Skip to content

Commit a0fc24c

Browse files
jdhmsMirzaSikander
authored andcommitted
Authorization - Add roleassignmentmetrics calls and fix correctness issues (Azure#13119)
* add roleassignmentmetrics calls and fix correctness issues * update parameter * update version * fix new ci requirement
1 parent 3802bac commit a0fc24c

File tree

11 files changed

+205
-0
lines changed

11 files changed

+205
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
{
2+
"swagger": "2.0",
3+
"info": {
4+
"title": "AuthorizationManagementClient",
5+
"version": "2019-08-01-preview",
6+
"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."
7+
},
8+
"host": "management.azure.com",
9+
"schemes": [
10+
"https"
11+
],
12+
"consumes": [
13+
"application/json"
14+
],
15+
"produces": [
16+
"application/json"
17+
],
18+
"security": [
19+
{
20+
"azure_auth": [
21+
"user_impersonation"
22+
]
23+
}
24+
],
25+
"securityDefinitions": {
26+
"azure_auth": {
27+
"type": "oauth2",
28+
"authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize",
29+
"flow": "implicit",
30+
"description": "Azure Active Directory OAuth2 Flow",
31+
"scopes": {
32+
"user_impersonation": "impersonate your user account"
33+
}
34+
}
35+
},
36+
"paths": {
37+
"/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/roleAssignmentsUsageMetrics": {
38+
"get": {
39+
"tags": [
40+
"RoleAssignmentMetrics"
41+
],
42+
"operationId": "RoleAssignmentMetrics_GetMetricsForSubscription",
43+
"description": "Get role assignment usage metrics for a subscription",
44+
"parameters": [
45+
{
46+
"$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/SubscriptionIdParameter"
47+
},
48+
{
49+
"$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter"
50+
}
51+
],
52+
"responses": {
53+
"200": {
54+
"description": "Returns current role assignment usage metrics.",
55+
"schema": {
56+
"$ref": "#/definitions/RoleAssignmentMetricsResult"
57+
}
58+
},
59+
"default": {
60+
"description": "Error response describing why the operation failed.",
61+
"schema": {
62+
"$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse"
63+
}
64+
}
65+
},
66+
"x-ms-examples": {
67+
"Get role assignment metrics for subscription": {
68+
"$ref": "./examples/RoleAssignmentMetrics_GetForSubscription.json"
69+
}
70+
}
71+
}
72+
}
73+
},
74+
"definitions": {
75+
"RoleAssignmentMetricsResult": {
76+
"properties": {
77+
"subscriptionId": {
78+
"type": "string",
79+
"readOnly": true,
80+
"description": "The subscription ID."
81+
},
82+
"roleAssignmentsLimit": {
83+
"type": "integer",
84+
"format": "int64",
85+
"readOnly": true,
86+
"description": "The role assignment limit."
87+
},
88+
"roleAssignmentsCurrentCount": {
89+
"type": "integer",
90+
"format": "int64",
91+
"readOnly": true,
92+
"description": "The number of current role assignments."
93+
},
94+
"roleAssignmentsRemainingCount": {
95+
"type": "integer",
96+
"format": "int64",
97+
"readOnly": true,
98+
"description": "The number of remaining role assignments available."
99+
}
100+
},
101+
"description": "Role Assignment Metrics"
102+
}
103+
},
104+
"parameters": {}
105+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"parameters": {
3+
"subscriptionId": "a925f2f7-5c63-4b7b-8799-25a5f97bc3b2",
4+
"api-version": "2019-08-01-preview"
5+
},
6+
"responses": {
7+
"200": {
8+
"body": {
9+
"subscriptionId": "a925f2f7-5c63-4b7b-8799-25a5f97bc3b2",
10+
"roleAssignmentsLimit": 2000,
11+
"roleAssignmentsCurrentCount": 1530,
12+
"roleAssignmentsRemainingCount": 470
13+
}
14+
}
15+
}
16+
}

specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-03-01-preview/authorization-RoleAssignmentsCalls.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,13 @@
249249
"$ref": "#/definitions/RoleAssignment"
250250
}
251251
},
252+
"500": {
253+
"x-ms-error-response": true,
254+
"description": "Error.",
255+
"schema": {
256+
"$ref": "#/definitions/CustomErrorResponse"
257+
}
258+
},
252259
"default": {
253260
"description": "Error response describing why the operation failed.",
254261
"schema": {
@@ -417,6 +424,13 @@
417424
"$ref": "#/definitions/RoleAssignment"
418425
}
419426
},
427+
"500": {
428+
"x-ms-error-response": true,
429+
"description": "Error.",
430+
"schema": {
431+
"$ref": "#/definitions/CustomErrorResponse"
432+
}
433+
},
420434
"default": {
421435
"description": "Error response describing why the operation failed.",
422436
"schema": {
@@ -470,6 +484,15 @@
470484
}
471485
},
472486
"definitions": {
487+
"CustomErrorResponse": {
488+
"properties": {
489+
"message": {
490+
"type": "string",
491+
"description": "Description of the error."
492+
}
493+
},
494+
"description": "Descriptive error response."
495+
},
473496
"RoleAssignmentFilter": {
474497
"properties": {
475498
"principalId": {
@@ -529,6 +552,7 @@
529552
"DirectoryObjectOrGroup",
530553
"Everyone"
531554
],
555+
"default": "User",
532556
"x-ms-enum": {
533557
"name": "PrincipalType",
534558
"modelAsString": true

specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-03-01-preview/examples/RoleAssignments_CreateById.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@
3939
"type": "Microsoft.Authorization/roleAssignments",
4040
"name": "b0f43c54-e787-4862-89b1-a653fa9cf747"
4141
}
42+
},
43+
"500": {
44+
"body": {
45+
"message": "Something went wrong."
46+
}
4247
}
4348
}
4449
}

specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-03-01-preview/examples/RoleAssignments_CreateForResource.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@
4040
"type": "Microsoft.Authorization/roleAssignments",
4141
"name": "05c5a614-a7d6-4502-b150-c2fb455033ff"
4242
}
43+
},
44+
"500": {
45+
"body": {
46+
"message": "Something went wrong."
47+
}
4348
}
4449
}
4550
}

specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-03-01-preview/examples/RoleAssignments_CreateForResourceGroup.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@
4040
"type": "Microsoft.Authorization/roleAssignments",
4141
"name": "05c5a614-a7d6-4502-b150-c2fb455033ff"
4242
}
43+
},
44+
"500": {
45+
"body": {
46+
"message": "Something went wrong."
47+
}
4348
}
4449
}
4550
}

specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-03-01-preview/examples/RoleAssignments_CreateForSubscription.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@
4040
"type": "Microsoft.Authorization/roleAssignments",
4141
"name": "05c5a614-a7d6-4502-b150-c2fb455033ff"
4242
}
43+
},
44+
"500": {
45+
"body": {
46+
"message": "Something went wrong."
47+
}
4348
}
4449
}
4550
}

specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-04-01-preview/authorization-RoleAssignmentsCalls.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,13 @@
252252
"$ref": "#/definitions/RoleAssignment"
253253
}
254254
},
255+
"500": {
256+
"x-ms-error-response": true,
257+
"description": "Error.",
258+
"schema": {
259+
"$ref": "#/definitions/CustomErrorResponse"
260+
}
261+
},
255262
"default": {
256263
"description": "Error response describing why the operation failed.",
257264
"schema": {
@@ -390,6 +397,13 @@
390397
"$ref": "#/definitions/RoleAssignment"
391398
}
392399
},
400+
"500": {
401+
"x-ms-error-response": true,
402+
"description": "Error.",
403+
"schema": {
404+
"$ref": "#/definitions/CustomErrorResponse"
405+
}
406+
},
393407
"default": {
394408
"description": "Error response describing why the operation failed.",
395409
"schema": {
@@ -544,6 +558,15 @@
544558
}
545559
},
546560
"definitions": {
561+
"CustomErrorResponse": {
562+
"properties": {
563+
"message": {
564+
"type": "string",
565+
"description": "Description of the error."
566+
}
567+
},
568+
"description": "Descriptive error response."
569+
},
547570
"RoleAssignmentFilter": {
548571
"properties": {
549572
"principalId": {
@@ -698,6 +721,7 @@
698721
"DirectoryObjectOrGroup",
699722
"Everyone"
700723
],
724+
"default": "User",
701725
"x-ms-enum": {
702726
"name": "PrincipalType",
703727
"modelAsString": true
@@ -718,6 +742,10 @@
718742
"conditionVersion": {
719743
"type": "string",
720744
"description": "Version of the condition. Currently accepted value is '2.0'"
745+
},
746+
"delegatedManagedIdentityResourceId": {
747+
"type": "string",
748+
"description": "Id of the delegated managed identity resource"
721749
}
722750
},
723751
"required": [

specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-04-01-preview/examples/PutRoleAssignment.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@
3232
"type": "Microsoft.Authorization/roleAssignments",
3333
"name": "roleassignmentId"
3434
}
35+
},
36+
"500": {
37+
"body": {
38+
"message": "Something went wrong."
39+
}
3540
}
3641
}
3742
}

specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-04-01-preview/examples/PutRoleAssignmentById.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@
3232
"type": "Microsoft.Authorization/roleAssignments",
3333
"name": "roleassignmentId"
3434
}
35+
},
36+
"500": {
37+
"body": {
38+
"message": "Something went wrong."
39+
}
3540
}
3641
}
3742
}

0 commit comments

Comments
 (0)