华为云用户手册

  • URI PUT /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name} 表1 路径参数 参数 是否必选 参数类型 描述 name 是 String name of the RoleBinding 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 201 Created 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
  • 请求示例 将Ingress的servicePort由"8080"替换为"8081"。 { "apiVersion" : "extensions/v1beta1", "kind" : "Ingress", "metadata" : { "annotations" : { "kubernetes.io/elb.id" : "xxx", "kubernetes.io/elb.ip" : "192.168.137.182", "kubernetes.io/elb.port" : "6071" }, "labels" : { "app" : "redis", "isExternal" : "true", "zone" : "data" }, "name" : "redis" }, "spec" : { "rules" : [ { "http" : { "paths" : [ { "backend" : { "serviceName" : "redis", "servicePort" : 8081 }, "path" : "/" } ] } } ] } }
  • 响应示例 状态码: 200 OK { "apiVersion" : "extensions/v1beta1", "kind" : "Ingress", "metadata" : { "annotations" : { "kubernetes.io/elb.id" : "xxx", "kubernetes.io/elb.ip" : "192.168.137.182", "kubernetes.io/elb.port" : "6071" }, "creationTimestamp" : "2018-09-04T02:16:14Z", "generation" : 2, "labels" : { "app" : "redis", "isExternal" : "true", "zone" : "data" }, "name" : "redis", "namespace" : "namespace-test", "resourceVersion" : "5162744", "selfLink" : "/apis/extensions/v1beta1/namespaces/namespace-test/ingresses/redis", "uid" : "7f86c310-afe8-11e8-b6ef-f898ef6c78b4" }, "spec" : { "rules" : [ { "http" : { "paths" : [ { "backend" : { "serviceName" : "redis", "servicePort" : 8081 }, "path" : "/" } ] } } ] }, "status" : { "loadBalancer" : { "ingress" : [ { "ip" : "192.168.137.182" } ] } } }
  • URI PUT /apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name} 表1 路径参数 参数 是否必选 参数类型 描述 name 是 String name of the Ingress 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.
  • 请求示例 将已创建EIPPool中的label值替换为"some-key" : "some-value"。 { "apiVersion" : "crd.yangtse.cni/v1", "kind" : "EIPPool", "metadata" : { "creationTimestamp" : "2022-09-07T01:22:50Z", "finalizers" : [ "yangtse.io/eip-pool" ], "generation" : 1, "labels" : { "some-key" : "some-value" }, "name" : "eippool-test", "namespace" : "namespace-test", "resourceVersion" : "42396258", "selfLink" : "/apis/crd.yangtse.cni/v1/namespaces/namespace-test/eippools/eippool-test", "uid" : "e4dc5432-1d9b-4fcb-8840-ee445b6511ae" }, "spec" : { "amount" : 1, "eipAttributes" : { "bandwidth" : { "chargeMode" : "bandwidth", "name" : "eip-test", "shareType" : "PER", "size" : 5 }, "ipVersion" : 4, "networkType" : "5_g-vm" } }, "status" : { "eips" : [ { "alias" : "eip-test", "bandWidthChargeMode" : "bandwidth", "bandwidthShareType" : "PER", "bandwidthSize" : 5, "id" : "034a0bae-81f7-46f4-b933-3273adc32b54", "ipv4" : "100.85.221.2", "networkType" : "5_g-vm", "status" : "DOWN" } ], "usage" : "0/1" } }
  • 状态码 状态码 描述 200 OK 201 Created 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 { "apiVersion" : "crd.yangtse.cni/v1", "kind" : "EIPPool", "metadata" : { "creationTimestamp" : "2022-09-07T01:22:50Z", "finalizers" : [ "yangtse.io/eip-pool" ], "generation" : 1, "labels" : { "some-key" : "some-value" }, "name" : "eippool-test", "namespace" : "namespace-test", "resourceVersion" : "42396258", "selfLink" : "/apis/crd.yangtse.cni/v1/namespaces/namespace-test/eippools/eippool-test", "uid" : "e4dc5432-1d9b-4fcb-8840-ee445b6511ae" }, "spec" : { "amount" : 1, "eipAttributes" : { "bandwidth" : { "chargeMode" : "bandwidth", "name" : "eip-test", "shareType" : "PER", "size" : 5 }, "ipVersion" : 4, "networkType" : "5_g-vm" } }, "status" : { "eips" : [ { "alias" : "eip-test", "bandWidthChargeMode" : "bandwidth", "bandwidthShareType" : "PER", "bandwidthSize" : 5, "id" : "034a0bae-81f7-46f4-b933-3273adc32b54", "ipv4" : "100.85.221.2", "networkType" : "5_g-vm", "status" : "DOWN" } ], "usage" : "0/1" } }
  • URI PUT /apis/crd.yangtse.cni/v1/namespaces/{namespace}/eippools/{name} 表1 路径参数 参数 是否必选 参数类型 描述 name 是 String name of the EIPPool 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 201 Created 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
  • 请求示例 将已创建Service的名称替换为“service-test”。 { "apiVersion" : "v1", "kind" : "Service", "metadata" : { "annotations" : { "kubernetes.io/elb.class" : "dnat", "kubernetes.io/natgateway.id" : "xxx", "tenant.kubernetes.io/domain-id" : "xxx", "tenant.kubernetes.io/project-id" : "xxx" }, "creationTimestamp" : "2022-09-06T06:28:09Z", "finalizers" : [ "service.kubernetes.io/load-balancer-cleanup" ], "labels" : { "app" : "service-test" }, "name" : "service-test", "namespace" : "namespace-test", "resourceVersion" : "41521168", "selfLink" : "/api/v1/namespaces/namespace-test/services/service-test", "uid" : "7dfc42ef-f938-401c-b44a-1f7bd79b3fcb" }, "spec" : { "clusterIP" : "10.247.64.172", "externalTrafficPolicy" : "Cluster", "loadBalancerIP" : "100.93.1.98", "ports" : [ { "name" : "service0", "nodePort" : 31966, "port" : 30157, "protocol" : "TCP", "targetPort" : 80 } ], "selector" : { "app" : "service-test" }, "sessionAffinity" : "None", "type" : "LoadBalancer" }, "status" : { "loadBalancer" : { } } }
  • URI PUT /api/v1/namespaces/{namespace}/services/{name} 表1 路径参数 参数 是否必选 参数类型 描述 name 是 String name of the Service 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 { "apiVersion" : "v1", "kind" : "Service", "metadata" : { "annotations" : { "kubernetes.io/elb.class" : "dnat", "kubernetes.io/natgateway.id" : "4ed25dd6-1887-439f-aef6-b1e3f2b57b5c", "tenant.kubernetes.io/domain-id" : "08a2c8ef8180d4150ff5c0012463ee60", "tenant.kubernetes.io/project-id" : "08a2c8ef8d80d4152ff8c001d0281c03" }, "creationTimestamp" : "2022-09-06T06:28:09Z", "finalizers" : [ "service.kubernetes.io/load-balancer-cleanup" ], "labels" : { "app" : "service-test" }, "name" : "service-test", "namespace" : "namespace-test", "resourceVersion" : "41521168", "selfLink" : "/api/v1/namespaces/namespace-test/services/service-test", "uid" : "7dfc42ef-f938-401c-b44a-1f7bd79b3fcb" }, "spec" : { "clusterIP" : "10.247.64.172", "externalTrafficPolicy" : "Cluster", "loadBalancerIP" : "100.93.1.98", "ports" : [ { "name" : "service0", "nodePort" : 31966, "port" : 30157, "protocol" : "TCP", "targetPort" : 80 } ], "selector" : { "app" : "service-test" }, "sessionAffinity" : "None", "type" : "LoadBalancer" }, "status" : { "loadBalancer" : { } } }
  • URI PUT /api/v1/namespaces/{namespace}/secrets/{name} 表1 路径参数 参数 是否必选 参数类型 描述 name 是 String name of the Secret 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 201 Created 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 { "apiVersion" : "v1", "data" : { "key1" : "MWYyZDFlMmU2N2Rm", "test" : "dGVzdA==" }, "kind" : "Secret", "metadata" : { "creationTimestamp" : "2018-09-04T03:59:19Z", "name" : "secret-test", "namespace" : "namespace-test", "resourceVersion" : "5199399", "selfLink" : "/api/v1/namespaces/namespace-test/secrets/secret-test", "uid" : "e6170b6d-aff6-11e8-8f17-c81fbe371a17" }, "type" : "Opaque" }
  • 请求示例 将已创建Secret中的key2替换为"test"。 { "apiVersion" : "v1", "data" : { "key1" : "MWYyZDFlMmU2N2Rm", "test" : "dGVzdA==" }, "kind" : "Secret", "metadata" : { "name" : "secret-test" }, "type" : "Opaque" }
  • 响应示例 状态码: 200 OK { "apiVersion" : "v1", "kind" : "Pod", "metadata" : { "creationTimestamp" : "2018-09-04T11:04:02Z", "labels" : { "name" : "pod-test" }, "name" : "pod-test", "namespace" : "namespace-test", "resourceVersion" : "5253248", "selfLink" : "/api/v1/namespaces/namespace-test/pods/pod-test", "uid" : "3b99abe8-b032-11e8-9d5d-c88d83be759f" }, "spec" : { "containers" : [ { "image" : "redis:latest", "imagePullPolicy" : "Always", "name" : "test", "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" : { }, "tolerations" : [ { "effect" : "NoExecute", "key" : "node.kubernetes.io/not-ready", "operator" : "Exists", "tolerationSeconds" : 300 }, { "effect" : "NoExecute", "key" : "node.kubernetes.io/unreachable", "operator" : "Exists", "tolerationSeconds" : 300 } ] }, "status" : { "conditions" : [ { "lastProbeTime" : null, "lastTransitionTime" : "2018-09-04T11:04:03Z", "status" : "True", "type" : "Initialized" }, { "lastProbeTime" : null, "lastTransitionTime" : "2018-09-04T11:04:36Z", "status" : "True", "type" : "Ready" }, { "lastProbeTime" : null, "lastTransitionTime" : "2018-09-04T11:04:02Z", "status" : "True", "type" : "PodScheduled" } ], "containerStatuses" : [ { "containerID" : "docker://f867ab7d5c68a86fc695e4d3e5f1912fdb8f98f5029ca96032b4d5d407d9a75c", "image" : "redis", "imageID" : "docker-pullable://redis@sha256:3ab7046bd035a47aa06963d8240651d00b57e82dab07ba374ad01f84dfa1230c", "lastState" : { }, "name" : "test", "ready" : true, "restartCount" : 0, "state" : { "running" : { "startedAt" : "2018-09-04T11:04:23Z" } } } ], "hostIP" : "xxx.xxx.xxx.xxx", "phase" : "Running", "podIP" : "192.168.244.170", "qosClass" : "Guaranteed", "startTime" : "2018-09-04T11:04:03Z" } }
  • 状态码 状态码 描述 200 OK 201 Created 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
  • 请求示例 将已创建Pod的镜像替换为"redis:latest"。 { "apiVersion" : "v1", "kind" : "Pod", "metadata" : { "labels" : { "name" : "pod-test" }, "name" : "pod-test" }, "spec" : { "containers" : [ { "image" : "redis:latest", "imagePullPolicy" : "Always", "name" : "test", "resources" : { "limits" : { "cpu" : "0.5", "memory" : "1024Mi" }, "requests" : { "cpu" : "0.5", "memory" : "1024Mi" } } } ], "imagePullSecrets" : [ { "name" : "imagepull-secret" } ], "restartPolicy" : "Always" } }
  • URI PUT /api/v1/namespaces/{namespace}/pods/{name} 表1 路径参数 参数 是否必选 参数类型 描述 name 是 String name of the Pod 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 201 Created 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
  • 请求示例 更新PersistentVolumeClaims的metadata.labels { "apiVersion" : "v1", "kind" : "PersistentVolumeClaim", "metadata" : { "annotations" : { "everest.io/disk-volume-type" : "SATA", "pv.kubernetes.io/bind-completed" : "yes", "pv.kubernetes.io/bound-by-controller" : "yes", "volume.beta.kubernetes.io/storage-provisioner" : "everest-csi-provisioner" }, "creationTimestamp" : "2023-06-25T02:59:26Z", "finalizers" : [ "kubernetes.io/pvc-protection" ], "labels" : { "failure-domain.beta.kubernetes.io/region" : "cn-north-7", "failure-domain.beta.kubernetes.io/zone" : "cn-north-7a" }, "name" : "pvc-test", "namespace" : "test-namespace", "resourceVersion" : "343613181", "selfLink" : "/api/v1/namespaces/test-namespace/persistentvolumeclaims/pvc-test", "uid" : "bb99f33d-a5da-46b4-90a4-b0c6b3eedabf" }, "spec" : { "accessModes" : [ "ReadWriteMany" ], "resources" : { "requests" : { "storage" : "10Gi" } }, "storageClassName" : "sata", "volumeMode" : "Filesystem", "volumeName" : "pvc-bb99f33d-a5da-46b4-90a4-b0c6b3eedabf" } }
  • 响应示例 状态码: 200 OK { "apiVersion" : "v1", "kind" : "PersistentVolumeClaim", "metadata" : { "annotations" : { "everest.io/disk-volume-type" : "SATA", "pv.kubernetes.io/bind-completed" : "yes", "pv.kubernetes.io/bound-by-controller" : "yes", "volume.beta.kubernetes.io/storage-provisioner" : "everest-csi-provisioner" }, "creationTimestamp" : "2023-06-25T02:59:26Z", "finalizers" : [ "kubernetes.io/pvc-protection" ], "labels" : { "failure-domain.beta.kubernetes.io/region" : "cn-north-7", "failure-domain.beta.kubernetes.io/zone" : "cn-north-7a" }, "name" : "pvc-test", "namespace" : "test-namespace", "resourceVersion" : "343622839", "selfLink" : "/api/v1/namespaces/test-namespace/persistentvolumeclaims/pvc-test", "uid" : "bb99f33d-a5da-46b4-90a4-b0c6b3eedabf" }, "spec" : { "accessModes" : [ "ReadWriteMany" ], "resources" : { "requests" : { "storage" : "10Gi" } }, "storageClassName" : "sata", "volumeMode" : "Filesystem", "volumeName" : "pvc-bb99f33d-a5da-46b4-90a4-b0c6b3eedabf" }, "status" : { "accessModes" : [ "ReadWriteMany" ], "capacity" : { "storage" : "10Gi" }, "phase" : "Bound" } }
  • URI PUT /api/v1/namespaces/{namespace}/persistentvolumeclaims/{name} 表1 路径参数 参数 是否必选 参数类型 描述 name 是 String name of the PersistentVolumeClaim 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 201 Created 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 PUT /api/v1/namespaces/{namespace}/endpoints/{name} 表1 路径参数 参数 是否必选 参数类型 描述 name 是 String name of the Endpoints 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.
  • 请求示例 替换Endpoint。 { "apiVersion" : "v1", "kind" : "Endpoints", "metadata" : { "annotations" : { "new-key" : "new-value", "test-key" : "test-value" }, "creationTimestamp" : "2023-03-28T13:55:52Z", "name" : "test-endpoint", "namespace" : "test-namespace", "resourceVersion" : "263561274", "selfLink" : "/api/v1/namespaces/test-namespace/endpoints/test-endpoint", "uid" : "3907aa64-c3f3-4de0-b938-9d23e8d12f94" }, "subsets" : [ { "addresses" : [ { "ip" : "192.168.226.222", "targetRef" : { "kind" : "Pod", "name" : "nginx-686bccd6f-ccsqb", "namespace" : "test-namespace", "resourceVersion" : "262055491", "uid" : "ae417968-4f69-40da-9228-2434671e9c66" } } ], "ports" : [ { "name" : "service0", "port" : 80, "protocol" : "TCP" } ] } ] }
  • 响应示例 状态码: 200 OK { "apiVersion" : "v1", "kind" : "Endpoints", "metadata" : { "annotations" : { "new-key" : "new-value", "test-key" : "test-value" }, "creationTimestamp" : "2023-03-28T13:55:52Z", "name" : "test-endpoint", "namespace" : "test-namespace", "resourceVersion" : "263576210", "selfLink" : "/api/v1/namespaces/test-namespace/endpoints/test-endpoint", "uid" : "3907aa64-c3f3-4de0-b938-9d23e8d12f94" }, "subsets" : [ { "addresses" : [ { "ip" : "192.168.226.222", "targetRef" : { "kind" : "Pod", "name" : "nginx-686bccd6f-ccsqb", "namespace" : "test-namespace", "resourceVersion" : "262055491", "uid" : "ae417968-4f69-40da-9228-2434671e9c66" } } ], "ports" : [ { "name" : "service0", "port" : 80, "protocol" : "TCP" } ] } ] }
  • 请求示例 将已创建ConfigMap中的data数据替换为 "property_1" : "test2"。 { "apiVersion" : "v1", "data" : { "property_1" : "test2" }, "kind" : "ConfigMap", "metadata" : { "name" : "configmap-test" } }
共100000条