CSN

CSN

  • API Reference
    • API function release records
    • Appendix
    • Bandwidth Package Related
      • Bandwidth package price inquiry
      • Bandwidth upgrade-downgrade for the bandwidth package
      • Bind a bandwidth package to a Cloud Smart Network
      • Create bandwidth package
      • Delete bandwidth package
      • Query bandwidth package list
      • Query the specified bandwidth package details
      • Unbind a bandwidth package from a Cloud Smart Network
      • Update bandwidth package
    • Cloud Smart Network Related
      • Create a Cloud Smart Network
      • Delete a Cloud Smart Network
      • Network instances loaded by the Cloud Smart Network
      • Network instances unloaded by the Cloud Smart Network
      • Query Cloud Smart Network details
      • Query Cloud Smart Network instance list
      • Query the list of Cloud Smart Network
      • Update a Cloud Smart Network
    • Common Headers and Error Responses
    • General Description
    • Ingress Management Related Interfaces
      • Add a routing entry
      • Create affiliation
      • Create learning relationship
      • Delete a learning relationship
      • Delete a routing entry
      • Delete an association relationship
      • Query association relationships
      • Query learning relationships
      • Query route table list
      • Query routing entries
    • Interface Overview
    • Region Bandwidth Related Interfaces
      • Create cross-region bandwidth
      • Delete cross-region bandwidth
      • Query cross-region bandwidth
      • Query the cross-region bandwidth of the specified Cloud Smart Network
      • Update cross-region bandwidth
    • Service domain
    • TGW Related Interfaces
      • Query routing entries of a TGW
      • Query TGW list
      • Update TGW information
  • FAQs
    • Consultation
  • Function Release Records
  • Operation guide
    • Cross-Account Authorization Management
      • Cancel Authorized Network Instance
      • Create Authorized Network Instance
      • Delete Authorized Network Instance
      • View Authorized Network Instance
    • Cross-Region Bandwidth Package Management
    • CSN Instance
      • Create CSN Instance
      • Delete CSN Instance
      • Modify CSN Instance
    • Identity and access management
    • Monitor and Operations
      • CSN Instance Diagnosis
    • Network instance
      • Add Cross-Account Network Instance
      • Add Local Account Network Instance
      • Adjust Network Instance Bandwidth
      • Uninstall Network Instance
    • Region Bandwidth Management
      • Adjust Region Bandwidth
      • Create cross-region bandwidth
      • Delete cross-region bandwidth
    • Route management
      • Association Relationship
        • Create affiliation
        • Delete affiliation
      • Custom route tables
        • Create custom route table
        • Delete custom route table
        • View Custom Route Table
      • Learning Relationship
        • Add Custom Route Entry
        • Create learning relationship
        • Delete Custom Route Entry
        • Delete learning relationship
        • Publish and Revoke Network Instance Route
        • View Route Entry
    • Tag Management
  • Product Description
    • Application scenarios
    • Introduction
    • Usage restrictions
  • Product pricing
  • SDK
    • GO-SDK
      • Bandwidth package
      • CSN Instance
      • Exception handling
      • Initialization
      • Install
      • Overview
      • Region Bandwidth
      • Route management
      • TGW
    • Java-SDK
      • CSN
      • Exception handling
      • Initialization
      • Install the SDK Package
      • Overview
      • Version history
    • Python-SDK
      • Bandwidth package
      • CSN Instance
      • Initialization
      • Region Bandwidth
      • Route management
      • TGW
  • Service Level Agreement (SLA)
    • Cloud Smart Network Service Level Agreement SLA
  • Typical Practices
    • CSN supports VPC custom route tables for secure traffic access
    • Multi-IDC Disaster Recovery via Cloud Smart Network
    • Multi-IDC Interconnection via Cloud Smart Network
    • Private Network VPC Interconnection with Edge Network
All documents
menu
No results found, please re-enter

