Help Center/ Cloud Connect/ API Reference/ API/ Site Network Capabilities/ Querying the List of Site Network Capabilities
Updated on 2024-11-19 GMT+08:00

Querying the List of Site Network Capabilities

Function

This API is used to query the list of site network capabilities.

Calling Method

For details, see Calling APIs.

URI

GET /v3/{domain_id}/dcaas/site-network/capabilities

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

domain_id

Yes

String

Account ID.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

specification

No

Array of arrays

Site network capabilities. Multiple capabilities can be queried.

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

No

String

User token.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

request_id

String

Request ID.

capabilities

Array of SiteNetworkCapabilityEntry objects

List of site network capabilities.

Table 5 SiteNetworkCapabilityEntry

Parameter

Type

Description

id

String

Instance ID.

domain_id

String

ID of the account that the instance belongs to.

specification

String

Site network capabilities.

  • site-network.is-support: site networks

  • site-network.is-support-enterprise-project: enterprise projects for site networks

  • site-network.is-support-tag: site network tags

  • site-network.is-support-intra-region: site networks in the same region

  • site-network.support-topologies: site network topologies

  • site-network.support-regions: list of the regions that support site networks

  • site-network.support-dscp-regions: list of the regions where DSCP is supported on a site network

  • site-network.support-freeze-regions: list of the regions where site networks can be frozen

  • **site-network.support-locations: list of site access points

  • site-connection-bandwidth.size-range: amount of site-to-site connection bandwidth

  • site-connection-bandwidth.charge-mode: billing options of bandwidth used by a site-to-site connection

  • site-connection-bandwidth.free-line: free lines for cross-site connections

is_support

Boolean

Whether site networks are supported.

is_support_enterprise_project

Boolean

Whether enterprise projects are supported for site networks.

is_support_tag

Boolean

Whether tagging site networks is supported.

is_support_intra_region

Boolean

Whether site networks in the same region can be created.

support_topologies

Array of strings

Topology list of a site network.

support_regions

Array of strings

List

support_dscp_regions

Array of strings

List

support_freeze_regions

Array of strings

List

support_locations

Array of strings

List

size_range

ConnectionBandwidthSizeRange object

JSON

charge_mode

Array of strings

List

Table 6 ConnectionBandwidthSizeRange

Parameter

Type

Description

min

Long

Minimum value.

max

Long

Maximum value.

Example Requests

Querying the list of site network capabilities

GET https://{cc_endpoint}/v3/{domain_id}/dcaas/site-network/capabilities

Example Responses

Status code: 200

The list of site network capabilities has been queried.

{
  "request_id" : "a3bad420-33b8-4e26-9e9b-bdf67aa8e72b",
  "capabilities" : [ {
    "id" : "1b7de9bb-e222-45b0-a3c2-65210349e578",
    "specification" : "site-network.is-support",
    "domain_id" : "77c0f00509d542629d032230098950c7",
    "is_support" : true
  }, {
    "id" : "bd231847-18a6-4ae3-adc0-0b0c1d706634",
    "specification" : "site-network.is-support-enterprise-project",
    "domain_id" : "77c0f00509d542629d032230098950c7",
    "is_support_enterprise_project" : true
  }, {
    "id" : "af56b862-ad14-4b8b-8919-1eef0bc08913",
    "specification" : "site-network.is-support-tag",
    "domain_id" : "77c0f00509d542629d032230098950c7",
    "is_support_tag" : true
  }, {
    "id" : "d4ed18c8-8ec8-4022-98b7-8fbb5ca487a5",
    "specification" : "site-network.is-support-intra-region",
    "domain_id" : "77c0f00509d542629d032230098950c7",
    "is_support_intra_region" : false
  }, {
    "id" : "de73beea-9104-43e6-888e-2513883091af",
    "specification" : "site-network.support-topologies",
    "domain_id" : "77c0f00509d542629d032230098950c7",
    "support_topologies" : [ "P2P" ]
  }, {
    "id" : "892a448c-62bd-46c9-aca0-44f1a7bb3eda",
    "specification" : "site-network.support-regions",
    "domain_id" : "77c0f00509d542629d032230098950c7",
    "support_regions" : [ "region-abc", "region-def" ]
  }, {
    "id" : "8f6adfa5-517a-4a52-b04e-6b2e90836b01",
    "specification" : "site-network.support-locations",
    "domain_id" : "77c0f00509d542629d032230098950c7",
    "support_locations" : [ "Access point." ]
  }, {
    "id" : "57b48e0b-16c7-4f32-9092-81e0816d7e74",
    "specification" : "site-connection-bandwidth.size-range",
    "domain_id" : "77c0f00509d542629d032230098950c7",
    "size_range" : {
      "max" : 100,
      "min" : 10
    }
  }, {
    "id" : "fc04670b-d8c9-4551-b128-ef65693ec3ef",
    "specification" : "site-connection-bandwidth.charge-mode",
    "domain_id" : "77c0f00509d542629d032230098950c7",
    "charge_mode" : [ "bwd" ]
  } ]
}

