sync_groups
Creates, updates, deletes, gets or lists a sync_groups resource.
Overview
| Name | sync_groups |
| Type | Resource |
| Id | azure.sql.sync_groups |
Fields
The following fields are returned by SELECT queries:
- list_logs
- get
- list_by_database
- list_sync_database_ids
| Name | Datatype | Description |
|---|---|---|
details | string | Details of the sync group log. |
operationStatus | string | OperationStatus of the sync group log. |
source | string | Source of the sync group log. |
timestamp | string (date-time) | Timestamp of the sync group log. |
tracingId | string | TracingId of the sync group log. |
type | string | Type of the sync group log. Known values are: "All", "Error", "Warning", and "Success". (All, Error, Warning, Success) |
| 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. |
conflictLoggingRetentionInDays | integer | Conflict logging retention period. |
conflictResolutionPolicy | string | Conflict resolution policy of the sync group. Known values are: "HubWin" and "MemberWin". (HubWin, MemberWin) |
enableConflictLogging | boolean | If conflict logging is enabled. |
hubDatabasePassword | string | Password for the sync group hub database credential. |
hubDatabaseUserName | string | User name for the sync group hub database credential. |
interval | integer | Sync interval of the sync group. |
lastSyncTime | string (date-time) | Last sync time of the sync group. |
privateEndpointName | string | Private endpoint name of the sync group if use private link connection is enabled. |
schema | object | Sync schema of the sync group. |
sku | object | The name and capacity of the SKU. |
syncDatabaseId | string | ARM resource id of the sync database in the sync group. |
syncState | string | Sync state of the sync group. Known values are: "NotReady", "Error", "Warning", "Progressing", and "Good". (NotReady, Error, Warning, Progressing, Good) |
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". |
usePrivateLinkConnection | boolean | If use private link connection is enabled. |
| 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. |
conflictLoggingRetentionInDays | integer | Conflict logging retention period. |
conflictResolutionPolicy | string | Conflict resolution policy of the sync group. Known values are: "HubWin" and "MemberWin". (HubWin, MemberWin) |
enableConflictLogging | boolean | If conflict logging is enabled. |
hubDatabasePassword | string | Password for the sync group hub database credential. |
hubDatabaseUserName | string | User name for the sync group hub database credential. |
interval | integer | Sync interval of the sync group. |
lastSyncTime | string (date-time) | Last sync time of the sync group. |
privateEndpointName | string | Private endpoint name of the sync group if use private link connection is enabled. |
schema | object | Sync schema of the sync group. |
sku | object | The name and capacity of the SKU. |
syncDatabaseId | string | ARM resource id of the sync database in the sync group. |
syncState | string | Sync state of the sync group. Known values are: "NotReady", "Error", "Warning", "Progressing", and "Good". (NotReady, Error, Warning, Progressing, Good) |
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". |
usePrivateLinkConnection | boolean | If use private link connection is enabled. |
| Name | Datatype | Description |
|---|---|---|
id | string | ARM resource id of sync database. |
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. |
endTime | string | Get logs generated before this time. Required. |
location_name | string | The name of the region where the resource is located. 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. |
startTime | string | Get logs generated after this time. Required. |
subscription_id | string | |
sync_group_name | string | The name of the sync group. Required. |
type | string | The types of logs to retrieve. Known values are: "All", "Error", "Warning", and "Success". Required. |
continuationToken | string | The continuation token for this operation. Default value is None. |
SELECT examples
- list_logs
- get
- list_by_database
- list_sync_database_ids
Gets a collection of sync group logs.
SELECT
details,
operationStatus,
source,
timestamp,
tracingId,
type
FROM azure.sql.sync_groups
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND server_name = '{{ server_name }}' -- required
AND database_name = '{{ database_name }}' -- required
AND sync_group_name = '{{ sync_group_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
AND startTime = '{{ startTime }}' -- required
AND endTime = '{{ endTime }}' -- required
AND type = '{{ type }}' -- required
AND continuationToken = '{{ continuationToken }}'
;
Gets a sync group.
SELECT
id,
name,
conflictLoggingRetentionInDays,
conflictResolutionPolicy,
enableConflictLogging,
hubDatabasePassword,
hubDatabaseUserName,
interval,
lastSyncTime,
privateEndpointName,
schema,
sku,
syncDatabaseId,
syncState,
systemData,
type,
usePrivateLinkConnection
FROM azure.sql.sync_groups
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND server_name = '{{ server_name }}' -- required
AND database_name = '{{ database_name }}' -- required
AND sync_group_name = '{{ sync_group_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
Lists sync groups under a hub database.
SELECT
id,
name,
conflictLoggingRetentionInDays,
conflictResolutionPolicy,
enableConflictLogging,
hubDatabasePassword,
hubDatabaseUserName,
interval,
lastSyncTime,
privateEndpointName,
schema,
sku,
syncDatabaseId,
syncState,
systemData,
type,
usePrivateLinkConnection
FROM azure.sql.sync_groups
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 collection of sync database ids.
SELECT
id
FROM azure.sql.sync_groups
WHERE location_name = '{{ location_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
INSERT examples
- create_or_update
- Manifest
Creates or updates a sync group.
INSERT INTO azure.sql.sync_groups (
properties,
sku,
resource_group_name,
server_name,
database_name,
sync_group_name,
subscription_id
)
SELECT
'{{ properties }}',
'{{ sku }}',
'{{ resource_group_name }}',
'{{ server_name }}',
'{{ database_name }}',
'{{ sync_group_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
properties,
sku,
systemData,
type
;
# Description fields are for documentation purposes
- name: sync_groups
props:
- name: resource_group_name
value: "{{ resource_group_name }}"
description: Required parameter for the sync_groups resource.
- name: server_name
value: "{{ server_name }}"
description: Required parameter for the sync_groups resource.
- name: database_name
value: "{{ database_name }}"
description: Required parameter for the sync_groups resource.
- name: sync_group_name
value: "{{ sync_group_name }}"
description: Required parameter for the sync_groups resource.
- name: subscription_id
value: "{{ subscription_id }}"
description: Required parameter for the sync_groups resource.
- name: properties
description: |
Resource properties.
value:
interval: {{ interval }}
lastSyncTime: "{{ lastSyncTime }}"
conflictResolutionPolicy: "{{ conflictResolutionPolicy }}"
syncDatabaseId: "{{ syncDatabaseId }}"
hubDatabaseUserName: "{{ hubDatabaseUserName }}"
hubDatabasePassword: "{{ hubDatabasePassword }}"
syncState: "{{ syncState }}"
schema:
tables:
- columns: "{{ columns }}"
quotedName: "{{ quotedName }}"
masterSyncMemberName: "{{ masterSyncMemberName }}"
enableConflictLogging: {{ enableConflictLogging }}
conflictLoggingRetentionInDays: {{ conflictLoggingRetentionInDays }}
usePrivateLinkConnection: {{ usePrivateLinkConnection }}
privateEndpointName: "{{ privateEndpointName }}"
- name: sku
description: |
The name and capacity of the SKU.
value:
name: "{{ name }}"
tier: "{{ tier }}"
size: "{{ size }}"
family: "{{ family }}"
capacity: {{ capacity }}
UPDATE examples
- update
Updates a sync group.
UPDATE azure.sql.sync_groups
SET
properties = '{{ properties }}',
sku = '{{ sku }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND server_name = '{{ server_name }}' --required
AND database_name = '{{ database_name }}' --required
AND sync_group_name = '{{ sync_group_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
properties,
sku,
systemData,
type;
REPLACE examples
- create_or_update
Creates or updates a sync group.
REPLACE azure.sql.sync_groups
SET
properties = '{{ properties }}',
sku = '{{ sku }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND server_name = '{{ server_name }}' --required
AND database_name = '{{ database_name }}' --required
AND sync_group_name = '{{ sync_group_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
properties,
sku,
systemData,
type;
DELETE examples
- delete
Deletes a sync group.
DELETE FROM azure.sql.sync_groups
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND server_name = '{{ server_name }}' --required
AND database_name = '{{ database_name }}' --required
AND sync_group_name = '{{ sync_group_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;
Lifecycle Methods
- list_hub_schemas
- cancel_sync
- refresh_hub_schema
- trigger_sync
Gets a collection of hub database schemas.
EXEC azure.sql.sync_groups.list_hub_schemas
@resource_group_name='{{ resource_group_name }}' --required,
@server_name='{{ server_name }}' --required,
@database_name='{{ database_name }}' --required,
@sync_group_name='{{ sync_group_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;
Cancels a sync group synchronization.
EXEC azure.sql.sync_groups.cancel_sync
@resource_group_name='{{ resource_group_name }}' --required,
@server_name='{{ server_name }}' --required,
@database_name='{{ database_name }}' --required,
@sync_group_name='{{ sync_group_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;
Refreshes a hub database schema.
EXEC azure.sql.sync_groups.refresh_hub_schema
@resource_group_name='{{ resource_group_name }}' --required,
@server_name='{{ server_name }}' --required,
@database_name='{{ database_name }}' --required,
@sync_group_name='{{ sync_group_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;
Triggers a sync group synchronization.
EXEC azure.sql.sync_groups.trigger_sync
@resource_group_name='{{ resource_group_name }}' --required,
@server_name='{{ server_name }}' --required,
@database_name='{{ database_name }}' --required,
@sync_group_name='{{ sync_group_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;