resources
Creates, updates, deletes, gets or lists a resources
resource.
Overview
Name | resources |
Type | Resource |
Id | azure.resources.resources |
Fields
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 |
identity | object | Identity for the resource. |
kind | string | The kind of the resource. |
managedBy | string | ID of the resource that manages this resource. |
plan | object | Plan for the resource. |
properties | object | The resource properties. |
sku | object | The resource model definition representing SKU |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | api-version, parentResourcePath, resourceGroupName, resourceName, resourceProviderNamespace, resourceType, subscriptionId | Gets a resource. |
get_by_id | SELECT | api-version, resourceId | Gets a resource by ID. |
list | SELECT | subscriptionId | Get all the resources in a subscription. |
list_by_resource_group | SELECT | resourceGroupName, subscriptionId | Get all the resources for a resource group. |
create_or_update | INSERT | api-version, parentResourcePath, resourceGroupName, resourceName, resourceProviderNamespace, resourceType, subscriptionId | Creates a resource. |
create_or_update_by_id | INSERT | api-version, resourceId | Create a resource by ID. |
delete | DELETE | api-version, parentResourcePath, resourceGroupName, resourceName, resourceProviderNamespace, resourceType, subscriptionId | Deletes a resource. |
delete_by_id | DELETE | api-version, resourceId | Deletes a resource by ID. |
update | UPDATE | api-version, parentResourcePath, resourceGroupName, resourceName, resourceProviderNamespace, resourceType, subscriptionId | Updates a resource. |
move_resources | EXEC | sourceResourceGroupName, subscriptionId | The resources to be moved must be in the same source resource group in the source subscription being used. The target resource group may be in a different subscription. When moving resources, both the source group and the target group are locked for the duration of the operation. Write and delete operations are blocked on the groups until the move completes. |
update_by_id | EXEC | api-version, resourceId | Updates a resource by ID. |
validate_move_resources | EXEC | sourceResourceGroupName, subscriptionId | This operation checks whether the specified resources can be moved to the target. The resources to be moved must be in the same source resource group in the source subscription being used. The target resource group may be in a different subscription. If validation succeeds, it returns HTTP response code 204 (no content). If validation fails, it returns HTTP response code 409 (Conflict) with an error message. Retrieve the URL in the Location header value to check the result of the long-running operation. |
SELECT
examples
Get all the resources in a subscription.
SELECT
id,
name,
identity,
kind,
managedBy,
plan,
properties,
sku,
type
FROM azure.resources.resources
WHERE subscriptionId = '{{ subscriptionId }}';
INSERT
example
Use the following StackQL query and manifest file to create a new resources
resource.
- All Properties
- Manifest
/*+ create */
INSERT INTO azure.resources.resources (
api-version,
resourceId,
plan,
properties,
kind,
managedBy,
sku,
identity
)
SELECT
'{{ api-version }}',
'{{ resourceId }}',
'{{ plan }}',
'{{ properties }}',
'{{ kind }}',
'{{ managedBy }}',
'{{ sku }}',
'{{ identity }}'
;
- name: your_resource_model_name
props:
- name: plan
value:
- name: name
value: string
- name: publisher
value: string
- name: product
value: string
- name: promotionCode
value: string
- name: version
value: string
- name: properties
value: object
- name: kind
value: string
- name: managedBy
value: string
- name: sku
value:
- name: name
value: string
- name: tier
value: string
- name: size
value: string
- name: family
value: string
- name: capacity
value: integer
- name: identity
value:
- name: principalId
value: string
- name: tenantId
value: string
- name: type
value: string
- name: id
value: string
- name: name
value: string
- name: type
value: string
UPDATE
example
Updates a resources
resource.
/*+ update */
UPDATE azure.resources.resources
SET
plan = '{{ plan }}',
properties = '{{ properties }}',
kind = '{{ kind }}',
managedBy = '{{ managedBy }}',
sku = '{{ sku }}',
identity = '{{ identity }}'
WHERE
api-version = '{{ api-version }}'
AND parentResourcePath = '{{ parentResourcePath }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND resourceName = '{{ resourceName }}'
AND resourceProviderNamespace = '{{ resourceProviderNamespace }}'
AND resourceType = '{{ resourceType }}'
AND subscriptionId = '{{ subscriptionId }}';
DELETE
example
Deletes the specified resources
resource.
/*+ delete */
DELETE FROM azure.resources.resources
WHERE api-version = '{{ api-version }}'
AND resourceId = '{{ resourceId }}';