Obtain Temporary Credential
Device report obtain Temporary Credential
Topic:
thing/product/{pid}/requests
Parameter Explanation:
Parameter | Required | Type | Illustration |
---|---|---|---|
tid | Yes | string | |
bid | Yes | string | |
method | Yes | string | message Type |
timestamp | Yes | int | 13-bit timestamp |
data | Yes | object | |
» module | Yes | int | Module enumeration value 0 - Media |
Example:
//Topic: thing/product/{pid}/requests
{
"method":"storage_config_get",
"tid":"123",
"bid":"456",
"timestamp":"1234567890123",
"data":{
"module": 0
}
}
Server Send Temporary Credential
Topic:
thing/product/{pid}/requests_reply
Parameter Explanation:
Parameter | Required | Type | Illustration |
---|---|---|---|
tid | Y | string | |
bid | Y | string | |
method | Y | string | message Type |
timestamp | Y | int | 13-bit timestamp |
data | Y | object | |
» result | Y | int | The response result of 0 means normal |
» output | Y | object | Output |
»» endpoint | Y | string | Access domain name for external services |
»» object_key_prefix | Y | string | The key prefix of the file in the object storage bucket |
»» provider | Y | string | Cloud vendor enumeration value * ali - Ali cloud * aws - Amazon cloud |
»» region | Y | string | The region where the data center is located, refer to the corresponding cloud vendor region enumeration value |
»» bucket | Y | string | Name of the object storage bucket |
»» credentials | Y | object | Credential information |
»»» access_key_id | Y | string | Access key ID (used for cloud vendor logo user) |
»»» access_key_secret | Y | string | Secret access key (the key used to encrypt the signature string and the cloud vendor uses to verify the signature string) |
»»» expire | Y | int | Access key expiration time. Unit: seconds |
»»» security_token | Y | string | session token |
// topic thing/product/{pid}/requests_reply
{
"method":"storage_config_get",
"tid":"123",
"bid":"456",
"timestamp":"1234567890123",
"data":{
"result":0,
"output":{
"bucket":"bucket_name",
"credentials":{
"access_key_id":"access_key_id",
"access_key_secret":"access_key_secret",
"expire":3600,
"security_token":"security_token"
},
"endpoint":"https://oss-cn-hangzhou.aliyuncs.com",
"object_key_prefix":"b4cfaae6-bd9d-4cd0-8472-63b608c3c581",
"provider":"ali",
"region":"hz"
}
}
}