sync_agents
Creates, updates, deletes, gets or lists a sync_agents
resource.
Overview
Name | sync_agents |
Type | Resource |
Id | azure.sql.sync_agents |
Fields
- vw_sync_agents
- sync_agents
Name | Datatype | Description |
---|---|---|
name | text | field from the properties object |
expiry_time | text | field from the properties object |
is_up_to_date | text | field from the properties object |
last_alive_time | text | field from the properties object |
resourceGroupName | text | field from the properties object |
serverName | text | field from the properties object |
state | text | field from the properties object |
subscriptionId | text | field from the properties object |
syncAgentName | text | field from the properties object |
sync_database_id | text | field from the properties object |
version | text | field from the properties object |
Name | Datatype | Description |
---|---|---|
properties | object | Properties of an Azure SQL Database sync agent. |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | resourceGroupName, serverName, subscriptionId, syncAgentName | Gets a sync agent. |
list_by_server | SELECT | resourceGroupName, serverName, subscriptionId | Lists sync agents in a server. |
create_or_update | INSERT | resourceGroupName, serverName, subscriptionId, syncAgentName | Creates or updates a sync agent. |
delete | DELETE | resourceGroupName, serverName, subscriptionId, syncAgentName | Deletes a sync agent. |
generate_key | EXEC | resourceGroupName, serverName, subscriptionId, syncAgentName | Generates a sync agent key. |
SELECT
examples
Lists sync agents in a server.
- vw_sync_agents
- sync_agents
SELECT
name,
expiry_time,
is_up_to_date,
last_alive_time,
resourceGroupName,
serverName,
state,
subscriptionId,
syncAgentName,
sync_database_id,
version
FROM azure.sql.vw_sync_agents
WHERE resourceGroupName = '{{ resourceGroupName }}'
AND serverName = '{{ serverName }}'
AND subscriptionId = '{{ subscriptionId }}';
SELECT
properties
FROM azure.sql.sync_agents
WHERE resourceGroupName = '{{ resourceGroupName }}'
AND serverName = '{{ serverName }}'
AND subscriptionId = '{{ subscriptionId }}';
INSERT
example
Use the following StackQL query and manifest file to create a new sync_agents
resource.
- All Properties
- Manifest
/*+ create */
INSERT INTO azure.sql.sync_agents (
resourceGroupName,
serverName,
subscriptionId,
syncAgentName,
properties
)
SELECT
'{{ resourceGroupName }}',
'{{ serverName }}',
'{{ subscriptionId }}',
'{{ syncAgentName }}',
'{{ properties }}'
;
- name: your_resource_model_name
props:
- name: properties
value:
- name: name
value: string
- name: syncDatabaseId
value: string
- name: lastAliveTime
value: string
- name: state
value: string
- name: isUpToDate
value: boolean
- name: expiryTime
value: string
- name: version
value: string
DELETE
example
Deletes the specified sync_agents
resource.
/*+ delete */
DELETE FROM azure.sql.sync_agents
WHERE resourceGroupName = '{{ resourceGroupName }}'
AND serverName = '{{ serverName }}'
AND subscriptionId = '{{ subscriptionId }}'
AND syncAgentName = '{{ syncAgentName }}';