CSN

  • API Reference
    • API function release records
    • Appendix
    • Bandwidth Package Related
      • Bandwidth package price inquiry
      • Bandwidth upgrade-downgrade for the bandwidth package
      • Bind a bandwidth package to a Cloud Smart Network
      • Create bandwidth package
      • Delete bandwidth package
      • Query bandwidth package list
      • Query the specified bandwidth package details
      • Unbind a bandwidth package from a Cloud Smart Network
      • Update bandwidth package
    • Cloud Smart Network Related
      • Create a Cloud Smart Network
      • Delete a Cloud Smart Network
      • Network instances loaded by the Cloud Smart Network
      • Network instances unloaded by the Cloud Smart Network
      • Query Cloud Smart Network details
      • Query Cloud Smart Network instance list
      • Query the list of Cloud Smart Network
      • Update a Cloud Smart Network
    • Common Headers and Error Responses
    • General Description
    • Ingress Management Related Interfaces
      • Add a routing entry
      • Create affiliation
      • Create learning relationship
      • Delete a learning relationship
      • Delete a routing entry
      • Delete an association relationship
      • Query association relationships
      • Query learning relationships
      • Query route table list
      • Query routing entries
    • Interface Overview
    • Region Bandwidth Related Interfaces
      • Create cross-region bandwidth
      • Delete cross-region bandwidth
      • Query cross-region bandwidth
      • Query the cross-region bandwidth of the specified Cloud Smart Network
      • Update cross-region bandwidth
    • Service domain
    • TGW Related Interfaces
      • Query routing entries of a TGW
      • Query TGW list
      • Update TGW information
  • FAQs
    • Consultation
  • Function Release Records
  • Operation guide
    • Cross-Account Authorization Management
      • Cancel Authorized Network Instance
      • Create Authorized Network Instance
      • Delete Authorized Network Instance
      • View Authorized Network Instance
    • Cross-Region Bandwidth Package Management
    • CSN Instance
      • Create CSN Instance
      • Delete CSN Instance
      • Modify CSN Instance
    • Identity and access management
    • Monitor and Operations
      • CSN Instance Diagnosis
    • Network instance
      • Add Cross-Account Network Instance
      • Add Local Account Network Instance
      • Adjust Network Instance Bandwidth
      • Uninstall Network Instance
    • Region Bandwidth Management
      • Adjust Region Bandwidth
      • Create cross-region bandwidth
      • Delete cross-region bandwidth
    • Route management
      • Association Relationship
        • Create affiliation
        • Delete affiliation
      • Custom route tables
        • Create custom route table
        • Delete custom route table
        • View Custom Route Table
      • Learning Relationship
        • Add Custom Route Entry
        • Create learning relationship
        • Delete Custom Route Entry
        • Delete learning relationship
        • Publish and Revoke Network Instance Route
        • View Route Entry
    • Tag Management
  • Product Description
    • Application scenarios
    • Introduction
    • Usage restrictions
  • Product pricing
  • SDK
    • GO-SDK
      • Bandwidth package
      • CSN Instance
      • Exception handling
      • Initialization
      • Install
      • Overview
      • Region Bandwidth
      • Route management
      • TGW
    • Java-SDK
      • CSN
      • Exception handling
      • Initialization
      • Install the SDK Package
      • Overview
      • Version history
    • Python-SDK
      • Bandwidth package
      • CSN Instance
      • Initialization
      • Region Bandwidth
      • Route management
      • TGW
  • Service Level Agreement (SLA)
    • Cloud Smart Network Service Level Agreement SLA
  • Typical Practices
    • CSN supports VPC custom route tables for secure traffic access
    • Multi-IDC Disaster Recovery via Cloud Smart Network
    • Multi-IDC Interconnection via Cloud Smart Network
    • Private Network VPC Interconnection with Edge Network
  • Document center
  • arrow
  • CSN
  • arrow
  • SDK
  • arrow
  • Java-SDK
  • arrow
  • CSN
Table of contents on this page
  • Retrieve Endpoint
  • Retrieve AK/SK
  • Create CsnClient
  • Create a Cloud Smart Network
  • Update a Cloud Smart Network
  • Delete a Cloud Smart Network
  • Query the list of Cloud Smart Network
  • Query Cloud Smart Network instance list
  • Query Cloud Smart Network details
  • Network instances unloaded by the Cloud Smart Network
  • Network instances loaded by the Cloud Smart Network
  • Add a routing entry
  • Query routing entries
  • Delete a routing entry
  • Create learning relationship
  • Query learning relationships
  • Delete a learning relationship
  • Create affiliation
  • Query association relationships
  • Delete an association relationship
  • Query route table list
  • Query bandwidth package list
  • Query the specified bandwidth package details
  • Create bandwidth package
  • Update bandwidth package
  • Delete bandwidth package
  • Bandwidth upgrade/downgrade for the bandwidth package
  • Unbind a bandwidth package from a Cloud Smart Network
  • Bind a bandwidth package to a Cloud Smart Network
  • Bandwidth package price inquiry
  • Query cross-region bandwidth
  • Create cross-region bandwidth
  • Update cross-region bandwidth
  • Delete cross-region bandwidth
  • Query the cross-region bandwidth of the specified Cloud Smart Network
  • Query TGW list
  • Update TGW information
  • Query routing entries of a TGW
  • Appendix

