database_accounts
Creates, updates, deletes, gets or lists a database_accounts
resource.
Overview
Name | database_accounts |
Type | Resource |
Id | azure.cosmos_db.database_accounts |
Fields
The following fields are returned by SELECT
queries:
- get
- list_by_resource_group
- list
The database account properties were retrieved successfully.
Name | Datatype | Description |
---|---|---|
id | string | The unique resource identifier of the ARM resource. |
name | string | The name of the ARM resource. |
identity | object | Identity for the resource. |
kind | string | Indicates the type of database account. This can only be set at database account creation. (default: GlobalDocumentDB) |
location | string | The location of the resource group to which the resource belongs. |
properties | object | Properties for the database account. |
systemData | object | The system meta data relating to this resource. |
tags | object | Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example, the default experience for a template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". |
type | string | The type of Azure resource. |
The operation completed successfully.
Name | Datatype | Description |
---|---|---|
id | string | The unique resource identifier of the ARM resource. |
name | string | The name of the ARM resource. |
identity | object | Identity for the resource. |
kind | string | Indicates the type of database account. This can only be set at database account creation. (default: GlobalDocumentDB) |
location | string | The location of the resource group to which the resource belongs. |
properties | object | Properties for the database account. |
systemData | object | The system meta data relating to this resource. |
tags | object | Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example, the default experience for a template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". |
type | string | The type of Azure resource. |
The operation completed successfully.
Name | Datatype | Description |
---|---|---|
id | string | The unique resource identifier of the ARM resource. |
name | string | The name of the ARM resource. |
identity | object | Identity for the resource. |
kind | string | Indicates the type of database account. This can only be set at database account creation. (default: GlobalDocumentDB) |
location | string | The location of the resource group to which the resource belongs. |
properties | object | Properties for the database account. |
systemData | object | The system meta data relating to this resource. |
tags | object | Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example, the default experience for a template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". |
type | string | The type of Azure resource. |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | subscriptionId , resourceGroupName , accountName | Retrieves the properties of an existing Azure Cosmos DB database account. | |
list_by_resource_group | select | resourceGroupName , subscriptionId | Lists all the Azure Cosmos DB database accounts available under the given resource group. | |
list | select | subscriptionId | Lists all the Azure Cosmos DB database accounts available under the subscription. | |
create_or_update | insert | subscriptionId , resourceGroupName , accountName , data__properties | Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates on an account. | |
update | update | subscriptionId , resourceGroupName , accountName | Updates the properties of an existing Azure Cosmos DB database account. | |
delete | delete | subscriptionId , resourceGroupName , accountName | Deletes an existing Azure Cosmos DB database account. | |
failover_priority_change | exec | subscriptionId , resourceGroupName , accountName , failoverPolicies | Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists. | |
offline_region | exec | subscriptionId , resourceGroupName , accountName , region | Offline the specified region for the specified Azure Cosmos DB database account. | |
online_region | exec | subscriptionId , resourceGroupName , accountName , region | Online the specified region for the specified Azure Cosmos DB database account. | |
regenerate_key | exec | subscriptionId , resourceGroupName , accountName , keyKind | Regenerates an access key for the specified Azure Cosmos DB database account. |
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.
Name | Datatype | Description |
---|---|---|
accountName | string | Cosmos DB database account name. |
resourceGroupName | string | The name of the resource group. The name is case insensitive. |
subscriptionId | string | The ID of the target subscription. |
SELECT
examples
- get
- list_by_resource_group
- list
Retrieves the properties of an existing Azure Cosmos DB database account.
SELECT
id,
name,
identity,
kind,
location,
properties,
systemData,
tags,
type
FROM azure.cosmos_db.database_accounts
WHERE subscriptionId = '{{ subscriptionId }}' -- required
AND resourceGroupName = '{{ resourceGroupName }}' -- required
AND accountName = '{{ accountName }}' -- required
;
Lists all the Azure Cosmos DB database accounts available under the given resource group.
SELECT
id,
name,
identity,
kind,
location,
properties,
systemData,
tags,
type
FROM azure.cosmos_db.database_accounts
WHERE resourceGroupName = '{{ resourceGroupName }}' -- required
AND subscriptionId = '{{ subscriptionId }}' -- required
;
Lists all the Azure Cosmos DB database accounts available under the subscription.
SELECT
id,
name,
identity,
kind,
location,
properties,
systemData,
tags,
type
FROM azure.cosmos_db.database_accounts
WHERE subscriptionId = '{{ subscriptionId }}' -- required
;
INSERT
examples
- create_or_update
- Manifest
Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates on an account.
INSERT INTO azure.cosmos_db.database_accounts (
data__kind,
data__identity,
data__properties,
data__location,
data__tags,
subscriptionId,
resourceGroupName,
accountName
)
SELECT
'{{ kind }}',
'{{ identity }}',
'{{ properties }}' /* required */,
'{{ location }}',
'{{ tags }}',
'{{ subscriptionId }}',
'{{ resourceGroupName }}',
'{{ accountName }}'
RETURNING
id,
name,
identity,
kind,
location,
properties,
systemData,
tags,
type
;
# Description fields are for documentation purposes
- name: database_accounts
props:
- name: subscriptionId
value: string
description: Required parameter for the database_accounts resource.
- name: resourceGroupName
value: string
description: Required parameter for the database_accounts resource.
- name: accountName
value: string
description: Required parameter for the database_accounts resource.
- name: kind
value: string
description: |
Indicates the type of database account. This can only be set at database account creation.
valid_values: ['GlobalDocumentDB', 'MongoDB', 'Parse']
default: GlobalDocumentDB
- name: identity
value: object
description: |
Identity for the resource.
- name: properties
value: object
description: |
Properties to create and update Azure Cosmos DB database accounts.
- name: location
value: string
description: |
The location of the resource group to which the resource belongs.
- name: tags
value: object
description: |
Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example, the default experience for a template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB".
UPDATE
examples
- update
Updates the properties of an existing Azure Cosmos DB database account.
UPDATE azure.cosmos_db.database_accounts
SET
data__tags = '{{ tags }}',
data__location = '{{ location }}',
data__identity = '{{ identity }}',
data__properties = '{{ properties }}'
WHERE
subscriptionId = '{{ subscriptionId }}' --required
AND resourceGroupName = '{{ resourceGroupName }}' --required
AND accountName = '{{ accountName }}' --required
RETURNING
id,
name,
identity,
kind,
location,
properties,
systemData,
tags,
type;
DELETE
examples
- delete
Deletes an existing Azure Cosmos DB database account.
DELETE FROM azure.cosmos_db.database_accounts
WHERE subscriptionId = '{{ subscriptionId }}' --required
AND resourceGroupName = '{{ resourceGroupName }}' --required
AND accountName = '{{ accountName }}' --required
;
Lifecycle Methods
- failover_priority_change
- offline_region
- online_region
- regenerate_key
Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists.
EXEC azure.cosmos_db.database_accounts.failover_priority_change
@subscriptionId='{{ subscriptionId }}' --required,
@resourceGroupName='{{ resourceGroupName }}' --required,
@accountName='{{ accountName }}' --required
@@json=
'{
"failoverPolicies": "{{ failoverPolicies }}"
}'
;
Offline the specified region for the specified Azure Cosmos DB database account.
EXEC azure.cosmos_db.database_accounts.offline_region
@subscriptionId='{{ subscriptionId }}' --required,
@resourceGroupName='{{ resourceGroupName }}' --required,
@accountName='{{ accountName }}' --required
@@json=
'{
"region": "{{ region }}"
}'
;
Online the specified region for the specified Azure Cosmos DB database account.
EXEC azure.cosmos_db.database_accounts.online_region
@subscriptionId='{{ subscriptionId }}' --required,
@resourceGroupName='{{ resourceGroupName }}' --required,
@accountName='{{ accountName }}' --required
@@json=
'{
"region": "{{ region }}"
}'
;
Regenerates an access key for the specified Azure Cosmos DB database account.
EXEC azure.cosmos_db.database_accounts.regenerate_key
@subscriptionId='{{ subscriptionId }}' --required,
@resourceGroupName='{{ resourceGroupName }}' --required,
@accountName='{{ accountName }}' --required
@@json=
'{
"keyKind": "{{ keyKind }}"
}'
;