ContainerInstance

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

Bases: object

A container instance to host containers.

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

Attributes

CONTAINER_RESTART_POLICY_ALWAYS A constant which can be used with the container_restart_policy property of a ContainerInstance.
CONTAINER_RESTART_POLICY_NEVER A constant which can be used with the container_restart_policy property of a ContainerInstance.
CONTAINER_RESTART_POLICY_ON_FAILURE A constant which can be used with the container_restart_policy property of a ContainerInstance.
LIFECYCLE_STATE_ACTIVE A constant which can be used with the lifecycle_state property of a ContainerInstance.
LIFECYCLE_STATE_CREATING A constant which can be used with the lifecycle_state property of a ContainerInstance.
LIFECYCLE_STATE_DELETED A constant which can be used with the lifecycle_state property of a ContainerInstance.
LIFECYCLE_STATE_DELETING A constant which can be used with the lifecycle_state property of a ContainerInstance.
LIFECYCLE_STATE_FAILED A constant which can be used with the lifecycle_state property of a ContainerInstance.
LIFECYCLE_STATE_INACTIVE A constant which can be used with the lifecycle_state property of a ContainerInstance.
LIFECYCLE_STATE_UPDATING A constant which can be used with the lifecycle_state property of a ContainerInstance.
availability_domain [Required] Gets the availability_domain of this ContainerInstance.
compartment_id [Required] Gets the compartment_id of this ContainerInstance.
container_count [Required] Gets the container_count of this ContainerInstance.
container_restart_policy [Required] Gets the container_restart_policy of this ContainerInstance.
containers [Required] Gets the containers of this ContainerInstance.
defined_tags Gets the defined_tags of this ContainerInstance.
display_name [Required] Gets the display_name of this ContainerInstance.
dns_config Gets the dns_config of this ContainerInstance.
fault_domain Gets the fault_domain of this ContainerInstance.
freeform_tags Gets the freeform_tags of this ContainerInstance.
graceful_shutdown_timeout_in_seconds Gets the graceful_shutdown_timeout_in_seconds of this ContainerInstance.
id [Required] Gets the id of this ContainerInstance.
image_pull_secrets Gets the image_pull_secrets of this ContainerInstance.
lifecycle_details Gets the lifecycle_details of this ContainerInstance.
lifecycle_state [Required] Gets the lifecycle_state of this ContainerInstance.
shape [Required] Gets the shape of this ContainerInstance.
shape_config [Required] Gets the shape_config of this ContainerInstance.
system_tags Gets the system_tags of this ContainerInstance.
time_created [Required] Gets the time_created of this ContainerInstance.
time_updated Gets the time_updated of this ContainerInstance.
vnics [Required] Gets the vnics of this ContainerInstance.
volume_count Gets the volume_count of this ContainerInstance.
volumes Gets the volumes of this ContainerInstance.

Methods

__init__(**kwargs) Initializes a new ContainerInstance object with values from keyword arguments.
CONTAINER_RESTART_POLICY_ALWAYS = 'ALWAYS'

A constant which can be used with the container_restart_policy property of a ContainerInstance. This constant has a value of “ALWAYS”

CONTAINER_RESTART_POLICY_NEVER = 'NEVER'

A constant which can be used with the container_restart_policy property of a ContainerInstance. This constant has a value of “NEVER”

CONTAINER_RESTART_POLICY_ON_FAILURE = 'ON_FAILURE'

A constant which can be used with the container_restart_policy property of a ContainerInstance. This constant has a value of “ON_FAILURE”

LIFECYCLE_STATE_ACTIVE = 'ACTIVE'

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

LIFECYCLE_STATE_CREATING = 'CREATING'

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

LIFECYCLE_STATE_DELETED = 'DELETED'

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

LIFECYCLE_STATE_DELETING = 'DELETING'

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

LIFECYCLE_STATE_FAILED = 'FAILED'

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

LIFECYCLE_STATE_INACTIVE = 'INACTIVE'

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

LIFECYCLE_STATE_UPDATING = 'UPDATING'

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

__init__(**kwargs)