CSN

Updated at:2025-11-11

Retrieve Endpoint

Before configuring the endpoint for SDK usage, please refer to the developer guide section on CSN Service Domain Name to understand endpoint-related concepts.

Note: CSN API supports both HTTP and HTTPS calling methods. To enhance data security, it is recommended to call via HTTPS.

Retrieve AK/SK

To use Baidu AI Cloud CSN, you must have a valid AK (Access Key ID) and SK (Secret Access Key) for signature authentication. These AK/SK credentials are system-generated strings used to identify users and authenticate service access. You can obtain and review your AK/SK information using the following steps:

  1. Register a Baidu AI Cloud account
  2. Create AK/SK

Create CsnClient

CsnClient serves as the client for CSN services, providing developers with a range of methods to interact with CSN services. When creating a CsnClient, first configure a BCE client configuration-type config instance using endpoint, AK and SK, and then use the config instance to configure the CsnClient. The specific configuration method is as follows:

Java
1static final String ENDPOINT = "";
2static final String AK = "";
3static final String SK = "";
4BceClientConfiguration config = new BceClientConfiguration();
5config.setCredentials(new DefaultBceCredentials(AK, SK));
6config.setEndpoint(ENDPOINT);
7CsnClien csnClient = new CsnClien(config);

Create a Cloud Smart Network

Function declaration

Java
1public CreateCsnResponse createCsn(CreateCsnRequest body, String clientToken) {
2    ......
3}

Parameter meaning

Please refer to the OpenAPI documentation: Request Parameters for Creating Cloud Smart Network

Response value

  • Operation succeeded
Plain Text
1{
2 "metadata": For details, refer to the metadata section in the appendix,
3    "csnId":"csn-c5s0isempeiscgyc"
4}
  • Operation failed

For response exception list of operation failure, refer to CSN Exception List

Code example

For specific code examples, refer to: ExampleCreateCsn.java

Update a Cloud Smart Network

Function declaration

Java
1public void updateCsn(String csnId, UpdateCsnRequest body, String clientToken) {
2    ......
3}

Parameter Meaning

Please refer to the OpenAPI documentation: Request Parameters for Updating Cloud Smart Network

Response value

  • Operation succeeded

No response value

  • Operation failed

For response exception list of operation failure, refer to CSN Exception List

Code example

For specific code examples, please refer to: ExampleUpdateCsn.java

Delete a Cloud Smart Network

Function declaration

Java
1public void deleteCsn(String csnId, String clientToken) {
2    ......
3}

Parameter meaning

Please refer to the OpenAPI documentation: Request Parameters for Deleting Cloud Smart Network

Response Value

  • Operation succeeded

No response value

  • Operation failed

For response exception list of operation failure, refer to CSN Exception List

Code example

For specific code examples, please refer to: ExampleDeleteCsn.java

Query the list of Cloud Smart Network

Function declaration

Java
1public ListCsnResponse listCsn(String marker, Integer maxKeys) {
2    ......
3}

Parameter Meaning

Please refer to the OpenAPI documentation: Request Parameters for Querying Cloud Smart Network List

Response value

  • Operation succeeded
Plain Text
1{
2 "metadata": For details, refer to the metadata section in the appendix,
3    "nextMarker": "csn-pls0isempeiscg65",
4    "marker": "csn-c5s0isempeiscgyc",
5    "maxKeys": 1,
6    "isTruncated": true,
7    "csns": [
8        {
9          "csnId":"csn-c5s0isempeiscgyc",
10          "name":"csn",
11          "description":"desc",
12          "instanceNum":5,
13          "csnBpNum":3
14        }
15    ]
16}
  • Operation failed

For response exception list of operation failure, refer to CSN Exception List

Code example

For specific code examples, please refer to: ExampleListCsn.java

Query Cloud Smart Network instance list

Function declaration

Java
1public ListInstanceResponse listInstance(String csnId, String marker, Integer maxKeys) {
2    ......
3}

Parameter meaning

Please refer to the OpenAPI documentation: Request Parameters for Querying Network Instances from Cloud Smart Network

Response value

  • Operation succeeded
