cache_rules
Creates, updates, deletes, gets or lists a cache_rules resource.
Overview
| Name | cache_rules |
| Type | Resource |
| Id | azure.container_registry.cache_rules |
Fields
The following fields are returned by SELECT queries:
- get
- list
| 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 private link resource. |
creationDate | string (date-time) | The creation date of the cache rule. |
credentialSetResourceId | string | The ARM resource ID of the credential store which is associated with the cache rule. |
identity | object | The identity of the cache rule. |
provisioningState | string | Provisioning state of the resource. Known values are: "Creating", "Updating", "Deleting", "Succeeded", "Failed", and "Canceled". (Creating, Updating, Deleting, Succeeded, Failed, Canceled) |
sourceRepository | string | Source repository pulled from upstream. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
targetRepository | string | Target repository specified in docker pull command. Eg: docker pull myregistry.azurecr.io/{targetRepository}:{tag}. |
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 private link resource. |
creationDate | string (date-time) | The creation date of the cache rule. |
credentialSetResourceId | string | The ARM resource ID of the credential store which is associated with the cache rule. |
identity | object | The identity of the cache rule. |
provisioningState | string | Provisioning state of the resource. Known values are: "Creating", "Updating", "Deleting", "Succeeded", "Failed", and "Canceled". (Creating, Updating, Deleting, Succeeded, Failed, Canceled) |
sourceRepository | string | Source repository pulled from upstream. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
targetRepository | string | Target repository specified in docker pull command. Eg: docker pull myregistry.azurecr.io/{targetRepository}:{tag}. |
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, registry_name, cache_rule_name, subscription_id | Gets the properties of the specified cache rule resource. | |
list | select | resource_group_name, registry_name, subscription_id | Lists all cache rule resources for the specified container registry. | |
create | insert | resource_group_name, registry_name, cache_rule_name, subscription_id | Creates a cache rule for a container registry with the specified parameters. | |
update | update | resource_group_name, registry_name, cache_rule_name, subscription_id | Updates a cache rule for a container registry with the specified parameters. | |
delete | delete | resource_group_name, registry_name, cache_rule_name, subscription_id | Deletes a cache rule resource from a container registry. |
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 |
|---|---|---|
cache_rule_name | string | The name of the cache rule. Required. |
registry_name | string | The name of the container registry. Required. |
resource_group_name | string | The name of the resource group. The name is case insensitive. Required. |
subscription_id | string |
SELECT examples
- get
- list
Gets the properties of the specified cache rule resource.
SELECT
id,
name,
creationDate,
credentialSetResourceId,
identity,
provisioningState,
sourceRepository,
systemData,
targetRepository,
type
FROM azure.container_registry.cache_rules
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND registry_name = '{{ registry_name }}' -- required
AND cache_rule_name = '{{ cache_rule_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
Lists all cache rule resources for the specified container registry.
SELECT
id,
name,
creationDate,
credentialSetResourceId,
identity,
provisioningState,
sourceRepository,
systemData,
targetRepository,
type
FROM azure.container_registry.cache_rules
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND registry_name = '{{ registry_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
INSERT examples
- create
- Manifest
Creates a cache rule for a container registry with the specified parameters.
INSERT INTO azure.container_registry.cache_rules (
properties,
identity,
resource_group_name,
registry_name,
cache_rule_name,
subscription_id
)
SELECT
'{{ properties }}',
'{{ identity }}',
'{{ resource_group_name }}',
'{{ registry_name }}',
'{{ cache_rule_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
identity,
properties,
systemData,
type
;
# Description fields are for documentation purposes
- name: cache_rules
props:
- name: resource_group_name
value: "{{ resource_group_name }}"
description: Required parameter for the cache_rules resource.
- name: registry_name
value: "{{ registry_name }}"
description: Required parameter for the cache_rules resource.
- name: cache_rule_name
value: "{{ cache_rule_name }}"
description: Required parameter for the cache_rules resource.
- name: subscription_id
value: "{{ subscription_id }}"
description: Required parameter for the cache_rules resource.
- name: properties
description: |
The properties of the cache rule.
value:
credentialSetResourceId: "{{ credentialSetResourceId }}"
sourceRepository: "{{ sourceRepository }}"
targetRepository: "{{ targetRepository }}"
creationDate: "{{ creationDate }}"
provisioningState: "{{ provisioningState }}"
- name: identity
description: |
The identity of the cache rule.
value:
principalId: "{{ principalId }}"
tenantId: "{{ tenantId }}"
type: "{{ type }}"
userAssignedIdentities: "{{ userAssignedIdentities }}"
UPDATE examples
- update
Updates a cache rule for a container registry with the specified parameters.
UPDATE azure.container_registry.cache_rules
SET
properties = '{{ properties }}',
identity = '{{ identity }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND registry_name = '{{ registry_name }}' --required
AND cache_rule_name = '{{ cache_rule_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
identity,
properties,
systemData,
type;
DELETE examples
- delete
Deletes a cache rule resource from a container registry.
DELETE FROM azure.container_registry.cache_rules
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND registry_name = '{{ registry_name }}' --required
AND cache_rule_name = '{{ cache_rule_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;