storage_targets
Creates, updates, deletes, gets or lists a storage_targets
resource.
Overview
Name | storage_targets |
Type | Resource |
Id | azure.storage_cache.storage_targets |
Fields
The following fields are returned by SELECT
queries:
- get
- list_by_cache
Returns the Storage Target object corresponding to storageTargetName.
Name | Datatype | Description |
---|---|---|
id | string | Resource ID of the Storage Target. |
name | string | Name of the Storage Target. (pattern: ^[-0-9a-zA-Z_]{1,80}$ ) |
location | string | Region name string. |
properties | object | StorageTarget properties |
systemData | object | The system meta data relating to this resource. |
type | string | Type of the Storage Target; Microsoft.StorageCache/Cache/StorageTarget |
Returns the list of Storage Targets defined by cache name.
Name | Datatype | Description |
---|---|---|
id | string | Resource ID of the Storage Target. |
name | string | Name of the Storage Target. (pattern: ^[-0-9a-zA-Z_]{1,80}$ ) |
location | string | Region name string. |
properties | object | StorageTarget properties |
systemData | object | The system meta data relating to this resource. |
type | string | Type of the Storage Target; Microsoft.StorageCache/Cache/StorageTarget |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | resourceGroupName , subscriptionId , cacheName , storageTargetName | Returns a Storage Target from a cache. | |
list_by_cache | select | resourceGroupName , subscriptionId , cacheName | Returns a list of Storage Targets for the specified cache. | |
create_or_update | insert | resourceGroupName , subscriptionId , cacheName , storageTargetName | Create or update a Storage Target. This operation is allowed at any time, but if the cache is down or unhealthy, the actual creation/modification of the Storage Target may be delayed until the cache is healthy again. | |
delete | delete | resourceGroupName , subscriptionId , cacheName , storageTargetName | force | Removes a Storage Target from a cache. This operation is allowed at any time, but if the cache is down or unhealthy, the actual removal of the Storage Target may be delayed until the cache is healthy again. Note that if the cache has data to flush to the Storage Target, the data will be flushed before the Storage Target will be deleted. |
dns_refresh | exec | resourceGroupName , subscriptionId , cacheName , storageTargetName | Tells a storage target to refresh its DNS information. | |
flush | exec | resourceGroupName , subscriptionId , cacheName , storageTargetName | Tells the cache to write all dirty data to the Storage Target's backend storage. Client requests to this storage target's namespace will return errors until the flush operation completes. | |
suspend | exec | resourceGroupName , subscriptionId , cacheName , storageTargetName | Suspends client access to a storage target. | |
resume | exec | resourceGroupName , subscriptionId , cacheName , storageTargetName | Resumes client access to a previously suspended storage target. | |
invalidate | exec | resourceGroupName , subscriptionId , cacheName , storageTargetName | Invalidate all cached data for a storage target. Cached files are discarded and fetched from the back end on the next request. | |
restore_defaults | exec | resourceGroupName , subscriptionId , cacheName , storageTargetName | Tells a storage target to restore its settings to their default values. |
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 |
---|---|---|
cacheName | string | Name of cache. Length of name must not be greater than 80 and chars must be from the [-0-9a-zA-Z_] char class. |
resourceGroupName | string | The name of the resource group. The name is case insensitive. |
storageTargetName | string | Name of Storage Target. |
subscriptionId | string (uuid) | The ID of the target subscription. The value must be an UUID. |
force | string | Boolean value requesting the force delete operation for a storage target. Force delete discards unwritten-data in the cache instead of flushing it to back-end storage. |
SELECT
examples
- get
- list_by_cache
Returns a Storage Target from a cache.
SELECT
id,
name,
location,
properties,
systemData,
type
FROM azure.storage_cache.storage_targets
WHERE resourceGroupName = '{{ resourceGroupName }}' -- required
AND subscriptionId = '{{ subscriptionId }}' -- required
AND cacheName = '{{ cacheName }}' -- required
AND storageTargetName = '{{ storageTargetName }}' -- required
;
Returns a list of Storage Targets for the specified cache.
SELECT
id,
name,
location,
properties,
systemData,
type
FROM azure.storage_cache.storage_targets
WHERE resourceGroupName = '{{ resourceGroupName }}' -- required
AND subscriptionId = '{{ subscriptionId }}' -- required
AND cacheName = '{{ cacheName }}' -- required
;
INSERT
examples
- create_or_update
- Manifest
Create or update a Storage Target. This operation is allowed at any time, but if the cache is down or unhealthy, the actual creation/modification of the Storage Target may be delayed until the cache is healthy again.
INSERT INTO azure.storage_cache.storage_targets (
data__properties,
resourceGroupName,
subscriptionId,
cacheName,
storageTargetName
)
SELECT
'{{ properties }}',
'{{ resourceGroupName }}',
'{{ subscriptionId }}',
'{{ cacheName }}',
'{{ storageTargetName }}'
RETURNING
id,
name,
location,
properties,
systemData,
type
;
# Description fields are for documentation purposes
- name: storage_targets
props:
- name: resourceGroupName
value: string
description: Required parameter for the storage_targets resource.
- name: subscriptionId
value: string (uuid)
description: Required parameter for the storage_targets resource.
- name: cacheName
value: string
description: Required parameter for the storage_targets resource.
- name: storageTargetName
value: string
description: Required parameter for the storage_targets resource.
- name: properties
value: object
description: |
StorageTarget properties
DELETE
examples
- delete
Removes a Storage Target from a cache. This operation is allowed at any time, but if the cache is down or unhealthy, the actual removal of the Storage Target may be delayed until the cache is healthy again. Note that if the cache has data to flush to the Storage Target, the data will be flushed before the Storage Target will be deleted.
DELETE FROM azure.storage_cache.storage_targets
WHERE resourceGroupName = '{{ resourceGroupName }}' --required
AND subscriptionId = '{{ subscriptionId }}' --required
AND cacheName = '{{ cacheName }}' --required
AND storageTargetName = '{{ storageTargetName }}' --required
AND force = '{{ force }}'
;
Lifecycle Methods
- dns_refresh
- flush
- suspend
- resume
- invalidate
- restore_defaults
Tells a storage target to refresh its DNS information.
EXEC azure.storage_cache.storage_targets.dns_refresh
@resourceGroupName='{{ resourceGroupName }}' --required,
@subscriptionId='{{ subscriptionId }}' --required,
@cacheName='{{ cacheName }}' --required,
@storageTargetName='{{ storageTargetName }}' --required
;
Tells the cache to write all dirty data to the Storage Target's backend storage. Client requests to this storage target's namespace will return errors until the flush operation completes.
EXEC azure.storage_cache.storage_targets.flush
@resourceGroupName='{{ resourceGroupName }}' --required,
@subscriptionId='{{ subscriptionId }}' --required,
@cacheName='{{ cacheName }}' --required,
@storageTargetName='{{ storageTargetName }}' --required
;
Suspends client access to a storage target.
EXEC azure.storage_cache.storage_targets.suspend
@resourceGroupName='{{ resourceGroupName }}' --required,
@subscriptionId='{{ subscriptionId }}' --required,
@cacheName='{{ cacheName }}' --required,
@storageTargetName='{{ storageTargetName }}' --required
;
Resumes client access to a previously suspended storage target.
EXEC azure.storage_cache.storage_targets.resume
@resourceGroupName='{{ resourceGroupName }}' --required,
@subscriptionId='{{ subscriptionId }}' --required,
@cacheName='{{ cacheName }}' --required,
@storageTargetName='{{ storageTargetName }}' --required
;
Invalidate all cached data for a storage target. Cached files are discarded and fetched from the back end on the next request.
EXEC azure.storage_cache.storage_targets.invalidate
@resourceGroupName='{{ resourceGroupName }}' --required,
@subscriptionId='{{ subscriptionId }}' --required,
@cacheName='{{ cacheName }}' --required,
@storageTargetName='{{ storageTargetName }}' --required
;
Tells a storage target to restore its settings to their default values.
EXEC azure.storage_cache.storage_targets.restore_defaults
@resourceGroupName='{{ resourceGroupName }}' --required,
@subscriptionId='{{ subscriptionId }}' --required,
@cacheName='{{ cacheName }}' --required,
@storageTargetName='{{ storageTargetName }}' --required
;