百度智能云

All Product Document

          Object Storage

          Fetch and Store Object into Bucket

          Interface Description

          This interface is used to fetch resources from the specified URL and store them in the specified bucket. This operation requires that the requester should have the write permission of this bucket. Only one object can be fetched each time, and the user can customize the object name.

          Description:

          • The size of resources fetched by the FetchObject interface is limited to 0-10 GB.

          Request URI

          POST /v1/{bucketName}/{objectKey}?fetch

          Parameter Name Parameter Type Required? Description Example Value Parameter Position
          bucketName String Yes Bucket name "bucketName_example" Path
          objectKey String Yes Object name "objectKey_example" Path

          Request Header Parameters

          Parameter Name Parameter Type Required? Description Example Value
          xBceFetchSource String Yes Source address of the fetched file, e.g., http://www.abc.com/img.jpg. This parameter can be put into the querystring. When it is put into the querystring, the UrlEncode is required. "xBceFetchSource_example"
          xBceFetchMode String No Fetch mode, which can be async fetch or sync fetch. In the asynchronous fetch mode, BOS returns “Fetched successfully” immediately after it receives the fetch task. In the synchronous fetch mode, BOS does not return “Fetched successfully” before it fetches the object successfully. It is recommended to use the synchronous fetch mode for a small amount of data or real-time fetch results. It does not need to wait in the asynchronous fetch mode, which is suitable for scenarios where it is not necessary to view the fetch results in real time. You can query the fetch results subsequently. The default value is sync. This parameter can be put into the querystring. "xBceFetchMode_example"
          xBceStorageClass String No Storage class, which can be standard storage (STANDARD), infrequent access (STANDARD_IA), cold storage (COLD), and archive storage (ARCHIVE). The default storage class is STANDARD. This parameter can be put into the querystring. "xBceStorageClass_example"
          xBceServerSideEncryption String No Server encryption algorithm, only AES256 is supported currently. "xBceServerSideEncryption_example"

          Request Body Parameters

          Description of Data Structure for Request Body Field

          Response Body Parameters

          Description of Data Structure for Response Body Field

          Parameter Name Parameter Type Description Example Value
          errors List The container for storing incorrect object messages during the deletion, which contains one or more object elements.

          Description of Data Structure for Error Field

          Parameter Name Parameter Type Description Example Value
          key String Incorrect object name during the deletion. my-object2
          code String Error code. InvalidArgument
          message String Error message Invalid Argument.

          Request Example

          POST /v1/bucketName_example/objectKey_example?fetch
          Common Request Header
          x-bce-fetch-source: xBceFetchSource_example
          x-bce-fetch-mode: xBceFetchMode_example
          x-bce-storage-class: xBceStorageClass_example
          x-bce-server-side-encryption: xBceServerSideEncryption_example
          
          
          { }

          Response Example

          HTTP/1.1 200 OK
          <Common response header>
          
          {
            "errors" : [ {
              "code" : "InvalidArgument",
              "message" : "Invalid Argument.",
              "key" : "my-object2"
            }, {
              "code" : "InvalidArgument",
              "message" : "Invalid Argument.",
              "key" : "my-object2"
            } ]
          }

          Error Code

          Refer to the universal error code.

          Previous
          Restore Archive Files
          Next
          Delete Object