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:

NameDatatypeDescription
idstringFully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
namestringThe name of the resource.
allocationPercentageintegerThe percentage of cache space allocated for this storage target.
blobNfsobjectProperties when targetType is blobNfs.
clfsobjectProperties when targetType is clfs.
junctionsarrayList of cache namespace junctions to target for namespace associations.
locationstringRegion name string.
nfs3objectProperties when targetType is nfs3.
provisioningStatestringARM provisioning state, see https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/Addendum.md#provisioningstate-property _. Known values are: "Succeeded", "Failed", "Canceled", "Creating", "Deleting", and "Updating". (Succeeded, Failed, Canceled, Creating, Deleting, Updating)
statestringStorage target operational state. Known values are: "Ready", "Busy", "Suspended", and "Flushing". (Ready, Busy, Suspended, Flushing)
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
targetTypestringType of the Storage Target. Required. Known values are: "nfs3", "clfs", "unknown", and "blobNfs". (nfs3, clfs, unknown, blobNfs)
typestringThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts".
unknownobjectProperties when targetType is unknown.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresource_group_name, cache_name, storage_target_name, subscription_idReturns a Storage Target from a cache.
list_by_cacheselectresource_group_name, cache_name, subscription_idReturns a list of Storage Targets for the specified cache.
create_or_updateinsertresource_group_name, cache_name, storage_target_name, subscription_idCreate 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.
create_or_updatereplaceresource_group_name, cache_name, storage_target_name, subscription_idCreate 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.
deletedeleteresource_group_name, cache_name, storage_target_name, subscription_idforceRemoves 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_refreshexecresource_group_name, cache_name, storage_target_name, subscription_idTells a storage target to refresh its DNS information.
restore_defaultsexecresource_group_name, cache_name, storage_target_name, subscription_idTells 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
cache_namestringName of cache. Length of name must not be greater than 80 and chars must be from the [-0-9a-zA-Z_] char class. Required.
resource_group_namestringThe name of the resource group. The name is case insensitive. Required.
storage_target_namestringName of Storage Target. Required.
subscription_idstring
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. Default value is None.

SELECT examples

Returns a Storage Target from a cache.

SELECT
id,
name,
allocationPercentage,
blobNfs,
clfs,
junctions,
location,
nfs3,
provisioningState,
state,
systemData,
targetType,
type,
unknown
FROM azure.storage_cache.storage_targets
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND cache_name = '{{ cache_name }}' -- required
AND storage_target_name = '{{ storage_target_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- 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 (
properties,
resource_group_name,
cache_name,
storage_target_name,
subscription_id
)
SELECT
'{{ properties }}',
'{{ resource_group_name }}',
'{{ cache_name }}',
'{{ storage_target_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
location,
properties,
systemData,
type
;

REPLACE 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.

REPLACE azure.storage_cache.storage_targets
SET
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND cache_name = '{{ cache_name }}' --required
AND storage_target_name = '{{ storage_target_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
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 resource_group_name = '{{ resource_group_name }}' --required
AND cache_name = '{{ cache_name }}' --required
AND storage_target_name = '{{ storage_target_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
AND force = '{{ force }}'
;

Lifecycle Methods

Tells a storage target to refresh its DNS information.

EXEC azure.storage_cache.storage_targets.dns_refresh 
@resource_group_name='{{ resource_group_name }}' --required,
@cache_name='{{ cache_name }}' --required,
@storage_target_name='{{ storage_target_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;