Class LifecycleHook

java.lang.Object
com.azure.resourcemanager.compute.models.LifecycleHook
All Implemented Interfaces:
com.azure.json.JsonSerializable<LifecycleHook>

public final class LifecycleHook extends Object implements com.azure.json.JsonSerializable<LifecycleHook>
Describes a lifecycle hook.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates an instance of LifecycleHook class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Get the defaultAction property: Specifies the action that will be applied to a target resource in the virtual machine scale set lifecycle hook event if the platform does not receive a response from the customer for the target resource before waitUntil.
    fromJson(com.azure.json.JsonReader jsonReader)
    Reads an instance of LifecycleHook from the JsonReader.
    com.azure.json.JsonWriter
    toJson(com.azure.json.JsonWriter jsonWriter)
    Get the type property: Specifies the type of the lifecycle hook.
    void
    Validates the instance.
    Get the waitDuration property: Specifies the time duration a virtual machine scale set lifecycle hook event sent to the customer waits for a response from the customer.
    Set the defaultAction property: Specifies the action that will be applied to a target resource in the virtual machine scale set lifecycle hook event if the platform does not receive a response from the customer for the target resource before waitUntil.
    Set the type property: Specifies the type of the lifecycle hook.
    withWaitDuration(Duration waitDuration)
    Set the waitDuration property: Specifies the time duration a virtual machine scale set lifecycle hook event sent to the customer waits for a response from the customer.

    Methods inherited from class Object

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

    Methods inherited from interface com.azure.json.JsonSerializable

    toJson, toJson, toJsonBytes, toJsonString
  • Constructor Details

    • LifecycleHook

      public LifecycleHook()
      Creates an instance of LifecycleHook class.
  • Method Details

    • type

      Get the type property: Specifies the type of the lifecycle hook.
      Returns:
      the type value.
    • withType

      Set the type property: Specifies the type of the lifecycle hook.
      Parameters:
      type - the type value to set.
      Returns:
      the LifecycleHook object itself.
    • waitDuration

      public Duration waitDuration()
      Get the waitDuration property: Specifies the time duration a virtual machine scale set lifecycle hook event sent to the customer waits for a response from the customer. It should be in ISO 8601 format.
      Returns:
      the waitDuration value.
    • withWaitDuration

      public LifecycleHook withWaitDuration(Duration waitDuration)
      Set the waitDuration property: Specifies the time duration a virtual machine scale set lifecycle hook event sent to the customer waits for a response from the customer. It should be in ISO 8601 format.
      Parameters:
      waitDuration - the waitDuration value to set.
      Returns:
      the LifecycleHook object itself.
    • defaultAction

      public LifecycleHookAction defaultAction()
      Get the defaultAction property: Specifies the action that will be applied to a target resource in the virtual machine scale set lifecycle hook event if the platform does not receive a response from the customer for the target resource before waitUntil.
      Returns:
      the defaultAction value.
    • withDefaultAction

      public LifecycleHook withDefaultAction(LifecycleHookAction defaultAction)
      Set the defaultAction property: Specifies the action that will be applied to a target resource in the virtual machine scale set lifecycle hook event if the platform does not receive a response from the customer for the target resource before waitUntil.
      Parameters:
      defaultAction - the defaultAction value to set.
      Returns:
      the LifecycleHook object itself.
    • validate

      public void validate()
      Validates the instance.
      Throws:
      IllegalArgumentException - thrown if the instance is not valid.
    • toJson

      public com.azure.json.JsonWriter toJson(com.azure.json.JsonWriter jsonWriter) throws IOException
      Specified by:
      toJson in interface com.azure.json.JsonSerializable<LifecycleHook>
      Throws:
      IOException
    • fromJson

      public static LifecycleHook fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of LifecycleHook from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of LifecycleHook if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
      Throws:
      IOException - If an error occurs while reading the LifecycleHook.