Container

class oci.container_instances.models.Container(**kwargs)

Bases: object

A single container on a container instance.

If you delete a container, the record remains visible for a short period of time before being permanently removed.

Attributes

LIFECYCLE_STATE_ACTIVE A constant which can be used with the lifecycle_state property of a Container.
LIFECYCLE_STATE_CREATING A constant which can be used with the lifecycle_state property of a Container.
LIFECYCLE_STATE_DELETED A constant which can be used with the lifecycle_state property of a Container.
LIFECYCLE_STATE_DELETING A constant which can be used with the lifecycle_state property of a Container.
LIFECYCLE_STATE_FAILED A constant which can be used with the lifecycle_state property of a Container.
LIFECYCLE_STATE_INACTIVE A constant which can be used with the lifecycle_state property of a Container.
LIFECYCLE_STATE_UPDATING A constant which can be used with the lifecycle_state property of a Container.
arguments Gets the arguments of this Container.
availability_domain [Required] Gets the availability_domain of this Container.
command Gets the command of this Container.
compartment_id [Required] Gets the compartment_id of this Container.
container_instance_id [Required] Gets the container_instance_id of this Container.
container_restart_attempt_count Gets the container_restart_attempt_count of this Container.
defined_tags Gets the defined_tags of this Container.
display_name [Required] Gets the display_name of this Container.
environment_variables Gets the environment_variables of this Container.
exit_code Gets the exit_code of this Container.
fault_domain Gets the fault_domain of this Container.
freeform_tags Gets the freeform_tags of this Container.
health_checks Gets the health_checks of this Container.
id [Required] Gets the id of this Container.
image_url [Required] Gets the image_url of this Container.
is_resource_principal_disabled Gets the is_resource_principal_disabled of this Container.
lifecycle_details Gets the lifecycle_details of this Container.
lifecycle_state [Required] Gets the lifecycle_state of this Container.
resource_config Gets the resource_config of this Container.
security_context Gets the security_context of this Container.
system_tags Gets the system_tags of this Container.
time_created [Required] Gets the time_created of this Container.
time_terminated Gets the time_terminated of this Container.
time_updated Gets the time_updated of this Container.
volume_mounts Gets the volume_mounts of this Container.
working_directory Gets the working_directory of this Container.

Methods

__init__(**kwargs) Initializes a new Container object with values from keyword arguments.
LIFECYCLE_STATE_ACTIVE = 'ACTIVE'

A constant which can be used with the lifecycle_state property of a Container. This constant has a value of “ACTIVE”

LIFECYCLE_STATE_CREATING = 'CREATING'

A constant which can be used with the lifecycle_state property of a Container. This constant has a value of “CREATING”

LIFECYCLE_STATE_DELETED = 'DELETED'

A constant which can be used with the lifecycle_state property of a Container. This constant has a value of “DELETED”

LIFECYCLE_STATE_DELETING = 'DELETING'

A constant which can be used with the lifecycle_state property of a Container. This constant has a value of “DELETING”

LIFECYCLE_STATE_FAILED = 'FAILED'

A constant which can be used with the lifecycle_state property of a Container. This constant has a value of “FAILED”

LIFECYCLE_STATE_INACTIVE = 'INACTIVE'

A constant which can be used with the lifecycle_state property of a Container. This constant has a value of “INACTIVE”

LIFECYCLE_STATE_UPDATING = 'UPDATING'

A constant which can be used with the lifecycle_state property of a Container. This constant has a value of “UPDATING”

__init__(**kwargs)

Initializes a new Container object with values from keyword arguments. The following keyword arguments are supported (corresponding to the getters/setters of this class):

Parameters:
  • id (str) – The value to assign to the id property of this Container.
  • display_name (str) – The value to assign to the display_name property of this Container.
  • compartment_id (str) – The value to assign to the compartment_id property of this Container.
  • freeform_tags (dict(str, str)) – The value to assign to the freeform_tags property of this Container.
  • defined_tags (dict(str, dict(str, object))) – The value to assign to the defined_tags property of this Container.
  • system_tags (dict(str, dict(str, object))) – The value to assign to the system_tags property of this Container.
  • availability_domain (str) – The value to assign to the availability_domain property of this Container.
  • fault_domain (str) – The value to assign to the fault_domain property of this Container.
  • lifecycle_state (str) – The value to assign to the lifecycle_state property of this Container. Allowed values for this property are: “CREATING”, “UPDATING”, “ACTIVE”, “INACTIVE”, “DELETING”, “DELETED”, “FAILED”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.
  • lifecycle_details (str) – The value to assign to the lifecycle_details property of this Container.
  • exit_code (int) – The value to assign to the exit_code property of this Container.
  • time_terminated (datetime) – The value to assign to the time_terminated property of this Container.
  • time_created (datetime) – The value to assign to the time_created property of this Container.
  • time_updated (datetime) – The value to assign to the time_updated property of this Container.
  • container_instance_id (str) – The value to assign to the container_instance_id property of this Container.
  • image_url (str) – The value to assign to the image_url property of this Container.
  • command (list[str]) – The value to assign to the command property of this Container.
  • arguments (list[str]) – The value to assign to the arguments property of this Container.
  • working_directory (str) – The value to assign to the working_directory property of this Container.
  • environment_variables (dict(str, str)) – The value to assign to the environment_variables property of this Container.
  • volume_mounts (list[oci.container_instances.models.VolumeMount]) – The value to assign to the volume_mounts property of this Container.
  • health_checks (list[oci.container_instances.models.ContainerHealthCheck]) – The value to assign to the health_checks property of this Container.
  • is_resource_principal_disabled (bool) – The value to assign to the is_resource_principal_disabled property of this Container.
  • resource_config (oci.container_instances.models.ContainerResourceConfig) – The value to assign to the resource_config property of this Container.
  • container_restart_attempt_count (int) – The value to assign to the container_restart_attempt_count property of this Container.
  • security_context (oci.container_instances.models.SecurityContext) – The value to assign to the security_context property of this Container.
