mongo_user_definitions
Creates, updates, deletes, gets or lists a mongo_user_definitions
resource.
Overview
Name | mongo_user_definitions |
Type | Resource |
Id | azure.cosmos_db.mongo_user_definitions |
Fields
- vw_mongo_user_definitions
- mongo_user_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 |
custom_data | text | field from the properties object |
database_name | text | field from the properties object |
mechanisms | text | field from the properties object |
mongoUserDefinitionId | text | field from the properties object |
password | text | field from the properties object |
resourceGroupName | 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. |
user_name | text | field from the properties object |
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 User Definition resource object. |
type | string | The type of Azure resource. |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | accountName, mongoUserDefinitionId, resourceGroupName, subscriptionId | Retrieves the properties of an existing Azure Cosmos DB Mongo User Definition with the given Id. |
list | SELECT | accountName, resourceGroupName, subscriptionId | Retrieves the list of all Azure Cosmos DB Mongo User Definition. |
create_update | INSERT | accountName, mongoUserDefinitionId, resourceGroupName, subscriptionId | Creates or updates an Azure Cosmos DB Mongo User Definition. |
delete | DELETE | accountName, mongoUserDefinitionId, resourceGroupName, subscriptionId | Deletes an existing Azure Cosmos DB Mongo User Definition. |
SELECT
examples
Retrieves the list of all Azure Cosmos DB Mongo User Definition.
- vw_mongo_user_definitions
- mongo_user_definitions
SELECT
id,
name,
accountName,
custom_data,
database_name,
mechanisms,
mongoUserDefinitionId,
password,
resourceGroupName,
roles,
subscriptionId,
type,
user_name
FROM azure.cosmos_db.vw_mongo_user_definitions
WHERE accountName = '{{ accountName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}';
SELECT
id,
name,
properties,
type
FROM azure.cosmos_db.mongo_user_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_user_definitions
resource.
- All Properties
- Manifest
/*+ create */
INSERT INTO azure.cosmos_db.mongo_user_definitions (
accountName,
mongoUserDefinitionId,
resourceGroupName,
subscriptionId,
properties
)
SELECT
'{{ accountName }}',
'{{ mongoUserDefinitionId }}',
'{{ resourceGroupName }}',
'{{ subscriptionId }}',
'{{ properties }}'
;
- name: your_resource_model_name
props:
- name: properties
value:
- name: userName
value: string
- name: password
value: string
- name: databaseName
value: string
- name: customData
value: string
- name: roles
value:
- - name: db
value: string
- name: role
value: string
- name: mechanisms
value: string
DELETE
example
Deletes the specified mongo_user_definitions
resource.
/*+ delete */
DELETE FROM azure.cosmos_db.mongo_user_definitions
WHERE accountName = '{{ accountName }}'
AND mongoUserDefinitionId = '{{ mongoUserDefinitionId }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}';