Queries the specified inventory task configured for a bucket.

Note To call this operation, make sure that you have permissions to perform operations on the inventory of the bucket. By default, the bucket owner has the permissions to call this operation. If you do not have the permissions, apply for the permissions from the bucket owner.

Request syntax

GET /?inventory&inventoryId=inventoryId HTTP/1.1

Request elements

Element Type Required Description
inventoryId String Yes The ID of the inventory that you want to query.

Response elements

Element Type Required Description
Id String Yes The specified inventory name, which must be globally unique in the bucket.
IsEnabled Boolean Yes Indicates whether the inventory feature is enabled.
Valid values: true and false
  • A value of true indicates that the inventory feature is enabled.
  • A value of false indicates that no inventory list is generated.
Filter Container No The container that stores the prefix used to filter the objects in inventory lists. Only objects whose names contain the specified prefix are included in inventory lists.
Prefix String No The prefix specified in the inventory.

Parent nodes: Filter

Destination Container Yes The container that stores the exported inventory lists.
OSSBucketDestination Container Yes The information about the bucket that stores the exported inventory lists.

Parent nodes: Destination

Format String Yes The format of the exported inventory lists.

Valid value: CSV

Parent nodes: OSSBucketDestination

AccountId String Yes The account ID granted by the bucket owner.

Parent nodes: OSSBucketDestination

RoleArn String Yes The name of the role to which the bucket owner grants permissions.

Format: acs:ram::uid:role/rolename

Parent nodes: OSSBucketDestination

Bucket String Yes The bucket in which the exported inventory lists are stored.

Parent nodes: OSSBucketDestination

Prefix String No The prefix contained in the path in which the exported inventory lists are stored.

Parent nodes: OSSBucketDestination

Encryption Container No The container that stores the encryption method of inventory lists.

Valid values: SSE-OSS, SSE-KMS, and Null

Parent nodes: OSSBucketDestination

SSE-OSS Container No The container that stores the information about the SSE-OSS encryption method.

Parent nodes: Encryption

SSE-KMS Container No The container that stores the customer master key (CMK) used in the SSE-KMS encryption method.

Parent nodes: Encryption

KeyId String No The ID of the key that is managed by Key Management Service (KMS).

Parent nodes: SSE-KMS

Schedule Container Yes The container that stores the information about the frequency at which inventory lists are exported.
Frequency String Yes The frequency at which inventory lists are exported.

Valid values: Daily and Weekly

Parent nodes: Schedule

IncludedObjectVersions String Yes Indicates whether to include the versioning information of objects in inventory lists.
Valid values: All and Current
  • A value of All indicates that all versions of the objects are exported.
  • A value of Current indicates that only the current versions of the objects are exported.
OptionalFields Container No The container that stores the configuration fields included in inventory lists.
Field String No The configuration fields that are included in inventory lists.

Valid values: Size, LastModifiedDate, ETag, StorageClass, IsMultipartUploaded, and EncryptionStatus

Parent nodes: OptionalFields

Examples

  • Sample requests
    GET /?inventory&inventoryId=list1 HTTP/1.1
  • Sample responses
      HTTP/1.1 200 OK
      x-oss-request-id: 56594298207FB304438516F9
      Date: Mon, 31 Oct 2016 12:00:00 GMT
      Server: AliyunOSS
      Content-Length: length
    
      <?xml version="1.0" encoding="UTF-8"?>
      <InventoryConfiguration">
         <Id>report1</Id>
         <IsEnabled>true</IsEnabled>
         <Destination>
            <OSSBucketDestination>
               <Format>CSV</Format>
               <AccountId>1000000000000000</AccountId>
               <RoleArn>acs:ram::1000000000000000:role/AliyunOSSRole</RoleArn>
               <Bucket>acs:oss:::bucket_0001</Bucket>
               <Prefix>prefix1</Prefix>
               <Encryption>
                  <SSE-OSS/>
               </Encryption>
            </OSSBucketDestination>
         </Destination>
         <Schedule>
            <Frequency>Daily</Frequency>
         </Schedule>
         <Filter>
           <Prefix>myprefix/</Prefix>
         </Filter>
         <IncludedObjectVersions>All</IncludedObjectVersions>
         <OptionalFields>
            <Field>Size</Field>
            <Field>LastModifiedDate</Field>
            <Field>ETag</Field>
            <Field>StorageClass</Field>
            <Field>IsMultipartUploaded</Field>
            <Field>EncryptionStatus</Field>
         </OptionalFields>
      </InventoryConfiguration>