-
Notifications
You must be signed in to change notification settings - Fork 5.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add built in policy definition/set definition paths #1788
Changes from all commits
503e9fe
3abdae4
4288c9c
a0a081a
5da03ba
91c7775
26ebb96
75b1c0c
cf054dd
730e2ee
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,7 +36,7 @@ | |
} | ||
}, | ||
"paths": { | ||
"/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policydefinitions/{policyDefinitionName}": { | ||
"/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}": { | ||
"put": { | ||
"tags": [ | ||
"PolicyDefinitions" | ||
|
@@ -137,7 +137,39 @@ | |
} | ||
} | ||
}, | ||
"/providers/Microsoft.Management/managementgroups/{managementGroupId}/providers/Microsoft.Authorization/policydefinitions/{policyDefinitionName}": { | ||
"/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}": { | ||
"get": { | ||
"tags": [ | ||
"PolicyDefinitions" | ||
], | ||
"operationId": "PolicyDefinitions_GetBuiltIn", | ||
"description": "Gets the built in policy definition.", | ||
"parameters": [ | ||
{ | ||
"name": "policyDefinitionName", | ||
"in": "path", | ||
"required": true, | ||
"type": "string", | ||
"description": "The name of the built in policy definition to get." | ||
}, | ||
{ | ||
"$ref": "#/parameters/ApiVersionParameter" | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "OK - Returns information about the built in policy definition.", | ||
"schema": { | ||
"$ref": "#/definitions/PolicyDefinition" | ||
} | ||
}, | ||
"404": { | ||
"description": "Not Found - the built in policy definition was not found." | ||
} | ||
} | ||
} | ||
}, | ||
"/providers/Microsoft.Management/managementgroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}": { | ||
"put": { | ||
"tags": [ | ||
"PolicyDefinitions" | ||
|
@@ -164,9 +196,6 @@ | |
{ | ||
"$ref": "#/parameters/ApiVersionParameter" | ||
}, | ||
{ | ||
"$ref": "#/parameters/SubscriptionIdParameter" | ||
}, | ||
{ | ||
"$ref": "#/parameters/ManagementGroupIdParameter" | ||
} | ||
|
@@ -197,9 +226,6 @@ | |
{ | ||
"$ref": "#/parameters/ApiVersionParameter" | ||
}, | ||
{ | ||
"$ref": "#/parameters/SubscriptionIdParameter" | ||
}, | ||
{ | ||
"$ref": "#/parameters/ManagementGroupIdParameter" | ||
} | ||
|
@@ -230,9 +256,6 @@ | |
{ | ||
"$ref": "#/parameters/ApiVersionParameter" | ||
}, | ||
{ | ||
"$ref": "#/parameters/SubscriptionIdParameter" | ||
}, | ||
{ | ||
"$ref": "#/parameters/ManagementGroupIdParameter" | ||
} | ||
|
@@ -247,21 +270,14 @@ | |
} | ||
} | ||
}, | ||
"/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policydefinitions": { | ||
"/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions": { | ||
"get": { | ||
"tags": [ | ||
"PolicyDefinitions" | ||
], | ||
"operationId": "PolicyDefinitions_List", | ||
"description": "Gets all the policy definitions for a subscription.", | ||
"parameters": [ | ||
{ | ||
"name": "$filter", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So this was not supported and here by mistake? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, apparently, only policy assignment list supports filter. Not policy definitions and set definitions There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok, this was exposed in the CLI, I create an issue for that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
"in": "query", | ||
"required": false, | ||
"type": "string", | ||
"description": "The filter to apply on the operation." | ||
}, | ||
{ | ||
"$ref": "#/parameters/ApiVersionParameter" | ||
}, | ||
|
@@ -279,31 +295,45 @@ | |
}, | ||
"x-ms-pageable": { | ||
"nextLinkName": "nextLink" | ||
} | ||
} | ||
}, | ||
"/providers/Microsoft.Authorization/policyDefinitions": { | ||
"get": { | ||
"tags": [ | ||
"PolicyDefinitions" | ||
], | ||
"operationId": "PolicyDefinitions_ListBuiltIn", | ||
"description": "Gets all the built in policy definitions.", | ||
"parameters": [ | ||
{ | ||
"$ref": "#/parameters/ApiVersionParameter" | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "OK - Returns an array of built in policy definitions.", | ||
"schema": { | ||
"$ref": "#/definitions/PolicyDefinitionListResult" | ||
} | ||
} | ||
}, | ||
"x-ms-odata": "#/definitions/PolicyDefinition" | ||
"x-ms-pageable": { | ||
"nextLinkName": "nextLink" | ||
} | ||
} | ||
}, | ||
"/providers/Microsoft.Management/managementgroups/{managementGroupId}/providers/Microsoft.Authorization/policydefinitions": { | ||
"/providers/Microsoft.Management/managementgroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions": { | ||
"get": { | ||
"tags": [ | ||
"PolicyDefinitions" | ||
], | ||
"operationId": "PolicyDefinitions_ListByManagementGroup", | ||
"description": "Gets all the policy definitions for a subscription at management group level.", | ||
"parameters": [ | ||
{ | ||
"name": "$filter", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same question, not supported? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, not supported |
||
"in": "query", | ||
"required": false, | ||
"type": "string", | ||
"description": "The filter to apply on the operation." | ||
}, | ||
{ | ||
"$ref": "#/parameters/ApiVersionParameter" | ||
}, | ||
{ | ||
"$ref": "#/parameters/SubscriptionIdParameter" | ||
}, | ||
{ | ||
"$ref": "#/parameters/ManagementGroupIdParameter" | ||
} | ||
|
@@ -318,8 +348,7 @@ | |
}, | ||
"x-ms-pageable": { | ||
"nextLinkName": "nextLink" | ||
}, | ||
"x-ms-odata": "#/definitions/PolicyDefinition" | ||
} | ||
} | ||
} | ||
}, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
{ | ||
"parameters": { | ||
"policySetDefinitionName": "costManagement", | ||
"api-version": "2017-06-01-preview" | ||
}, | ||
"responses": { | ||
"200": { | ||
"headers": {}, | ||
"body": { | ||
"id": "/providers/Microsoft.Authorization/policySetDefinitions/costManagement", | ||
"type": "Microsoft.Authorization/policySetDefinitions", | ||
"name": "costManagement", | ||
"properties": { | ||
"displayName": "VM and Storage Cost Management", | ||
"description": "Policies required to minimize the risk of accidental cost overruns", | ||
"metadata": { | ||
"category": "Cost Management" | ||
}, | ||
"parameters": { | ||
"allowedLocations": { | ||
"type": "array", | ||
"metadata": { | ||
"description": "Regions that resources can be deployed to", | ||
"displayName": "Valid Regions" | ||
} | ||
} | ||
}, | ||
"policyDefinitions": [ | ||
{ | ||
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/storageSkus", | ||
"parameters": { | ||
"listOfAllowedSKUs": { | ||
"value": [ | ||
"Standard_GRS", | ||
"Standard_LRS" | ||
] | ||
} | ||
} | ||
}, | ||
{ | ||
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/vmSkus" | ||
}, | ||
{ | ||
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/policyDefinitionId", | ||
"parameters": { | ||
"listOfAllowedLocations": { | ||
"value": "[parameters('allowedLocations')]" | ||
} | ||
} | ||
} | ||
], | ||
"policyType": "Custom" | ||
} | ||
} | ||
}, | ||
"404": {} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,6 +53,7 @@ | |
"policyType": "Custom" | ||
} | ||
} | ||
} | ||
}, | ||
"404": {} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
{ | ||
"parameters": { | ||
"api-version": "2017-06-01-preview" | ||
}, | ||
"responses": { | ||
"200": { | ||
"headers": {}, | ||
"body": { | ||
"value": [ | ||
{ | ||
"id": "/providers/Microsoft.Authorization/policySetDefinitions/costManagement", | ||
"type": "Microsoft.Authorization/policySetDefinitions", | ||
"name": "costManagement", | ||
"properties": { | ||
"displayName": "VM and Storage Cost Management", | ||
"description": "Policies required to minimize the risk of accidental cost overruns", | ||
"metadata": { | ||
"category": "Cost Management" | ||
}, | ||
"parameters": { | ||
"allowedLocations": { | ||
"type": "array", | ||
"metadata": { | ||
"description": "Regions that resources can be deployed to", | ||
"displayName": "Valid Regions" | ||
} | ||
} | ||
}, | ||
"policyDefinitions": [ | ||
{ | ||
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/storageSkus", | ||
"parameters": { | ||
"locations": { | ||
"value": "[parameters('allowedLocations')]" | ||
} | ||
} | ||
} | ||
], | ||
"policyType": "Custom" | ||
} | ||
}, | ||
{ | ||
"id": "/providers/Microsoft.Authorization/policySetDefinitions/skuManagement", | ||
"type": "Microsoft.Authorization/policySetDefinitions", | ||
"name": "skuManagement", | ||
"properties": { | ||
"displayName": "VM Sku Management", | ||
"description": "Policies required to minimize the risk of accidental cost overruns", | ||
"metadata": { | ||
"category": "Sku Management" | ||
}, | ||
"policyDefinitions": [ | ||
{ | ||
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/vmSkus" | ||
} | ||
], | ||
"policyType": "Custom" | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
404 should be valid response correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep