Class PortClientImpl
java.lang.Object
com.eqixiac.equinix.core.client.ClientBase
com.eqixiac.equinix.core.client.ResourceClientBase<Port,PortJson>
com.eqixiac.equinix.fabric.client.internal.implementation.PortClientImpl
- All Implemented Interfaces:
Pageable<Port>, PageablePost<Port>, PortClient<Port>
Internal client for Fabric Ports. Plumbing/paging provided by
ResourceClientBase.- 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 TypeMethodDescriptionaddToLag(String portId, List<PhysicalPort> physicalPorts) Adds physical ports to a virtual port's LAG (POST /fabric/v4/ports/{portId}/physicalPorts/bulk).create(PortCreatorJson body) Creates a single port (POST /fabric/v4/ports).Deletes a port by uuid (DELETE /fabric/v4/ports/{uuid}).dryRunCreate(PortCreatorJson body) POST /fabric/v4/ports?dryRun=true(spec: "option to verify that API calls will succeed") via the sharedResourceClientBase.dryRunCreatehelper.dryRunDelete(String uuid) DELETE /fabric/v4/ports/{uuid}?dryRun=true(spec: "option to verify that API calls will succeed").dryRunUpdate(String uuid, List<PatchOperation> operations) PATCH /fabric/v4/ports/{uuid}?dryRun=true(spec: "option to verify that API calls will succeed").list()search(FilterPropertyList filter, SortPropertyList sort) update(String uuid, List<PatchOperation> operations) Updates a port by uuid with a JSON Patch operations array (PATCH /fabric/v4/ports/{uuid}).protected PortWraps 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 PortJsoncreate(body)via the derivedCreate<Singular>endpoint name.protected PortJsonprotected PortJsonprotected PortJsondeleteOneByUuid(String uuid) delete(uuid)via the derivedDelete<Singular>endpoint name.protected PortJsondryRunCreate(String serviceEndpoint, Object body) protected PortJsondryRunCreate(String serviceEndpoint, Object body, com.fasterxml.jackson.databind.ser.FilterProvider filters) protected PortJsondryRunPatch(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 PortJsondryRunUpdate(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 PortJsonprotected PortJsonprotected PortJsongetOneByUuid(String uuid) get(uuid)via the derivedGet<Singular>endpoint name.listPage()list()via the derivedList<Plural>endpoint name.listPagePath(String serviceEndpoint, Map<String, String> pathParams) nextPage(PaginatedPostRequest<Port> 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<Port> equinixRequest) protected PortJsonpatchOne(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 PortJsonprotected PortJsonprotected PortJsonpostOne(String serviceEndpoint, Object body, com.fasterxml.jackson.databind.ser.FilterProvider filters) protected PortJsonsearchPage(Object filterSortBody) search(body)via the derivedSearch<Plural>endpoint name.searchPage(String serviceEndpoint, Object filterSortBody) 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.searchPageQueryPaginated(String serviceEndpoint, Map<String, List<String>> queryParams, Object filterBody) Variant ofResourceClientBase.searchPageQueryPaginated(String, Object)carrying additional query parameters (e.g.protected PortJsonprotected PortJsonprotected PortJsonupdateOneByUuid(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
-
PortClientImpl
-
-
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<Port,PortJson> - Parameters:
json- the deserialized JSON model- Returns:
- the public model wrapper
-
list
- Specified by:
listin interfacePortClient<Port>
-
search
- Specified by:
searchin interfacePortClient<Port>
-
getByUuid
- Specified by:
getByUuidin interfacePortClient<Port>
-
getVlans
-
refresh
- Specified by:
refreshin interfacePortClient<Port>
-
create
Description copied from interface:PortClientCreates a single port (POST /fabric/v4/ports).- Specified by:
createin interfacePortClient<Port>- Parameters:
body- the typed create request- Returns:
- the created port
-
dryRunCreate
POST /fabric/v4/ports?dryRun=true(spec: "option to verify that API calls will succeed") via the sharedResourceClientBase.dryRunCreatehelper. The 200 body is the validated port order echoed back - no uuid/name/state - versus the real create's 202.- Specified by:
dryRunCreatein interfacePortClient<Port>- Parameters:
body- the typed create request to validate- Returns:
- the validated port order echoed back by the server
-
delete
Description copied from interface:PortClientDeletes a port by uuid (DELETE /fabric/v4/ports/{uuid}).- Specified by:
deletein interfacePortClient<Port>- Parameters:
uuid- the unique identifier of the port- Returns:
- the deleted port as returned by the server
-
dryRunDelete
DELETE /fabric/v4/ports/{uuid}?dryRun=true(spec: "option to verify that API calls will succeed"). Nothing is deleted; the 200 body is the existing port entity that WOULD be deleted, deserialized exactly like the real delete's response.- Specified by:
dryRunDeletein interfacePortClient<Port>- Parameters:
uuid- the unique identifier of the port- Returns:
- the port that would be deleted
-
update
Description copied from interface:PortClientUpdates a port by uuid with a JSON Patch operations array (PATCH /fabric/v4/ports/{uuid}).- Specified by:
updatein interfacePortClient<Port>- Parameters:
uuid- the unique identifier of the portoperations- the op/path/value change operations- Returns:
- the updated port
-
dryRunUpdate
PATCH /fabric/v4/ports/{uuid}?dryRun=true(spec: "option to verify that API calls will succeed"). Nothing is changed - and the dry-run 200 schema isAllPortsResponse, a paginated envelope{pagination, data:[Port]}carrying the simulated updated port indata[0](spec examplePortUpdateDryRunResponse). That is a DIFFERENT wire shape from the real update's barePort, so this method deserializesPage<PortJson>and unwrapsdata[0]instead of reusingupdateOne.- Specified by:
dryRunUpdatein interfacePortClient<Port>- Parameters:
uuid- the unique identifier of the portoperations- the op/path/value change operations to validate- Returns:
- the simulated updated port unwrapped from the envelope's
data[0]
-
addToLag
Description copied from interface:PortClientAdds physical ports to a virtual port's LAG (POST /fabric/v4/ports/{portId}/physicalPorts/bulk).- Specified by:
addToLagin interfacePortClient<Port>- Parameters:
portId- the virtual port uuidphysicalPorts- the physical ports to add- Returns:
- the full set of physical ports backing the virtual port after the addition
-