arguments

Gets the arguments of this Container. A list of string arguments for the ENTRYPOINT process of the container.

Many containers use an ENTRYPOINT process pointing to a shell /bin/bash. For those containers, you can use the argument list to specify the main command in the container process.

Returns:The arguments of this Container.
Return type:list[str]
availability_domain

[Required] Gets the availability_domain of this Container. The availability domain where the container instance that hosts the container runs.

Returns:The availability_domain of this Container.
Return type:str
command

Gets the command of this Container. This command overrides ENTRYPOINT process of the container. If you do not specify this command, the existing ENTRYPOINT process defined in the image is the default.

Returns:The command of this Container.
Return type:list[str]
compartment_id

[Required] Gets the compartment_id of this Container. The OCID of the compartment that contains the container.

Returns:The compartment_id of this Container.
Return type:str
container_instance_id

[Required] Gets the container_instance_id of this Container. The OCID of the container instance that the container is running on.

Returns:The container_instance_id of this Container.
Return type:str
container_restart_attempt_count

Gets the container_restart_attempt_count of this Container. The number of container restart attempts. Depending on the restart policy, a restart might be attempted after a health check failure or a container exit.

Returns:The container_restart_attempt_count of this Container.
Return type:int
defined_tags

Gets the defined_tags of this Container. Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {“foo-namespace”: {“bar-key”: “value”}}.

Returns:The defined_tags of this Container.
Return type:dict(str, dict(str, object))
display_name

[Required] Gets the display_name of this Container. A user-friendly name. Does not have to be unique, and it’s changeable. Avoid entering confidential information.

Returns:The display_name of this Container.
Return type:str
environment_variables

Gets the environment_variables of this Container. A map of additional environment variables to set in the environment of the ENTRYPOINT process of the container. These variables are in addition to any variables already defined in the container’s image.

Returns:The environment_variables of this Container.
Return type:dict(str, str)
exit_code

Gets the exit_code of this Container. The exit code of the container process when it stopped running.

Returns:The exit_code of this Container.
Return type:int
fault_domain

Gets the fault_domain of this Container. The fault domain of the container instance that hosts the container runs.

Returns:The fault_domain of this Container.
Return type:str
freeform_tags

Gets the freeform_tags of this Container. Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {“bar-key”: “value”}

Returns:The freeform_tags of this Container.
Return type:dict(str, str)
health_checks

Gets the health_checks of this Container. List of container health checks

Returns:The health_checks of this Container.
Return type:list[oci.container_instances.models.ContainerHealthCheck]
id

[Required] Gets the id of this Container. The OCID of the container.

Returns:The id of this Container.
Return type:str
image_url

[Required] Gets the image_url of this Container. The container image information. Currently only supports public Docker registry.

You can provide either the image name (containerImage), image name with version (containerImagev1), or complete Docker image URL docker.io/library/containerImage:latest.

If you do not provide a registry, the registry defaults to public Docker hub docker.io/library. The registry used for the container image must be reachable over the VNIC of the container instance.

Returns:The image_url of this Container.
Return type:str
is_resource_principal_disabled

Gets the is_resource_principal_disabled of this Container. Determines if the container will have access to the container instance resource principal.

This method utilizes resource principal version 2.2. For more information on how to use the exposed resource principal elements, see https://docs.oracle.com/en-us/iaas/Content/API/Concepts/sdk_authentication_methods.htm#sdk_authentication_methods_resource_principal.

Returns:The is_resource_principal_disabled of this Container.
Return type:bool
lifecycle_details

Gets the lifecycle_details of this Container. A message that describes the current state of the container in more detail. Can be used to provide actionable information.

Returns:The lifecycle_details of this Container.
Return type:str
lifecycle_state

[Required] Gets the lifecycle_state of this Container. The current state of the container.

Allowed values for this property are: “CREATING”, “UPDATING”, “ACTIVE”, “INACTIVE”, “DELETING”, “DELETED”, “FAILED”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.

Returns:The lifecycle_state of this Container.
Return type:str
resource_config

Gets the resource_config of this Container.

Returns:The resource_config of this Container.
Return type:oci.container_instances.models.ContainerResourceConfig
security_context

Gets the security_context of this Container.

Returns:The security_context of this Container.
Return type:oci.container_instances.models.SecurityContext
system_tags

Gets the system_tags of this Container. Usage of system tag keys. These predefined keys are scoped to namespaces. Example: {“orcl-cloud”: {“free-tier-retained”: “true”}}.

Returns:The system_tags of this Container.
Return type:dict(str, dict(str, object))
time_created

[Required] Gets the time_created of this Container. The time the container was created, in the format defined by RFC 3339.

Returns:The time_created of this Container.
Return type:datetime
time_terminated

Gets the time_terminated of this Container. The time when the container last deleted (terminated), in the format defined by RFC 3339.

Returns:The time_terminated of this Container.
Return type:datetime
time_updated

Gets the time_updated of this Container. The time the container was updated, in the format defined by RFC 3339.

Returns:The time_updated of this Container.
Return type:datetime
volume_mounts

Gets the volume_mounts of this Container. List of the volume mounts.

Returns:The volume_mounts of this Container.
Return type:list[oci.container_instances.models.VolumeMount]
working_directory

Gets the working_directory of this Container. The working directory within the container’s filesystem for the container process. If not specified, the default working directory from the image is used.

Returns:The working_directory of this Container.
Return type:str