• Cloud Container Engine

cce
  1. Help Center
  2. Cloud Container Engine
  3. API Reference
  4. Endpoints (Native Kubernetes APIs)
  5. Partially Updating a Specified Endpoints

Partially Updating a Specified Endpoints

Function

This API is used to update some specified Endpoints resource objects under a Namespace.

The following fields can be updated:

  • metadata.selfLink
  • metadata.resourceVersion
  • metadata.generation
  • metadata.creationTimestamp
  • metadata.deletionTimestamp
  • 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 Endpoints.

Request

Request parameters:

For the description about the Content-Type message header, see section Patch Request Method Operation Description.

Example request:

Content-Type: application/merge-patch+json
[
    {
        "op": "replace",
        "path": "/subsets/0/addresses/0/ip",
        "value": "172.18.74.5"
    }
]

Response

Response parameters:

For the description about response parameters, see Table 2.

Example response:

{
    "kind": "Endpoints",
    "apiVersion": "v1",
    "metadata": {
        "name": "test",
        "namespace": "default",
        "selfLink": "/api/v1/namespaces/default/endpoints/test",
        "uid": "9db9c8bc-f0fb-11e7-a1bb-fa163edd242c",
        "resourceVersion": "6719736",
        "creationTimestamp": "2018-01-04T03:01:53Z",
        "labels": {
            "cce/appgroup": "appgroup",
            "name": "whlal"
        }
    },
    "subsets": [
        {
            "addresses": [
                {
                    "ip": "172.18.74.5",
                    "nodeName": "192.168.2.93",
                    "targetRef": {
                        "kind": "Pod",
                        "namespace": "default",
                        "name": "whlal-w6xd3",
                        "uid": "9db63f3e-f0fb-11e7-a1bb-fa163edd242c",
                        "resourceVersion": "5973075"
                    }
                }
            ],
            "ports": [
                {
                    "name": "test0",
                    "port": 80,
                    "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 status codes, see section Status Codes.