replication_links
Creates, updates, deletes, gets or lists a replication_links resource.
Overview
| Name | replication_links |
| Type | Resource |
| Id | azure.sql.replication_links |
Fields
The following fields are returned by SELECT queries:
- get
- list_by_database
- list_by_server
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
isTerminationAllowed | boolean | Whether the user is currently allowed to terminate the link. |
linkType | string | Link type (GEO, NAMED, STANDBY). Update operation does not support NAMED. Known values are: "GEO", "NAMED", and "STANDBY". (GEO, NAMED, STANDBY) |
partnerDatabase | string | Resource partner database. |
partnerDatabaseId | string | Resource partner database Id. |
partnerLocation | string | Resource partner location. |
partnerRole | string | Partner replication role. Known values are: "Primary", "Secondary", "NonReadableSecondary", "Source", and "Copy". (Primary, Secondary, NonReadableSecondary, Source, Copy) |
partnerServer | string | Resource partner server. |
percentComplete | integer | Seeding completion percentage for the link. |
replicationMode | string | Replication mode. |
replicationState | string | Replication state (PENDING, SEEDING, CATCHUP, SUSPENDED). Known values are: "PENDING", "SEEDING", "CATCH_UP", and "SUSPENDED". (PENDING, SEEDING, CATCH_UP, SUSPENDED) |
role | string | Local replication role. Known values are: "Primary", "Secondary", "NonReadableSecondary", "Source", and "Copy". (Primary, Secondary, NonReadableSecondary, Source, Copy) |
startTime | string (date-time) | Time at which the link was created. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
isTerminationAllowed | boolean | Whether the user is currently allowed to terminate the link. |
linkType | string | Link type (GEO, NAMED, STANDBY). Update operation does not support NAMED. Known values are: "GEO", "NAMED", and "STANDBY". (GEO, NAMED, STANDBY) |
partnerDatabase | string | Resource partner database. |
partnerDatabaseId | string | Resource partner database Id. |
partnerLocation | string | Resource partner location. |
partnerRole | string | Partner replication role. Known values are: "Primary", "Secondary", "NonReadableSecondary", "Source", and "Copy". (Primary, Secondary, NonReadableSecondary, Source, Copy) |
partnerServer | string | Resource partner server. |
percentComplete | integer | Seeding completion percentage for the link. |
replicationMode | string | Replication mode. |
replicationState | string | Replication state (PENDING, SEEDING, CATCHUP, SUSPENDED). Known values are: "PENDING", "SEEDING", "CATCH_UP", and "SUSPENDED". (PENDING, SEEDING, CATCH_UP, SUSPENDED) |
role | string | Local replication role. Known values are: "Primary", "Secondary", "NonReadableSecondary", "Source", and "Copy". (Primary, Secondary, NonReadableSecondary, Source, Copy) |
startTime | string (date-time) | Time at which the link was created. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
isTerminationAllowed | boolean | Whether the user is currently allowed to terminate the link. |
linkType | string | Link type (GEO, NAMED, STANDBY). Update operation does not support NAMED. Known values are: "GEO", "NAMED", and "STANDBY". (GEO, NAMED, STANDBY) |
partnerDatabase | string | Resource partner database. |
partnerDatabaseId | string | Resource partner database Id. |
partnerLocation | string | Resource partner location. |
partnerRole | string | Partner replication role. Known values are: "Primary", "Secondary", "NonReadableSecondary", "Source", and "Copy". (Primary, Secondary, NonReadableSecondary, Source, Copy) |
partnerServer | string | Resource partner server. |
percentComplete | integer | Seeding completion percentage for the link. |
replicationMode | string | Replication mode. |
replicationState | string | Replication state (PENDING, SEEDING, CATCHUP, SUSPENDED). Known values are: "PENDING", "SEEDING", "CATCH_UP", and "SUSPENDED". (PENDING, SEEDING, CATCH_UP, SUSPENDED) |
role | string | Local replication role. Known values are: "Primary", "Secondary", "NonReadableSecondary", "Source", and "Copy". (Primary, Secondary, NonReadableSecondary, Source, Copy) |
startTime | string (date-time) | Time at which the link was created. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
Methods
The following methods are available for this resource:
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 |
|---|---|---|
database_name | string | The name of the database. Required. |
link_id | string | The name of the replication link. Required. |
resource_group_name | string | The name of the resource group. The name is case insensitive. Required. |
server_name | string | The name of the server. Required. |
subscription_id | string |
SELECT examples
- get
- list_by_database
- list_by_server
Gets a replication link.
SELECT
id,
name,
isTerminationAllowed,
linkType,
partnerDatabase,
partnerDatabaseId,
partnerLocation,
partnerRole,
partnerServer,
percentComplete,
replicationMode,
replicationState,
role,
startTime,
systemData,
type
FROM azure.sql.replication_links
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND server_name = '{{ server_name }}' -- required
AND database_name = '{{ database_name }}' -- required
AND link_id = '{{ link_id }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
Gets a list of replication links on database.
SELECT
id,
name,
isTerminationAllowed,
linkType,
partnerDatabase,
partnerDatabaseId,
partnerLocation,
partnerRole,
partnerServer,
percentComplete,
replicationMode,
replicationState,
role,
startTime,
systemData,
type
FROM azure.sql.replication_links
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND server_name = '{{ server_name }}' -- required
AND database_name = '{{ database_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
Gets a list of replication links.
SELECT
id,
name,
isTerminationAllowed,
linkType,
partnerDatabase,
partnerDatabaseId,
partnerLocation,
partnerRole,
partnerServer,
percentComplete,
replicationMode,
replicationState,
role,
startTime,
systemData,
type
FROM azure.sql.replication_links
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND server_name = '{{ server_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
INSERT examples
- create_or_update
- Manifest
Updates the replication link type.
INSERT INTO azure.sql.replication_links (
properties,
resource_group_name,
server_name,
database_name,
link_id,
subscription_id
)
SELECT
'{{ properties }}',
'{{ resource_group_name }}',
'{{ server_name }}',
'{{ database_name }}',
'{{ link_id }}',
'{{ subscription_id }}'
RETURNING
id,
name,
properties,
systemData,
type
;
# Description fields are for documentation purposes
- name: replication_links
props:
- name: resource_group_name
value: "{{ resource_group_name }}"
description: Required parameter for the replication_links resource.
- name: server_name
value: "{{ server_name }}"
description: Required parameter for the replication_links resource.
- name: database_name
value: "{{ database_name }}"
description: Required parameter for the replication_links resource.
- name: link_id
value: "{{ link_id }}"
description: Required parameter for the replication_links resource.
- name: subscription_id
value: "{{ subscription_id }}"
description: Required parameter for the replication_links resource.
- name: properties
description: |
Resource properties.
value:
partnerServer: "{{ partnerServer }}"
partnerDatabase: "{{ partnerDatabase }}"
partnerDatabaseId: "{{ partnerDatabaseId }}"
partnerLocation: "{{ partnerLocation }}"
role: "{{ role }}"
partnerRole: "{{ partnerRole }}"
replicationMode: "{{ replicationMode }}"
startTime: "{{ startTime }}"
percentComplete: {{ percentComplete }}
replicationState: "{{ replicationState }}"
isTerminationAllowed: {{ isTerminationAllowed }}
linkType: "{{ linkType }}"
UPDATE examples
- update
Updates the replication link type.
UPDATE azure.sql.replication_links
SET
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND server_name = '{{ server_name }}' --required
AND database_name = '{{ database_name }}' --required
AND link_id = '{{ link_id }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
properties,
systemData,
type;
REPLACE examples
- create_or_update
Updates the replication link type.
REPLACE azure.sql.replication_links
SET
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND server_name = '{{ server_name }}' --required
AND database_name = '{{ database_name }}' --required
AND link_id = '{{ link_id }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
properties,
systemData,
type;
DELETE examples
- delete
Deletes the replication link.
DELETE FROM azure.sql.replication_links
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND server_name = '{{ server_name }}' --required
AND database_name = '{{ database_name }}' --required
AND link_id = '{{ link_id }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;
Lifecycle Methods
- failover
- failover_allow_data_loss
Fails over from the current primary server to this server.
EXEC azure.sql.replication_links.failover
@resource_group_name='{{ resource_group_name }}' --required,
@server_name='{{ server_name }}' --required,
@database_name='{{ database_name }}' --required,
@link_id='{{ link_id }}' --required,
@subscription_id='{{ subscription_id }}' --required
;
Fails over from the current primary server to this server allowing data loss.
EXEC azure.sql.replication_links.failover_allow_data_loss
@resource_group_name='{{ resource_group_name }}' --required,
@server_name='{{ server_name }}' --required,
@database_name='{{ database_name }}' --required,
@link_id='{{ link_id }}' --required,
@subscription_id='{{ subscription_id }}' --required
;