Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Authorization - Add roleassignmentmetrics calls and fix correctness issues #13119

Merged
merged 4 commits into from
Mar 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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": {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"parameters": {
"subscriptionId": "a925f2f7-5c63-4b7b-8799-25a5f97bc3b2",
"api-version": "2019-08-01-preview"
},
"responses": {
"200": {
"body": {
"subscriptionId": "a925f2f7-5c63-4b7b-8799-25a5f97bc3b2",
"roleAssignmentsLimit": 2000,
"roleAssignmentsCurrentCount": 1530,
"roleAssignmentsRemainingCount": 470
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,13 @@
"$ref": "#/definitions/RoleAssignment"
}
},
"500": {
"x-ms-error-response": true,
"description": "Error.",
"schema": {
"$ref": "#/definitions/CustomErrorResponse"
}
},
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
Expand Down Expand Up @@ -417,6 +424,13 @@
"$ref": "#/definitions/RoleAssignment"
}
},
"500": {
"x-ms-error-response": true,
"description": "Error.",
"schema": {
"$ref": "#/definitions/CustomErrorResponse"
}
},
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
Expand Down Expand Up @@ -470,6 +484,15 @@
}
},
"definitions": {
"CustomErrorResponse": {
"properties": {
"message": {
"type": "string",
"description": "Description of the error."
}
},
"description": "Descriptive error response."
},
"RoleAssignmentFilter": {
"properties": {
"principalId": {
Expand Down Expand Up @@ -529,6 +552,7 @@
"DirectoryObjectOrGroup",
"Everyone"
],
"default": "User",
"x-ms-enum": {
"name": "PrincipalType",
"modelAsString": true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@
"type": "Microsoft.Authorization/roleAssignments",
"name": "b0f43c54-e787-4862-89b1-a653fa9cf747"
}
},
"500": {
"body": {
"message": "Something went wrong."
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@
"type": "Microsoft.Authorization/roleAssignments",
"name": "05c5a614-a7d6-4502-b150-c2fb455033ff"
}
},
"500": {
"body": {
"message": "Something went wrong."
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@
"type": "Microsoft.Authorization/roleAssignments",
"name": "05c5a614-a7d6-4502-b150-c2fb455033ff"
}
},
"500": {
"body": {
"message": "Something went wrong."
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@
"type": "Microsoft.Authorization/roleAssignments",
"name": "05c5a614-a7d6-4502-b150-c2fb455033ff"
}
},
"500": {
"body": {
"message": "Something went wrong."
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,13 @@
"$ref": "#/definitions/RoleAssignment"
}
},
"500": {
"x-ms-error-response": true,
"description": "Error.",
"schema": {
"$ref": "#/definitions/CustomErrorResponse"
}
},
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
Expand Down Expand Up @@ -390,6 +397,13 @@
"$ref": "#/definitions/RoleAssignment"
}
},
"500": {
"x-ms-error-response": true,
"description": "Error.",
"schema": {
"$ref": "#/definitions/CustomErrorResponse"
}
},
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
Expand Down Expand Up @@ -544,6 +558,15 @@
}
},
"definitions": {
"CustomErrorResponse": {
"properties": {
"message": {
"type": "string",
"description": "Description of the error."
}
},
"description": "Descriptive error response."
},
"RoleAssignmentFilter": {
"properties": {
"principalId": {
Expand Down Expand Up @@ -698,6 +721,7 @@
"DirectoryObjectOrGroup",
"Everyone"
],
"default": "User",
"x-ms-enum": {
"name": "PrincipalType",
"modelAsString": true
Expand All @@ -718,6 +742,10 @@
"conditionVersion": {
"type": "string",
"description": "Version of the condition. Currently accepted value is '2.0'"
},
"delegatedManagedIdentityResourceId": {
"type": "string",
"description": "Id of the delegated managed identity resource"
}
},
"required": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@
"type": "Microsoft.Authorization/roleAssignments",
"name": "roleassignmentId"
}
},
"500": {
"body": {
"message": "Something went wrong."
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@
"type": "Microsoft.Authorization/roleAssignments",
"name": "roleassignmentId"
}
},
"500": {
"body": {
"message": "Something went wrong."
}
}
}
}
2 changes: 2 additions & 0 deletions specification/authorization/resource-manager/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ input-file:
- Microsoft.Authorization/preview/2018-01-01-preview/authorization-RoleDefinitionsCalls.json
- Microsoft.Authorization/preview/2018-07-01-preview/authorization-DenyAssignmentGetCalls.json
- Microsoft.Authorization/preview/2020-04-01-preview/authorization-RoleAssignmentsCalls.json
- Microsoft.Authorization/preview/2019-08-01-preview/authorization-UsageMetricsCalls.json
```

### Tag: package-2020-04-01-preview-only
Expand All @@ -125,6 +126,7 @@ input-file:
- Microsoft.Authorization/preview/2020-03-01-preview/authorization-DenyAssignmentGetCalls.json
- Microsoft.Authorization/preview/2020-03-01-preview/authorization-RoleAssignmentsCalls.json
- Microsoft.Authorization/preview/2020-03-01-preview/authorization-PermissionsCalls.json
- Microsoft.Authorization/preview/2019-08-01-preview/authorization-UsageMetricsCalls.json
```

### Tag: package-2018-09-01-preview
Expand Down