resource_sync_rules
Creates, updates, deletes, gets or lists a resource_sync_rules
resource.
Overview
Name | resource_sync_rules |
Type | Resource |
Id | azure.custom_locations.resource_sync_rules |
Fields
- vw_resource_sync_rules
- resource_sync_rules
Name | Datatype | Description |
---|---|---|
childResourceName | text | field from the properties object |
location | text | The geo-location where the resource lives |
priority | text | field from the properties object |
provisioning_state | text | field from the properties object |
resourceGroupName | text | field from the properties object |
resourceName | text | field from the properties object |
selector | text | field from the properties object |
subscriptionId | text | field from the properties object |
system_data | text | field from the properties object |
tags | text | Resource tags. |
target_resource_group | text | field from the properties object |
Name | Datatype | Description |
---|---|---|
location | string | The geo-location where the resource lives |
properties | object | Properties for a resource sync rule. For an unmapped custom resource, its labels will be used to find out matching resource sync rules using the selector property of the resource sync rule. If this resource sync rule has highest priority among all matching rules, then the unmapped custom resource will be projected to the target resource group associated with this resource sync rule. |
systemData | object | Metadata pertaining to creation and last modification of the resource. |
tags | object | Resource tags. |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | childResourceName, resourceGroupName, resourceName, subscriptionId | 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 | resourceGroupName, resourceName, subscriptionId | Gets a list of Resource Sync Rules in the specified subscription. The operation returns properties of each Resource Sync Rule |
create_or_update | INSERT | childResourceName, resourceGroupName, resourceName, subscriptionId | Creates or updates a Resource Sync Rule in the parent Custom Location, Subscription Id and Resource Group |
delete | DELETE | childResourceName, resourceGroupName, resourceName, subscriptionId | Deletes the Resource Sync Rule with the specified Resource Sync Rule Name, Custom Location Resource Name, Resource Group, and Subscription Id. |
update | UPDATE | childResourceName, resourceGroupName, resourceName, subscriptionId | Updates a Resource Sync Rule with the specified Resource Sync Rule name in the specified Resource Group, Subscription and Custom Location name. |
SELECT
examples
Gets a list of Resource Sync Rules in the specified subscription. The operation returns properties of each Resource Sync Rule
- vw_resource_sync_rules
- resource_sync_rules
SELECT
childResourceName,
location,
priority,
provisioning_state,
resourceGroupName,
resourceName,
selector,
subscriptionId,
system_data,
tags,
target_resource_group
FROM azure.custom_locations.vw_resource_sync_rules
WHERE resourceGroupName = '{{ resourceGroupName }}'
AND resourceName = '{{ resourceName }}'
AND subscriptionId = '{{ subscriptionId }}';
SELECT
location,
properties,
systemData,
tags
FROM azure.custom_locations.resource_sync_rules
WHERE resourceGroupName = '{{ resourceGroupName }}'
AND resourceName = '{{ resourceName }}'
AND subscriptionId = '{{ subscriptionId }}';
INSERT
example
Use the following StackQL query and manifest file to create a new resource_sync_rules
resource.
- All Properties
- Manifest
/*+ create */
INSERT INTO azure.custom_locations.resource_sync_rules (
childResourceName,
resourceGroupName,
resourceName,
subscriptionId,
properties,
tags,
location
)
SELECT
'{{ childResourceName }}',
'{{ resourceGroupName }}',
'{{ resourceName }}',
'{{ subscriptionId }}',
'{{ properties }}',
'{{ tags }}',
'{{ location }}'
;
- name: your_resource_model_name
props:
- name: properties
value:
- name: priority
value: integer
- name: provisioningState
value: string
- name: selector
value:
- name: matchExpressions
value: []
- name: matchLabels
value: object
- name: targetResourceGroup
value: string
- name: systemData
value:
- name: createdBy
value: string
- name: createdByType
value: string
- name: createdAt
value: string
- name: lastModifiedBy
value: string
- name: lastModifiedByType
value: string
- name: lastModifiedAt
value: string
- name: tags
value: object
- name: location
value: string
UPDATE
example
Updates a resource_sync_rules
resource.
/*+ update */
UPDATE azure.custom_locations.resource_sync_rules
SET
properties = '{{ properties }}',
tags = '{{ tags }}'
WHERE
childResourceName = '{{ childResourceName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND resourceName = '{{ resourceName }}'
AND subscriptionId = '{{ subscriptionId }}';
DELETE
example
Deletes the specified resource_sync_rules
resource.
/*+ delete */
DELETE FROM azure.custom_locations.resource_sync_rules
WHERE childResourceName = '{{ childResourceName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND resourceName = '{{ resourceName }}'
AND subscriptionId = '{{ subscriptionId }}';