Class MaintenanceOptions

java.lang.Object
io.vertx.ext.consul.MaintenanceOptions

public class MaintenanceOptions extends Object
Options used to placing a given service into "maintenance mode". During maintenance mode, the service will be marked as unavailable and will not be present in DNS or API queries. Maintenance mode is persistent and will be automatically restored on agent restart.
Author:
Ruslan Sennov
  • Constructor Details

    • MaintenanceOptions

      public MaintenanceOptions()
      Default constructor
    • MaintenanceOptions

      public MaintenanceOptions(MaintenanceOptions options)
      Copy constructor
      Parameters:
      options - the one to copy
    • MaintenanceOptions

      public MaintenanceOptions(JsonObject options)
      Constructor from JSON
      Parameters:
      options - the JSON
  • Method Details

    • toJson

      public JsonObject toJson()
      Convert to JSON
      Returns:
      the JSON
    • setId

      public MaintenanceOptions setId(String id)
      Set the ID of service. This field is required.
      Parameters:
      id - the ID of service
      Returns:
      reference to this, for fluency
    • getId

      public String getId()
      Get the ID of service
      Returns:
      the ID of service
    • setEnable

      public MaintenanceOptions setEnable(boolean enable)
      Set maintenance mode to enabled: true to enter maintenance mode or false to resume normal operation. This flag is required.
      Parameters:
      enable - maintenance mode
      Returns:
      reference to this, for fluency
    • isEnable

      public boolean isEnable()
      Get maintenance mode
      Returns:
      the boolean if maintenance mode enabled
    • setReason

      public MaintenanceOptions setReason(String reason)
      Set the reason message. If provided, its value should be a text string explaining the reason for placing the service into maintenance mode. This is simply to aid human operators.
      Parameters:
      reason - the reason message
      Returns:
      reference to this, for fluency
    • getReason

      public String getReason()
      Get the reason message
      Returns:
      the reason message