Skip to content

Commit 2756f8f

Browse files
brrusinoRenzoPrettoMSkazrael2119
authored
Microsoft.Chaos - a few follow-up fixes after TypeSpec migration (#32119)
* removed provisioning state from a few models * fixed based on linting * built from main instead of client * feat: add 2025-01-01 API version with updated capability type properties * chore: fix properties * added back missing provisioningState in preview version * changed inline docs * fixing documentation * feat: add required role definition ids to capability type * Create sdk-suppressions.yaml --------- Co-authored-by: renzopretto <[email protected]> Co-authored-by: kazrael2119 <[email protected]>
1 parent cc5e8fa commit 2756f8f

File tree

60 files changed

+5332
-2
lines changed

Some content is hidden

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

60 files changed

+5332
-2
lines changed

specification/chaos/Chaos.Management/capability.models.tsp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ using TypeSpec.Http;
99
using Azure.ResourceManager;
1010
using Azure.ResourceManager.Foundations;
1111
using TypeSpec.OpenAPI;
12+
using TypeSpec.Versioning;
1213

1314
namespace Microsoft.Chaos;
1415

@@ -31,6 +32,7 @@ alias CapabilityParentResourceParameters = BaseParameters<Capability> &
3132
/**
3233
* Model that represents the Capability properties model.
3334
*/
35+
#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "Unused property, avoids breaking changes in SDK."
3436
model CapabilityProperties {
3537
/**
3638
* String of the Publisher that this Capability extends.
@@ -67,6 +69,7 @@ model CapabilityProperties {
6769
/**
6870
* Resource provisioning state. Not currently in use because resource is created synchronously.
6971
*/
72+
@removed(Microsoft.Chaos.Versions.v2025_01_01)
7073
@visibility("read")
7174
provisioningState?: ProvisioningState;
7275
}

specification/chaos/Chaos.Management/capabilityType.models.tsp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ using TypeSpec.Http;
88
using Azure.ResourceManager;
99
using Azure.ResourceManager.Foundations;
1010
using TypeSpec.OpenAPI;
11+
using TypeSpec.Versioning;
1112

1213
namespace Microsoft.Chaos;
1314

@@ -86,6 +87,13 @@ model CapabilityTypeProperties {
8687
@visibility("read")
8788
azureRbacDataActions?: string[];
8889

90+
/**
91+
* Required Azure Role Definition Ids to execute capability type.
92+
*/
93+
@visibility("read")
94+
@added(Microsoft.Chaos.Versions.v2025_01_01)
95+
requiredAzureRoleDefinitionIds?: string[];
96+
8997
/**
9098
* Runtime properties of this Capability Type.
9199
*/
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
{
2+
"parameters": {
3+
"api-version": "2025-01-01",
4+
"resource": {
5+
"properties": {}
6+
},
7+
"capabilityName": "Shutdown-1.0",
8+
"parentProviderNamespace": "Microsoft.Compute",
9+
"parentResourceName": "exampleVM",
10+
"parentResourceType": "virtualMachines",
11+
"resourceGroupName": "exampleRG",
12+
"subscriptionId": "6b052e15-03d3-4f17-b2e1-be7f07588291",
13+
"targetName": "Microsoft-VirtualMachine"
14+
},
15+
"responses": {
16+
"200": {
17+
"body": {
18+
"name": "Shutdown-1.0",
19+
"type": "Microsoft.Chaos/targets/capabilities",
20+
"id": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Compute/virtualMachines/exampleVM/providers/Microsoft.Chaos/targets/Microsoft-VirtualMachine/capabilities/Shutdown-1.0",
21+
"properties": {
22+
"description": "Shutdown an Azure Virtual Machine for a defined period of time.",
23+
"parametersSchema": "https://schema.centralus.chaos-prod.azure.com/targets/Microsoft-VirtualMachine/capabilities/Shutdown-1.0.json",
24+
"publisher": "Microsoft",
25+
"targetType": "VirtualMachine",
26+
"urn": "urn:csci:microsoft:virtualMachine:shutdown/1.0"
27+
},
28+
"systemData": {
29+
"createdAt": "2020-05-14T05:08:38.4662189Z",
30+
"lastModifiedAt": "2020-05-14T05:08:38.4662189Z"
31+
}
32+
}
33+
},
34+
"201": {
35+
"body": {
36+
"name": "Shutdown-1.0",
37+
"type": "Microsoft.Chaos/targets/capabilities",
38+
"id": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Compute/virtualMachines/exampleVM/providers/Microsoft.Chaos/targets/Microsoft-VirtualMachine/capabilities/Shutdown-1.0",
39+
"properties": {
40+
"description": "Shutdown an Azure Virtual Machine for a defined period of time.",
41+
"parametersSchema": "https://schema.centralus.chaos-prod.azure.com/targets/Microsoft-VirtualMachine/capabilities/Shutdown-1.0.json",
42+
"publisher": "Microsoft",
43+
"targetType": "VirtualMachine",
44+
"urn": "urn:csci:microsoft:virtualMachine:shutdown/1.0"
45+
},
46+
"systemData": {
47+
"createdAt": "2020-05-14T05:08:38.4662189Z",
48+
"lastModifiedAt": "2020-05-14T05:08:38.4662189Z"
49+
}
50+
}
51+
}
52+
},
53+
"operationId": "Capabilities_CreateOrUpdate",
54+
"title": "Create/update a Capability that extends a virtual machine Target resource."
55+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"parameters": {
3+
"api-version": "2025-01-01",
4+
"capabilityName": "Shutdown-1.0",
5+
"parentProviderNamespace": "Microsoft.Compute",
6+
"parentResourceName": "exampleVM",
7+
"parentResourceType": "virtualMachines",
8+
"resourceGroupName": "exampleRG",
9+
"subscriptionId": "6b052e15-03d3-4f17-b2e1-be7f07588291",
10+
"targetName": "Microsoft-VirtualMachine"
11+
},
12+
"responses": {
13+
"200": {},
14+
"204": {}
15+
},
16+
"operationId": "Capabilities_Delete",
17+
"title": "Delete a Capability that extends a virtual machine Target resource."
18+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"parameters": {
3+
"api-version": "2025-01-01",
4+
"capabilityName": "Shutdown-1.0",
5+
"parentProviderNamespace": "Microsoft.Compute",
6+
"parentResourceName": "exampleVM",
7+
"parentResourceType": "virtualMachines",
8+
"resourceGroupName": "exampleRG",
9+
"subscriptionId": "6b052e15-03d3-4f17-b2e1-be7f07588291",
10+
"targetName": "Microsoft-VirtualMachine"
11+
},
12+
"responses": {
13+
"200": {
14+
"body": {
15+
"name": "Shutdown-1.0",
16+
"type": "Microsoft.Chaos/targets/capabilities",
17+
"id": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Compute/virtualMachines/exampleVM/providers/Microsoft.Chaos/targets/Microsoft-VirtualMachine/capabilities/Shutdown-1.0",
18+
"properties": {
19+
"description": "Shutdown an Azure Virtual Machine for a defined period of time.",
20+
"parametersSchema": "https://schema.centralus.chaos-prod.azure.com/targets/Microsoft-VirtualMachine/capabilities/Shutdown-1.0.json",
21+
"publisher": "Microsoft",
22+
"targetType": "VirtualMachine",
23+
"urn": "urn:csci:microsoft:virtualMachine:shutdown/1.0"
24+
},
25+
"systemData": {
26+
"createdAt": "2020-05-14T05:08:38.4662189Z",
27+
"lastModifiedAt": "2020-05-14T05:08:38.4662189Z"
28+
}
29+
}
30+
}
31+
},
32+
"operationId": "Capabilities_Get",
33+
"title": "Get a Capability that extends a virtual machine Target resource."
34+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"parameters": {
3+
"api-version": "2025-01-01",
4+
"parentProviderNamespace": "Microsoft.Compute",
5+
"parentResourceName": "exampleVM",
6+
"parentResourceType": "virtualMachines",
7+
"resourceGroupName": "exampleRG",
8+
"subscriptionId": "6b052e15-03d3-4f17-b2e1-be7f07588291",
9+
"targetName": "Microsoft-VirtualMachine"
10+
},
11+
"responses": {
12+
"200": {
13+
"body": {
14+
"nextLink": "https://management.azure.com/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Compute/virtualMachines/exampleVM/providers/Microsoft.Chaos/targets/Microsoft-VirtualMachine/capabilities?continuationToken=&api-version=2024-11-01-preview",
15+
"value": [
16+
{
17+
"name": "Shutdown-1.0",
18+
"type": "Microsoft.Chaos/targets/capabilities",
19+
"id": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Compute/virtualMachines/exampleVM/providers/Microsoft.Chaos/targets/Microsoft-VirtualMachine/capabilities/Shutdown-1.0",
20+
"properties": {
21+
"description": "Shutdown an Azure Virtual Machine for a defined period of time.",
22+
"parametersSchema": "https://schema.centralus.chaos-prod.azure.com/targets/Microsoft-VirtualMachine/capabilities/Shutdown-1.0.json",
23+
"publisher": "Microsoft",
24+
"targetType": "VirtualMachine",
25+
"urn": "urn:csci:microsoft:virtualMachine:shutdown/1.0"
26+
},
27+
"systemData": {
28+
"createdAt": "2020-05-14T05:08:38.4662189Z",
29+
"lastModifiedAt": "2020-05-14T05:08:38.4662189Z"
30+
}
31+
}
32+
]
33+
}
34+
}
35+
},
36+
"operationId": "Capabilities_List",
37+
"title": "List all Capabilities that extend a virtual machine Target resource."
38+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"parameters": {
3+
"api-version": "2025-01-01",
4+
"capabilityTypeName": "Shutdown-1.0",
5+
"location": "westus2",
6+
"subscriptionId": "6b052e15-03d3-4f17-b2e1-be7f07588291",
7+
"targetTypeName": "Microsoft-VirtualMachine"
8+
},
9+
"responses": {
10+
"200": {
11+
"body": {
12+
"name": "Shutdown-1.0",
13+
"type": "Microsoft.Chaos/locations/targetTypes/capabilityTypes",
14+
"id": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/providers/Microsoft.Chaos/locations/westus2/targetTypes/Microsoft-VirtualMachine/capabilityTypes/Shutdown-1.0",
15+
"properties": {
16+
"description": "Shutdown an Azure Virtual Machine for a defined period of time.",
17+
"displayName": "Shutdown VM",
18+
"kind": "fault",
19+
"parametersSchema": "https://schema.centralus.chaos-prod.azure.com/targets/Microsoft-VirtualMachine/capabilities/Shutdown-1.0.json",
20+
"publisher": "Microsoft",
21+
"runtimeProperties": {
22+
"kind": "continuous"
23+
},
24+
"targetType": "VirtualMachine",
25+
"urn": "urn:csci:microsoft:virtualMachine:shutdown/1.0",
26+
"azureRbacActions": [
27+
"Microsoft.Compute/virtualMachines/poweroff/action",
28+
"Microsoft.Compute/virtualMachines/start/action",
29+
"Microsoft.Compute/virtualMachines/instanceView/read",
30+
"Microsoft.Compute/virtualMachines/read",
31+
"Microsoft.Compute/locations/operations/read"
32+
],
33+
"requiredAzureRoleDefinitionIds": [
34+
"acdd72a7-3385-48ef-bd42-f606fba81ae0"
35+
]
36+
}
37+
}
38+
}
39+
},
40+
"operationId": "CapabilityTypes_Get",
41+
"title": "Get a Capability Type for a virtual machine Target resource on westus2 location."
42+
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"parameters": {
3+
"api-version": "2025-01-01",
4+
"location": "westus2",
5+
"subscriptionId": "6b052e15-03d3-4f17-b2e1-be7f07588291",
6+
"targetTypeName": "Microsoft-VirtualMachine"
7+
},
8+
"responses": {
9+
"200": {
10+
"body": {
11+
"nextLink": "https://management.azure.com/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/providers/Microsoft.Chaos/locations/westus2/targetTypes/Microsoft-VirtualMachine/capabilityTypes?continuationToken=&api-version=2024-11-01-preview",
12+
"value": [
13+
{
14+
"name": "Shutdown-1.0",
15+
"type": "Microsoft.Chaos/locations/targetTypes/capabilityTypes",
16+
"id": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/providers/Microsoft.Chaos/locations/westus2/targetTypes/Microsoft-VirtualMachine/capabilityTypes/Shutdown-1.0",
17+
"properties": {
18+
"description": "Shutdown an Azure Virtual Machine for a defined period of time.",
19+
"displayName": "Shutdown VM",
20+
"kind": "fault",
21+
"parametersSchema": "https://schema.centralus.chaos-prod.azure.com/targets/Microsoft-VirtualMachine/capabilities/Shutdown-1.0.json",
22+
"publisher": "Microsoft",
23+
"runtimeProperties": {
24+
"kind": "continuous"
25+
},
26+
"targetType": "VirtualMachine",
27+
"urn": "urn:csci:microsoft:virtualMachine:shutdown/1.0",
28+
"azureRbacActions": [
29+
"Microsoft.Compute/virtualMachines/poweroff/action",
30+
"Microsoft.Compute/virtualMachines/start/action",
31+
"Microsoft.Compute/virtualMachines/instanceView/read",
32+
"Microsoft.Compute/virtualMachines/read",
33+
"Microsoft.Compute/locations/operations/read"
34+
],
35+
"requiredAzureRoleDefinitionIds": [
36+
"acdd72a7-3385-48ef-bd42-f606fba81ae0"
37+
]
38+
}
39+
}
40+
]
41+
}
42+
}
43+
},
44+
"operationId": "CapabilityTypes_List",
45+
"title": "List all Capability Types for a virtual machine Target resource on westus2 location."
46+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"parameters": {
3+
"api-version": "2025-01-01",
4+
"experimentName": "exampleExperiment",
5+
"resourceGroupName": "exampleRG",
6+
"subscriptionId": "6b052e15-03d3-4f17-b2e1-be7f07588291"
7+
},
8+
"responses": {
9+
"202": {
10+
"headers": {
11+
"Azure-AsyncOperation": "https://management.azure.com/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/myResourceGroup/providers/Microsoft.Chaos/locations/eastus/operationStatus/00000000-0000-0000-0000-000000000000?api-version=2024-11-01-preview",
12+
"Location": "https://management.azure.com/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/myResourceGroup/providers/Microsoft.Chaos/locations/eastus/operationResults/00000000-0000-0000-0000-000000000000?api-version=2024-11-01-preview"
13+
}
14+
}
15+
},
16+
"operationId": "Experiments_Cancel",
17+
"title": "Cancel a running Experiment."
18+
}

0 commit comments

Comments
 (0)