Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,283 @@
{
"swagger": "2.0",
"info": {
"title": "PolicyClient",
"version": "2016-12-01",
"description": "To manage and control access to your resources, you can define customized policies and assign them at a scope."
},
"host": "management.azure.com",
"schemes": [
"https"
],
"consumes": [
"application/json",
"text/json"
],
"produces": [
"application/json",
"text/json"
],
"security": [
{
"azure_auth": [
"user_impersonation"
]
}
],
"securityDefinitions": {
"azure_auth": {
"type": "oauth2",
"authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize",
"flow": "implicit",
"description": "Azure Active Directory OAuth2 Flow",
"scopes": {
"user_impersonation": "impersonate your user account"
}
}
},
"paths": {
"/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policydefinitions/{policyDefinitionName}": {
"put": {
"tags": [
"PolicyDefinitions"
],
"operationId": "PolicyDefinitions_CreateOrUpdate",
"description": "Creates or updates a policy definition.",
"parameters": [
{
"name": "policyDefinitionName",
"in": "path",
"required": true,
"type": "string",
"description": "The name of the policy definition to create."
},
{
"name": "parameters",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/PolicyDefinition"
},
"description": "The policy definition properties."
},
{
"$ref": "#/parameters/ApiVersionParameter"
},
{
"$ref": "#/parameters/SubscriptionIdParameter"
}
],
"responses": {
"201": {
"description": "Created - Returns information about the policy definition.",
"schema": {
"$ref": "#/definitions/PolicyDefinition"
}
}
}
},
"delete": {
"tags": [
"PolicyDefinitions"
],
"operationId": "PolicyDefinitions_Delete",
"description": "Deletes a policy definition.",
"parameters": [
{
"name": "policyDefinitionName",
"in": "path",
"required": true,
"type": "string",
"description": "The name of the policy definition to delete."
},
{
"$ref": "#/parameters/ApiVersionParameter"
},
{
"$ref": "#/parameters/SubscriptionIdParameter"
}
],
"responses": {
"204": {
"description": "No Content"
},
"200": {
"description": "OK"
}
}
},
"get": {
"tags": [
"PolicyDefinitions"
],
"operationId": "PolicyDefinitions_Get",
"description": "Gets the policy definition.",
"parameters": [
{
"name": "policyDefinitionName",
"in": "path",
"required": true,
"type": "string",
"description": "The name of the policy definition to get."
},
{
"$ref": "#/parameters/ApiVersionParameter"
},
{
"$ref": "#/parameters/SubscriptionIdParameter"
}
],
"responses": {
"200": {
"description": "OK - Returns information about the policy definition.",
"schema": {
"$ref": "#/definitions/PolicyDefinition"
}
}
}
}
},
"/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policydefinitions": {
"get": {
"tags": [
"PolicyDefinitions"
],
"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"
},
{
"$ref": "#/parameters/SubscriptionIdParameter"
}
],
"responses": {
"200": {
"description": "OK - Returns ana array of policy definitions.",
"schema": {
"$ref": "#/definitions/PolicyDefinitionListResult"
}
}
},
"x-ms-pageable": {
"nextLinkName": "nextLink"
},
"x-ms-odata": "#/definitions/PolicyDefinition"
}
}
},
"definitions": {
"PolicyDefinitionProperties": {
"properties": {
"policyType": {
"type": "string",
"description": "The type of policy definition. Possible values are NotSpecified, BuiltIn, and Custom.",
"enum": [
"NotSpecified",
"BuiltIn",
"Custom"
],
"x-ms-enum": {
"name": "policyType",
"modelAsString": true
}
},
"mode": {
"type": "string",
"description": "The policy definition mode. Possible values are NotSpecified, Indexed, and All.",
"enum": [
"NotSpecified",
"Indexed",
"All"
],
"x-ms-enum": {
"name": "policyMode",
"modelAsString": true
}
},
"displayName": {
"type": "string",
"description": "The display name of the policy definition."
},
"description": {
"type": "string",
"description": "The policy definition description."
},
"policyRule": {
"type": "object",
"description": "The policy rule."
},
"metadata": {
"type": "object",
"description": "The policy definition metadata."
},
"parameters": {
"type": "object",
"description": "Required if a parameter is used in policy rule."
}
},
"description": "The policy definition properties."
},
"PolicyDefinition": {
"properties": {
"properties": {
"x-ms-client-flatten": true,
"$ref": "#/definitions/PolicyDefinitionProperties",
"description": "The policy definition properties."
},
"id": {
"readOnly": true,
"type": "string",
"description": "The ID of the policy definition."
},
"name": {
"readOnly": true,
"type": "string",
"description": "The name of the policy definition."
}
},
"description": "The policy definition.",
"x-ms-azure-resource": true
},
"PolicyDefinitionListResult": {
"properties": {
"value": {
"type": "array",
"items": {
"$ref": "#/definitions/PolicyDefinition"
},
"description": "An array of policy definitions."
},
"nextLink": {
"type": "string",
"description": "The URL to use for getting the next set of results."
}
},
"description": "List of policy definitions."
}
},
"parameters": {
"SubscriptionIdParameter": {
"name": "subscriptionId",
"in": "path",
"required": true,
"type": "string",
"description": "The ID of the target subscription."
},
"ApiVersionParameter": {
"name": "api-version",
"in": "query",
"required": true,
"type": "string",
"description": "The API version to use for the operation."
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"parameters": {
"api-version": "2017-06-01-preview",
"policyAssignmentName": "costManagement",
"scope": "/subscriptions/subId",
"parameters": {
"properties": {
"displayName": "Storage Cost Management",
"description": "Policies required to minimize the risk of accidental cost overruns",
"metadata": {
"category": "Cost Management"
},
"policyDefinitionId": "/subscriptions/subId/providers/Microsoft.Authorization/policyDefinitions/storageSkus",
"parameters": { "allowedSkus": { "type": "Array" } },
"notScopes": [ "/subscriptions/subId/resourcegroups/testingResourceGroup" ]
},
"sku": {
"name": "A0",
"tier": "Free"
}
}
},
"responses": {
"201": {
"headers": {},
"body": {
"id": "/subscriptions/subId/providers/Microsoft.Authorization/policyAssignments/costManagement",
"type": "Microsoft.Authorization/policyAssignments",
"name": "costManagement",
"properties": {
"displayName": "Storage Cost Management",
"description": "Policies required to minimize the risk of accidental cost overruns",
"metadata": {
"category": "Cost Management"
},
"policyDefinitionId": "/subscriptions/subId/providers/Microsoft.Authorization/policyDefinitions/storageSkus",
"parameters": { "allowedSkus": { "type": "Array" } },
"notScopes": [ "/subscriptions/subId/resourcegroups/testingResourceGroup" ],
"scope": "/subscriptions/subId"
},
"sku": {
"name": "A0",
"tier": "Free"
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"parameters": {
"api-version": "2017-06-01-preview",
"policyAssignmentName": "costManagement",
"scope": "/subscriptions/subId"
},
"responses": {
"200": {
"headers": {},
"body": {
"id": "/subscriptions/subId/providers/Microsoft.Authorization/policyAssignments/costManagement",
"type": "Microsoft.Authorization/policyAssignments",
"name": "costManagement",
"properties": {
"displayName": "Storage Cost Management",
"description": "Policies required to minimize the risk of accidental cost overruns",
"metadata": {
"category": "Cost Management"
},
"policyDefinitionId": "/subscriptions/subId/providers/Microsoft.Authorization/policyDefinitions/storageSkus",
"parameters": { "allowedSkus": { "type": "Array" } },
"notScopes": [ "/subscriptions/subId/resourcegroups/testingResourceGroup" ],
"scope": "/subscriptions/subId"
},
"sku": {
"name": "A0",
"tier": "Free"
}
}
}
}
}
Loading