Class PortOperator.PortUpdater

java.lang.Object
com.eqixiac.equinix.fabric.model.json.creators.PortOperator.PortUpdater
Enclosing class:
PortOperator

public class PortOperator.PortUpdater extends Object
Fluent builder for updating an existing port. Each typed setter records a replace change operation; save() sends them as one PATCH (an op/path/value array, content-type application/json) and returns the refreshed model.
port.update().name("New-Name").save();
Author:
ianjones
  • Constructor Details

    • PortUpdater

      protected PortUpdater(String uuid)
  • Method Details

    • dryRun

      public PortOperator.PortUpdater dryRun()
      Marks this update as a validate-only dry run: save() sends PATCH /fabric/v4/ports/{uuid}?dryRun=true (spec: "option to verify that API calls will succeed"; boolean, default false). Nothing is changed on the port.

      Wire-shape caveat: unlike the real update's bare Port body, the dry-run 200 body is an AllPortsResponse paginated envelope ({pagination, data:[Port]}) carrying the simulated updated port in data[0] (spec example PortUpdateDryRunResponse); the SDK deserializes that envelope and unwraps data[0] into the Port returned by save().

      Returns:
      this updater
    • name

      public PortOperator.PortUpdater name(String name)
      Replaces the port name.
      Parameters:
      name - the new name
      Returns:
      this updater
    • encapsulation

      public PortOperator.PortUpdater encapsulation(EncapsulationType type, String tagProtocolId)
      Replaces the port encapsulation and its tag protocol identifier (TPID), as in the spec's PortUpdateEncapsulationAndTagprotocolIdRequest example: [{"op":"replace","path":"/encapsulation","value":{"type":"DOT1Q","tagProtocolId":"0x8100"}}].
      Parameters:
      type - the encapsulation type (DOT1Q, QINQ or UNTAGGED)
      tagProtocolId - the TPID as four hex digits with a 0x prefix, for example 0x8100 or 0x88A8; null to leave it out
      Returns:
      this updater
    • lagEnabled

      public PortOperator.PortUpdater lagEnabled(boolean lagEnabled)
      Enables or disables LAG on the port (/lagEnabled, spec example PortUpdateLagEnabledRequest).
      Parameters:
      lagEnabled - whether LAG is enabled
      Returns:
      this updater
    • patch

      public PortOperator.PortUpdater patch(PatchOperation operation)
      Adds an arbitrary change operation, for paths not covered by the typed setters above.
      Parameters:
      operation - the patch operation
      Returns:
      this updater
    • save

      public Port save()
      Applies the accumulated changes and returns the port refreshed from the server.
      Returns:
      the updated Port