华为云用户手册

  • 响应示例 状态码: 200 OK { "apiVersion" : "apps/v1", "items" : [ { "metadata" : { "annotations" : { "deployment.kubernetes.io/revision" : "1" }, "creationTimestamp" : "2018-09-03T12:58:07Z", "generation" : 1, "labels" : { "app" : "redis" }, "name" : "deployment-test", "namespace" : "namespace-test", "resourceVersion" : "5036888", "selfLink" : "/apis/apps/v1/namespaces/namespace-test/deployments/deployment-test", "uid" : "010506c7-af79-11e8-b6ef-f898ef6c78b4" }, "spec" : { "progressDeadlineSeconds" : 600, "replicas" : 1, "revisionHistoryLimit" : 2, "selector" : { "matchLabels" : { "app" : "redis" } }, "strategy" : { "rollingUpdate" : { "maxSurge" : "25%", "maxUnavailable" : "25%" }, "type" : "RollingUpdate" }, "template" : { "metadata" : { "annotations" : { "cri.cci.io/container-type" : "secure-container" }, "creationTimestamp" : null, "labels" : { "app" : "redis" } }, "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" : { } } } }, "status" : { "availableReplicas" : 1, "conditions" : [ { "lastTransitionTime" : "2018-09-03T12:58:12Z", "lastUpdateTime" : "2018-09-03T12:58:12Z", "message" : "Deployment has minimum availability.", "reason" : "MinimumReplicasAvailable", "status" : "True", "type" : "Available" }, { "lastTransitionTime" : "2018-09-03T12:58:07Z", "lastUpdateTime" : "2018-09-03T12:58:12Z", "message" : "ReplicaSet \"deployment-test-57f7cff77c\" has successfully\nprogressed.", "reason" : "NewReplicaSetAvailable", "status" : "True", "type" : "Progressing" } ], "observedGeneration" : 1, "readyReplicas" : 1, "replicas" : 1, "updatedReplicas" : 1 } } ], "kind" : "DeploymentList", "metadata" : { "resourceVersion" : "5038849", "selfLink" : "/apis/apps/v1/namespaces/namespace-test/deployments" } }
  • 状态码 状态码 描述 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/apps/v1/namespaces/{namespace}/deployments 表1 路径参数 参数 是否必选 参数类型 描述 namespace 是 String object name and auth scope, such as for teams and projects 表2 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.
  • URI GET /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参数 参数 是否必选 参数类型 描述 exact 否 Boolean Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. Deprecated. Planned for removal in 1.18. export 否 Boolean Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. pretty 否 String If 'true', then the output is pretty printed.
  • 响应示例 状态码: 200 OK { "apiVersion" : "v1", "kind" : "PersistentVolumeClaim", "metadata" : { "annotations" : { "pv.kubernetes.io/bind-completed" : "yes", "pv.kubernetes.io/bound-by-controller" : "yes", "volume.beta.kubernetes.io/storage-class" : "sata", "volume.beta.kubernetes.io/storage-provisioner" : "flexvolume-huawei.com/fuxivol" }, "creationTimestamp" : "2018-09-07T07:17:38Z", "finalizers" : [ "kubernetes.io/pvc-protection" ], "name" : "pvc-test", "namespace" : "test-namespace", "resourceVersion" : "5915795", "selfLink" : "/api/v1/namespaces/namespace-test/persistentvolumeclaims/pvc-test", "uid" : "19a355cc-b26e-11e8-b205-c88d83be759f" }, "spec" : { "accessModes" : [ "ReadWriteMany" ], "resources" : { "requests" : { "storage" : "10Gi" } }, "volumeName" : "pvc-19a355cc-b26e-11e8-b205-c88d83be759f" }, "status" : { "accessModes" : [ "ReadWriteMany" ], "capacity" : { "storage" : "10Gi" }, "phase" : "Bound" } }
  • 状态码 状态码 描述 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 { "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" } } }
  • 状态码 状态码 描述 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.
  • 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.
  • 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.
  • 请求示例 替换指定的RoleBinding。 { "apiVersion" : "rbac.authorization.k8s.io/v1", "kind" : "RoleBinding", "metadata" : { "creationTimestamp" : "2020-04-07T08:25:46Z", "name" : "clusterrole_view_User_07b82a44a680d5661f01c00b448f8f50", "namespace" : "rbac-test", "resourceVersion" : "230608015", "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" } ] }
  • 响应示例 状态码: 200 OK { "apiVersion" : "rbac.authorization.k8s.io/v1", "kind" : "RoleBinding", "metadata" : { "creationTimestamp" : "2020-04-07T08:25:46Z", "name" : "clusterrole_view_User_07b82a44a680d5661f01c00b448f8f50", "namespace" : "rbac-test", "resourceVersion" : "230609819", "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" } ] }
  • 状态码 状态码 描述 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 表2 响应Body参数 参数 参数类型 描述 apiVersion String APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources groupVersion String groupVersion is the group and version this APIResourceList is for. kind String Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds resources Array of io.k8s.apimachinery.pkg.apis.meta.v1.APIResource objects resources contains the name of the resources and if they are namespaced. 表3 io.k8s.apimachinery.pkg.apis.meta.v1.APIResource 参数 参数类型 描述 categories Array of strings categories is a list of the grouped resources this resource belongs to (e.g. 'all') group String group is the preferred group of the resource. Empty implies the group of the containing resource list. For subresources, this may have a different value, for example: Scale". kind String kind is the kind for the resource (e.g. 'Foo' is the kind for a resource 'foo') name String name is the plural name of the resource. namespaced Boolean namespaced indicates if a resource is namespaced or not. shortNames Array of strings shortNames is a list of suggested short names of the resource. singularName String singularName is the singular name of the resource. This allows clients to handle plural and singular opaquely. The singularName is more correct for reporting status on a single item and both singular and plural are allowed from the kubectl CLI interface. storageVersionHash String The hash value of the storage version, the version this resource is converted to when written to the data store. Value must be treated as opaque by clients. Only equality comparison on the value is valid. This is an alpha feature and may change or be removed in the future. The field is populated by the apiserver only if the StorageVersionHash feature gate is enabled. This field will remain optional even if it graduates. verbs Array of strings verbs is a list of supported kube verbs (this includes get, list, watch, create, update, patch, delete, deletecollection, and proxy) version String version is the preferred version of the resource. Empty implies the version of the containing resource list For subresources, this may have a different value, for example: v1 (while inside a v1beta1 version of the core resource's group)".
  • 状态码 状态码 描述 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 { "apiVersion" : "v1", "groupVersion" : "apps/v1", "kind" : "APIResourceList", "resources" : [ { "categories" : [ "all" ], "kind" : "Deployment", "name" : "deployments", "namespaced" : true, "shortNames" : [ "deploy" ], "singularName" : "", "verbs" : [ "create", "delete", "deletecollection", "get", "list", "patch", "update", "watch" ] }, { "group" : "autoscaling", "kind" : "Scale", "name" : "deployments/scale", "namespaced" : true, "singularName" : "", "verbs" : [ "get", "patch", "update" ], "version" : "v1" }, { "kind" : "Deployment", "name" : "deployments/status", "namespaced" : true, "singularName" : "", "verbs" : [ "get", "patch", "update" ] }, { "categories" : [ "all" ], "kind" : "ReplicaSet", "name" : "replicasets", "namespaced" : true, "shortNames" : [ "rs" ], "singularName" : "", "verbs" : [ "create", "delete", "deletecollection", "get", "list", "patch", "update", "watch" ] }, { "categories" : [ "all" ], "kind" : "StatefulSet", "name" : "statefulsets", "namespaced" : true, "shortNames" : [ "sts" ], "singularName" : "", "verbs" : [ "create", "delete", "deletecollection", "get", "list", "patch", "update", "watch" ] }, { "kind" : "StatefulSet", "name" : "statefulsets/status", "namespaced" : true, "singularName" : "", "verbs" : [ "get", "patch", "update" ] } ] }
  • 响应示例 状态码: 200 OK { "apiVersion" : "v1", "groupVersion" : "crd.yangtse.cni/v1", "kind" : "APIResourceList", "resources" : [ { "kind" : "EIPPool", "name" : "eippools", "namespaced" : true, "singularName" : "eippool", "storageVersionHash" : "vG508QhjuOY=", "verbs" : [ "delete", "deletecollection", "get", "list", "patch", "create", "update", "watch" ] }, { "kind" : "EIPPool", "name" : "eippools/status", "namespaced" : true, "singularName" : "", "verbs" : [ "get", "patch", "update" ] } ] }
  • 状态码 状态码 描述 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 表2 响应Body参数 参数 参数类型 描述 apiVersion String APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources groupVersion String groupVersion is the group and version this APIResourceList is for. kind String Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds resources Array of io.k8s.apimachinery.pkg.apis.meta.v1.APIResource objects resources contains the name of the resources and if they are namespaced. 表3 io.k8s.apimachinery.pkg.apis.meta.v1.APIResource 参数 参数类型 描述 categories Array of strings categories is a list of the grouped resources this resource belongs to (e.g. 'all') group String group is the preferred group of the resource. Empty implies the group of the containing resource list. For subresources, this may have a different value, for example: Scale". kind String kind is the kind for the resource (e.g. 'Foo' is the kind for a resource 'foo') name String name is the plural name of the resource. namespaced Boolean namespaced indicates if a resource is namespaced or not. shortNames Array of strings shortNames is a list of suggested short names of the resource. singularName String singularName is the singular name of the resource. This allows clients to handle plural and singular opaquely. The singularName is more correct for reporting status on a single item and both singular and plural are allowed from the kubectl CLI interface. storageVersionHash String The hash value of the storage version, the version this resource is converted to when written to the data store. Value must be treated as opaque by clients. Only equality comparison on the value is valid. This is an alpha feature and may change or be removed in the future. The field is populated by the apiserver only if the StorageVersionHash feature gate is enabled. This field will remain optional even if it graduates. verbs Array of strings verbs is a list of supported kube verbs (this includes get, list, watch, create, update, patch, delete, deletecollection, and proxy) version String version is the preferred version of the resource. Empty implies the version of the containing resource list For subresources, this may have a different value, for example: v1 (while inside a v1beta1 version of the core resource's group)".
  • URI GET /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参数 参数 是否必选 参数类型 描述 exact 否 Boolean Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. Deprecated. Planned for removal in 1.18. export 否 Boolean Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. pretty 否 String If 'true', then the output is pretty printed.
  • 响应示例 状态码: 200 OK { "apiVersion" : "apps/v1", "kind" : "StatefulSet", "metadata" : { "creationTimestamp" : "2018-09-04T07:13:00Z", "generation" : 1, "labels" : { "app" : "statefulset-test" }, "name" : "statefulset-test", "namespace" : "namespace-test", "resourceVersion" : "5209881", "selfLink" : "/apis/apps/v1/namespaces/namespace-test/statefulsets/statefulset-test", "uid" : "f4a35f35-b011-11e8-b6ef-f898ef6c78b4" }, "spec" : { "podManagementPolicy" : "OrderedReady", "replicas" : 3, "revisionHistoryLimit" : 10, "selector" : { "matchLabels" : { "app" : "statefulset-test" } }, "serviceName" : "", "template" : { "metadata" : { "annotations" : { "cri.cci.io/container-type" : "secure-container" }, "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, "currentReplicas" : 3, "currentRevision" : "statefulset-test-f986b645b", "observedGeneration" : 1, "readyReplicas" : 2, "replicas" : 3, "updateRevision" : "statefulset-test-f986b645b" } }
  • 状态码 状态码 描述 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/apps/v1/namespaces/{namespace}/deployments/{name}/status 表1 路径参数 参数 是否必选 参数类型 描述 name 是 String name of the Deployment namespace 是 String object name and auth scope, such as for teams and projects 表2 Query参数 参数 是否必选 参数类型 描述 pretty 否 String If 'true', then the output is pretty printed.
  • 响应示例 状态码: 200 OK { "apiVersion" : "apps/v1", "kind" : "Deployment", "metadata" : { "annotations" : { "deployment.kubernetes.io/revision" : "1" }, "creationTimestamp" : "2018-09-06T03:39:32Z", "generation" : 1, "labels" : { "app" : "redis" }, "name" : "deployment-test", "namespace" : "namespace-test", "resourceVersion" : "5630865", "selfLink" : "/apis/apps/v1/namespaces/namespace-test/deployments/deployment-test/status", "uid" : "777dce52-b186-11e8-8cb0-c81fbe371a17" }, "spec" : { "progressDeadlineSeconds" : 600, "replicas" : 1, "revisionHistoryLimit" : 10, "selector" : { "matchLabels" : { "app" : "redis" } }, "strategy" : { "rollingUpdate" : { "maxSurge" : "25%", "maxUnavailable" : "25%" }, "type" : "RollingUpdate" }, "template" : { "metadata" : { "annotations" : { "cri.cci.io/container-type" : "secure-container" }, "creationTimestamp" : null, "labels" : { "app" : "redis" } }, "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" : { } } } }, "status" : { "availableReplicas" : 1, "conditions" : [ { "lastTransitionTime" : "2018-09-06T03:39:40Z", "lastUpdateTime" : "2018-09-06T03:39:40Z", "message" : "Deployment has minimum availability.", "reason" : "MinimumReplicasAvailable", "status" : "True", "type" : "Available" }, { "lastTransitionTime" : "2018-09-06T03:39:32Z", "lastUpdateTime" : "2018-09-06T03:39:40Z", "message" : "ReplicaSet \"deployment-test-865578b586\" has successfully\nprogressed.", "reason" : "NewReplicaSetAvailable", "status" : "True", "type" : "Progressing" } ], "observedGeneration" : 1, "readyReplicas" : 1, "replicas" : 1, "updatedReplicas" : 1 } }
  • 状态码 状态码 描述 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/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参数 参数 是否必选 参数类型 描述 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 pretty 否 String If 'true', then the output is pretty printed.
  • 响应示例 状态码: 200 OK { "apiVersion" : "batch.volcano.sh/v1alpha1", "kind" : "Job", "metadata" : { "creationTimestamp" : "2019-06-26T06:24:50Z", "generation" : 1, "name" : "openmpi-hello-3-com", "namespace" : "cci-namespace-42263891", "resourceVersion" : "7681358", "selfLink" : "/apis/batch.volcano.sh/v1alpha1/namespaces/cci-namespace-42263891/jobs/openmpi-hello-3-com", "uid" : "1a32a8c4-97db-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" } } }
  • 状态码 状态码 描述 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 /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参数 参数 是否必选 参数类型 描述 exact 否 Boolean Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. Deprecated. Planned for removal in 1.18. export 否 Boolean Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. pretty 否 String If 'true', then the output is pretty printed.
共100000条