Class PortClientImpl

All Implemented Interfaces:
Pageable<Port>, PageablePost<Port>, PortClient<Port>

public class PortClientImpl extends ResourceClientBase<Port,PortJson> implements PortClient<Port>
Internal client for Fabric Ports. Plumbing/paging provided by ResourceClientBase.
Author:
ianjones
  • Constructor Details

  • Method Details

    • wrap

      protected Port wrap(PortJson json)
      Description copied from class: ResourceClientBase
      Wraps a JSON model into its public model type, binding this client so the returned object can refresh/delete/page itself.
      Specified by:
      wrap in class ResourceClientBase<Port,PortJson>
      Parameters:
      json - the deserialized JSON model
      Returns:
      the public model wrapper
    • list

      public Page<PortJson> list()
      Specified by:
      list in interface PortClient<Port>
    • search

      public Page<PortJson> search(FilterPropertyList filter, SortPropertyList sort)
      Specified by:
      search in interface PortClient<Port>
    • getByUuid

      public PortJson getByUuid(String uuid)
      Specified by:
      getByUuid in interface PortClient<Port>
    • getVlans

      public List<PortVlan> getVlans(String portUuid)
      Specified by:
      getVlans in interface PortClient<Port>
    • refresh

      public PortJson refresh(String uuid)
      Specified by:
      refresh in interface PortClient<Port>
    • create

      public PortJson create(PortCreatorJson body)
      Description copied from interface: PortClient
      Creates a single port (POST /fabric/v4/ports).
      Specified by:
      create in interface PortClient<Port>
      Parameters:
      body - the typed create request
      Returns:
      the created port
    • dryRunCreate

      public PortJson dryRunCreate(PortCreatorJson body)
      POST /fabric/v4/ports?dryRun=true (spec: "option to verify that API calls will succeed") via the shared ResourceClientBase.dryRunCreate helper. The 200 body is the validated port order echoed back - no uuid/name/state - versus the real create's 202.
      Specified by:
      dryRunCreate in interface PortClient<Port>
      Parameters:
      body - the typed create request to validate
      Returns:
      the validated port order echoed back by the server
    • delete

      public PortJson delete(String uuid)
      Description copied from interface: PortClient
      Deletes a port by uuid (DELETE /fabric/v4/ports/{uuid}).
      Specified by:
      delete in interface PortClient<Port>
      Parameters:
      uuid - the unique identifier of the port
      Returns:
      the deleted port as returned by the server
    • dryRunDelete

      public PortJson dryRunDelete(String uuid)
      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:
      dryRunDelete in interface PortClient<Port>
      Parameters:
      uuid - the unique identifier of the port
      Returns:
      the port that would be deleted
    • update

      public PortJson update(String uuid, List<PatchOperation> operations)
      Description copied from interface: PortClient
      Updates a port by uuid with a JSON Patch operations array (PATCH /fabric/v4/ports/{uuid}).
      Specified by:
      update in interface PortClient<Port>
      Parameters:
      uuid - the unique identifier of the port
      operations - the op/path/value change operations
      Returns:
      the updated port
    • dryRunUpdate

      public PortJson dryRunUpdate(String uuid, List<PatchOperation> operations)
      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 is AllPortsResponse, a paginated envelope {pagination, data:[Port]} carrying the simulated updated port in data[0] (spec example PortUpdateDryRunResponse). That is a DIFFERENT wire shape from the real update's bare Port, so this method deserializes Page<PortJson> and unwraps data[0] instead of reusing updateOne.
      Specified by:
      dryRunUpdate in interface PortClient<Port>
      Parameters:
      uuid - the unique identifier of the port
      operations - the op/path/value change operations to validate
      Returns:
      the simulated updated port unwrapped from the envelope's data[0]
    • addToLag

      public PhysicalPortsResponseJson addToLag(String portId, List<PhysicalPort> physicalPorts)
      Description copied from interface: PortClient
      Adds physical ports to a virtual port's LAG (POST /fabric/v4/ports/{portId}/physicalPorts/bulk).
      Specified by:
      addToLag in interface PortClient<Port>
      Parameters:
      portId - the virtual port uuid
      physicalPorts - the physical ports to add
      Returns:
      the full set of physical ports backing the virtual port after the addition