Listing Endpoints
Function
This API is used to list all endpoints.
URI
GET /api/v1/endpoints
Table 1 describes the parameters of this API.
|
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 |
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.
|
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 |
metadata object |
- |
|
items |
Object |
List of endpoints. For details, see Table 2. |
|
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",
"kubernetes-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.
|
Status Code |
Description |
|---|---|
|
200 |
This operation succeeds, and a group of Endpoint resource objects is returned. |
For the description about error status codes, see Status Code.
Last Article: Replacing a Specified Endpoint
Next Article: Listing Endpoints in a Specified Namespace
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.