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.

Table 1 Parameter description

Parameter

Mandatory

Description

pretty

No

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

namespace

Yes

Object name and auth scope, such as for teams and projects.

name

Yes

Name of the endpoint.

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.

Table 2 Status code

Status Code

Description

200

This operation succeeds, and an Endpoint resource object is returned.

For the description about error status codes, see Status Code.