• Direct Connect

dc
  1. Help Center
  2. Direct Connect
  3. API Reference
  4. API
  5. Connection
  6. Creating a Connection

Creating a Connection

Function

This API is used to create a connection.

NOTE:
  1. When creating a hosted connection that does not need to be confirmed, you need to set Status to ACCEPT.
  2. The bandwidth of a hosted connection cannot exceed that of the associated hosting connection.

URI

POST /v2.0/dcaas/direct-connects

Table 1 Parameter description

Parameter

Type

Mandatory

Description

direct_connect

Dictionary data structure

Yes

Specifies the direct_connect object.

Request

Table 2 lists the direct_connect request parameters.

Table 2 Request parameters

Parameter

Type

Mandatory

Description

tenant_id

String

No

Specifies the project ID.

name

String

No

Specifies the connection name.

description

String

No

Provides supplementary information about the connection.

port_type

String

Yes

Specifies the type of the port used by the connection. The value can be 1G or 10G.

bandwidth

Integer

Yes

Specifies the connection bandwidth (unit: Mbit/s).

location

String

Yes

Specifies the connection access location.

peer_location

String

No

Specifies the physical location of the peer device accessed by the connection. The value can be a street, city, and province, or an IDC.

device_id

String

No

Specifies the gateway device ID of the connection.

interface_name

String

No

Specifies the name of the interface accessed by the connection.

redundant_id

String

No

Specifies the ID of the redundant connection using the same gateway.

provider

String

Yes

Specifies the connection provider.

provider_status

String

No

Specifies the status of the provider's connection.

The value can be ACTIVE or DOWN.

type

String

No

Specifies the connection type. The value can be hosted.

hosting_id

String

No

Specifies the ID of the hosting connection mapped to the hosted connection.

vlan

Integer

No

Specifies the pre-allocated VLAN to the hosted connection.

charge_mode

String

No

Specifies the billing mode. The value can be prepayment, bandwidth, or traffic.

order_id

String

No

Specifies the order number of a connection.

product_id

String

No

Specifies the product ID corresponding to a connection order.

status

String

No

Specifies the connection status.

The value can be ACTIVE, DOWN, BUILD, ERROR, PENDING_DELETE, DELETED, APPLY, DENY, PENDING_PAY, PAID, ORDERING, ACCEPT, or REJECTED.

admin_state_up

Boolean

No

Specifies the administrative state of the connection.

The value can be true or false.

Response

Table 3 lists the response parameter.

Table 3 Response parameter

Parameter

Type

Description

direct_connect

Dictionary data structure

Specifies the direct_connect object.

Description of field direct_connect

Parameter

Type

Description

id

String

Specifies the connection ID.

tenant_id

String

Specifies the project ID.

name

String

Specifies the connection name.

description

String

Provides supplementary information about the connection.

port_type

String

Specifies the type of the port used by the connection. The value can be 1G or 10G.

bandwidth

Integer

Specifies the connection bandwidth (unit: Mbit/s).

location

String

Specifies the connection access location.

peer_location

String

Specifies the physical location of the peer device accessed by the connection. The value can be a street, city, and province, or an IDC.

device_id

String

Specifies the gateway device ID of the connection.

interface_name

String

Specifies the name of the interface accessed by the connection.

redundant_id

String

Specifies the ID of the redundant connection using the same gateway.

provider

String

Specifies the connection provider.

provider_status

String

Specifies the status of the provider's connection. The value can be ACTIVE or DOWN.

type

String

Specifies the connection type. The value can be hosted.

hosting_id

String

Specifies the ID of the hosting connection mapped to the hosted connection.

vlan

Integer

Specifies the pre-allocated VLAN to the hosted connection.

charge_mode

String

Specifies the billing mode. The value can be prepayment, bandwidth, or traffic.

Its value is left blank by default.

apply_time

String

Specifies the time when the connection is applied for.

create_time

String

Specifies the time when the connection is created.

delete_time

String

Specifies the time when the connection is deleted.

order_id

String

Specifies the order number of a connection.

product_id

String

Specifies the product ID corresponding to a connection order.

status

String

Specifies the connection status. The value can be ACTIVE, DOWN, BUILD, ERROR, PENDING_DELETE, DELETED, APPLY, DENY, PENDING_PAY, PAID, ORDERING, ACCEPT, or REJECTED.

admin_state_up

Boolean

Specifies the administrative state of the connection.

The value can be true or false.

Examples

  • Example request
    POST /v2.0/dcaas/direct-connects 
    { 
        "direct_connect" : { 
            "name" : "direct connect1", 
            "port_type" : "10G", 
            "bandwidth" : 100, 
            "location" : "Biere", 
            "device_id" : "172.16.40.2", 
            "provider" : "OTC" 
        } 
    } 
  • Example response
    {
        "direct_connect" : {
            "bandwidth" : 100,
            "create_time": "2018-10-19 09:53:26.389556", 
            "port_type" : "10G",
            "id" : "6ecd9cf3-ca64-46c7-863f-f2eb1b9e838a",
            "apply_time": "2018-10-19 09:53:26.389556", 
            "peer_location": "",
            "delete_time": null, 
            "location" : "Biere", 
            "provider" : "OTC"
            "interface_name": "Eth-Trunk2", 
            "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",
            "redundant_id": null, "hosting_id": null, "product_id": "", "charge_mode": ""
        }
    }

Returned Value

For details, see section Common Returned Values.