You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/chaos-studio/chaos-studio-samples-rest-api.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -70,23 +70,23 @@ az rest --method get --url "https://management.azure.com/subscriptions/{subscrip
70
70
To use a resource in an experiment, you need to enable it as a target.
71
71
72
72
```azurecli
73
-
az rest --method put --url "https://management.azure.com/{resourceId}/providers/Microsoft.Chaos/targetTypes/{targetType}?api-version={apiVersion}" --body "{'properties':{}}"
73
+
az rest --method put --url "https://management.azure.com/{resourceId}/providers/Microsoft.Chaos/targets/{targetType}?api-version={apiVersion}" --body "{'properties':{}}"
74
74
```
75
75
76
76
### Enable capabilities for a target
77
77
78
78
Once a resource has been enabled as a target, you need to specify what capabilities (corresponding to faults) are allowed.
79
79
80
80
```azurecli
81
-
az rest --method put --url "https://management.azure.com/{resourceId}/providers/Microsoft.Chaos/targetTypes/{targetType}/capabilities/{capabilityName}?api-version={apiVersion}" --body "{'properties':{}}"
81
+
az rest --method put --url "https://management.azure.com/{resourceId}/providers/Microsoft.Chaos/targets/{targetType}/capabilities/{capabilityName}?api-version={apiVersion}" --body "{'properties':{}}"
82
82
```
83
83
84
84
### See what capabilities are enabled for a target
85
85
86
86
Once a target and capabilities have been enabled, you can view the enabled capabilities. This is useful for constructing your chaos experiment, since it includes the parameter schema for each fault.
87
87
88
88
```azurecli
89
-
az rest --method get --url "https://management.azure.com/{resourceId}/providers/Microsoft.Chaos/targetTypes/{targetType}/capabilities?api-version={apiVersion}"
89
+
az rest --method get --url "https://management.azure.com/{resourceId}/providers/Microsoft.Chaos/targets/{targetType}/capabilities?api-version={apiVersion}"
90
90
```
91
91
92
92
## Experiments
@@ -114,7 +114,7 @@ az rest --method put --url "https://management.azure.com/{experimentId}?api-vers
114
114
### Delete an experiment
115
115
116
116
```azurecli
117
-
az rest --method delete --url "https://management.azure.com/{experimentId}?api-version={apiVersion}" --verbose
117
+
az rest --method delete --url "https://management.azure.com/{experimentId}?api-version={apiVersion}"
118
118
```
119
119
120
120
### Start an experiment
@@ -134,7 +134,7 @@ az rest --method get --url "https://management.azure.com/{experimentId}/executio
134
134
If an experiment has failed, this can be used to find error messages and specific targets, branches, steps, or actions that failed.
135
135
136
136
```azurecli
137
-
az rest --method get --url "https://management.azure.com/{experimentId}/executions/{executionDetailsId}?api-version={apiVersion}"
137
+
az rest --method post --url "https://management.azure.com/{experimentId}/executions/{executionDetailsId}/getExecutionDetails?api-version={apiVersion}"
138
138
```
139
139
140
140
### Cancel (stop) an experiment
@@ -149,10 +149,10 @@ While these commands don't use the Chaos Studio API specifically, they can be he
149
149
150
150
### View Chaos Studio resources with Azure Resource Graph
151
151
152
-
You can use the Azure Resource Graph [REST API](../governance/resource-graph/first-query-rest-api.md) to query resources used by Chaos Studio.
152
+
You can use the Azure Resource Graph [REST API](../governance/resource-graph/first-query-rest-api.md) to query resources associated with Chaos Studio, like targets and capabilities.
153
153
154
154
```azurecli
155
-
az rest --method post --url https://management.azure.com/providers/Microsoft.ResourceGraph/resources?api-version=2021-03-01 --body "{\"subscriptions\":[\"{subscriptionId}\"],\"query\":\"chaosresources \"}"
155
+
az rest --method post --url "https://management.azure.com/providers/Microsoft.ResourceGraph/resources?api-version=2021-03-01" --body "{'query':'chaosresources'}"
156
156
```
157
157
158
158
Alternatively, you can use Azure Resource Graph's `az cli`[extension](../governance/resource-graph/first-query-azurecli.md).
0 commit comments