Help Center/ Direct Connect/ CLI Reference/ CLI Command Reference
Updated on 2026-09-03 GMT+08:00

CLI Command Reference

Connections

API Name

Command

Description

Operation

Querying Details About a Connection

hcloud DC ShowDirectConnect

This API is used to query details about a connection.

Go debug

Updating a Connection

hcloud DC UpdateDirectConnect

This API is used to update a connection, including updating its name and description.

Go debug

Deleting a Connection

hcloud DC DeleteDirectConnect

This API is used to delete pay-per-use connections only. You can only unsubscribe them yearly/monthly connections.

Go debug

Querying the Connection List

hcloud DC ListDirectConnects

This API is used to query all direct connections created by a tenant.

Go debug

Querying the Hosted Connection List

hcloud DC ListHostedDirectConnects

This API is used to query hosted connections created by partners.

Go debug

Creating a Hosted Connection

hcloud DC CreateHostedDirectConnect

This API is used by partners to create hosted connections for their users. The creator must have the partner qualification and have an operations connection.

Go debug

Querying Details About a Hosted Connection

hcloud DC ShowHostedDirectConnect

This API is used to query a hosted connection of a partner.

Go debug

Updating a Hosted Connection

hcloud DC UpdateHostedDirectConnect

This API is used to update a hosted connection created by a partner.

Go debug

Deleting a Hosted Connection

hcloud DC DeleteHostedDirectConnect

This API is used by partners to delete hosted connections.

Go debug

Virtual Gateways

API Name

Command

Description

Operation

Querying Details About a Virtual Gateway

hcloud DC ShowVirtualGateway

This API is used to query details about a specified virtual gateway.

Go debug

Updating a Virtual Gateway

hcloud DC UpdateVirtualGateway

This API is used to update a virtual gateway.

Go debug

Deleting a Virtual Gateway

hcloud DC DeleteVirtualGateway

The API is used to delete a specified virtual gateway.

Go debug

Querying Virtual Gateways

hcloud DC ListVirtualGateways

This API is used to query virtual gateways.

Go debug

Creating a Virtual Gateway

hcloud DC CreateVirtualGateway

This API is used to create a virtual gateway.

Go debug

Virtual Interfaces

API Name

Command

Description

Operation

Querying Details About a Virtual Interface

hcloud DC ShowVirtualInterface

This API is used to query details about a virtual interface.

Go debug

Updating a Virtual Interface

hcloud DC UpdateVirtualInterface

This API is used to update a virtual interface.

Go debug

Deleting a Virtual Interface

hcloud DC DeleteVirtualInterface

This API is used to delete a virtual interface.

Go debug

Querying the Virtual Interface List

hcloud DC ListVirtualInterfaces

This API is used to query all virtual interfaces of a tenant.

Go debug

Creating a Virtual Interface

hcloud DC CreateVirtualInterface

This API is used to create a virtual interface.

Go debug

Updating Extended Parameters for Reliability Detection on a Virtual Interface

hcloud DC UpdateExtendAttribute

This API is used to update extended parameters for reliability on a virtual interface, such as **min_rx_interval**, **min_tx_interval**, and **detect_multiplier**.

Go debug

Updating a Virtual Interface Peer

hcloud DC UpdateVifPeer

This API is used to update a virtual interface peer, for example, its remote subnet, name, and description. This API is available only in regions that support IPv6. To use this API, contact customer service.

Go debug

Deleting a Virtual Interface Peer

hcloud DC DeleteVifPeer

This API is used to delete a virtual interface. The virtual interface must contain at least one peer. The last peer cannot be deleted. This API is available only in regions that support IPv6. To use this API, contact customer service.

Go debug

Creating a Virtual Interface Peer

hcloud DC CreateVifPeer

This API is used to create an IPv6 peer.Each virtual interface can have two peers: IPv4 and IPv6 peers. When a virtual interface is created, an IPv4 peer is created by default. After a virtual interface peer is created, you can query its settings by viewing the virtual interface details. This API is available only in regions that support IPv6. To use this API, contact customer service.

Go debug

Performing a Virtual Interface Switchover Test

hcloud DC SwitchoverTest

This API is used to perform a virtual interface switchover test.If there are two connections, automatic switchover between the connections is required for connectivity testing. If a switchover is performed, the virtual interface in use is disabled, and traffic is interrupted.You can perform two operations on a virtual interface:- Run the **shutdown** command to disable the virtual interface.- Run the **undo_shutdown** command to enable the virtual interface.If **shutdown** is selected for the switchover test, the virtual interface is in the **ADMIN_SHUTDOWN** state, and no operations can be performed on the virtual interface. If **undo_shutdown** is selected for the switchover test, the virtual interface is in the **ACTIVE** state.

Go debug

Querying the Switchover Test Records of a Virtual Interface

hcloud DC ListSwitchoverTestRecords

This API is used to query the switchover test record list. Only the records whose **operate_status** is **COMPLETE** are displayed.

Go debug

Tag management

API Name

Command

Description

Operation

Querying Tags by Resource Type

hcloud DC ListProjectTags

This API is used to query the tags of a resource type in a specific project. TMS uses this API to list tags created by a tenant to facilitate tag creation and resource filtering on the console.

Go debug

Querying Resource Tags

hcloud DC ShowResourceTag

This API is used to query resource tags.

Go debug

Adding a Resource Tag

hcloud DC CreateResourceTag

This API is used to add a tag to a resource.

Go debug

Adding or Deleting Tags in Batches

hcloud DC BatchCreateResourceTags

