Skip to main content

mongo_role_definitions

Creates, updates, deletes, gets or lists a mongo_role_definitions resource.

Overview

Namemongo_role_definitions
TypeResource
Idazure.cosmos_db.mongo_role_definitions

Fields

NameDatatypeDescription
idtextThe unique resource identifier of the database account.
nametextThe name of the database account.
accountNametextfield from the properties object
database_nametextfield from the properties object
mongoRoleDefinitionIdtextfield from the properties object
privilegestextfield from the properties object
resourceGroupNametextfield from the properties object
role_nametextfield from the properties object
rolestextfield from the properties object
subscriptionIdtextfield from the properties object
typetextThe type of Azure resource.

Methods

NameAccessible byRequired ParamsDescription
getSELECTaccountName, mongoRoleDefinitionId, resourceGroupName, subscriptionIdRetrieves the properties of an existing Azure Cosmos DB Mongo Role Definition with the given Id.
listSELECTaccountName, resourceGroupName, subscriptionIdRetrieves the list of all Azure Cosmos DB Mongo Role Definitions.
create_updateINSERTaccountName, mongoRoleDefinitionId, resourceGroupName, subscriptionIdCreates or updates an Azure Cosmos DB Mongo Role Definition.
deleteDELETEaccountName, mongoRoleDefinitionId, resourceGroupName, subscriptionIdDeletes an existing Azure Cosmos DB Mongo Role Definition.

SELECT examples

Retrieves the list of all Azure Cosmos DB 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 }}';

INSERT example

Use the following StackQL query and manifest file to create a new mongo_role_definitions resource.

/*+ create */
INSERT INTO azure.cosmos_db.mongo_role_definitions (
accountName,
mongoRoleDefinitionId,
resourceGroupName,
subscriptionId,
properties
)
SELECT
'{{ accountName }}',
'{{ mongoRoleDefinitionId }}',
'{{ resourceGroupName }}',
'{{ subscriptionId }}',
'{{ properties }}'
;

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 }}';