Skip to content

Commit 0e3f4a8

Browse files
authored
[Chaos] Create new module: Az.Chaos (#24444)
* create new module: chaos * update * Update * create new module Az.Chaos * create ExampleIssues.csv
1 parent 49d7505 commit 0e3f4a8

File tree

95 files changed

+10370
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+10370
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto

src/Chaos/Chaos.Autorest/.gitignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
bin
2+
obj
3+
.vs
4+
generated
5+
internal
6+
exports
7+
tools
8+
custom/*.psm1
9+
custom/autogen-model-cmdlets
10+
test/*-TestResults.xml
11+
/*.ps1
12+
/*.ps1xml
13+
/*.psm1
14+
/*.snk
15+
/*.csproj
16+
/*.nuspec
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
@{
2+
GUID = 'ca01a43f-b9c7-4e71-a41d-a185e2355c98'
3+
RootModule = './Az.Chaos.psm1'
4+
ModuleVersion = '0.1.0'
5+
CompatiblePSEditions = 'Core', 'Desktop'
6+
Author = 'Microsoft Corporation'
7+
CompanyName = 'Microsoft Corporation'
8+
Copyright = 'Microsoft Corporation. All rights reserved.'
9+
Description = 'Microsoft Azure PowerShell: Chaos cmdlets'
10+
PowerShellVersion = '5.1'
11+
DotNetFrameworkVersion = '4.7.2'
12+
RequiredAssemblies = './bin/Az.Chaos.private.dll'
13+
FormatsToProcess = './Az.Chaos.format.ps1xml'
14+
FunctionsToExport = 'Get-AzChaosCapability', 'Get-AzChaosCapabilityType', 'Get-AzChaosExecutionExperimentDetail', 'Get-AzChaosExperiment', 'Get-AzChaosExperimentExecution', 'Get-AzChaosTarget', 'Get-AzChaosTargetType', 'New-AzChaosActionObject', 'New-AzChaosBranchObject', 'New-AzChaosCapability', 'New-AzChaosExperiment', 'New-AzChaosSelectorObject', 'New-AzChaosStepObject', 'New-AzChaosTarget', 'Remove-AzChaosCapability', 'Remove-AzChaosExperiment', 'Remove-AzChaosTarget', 'Start-AzChaosExperiment', 'Stop-AzChaosExperiment', 'Update-AzChaosCapability', 'Update-AzChaosExperiment', 'Update-AzChaosTarget'
15+
PrivateData = @{
16+
PSData = @{
17+
Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'Chaos'
18+
LicenseUri = 'https://aka.ms/azps-license'
19+
ProjectUri = 'https://github.com/Azure/azure-powershell'
20+
ReleaseNotes = ''
21+
}
22+
}
23+
}

src/Chaos/Chaos.Autorest/README.md

Lines changed: 203 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,203 @@
1+
<!-- region Generated -->
2+
# Az.Chaos
3+
This directory contains the PowerShell module for the Chaos service.
4+
5+
---
6+
## Info
7+
- Modifiable: yes
8+
- Generated: all
9+
- Committed: yes
10+
- Packaged: yes
11+
12+
---
13+
## Detail
14+
This module was primarily generated via [AutoRest](https://github.com/Azure/autorest) using the [PowerShell](https://github.com/Azure/autorest.powershell) extension.
15+
16+
## Module Requirements
17+
- [Az.Accounts module](https://www.powershellgallery.com/packages/Az.Accounts/), version 2.7.5 or greater
18+
19+
## Authentication
20+
AutoRest does not generate authentication code for the module. Authentication is handled via Az.Accounts by altering the HTTP payload before it is sent.
21+
22+
## Development
23+
For information on how to develop for `Az.Chaos`, see [how-to.md](how-to.md).
24+
<!-- endregion -->
25+
26+
### AutoRest Configuration
27+
> see https://aka.ms/autorest
28+
29+
``` yaml
30+
commit: 907b79c0a6a660826e54dc1f16ea14b831b201d2
31+
require:
32+
- $(this-folder)/../../readme.azure.noprofile.md
33+
input-file:
34+
- $(repo)/specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/capabilities.json
35+
- $(repo)/specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/capabilityTypes.json
36+
- $(repo)/specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/experiments.json
37+
- $(repo)/specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/operationStatuses.json
38+
- $(repo)/specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/operations.json
39+
- $(repo)/specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/targetTypes.json
40+
- $(repo)/specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/targets.json
41+
42+
title: Chaos
43+
module-version: 0.1.0
44+
subject-prefix: $(service-name)
45+
46+
identity-correction-for-post: true
47+
48+
directive:
49+
- from: swagger-document
50+
where: $.definitions.TrackedResource.properties.location
51+
transform: >-
52+
return {
53+
"type": "string",
54+
"x-ms-mutability": [
55+
"read",
56+
"create",
57+
"update"
58+
],
59+
"description": "The geo-location where the resource lives"
60+
}
61+
62+
- from: swagger-document
63+
where: $.definitions.target
64+
transform: >-
65+
return {
66+
"type": "object",
67+
"description": "Model that represents a Target resource.",
68+
"allOf": [
69+
{
70+
"$ref": "https://github.com/Azure/azure-rest-api-specs/blob/907b79c0a6a660826e54dc1f16ea14b831b201d2/specification/common-types/resource-management/v2/types.json#/definitions/Resource"
71+
}
72+
],
73+
"properties": {
74+
"systemData": {
75+
"description": "The system metadata of the target resource.",
76+
"$ref": "https://github.com/Azure/azure-rest-api-specs/blob/907b79c0a6a660826e54dc1f16ea14b831b201d2/specification/common-types/resource-management/v2/types.json#/definitions/systemData",
77+
"readOnly": true
78+
},
79+
"location": {
80+
"type": "string",
81+
"description": "Location of the target resource."
82+
},
83+
"properties": {
84+
"description": "The properties of the target resource.",
85+
"x-ms-client-flatten": true,
86+
"$ref": "#/definitions/targetProperties"
87+
}
88+
}
89+
}
90+
91+
- from: swagger-document
92+
where: $.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}"].delete.responses
93+
transform: >-
94+
return {
95+
"200": {
96+
"description": "OK"
97+
},
98+
"202": {
99+
"description": "Asynchronous delete operation."
100+
},
101+
"default": {
102+
"description": "Error response returned if request was unsuccessful.",
103+
"schema": {
104+
"$ref": "https://github.com/Azure/azure-rest-api-specs/blob/907b79c0a6a660826e54dc1f16ea14b831b201d2/specification/common-types/resource-management/v5/types.json#/definitions/ErrorResponse"
105+
}
106+
}
107+
}
108+
109+
- from: swagger-document
110+
where: $.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}"].patch.responses
111+
transform: >-
112+
return {
113+
"200": {
114+
"description": "Long running replace experiment operation.",
115+
"schema": {
116+
"$ref": "./types/experiments.json#/definitions/experiment"
117+
}
118+
},
119+
"202": {
120+
"description": "Long running update operation.",
121+
"schema": {
122+
"$ref": "./types/experiments.json#/definitions/experiment"
123+
}
124+
},
125+
"default": {
126+
"description": "Error response returned if request was unsuccessful.",
127+
"schema": {
128+
"$ref": "https://github.com/Azure/azure-rest-api-specs/blob/907b79c0a6a660826e54dc1f16ea14b831b201d2/specification/common-types/resource-management/v5/types.json#/definitions/ErrorResponse"
129+
}
130+
}
131+
}
132+
133+
- from: swagger-document
134+
where: $.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}/start"].post.responses
135+
transform: >-
136+
return {
137+
"200": {
138+
"description": "Ok.",
139+
"schema": {
140+
"$ref": "./types/experiments.json#/definitions/experiment"
141+
}
142+
},
143+
"202": {
144+
"description": "Long running start experiment operation."
145+
},
146+
"default": {
147+
"description": "Error response returned if request was unsuccessful.",
148+
"schema": {
149+
"$ref": "https://github.com/Azure/azure-rest-api-specs/blob/907b79c0a6a660826e54dc1f16ea14b831b201d2/specification/common-types/resource-management/v5/types.json#/definitions/ErrorResponse"
150+
}
151+
}
152+
}
153+
154+
- from: swagger-document
155+
where: $.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}/cancel"].post.responses
156+
transform: >-
157+
return {
158+
"200": {
159+
"description": "Ok.",
160+
"schema": {
161+
"$ref": "./types/experiments.json#/definitions/experiment"
162+
}
163+
},
164+
"202": {
165+
"description": "Long running start experiment operation."
166+
},
167+
"default": {
168+
"description": "Error response returned if request was unsuccessful.",
169+
"schema": {
170+
"$ref": "https://github.com/Azure/azure-rest-api-specs/blob/907b79c0a6a660826e54dc1f16ea14b831b201d2/specification/common-types/resource-management/v5/types.json#/definitions/ErrorResponse"
171+
}
172+
}
173+
}
174+
175+
- where:
176+
verb: New
177+
subject: Experiment
178+
variant: ^CreateViaIdentityExpanded$|^CreateExpanded$
179+
remove: true
180+
181+
- where:
182+
variant: ^(Create|Update).*(?<!Expanded|JsonFilePath|JsonString)$
183+
remove: true
184+
185+
- where:
186+
verb: Set
187+
remove: true
188+
189+
- where:
190+
subject: OperationStatuses
191+
remove: true
192+
193+
- where:
194+
verb: Invoke
195+
set:
196+
verb: Get
197+
198+
- model-cmdlet:
199+
- model-name: Selector
200+
- model-name: Step
201+
- model-name: Branch
202+
- model-name: Action
203+
```
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
{
2+
"resourceType": "experiments/executions",
3+
"apiVersion": "2024-01-01",
4+
"learnMore": {
5+
"url": "https://learn.microsoft.com/powershell/module/az.chaos"
6+
},
7+
"commands": [
8+
{
9+
"name": "Get-AzChaosExecutionExperimentDetail",
10+
"description": "Execution details of an experiment resource.",
11+
"path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}/executions/{executionId}/getExecutionDetails",
12+
"help": {
13+
"learnMore": {
14+
"url": "https://learn.microsoft.com/powershell/module/az.chaos/get-azchaosexecutionexperimentdetail"
15+
},
16+
"parameterSets": [
17+
{
18+
"parameters": [
19+
"-ExecutionId <String>",
20+
"-ExperimentName <String>",
21+
"-ResourceGroupName <String>",
22+
"[-SubscriptionId <String[]>]"
23+
]
24+
}
25+
]
26+
},
27+
"examples": [
28+
{
29+
"description": "Execution details of an experiment resource.",
30+
"parameters": [
31+
{
32+
"name": "-ExecutionId",
33+
"value": "[Path.executionId]"
34+
},
35+
{
36+
"name": "-ExperimentName",
37+
"value": "[Path.experimentName]"
38+
},
39+
{
40+
"name": "-ResourceGroupName",
41+
"value": "[Path.resourceGroupName]"
42+
},
43+
{
44+
"name": "-SubscriptionId",
45+
"value": "[Path.subscriptionId]"
46+
}
47+
]
48+
}
49+
]
50+
},
51+
{
52+
"name": "Get-AzChaosExperimentExecution",
53+
"description": "Get an execution of an Experiment resource.",
54+
"path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}/executions/{executionId}",
55+
"help": {
56+
"learnMore": {
57+
"url": "https://learn.microsoft.com/powershell/module/az.chaos/get-azchaosexperimentexecution"
58+
},
59+
"parameterSets": [
60+
{
61+
"parameters": [
62+
"-ExecutionId <String>",
63+
"-ExperimentName <String>",
64+
"-ResourceGroupName <String>",
65+
"[-SubscriptionId <String[]>]"
66+
]
67+
}
68+
]
69+
},
70+
"examples": [
71+
{
72+
"description": "Get an execution of an Experiment resource.",
73+
"parameters": [
74+
{
75+
"name": "-ExecutionId",
76+
"value": "[Path.executionId]"
77+
},
78+
{
79+
"name": "-ExperimentName",
80+
"value": "[Path.experimentName]"
81+
},
82+
{
83+
"name": "-ResourceGroupName",
84+
"value": "[Path.resourceGroupName]"
85+
},
86+
{
87+
"name": "-SubscriptionId",
88+
"value": "[Path.subscriptionId]"
89+
}
90+
]
91+
}
92+
]
93+
}
94+
]
95+
}

0 commit comments

Comments
 (0)