Obtain Temporary Credential

2022-06-23
No Rating

Get STS Token

POST /storage/api/v1/workspaces/{workspace_id}/sts

Parameters

NameInTypeRequiredDescription
workspace_idpathstringtrueworkspace id
x-auth-tokenheaderstringtrueaccess token

Responses

StatusMeaningDescriptionSchema
200OKopen in new windowOKmedia.GetStsOutput

Example responses

{
    "code":0,
    "data":{
        "bucket":"string",
        "credentials":{
            "access_key_id":"STS.NUBdKtVadL1U8aBJ2TH6PWoYo",
            "access_key_secret":"9NG2P2yJaUrck576CkdRoRbchKssJiZygi5D93CBsduY",
            "expire":3600,
         	 "security_token":"CAIS8AN1q6Ft5B2yfSjIr5b3L/HAu75F+/O+OkfzrjIBRLl8uKryjTz2IHhOenBhB+Actfk+lWhV6v0Tlrt+UMQcHQnKbM99q49L9hmobIeZWV4pagxD2vOfAmG2J0PRH6WwCryLq7q/F96pb1fb7FgRpZLxaTSlWXG8LJSNkuQJR98LXw6+H1UkadBNPVkg0sJ4U0HcLvGwKBXnr3PNBU5zwGpGhHh49L60z7+9iDXXh0aozfQO9cajYMqkfYxiPZNyFsyp2/Z/eaeEzCNL918X/fl43aAY83Kdt4rNRgVbvx/DY7Tao5g0JVEmNqQzQ6RK8PG714+D046+voDzzAk3fIMxei/DRYem7dLZEeeyTLgQfqr6PHK/q7LoMYLu4Sclem48PgFHcMY6UCUSbyYhUTbHMKSq1UnXawO4Mci/3boxzIB+wieWn6aDLEPdRK6Cg2RKeM05flsoMAIRxhaiEM09bxZNdVxDBrWYN+d0dwsMkbnlswzCJFQCqXFeufLsZ/TL/fpHMNi4HLA+iNpCPcQa6zd6Fg+rEunw1n15LjI1Hexkt4D2IoK65bO/x+GeXPXLEPhvuC8BKWqP9nvTGSkLcHygvoB/MguCjt/N1+nM4dZuEQ8jo8tDChuMftsos1F9/+6o6BCe4DNU548fW6tTGoABfvC8lAYwapu2ryxHRLeBodm278eCTa57hXytE/f/l9neR9Zg9tLoIJzFOdjs2gLfVc+BhjQ0GkZDP9ie332XnhH5nOugICpYlv5++p2Ap6WZIKTVEkFetdVKjkxal2zhXoCN9Aq4YeLn5bfQiTHrA3pjjhuE7sMSFsMVdxVvftI="
        },
        "endpoint":"https://oss-cn-hangzhou.aliyuncs.com",
        "object_key_prefix":"5a6f9d4b-2a38-4b4b-86f9-3a678da0bf4a",
        "provider":"ali""region": "cn-hangzhou"
    },
    "message":"success"
}

Schemas

media.GetStsOutput

{
    "code":0,
    "message":"string",
    "data":{
        "bucket":"string",
        "credentials":{
            "access_key_id":"string",
            "access_key_secret":"string",
            "expire":0,
            "security_token":"string"
        },
        "endpoint":"string",
        "object_key_prefix":"string",
        "provider":"ali",
        "region":"string"
    }
}

Properties

NameTypeRequiredRestrictionsDescription
codestringfalsenoneerror code
messagestringfalsenonedescription
datastringfalsenone
» bucketstringfalsenonebucket name
» credentialsmedia.Credentialsnonecredentials info
» endpointstringfalsenoneaccess domain name for external services
» object_key_prefixstringfalsenoneThe prefix of the key of the file in the object storage bucket
» providerstringfalsenoneenum:
* ali
* aws
» regionstringfalsenoneThe region where the data center is located

media.Credentials

{
  "access_key_id": "string",
  "access_key_secret": "string",
  "expire": 0,
  "security_token": "string"
}

Properties

NameTypeRequiredRestrictionsDescription
access_key_idstringfalsenoneaccess key id
access_key_secretstringfalsenoneaccess key)
expireintegerfalsenoneaccess key expiration time
security_tokenstringfalsenonesession token