mongo_role_definitions
Creates, updates, deletes, gets or lists a mongo_role_definitions
resource.
Overview
Name | mongo_role_definitions |
Type | Resource |
Id | azure.cosmos_db.mongo_role_definitions |
Fields
- vw_mongo_role_definitions
- mongo_role_definitions
Name | Datatype | Description |
---|---|---|
id | text | The unique resource identifier of the database account. |
name | text | The name of the database account. |
accountName | text | field from the properties object |
database_name | text | field from the properties object |
mongoRoleDefinitionId | text | field from the properties object |
privileges | text | field from the properties object |
resourceGroupName | text | field from the properties object |
role_name | text | field from the properties object |
roles | text | field from the properties object |
subscriptionId | text | field from the properties object |
type | text | The type of Azure resource. |
Name | Datatype | Description |
---|---|---|
id | string | The unique resource identifier of the database account. |
name | string | The name of the database account. |
properties | object | Azure Cosmos DB Mongo Role Definition resource object. |
type | string | The type of Azure resource. |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | accountName, mongoRoleDefinitionId, resourceGroupName, subscriptionId | Retrieves the properties of an existing Azure Cosmos DB Mongo Role Definition with the given Id. |
list | SELECT | accountName, resourceGroupName, subscriptionId | Retrieves the list of all Azure Cosmos DB Mongo Role Definitions. |
create_update | INSERT | accountName, mongoRoleDefinitionId, resourceGroupName, subscriptionId | Creates or updates an Azure Cosmos DB Mongo Role Definition. |
delete | DELETE | accountName, mongoRoleDefinitionId, resourceGroupName, subscriptionId | Deletes an existing Azure Cosmos DB Mongo Role Definition. |
SELECT
examples
Retrieves the list of all Azure Cosmos DB Mongo Role Definitions.
- vw_mongo_role_definitions
- mongo_role_definitions
SELECT
id,
name,
accountName,
database_name,
mongoRoleDefinitionId,
privileges,
resourceGroupName,
role_name,
roles,
subscriptionId,
type
FROM azure.cosmos_db.vw_mongo_role_definitions
WHERE accountName = '{{ accountName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}';
SELECT
id,
name,
properties,
type
FROM azure.cosmos_db.mongo_role_definitions
WHERE accountName = '{{ accountName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}';
INSERT
example
Use the following StackQL query and manifest file to create a new mongo_role_definitions
resource.
- All Properties
- Manifest
/*+ create */
INSERT INTO azure.cosmos_db.mongo_role_definitions (
accountName,
mongoRoleDefinitionId,
resourceGroupName,
subscriptionId,
properties
)
SELECT
'{{ accountName }}',
'{{ mongoRoleDefinitionId }}',
'{{ resourceGroupName }}',
'{{ subscriptionId }}',
'{{ properties }}'
;
- name: your_resource_model_name
props:
- name: properties
value:
- name: roleName
value: string
- name: type
value: string
- name: databaseName
value: string
- name: privileges
value:
- - name: resource
value:
- name: db
value: string
- name: collection
value: string
- name: actions
value:
- string
- name: roles
value:
- - name: db
value: string
- name: role
value: string
DELETE
example
Deletes the specified mongo_role_definitions
resource.
/*+ delete */
DELETE FROM azure.cosmos_db.mongo_role_definitions
WHERE accountName = '{{ accountName }}'
AND mongoRoleDefinitionId = '{{ mongoRoleDefinitionId }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}';