You need to enable JavaScript to run this app.
文档中心
文档控制台
注册
费用中心

费用中心

复制全文
下载 pdf
实例
SetRenewalType - 设置实例续费类型
复制全文
下载 pdf
SetRenewalType - 设置实例续费类型

为一个实例设置续费类型,包括自动续费、手动续费、到期不续费

使用说明

  1. 使用此接口设置自动续费时,仅支持续费符合续费规则的包年包月实例或包月预留实例券
  2. 续费规则可参考续费规则概览--费用中心-火山引擎,机器学习平台暂不支持OpenAPI设置自动续费
  3. 已到期、即将关停/已关停实例,仅支持设置为手动续费
  4. 预留实例券到期后不支持设置续费类型
  5. 包年包月实例到期回收后不支持设置续费类型,退订关停实例不支持设置续费类型

注意事项

  1. 单账号QPS上限为30
  2. 子用户使用该接口时,应具备BillingCenterFullAccess或BillingCenterRenewAccess权限策略

请求参数

下表仅列出该接口特有的请求参数和部分公共参数。更多信息请见公共参数

const columns = [
  {
    width: '20%',
    title: '参数',
    dataIndex: 'Name',
    className: 'openapi-doc-parameter-table-name'
  },
  {
    width: 130,
    title: '类型',
    dataIndex: 'DataType',
    className: 'openapi-doc-parameter-table-type'
  },
  {
    width: 90,
    title: '是否必填',
    dataIndex: 'IsRequired',
    className: 'openapi-doc-parameter-table-required'
  },
  {
    width: '20%',
    title: '示例值',
    dataIndex: 'Example',
    className: 'openapi-doc-parameter-table-example'
  },
  {
    title: '描述',
    dataIndex: 'Description',
    className: 'openapi-doc-parameter-table-description'
  },
];

const data = [
  {
    rowKey: '->Action',
    Name: 'Action',
    DataType: 'String',
    IsRequired: '是',
    Example: <RenderMd content={"SetRenewalType"} />,
    Description: <RenderMd content={"要执行的操作,取值:SetRenewalType。"} />,
    children: [
    ]
  },
  {
    rowKey: '->Version',
    Name: 'Version',
    DataType: 'String',
    IsRequired: '是',
    Example: <RenderMd content={"2022-01-01"} />,
    Description: <RenderMd content={"API的版本,取值:2022-01-01。"} />,
    children: [
    ]
  },
  {
    rowKey: '->InstanceID',
    Name: 'InstanceID',
    DataType: 'String',
    IsRequired: '是',
    Example: <RenderMd content={"ins123"} />,
    Description: <RenderMd content={"实例ID,仅支持指定一个"} />,
    children: [
    ]
  },
  {
    rowKey: '->Product',
    Name: 'Product',
    DataType: 'String',
    IsRequired: '是',
    Example: <RenderMd content={"ECS"} />,
    Description: <RenderMd content={"实例ID对应的商品编码"} />,
    children: [
    ]
  },
  {
    rowKey: '->RenewType',
    Name: 'RenewType',
    DataType: 'String',
    IsRequired: '是',
    Example: <RenderMd content={"AutoRenewal"} />,
    Description: <RenderMd content={"续费类型\n手动续费:ManualRenewal\n自动续费:AutoRenewal\n到期不续费:NonRenewal"} />,
    children: [
    ]
  },
  {
    rowKey: '->RenewalDurationUnit',
    Name: 'RenewalDurationUnit',
    DataType: 'String',
    IsRequired: '否',
    Example: <RenderMd content={"Year"} />,
    Description: <RenderMd content={"自动续费周期单位\n当 RenewType = AutoRenewal 时,必须设置\n天:Day\n月:Month\n年:Year"} />,
    children: [
    ]
  },
  {
    rowKey: '->RenewalDuration',
    Name: 'RenewalDuration',
    DataType: 'Long',
    IsRequired: '否',
    Example: <RenderMd content={"1"} />,
    Description: <RenderMd content={"单次自动续费时长\n当 RenewType = AutoRenewal 时,必须设置\n如果是天,支持:1~365\n如果是月,支持:1~12,24,36\n如果是年,支持:1~3"} />,
    children: [
    ]
  },
  {
    rowKey: '->RenewalTimes',
    Name: 'RenewalTimes',
    DataType: 'Long',
    IsRequired: '否',
    Example: <RenderMd content={"1"} />,
    Description: <RenderMd content={"自动续费次数\n不填写时,默认永久有效\n如果限制续费次数,支持:1~100"} />,
    children: [
    ]
  },
  {
    rowKey: '->SetRenewalRelatedInstance',
    Name: 'SetRenewalRelatedInstance',
    DataType: 'Boolean',
    IsRequired: '否',
    Example: <RenderMd content={"true"} />,
    Description: <RenderMd content={"是否同一实例组内的强关系实例一起设置续费类型\ntrue : 一起设置\nfalse: 不一起设置(若存在强绑定关系实例则报错) "} />,
    children: [
    ]
  },
  {
    rowKey: '->ClientToken',
    Name: 'ClientToken',
    DataType: 'String',
    IsRequired: '否',
    Example: <RenderMd content={"t12345ghfj"} />,
    Description: <RenderMd content={"幂等token, (36 字符)多次调用传入同样的值,会返回第一次请求的响应。多次请求使用同一个token 请求内容却发生了变化会报错"} />,
    children: [
    ]
  },

];

