你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Experiments - List

获取资源组中的试验资源列表。

GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments?api-version=2025-01-01
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments?api-version=2025-01-01&running={running}&continuationToken={continuationToken}

URI 参数

名称 必需 类型 说明
resourceGroupName
path True

string

minLength: 1
maxLength: 90

资源组的名称。 名称不区分大小写。

subscriptionId
path True

string (uuid)

目标订阅的 ID。 该值必须是 UUID。

api-version
query True

string

minLength: 1

用于此作的 API 版本。

continuationToken
query

string

设置延续标记的字符串。

running
query

boolean

可选值,该值指示是否根据试验当前正在运行来筛选结果。 如果为 null,则不会筛选结果。

响应

名称 类型 说明
200 OK

ExperimentListResult

请求已成功。

Other Status Codes

ErrorResponse

意外的错误响应。

安全性

azure_auth

Azure Active Directory OAuth2 Flow。

类型: oauth2
流向: implicit
授权 URL: https://login.microsoftonline.com/common/oauth2/authorize

作用域

名称 说明
user_impersonation 模拟用户帐户

示例

List all Experiments in a resource group.

示例请求

GET https://management.azure.com/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Chaos/experiments?api-version=2025-01-01&continuationToken=

示例响应

{
  "nextLink": "https://management.azure.com/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Chaos/experiments?continuationToken=&api-version=2024-11-01-preview",
  "value": [
    {
      "name": "exampleExperiment",
      "type": "Microsoft.Chaos/experiments",
      "id": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Chaos/experiments/exampleExperiment",
      "identity": {
        "type": "SystemAssigned",
        "principalId": "d04ab567-2c07-43ef-a7f4-4527626b7f56",
        "tenantId": "8c3e2fb2-fe7a-4bf1-b779-d73990782fe6"
      },
      "location": "centraluseuap",
      "properties": {
        "selectors": [
          {
            "type": "List",
            "id": "selector1",
            "targets": [
              {
                "type": "ChaosTarget",
                "id": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Compute/virtualMachines/exampleVM/providers/Microsoft.Chaos/targets/Microsoft-VirtualMachine"
              }
            ]
          }
        ],
        "steps": [
          {
            "name": "step1",
            "branches": [
              {
                "name": "branch1",
                "actions": [
                  {
                    "name": "urn:csci:provider:providername:Shutdown/1.0",
                    "type": "continuous",
                    "duration": "PT10M",
                    "parameters": [
                      {
                        "key": "abruptShutdown",
                        "value": "false"
                      }
                    ],
                    "selectorId": "selector1"
                  }
                ]
              }
            ]
          }
        ]
      },
      "systemData": {
        "createdAt": "2021-07-01T00:00:00.0Z",
        "createdBy": "User",
        "createdByType": "b3a41dba-4415-4d36-9ee8-e5eaa86db976",
        "lastModifiedAt": "2021-07-01T00:00:00.0Z",
        "lastModifiedBy": "User",
        "lastModifiedByType": "b3a41dba-4415-4d36-9ee8-e5eaa86db976"
      }
    }
  ]
}

定义

名称 说明
ChaosExperimentBranch

表示步骤中的分支的模型。 每个试验总共 9 个。

ChaosExperimentStep

表示试验资源中的步骤的模型。

ChaosTargetListSelector

表示列表选择器的模型。

ChaosTargetQuerySelector

表示查询选择器的模型。

ChaosTargetSimpleFilter

表示简单目标筛选器的模型。

ChaosTargetSimpleFilterParameters

表示简单筛选器参数的模型。

ContinuousAction

表示连续作的模型。

createdByType

创建资源的标识的类型。

DelayAction

表示延迟作的模型。

DiscreteAction

表示离散作的模型。

ErrorAdditionalInfo

资源管理错误附加信息。

ErrorDetail

错误详细信息。

ErrorResponse

错误响应

Experiment

