你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。

Storage Tasks - Preview Actions

针对输入对象元数据属性运行输入条件,并在响应中指定匹配的对象。

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

URI 参数

名称 在 必需 类型 说明
location
path True

string

表示受支持资源提供程序所在的 Azure 地理区域。

subscriptionId
path True

string (uuid)

目标订阅的 ID。 该值必须是 UUID。

api-version
query True

string

minLength: 1

用于此操作的 API 版本。

请求正文

名称 必需 类型 说明
properties.action True

StorageTaskPreviewActionCondition

要测试的预览作

properties.blobs True

StorageTaskPreviewBlobProperties[]

容器中一些示例 Blob 的属性,用于测试与预览作的匹配项。

properties.container True

StorageTaskPreviewContainerProperties

要测试与预览作匹配的示例容器的属性。

响应

名称 类型 说明
200 OK

StorageTaskPreviewAction

请求已成功。

Other Status Codes

ErrorResponse

意外的错误响应。

安全性

azure_auth

Azure Active Directory OAuth2 流程。

类型: oauth2
流向: implicit
授权 URL: https://login.microsoftonline.com/common/oauth2/authorize

作用域

名称 说明
user_impersonation 模拟用户帐户

示例

PerformStorageTaskActionsPreview

示例请求

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"
        }
      ]
    }
  }
}

示例响应

{
  "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"
        }
      ]
    }
  }
}

定义

名称 说明
ErrorAdditionalInfo

资源管理错误附加信息。

ErrorDetail

错误详细信息。

ErrorResponse

错误响应

MatchedBlockName

表示与 Blob 属性匹配的条件块名称。

StorageTaskPreviewAction

存储任务预览作。

StorageTaskPreviewActionCondition

表示要针对容器和 Blob 属性的匹配进行测试的存储任务条件。

StorageTaskPreviewActionIfCondition

表示存储任务预览作条件。

StorageTaskPreviewBlobProperties

存储任务预览容器属性

StorageTaskPreviewContainerProperties

存储任务预览容器属性

StorageTaskPreviewKeyValueProperties

存储任务预览对象键值对属性。

ErrorAdditionalInfo

资源管理错误附加信息。

名称 类型 说明
info

object

其他信息。

type

string

其他信息类型。

ErrorDetail

错误详细信息。

名称 类型 说明
additionalInfo

ErrorAdditionalInfo[]

错误附加信息。

code

string

错误代码。

details

ErrorDetail[]

错误详细信息。

message

string

错误消息。

target

string

错误目标。

ErrorResponse

错误响应

名称 类型 说明
error

ErrorDetail

错误对象。

MatchedBlockName

表示与 Blob 属性匹配的条件块名称。

值 说明
If
Else
None

StorageTaskPreviewAction

存储任务预览作。

名称 类型 说明
properties.action

StorageTaskPreviewActionCondition

要测试的预览作

properties.blobs

StorageTaskPreviewBlobProperties[]

容器中一些示例 Blob 的属性,用于测试与预览作的匹配项。

properties.container

StorageTaskPreviewContainerProperties

要测试与预览作匹配的示例容器的属性。

StorageTaskPreviewActionCondition

表示要针对容器和 Blob 属性的匹配进行测试的存储任务条件。

名称 类型 说明
elseBlockExists

boolean

指定条件中是否存在其他块。

if

StorageTaskPreviewActionIfCondition

要针对与容器和 Blob 属性匹配的条件进行测试。

StorageTaskPreviewActionIfCondition

表示存储任务预览作条件。

名称 类型 说明
condition

string

要测试匹配的存储任务条件。

StorageTaskPreviewBlobProperties

存储任务预览容器属性

名称 类型 说明
matchedBlock

MatchedBlockName

表示与 Blob 属性匹配的条件块名称。

metadata

StorageTaskPreviewKeyValueProperties[]

要针对所提供的条件进行测试的元数据键值对。

name

string

测试 Blob 的名称

properties

StorageTaskPreviewKeyValueProperties[]

要针对所提供的条件进行测试的匹配的 properties 键值对。

tags

StorageTaskPreviewKeyValueProperties[]

标记要针对所提供的条件进行测试的匹配项的键值对。

StorageTaskPreviewContainerProperties

存储任务预览容器属性

名称 类型 说明
metadata

StorageTaskPreviewKeyValueProperties[]

要针对所提供的条件进行测试的元数据键值对。

name

string

测试容器的名称

StorageTaskPreviewKeyValueProperties

存储任务预览对象键值对属性。

名称 类型 说明
key

string

表示对的键属性。

value

string

表示对的值属性。