华为云用户手册

  • 响应示例 状态码: 200 OK { "apiVersion" : "metrics.k8s.io/v1beta1", "items" : [ { "containers" : [ { "name" : "container-0", "usage" : { "cpu" : "374598n", "cpu_accumulated" : "127739654828n", "memory" : "1540Ki", "memory_rss" : "284Ki", "memory_usage" : "1804Ki" } } ], "metadata" : { "creationTimestamp" : "2023-03-28T11:24:34Z", "name" : "cci-deployment-20233231-6c8d7f74f7-2t6k5", "namespace" : "cci-namespace-13238101", "selfLink" : "/apis/metrics.k8s.io/v1beta1/namespaces/cci-namespace-13238101/pods/cci-deployment-20233231-6c8d7f74f7-2t6k5" }, "timestamp" : "2023-03-28T11:24:19Z", "window" : "30s" }, { "containers" : [ { "name" : "container-0", "usage" : { "cpu" : "0", "cpu_accumulated" : "75422933n", "memory" : "6236Ki", "memory_rss" : "1644Ki", "memory_usage" : "12308Ki" } } ], "metadata" : { "creationTimestamp" : "2023-03-28T11:24:34Z", "name" : "cci-deployment-687-1678883958925-599b74469b-7bmqh", "namespace" : "cci-namespace-13238101", "selfLink" : "/apis/metrics.k8s.io/v1beta1/namespaces/cci-namespace-13238101/pods/cci-deployment-687-1678883958925-599b74469b-7bmqh" }, "timestamp" : "2023-03-28T11:24:15Z", "window" : "30s" } ], "kind" : "PodMetricsList", "metadata" : { "selfLink" : "/apis/metrics.k8s.io/v1beta1/namespaces/cci-namespace-13238101/pods" } }
  • 状态码 状态码 描述 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", "kind" : "Endpoints", "metadata" : { "creationTimestamp" : "2023-03-28T13:55:52Z", "name" : "test-endpoint", "namespace" : "test-namespace", "resourceVersion" : "263538673", "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" } ] } ] }
  • URI POST /api/v1/namespaces/{namespace}/endpoints 表1 路径参数 参数 是否必选 参数类型 描述 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,端口名称为"service0",端口号"80",端口的IP协议为默认的TCP协议。 { "apiVersion" : "v1", "kind" : "Endpoints", "metadata" : { "name" : "test-endpoint", "namespace" : "test-namespace" }, "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 201 Created 202 Accepted 400 BadRequest 401 Unauthorized 403 Forbidden 404 NotFound 405 MethodNotAllowed 406 NotAcceptable 409 AlreadyExists 415 UnsupportedMediaType 422 Invalid 429 TooManyRequests 500 InternalError 503 ServiceUnavailable 504 ServerTimeout
  • 响应示例 状态码: 200 OK { "apiVersion" : "metrics.k8s.io/v1beta1", "containers" : [ { "name" : "container-0", "usage" : { "cpu" : "353450n", "cpu_accumulated" : "127810375798n", "memory" : "1560Ki", "memory_rss" : "284Ki", "memory_usage" : "1824Ki" } } ], "kind" : "PodMetrics", "metadata" : { "creationTimestamp" : "2023-03-28T11:28:23Z", "name" : "cci-deployment-20233231-6c8d7f74f7-2t6k5", "namespace" : "cci-namespace-13238101", "selfLink" : "/apis/metrics.k8s.io/v1beta1/namespaces/cci-namespace-13238101/pods/cci-deployment-20233231-6c8d7f74f7-2t6k5" }, "timestamp" : "2023-03-28T11:28:02Z", "window" : "30s" }
  • 状态码 状态码 描述 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/metrics.k8s.io/v1beta1/namespaces/{namespace}/pods/{name} 表1 路径参数 参数 是否必选 参数类型 描述 name 是 String name of the PodMetrics 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 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}/configmaps 表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.
  • 响应示例 状态码: 200 OK { "apiVersion" : "v1", "items" : [ { "data" : { "property_1" : "test" }, "metadata" : { "creationTimestamp" : "2017-12-13T03:15:57Z", "name" : "test-12130306", "namespace" : "ns-12130306-s", "resourceVersion" : "419081", "selfLink" : "/api/v1/namespaces/ns-12130306-s/configmaps/test-12130306", "uid" : "efd6d9e0-dfb3-11e7-9c19-fa163e2d897b" } } ], "kind" : "ConfigMapList", "metadata" : { "resourceVersion" : "419140", "selfLink" : "/api/v1/namespaces/ns-12130306-s/configmaps" } }
  • 响应参数 状态码: 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 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 name String name is the name of the group. preferredVersion io.k8s.apimachinery.pkg.apis.meta.v1.GroupVersionForDiscovery object preferredVersion is the version preferred by the API server, which probably is the storage version. serverAddressByClientCIDRs Array of io.k8s.apimachinery.pkg.apis.meta.v1.ServerAddressByClientCIDR objects a map of client CIDR to server address that is serving this group. This is to help clients reach servers in the most network-efficient way possible. Clients can use the appropriate server address as per the CIDR that they match. In case of multiple matches, clients should use the longest matching CIDR. The server returns only those CIDRs that it thinks that the client can match. For example: the master will return an internal IP CIDR only, if the client reaches the server using an internal IP. Server looks at X-Forwarded-For header or X-Real-Ip header or request.RemoteAddr (in that order) to get the client IP. versions Array of io.k8s.apimachinery.pkg.apis.meta.v1.GroupVersionForDiscovery objects versions are the versions supported in this group. 表3 io.k8s.apimachinery.pkg.apis.meta.v1.GroupVersionForDiscovery 参数 参数类型 描述 groupVersion String groupVersion specifies the API group and version in the form "group/version" version String version specifies the version in the form of "version". This is to save the clients the trouble of splitting the GroupVersion. 表4 io.k8s.apimachinery.pkg.apis.meta.v1.ServerAddressByClientCIDR 参数 参数类型 描述 clientCIDR String The CIDR with which clients can match their IP to figure out the server address that they should use. serverAddress String Address of this server, suitable for a client that matches the above CIDR. This can be a hostname, hostname:port, IP or IP:port.
  • 状态码 状态码 描述 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", "kind" : "APIGroup", "name" : "rbac.authorization.k8s.io", "preferredVersion" : { "groupVersion" : "rbac.authorization.k8s.io/v1", "version" : "v1" }, "versions" : [ { "groupVersion" : "rbac.authorization.k8s.io/v1", "version" : "v1" } ] }
  • 状态码 状态码 描述 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/v1", "items" : [ { "metadata" : { "creationTimestamp" : "2017-12-13T03:15:55Z", "labels" : { "name" : "job-test" }, "name" : "jobs-12130306", "namespace" : "ns-12130306-s", "resourceVersion" : "419064", "selfLink" : "/apis/batch/v1/namespaces/ns-12130306-s/jobs/jobs-12130306", "uid" : "eed6b02b-dfb3-11e7-9c19-fa163e2d897b" }, "spec" : { "completions" : 1, "parallelism" : 1, "selector" : { "matchLabels" : { "controller-uid" : "eed6b02b-dfb3-11e7-9c19-fa163e2d897b" } }, "template" : { "metadata" : { "creationTimestamp" : null, "labels" : { "controller-uid" : "eed6b02b-dfb3-11e7-9c19-fa163e2d897b", "job-name" : "jobs-12130306", "name" : "job-test" }, "name" : "jobs-12130306" }, "spec" : { "containers" : [ { "image" : "172.16.5.235:20202/test/redis:latest", "imagePullPolicy" : "Always", "name" : "jobs-12130306", "resources" : { }, "terminationMessagePath" : "/dev/termination-log", "terminationMessagePolicy" : "File" } ], "dnsPolicy" : "ClusterFirst", "restartPolicy" : "Never", "schedulerName" : "default-scheduler", "securityContext" : { } } } }, "status" : { "active" : 1, "startTime" : "2017-12-13T03:15:55Z" } } ], "kind" : "JobList", "metadata" : { "resourceVersion" : "419065", "selfLink" : "/apis/batch/v1/jobs" } }
  • URI GET /apis/batch/v1/jobs 表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.
  • 响应示例 状态码: 201 Created { "apiVersion" : "crd.yangtse.cni/v1", "kind" : "EIPPool", "metadata" : { "creationTimestamp" : "2023-04-23T06:36:06Z", "generation" : 1, "name" : "eippool-test", "namespace" : "auto-test-namespace", "resourceVersion" : "290279663", "selfLink" : "/apis/crd.yangtse.cni/v1/namespaces/auto-test-namespace/eippools/eippool-test", "uid" : "446b63bb-c1f1-4eb2-8bdf-b77823881d37" }, "spec" : { "amount" : 2, "eipAttributes" : { "bandwidth" : { "chargeMode" : "bandwidth", "name" : "eippool-test", "shareType" : "PER", "size" : 5 }, "ipVersion" : 4, "networkType" : "5_g-vm" } } }
  • 状态码 状态码 描述 200 OK 201 Created 202 Accepted 400 BadRequest 401 Unauthorized 403 Forbidden 404 NotFound 405 MethodNotAllowed 406 NotAcceptable 409 AlreadyExists 415 UnsupportedMediaType 422 Invalid 429 TooManyRequests 500 InternalError 503 ServiceUnavailable 504 ServerTimeout
  • URI POST /apis/crd.yangtse.cni/v1/namespaces/{namespace}/eippools 表1 路径参数 参数 是否必选 参数类型 描述 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,资源池中EIP数量为2。 { "apiVersion" : "crd.yangtse.cni/v1", "kind" : "EIPPool", "metadata" : { "name" : "eippool-test" }, "spec" : { "amount" : 2, "eipAttributes" : { "bandwidth" : { "chargeMode" : "bandwidth", "name" : "eippool-test", "shareType" : "PER", "size" : 5 }, "ipVersion" : 4, "networkType" : "5_g-vm" } } }
  • 响应参数 状态码: 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 groups Array of io.k8s.apimachinery.pkg.apis.meta.v1.APIGroup objects groups is a list of APIGroup. 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 表3 io.k8s.apimachinery.pkg.apis.meta.v1.APIGroup 参数 参数类型 描述 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 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 name String name is the name of the group. preferredVersion io.k8s.apimachinery.pkg.apis.meta.v1.GroupVersionForDiscovery object preferredVersion is the version preferred by the API server, which probably is the storage version. serverAddressByClientCIDRs Array of io.k8s.apimachinery.pkg.apis.meta.v1.ServerAddressByClientCIDR objects a map of client CIDR to server address that is serving this group. This is to help clients reach servers in the most network-efficient way possible. Clients can use the appropriate server address as per the CIDR that they match. In case of multiple matches, clients should use the longest matching CIDR. The server returns only those CIDRs that it thinks that the client can match. For example: the master will return an internal IP CIDR only, if the client reaches the server using an internal IP. Server looks at X-Forwarded-For header or X-Real-Ip header or request.RemoteAddr (in that order) to get the client IP. versions Array of io.k8s.apimachinery.pkg.apis.meta.v1.GroupVersionForDiscovery objects versions are the versions supported in this group. 表4 io.k8s.apimachinery.pkg.apis.meta.v1.GroupVersionForDiscovery 参数 参数类型 描述 groupVersion String groupVersion specifies the API group and version in the form "group/version" version String version specifies the version in the form of "version". This is to save the clients the trouble of splitting the GroupVersion. 表5 io.k8s.apimachinery.pkg.apis.meta.v1.ServerAddressByClientCIDR 参数 参数类型 描述 clientCIDR String The CIDR with which clients can match their IP to figure out the server address that they should use. serverAddress String Address of this server, suitable for a client that matches the above CIDR. This can be a hostname, hostname:port, IP or IP:port.
  • 响应示例 状态码: 200 OK { "apiVersion" : "v1", "groups" : [ { "name" : "extensions", "preferredVersion" : { "groupVersion" : "extensions/v1beta1", "version" : "v1beta1" }, "versions" : [ { "groupVersion" : "extensions/v1beta1", "version" : "v1beta1" } ] }, { "name" : "apps", "preferredVersion" : { "groupVersion" : "apps/v1", "version" : "v1" }, "versions" : [ { "groupVersion" : "apps/v1", "version" : "v1" }, { "groupVersion" : "apps/v1beta1", "version" : "v1beta1" } ] }, { "name" : "batch", "preferredVersion" : { "groupVersion" : "batch/v1", "version" : "v1" }, "versions" : [ { "groupVersion" : "batch/v1", "version" : "v1" }, { "groupVersion" : "batch/v1beta1", "version" : "v1beta1" } ] }, { "name" : "rbac.authorization.k8s.io", "preferredVersion" : { "groupVersion" : "rbac.authorization.k8s.io/v1", "version" : "v1" }, "versions" : [ { "groupVersion" : "rbac.authorization.k8s.io/v1", "version" : "v1" } ] }, { "name" : "networking.cci.io", "preferredVersion" : { "groupVersion" : "networking.cci.io/v1beta1", "version" : "v1beta1" }, "versions" : [ { "groupVersion" : "networking.cci.io/v1beta1", "version" : "v1beta1" } ] }, { "name" : "image.cci.io", "preferredVersion" : { "groupVersion" : "image.cci.io/v1alpha1", "version" : "v1alpha1" }, "versions" : [ { "groupVersion" : "image.cci.io/v1alpha1", "version" : "v1alpha1" } ] }, { "name" : "kubeflow.org", "preferredVersion" : { "groupVersion" : "kubeflow.org/v1", "version" : "v1" }, "versions" : [ { "groupVersion" : "kubeflow.org/v1", "version" : "v1" } ] }, { "name" : "batch.volcano.sh", "preferredVersion" : { "groupVersion" : "batch.volcano.sh/v1alpha1", "version" : "v1alpha1" }, "versions" : [ { "groupVersion" : "batch.volcano.sh/v1alpha1", "version" : "v1alpha1" } ] }, { "name" : "metrics.k8s.io", "preferredVersion" : { "groupVersion" : "metrics.k8s.io/v1beta1", "version" : "v1beta1" }, "versions" : [ { "groupVersion" : "metrics.k8s.io/v1beta1", "version" : "v1beta1" } ] } ], "kind" : "APIGroupList" }
  • 状态码 状态码 描述 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 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/v1beta1/cronjobs 表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" : "batch/v1beta1", "items" : [ { "metadata" : { "annotations" : { "description" : "" }, "creationTimestamp" : "2022-09-06T08:56:37Z", "name" : "cronjob-test", "namespace" : "namespace-test", "resourceVersion" : "615089077", "selfLink" : "/apis/batch/v1beta1/namespaces/namespace-test/cronjobs/cronjob-test", "uid" : "808543b6-696f-49ef-a8c9-30ab6b66c979" }, "spec" : { "concurrencyPolicy" : "Forbid", "failedJobsHistoryLimit" : 1, "jobTemplate" : { "metadata" : { "creationTimestamp" : null }, "spec" : { "template" : { "metadata" : { "annotations" : { "cri.cci.io/container-type" : "secure-container", "log.stdoutcollection.kubernetes.io" : "{\\\\\"collectionContainers\\\\\": [\\\\\"container-0\\\\\"]}" }, "creationTimestamp" : null }, "spec" : { "containers" : [ { "image" : "redis", "imagePullPolicy" : "IfNotPresent", "lifecycle" : { }, "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" : "Never", "schedulerName" : "default-scheduler", "securityContext" : { }, "terminationGracePeriodSeconds" : 30 } } } }, "schedule" : "0 */1 * * *", "successfulJobsHistoryLimit" : 3, "suspend" : false }, "status" : { } } ], "kind" : "CronJobList", "metadata" : { "resourceVersion" : "41656236", "selfLink" : "" } }
  • URI PUT /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. 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
共100000条