Skip to main content

scenarios

Creates, updates, deletes, gets or lists a scenarios resource.

Overview

Namescenarios
TypeResource
Idazure.chaos.scenarios

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringFully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
namestringThe name of the resource.
actionsarrayArray of actions that define the scenario's orchestration. Required.
createdFromstringResource ID of the template version this scenario was created from (optional).
descriptionstringDescription of what this scenario does (optional).
parametersarrayParameter definitions for the scenario. Required.
provisioningStatestringMost 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)
recommendationobjectThe recommendation information for this scenario.
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
typestringThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts".
versionstringVersion of the scenario.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresource_group_name, workspace_name, scenario_name, subscription_idGet a scenario.
list_allselectresource_group_name, workspace_name, subscription_idGet a list of scenarios.
create_or_updateinsertresource_group_name, workspace_name, scenario_name, subscription_idCreate or update a scenario.
create_or_updatereplaceresource_group_name, workspace_name, scenario_name, subscription_idCreate or update a scenario.
deletedeleteresource_group_name, workspace_name, scenario_name, subscription_idDelete 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.

NameDatatypeDescription
resource_group_namestringThe name of the resource group. The name is case insensitive. Required.
scenario_namestringName of the scenario. Required.
subscription_idstring
workspace_namestringString that represents a Workspace resource name. Required.

SELECT examples

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
;

INSERT examples

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
;

REPLACE examples

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 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
;