All Products
Search
Document Center

Microservices Engine:GetServiceListeners

Last Updated:Aug 12, 2024

Queries the list of listeners for the destination service.

Debugging

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

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
mse:GetServiceListenersget
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
ServiceNamestringYes

The name of the service whose listeners you want to query.

zeekr-orderboss
GroupNamestringYes

The group to which the service belongs.

WEB_GROUP
NamespaceIdstringYes

The namespace to which the service belongs.

ddaf8f12-****-b1c1-86e7c72e266b
ClusterNamestringNo

The name of the cluster to which the service belongs.

Note The cluster is a concept for Nacos services and is not equivalent to a Microservices Engine (MSE) instance.
DEFAULT
HasIpCountstringNo

A reserved parameter.

none
ClusterIddeprecatedstringNo

The ID of the MSE instance to which the service belongs.

Note You must specify InstanceId or ClusterId.
mse-09k1q11****
InstanceIdstringNo

The ID of the instance to which the service belongs.

Note You must specify InstanceId or ClusterId.
mse_prepaid_public_cn-tl32odtt20j
PageNumintegerNo

The number of the page to return.

1
PageSizeintegerNo

The number of entries to return on each page.

10
RegionIdstringNo

The ID of the region.

cn-hangzhou
RequestParsstringNo

The extended request parameters in the JSON format.

{}
AcceptLanguagestringNo

The language of the response. Valid values:

  • zh: Chinese
  • en: English
zh

Response parameters

ParameterTypeDescriptionExample
object

The data structure.

Dataarray<object>

The returned data.

object

The details of the data.

Addrstring

The IP address of the listener.

119.23.84.102
Agentstring

The listener client version.

Nacos-Java-Client:v2.1.1
Appstring

The application name of the listener.

app
IPstring

The IP address of the monitored service.

172.16.1.5
Portstring

The port number of the monitored service.

8080
NamespaceIdstring

The ID of the namespace.

0ba53825-b183-414f-a6a0-288e4f1c467e
ServiceNamestring

The name of the monitored service.

zeekr-orderboss
Clusterstring

The name of the cluster to which the monitored service belongs.

DEFAULT
PageNumberinteger

The page number of the returned page.

1
TotalCountinteger

The number of listeners that are queried.

2
PageSizeinteger

The number of entries returned per page.

10
Successboolean

Indicates whether the request was successful. Valid values:

  • true: The request was successful.
  • false: The request failed.
true
Messagestring

The message returned.

  • If the request is successful, a success message is returned.
  • If the request fails, an error message is returned.
success
RequestIdstring

The ID of the request.

54973C90-F379-4372-9AA5-053A3F7****
ErrorCodestring

The error code returned if the request failed.

mse-100-000
HttpCodestring

The HTTP status code returned.

202

Examples

Sample success responses

JSONformat

{
  "Data": [
    {
      "Addr": "119.23.84.102",
      "Agent": "Nacos-Java-Client:v2.1.1",
      "App": "app",
      "IP": "172.16.1.5",
      "Port": "8080",
      "NamespaceId": "0ba53825-b183-414f-a6a0-288e4f1c467e",
      "ServiceName": "zeekr-orderboss",
      "Cluster": "DEFAULT"
    }
  ],
  "PageNumber": 1,
  "TotalCount": 2,
  "PageSize": 10,
  "Success": true,
  "Message": "success",
  "RequestId": "54973C90-F379-4372-9AA5-053A3F7****",
  "ErrorCode": "mse-100-000",
  "HttpCode": "202"
}

Error codes

HTTP status codeError codeError messageDescription
400IllegalRequestInvalid request:%sInvalid request: %s
400InvalidParameterParameter error:%sRequest parameter error: %s
403NoPermissionYou are not authorized to perform this operation:%sYou do not have the permission to use this interface:%s
404NotFoundNot found:%sThe resource does not exist:%s
500InternalErrorConsole error. Try again later:%sConsole error. Try again later: %s

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

Change history

Change timeSummary of changesOperation
2023-04-25The internal configuration of the API is changed, but the call is not affectedView Change Details