az documentdb mongocluster replica

Note

This reference is part of the documentdb extension for the Azure CLI (version 2.75.0 or higher). The extension will automatically install the first time you run an az documentdb mongocluster replica command. Learn more about extensions.

Command group 'az documentdb mongocluster' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Manage Replica.

Commands

Name Description Type Status
az documentdb mongocluster replica create

Create a read replica of an existing mongo cluster.

Extension Preview
az documentdb mongocluster replica list

List all the replicas for the mongo cluster.

Extension Preview
az documentdb mongocluster replica promote

Promotes a replica mongo cluster to a primary role.

Extension Preview

az documentdb mongocluster replica create

Preview

Command group 'az documentdb mongocluster replica' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Create a read replica of an existing mongo cluster.

The source cluster must have the "GeoReplicas" preview feature enabled. The replica is provisioned as a new mongo cluster and inherits its configuration (compute, storage, sharding) from the source cluster. A replica in the same region as the source is created as an in-region AsyncReplica; a replica in a different region is created as a cross-region GeoAsyncReplica.

az documentdb mongocluster replica create --cluster-name --name
                                          --resource-group
                                          --source-cluster
                                          [--acquire-policy-token]
                                          [--change-reference]
                                          [--location]
                                          [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]

Examples

Create a replica of a cluster.

az documentdb mongocluster replica create -n MyReplica -g MyResourceGroup --location centralus --source-cluster MySourceCluster

Required Parameters

--cluster-name --name -n

The name of the mongo cluster.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--source-cluster

Name or resource ID of the source (primary) mongo cluster to replicate from. If a name is given, the current subscription and resource group are assumed. Provide a full ARM ID for a source in another resource group or subscription.

Property Value
Parameter group: Replica Arguments

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--acquire-policy-token

Acquiring an Azure Policy token automatically for this resource operation.

Property Value
Parameter group: Global Policy Arguments
--change-reference

The related change reference ID for this resource operation.

Property Value
Parameter group: Global Policy Arguments
--location -l

The geo-location where the resource lives When not specified, the location of the resource group will be used.

Property Value
Parameter group: Resource Arguments
--no-wait

Do not wait for the long-running operation to finish.

Property Value
Accepted values: 0, 1, f, false, n, no, t, true, y, yes
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

az documentdb mongocluster replica list

Preview

Command group 'az documentdb mongocluster replica' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

List all the replicas for the mongo cluster.

az documentdb mongocluster replica list --resource-group
                                        --source-cluster
                                        [--max-items]
                                        [--next-token]

Examples

List replicas of a cluster.

az documentdb mongocluster replica list --source-cluster MyCluster -g MyResourceGroup

Required Parameters

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--source-cluster

The name of the source mongo cluster.

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--max-items

Total number of items to return in the command's output. If the total number of items available is more than the value specified, a token is provided in the command's output. To resume pagination, provide the token value in --next-token argument of a subsequent command.

Property Value
Parameter group: Pagination Arguments
--next-token

Token to specify where to start paginating. This is the token value from a previously truncated response.

Property Value
Parameter group: Pagination Arguments
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

az documentdb mongocluster replica promote

Preview

Command group 'az documentdb mongocluster replica' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Promotes a replica mongo cluster to a primary role.

az documentdb mongocluster replica promote --promote-option {Forced}
                                           --source-cluster
                                           [--acquire-policy-token]
                                           [--change-reference]
                                           [--ids]
                                           [--mode {Switchover}]
                                           [--name]
                                           [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
                                           [--resource-group]
                                           [--subscription]
                                           [--yes]

Examples

Promote a replica to primary.

az documentdb mongocluster replica promote -n MyReplica -g MyResourceGroup --mode Switchover --promote-option Forced

Required Parameters

--promote-option

The promote option to apply to the operation.

Property Value
Parameter group: Body Arguments
Accepted values: Forced
--source-cluster

Name or resource ID of the expected source (primary) cluster of this replica. Promotion only proceeds if it matches the replica's actual source cluster; otherwise the operation fails.

Property Value
Parameter group: Replica Arguments

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--acquire-policy-token

Acquiring an Azure Policy token automatically for this resource operation.

Property Value
Parameter group: Global Policy Arguments
--change-reference

The related change reference ID for this resource operation.

Property Value
Parameter group: Global Policy Arguments
--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

Property Value
Parameter group: Resource Id Arguments
--mode

The mode to apply to the promote operation. Value is optional and default value is 'Switchover'.

Property Value
Parameter group: Body Arguments
Accepted values: Switchover
--name -n

The name of the replica to promote.

Property Value
Parameter group: Resource Id Arguments
--no-wait

Do not wait for the long-running operation to finish.

Property Value
Accepted values: 0, 1, f, false, n, no, t, true, y, yes
--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Property Value
Parameter group: Resource Id Arguments
--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

Property Value
Parameter group: Resource Id Arguments
--yes -y

Do not prompt for confirmation.

Property Value
Default value: False
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False