百度智能云

All Product Document

          Object Storage

          GetObjectMeta

          Interface Description

          This command allows you to get the meta information of an object, but it does not return data at this time.

          Notes:

          • If the soft link is used to access GetObjectMeta, Content-Length, ETag and Content-Md5 in the return response header are the meta information of the destination file, Last-Modified is the maximum value of the destination files and soft link, and others are the meta information of the soft link.
          • If the soft link is used to access this API and the destination file is deleted, it returns “Http 404: SymlinkTargetNotExist”. No error occurs when GetSymlink is called.

          Request

          • Request syntax

            HEAD /<ObjectName> HTTP/1.1
            Host: <BucketName>.bj.bcebos.com
            Date: <Date>
            Authorization: <AuthorizationString>
          • Request header field

          No special header parameter

          • Request parameters

          No special parameters.

          Response

          • Response header field

            Name Type Description
            Cache-Control String Cache setting for downloading the object. The common optional values are private, no-cache, max-age and must-revalidate
            Content-Disposition String Set the browser to download files. The optional values are inline and attachment. Filename="download.txt".
            Content-Length Long Int It returns the data size of the object.
            Content-Range String If a range is available, it returns the data range of the object.
            Content-Type String Object type and coding method
            Expires String Cache expiration date during the object download.
            ETag String HTTP protocol entity tag of the object.
            x-bce-meta-* String It returns this item only when there is a custom meta.
            x-bce-storage-class String It returns STANDARD for standard storage, STANDARD_IA for infrequent access, COLD for cold storage and ARCHIVE for archive storage. If it is the multi-AZ bucket, it returns MAZ_STANDARD_IA for the multi-AZ infrequent access and MAZ_STANDARD for the multi-AZ standard storage.
            x-bce-server-side-encryption String Server encryption type of the object. Only AES256 encryption is supported currently.
            x-bce-restore String When the object is of archive storage type and is being restored or has been restored, it returns the header field “x-bce-restore” to indicate the restoration status of the archive object: return ongoing-request="true"e" when it is being restored and ongoing-request="false", expiry-date="Wed, 07 Nov 2019 00:00:00 GMT", expiry-date="Wed, 07 Nov 2019 00:00:00 GMT" when it has been restored. expiry-date indicates the expiration date after the object is restored.
            x-bce-object-type String When you access a soft link, it returns "Symlink". In other cases, it does not return value.
          • Response parameter

          None

          Considerations

          None

          Example

          • Request example

            HEAD /ObjectName HTTP/1.1
            Host: BucketName.bj.bcebos.com
            Date: Wed, 06 Apr 2016 06:34:40 GMT
            Authorization: AuthorizationString
          • Response example

            HTTP/1.1 200 OK
            x-bce-request-id: 4db2b34d-654d-4d8a-b49b-3049ca786409
            x-bce-storage-class: STANDARD
            Date: Wed, 06 Apr 2016 06:34:40 GMT
            Last-Modified: Sun, 1 Jan 2006 12:00:00 GMT
            ETag: "fba9dede5f27731c9771645a39863328"
            Content-Length: 0
            Content-Type: text/plain
            Connection: close
            Server: BceBos
          • Example of response after retrieval of archive object

            HTTP/1.1 200 OK
            x-bce-request-id: 4db2b34d-654d-4d8a-b49b-3049ca786409
            x-bce-storage-class: ARCHIVE
            x-bce-restore: ongoing-request="false", expiry-date="Wed, 07 Nov 2019 00:00:00  GMT"
            Date: Wed, 27 Feb 2019 06:34:40 GMT
            Last-Modified: Wed, 20 Feb 2019 06:34:40 GMT
            ETag: "fba9dede5f27731c9771645a39863328"
            Content-Length: 15618
            Content-Type: text/plain
            Connection: close
            Server: BceBos
          Previous
          GetObject
          Next
          PostObject