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

修改指定带宽包信息

最近更新时间2023.06.27 15:39:07

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

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

示例代码

package com.volcengine.cen.examples;

import com.volcengine.ApiClient;
import com.volcengine.ApiException;
import com.volcengine.sign.Credentials;

import com.volcengine.cen.CenApi;
import com.volcengine.cen.model.*;


public class TestModifyCenBandwidthPackageAttributes {
    public static void main(String[] args) throws Exception {
        //设置您的ak
        String ak = "Your AK";
        //设置您的sk
        String sk = "Your SK";
        //设置您要访问的地域
        String region = "Your Region";

        //初始化apiclient
        ApiClient apiClient = new ApiClient()
                .setCredentials(Credentials.getCredentials(ak, sk))
                .setRegion(region);

        CenApi api = new CenApi(apiClient);
        
        //修改指定带宽包的信息
        ModifyCenBandwidthPackageAttributesRequest modifyCenBandwidthPackageAttributesRequest = new ModifyCenBandwidthPackageAttributesRequest();
        modifyCenBandwidthPackageAttributesRequest.setBandwidth(100);  //带宽包的带宽上限
        modifyCenBandwidthPackageAttributesRequest.setCenBandwidthPackageId("cbp-4c2zaavbvh5fx****"); //带宽包的ID
        
        //发起请求并处理返回或异常
        try {
            ModifyCenBandwidthPackageAttributesResponse response = api.modifyCenBandwidthPackageAttributes(modifyCenBandwidthPackageAttributesRequest);
            System.out.println(response);
        } catch (ApiException e) {
            System.out.println(e.getResponseBody());
        }
    }
}

相关文档