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.
Manage Replica.
Commands
| Name | Description | Type | Status |
|---|---|---|---|
| az documentdb mongocluster replica create |
Create a cross-region read replica of an existing mongo cluster. |
Extension | GA |
| az documentdb mongocluster replica list |
List all the replicas for the mongo cluster. |
Extension | GA |
| az documentdb mongocluster replica promote |
Promotes a replica mongo cluster to a primary role. |
Extension | GA |
az documentdb mongocluster replica create
Create a cross-region 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 in the target region and inherits its configuration (compute, storage, sharding) from the source cluster.
az documentdb mongocluster replica create --cluster-name --name
--resource-group
--source-cluster
--source-location
[--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 in another region.
az documentdb mongocluster replica create -n MyReplica -g MyResourceGroup --location centralus --source-cluster MySourceCluster --source-location eastus2
Required Parameters
The name of the mongo cluster.
Name of resource group. You can configure the default group using az configure --defaults group=<name>.
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.
| Property | Value |
|---|---|
| Parameter group: | Replica Arguments |
The Azure region of the source cluster (for example: eastus2).
| 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.
Acquiring an Azure Policy token automatically for this resource operation.
| Property | Value |
|---|---|
| Parameter group: | Global Policy Arguments |
The related change reference ID for this resource operation.
| Property | Value |
|---|---|
| Parameter group: | Global Policy Arguments |
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 |
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
Increase logging verbosity to show all debug logs.
| Property | Value |
|---|---|
| Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
| Property | Value |
|---|---|
| Default value: | False |
Output format.
| Property | Value |
|---|---|
| Default value: | json |
| Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.
Increase logging verbosity. Use --debug for full debug logs.
| Property | Value |
|---|---|
| Default value: | False |
az documentdb mongocluster replica list
List all the replicas for the mongo cluster.
az documentdb mongocluster replica list --cluster-name
--resource-group
[--max-items]
[--next-token]
Examples
List replicas of a cluster.
az documentdb mongocluster replica list --cluster-name MyCluster -g MyResourceGroup
Required Parameters
The name of the mongo cluster.
Name of resource group. You can configure the default group using az configure --defaults group=<name>.
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
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 |
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
Increase logging verbosity to show all debug logs.
| Property | Value |
|---|---|
| Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
| Property | Value |
|---|---|
| Default value: | False |
Output format.
| Property | Value |
|---|---|
| Default value: | json |
| Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.
Increase logging verbosity. Use --debug for full debug logs.
| Property | Value |
|---|---|
| Default value: | False |
az documentdb mongocluster replica promote
Promotes a replica mongo cluster to a primary role.
az documentdb mongocluster replica promote --promote-option {Forced}
[--acquire-policy-token]
[--change-reference]
[--ids]
[--mode {Switchover}]
[--name]
[--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
[--resource-group]
[--subscription]
Examples
Promote a replica to primary.
az documentdb mongocluster replica promote -n MyReplica -g MyResourceGroup --mode Switchover --promote-option Forced
Required Parameters
The promote option to apply to the operation.
| Property | Value |
|---|---|
| Parameter group: | Body Arguments |
| Accepted values: | Forced |
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
Acquiring an Azure Policy token automatically for this resource operation.
| Property | Value |
|---|---|
| Parameter group: | Global Policy Arguments |
The related change reference ID for this resource operation.
| Property | Value |
|---|---|
| Parameter group: | Global Policy Arguments |
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 |
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 |
The name of the replica to promote.
| Property | Value |
|---|---|
| Parameter group: | Resource Id Arguments |
Do not wait for the long-running operation to finish.
| Property | Value |
|---|---|
| Accepted values: | 0, 1, f, false, n, no, t, true, y, yes |
Name of resource group. You can configure the default group using az configure --defaults group=<name>.
| Property | Value |
|---|---|
| Parameter group: | Resource Id Arguments |
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 |
Global Parameters
Increase logging verbosity to show all debug logs.
| Property | Value |
|---|---|
| Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
| Property | Value |
|---|---|
| Default value: | False |
Output format.
| Property | Value |
|---|---|
| Default value: | json |
| Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Increase logging verbosity. Use --debug for full debug logs.
| Property | Value |
|---|---|
| Default value: | False |