更新时间:2022-04-18 GMT+08:00
分享

替换指定的Endpoints

功能介绍

该API用于替换指定Namespace下指定的Endpoints资源对象。

其中以下字段支持更新:

  • metadata.name
  • metadata.namespace
  • metadata.selfLink
  • metadata.resourceVersion
  • metadata.uid
  • metadata.labels
  • metadata.clusterName
  • metadata.generateName
  • metadata.annotations
  • subnet.*
  • metadata.deletionGracePeriodSeconds

URI

PUT /api/v1/namespaces/{namespace}/endpoints/{name}

表1 描述该API的参数。

表1 参数描述

参数

是否必选

描述

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.

请求消息

请求参数:

请求参数的详细描述请参见表2

请求示例:

{ 
   "kind": "Endpoints", 
   "apiVersion": "v1", 
   "metadata": { 
     "name": "cluster-test" 
   }, 
   "subsets": [ 
     { 
       "addresses": [ 
         { 
           "ip": "172.16.106.150" 
         } 
       ], 
       "ports": [ 
         { 
           "port": 1 
         } 
       ] 
     }, 
     { 
       "addresses": [ 
         { 
           "ip": "172.16.79.223" 
         } 
       ], 
       "ports": [ 
         { 
           "port": 1 
         } 
       ] 
     },{ 
       "addresses": [ 
         { 
           "ip": "172.16.106.154" 
         } 
       ], 
       "ports": [ 
         { 
           "port": 1 
         } 
       ] 
     } 
   ] 
 }

响应消息

响应参数:

响应参数的详细描述请参见请求消息

响应示例:

{ 
   "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": "3203", 
     "creationTimestamp": "2016-08-08T07:05:48Z" 
   }, 
   "subsets": [ 
     { 
       "addresses": [ 
         { 
           "ip": "172.16.106.150" 
         }, 
         { 
           "ip": "172.16.106.154" 
         }, 
         { 
           "ip": "172.16.79.223" 
         } 
       ], 
       "ports": [ 
         { 
           "port": 1, 
           "protocol": "TCP" 
         } 
       ] 
     } 
   ] 
 }

状态码

表2描述API的状态码。

表2 状态码

状态码

描述

200

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

异常状态码请参见状态码

分享:

    相关文档

    相关产品

close