resource_sync_rules
Creates, updates, deletes, gets or lists a resource_sync_rules resource.
Overview
| Name | resource_sync_rules |
| Type | Resource |
| Id | azure.extended_location.resource_sync_rules |
Fields
The following fields are returned by SELECT queries:
- get
- list_by_custom_location_id
| 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. |
location | string | The geo-location where the resource lives. Required. |
priority | integer | Priority represents a priority of the Resource Sync Rule. |
provisioningState | string | Provisioning State for the Resource Sync Rule. |
selector | object | A label selector is composed of two parts, matchLabels and matchExpressions. The first part, matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is 'key', the operator is 'In', and the values array contains only 'value'. The second part, matchExpressions is a list of resource selector requirements. Valid operators include In, NotIn, Exists, and DoesNotExist. The values set must be non-empty in the case of In and NotIn. The values set must be empty in the case of Exists and DoesNotExist. All of the requirements, from both matchLabels and matchExpressions must all be satisfied in order to match. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
tags | object | Resource tags. |
targetResourceGroup | string | For an unmapped custom resource, its labels will be used to find matching resource sync rules. If this resource sync rule is one of the matching rules with highest priority, then the unmapped custom resource will be projected to the target resource group associated with this resource sync rule. The user creating this resource sync rule should have write permissions on the target resource group and this write permission will be validated when creating the resource sync rule. |
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. |
location | string | The geo-location where the resource lives. Required. |
priority | integer | Priority represents a priority of the Resource Sync Rule. |
provisioningState | string | Provisioning State for the Resource Sync Rule. |
selector | object | A label selector is composed of two parts, matchLabels and matchExpressions. The first part, matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is 'key', the operator is 'In', and the values array contains only 'value'. The second part, matchExpressions is a list of resource selector requirements. Valid operators include In, NotIn, Exists, and DoesNotExist. The values set must be non-empty in the case of In and NotIn. The values set must be empty in the case of Exists and DoesNotExist. All of the requirements, from both matchLabels and matchExpressions must all be satisfied in order to match. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
tags | object | Resource tags. |
targetResourceGroup | string | For an unmapped custom resource, its labels will be used to find matching resource sync rules. If this resource sync rule is one of the matching rules with highest priority, then the unmapped custom resource will be projected to the target resource group associated with this resource sync rule. The user creating this resource sync rule should have write permissions on the target resource group and this write permission will be validated when creating the resource sync rule. |
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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | resource_group_name, resource_name, child_resource_name, subscription_id | Gets a Resource Sync Rule. Gets the details of the resourceSyncRule with a specified resource group, subscription id Custom Location resource name and Resource Sync Rule name. | |
list_by_custom_location_id | select | resource_group_name, resource_name, subscription_id | Lists all Resource Sync Rules in a Custom Location. Gets a list of Resource Sync Rules in the specified subscription. The operation returns properties of each Resource Sync Rule. | |
create_or_update | insert | resource_group_name, resource_name, child_resource_name, subscription_id, location | Creates or updates a Resource Sync Rule. Creates or updates a Resource Sync Rule in the parent Custom Location, Subscription Id and Resource Group. | |
update | update | resource_group_name, resource_name, child_resource_name, subscription_id | Updates a Resource Sync Rule. Updates a Resource Sync Rule with the specified Resource Sync Rule name in the specified Resource Group, Subscription and Custom Location name. | |
create_or_update | replace | resource_group_name, resource_name, child_resource_name, subscription_id, location | Creates or updates a Resource Sync Rule. Creates or updates a Resource Sync Rule in the parent Custom Location, Subscription Id and Resource Group. | |
delete | delete | resource_group_name, resource_name, child_resource_name, subscription_id | Deletes a Resource Sync Rule. Deletes the Resource Sync Rule with the specified Resource Sync Rule Name, Custom Location Resource Name, Resource Group, and Subscription Id. |
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 |
|---|---|---|
child_resource_name | string | Resource Sync Rule name. Required. |
resource_group_name | string | The name of the resource group. The name is case insensitive. Required. |
resource_name | string | Custom Locations name. Required. |
subscription_id | string |
SELECT examples
- get
- list_by_custom_location_id
Gets a Resource Sync Rule. Gets the details of the resourceSyncRule with a specified resource group, subscription id Custom Location resource name and Resource Sync Rule name.
SELECT
id,
name,
location,
priority,
provisioningState,
selector,
systemData,
tags,
targetResourceGroup,
type
FROM azure.extended_location.resource_sync_rules
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND resource_name = '{{ resource_name }}' -- required
AND child_resource_name = '{{ child_resource_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
Lists all Resource Sync Rules in a Custom Location. Gets a list of Resource Sync Rules in the specified subscription. The operation returns properties of each Resource Sync Rule.
SELECT
id,
name,
location,
priority,
provisioningState,
selector,
systemData,
tags,
targetResourceGroup,
type
FROM azure.extended_location.resource_sync_rules
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND resource_name = '{{ resource_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
INSERT examples
- create_or_update
- Manifest
Creates or updates a Resource Sync Rule. Creates or updates a Resource Sync Rule in the parent Custom Location, Subscription Id and Resource Group.
INSERT INTO azure.extended_location.resource_sync_rules (
tags,
location,
properties,
resource_group_name,
resource_name,
child_resource_name,
subscription_id
)
SELECT
'{{ tags }}',
'{{ location }}' /* required */,
'{{ properties }}',
'{{ resource_group_name }}',
'{{ resource_name }}',
'{{ child_resource_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
location,
properties,
systemData,
tags,
type
;
# Description fields are for documentation purposes
- name: resource_sync_rules
props:
- name: resource_group_name
value: "{{ resource_group_name }}"
description: Required parameter for the resource_sync_rules resource.
- name: resource_name
value: "{{ resource_name }}"
description: Required parameter for the resource_sync_rules resource.
- name: child_resource_name
value: "{{ child_resource_name }}"
description: Required parameter for the resource_sync_rules resource.
- name: subscription_id
value: "{{ subscription_id }}"
description: Required parameter for the resource_sync_rules resource.
- name: tags
value: "{{ tags }}"
description: |
Resource tags.
- name: location
value: "{{ location }}"
description: |
The geo-location where the resource lives. Required.
- name: properties
description: |
The set of properties specific to a Resource Sync Rule.
value:
priority: {{ priority }}
provisioningState: "{{ provisioningState }}"
selector:
matchExpressions:
- key: "{{ key }}"
operator: "{{ operator }}"
values: "{{ values }}"
matchLabels: "{{ matchLabels }}"
targetResourceGroup: "{{ targetResourceGroup }}"
UPDATE examples
- update
Updates a Resource Sync Rule. Updates a Resource Sync Rule with the specified Resource Sync Rule name in the specified Resource Group, Subscription and Custom Location name.
UPDATE azure.extended_location.resource_sync_rules
SET
properties = '{{ properties }}',
tags = '{{ tags }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND resource_name = '{{ resource_name }}' --required
AND child_resource_name = '{{ child_resource_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
location,
properties,
systemData,
tags,
type;
REPLACE examples
- create_or_update
Creates or updates a Resource Sync Rule. Creates or updates a Resource Sync Rule in the parent Custom Location, Subscription Id and Resource Group.
REPLACE azure.extended_location.resource_sync_rules
SET
tags = '{{ tags }}',
location = '{{ location }}',
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND resource_name = '{{ resource_name }}' --required
AND child_resource_name = '{{ child_resource_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
AND location = '{{ location }}' --required
RETURNING
id,
name,
location,
properties,
systemData,
tags,
type;
DELETE examples
- delete
Deletes a Resource Sync Rule. Deletes the Resource Sync Rule with the specified Resource Sync Rule Name, Custom Location Resource Name, Resource Group, and Subscription Id.
DELETE FROM azure.extended_location.resource_sync_rules
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND resource_name = '{{ resource_name }}' --required
AND child_resource_name = '{{ child_resource_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;