-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cosmos DB - Adding APIs for Role Definition and Role Assignment (#10493)
* WOrk on Role Definition * Finish json initial * added examples * added missing comma * changes based on linter * try removing filter from paht? * spelled description wrong :( * more fixes * more changes for exmaple issesu * hopefully fix * minor changes and delete old files * changes based on warnings * chnage to invalidroledefinition * change delete to 202 * change put to 202 * change default error response * fix response code example * fix errors * RoleDefinitionType enum * changes based on comments * trying different errorresponse * more changes based on comments + add DefaultErrorResponse * minor typo fixes * some minor changes * remove notdataactions and change databaseAccountName to accountName * new changes based on comments * changes to comments and DefaultErrorResponse * change to errorResponse * change to delete responses * changes to descriptions * change description * add back notDataActions * add 'Sql' to operationIds
- Loading branch information
1 parent
4583ff4
commit 2a4dc28
Showing
11 changed files
with
857 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
...DocumentDB/preview/2020-06-01-preview/examples/CosmosDBSqlRoleAssignmentCreateUpdate.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"parameters": { | ||
"roleAssignmentId": "myRoleAssignmentId", | ||
"subscriptionId": "mySubscriptionId", | ||
"resourceGroupName": "myResourceGroupName", | ||
"accountName": "myAccountName", | ||
"api-version": "2020-06-01-preview", | ||
"createUpdateSqlRoleAssignmentParameters": { | ||
"properties": { | ||
"roleDefinitionId": "/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/sqlRoleDefinitions/myRoleDefinitionId", | ||
"scope": "/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/purchases/colls/redmond-purchases", | ||
"principalId": "myPrincipalId" | ||
} | ||
} | ||
}, | ||
"responses": { | ||
"200": { | ||
"body": { | ||
"id": "/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/sqlRoleAssignments/myRoleAssignmentId", | ||
"name": "myRoleAssignmentId", | ||
"type": "Microsoft.DocumentDB/databaseAccounts/sqlRoleAssignments", | ||
"properties": { | ||
"roleDefinitionId": "/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/sqlRoleDefinitions/myRoleDefinitionId", | ||
"scope": "/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/purchases/colls/redmond-purchases", | ||
"principalId": "myPrincipalId" | ||
} | ||
} | ||
}, | ||
"202": {} | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
...osoft.DocumentDB/preview/2020-06-01-preview/examples/CosmosDBSqlRoleAssignmentDelete.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"parameters": { | ||
"roleAssignmentId": "myRoleAssignmentId", | ||
"subscriptionId": "mySubscriptionId", | ||
"resourceGroupName": "myResourceGroupName", | ||
"accountName": "myAccountName", | ||
"api-version": "2020-06-01-preview" | ||
}, | ||
"responses": { | ||
"200": {}, | ||
"202": {}, | ||
"204": {} | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
...icrosoft.DocumentDB/preview/2020-06-01-preview/examples/CosmosDBSqlRoleAssignmentGet.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"parameters": { | ||
"roleAssignmentId": "myRoleAssignmentId", | ||
"subscriptionId": "mySubscriptionId", | ||
"resourceGroupName": "myResourceGroupName", | ||
"accountName": "myAccountName", | ||
"api-version": "2020-06-01-preview" | ||
}, | ||
"responses": { | ||
"200": { | ||
"body": { | ||
"id": "/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/sqlRoleAssignments/myRoleAssignmentId", | ||
"name": "myRoleAssignmentId", | ||
"type": "Microsoft.DocumentDB/databaseAccounts/sqlRoleAssignments", | ||
"properties": { | ||
"roleDefinitionId": "/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/sqlRoleDefinitions/myRoleDefinitionId", | ||
"scope": "/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/purchases/colls/redmond-purchases", | ||
"principalId": "myPrincipalId" | ||
} | ||
} | ||
} | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
...crosoft.DocumentDB/preview/2020-06-01-preview/examples/CosmosDBSqlRoleAssignmentList.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"parameters": { | ||
"subscriptionId": "mySubscriptionId", | ||
"resourceGroupName": "myResourceGroupName", | ||
"accountName": "myAccountName", | ||
"api-version": "2020-06-01-preview" | ||
}, | ||
"responses": { | ||
"200": { | ||
"body": { | ||
"value": [ | ||
{ | ||
"id": "/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/sqlRoleAssignments/myRoleAssignmentId", | ||
"name": "myRoleAssignmentId", | ||
"type": "Microsoft.DocumentDB/databaseAccounts/sqlRoleAssignments", | ||
"properties": { | ||
"roleDefinitionId": "/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/sqlRoleDefinitions/myRoleDefinitionId", | ||
"scope": "/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/purchases/colls/redmond-purchases", | ||
"principalId": "myPrincipalId" | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} |
54 changes: 54 additions & 0 deletions
54
...DocumentDB/preview/2020-06-01-preview/examples/CosmosDBSqlRoleDefinitionCreateUpdate.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
{ | ||
"parameters": { | ||
"roleDefinitionId": "myRoleDefinitionId", | ||
"subscriptionId": "mySubscriptionId", | ||
"resourceGroupName": "myResourceGroupName", | ||
"accountName": "myAccountName", | ||
"api-version": "2020-06-01-preview", | ||
"createUpdateSqlRoleDefinitionParameters": { | ||
"properties": { | ||
"roleName": "myRoleName", | ||
"type": "CustomRole", | ||
"assignableScopes": [ | ||
"/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/sales", | ||
"/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/purchases" | ||
], | ||
"permissions": [ | ||
{ | ||
"dataActions": [ | ||
"Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/create", | ||
"Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/read" | ||
], | ||
"notDataActions": [] | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"responses": { | ||
"200": { | ||
"body": { | ||
"id": "/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/sqlRoleDefinitions/myRoleDefinitionId", | ||
"name": "myRoleDefinitionId", | ||
"type": "Microsoft.DocumentDB/databaseAccounts/sqlRoleDefinitions", | ||
"properties": { | ||
"roleName": "myRoleName", | ||
"type": "CustomRole", | ||
"assignableScopes": [ | ||
"/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/sales", | ||
"/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/purchases" | ||
], | ||
"permissions": [ | ||
{ | ||
"dataActions": [ | ||
"Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/create", | ||
"Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/read" | ||
] | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"202": {} | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
...osoft.DocumentDB/preview/2020-06-01-preview/examples/CosmosDBSqlRoleDefinitionDelete.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"parameters": { | ||
"roleDefinitionId": "myRoleDefinitionId", | ||
"subscriptionId": "mySubscriptionId", | ||
"resourceGroupName": "myResourceGroupName", | ||
"accountName": "myAccountName", | ||
"api-version": "2020-06-01-preview" | ||
}, | ||
"responses": { | ||
"200": {}, | ||
"202": {}, | ||
"204": {} | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
...icrosoft.DocumentDB/preview/2020-06-01-preview/examples/CosmosDBSqlRoleDefinitionGet.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"parameters": { | ||
"roleDefinitionId": "myRoleDefinitionId", | ||
"subscriptionId": "mySubscriptionId", | ||
"resourceGroupName": "myResourceGroupName", | ||
"accountName": "myAccountName", | ||
"api-version": "2020-06-01-preview" | ||
}, | ||
"responses": { | ||
"200": { | ||
"body": { | ||
"id": "/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/sqlRoleDefinitions/myRoleDefinitionId", | ||
"name": "myRoleDefinitionId", | ||
"type": "Microsoft.DocumentDB/databaseAccounts/sqlRoleDefinitions", | ||
"properties": { | ||
"roleName": "myRoleName", | ||
"type": "CustomRole", | ||
"assignableScopes": [ | ||
"/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/sales", | ||
"/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/purchases" | ||
], | ||
"permissions": [ | ||
{ | ||
"dataActions": [ | ||
"Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/create", | ||
"Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/read" | ||
], | ||
"notDataActions": [] | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
...crosoft.DocumentDB/preview/2020-06-01-preview/examples/CosmosDBSqlRoleDefinitionList.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{ | ||
"parameters": { | ||
"subscriptionId": "mySubscriptionId", | ||
"resourceGroupName": "myResourceGroupName", | ||
"accountName": "myAccountName", | ||
"api-version": "2020-06-01-preview" | ||
}, | ||
"responses": { | ||
"200": { | ||
"body": { | ||
"value": [ | ||
{ | ||
"id": "/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/sqlRoleDefinitions/myRoleDefinitionId", | ||
"name": "myRoleDefinitionId", | ||
"type": "Microsoft.DocumentDB/databaseAccounts/sqlRoleDefinitions", | ||
"properties": { | ||
"roleName": "myRoleName", | ||
"type": "CustomRole", | ||
"assignableScopes": [ | ||
"/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/sales", | ||
"/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/purchases" | ||
], | ||
"permissions": [ | ||
{ | ||
"dataActions": [ | ||
"Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/create", | ||
"Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/read" | ||
], | ||
"notDataActions": [] | ||
} | ||
] | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.