Class ConnectionClientImpl
java.lang.Object
com.eqixiac.equinix.core.client.ClientBase
com.eqixiac.equinix.core.client.ResourceClientBase<Connection, ConnectionJson>
com.eqixiac.equinix.fabric.client.internal.implementation.ConnectionClientImpl
- All Implemented Interfaces:
Pageable<Connection>, PageablePost<Connection>, ConnectionClient<Connection>
public class ConnectionClientImpl
extends ResourceClientBase<Connection, ConnectionJson>
implements ConnectionClient<Connection>
Internal client for Fabric Connections. Standard CRUD + paging come from
ResourceClientBase;
the Connection-specific operations (dry-run, actions, statistics) remain bespoke below.- 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 TypeMethodDescriptionattachRouteAggregation(String connectionId, String routeAggregationId) attachRouteFilter(String connectionId, String routeFilterId, Direction direction) create(ConnectionCreatorJson connectionCreatorJson) detachRouteAggregation(String connectionId, String routeAggregationId) detachRouteFilter(String connectionId, String routeFilterId) dryRunCreate(ConnectionCreatorJson connectionCreatorJson) dryRunUpdate(String uuid, List<PatchOperation> operations) Dry-run variant ofConnectionClient.update(String, List): sends the same JSON Patch toPATCH /fabric/v4/connections/{uuid}withdryRun=true- per the Fabric v4 spec, an "option to verify that API calls will succeed".getRouteAggregation(String connectionId, String routeAggregationId) getRouteAggregations(String connectionId) getRouteFilter(String connectionId, String routeFilterId) getRouteFilters(String connectionId) performOperation(String uuid, ConnectionOperationType connectionOperationType, String description, Object bodyObject) search(FilterPropertyList filter, SortPropertyList sort) update(String uuid, List<PatchOperation> operations) validate(FilterPropertyList filter) Validates connections against the supplied filter (auth key or VLAN availability).protected Connectionwrap(ConnectionJson 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 ConnectionJsoncreate(body)via the derivedCreate<Singular>endpoint name.protected ConnectionJsonprotected ConnectionJsonprotected ConnectionJsondeleteOneByUuid(String uuid) delete(uuid)via the derivedDelete<Singular>endpoint name.protected ConnectionJsondryRunCreate(String serviceEndpoint, Object body) protected ConnectionJsondryRunCreate(String serviceEndpoint, Object body, com.fasterxml.jackson.databind.ser.FilterProvider filters) protected ConnectionJsondryRunPatch(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 ConnectionJsondryRunUpdate(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 ConnectionJsonprotected ConnectionJsonprotected ConnectionJsongetOneByUuid(String uuid) get(uuid)via the derivedGet<Singular>endpoint name.protected Page<ConnectionJson> listPage()list()via the derivedList<Plural>endpoint name.protected Page<ConnectionJson> protected Page<ConnectionJson> protected Page<ConnectionJson> listPagePath(String serviceEndpoint, Map<String, String> pathParams) nextPage(PaginatedPostRequest<Connection> 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<Connection> equinixRequest) protected ConnectionJsonpatchOne(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 ConnectionJsonprotected ConnectionJsonprotected ConnectionJsonpostOne(String serviceEndpoint, Object body, com.fasterxml.jackson.databind.ser.FilterProvider filters) protected ConnectionJsonprotected Page<ConnectionJson> searchPage(Object filterSortBody) search(body)via the derivedSearch<Plural>endpoint name.protected Page<ConnectionJson> searchPage(String serviceEndpoint, Object filterSortBody) protected Page<ConnectionJson> 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<ConnectionJson> searchPageQueryPaginated(String serviceEndpoint, Map<String, List<String>> queryParams, Object filterBody) Variant ofResourceClientBase.searchPageQueryPaginated(String, Object)carrying additional query parameters (e.g.protected ConnectionJsonprotected ConnectionJsonprotected ConnectionJsonupdateOneByUuid(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
-
ConnectionClientImpl
-
-
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<Connection, ConnectionJson>- Parameters:
json- the deserialized JSON model- Returns:
- the public model wrapper
-
search
- Specified by:
searchin interfaceConnectionClient<Connection>
-
validate
Description copied from interface:ConnectionClientValidates connections against the supplied filter (auth key or VLAN availability).
- Specified by:
validatein interfaceConnectionClient<Connection>- Returns:
- a
ListofValidateConnectionResultobjects.
-
getByUuid
- Specified by:
getByUuidin interfaceConnectionClient<Connection>
-
create
- Specified by:
createin interfaceConnectionClient<Connection>
-
delete
-
refresh
-
dryRunCreate
- Specified by:
dryRunCreatein interfaceConnectionClient<Connection>
-
performOperation
public ConnectionActionJson performOperation(String uuid, ConnectionOperationType connectionOperationType, String description, Object bodyObject) - Specified by:
performOperationin interfaceConnectionClient<Connection>
-
update
- Specified by:
updatein interfaceConnectionClient<Connection>
-
dryRunUpdate
Description copied from interface:ConnectionClientDry-run variant ofConnectionClient.update(String, List): sends the same JSON Patch toPATCH /fabric/v4/connections/{uuid}withdryRun=true- per the Fabric v4 spec, an "option to verify that API calls will succeed". Nothing is persisted; the API responds200(the real update responds202) with a simulation of the post-update connection.- Specified by:
dryRunUpdatein interfaceConnectionClient<Connection>
-
getRouteAggregations
- Specified by:
getRouteAggregationsin interfaceConnectionClient<Connection>
-
getRouteAggregation
public RouteAggregationAttachment getRouteAggregation(String connectionId, String routeAggregationId) - Specified by:
getRouteAggregationin interfaceConnectionClient<Connection>
-
attachRouteAggregation
public RouteAggregationAttachment attachRouteAggregation(String connectionId, String routeAggregationId) - Specified by:
attachRouteAggregationin interfaceConnectionClient<Connection>
-
detachRouteAggregation
- Specified by:
detachRouteAggregationin interfaceConnectionClient<Connection>
-
getRouteFilters
- Specified by:
getRouteFiltersin interfaceConnectionClient<Connection>
-
getRouteFilter
- Specified by:
getRouteFilterin interfaceConnectionClient<Connection>
-
attachRouteFilter
public RouteFilterAttachment attachRouteFilter(String connectionId, String routeFilterId, Direction direction) - Specified by:
attachRouteFilterin interfaceConnectionClient<Connection>
-
detachRouteFilter
- Specified by:
detachRouteFilterin interfaceConnectionClient<Connection>
-