Plain Text
1{
2 "metadata": For details, refer to the metadata section in the appendix,
3    "nextMarker": "tgwAttach-lo3tykku6sga06",
4    "marker": "tgwAttach-zuk33tykku6sgabu",
5    "maxKeys": 1,
6    "isTruncated": true,
7    "instances": [
8        {
9            "attachId": "tgwAttach-rvu8tkaubphb78eg",
10            "instanceType": "vpc",
11            "instanceId": "vpc-3f2380nmcfn1",
12            "instanceName": "hzb_2_csn",
13            "instanceRegion": "bj",
14            "instanceAccountId": "1beb4ad4762746db96941a5ad253ac8c",
15            "status": "attached"
16        }
17    ]
18}
  • Operation failed

For response exception list of operation failure, refer to CSN Exception List

Code example

For specific code examples, please refer to: ExampleListInstance.java

Query Cloud Smart Network details

Function declaration

Java
1public GetCsnResponse getCsn(String csnId) {
2    ......
3}

Parameter Meaning

Please refer to the OpenAPI documentation: Detailed Request Parameters for Querying Cloud Smart Network

Response Value

  • Operation succeeded
Plain Text
1{
2 "metadata": For details, refer to the metadata section in the appendix,
3    "name":"csn",
4    "description":"desc",
5    "csnId":"csn-c5s0isempeiscgyc",
6    "status": "active",
7    "instanceNum":5,
8    "csnBpNum":3
9}
  • Operation failed

For response exception list of operation failure, refer to CSN Exception List

Code example

For specific code examples, please refer to: ExampleGetCsn.java

Network instances unloaded by the Cloud Smart Network

Function declaration

Java
1public void detachInstance(String csnId, DetachInstanceRequest detachInstanceRequest, String clientToken) {
2    ......
3}

Parameter meaning

Please refer to the OpenAPI documentation: Request Parameters for Unloading Network Instances from Cloud Smart Network

Response value

  • Operation succeeded

No response value

  • Operation failed

For response exception list of operation failure, refer to CSN Exception List

Code example

For specific code examples, please refer to: ExampleDetachInstance.java

Network instances loaded by the Cloud Smart Network

Function declaration

Java
1public void attachInstance(String csnId, AttachInstanceRequest attachInstanceRequest, String clientToken) {
2    ......
3}

Parameter meaning

Please refer to the OpenAPI documentation: Request Parameters for Loading Network Instances from Cloud Smart Network

Response value

  • Operation succeeded

No response value

  • Operation failed

For response exception list of operation failure, refer to CSN Exception List

Code example

For specific code examples, refer to ExampleAttachInstance.java

Add a routing entry

Function declaration

Java
1public void createRouteRule(String csnRtId, CreateRouteRuleRequest createRouteRuleRequest, String clientToken) {
2    ......
3}

Parameter meaning

Please refer to the OpenAPI documentation: Request Parameters for Adding Routing Entries

Response value

  • Operation succeeded

No response value

  • Operation failed

For response exception list of operation failure, refer to CSN Exception List

Code example

For specific code examples, refer to: ExampleCreateRouteRule.java

Query routing entries

Function declaration

Java
1public ListRouteRuleResponse listRouteRule(String csnRtId, String marker, Integer maxKeys) {
2    ......
3}

Parameter Meaning

Refer to OpenAPI documentation: Request Parameters for Querying Route Entries

Response value

  • Operation succeeded
Plain Text
1{
2 "metadata": For details, refer to the metadata section in the appendix,
3    "nextMarker": "csnrr-IyWRn123",
4    "marker": "csnrr-IyWRnII7",
5    "maxKeys": 1,
6    "isTruncated": true,
7    "csnRtRules": [
8          {
9                "ruleId": "cnrr-1db26d78-1781",
10                "routeType": "propagated",
11                "csnId": "csn-m3dwj6tfysnmxmcy",
12                "csnRtId": "csnRt-w3x16fk8nr5kpxkx",
13                "description": null,
14                "fromAttachId": "tgwAttach-wg3z1z5baq3ry1a6",
15                "status": "conflicted",
16                "sourceAddress": null,
17                "destAddress": "192.168.0.0/20",
18                "nextHopId": "vpc-fh43ygs8yp0d",
19 "nextHopName": "Default Virtual Private Cloud",
20                "nextHopRegion": "su",
21                "nextHopType": "vpc",
22                "asPath": "",
23                "community": "",
24                "blackHole": false
25           }
26   ]
27}
  • Operation failed

For response exception list of operation failure, refer to CSN Exception List

Code example

For specific code examples, refer to: ExampleListRouteRule.java

Delete a routing entry

Function declaration