This API is used to batch add tags to or delete tags from a specified resource. TMS needs to use this API to manage tags of resources in batches. A resource can have a maximum of 10 tags.

Go debug

Deleting a Resource Tag

hcloud DC DeleteResourceTag

This API is used to delete a tag.When a tag is deleted, the tag character set is not verified. Before this API is called, the API URL must be encoded, and the service who is calling this API must decode the API URI. If the key to be deleted does not exist, 404 is returned. The key cannot be left blank or an empty string.

Go debug

Querying Resources by Tag

hcloud DC ListTagResourceInstances

This API is used to query resources such as virtual gateways and virtual interfaces by tag.

Go debug

Quota Management

API Name

Command

Description

Operation

Querying Resource Quotas

hcloud DC ShowQuotas

This API is used to query the usage of resources, for example, how many connections and virtual interfaces have been created.

Go debug

Global DC Gateways

API Name

Command

Description

Operation

Querying the Global DC Gateway List

hcloud DC ListGlobalDcGateways

This API is used to query the global DC gateway list. Pagination query is recommended. The **marker** and **limit** parameters are used for pagination query. The two parameters take effect only when they are used together.

Go debug

Creating a Global DC Gateway

hcloud DC CreateGlobalDcGateway

This API is used to create a global DC gateway that can be attached to an enterprise router.

Go debug

Querying Details About a Global DC Gateway

hcloud DC ShowGlobalDcGateway

This API is used to query details about a global DC gateway.

Go debug

Updating a Global DC Gateway

hcloud DC UpdateGlobalDcGateway

This API is used to update a global DC gateway, for example, the name and description of a global DC gateway.

Go debug

Deleting a Global DC Gateway

hcloud DC DeleteGlobalDcGateway

This API is used to delete a global DC gateway.

Go debug

Peer Links

API Name

Command

Description

Operation

Querying the Peer Link List

hcloud DC ListPeerLinks

This API is used to query the peer link list. The **marker** and **limit** parameters are used for pagination query. The two parameters take effect only when they are used together.

Go debug

Adding a Peer Link

hcloud DC CreatePeerLink

This API is used to add a peer link between a global DC gateway and an enterprise router or another global DC gateway.

Go debug

Querying Details About a Peer Link

hcloud DC ShowPeerLink

This API is used to query details about a peer link of a global DC gateway.

Go debug

Updating a Peer Link

hcloud DC UpdatePeerLink

This API is used to update a peer link between a global DC gateway and an enterprise router.

Go debug

Deleting a Peer Link

hcloud DC DeletePeerLink

This API is used to delete a peer link between a global DC gateway and an enterprise router.

Go debug

Direct Connect Locations

API Name

Command

Description

Operation

Querying the Direct Connect Location List

hcloud DC ListDirectConnectLocations

This API is used to query all the Direct Connect locations in a region. The **marker** and **limit** parameters are used for pagination query. The two parameters take effect only when they are used together.

Go debug

Querying Details About a Direct Connect Location

hcloud DC ShowDirectConnectLocation

This API is used to query details about a Direct Connect location.

Go debug

Connect Gateways

API Name

Command

Description

Operation

Querying Details About a Connect Gateway

hcloud DC ShowConnectGateway

This API is used to query the details about a connect gateway.

Go debug

Updating a Connect Gateway

hcloud DC UpdateConnectGateway

This API is used to update a connect gateway.

Go debug

Deleting a Connect Gateway

hcloud DC DeleteConnectGateway

This API is used to delete a connect gateway.

Go debug

Querying the Connect Gateway List

hcloud DC ListConnectGateways

This API is used to query the list of connect gateways.

Go debug

Creating a Connect Gateway

hcloud DC CreateConnectGateway

This API is used to create a connect gateway.

Go debug

Global EIPs

API Name

Command

Description

Operation

Querying the Global EIPs Bound to a Connect Gateway

hcloud DC ListGlobalEips

This API is used to query the global EIPs bound to a connect gateway.

Go debug

Binding Global EIPs to a Connect Gateway

hcloud DC BindGlobalEips

This API is used to bind global EIPs to a connect gateway.

Go debug

Unbinding Global EIPs from a Connect Gateway

hcloud DC UnbindGlobalEips

This API is used to unbind global EIPs from a connect gateway.

Go debug

Global DC Gateway Route Tables

API Name

Command

Description

Operation

Querying Global DC Gateway Route Tables

hcloud DC ListGdgwRouteTables

This API is used to query the route tables for a global DC gateway.

Go debug

Modifying Global DC Gateway Route Tables

hcloud DC UpdateGdgwRouteTable

This API is used to modify the route tables for a global DC gateway.

Go debug

Virtual Interface Peer Connectivity Detection Task

API Name

Command

Description

Operation

Querying the Details About a Connectivity Detection Task of a Virtual Interface Peer

hcloud DC ShowVifPeerDetection

This API is used to query the details about a connectivity detection task of a virtual interface peer, including the task ID, start time, end time, status, and packet loss rate.

Go debug

Deleting a Connectivity Detection Task for a Virtual Interface Peer

hcloud DC DeleteVifPeerDetection

This API is used to delete a connectivity detection task if you no longer need it.

Go debug

Querying Connectivity Detection Tasks of a Virtual Interface Peer

hcloud DC ListVifPeerDetections

This API is used to query information about multiple connectivity detection tasks for a virtual interface peer, including the task ID, start time, end time, status, and packet loss rate.

Go debug

Creating a Connectivity Detection Task for a Virtual Interface Peer

hcloud DC CreateVifPeerDetection

This API is used to create a connectivity detection task for a virtual interface peer to test the connectivity of the remote gateway.

Go debug