功能介绍
查询指定的resourcequota(资源用量)。
调用方法
请参见如何调用API。
URI
GET /api/v1/namespaces/{namespace}/resourcequotas/{name}
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
name |
是 |
String |
name of the ResourceQuota |
namespace |
是 |
String |
object name and auth scope, such as for teams and projects |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
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. |
请求参数
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
X-Auth-Token |
是 |
String |
用户Token。 通过调用 IAM 服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 |
响应参数
状态码: 200
参数 |
参数类型 |
描述 |
---|---|---|
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 |
metadata |
Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata |
|
spec |
Spec defines the desired quota. https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status |
|
status |
Status defines the actual enforced quota and its current usage. https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status |
参数 |
参数类型 |
描述 |
---|---|---|
apiVersion |
String |
APIVersion defines the version of this resource that this field set applies to. The format is "group/version" just like the top-level APIVersion field. It is necessary to track the version of a field set because it cannot be automatically converted. |
fieldsType |
String |
FieldsType is the discriminator for the different fields format and version. There is currently only one possible value: "FieldsV1" |
fieldsV1 |
Object |
FieldsV1 holds the first JSON version format as described in the "FieldsV1" type. |
manager |
String |
Manager is an identifier of the workflow managing these fields. |
operation |
String |
Operation is the type of operation which lead to this ManagedFieldsEntry being created. The only valid values for this field are 'Apply' and 'Update'. |
time |
String |
Time is timestamp of when these fields were set. It should always be empty if Operation is 'Apply' |
参数 |
参数类型 |
描述 |
---|---|---|
apiVersion |
String |
API version of the referent. |
blockOwnerDeletion |
Boolean |
If true, AND if the owner has the "foregroundDeletion" finalizer, then the owner cannot be deleted from the key-value store until this reference is removed. Defaults to false. To set this field, a user needs "delete" permission of the owner, otherwise 422 (Unprocessable Entity) will be returned. |
controller |
Boolean |
If true, this reference points to the managing controller. |
kind |
String |
Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds |
name |
String |
Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names |
uid |
String |
UID of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#uids |
参数 |
参数类型 |
描述 |
---|---|---|
hard |
Map<String,String> |
hard is the set of desired hard limits for each named resource. More info: https://kubernetes.io/docs/concepts/policy/resource-quotas/ |
scopeSelector |
scopeSelector is also a collection of filters like scopes that must match each object tracked by a quota but expressed using ScopeSelectorOperator in combination with possible values. For a resource to match, both scopes AND scopeSelector (if specified in spec), must be matched. |
|
scopes |
Array of strings |
A collection of filters that must match each object tracked by a quota. If not specified, the quota matches all objects. |
参数 |
参数类型 |
描述 |
---|---|---|
matchExpressions |
Array of io.k8s.api.core.v1.ScopedResourceSelectorRequirement objects |
A list of scope selector requirements by scope of the resources. |
参数 |
参数类型 |
描述 |
---|---|---|
operator |
String |
Represents a scope's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. |
scopeName |
String |
The name of the scope that the selector applies to. |
values |
Array of strings |
An array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. |
参数 |
参数类型 |
描述 |
---|---|---|
hard |
Map<String,String> |
Hard is the set of enforced hard limits for each named resource. More info: https://kubernetes.io/docs/concepts/policy/resource-quotas/ |
used |
Map<String,String> |
Used is the current observed total usage of the resource in the namespace. |
请求示例
无
响应示例
状态码: 200
OK
{
"apiVersion" : "v1",
"kind" : "ResourceQuota",
"metadata" : {
"creationTimestamp" : "2022-09-07T06:07:58Z",
"name" : "compute-resources",
"namespace" : "namespace-test",
"resourceVersion" : "42717140",
"selfLink" : "/api/v1/namespaces/namespace-test/resourcequotas/compute-resources",
"uid" : "df6e7f78-717d-48e2-bf41-afab0ba0a3de"
},
"spec" : {
"hard" : {
"configmaps" : "480k",
"count/cronjobs.batch" : "960",
"count/deployments.apps" : "480",
"count/ingresses.extensions" : "480",
"count/jobs.batch" : "960",
"count/networks.networking.cci.io" : "72",
"count/statefulsets.apps" : "480",
"limits.cpu" : "100k",
"limits.memory" : "800000Gi",
"persistentvolumeclaims" : "960",
"pods" : "480k",
"requests.nvidia.com/gpu-tesla-p4" : "256",
"requests.nvidia.com/gpu-tesla-p100-16GB" : "256",
"requests.nvidia.com/gpu-tesla-v100-16GB" : "256",
"requests.nvidia.com/gpu-tesla-v100-32GB" : "256",
"secrets" : "480k",
"services" : "9600"
}
},
"status" : {
"hard" : {
"configmaps" : "480k",
"count/cronjobs.batch" : "960",
"count/deployments.apps" : "480",
"count/ingresses.extensions" : "480",
"count/jobs.batch" : "960",
"count/networks.networking.cci.io" : "72",
"count/statefulsets.apps" : "480",
"limits.cpu" : "100k",
"limits.memory" : "800000Gi",
"persistentvolumeclaims" : "960",
"pods" : "480k",
"requests.nvidia.com/gpu-tesla-p4" : "256",
"requests.nvidia.com/gpu-tesla-p100-16GB" : "256",
"requests.nvidia.com/gpu-tesla-v100-16GB" : "256",
"requests.nvidia.com/gpu-tesla-v100-32GB" : "256",
"secrets" : "480k",
"services" : "9600"
},
"used" : {
"configmaps" : "0",
"count/cronjobs.batch" : "0",
"count/deployments.apps" : "0",
"count/ingresses.extensions" : "0",
"count/jobs.batch" : "0",
"count/networks.networking.cci.io" : "1",
"count/statefulsets.apps" : "0",
"limits.cpu" : "0",
"limits.memory" : "0",
"persistentvolumeclaims" : "0",
"pods" : "0",
"requests.nvidia.com/gpu-tesla-p4" : "0",
"requests.nvidia.com/gpu-tesla-p100-16GB" : "0",
"requests.nvidia.com/gpu-tesla-v100-16GB" : "0",
"requests.nvidia.com/gpu-tesla-v100-32GB" : "0",
"secrets" : "2",
"services" : "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 |