failover_groups
Creates, updates, deletes, gets or lists a failover_groups
resource.
Overview
Name | failover_groups |
Type | Resource |
Id | azure.sql.failover_groups |
Fields
- vw_failover_groups
- failover_groups
Name | Datatype | Description |
---|---|---|
databases | text | field from the properties object |
failoverGroupName | text | field from the properties object |
location | text | Resource location. |
partner_servers | text | field from the properties object |
read_only_endpoint | text | field from the properties object |
read_write_endpoint | text | field from the properties object |
replication_role | text | field from the properties object |
replication_state | text | field from the properties object |
resourceGroupName | text | field from the properties object |
secondary_type | text | field from the properties object |
serverName | text | field from the properties object |
subscriptionId | text | field from the properties object |
tags | text | Resource tags. |
Name | Datatype | Description |
---|---|---|
location | string | Resource location. |
properties | object | Properties of a failover group. |
tags | object | Resource tags. |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | failoverGroupName, resourceGroupName, serverName, subscriptionId | Gets a failover group. |
list_by_server | SELECT | resourceGroupName, serverName, subscriptionId | Lists the failover groups in a server. |
create_or_update | INSERT | failoverGroupName, resourceGroupName, serverName, subscriptionId | Creates or updates a failover group. |
delete | DELETE | failoverGroupName, resourceGroupName, serverName, subscriptionId | Deletes a failover group. |
update | UPDATE | failoverGroupName, resourceGroupName, serverName, subscriptionId | Updates a failover group. |
failover | EXEC | failoverGroupName, resourceGroupName, serverName, subscriptionId | Fails over from the current primary server to this server. |
force_failover_allow_data_loss | EXEC | failoverGroupName, resourceGroupName, serverName, subscriptionId | Fails over from the current primary server to this server. This operation might result in data loss. |
try_planned_before_forced_failover | EXEC | failoverGroupName, resourceGroupName, serverName, subscriptionId | Fails over from the current primary server to this server. This operation tries planned before forced failover but might still result in data loss. |
SELECT
examples
Lists the failover groups in a server.
- vw_failover_groups
- failover_groups
SELECT
databases,
failoverGroupName,
location,
partner_servers,
read_only_endpoint,
read_write_endpoint,
replication_role,
replication_state,
resourceGroupName,
secondary_type,
serverName,
subscriptionId,
tags
FROM azure.sql.vw_failover_groups
WHERE resourceGroupName = '{{ resourceGroupName }}'
AND serverName = '{{ serverName }}'
AND subscriptionId = '{{ subscriptionId }}';
SELECT
location,
properties,
tags
FROM azure.sql.failover_groups
WHERE resourceGroupName = '{{ resourceGroupName }}'
AND serverName = '{{ serverName }}'
AND subscriptionId = '{{ subscriptionId }}';
INSERT
example
Use the following StackQL query and manifest file to create a new failover_groups
resource.
- All Properties
- Manifest
/*+ create */
INSERT INTO azure.sql.failover_groups (
failoverGroupName,
resourceGroupName,
serverName,
subscriptionId,
tags,
properties
)
SELECT
'{{ failoverGroupName }}',
'{{ resourceGroupName }}',
'{{ serverName }}',
'{{ subscriptionId }}',
'{{ tags }}',
'{{ properties }}'
;
- name: your_resource_model_name
props:
- name: location
value: string
- name: tags
value: object
- name: properties
value:
- name: readWriteEndpoint
value:
- name: failoverPolicy
value: string
- name: failoverWithDataLossGracePeriodMinutes
value: integer
- name: readOnlyEndpoint
value:
- name: failoverPolicy
value: string
- name: targetServer
value: string
- name: replicationRole
value: string
- name: replicationState
value: string
- name: partnerServers
value:
- - name: id
value: string
- name: location
value: string
- name: replicationRole
value: string
- name: databases
value:
- string
- name: secondaryType
value: string
UPDATE
example
Updates a failover_groups
resource.
/*+ update */
UPDATE azure.sql.failover_groups
SET
properties = '{{ properties }}',
tags = '{{ tags }}'
WHERE
failoverGroupName = '{{ failoverGroupName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND serverName = '{{ serverName }}'
AND subscriptionId = '{{ subscriptionId }}';
DELETE
example
Deletes the specified failover_groups
resource.
/*+ delete */
DELETE FROM azure.sql.failover_groups
WHERE failoverGroupName = '{{ failoverGroupName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND serverName = '{{ serverName }}'
AND subscriptionId = '{{ subscriptionId }}';