Skip to content

Commit 7f910c1

Browse files
CelinadhhCelina Zhaorobga
authored
Update Swagger for Updated PolicyAssignment and PolicyTokens API (#39843)
* 2025-11-01 * readme * add policy action * examples * fix api version in example * generated openapi.json * nit * nit * nit * fix tests * Add selfServeExemptionSettings to policyAssignment properties * Fixed update model and json format * Address the linter errors * Change back to boolean --------- Co-authored-by: Celina Zhao <zhaocelina@microsoft.com> Co-authored-by: Robert Gao <robga@microsoft.com>
1 parent c9dee80 commit 7f910c1

157 files changed

Lines changed: 16880 additions & 43 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
{
2+
"parameters": {
3+
"api-version": "2025-11-01",
4+
"parameters": {
5+
"operation": {
6+
"httpMethod": "delete",
7+
"uri": "https://management.azure.com/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/resourceGroups/testRG/providers/Microsoft.Compute/virtualMachines/testVM?api-version=2024-01-01"
8+
}
9+
},
10+
"subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2"
11+
},
12+
"responses": {
13+
"200": {
14+
"body": {
15+
"result": "Succeeded",
16+
"requestDetails": {
17+
"uri": "https://management.azure.com/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/resourceGroups/testRG/providers/Microsoft.Compute/virtualMachines/testVM?api-version=2024-01-01",
18+
"resourceId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/resourceGroups/testRG/providers/Microsoft.Compute/virtualMachines/testVM",
19+
"apiVersion": "2024-01-01",
20+
"authorizationAction": "Microsoft.Compute/virtualMachines/delete",
21+
"httpMethod": "DELETE",
22+
"contentHash": "0000000000000000000000000000000000000000000000000000000000000000"
23+
},
24+
"results": [
25+
{
26+
"policyInfo": {
27+
"policyAssignmentId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/3f2def86",
28+
"policyDefinitionId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/5ed64d02",
29+
"policyDefinitionEffect": "denyAction"
30+
},
31+
"result": "Succeeded",
32+
"endpointKind": "CoinFlip",
33+
"message": "Coin flip successful (success probability: '1').",
34+
"claims": {
35+
"date": "2025-01-01T19:30:00.00Z",
36+
"double": 0.99,
37+
"int": 2,
38+
"isValid": false,
39+
"string": "testString",
40+
"testArray": [
41+
"Apple",
42+
"Banana",
43+
"Cherry"
44+
],
45+
"testObject": {
46+
"name": "Complex Object",
47+
"id": 12345,
48+
"details": {
49+
"createdBy": "John Doe",
50+
"createdDate": "2024-12-13T12:00:00Z",
51+
"metadata": {
52+
"isActive": true,
53+
"tags": [
54+
"example",
55+
"test",
56+
"object"
57+
],
58+
"version": "1.0.0"
59+
}
60+
}
61+
}
62+
},
63+
"policyAction": "Allow",
64+
"policyEvaluationDetails": {
65+
"evaluatedExpressions": [
66+
{
67+
"result": "False",
68+
"expressionKind": "Value",
69+
"expression": "[claims().isValid]",
70+
"expressionValue": false,
71+
"targetValue": "True",
72+
"operator": "Equals"
73+
}
74+
]
75+
},
76+
"additionalInfo": {
77+
"successProbability": 1.0
78+
},
79+
"expiration": "2025-01-01T21:30:00.00Z"
80+
}
81+
],
82+
"token": "PT 1.ey7zmVse52pjMKPQd5m2uiNjz5UV2pZ.LPGtRiTeuCDBomEVbzj9kIaL9odEmlNv4D9VzyrQLTAyv4HHnUR7oNytWnL.AQrZ5bSGAQZzr8eySqvugzrD-ceRVL311SL3Nn6f-4c9kgPgU_u1ArXQKW25QCxMlsAuWmaE",
83+
"tokenId": "0da8a969-c660-4de0-a6a4-b2034d4325e4",
84+
"expiration": "2025-01-01T21:30:00.00Z"
85+
}
86+
}
87+
},
88+
"operationId": "PolicyTokens_Acquire",
89+
"title": "Acquire a policy token"
90+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
{
2+
"parameters": {
3+
"api-version": "2025-11-01",
4+
"managementGroupName": "MyManagementGroup",
5+
"parameters": {
6+
"operation": {
7+
"httpMethod": "delete",
8+
"uri": "https://management.azure.com/providers/Microsoft.Management/managementGroups/MyManagementGroup/providers/Microsoft.Authorization/roleAssignments/00000000-0000-0000-0000-000000000000?api-version=2022-04-01"
9+
}
10+
}
11+
},
12+
"responses": {
13+
"200": {
14+
"body": {
15+
"result": "Succeeded",
16+
"requestDetails": {
17+
"uri": "https://management.azure.com/providers/Microsoft.Management/managementGroups/MyManagementGroup/providers/Microsoft.Authorization/roleAssignments/00000000-0000-0000-0000-000000000000?api-version=2022-04-01",
18+
"resourceId": "/providers/Microsoft.Management/managementGroups/MyManagementGroup/providers/Microsoft.Authorization/roleAssignments/00000000-0000-0000-0000-000000000000",
19+
"apiVersion": "2022-04-01",
20+
"authorizationAction": "Microsoft.Authorization/roleAssignments/delete",
21+
"httpMethod": "DELETE",
22+
"contentHash": "0000000000000000000000000000000000000000000000000000000000000000"
23+
},
24+
"results": [
25+
{
26+
"policyInfo": {
27+
"policyAssignmentId": "/providers/Microsoft.Management/managementGroups/MyManagementGroup/providers/Microsoft.Authorization/policyAssignments/3f2def86",
28+
"policyDefinitionId": "/providers/Microsoft.Management/managementGroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/5ed64d02",
29+
"policyDefinitionEffect": "denyAction"
30+
},
31+
"result": "Succeeded",
32+
"endpointKind": "CoinFlip",
33+
"message": "Coin flip successful (success probability: '1').",
34+
"claims": {
35+
"date": "2025-01-01T19:30:00.00Z",
36+
"double": 0.99,
37+
"int": 2,
38+
"isValid": false,
39+
"string": "testString",
40+
"testArray": [
41+
"Apple",
42+
"Banana",
43+
"Cherry"
44+
],
45+
"testObject": {
46+
"name": "Complex Object",
47+
"id": 12345,
48+
"details": {
49+
"createdBy": "John Doe",
50+
"createdDate": "2024-12-13T12:00:00Z",
51+
"metadata": {
52+
"isActive": true,
53+
"tags": [
54+
"example",
55+
"test",
56+
"object"
57+
],
58+
"version": "1.0.0"
59+
}
60+
}
61+
}
62+
},
63+
"policyAction": "Allow",
64+
"policyEvaluationDetails": {
65+
"evaluatedExpressions": [
66+
{
67+
"result": "False",
68+
"expressionKind": "Value",
69+
"expression": "[claims().isValid]",
70+
"expressionValue": false,
71+
"targetValue": "True",
72+
"operator": "Equals"
73+
}
74+
]
75+
},
76+
"additionalInfo": {
77+
"successProbability": 1.0
78+
},
79+
"expiration": "2025-01-01T21:30:00.00Z"
80+
}
81+
],
82+
"token": "PT 1.ey7zmVse52pjMKPQd5m2uiNjz5UV2pZ.LPGtRiTeuCDBomEVbzj9kIaL9odEmlNv4D9VzyrQLTAyv4HHnUR7oNytWnL.AQrZ5bSGAQZzr8eySqvugzrD-ceRVL311SL3Nn6f-4c9kgPgU_u1ArXQKW25QCxMlsAuWmaE",
83+
"tokenId": "0da8a969-c660-4de0-a6a4-b2034d4325e4",
84+
"expiration": "2025-01-01T21:30:00.00Z"
85+
}
86+
}
87+
},
88+
"operationId": "PolicyTokens_AcquireAtManagementGroup",
89+
"title": "Acquire a policy token at management group level"
90+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
{
2+
"parameters": {
3+
"api-version": "2025-11-01",
4+
"parameters": {
5+
"properties": {
6+
"description": "Force resource names to begin with given 'prefix' and/or end with given 'suffix'",
7+
"displayName": "Enforce resource naming convention",
8+
"metadata": {
9+
"category": "Naming"
10+
},
11+
"mode": "All",
12+
"parameters": {
13+
"prefix": {
14+
"type": "String",
15+
"metadata": {
16+
"description": "Resource name prefix",
17+
"displayName": "Prefix"
18+
}
19+
},
20+
"suffix": {
21+
"type": "String",
22+
"metadata": {
23+
"description": "Resource name suffix",
24+
"displayName": "Suffix"
25+
}
26+
}
27+
},
28+
"policyRule": {
29+
"if": {
30+
"not": {
31+
"field": "name",
32+
"like": "[concat(parameters('prefix'), '*', parameters('suffix'))]"
33+
}
34+
},
35+
"then": {
36+
"effect": "deny"
37+
}
38+
}
39+
}
40+
},
41+
"policyDefinitionName": "ResourceNaming",
42+
"subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2"
43+
},
44+
"responses": {
45+
"201": {
46+
"body": {
47+
"name": "ResourceNaming",
48+
"type": "Microsoft.Authorization/policyDefinitions",
49+
"id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming",
50+
"properties": {
51+
"description": "Force resource names to begin with 'prefix' and end with 'suffix'",
52+
"displayName": "Naming Convention",
53+
"metadata": {
54+
"category": "Naming"
55+
},
56+
"mode": "All",
57+
"parameters": {
58+
"prefix": {
59+
"type": "String",
60+
"metadata": {
61+
"description": "Resource name prefix",
62+
"displayName": "Prefix"
63+
}
64+
},
65+
"suffix": {
66+
"type": "String",
67+
"metadata": {
68+
"description": "Resource name suffix",
69+
"displayName": "Suffix"
70+
}
71+
}
72+
},
73+
"policyRule": {
74+
"if": {
75+
"not": {
76+
"field": "name",
77+
"like": "[concat(parameters('prefix'), '*', parameters('suffix'))]"
78+
}
79+
},
80+
"then": {
81+
"effect": "deny"
82+
}
83+
},
84+
"policyType": "Custom",
85+
"version": "1.2.1",
86+
"versions": [
87+
"1.2.1",
88+
"1.0.0"
89+
]
90+
}
91+
},
92+
"headers": {}
93+
}
94+
},
95+
"operationId": "PolicyDefinitions_CreateOrUpdate",
96+
"title": "Create or update a policy definition"
97+
}

0 commit comments

Comments
 (0)