containers
Creates, updates, deletes, gets or lists a containers resource.
Overview
| Name | containers |
| Type | Resource |
| Id | azure.container_instance.containers |
Fields
The following fields are returned by SELECT queries:
- list_logs
| Name | Datatype | Description |
|---|---|---|
content | string | The content of the log. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_logs | select | resource_group_name, container_group_name, container_name, subscription_id | tail, timestamps | Get the logs for a specified container instance. Get the logs for a specified container instance in a specified resource group and container group. |
execute_command | exec | resource_group_name, container_group_name, container_name, subscription_id | Executes a command in a specific container instance. Executes a command for a specific container instance in a specified resource group and container group. | |
attach | exec | resource_group_name, container_group_name, container_name, subscription_id | 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. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
container_group_name | string | The name of the container group. Required. |
container_name | string | The name of the container instance. Required. |
resource_group_name | string | The name of the resource group. The name is case insensitive. Required. |
subscription_id | string | |
tail | integer | 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 | boolean | If true, adds a timestamp at the beginning of every line of log output. If not provided, defaults to false. Default value is None. |
SELECT examples
- 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.
SELECT
content
FROM azure.container_instance.containers
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND container_group_name = '{{ container_group_name }}' -- required
AND container_name = '{{ container_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
AND tail = '{{ tail }}'
AND timestamps = '{{ timestamps }}'
;
Lifecycle Methods
- execute_command
- attach
Executes a command in a specific container instance. Executes a command for a specific container instance in a specified resource group and container group.
EXEC azure.container_instance.containers.execute_command
@resource_group_name='{{ resource_group_name }}' --required,
@container_group_name='{{ container_group_name }}' --required,
@container_name='{{ container_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
@@json=
'{
"command": "{{ command }}",
"terminalSize": "{{ terminalSize }}"
}'
;
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.
EXEC azure.container_instance.containers.attach
@resource_group_name='{{ resource_group_name }}' --required,
@container_group_name='{{ container_group_name }}' --required,
@container_name='{{ container_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;