Class DeviceClientImpl
java.lang.Object
com.eqixiac.equinix.core.client.ClientBase
com.eqixiac.equinix.core.client.ResourceClientBase<Device, DeviceJson>
com.eqixiac.equinix.networkedge.client.internal.implementation.DeviceClientImpl
- All Implemented Interfaces:
Pageable<Device>, PageablePost<Device>, DeviceClient<Device>
public class DeviceClientImpl
extends ResourceClientBase<Device, DeviceJson>
implements DeviceClient<Device>
- Author:
- ianjones
-
Nested Class Summary
Nested classes/interfaces inherited from class ClientBase
ClientBase.EquinixRequestBuilderModifier and TypeClassDescriptionprotected classFluent builder for constructingEquinixRequestinstances. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddACL(String uuid, DeviceACLRequest deviceACLRequest, String accountUcmId) create(DeviceCreatorJson deviceCreatorJson, Boolean draft) createRMA(String uuid, DeviceRMARequest deviceRMARequest) delete(String uuid, DeviceDeleteRequest request) getInterfaceStatistics(String uuid, String interfaceId, Instant startDateTime, Instant endDateTime) getPricing(String deviceUuid) list(RequestBuilder.Device requestBuilder) listDownloadableImages(String deviceType) listInterfaces(String uuid) listReloadHistory(String uuid) listUpgradeHistory(String uuid) postLicenseFile(MetroCode metroCode, String deviceTypeCode, LicenseType licenseType, String fileContents) POST /ne/v1/devices/licenseFiles.postLicenseFile(String deviceUuid, String fileContents) POST /ne/v1/devices/licenseFiles/{uuid},multipart/form-dataas above.requestImageDownload(String deviceType, String version) restore.softReboot(String uuid) update(String uuid, DeviceUpdaterJson deviceUpdaterJson) updateACL(String uuid, DeviceACLRequest deviceACLRequest, String accountUcmId) updateAdditionalBandwidth(String uuid, Integer additionalBandwidth) updateLicenseToken(String deviceUuid, String licenseToken) PUT /ne/v1/devices/{uuid}/licenseTokens, answered with202 Accepted.protected Devicewrap(DeviceJson json) Wraps a JSON model into its public model type, binding this client so the returned object can refresh/delete/page itself.Methods inherited from class ResourceClientBase
createOne, deleteOne, deleteOne, deleteOneByUuid, dryRunCreate, dryRunCreate, dryRunPatch, dryRunUpdate, getOne, getOne, getOneByUuid, listPage, listPage, listPage, listPagePath, nextPage, nextPage, patchOne, patchOne, postOne, postOne, postOne, searchPage, searchPage, searchPageQueryPaginated, searchPageQueryPaginated, updateOne, updateOne, updateOneByUuidModifier and TypeMethodDescriptionprotected DeviceJsoncreate(body)via the derivedCreate<Singular>endpoint name.protected DeviceJsonprotected DeviceJsonprotected DeviceJsondeleteOneByUuid(String uuid) delete(uuid)via the derivedDelete<Singular>endpoint name.protected DeviceJsondryRunCreate(String serviceEndpoint, Object body) protected DeviceJsondryRunCreate(String serviceEndpoint, Object body, com.fasterxml.jackson.databind.ser.FilterProvider filters) protected DeviceJsondryRunPatch(String serviceEndpoint, String uuid, List<PatchOperation> operations) Dry-run variant ofResourceClientBase.patchOne(String, String, List): sends the identical RFC 6902 JSON Patch request (sameapplication/json-patch+jsoncontent type) plus thedryRun=truequery parameter - per the spec, an "option to verify that API calls will succeed".protected DeviceJsondryRunUpdate(String serviceEndpoint, String uuid, Object body) Dry-run variant ofResourceClientBase.updateOne(String, String, Object): sends the identical update request (same defaultapplication/jsoncontent type) plus thedryRun=truequery parameter - per the spec, an "option to verify that API calls will succeed".protected DeviceJsonprotected DeviceJsonprotected DeviceJsongetOneByUuid(String uuid) get(uuid)via the derivedGet<Singular>endpoint name.protected Page<DeviceJson> listPage()list()via the derivedList<Plural>endpoint name.protected Page<DeviceJson> protected Page<DeviceJson> protected Page<DeviceJson> listPagePath(String serviceEndpoint, Map<String, String> pathParams) nextPage(PaginatedPostRequest<Device> equinixRequest) Fetches the next page for the given POST-search request (its body's pagination has already been advanced by the paging pipeline).nextPage(PaginatedRequest<Device> equinixRequest) protected DeviceJsonpatchOne(String serviceEndpoint, String uuid, List<PatchOperation> operations) PATCH a resource by uuid with an RFC 6902 JSON Patch operations array, sent with content-typeapplication/json-patch+json.protected DeviceJsonprotected DeviceJsonprotected DeviceJsonpostOne(String serviceEndpoint, Object body, com.fasterxml.jackson.databind.ser.FilterProvider filters) protected DeviceJsonprotected Page<DeviceJson> searchPage(Object filterSortBody) search(body)via the derivedSearch<Plural>endpoint name.protected Page<DeviceJson> searchPage(String serviceEndpoint, Object filterSortBody) protected Page<DeviceJson> searchPageQueryPaginated(String serviceEndpoint, Object filterBody) POST search whose pagination travels asoffset/limitquery parameters (per the endpoint's spec) rather than inside the body - e.g. assets v1 and the EIA services/prices searches.protected Page<DeviceJson> searchPageQueryPaginated(String serviceEndpoint, Map<String, List<String>> queryParams, Object filterBody) Variant ofResourceClientBase.searchPageQueryPaginated(String, Object)carrying additional query parameters (e.g.protected DeviceJsonprotected DeviceJsonprotected DeviceJsonupdateOneByUuid(String uuid, Object body) update(uuid, body)via the derivedUpdate<Singular>endpoint name.Methods inherited from class ClientBase
booleanOp, buildRequest, buildRequest, buildRequestWithPathParams, buildRequestWithQueryParams, bytesOp, createReturningLocationUuid, getAs, getAs, getConfigClient, invoke, listAs, mapOp, newRequest, postAs, postForType, postForType, postForType, postListAs, stringOp, voidOpModifier and TypeMethodDescriptionprotected booleanbooleanOp(String serviceEndpoint, RequestType requestType, Map<String, String> pathParams, Map<String, List<String>> queryParams, Object body) protected <T> EquinixRequest<T> buildRequest(String serviceEndpoint, RequestType requestType, Class<?> jsonClass) protected <T> EquinixRequest<T> buildRequest(String serviceEndpoint, RequestType requestType, Map<String, String> pathParams, Map<String, List<String>> queryParams, Class<?> jsonClass) protected <T> EquinixRequest<T> buildRequestWithPathParams(String serviceEndpoint, RequestType requestType, Map<String, String> pathParams, Class<?> jsonClass) protected <T> EquinixRequest<T> buildRequestWithQueryParams(String serviceEndpoint, RequestType requestType, Map<String, List<String>> queryParams, Class<?> jsonClass) protected byte[]bytesOp(String serviceEndpoint, Map<String, String> pathParams, Map<String, List<String>> queryParams) protected StringcreateReturningLocationUuid(String serviceEndpoint, Map<String, String> pathParams, Map<String, List<String>> queryParams, Object body) POST a body, then return the created resource's uuid parsed from the responseLocationheader (for endpoints that return201 Location: .../{uuid}rather than a body).protected <R> Rprotected <R> RgetAs(String serviceEndpoint, Map<String, String> pathParams, Map<String, List<String>> queryParams, Class<R> responseType) protected Configprotected <T> EquinixResponse<T> invoke(EquinixRequest<T> equinixRequest) protected <R> List<R> listAs(String serviceEndpoint, Map<String, String> pathParams, Map<String, List<String>> queryParams, Class<R> elementType) mapOp(String serviceEndpoint, RequestType requestType, Map<String, String> pathParams, Map<String, List<String>> queryParams, Object body) protected ClientBase.EquinixRequestBuildernewRequest(String serviceEndpoint) Creates a fluent request builder for the given service endpoint.protected <R> Rprotected <R> RpostForType(String serviceEndpoint, Object body, com.fasterxml.jackson.core.type.TypeReference<?> typeReference) protected <R> RpostForType(String serviceEndpoint, Map<String, String> pathParams, Object body, com.fasterxml.jackson.core.type.TypeReference<?> typeReference) protected <R> RpostForType(String serviceEndpoint, Map<String, String> pathParams, Map<String, List<String>> queryParams, Object body, com.fasterxml.jackson.core.type.TypeReference<?> typeReference) protected <R> List<R> postListAs(String serviceEndpoint, Object body, Class<R> elementType) protected StringstringOp(String serviceEndpoint, RequestType requestType, Map<String, String> pathParams, Map<String, List<String>> queryParams, Object body) protected voidvoidOp(String serviceEndpoint, RequestType requestType, Map<String, String> pathParams, Map<String, List<String>> queryParams, Object body) Execute a request for its side effect only - the response body is validated (throws on API error) and discarded.
-
Constructor Details
-
DeviceClientImpl
-
-
Method Details
-
wrap
Description copied from class:ResourceClientBaseWraps a JSON model into its public model type, binding this client so the returned object can refresh/delete/page itself.- Specified by:
wrapin classResourceClientBase<Device, DeviceJson>- Parameters:
json- the deserialized JSON model- Returns:
- the public model wrapper
-
list
- Specified by:
listin interfaceDeviceClient<Device>
-
getByUuid
- Specified by:
getByUuidin interfaceDeviceClient<Device>
-
listInterfaces
- Specified by:
listInterfacesin interfaceDeviceClient<Device>
-
getAllowedInterfaces
public AllowedInterfaceResponse getAllowedInterfaces(String deviceType, Map<String, List<String>> queryParams) - Specified by:
getAllowedInterfacesin interfaceDeviceClient<Device>- Parameters:
deviceType- the device type code.queryParams- the configuration query parameters.
-
listReloadHistory
- Specified by:
listReloadHistoryin interfaceDeviceClient<Device>- Parameters:
uuid- the device uuid.
-
listUpgradeHistory
- Specified by:
listUpgradeHistoryin interfaceDeviceClient<Device>- Parameters:
uuid- the device uuid.
-
getInterfaceStatistics
public InterfaceStats getInterfaceStatistics(String uuid, String interfaceId, Instant startDateTime, Instant endDateTime) - Specified by:
getInterfaceStatisticsin interfaceDeviceClient<Device>- Parameters:
uuid- the device uuid.interfaceId- the interface id.startDateTime- the start of the stats window (ISO-8601), ornull.endDateTime- the end of the stats window (ISO-8601), ornull.
-
listDownloadableImages
- Specified by:
listDownloadableImagesin interfaceDeviceClient<Device>- Parameters:
deviceType- the device type code.
-
requestImageDownload
- Specified by:
requestImageDownloadin interfaceDeviceClient<Device>- Parameters:
deviceType- the device type code.version- the device version.
-
restore
Description copied from interface:DeviceClientrestore. Restores the backup identified by
backupUuid. Per the spec the backup name is required in the request body.- Specified by:
restorein interfaceDeviceClient<Device>- Parameters:
backupUuid- the unique identifier of the backup to restore.backupName- the name of the backup (DeviceBackupUpdateRequest.name).
-
updateAdditionalBandwidth
- Specified by:
updateAdditionalBandwidthin interfaceDeviceClient<Device>
-
softReboot
- Specified by:
softRebootin interfaceDeviceClient<Device>
-
createRMA
- Specified by:
createRMAin interfaceDeviceClient<Device>
-
getACL
- Specified by:
getACLin interfaceDeviceClient<Device>
-
addACL
- Specified by:
addACLin interfaceDeviceClient<Device>
-
updateACL
- Specified by:
updateACLin interfaceDeviceClient<Device>
-
ping
- Specified by:
pingin interfaceDeviceClient<Device>
-
postLicenseFile
public String postLicenseFile(MetroCode metroCode, String deviceTypeCode, LicenseType licenseType, String fileContents) POST /ne/v1/devices/licenseFiles. The spec accepts onlymultipart/form-datawith a binaryfilepart (LicenseUploadRequest);metroCode,deviceTypeCodeandlicenseTypeare required query parameters.- Specified by:
postLicenseFilein interfaceDeviceClient<Device>
-
postLicenseFile
POST /ne/v1/devices/licenseFiles/{uuid},multipart/form-dataas above.- Specified by:
postLicenseFilein interfaceDeviceClient<Device>
-
updateLicenseToken
PUT /ne/v1/devices/{uuid}/licenseTokens, answered with202 Accepted. Returns thefileIdwhen the service includes one, ornullfor an empty 202 body; the update has been accepted either way.- Specified by:
updateLicenseTokenin interfaceDeviceClient<Device>
-
getPricing
-
create
- Specified by:
createin interfaceDeviceClient<Device>
-
update
- Specified by:
updatein interfaceDeviceClient<Device>
-
delete
- Specified by:
deletein interfaceDeviceClient<Device>
-
delete
- Specified by:
deletein interfaceDeviceClient<Device>
-
refresh
- Specified by:
refreshin interfaceDeviceClient<Device>
-