Class SecurityContextDefinition

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

public final class SecurityContextDefinition extends Object implements com.azure.json.JsonSerializable<SecurityContextDefinition>
The security context for the container.
  • Constructor Details

    • SecurityContextDefinition

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

    • privileged

      public Boolean privileged()
      Get the privileged property: The flag to determine if the container permissions is elevated to Privileged.
      Returns:
      the privileged value.
    • withPrivileged

      public SecurityContextDefinition withPrivileged(Boolean privileged)
      Set the privileged property: The flag to determine if the container permissions is elevated to Privileged.
      Parameters:
      privileged - the privileged value to set.
      Returns:
      the SecurityContextDefinition object itself.
    • allowPrivilegeEscalation

      public Boolean allowPrivilegeEscalation()
      Get the allowPrivilegeEscalation property: A boolean value indicating whether the init process can elevate its privileges.
      Returns:
      the allowPrivilegeEscalation value.
    • withAllowPrivilegeEscalation

      public SecurityContextDefinition withAllowPrivilegeEscalation(Boolean allowPrivilegeEscalation)
      Set the allowPrivilegeEscalation property: A boolean value indicating whether the init process can elevate its privileges.
      Parameters:
      allowPrivilegeEscalation - the allowPrivilegeEscalation value to set.
      Returns:
      the SecurityContextDefinition object itself.
    • capabilities

      Get the capabilities property: The capabilities to add or drop from a container.
      Returns:
      the capabilities value.
    • withCapabilities

      public SecurityContextDefinition withCapabilities(SecurityContextCapabilitiesDefinition capabilities)
      Set the capabilities property: The capabilities to add or drop from a container.
      Parameters:
      capabilities - the capabilities value to set.
      Returns:
      the SecurityContextDefinition object itself.
    • runAsGroup

      public Integer runAsGroup()
      Get the runAsGroup property: Sets the User GID for the container.
      Returns:
      the runAsGroup value.
    • withRunAsGroup

      public SecurityContextDefinition withRunAsGroup(Integer runAsGroup)
      Set the runAsGroup property: Sets the User GID for the container.
      Parameters:
      runAsGroup - the runAsGroup value to set.
      Returns:
      the SecurityContextDefinition object itself.
    • runAsUser

      public Integer runAsUser()
      Get the runAsUser property: Sets the User UID for the container.
      Returns:
      the runAsUser value.
    • withRunAsUser

      public SecurityContextDefinition withRunAsUser(Integer runAsUser)
      Set the runAsUser property: Sets the User UID for the container.
      Parameters:
      runAsUser - the runAsUser value to set.
      Returns:
      the SecurityContextDefinition object itself.
    • seccompProfile

      public String seccompProfile()
      Get the seccompProfile property: a base64 encoded string containing the contents of the JSON in the seccomp profile.
      Returns:
      the seccompProfile value.
    • withSeccompProfile

      public SecurityContextDefinition withSeccompProfile(String seccompProfile)
      Set the seccompProfile property: a base64 encoded string containing the contents of the JSON in the seccomp profile.
      Parameters:
      seccompProfile - the seccompProfile value to set.
      Returns:
      the SecurityContextDefinition 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<SecurityContextDefinition>
      Throws:
      IOException
    • fromJson

      public static SecurityContextDefinition fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of SecurityContextDefinition from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of SecurityContextDefinition 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 SecurityContextDefinition.