Skip to main content

experiments

Creates, updates, deletes, gets or lists an experiments resource.

Overview

Nameexperiments
TypeResource
Idazure.chaos.experiments

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.
provisioningStatestringResource provisioning state. Not currently in use for executions. Known values are: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting", and "Running". (Succeeded, Failed, Canceled, Creating, Updating, Deleting, Running)
startedAtstring (date-time)String that represents the start date time.
statusstringThe status of the execution.
stoppedAtstring (date-time)String that represents the stop date time.
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
typestringThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts".

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_executionselectresource_group_name, experiment_name, execution_id, subscription_idGet an execution of an Experiment resource.
getselectresource_group_name, experiment_name, subscription_idGet a Experiment resource.
listselectresource_group_name, subscription_idrunning, continuationTokenGet a list of Experiment resources in a resource group.
list_allselectsubscription_idrunning, continuationTokenGet a list of Experiment resources in a subscription.
create_or_updateinsertresource_group_name, experiment_name, subscription_id, location, propertiesCreate or update a Experiment resource.
updateupdateresource_group_name, experiment_name, subscription_idThe operation to update an experiment.
create_or_updatereplaceresource_group_name, experiment_name, subscription_id, location, propertiesCreate or update a Experiment resource.
deletedeleteresource_group_name, experiment_name, subscription_idDelete a Experiment resource.
list_all_executionsexecresource_group_name, experiment_name, subscription_idGet a list of executions of an Experiment resource.
cancelexecresource_group_name, experiment_name, subscription_idCancel a running Experiment resource.
startexecresource_group_name, experiment_name, subscription_idStart a Experiment resource.
execution_detailsexecresource_group_name, experiment_name, execution_id, subscription_idExecution details of an experiment 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.

NameDatatypeDescription
execution_idstringGUID that represents a Experiment execution detail. Required.
experiment_namestringString that represents a Experiment resource name. Required.
resource_group_namestringThe name of the resource group. The name is case insensitive. Required.
subscription_idstring
continuationTokenstringString that sets the continuation token. Default value is None.
runningbooleanOptional value that indicates whether to filter results based on if the Experiment is currently running. If null, then the results will not be filtered. Default value is None.

SELECT examples

Get an execution of an Experiment resource.

SELECT
id,
name,
provisioningState,
startedAt,
status,
stoppedAt,
systemData,
type
FROM azure.chaos.experiments
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND experiment_name = '{{ experiment_name }}' -- required
AND execution_id = '{{ execution_id }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;

INSERT examples

Create or update a Experiment resource.

INSERT INTO azure.chaos.experiments (
tags,
location,
identity,
properties,
resource_group_name,
experiment_name,
subscription_id
)
SELECT
'{{ tags }}',
'{{ location }}' /* required */,
'{{ identity }}',
'{{ properties }}' /* required */,
'{{ resource_group_name }}',
'{{ experiment_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
identity,
location,
properties,
systemData,
tags,
type
;

UPDATE examples

The operation to update an experiment.

UPDATE azure.chaos.experiments
SET
tags = '{{ tags }}',
identity = '{{ identity }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND experiment_name = '{{ experiment_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
identity,
location,
properties,
systemData,
tags,
type;

REPLACE examples

Create or update a Experiment resource.

REPLACE azure.chaos.experiments
SET
tags = '{{ tags }}',
location = '{{ location }}',
identity = '{{ identity }}',
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND experiment_name = '{{ experiment_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
AND location = '{{ location }}' --required
AND properties = '{{ properties }}' --required
RETURNING
id,
name,
identity,
location,
properties,
systemData,
tags,
type;

DELETE examples

Delete a Experiment resource.

DELETE FROM azure.chaos.experiments
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND experiment_name = '{{ experiment_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;

Lifecycle Methods

Get a list of executions of an Experiment resource.

EXEC azure.chaos.experiments.list_all_executions 
@resource_group_name='{{ resource_group_name }}' --required,
@experiment_name='{{ experiment_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;