From 53708850ac79b5c527a9932ccb59ec93c98721a4 Mon Sep 17 00:00:00 2001 From: Jeff Hackshaw Date: Mon, 1 Mar 2021 09:53:31 -0800 Subject: [PATCH 1/8] authorization add 2020-08-01-preview --- .../authorization-UsageMetricsCalls.json | 105 +++ ...eAssignmentMetrics_GetForSubscription.json | 16 + .../authorization-RoleAssignmentsCalls.json | 679 ++++++++++++++++++ .../2020-08-01-preview/common-types.json | 81 +++ .../examples/RoleAssignments_CreateById.json | 46 ++ .../RoleAssignments_CreateForResource.json | 47 ++ ...oleAssignments_CreateForResourceGroup.json | 47 ++ ...RoleAssignments_CreateForSubscription.json | 47 ++ .../examples/RoleAssignments_Delete.json | 23 + .../examples/RoleAssignments_DeleteById.json | 22 + .../examples/RoleAssignments_Get.json | 22 + .../examples/RoleAssignments_GetById.json | 21 + .../RoleAssignments_ListForResource.json | 51 ++ .../RoleAssignments_ListForResourceGroup.json | 37 + .../RoleAssignments_ListForScope.json | 25 + .../RoleAssignments_ListForSubscription.json | 25 + .../authorization/resource-manager/readme.md | 16 + 17 files changed, 1310 insertions(+) create mode 100644 specification/authorization/resource-manager/Microsoft.Authorization/preview/2019-08-01-preview/authorization-UsageMetricsCalls.json create mode 100644 specification/authorization/resource-manager/Microsoft.Authorization/preview/2019-08-01-preview/examples/RoleAssignmentMetrics_GetForSubscription.json create mode 100644 specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/authorization-RoleAssignmentsCalls.json create mode 100644 specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/common-types.json create mode 100644 specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_CreateById.json create mode 100644 specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_CreateForResource.json create mode 100644 specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_CreateForResourceGroup.json create mode 100644 specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_CreateForSubscription.json create mode 100644 specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_Delete.json create mode 100644 specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_DeleteById.json create mode 100644 specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_Get.json create mode 100644 specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_GetById.json create mode 100644 specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_ListForResource.json create mode 100644 specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_ListForResourceGroup.json create mode 100644 specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_ListForScope.json create mode 100644 specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_ListForSubscription.json diff --git a/specification/authorization/resource-manager/Microsoft.Authorization/preview/2019-08-01-preview/authorization-UsageMetricsCalls.json b/specification/authorization/resource-manager/Microsoft.Authorization/preview/2019-08-01-preview/authorization-UsageMetricsCalls.json new file mode 100644 index 000000000000..a723ef63e1a8 --- /dev/null +++ b/specification/authorization/resource-manager/Microsoft.Authorization/preview/2019-08-01-preview/authorization-UsageMetricsCalls.json @@ -0,0 +1,105 @@ +{ + "swagger": "2.0", + "info": { + "title": "AuthorizationManagementClient", + "version": "2019-08-01-preview", + "description": "Role based access control provides you a way to apply granular level policy administration down to individual resources or resource groups. These operations enable you to manage role assignments. A role assignment grants access to Azure Active Directory users." + }, + "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": { + "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/roleAssignmentsUsageMetrics": { + "get": { + "tags": [ + "RoleAssignmentMetrics" + ], + "operationId": "RoleAssignmentMetrics_GetMetricsForSubscription", + "description": "Get role assignment usage metrics for a subscription", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Returns current role assignment usage metrics.", + "schema": { + "$ref": "#/definitions/RoleAssignmentMetricsResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Get role assignment metrics for subscription": { + "$ref": "./examples/RoleAssignmentMetrics_GetForSubscription.json" + } + } + } + } + }, + "definitions": { + "RoleAssignmentMetricsResult": { + "properties": { + "subscriptionId": { + "type": "string", + "readOnly": true, + "description": "The subscription ID." + }, + "roleAssignmentsLimit": { + "type": "integer", + "format": "int64", + "readOnly": true, + "description": "The role assignment limit." + }, + "roleAssignmentsCurrentCount": { + "type": "integer", + "format": "int64", + "readOnly": true, + "description": "The number of current role assignments." + }, + "roleAssignmentsRemainingCount": { + "type": "integer", + "format": "int64", + "readOnly": true, + "description": "The number of remaining role assignments available." + } + }, + "description": "Role Assignment Metrics" + } + }, + "parameters": {} +} diff --git a/specification/authorization/resource-manager/Microsoft.Authorization/preview/2019-08-01-preview/examples/RoleAssignmentMetrics_GetForSubscription.json b/specification/authorization/resource-manager/Microsoft.Authorization/preview/2019-08-01-preview/examples/RoleAssignmentMetrics_GetForSubscription.json new file mode 100644 index 000000000000..65d1b61d8d4e --- /dev/null +++ b/specification/authorization/resource-manager/Microsoft.Authorization/preview/2019-08-01-preview/examples/RoleAssignmentMetrics_GetForSubscription.json @@ -0,0 +1,16 @@ +{ + "parameters": { + "subscriptionId": "a925f2f7-5c63-4b7b-8799-25a5f97bc3b2", + "api-version": "2020-03-01-preview" + }, + "responses": { + "200": { + "body": { + "subscriptionId": "a925f2f7-5c63-4b7b-8799-25a5f97bc3b2", + "roleAssignmentsLimit": 2000, + "roleAssignmentsCurrentCount": 1530, + "roleAssignmentsRemainingCount": 470 + } + } + } +} diff --git a/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/authorization-RoleAssignmentsCalls.json b/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/authorization-RoleAssignmentsCalls.json new file mode 100644 index 000000000000..3baa050481b8 --- /dev/null +++ b/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/authorization-RoleAssignmentsCalls.json @@ -0,0 +1,679 @@ +{ + "swagger": "2.0", + "info": { + "title": "AuthorizationManagementClient", + "version": "2020-03-01-preview", + "description": "Role based access control provides you a way to apply granular level policy administration down to individual resources or resource groups. These operations enable you to manage role assignments. A role assignment grants access to Azure Active Directory users." + }, + "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": { + "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/roleAssignments": { + "get": { + "tags": [ + "RoleAssignments" + ], + "operationId": "RoleAssignments_ListForSubscription", + "description": "List all role assignments that apply to a subscription.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RoleAssignmentFilterParameter" + } + ], + "responses": { + "200": { + "description": "Returns an array of role assignments.", + "schema": { + "$ref": "#/definitions/RoleAssignmentListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-odata": "#/definitions/RoleAssignmentFilter", + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "x-ms-examples": { + "List role assignments for subscription": { + "$ref": "./examples/RoleAssignments_ListForSubscription.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/roleAssignments": { + "get": { + "tags": [ + "RoleAssignments" + ], + "operationId": "RoleAssignments_ListForResourceGroup", + "description": "List all role assignments that apply to a resource group.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RoleAssignmentFilterParameter" + } + ], + "responses": { + "200": { + "description": "Returns an array of role assignments.", + "schema": { + "$ref": "#/definitions/RoleAssignmentListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-odata": "#/definitions/RoleAssignmentFilter", + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "x-ms-examples": { + "List role assignments for resource group": { + "$ref": "./examples/RoleAssignments_ListForResourceGroup.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/roleAssignments": { + "get": { + "tags": [ + "RoleAssignments" + ], + "operationId": "RoleAssignments_ListForResource", + "description": "List all role assignments that apply to a resource.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "./common-types.json#/parameters/ResourceProviderNamespaceParameter" + }, + { + "$ref": "./common-types.json#/parameters/ResourceTypeParameter" + }, + { + "$ref": "./common-types.json#/parameters/ResourceNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RoleAssignmentFilterParameter" + } + ], + "responses": { + "200": { + "description": "Returns an array of role assignments.", + "schema": { + "$ref": "#/definitions/RoleAssignmentListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-odata": "#/definitions/RoleAssignmentFilter", + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "x-ms-examples": { + "List role assignments for a resource": { + "$ref": "./examples/RoleAssignments_ListForResource.json" + } + } + } + }, + "/{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}": { + "get": { + "tags": [ + "RoleAssignments" + ], + "operationId": "RoleAssignments_Get", + "description": "Get a role assignment by scope and name.", + "parameters": [ + { + "$ref": "./common-types.json#/parameters/ScopeParameter" + }, + { + "$ref": "#/parameters/RoleAssignmentNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Returns the role assignment.", + "schema": { + "$ref": "#/definitions/RoleAssignment" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Get role assignment by scope and name": { + "$ref": "./examples/RoleAssignments_Get.json" + } + } + }, + "put": { + "tags": [ + "RoleAssignments" + ], + "operationId": "RoleAssignments_Create", + "description": "Create or update a role assignment by scope and name.", + "parameters": [ + { + "$ref": "./common-types.json#/parameters/ScopeParameter" + }, + { + "$ref": "#/parameters/RoleAssignmentNameParameter" + }, + { + "$ref": "#/parameters/RoleAssignmentCreateParameters" + }, + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "201": { + "description": "Returns the role assignment.", + "schema": { + "$ref": "#/definitions/RoleAssignment" + } + }, + "200": { + "description": "Returns the role assignment.", + "schema": { + "$ref": "#/definitions/RoleAssignment" + } + }, + "500": { + "description": "Error.", + "schema": { + "$ref": "#/definitions/CustomErrorResponse" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Create role assignment for subscription": { + "$ref": "./examples/RoleAssignments_CreateForSubscription.json" + }, + "Create role assignment for resource group": { + "$ref": "./examples/RoleAssignments_CreateForResourceGroup.json" + }, + "Create role assignment for resource": { + "$ref": "./examples/RoleAssignments_CreateForResource.json" + } + } + }, + "delete": { + "tags": [ + "RoleAssignments" + ], + "operationId": "RoleAssignments_Delete", + "description": "Delete a role assignment by scope and name.", + "parameters": [ + { + "$ref": "./common-types.json#/parameters/ScopeParameter" + }, + { + "$ref": "#/parameters/RoleAssignmentNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Returns the deleted role assignment.", + "schema": { + "$ref": "#/definitions/RoleAssignment" + } + }, + "204": { + "description": "Role assignment was already deleted or does not exist." + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Delete role assignment": { + "$ref": "./examples/RoleAssignments_Delete.json" + } + } + } + }, + "/{scope}/providers/Microsoft.Authorization/roleAssignments": { + "get": { + "tags": [ + "RoleAssignments" + ], + "operationId": "RoleAssignments_ListForScope", + "description": "List all role assignments that apply to a scope.", + "parameters": [ + { + "$ref": "./common-types.json#/parameters/ScopeParameter" + }, + { + "$ref": "#/parameters/RoleAssignmentFilterParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Returns an array of role assignments.", + "schema": { + "$ref": "#/definitions/RoleAssignmentListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "x-ms-odata": "#/definitions/RoleAssignmentFilter", + "x-ms-examples": { + "List role assignments for scope": { + "$ref": "./examples/RoleAssignments_ListForScope.json" + } + } + } + }, + "/{roleAssignmentId}": { + "get": { + "tags": [ + "RoleAssignments" + ], + "operationId": "RoleAssignments_GetById", + "description": "Get a role assignment by ID.", + "parameters": [ + { + "$ref": "#/parameters/RoleAssignmentIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Returns the role assignment.", + "schema": { + "$ref": "#/definitions/RoleAssignment" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Get role assignment by ID": { + "$ref": "./examples/RoleAssignments_GetById.json" + } + } + }, + "put": { + "tags": [ + "RoleAssignments" + ], + "operationId": "RoleAssignments_CreateById", + "description": "Create or update a role assignment by ID.", + "parameters": [ + { + "$ref": "#/parameters/RoleAssignmentIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RoleAssignmentCreateParameters" + } + ], + "responses": { + "201": { + "description": "Returns the role assignment.", + "schema": { + "$ref": "#/definitions/RoleAssignment" + } + }, + "200": { + "description": "Returns the role assignment.", + "schema": { + "$ref": "#/definitions/RoleAssignment" + } + }, + "500": { + "description": "Error.", + "schema": { + "$ref": "#/definitions/CustomErrorResponse" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Create or update role assignment by ID": { + "$ref": "./examples/RoleAssignments_CreateById.json" + } + } + }, + "delete": { + "tags": [ + "RoleAssignments" + ], + "operationId": "RoleAssignments_DeleteById", + "description": "Delete a role assignment by ID.", + "parameters": [ + { + "$ref": "#/parameters/RoleAssignmentIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Returns the deleted role assignment.", + "schema": { + "$ref": "#/definitions/RoleAssignment" + } + }, + "204": { + "description": "Role assignment already deleted or does not exist." + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Delete role assignment by ID": { + "$ref": "./examples/RoleAssignments_DeleteById.json" + } + } + } + } + }, + "definitions": { + "CustomErrorResponse": { + "properties": { + "message": { + "type": "string", + "description": "Description of the error." + } + }, + "description": "Descriptive error response." + }, + "RoleAssignmentFilter": { + "properties": { + "principalId": { + "type": "string", + "description": "Returns role assignment of the specific principal." + } + }, + "description": "Role Assignments filter" + }, + "RoleAssignmentListResult": { + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/RoleAssignment" + }, + "description": "Role assignment list." + }, + "nextLink": { + "readOnly": true, + "type": "string", + "description": "The URL to use for getting the next set of results." + } + }, + "description": "Role assignment list operation result." + }, + "RoleAssignmentProperties": { + "properties": { + "scope": { + "type": "string", + "description": "The role assignment scope." + }, + "roleDefinitionId": { + "type": "string", + "description": "The role definition ID." + }, + "principalId": { + "type": "string", + "description": "The principal ID." + }, + "principalType": { + "type": "string", + "description": "The principal type of the assigned principal ID.", + "enum": [ + "User", + "Group", + "ServicePrincipal", + "Unknown", + "DirectoryRoleTemplate", + "ForeignGroup", + "Application", + "MSI", + "DirectoryObjectOrGroup", + "Everyone" + ], + "default": "User", + "x-ms-enum": { + "name": "PrincipalType", + "modelAsString": true + } + }, + "description": { + "type": "string", + "description": "Description of role assignment" + }, + "condition": { + "type": "string", + "description": "The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'" + }, + "conditionVersion": { + "type": "string", + "description": "Version of the condition. Currently accepted value is '2.0'" + }, + "createdOn": { + "readOnly": true, + "type": "string", + "description": "Time it was created", + "format": "date-time" + }, + "updatedOn": { + "readOnly": true, + "type": "string", + "description": "Time it was updated", + "format": "date-time" + }, + "createdBy": { + "readOnly": true, + "type": "string", + "description": "Id of the user who created the assignment" + }, + "updatedBy": { + "readOnly": true, + "type": "string", + "description": "Id of the user who updated the assignment" + }, + "delegatedManagedIdentityResourceId": { + "type": "string", + "description": "Id of the delegated managed identity resource" + } + }, + "required": [ + "roleDefinitionId", + "principalId" + ], + "description": "Role assignment properties." + }, + "RoleAssignment": { + "x-ms-azure-resource": true, + "properties": { + "id": { + "type": "string", + "readOnly": true, + "description": "The role assignment ID." + }, + "name": { + "type": "string", + "readOnly": true, + "description": "The role assignment name." + }, + "type": { + "type": "string", + "readOnly": true, + "description": "The role assignment type." + }, + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/RoleAssignmentProperties", + "description": "Role assignment properties." + } + }, + "description": "Role Assignments" + }, + "RoleAssignmentCreateParameters": { + "properties": { + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/RoleAssignmentProperties", + "description": "Role assignment properties." + } + }, + "required": [ + "properties" + ], + "description": "Role assignment create parameters." + } + }, + "parameters": { + "RoleAssignmentFilterParameter": { + "name": "$filter", + "in": "query", + "required": false, + "type": "string", + "description": "The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope for the specified principal.", + "x-ms-skip-url-encoding": true, + "x-ms-parameter-location": "method" + }, + "RoleAssignmentNameParameter": { + "name": "roleAssignmentName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the role assignment. It can be any valid GUID.", + "x-ms-skip-url-encoding": true, + "x-ms-parameter-location": "method" + }, + "RoleAssignmentIdParameter": { + "name": "roleAssignmentId", + "in": "path", + "required": true, + "type": "string", + "description": "The fully qualified ID of the role assignment including scope, resource name, and resource type. Format: /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. Example: /subscriptions//resourcegroups//providers/Microsoft.Authorization/roleAssignments/", + "x-ms-skip-url-encoding": true, + "x-ms-parameter-location": "method" + }, + "RoleAssignmentCreateParameters": { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/RoleAssignmentCreateParameters" + }, + "description": "Parameters for the role assignment.", + "x-ms-parameter-location": "method" + } + } +} diff --git a/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/common-types.json b/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/common-types.json new file mode 100644 index 000000000000..7a046cf80498 --- /dev/null +++ b/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/common-types.json @@ -0,0 +1,81 @@ +{ + "swagger": "2.0", + "info": { + "version": "2020-03-01-preview", + "title": "Common types" + }, + "paths": {}, + "definitions": { + "Permission": { + "properties": { + "actions": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Allowed actions." + }, + "notActions": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Denied actions." + }, + "dataActions": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Allowed Data actions." + }, + "notDataActions": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Denied Data actions." + } + }, + "description": "Role definition permissions." + } + }, + "parameters": { + "ResourceProviderNamespaceParameter": { + "name": "resourceProviderNamespace", + "in": "path", + "required": true, + "type": "string", + "description": "The namespace of the resource provider.", + "x-ms-skip-url-encoding": true, + "x-ms-parameter-location": "method" + }, + "ResourceTypeParameter": { + "name": "resourceType", + "in": "path", + "required": true, + "type": "string", + "description": "The resource type name. For example the type name of a web app is 'sites' (from Microsoft.Web/sites).", + "x-ms-skip-url-encoding": true, + "x-ms-parameter-location": "method" + }, + "ResourceNameParameter": { + "name": "resourceName", + "in": "path", + "required": true, + "type": "string", + "description": "The resource name.", + "x-ms-skip-url-encoding": true, + "x-ms-parameter-location": "method" + }, + "ScopeParameter": { + "name": "scope", + "in": "path", + "required": true, + "type": "string", + "description": "The scope of the operation or resource. Valid scopes are: subscription (format: '/subscriptions/{subscriptionId}'), resource group (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'", + "x-ms-skip-url-encoding": true, + "x-ms-parameter-location": "method" + } + } +} diff --git a/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_CreateById.json b/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_CreateById.json new file mode 100644 index 000000000000..14c86b512f5d --- /dev/null +++ b/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_CreateById.json @@ -0,0 +1,46 @@ +{ + "parameters": { + "roleAssignmentId": "subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/providers/Microsoft.Authorization/roleAssignments/b0f43c54-e787-4862-89b1-a653fa9cf747", + "api-version": "2020-08-01-preview", + "parameters": { + "properties": { + "roleDefinitionId": "/providers/Microsoft.Authorization/roleDefinitions/0b5fe924-9a61-425c-96af-cfe6e287ca2d", + "principalId": "ce2ce14e-85d7-4629-bdbc-454d0519d987", + "principalType": "User" + } + } + }, + "responses": { + "201": { + "body": { + "properties": { + "roleDefinitionId": "/providers/Microsoft.Authorization/roleDefinitions/0b5fe924-9a61-425c-96af-cfe6e287ca2d", + "principalId": "ce2ce14e-85d7-4629-bdbc-454d0519d987", + "principalType": "User", + "scope": "/subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2" + }, + "id": "/subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/providers/Microsoft.Authorization/roleAssignments/b0f43c54-e787-4862-89b1-a653fa9cf747", + "type": "Microsoft.Authorization/roleAssignments", + "name": "b0f43c54-e787-4862-89b1-a653fa9cf747" + } + }, + "200": { + "body": { + "properties": { + "roleDefinitionId": "/providers/Microsoft.Authorization/roleDefinitions/0b5fe924-9a61-425c-96af-cfe6e287ca2d", + "principalId": "ce2ce14e-85d7-4629-bdbc-454d0519d987", + "principalType": "User", + "scope": "/subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2" + }, + "id": "/subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/providers/Microsoft.Authorization/roleAssignments/b0f43c54-e787-4862-89b1-a653fa9cf747", + "type": "Microsoft.Authorization/roleAssignments", + "name": "b0f43c54-e787-4862-89b1-a653fa9cf747" + } + }, + "500": { + "body": { + "message": "Something went wrong." + } + } + } +} diff --git a/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_CreateForResource.json b/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_CreateForResource.json new file mode 100644 index 000000000000..3b3da95c7a67 --- /dev/null +++ b/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_CreateForResource.json @@ -0,0 +1,47 @@ +{ + "parameters": { + "scope": "subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/resourceGroups/testrg/providers/Microsoft.DocumentDb/databaseAccounts/test-db-account", + "roleAssignmentName": "05c5a614-a7d6-4502-b150-c2fb455033ff", + "api-version": "2020-08-01-preview", + "parameters": { + "properties": { + "roleDefinitionId": "/subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/providers/Microsoft.Authorization/roleDefinitions/0b5fe924-9a61-425c-96af-cfe6e287ca2d", + "principalId": "ce2ce14e-85d7-4629-bdbc-454d0519d987", + "principalType": "User" + } + } + }, + "responses": { + "201": { + "body": { + "properties": { + "roleDefinitionId": "/providers/Microsoft.Authorization/roleDefinitions/0b5fe924-9a61-425c-96af-cfe6e287ca2d", + "principalId": "ce2ce14e-85d7-4629-bdbc-454d0519d987", + "principalType": "User", + "scope": "/subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/resourceGroups/testrg/providers/Microsoft.DocumentDb/databaseAccounts/test-db-account" + }, + "id": "/subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/resourceGroups/testrg/providers/Microsoft.DocumentDb/databaseAccounts/test-db-account/providers/Microsoft.Authorization/roleAssignments/05c5a614-a7d6-4502-b150-c2fb455033ff", + "type": "Microsoft.Authorization/roleAssignments", + "name": "05c5a614-a7d6-4502-b150-c2fb455033ff" + } + }, + "200": { + "body": { + "properties": { + "roleDefinitionId": "/providers/Microsoft.Authorization/roleDefinitions/0b5fe924-9a61-425c-96af-cfe6e287ca2d", + "principalId": "ce2ce14e-85d7-4629-bdbc-454d0519d987", + "principalType": "User", + "scope": "/subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/resourceGroups/testrg/providers/Microsoft.DocumentDb/databaseAccounts/test-db-account" + }, + "id": "/subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/resourceGroups/testrg/providers/Microsoft.DocumentDb/databaseAccounts/test-db-account/providers/Microsoft.Authorization/roleAssignments/05c5a614-a7d6-4502-b150-c2fb455033ff", + "type": "Microsoft.Authorization/roleAssignments", + "name": "05c5a614-a7d6-4502-b150-c2fb455033ff" + } + }, + "500": { + "body": { + "message": "Something went wrong." + } + } + } +} diff --git a/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_CreateForResourceGroup.json b/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_CreateForResourceGroup.json new file mode 100644 index 000000000000..098d4bf9c675 --- /dev/null +++ b/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_CreateForResourceGroup.json @@ -0,0 +1,47 @@ +{ + "parameters": { + "scope": "subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/resourceGroups/testrg", + "roleAssignmentName": "05c5a614-a7d6-4502-b150-c2fb455033ff", + "api-version": "2020-08-01-preview", + "parameters": { + "properties": { + "roleDefinitionId": "/subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/providers/Microsoft.Authorization/roleDefinitions/0b5fe924-9a61-425c-96af-cfe6e287ca2d", + "principalId": "ce2ce14e-85d7-4629-bdbc-454d0519d987", + "principalType": "User" + } + } + }, + "responses": { + "201": { + "body": { + "properties": { + "roleDefinitionId": "/providers/Microsoft.Authorization/roleDefinitions/0b5fe924-9a61-425c-96af-cfe6e287ca2d", + "principalId": "ce2ce14e-85d7-4629-bdbc-454d0519d987", + "principalType": "User", + "scope": "/subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/resourceGroups/testrg" + }, + "id": "/subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/resourceGroups/testrg/providers/Microsoft.Authorization/roleAssignments/05c5a614-a7d6-4502-b150-c2fb455033ff", + "type": "Microsoft.Authorization/roleAssignments", + "name": "05c5a614-a7d6-4502-b150-c2fb455033ff" + } + }, + "200": { + "body": { + "properties": { + "roleDefinitionId": "/providers/Microsoft.Authorization/roleDefinitions/0b5fe924-9a61-425c-96af-cfe6e287ca2d", + "principalId": "ce2ce14e-85d7-4629-bdbc-454d0519d987", + "principalType": "User", + "scope": "/subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/resourceGroups/testrg" + }, + "id": "/subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/resourceGroups/testrg/providers/Microsoft.Authorization/roleAssignments/05c5a614-a7d6-4502-b150-c2fb455033ff", + "type": "Microsoft.Authorization/roleAssignments", + "name": "05c5a614-a7d6-4502-b150-c2fb455033ff" + } + }, + "500": { + "body": { + "message": "Something went wrong." + } + } + } +} diff --git a/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_CreateForSubscription.json b/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_CreateForSubscription.json new file mode 100644 index 000000000000..45948d92d258 --- /dev/null +++ b/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_CreateForSubscription.json @@ -0,0 +1,47 @@ +{ + "parameters": { + "scope": "subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2", + "roleAssignmentName": "05c5a614-a7d6-4502-b150-c2fb455033ff", + "api-version": "2020-08-01-preview", + "parameters": { + "properties": { + "roleDefinitionId": "/subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/providers/Microsoft.Authorization/roleDefinitions/0b5fe924-9a61-425c-96af-cfe6e287ca2d", + "principalId": "ce2ce14e-85d7-4629-bdbc-454d0519d987", + "principalType": "User" + } + } + }, + "responses": { + "201": { + "body": { + "properties": { + "roleDefinitionId": "/providers/Microsoft.Authorization/roleDefinitions/0b5fe924-9a61-425c-96af-cfe6e287ca2d", + "principalId": "ce2ce14e-85d7-4629-bdbc-454d0519d987", + "principalType": "User", + "scope": "/subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2" + }, + "id": "/subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/providers/Microsoft.Authorization/roleAssignments/05c5a614-a7d6-4502-b150-c2fb455033ff", + "type": "Microsoft.Authorization/roleAssignments", + "name": "05c5a614-a7d6-4502-b150-c2fb455033ff" + } + }, + "200": { + "body": { + "properties": { + "roleDefinitionId": "/providers/Microsoft.Authorization/roleDefinitions/0b5fe924-9a61-425c-96af-cfe6e287ca2d", + "principalId": "ce2ce14e-85d7-4629-bdbc-454d0519d987", + "principalType": "User", + "scope": "/subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2" + }, + "id": "/subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/providers/Microsoft.Authorization/roleAssignments/05c5a614-a7d6-4502-b150-c2fb455033ff", + "type": "Microsoft.Authorization/roleAssignments", + "name": "05c5a614-a7d6-4502-b150-c2fb455033ff" + } + }, + "500": { + "body": { + "message": "Something went wrong." + } + } + } +} diff --git a/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_Delete.json b/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_Delete.json new file mode 100644 index 000000000000..17767c7232e0 --- /dev/null +++ b/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_Delete.json @@ -0,0 +1,23 @@ +{ + "parameters": { + "scope": "subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2", + "roleAssignmentName": "b0f43c54-e787-4862-89b1-a653fa9cf747", + "api-version": "2020-08-01-preview" + }, + "responses": { + "200": { + "body": { + "properties": { + "roleDefinitionId": "/providers/Microsoft.Authorization/roleDefinitions/0b5fe924-9a61-425c-96af-cfe6e287ca2d", + "principalId": "ce2ce14e-85d7-4629-bdbc-454d0519d987", + "principalType": "User", + "scope": "/subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2" + }, + "id": "/subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/providers/Microsoft.Authorization/roleAssignments/b0f43c54-e787-4862-89b1-a653fa9cf747", + "type": "Microsoft.Authorization/roleAssignments", + "name": "b0f43c54-e787-4862-89b1-a653fa9cf747" + } + }, + "204": {} + } +} diff --git a/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_DeleteById.json b/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_DeleteById.json new file mode 100644 index 000000000000..f7037896bdb7 --- /dev/null +++ b/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_DeleteById.json @@ -0,0 +1,22 @@ +{ + "parameters": { + "roleAssignmentId": "subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/providers/Microsoft.Authorization/roleAssignments/b0f43c54-e787-4862-89b1-a653fa9cf747", + "api-version": "2020-08-01-preview" + }, + "responses": { + "200": { + "body": { + "properties": { + "roleDefinitionId": "/providers/Microsoft.Authorization/roleDefinitions/0b5fe924-9a61-425c-96af-cfe6e287ca2d", + "principalId": "ce2ce14e-85d7-4629-bdbc-454d0519d987", + "principalType": "User", + "scope": "/subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2" + }, + "id": "/subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/providers/Microsoft.Authorization/roleAssignments/b0f43c54-e787-4862-89b1-a653fa9cf747", + "type": "Microsoft.Authorization/roleAssignments", + "name": "b0f43c54-e787-4862-89b1-a653fa9cf747" + } + }, + "204": {} + } +} diff --git a/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_Get.json b/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_Get.json new file mode 100644 index 000000000000..b3a3b077bf5c --- /dev/null +++ b/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_Get.json @@ -0,0 +1,22 @@ +{ + "parameters": { + "scope": "subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2", + "roleAssignmentName": "b0f43c54-e787-4862-89b1-a653fa9cf747", + "api-version": "2020-08-01-preview" + }, + "responses": { + "200": { + "body": { + "properties": { + "roleDefinitionId": "/providers/Microsoft.Authorization/roleDefinitions/0b5fe924-9a61-425c-96af-cfe6e287ca2d", + "principalId": "ce2ce14e-85d7-4629-bdbc-454d0519d987", + "principalType": "User", + "scope": "/subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2" + }, + "id": "/subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/providers/Microsoft.Authorization/roleAssignments/b0f43c54-e787-4862-89b1-a653fa9cf747", + "type": "Microsoft.Authorization/roleAssignments", + "name": "b0f43c54-e787-4862-89b1-a653fa9cf747" + } + } + } +} diff --git a/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_GetById.json b/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_GetById.json new file mode 100644 index 000000000000..f78e8948ca60 --- /dev/null +++ b/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_GetById.json @@ -0,0 +1,21 @@ +{ + "parameters": { + "roleAssignmentId": "subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/providers/Microsoft.Authorization/roleAssignments/b0f43c54-e787-4862-89b1-a653fa9cf747", + "api-version": "2020-08-01-preview" + }, + "responses": { + "200": { + "body": { + "properties": { + "roleDefinitionId": "/providers/Microsoft.Authorization/roleDefinitions/0b5fe924-9a61-425c-96af-cfe6e287ca2d", + "principalId": "ce2ce14e-85d7-4629-bdbc-454d0519d987", + "principalType": "User", + "scope": "/subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2" + }, + "id": "/subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/providers/Microsoft.Authorization/roleAssignments/b0f43c54-e787-4862-89b1-a653fa9cf747", + "type": "Microsoft.Authorization/roleAssignments", + "name": "b0f43c54-e787-4862-89b1-a653fa9cf747" + } + } + } +} diff --git a/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_ListForResource.json b/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_ListForResource.json new file mode 100644 index 000000000000..5479dcaacbee --- /dev/null +++ b/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_ListForResource.json @@ -0,0 +1,51 @@ +{ + "parameters": { + "subscriptionId": "a925f2f7-5c63-4b7b-8799-25a5f97bc3b2", + "resourceGroupName": "testrg", + "resourceProviderNamespace": "Microsoft.DocumentDb", + "resourceType": "databaseAccounts", + "resourceName": "test-db-account", + "api-version": "2020-08-01-preview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "properties": { + "roleDefinitionId": "/providers/Microsoft.Authorization/roleDefinitions/0b5fe924-9a61-425c-96af-cfe6e287ca2d", + "principalId": "ce2ce14e-85d7-4629-bdbc-454d0519d987", + "principalType": "User", + "scope": "/subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2" + }, + "id": "/subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/providers/Microsoft.Authorization/roleAssignments/b0f43c54-e787-4862-89b1-a653fa9cf747", + "type": "Microsoft.Authorization/roleAssignments", + "name": "b0f43c54-e787-4862-89b1-a653fa9cf747" + }, + { + "properties": { + "roleDefinitionId": "/providers/Microsoft.Authorization/roleDefinitions/0b5fe924-9a61-425c-96af-cfe6e287ca2d", + "principalId": "ce2ce14e-85d7-4629-bdbc-454d0519d987", + "principalType": "User", + "scope": "/subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/resourceGroups/testrg" + }, + "id": "/subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/resourceGroups/testrg/providers/Microsoft.Authorization/roleAssignments/96786e4b-dede-4c2e-8736-8ab911987f08", + "type": "Microsoft.Authorization/roleAssignments", + "name": "96786e4b-dede-4c2e-8736-8ab911987f08" + }, + { + "properties": { + "roleDefinitionId": "/providers/Microsoft.Authorization/roleDefinitions/0b5fe924-9a61-425c-96af-cfe6e287ca2d", + "principalId": "ce2ce14e-85d7-4629-bdbc-454d0519d987", + "principalType": "User", + "scope": "/subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/resourceGroups/testrg/providers/Microsoft.DocumentDb/databaseAccounts/test-db-account" + }, + "id": "/subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/resourceGroups/testrg/providers/Microsoft.DocumentDb/databaseAccounts/test-db-account/providers/Microsoft.Authorization/roleAssignments/05c5a614-a7d6-4502-b150-c2fb455033ff", + "type": "Microsoft.Authorization/roleAssignments", + "name": "05c5a614-a7d6-4502-b150-c2fb455033ff" + } + ] + } + } + } +} diff --git a/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_ListForResourceGroup.json b/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_ListForResourceGroup.json new file mode 100644 index 000000000000..5bb41e369791 --- /dev/null +++ b/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_ListForResourceGroup.json @@ -0,0 +1,37 @@ +{ + "parameters": { + "subscriptionId": "a925f2f7-5c63-4b7b-8799-25a5f97bc3b2", + "resourceGroupName": "testrg", + "api-version": "2020-08-01-preview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "properties": { + "roleDefinitionId": "/providers/Microsoft.Authorization/roleDefinitions/0b5fe924-9a61-425c-96af-cfe6e287ca2d", + "principalId": "ce2ce14e-85d7-4629-bdbc-454d0519d987", + "principalType": "User", + "scope": "/subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2" + }, + "id": "/subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/providers/Microsoft.Authorization/roleAssignments/b0f43c54-e787-4862-89b1-a653fa9cf747", + "type": "Microsoft.Authorization/roleAssignments", + "name": "b0f43c54-e787-4862-89b1-a653fa9cf747" + }, + { + "properties": { + "roleDefinitionId": "/providers/Microsoft.Authorization/roleDefinitions/0b5fe924-9a61-425c-96af-cfe6e287ca2d", + "principalId": "ce2ce14e-85d7-4629-bdbc-454d0519d987", + "principalType": "User", + "scope": "/subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/resourceGroups/testrg" + }, + "id": "/subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/resourceGroups/testrg/providers/Microsoft.Authorization/roleAssignments/96786e4b-dede-4c2e-8736-8ab911987f08", + "type": "Microsoft.Authorization/roleAssignments", + "name": "96786e4b-dede-4c2e-8736-8ab911987f08" + } + ] + } + } + } +} diff --git a/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_ListForScope.json b/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_ListForScope.json new file mode 100644 index 000000000000..59fffd4355ba --- /dev/null +++ b/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_ListForScope.json @@ -0,0 +1,25 @@ +{ + "parameters": { + "scope": "subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2", + "api-version": "2020-08-01-preview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "properties": { + "roleDefinitionId": "/providers/Microsoft.Authorization/roleDefinitions/0b5fe924-9a61-425c-96af-cfe6e287ca2d", + "principalId": "ce2ce14e-85d7-4629-bdbc-454d0519d987", + "principalType": "User", + "scope": "/subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2" + }, + "id": "/subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/providers/Microsoft.Authorization/roleAssignments/b0f43c54-e787-4862-89b1-a653fa9cf747", + "type": "Microsoft.Authorization/roleAssignments", + "name": "b0f43c54-e787-4862-89b1-a653fa9cf747" + } + ] + } + } + } +} diff --git a/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_ListForSubscription.json b/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_ListForSubscription.json new file mode 100644 index 000000000000..a6cde20bdccd --- /dev/null +++ b/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_ListForSubscription.json @@ -0,0 +1,25 @@ +{ + "parameters": { + "subscriptionId": "a925f2f7-5c63-4b7b-8799-25a5f97bc3b2", + "api-version": "2020-08-01-preview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "properties": { + "roleDefinitionId": "/providers/Microsoft.Authorization/roleDefinitions/0b5fe924-9a61-425c-96af-cfe6e287ca2d", + "principalId": "ce2ce14e-85d7-4629-bdbc-454d0519d987", + "principalType": "User", + "scope": "/subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2" + }, + "id": "/subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/providers/Microsoft.Authorization/roleAssignments/b0f43c54-e787-4862-89b1-a653fa9cf747", + "type": "Microsoft.Authorization/roleAssignments", + "name": "b0f43c54-e787-4862-89b1-a653fa9cf747" + } + ] + } + } + } +} diff --git a/specification/authorization/resource-manager/readme.md b/specification/authorization/resource-manager/readme.md index fe2381e381f2..a8f6e8e7cdae 100644 --- a/specification/authorization/resource-manager/readme.md +++ b/specification/authorization/resource-manager/readme.md @@ -100,6 +100,22 @@ input-file: - Microsoft.Authorization/preview/2020-10-01-preview/RoleManagementPolicyAssignment.json ``` +### Tag: package-2020-08-01-preview + +These settings apply only when `--tag=package-2020-08-01-preview` is specified on the command line. + +``` yaml $(tag) == 'package-2020-08-01-preview' +input-file: +- Microsoft.Authorization/preview/2020-03-01-preview/authorization-ClassicAdminCalls.json +- Microsoft.Authorization/preview/2020-03-01-preview/authorization-ElevateAccessCalls.json +- Microsoft.Authorization/preview/2020-03-01-preview/authorization-ProviderOperationsCalls.json +- Microsoft.Authorization/preview/2020-03-01-preview/authorization-RoleDefinitionsCalls.json +- Microsoft.Authorization/preview/2020-03-01-preview/authorization-DenyAssignmentGetCalls.json +- Microsoft.Authorization/preview/2020-03-01-preview/authorization-PermissionsCalls.json +- Microsoft.Authorization/preview/2020-08-01-preview/authorization-RoleAssignmentsCalls.json +- Microsoft.Authorization/preview/2019-08-01-preview/authorization-UsageMetricsCalls.json +``` + ### Tag: package-2020-04-01-preview These settings apply only when `--tag=package-2020-04-01-preview` is specified on the command line. From f84e55285a204b3d229738b1396ac5afa00d92b9 Mon Sep 17 00:00:00 2001 From: Jeff Hackshaw Date: Mon, 1 Mar 2021 10:32:14 -0800 Subject: [PATCH 2/8] update version in spec --- .../2020-08-01-preview/authorization-RoleAssignmentsCalls.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/authorization-RoleAssignmentsCalls.json b/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/authorization-RoleAssignmentsCalls.json index 3baa050481b8..92a42b1a6e66 100644 --- a/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/authorization-RoleAssignmentsCalls.json +++ b/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/authorization-RoleAssignmentsCalls.json @@ -2,7 +2,7 @@ "swagger": "2.0", "info": { "title": "AuthorizationManagementClient", - "version": "2020-03-01-preview", + "version": "2020-08-01-preview", "description": "Role based access control provides you a way to apply granular level policy administration down to individual resources or resource groups. These operations enable you to manage role assignments. A role assignment grants access to Azure Active Directory users." }, "host": "management.azure.com", From 422a849e0701dfa32ec6ff6ead79eb686bedda40 Mon Sep 17 00:00:00 2001 From: Jeff Hackshaw Date: Tue, 2 Mar 2021 16:59:49 -0800 Subject: [PATCH 3/8] validate calls --- .../authorization-RoleAssignmentsCalls.json | 93 +++++++++++++++++++ .../examples/RoleAssignments_Validate.json | 34 +++++++ .../RoleAssignments_ValidateById.json | 33 +++++++ 3 files changed, 160 insertions(+) create mode 100644 specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_Validate.json create mode 100644 specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_ValidateById.json diff --git a/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/authorization-RoleAssignmentsCalls.json b/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/authorization-RoleAssignmentsCalls.json index 92a42b1a6e66..e08e24aa789b 100644 --- a/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/authorization-RoleAssignmentsCalls.json +++ b/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/authorization-RoleAssignmentsCalls.json @@ -315,6 +315,54 @@ } } }, + "/{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}/validate": { + "post": { + "tags": [ + "RoleAssignments" + ], + "operationId": "RoleAssignments_Validate", + "description": "Validate a role assignment create or update operation by scope and name.", + "parameters": [ + { + "$ref": "./common-types.json#/parameters/ScopeParameter" + }, + { + "$ref": "#/parameters/RoleAssignmentNameParameter" + }, + { + "$ref": "#/parameters/RoleAssignmentCreateParameters" + }, + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Returns the role assignment.", + "schema": { + "$ref": "#/definitions/RoleAssignment" + } + }, + "500": { + "description": "Error.", + "schema": { + "$ref": "#/definitions/CustomErrorResponse" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Validate a role assignment create or update operation": { + "$ref": "./examples/RoleAssignments_Validate.json" + } + } + } + }, "/{scope}/providers/Microsoft.Authorization/roleAssignments": { "get": { "tags": [ @@ -479,6 +527,51 @@ } } } + }, + "/{roleAssignmentId}/validate": { + "post": { + "tags": [ + "RoleAssignments" + ], + "operationId": "RoleAssignments_ValidateById", + "description": "Validate a role assignment create or update operation by ID.", + "parameters": [ + { + "$ref": "#/parameters/RoleAssignmentIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RoleAssignmentCreateParameters" + } + ], + "responses": { + "200": { + "description": "Returns the role assignment.", + "schema": { + "$ref": "#/definitions/RoleAssignment" + } + }, + "500": { + "description": "Error.", + "schema": { + "$ref": "#/definitions/CustomErrorResponse" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Validate a role assignment create or update operation by ID": { + "$ref": "./examples/RoleAssignments_ValidateById.json" + } + } + } } }, "definitions": { diff --git a/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_Validate.json b/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_Validate.json new file mode 100644 index 000000000000..bdefe4a2ead2 --- /dev/null +++ b/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_Validate.json @@ -0,0 +1,34 @@ +{ + "parameters": { + "scope": "subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2", + "roleAssignmentName": "05c5a614-a7d6-4502-b150-c2fb455033ff", + "api-version": "2020-08-01-preview", + "parameters": { + "properties": { + "roleDefinitionId": "/subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/providers/Microsoft.Authorization/roleDefinitions/0b5fe924-9a61-425c-96af-cfe6e287ca2d", + "principalId": "ce2ce14e-85d7-4629-bdbc-454d0519d987", + "principalType": "User" + } + } + }, + "responses": { + "200": { + "body": { + "properties": { + "roleDefinitionId": "/providers/Microsoft.Authorization/roleDefinitions/0b5fe924-9a61-425c-96af-cfe6e287ca2d", + "principalId": "ce2ce14e-85d7-4629-bdbc-454d0519d987", + "principalType": "User", + "scope": "/subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2" + }, + "id": "/subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/providers/Microsoft.Authorization/roleAssignments/05c5a614-a7d6-4502-b150-c2fb455033ff", + "type": "Microsoft.Authorization/roleAssignments", + "name": "05c5a614-a7d6-4502-b150-c2fb455033ff" + } + }, + "500": { + "body": { + "message": "Something went wrong." + } + } + } +} diff --git a/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_ValidateById.json b/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_ValidateById.json new file mode 100644 index 000000000000..6f0eb9b46e8f --- /dev/null +++ b/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_ValidateById.json @@ -0,0 +1,33 @@ +{ + "parameters": { + "roleAssignmentId": "subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/providers/Microsoft.Authorization/roleAssignments/b0f43c54-e787-4862-89b1-a653fa9cf747", + "api-version": "2020-08-01-preview", + "parameters": { + "properties": { + "roleDefinitionId": "/providers/Microsoft.Authorization/roleDefinitions/0b5fe924-9a61-425c-96af-cfe6e287ca2d", + "principalId": "ce2ce14e-85d7-4629-bdbc-454d0519d987", + "principalType": "User" + } + } + }, + "responses": { + "200": { + "body": { + "properties": { + "roleDefinitionId": "/providers/Microsoft.Authorization/roleDefinitions/0b5fe924-9a61-425c-96af-cfe6e287ca2d", + "principalId": "ce2ce14e-85d7-4629-bdbc-454d0519d987", + "principalType": "User", + "scope": "/subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2" + }, + "id": "/subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/providers/Microsoft.Authorization/roleAssignments/b0f43c54-e787-4862-89b1-a653fa9cf747", + "type": "Microsoft.Authorization/roleAssignments", + "name": "b0f43c54-e787-4862-89b1-a653fa9cf747" + } + }, + "500": { + "body": { + "message": "Something went wrong." + } + } + } +} From 74aedf3fb9663e3d71e79e46a422f92e12ab4c98 Mon Sep 17 00:00:00 2001 From: Jeff Hackshaw Date: Wed, 10 Mar 2021 08:56:20 -0800 Subject: [PATCH 4/8] update version --- .../examples/RoleAssignmentMetrics_GetForSubscription.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/authorization/resource-manager/Microsoft.Authorization/preview/2019-08-01-preview/examples/RoleAssignmentMetrics_GetForSubscription.json b/specification/authorization/resource-manager/Microsoft.Authorization/preview/2019-08-01-preview/examples/RoleAssignmentMetrics_GetForSubscription.json index 65d1b61d8d4e..0a361d0fd93c 100644 --- a/specification/authorization/resource-manager/Microsoft.Authorization/preview/2019-08-01-preview/examples/RoleAssignmentMetrics_GetForSubscription.json +++ b/specification/authorization/resource-manager/Microsoft.Authorization/preview/2019-08-01-preview/examples/RoleAssignmentMetrics_GetForSubscription.json @@ -1,7 +1,7 @@ { "parameters": { "subscriptionId": "a925f2f7-5c63-4b7b-8799-25a5f97bc3b2", - "api-version": "2020-03-01-preview" + "api-version": "2019-08-01-preview" }, "responses": { "200": { From e5de35dcbc011c6a76fe06da716612f26beaa472 Mon Sep 17 00:00:00 2001 From: Jeff Hackshaw Date: Wed, 10 Mar 2021 09:15:24 -0800 Subject: [PATCH 5/8] fix new ci requirement --- .../authorization-RoleAssignmentsCalls.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/authorization-RoleAssignmentsCalls.json b/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/authorization-RoleAssignmentsCalls.json index e08e24aa789b..1205c6d62d64 100644 --- a/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/authorization-RoleAssignmentsCalls.json +++ b/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/authorization-RoleAssignmentsCalls.json @@ -250,6 +250,7 @@ } }, "500": { + "x-ms-error-response": true, "description": "Error.", "schema": { "$ref": "#/definitions/CustomErrorResponse" @@ -344,6 +345,7 @@ } }, "500": { + "x-ms-error-response": true, "description": "Error.", "schema": { "$ref": "#/definitions/CustomErrorResponse" @@ -472,6 +474,7 @@ } }, "500": { + "x-ms-error-response": true, "description": "Error.", "schema": { "$ref": "#/definitions/CustomErrorResponse" @@ -554,6 +557,7 @@ } }, "500": { + "x-ms-error-response": true, "description": "Error.", "schema": { "$ref": "#/definitions/CustomErrorResponse" From 47872bae1092c37127f7847c1095eec8b2dc11fc Mon Sep 17 00:00:00 2001 From: Jeff Hackshaw Date: Wed, 10 Mar 2021 13:42:08 -0800 Subject: [PATCH 6/8] fix version --- .../preview/2020-08-01-preview/common-types.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/common-types.json b/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/common-types.json index 7a046cf80498..03896a5f9da2 100644 --- a/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/common-types.json +++ b/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/common-types.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "version": "2020-03-01-preview", + "version": "2020-08-01-preview", "title": "Common types" }, "paths": {}, From bdba7124a920b1c995dc5e2bf71d20575124611f Mon Sep 17 00:00:00 2001 From: Jeff Hackshaw Date: Thu, 11 Mar 2021 16:15:58 -0800 Subject: [PATCH 7/8] fix validate definition --- .../authorization-RoleAssignmentsCalls.json | 46 ++++++++++++++++--- ... RoleAssignments_ValidateByIdInvalid.json} | 14 ++---- .../RoleAssignments_ValidateByIdValid.json | 25 ++++++++++ ...n => RoleAssignments_ValidateInvalid.json} | 14 ++---- .../RoleAssignments_ValidateValid.json | 26 +++++++++++ .../authorization/resource-manager/readme.md | 4 ++ 6 files changed, 104 insertions(+), 25 deletions(-) rename specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/{RoleAssignments_ValidateById.json => RoleAssignments_ValidateByIdInvalid.json} (52%) create mode 100644 specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_ValidateByIdValid.json rename specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/{RoleAssignments_Validate.json => RoleAssignments_ValidateInvalid.json} (52%) create mode 100644 specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_ValidateValid.json diff --git a/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/authorization-RoleAssignmentsCalls.json b/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/authorization-RoleAssignmentsCalls.json index 1205c6d62d64..ca804c060e91 100644 --- a/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/authorization-RoleAssignmentsCalls.json +++ b/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/authorization-RoleAssignmentsCalls.json @@ -339,9 +339,9 @@ ], "responses": { "200": { - "description": "Returns the role assignment.", + "description": "Returns whether or not validation was successful.", "schema": { - "$ref": "#/definitions/RoleAssignment" + "$ref": "#/definitions/ValidationResponse" } }, "500": { @@ -359,8 +359,11 @@ } }, "x-ms-examples": { - "Validate a role assignment create or update operation": { - "$ref": "./examples/RoleAssignments_Validate.json" + "Validate a role assignment create or update operation with failed validation": { + "$ref": "./examples/RoleAssignments_ValidateInvalid.json" + }, + "Validate a role assignment create or update operation with successful validation": { + "$ref": "./examples/RoleAssignments_ValidateValid.json" } } } @@ -553,7 +556,7 @@ "200": { "description": "Returns the role assignment.", "schema": { - "$ref": "#/definitions/RoleAssignment" + "$ref": "#/definitions/ValidationResponse" } }, "500": { @@ -571,8 +574,11 @@ } }, "x-ms-examples": { - "Validate a role assignment create or update operation by ID": { - "$ref": "./examples/RoleAssignments_ValidateById.json" + "Validate a role assignment create or update operation by ID with failed validation": { + "$ref": "./examples/RoleAssignments_ValidateByIdInvalid.json" + }, + "Validate a role assignment create or update operation by ID with successful validation": { + "$ref": "./examples/RoleAssignments_ValidateByIdValid.json" } } } @@ -588,6 +594,32 @@ }, "description": "Descriptive error response." }, + "ValidationResponseErrorInfo": { + "description": "Failed validation result details", + "properties": { + "code": { + "type": "string", + "description": "Error code indicating why validation failed" + }, + "message": { + "type": "string", + "description": "Message indicating why validation failed" + } + } + }, + "ValidationResponse": { + "description": "Validation response", + "properties": { + "isValid": { + "type": "boolean", + "description": "Whether or not validation succeeded" + }, + "validationErrorInfo": { + "description": "Failed validation result details", + "$ref": "#/definitions/ValidationResponseErrorInfo" + } + } + }, "RoleAssignmentFilter": { "properties": { "principalId": { diff --git a/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_ValidateById.json b/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_ValidateByIdInvalid.json similarity index 52% rename from specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_ValidateById.json rename to specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_ValidateByIdInvalid.json index 6f0eb9b46e8f..cd0596c2b1fc 100644 --- a/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_ValidateById.json +++ b/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_ValidateByIdInvalid.json @@ -13,15 +13,11 @@ "responses": { "200": { "body": { - "properties": { - "roleDefinitionId": "/providers/Microsoft.Authorization/roleDefinitions/0b5fe924-9a61-425c-96af-cfe6e287ca2d", - "principalId": "ce2ce14e-85d7-4629-bdbc-454d0519d987", - "principalType": "User", - "scope": "/subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2" - }, - "id": "/subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/providers/Microsoft.Authorization/roleAssignments/b0f43c54-e787-4862-89b1-a653fa9cf747", - "type": "Microsoft.Authorization/roleAssignments", - "name": "b0f43c54-e787-4862-89b1-a653fa9cf747" + "isValid": false, + "validationErrorInfo": { + "code": "InvalidRoleDefinitionId", + "message": "The specified role definition with ID '0b5fe924-9a61-425c-96af-cfe6e287ca2d' does not exist." + } } }, "500": { diff --git a/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_ValidateByIdValid.json b/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_ValidateByIdValid.json new file mode 100644 index 000000000000..3c873017560a --- /dev/null +++ b/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_ValidateByIdValid.json @@ -0,0 +1,25 @@ +{ + "parameters": { + "roleAssignmentId": "subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/providers/Microsoft.Authorization/roleAssignments/b0f43c54-e787-4862-89b1-a653fa9cf747", + "api-version": "2020-08-01-preview", + "parameters": { + "properties": { + "roleDefinitionId": "/providers/Microsoft.Authorization/roleDefinitions/0b5fe924-9a61-425c-96af-cfe6e287ca2d", + "principalId": "ce2ce14e-85d7-4629-bdbc-454d0519d987", + "principalType": "User" + } + } + }, + "responses": { + "200": { + "body": { + "isValid": true + } + }, + "500": { + "body": { + "message": "Something went wrong." + } + } + } +} diff --git a/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_Validate.json b/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_ValidateInvalid.json similarity index 52% rename from specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_Validate.json rename to specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_ValidateInvalid.json index bdefe4a2ead2..e068332f2dcf 100644 --- a/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_Validate.json +++ b/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_ValidateInvalid.json @@ -14,15 +14,11 @@ "responses": { "200": { "body": { - "properties": { - "roleDefinitionId": "/providers/Microsoft.Authorization/roleDefinitions/0b5fe924-9a61-425c-96af-cfe6e287ca2d", - "principalId": "ce2ce14e-85d7-4629-bdbc-454d0519d987", - "principalType": "User", - "scope": "/subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2" - }, - "id": "/subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/providers/Microsoft.Authorization/roleAssignments/05c5a614-a7d6-4502-b150-c2fb455033ff", - "type": "Microsoft.Authorization/roleAssignments", - "name": "05c5a614-a7d6-4502-b150-c2fb455033ff" + "isValid": false, + "validationErrorInfo": { + "code": "InvalidRoleDefinitionId", + "message": "The specified role definition with ID '0b5fe924-9a61-425c-96af-cfe6e287ca2d' does not exist." + } } }, "500": { diff --git a/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_ValidateValid.json b/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_ValidateValid.json new file mode 100644 index 000000000000..f2e66e0b9774 --- /dev/null +++ b/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/examples/RoleAssignments_ValidateValid.json @@ -0,0 +1,26 @@ +{ + "parameters": { + "scope": "subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2", + "roleAssignmentName": "05c5a614-a7d6-4502-b150-c2fb455033ff", + "api-version": "2020-08-01-preview", + "parameters": { + "properties": { + "roleDefinitionId": "/subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/providers/Microsoft.Authorization/roleDefinitions/0b5fe924-9a61-425c-96af-cfe6e287ca2d", + "principalId": "ce2ce14e-85d7-4629-bdbc-454d0519d987", + "principalType": "User" + } + } + }, + "responses": { + "200": { + "body": { + "isValid": true + } + }, + "500": { + "body": { + "message": "Something went wrong." + } + } + } +} diff --git a/specification/authorization/resource-manager/readme.md b/specification/authorization/resource-manager/readme.md index a8f6e8e7cdae..b5e8a9f527e6 100644 --- a/specification/authorization/resource-manager/readme.md +++ b/specification/authorization/resource-manager/readme.md @@ -69,6 +69,10 @@ directive: where: $.definitions.DenyAssignmentProperties.properties.isSystemProtected from: authorization-DenyAssignmentGetCalls.json reason: for this case the result of the proposed change would resemble a boolean anyways + - suppress: EnumInsteadOfBoolean + where: $.definitions.ValidationResponse.properties.isValid + from: authorization-RoleAssignmentsCalls.json + reason: for this case the result of the proposed change would resemble a boolean anyways - suppress: R4024 reason: Preview versions still in use - suppress: RequiredSystemDataInNewApiVersions From bee6b006c3d434c1e8b9912911a2800a7d461409 Mon Sep 17 00:00:00 2001 From: Jeff Hackshaw Date: Fri, 12 Mar 2021 08:52:18 -0800 Subject: [PATCH 8/8] mark readonly properties as such --- .../2020-08-01-preview/authorization-RoleAssignmentsCalls.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/authorization-RoleAssignmentsCalls.json b/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/authorization-RoleAssignmentsCalls.json index ca804c060e91..7d9930ea99db 100644 --- a/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/authorization-RoleAssignmentsCalls.json +++ b/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-08-01-preview/authorization-RoleAssignmentsCalls.json @@ -598,10 +598,12 @@ "description": "Failed validation result details", "properties": { "code": { + "readOnly": true, "type": "string", "description": "Error code indicating why validation failed" }, "message": { + "readOnly": true, "type": "string", "description": "Message indicating why validation failed" } @@ -611,6 +613,7 @@ "description": "Validation response", "properties": { "isValid": { + "readOnly": true, "type": "boolean", "description": "Whether or not validation succeeded" },