SecurityContextDefinition Class

  • java.lang.Object
    • com.azure.resourcemanager.containerinstance.models.SecurityContextDefinition

Implements

public final class SecurityContextDefinition
implements JsonSerializable<SecurityContextDefinition>

The security context for the container.

Constructor Summary

Constructor Description
SecurityContextDefinition()

Creates an instance of SecurityContextDefinition class.

Method Summary

Modifier and Type Method and Description
Boolean allowPrivilegeEscalation()

Get the allowPrivilegeEscalation property: A boolean value indicating whether the init process can elevate its privileges.

SecurityContextCapabilitiesDefinition capabilities()

Get the capabilities property: The capabilities to add or drop from a container.

static SecurityContextDefinition fromJson(JsonReader jsonReader)

Reads an instance of SecurityContextDefinition from the JsonReader.

Boolean privileged()

Get the privileged property: The flag to determine if the container permissions is elevated to Privileged.

Integer runAsGroup()

Get the runAsGroup property: Sets the User GID for the container.

Integer runAsUser()

Get the runAsUser property: Sets the User UID for the container.

String seccompProfile()

Get the seccompProfile property: a base64 encoded string containing the contents of the JSON in the seccomp profile.

JsonWriter toJson(JsonWriter jsonWriter)
void validate()

Validates the instance.

SecurityContextDefinition withAllowPrivilegeEscalation(Boolean allowPrivilegeEscalation)

Set the allowPrivilegeEscalation property: A boolean value indicating whether the init process can elevate its privileges.

SecurityContextDefinition withCapabilities(SecurityContextCapabilitiesDefinition capabilities)

Set the capabilities property: The capabilities to add or drop from a container.

SecurityContextDefinition withPrivileged(Boolean privileged)

Set the privileged property: The flag to determine if the container permissions is elevated to Privileged.

SecurityContextDefinition withRunAsGroup(Integer runAsGroup)

Set the runAsGroup property: Sets the User GID for the container.

SecurityContextDefinition withRunAsUser(Integer runAsUser)

Set the runAsUser property: Sets the User UID for the container.

SecurityContextDefinition withSeccompProfile(String seccompProfile)

Set the seccompProfile property: a base64 encoded string containing the contents of the JSON in the seccomp profile.

Methods inherited from java.lang.Object

Constructor Details

SecurityContextDefinition

public SecurityContextDefinition()

Creates an instance of SecurityContextDefinition class.

Method Details

allowPrivilegeEscalation

public Boolean allowPrivilegeEscalation()

Get the allowPrivilegeEscalation property: A boolean value indicating whether the init process can elevate its privileges.

Returns:

the allowPrivilegeEscalation value.

capabilities

public SecurityContextCapabilitiesDefinition capabilities()

Get the capabilities property: The capabilities to add or drop from a container.

Returns:

the capabilities value.

fromJson

public static SecurityContextDefinition fromJson(JsonReader jsonReader)

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.

privileged

public Boolean privileged()

Get the privileged property: The flag to determine if the container permissions is elevated to Privileged.

Returns:

the privileged value.

runAsGroup

public Integer runAsGroup()

Get the runAsGroup property: Sets the User GID for the container.

Returns:

the runAsGroup value.

runAsUser

public Integer runAsUser()

Get the runAsUser property: Sets the User UID for the container.

Returns:

the runAsUser value.

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.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

validate

public void validate()

Validates the instance.

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.

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.

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.

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.

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.

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.

Applies to