SDK Sample Code

The SDK sample code is as follows.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package com.huaweicloud.sdk.test;

import com.huaweicloud.sdk.core.auth.ICredential;
import com.huaweicloud.sdk.core.auth.GlobalCredentials;
import com.huaweicloud.sdk.core.exception.ConnectionException;
import com.huaweicloud.sdk.core.exception.RequestTimeoutException;
import com.huaweicloud.sdk.core.exception.ServiceResponseException;
import com.huaweicloud.sdk.cc.v3.region.CcRegion;
import com.huaweicloud.sdk.cc.v3.*;
import com.huaweicloud.sdk.cc.v3.model.*;


public class ListSiteNetworkCapabilitiesSolution {

    public static void main(String[] args) {
        // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
        // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
        String ak = System.getenv("CLOUD_SDK_AK");
        String sk = System.getenv("CLOUD_SDK_SK");

        ICredential auth = new GlobalCredentials()
                .withAk(ak)
                .withSk(sk);

        CcClient client = CcClient.newBuilder()
                .withCredential(auth)
                .withRegion(CcRegion.valueOf("<YOUR REGION>"))
                .build();
        ListSiteNetworkCapabilitiesRequest request = new ListSiteNetworkCapabilitiesRequest();
        try {
            ListSiteNetworkCapabilitiesResponse response = client.listSiteNetworkCapabilities(request);
            System.out.println(response.toString());
        } catch (ConnectionException e) {
            e.printStackTrace();
        } catch (RequestTimeoutException e) {
            e.printStackTrace();
        } catch (ServiceResponseException e) {
            e.printStackTrace();
            System.out.println(e.getHttpStatusCode());
            System.out.println(e.getRequestId());
            System.out.println(e.getErrorCode());
            System.out.println(e.getErrorMsg());
        }
    }
}
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# coding: utf-8

import os
from huaweicloudsdkcore.auth.credentials import GlobalCredentials
from huaweicloudsdkcc.v3.region.cc_region import CcRegion
from huaweicloudsdkcore.exceptions import exceptions
from huaweicloudsdkcc.v3 import *

if __name__ == "__main__":
    # The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
    # In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
    ak = os.environ["CLOUD_SDK_AK"]
    sk = os.environ["CLOUD_SDK_SK"]

    credentials = GlobalCredentials(ak, sk)

    client = CcClient.new_builder() \
        .with_credentials(credentials) \
        .with_region(CcRegion.value_of("<YOUR REGION>")) \
        .build()

    try:
        request = ListSiteNetworkCapabilitiesRequest()
        response = client.list_site_network_capabilities(request)
        print(response)
    except exceptions.ClientRequestException as e:
        print(e.status_code)
        print(e.request_id)
        print(e.error_code)
        print(e.error_msg)
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package main

import (
	"fmt"
	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/global"
    cc "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/cc/v3"
	"github.com/huaweicloud/huaweicloud-sdk-go-v3/services/cc/v3/model"
    region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/cc/v3/region"
)

func main() {
    // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
    // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
    ak := os.Getenv("CLOUD_SDK_AK")
    sk := os.Getenv("CLOUD_SDK_SK")

    auth := global.NewCredentialsBuilder().
        WithAk(ak).
        WithSk(sk).
        Build()

    client := cc.NewCcClient(
        cc.CcClientBuilder().
            WithRegion(region.ValueOf("<YOUR REGION>")).
            WithCredential(auth).
            Build())

    request := &model.ListSiteNetworkCapabilitiesRequest{}
	response, err := client.ListSiteNetworkCapabilities(request)
	if err == nil {
        fmt.Printf("%+v\n", response)
    } else {
        fmt.Println(err)
    }
}

For SDK sample code of more programming languages, see the Sample Code tab in API Explorer. SDK sample code can be automatically generated.

Status Codes

Status Code

Description

200

The list of site network capabilities has been queried.

Error Codes

See Error Codes.