return (<Table
  rowKey="rowKey"
  className="openapi-doc-parameter-table"
  columns={columns}
  data={data}
  border={ { cell: true, wrapper: true } }
  scroll={ { x: "auto" } }
  pagination={false}
/>);

返回参数

下表仅列出本接口特有的返回参数。更多信息请参见返回结构

const columns = [
  {
    width: '25%',
    title: '参数',
    dataIndex: 'Name',
    className: 'openapi-doc-parameter-table-name',
  },
  {
    width: 130,
    title: '类型',
    dataIndex: 'DataType',
    className: 'openapi-doc-parameter-table-type'
  },
  {
    width: '25%',
    title: '示例值',
    dataIndex: 'Example',
    className: 'openapi-doc-parameter-table-example'
  },
  {
    title: '描述',
    dataIndex: 'Description',
    className: 'openapi-doc-parameter-table-description'
  },
];

const data = [
  {
    rowKey: "->SuccessInstanceList",
    Name: "SuccessInstanceList",
    DataType: "Array of Object",
    Example: <RenderMd content={" [\n      {\n        \"InstanceID\": \"ins23\",\n        \"Product\": \"p1\"\n      }\n    ]"} />,
    Description: <RenderMd content={"设置续费类型成功实例列表"} />,
    children: [
        {
          rowKey: "->SuccessInstanceList->InstanceID",
          Name: "InstanceID",
          DataType: "String",
          Example: <RenderMd content={""} />,
          Description: <RenderMd content={"实例ID"} />,
          children: [
          ]
        },
        {
          rowKey: "->SuccessInstanceList->Product",
          Name: "Product",
          DataType: "String",
          Example: <RenderMd content={""} />,
          Description: <RenderMd content={"商品code"} />,
          children: [
          ]
        },
    ]
  },
];

return (<Table
  rowKey="rowKey"
  className="openapi-doc-parameter-table"
  columns={columns}
  data={data}
  border={ { cell: true, wrapper: true } }
  scroll={ { x: "auto" } }
  pagination={false}
/>);

请求示例

POST /?Action=SetRenewalType&Version=2022-01-01 HTTP/1.1
Host: billing.volcengineapi.com
Content-Type: application/json; charset=UTF-8
X-Date: 20250311T063207Z
X-Content-Sha256: 287e874e******d653b44d21e
Authorization: HMAC-SHA256 Credential=Adfks******wekfwe/20250311/cn-beijing/billing/request, SignedHeaders=host;x-content-sha256;x-date, Signature=47a7d934ff7b37c03938******cd7b8278a40a1057690c401e92246a0e41085f

