Skip to main content

storage_targets

Creates, updates, deletes, gets or lists a storage_targets resource.

Overview

Namestorage_targets
TypeResource
Idazure.storage_cache.storage_targets

Fields

The following fields are returned by SELECT queries:

Returns the Storage Target object corresponding to storageTargetName.

NameDatatypeDescription
idstringResource ID of the Storage Target.
namestringName of the Storage Target. (pattern: ^[-0-9a-zA-Z_]{1,80}$)
locationstringRegion name string.
propertiesobjectStorageTarget properties
systemDataobjectThe system meta data relating to this resource.
typestringType of the Storage Target; Microsoft.StorageCache/Cache/StorageTarget

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresourceGroupName, subscriptionId, cacheName, storageTargetNameReturns a Storage Target from a cache.
list_by_cacheselectresourceGroupName, subscriptionId, cacheNameReturns a list of Storage Targets for the specified cache.
create_or_updateinsertresourceGroupName, subscriptionId, cacheName, storageTargetNameCreate 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.
deletedeleteresourceGroupName, subscriptionId, cacheName, storageTargetNameforceRemoves 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_refreshexecresourceGroupName, subscriptionId, cacheName, storageTargetNameTells a storage target to refresh its DNS information.
flushexecresourceGroupName, subscriptionId, cacheName, storageTargetNameTells 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.
suspendexecresourceGroupName, subscriptionId, cacheName, storageTargetNameSuspends client access to a storage target.
resumeexecresourceGroupName, subscriptionId, cacheName, storageTargetNameResumes client access to a previously suspended storage target.
invalidateexecresourceGroupName, subscriptionId, cacheName, storageTargetNameInvalidate all cached data for a storage target. Cached files are discarded and fetched from the back end on the next request.
restore_defaultsexecresourceGroupName, subscriptionId, cacheName, storageTargetNameTells 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.

NameDatatypeDescription
cacheNamestringName of cache. Length of name must not be greater than 80 and chars must be from the [-0-9a-zA-Z_] char class.
resourceGroupNamestringThe name of the resource group. The name is case insensitive.
storageTargetNamestringName of Storage Target.
subscriptionIdstring (uuid)The ID of the target subscription. The value must be an UUID.
forcestringBoolean 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

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
;

INSERT examples

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
;

DELETE examples

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

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
;