表示试验资源的模型。

ExperimentActionType

混沌试验作类型的枚举联合。

ExperimentListResult

表示试验资源和分页链接的列表的模型。

FilterType

区分筛选器类型的枚举。 目前仅支持 Simple 类型。

KeyValuePair

描述作设置的映射。

ManagedServiceIdentity

托管服务标识(系统分配和/或用户分配的标识)

ManagedServiceIdentityType

托管服务标识的类型(其中允许 SystemAssigned 和 UserAssigned 类型)。

ProvisioningState

给定 Azure 混沌资源的当前预配状态。

SelectorType

选择器类型的枚举。

systemData

与创建和上次修改资源相关的元数据。

TargetReference

表示对选择器中目标的引用的模型。

TargetReferenceType

目标引用类型的枚举。

UserAssignedIdentity

用户分配的标识属性

ChaosExperimentBranch

表示步骤中的分支的模型。 每个试验总共 9 个。

名称 类型 说明
actions ChaosExperimentAction[]:

作列表。

name

string

minLength: 1

分支名称的字符串。

ChaosExperimentStep

表示试验资源中的步骤的模型。

名称 类型 说明
branches

ChaosExperimentBranch[]

分支列表。

name

string

minLength: 1

步骤名称的字符串。

ChaosTargetListSelector

表示列表选择器的模型。

名称 类型 说明
filter ChaosTargetFilter:

ChaosTargetSimpleFilter

表示可应用于目标列表的可用筛选器类型的模型。

id

string

minLength: 1

选择器 ID 的字符串。

targets

TargetReference[]

目标引用列表。

type string:

List

混沌目标选择器鉴别器类型

ChaosTargetQuerySelector

表示查询选择器的模型。

名称 类型 说明
filter ChaosTargetFilter:

ChaosTargetSimpleFilter

表示可应用于目标列表的可用筛选器类型的模型。

id

string

minLength: 1

选择器 ID 的字符串。

queryString

string

针对目标资源的 Azure Resource Graph (ARG) 查询语言查询。

subscriptionIds

string[]

用于限定资源查询范围的订阅 ID 列表。

type string:

Query

混沌目标选择器鉴别器类型

ChaosTargetSimpleFilter

表示简单目标筛选器的模型。

名称 类型 说明
parameters

ChaosTargetSimpleFilterParameters

表示简单筛选器参数的模型。

type string:

Simple

混沌目标筛选器鉴别器类型

ChaosTargetSimpleFilterParameters

表示简单筛选器参数的模型。

名称 类型 说明
zones

string[]

要按其筛选目标的 Azure 可用性区域列表。

ContinuousAction

表示连续作的模型。

名称 类型 说明
duration

string (duration)

ISO8601表示持续时间的格式化字符串。

name

string

maxLength: 2048

表示功能 URN 的字符串。

parameters

KeyValuePair[]

键值对列表。

selectorId

string

minLength: 1

表示选择器的字符串。

type string:

continuous

混沌实验作鉴别器类型

createdByType

创建资源的标识的类型。

说明
Application
Key
ManagedIdentity
User

DelayAction

表示延迟作的模型。

名称 类型 说明
duration

string (duration)

ISO8601表示持续时间的格式化字符串。

name

string

maxLength: 2048

表示功能 URN 的字符串。

type string:

delay

混沌实验作鉴别器类型

DiscreteAction

表示离散作的模型。

名称 类型 说明
name

string

maxLength: 2048

表示功能 URN 的字符串。

parameters

KeyValuePair[]

键值对列表。

selectorId

string

minLength: 1

表示选择器的字符串。

type string:

discrete

混沌实验作鉴别器类型

ErrorAdditionalInfo

资源管理错误附加信息。

名称 类型 说明
info

object

其他信息。

type

string

其他信息类型。

ErrorDetail

错误详细信息。

名称 类型 说明
additionalInfo

ErrorAdditionalInfo[]

