-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update policy assignments and exemptions api-version to support selec…
…tors and overrides (#20672) * Port previous version exemptions and assignments * Update assignments and exemptions api-version * fix file name casing * Trigger checks * Addressed comments * Addressed comment * Addressed comments * Fixed the merge error
- Loading branch information
Showing
41 changed files
with
3,941 additions
and
1 deletion.
There are no files selected for viewing
115 changes: 115 additions & 0 deletions
115
specification/resources/resource-manager/Microsoft.Authorization/common/v1/types.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
{ | ||
"swagger": "2.0", | ||
"info": { | ||
"title": "PolicyClient", | ||
"version": "v1" | ||
}, | ||
"paths": {}, | ||
"definitions": { | ||
"Selector": { | ||
"description": "The selector expression.", | ||
"type": "object", | ||
"properties": { | ||
"kind": { | ||
"type": "string", | ||
"description": "The selector kind.", | ||
"enum": [ | ||
"resourceLocation", | ||
"resourceType", | ||
"resourceWithoutLocation", | ||
"policyDefinitionReferenceId" | ||
], | ||
"x-ms-enum": { | ||
"name": "SelectorKind", | ||
"modelAsString": true, | ||
"values": [ | ||
{ | ||
"value": "resourceLocation", | ||
"description": "The selector kind to filter policies by the resource location." | ||
}, | ||
{ | ||
"value": "resourceType", | ||
"description": "The selector kind to filter policies by the resource type." | ||
}, | ||
{ | ||
"value": "resourceWithoutLocation", | ||
"description": "The selector kind to filter policies by the resource without location." | ||
}, | ||
{ | ||
"value": "policyDefinitionReferenceId", | ||
"description": "The selector kind to filter policies by the policy definition reference ID." | ||
} | ||
] | ||
} | ||
}, | ||
"in": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
}, | ||
"description": "The list of values to filter in." | ||
}, | ||
"notIn": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
}, | ||
"description": "The list of values to filter out." | ||
} | ||
} | ||
}, | ||
"ResourceSelector": { | ||
"description": "The resource selector to filter policies by resource properties.", | ||
"type": "object", | ||
"properties": { | ||
"name": { | ||
"type": "string", | ||
"description": "The name of the resource selector." | ||
}, | ||
"selectors": { | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/definitions/Selector" | ||
}, | ||
"x-ms-identifiers": [], | ||
"description": "The list of the selector expressions." | ||
} | ||
} | ||
}, | ||
"Override": { | ||
"description": "The policy property value override.", | ||
"type": "object", | ||
"properties": { | ||
"kind": { | ||
"type": "string", | ||
"description": "The override kind.", | ||
"enum": [ | ||
"policyEffect" | ||
], | ||
"x-ms-enum": { | ||
"name": "OverrideKind", | ||
"modelAsString": true, | ||
"values": [ | ||
{ | ||
"value": "policyEffect", | ||
"description": "It will override the policy effect type." | ||
} | ||
] | ||
} | ||
}, | ||
"value": { | ||
"type": "string", | ||
"description": "The value to override the policy property." | ||
}, | ||
"selectors": { | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/definitions/Selector" | ||
}, | ||
"x-ms-identifiers": [], | ||
"description": "The list of the selector expressions." | ||
} | ||
} | ||
} | ||
} | ||
} |
79 changes: 79 additions & 0 deletions
79
...soft.Authorization/preview/2022-07-01-preview/examples/createOrUpdatePolicyExemption.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
{ | ||
"parameters": { | ||
"scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/resourceGroups/demoCluster", | ||
"policyExemptionName": "DemoExpensiveVM", | ||
"api-version": "2022-07-01-preview", | ||
"parameters": { | ||
"properties": { | ||
"policyAssignmentId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/CostManagement", | ||
"policyDefinitionReferenceIds": [ | ||
"Limit_Skus" | ||
], | ||
"exemptionCategory": "Waiver", | ||
"displayName": "Exempt demo cluster", | ||
"description": "Exempt demo cluster from limit sku", | ||
"metadata": { | ||
"reason": "Temporary exemption for a expensive VM demo" | ||
} | ||
} | ||
} | ||
}, | ||
"responses": { | ||
"201": { | ||
"headers": {}, | ||
"body": { | ||
"properties": { | ||
"policyAssignmentId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/CostManagement", | ||
"policyDefinitionReferenceIds": [ | ||
"Limit_Skus" | ||
], | ||
"exemptionCategory": "Waiver", | ||
"displayName": "Exempt demo cluster", | ||
"description": "Exempt demo cluster from limit sku", | ||
"metadata": { | ||
"reason": "Temporary exemption for a expensive VM demo" | ||
} | ||
}, | ||
"systemData": { | ||
"createdBy": "string", | ||
"createdByType": "User", | ||
"createdAt": "2020-07-01T01:01:01.1075056Z", | ||
"lastModifiedBy": "string", | ||
"lastModifiedByType": "User", | ||
"lastModifiedAt": "2020-07-01T01:01:01.1075056Z" | ||
}, | ||
"id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/resourceGroups/demoCluster/providers/Microsoft.Authorization/policyExemptions/DemoExpensiveVM", | ||
"type": "Microsoft.Authorization/policyExemptions", | ||
"name": "DemoExpensiveVM" | ||
} | ||
}, | ||
"200": { | ||
"headers": {}, | ||
"body": { | ||
"properties": { | ||
"policyAssignmentId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/CostManagement", | ||
"policyDefinitionReferenceIds": [ | ||
"Limit_Skus" | ||
], | ||
"exemptionCategory": "Waiver", | ||
"displayName": "Exempt demo cluster", | ||
"description": "Exempt demo cluster from limit sku", | ||
"metadata": { | ||
"reason": "Temporary exemption for a expensive VM demo" | ||
} | ||
}, | ||
"systemData": { | ||
"createdBy": "string", | ||
"createdByType": "User", | ||
"createdAt": "2020-07-01T01:01:01.1075056Z", | ||
"lastModifiedBy": "string", | ||
"lastModifiedByType": "User", | ||
"lastModifiedAt": "2020-07-01T02:01:01.1075056Z" | ||
}, | ||
"id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/resourceGroups/demoCluster/providers/Microsoft.Authorization/policyExemptions/DemoExpensiveVM", | ||
"type": "Microsoft.Authorization/policyExemptions", | ||
"name": "DemoExpensiveVM" | ||
} | ||
} | ||
} | ||
} |
124 changes: 124 additions & 0 deletions
124
...eview/2022-07-01-preview/examples/createOrUpdatePolicyExemptionWithResourceSelectors.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
{ | ||
"parameters": { | ||
"scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/resourceGroups/demoCluster", | ||
"policyExemptionName": "DemoExpensiveVM", | ||
"api-version": "2022-07-01-preview", | ||
"parameters": { | ||
"properties": { | ||
"policyAssignmentId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/CostManagement", | ||
"policyDefinitionReferenceIds": [ | ||
"Limit_Skus" | ||
], | ||
"exemptionCategory": "Waiver", | ||
"displayName": "Exempt demo cluster", | ||
"description": "Exempt demo cluster from limit sku", | ||
"metadata": { | ||
"reason": "Temporary exemption for a expensive VM demo" | ||
}, | ||
"assignmentScopeValidation": "Default", | ||
"resourceSelectors": [ | ||
{ | ||
"name": "SDPRegions", | ||
"selectors": [ | ||
{ | ||
"kind": "resourceLocation", | ||
"in": [ | ||
"eastus2euap", | ||
"centraluseuap" | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"responses": { | ||
"201": { | ||
"headers": {}, | ||
"body": { | ||
"properties": { | ||
"policyAssignmentId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/CostManagement", | ||
"policyDefinitionReferenceIds": [ | ||
"Limit_Skus" | ||
], | ||
"exemptionCategory": "Waiver", | ||
"displayName": "Exempt demo cluster", | ||
"description": "Exempt demo cluster from limit sku", | ||
"metadata": { | ||
"reason": "Temporary exemption for a expensive VM demo" | ||
}, | ||
"assignmentScopeValidation": "Default", | ||
"resourceSelectors": [ | ||
{ | ||
"name": "SDPRegions", | ||
"selectors": [ | ||
{ | ||
"kind": "resourceLocation", | ||
"in": [ | ||
"eastus2euap", | ||
"centraluseuap" | ||
] | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
"systemData": { | ||
"createdBy": "string", | ||
"createdByType": "User", | ||
"createdAt": "2020-07-01T01:01:01.1075056Z", | ||
"lastModifiedBy": "string", | ||
"lastModifiedByType": "User", | ||
"lastModifiedAt": "2020-07-01T01:01:01.1075056Z" | ||
}, | ||
"id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/resourceGroups/demoCluster/providers/Microsoft.Authorization/policyExemptions/DemoExpensiveVM", | ||
"type": "Microsoft.Authorization/policyExemptions", | ||
"name": "DemoExpensiveVM" | ||
} | ||
}, | ||
"200": { | ||
"headers": {}, | ||
"body": { | ||
"properties": { | ||
"policyAssignmentId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/CostManagement", | ||
"policyDefinitionReferenceIds": [ | ||
"Limit_Skus" | ||
], | ||
"exemptionCategory": "Waiver", | ||
"displayName": "Exempt demo cluster", | ||
"description": "Exempt demo cluster from limit sku", | ||
"metadata": { | ||
"reason": "Temporary exemption for a expensive VM demo" | ||
}, | ||
"assignmentScopeValidation": "Default", | ||
"resourceSelectors": [ | ||
{ | ||
"name": "SDPRegions", | ||
"selectors": [ | ||
{ | ||
"kind": "resourceLocation", | ||
"in": [ | ||
"eastus2euap", | ||
"centraluseuap" | ||
] | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
"systemData": { | ||
"createdBy": "string", | ||
"createdByType": "User", | ||
"createdAt": "2020-07-01T01:01:01.1075056Z", | ||
"lastModifiedBy": "string", | ||
"lastModifiedByType": "User", | ||
"lastModifiedAt": "2020-07-01T02:01:01.1075056Z" | ||
}, | ||
"id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/resourceGroups/demoCluster/providers/Microsoft.Authorization/policyExemptions/DemoExpensiveVM", | ||
"type": "Microsoft.Authorization/policyExemptions", | ||
"name": "DemoExpensiveVM" | ||
} | ||
} | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
...er/Microsoft.Authorization/preview/2022-07-01-preview/examples/deletePolicyExemption.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"parameters": { | ||
"scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/resourceGroups/demoCluster", | ||
"policyExemptionName": "DemoExpensiveVM", | ||
"api-version": "2022-07-01-preview" | ||
}, | ||
"responses": { | ||
"200": { | ||
"headers": {} | ||
}, | ||
"204": { | ||
"headers": {} | ||
} | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
...nager/Microsoft.Authorization/preview/2022-07-01-preview/examples/getPolicyExemption.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{ | ||
"parameters": { | ||
"scope": "subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/resourceGroups/demoCluster", | ||
"policyExemptionName": "DemoExpensiveVM", | ||
"api-version": "2022-07-01-preview" | ||
}, | ||
"responses": { | ||
"200": { | ||
"headers": {}, | ||
"body": { | ||
"properties": { | ||
"policyAssignmentId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/CostManagement", | ||
"policyDefinitionReferenceIds": [ | ||
"Limit_Skus" | ||
], | ||
"exemptionCategory": "Waiver", | ||
"displayName": "Exempt demo cluster", | ||
"description": "Exempt demo cluster from limit sku", | ||
"metadata": { | ||
"reason": "Temporary exemption for a expensive VM demo" | ||
} | ||
}, | ||
"systemData": { | ||
"createdBy": "string", | ||
"createdByType": "User", | ||
"createdAt": "2020-07-01T01:01:01.1075056Z", | ||
"lastModifiedBy": "string", | ||
"lastModifiedByType": "User", | ||
"lastModifiedAt": "2020-07-01T02:01:01.1075056Z" | ||
}, | ||
"id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/resourceGroups/demoCluster/providers/Microsoft.Authorization/policyExemptions/DemoExpensiveVM", | ||
"type": "Microsoft.Authorization/policyExemptions", | ||
"name": "DemoExpensiveVM" | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.