Class SecurityContextDefinition
java.lang.Object
com.azure.resourcemanager.containerinstance.models.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.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.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.
-
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.
-