华为云用户手册

  • 请求参数 表3 请求Header参数 参数 是否必选 参数类型 描述 X-Auth-Token 是 String 用户Token。 通过调用 IAM 服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 Content-Type 是 String 目前支持三种类型的PATCH请求方法的操作,参考《使用JSON合并patch更新Deployment》。 Json Patch, Content-Type: application/json-patch+json 在RFC6902协议的定义中,Json Patch包含一系列对目标JSON对象的操作,其本身也为JSON对象。服务器接收到该对象后,会将其表示的操作应用于目标JSON对象。 Merge Patch, Content-Type: application/merge-patch+json 在RFC7386协议的定义中,Merge Patch必须包含对一个资源对象的部分描述,即为JSON对象。该JSON对象被提交到服务端后与服务端的当前对象合并,即替换当前资源对象中的列表域,从而创建一个新的对象。 Strategic Merge Patch, Content-Type: application/strategic-merge-patch+json Strategic Merge Patch是添加合法的元数据到API对象中,并通过这些新的元数据来决定哪个列表被合并,哪个列表不该被合并。当前这些元数据则作为结构标签。 表4 请求Body参数 参数 是否必选 参数类型 描述 - 是 Object Patch is provided to give a concrete name and type to the Kubernetes PATCH request body.
  • 响应示例 状态码: 200 OK { "apiVersion" : "v1", "data" : { "property_1" : "test", "property_2" : "test" }, "kind" : "ConfigMap", "metadata" : { "creationTimestamp" : "2018-09-04T03:11:29Z", "name" : "configmap-test", "namespace" : "namespace-test", "resourceVersion" : "5171481", "selfLink" : "/api/v1/namespaces/namespace-test/configmaps/configmap-test", "uid" : "379519a3-aff0-11e8-8f17-c81fbe371a17" } }
  • URI PATCH /api/v1/namespaces/{namespace}/configmaps/{name} 表1 路径参数 参数 是否必选 参数类型 描述 name 是 String name of the ConfigMap namespace 是 String object name and auth scope, such as for teams and projects 表2 Query参数 参数 是否必选 参数类型 描述 dryRun 否 String When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed fieldManager 否 String fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). force 否 Boolean Force is going to "force" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. pretty 否 String If 'true', then the output is pretty printed.
  • 响应示例 状态码: 200 OK { "apiVersion" : "batch.volcano.sh/v1alpha1", "kind" : "Job", "metadata" : { "creationTimestamp" : "2019-06-26T03:16:26Z", "generation" : 1, "labels" : { "app" : "patchlabel" }, "name" : "openmpi-hello-2-com", "namespace" : "cci-namespace-42263891", "resourceVersion" : "7695210", "selfLink" : "/apis/batch.volcano.sh/v1alpha1/namespaces/cci-namespace-42263891/jobs/openmpi-hello-2-com", "uid" : "c84d86f0-97c0-11e9-9d09-dc9914fb58e0" }, "spec" : { "minAvailable" : 1, "plugins" : { "env" : [ ], "ssh" : [ ], "svc" : [ ] }, "queue" : "default", "schedulerName" : "volcano", "tasks" : [ { "name" : "mpimaster", "policies" : [ { "action" : "CompleteJob", "event" : "TaskCompleted" } ], "replicas" : 1, "template" : { "spec" : { "containers" : [ { "command" : [ "/bin/sh", "-c", "MPI_HOST=`cat /etc/volcano/mpiworker.host | tr \"\\n\" \",\"`;\nmkdir -p /var/run/sshd; /usr/sbin/sshd;\nmpiexec --allow-run-as-root --host ${MPI_HOST} -np 2 mpi_hello_world 003e /home/re" ], "image" : "*.*.*.*:20202/swr/openmpi-hello:3.28", "name" : "mpimaster", "ports" : [ { "containerPort" : 22, "name" : "mpijob-port" } ], "resources" : { "limits" : { "cpu" : "250m", "memory" : "1Gi" }, "requests" : { "cpu" : "250m", "memory" : "1Gi" } }, "workingDir" : "/home" } ], "imagePullSecrets" : [ { "name" : "imagepull-secret" } ], "restartPolicy" : "OnFailure" } } }, { "name" : "mpiworker", "replicas" : 2, "template" : { "spec" : { "containers" : [ { "command" : [ "/bin/sh", "-c", "mkdir -p /var/run/sshd; /usr/sbin/sshd -D;" ], "image" : "*.*.*.*:20202/swr/openmpi-hello:3.28", "name" : "mpiworker", "ports" : [ { "containerPort" : 22, "name" : "mpijob-port" } ], "resources" : { "limits" : { "cpu" : "250m", "memory" : "1Gi" }, "requests" : { "cpu" : "250m", "memory" : "1Gi" } }, "workingDir" : "/home" } ], "imagePullSecrets" : [ { "name" : "imagepull-secret" } ], "restartPolicy" : "OnFailure" } } } ] }, "status" : { "minAvailable" : 1, "pending" : 3, "state" : { "phase" : "Inqueue" } } }
  • URI PATCH /apis/batch.volcano.sh/v1alpha1/namespaces/{namespace}/jobs/{name} 表1 路径参数 参数 是否必选 参数类型 描述 name 是 String name of the Job namespace 是 String object name and auth scope, such as for teams and projects 表2 Query参数 参数 是否必选 参数类型 描述 dryRun 否 String When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed fieldManager 否 String fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. pretty 否 String If 'true', then the output is pretty printed.
  • 状态码 状态码 描述 200 OK 400 BadRequest 401 Unauthorized 403 Forbidden 404 NotFound 405 MethodNotAllowed 406 NotAcceptable 409 Conflict 415 UnsupportedMediaType 422 Invalid 429 TooManyRequests 500 InternalError 503 ServiceUnavailable 504 ServerTimeout
  • 请求参数 表3 请求Header参数 参数 是否必选 参数类型 描述 X-Auth-Token 是 String 用户Token。 通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 Content-Type 是 String 目前支持三种类型的PATCH请求方法的操作,参考《使用JSON合并patch更新Deployment》。 Json Patch, Content-Type: application/json-patch+json 在RFC6902协议的定义中,Json Patch包含一系列对目标JSON对象的操作,其本身也为JSON对象。服务器接收到该对象后,会将其表示的操作应用于目标JSON对象。 Merge Patch, Content-Type: application/merge-patch+json 在RFC7386协议的定义中,Merge Patch必须包含对一个资源对象的部分描述,即为JSON对象。该JSON对象被提交到服务端后与服务端的当前对象合并,即替换当前资源对象中的列表域,从而创建一个新的对象。 Strategic Merge Patch, Content-Type: application/strategic-merge-patch+json Strategic Merge Patch是添加合法的元数据到API对象中,并通过这些新的元数据来决定哪个列表被合并,哪个列表不该被合并。当前这些元数据则作为结构标签。 表4 请求Body参数 参数 是否必选 参数类型 描述 - 是 Object Patch is provided to give a concrete name and type to the Kubernetes PATCH request body.
  • 请求参数 表3 请求Header参数 参数 是否必选 参数类型 描述 X-Auth-Token 是 String 用户Token。 通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 Content-Type 是 String 目前支持三种类型的PATCH请求方法的操作,参考《使用JSON合并patch更新Deployment》。 Json Patch, Content-Type: application/json-patch+json 在RFC6902协议的定义中,Json Patch包含一系列对目标JSON对象的操作,其本身也为JSON对象。服务器接收到该对象后,会将其表示的操作应用于目标JSON对象。 Merge Patch, Content-Type: application/merge-patch+json 在RFC7386协议的定义中,Merge Patch必须包含对一个资源对象的部分描述,即为JSON对象。该JSON对象被提交到服务端后与服务端的当前对象合并,即替换当前资源对象中的列表域,从而创建一个新的对象。 Strategic Merge Patch, Content-Type: application/strategic-merge-patch+json Strategic Merge Patch是添加合法的元数据到API对象中,并通过这些新的元数据来决定哪个列表被合并,哪个列表不该被合并。当前这些元数据则作为结构标签。 表4 请求Body参数 参数 是否必选 参数类型 描述 - 是 Object Patch is provided to give a concrete name and type to the Kubernetes PATCH request body.
  • 响应示例 状态码: 200 OK { "apiVersion" : "batch/v1", "kind" : "Job", "metadata" : { "creationTimestamp" : "2018-09-05T01:10:59Z", "labels" : { "app" : "test", "controller-uid" : "8c923079-b0a8-11e8-8bcb-f898ef6c78b4", "job-name" : "pi" }, "name" : "pi", "namespace" : "namespace-test", "resourceVersion" : "5398083", "selfLink" : "/apis/batch/v1/namespaces/namespace-test/jobs/pi", "uid" : "8c923079-b0a8-11e8-8bcb-f898ef6c78b4" }, "spec" : { "backoffLimit" : 6, "completions" : 1, "parallelism" : 1, "selector" : { "matchLabels" : { "controller-uid" : "8c923079-b0a8-11e8-8bcb-f898ef6c78b4" } }, "template" : { "metadata" : { "annotations" : { "cri.cci.io/container-type" : "secure-container" }, "creationTimestamp" : null, "labels" : { "controller-uid" : "8c923079-b0a8-11e8-8bcb-f898ef6c78b4", "job-name" : "pi" }, "name" : "pi" }, "spec" : { "containers" : [ { "command" : [ "perl", "-Mbignum=bpi", "-wle", "print bpi(2000)" ], "image" : "perl", "imagePullPolicy" : "Always", "name" : "pi", "resources" : { "limits" : { "cpu" : "500m", "memory" : "1Gi" }, "requests" : { "cpu" : "500m", "memory" : "1Gi" } }, "terminationMessagePath" : "/dev/termination-log", "terminationMessagePolicy" : "File" } ], "dnsPolicy" : "ClusterFirst", "imagePullSecrets" : [ { "name" : "imagepull-secret" } ], "restartPolicy" : "Never", "schedulerName" : "default-scheduler", "securityContext" : { } } } }, "status" : { "active" : 1, "startTime" : "2018-09-05T01:10:59Z" } }
  • 状态码 状态码 描述 200 OK 400 BadRequest 401 Unauthorized 403 Forbidden 404 NotFound 405 MethodNotAllowed 406 NotAcceptable 409 Conflict 415 UnsupportedMediaType 422 Invalid 429 TooManyRequests 500 InternalError 503 ServiceUnavailable 504 ServerTimeout
  • URI PATCH /apis/batch/v1/namespaces/{namespace}/jobs/{name} 表1 路径参数 参数 是否必选 参数类型 描述 name 是 String name of the Job namespace 是 String object name and auth scope, such as for teams and projects 表2 Query参数 参数 是否必选 参数类型 描述 dryRun 否 String When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed fieldManager 否 String fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). force 否 Boolean Force is going to "force" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. pretty 否 String If 'true', then the output is pretty printed.
  • 功能介绍 更新StatefulSet。 The following fields can be updated: metadata.labels metadata.annotations spec.replicas spec.template spec.restartPolicy spec.revisionHistoryLimit spec.progressDeadlineSeconds The other fields cannot be updated.
  • 响应示例 状态码: 200 OK { "apiVersion" : "apps/v1", "kind" : "StatefulSet", "metadata" : { "creationTimestamp" : "2018-09-04T07:13:00Z", "generation" : 2, "labels" : { "app" : "statefulset-test2" }, "name" : "statefulset-test", "namespace" : "namespace-test", "resourceVersion" : "5231369", "selfLink" : "/apis/apps/v1/namespaces/namespace-test/statefulsets/statefulset-test", "uid" : "f4a35f35-b011-11e8-b6ef-f898ef6c78b4" }, "spec" : { "podManagementPolicy" : "OrderedReady", "replicas" : 2, "revisionHistoryLimit" : 10, "selector" : { "matchLabels" : { "app" : "statefulset-test" } }, "serviceName" : "", "template" : { "metadata" : { "creationTimestamp" : null, "labels" : { "app" : "statefulset-test" } }, "spec" : { "containers" : [ { "image" : "redis", "imagePullPolicy" : "IfNotPresent", "name" : "container-0", "resources" : { "limits" : { "cpu" : "500m", "memory" : "1Gi" }, "requests" : { "cpu" : "500m", "memory" : "1Gi" } }, "terminationMessagePath" : "/dev/termination-log", "terminationMessagePolicy" : "File" } ], "dnsPolicy" : "ClusterFirst", "imagePullSecrets" : [ { "name" : "imagepull-secret" } ], "restartPolicy" : "Always", "schedulerName" : "default-scheduler", "securityContext" : { } } }, "updateStrategy" : { "type" : "OnDelete" } }, "status" : { "collisionCount" : 0, "currentRevision" : "statefulset-test-f986b645b", "observedGeneration" : 2, "replicas" : 2, "updateRevision" : "statefulset-test-7748d5459", "updatedReplicas" : 2 } }
  • 请求参数 表3 请求Header参数 参数 是否必选 参数类型 描述 X-Auth-Token 是 String 用户Token。 通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 Content-Type 是 String 目前支持三种类型的PATCH请求方法的操作,参考《使用JSON合并patch更新Deployment》。 Json Patch, Content-Type: application/json-patch+json 在RFC6902协议的定义中,Json Patch包含一系列对目标JSON对象的操作,其本身也为JSON对象。服务器接收到该对象后,会将其表示的操作应用于目标JSON对象。 Merge Patch, Content-Type: application/merge-patch+json 在RFC7386协议的定义中,Merge Patch必须包含对一个资源对象的部分描述,即为JSON对象。该JSON对象被提交到服务端后与服务端的当前对象合并,即替换当前资源对象中的列表域,从而创建一个新的对象。 Strategic Merge Patch, Content-Type: application/strategic-merge-patch+json Strategic Merge Patch是添加合法的元数据到API对象中,并通过这些新的元数据来决定哪个列表被合并,哪个列表不该被合并。当前这些元数据则作为结构标签。 表4 请求Body参数 参数 是否必选 参数类型 描述 - 是 Object Patch is provided to give a concrete name and type to the Kubernetes PATCH request body.
  • 状态码 状态码 描述 200 OK 400 BadRequest 401 Unauthorized 403 Forbidden 404 NotFound 405 MethodNotAllowed 406 NotAcceptable 409 Conflict 415 UnsupportedMediaType 422 Invalid 429 TooManyRequests 500 InternalError 503 ServiceUnavailable 504 ServerTimeout
  • URI PATCH /apis/apps/v1/namespaces/{namespace}/statefulsets/{name} 表1 路径参数 参数 是否必选 参数类型 描述 name 是 String name of the StatefulSet namespace 是 String object name and auth scope, such as for teams and projects 表2 Query参数 参数 是否必选 参数类型 描述 dryRun 否 String When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed fieldManager 否 String fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). force 否 Boolean Force is going to "force" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. pretty 否 String If 'true', then the output is pretty printed.
  • 请求参数 表3 请求Header参数 参数 是否必选 参数类型 描述 X-Auth-Token 是 String 用户Token。 通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 Content-Type 是 String 目前支持三种类型的PATCH请求方法的操作,参考《使用JSON合并patch更新Deployment》。 Json Patch, Content-Type: application/json-patch+json 在RFC6902协议的定义中,Json Patch包含一系列对目标JSON对象的操作,其本身也为JSON对象。服务器接收到该对象后,会将其表示的操作应用于目标JSON对象。 Merge Patch, Content-Type: application/merge-patch+json 在RFC7386协议的定义中,Merge Patch必须包含对一个资源对象的部分描述,即为JSON对象。该JSON对象被提交到服务端后与服务端的当前对象合并,即替换当前资源对象中的列表域,从而创建一个新的对象。 Strategic Merge Patch, Content-Type: application/strategic-merge-patch+json Strategic Merge Patch是添加合法的元数据到API对象中,并通过这些新的元数据来决定哪个列表被合并,哪个列表不该被合并。当前这些元数据则作为结构标签。 表4 请求Body参数 参数 是否必选 参数类型 描述 - 是 Object Patch is provided to give a concrete name and type to the Kubernetes PATCH request body.
  • 响应示例 状态码: 200 OK { "apiVersion" : "autoscaling/v1", "kind" : "Scale", "metadata" : { "creationTimestamp" : "2022-08-30T09:23:43Z", "name" : "nginx", "namespace" : "test-api", "resourceVersion" : "34017936", "selfLink" : "/apis/apps/v1/namespaces/test-api/deployments/nginx/scale", "uid" : "3bd1306c-ac3e-41c2-81ab-14c79fa006d3" }, "spec" : { "replicas" : 2 }, "status" : { "replicas" : 2, "selector" : "app=nginx" } }
  • 状态码 状态码 描述 200 OK 400 BadRequest 401 Unauthorized 403 Forbidden 404 NotFound 405 MethodNotAllowed 406 NotAcceptable 409 Conflict 415 UnsupportedMediaType 422 Invalid 429 TooManyRequests 500 InternalError 503 ServiceUnavailable 504 ServerTimeout
  • URI PATCH /apis/apps/v1/namespaces/{namespace}/deployments/{name}/scale 表1 路径参数 参数 是否必选 参数类型 描述 name 是 String name of the Scale namespace 是 String object name and auth scope, such as for teams and projects 表2 Query参数 参数 是否必选 参数类型 描述 dryRun 否 String When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed fieldManager 否 String fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). force 否 Boolean Force is going to "force" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. pretty 否 String If 'true', then the output is pretty printed.
  • 状态码 状态码 描述 200 OK 400 BadRequest 401 Unauthorized 403 Forbidden 404 NotFound 405 MethodNotAllowed 406 NotAcceptable 409 Conflict 415 UnsupportedMediaType 422 Invalid 429 TooManyRequests 500 InternalError 503 ServiceUnavailable 504 ServerTimeout
  • URI PATCH /apis/apps/v1/namespaces/{namespace}/deployments/{name} 表1 路径参数 参数 是否必选 参数类型 描述 name 是 String name of the Deployment namespace 是 String object name and auth scope, such as for teams and projects 表2 Query参数 参数 是否必选 参数类型 描述 dryRun 否 String When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed fieldManager 否 String fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). force 否 Boolean Force is going to "force" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. pretty 否 String If 'true', then the output is pretty printed.
  • 响应示例 状态码: 200 OK { "apiVersion" : "apps/v1", "kind" : "Deployment", "metadata" : { "annotations" : { "deployment.kubernetes.io/revision" : "2" }, "creationTimestamp" : "2018-09-06T03:39:32Z", "generation" : 2, "labels" : { "app" : "deployment-test2" }, "name" : "deployment-test", "namespace" : "namespace-test", "resourceVersion" : "5657176", "selfLink" : "/apis/apps/v1/namespaces/namespace-test/deployments/deployment-test", "uid" : "777dce52-b186-11e8-8cb0-c81fbe371a17" }, "spec" : { "progressDeadlineSeconds" : 600, "replicas" : 2, "revisionHistoryLimit" : 10, "selector" : { "matchLabels" : { "app" : "redis" } }, "strategy" : { "rollingUpdate" : { "maxSurge" : "25%", "maxUnavailable" : "25%" }, "type" : "RollingUpdate" }, "template" : { "metadata" : { "creationTimestamp" : null, "labels" : { "app" : "redis" } }, "spec" : { "containers" : [ { "image" : "*.*.*.*:20202/cci/redis:V1", "imagePullPolicy" : "IfNotPresent", "name" : "container-0", "resources" : { "limits" : { "cpu" : "500m", "memory" : "1Gi" }, "requests" : { "cpu" : "500m", "memory" : "1Gi" } }, "terminationMessagePath" : "/dev/termination-log", "terminationMessagePolicy" : "File" } ], "dnsPolicy" : "ClusterFirst", "imagePullSecrets" : [ { "name" : "imagepull-secret" } ], "restartPolicy" : "Always", "schedulerName" : "default-scheduler", "securityContext" : { } } } }, "status" : { "availableReplicas" : 2, "conditions" : [ { "lastTransitionTime" : "2018-09-06T04:14:14Z", "lastUpdateTime" : "2018-09-06T04:14:14Z", "message" : "Deployment has minimum availability.", "reason" : "MinimumReplicasAvailable", "status" : "True", "type" : "Available" }, { "lastTransitionTime" : "2018-09-06T03:39:32Z", "lastUpdateTime" : "2018-09-06T04:14:24Z", "message" : "ReplicaSet \"deployment-test-68585dfddb\" has successfully\nprogressed.", "reason" : "NewReplicaSetAvailable", "status" : "True", "type" : "Progressing" } ], "observedGeneration" : 2, "readyReplicas" : 2, "replicas" : 2, "updatedReplicas" : 2 } }
  • 请求参数 表3 请求Header参数 参数 是否必选 参数类型 描述 X-Auth-Token 是 String 用户Token。 通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 Content-Type 是 String 目前支持三种类型的PATCH请求方法的操作,参考《使用JSON合并patch更新Deployment》。 Json Patch, Content-Type: application/json-patch+json 在RFC6902协议的定义中,Json Patch包含一系列对目标JSON对象的操作,其本身也为JSON对象。服务器接收到该对象后,会将其表示的操作应用于目标JSON对象。 Merge Patch, Content-Type: application/merge-patch+json 在RFC7386协议的定义中,Merge Patch必须包含对一个资源对象的部分描述,即为JSON对象。该JSON对象被提交到服务端后与服务端的当前对象合并,即替换当前资源对象中的列表域,从而创建一个新的对象。 Strategic Merge Patch, Content-Type: application/strategic-merge-patch+json Strategic Merge Patch是添加合法的元数据到API对象中,并通过这些新的元数据来决定哪个列表被合并,哪个列表不该被合并。当前这些元数据则作为结构标签。 表4 请求Body参数 参数 是否必选 参数类型 描述 - 是 Object Patch is provided to give a concrete name and type to the Kubernetes PATCH request body.
  • URI GET /apis/storage.k8s.io/v1/storageclasses 表1 Query参数 参数 是否必选 参数类型 描述 allowWatchBookmarks 否 Boolean allowWatchBookmarks requests watch events with type "BOOKMARK". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. continue 否 String The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the "next key". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. fieldSelector 否 String A selector to restrict the list of returned objects by their fields. Defaults to everything. labelSelector 否 String A selector to restrict the list of returned objects by their labels. Defaults to everything. limit 否 Integer limit is a maximum number of responses to return for a list call. If more items exist, the server will set the continue field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. resourceVersion 否 String resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset resourceVersionMatch 否 String resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset timeoutSeconds 否 Integer Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. watch 否 Boolean Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. pretty 否 String If 'true', then the output is pretty printed.
  • 状态码 状态码 描述 200 OK 400 BadRequest 401 Unauthorized 403 Forbidden 404 NotFound 405 MethodNotAllowed 406 NotAcceptable 409 Conflict 415 UnsupportedMediaType 422 Invalid 429 TooManyRequests 500 InternalError 503 ServiceUnavailable 504 ServerTimeout
  • 响应示例 状态码: 200 OK [ { "allowVolumeExpansion" : false, "metadata" : { "creationTimestamp" : "2022-07-26T04:58:34Z", "name" : "csi-disk-sas", "resourceVersion" : "289546", "selfLink" : "/apis/storage.k8s.io/v1/storageclasses/csi-disk-sas", "uid" : "f47fe78e-1677-4ac4-b02c-109cee63f34a" }, "parameters" : { "csi.storage.k8s.io/csi-driver-name" : "disk.csi.everest.io", "csi.storage.k8s.io/fstype" : "ext4", "everest.io/disk-volume-type" : "SAS", "everest.io/passthrough" : "true" }, "provisioner" : "everest-csi-provisioner", "reclaimPolicy" : "Delete", "volumeBindingMode" : "Immediate" }, { "allowVolumeExpansion" : false, "metadata" : { "creationTimestamp" : "2022-07-26T04:58:34Z", "name" : "csi-disk-sata", "resourceVersion" : "289547", "selfLink" : "/apis/storage.k8s.io/v1/storageclasses/csi-disk-sata", "uid" : "3df529ff-5300-4bd8-a292-34ed5ddd80cd" }, "parameters" : { "csi.storage.k8s.io/csi-driver-name" : "disk.csi.everest.io", "csi.storage.k8s.io/fstype" : "ext4", "everest.io/disk-volume-type" : "SATA", "everest.io/passthrough" : "true" }, "provisioner" : "everest-csi-provisioner", "reclaimPolicy" : "Delete", "volumeBindingMode" : "Immediate" } ]
  • 状态码 状态码 描述 200 OK 400 BadRequest 401 Unauthorized 403 Forbidden 404 NotFound 405 MethodNotAllowed 406 NotAcceptable 409 Conflict 415 UnsupportedMediaType 422 Invalid 429 TooManyRequests 500 InternalError 503 ServiceUnavailable 504 ServerTimeout
  • URI GET /apis/rbac.authorization.k8s.io/v1/rolebindings 表1 Query参数 参数 是否必选 参数类型 描述 allowWatchBookmarks 否 Boolean allowWatchBookmarks requests watch events with type "BOOKMARK". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. continue 否 String The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the "next key". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. fieldSelector 否 String A selector to restrict the list of returned objects by their fields. Defaults to everything. labelSelector 否 String A selector to restrict the list of returned objects by their labels. Defaults to everything. limit 否 Integer limit is a maximum number of responses to return for a list call. If more items exist, the server will set the continue field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. pretty 否 String If 'true', then the output is pretty printed. resourceVersion 否 String resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset resourceVersionMatch 否 String resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset timeoutSeconds 否 Integer Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. watch 否 Boolean Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.
  • 响应示例 状态码: 200 OK { "apiVersion" : "rbac.authorization.k8s.io/v1", "items" : [ { "metadata" : { "creationTimestamp" : "2020-04-07T08:24:24Z", "name" : "clusterrole_cluster-admin_User_456b80acfdf1471e8a7fbc0019825124", "namespace" : "rbac-test", "resourceVersion" : "230509842", "selfLink" : "/apis/rbac.authorization.k8s.io/v1/namespaces/rbac-test/rolebindings/clusterrole_cluster-admin_User_456b80acfdf1471e8a7fbc0019825124", "uid" : "303fcfde-78a9-11ea-83a1-340a9837e413" }, "roleRef" : { "apiGroup" : "rbac.authorization.k8s.io", "kind" : "ClusterRole", "name" : "cluster-admin" }, "subjects" : [ { "apiGroup" : "rbac.authorization.k8s.io", "kind" : "User", "name" : "456b80acfdf1471e8a7fbc0019825124" } ] }, { "metadata" : { "creationTimestamp" : "2020-04-07T08:25:46Z", "name" : "clusterrole_view_User_07b82a44a680d5661f01c00b448f8f50", "namespace" : "rbac-test", "resourceVersion" : "230511279", "selfLink" : "/apis/rbac.authorization.k8s.io/v1/namespaces/rbac-test/rolebindings/clusterrole_view_User_07b82a44a680d5661f01c00b448f8f50", "uid" : "6163c216-78a9-11ea-bcc5-340a9837e2a7" }, "roleRef" : { "apiGroup" : "rbac.authorization.k8s.io", "kind" : "ClusterRole", "name" : "view" }, "subjects" : [ { "apiGroup" : "rbac.authorization.k8s.io", "kind" : "User", "name" : "07b82a44a680d5661f01c00b448f8f50" } ] } ], "kind" : "RoleBindingList", "metadata" : { "resourceVersion" : "230535192", "selfLink" : "/apis/rbac.authorization.k8s.io/v1/namespaces/rbac-test/rolebindings" } }
共100000条