Class StreamAssetClientImpl
java.lang.Object
com.eqixiac.equinix.core.client.ClientBase
com.eqixiac.equinix.core.client.ResourceClientBase<StreamAsset, StreamAssetJson>
com.eqixiac.equinix.fabric.client.internal.implementation.StreamAssetClientImpl
- All Implemented Interfaces:
Pageable<StreamAsset>, PageablePost<StreamAsset>, StreamAssetClient<StreamAsset>
public class StreamAssetClientImpl
extends ResourceClientBase<StreamAsset, StreamAssetJson>
implements StreamAssetClient<StreamAsset>
Internal client for Fabric Stream Assets (attach / detach / get an asset to/from a stream). The
endpoints are keyed by stream id, asset type and asset id, with no list operation, so this client
reads/writes the
StreamAssetJson singleton directly.- 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 TypeMethodDescriptiondeleteDevice(String streamId, String deviceId) DELETE /fabric/v4/streams/{streamId}/devices/{deviceId}.GET /fabric/v4/streams/{streamId}/devices/{deviceId}.search(FilterPropertyList filter, SortPropertyList sort) POST /fabric/v4/streamAssets/search.updateDevice(String streamId, String deviceId, StreamDevicePutRequest request) PUT /fabric/v4/streams/{streamId}/devices/{deviceId}.protected StreamAssetwrap(StreamAssetJson 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 StreamAssetJsoncreate(body)via the derivedCreate<Singular>endpoint name.protected StreamAssetJsonprotected StreamAssetJsonprotected StreamAssetJsondeleteOneByUuid(String uuid) delete(uuid)via the derivedDelete<Singular>endpoint name.protected StreamAssetJsondryRunCreate(String serviceEndpoint, Object body) protected StreamAssetJsondryRunCreate(String serviceEndpoint, Object body, com.fasterxml.jackson.databind.ser.FilterProvider filters) protected StreamAssetJsondryRunPatch(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 StreamAssetJsondryRunUpdate(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 StreamAssetJsonprotected StreamAssetJsonprotected StreamAssetJsongetOneByUuid(String uuid) get(uuid)via the derivedGet<Singular>endpoint name.protected Page<StreamAssetJson> listPage()list()via the derivedList<Plural>endpoint name.protected Page<StreamAssetJson> protected Page<StreamAssetJson> protected Page<StreamAssetJson> listPagePath(String serviceEndpoint, Map<String, String> pathParams) nextPage(PaginatedPostRequest<StreamAsset> 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<StreamAsset> equinixRequest) protected StreamAssetJsonpatchOne(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 StreamAssetJsonprotected StreamAssetJsonprotected StreamAssetJsonpostOne(String serviceEndpoint, Object body, com.fasterxml.jackson.databind.ser.FilterProvider filters) protected StreamAssetJsonprotected Page<StreamAssetJson> searchPage(Object filterSortBody) search(body)via the derivedSearch<Plural>endpoint name.protected Page<StreamAssetJson> searchPage(String serviceEndpoint, Object filterSortBody) protected Page<StreamAssetJson> 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<StreamAssetJson> searchPageQueryPaginated(String serviceEndpoint, Map<String, List<String>> queryParams, Object filterBody) Variant ofResourceClientBase.searchPageQueryPaginated(String, Object)carrying additional query parameters (e.g.protected StreamAssetJsonprotected StreamAssetJsonprotected StreamAssetJsonupdateOneByUuid(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
-
StreamAssetClientImpl
-
-
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<StreamAsset, StreamAssetJson>- Parameters:
json- the deserialized JSON model- Returns:
- the public model wrapper
-
get
- Specified by:
getin interfaceStreamAssetClient<StreamAsset>
-
attach
public StreamAssetJson attach(String streamId, String asset, String assetId, Boolean metricsEnabled) - Specified by:
attachin interfaceStreamAssetClient<StreamAsset>
-
detach
- Specified by:
detachin interfaceStreamAssetClient<StreamAsset>
-
search
Description copied from interface:StreamAssetClientPOST /fabric/v4/streamAssets/search.- Specified by:
searchin interfaceStreamAssetClient<StreamAsset>- Parameters:
filter- the filter, ornullsort- the sort, ornull- Returns:
- the first page
-
getDevice
Description copied from interface:StreamAssetClientGET /fabric/v4/streams/{streamId}/devices/{deviceId}.- Specified by:
getDevicein interfaceStreamAssetClient<StreamAsset>- Parameters:
streamId- the stream uuiddeviceId- the Network Edge device uuid- Returns:
- the device asset
-
updateDevice
public StreamAssetJson updateDevice(String streamId, String deviceId, StreamDevicePutRequest request) Description copied from interface:StreamAssetClientPUT /fabric/v4/streams/{streamId}/devices/{deviceId}.- Specified by:
updateDevicein interfaceStreamAssetClient<StreamAsset>- Parameters:
streamId- the stream uuiddeviceId- the Network Edge device uuidrequest- the desired interfaces- Returns:
- the device asset (202)
-
deleteDevice
Description copied from interface:StreamAssetClientDELETE /fabric/v4/streams/{streamId}/devices/{deviceId}.- Specified by:
deleteDevicein interfaceStreamAssetClient<StreamAsset>- Parameters:
streamId- the stream uuiddeviceId- the Network Edge device uuid- Returns:
- the device asset (202), or
nullon an empty body
-