io.vertx.ext.consul

## 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 Summary

    Constructors
    Constructor and Description
    `MaintenanceOptions()` Default constructor
    `MaintenanceOptions(JsonObject options)` Constructor from JSON
    `MaintenanceOptions(MaintenanceOptions options)` Copy constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getId()` Get the ID of service
    `String` | `getReason()` Get the reason message
    `boolean` | `isEnable()` Get maintenance mode
    `MaintenanceOptions` | `setEnable(boolean enable)` Set maintenance mode to enabled: `true` to enter maintenance mode or `false` to resume normal operation.
    `MaintenanceOptions` | `setId(String id)` Set the ID of service.
    `MaintenanceOptions` | `setReason(String reason)` Set the reason message.
    `JsonObject` | `toJson()` Convert to JSON

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### 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 Detail

    - #### 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

Copyright © 2021 Eclipse. All rights reserved.