0020-00000027

Updated at:

Problem description

The value of the Destination/OSSBucketDestination/Format node in a PutBucketInventory request is invalid.

Causes

The Format node specifies the output format of inventory lists. The only valid value is CSV. Inventory lists are exported as comma-separated values (CSV) objects compressed with GZIP.

Examples

The following request fails because <Format> is set to TXT, which is not a supported value.

PUT /?inventory&inventoryId=report1 HTTP/1.1
Host: BucketName.oss.aliyuncs.com
Date: Mon, 31 Oct 2016 12:00:00 GMT
Authorization: authorization string
Content-Length: length

<?xml version="1.0" encoding="UTF-8"?>
<InventoryConfiguration>
  <Id>report1</Id>
  <IsEnabled>true</IsEnabled>
  <Destination>
    <OSSBucketDestination>
      <Format>TXT</Format>
      <AccountId>1000000000000000</AccountId>
      <RoleArn>acs:ram::1000000000000000:role/AliyunOSSRole</RoleArn>
      <Bucket>acs:oss:::destination-bucket</Bucket>
      <Prefix>prefix1</Prefix>
      <Encryption>
        <SSE-KMS>
          <KeyId>keyId</KeyId>
        </SSE-KMS>
      </Encryption>
    </OSSBucketDestination>
  </Destination>
  <Schedule>
    <Frequency>Daily</Frequency>
  </Schedule>
  <IncludedObjectVersions>All</IncludedObjectVersions>
  <OptionalFields>
    <Field>Size</Field>
    <Field>LastModifiedDate</Field>
    <Field>ETag</Field>
    <Field>StorageClass</Field>
    <Field>IsMultipartUploaded</Field>
    <Field>EncryptionStatus</Field>
  </OptionalFields>
</InventoryConfiguration>

Solutions

Set <Format> to CSV, the only supported value.

PUT /?inventory&inventoryId=report1 HTTP/1.1
Host: oss-example.oss-cn-hangzhou.aliyuncs.com
Date: Mon, 31 Oct 2016 12:00:00 GMT
Authorization: authorization string
Content-Length: length

<?xml version="1.0" encoding="UTF-8"?>
<InventoryConfiguration>
  <Id>report1</Id>
  <IsEnabled>true</IsEnabled>
  <Filter>
    <Prefix>Pics/</Prefix>
    <LastModifyBeginTimeStamp>1637883649</LastModifyBeginTimeStamp>
    <LastModifyEndTimeStamp>1638347592</LastModifyEndTimeStamp>
    <LowerSizeBound>1024</LowerSizeBound>
    <UpperSizeBound>1048576</UpperSizeBound>
    <StorageClass>Standard,IA</StorageClass>
  </Filter>
  <Destination>
    <OSSBucketDestination>
      <Format>CSV</Format>
      <AccountId>100000000000000</AccountId>
      <RoleArn>acs:ram::100000000000000:role/AliyunOSSRole</RoleArn>
      <Bucket>acs:oss:::destbucket</Bucket>
      <Prefix>prefix1/</Prefix>
      <Encryption>
        <SSE-KMS>
          <KeyId>keyId</KeyId>
        </SSE-KMS>
      </Encryption>
    </OSSBucketDestination>
  </Destination>
  <Schedule>
    <Frequency>Daily</Frequency>
  </Schedule>
  <IncludedObjectVersions>All</IncludedObjectVersions>
  <OptionalFields>
    <Field>Size</Field>
    <Field>LastModifiedDate</Field>
    <Field>ETag</Field>
    <Field>StorageClass</Field>
    <Field>IsMultipartUploaded</Field>
    <Field>EncryptionStatus</Field>
  </OptionalFields>
</InventoryConfiguration>

References

PutBucketInventory