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 Summary
ConstructorsConstructorDescriptionCreates an instance of SecurityContextDefinition class. -
Method Summary
Modifier and TypeMethodDescriptionGet the allowPrivilegeEscalation property: A boolean value indicating whether the init process can elevate its privileges.Get the capabilities property: The capabilities to add or drop from a container.static SecurityContextDefinitionfromJson(com.azure.json.JsonReader jsonReader) Reads an instance of SecurityContextDefinition from the JsonReader.Get the privileged property: The flag to determine if the container permissions is elevated to Privileged.Get the runAsGroup property: Sets the User GID for the container.Get the runAsUser property: Sets the User UID for the container.Get the seccompProfile property: a base64 encoded string containing the contents of the JSON in the seccomp profile.com.azure.json.JsonWritertoJson(com.azure.json.JsonWriter jsonWriter) voidvalidate()Validates the instance.withAllowPrivilegeEscalation(Boolean allowPrivilegeEscalation) Set the allowPrivilegeEscalation property: A boolean value indicating whether the init process can elevate its privileges.withCapabilities(SecurityContextCapabilitiesDefinition capabilities) Set the capabilities property: The capabilities to add or drop from a container.withPrivileged(Boolean privileged) Set the privileged property: The flag to determine if the container permissions is elevated to Privileged.withRunAsGroup(Integer runAsGroup) Set the runAsGroup property: Sets the User GID for the container.withRunAsUser(Integer runAsUser) Set the runAsUser property: Sets the User UID for the container.withSeccompProfile(String seccompProfile) Set the seccompProfile property: a base64 encoded string containing the contents of the JSON in the seccomp profile.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.azure.json.JsonSerializable
toJson, toJson, toJsonBytes, toJsonString
-
Constructor Details
-
SecurityContextDefinition
public SecurityContextDefinition()Creates an instance of SecurityContextDefinition class.
-
-
Method Details
-
privileged
Get the privileged property: The flag to determine if the container permissions is elevated to Privileged.- Returns:
- the privileged value.
-
withPrivileged
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
Get the allowPrivilegeEscalation property: A boolean value indicating whether the init process can elevate its privileges.- Returns:
- the allowPrivilegeEscalation value.
-
withAllowPrivilegeEscalation
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
Get the runAsGroup property: Sets the User GID for the container.- Returns:
- the runAsGroup value.
-
withRunAsGroup
Set the runAsGroup property: Sets the User GID for the container.- Parameters:
runAsGroup- the runAsGroup value to set.- Returns:
- the SecurityContextDefinition object itself.
-
runAsUser
Get the runAsUser property: Sets the User UID for the container.- Returns:
- the runAsUser value.
-
withRunAsUser
Set the runAsUser property: Sets the User UID for the container.- Parameters:
runAsUser- the runAsUser value to set.- Returns:
- the SecurityContextDefinition object itself.
-
seccompProfile
Get the seccompProfile property: a base64 encoded string containing the contents of the JSON in the seccomp profile.- Returns:
- the seccompProfile value.
-
withSeccompProfile
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
- Specified by:
toJsonin interfacecom.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.
-