GetBucketInventory retrieves the configuration of a specified inventory task for a bucket.
Usage notes
By default, an Alibaba Cloud account has permission to retrieve inventory task configurations for a bucket. If you use a RAM user or Security Token Service (STS) to retrieve inventory task configurations, you must have the oss:GetBucketInventory permission.
Request syntax
GET /?inventory&inventoryId=inventoryId HTTP/1.1Request parameters
Name | Type | Required | Description |
inventoryId | String | Yes | The ID of the inventory task to query. |
Response parameters
Name | Type | Description |
Id | String | The inventory name that you specify. The name must be globally unique in the bucket. |
IsEnabled | Boolean | Indicates whether the inventory feature is enabled. Valid values: true and false
|
Filter | Container | The prefix used to filter objects. Only objects whose names contain the specified prefix are included in the inventory list. |
Prefix | String | The prefix used in the filter rule. Parent node: Filter |
Destination | Container | Details of the checklist results. |
OSSBucketDestination | Container | Information about the bucket that stores exported inventory lists. Parent node: Destination |
Format | String | The format of exported inventory lists. Valid value: CSV Parent node: OSSBucketDestination |
AccountId | String | The account ID granted by the bucket owner. Parent node: OSSBucketDestination |
RoleArn | String | The role name to which the bucket owner grants permissions. Format: acs:ram::uid:role/rolename Parent node: OSSBucketDestination |
Bucket | String | The bucket that stores exported inventory lists. Parent node: OSSBucketDestination |
Prefix | String | The prefix in the path where exported inventory lists are stored. Parent node: OSSBucketDestination |
Encryption | Container | The encryption method used for exported inventory lists. Valid values: SSE-OSS, SSE-KMS, and null Parent node: OSSBucketDestination |
SSE-OSS | Container | The container for the SSE-OSS encryption method. Parent node: Encryption |
SSE-KMS | Container | The container that stores the customer master key (CMK) used in the SSE-KMS encryption method. Parent node: Encryption |
KeyId | String | The ID of the key managed by Key Management Service (KMS). Parent node: SSE-KMS |
Schedule | Container | The container that stores information about how often inventory lists are exported. |
Frequency | String | How often inventory lists are exported. Valid values: Daily and Weekly Parent node: Schedule |
IncludedObjectVersions | String | Indicates whether to include version information for objects in inventory lists. Valid values: All and Current
|
OptionalFields | Container | The configuration fields to include in inventory lists. |
Field | String | The configuration fields to include in inventory lists. Valid values: Size, LastModifiedDate, TransitionTime, ETag, StorageClass, IsMultipartUploaded, EncryptionStatus, ObjectAcl, TaggingCount, ObjectType, and CRC64 Parent node: OptionalFields |
IncrementalInventory | Container | Configuration information for incremental inventories. |
IsEnabled | Boolean | Indicates whether to enable incremental inventories. Valid values:
If set to true, the incremental inventory feature is enabled regardless of whether the top-level IsEnabled parameter is set to false. Parent node: IncrementalInventory |
Schedule | Container | The export frequency for incremental inventories. Parent node: IncrementalInventory |
Frequency | Positive integer | The export frequency for incremental inventories, in seconds. The system uses a fixed interval of 600 seconds. For each interval, the system automatically creates a directory prefix and generates a manifest file and multiple CSV files for objects created during that interval. Custom frequencies are not supported. Parent node: Schedule |
OptionalFields | Container | The configuration fields to include in incremental inventories. Parent node: IncrementalInventory |
Field | String | The configuration fields to include in incremental inventories. Parent node: OptionalFields
|
Examples
Sample request
GET /?inventory&inventoryId=list1 HTTP/1.1Sample response
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>
SDK
The SDKs for this API are available in the following programming languages:
ossutil
For information about the ossutil command that corresponds to the GetBucketInventory operation, see get-bucket-inventory.