Java
1public void deleteRouteRule(String csnRtId, String csnRtRuleId, String clientToken) {
2    ......
3}

Parameter Meaning

Please refer to the OpenAPI documentation: Request Parameters for Deleting Routing Entries

Response Value

  • Operation succeeded

No response value

  • Operation failed

For response exception list of operation failure, refer to CSN Exception List

Code example

For specific code examples, refer to: ExampleDeleteRouteRule.java

Create learning relationship

Function declaration

Java
1public void createPropagation(String csnRtId, CreatePropagationRequest createPropagationRequest, String clientToken) {
2    ......
3}

Parameter Meaning

Please refer to the OpenAPI documentation: Request Parameters for Creating Learning Relationships

Response Value

  • Operation succeeded

No response value

  • Operation failed

For response exception list of operation failure, refer to CSN Exception List

Code example

For specific code examples, please refer to: ExampleCreatePropagation.java

Query learning relationships

Function declaration

Java
1public ListPropagationResponse listPropagation(String csnRtId) {
2    ......
3}

Parameter meaning

Please refer to the OpenAPI documentation: Request Parameters for Querying Learning Relationships

Response value

  • Operation succeeded
Plain Text
1{
2 "metadata": For details, refer to the metadata section in the appendix,
3    "propagations":[
4        {
5            "attachId":"tgwAttach-kfdccn8a6pip0qd1",
6            "description":"default",
7            "instanceName":"test-03",
8            "instanceRegion":"bj",
9            "instanceId":"vpc-v3ku2mhsyxvn",
10            "instanceType":"vpc",
11            "status":"enable"
12        }
13    ]
14}
  • Operation failed

For response exception list of operation failure, refer to CSN Exception List

Code example

For specific code examples, refer to: ExampleListPropagation.java

Delete a learning relationship

Function declaration

Java
1public void deletePropagation(String csnRtId, String attachId, String clientToken) {
2    ......
3}

Parameter Meaning

Please refer to the OpenAPI documentation: Request Parameters for Deleting Learning Relationships

Response value

  • Operation succeeded

No response value

  • Operation failed

For response exception list of operation failure, refer to CSN Exception List

Code example

For specific code examples, please refer to: ExampleDeletePropagation.java

Create affiliation

Function declaration

Java
1public void createAssociation(String csnRtId, CreateAssociationRequest createAssociationRequest, String clientToken) {
2    ......
3}

Parameter meaning

Please refer to the OpenAPI documentation: Request Parameters for Creating Association Relationships

Response Value

  • Operation succeeded

No response value

  • Operation failed

For response exception list of operation failure, refer to CSN Exception List

Code example

For specific code examples, please refer to: ExampleCreateAssociation.java

Query association relationships

Function declaration

Java
1public ListAssociationResponse listAssociation(String csnRtId) {
2    ......
3}

Parameter Meaning

Please refer to the OpenAPI documentation: Request Parameters for Querying Association Relationships

Response Value

  • Operation succeeded
Plain Text
1{
2 "metadata": For details, refer to the metadata section in the appendix,
3    "associations":[
4        {
5            "attachId":"tgwAttach-kfdccn8a6pip0qd1",
6            "description":"desc",
7            "instanceId":"vpc-v3ku2mhsyxvn",
8            "instanceName":"test-03",
9            "instanceRegion":"bj",
10            "instanceType":"vpc",
11            "status":"active"
12        }
13    ]
14}
  • Operation failed

For response exception list of operation failure, refer to CSN Exception List

Code example

For specific code examples, please refer to: ExampleListAssociation.java

Delete an association relationship

Function declaration

Java
1public void deleteAssociation(String csnRtId, String attachId, String clientToken) {
2    ......
3}

Parameter meaning

Please refer to the OpenAPI documentation: Request Parameters for Deleting Association Relationships

Response value

  • Operation succeeded

No response value

  • Operation failed

For response exception list of operation failure, refer to CSN Exception List

Code example

For specific code examples, please refer to: ExampleDeleteAssociation.java

Query route table list

Function declaration

Java
1public ListRouteTableResponse listRouteTable(String csnId, String marker, Integer maxKeys) {
2    ......
3}

Parameter meaning

Please refer to the OpenAPI documentation: Request Parameters for Querying Route Table List

Response value

  • Operation succeeded