Initializes a new ContainerInstance 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 ContainerInstance.
  • display_name (str) – The value to assign to the display_name property of this ContainerInstance.
  • compartment_id (str) – The value to assign to the compartment_id property of this ContainerInstance.
  • freeform_tags (dict(str, str)) – The value to assign to the freeform_tags property of this ContainerInstance.
  • defined_tags (dict(str, dict(str, object))) – The value to assign to the defined_tags property of this ContainerInstance.
  • system_tags (dict(str, dict(str, object))) – The value to assign to the system_tags property of this ContainerInstance.
  • availability_domain (str) – The value to assign to the availability_domain property of this ContainerInstance.
  • fault_domain (str) – The value to assign to the fault_domain property of this ContainerInstance.
  • lifecycle_state (str) – The value to assign to the lifecycle_state property of this ContainerInstance. 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 ContainerInstance.
  • volumes (list[oci.container_instances.models.ContainerVolume]) – The value to assign to the volumes property of this ContainerInstance.
  • volume_count (int) – The value to assign to the volume_count property of this ContainerInstance.
  • containers (list[oci.container_instances.models.ContainerInstanceContainer]) – The value to assign to the containers property of this ContainerInstance.
  • container_count (int) – The value to assign to the container_count property of this ContainerInstance.
  • time_created (datetime) – The value to assign to the time_created property of this ContainerInstance.
  • time_updated (datetime) – The value to assign to the time_updated property of this ContainerInstance.
  • shape (str) – The value to assign to the shape property of this ContainerInstance.
  • shape_config (oci.container_instances.models.ContainerInstanceShapeConfig) – The value to assign to the shape_config property of this ContainerInstance.
  • vnics (list[oci.container_instances.models.ContainerVnic]) – The value to assign to the vnics property of this ContainerInstance.
  • dns_config (oci.container_instances.models.ContainerDnsConfig) – The value to assign to the dns_config property of this ContainerInstance.
  • graceful_shutdown_timeout_in_seconds (int) – The value to assign to the graceful_shutdown_timeout_in_seconds property of this ContainerInstance.
  • image_pull_secrets (list[oci.container_instances.models.ImagePullSecret]) – The value to assign to the image_pull_secrets property of this ContainerInstance.
  • container_restart_policy (str) – The value to assign to the container_restart_policy property of this ContainerInstance. Allowed values for this property are: “ALWAYS”, “NEVER”, “ON_FAILURE”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.
availability_domain

[Required] Gets the availability_domain of this ContainerInstance. The availability domain to place the container instance.

Returns:The availability_domain of this ContainerInstance.
Return type:str
compartment_id

[Required] Gets the compartment_id of this ContainerInstance. The OCID of the compartment.

Returns:The compartment_id of this ContainerInstance.
Return type:str
container_count

[Required] Gets the container_count of this ContainerInstance. The number of containers on the container instance.

Returns:The container_count of this ContainerInstance.
Return type:int
container_restart_policy

[Required] Gets the container_restart_policy of this ContainerInstance. The container restart policy is applied for all containers in container instance.

Allowed values for this property are: “ALWAYS”, “NEVER”, “ON_FAILURE”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.

Returns:The container_restart_policy of this ContainerInstance.
Return type:str
containers

[Required] Gets the containers of this ContainerInstance. The containers on the container instance.

Returns:The containers of this ContainerInstance.
Return type:list[oci.container_instances.models.ContainerInstanceContainer]
defined_tags

Gets the defined_tags of this ContainerInstance. 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 ContainerInstance.
Return type:dict(str, dict(str, object))
display_name

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

Returns:The display_name of this ContainerInstance.
Return type:str
dns_config

Gets the dns_config of this ContainerInstance.

Returns:The dns_config of this ContainerInstance.
Return type:oci.container_instances.models.ContainerDnsConfig
fault_domain

Gets the fault_domain of this ContainerInstance. The fault domain to place the container instance.

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

Gets the freeform_tags of this ContainerInstance. 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 ContainerInstance.
Return type:dict(str, str)
graceful_shutdown_timeout_in_seconds

Gets the graceful_shutdown_timeout_in_seconds of this ContainerInstance. The amount of time that processes in a container have to gracefully end when the container must be stopped. For example, when you delete a container instance. After the timeout is reached, the processes are sent a signal to be deleted.

Returns:The graceful_shutdown_timeout_in_seconds of this ContainerInstance.
Return type:int
id

[Required] Gets the id of this ContainerInstance. An OCID that cannot be changed.

Returns:The id of this ContainerInstance.
Return type:str
image_pull_secrets

Gets the image_pull_secrets of this ContainerInstance. The image pulls secrets so you can access private registry to pull container images.

Returns:The image_pull_secrets of this ContainerInstance.
Return type:list[oci.container_instances.models.ImagePullSecret]
lifecycle_details

Gets the lifecycle_details of this ContainerInstance. 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 ContainerInstance.
Return type:str
lifecycle_state

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

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 ContainerInstance.
Return type:str
shape

[Required] Gets the shape of this ContainerInstance. The shape of the container instance. The shape determines the number of OCPUs, amount of memory, and other resources that are allocated to a container instance.

Returns:The shape of this ContainerInstance.
Return type:str
shape_config

[Required] Gets the shape_config of this ContainerInstance.

Returns:The shape_config of this ContainerInstance.
Return type:oci.container_instances.models.ContainerInstanceShapeConfig
system_tags

Gets the system_tags of this ContainerInstance. 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 ContainerInstance.
Return type:dict(str, dict(str, object))
time_created

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

Returns:The time_created of this ContainerInstance.
Return type:datetime
time_updated

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

Returns:The time_updated of this ContainerInstance.
Return type:datetime
vnics

[Required] Gets the vnics of this ContainerInstance. The virtual networks available to the containers in the container instance.

Returns:The vnics of this ContainerInstance.
Return type:list[oci.container_instances.models.ContainerVnic]
volume_count

Gets the volume_count of this ContainerInstance. The number of volumes that are attached to the container instance.

Returns:The volume_count of this ContainerInstance.
Return type:int
volumes

Gets the volumes of this ContainerInstance. A volume is a directory with data that is accessible across multiple containers in a container instance.

Returns:The volumes of this ContainerInstance.
Return type:list[oci.container_instances.models.ContainerVolume]