All Products
Search
Document Center

Object Storage Service:OpenMetaQuery

Last Updated:Nov 13, 2023

Enables the metadata management feature for a bucket. After you enable the metadata management feature for a bucket, Object Storage Service (OSS) creates a metadata index library for the bucket and creates metadata indexes for all objects in the bucket. After the metadata index library is created, OSS continues to perform quasi-real-time scans on incremental objects in the bucket and creates metadata indexes for the incremental objects.

Usage notes

  • Required permissions

    By default, an Alibaba Cloud account has the permissions to enable the metadata management feature. To enable the metadata management feature as a RAM user, make sure that the RAM user has the oss:OpenMetaQuery permission. For more information, see Attach a custom policy to a RAM user.

  • Object quantity

    By default, the metadata management feature is supported only for a bucket that contains fewer than 100,000,000 objects.

  • Billing

    During the public preview, you are not charged for metadata management. For more information about billable items of the data indexing feature, see Data indexing fees.

  • Time required for indexing

    When you enable metadata management, OSS creates an index. The time required for creating the index is directly proportional to the number of objects stored in the bucket. The larger the number of objects in the bucket, the longer the time required to create the index.

Request syntax

POST /?metaQuery&comp=add HTTP/1.1
Host: BucketName.oss-cn-hangzhou.aliyuncs.com
Date: GMT Date
Authorization: SignatureValue

Request headers

This request contains only common request headers. For more information, see Common HTTP headers.

Response headers

This request contains only common response headers. For more information, see Common HTTP headers.

Examples

Sample request

POST /?metaQuery&comp=add HTTP/1.1
Host: oss-example.oss-cn-hangzhou.aliyuncs.com
Date: Mon, 26 Jul 2021 13:08:38 GMT
Authorization: OSS qn6qrrqxo2oawuk53otf****:ceOEyZavKY4QcjoUWYSpYbJ3**** 

Sample response

HTTP/1.1 200 OK
x-oss-request-id: 5C1B138A109F4E405B2D****
Date: Mon, 26 Jul 2021 13:08:38 GMT
Content-Length: 0
Connection: keep-alive
Server: AliyunOSS
x-oss-request-id: 5C06A3B67B8B5A3DA422299D
x-oss-server-time: 544

Error codes

Error code

HTTP status code

Description

MetaQueryAlreadyExist

400

The metadata index library of the bucket is being created. Wait until the metadata index library is created and try again.

AccessDenied

403

You do not have the permissions to access the bucket. Make sure that the RAM user is granted the permissions to access the bucket.

NoSuchBucket

404

The destination bucket does not exist. Specify a valid bucket name.