Class InitContainerDefinition

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

public final class InitContainerDefinition extends Object implements com.azure.json.JsonSerializable<InitContainerDefinition>
The init container definition.
  • Constructor Details

    • InitContainerDefinition

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

    • name

      public String name()
      Get the name property: The name for the init container.
      Returns:
      the name value.
    • withName

      public InitContainerDefinition withName(String name)
      Set the name property: The name for the init container.
      Parameters:
      name - the name value to set.
      Returns:
      the InitContainerDefinition object itself.
    • image

      public String image()
      Get the image property: The image of the init container.
      Returns:
      the image value.
    • withImage

      public InitContainerDefinition withImage(String image)
      Set the image property: The image of the init container.
      Parameters:
      image - the image value to set.
      Returns:
      the InitContainerDefinition object itself.
    • command

      public List<String> command()
      Get the command property: The command to execute within the init container in exec form.
      Returns:
      the command value.
    • withCommand

      public InitContainerDefinition withCommand(List<String> command)
      Set the command property: The command to execute within the init container in exec form.
      Parameters:
      command - the command value to set.
      Returns:
      the InitContainerDefinition object itself.
    • environmentVariables

      public List<EnvironmentVariable> environmentVariables()
      Get the environmentVariables property: The environment variables to set in the init container.
      Returns:
      the environmentVariables value.
    • withEnvironmentVariables

      public InitContainerDefinition withEnvironmentVariables(List<EnvironmentVariable> environmentVariables)
      Set the environmentVariables property: The environment variables to set in the init container.
      Parameters:
      environmentVariables - the environmentVariables value to set.
      Returns:
      the InitContainerDefinition object itself.
    • instanceView

      Get the instanceView property: The instance view of the init container. Only valid in response.
      Returns:
      the instanceView value.
    • volumeMounts

      public List<VolumeMount> volumeMounts()
      Get the volumeMounts property: The volume mounts available to the init container.
      Returns:
      the volumeMounts value.
    • withVolumeMounts

      public InitContainerDefinition withVolumeMounts(List<VolumeMount> volumeMounts)
      Set the volumeMounts property: The volume mounts available to the init container.
      Parameters:
      volumeMounts - the volumeMounts value to set.
      Returns:
      the InitContainerDefinition object itself.
    • securityContext

      public SecurityContextDefinition securityContext()
      Get the securityContext property: The container security properties.
      Returns:
      the securityContext value.
    • withSecurityContext

      public InitContainerDefinition withSecurityContext(SecurityContextDefinition securityContext)
      Set the securityContext property: The container security properties.
      Parameters:
      securityContext - the securityContext value to set.
      Returns:
      the InitContainerDefinition 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<InitContainerDefinition>
      Throws:
      IOException
    • fromJson

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