replication_links
Creates, updates, deletes, gets or lists a replication_links
resource.
Overview
Name | replication_links |
Type | Resource |
Id | azure.sql.replication_links |
Fields
- vw_replication_links
- replication_links
Name | Datatype | Description |
---|---|---|
databaseName | text | field from the properties object |
is_termination_allowed | text | field from the properties object |
linkId | text | field from the properties object |
link_type | text | field from the properties object |
partner_database | text | field from the properties object |
partner_database_id | text | field from the properties object |
partner_location | text | field from the properties object |
partner_role | text | field from the properties object |
partner_server | text | field from the properties object |
percent_complete | text | field from the properties object |
replication_mode | text | field from the properties object |
replication_state | text | field from the properties object |
resourceGroupName | text | field from the properties object |
role | text | field from the properties object |
serverName | text | field from the properties object |
start_time | text | field from the properties object |
subscriptionId | text | field from the properties object |
Name | Datatype | Description |
---|---|---|
properties | object | Properties of a replication link. |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | databaseName, linkId, resourceGroupName, serverName, subscriptionId | Gets a replication link. |
list_by_database | SELECT | databaseName, resourceGroupName, serverName, subscriptionId | Gets a list of replication links on database. |
list_by_server | SELECT | resourceGroupName, serverName, subscriptionId | Gets a list of replication links. |
create_or_update | INSERT | databaseName, linkId, resourceGroupName, serverName, subscriptionId | Updates the replication link type. |
delete | DELETE | databaseName, linkId, resourceGroupName, serverName, subscriptionId | Deletes the replication link. |
update | UPDATE | databaseName, linkId, resourceGroupName, serverName, subscriptionId | Updates the replication link type. |
failover | EXEC | databaseName, linkId, resourceGroupName, serverName, subscriptionId | Fails over from the current primary server to this server. |
failover_allow_data_loss | EXEC | databaseName, linkId, resourceGroupName, serverName, subscriptionId | Fails over from the current primary server to this server allowing data loss. |
SELECT
examples
Gets a list of replication links.
- vw_replication_links
- replication_links
SELECT
databaseName,
is_termination_allowed,
linkId,
link_type,
partner_database,
partner_database_id,
partner_location,
partner_role,
partner_server,
percent_complete,
replication_mode,
replication_state,
resourceGroupName,
role,
serverName,
start_time,
subscriptionId
FROM azure.sql.vw_replication_links
WHERE resourceGroupName = '{{ resourceGroupName }}'
AND serverName = '{{ serverName }}'
AND subscriptionId = '{{ subscriptionId }}';
SELECT
properties
FROM azure.sql.replication_links
WHERE resourceGroupName = '{{ resourceGroupName }}'
AND serverName = '{{ serverName }}'
AND subscriptionId = '{{ subscriptionId }}';
INSERT
example
Use the following StackQL query and manifest file to create a new replication_links
resource.
- All Properties
- Manifest
/*+ create */
INSERT INTO azure.sql.replication_links (
databaseName,
linkId,
resourceGroupName,
serverName,
subscriptionId,
properties
)
SELECT
'{{ databaseName }}',
'{{ linkId }}',
'{{ resourceGroupName }}',
'{{ serverName }}',
'{{ subscriptionId }}',
'{{ properties }}'
;
- name: your_resource_model_name
props:
- name: properties
value:
- name: partnerServer
value: string
- name: partnerDatabase
value: string
- name: partnerDatabaseId
value: string
- name: partnerLocation
value: string
- name: role
value: string
- name: partnerRole
value: string
- name: replicationMode
value: string
- name: startTime
value: string
- name: percentComplete
value: integer
- name: replicationState
value: string
- name: isTerminationAllowed
value: boolean
- name: linkType
value: string
UPDATE
example
Updates a replication_links
resource.
/*+ update */
UPDATE azure.sql.replication_links
SET
properties = '{{ properties }}'
WHERE
databaseName = '{{ databaseName }}'
AND linkId = '{{ linkId }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND serverName = '{{ serverName }}'
AND subscriptionId = '{{ subscriptionId }}';
DELETE
example
Deletes the specified replication_links
resource.
/*+ delete */
DELETE FROM azure.sql.replication_links
WHERE databaseName = '{{ databaseName }}'
AND linkId = '{{ linkId }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND serverName = '{{ serverName }}'
AND subscriptionId = '{{ subscriptionId }}';