scenarios
Creates, updates, deletes, gets or lists a scenarios resource.
Overview
| Name | scenarios |
| Type | Resource |
| Id | azure.chaos.scenarios |
Fields
The following fields are returned by SELECT queries:
- get
- list_all
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
actions | array | Array of actions that define the scenario's orchestration. Required. |
createdFrom | string | Resource ID of the template version this scenario was created from (optional). |
description | string | Description of what this scenario does (optional). |
parameters | array | Parameter definitions for the scenario. Required. |
provisioningState | string | Most recent provisioning state for the given scenario resource. Known values are: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting", and "Running". (Succeeded, Failed, Canceled, Creating, Updating, Deleting, Running) |
recommendation | object | The recommendation information for this scenario. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
version | string | Version of the scenario. |
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
actions | array | Array of actions that define the scenario's orchestration. Required. |
createdFrom | string | Resource ID of the template version this scenario was created from (optional). |
description | string | Description of what this scenario does (optional). |
parameters | array | Parameter definitions for the scenario. Required. |
provisioningState | string | Most recent provisioning state for the given scenario resource. Known values are: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting", and "Running". (Succeeded, Failed, Canceled, Creating, Updating, Deleting, Running) |
recommendation | object | The recommendation information for this scenario. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
version | string | Version of the scenario. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | resource_group_name, workspace_name, scenario_name, subscription_id | Get a scenario. | |
list_all | select | resource_group_name, workspace_name, subscription_id | Get a list of scenarios. | |
create_or_update | insert | resource_group_name, workspace_name, scenario_name, subscription_id | Create or update a scenario. | |
create_or_update | replace | resource_group_name, workspace_name, scenario_name, subscription_id | Create or update a scenario. | |
delete | delete | resource_group_name, workspace_name, scenario_name, subscription_id | Delete a scenario. |
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 |
|---|---|---|
resource_group_name | string | The name of the resource group. The name is case insensitive. Required. |
scenario_name | string | Name of the scenario. Required. |
subscription_id | string | |
workspace_name | string | String that represents a Workspace resource name. Required. |
SELECT examples
- get
- list_all
Get a scenario.
SELECT
id,
name,
actions,
createdFrom,
description,
parameters,
provisioningState,
recommendation,
systemData,
type,
version
FROM azure.chaos.scenarios
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND workspace_name = '{{ workspace_name }}' -- required
AND scenario_name = '{{ scenario_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
Get a list of scenarios.
SELECT
id,
name,
actions,
createdFrom,
description,
parameters,
provisioningState,
recommendation,
systemData,
type,
version
FROM azure.chaos.scenarios
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND workspace_name = '{{ workspace_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
INSERT examples
- create_or_update
- Manifest
Create or update a scenario.
INSERT INTO azure.chaos.scenarios (
properties,
resource_group_name,
workspace_name,
scenario_name,
subscription_id
)
SELECT
'{{ properties }}',
'{{ resource_group_name }}',
'{{ workspace_name }}',
'{{ scenario_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
properties,
systemData,
type
;
# Description fields are for documentation purposes
- name: scenarios
props:
- name: resource_group_name
value: "{{ resource_group_name }}"
description: Required parameter for the scenarios resource.
- name: workspace_name
value: "{{ workspace_name }}"
description: Required parameter for the scenarios resource.
- name: scenario_name
value: "{{ scenario_name }}"
description: Required parameter for the scenarios resource.
- name: subscription_id
value: "{{ subscription_id }}"
description: Required parameter for the scenarios resource.
- name: properties
description: |
The properties of scenario.
value:
provisioningState: "{{ provisioningState }}"
createdFrom: "{{ createdFrom }}"
version: "{{ version }}"
description: "{{ description }}"
parameters:
- name: "{{ name }}"
type: "{{ type }}"
default: "{{ default }}"
required: {{ required }}
description: "{{ description }}"
actions:
- name: "{{ name }}"
actionId: "{{ actionId }}"
description: "{{ description }}"
duration: "{{ duration }}"
parameters: "{{ parameters }}"
runAfter:
behavior: "{{ behavior }}"
items_:
- type: "{{ type }}"
name: "{{ name }}"
onActionLifecycle: "{{ onActionLifecycle }}"
waitBefore: "{{ waitBefore }}"
timeout: "{{ timeout }}"
externalResource:
resourceId: "{{ resourceId }}"
recommendation:
recommendationStatus: "{{ recommendationStatus }}"
evaluationRunAt: "{{ evaluationRunAt }}"
REPLACE examples
- create_or_update
Create or update a scenario.
REPLACE azure.chaos.scenarios
SET
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND workspace_name = '{{ workspace_name }}' --required
AND scenario_name = '{{ scenario_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
properties,
systemData,
type;
DELETE examples
- delete
Delete a scenario.
DELETE FROM azure.chaos.scenarios
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND workspace_name = '{{ workspace_name }}' --required
AND scenario_name = '{{ scenario_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;