Updated on 2024-04-23 GMT+08:00

Querying Service Details

Function

This API is used to query details about a service.

Only the platinum edition supports service-related functions.

URI

GET /v2/{project_id}/edgemgr/services/{service_id}

Table 1 Path parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID.

service_id

Yes

String

Service ID.

Request

Table 2 Parameters in the request header

Parameter

Mandatory

Type

Description

Content-Type

Yes

String

Message body type (format).

The default value application/json is recommended.

X-Auth-Token

Yes

String

User token. The token can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token.

Response

When the status code is 200, the response parameters are as follows:

Table 3 Parameters in the response body

Parameter

Type

Description

service

ServiceRespDetail object

Service details.

Table 4 ServiceRespDetail

Parameter

Type

Description

created_at

String

Creation time.

id

String

Service ID.

meta_data

SvcMetadata object

Static properties of the service.

project_id

String

Tenant ID.

spec

SvcSpec object

Dynamic properties of the service.

updated_at

String

Update time.

Table 5 SvcMetadata

Parameter

Type

Description

labels

Map<String,String>

List of customized labels.

name

String

Service name. The name contains a maximum of 64 characters starting with a letter and ending with a letter or digit. Only lowercase letters, digits, and hyphens (-) are allowed.

Table 6 SvcSpec

Parameter

Type

Description

cluster_ip

String

Virtual service IP address.

external_ips

Array of strings

List of external IP addresses. This parameter is not supported currently.

external_name

String

External domain name. This parameter is not supported currently.

ports

Array of SvcPort objects

List of service ports to be exposed.

selector

Map<String,String>

Label selector, which is used to select the pods with the specified labels for management.

type

String

Service type.

Table 7 SvcPort

Parameter

Type

Description

name

String

The service port must be named in the {protocol}-{suffix} format, where {protocol} can be tcp or http. IEF provides routing capabilities based on protocols defined on ports. For example, name:http-0 and name:tcp-0 are valid port names, while name:http2forecast is invalid.

node_port

String

Port number mapped to the physical machine when spec.type is set to NodePort.

port

String

Port on which the service listens.

protocol

String

Protocol, for example, TCP.

target_port

String

Port number of the backend pod to which requests are forwarded.

When the status code is 404, the response parameters are as follows.

Table 8 Parameters in the response body

Parameter

Type

Description

error_code

String

Error code.

error_message

String

Error message.

When the status code is 500, the response parameters are as follows:

Table 9 Parameters in the response body

Parameter

Type

Description

error_code

String

Error code.

error_message

String

Error message.

Example Request

None

Example Response

Example response with status code 200:

{
  "service" : {
    "id" : "81acf9ff-de6d-4736-8d1a-f43bb058e79d",
    "project_id" : "e78acc02d9d141eda5ca8e88fa35f6f8",
    "meta_data" : {
      "name" : "service-example"
    },
    "spec" : {
      "selector" : {
        "app" : "ief-nginx"
      },
      "ports" : [ {
        "name" : "http-0",
        "protocol" : "TCP",
        "port" : "8888",
        "target_port" : "80"
      } ],
      "cluster_ip" : "None"
    },
    "created_at" : "2020-07-08 01:23:25.845332209 +0000 UTC",
    "updated_at" : "2020-07-08 01:23:25.845332209 +0000 UTC"
  }
}

Status Codes

Status Code

Description

200

Query succeeded.

404

Error response.

500

Error response.

Error Codes

For details, see Error Codes.