sql_server_availability_groups
Creates, updates, deletes, gets or lists a sql_server_availability_groups
resource.
Overview
Name | sql_server_availability_groups |
Type | Resource |
Id | azure.azure_arc_data.sql_server_availability_groups |
Fields
- vw_sql_server_availability_groups
- sql_server_availability_groups
Name | Datatype | Description |
---|---|---|
availabilityGroupName | text | field from the properties object |
availability_group_id | text | field from the properties object |
collection_timestamp | text | field from the properties object |
databases | text | field from the properties object |
info | text | field from the properties object |
instance_name | text | field from the properties object |
location | text | The geo-location where the resource lives |
provisioning_state | text | field from the properties object |
replicas | text | field from the properties object |
resourceGroupName | text | field from the properties object |
server_name | text | field from the properties object |
sqlServerInstanceName | text | field from the properties object |
subscriptionId | text | field from the properties object |
tags | text | Resource tags. |
Name | Datatype | Description |
---|---|---|
location | string | The geo-location where the resource lives |
properties | object | The properties of Arc Sql Server availability group resource |
tags | object | Resource tags. |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | availabilityGroupName, resourceGroupName, sqlServerInstanceName, subscriptionId | Retrieves an Arc Sql Server availability group. |
list | SELECT | resourceGroupName, sqlServerInstanceName, subscriptionId | |
create | INSERT | availabilityGroupName, resourceGroupName, sqlServerInstanceName, subscriptionId, data__properties | Creates or replaces an Arc Sql Server Availability Group. |
delete | DELETE | availabilityGroupName, resourceGroupName, sqlServerInstanceName, subscriptionId | Deletes an Arc Sql Server availability group resource. |
update | UPDATE | availabilityGroupName, resourceGroupName, sqlServerInstanceName, subscriptionId | Updates an existing Availability Group. |
detail_view | EXEC | availabilityGroupName, resourceGroupName, sqlServerInstanceName, subscriptionId | Retrieves detailed properties of the Availability Group. |
failover | EXEC | availabilityGroupName, resourceGroupName, sqlServerInstanceName, subscriptionId | Request manual failover of the availability group to this server. |
force_failover_allow_data_loss | EXEC | availabilityGroupName, resourceGroupName, sqlServerInstanceName, subscriptionId | Request forced failover of the availability group to this server. |
SELECT
examples
- vw_sql_server_availability_groups
- sql_server_availability_groups
SELECT
availabilityGroupName,
availability_group_id,
collection_timestamp,
databases,
info,
instance_name,
location,
provisioning_state,
replicas,
resourceGroupName,
server_name,
sqlServerInstanceName,
subscriptionId,
tags
FROM azure.azure_arc_data.vw_sql_server_availability_groups
WHERE resourceGroupName = '{{ resourceGroupName }}'
AND sqlServerInstanceName = '{{ sqlServerInstanceName }}'
AND subscriptionId = '{{ subscriptionId }}';
SELECT
location,
properties,
tags
FROM azure.azure_arc_data.sql_server_availability_groups
WHERE resourceGroupName = '{{ resourceGroupName }}'
AND sqlServerInstanceName = '{{ sqlServerInstanceName }}'
AND subscriptionId = '{{ subscriptionId }}';
INSERT
example
Use the following StackQL query and manifest file to create a new sql_server_availability_groups
resource.
- All Properties
- Manifest
/*+ create */
INSERT INTO azure.azure_arc_data.sql_server_availability_groups (
availabilityGroupName,
resourceGroupName,
sqlServerInstanceName,
subscriptionId,
data__properties,
tags,
location,
properties
)
SELECT
'{{ availabilityGroupName }}',
'{{ resourceGroupName }}',
'{{ sqlServerInstanceName }}',
'{{ subscriptionId }}',
'{{ data__properties }}',
'{{ tags }}',
'{{ location }}',
'{{ properties }}'
;
- name: your_resource_model_name
props:
- name: tags
value: object
- name: location
value: string
- name: properties
value:
- name: availabilityGroupId
value: string
- name: serverName
value: string
- name: instanceName
value: string
- name: collectionTimestamp
value: string
- name: info
value:
- name: failureConditionLevel
value: integer
- name: healthCheckTimeout
value: integer
- name: automatedBackupPreferenceDescription
value: string
- name: version
value: integer
- name: basicFeatures
value: boolean
- name: dtcSupport
value: boolean
- name: dbFailover
value: boolean
- name: isDistributed
value: boolean
- name: clusterTypeDescription
value: string
- name: requiredSynchronizedSecondariesToCommit
value: integer
- name: isContained
value: boolean
- name: primaryReplica
value: string
- name: primaryRecoveryHealthDescription
value: string
- name: secondaryRecoveryHealthDescription
value: string
- name: synchronizationHealthDescription
value: string
- name: replicationPartnerType
value: string
- name: replicas
value:
- name: value
value:
- - name: replicaId
value: string
- name: replicaName
value: string
- name: configure
value:
- name: endpointUrl
value: string
- name: availabilityModeDescription
value: string
- name: failoverModeDescription
value: string
- name: sessionTimeout
value: integer
- name: primaryRoleAllowConnectionsDescription
value: string
- name: secondaryRoleAllowConnectionsDescription
value: string
- name: replicaCreateDate
value: string
- name: replicaModifyDate
value: string
- name: backupPriority
value: integer
- name: readOnlyRoutingUrl
value: string
- name: readWriteRoutingUrl
value: string
- name: seedingModeDescription
value: string
- name: state
value:
- name: availabilityGroupReplicaRole
value: string
- name: operationalStateDescription
value: string
- name: recoveryHealthDescription
value: string
- name: synchronizationHealthDescription
value: string
- name: connectedStateDescription
value: string
- name: lastConnectErrorDescription
value: string
- name: lastConnectErrorTimestamp
value: string
- name: nextLink
value: string
- name: databases
value:
- name: value
value:
- - name: databaseName
value: string
- name: replicaName
value: string
- name: isLocal
value: boolean
- name: isPrimaryReplica
value: boolean
- name: synchronizationStateDescription
value: string
- name: isCommitParticipant
value: boolean
- name: synchronizationHealthDescription
value: string
- name: databaseStateDescription
value: string
- name: isSuspended
value: boolean
- name: suspendReasonDescription
value: string
- name: nextLink
value: string
- name: provisioningState
value: string
UPDATE
example
Updates a sql_server_availability_groups
resource.
/*+ update */
UPDATE azure.azure_arc_data.sql_server_availability_groups
SET
tags = '{{ tags }}',
properties = '{{ properties }}'
WHERE
availabilityGroupName = '{{ availabilityGroupName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND sqlServerInstanceName = '{{ sqlServerInstanceName }}'
AND subscriptionId = '{{ subscriptionId }}';
DELETE
example
Deletes the specified sql_server_availability_groups
resource.
/*+ delete */
DELETE FROM azure.azure_arc_data.sql_server_availability_groups
WHERE availabilityGroupName = '{{ availabilityGroupName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND sqlServerInstanceName = '{{ sqlServerInstanceName }}'
AND subscriptionId = '{{ subscriptionId }}';