错误附加信息。

code

string

错误代码。

details

ErrorDetail[]

错误详细信息。

message

string

错误消息。

target

string

错误目标。

ErrorResponse

错误响应

名称 类型 说明
error

ErrorDetail

错误对象。

Experiment

表示试验资源的模型。

名称 类型 说明
id

string (arm-id)

资源的完全限定资源 ID。 例如“/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}”

identity

ManagedServiceIdentity

分配给此资源的托管服务标识。

location

string

资源所在的地理位置

name

string

资源的名称

properties.provisioningState

ProvisioningState

给定试验资源的最新预配状态。

properties.selectors ChaosTargetSelector[]:

选择器列表。

properties.steps

ChaosExperimentStep[]

步骤列表。

systemData

systemData

包含 createdBy 和 modifiedBy 信息的 Azure 资源管理器元数据。

tags

object

资源标记。

type

string

资源的类型。 例如“Microsoft.Compute/virtualMachines”或“Microsoft.Storage/storageAccounts”

ExperimentActionType

混沌试验作类型的枚举联合。

说明
continuous
delay
discrete

ExperimentListResult

表示试验资源和分页链接的列表的模型。

名称 类型 说明
nextLink

string (uri)

指向下一页项的链接

value

Experiment[]

此页上的试验项

FilterType

区分筛选器类型的枚举。 目前仅支持 Simple 类型。

说明
Simple

简单筛选器类型。

KeyValuePair

描述作设置的映射。

名称 类型 说明
key

string

minLength: 1

作的设置的名称。

value

string

minLength: 1

作设置的值。

ManagedServiceIdentity

托管服务标识(系统分配和/或用户分配的标识)

名称 类型 说明
principalId

string (uuid)

系统分配标识的服务主体 ID。 此属性仅针对系统分配的标识提供。

tenantId

string (uuid)

系统分配标识的租户 ID。 此属性仅针对系统分配的标识提供。

type

ManagedServiceIdentityType

托管服务标识的类型(其中允许 SystemAssigned 和 UserAssigned 类型)。

userAssignedIdentities

<string,  UserAssignedIdentity>

User-Assigned 标识
与资源关联的用户分配标识集。 userAssignedIdentities 字典密钥将为 ARM 资源 ID,格式为“/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}”。 字典值可以是请求中的空对象({})。

ManagedServiceIdentityType

托管服务标识的类型(其中允许 SystemAssigned 和 UserAssigned 类型)。

说明
None
SystemAssigned
SystemAssigned,UserAssigned
UserAssigned

ProvisioningState

给定 Azure 混沌资源的当前预配状态。

说明
Canceled

资源创建已取消。

Creating

初始创建正在进行中。

Deleting

正在删除。

Failed

资源创建失败。

Succeeded

已创建资源。

Updating

正在进行更新。

SelectorType

选择器类型的枚举。

说明
List

列表选择器类型。

Query

查询选择器类型。

systemData

与创建和上次修改资源相关的元数据。

名称 类型 说明
createdAt

string (date-time)

资源创建时间戳(UTC)。

createdBy

string

创建资源的标识。

createdByType

createdByType

创建资源的标识的类型。

lastModifiedAt

string (date-time)

上次修改的资源时间戳(UTC)

lastModifiedBy

string

上次修改资源的标识。

lastModifiedByType

createdByType

上次修改资源的标识的类型。

TargetReference

表示对选择器中目标的引用的模型。

名称 类型 说明
id

string (arm-id)

目标资源的资源 ID 的字符串。

type

TargetReferenceType

目标引用类型的枚举。

TargetReferenceType

目标引用类型的枚举。

说明
ChaosTarget

混沌目标引用类型。

UserAssignedIdentity

用户分配的标识属性

名称 类型 说明
clientId

string (uuid)

分配的标识的客户端 ID。

principalId

string (uuid)

已分配标识的主体 ID。