scenario_configurations
Creates, updates, deletes, gets or lists a scenario_configurations resource.
Overview
| Name | scenario_configurations |
| Type | Resource |
| Id | azure.chaos.scenario_configurations |
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. |
exclusions | object | Exclusion criteria for protecting resources from fault injection. |
filters | object | Filter criteria used to constrain which discovered resources participate in fault injection. |
parameters | array | Runtime parameter values for the scenario. Keys must match parameter names defined in the scenario. |
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) |
scenarioId | string | Resource ID of the scenario this configuration applies to. Required. |
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". |
| 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. |
exclusions | object | Exclusion criteria for protecting resources from fault injection. |
filters | object | Filter criteria used to constrain which discovered resources participate in fault injection. |
parameters | array | Runtime parameter values for the scenario. Keys must match parameter names defined in the scenario. |
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) |
scenarioId | string | Resource ID of the scenario this configuration applies to. Required. |
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". |
Methods
The following methods are available for this resource:
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_configuration_name | string | Name of the scenario definition. 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 definition.
SELECT
id,
name,
exclusions,
filters,
parameters,
provisioningState,
scenarioId,
systemData,
type
FROM azure.chaos.scenario_configurations
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND workspace_name = '{{ workspace_name }}' -- required
AND scenario_name = '{{ scenario_name }}' -- required
AND scenario_configuration_name = '{{ scenario_configuration_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
Get a list of scenario definitions.
SELECT
id,
name,
exclusions,
filters,
parameters,
provisioningState,
scenarioId,
systemData,
type
FROM azure.chaos.scenario_configurations
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
;
INSERT examples
- create_or_update
- Manifest
Create or update a scenario definition.
INSERT INTO azure.chaos.scenario_configurations (
properties,
resource_group_name,
workspace_name,
scenario_name,
scenario_configuration_name,
subscription_id
)
SELECT
'{{ properties }}',
'{{ resource_group_name }}',
'{{ workspace_name }}',
'{{ scenario_name }}',
'{{ scenario_configuration_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
properties,
systemData,
type
;
# Description fields are for documentation purposes
- name: scenario_configurations
props:
- name: resource_group_name
value: "{{ resource_group_name }}"
description: Required parameter for the scenario_configurations resource.
- name: workspace_name
value: "{{ workspace_name }}"
description: Required parameter for the scenario_configurations resource.
- name: scenario_name
value: "{{ scenario_name }}"
description: Required parameter for the scenario_configurations resource.
- name: scenario_configuration_name
value: "{{ scenario_configuration_name }}"
description: Required parameter for the scenario_configurations resource.
- name: subscription_id
value: "{{ subscription_id }}"
description: Required parameter for the scenario_configurations resource.
- name: properties
description: |
The properties of scenario definition.
value:
scenarioId: "{{ scenarioId }}"
parameters:
- key: "{{ key }}"
value: "{{ value }}"
exclusions:
resources:
- "{{ resources }}"
tags:
- key: "{{ key }}"
value: "{{ value }}"
types:
- "{{ types }}"
provisioningState: "{{ provisioningState }}"
filters:
locations:
- "{{ locations }}"
zones:
- "{{ zones }}"
physicalZones:
- "{{ physicalZones }}"
REPLACE examples
- create_or_update
Create or update a scenario definition.
REPLACE azure.chaos.scenario_configurations
SET
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND workspace_name = '{{ workspace_name }}' --required
AND scenario_name = '{{ scenario_name }}' --required
AND scenario_configuration_name = '{{ scenario_configuration_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
properties,
systemData,
type;
DELETE examples
- delete
Delete a scenario definition.
DELETE FROM azure.chaos.scenario_configurations
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND workspace_name = '{{ workspace_name }}' --required
AND scenario_name = '{{ scenario_name }}' --required
AND scenario_configuration_name = '{{ scenario_configuration_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;
Lifecycle Methods
- execute
- validate
- fix_resource_permissions
Execute the scenario execution with the given scenario configuration.
EXEC azure.chaos.scenario_configurations.execute
@resource_group_name='{{ resource_group_name }}' --required,
@workspace_name='{{ workspace_name }}' --required,
@scenario_name='{{ scenario_name }}' --required,
@scenario_configuration_name='{{ scenario_configuration_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;
Validate the given scenario configuration.
EXEC azure.chaos.scenario_configurations.validate
@resource_group_name='{{ resource_group_name }}' --required,
@workspace_name='{{ workspace_name }}' --required,
@scenario_name='{{ scenario_name }}' --required,
@scenario_configuration_name='{{ scenario_configuration_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;
Fixes resource permissions for the given scenario configuration.
EXEC azure.chaos.scenario_configurations.fix_resource_permissions
@resource_group_name='{{ resource_group_name }}' --required,
@workspace_name='{{ workspace_name }}' --required,
@scenario_name='{{ scenario_name }}' --required,
@scenario_configuration_name='{{ scenario_configuration_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
@@json=
'{
"whatIf": {{ whatIf }}
}'
;