Plain Text
1{
2 "metadata": For details, refer to the metadata section in the appendix,
3    "marker": null,
4    "isTruncated": true,
5    "nextMarker": "csnBp-iuc756n5kkda",
6    "maxKeys": 1,
7    "csnRts": [
8         {
9            "csnRtId": "csn-rt-uezhhw306g5be3gb",
10            "name": "csnRtName",
11            "description": "desc",
12            "type": "default"
13        }
14    ]
15}
  • Operation failed

For response exception list of operation failure, refer to CSN Exception List

Code example

For specific code examples, please refer to: ExampleListRouteTable.java

Query bandwidth package list

Function declaration

Java
1public ListCsnBpResponse listCsnBp(String marker, Integer maxKeys) {
2    ......
3}

Parameter meaning

Please refer to the OpenAPI documentation: Request Parameters for Querying Bandwidth Package List

Response value

  • Operation succeeded
Plain Text
1{
2 "metadata": For details, refer to the metadata section in the appendix,
3    "marker": "csnBp-gdrf6fukb36u",
4    "isTruncated": true,
5    "nextMarker": "csnBp-iuc756n5kkda",
6    "maxKeys": 1,
7    "csnBps": [
8                {
9                    "csnBpId": "csnBp - gdrf6fukb36u",
10                    "name": "csnBp",
11                    "bandwidth": 100,
12                    "usedBandwidth": 10,
13                    "csnId": "",
14                    "interworkType": "center",
15                    "interworkRegion": "chinesemainland",
16                    "status": "available",
17                    "paymentTiming": "Prepaid",
18                    "expiredTime": "2018-08-13T08:10:59Z",
19                    "createTime": "2021-04-25 17:22:34"
20                }
21    ]
22}
  • Operation failed

For response exception list of operation failure, refer to CSN Exception List

Code example

For specific code examples, please refer to: ExampleListCsnBp.java

Query the specified bandwidth package details

Function declaration

Java
1public GetCsnBpResponse getCsnBp(String csnBpId) {
2    ......
3}

Parameter Meaning

Please refer to the OpenAPI documentation: Request Parameters for Querying Specified Bandwidth Package Details

Response value

  • Operation succeeded
Plain Text
1{
2 "metadata": For details, refer to the metadata section in the appendix,
3    "csnBpId":"csnBp-gdrf6fukb36u",
4    "name":"csnBp",
5    "bandwidth":100,
6    "usedBandwidth":10,
7    "csnId":"",
8    "interworkType":"center",
9    "interworkRegion":"chinesemainland",
10    "status":"available",
11    "paymentTiming":"Prepaid",
12    "expireTime":"2018-08-13T08:10:59Z",
13    "createdTime":"2021-04-25 17:22:34"
14}
  • Operation failed

For response exception list of operation failure, refer to CSN Exception List

Code example

For specific code examples, please refer to: ExampleGetCsnBp.java

Create bandwidth package

Function declaration

Java
1public CreateCsnBpResponse createCsnBp(CreateCsnBpRequest createCsnBpRequest, String clientToken) {
2    ......
3}

Parameter meaning

Please refer to the OpenAPI documentation: Request Parameters for Creating Bandwidth Package

Response value

  • Operation succeeded
Plain Text
1{
2 "metadata": For details, refer to the metadata section in the appendix,
3    "csnBpId":"csnBp-gdrf6fukb36u"
4}
  • Operation failed

For response exception list of operation failure, refer to CSN Exception List

Code example

For specific code examples, please refer to: ExampleCreateCsnBp.java

Update bandwidth package

Function declaration

Java
1public void updateCsnBp(String csnBpId, UpdateCsnBpRequest updateCsnBpRequest, String clientToken) {
2    ......
3}

Parameter meaning

Please refer to the OpenAPI documentation: Request Parameters for Updating Bandwidth Package

Response value

  • Operation succeeded

No response value

  • Operation failed

For response exception list of operation failure, refer to CSN Exception List

Code example

For specific code examples, please refer to: ExampleUpdateCsnBp.java

Delete bandwidth package

Function declaration

Java
1public void deleteCsnBp(String csnBpId, String clientToken) {
2    ......
3}

Parameter meaning

Please refer to the OpenAPI documentation: Request Parameters for Deleting Bandwidth Package

Response value

  • Operation succeeded

No response value

  • Operation failed

For response exception list of operation failure, refer to CSN Exception List

Code example

For specific code examples, please refer to: ExampleDeleteCsnBp.java

Bandwidth upgrade/downgrade for the bandwidth package

Function declaration

Java
1public void resizeCsnBp(String csnBpId, ResizeCsnBpRequest resizeCsnBpRequest, String clientToken) {
2    ......
3}

