Storage Tasks - Preview Actions

Runs the input conditions against input object metadata properties and designates matched objects in response.

POST https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.StorageActions/locations/{location}/previewActions?api-version=2023-01-01

URI Parameters

Name In Required Type Description
location
path True

string

Represents an Azure geography region where supported resource providers live.

subscriptionId
path True

string (uuid)

The ID of the target subscription. The value must be an UUID.

api-version
query True

string

minLength: 1

The API version to use for this operation.

Request Body

Name Required Type Description
properties.action True

StorageTaskPreviewActionCondition

Preview action to test

properties.blobs True

StorageTaskPreviewBlobProperties[]

Properties of some sample blobs in the container to test for matches with the preview action.

properties.container True

StorageTaskPreviewContainerProperties

Properties of a sample container to test for a match with the preview action.

Responses

Name Type Description
200 OK

StorageTaskPreviewAction

The request has succeeded.

Other Status Codes

ErrorResponse

An unexpected error response.

Security

azure_auth

Azure Active Directory OAuth2 Flow.

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation impersonate your user account

Examples

PerformStorageTaskActionsPreview

Sample request

POST https://management.azure.com/subscriptions/1f31ba14-ce16-4281-b9b4-3e78da6e1616/providers/Microsoft.StorageActions/locations/eastus/previewActions?api-version=2023-01-01

{
  "properties": {
    "action": {
      "elseBlockExists": true,
      "if": {
        "condition": "[[equals(AccessTier, 'Hot')]]"
      }
    },
    "blobs": [
      {
        "name": "folder1/file1.txt",
        "metadata": [
          {
            "key": "mKey1",
            "value": "mValue1"
          }
        ],
        "properties": [
          {
            "key": "Creation-Time",
            "value": "Wed, 07 Jun 2023 05:23:29 GMT"
          },
          {
            "key": "Last-Modified",
            "value": "Wed, 07 Jun 2023 05:23:29 GMT"
          },
          {
            "key": "Etag",
            "value": "0x8DB67175454D36D"
          },
          {
            "key": "Content-Length",
            "value": "38619"
          },
          {
            "key": "Content-Type",
            "value": "text/xml"
          },
          {
            "key": "Content-Encoding",
            "value": ""
          },
          {
            "key": "Content-Language",
            "value": ""
          },
          {
            "key": "Content-CRC64",
            "value": ""
          },
          {
            "key": "Content-MD5",
            "value": "njr6iDrmU9+FC89WMK22EA=="
          },
          {
            "key": "Cache-Control",
            "value": ""
          },
          {
            "key": "Content-Disposition",
            "value": ""
          },
          {
            "key": "BlobType",
            "value": "BlockBlob"
          },
          {
            "key": "AccessTier",
            "value": "Hot"
          },
          {
            "key": "AccessTierInferred",
            "value": "true"
          },
          {
            "key": "LeaseStatus",
            "value": "unlocked"
          },
          {
            "key": "LeaseState",
            "value": "available"
          },
          {
            "key": "ServerEncrypted",
            "value": "true"
          },
          {
            "key": "TagCount",
            "value": "1"
          }
        ],
        "tags": [
          {
            "key": "tKey1",
            "value": "tValue1"
          }
        ]
      },
      {
        "name": "folder2/file1.txt",
        "metadata": [
          {
            "key": "mKey2",
            "value": "mValue2"
          }
        ],
        "properties": [
          {
            "key": "Creation-Time",
            "value": "Wed, 06 Jun 2023 05:23:29 GMT"
          },
          {
            "key": "Last-Modified",
            "value": "Wed, 06 Jun 2023 05:23:29 GMT"
          },
          {
            "key": "Etag",
            "value": "0x6FB67175454D36D"
          }
        ],
        "tags": [
          {
            "key": "tKey2",
            "value": "tValue2"
          }
        ]
      }
    ],
    "container": {
      "name": "firstContainer",
      "metadata": [
        {
          "key": "mContainerKey1",
          "value": "mContainerValue1"
        }
      ]
    }
  }
}

Sample response

