• Cloud Container Engine

cce
  1. Help Center
  2. Cloud Container Engine
  3. API Reference
  4. Endpoints (Native Kubernetes APIs)
  5. Listing or Watching Objects of Kind Endpoints

Listing or Watching Objects of Kind Endpoints

Function

This API is used to list all Endpoints resource objects.

URI

GET /api/v1/endpoints

Table 1 describes the parameters of this API.

Table 1 Parameter description

Parameter

Mandatory

Description

pretty

No

If 'true', then the output is pretty printed.

labelSelector

No

A selector to restrict the list of returned objects by their labels. Defaults to everything.

includeUninitialized

No

(A newly added parameter in Kubernetes 1.7)

If true, partially initialized resources are included in the response.

fieldSelector

No

A selector to restrict the list of returned objects by their fields. Defaults to everything.

watch

No

Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.

resourceVersion

No

When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history.

timeoutSeconds

No

Timeout for the list/watch call.

Request

N/A

Response

Response parameters:

Table 2 describes the response parameters.

Table 2 Parameter description

Parameter

Type

Description

kind

String

Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase.

apiVersion

String

APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values.

metadata

Table 3

-

items

Table 2

List of endpoints.

Table 3 Data structure of the metadata field

Parameter

Type

Description

selfLink

String

SelfLink is a URL representing this object. Populated by the system. Read-only.

resourceVersion

String

String that identifies the server's internal version of this object that can be used by clients to determine when objects have changed. Value must be treated as opaque by clients and passed unmodified back to the server. Populated by the system. Read-only.

Example response:

{
    "kind": "EndpointsList",
    "apiVersion": "v1",
    "metadata": {
        "selfLink": "/api/v1/endpoints",
        "resourceVersion": "599259"
    },
    "items": [
        {
            "metadata": {
                "name": "kubernetes",
                "namespace": "default",
                "selfLink": "/api/v1/namespaces/default/endpoints/kubernetes",
                "uid": "64593b5d-f83d-11e7-9c3c-fa163eb8ad1a",
                "resourceVersion": "49",
                "creationTimestamp": "2018-01-13T08:40:21Z",
                "enable": true
            },
            "subsets": [
                {
                    "addresses": [
                        {
                            "ip": "192.168.0.64"
                        }
                    ],
                    "ports": [
                        {
                            "name": "https",
                            "port": 5444,
                            "protocol": "TCP"
                        }
                    ]
                }
            ]
        },
        {
            "metadata": {
                "name": "kube-controller-manager",
                "namespace": "kube-system",
                "selfLink": "/api/v1/namespaces/kube-system/endpoints/kube-controller-manager",
                "uid": "654e158d-f83d-11e7-9c3c-fa163eb8ad1a",
                "resourceVersion": "599259",
                "creationTimestamp": "2018-01-13T08:40:23Z",
                "annotations": {
                    "control-plane.alpha.kubernetes.io/leader": "{\"holderIdentity\":\"192-168-0-64\",\"leaseDurationSeconds\":15,\"acquireTime\":\"2018-01-13T08:40:23Z\",\"renewTime\":\"2018-01-19T09:31:56Z\",\"leaderTransitions\":0}"
                },
                "enable": true
            },
            "subsets": null
        },
        {
            "metadata": {
                "name": "kube-dns",
                "namespace": "kube-system",
                "selfLink": "/api/v1/namespaces/kube-system/endpoints/kube-dns",
                "uid": "6cfc9958-f83d-11e7-9c3c-fa163eb8ad1a",
                "resourceVersion": "506984",
                "creationTimestamp": "2018-01-13T08:40:36Z",
                "labels": {
                    "addonmanager.kubernetes.io/mode": "Reconcile",
                    "k8s-app": "kube-dns",
                    "kubernetes.io/cluster-service": "true",
                    "kubernetes.io/name": "KubeDNS"
                },
                "enable": true
            },
            "subsets": [
                {
                    "addresses": [
                        {
                            "ip": "172.31.0.10",
                            "nodeName": "192.168.0.228",
                            "targetRef": {
                                "kind": "Pod",
                                "namespace": "kube-system",
                                "name": "kube-dns-139966378-crrqm",
                                "uid": "c46cfbf9-fc4b-11e7-9c3c-fa163eb8ad1a",
                                "resourceVersion": "506982"
                            }
                        }
                    ],
                    "ports": [
                        {
                            "name": "dns-tcp",
                            "port": 5353,
                            "protocol": "TCP"
                        },
                        {
                            "name": "dns",
                            "port": 5353,
                            "protocol": "UDP"
                        }
                    ]
                }
            ]
        },
        {
            "metadata": {
                "name": "kube-scheduler",
                "namespace": "kube-system",
                "selfLink": "/api/v1/namespaces/kube-system/endpoints/kube-scheduler",
                "uid": "64d35553-f83d-11e7-9c3c-fa163eb8ad1a",
                "resourceVersion": "599258",
                "creationTimestamp": "2018-01-13T08:40:22Z",
                "annotations": {
                    "control-plane.alpha.kubernetes.io/leader": "{\"holderIdentity\":\"192-168-0-64\",\"leaseDurationSeconds\":15,\"acquireTime\":\"2018-01-13T08:40:22Z\",\"renewTime\":\"2018-01-19T09:31:56Z\",\"leaderTransitions\":0}"
                },
                "enable": true
            },
            "subsets": null
        }
    ]
}

Status Code

Table 4 describes the status code of this API.

Table 4 Status code

Status Code

Description

200

This operation succeeds, and a group of Endpoint resource objects is returned.

For the description about status codes, see section Status Codes.