Parameter meaning

Please refer to the OpenAPI documentation: Request Parameters for Bandwidth Upgrade/Downgrade of Bandwidth Packages

Response value

  • Operation succeeded

No response value

  • Operation failed

For response exception list of operation failure, refer to CSN Exception List

Code example

For specific code examples, please refer to: ExampleResizeCsnBp.java

Unbind a bandwidth package from a Cloud Smart Network

Function declaration

Java
1public void unbindCsnBp(String csnBpId, UnbindCsnBpRequest unbindCsnBpRequest, String clientToken) {
2    ......
3}

Parameter meaning

Please refer to the OpenAPI documentation: Request Parameters for Unbinding Bandwidth Package from Cloud Smart Network

Response value

  • Operation succeeded

No response value

  • Operation failed

For response exception list of operation failure, refer to CSN Exception List

Code example

For specific code examples, please refer to: ExampleUnbindCsnBp.java

Bind a bandwidth package to a Cloud Smart Network

Function declaration

Java
1public void bindCsnBp(String csnBpId, BindCsnBpRequest bindCsnBpRequest, String clientToken) {
2    ......
3}

Parameter Meaning

Please refer to the OpenAPI documentation: Request Parameters for Unbinding Bandwidth Package from Cloud Smart Network

Response value

  • Operation succeeded

No response value

  • Operation failed

For response exception list of operation failure, refer to CSN Exception List

Code example

For specific code examples, please refer to: ExampleBindCsnBp.java

Bandwidth package price inquiry

Function declaration

Java
1public CsnBpPriceResponse csnBpPrice(CsnBpPriceRequest csnBpPriceRequest) {
2    ......
3}

Parameter meaning

Please refer to the OpenAPI documentation: Request Parameters for Bandwidth Package Inquiry

Response value

  • Operation succeeded
Plain Text
1{
2 "metadata": For details, refer to the metadata section in the appendix,
3    "price":"440"
4}
  • Operation failed

For response exception list of operation failure, refer to CSN Exception List

Code example

For specific code examples, refer to ExampleCsnBpPrice.java

Query cross-region bandwidth

Function declaration

Java
1public ListCsnBpLimitResponse listCsnBpLimit(String csnBpId) {
2    ......
3}

Parameter meaning

Please refer to the OpenAPI documentation: Request Parameters for Querying Cross-Region Bandwidth

Response value

  • Operation succeeded
Plain Text
1{
2 "metadata": For details, refer to the metadata section in the appendix,
3    "bpLimits":[
4        {
5            "csnBpId": "csnBp-nkyiykbbu9js",
6            "localRegion": "cn-hangzhou-cm",
7            "peerRegion": "bj",
8            "bandwidth": 4,
9            "csnId": "csn-uftcf4rvrbjii95r"
10        }
11    ]
12}
  • Operation failed

For response exception list of operation failure, refer to CSN Exception List

Code example

For specific code examples, please refer to: ExampleListCsnBpLimit.java

Create cross-region bandwidth

Function declaration

Java
1public void createCsnBpLimit(String csnBpId, CreateCsnBpLimitRequest createCsnBpLimitRequest, String clientToken) {
2    ......
3}

Parameter meaning

Please refer to the OpenAPI documentation: Request Parameters for Creating Cross-Region Bandwidth

Response value

  • Operation succeeded

No response value

  • Operation failed

For response exception list of operation failure, refer to CSN Exception List

Code example

For specific code examples, please refer to: ExampleCreateCsnBpLimit.java

Update cross-region bandwidth

Function declaration

Java
1public void updateCsnBpLimit(String csnBpId, UpdateCsnBpLimitRequest updateCsnBpLimitRequest, String clientToken) {
2    ......
3}

Parameter meaning

Please refer to the OpenAPI documentation: Request Parameters for Updating Cross-Region Bandwidth

Response value

  • Operation succeeded

No response value

  • Operation failed

For response exception list of operation failure, refer to CSN Exception List

Code example

For specific code examples, please refer to: ExampleUpdateCsnBpLimit.java

Delete cross-region bandwidth

Function declaration

Java
1public void deleteCsnBpLimit(String csnBpId, DeleteCsnBpLimitRequest deleteCsnBpLimitRequest, String clientToken) {
2    ......
3}

Parameter meaning

Please refer to the OpenAPI documentation: Request Parameters for Deleting Cross-Region Bandwidth

Response Value

  • Operation succeeded

No response value

  • Operation failed

For response exception list of operation failure, refer to CSN Exception List

