> For the complete documentation index, see [llms.txt](https://docs.console.zenlayer.com/api-reference/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.console.zenlayer.com/api-reference/cn/security/zos/datastructure.md).

# 数据结构

## Command

描述命令的基本信息。

被如下接口引用：DescribeCommands

| 参数名称                 | 类型                                      | 描述        |
| -------------------- | --------------------------------------- | --------- |
| commandId            | String                                  | 命令ID。     |
| name                 | String                                  | 命令的名称。    |
| type                 | [CommandType](#commandtype)             | 命令的类型。    |
| createTime           | String                                  | 命令的创建时间。  |
| description          | String                                  | 命令的描述信息。  |
| content              | String                                  | 命令的内容。    |
| latestInvocationTime | String                                  | 最近执行的时间。  |
| tags                 | [Tags](#tags)                           | 指令的标签。    |
| resourceGroup        | [ResourceGroupInfo](#resourcegroupinfo) | 指令所属的资源组。 |

## CommandInvocation

描述命令执行记录的信息。

被如下接口引用：DescribeCommandInvocations

| 参数名称                | 类型                                                 | 描述           |
| ------------------- | -------------------------------------------------- | ------------ |
| invocationId        | String                                             | 执行ID。        |
| commandId           | String                                             | 命令的ID。       |
| commandName         | String                                             | 命令的名称。       |
| commandType         | [CommandType](#commandtype)                        | 命令的类型。       |
| content             | String                                             | 执行的内容。       |
| timeout             | Integer                                            | 超时时间。        |
| createTime          | String                                             | 命令执行的创建时间。   |
| invocationStatus    | [InvocationStatus](#invocationstatus)              | 命令的执行的总执行状态。 |
| invocationInstances | Array of [InvocationInstance](#invocationinstance) | 命令执行实例列表。    |

## CommandType

命令类型的值。

被如下接口引用：DescribeCommands, CreateCommand, DescribeCommandInvocations

| 值          | 值说明                           |
| ---------- | ----------------------------- |
| SHELL      | 在 Linux 实例中运行的 Shell 脚本。      |
| POWERSHELL | 在 Windows 中运行的 PowerShell 类型。 |
| BAT        | 在 Windows 中运行的 Bat 脚本。        |

## InvocationInstance

描述执行目标实例的信息。

被如下接口引用：DescribeCommandInvocations

| 参数名称          | 类型                                                  | 描述                   |
| ------------- | --------------------------------------------------- | -------------------- |
| instanceId    | String                                              | 执行ID。                |
| instanceName  | String                                              | 实例的名称。               |
| instanceExist | Boolean                                             | 实例是否存在。              |
| taskStatus    | [InvocationTaskStatus](#invocationtaskstatus)       | 实例执行任务的状态。           |
| exitCode      | Integer                                             | 命令进程的退出代码。           |
| errorCode     | [InvocationTaskErrorCode](#invocationtaskerrorcode) | 命令执行失败原因的代号。         |
| output        | String                                              | 命令执行的标准输出(stdout)。   |
| outputError   | String                                              | 命令执行的标准错误输出(stderr)。 |
| execStartTime | String                                              | 命令执行的开始时间。           |
| execEndTime   | String                                              | 命令执行的结束时间。           |

## InvocationStatus

执行的总状态。

被如下接口引用：DescribeCommandInvocations

| 值             | 值说明                                                   |
| ------------- | ----------------------------------------------------- |
| Pending       | <p>任务还未执行。</p><p>所有实例任务状态均处于<code>Pending</code>。</p> |
| Running       | <p>任务执行中。</p><p>所有实例任务状态均处于<code>Running</code>。</p>  |
| PartialFailed | <p>部分失败。</p><p>所有实例执行完毕，且有部分实例任务状态成功，有部分失败未失败。</p>    |
| Failed        | <p>全部失败。</p><p>所有实例执行完毕，所有实例执行状态均为失败。</p>             |
| Success       | <p>全部成功。</p><p>所有实例执行完毕，所有实例执行状态均为成功。</p>             |

## InvocationTaskErrorCode

执行任务错误码的相关值。

被如下接口引用：DescribeCommandInvocations

| 值                      | 值说明                       |
| ---------------------- | ------------------------- |
| InstanceNotExists      | 实例不存在。                    |
| InstanceInstanceState  | 实例状态非运行。                  |
| SystemError            | <p>系统错误。</p><p>命令未执行。</p> |
| CommandPlatformInvalid | 命令类型无法在实例上执行。             |
| ExecutionTimeout       | 脚本执行超时。                   |
| ExecutionExitNoneZero  | 脚本执行，退出码为非0。              |

## InvocationTaskStatus

实例任务的执行状态的值。

被如下接口引用：DescribeCommandInvocations

| 值       | 值说明                                 |
| ------- | ----------------------------------- |
| Pending | 等待执行命令。                             |
| Running | 正在执行命令。                             |
| Timeout | 执行命令超时。                             |
| Failed  | 执行命令完，退出码为非0。                       |
| Success | 执行命令完，退出码为0。                        |
| Error   | <p>命令无法执行。</p><p>由于系统错误或实例未运行等。</p> |

## ResourceGroupInfo

描述资源所在资源组的相关信息，包括资源组名称和ID。

被如下接口引用：DescribeCommands

| 参数名称              | 类型     | 描述     |
| ----------------- | ------ | ------ |
| resourceGroupId   | String | 资源组ID。 |
| resourceGroupName | String | 资源组名称。 |

## Tag

描述一个标签键值对的信息。

被如下接口引用：DescribeCommands, CreateCommand

| 参数名称  | 类型     | 必选 | 描述                              |
| ----- | ------ | -- | ------------------------------- |
| key   | String | 是  | <p>标签键。</p><p>长度限制：1～64个字符。</p> |
| value | String | 否  | <p>标签值。</p><p>长度限制：1～64个字符。</p> |

## TagAssociation

描述创建资源时同时绑定的标签对的信息。

被如下接口引用：CreateCommand

| 参数名称 | 类型                   | 必选 | 描述     |
| ---- | -------------------- | -- | ------ |
| tags | Array of [Tag](#tag) | 是  | 标签对列表。 |

## Tags

描述资源关联的标签信息。

被如下接口引用：DescribeCommands

| 参数名称 | 类型                   | 描述     |
| ---- | -------------------- | ------ |
| tags | Array of [Tag](#tag) | 标签对列表。 |
