Updating a Specified Endpoint
Function
This API is used to update an endpoint under a specified namespace.
The following fields can be updated:
- metadata.selfLink
- metadata.resourceVersion
- metadata.labels
- metadata.clusterName
- metadata.generateName
- metadata.annotations
- subnet.*
URI
PATCH /api/v1/namespaces/{namespace}/endpoints/{name}
Table 1 describes the parameters of this API.
Request
Request parameters:
For the description about the Content-Type field, see Patch Request Method Operation Description.
Example request:
Content-Type: application/merge-patch+json
{
"subsets": [
{
"addresses": [
{
"ip": "172.16.106.154"
}
],
"ports": [
{
"port": 1
}
]
}
]
}
Response
Response parameters:
For the description about response parameters, see Table 2.
Example response:
{
"kind": "Endpoints",
"apiVersion": "v1",
"metadata": {
"name": "cluster-test",
"namespace": "default",
"selfLink": "/api/v1/namespaces/default/endpoints/cluster-test",
"uid": "88a7230f-5d36-11e6-aeb9-286ed488fafe",
"resourceVersion": "3182",
"creationTimestamp": "2016-08-08T07:05:48Z"
},
"subsets": [
{
"addresses": [
{
"ip": "172.16.106.150"
},
{
"ip": "172.16.106.154"
},
{
"ip": "172.16.79.123"
}
],
"ports": [
{
"port": 1,
"protocol": "TCP"
}
]
}
]
}
Status Code
Table 2 describes the status code of this API.
|
Status Code |
Description |
|---|---|
|
200 |
This operation succeeds, and an Endpoint resource object is returned. |
For the description about error status codes, see Status Code.
Last Article: Listing Endpoints in a Specified Namespace
Next Article: Service
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.