Experiments - Create Or Update
Create or update a Experiment resource.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}?api-version=2024-01-01
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
experiment
|
path | True |
string |
String that represents a Experiment resource name. Regex pattern: |
resource
|
path | True |
string |
String that represents an Azure resource group. Regex pattern: |
subscription
|
path | True |
string |
GUID that represents an Azure subscription ID. Regex pattern: |
api-version
|
query | True |
string |
String that sets the API version. Regex pattern: |
Request Body
Name | Required | Type | Description |
---|---|---|---|
location | True |
string |
The geo-location where the resource lives |
properties.selectors | True | selector[]: |
List of selectors. |
properties.steps | True |
step[] |
List of steps. |
identity |
The identity of the experiment resource. |
||
tags |
object |
Resource tags. |
Responses
Name | Type | Description |
---|---|---|
200 OK |
Long running replace experiment operation. |
|
201 Created |
Long running create experiment operation. |
|
Other Status Codes |
Error response returned if request was unsuccessful. |
Security
azure_auth
Azure Active Directory OAuth2 Flow
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Name | Description |
---|---|
user_impersonation | Impersonate your user account |
Examples
Create/update a Experiment in a resource group.
Sample request
PUT https://management.azure.com/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Chaos/experiments/exampleExperiment?api-version=2024-01-01
{
"location": "eastus2euap",
"identity": {
"type": "SystemAssigned"
},
"properties": {
"steps": [
{
"name": "step1",
"branches": [
{
"name": "branch1",
"actions": [
{
"type": "continuous",
"name": "urn:csci:microsoft:virtualMachine:shutdown/1.0",
"selectorId": "selector1",
"duration": "PT10M",
"parameters": [
{
"key": "abruptShutdown",
"value": "false"
}
]
}
]
}
]
}
],
"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"
}
]
}
]
}
}
Sample response
Azure-AsyncOperation: https://management.azure.com/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/myResourceGroup/providers/Microsoft.Chaos/locations/eastus/operationStatus/00000000-0000-0000-0000-000000000000?api-version=2024-01-01
Location: https://management.azure.com/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/myResourceGroup/providers/Microsoft.Chaos/experiments/00000000-0000-0000-0000-000000000000?api-version=2024-01-01
{
"id": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Chaos/experiments/exampleExperiment",
"type": "Microsoft.Chaos/experiments",
"name": "exampleExperiment",
"location": "eastus2euap",
"identity": {
"type": "SystemAssigned",
"principalId": "d04ab567-2c07-43ef-a7f4-4527626b7f56",
"tenantId": "8c3e2fb2-fe7a-4bf1-b779-d73990782fe6"
},
"properties": {
"provisioningState": "Creating",
"steps": [
{
"name": "step1",
"branches": [
{
"name": "branch1",
"actions": [
{
"type": "continuous",
"name": "urn:csci:microsoft:virtualMachine:shutdown/1.0",
"selectorId": "selector1",
"duration": "PT10M",
"parameters": [
{
"key": "abruptShutdown",
"value": "false"
}
]
}
]
}
]
}
],
"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"
}
]
}
]
},
"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"
}
}
Azure-AsyncOperation: https://management.azure.com/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/myResourceGroup/providers/Microsoft.Chaos/locations/eastus/operationStatus/00000000-0000-0000-0000-000000000000?api-version=2024-01-01
Location: https://management.azure.com/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/myResourceGroup/providers/Microsoft.Chaos/experiments/00000000-0000-0000-0000-000000000000?api-version=2024-01-01
{
"id": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Chaos/experiments/exampleExperiment",
"type": "Microsoft.Chaos/experiments",
"name": "exampleExperiment",
"location": "eastus2euap",
"identity": {
"type": "SystemAssigned",
"principalId": "d04ab567-2c07-43ef-a7f4-4527626b7f56",
"tenantId": "8c3e2fb2-fe7a-4bf1-b779-d73990782fe6"
},
"properties": {
"provisioningState": "Updating",
"steps": [
{
"name": "step1",
"branches": [
{
"name": "branch1",
"actions": [
{
"type": "continuous",
"name": "urn:csci:microsoft:virtualMachine:shutdown/1.0",
"selectorId": "selector1",
"duration": "PT10M",
"parameters": [
{
"key": "abruptShutdown",
"value": "false"
}
]
}
]
}
]
}
],
"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"
}
]
}
]
},
"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"
}
}
Definitions
Name | Description |
---|---|
branch |
Model that represents a branch in the step. 9 total per experiment. |
continuous |
Model that represents a continuous action. |
created |
The type of identity that created the resource. |
delay |
Model that represents a delay action. |
discrete |
Model that represents a discrete action. |
Error |
The resource management error additional info. |
Error |
The error detail. |
Error |
Error response |
experiment |
Model that represents a Experiment resource. |
key |
A map to describe the settings of an action. |
list |
Model that represents a list selector. |
Provisioning |
Most recent provisioning state for the given experiment resource. |
query |
Model that represents a query selector. |
resource |
The identity of a resource. |
Resource |
String of the resource identity type. |
simple |
Model that represents a simple target filter. |
simple |
Model that represents the Simple filter parameters. |
step |
Model that represents a step in the Experiment resource. |
system |
Metadata pertaining to creation and last modification of the resource. |
target |
Model that represents a reference to a Target in the selector. |
Target |
Enum of the Target reference type. |
User |
User assigned identity properties |
branch
Model that represents a branch in the step. 9 total per experiment.
Name | Type | Description |
---|---|---|
actions | action[]: |
List of actions. |
name |
string |
String of the branch name. |
continuousAction
Model that represents a continuous action.
Name | Type | Description |
---|---|---|
duration |
string |
ISO8601 formatted string that represents a duration. |
name |
string |
String that represents a Capability URN. |
parameters |
List of key value pairs. |
|
selectorId |
string |
String that represents a selector. |
type |
string:
continuous |
Enum that discriminates between action models. |
createdByType
The type of identity that created the resource.
Name | Type | Description |
---|---|---|
Application |
string |
|
Key |
string |
|
ManagedIdentity |
string |
|
User |
string |
delayAction
Model that represents a delay action.
Name | Type | Description |
---|---|---|
duration |
string |
ISO8601 formatted string that represents a duration. |
name |
string |
String that represents a Capability URN. |
type |
string:
delay |
Enum that discriminates between action models. |
discreteAction
Model that represents a discrete action.
Name | Type | Description |
---|---|---|
name |
string |
String that represents a Capability URN. |
parameters |
List of key value pairs. |
|
selectorId |
string |
String that represents a selector. |
type |
string:
discrete |
Enum that discriminates between action models. |
ErrorAdditionalInfo
The resource management error additional info.
Name | Type | Description |
---|---|---|
info |
object |
The additional info. |
type |
string |
The additional info type. |
ErrorDetail
The error detail.
Name | Type | Description |
---|---|---|
additionalInfo |
The error additional info. |
|
code |
string |
The error code. |
details |
The error details. |
|
message |
string |
The error message. |
target |
string |
The error target. |
ErrorResponse
Error response
Name | Type | Description |
---|---|---|
error |
The error object. |
experiment
Model that represents a Experiment resource.
Name | Type | Description |
---|---|---|
id |
string |
Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} |
identity |
The identity of the experiment resource. |
|
location |
string |
The geo-location where the resource lives |
name |
string |
The name of the resource |
properties.provisioningState |
Most recent provisioning state for the given experiment resource. |
|
properties.selectors | selector[]: |
List of selectors. |
properties.steps |
step[] |
List of steps. |
systemData |
The system metadata of the experiment resource. |
|
tags |
object |
Resource tags. |
type |
string |
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" |
keyValuePair
A map to describe the settings of an action.
Name | Type | Description |
---|---|---|
key |
string |
The name of the setting for the action. |
value |
string |
The value of the setting for the action. |
listSelector
Model that represents a list selector.
Name | Type | Description |
---|---|---|
filter | filter: |
Model that represents available filter types that can be applied to a targets list. |
id |
string |
String of the selector ID. |
targets |
List of Target references. |
|
type |
string:
List |
Enum of the selector type. |
ProvisioningState
Most recent provisioning state for the given experiment resource.
Name | Type | Description |
---|---|---|
Canceled |
string |
|
Creating |
string |
|
Deleting |
string |
|
Failed |
string |
|
Succeeded |
string |
|
Updating |
string |
querySelector
Model that represents a query selector.
Name | Type | Description |
---|---|---|
filter | filter: |
Model that represents available filter types that can be applied to a targets list. |
id |
string |
String of the selector ID. |
queryString |
string |
Azure Resource Graph (ARG) Query Language query for target resources. |
subscriptionIds |
string[] |
Subscription id list to scope resource query. |
type |
string:
Query |
Enum of the selector type. |
resourceIdentity
The identity of a resource.
Name | Type | Description |
---|---|---|
principalId |
string |
GUID that represents the principal ID of this resource identity. |
tenantId |
string |
GUID that represents the tenant ID of this resource identity. |
type |
String of the resource identity type. |
|
userAssignedIdentities |
<string,
User |
User-Assigned Identities |
ResourceIdentityType
String of the resource identity type.
Name | Type | Description |
---|---|---|
None |
string |
|
SystemAssigned |
string |
|
UserAssigned |
string |
simpleFilter
Model that represents a simple target filter.
Name | Type | Description |
---|---|---|
parameters |
Model that represents the Simple filter parameters. |
|
type |
string:
Simple |
Enum that discriminates between filter types. Currently only |
simpleFilterParameters
Model that represents the Simple filter parameters.
Name | Type | Description |
---|---|---|
zones |
string[] |
List of Azure availability zones to filter targets by. |
step
Model that represents a step in the Experiment resource.
Name | Type | Description |
---|---|---|
branches |
branch[] |
List of branches. |
name |
string |
String of the step name. |
systemData
Metadata pertaining to creation and last modification of the resource.
Name | Type | Description |
---|---|---|
createdAt |
string |
The timestamp of resource creation (UTC). |
createdBy |
string |
The identity that created the resource. |
createdByType |
The type of identity that created the resource. |
|
lastModifiedAt |
string |
The timestamp of resource last modification (UTC) |
lastModifiedBy |
string |
The identity that last modified the resource. |
lastModifiedByType |
The type of identity that last modified the resource. |
targetReference
Model that represents a reference to a Target in the selector.
Name | Type | Description |
---|---|---|
id |
string |
String of the resource ID of a Target resource. |
type |
Enum of the Target reference type. |
TargetReferenceType
Enum of the Target reference type.
Name | Type | Description |
---|---|---|
ChaosTarget |
string |
UserAssignedIdentity
User assigned identity properties
Name | Type | Description |
---|---|---|
clientId |
string |
The client ID of the assigned identity. |
principalId |
string |
The principal ID of the assigned identity. |