Fetch Resource

Last update:2022-10-14 15:24:32

Fetch Resource

Description

For the space where the mirror storage is set, this interface provides the function of getting specified resources from the mirror source site and storing them in the space.
If a resource with the same name already exists in this space, it will be overwritten by the resource of the mirror source site.

Request Description

POST /prefetch/{param1}
Host: <MgrDomain>
Authorization: <AccessToken>

Note: {param1}Generation rule: space name + “:” + file name 1 | file name 2 | file name 3… Do URL-safe Base64 encoding for the concatenated string .

encode_file_key = Urlsafe_Base64_Encode(<key>)
{param1} = Urlsafe_Base64_Encode(<bucekt>:encode_file_key1|encode_file_key2|encode_file_key3)

header Description

Parameter Required Description
Host Yes The management domain name can be obtained on the user management interface.
Authorization Yes Manage credentials .

Response Description

If the request is successful, a Jsonstring with the following content is returned:

{
    "bucket":"<bucket string>",
    "items":[
    {
        "key":"<filekey>",
        "mirrorAddress":"<mirrorAddress string>",
        "code":"<code int>",
        "message":"<message string>"
    }]
}
Field name Required Description
bucket Yes space name
mirrorAddress Yes mirror source address
code Yes Mirror source response code
message Yes Mirror source response information

If the request fails, a Jsonstring with the following content is returned:

{
    "code":     "<code string>",
    "message":  "<message string>"
}
Field name Required Description
code Yes HTTP request response code, see HTTP response status code
message Yes Tips

Example

curl -v  -X POST -H "Authorization:bea919a5a1bc53d76a9e4340951b0b3692ff2517:YjRmYWI4ZWVkYzNmNDkyYmM2Y2I0NWE2NzVjNjk1Y2NjOGQxYzI3NQ==" –-url http://mgrDomain/prefetch/aW1hZ2U6TVM1cWNHYz18TWk1cWNHYz0=
Is the content of this document helpful to you?
Yes
I have suggestion
Submitted successfully! Thank you very much for your feedback, we will continue to strive to do better!