diff --git a/specification/resources/resource-manager/Microsoft.Authorization/2016-12-01/policyDefinitions.json b/specification/resources/resource-manager/Microsoft.Authorization/2016-12-01/policyDefinitions.json index ef71d13286d9..cf40cb0289d7 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/2016-12-01/policyDefinitions.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/2016-12-01/policyDefinitions.json @@ -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,7 +270,7 @@ } } }, - "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policydefinitions": { + "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions": { "get": { "tags": [ "PolicyDefinitions" @@ -255,13 +278,6 @@ "operationId": "PolicyDefinitions_List", "description": "Gets all the policy definitions for a subscription.", "parameters": [ - { - "name": "$filter", - "in": "query", - "required": false, - "type": "string", - "description": "The filter to apply on the operation." - }, { "$ref": "#/parameters/ApiVersionParameter" }, @@ -279,11 +295,35 @@ }, "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" @@ -291,19 +331,9 @@ "operationId": "PolicyDefinitions_ListByManagementGroup", "description": "Gets all the policy definitions for a subscription at management group level.", "parameters": [ - { - "name": "$filter", - "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" + } } } }, diff --git a/specification/resources/resource-manager/Microsoft.Authorization/2017-06-01-preview/examples/getBuiltInPolicySetDefinition.json b/specification/resources/resource-manager/Microsoft.Authorization/2017-06-01-preview/examples/getBuiltInPolicySetDefinition.json new file mode 100644 index 000000000000..bc672a72b7ec --- /dev/null +++ b/specification/resources/resource-manager/Microsoft.Authorization/2017-06-01-preview/examples/getBuiltInPolicySetDefinition.json @@ -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": {} + } +} \ No newline at end of file diff --git a/specification/resources/resource-manager/Microsoft.Authorization/2017-06-01-preview/examples/getPolicySetDefinition.json b/specification/resources/resource-manager/Microsoft.Authorization/2017-06-01-preview/examples/getPolicySetDefinition.json index 858495875e82..91864a4874f9 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/2017-06-01-preview/examples/getPolicySetDefinition.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/2017-06-01-preview/examples/getPolicySetDefinition.json @@ -53,6 +53,7 @@ "policyType": "Custom" } } - } + }, + "404": {} } } \ No newline at end of file diff --git a/specification/resources/resource-manager/Microsoft.Authorization/2017-06-01-preview/examples/listBuiltInPolicySetDefinitions.json b/specification/resources/resource-manager/Microsoft.Authorization/2017-06-01-preview/examples/listBuiltInPolicySetDefinitions.json new file mode 100644 index 000000000000..b4c2354de76f --- /dev/null +++ b/specification/resources/resource-manager/Microsoft.Authorization/2017-06-01-preview/examples/listBuiltInPolicySetDefinitions.json @@ -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" + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/resources/resource-manager/Microsoft.Authorization/2017-06-01-preview/policySetDefinitions.json b/specification/resources/resource-manager/Microsoft.Authorization/2017-06-01-preview/policySetDefinitions.json index e7e67ed90c45..af49e9da5da6 100644 --- a/specification/resources/resource-manager/Microsoft.Authorization/2017-06-01-preview/policySetDefinitions.json +++ b/specification/resources/resource-manager/Microsoft.Authorization/2017-06-01-preview/policySetDefinitions.json @@ -36,7 +36,7 @@ } }, "paths": { - "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policysetdefinitions/{policySetDefinitionName}": { + "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}": { "put": { "tags": [ "PolicySetDefinitions" @@ -174,7 +174,50 @@ } } }, - "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policysetdefinitions": { + "/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}": { + "get": { + "tags": [ + "PolicySetDefinitions" + ], + "operationId": "PolicySetDefinitions_GetBuiltIn", + "description": "Gets the built in policy set definition.", + "x-ms-examples": { + "Get a built in policy set definition": { + "$ref": "./examples/getBuiltInPolicySetDefinition.json" + } + }, + "parameters": [ + { + "name": "policySetDefinitionName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the policy set definition to get." + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK - Returns information about the built in policy set definition.", + "schema": { + "$ref": "#/definitions/PolicySetDefinition" + } + }, + "404": { + "description": "Not Found - the built in policy set definition was not found." + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions": { "get": { "tags": [ "PolicySetDefinitions" @@ -213,7 +256,43 @@ } } }, - "/providers/Microsoft.Management/managementgroups/{managementGroupId}/providers/Microsoft.Authorization/policysetdefinitions/{policySetDefinitionName}": { + "/providers/Microsoft.Authorization/policySetDefinitions": { + "get": { + "tags": [ + "PolicySetDefinitions" + ], + "operationId": "PolicySetDefinitions_ListBuiltIn", + "description": "Gets all the built in policy set definitions.", + "x-ms-examples": { + "List policy set definitions": { + "$ref": "./examples/listBuiltInPolicySetDefinitions.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK - Returns an array of built in policy set definitions.", + "schema": { + "$ref": "#/definitions/PolicySetDefinitionListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/providers/Microsoft.Management/managementgroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}": { "put": { "tags": [ "PolicySetDefinitions" @@ -245,9 +324,6 @@ { "$ref": "#/parameters/ApiVersionParameter" }, - { - "$ref": "#/parameters/SubscriptionIdParameter" - }, { "$ref": "#/parameters/ManagementGroupIdParameter" } @@ -290,9 +366,6 @@ { "$ref": "#/parameters/ApiVersionParameter" }, - { - "$ref": "#/parameters/SubscriptionIdParameter" - }, { "$ref": "#/parameters/ManagementGroupIdParameter" } @@ -334,9 +407,6 @@ { "$ref": "#/parameters/ApiVersionParameter" }, - { - "$ref": "#/parameters/SubscriptionIdParameter" - }, { "$ref": "#/parameters/ManagementGroupIdParameter" } @@ -357,7 +427,7 @@ } } }, - "/providers/Microsoft.Management/managementgroups/{managementGroupId}/providers/Microsoft.Authorization/policysetdefinitions": { + "/providers/Microsoft.Management/managementgroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions": { "get": { "tags": [ "PolicySetDefinitions" @@ -373,9 +443,6 @@ { "$ref": "#/parameters/ApiVersionParameter" }, - { - "$ref": "#/parameters/SubscriptionIdParameter" - }, { "$ref": "#/parameters/ManagementGroupIdParameter" }