Code example

For specific code examples, please refer to: ExampleDeleteCsnBpLimit.java

Query the cross-region bandwidth of the specified Cloud Smart Network

Function declaration

Java
1public ListCsnBpLimitByCsnIdResponse listCsnBpLimitByCsnId(String csnId) {
2    ......
3}

Parameter meaning

Please refer to the OpenAPI documentation: Request Parameters for Querying Cross-Region Bandwidth of a Specified Cloud Smart Network (CSN)

Response value

  • Operation succeeded
Plain Text
1{
2 "metadata": For details, refer to the metadata section in the appendix,
3    "bpLimits":[
4        {
5            "csnBpId": "csnBp-nkyiykbbu9js",
6            "localRegion": "cn-hangzhou-cm",
7            "peerRegion": "bj",
8            "bandwidth": 4,
9            "csnId": "csn-uftcf4rvrbjii95r"
10        }
11    ]
12}
  • Operation failed

For response exception list of operation failure, refer to CSN Exception List

Code example

For specific code examples, please refer to: ExampleListCsnBpLimitByCsnId.java

Query TGW list

Function declaration

Java
1public ListTgwResponse listTgw(String csnId, String marker, Integer maxKeys) {
2    ......
3}

Parameter meaning

Please refer to the OpenAPI documentation: Request Parameters for Querying TGW List

Response value

  • Operation succeeded
Plain Text
1{
2 "metadata": For details, refer to the metadata section in the appendix,
3    "nextMarker": "tgw-jkxx0kmm0t86vkfk",
4    "marker": "tgw-qhxx0kmm0t86vmpk",
5    "maxKeys": 1,
6    "isTruncated": true,
7    "tgws": [
8        {
9            "tgwId": "tgw-vhw0idtdwbxi7n0p",
10            "csnId": "csn-3cq38gxc8irzuu0x",
11            "name": "tgw_1",
12            "description": "desc",
13            "region": "bj"
14        }
15    ]
16}
  • Operation failed

For response exception list of operation failure, refer to CSN Exception List

Code example

For specific code examples, please refer to: ExampleListTgw.java

Update TGW information

Function declaration

Java
1public void updateTgw(String csnId, String tgwId, UpdateTgwRequest updateTgwRequest, String clientToken) {
2    ......
3}

Parameter meaning

Please refer to the OpenAPI documentation: Request Parameters for Updating TGW Information

Response value

  • Operation succeeded

No response value

  • Operation failed

For response exception list of operation failure, refer to CSN Exception List

Code example

For specific code examples, please refer to: ExampleUpdateTgw.java

Query routing entries of a TGW

Function declaration

Java
1public ListTgwRuleResponse listTgwRule(String csnId, String tgwId, String marker, Integer maxKeys) {
2    ......
3}

Parameter Meaning

Refer to OpenAPI documentation: Request Parameters for Querying TGW Route Entries

Response value

  • Operation succeeded
Plain Text
1{
2 "metadata": For details, refer to the metadata section in the appendix,
3    "nextMarker": "tgw-jkxx0kmm0t86vkfk",
4    "marker": "tgw-qhxx0kmm0t86vmpk",
5    "maxKeys": 1,
6    "isTruncated": true,
7    "tgwRtRules": [
8        {
9            "ruleId": "cnrr-1db26d78-1781",
10            "routeType": "custom",
11            "csnId": "csn-m3dwj6tfysnmxmcy",
12            "csnRtId": "csnRt-w3x16fk8nr5kpxkx",
13            "fromAttachId": "tgwAttach-wg3z1z5baq3ry1a6",
14            "status": "conflicted",
15            "destAddress": "192.168.0.0/20",
16            "nextHopId": "vpc-fh43ygs8yp0d",
17 "nextHopName": "Default Virtual Private Cloud",
18            "nextHopRegion": "su",
19            "nextHopType": "vpc",
20            "asPath": "",
21            "community": "",
22            "blackHole": false
23        }
24    ]
25}
  • Operation failed

For response exception list of operation failure, refer to CSN Exception List

Code example

For specific code examples, please refer to: ExampleListTgwRule.java

Appendix

Public response information in Metadata format

Plain Text
1{
2      "bceRequestId":"f5f0821d-45fe-439b-bbf4-fc48b639f84a",
3      "contentLength":28,
4      "contentType":"application/json;charset=UTF-8",
5      "date":1701917695000,
6      "server":"openresty/1.15.8.1"
7}

Previous
GO-SDK
Next
Exception handling