resource_links
Creates, updates, deletes, gets or lists a resource_links resource.
Overview
| Name | resource_links |
| Type | Resource |
| Id | azure.resource.resource_links |
Fields
The following fields are returned by SELECT queries:
- get
- list_at_subscription
- list_at_source_scope
| Name | Datatype | Description |
|---|---|---|
id | string | The fully qualified ID of the resource link. |
name | string | The name of the resource link. |
notes | string | Notes about the resource link. |
sourceId | string | The fully qualified ID of the source resource in the link. |
targetId | string | The fully qualified ID of the target resource in the link. Required. |
type | object | The resource link object. |
| Name | Datatype | Description |
|---|---|---|
id | string | The fully qualified ID of the resource link. |
name | string | The name of the resource link. |
notes | string | Notes about the resource link. |
sourceId | string | The fully qualified ID of the source resource in the link. |
targetId | string | The fully qualified ID of the target resource in the link. Required. |
type | object | The resource link object. |
| Name | Datatype | Description |
|---|---|---|
id | string | The fully qualified ID of the resource link. |
name | string | The name of the resource link. |
notes | string | Notes about the resource link. |
sourceId | string | The fully qualified ID of the source resource in the link. |
targetId | string | The fully qualified ID of the target resource in the link. Required. |
type | object | The resource link object. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | link_id | Gets a resource link with the specified ID. | |
list_at_subscription | select | subscription_id | $filter | Gets all the linked resources for the subscription. |
list_at_source_scope | select | scope | $filter | Gets a list of resource links at and below the specified source scope. |
create_or_update | insert | link_id | Creates or updates a resource link between the specified resources. | |
create_or_update | replace | link_id | Creates or updates a resource link between the specified resources. | |
delete | delete | link_id | Deletes a resource link with the specified 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 |
|---|---|---|
link_id | string | The fully qualified ID of the resource link. Use the format, /subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/{provider-namespace}/{resource-type}/{resource-name}/Microsoft.Resources/links/{link-name}. For example, /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myGroup/Microsoft.Web/sites/mySite/Microsoft.Resources/links/myLink. Required. |
scope | string | The fully qualified ID of the scope for getting the resource links. For example, to list resource links at and under a resource group, set the scope to /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myGroup. Required. |
subscription_id | string | |
$filter | string | The filter to apply when getting resource links. To get links only at the specified scope (not below the scope), use Filter.atScope(). Known values are "atScope()" and None. Default value is "atScope()". |
SELECT examples
- get
- list_at_subscription
- list_at_source_scope
Gets a resource link with the specified ID.
SELECT
id,
name,
notes,
sourceId,
targetId,
type
FROM azure.resource.resource_links
WHERE link_id = '{{ link_id }}' -- required
;
Gets all the linked resources for the subscription.
SELECT
id,
name,
notes,
sourceId,
targetId,
type
FROM azure.resource.resource_links
WHERE subscription_id = '{{ subscription_id }}' -- required
AND $filter = '{{ $filter }}'
;
Gets a list of resource links at and below the specified source scope.
SELECT
id,
name,
notes,
sourceId,
targetId,
type
FROM azure.resource.resource_links
WHERE scope = '{{ scope }}' -- required
AND $filter = '{{ $filter }}'
;
INSERT examples
- create_or_update
- Manifest
Creates or updates a resource link between the specified resources.
INSERT INTO azure.resource.resource_links (
properties,
link_id
)
SELECT
'{{ properties }}',
'{{ link_id }}'
RETURNING
id,
name,
properties,
type
;
# Description fields are for documentation purposes
- name: resource_links
props:
- name: link_id
value: "{{ link_id }}"
description: Required parameter for the resource_links resource.
- name: properties
description: |
Properties for resource link.
value:
sourceId: "{{ sourceId }}"
targetId: "{{ targetId }}"
notes: "{{ notes }}"
REPLACE examples
- create_or_update
Creates or updates a resource link between the specified resources.
REPLACE azure.resource.resource_links
SET
properties = '{{ properties }}'
WHERE
link_id = '{{ link_id }}' --required
RETURNING
id,
name,
properties,
type;
DELETE examples
- delete
Deletes a resource link with the specified ID.
DELETE FROM azure.resource.resource_links
WHERE link_id = '{{ link_id }}' --required
;