ContainersOperations Class

Warning

DO NOT instantiate this class directly.

Instead, you should access the following operations through

ContainerInstanceManagementClient's

<xref:containers> attribute.

Inheritance
builtins.object
ContainersOperations

Constructor

ContainersOperations(*args, **kwargs)

Methods

attach

Attach to the output of a specific container instance.

Attach to the output stream of a specific container instance in a specified resource group and container group.

execute_command

Executes a command in a specific container instance.

Executes a command for a specific container instance in a specified resource group and container group.

list_logs

Get the logs for a specified container instance.

Get the logs for a specified container instance in a specified resource group and container group.

attach

Attach to the output of a specific container instance.

Attach to the output stream of a specific container instance in a specified resource group and container group.

attach(resource_group_name: str, container_group_name: str, container_name: str, **kwargs: Any) -> ContainerAttachResponse

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group. Required.

container_group_name
Required
str

The name of the container group. Required.

container_name
Required
str

The name of the container instance. Required.

Keyword-Only Parameters

Name Description
cls

A custom type or function that will be passed the direct response

Returns

Type Description

ContainerAttachResponse or the result of cls(response)

Exceptions

Type Description

execute_command

Executes a command in a specific container instance.

Executes a command for a specific container instance in a specified resource group and container group.

execute_command(resource_group_name: str, container_group_name: str, container_name: str, container_exec_request: _models.ContainerExecRequest, *, content_type: str = 'application/json', **kwargs: Any) -> _models.ContainerExecResponse

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group. Required.

container_group_name
Required
str

The name of the container group. Required.

container_name
Required
str

The name of the container instance. Required.

container_exec_request
Required

The request for the exec command. Is either a ContainerExecRequest type or a IO type. Required.

Keyword-Only Parameters

Name Description
content_type
str

Body Parameter content-type. Known values are: 'application/json'. Default value is None.

cls

A custom type or function that will be passed the direct response

Returns

Type Description

ContainerExecResponse or the result of cls(response)

Exceptions

Type Description

list_logs

Get the logs for a specified container instance.

Get the logs for a specified container instance in a specified resource group and container group.

list_logs(resource_group_name: str, container_group_name: str, container_name: str, tail: int | None = None, timestamps: bool | None = None, **kwargs: Any) -> Logs

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group. Required.

container_group_name
Required
str

The name of the container group. Required.

container_name
Required
str

The name of the container instance. Required.

tail
Required
int

The number of lines to show from the tail of the container instance log. If not provided, all available logs are shown up to 4mb. Default value is None.

timestamps
Required

If true, adds a timestamp at the beginning of every line of log output. If not provided, defaults to false. Default value is None.

Keyword-Only Parameters

Name Description
cls

A custom type or function that will be passed the direct response

Returns

Type Description

Logs or the result of cls(response)

Exceptions

Type Description

Attributes

models

models = <module 'azure.mgmt.containerinstance.models' from 'C:\\hostedtoolcache\\windows\\Python\\3.11.9\\x64\\Lib\\site-packages\\azure\\mgmt\\containerinstance\\models\\__init__.py'>