{
  "properties": {
    "action": {
      "elseBlockExists": true,
      "if": {
        "condition": "[[equals(AccessTier, 'Hot')]]"
      }
    },
    "blobs": [
      {
        "name": "folder1/file1.txt",
        "matchedBlock": "If",
        "metadata": [
          {
            "key": "mKey1",
            "value": "mValue1"
          }
        ],
        "properties": [
          {
            "key": "Creation-Time",
            "value": "Wed, 07 Jun 2023 05:23:29 GMT"
          },
          {
            "key": "Last-Modified",
            "value": "Wed, 07 Jun 2023 05:23:29 GMT"
          },
          {
            "key": "Etag",
            "value": "0x8DB67175454D36D"
          },
          {
            "key": "Content-Length",
            "value": "38619"
          },
          {
            "key": "Content-Type",
            "value": "text/xml"
          },
          {
            "key": "Content-Encoding",
            "value": ""
          },
          {
            "key": "Content-Language",
            "value": ""
          },
          {
            "key": "Content-CRC64",
            "value": ""
          },
          {
            "key": "Content-MD5",
            "value": "njr6iDrmU9+FC89WMK22EA=="
          },
          {
            "key": "Cache-Control",
            "value": ""
          },
          {
            "key": "Content-Disposition",
            "value": ""
          },
          {
            "key": "BlobType",
            "value": "BlockBlob"
          },
          {
            "key": "AccessTier",
            "value": "Hot"
          },
          {
            "key": "AccessTierInferred",
            "value": "true"
          },
          {
            "key": "LeaseStatus",
            "value": "unlocked"
          },
          {
            "key": "LeaseState",
            "value": "available"
          },
          {
            "key": "ServerEncrypted",
            "value": "true"
          },
          {
            "key": "TagCount",
            "value": "1"
          }
        ],
        "tags": [
          {
            "key": "tKey1",
            "value": "tValue1"
          }
        ]
      },
      {
        "name": "folder2/file1.txt",
        "matchedBlock": "Else",
        "metadata": [
          {
            "key": "mKey2",
            "value": "mValue2"
          }
        ],
        "properties": [
          {
            "key": "Creation-Time",
            "value": "Wed, 06 Jun 2023 05:23:29 GMT"
          },
          {
            "key": "Last-Modified",
            "value": "Wed, 06 Jun 2023 05:23:29 GMT"
          },
          {
            "key": "Etag",
            "value": "0x6FB67175454D36D"
          }
        ],
        "tags": [
          {
            "key": "tKey2",
            "value": "tValue2"
          }
        ]
      }
    ],
    "container": {
      "name": "firstContainer",
      "metadata": [
        {
          "key": "mContainerKey1",
          "value": "mContainerValue1"
        }
      ]
    }
  }
}

Definitions

Name Description
ErrorAdditionalInfo

The resource management error additional info.

ErrorDetail

The error detail.

ErrorResponse

Error response

MatchedBlockName

Represents the condition block name that matched blob properties.

StorageTaskPreviewAction

Storage Task Preview Action.

StorageTaskPreviewActionCondition

Represents the storage task conditions to be tested for a match with container and blob properties.

StorageTaskPreviewActionIfCondition

Represents storage task preview action condition.

StorageTaskPreviewBlobProperties

Storage task preview container properties

StorageTaskPreviewContainerProperties

Storage task preview container properties

StorageTaskPreviewKeyValueProperties

Storage task preview object key value pair properties.

ErrorAdditionalInfo

The resource management error additional info.

Name Type Description
info

object

The additional info.

type

string

The additional info type.

ErrorDetail

The error detail.

Name Type Description
additionalInfo

ErrorAdditionalInfo[]

The error additional info.

code

string

The error code.

details

ErrorDetail[]

The error details.

message

string

The error message.

target

string

The error target.

ErrorResponse

Error response

Name Type Description
error

ErrorDetail

The error object.

MatchedBlockName

Represents the condition block name that matched blob properties.

Value Description
If
Else
None

StorageTaskPreviewAction

Storage Task Preview Action.

Name Type Description
properties.action

StorageTaskPreviewActionCondition

Preview action to test

properties.blobs

StorageTaskPreviewBlobProperties[]

Properties of some sample blobs in the container to test for matches with the preview action.

properties.container

StorageTaskPreviewContainerProperties

Properties of a sample container to test for a match with the preview action.

StorageTaskPreviewActionCondition

Represents the storage task conditions to be tested for a match with container and blob properties.

Name Type Description
elseBlockExists

boolean

Specify whether the else block is present in the condition.

if

StorageTaskPreviewActionIfCondition

The condition to be tested for a match with container and blob properties.

StorageTaskPreviewActionIfCondition

Represents storage task preview action condition.

Name Type Description
condition

string

Storage task condition to bes tested for a match.

StorageTaskPreviewBlobProperties

Storage task preview container properties

Name Type Description
matchedBlock

MatchedBlockName

Represents the condition block name that matched blob properties.

metadata

StorageTaskPreviewKeyValueProperties[]

metadata key value pairs to be tested for a match against the provided condition.

name

string

Name of test blob

properties

StorageTaskPreviewKeyValueProperties[]

properties key value pairs to be tested for a match against the provided condition.

tags

StorageTaskPreviewKeyValueProperties[]

tags key value pairs to be tested for a match against the provided condition.

StorageTaskPreviewContainerProperties

Storage task preview container properties

Name Type Description
metadata

StorageTaskPreviewKeyValueProperties[]

metadata key value pairs to be tested for a match against the provided condition.

name

string

Name of test container

StorageTaskPreviewKeyValueProperties

Storage task preview object key value pair properties.

Name Type Description
key

string

Represents the key property of the pair.

value

string

Represents the value property of the pair.