You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[cosmosdb-preview] Add support for Table RBAC role definition and assignment CRUD actions (#8310)
* Updating cosmosdb_preview for 12.01 preview release cli
* Adding remaining changes from documentation to bump version
* working table api role definition tests
* Working table role assignment tests
* Cleaning up new resources and removing debugging helpers
* removing unused validator
* Adding help updates
* Fixing help
* Trying to fix param help
* Trying to fix param help
* Trying to fix param help
* Trying to fix param help
* Trying to fix param help
* Fixing version
* Removing azext.isPreview: true, as requested by github-actions bot
* Updating and rerecording tests with latest cli dev branch
* updating version to 1.2.0
* Changing version to be 1.2.0 as requested by github actions bot
* Chaning history.rst version from 1.3.0 to 1.2.0 as requested by reviewers
- name: Create a Table role definition under an Azure Cosmos DB account using a JSON file.
1121
+
text: az cosmosdb table role definition create --account-name MyAccount --resource-group MyResourceGroup --body @role-definition.json
1122
+
"""
1123
+
1124
+
helps['cosmosdb table role definition delete'] ="""
1125
+
type: command
1126
+
short-summary: Delete a Table role definition under an Azure Cosmos DB account.
1127
+
examples:
1128
+
- name: Delete a Table role definition under an Azure Cosmos DB account.
1129
+
text: az cosmosdb table role definition delete --account-name MyAccount --resource-group MyResourceGroup --role-definition-id be79875a-2cc4-40d5-8958-566017875b39
1130
+
"""
1131
+
1132
+
helps['cosmosdb table role definition exists'] ="""
1133
+
type: command
1134
+
short-summary: Check if an Azure Cosmos DB role definition exists.
1135
+
examples:
1136
+
- name: Check if an Azure Cosmos DB role definition exists.
1137
+
text: az cosmosdb table role definition exists --account-name MyAccount --resource-group MyResourceGroup --role-definition-id be79875a-2cc4-40d5-8958-566017875b39
1138
+
"""
1139
+
1140
+
helps['cosmosdb table role definition list'] ="""
1141
+
type: command
1142
+
short-summary: List all Table role definitions under an Azure Cosmos DB account.
1143
+
examples:
1144
+
- name: List all Table role definitions under an Azure Cosmos DB account.
1145
+
text: az cosmosdb table role definition list --account-name MyAccount --resource-group MyResourceGroup
1146
+
"""
1147
+
1148
+
helps['cosmosdb table role definition show'] ="""
1149
+
type: command
1150
+
short-summary: Show the properties of a Table role definition under an Azure Cosmos DB account.
1151
+
examples:
1152
+
- name: Show the properties of a Table role definition under an Azure Cosmos DB account.
1153
+
text: az cosmosdb table role definition show --account-name MyAccount --resource-group MyResourceGroup --role-definition-id be79875a-2cc4-40d5-8958-566017875b39
1154
+
"""
1155
+
1156
+
helps['cosmosdb table role definition update'] ="""
1157
+
type: command
1158
+
short-summary: Update a Table role definition under an Azure Cosmos DB account.
1159
+
examples:
1160
+
- name: Update a Table role definition under an Azure Cosmos DB account.
1161
+
text: az cosmosdb table role definition update --account-name MyAccount --resource-group MyResourceGroup --body @role-definition.json
1162
+
"""
1163
+
1164
+
helps['cosmosdb table role assignment'] ="""
1165
+
type: group
1166
+
short-summary: Manage Azure Cosmos DB Table role assignments.
1167
+
"""
1168
+
1169
+
helps['cosmosdb table role assignment create'] ="""
1170
+
type: command
1171
+
short-summary: Create a Table role assignment under an Azure Cosmos DB account.
1172
+
examples:
1173
+
- name: Create a Table role assignment under an Azure Cosmos DB account using Role Definition Name.
1174
+
text: |
1175
+
az cosmosdb table role assignment create --account-name MyAccount --resource-group MyResourceGroup \\
helps['cosmosdb table role assignment delete'] ="""
1190
+
type: command
1191
+
short-summary: Delete a Table role assignment under an Azure Cosmos DB account.
1192
+
examples:
1193
+
- name: Delete a Table role assignment under an Azure Cosmos DB account.
1194
+
text: az cosmosdb table role assignment delete --account-name MyAccount --resource-group MyResourceGroup --role-assignment-id cb8ed2d7-2371-4e3c-bd31-6cc1560e84f8
1195
+
"""
1196
+
1197
+
helps['cosmosdb table role assignment exists'] ="""
1198
+
type: command
1199
+
short-summary: Check if an Azure Cosmos DB role assignment exists.
1200
+
examples:
1201
+
- name: Check if an Azure Cosmos DB role assignment exists.
1202
+
text: az cosmosdb table role assignment exists --account-name MyAccount --resource-group MyResourceGroup --role-assignment-id cb8ed2d7-2371-4e3c-bd31-6cc1560e84f8
1203
+
"""
1204
+
1205
+
helps['cosmosdb table role assignment list'] ="""
1206
+
type: command
1207
+
short-summary: List all Table role assignments under an Azure Cosmos DB account.
1208
+
examples:
1209
+
- name: List all Table role assignments under an Azure Cosmos DB account.
1210
+
text: az cosmosdb table role assignment list --account-name MyAccount --resource-group MyResourceGroup
1211
+
"""
1212
+
1213
+
helps['cosmosdb table role assignment show'] ="""
1214
+
type: command
1215
+
short-summary: Show the properties of a Table role assignment under an Azure Cosmos DB account.
1216
+
examples:
1217
+
- name: Show the properties of a Table role assignment under an Azure Cosmos DB account.
1218
+
text: az cosmosdb table role assignment show --account-name MyAccount --resource-group MyResourceGroup --role-assignment-id cb8ed2d7-2371-4e3c-bd31-6cc1560e84f8
1219
+
"""
1220
+
1221
+
helps['cosmosdb table role assignment update'] ="""
1222
+
type: command
1223
+
short-summary: Update a Table role assignment under an Azure Cosmos DB account.
1224
+
examples:
1225
+
- name: Update a Table role assignment under an Azure Cosmos DB account using Role Definition Name.
1226
+
text: |
1227
+
az cosmosdb table role assignment update --account-name MyAccount --resource-group MyResourceGroup \\
c.argument('table_name', options_list=['--table-name', '-n'], required=True, help='Name of the CosmosDB Table name')
653
674
c.argument('restore_timestamp', options_list=['--restore-timestamp', '-t'], action=UtcDatetimeAction, help="The timestamp to which the Table needs to be restored to.", required=False)
654
675
c.argument('disable_ttl', options_list=['--disable-ttl'], arg_type=get_three_state_flag(), help="Enable or disable restoring with ttl disabled.", is_preview=True, required=False)
676
+
677
+
# table role definition
678
+
withself.argument_context('cosmosdb table role definition') asc:
c.argument('role_definition_id', options_list=['--role-definition-id', '-i'], validator=validate_table_role_definition_id, help="Unique ID for the Table Role Definition.")
681
+
c.argument('table_role_definition_body', options_list=['--body', '-b'], validator=validate_table_role_definition_body, completer=FilesCompleter(), help="Role Definition body with Id (Optional for create), Type (Default is CustomRole), RoleName, Description, AssignableScopes, Permissions. You can enter it as a string or as a file, e.g., --body @table-role_definition-body-file.json or "+TABLE_ROLE_DEFINITION_EXAMPLE)
682
+
683
+
withself.argument_context('cosmosdb table role assignment') asc:
c.argument('role_assignment_id', options_list=['--role-assignment-id', '-i'], validator=validate_table_role_assignment_id, help="Optional for Create. Unique ID for the Role Assignment. If not provided, a new GUID will be used.")
686
+
c.argument('role_definition_id', options_list=['--role-definition-id', '-d'], help="Unique ID of the Role Definition that this Role Assignment refers to.")
687
+
c.argument('role_definition_name', options_list=['--role-definition-name', '-n'], help="Unique Name of the Role Definition that this Role Assignment refers to. Eg. 'Contoso Reader Role'.")
688
+
c.argument('scope', options_list=['--scope', '-s'], help="Data plane resource path at which this Role Assignment is being granted.")
689
+
c.argument('principal_id', options_list=['--principal-id', '-p'], help="AAD Object ID of the principal to which this Role Assignment is being granted.")
0 commit comments