All Products
Search
Document Center

ENS:GetDeviceInternetPort

Last Updated:Mar 12, 2024

Queries the network address translation (NAT) rule details of a device such as a server or container by its ID.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
InstanceIdstringYes

The ID of the instance. You can specify the ID of the server or container. You can specify only one ID.

i-5s6xbnx9srb3vm6tp9hg9o64e
NatTypestringYes

The type of the NAT gateway. The value must be of the enumerated data type. Valid values:

  • SNAT
  • DNAT
DNAT
RuleIdstringNo

The ID of the rule. If you leave this parameter empty, all rules are queried.

snat-5ref5fc1l1xgqnpjzrtw1hw5a

Response parameters

ParameterTypeDescriptionExample
object

Schema of Response

RequestIdstring

The ID of the request.

36311833-83FC-57C3-A7DD-768F61F65555
InstanceIdstring

The ID of the instance. The value is the ID of the server or container.

i-5sadvk2xnylvra9kyejcnevi6
NetworkInfoobject []

The network mapping information about the instance.

InternalIpstring

The internal IP address.

10.0.0.49
InternalPortstring

The internal port number.

2020/2025
ExternalIpstring

The public IP address.

39.105.62.120
ExternalPortstring

The external port number.

20
ISPstring

The Internet service provider (ISP).

cmcc
Statusstring

The status of the external port.

Running

Examples

Sample success responses

JSONformat

{
  "RequestId": "36311833-83FC-57C3-A7DD-768F61F65555",
  "InstanceId": "i-5sadvk2xnylvra9kyejcnevi6",
  "NetworkInfo": [
    {
      "InternalIp": "10.0.0.49",
      "InternalPort": "2020/2025",
      "ExternalIp": "39.105.62.120",
      "ExternalPort": "20",
      "ISP": "cmcc",
      "Status": "Running"
    }
  ]
}

Error codes

HTTP status codeError codeError message
400NoPermissionPermission denied.
400InvalidParameter.%sThe specified field %s invalid. Please check it again.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
No change history