instance_failover_groups
Creates, updates, deletes, gets or lists a instance_failover_groups
resource.
Overview
Name | instance_failover_groups |
Type | Resource |
Id | azure.sql.instance_failover_groups |
Fields
- vw_instance_failover_groups
- instance_failover_groups
Name | Datatype | Description |
---|---|---|
failoverGroupName | text | field from the properties object |
locationName | text | field from the properties object |
managed_instance_pairs | text | field from the properties object |
partner_regions | 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 |
subscriptionId | text | field from the properties object |
Name | Datatype | Description |
---|---|---|
properties | object | Properties of a instance failover group. |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | failoverGroupName, locationName, resourceGroupName, subscriptionId | Gets a failover group. |
list_by_location | SELECT | locationName, resourceGroupName, subscriptionId | Lists the failover groups in a location. |
create_or_update | INSERT | failoverGroupName, locationName, resourceGroupName, subscriptionId | Creates or updates a failover group. |
delete | DELETE | failoverGroupName, locationName, resourceGroupName, subscriptionId | Deletes a failover group. |
failover | EXEC | failoverGroupName, locationName, resourceGroupName, subscriptionId | Fails over from the current primary managed instance to this managed instance. |
force_failover_allow_data_loss | EXEC | failoverGroupName, locationName, resourceGroupName, subscriptionId | Fails over from the current primary managed instance to this managed instance. This operation might result in data loss. |
SELECT
examples
Lists the failover groups in a location.
- vw_instance_failover_groups
- instance_failover_groups
SELECT
failoverGroupName,
locationName,
managed_instance_pairs,
partner_regions,
read_only_endpoint,
read_write_endpoint,
replication_role,
replication_state,
resourceGroupName,
secondary_type,
subscriptionId
FROM azure.sql.vw_instance_failover_groups
WHERE locationName = '{{ locationName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}';
SELECT
properties
FROM azure.sql.instance_failover_groups
WHERE locationName = '{{ locationName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}';
INSERT
example
Use the following StackQL query and manifest file to create a new instance_failover_groups
resource.
- All Properties
- Manifest
/*+ create */
INSERT INTO azure.sql.instance_failover_groups (
failoverGroupName,
locationName,
resourceGroupName,
subscriptionId,
properties
)
SELECT
'{{ failoverGroupName }}',
'{{ locationName }}',
'{{ resourceGroupName }}',
'{{ subscriptionId }}',
'{{ properties }}'
;
- name: your_resource_model_name
props:
- name: properties
value:
- name: secondaryType
value: string
- name: readWriteEndpoint
value:
- name: failoverPolicy
value: string
- name: failoverWithDataLossGracePeriodMinutes
value: integer
- name: readOnlyEndpoint
value:
- name: failoverPolicy
value: string
- name: replicationRole
value: string
- name: replicationState
value: string
- name: partnerRegions
value:
- - name: location
value: string
- name: replicationRole
value: string
- name: managedInstancePairs
value:
- - name: primaryManagedInstanceId
value: string
- name: partnerManagedInstanceId
value: string
DELETE
example
Deletes the specified instance_failover_groups
resource.
/*+ delete */
DELETE FROM azure.sql.instance_failover_groups
WHERE failoverGroupName = '{{ failoverGroupName }}'
AND locationName = '{{ locationName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}';