{ "swagger": "2.0", "info": { "title": "PolicyClient", "version": "2025-01-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" ], "produces": [ "application/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": { "/providers/Microsoft.Authorization/listPolicySetDefinitionVersions": { "post": { "tags": [ "PolicySetDefinitionVersions" ], "operationId": "PolicySetDefinitionVersions_ListAllBuiltins", "summary": "Lists all built-in policy set definition versions.", "description": "This operation lists all the built-in policy set definition versions for all built-in policy set definitions.", "x-ms-examples": { "List all built-in policy definition versions": { "$ref": "./examples/listAllBuiltInPolicySetDefinitionVersions.json" } }, "parameters": [ { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" } ], "responses": { "200": { "description": "OK - Returns an array of policy set definition versions.", "schema": { "$ref": "#/definitions/PolicySetDefinitionVersionListResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "#/definitions/CloudError" } } } } }, "/providers/Microsoft.Management/managementGroups/{managementGroupName}/providers/Microsoft.Authorization/listPolicySetDefinitionVersions": { "post": { "tags": [ "PolicySetDefinitionVersions" ], "operationId": "PolicySetDefinitionVersions_ListAllAtManagementGroup", "summary": "Lists all policy set definition versions at management group scope.", "description": "This operation lists all the policy set definition versions for all policy set definitions at the management group scope.", "x-ms-examples": { "List all policy definition versions at management group": { "$ref": "./examples/listAllPolicySetDefinitionVersionsByManagementGroup.json" } }, "parameters": [ { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ManagementGroupNameParameter" }, { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" } ], "responses": { "200": { "description": "OK - Returns an array of policy set definition versions.", "schema": { "$ref": "#/definitions/PolicySetDefinitionVersionListResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "#/definitions/CloudError" } } } } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/listPolicySetDefinitionVersions": { "post": { "tags": [ "PolicySetDefinitionVersions" ], "operationId": "PolicySetDefinitionVersions_ListAll", "summary": "Lists all policy set definition versions within a subscription.", "description": "This operation lists all the policy set definition versions for all policy set definitions within a subscription.", "x-ms-examples": { "List all policy definition versions at subscription": { "$ref": "./examples/listAllPolicySetDefinitionVersions.json" } }, "parameters": [ { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" }, { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" } ], "responses": { "200": { "description": "OK - Returns an array of policy set definition versions.", "schema": { "$ref": "#/definitions/PolicySetDefinitionVersionListResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "#/definitions/CloudError" } } } } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}/versions/{policyDefinitionVersion}": { "put": { "tags": [ "PolicySetDefinitionVersions" ], "operationId": "PolicySetDefinitionVersions_CreateOrUpdate", "summary": "Creates or updates a policy set definition version.", "description": "This operation creates or updates a policy set definition version in the given subscription with the given name and version.", "x-ms-examples": { "Create or update a policy set definition version": { "$ref": "./examples/createOrUpdatePolicySetDefinitionVersion.json" } }, "parameters": [ { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" }, { "$ref": "#/parameters/PolicySetDefinitionName" }, { "$ref": "#/parameters/PolicySetDefinitionVersion" }, { "name": "parameters", "in": "body", "required": true, "schema": { "$ref": "#/definitions/PolicySetDefinitionVersion" }, "description": "The policy set definition properties." }, { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" } ], "responses": { "201": { "description": "Created - Returns information about the policy set definition version.", "schema": { "$ref": "#/definitions/PolicySetDefinitionVersion" } }, "200": { "description": "OK - Successfully updated policy set definition version.", "schema": { "$ref": "#/definitions/PolicySetDefinitionVersion" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "#/definitions/CloudError" } } } }, "delete": { "tags": [ "PolicySetDefinitionVersions" ], "operationId": "PolicySetDefinitionVersions_Delete", "summary": "Deletes a policy set definition version.", "description": "This operation deletes the policy set definition version in the given subscription with the given name and version.", "x-ms-examples": { "Delete a policy set definition version": { "$ref": "./examples/deletePolicySetDefinitionVersion.json" } }, "parameters": [ { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" }, { "$ref": "#/parameters/PolicySetDefinitionName" }, { "$ref": "#/parameters/PolicySetDefinitionVersion" }, { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" } ], "responses": { "204": { "description": "No Content - the policy set definition doesn't exist in the subscription." }, "200": { "description": "OK" }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "#/definitions/CloudError" } } } }, "get": { "tags": [ "PolicySetDefinitionVersions" ], "operationId": "PolicySetDefinitionVersions_Get", "summary": "Retrieves a policy set definition version.", "description": "This operation retrieves the policy set definition version in the given subscription with the given name and version.", "x-ms-examples": { "Retrieve a policy set definition version": { "$ref": "./examples/getPolicySetDefinitionVersion.json" } }, "parameters": [ { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" }, { "$ref": "#/parameters/PolicySetDefinitionName" }, { "$ref": "#/parameters/PolicySetDefinitionVersion" }, { "$ref": "#/parameters/PolicySetDefinitionsExpandParameter" }, { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" } ], "responses": { "200": { "description": "OK - Returns information about the policy set definition version.", "schema": { "$ref": "#/definitions/PolicySetDefinitionVersion" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "#/definitions/CloudError" } } } } }, "/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}/versions/{policyDefinitionVersion}": { "get": { "tags": [ "PolicySetDefinitionVersions" ], "operationId": "PolicySetDefinitionVersions_GetBuiltIn", "summary": "Retrieves a built in policy set definition version.", "description": "This operation retrieves the built-in policy set definition version with the given name and version.", "x-ms-examples": { "Retrieve a built-in policy set definition version": { "$ref": "./examples/getBuiltInPolicySetDefinitionVersion.json" } }, "parameters": [ { "$ref": "#/parameters/PolicySetDefinitionName" }, { "$ref": "#/parameters/PolicySetDefinitionVersion" }, { "$ref": "#/parameters/PolicySetDefinitionsExpandParameter" }, { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" } ], "responses": { "200": { "description": "OK - Returns information about the built in policy set definition version.", "schema": { "$ref": "#/definitions/PolicySetDefinitionVersion" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "#/definitions/CloudError" } } } } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}/versions": { "get": { "tags": [ "PolicySetDefinitionVersions" ], "operationId": "PolicySetDefinitionVersions_List", "summary": "Retrieves the policy set definition versions for a given policy set definition in a subscription.", "description": "This operation retrieves a list of all the policy set definition versions for the given policy set definition.", "x-ms-examples": { "List policy set definitions": { "$ref": "./examples/listPolicySetDefinitionVersions.json" } }, "parameters": [ { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" }, { "$ref": "#/parameters/PolicySetDefinitionName" }, { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { "$ref": "#/parameters/PolicySetDefinitionsExpandParameter" }, { "$ref": "#/parameters/TopParameter" } ], "responses": { "200": { "description": "OK - Returns an array of policy set definition versions.", "schema": { "$ref": "#/definitions/PolicySetDefinitionVersionListResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "#/definitions/CloudError" } } }, "x-ms-pageable": { "nextLinkName": "nextLink" } } }, "/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}/versions": { "get": { "tags": [ "PolicySetDefinitionVersions" ], "operationId": "PolicySetDefinitionVersions_ListBuiltIn", "summary": "Retrieves built-in policy set definition versions.", "description": "This operation retrieves a list of all the built-in policy set definition versions for the given built-in policy set definition.", "x-ms-examples": { "List built-in policy set definitions": { "$ref": "./examples/listBuiltInPolicySetDefinitionVersions.json" } }, "parameters": [ { "$ref": "#/parameters/PolicySetDefinitionName" }, { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { "$ref": "#/parameters/PolicySetDefinitionsExpandParameter" }, { "$ref": "#/parameters/TopParameter" } ], "responses": { "200": { "description": "OK - Returns an array of built in policy set definition versions.", "schema": { "$ref": "#/definitions/PolicySetDefinitionVersionListResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "#/definitions/CloudError" } } }, "x-ms-pageable": { "nextLinkName": "nextLink" } } }, "/providers/Microsoft.Management/managementGroups/{managementGroupName}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}/versions/{policyDefinitionVersion}": { "put": { "tags": [ "PolicySetDefinitionVersions" ], "operationId": "PolicySetDefinitionVersions_CreateOrUpdateAtManagementGroup", "summary": "Creates or updates a policy set definition version.", "description": "This operation creates or updates a policy set definition version in the given management group with the given name and version.", "x-ms-examples": { "Create or update a policy set definition version at management group level": { "$ref": "./examples/createOrUpdatePolicySetDefinitionVersionAtManagementGroup.json" } }, "parameters": [ { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ManagementGroupNameParameter" }, { "$ref": "#/parameters/PolicySetDefinitionName" }, { "$ref": "#/parameters/PolicySetDefinitionVersion" }, { "name": "parameters", "in": "body", "required": true, "schema": { "$ref": "#/definitions/PolicySetDefinitionVersion" }, "description": "The policy set definition version properties." }, { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" } ], "responses": { "201": { "description": "Created - Returns information about the policy set definition version.", "schema": { "$ref": "#/definitions/PolicySetDefinitionVersion" } }, "200": { "description": "OK - Successfully updated policy set definition version.", "schema": { "$ref": "#/definitions/PolicySetDefinitionVersion" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "#/definitions/CloudError" } } } }, "delete": { "tags": [ "PolicySetDefinitionVersions" ], "operationId": "PolicySetDefinitionVersions_DeleteAtManagementGroup", "summary": "Deletes a policy set definition version.", "description": "This operation deletes the policy set definition version in the given management group with the given name and version.", "x-ms-examples": { "Delete a policy set definition version at management group level": { "$ref": "./examples/deletePolicySetDefinitionVersionAtManagementGroup.json" } }, "parameters": [ { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ManagementGroupNameParameter" }, { "$ref": "#/parameters/PolicySetDefinitionName" }, { "$ref": "#/parameters/PolicySetDefinitionVersion" }, { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" } ], "responses": { "204": { "description": "No Content - the policy set definition doesn't exist in the subscription." }, "200": { "description": "OK" }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "#/definitions/CloudError" } } } }, "get": { "tags": [ "PolicySetDefinitionVersions" ], "operationId": "PolicySetDefinitionVersions_GetAtManagementGroup", "summary": "Retrieves a policy set definition version.", "description": "This operation retrieves the policy set definition version in the given management group with the given name and version.", "x-ms-examples": { "Retrieve a policy set definition version at management group level": { "$ref": "./examples/getPolicySetDefinitionVersionAtManagementGroup.json" } }, "parameters": [ { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ManagementGroupNameParameter" }, { "$ref": "#/parameters/PolicySetDefinitionName" }, { "$ref": "#/parameters/PolicySetDefinitionVersion" }, { "$ref": "#/parameters/PolicySetDefinitionsExpandParameter" }, { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" } ], "responses": { "200": { "description": "OK - Returns information about the policy set definition version.", "schema": { "$ref": "#/definitions/PolicySetDefinitionVersion" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "#/definitions/CloudError" } } } } }, "/providers/Microsoft.Management/managementGroups/{managementGroupName}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}/versions": { "get": { "tags": [ "PolicySetDefinitionVersions" ], "operationId": "PolicySetDefinitionVersions_ListByManagementGroup", "summary": "Retrieves all policy set definition versions for a given policy set definition in a management group.", "description": "This operation retrieves a list of all the policy set definition versions for the given policy set definition in a given management group.", "x-ms-examples": { "List policy set definitions at management group level": { "$ref": "./examples/listPolicySetDefinitionVersionsByManagementGroup.json" } }, "parameters": [ { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ManagementGroupNameParameter" }, { "$ref": "#/parameters/PolicySetDefinitionName" }, { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { "$ref": "#/parameters/PolicySetDefinitionsExpandParameter" }, { "$ref": "#/parameters/TopParameter" } ], "responses": { "200": { "description": "OK - Returns an array of policy set definition versions.", "schema": { "$ref": "#/definitions/PolicySetDefinitionVersionListResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "#/definitions/CloudError" } } }, "x-ms-pageable": { "nextLinkName": "nextLink" } } } }, "definitions": { "CloudError": { "type": "object", "x-ms-external": true, "properties": { "error": { "$ref": "../../../../../../common-types/resource-management/v1/types.json#/definitions/ErrorResponse" } }, "description": "An error response from a policy operation." }, "PolicySetDefinitionVersionProperties": { "type": "object", "properties": { "policyType": { "type": "string", "description": "The type of policy definition. Possible values are NotSpecified, BuiltIn, Custom, and Static.", "enum": [ "NotSpecified", "BuiltIn", "Custom", "Static" ], "x-ms-enum": { "name": "policyType", "modelAsString": true } }, "displayName": { "type": "string", "description": "The display name of the policy set definition." }, "description": { "type": "string", "description": "The policy set definition description." }, "metadata": { "type": "object", "description": "The policy set definition metadata. Metadata is an open ended object and is typically a collection of key value pairs." }, "parameters": { "description": "The policy set definition parameters that can be used in policy definition references.", "$ref": "./policyDefinitions.json#/definitions/ParameterDefinitions" }, "policyDefinitions": { "type": "array", "items": { "$ref": "#/definitions/PolicyDefinitionReference" }, "x-ms-identifiers": [ "policyDefinitionReferenceId" ], "description": "An array of policy definition references." }, "policyDefinitionGroups": { "type": "array", "items": { "$ref": "#/definitions/PolicyDefinitionGroup" }, "x-ms-identifiers": [ "name" ], "description": "The metadata describing groups of policy definition references within the policy set definition." }, "version": { "type": "string", "description": "The policy set definition version in #.#.# format." } }, "required": [ "policyDefinitions" ], "description": "The policy set definition properties." }, "PolicyDefinitionReference": { "type": "object", "properties": { "policyDefinitionId": { "type": "string", "description": "The ID of the policy definition or policy set definition." }, "definitionVersion": { "type": "string", "description": "The version of the policy definition to use." }, "latestDefinitionVersion": { "type": "string", "description": "The latest version of the policy definition available. This is only present if requested via the $expand query parameter.", "readOnly": true }, "effectiveDefinitionVersion": { "type": "string", "description": "The effective version of the policy definition in use. This is only present if requested via the $expand query parameter.", "readOnly": true }, "parameters": { "description": "The parameter values for the referenced policy rule. The keys are the parameter names.", "$ref": "./policyAssignments.json#/definitions/ParameterValues" }, "policyDefinitionReferenceId": { "type": "string", "description": "A unique id (within the policy set definition) for this policy definition reference." }, "groupNames": { "type": "array", "items": { "type": "string" }, "description": "The name of the groups that this policy definition reference belongs to." } }, "required": [ "policyDefinitionId" ], "description": "The policy definition reference." }, "PolicyDefinitionGroup": { "type": "object", "properties": { "name": { "type": "string", "description": "The name of the group." }, "displayName": { "type": "string", "description": "The group's display name." }, "category": { "type": "string", "description": "The group's category." }, "description": { "type": "string", "description": "The group's description." }, "additionalMetadataId": { "type": "string", "description": "A resource ID of a resource that contains additional metadata about the group." } }, "required": [ "name" ], "description": "The policy definition group." }, "PolicySetDefinitionVersion": { "type": "object", "properties": { "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/PolicySetDefinitionVersionProperties", "description": "The policy set definition version properties." }, "id": { "readOnly": true, "type": "string", "description": "The ID of the policy set definition version." }, "name": { "readOnly": true, "type": "string", "description": "The name of the policy set definition version." }, "type": { "readOnly": true, "type": "string", "description": "The type of the resource (Microsoft.Authorization/policySetDefinitions/versions)." }, "systemData": { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/systemData", "readOnly": true, "description": "The system metadata relating to this resource." } }, "description": "The policy set definition version.", "x-ms-azure-resource": true }, "PolicySetDefinitionVersionListResult": { "type": "object", "properties": { "value": { "type": "array", "items": { "$ref": "#/definitions/PolicySetDefinitionVersion" }, "description": "An array of policy set definition versions." }, "nextLink": { "type": "string", "description": "The URL to use for getting the next set of results." } }, "description": "List of policy set definition versions." } }, "parameters": { "PolicySetDefinitionName": { "name": "policySetDefinitionName", "in": "path", "required": true, "type": "string", "pattern": "^[^<>%&:\\?/]*[^<>%&:\\?/ ]+$", "description": "The name of the policy set definition.", "x-ms-parameter-location": "method" }, "PolicySetDefinitionVersion": { "name": "policyDefinitionVersion", "in": "path", "required": true, "type": "string", "pattern": "^\\d+\\.\\d+\\.\\d+$", "description": "The policy set definition version. The format is x.y.z where x is the major version number, y is the minor version number, and z is the patch number", "x-ms-parameter-location": "method" }, "PolicySetDefinitionsFilterParameter": { "name": "$filter", "in": "query", "required": false, "type": "string", "description": "The filter to apply on the operation. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atExactScope() is provided, the returned list only includes all policy set definitions that at the given scope. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy set definitions whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If $filter='category -eq {value}' is provided, the returned list only includes all policy set definitions whose category match the {value}.", "x-ms-skip-url-encoding": true, "x-ms-parameter-location": "method" }, "PolicySetDefinitionsExpandParameter": { "name": "$expand", "in": "query", "required": false, "type": "string", "description": "Comma-separated list of additional properties to be included in the response. Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'.", "x-ms-parameter-location": "method" }, "TopParameter": { "name": "$top", "in": "query", "required": false, "type": "integer", "format": "int32", "minimum": 1, "maximum": 1000, "description": "Maximum number of records to return. When the $top filter is not provided, it will return 500 records.", "x-ms-parameter-location": "method" } } }