{
  "InstanceID": "ins123",
  "Product": "ecs",
  "RenewType": "AutoRenewal",
  "RenewalDurationUnit": "Year",
  "RenewalDuration": 1,
  "RenewalTimes": 1,
  "SetRenewalRelatedInstance": true,
  "ClientToken": "t12345ghfj"
}

返回示例

{
  "ResponseMetadata": {
    "RequestId": "2025031114175308612821124786FDF9",
    "Action": "SetRenewalType",
    "Version": "2022-01-01",
    "Service": "billing",
    "Region": "cn-beijing"
  },
  "Result": {
    "SuccessInstanceList": [
      {
        "InstanceID": "b",
        "Product": "Z4yIpYlR"
      }
    ]
  }
}

错误码

下表为您列举了该接口与业务逻辑相关的错误码。公共错误码请参见公共错误码文档。

const columns = [
  {
    title: '状态码',
    dataIndex: 'HttpCode',
    width: '12%',
    className: 'openapi-doc-errorcode-table-httpcode'
  },
  {
    title: '错误码',
    dataIndex: 'ErrorCode',
    width: '22%',
    className: 'openapi-doc-errorcode-table-errorcode'
  },
  {
    title: '错误信息',
    dataIndex: 'ErrorMessage',
    width: '33%',
    className: 'openapi-doc-errorcode-table-errormessage'
  },
  {
    title: '说明',
    dataIndex: 'Description',
    width: '33%',
    className: 'openapi-doc-errorcode-table-description'
  },
];

const data = [
  {
    HttpCode: 400,
    ErrorCode: 'MissingParameter',
    ErrorMessage: <RenderMd content={"The request is missing %s parameter."} />,
    Description: <RenderMd content={"参数缺失"} />,
  },
  {
    HttpCode: 400,
    ErrorCode: 'InvalidParam',
    ErrorMessage: <RenderMd content={"The parameter %s is invalid."} />,
    Description: <RenderMd content={"参数无效"} />,
  },
  {
    HttpCode: 403,
    ErrorCode: 'RequestReject',
    ErrorMessage: <RenderMd content={"You have engaged in unauthorized operations, and the function is temporarily unavailable."} />,
    Description: <RenderMd content={"您涉及违规操作,暂时无法使用该功能"} />,
  },
  {
    HttpCode: 404,
    ErrorCode: 'RecordNotFound',
    ErrorMessage: <RenderMd content={"Record not found"} />,
    Description: <RenderMd content={"记录未找到"} />,
  },
  {
    HttpCode: 409,
    ErrorCode: 'IdempotentRequestConflict',
    ErrorMessage: <RenderMd content={"The request is already being processed. Please try again later."} />,
    Description: <RenderMd content={""} />,
  },
  {
    HttpCode: 412,
    ErrorCode: 'StatusWrong',
    ErrorMessage: <RenderMd content={"The instance's status is unexpected."} />,
    Description: <RenderMd content={""} />,
  },
  {
    HttpCode: 412,
    ErrorCode: 'CannotSetRenewalType',
    ErrorMessage: <RenderMd content={"This instance can not set renewal type."} />,
    Description: <RenderMd content={""} />,
  },
  {
    HttpCode: 429,
    ErrorCode: 'FrequentRequest',
    ErrorMessage: <RenderMd content={"Frequent operations, please try again later."} />,
    Description: <RenderMd content={"操作频繁,请稍后尝试"} />,
  },
  {
    HttpCode: 500,
    ErrorCode: 'InternalError',
    ErrorMessage: <RenderMd content={"Service has some internal Error. Pls Contact With Admin."} />,
    Description: <RenderMd content={"服务内部异常"} />,
  },
];

return (<Table
  columns={columns}
  data={data}
  border={ { cell: true, wrapper: true } }
  scroll={ { x: "auto" } }
  pagination={false}
/>);
最近更新时间:2025.07.07 14:18:53
这个页面对您有帮助吗?
有用
有用
无用
无用