- Categories:
System functions (System Information)
SYSTEM$VALIDATE_ STORAGE_ INTEGRATION¶
验证指定存储集成的配置。该函数尝试使用存储集成来写入、读取、列出或删除通过路径指定的存储位置的文件。
有关配置存储集成的更多信息,请参阅:
语法
实参
storage_integration_name要测试的存储集成的名称。
存储集成名称区分大小写。
storage_pathThe full path to a storage location that you want to validate. The storage path must be a URL in the
STORAGE_ALLOWED_LOCATIONSlist for the storage integration.Amazon S3
's3china://bucket/path/'- The
s3prefix refers to S3 storage in public AWS regions. Thes3govprefix refers to S3 storage in government regions. bucketis the name of an S3 bucket that stores your data files.pathis an optional path or directory in the bucket.
Google Cloud Storage
'gcs://bucket/path/'bucketis the name of a GCS bucket that stores your data files.pathis an optional path or directory in the bucket.
Microsoft Azure
'azure://account.blob.core.windows.net/container/path/'accountis the name of the Azure storage account.containeris the name of an Azure blob storage container that stores your data files.pathis an optional path or directory in the bucket.
- The
test_file_name要在存储集成验证中使用的文件名称。
validate_action要执行的验证操作。
- Values:
read- Validates that Snowflake can read from the storage location. This action fails if the file doesn’t exist.write- Validate that Snowflake can write to the storage location. This action fails if the file already exists.list- Validates that Snowflake can list the files in the storage location.delete- Validates that Snowflake can delete files in the storage location.all- Validates all possible actions in the storage location.
返回
该函数返回一个 JSON 对象,其属性如下所述:
| Property | Description |
|---|---|
status | The status of the validation test. Returns a status of success if all actions completed successfully; returns failure if any action didn’t complete as expected. |
actions | Array of objects that contain the requested validation action (READ, DELETE, LIST, WRITE) and status. |
示例
The following example validates the configuration of the storage integration example_integration for all validation actions. The
example returns a successful result in JSON.
输出:
The following example shows the result when the storage integration doesn’t have read permissions.
输出: