调用接口EnableFreeStorage设置免费试用的云存储套餐立即生效。
QPS限制
单个阿里云账号调用该接口的每秒请求数(QPS)最大限制为100。
说明 单个阿里云账号下的所有RAM用户共享该阿里云账号的配额。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 |
类型 |
是否必选 |
示例值 |
描述 |
Action | String | 是 | EnableFreeStorage | 系统规定参数。取值:EnableFreeStorage。 |
ProductKey | String | 否 | BwAGV**** | 设备所属的产品ProductKey。 重要 如果传入该参数,需同时传入DeviceName。
|
DeviceName | String | 否 | light | 设备的名称。 重要 如果传入该参数,需同时传入ProductKey。
|
IotId | String | 否 | Q7uOhVRdZRRlDnTLv****00100 | 设备ID。 重要 IotId作为设备唯一标识符,和ProductKey与DeviceName组合是一一对应的关系。如果传入该参数,则无需传入ProductKey和DeviceName。如果您同时传入IotId和ProductKey与DeviceName组合,则以IotId为准。
|
调用API时,除了本文介绍的该API的特有请求参数,还需传入公共请求参数。
返回数据
名称 |
类型 |
示例值 |
描述 |
Code | String | 400 | 调用结果状态码:
|
Data | Struct | 调用成功,返回的结果。 |
|
Consumed | Integer | 0 | 是否已领取免费的云存储套餐。
|
EndTime | String | 2024-0-01 12:00:00 | 结束时间。格式为 |
EndTimeUTC | String | 2024-01-01T12:00:00Z | 结束时间UTC。格式 |
Expired | Integer | 0 | 云存储服务是否已到期。
|
Lifecycle | Integer | 3 | 数据在云端的存储周期。取值为1、3、7或30,单位为天。 |
Months | Integer | 12 | 云存储服务有效期,单位为月。 |
RemainQuota | Integer | 1 | 免费试用云存储的剩余配额,单位为月。 |
StartTime | String | 2023-01-01 12:00:00 | 开始时间。格式为 |
StartTimeUTC | String | 2023-01-01T12:00:00Z | 开始时间UTC,格式为 |
Type | Integer | 1 | 云存储套餐类型。
|
ErrorMessage | String | Request parameter error. | 调用失败时,返回的出错信息。 |
RequestId | String | E******7-4***-***B-8**E-D3********65 | 阿里云为该请求生成的唯一标识符。 |
Success | Boolean | true | 是否调用成功。
|
示例
请求示例
http(s)://linkvisual.cn-shanghai.aliyuncs.com/?Action=EnableFreeStorage
&ProductKey=a1rYuVF****
&DeviceName=device1
&<公共请求参数>
正常返回示例
XML
格式
<EnableFreeStorageResponse>
<RequestId>E******7-4***-***B-8**E-D3********65</RequestId>
<Data>
<Type>1</Type>
<RemainQuota>1</RemainQuota>
<StartTimeUTC>2023-01-01T12:00:00Z</StartTimeUTC>
<EndTime>2024-0-01 12:00:00</EndTime>
<Months>12</Months>
<Lifecycle>3</Lifecycle>
<StartTime>2023-01-01 12:00:00</StartTime>
<Expired>0</Expired>
<Consumed>0</Consumed>
<EndTimeUTC>2024-01-01T12:00:00Z</EndTimeUTC>
</Data>
<Code>200</Code>
<Success>true</Success>
</EnableFreeStorageResponse>
JSON
格式
{
"RequestId": "E******7-4***-***B-8**E-D3********65",
"Data": {
"Type": 1,
"RemainQuota": 1,
"StartTimeUTC": "2023-01-01T12:00:00Z",
"EndTime": "2024-0-01 12:00:00",
"Months": 12,
"Lifecycle": 3,
"StartTime": "2023-01-01 12:00:00",
"Expired": 0,
"Consumed": 0,
"EndTimeUTC": "2024-01-01T12:00:00Z"
},
"Code": 200,
"Success": true
}
错误码
HttpCode |
错误码 |
错误信息 |
描述 |
400 | iot.vision.RequestParamError | Request parameter error. | 请求参数错误。 |
403 | iot.vision.RequestAuthFailed | Request auth failed. | 请求鉴权失败。 |
403 | iot.vision.RequestForbidden | Request forbidden. | 请求被禁止。 |
429 | iot.vision.RequestTrafficControl | Request traffic control. | 请求太频繁被限流。 |
400 | iot.vision.RequestFailed | Request failed. | 请求失败。 |
400 | iot.vision.UnexpectedInternalError | Unexpected internal error. | 未知内部错误。 |
400 | iot.vision.DeviceNoOwner | Device has no owner. | 设备没有绑定管理员。 |
400 | iot.vision.FreeStorageQuotaLimit | No enough free storage quota or exceed limit. | 免费试用的云存储配额不足或超限制。 |
访问错误中心查看更多错误码。
该文章对您有帮助吗?