Skip to main content

mongo_clusters

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

Overview

Namemongo_clusters
TypeResource
Idazure_isv.mongo_db.mongo_clusters

Fields

The following fields are returned by SELECT queries:

Azure operation completed successfully.

NameDatatypeDescription
locationstringThe geo-location where the resource lives
propertiesobjectThe resource-specific properties for this resource.
tagsobjectResource tags.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectsubscriptionId, resourceGroupName, mongoClusterNameGets information about a mongo cluster.
list_by_resource_groupselectsubscriptionId, resourceGroupNameList all the mongo clusters in a given resource group.
listselectsubscriptionIdList all the mongo clusters in a given subscription.
create_or_updateinsertsubscriptionId, resourceGroupName, mongoClusterNameCreate or update a mongo cluster. Update overwrites all properties for the resource. To only modify some of the properties, use PATCH.
updateupdatesubscriptionId, resourceGroupName, mongoClusterNameUpdates an existing mongo cluster. The request body can contain one to many of the properties present in the normal mongo cluster definition.
deletedeletesubscriptionId, resourceGroupName, mongoClusterNameDeletes a mongo cluster.
check_name_availabilityexecsubscriptionId, locationCheck if mongo cluster name is available for use.
promoteexecsubscriptionId, resourceGroupName, mongoClusterName, promoteOptionPromotes a replica mongo cluster to a primary role.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
locationstringThe name of the Azure region.
mongoClusterNamestringThe name of the mongo cluster.
resourceGroupNamestringThe name of the resource group. The name is case insensitive.
subscriptionIdstring (uuid)The ID of the target subscription. The value must be an UUID.

SELECT examples

Gets information about a mongo cluster.

SELECT
location,
properties,
tags
FROM azure_isv.mongo_db.mongo_clusters
WHERE subscriptionId = '{{ subscriptionId }}' -- required
AND resourceGroupName = '{{ resourceGroupName }}' -- required
AND mongoClusterName = '{{ mongoClusterName }}' -- required
;

INSERT examples

Create or update a mongo cluster. Update overwrites all properties for the resource. To only modify some of the properties, use PATCH.

INSERT INTO azure_isv.mongo_db.mongo_clusters (
data__properties,
data__tags,
data__location,
subscriptionId,
resourceGroupName,
mongoClusterName
)
SELECT
'{{ properties }}',
'{{ tags }}',
'{{ location }}',
'{{ subscriptionId }}',
'{{ resourceGroupName }}',
'{{ mongoClusterName }}'
RETURNING
location,
properties,
tags
;

UPDATE examples

Updates an existing mongo cluster. The request body can contain one to many of the properties present in the normal mongo cluster definition.

UPDATE azure_isv.mongo_db.mongo_clusters
SET
data__tags = '{{ tags }}',
data__properties = '{{ properties }}'
WHERE
subscriptionId = '{{ subscriptionId }}' --required
AND resourceGroupName = '{{ resourceGroupName }}' --required
AND mongoClusterName = '{{ mongoClusterName }}' --required
RETURNING
location,
properties,
tags;

DELETE examples

Deletes a mongo cluster.

DELETE FROM azure_isv.mongo_db.mongo_clusters
WHERE subscriptionId = '{{ subscriptionId }}' --required
AND resourceGroupName = '{{ resourceGroupName }}' --required
AND mongoClusterName = '{{ mongoClusterName }}' --required
;

Lifecycle Methods

Check if mongo cluster name is available for use.

EXEC azure_isv.mongo_db.mongo_clusters.check_name_availability 
@subscriptionId='{{ subscriptionId }}' --required,
@location='{{ location }}' --required
@@json=
'{
"name": "{{ name }}",
"type": "{{ type }}"
}'
;