You need to enable JavaScript to run this app.
导航

修改指定带宽包信息

最近更新时间2023.07.07 14:27:51

首次发布时间2023.06.27 15:39:07

本文介绍如何修改指定带宽包的信息。

示例代码

from __future__ import print_function
import volcenginesdkcore
import volcenginesdkcen
from pprint import pprint
from volcenginesdkcore.rest import ApiException

if __name__ == '__main__':
    configuration = volcenginesdkcore.Configuration()
    #设置您的ak
    configuration.ak = "AK"
    #设置您的sk
    configuration.sk = "SK"
    #设置您要访问的地域
    configuration.region = "cn-beijing"
    #设置默认配置
    volcenginesdkcore.Configuration.set_default(configuration)

    # 使用全局默认配置
    api_instance = volcenginesdkcen.CENApi()
    #修改指定带宽包的信息
    modify_cen_bandwidth_package_attributes_request = volcenginesdkcen.ModifyCenBandwidthPackageAttributesRequest(
        bandwidth=100, # 带宽包的带宽上限
        cen_bandwidth_package_id="cbp-4c2zaavbvh5fx****",  # 带宽包的ID
    )

    #发起请求并处理返回或异常
    try:
        resp = api_instance.modify_cen_bandwidth_package_attributes(modify_cen_bandwidth_package_attributes_request)
        pprint(resp)
    except ApiException as e:
        print("Exception when calling api: %s\n" % e)

相关文档