Querying Details About a Connection
Function
This API is used to query the details about a connection.
Calling Method
For details, see Calling APIs.
Authorization Information
Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.
- If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
- If you are using identity policy-based authorization, the following identity policy-based permissions are required.
URI
GET /v3/{project_id}/dcaas/direct-connects/{direct_connect_id}
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| direct_connect_id | Yes | String | Definition Specifies the connection ID. Constraints N/A Range The value can contain up to 36 characters in UUID format and is connected by hyphens (-). Default Value N/A |
| project_id | Yes | String | Definition Specifies the project ID. Constraints N/A Range N/A Default Value N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| fields | No | Array of strings | Definition Specifies the list of fields to be displayed. Constraints The array length ranges from 1 to 5. |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| X-Auth-Token | Yes | String | Definition Specifies the user token. To obtain the token, see section "Obtaining the User Token" in the Identity and Access Management API Reference. After the request is processed, the value of X-Subject-Token in the header is the token value. Constraints N/A Range N/A Default Value N/A |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| request_id | String | Definition Specifies the request ID. Range N/A |
| direct_connect | DirectConnect object | Definition Specifies the connection object. |
| Parameter | Type | Description |
|---|---|---|
| id | String | Definition Specifies the connection ID. Range N/A |
| tenant_id | String | Definition Specifies the project ID. Range N/A |
| name | String | Definition Specifies the connection name. Range The value can contain a maximum of 64 characters. |
| description | String | Definition Provides supplementary information about the connection. Range The value can contain a maximum of 128 characters. |
| port_type | String | Definition Specifies the type of the port used by the connection. The value can be 1G, 10G, 40G, or 100G. Range |
| bandwidth | Integer | Definition Specifies the connection bandwidth, in Mbit/s. Range N/A |
| location | String | Definition Specifies information about the Direct Connect location. Range The value can contain a maximum of 255 characters. |
| peer_location | String | Definition Specifies the location of the on-premises facility at the other end of the connection, specific to the street or data center name. Range The value can contain a maximum of 255 characters. |
| device_id | String | Definition Specifies the ID of the device connected to the connection. Range The value can contain a maximum of 36 characters. |
| type | String | Definition Specifies the type of the connection. The value can be standard (a standard connection), hosting (an operations connection), or hosted (a hosted connection). Range |
| hosting_id | String | Definition Specifies the ID of the operations connection on which the hosted connection is created. Range The value is in UUID format and is connected by hyphens (-). |
| charge_mode | String | Definition Specifies the billing mode. Range |
| provider | String | Definition Specifies the line carrier of the connection. Range |
| admin_state_up | Boolean | Definition Managing a status Range |
| vlan | Integer | Definition Specifies the VLAN allocated to the hosted connection. Range 0–3999 |
| status | String | Definition Specifies the resource status. The value can be:
Range |
| apply_time | String | Definition Specifies when the connection was requested. The UTC time format is yyyy-MM-ddTHH:mm:ss.SSSZ. |
| create_time | String | Definition Specifies when the connection was created. The UTC time format is yyyy-MM-ddTHH:mm:ss.SSSZ. |
| provider_status | String | Definition Specifies the carrier operation status of the connection. Range |
| peer_port_type | String | Definition Specifies the peer port type. Range 1G, 10G, 40G, or 100G |
| peer_provider | String | Definition Specifies the carrier connected to the connection. Range N/A |
| order_id | String | Definition Specifies the connection order ID, which is used to support duration-based billing and identify user orders. Range N/A |
| product_id | String | Definition Specifies the product ID corresponding to the connection's order. The product ID is used to specify billing policies such as duration-based packages. Range N/A |
| spec_code | String | Definition Specifies the product specifications corresponding to the connection's order. The specifications are used to specify billing policies such as duration-based packages. Range N/A |
| period_type | Integer | Definition Specifies whether a connection in a specified order is billed by year or by month. Range |
| period_num | Integer | Definition Specifies the required service duration of a yearly/monthly connection. Range N/A |
| vgw_type | String | Definition Specifies the gateway type required by a connection. Range |
| lag_id | String | Definition Specifies the ID of the LAG to which the connection belongs. Range The value is in UUID format and is connected by hyphens (-). |
| signed_agreement_status | String | Definition Specifies the signing status of the Direct Connect Disclaimers. Range |
| signed_agreement_time | String | Definition Specifies the time when the line agreement was signed. The UTC time format is yyyy-MM-ddTHH:mm:ss.SSSZ. |
| enterprise_project_id | String | Definition Specifies the ID of the enterprise project that the instance belongs to. Range The value is 0 or a string that contains a maximum of 36 bytes in UUID format with hyphens (-). 0 indicates the default enterprise project. |
| tags | Array of Tag objects | Definition Specifies the tag information. |
| locales | LocalesBody object | Definition Specifies the locale. |
| support_feature | Array of strings | Definition Lists the features supported by the connection. |
| ies_id | String | Definition Specifies the ID of a CloudPond site. Range N/A |
| reason | String | Definition Displays error information if the status of a line is Error. Range N/A |
| | String | Definition Specifies the customer email information. Range The value is in the email address format. It can consist of digits (0 to 9), lowercase letters (a to z), uppercase letters (A to Z), underscores (_), periods (.), and hyphens (-). The username and domain name are separated by at signs (@). The domain name must contain at least one period (.). |
| onestop_product_id | String | Definition Specifies the product ID of a full-service connection. This parameter is used in line sales scenarios. Range N/A |
| building_line_product_id | String | Definition Specifies the product ID of the line resource used in the equipment room. This parameter is used in line sales scenarios. Range N/A |
| last_onestop_product_id | String | Definition Specifies the product ID of a full-service connection before the change. This parameter is used in line sales scenarios and used to save the last record when the line bandwidth is changed. Range N/A |
| last_building_line_product_id | String | Definition Specifies the product ID of the line resource used in the equipment room before the change. This parameter is used in line sales scenarios and used to save the last record when the line bandwidth is changed. Range N/A |
| modified_bandwidth | Integer | Definition Specifies the new bandwidth after the line bandwidth is changed. Range N/A |
| change_mode | Integer | Definition Specifies the status of a renewal change. Range N/A |
| onestopdc_status | String | Definition Specifies the status of the full-service connection. Range |
| public_border_group | String | Definition Specifies the public border group of the AZ, indicating whether the site is a HomeZones site. Range N/A |
| auto_renew | Integer | Definition Specifies whether to automatically renew a yearly/monthly subscription. Range N/A |
| ratio_95peak | Integer | Definition Specifies the percentage of the minimum bandwidth for 95th percentile billing. Range 0–100 |
| Parameter | Type | Description |
|---|---|---|
| key | String | Definition Specifies the tag key. Each key cannot start or end with a space, or start with _sys_. Only letters, digits, spaces, and the following special characters are allowed: _.:=+-@ Range 1 to 128 characters |
| value | String | Definition Specifies the tag value. The value can contain letters, digits, spaces, and the following special characters: _.:/=+-@ Range The value can contain a maximum of 255 characters. |
| Parameter | Type | Description |
|---|---|---|
| en_us | String | Definition Specifies the region name in English. Range The value can contain a maximum of 255 characters. Angle brackets (< and >) are not allowed. |
| zh_cn | String | Definition Specifies the region name in Chinese. Range The value can contain a maximum of 255 characters. Angle brackets (< and >) are not allowed. |
Example Requests
Querying details about a connection
GET https://{dc_endpoint}/v3/6fbe9263116a4b68818cf1edce16bc4f/dcaas/direct-connects/6ecd9cf3-ca64-46c7-863f-f2eb1b9e838a Example Responses
Status code: 200
-
The details of the connection are queried.
{ "direct_connect" : { "bandwidth" : 100, "create_time" : "2018-10-19T07:08:11.000Z", "port_type" : "10G", "id" : "6ecd9cf3-ca64-46c7-863f-f2eb1b9e838a", "apply_time" : "2018-10-19T07:08:11.000Z", "peer_location" : "", "peer_port_type" : null, "peer_provider" : null, "location" : "ExampleLocation", "provider" : "others", "type" : "standard", "status" : "BUILD", "description" : "", "provider_status" : "ACTIVE", "order_id" : "", "vlan" : null, "device_id" : "172.16.40.2", "name" : "direct connect1", "admin_state_up" : true, "tenant_id" : "6fbe9263116a4b68818cf1edce16bc4f", "hosting_id" : null, "product_id" : "", "vgw_type" : "default", "spec_code" : "100ge", "charge_mode" : null, "support_feature" : [ ], "ies_id" : null, "reason" : null, "email" : "cloud@example.com", "onestop_product_id" : null, "building_line_product_id" : null, "last_building_line_product_id" : null, "last_onestop_product_id" : null, "modified_bandwidth" : null, "change_mode" : null, "onestopdc_status" : null, "public_border_group" : "center", "auto_renew" : 0, "ratio_95peak" : null, "tags" : [ ], "locales" : null, "enterprise_project_id" : "0", "lag_id" : null, "signed_agreement_status" : null, "signed_agreement_time" : null, "period_type" : null, "period_num" : null }, "request_id" : "9a4f4dfc4fb2fc101e65bba07d908535" }
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 46 47 48 | package com.huaweicloud.sdk.test; import com.huaweicloud.sdk.core.auth.ICredential; import com.huaweicloud.sdk.core.auth.BasicCredentials; 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.dc.v3.region.DcRegion; import com.huaweicloud.sdk.dc.v3.*; import com.huaweicloud.sdk.dc.v3.model.*; public class ShowDirectConnectSolution { 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"); String projectId = "{project_id}"; ICredential auth = new BasicCredentials() .withProjectId(projectId) .withAk(ak) .withSk(sk); DcClient client = DcClient.newBuilder() .withCredential(auth) .withRegion(DcRegion.valueOf("<YOUR REGION>")) .build(); ShowDirectConnectRequest request = new ShowDirectConnectRequest(); request.withDirectConnectId("{direct_connect_id}"); try { ShowDirectConnectResponse response = client.showDirectConnect(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 31 32 | # coding: utf-8 import os from huaweicloudsdkcore.auth.credentials import BasicCredentials from huaweicloudsdkdc.v3.region.dc_region import DcRegion from huaweicloudsdkcore.exceptions import exceptions from huaweicloudsdkdc.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"] projectId = "{project_id}" credentials = BasicCredentials(ak, sk, projectId) client = DcClient.new_builder() \ .with_credentials(credentials) \ .with_region(DcRegion.value_of("<YOUR REGION>")) \ .build() try: request = ShowDirectConnectRequest() request.direct_connect_id = "{direct_connect_id}" response = client.show_direct_connect(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 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | package main import ( "fmt" "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic" dc "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/dc/v3" "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/dc/v3/model" region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/dc/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") projectId := "{project_id}" auth, err := basic.NewCredentialsBuilder(). WithAk(ak). WithSk(sk). WithProjectId(projectId). SafeBuild() if err != nil { fmt.Println(err) return } hcClient, err := dc.DcClientBuilder(). WithRegion(region.ValueOf("<YOUR REGION>")). WithCredential(auth). SafeBuild() if err != nil { fmt.Println(err) return } client := dc.NewDcClient(hcClient) request := &model.ShowDirectConnectRequest{} request.DirectConnectId = "{direct_connect_id}" response, err := client.ShowDirectConnect(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 | OK |
Error Codes
See Error Codes.
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot