0
点赞
收藏
分享

微信扫一扫

K8sAPI接口文档

JamFF 2022-04-29 阅读 45
kubernetes

#sjjd
#K8sAPI

API操作方式描述
CustomObjectsApi使用 CustomObjectsApi apiInstance = new CustomObjectsApi();CRD(CustomResourceDefinition,自定义资源)资源增删改查
CoreV1Api使用 CoreV1Api apiInstance = new CoreV1Api();Namespaces增删改查
SchedulingV1Api使用 SchedulingV1Api apiInstance = new SchedulingV1Api();优先级增删改查
AppsV1Api使用 AppsV1Api apiInstance = new AppsV1Api();Deployment增删改查

CustomObjectsApi


回到K8sAPI根目录

All URIs are relative to http://localhost

MethodHTTP requestDescription
createClusterCustomObjectPOST /apis/{group}/{version}/{plural}创建集群范围CRD资源对象
createNamespacedCustomObjectPOST /apis/{group}/{version}/namespaces/{namespace}/{plural}创建分区范围CRD资源对象
deleteClusterCustomObjectDELETE /apis/{group}/{version}/{plural}/{name}删除集群范围CRD资源对象
deleteNamespacedCustomObjectDELETE /apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}删除分区范围CRD资源对象
getClusterCustomObjectGET /apis/{group}/{version}/{plural}/{name}获取集群范围CRD资源对象
getClusterCustomObjectScaleGET /apis/{group}/{version}/{plural}/{name}/scale获取集群范围CRD资源对象-scale
getClusterCustomObjectStatusGET /apis/{group}/{version}/{plural}/{name}/status获取集群范围CRD资源对象-状态
getNamespacedCustomObjectGET /apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}获取分区范围CRD资源对象
getNamespacedCustomObjectScaleGET /apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}/scale获取分区范围CRD资源对象-scale
getNamespacedCustomObjectStatusGET /apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}/status获取分区范围CRD资源对象-状态
listClusterCustomObjectGET /apis/{group}/{version}/{plural}集群范围CRD资源对象列表
listNamespacedCustomObjectGET /apis/{group}/{version}/namespaces/{namespace}/{plural}分区范围CRD资源对象列表
patchClusterCustomObjectPATCH /apis/{group}/{version}/{plural}/{name}更新集群范围CRD资源对象
patchClusterCustomObjectScalePATCH /apis/{group}/{version}/{plural}/{name}/scale更新集群范围CRD资源对象-scale
patchClusterCustomObjectStatusPATCH /apis/{group}/{version}/{plural}/{name}/status更新集群范围CRD资源对象-状态
patchNamespacedCustomObjectPATCH /apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}更新分区范围CRD资源对象
patchNamespacedCustomObjectScalePATCH /apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}/scale更新分区范围CRD资源对象-scale
patchNamespacedCustomObjectStatusPATCH /apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}/status更新分区范围CRD资源对象-状态
replaceClusterCustomObjectPUT /apis/{group}/{version}/{plural}/{name}替换集群范围CRD资源对象
replaceClusterCustomObjectScalePUT /apis/{group}/{version}/{plural}/{name}/scale替换集群范围CRD资源对象-scale
replaceClusterCustomObjectStatusPUT /apis/{group}/{version}/{plural}/{name}/status替换集群范围CRD资源对象-状态
replaceNamespacedCustomObjectPUT /apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}替换分区范围CRD资源对象
replaceNamespacedCustomObjectScalePUT /apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}/scale替换分区范围CRD资源对象-scale
replaceNamespacedCustomObjectStatusPUT /apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}/status替换分区范围CRD资源对象-状态

createClusterCustomObject


回到CustomObjectsApi目录

Creates a cluster scoped Custom object(创建群集范围的自定义对象)

Example

// Import classes:
import io.kubernetes.client.openapi.ApiClient;
import io.kubernetes.client.openapi.ApiException;
import io.kubernetes.client.openapi.Configuration;
import io.kubernetes.client.openapi.auth.*;
import io.kubernetes.client.openapi.models.*;
import io.kubernetes.client.openapi.apis.CustomObjectsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://localhost");
    
    // Configure API key authorization: BearerToken
    ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken");
    BearerToken.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //BearerToken.setApiKeyPrefix("Token");

    CustomObjectsApi apiInstance = new CustomObjectsApi(defaultClient);
    String group = "group_example"; // String | The custom resource's group name
    String version = "version_example"; // String | The custom resource's version
    String plural = "plural_example"; // String | 自定义资源的复数名。对于TPR,这将是小写复数形式。The custom resource's plural name. For TPRs this would be lowercase plural kind.
    Object body = null; // Object | 要创建的资源的JSON模式。The JSON schema of the Resource to create..
    String pretty = "pretty_example"; // String | 如果为“true”,则输出相当打印。If 'true', then the output is pretty printed.
    String dryRun = "dryRun_example"; // String | 如果存在,则表示不应保留修改。无效或无法识别的dryRun指令将导致错误响应,并且不会进一步处理请求。有效值为:-全部:将处理所有干运行阶段。如果存在,则表示不应保留修改。无效或无法识别的dryRun指令将导致错误响应,并且不会进一步处理请求。有效值为:-全部:将处理所有干运行阶段。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
    String fieldManager = "fieldManager_example"; // String | fieldManager是与进行这些更改的参与者或实体关联的名称。该值的长度必须小于或128个字符,并且仅包含可打印字符,如https://golang.org/pkg/unicode/#IsPrint.应用请求(应用程序/应用补丁)需要此字段,但非应用补丁类型(JsonPatch、MergePatch、StrategicMergePatch)可选择此字段。 fieldManager是与进行这些更改的参与者或实体关联的名称。该值的长度必须小于或128个字符,并且仅包含可打印字符,如https://golang.org/pkg/unicode/#IsPrint.fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).
    try {
      Object result = apiInstance.createClusterCustomObject(group, version, plural, body, pretty, dryRun, fieldManager);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CustomObjectsApi#createClusterCustomObject");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

NameTypeDescriptionNotes
groupStringThe custom resource's group name
versionStringThe custom resource's version
pluralStringThe custom resource's plural name. For TPRs this would be lowercase plural kind.
bodyObject要创建的资源的JSON模式。The JSON schema of the Resource to create…
prettyString如果为“true”,则输出相当打印。If 'true', then the output is pretty printed.[optional]
dryRunString如果存在,则表示不应保留修改。无效或无法识别的dryRun指令将导致错误响应,并且不会进一步处理请求。有效值为:-全部:将处理所有干运行阶段。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[optional]
fieldManagerStringfieldManager是与进行这些更改的参与者或实体关联的名称。该值的长度必须小于或128个字符,并且仅包含可打印字符,如https://golang.org/pkg/unicode/#IsPrint.应用请求(应用程序/应用补丁)需要此字段,但非应用补丁类型(JsonPatch、MergePatch、StrategicMergePatch)可选择此字段。 fieldManager是与进行这些更改的参与者或实体关联的名称。该值的长度必须小于或128个字符,并且仅包含可打印字符,如https://golang.org/pkg/unicode/#IsPrint.fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).[optional]

Return type

Object

Authorization

BearerToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
201Created-
401Unauthorized-

createNamespacedCustomObject


回到CustomObjectsApi目录

Creates a namespace scoped Custom object

Example

// Import classes:
import io.kubernetes.client.openapi.ApiClient;
import io.kubernetes.client.openapi.ApiException;
import io.kubernetes.client.openapi.Configuration;
import io.kubernetes.client.openapi.auth.*;
import io.kubernetes.client.openapi.models.*;
import io.kubernetes.client.openapi.apis.CustomObjectsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://localhost");
    
    // Configure API key authorization: BearerToken
    ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken");
    BearerToken.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //BearerToken.setApiKeyPrefix("Token");

    CustomObjectsApi apiInstance = new CustomObjectsApi(defaultClient);
    String group = "group_example"; // String | The custom resource's group name
    String version = "version_example"; // String | The custom resource's version
    String namespace = "namespace_example"; // String | The custom resource's namespace
    String plural = "plural_example"; // String | 自定义资源的复数名。对于TPR,这将是小写复数形式。The custom resource's plural name. For TPRs this would be lowercase plural kind.
    Object body = null; // Object | 要创建的资源的JSON模式。The JSON schema of the Resource to create..
    String pretty = "pretty_example"; // String | 如果为“true”,则输出相当打印。If 'true', then the output is pretty printed.
    String dryRun = "dryRun_example"; // String | 如果存在,则表示不应保留修改。无效或无法识别的dryRun指令将导致错误响应,并且不会进一步处理请求。有效值为:-全部:将处理所有干运行阶段。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
    String fieldManager = "fieldManager_example"; // String | fieldManager是与进行这些更改的参与者或实体关联的名称。该值的长度必须小于或128个字符,并且仅包含可打印字符,如https://golang.org/pkg/unicode/#IsPrint.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.
    try {
      Object result = apiInstance.createNamespacedCustomObject(group, version, namespace, plural, body, pretty, dryRun, fieldManager);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CustomObjectsApi#createNamespacedCustomObject");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

NameTypeDescriptionNotes
groupStringThe custom resource's group name
versionStringThe custom resource's version
namespaceStringThe custom resource's namespace
pluralString自定义资源的复数名。对于TPR,这将是小写复数形式。
bodyObject要创建的资源的JSON模式。The JSON schema of the Resource to create…
prettyString如果为“true”,则输出相当打印。If 'true', then the output is pretty printed.[optional]
dryRunString如果存在,则表示不应保留修改。无效或无法识别的dryRun指令将导致错误响应,并且不会进一步处理请求。有效值为:-全部:将处理所有干运行阶段。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[optional]
fieldManagerStringfieldManager是与进行这些更改的参与者或实体关联的名称。该值的长度必须小于或128个字符,并且仅包含可打印字符,如https://golang.org/pkg/unicode/#IsPrint.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.[optional]

Return type

Object

Authorization

BearerToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
201Created-
401Unauthorized-

deleteClusterCustomObject


回到CustomObjectsApi目录

Deletes the specified cluster scoped custom object

Example

// Import classes:
import io.kubernetes.client.openapi.ApiClient;
import io.kubernetes.client.openapi.ApiException;
import io.kubernetes.client.openapi.Configuration;
import io.kubernetes.client.openapi.auth.*;
import io.kubernetes.client.openapi.models.*;
import io.kubernetes.client.openapi.apis.CustomObjectsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://localhost");
    
    // Configure API key authorization: BearerToken
    ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken");
    BearerToken.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //BearerToken.setApiKeyPrefix("Token");

    CustomObjectsApi apiInstance = new CustomObjectsApi(defaultClient);
    String group = "group_example"; // String | the custom resource's group
    String version = "version_example"; // String | the custom resource's version
    String plural = "plural_example"; // String | 自定义资源的复数名。对于TPR,这将是小写复数形式。the custom object's plural name. For TPRs this would be lowercase plural kind.
    String name = "name_example"; // String | the custom object's name
    Integer gracePeriodSeconds = 56; // Integer | 删除对象前的持续时间(秒)。值必须是非负整数。值为零表示立即删除。如果此值为nil,则将使用指定类型的默认宽限期。如果未指定,则默认为每对象值。零表示立即删除。The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.
    Boolean orphanDependents = true; // Boolean | 已弃用:请使用PropagationPolicy,此字段将在1.7中弃用。从属对象应该是孤立的吗。如果为真/假,“孤立”终结器将被添加到对象的终结器列表中或从中删除。可以设置此字段或PropagationPolicy,但不能同时设置两者。已弃用:请使用PropagationPolicy,此字段将在1.7中弃用。从属对象应该是孤立的吗。如果为真/假,“孤立”终结器将被添加到对象的终结器列表中或从中删除。可以设置此字段或PropagationPolicy,但不能同时设置两者。Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.
    String propagationPolicy = "propagationPolicy_example"; // String | 是否以及如何执行垃圾收集。可以设置此字段或孤立从属项,但不能同时设置两者。默认策略由元数据中设置的现有终结器决定。终结器和特定于资源的默认策略。Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy.
    String dryRun = "dryRun_example"; // String | 如果存在,则表示不应保留修改。无效或无法识别的dryRun指令将导致错误响应,并且不会进一步处理请求。有效值为:-全部:将处理所有干运行阶段。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
    V1DeleteOptions body = new V1DeleteOptions(); // V1DeleteOptions | 
    try {
      Object result = apiInstance.deleteClusterCustomObject(group, version, plural, name, gracePeriodSeconds, orphanDependents, propagationPolicy, dryRun, body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CustomObjectsApi#deleteClusterCustomObject");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

NameTypeDescriptionNotes
groupStringthe custom resource's group
versionStringthe custom resource's version
pluralString自定义资源的复数名。对于TPR,这将是小写复数形式。the custom object's plural name. For TPRs this would be lowercase plural kind.
nameStringthe custom object's name
gracePeriodSecondsInteger删除对象前的持续时间(秒)。值必须是非负整数。值为零表示立即删除。如果此值为nil,则将使用指定类型的默认宽限期。如果未指定,则默认为每对象值。零表示立即删除。The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.[optional]
orphanDependentsBoolean已弃用:请使用PropagationPolicy,此字段将在1.7中弃用。从属对象应该是孤立的吗。如果为真/假,“孤立”终结器将被添加到对象的终结器列表中或从中删除。可以设置此字段或PropagationPolicy,但不能同时设置两者。已弃用:请使用PropagationPolicy,此字段将在1.7中弃用。从属对象应该是孤立的吗。如果为真/假,“孤立”终结器将被添加到对象的终结器列表中或从中删除。可以设置此字段或PropagationPolicy,但不能同时设置两者。Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the "orphan" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.[optional]
propagationPolicyString是否以及如何执行垃圾收集。可以设置此字段或孤立从属项,但不能同时设置两者。默认策略由元数据中设置的现有终结器决定。终结器和特定于资源的默认策略。Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy.[optional]
dryRunString如果存在,则表示不应保留修改。无效或无法识别的dryRun指令将导致错误响应,并且不会进一步处理请求。有效值为:-全部:将处理所有干运行阶段。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[optional]
bodyV1DeleteOptions[optional]

Return type

Object

Authorization

BearerToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200OK-
401Unauthorized-

deleteNamespacedCustomObject


回到CustomObjectsApi目录

Deletes the specified namespace scoped custom object

Example

// Import classes:
import io.kubernetes.client.openapi.ApiClient;
import io.kubernetes.client.openapi.ApiException;
import io.kubernetes.client.openapi.Configuration;
import io.kubernetes.client.openapi.auth.*;
import io.kubernetes.client.openapi.models.*;
import io.kubernetes.client.openapi.apis.CustomObjectsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://localhost");
    
    // Configure API key authorization: BearerToken
    ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken");
    BearerToken.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //BearerToken.setApiKeyPrefix("Token");

    CustomObjectsApi apiInstance = new CustomObjectsApi(defaultClient);
    String group = "group_example"; // String | the custom resource's group
    String version = "version_example"; // String | the custom resource's version
    String namespace = "namespace_example"; // String | The custom resource's namespace
    String plural = "plural_example"; // String | 自定义资源的复数名。对于TPR,这将是小写复数形式。the custom resource's plural name. For TPRs this would be lowercase plural kind.
    String name = "name_example"; // String | the custom object's name
    Integer gracePeriodSeconds = 56; // Integer | 删除对象前的持续时间(秒)。值必须是非负整数。值为零表示立即删除。如果此值为nil,则将使用指定类型的默认宽限期。如果未指定,则默认为每对象值。零表示立即删除。The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.
    Boolean orphanDependents = true; // Boolean | 已弃用:请使用PropagationPolicy,此字段将在1.7中弃用。从属对象应该是孤立的吗。如果为真/假,“孤立”终结器将被添加到对象的终结器列表中或从中删除。可以设置此字段或PropagationPolicy,但不能同时设置两者。已弃用:请使用PropagationPolicy,此字段将在1.7中弃用。从属对象应该是孤立的吗。如果为真/假,“孤立”终结器将被添加到对象的终结器列表中或从中删除。可以设置此字段或PropagationPolicy,但不能同时设置两者。Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.
    String propagationPolicy = "propagationPolicy_example"; // String | 是否以及如何执行垃圾收集。可以设置此字段或孤立从属项,但不能同时设置两者。默认策略由元数据中设置的现有终结器决定。终结器和特定于资源的默认策略。Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy.
    String dryRun = "dryRun_example"; // String | 如果存在,则表示不应保留修改。无效或无法识别的dryRun指令将导致错误响应,并且不会进一步处理请求。有效值为:-全部:将处理所有干运行阶段。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
    V1DeleteOptions body = new V1DeleteOptions(); // V1DeleteOptions | 
    try {
      Object result = apiInstance.deleteNamespacedCustomObject(group, version, namespace, plural, name, gracePeriodSeconds, orphanDependents, propagationPolicy, dryRun, body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CustomObjectsApi#deleteNamespacedCustomObject");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

NameTypeDescriptionNotes
groupStringthe custom resource's group
versionStringthe custom resource's version
namespaceStringThe custom resource's namespace
pluralString自定义资源的复数名。对于TPR,这将是小写复数形式。
nameStringthe custom object's name
gracePeriodSecondsInteger删除对象前的持续时间(秒)。值必须是非负整数。值为零表示立即删除。如果此值为nil,则将使用指定类型的默认宽限期。如果未指定,则默认为每对象值。零表示立即删除。The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.[optional]
orphanDependentsBoolean已弃用:请使用PropagationPolicy,此字段将在1.7中弃用。从属对象应该是孤立的吗。如果为真/假,“孤立”终结器将被添加到对象的终结器列表中或从中删除。可以设置此字段或PropagationPolicy,但不能同时设置两者。已弃用:请使用PropagationPolicy,此字段将在1.7中弃用。从属对象应该是孤立的吗。如果为真/假,“孤立”终结器将被添加到对象的终结器列表中或从中删除。可以设置此字段或PropagationPolicy,但不能同时设置两者。Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the "orphan" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.[optional]
propagationPolicyString是否以及如何执行垃圾收集。可以设置此字段或孤立从属项,但不能同时设置两者。默认策略由元数据中设置的现有终结器决定。终结器和特定于资源的默认策略。Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy.[optional]
dryRunString如果存在,则表示不应保留修改。无效或无法识别的dryRun指令将导致错误响应,并且不会进一步处理请求。有效值为:-全部:将处理所有干运行阶段。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[optional]
bodyV1DeleteOptions[optional]

Return type

Object

Authorization

BearerToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200OK-
401Unauthorized-

getClusterCustomObject


回到CustomObjectsApi目录

Returns a cluster scoped custom object

Example

// Import classes:
import io.kubernetes.client.openapi.ApiClient;
import io.kubernetes.client.openapi.ApiException;
import io.kubernetes.client.openapi.Configuration;
import io.kubernetes.client.openapi.auth.*;
import io.kubernetes.client.openapi.models.*;
import io.kubernetes.client.openapi.apis.CustomObjectsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://localhost");
    
    // Configure API key authorization: BearerToken
    ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken");
    BearerToken.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //BearerToken.setApiKeyPrefix("Token");

    CustomObjectsApi apiInstance = new CustomObjectsApi(defaultClient);
    String group = "group_example"; // String | the custom resource's group
    String version = "version_example"; // String | the custom resource's version
    String plural = "plural_example"; // String | 自定义对象的复数名称。对于TPR,这将是小写复数形式。the custom object's plural name. For TPRs this would be lowercase plural kind..
    String name = "name_example"; // String | the custom object's name
    try {
      Object result = apiInstance.getClusterCustomObject(group, version, plural, name);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CustomObjectsApi#getClusterCustomObject");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

NameTypeDescriptionNotes
groupStringthe custom resource's group
versionStringthe custom resource's version
pluralStringthe custom object's plural name. For TPRs this would be lowercase plural kind.
nameStringthe custom object's name

Return type

Object

Authorization

BearerToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200A single Resource-
401Unauthorized-

getClusterCustomObjectScale


回到CustomObjectsApi目录

read scale of the specified custom object

Example

// Import classes:
import io.kubernetes.client.openapi.ApiClient;
import io.kubernetes.client.openapi.ApiException;
import io.kubernetes.client.openapi.Configuration;
import io.kubernetes.client.openapi.auth.*;
import io.kubernetes.client.openapi.models.*;
import io.kubernetes.client.openapi.apis.CustomObjectsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://localhost");
    
    // Configure API key authorization: BearerToken
    ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken");
    BearerToken.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //BearerToken.setApiKeyPrefix("Token");

    CustomObjectsApi apiInstance = new CustomObjectsApi(defaultClient);
    String group = "group_example"; // String | the custom resource's group
    String version = "version_example"; // String | the custom resource's version
    String plural = "plural_example"; // String | 自定义资源的复数名。对于TPR,这将是小写复数形式。the custom resource's plural name. For TPRs this would be lowercase plural kind.
    String name = "name_example"; // String | the custom object's name
    try {
      Object result = apiInstance.getClusterCustomObjectScale(group, version, plural, name);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CustomObjectsApi#getClusterCustomObjectScale");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

NameTypeDescriptionNotes
groupStringthe custom resource's group
versionStringthe custom resource's version
pluralString自定义资源的复数名。对于TPR,这将是小写复数形式。
nameStringthe custom object's name

Return type

Object

Authorization

BearerToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/yaml, application/vnd.kubernetes.protobuf

HTTP response details

Status codeDescriptionResponse headers
200OK-
401Unauthorized-

getClusterCustomObjectStatus


回到CustomObjectsApi目录

read status of the specified cluster scoped custom object

Example

// Import classes:
import io.kubernetes.client.openapi.ApiClient;
import io.kubernetes.client.openapi.ApiException;
import io.kubernetes.client.openapi.Configuration;
import io.kubernetes.client.openapi.auth.*;
import io.kubernetes.client.openapi.models.*;
import io.kubernetes.client.openapi.apis.CustomObjectsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://localhost");
    
    // Configure API key authorization: BearerToken
    ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken");
    BearerToken.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //BearerToken.setApiKeyPrefix("Token");

    CustomObjectsApi apiInstance = new CustomObjectsApi(defaultClient);
    String group = "group_example"; // String | the custom resource's group
    String version = "version_example"; // String | the custom resource's version
    String plural = "plural_example"; // String | 自定义资源的复数名。对于TPR,这将是小写复数形式。the custom resource's plural name. For TPRs this would be lowercase plural kind.
    String name = "name_example"; // String | the custom object's name
    try {
      Object result = apiInstance.getClusterCustomObjectStatus(group, version, plural, name);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CustomObjectsApi#getClusterCustomObjectStatus");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

NameTypeDescriptionNotes
groupStringthe custom resource's group
versionStringthe custom resource's version
pluralString自定义资源的复数名。对于TPR,这将是小写复数形式。
nameStringthe custom object's name

Return type

Object

Authorization

BearerToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/yaml, application/vnd.kubernetes.protobuf

HTTP response details

Status codeDescriptionResponse headers
200OK-
401Unauthorized-

getNamespacedCustomObject


回到CustomObjectsApi目录

Returns a namespace scoped custom object

Example

// Import classes:
import io.kubernetes.client.openapi.ApiClient;
import io.kubernetes.client.openapi.ApiException;
import io.kubernetes.client.openapi.Configuration;
import io.kubernetes.client.openapi.auth.*;
import io.kubernetes.client.openapi.models.*;
import io.kubernetes.client.openapi.apis.CustomObjectsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://localhost");
    
    // Configure API key authorization: BearerToken
    ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken");
    BearerToken.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //BearerToken.setApiKeyPrefix("Token");

    CustomObjectsApi apiInstance = new CustomObjectsApi(defaultClient);
    String group = "group_example"; // String | the custom resource's group
    String version = "version_example"; // String | the custom resource's version
    String namespace = "namespace_example"; // String | The custom resource's namespace
    String plural = "plural_example"; // String | 自定义资源的复数名。对于TPR,这将是小写复数形式。the custom resource's plural name. For TPRs this would be lowercase plural kind.
    String name = "name_example"; // String | the custom object's name
    try {
      Object result = apiInstance.getNamespacedCustomObject(group, version, namespace, plural, name);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CustomObjectsApi#getNamespacedCustomObject");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

NameTypeDescriptionNotes
groupStringthe custom resource's group
versionStringthe custom resource's version
namespaceStringThe custom resource's namespace
pluralString自定义资源的复数名。对于TPR,这将是小写复数形式。
nameStringthe custom object's name

Return type

Object

Authorization

BearerToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200A single Resource-
401Unauthorized-

getNamespacedCustomObjectScale


回到CustomObjectsApi目录

read scale of the specified namespace scoped custom object

Example

// Import classes:
import io.kubernetes.client.openapi.ApiClient;
import io.kubernetes.client.openapi.ApiException;
import io.kubernetes.client.openapi.Configuration;
import io.kubernetes.client.openapi.auth.*;
import io.kubernetes.client.openapi.models.*;
import io.kubernetes.client.openapi.apis.CustomObjectsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://localhost");
    
    // Configure API key authorization: BearerToken
    ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken");
    BearerToken.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //BearerToken.setApiKeyPrefix("Token");

    CustomObjectsApi apiInstance = new CustomObjectsApi(defaultClient);
    String group = "group_example"; // String | the custom resource's group
    String version = "version_example"; // String | the custom resource's version
    String namespace = "namespace_example"; // String | The custom resource's namespace
    String plural = "plural_example"; // String | 自定义资源的复数名。对于TPR,这将是小写复数形式。the custom resource's plural name. For TPRs this would be lowercase plural kind.
    String name = "name_example"; // String | the custom object's name
    try {
      Object result = apiInstance.getNamespacedCustomObjectScale(group, version, namespace, plural, name);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CustomObjectsApi#getNamespacedCustomObjectScale");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

NameTypeDescriptionNotes
groupStringthe custom resource's group
versionStringthe custom resource's version
namespaceStringThe custom resource's namespace
pluralString自定义资源的复数名。对于TPR,这将是小写复数形式。
nameStringthe custom object's name

Return type

Object

Authorization

BearerToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/yaml, application/vnd.kubernetes.protobuf

HTTP response details

Status codeDescriptionResponse headers
200OK-
401Unauthorized-

getNamespacedCustomObjectStatus


回到CustomObjectsApi目录

read status of the specified namespace scoped custom object

Example

// Import classes:
import io.kubernetes.client.openapi.ApiClient;
import io.kubernetes.client.openapi.ApiException;
import io.kubernetes.client.openapi.Configuration;
import io.kubernetes.client.openapi.auth.*;
import io.kubernetes.client.openapi.models.*;
import io.kubernetes.client.openapi.apis.CustomObjectsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://localhost");
    
    // Configure API key authorization: BearerToken
    ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken");
    BearerToken.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //BearerToken.setApiKeyPrefix("Token");

    CustomObjectsApi apiInstance = new CustomObjectsApi(defaultClient);
    String group = "group_example"; // String | the custom resource's group
    String version = "version_example"; // String | the custom resource's version
    String namespace = "namespace_example"; // String | The custom resource's namespace
    String plural = "plural_example"; // String | 自定义资源的复数名。对于TPR,这将是小写复数形式。the custom resource's plural name. For TPRs this would be lowercase plural kind.
    String name = "name_example"; // String | the custom object's name
    try {
      Object result = apiInstance.getNamespacedCustomObjectStatus(group, version, namespace, plural, name);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CustomObjectsApi#getNamespacedCustomObjectStatus");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

NameTypeDescriptionNotes
groupStringthe custom resource's group
versionStringthe custom resource's version
namespaceStringThe custom resource's namespace
pluralString自定义资源的复数名。对于TPR,这将是小写复数形式。
nameStringthe custom object's name

Return type

Object

Authorization

BearerToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/yaml, application/vnd.kubernetes.protobuf

HTTP response details

Status codeDescriptionResponse headers
200OK-
401Unauthorized-

listClusterCustomObject


回到CustomObjectsApi目录

list or watch cluster scoped custom objects

Example

// Import classes:
import io.kubernetes.client.openapi.ApiClient;
import io.kubernetes.client.openapi.ApiException;
import io.kubernetes.client.openapi.Configuration;
import io.kubernetes.client.openapi.auth.*;
import io.kubernetes.client.openapi.models.*;
import io.kubernetes.client.openapi.apis.CustomObjectsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://localhost");
    
    // Configure API key authorization: BearerToken
    ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken");
    BearerToken.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //BearerToken.setApiKeyPrefix("Token");

    CustomObjectsApi apiInstance = new CustomObjectsApi(defaultClient);
    String group = "group_example"; // String | The custom resource's group name
    String version = "version_example"; // String | The custom resource's version
    String plural = "plural_example"; // String | 自定义资源的复数名。对于TPR,这将是小写复数形式。The custom resource's plural name. For TPRs this would be lowercase plural kind.
    String pretty = "pretty_example"; // String | 如果为“true”,则输出相当打印。If 'true', then the output is pretty printed.
    String _continue = "_continue_example"; // String | 从服务器检索更多结果时,应设置“继续”选项。由于此值是服务器定义的,因此客户端只能使用具有相同查询参数(continue值除外)的上一个查询结果中的continue值,服务器可能会拒绝它无法识别的continue值。如果指定的continue值因过期(通常为5到15分钟)或服务器上的配置更改而不再有效,服务器将响应410 ResourceExpired错误和continue令牌。如果客户端需要一个一致的列表,它必须在不使用continue字段的情况下重新启动它们的列表。从另一台服务器发送的结果可能与前一台服务器发送的结果不一致,但从下一台服务器发送的结果可能与前一台服务器发送的结果不一致,只要他们的钥匙在“下一个钥匙”之后。watch为true时不支持此字段。客户端可以从服务器返回的最后一个resourceVersion值开始监视,并且不会错过任何修改。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.(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.
    String fieldSelector = "fieldSelector_example"; // String | 一个选择器,用于按字段限制返回对象的列表。默认为一切。A selector to restrict the list of returned objects by their fields. Defaults to everything.
    String labelSelector = "labelSelector_example"; // String | 一个选择器,用于根据返回对象的标签限制其列表。默认为一切。A selector to restrict the list of returned objects by their labels. Defaults to everything.
    Integer limit = 56; // Integer | limit是列表调用返回的最大响应数。如果存在更多项,服务器会将列表元数据上的“continue”字段设置为一个值,该值可用于同一初始查询,以检索下一组结果。如果所有请求的对象都被过滤掉,设置限制可能会返回少于请求数量的项目(最多为零个项目),客户端应该只使用continue字段来确定是否有更多结果可用。服务器可能会选择不支持limit参数,并将返回所有可用的结果。如果指定了limit且continue字段为空,则客户端可能会认为没有更多结果可用。如果watch为true,则不支持此字段。服务器保证在使用continue时返回的对象将与无限制地发出单个列表调用相同——也就是说,在发出第一个请求后创建、修改或删除的对象不会包含在任何后续的continue请求中。这有时被称为一致性快照,可以确保使用limit接收非常大结果的较小数据块的客户端可以确保看到所有可能的对象。如果在分块列表期间更新对象,则返回在计算第一个列表结果时存在的对象版本。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.
    String resourceVersion = "resourceVersion_example"; // String | 当通过监视调用指定时,显示在资源的特定版本之后发生的更改。默认为历史开始时的更改。为列表指定时:-如果未设置,则根据仲裁读取标志从远程存储返回结果;-如果是0,那么我们只返回当前缓存中的内容,不保证;-如果设置为非零,则结果至少与给定值一样新鲜When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.
    Integer timeoutSeconds = 56; // Integer | 列表/监视呼叫超时。这会限制通话的持续时间,而不管通话是否处于活动状态。列表/监视呼叫超时。这会限制通话的持续时间,而不管通话是否处于活动状态。Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.
    Boolean watch = true; // Boolean | 观察对所描述资源的更改,并将其作为添加、更新和删除通知流返回。Watch for changes to the described resources and return them as a stream of add, update, and remove notifications.
    try {
      Object result = apiInstance.listClusterCustomObject(group, version, plural, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CustomObjectsApi#listClusterCustomObject");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

NameTypeDescriptionNotes
groupStringThe custom resource's group name
versionStringThe custom resource's version
pluralString自定义资源的复数名。对于TPR,这将是小写复数形式。
prettyString如果为“true”,则输出相当打印。If 'true', then the output is pretty printed.[optional]
_continueString从服务器检索更多结果时,应设置“继续”选项。由于此值是服务器定义的,因此客户端只能使用具有相同查询参数(continue值除外)的上一个查询结果中的continue值,服务器可能会拒绝它无法识别的continue值。如果指定的continue值因过期(通常为5到15分钟)或服务器上的配置更改而不再有效,服务器将响应410 ResourceExpired错误和continue令牌。如果客户端需要一个一致的列表,它必须在不使用continue字段的情况下重新启动它们的列表。从另一台服务器发送的结果可能与前一台服务器发送的结果不一致,但从下一台服务器发送的结果可能与前一台服务器发送的结果不一致,只要他们的钥匙在“下一个钥匙”之后。watch为true时不支持此字段。客户端可以从服务器返回的最后一个resourceVersion值开始监视,并且不会错过任何修改。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.(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.[optional]
fieldSelectorString一个选择器,用于按字段限制返回对象的列表。默认为一切。A selector to restrict the list of returned objects by their fields. Defaults to everything.[optional]
labelSelectorString一个选择器,用于根据返回对象的标签限制其列表。默认为一切。A selector to restrict the list of returned objects by their labels. Defaults to everything.[optional]
limitIntegerlimit是列表调用返回的最大响应数。如果存在更多项目,服务器将设置`继续`字段的值,该值可用于同一初始查询以检索下一组结果。如果所有请求的对象都被过滤掉,设置限制可能会返回少于请求数量的项目(最多为零个项目),客户端应该只使用continue字段来确定是否有更多结果可用。服务器可能会选择不支持limit参数,并将返回所有可用的结果。如果指定了limit且continue字段为空,则客户端可能会认为没有更多结果可用。如果watch为true,则不支持此字段。服务器保证在使用continue时返回的对象将与无限制地发出单个列表调用相同——也就是说,在发出第一个请求后创建、修改或删除的对象不会包含在任何后续的continue请求中。这有时被称为一致性快照,可以确保使用limit接收非常大结果的较小数据块的客户端可以确保看到所有可能的对象。如果在分块列表期间更新对象,则返回在计算第一个列表结果时存在的对象版本。 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.[optional]
resourceVersionString当通过监视调用指定时,显示在资源的特定版本之后发生的更改。默认为历史开始时的更改。为列表指定时:-如果未设置,则根据仲裁读取标志从远程存储返回结果;-如果是's 0,然后我们只返回当前缓存中的内容,不保证;-如果设置为非零,则结果至少与给定值一样新鲜。When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.[optional]
timeoutSecondsInteger列表/监视呼叫超时。这会限制通话的持续时间,而不管通话是否处于活动状态。列表/监视呼叫超时。这会限制通话的持续时间,而不管通话是否处于活动状态。Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.[optional]
watchBoolean观察对所描述资源的更改,并将其作为添加、更新和删除通知流返回。Watch for changes to the described resources and return them as a stream of add, update, and remove notifications.[optional]

Return type

Object

Authorization

BearerToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/json;stream=watch

HTTP response details

Status codeDescriptionResponse headers
200OK-
401Unauthorized-

listNamespacedCustomObject


回到CustomObjectsApi目录

list or watch namespace scoped custom objects

Example

// Import classes:
import io.kubernetes.client.openapi.ApiClient;
import io.kubernetes.client.openapi.ApiException;
import io.kubernetes.client.openapi.Configuration;
import io.kubernetes.client.openapi.auth.*;
import io.kubernetes.client.openapi.models.*;
import io.kubernetes.client.openapi.apis.CustomObjectsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://localhost");
    
    // Configure API key authorization: BearerToken
    ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken");
    BearerToken.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //BearerToken.setApiKeyPrefix("Token");

    CustomObjectsApi apiInstance = new CustomObjectsApi(defaultClient);
    String group = "group_example"; // String | The custom resource's group name
    String version = "version_example"; // String | The custom resource's version
    String namespace = "namespace_example"; // String | The custom resource's namespace
    String plural = "plural_example"; // String | 自定义资源的复数名。对于TPR,这将是小写复数形式。The custom resource's plural name. For TPRs this would be lowercase plural kind.
    String pretty = "pretty_example"; // String | 如果为“true”,则输出相当打印。If 'true', then the output is pretty printed.
    String _continue = "_continue_example"; // String | 从服务器检索更多结果时,应设置“继续”选项。由于此值是服务器定义的,因此客户端只能使用具有相同查询参数(continue值除外)的上一个查询结果中的continue值,服务器可能会拒绝它无法识别的continue值。如果指定的continue值因过期(通常为5到15分钟)或服务器上的配置更改而不再有效,服务器将响应410 ResourceExpired错误和continue令牌。如果客户端需要一个一致的列表,它必须在不使用continue字段的情况下重新启动它们的列表。从另一台服务器发送的结果可能与前一台服务器发送的结果不一致,但从下一台服务器发送的结果可能与前一台服务器发送的结果不一致,只要他们的钥匙在“下一个钥匙”之后。watch为true时不支持此字段。客户端可以从服务器返回的最后一个resourceVersion值开始监视,并且不会错过任何修改。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.(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.
    String fieldSelector = "fieldSelector_example"; // String | 一个选择器,用于按字段限制返回对象的列表。默认为一切。A selector to restrict the list of returned objects by their fields. Defaults to everything.
    String labelSelector = "labelSelector_example"; // String | 一个选择器,用于根据返回对象的标签限制其列表。默认为一切。A selector to restrict the list of returned objects by their labels. Defaults to everything.
    Integer limit = 56; // Integer | limit是列表调用返回的最大响应数。如果存在更多项,服务器会将列表元数据上的“continue”字段设置为一个值,该值可用于同一初始查询,以检索下一组结果。如果所有请求的对象都被过滤掉,设置限制可能会返回少于请求数量的项目(最多为零个项目),客户端应该只使用continue字段来确定是否有更多结果可用。服务器可能会选择不支持limit参数,并将返回所有可用的结果。如果指定了limit且continue字段为空,则客户端可能会认为没有更多结果可用。如果watch为true,则不支持此字段。服务器保证在使用continue时返回的对象将与无限制地发出单个列表调用相同——也就是说,在发出第一个请求后创建、修改或删除的对象不会包含在任何后续的continue请求中。这有时被称为一致性快照,可以确保使用limit接收非常大结果的较小数据块的客户端可以确保看到所有可能的对象。如果在分块列表期间更新对象,则返回在计算第一个列表结果时存在的对象版本。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.
    String resourceVersion = "resourceVersion_example"; // String | 当通过监视调用指定时,显示在资源的特定版本之后发生的更改。默认为历史开始时的更改。为列表指定时:-如果未设置,则根据仲裁读取标志从远程存储返回结果;-如果是0,那么我们只返回当前缓存中的内容,不保证;-如果设置为非零,则结果至少与给定值一样新鲜When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.
    Integer timeoutSeconds = 56; // Integer | 列表/监视呼叫超时。这会限制通话的持续时间,而不管通话是否处于活动状态。列表/监视呼叫超时。这会限制通话的持续时间,而不管通话是否处于活动状态。Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.
    Boolean watch = true; // Boolean | 观察对所描述资源的更改,并将其作为添加、更新和删除通知流返回。Watch for changes to the described resources and return them as a stream of add, update, and remove notifications.
    try {
      Object result = apiInstance.listNamespacedCustomObject(group, version, namespace, plural, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CustomObjectsApi#listNamespacedCustomObject");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

NameTypeDescriptionNotes
groupStringThe custom resource's group name
versionStringThe custom resource's version
namespaceStringThe custom resource's namespace
pluralString自定义资源的复数名。对于TPR,这将是小写复数形式。
prettyString如果为“true”,则输出相当打印。If 'true', then the output is pretty printed.[optional]
_continueString从服务器检索更多结果时,应设置“继续”选项。由于此值是服务器定义的,因此客户端只能使用具有相同查询参数(continue值除外)的上一个查询结果中的continue值,服务器可能会拒绝它无法识别的continue值。如果指定的continue值因过期(通常为5到15分钟)或服务器上的配置更改而不再有效,服务器将响应410 ResourceExpired错误和continue令牌。如果客户端需要一个一致的列表,它必须在不使用continue字段的情况下重新启动它们的列表。从另一台服务器发送的结果可能与前一台服务器发送的结果不一致,但从下一台服务器发送的结果可能与前一台服务器发送的结果不一致,只要他们的钥匙在“下一个钥匙”之后。watch为true时不支持此字段。客户端可以从服务器返回的最后一个resourceVersion值开始监视,并且不会错过任何修改。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.(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.[optional]
fieldSelectorString一个选择器,用于按字段限制返回对象的列表。默认为一切。A selector to restrict the list of returned objects by their fields. Defaults to everything.[optional]
labelSelectorString一个选择器,用于根据返回对象的标签限制其列表。默认为一切。A selector to restrict the list of returned objects by their labels. Defaults to everything.[optional]
limitIntegerlimit是列表调用返回的最大响应数。如果存在更多项目,服务器将设置`继续`字段的值,该值可用于同一初始查询以检索下一组结果。如果所有请求的对象都被过滤掉,设置限制可能会返回少于请求数量的项目(最多为零个项目),客户端应该只使用continue字段来确定是否有更多结果可用。服务器可能会选择不支持limit参数,并将返回所有可用的结果。如果指定了limit且continue字段为空,则客户端可能会认为没有更多结果可用。如果watch为true,则不支持此字段。服务器保证在使用continue时返回的对象将与无限制地发出单个列表调用相同——也就是说,在发出第一个请求后创建、修改或删除的对象不会包含在任何后续的continue请求中。这有时被称为一致性快照,可以确保使用limit接收非常大结果的较小数据块的客户端可以确保看到所有可能的对象。如果在分块列表期间更新对象,则返回在计算第一个列表结果时存在的对象版本。 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.[optional]
resourceVersionString当通过监视调用指定时,显示在资源的特定版本之后发生的更改。默认为历史开始时的更改。为列表指定时:-如果未设置,则根据仲裁读取标志从远程存储返回结果;-如果是's 0,然后我们只返回当前缓存中的内容,不保证;-如果设置为非零,则结果至少与给定值一样新鲜。When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.[optional]
timeoutSecondsInteger列表/监视呼叫超时。这会限制通话的持续时间,而不管通话是否处于活动状态。列表/监视呼叫超时。这会限制通话的持续时间,而不管通话是否处于活动状态。Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.[optional]
watchBoolean观察对所描述资源的更改,并将其作为添加、更新和删除通知流返回。Watch for changes to the described resources and return them as a stream of add, update, and remove notifications.[optional]

Return type

Object

Authorization

BearerToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/json;stream=watch

HTTP response details

Status codeDescriptionResponse headers
200OK-
401Unauthorized-

patchClusterCustomObject


回到CustomObjectsApi目录

patch the specified cluster scoped custom object

Example

// Import classes:
import io.kubernetes.client.openapi.ApiClient;
import io.kubernetes.client.openapi.ApiException;
import io.kubernetes.client.openapi.Configuration;
import io.kubernetes.client.openapi.auth.*;
import io.kubernetes.client.openapi.models.*;
import io.kubernetes.client.openapi.apis.CustomObjectsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://localhost");
    
    // Configure API key authorization: BearerToken
    ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken");
    BearerToken.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //BearerToken.setApiKeyPrefix("Token");

    CustomObjectsApi apiInstance = new CustomObjectsApi(defaultClient);
    String group = "group_example"; // String | the custom resource's group
    String version = "version_example"; // String | the custom resource's version
    String plural = "plural_example"; // String | 自定义资源的复数名。对于TPR,这将是小写复数形式。the custom object's plural name. For TPRs this would be lowercase plural kind.
    String name = "name_example"; // String | the custom object's name
    Object body = null; // Object | The JSON schema of the Resource to patch.
    String dryRun = "dryRun_example"; // String | 如果存在,则表示不应保留修改。无效或无法识别的dryRun指令将导致错误响应,并且不会进一步处理请求。有效值为:-全部:将处理所有干运行阶段。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
    String fieldManager = "fieldManager_example"; // String |  fieldManager是与进行这些更改的参与者或实体关联的名称。该值的长度必须小于或128个字符,并且仅包含可打印字符,如https://golang.org/pkg/unicode/#IsPrint.fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).
    Boolean force = true; // Boolean | Force将“强制”应用请求。这意味着用户将重新获取其他人拥有的冲突字段。对于非应用补丁请求,必须取消设置强制标志。Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.
    try {
      Object result = apiInstance.patchClusterCustomObject(group, version, plural, name, body, dryRun, fieldManager, force);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CustomObjectsApi#patchClusterCustomObject");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

NameTypeDescriptionNotes
groupStringthe custom resource's group
versionStringthe custom resource's version
pluralString自定义资源的复数名。对于TPR,这将是小写复数形式。
nameStringthe custom object's name
bodyObjectThe JSON schema of the Resource to patch.
dryRunString如果存在,则表示不应保留修改。无效或无法识别的dryRun指令将导致错误响应,并且不会进一步处理请求。有效值为:-全部:将处理所有干运行阶段。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[optional]
fieldManagerStringfieldManager是与进行这些更改的参与者或实体关联的名称。该值的长度必须小于或128个字符,并且仅包含可打印字符,如https://golang.org/pkg/unicode/#IsPrint.fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).[optional]
forceBooleanForce将“强制”应用请求。这意味着用户将重新获取其他人拥有的冲突字段。对于非应用补丁请求,必须取消设置强制标志。Force is going to "force" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.[optional]

Return type

Object

Authorization

BearerToken

HTTP request headers

  • Content-Type: application/json-patch+json, application/merge-patch+json
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200OK-
401Unauthorized-

patchClusterCustomObjectScale


回到CustomObjectsApi目录

partially update scale of the specified cluster scoped custom object

Example

// Import classes:
import io.kubernetes.client.openapi.ApiClient;
import io.kubernetes.client.openapi.ApiException;
import io.kubernetes.client.openapi.Configuration;
import io.kubernetes.client.openapi.auth.*;
import io.kubernetes.client.openapi.models.*;
import io.kubernetes.client.openapi.apis.CustomObjectsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://localhost");
    
    // Configure API key authorization: BearerToken
    ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken");
    BearerToken.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //BearerToken.setApiKeyPrefix("Token");

    CustomObjectsApi apiInstance = new CustomObjectsApi(defaultClient);
    String group = "group_example"; // String | the custom resource's group
    String version = "version_example"; // String | the custom resource's version
    String plural = "plural_example"; // String | 自定义资源的复数名。对于TPR,这将是小写复数形式。the custom resource's plural name. For TPRs this would be lowercase plural kind.
    String name = "name_example"; // String | the custom object's name
    Object body = null; // Object | 
    String dryRun = "dryRun_example"; // String | 如果存在,则表示不应保留修改。无效或无法识别的dryRun指令将导致错误响应,并且不会进一步处理请求。有效值为:-全部:将处理所有干运行阶段。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
    String fieldManager = "fieldManager_example"; // String |  fieldManager是与进行这些更改的参与者或实体关联的名称。该值的长度必须小于或128个字符,并且仅包含可打印字符,如https://golang.org/pkg/unicode/#IsPrint.fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).
    Boolean force = true; // Boolean | Force将“强制”应用请求。这意味着用户将重新获取其他人拥有的冲突字段。对于非应用补丁请求,必须取消设置强制标志。Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.
    try {
      Object result = apiInstance.patchClusterCustomObjectScale(group, version, plural, name, body, dryRun, fieldManager, force);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CustomObjectsApi#patchClusterCustomObjectScale");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

NameTypeDescriptionNotes
groupStringthe custom resource's group
versionStringthe custom resource's version
pluralString自定义资源的复数名。对于TPR,这将是小写复数形式。.
nameStringthe custom object's name
bodyObject
dryRunString如果存在,则表示不应保留修改。无效或无法识别的dryRun指令将导致错误响应,并且不会进一步处理请求。有效值为:-全部:将处理所有干运行阶段。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[optional]
fieldManagerStringfieldManager是与进行这些更改的参与者或实体关联的名称。该值的长度必须小于或128个字符,并且仅包含可打印字符,如https://golang.org/pkg/unicode/#IsPrint.fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).[optional]
forceBooleanForce将“强制”应用请求。这意味着用户将重新获取其他人拥有的冲突字段。对于非应用补丁请求,必须取消设置强制标志。Force is going to "force" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.[optional]

Return type

Object

Authorization

BearerToken

HTTP request headers

  • Content-Type: application/json-patch+json, application/merge-patch+json
  • Accept: application/json, application/yaml, application/vnd.kubernetes.protobuf

HTTP response details

Status codeDescriptionResponse headers
200OK-
401Unauthorized-

patchClusterCustomObjectStatus


回到CustomObjectsApi目录

partially update status of the specified cluster scoped custom object

Example

// Import classes:
import io.kubernetes.client.openapi.ApiClient;
import io.kubernetes.client.openapi.ApiException;
import io.kubernetes.client.openapi.Configuration;
import io.kubernetes.client.openapi.auth.*;
import io.kubernetes.client.openapi.models.*;
import io.kubernetes.client.openapi.apis.CustomObjectsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://localhost");
    
    // Configure API key authorization: BearerToken
    ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken");
    BearerToken.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //BearerToken.setApiKeyPrefix("Token");

    CustomObjectsApi apiInstance = new CustomObjectsApi(defaultClient);
    String group = "group_example"; // String | the custom resource's group
    String version = "version_example"; // String | the custom resource's version
    String plural = "plural_example"; // String | 自定义资源的复数名。对于TPR,这将是小写复数形式。the custom resource's plural name. For TPRs this would be lowercase plural kind.
    String name = "name_example"; // String | the custom object's name
    Object body = null; // Object | 
    String dryRun = "dryRun_example"; // String | 如果存在,则表示不应保留修改。无效或无法识别的dryRun指令将导致错误响应,并且不会进一步处理请求。有效值为:-全部:将处理所有干运行阶段。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
    String fieldManager = "fieldManager_example"; // String |  fieldManager是与进行这些更改的参与者或实体关联的名称。该值的长度必须小于或128个字符,并且仅包含可打印字符,如https://golang.org/pkg/unicode/#IsPrint.fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).
    Boolean force = true; // Boolean | Force将“强制”应用请求。这意味着用户将重新获取其他人拥有的冲突字段。对于非应用补丁请求,必须取消设置强制标志。Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.
    try {
      Object result = apiInstance.patchClusterCustomObjectStatus(group, version, plural, name, body, dryRun, fieldManager, force);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CustomObjectsApi#patchClusterCustomObjectStatus");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

NameTypeDescriptionNotes
groupStringthe custom resource's group
versionStringthe custom resource's version
pluralString自定义资源的复数名。对于TPR,这将是小写复数形式。
nameStringthe custom object's name
bodyObject
dryRunString如果存在,则表示不应保留修改。无效或无法识别的dryRun指令将导致错误响应,并且不会进一步处理请求。有效值为:-全部:将处理所有干运行阶段。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[optional]
fieldManagerStringfieldManager是与进行这些更改的参与者或实体关联的名称。该值的长度必须小于或128个字符,并且仅包含可打印字符,如https://golang.org/pkg/unicode/#IsPrint.fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).[optional]
forceBooleanForce将“强制”应用请求。这意味着用户将重新获取其他人拥有的冲突字段。对于非应用补丁请求,必须取消设置强制标志。Force is going to "force" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.[optional]

Return type

Object

Authorization

BearerToken

HTTP request headers

  • Content-Type: application/json-patch+json, application/merge-patch+json
  • Accept: application/json, application/yaml, application/vnd.kubernetes.protobuf

HTTP response details

Status codeDescriptionResponse headers
200OK-
401Unauthorized-

patchNamespacedCustomObject


回到CustomObjectsApi目录

patch the specified namespace scoped custom object

Example

// Import classes:
import io.kubernetes.client.openapi.ApiClient;
import io.kubernetes.client.openapi.ApiException;
import io.kubernetes.client.openapi.Configuration;
import io.kubernetes.client.openapi.auth.*;
import io.kubernetes.client.openapi.models.*;
import io.kubernetes.client.openapi.apis.CustomObjectsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://localhost");
    
    // Configure API key authorization: BearerToken
    ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken");
    BearerToken.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //BearerToken.setApiKeyPrefix("Token");

    CustomObjectsApi apiInstance = new CustomObjectsApi(defaultClient);
    String group = "group_example"; // String | the custom resource's group
    String version = "version_example"; // String | the custom resource's version
    String namespace = "namespace_example"; // String | The custom resource's namespace
    String plural = "plural_example"; // String | 自定义资源的复数名。对于TPR,这将是小写复数形式。the custom resource's plural name. For TPRs this would be lowercase plural kind.
    String name = "name_example"; // String | the custom object's name
    Object body = null; // Object | The JSON schema of the Resource to patch.
    String dryRun = "dryRun_example"; // String | 如果存在,则表示不应保留修改。无效或无法识别的dryRun指令将导致错误响应,并且不会进一步处理请求。有效值为:-全部:将处理所有干运行阶段。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
    String fieldManager = "fieldManager_example"; // String |  fieldManager是与进行这些更改的参与者或实体关联的名称。该值的长度必须小于或128个字符,并且仅包含可打印字符,如https://golang.org/pkg/unicode/#IsPrint.fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).
    Boolean force = true; // Boolean | Force将“强制”应用请求。这意味着用户将重新获取其他人拥有的冲突字段。对于非应用补丁请求,必须取消设置强制标志。Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.
    try {
      Object result = apiInstance.patchNamespacedCustomObject(group, version, namespace, plural, name, body, dryRun, fieldManager, force);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CustomObjectsApi#patchNamespacedCustomObject");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

NameTypeDescriptionNotes
groupStringthe custom resource's group
versionStringthe custom resource's version
namespaceStringThe custom resource's namespace
pluralString自定义资源的复数名。对于TPR,这将是小写复数形式。
nameStringthe custom object's name
bodyObjectThe JSON schema of the Resource to patch.
dryRunString如果存在,则表示不应保留修改。无效或无法识别的dryRun指令将导致错误响应,并且不会进一步处理请求。有效值为:-全部:将处理所有干运行阶段。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[optional]
fieldManagerStringfieldManager是与进行这些更改的参与者或实体关联的名称。该值的长度必须小于或128个字符,并且仅包含可打印字符,如https://golang.org/pkg/unicode/#IsPrint.fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).[optional]
forceBooleanForce将“强制”应用请求。这意味着用户将重新获取其他人拥有的冲突字段。对于非应用补丁请求,必须取消设置强制标志。Force is going to "force" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.[optional]

Return type

Object

Authorization

BearerToken

HTTP request headers

  • Content-Type: application/json-patch+json, application/merge-patch+json
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200OK-
401Unauthorized-

patchNamespacedCustomObjectScale


回到CustomObjectsApi目录

partially update scale of the specified namespace scoped custom object

Example

// Import classes:
import io.kubernetes.client.openapi.ApiClient;
import io.kubernetes.client.openapi.ApiException;
import io.kubernetes.client.openapi.Configuration;
import io.kubernetes.client.openapi.auth.*;
import io.kubernetes.client.openapi.models.*;
import io.kubernetes.client.openapi.apis.CustomObjectsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://localhost");
    
    // Configure API key authorization: BearerToken
    ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken");
    BearerToken.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //BearerToken.setApiKeyPrefix("Token");

    CustomObjectsApi apiInstance = new CustomObjectsApi(defaultClient);
    String group = "group_example"; // String | the custom resource's group
    String version = "version_example"; // String | the custom resource's version
    String namespace = "namespace_example"; // String | The custom resource's namespace
    String plural = "plural_example"; // String | 自定义资源的复数名。对于TPR,这将是小写复数形式。the custom resource's plural name. For TPRs this would be lowercase plural kind.
    String name = "name_example"; // String | the custom object's name
    Object body = null; // Object | 
    String dryRun = "dryRun_example"; // String | 如果存在,则表示不应保留修改。无效或无法识别的dryRun指令将导致错误响应,并且不会进一步处理请求。有效值为:-全部:将处理所有干运行阶段。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
    String fieldManager = "fieldManager_example"; // String |  fieldManager是与进行这些更改的参与者或实体关联的名称。该值的长度必须小于或128个字符,并且仅包含可打印字符,如https://golang.org/pkg/unicode/#IsPrint.fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).
    Boolean force = true; // Boolean | Force将“强制”应用请求。这意味着用户将重新获取其他人拥有的冲突字段。对于非应用补丁请求,必须取消设置强制标志。Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.
    try {
      Object result = apiInstance.patchNamespacedCustomObjectScale(group, version, namespace, plural, name, body, dryRun, fieldManager, force);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CustomObjectsApi#patchNamespacedCustomObjectScale");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

NameTypeDescriptionNotes
groupStringthe custom resource's group
versionStringthe custom resource's version
namespaceStringThe custom resource's namespace
pluralString自定义资源的复数名。对于TPR,这将是小写复数形式。
nameStringthe custom object's name
bodyObject
dryRunString如果存在,则表示不应保留修改。无效或无法识别的dryRun指令将导致错误响应,并且不会进一步处理请求。有效值为:-全部:将处理所有干运行阶段。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[optional]
fieldManagerStringfieldManager是与进行这些更改的参与者或实体关联的名称。该值的长度必须小于或128个字符,并且仅包含可打印字符,如https://golang.org/pkg/unicode/#IsPrint.fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).[optional]
forceBooleanForce将“强制”应用请求。这意味着用户将重新获取其他人拥有的冲突字段。对于非应用补丁请求,必须取消设置强制标志。Force is going to "force" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.[optional]

Return type

Object

Authorization

BearerToken

HTTP request headers

  • Content-Type: application/json-patch+json, application/merge-patch+json, application/apply-patch+yaml
  • Accept: application/json, application/yaml, application/vnd.kubernetes.protobuf

HTTP response details

Status codeDescriptionResponse headers
200OK-
401Unauthorized-

patchNamespacedCustomObjectStatus


回到CustomObjectsApi目录

partially update status of the specified namespace scoped custom object

Example

// Import classes:
import io.kubernetes.client.openapi.ApiClient;
import io.kubernetes.client.openapi.ApiException;
import io.kubernetes.client.openapi.Configuration;
import io.kubernetes.client.openapi.auth.*;
import io.kubernetes.client.openapi.models.*;
import io.kubernetes.client.openapi.apis.CustomObjectsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://localhost");
    
    // Configure API key authorization: BearerToken
    ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken");
    BearerToken.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //BearerToken.setApiKeyPrefix("Token");

    CustomObjectsApi apiInstance = new CustomObjectsApi(defaultClient);
    String group = "group_example"; // String | the custom resource's group
    String version = "version_example"; // String | the custom resource's version
    String namespace = "namespace_example"; // String | The custom resource's namespace
    String plural = "plural_example"; // String | 自定义资源的复数名。对于TPR,这将是小写复数形式。the custom resource's plural name. For TPRs this would be lowercase plural kind.
    String name = "name_example"; // String | the custom object's name
    Object body = null; // Object | 
    String dryRun = "dryRun_example"; // String | 如果存在,则表示不应保留修改。无效或无法识别的dryRun指令将导致错误响应,并且不会进一步处理请求。有效值为:-全部:将处理所有干运行阶段。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
    String fieldManager = "fieldManager_example"; // String |  fieldManager是与进行这些更改的参与者或实体关联的名称。该值的长度必须小于或128个字符,并且仅包含可打印字符,如https://golang.org/pkg/unicode/#IsPrint.fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).
    Boolean force = true; // Boolean | Force将“强制”应用请求。这意味着用户将重新获取其他人拥有的冲突字段。对于非应用补丁请求,必须取消设置强制标志。Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.
    try {
      Object result = apiInstance.patchNamespacedCustomObjectStatus(group, version, namespace, plural, name, body, dryRun, fieldManager, force);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CustomObjectsApi#patchNamespacedCustomObjectStatus");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

NameTypeDescriptionNotes
groupStringthe custom resource's group
versionStringthe custom resource's version
namespaceStringThe custom resource's namespace
pluralString自定义资源的复数名。对于TPR,这将是小写复数形式。
nameStringthe custom object's name
bodyObject
dryRunString如果存在,则表示不应保留修改。无效或无法识别的dryRun指令将导致错误响应,并且不会进一步处理请求。有效值为:-全部:将处理所有干运行阶段。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[optional]
fieldManagerStringfieldManager是与进行这些更改的参与者或实体关联的名称。该值的长度必须小于或128个字符,并且仅包含可打印字符,如https://golang.org/pkg/unicode/#IsPrint.fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).[optional]
forceBooleanForce将“强制”应用请求。这意味着用户将重新获取其他人拥有的冲突字段。对于非应用补丁请求,必须取消设置强制标志。Force is going to "force" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.[optional]

Return type

Object

Authorization

BearerToken

HTTP request headers

  • Content-Type: application/json-patch+json, application/merge-patch+json, application/apply-patch+yaml
  • Accept: application/json, application/yaml, application/vnd.kubernetes.protobuf

HTTP response details

Status codeDescriptionResponse headers
200OK-
401Unauthorized-

replaceClusterCustomObject


回到CustomObjectsApi目录

replace the specified cluster scoped custom object

Example

// Import classes:
import io.kubernetes.client.openapi.ApiClient;
import io.kubernetes.client.openapi.ApiException;
import io.kubernetes.client.openapi.Configuration;
import io.kubernetes.client.openapi.auth.*;
import io.kubernetes.client.openapi.models.*;
import io.kubernetes.client.openapi.apis.CustomObjectsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://localhost");
    
    // Configure API key authorization: BearerToken
    ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken");
    BearerToken.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //BearerToken.setApiKeyPrefix("Token");

    CustomObjectsApi apiInstance = new CustomObjectsApi(defaultClient);
    String group = "group_example"; // String | the custom resource's group
    String version = "version_example"; // String | the custom resource's version
    String plural = "plural_example"; // String | 自定义资源的复数名。对于TPR,这将是小写复数形式。the custom object's plural name. For TPRs this would be lowercase plural kind.
    String name = "name_example"; // String | the custom object's name
    Object body = null; // Object | The JSON schema of the Resource to replace.
    String dryRun = "dryRun_example"; // String | 如果存在,则表示不应保留修改。无效或无法识别的dryRun指令将导致错误响应,并且不会进一步处理请求。有效值为:-全部:将处理所有干运行阶段。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
    String fieldManager = "fieldManager_example"; // String |  fieldManager是与进行这些更改的参与者或实体关联的名称。该值的长度必须小于或128个字符,并且仅包含可打印字符,如https://golang.org/pkg/unicode/#IsPrint.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.
    try {
      Object result = apiInstance.replaceClusterCustomObject(group, version, plural, name, body, dryRun, fieldManager);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CustomObjectsApi#replaceClusterCustomObject");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

NameTypeDescriptionNotes
groupStringthe custom resource's group
versionStringthe custom resource's version
pluralStringthe custom object's plural name. For TPRs this would be lowercase plural kind.
nameStringthe custom object's name
bodyObjectThe JSON schema of the Resource to replace.
dryRunString如果存在,则表示不应保留修改。无效或无法识别的dryRun指令将导致错误响应,并且不会进一步处理请求。有效值为:-全部:将处理所有干运行阶段。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[optional]
fieldManagerStringfieldManager是与进行这些更改的参与者或实体关联的名称。该值的长度必须小于或128个字符,并且仅包含可打印字符,如https://golang.org/pkg/unicode/#IsPrint.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.[optional]

Return type

Object

Authorization

BearerToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200OK-
401Unauthorized-

replaceClusterCustomObjectScale


回到CustomObjectsApi目录

replace scale of the specified cluster scoped custom object

Example

// Import classes:
import io.kubernetes.client.openapi.ApiClient;
import io.kubernetes.client.openapi.ApiException;
import io.kubernetes.client.openapi.Configuration;
import io.kubernetes.client.openapi.auth.*;
import io.kubernetes.client.openapi.models.*;
import io.kubernetes.client.openapi.apis.CustomObjectsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://localhost");
    
    // Configure API key authorization: BearerToken
    ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken");
    BearerToken.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //BearerToken.setApiKeyPrefix("Token");

    CustomObjectsApi apiInstance = new CustomObjectsApi(defaultClient);
    String group = "group_example"; // String | the custom resource's group
    String version = "version_example"; // String | the custom resource's version
    String plural = "plural_example"; // String | 自定义资源的复数名。对于TPR,这将是小写复数形式。the custom resource's plural name. For TPRs this would be lowercase plural kind.
    String name = "name_example"; // String | the custom object's name
    Object body = null; // Object | 
    String dryRun = "dryRun_example"; // String | 如果存在,则表示不应保留修改。无效或无法识别的dryRun指令将导致错误响应,并且不会进一步处理请求。有效值为:-全部:将处理所有干运行阶段。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
    String fieldManager = "fieldManager_example"; // String |  fieldManager是与进行这些更改的参与者或实体关联的名称。该值的长度必须小于或128个字符,并且仅包含可打印字符,如https://golang.org/pkg/unicode/#IsPrint.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.
    try {
      Object result = apiInstance.replaceClusterCustomObjectScale(group, version, plural, name, body, dryRun, fieldManager);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CustomObjectsApi#replaceClusterCustomObjectScale");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

NameTypeDescriptionNotes
groupStringthe custom resource's group
versionStringthe custom resource's version
pluralString自定义资源的复数名。对于TPR,这将是小写复数形式。
nameStringthe custom object's name
bodyObject
dryRunString如果存在,则表示不应保留修改。无效或无法识别的dryRun指令将导致错误响应,并且不会进一步处理请求。有效值为:-全部:将处理所有干运行阶段。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[optional]
fieldManagerStringfieldManager是与进行这些更改的参与者或实体关联的名称。该值的长度必须小于或128个字符,并且仅包含可打印字符,如https://golang.org/pkg/unicode/#IsPrint.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.[optional]

Return type

Object

Authorization

BearerToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/yaml, application/vnd.kubernetes.protobuf

HTTP response details

Status codeDescriptionResponse headers
200OK-
201Created-
401Unauthorized-

replaceClusterCustomObjectStatus


回到CustomObjectsApi目录

replace status of the cluster scoped specified custom object

Example

// Import classes:
import io.kubernetes.client.openapi.ApiClient;
import io.kubernetes.client.openapi.ApiException;
import io.kubernetes.client.openapi.Configuration;
import io.kubernetes.client.openapi.auth.*;
import io.kubernetes.client.openapi.models.*;
import io.kubernetes.client.openapi.apis.CustomObjectsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://localhost");
    
    // Configure API key authorization: BearerToken
    ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken");
    BearerToken.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //BearerToken.setApiKeyPrefix("Token");

    CustomObjectsApi apiInstance = new CustomObjectsApi(defaultClient);
    String group = "group_example"; // String | the custom resource's group
    String version = "version_example"; // String | the custom resource's version
    String plural = "plural_example"; // String | 自定义资源的复数名。对于TPR,这将是小写复数形式。the custom resource's plural name. For TPRs this would be lowercase plural kind.
    String name = "name_example"; // String | the custom object's name
    Object body = null; // Object | 
    String dryRun = "dryRun_example"; // String | 如果存在,则表示不应保留修改。无效或无法识别的dryRun指令将导致错误响应,并且不会进一步处理请求。有效值为:-全部:将处理所有干运行阶段。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
    String fieldManager = "fieldManager_example"; // String |  fieldManager是与进行这些更改的参与者或实体关联的名称。该值的长度必须小于或128个字符,并且仅包含可打印字符,如https://golang.org/pkg/unicode/#IsPrint.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.
    try {
      Object result = apiInstance.replaceClusterCustomObjectStatus(group, version, plural, name, body, dryRun, fieldManager);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CustomObjectsApi#replaceClusterCustomObjectStatus");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

NameTypeDescriptionNotes
groupStringthe custom resource's group
versionStringthe custom resource's version
pluralString自定义资源的复数名。对于TPR,这将是小写复数形式。
nameStringthe custom object's name
bodyObject
dryRunString如果存在,则表示不应保留修改。无效或无法识别的dryRun指令将导致错误响应,并且不会进一步处理请求。有效值为:-全部:将处理所有干运行阶段。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[optional]
fieldManagerStringfieldManager是与进行这些更改的参与者或实体关联的名称。该值的长度必须小于或128个字符,并且仅包含可打印字符,如https://golang.org/pkg/unicode/#IsPrint.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.[optional]

Return type

Object

Authorization

BearerToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/yaml, application/vnd.kubernetes.protobuf

HTTP response details

Status codeDescriptionResponse headers
200OK-
201Created-
401Unauthorized-

replaceNamespacedCustomObject


回到CustomObjectsApi目录

replace the specified namespace scoped custom object

Example

// Import classes:
import io.kubernetes.client.openapi.ApiClient;
import io.kubernetes.client.openapi.ApiException;
import io.kubernetes.client.openapi.Configuration;
import io.kubernetes.client.openapi.auth.*;
import io.kubernetes.client.openapi.models.*;
import io.kubernetes.client.openapi.apis.CustomObjectsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://localhost");
    
    // Configure API key authorization: BearerToken
    ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken");
    BearerToken.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //BearerToken.setApiKeyPrefix("Token");

    CustomObjectsApi apiInstance = new CustomObjectsApi(defaultClient);
    String group = "group_example"; // String | the custom resource's group
    String version = "version_example"; // String | the custom resource's version
    String namespace = "namespace_example"; // String | The custom resource's namespace
    String plural = "plural_example"; // String | 自定义资源的复数名。对于TPR,这将是小写复数形式。the custom resource's plural name. For TPRs this would be lowercase plural kind.
    String name = "name_example"; // String | the custom object's name
    Object body = null; // Object | The JSON schema of the Resource to replace.
    String dryRun = "dryRun_example"; // String | 如果存在,则表示不应保留修改。无效或无法识别的dryRun指令将导致错误响应,并且不会进一步处理请求。有效值为:-全部:将处理所有干运行阶段。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
    String fieldManager = "fieldManager_example"; // String |  fieldManager是与进行这些更改的参与者或实体关联的名称。该值的长度必须小于或128个字符,并且仅包含可打印字符,如https://golang.org/pkg/unicode/#IsPrint.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.
    try {
      Object result = apiInstance.replaceNamespacedCustomObject(group, version, namespace, plural, name, body, dryRun, fieldManager);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CustomObjectsApi#replaceNamespacedCustomObject");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

NameTypeDescriptionNotes
groupStringthe custom resource's group
versionStringthe custom resource's version
namespaceStringThe custom resource's namespace
pluralString自定义资源的复数名。对于TPR,这将是小写复数形式。
nameStringthe custom object's name
bodyObjectThe JSON schema of the Resource to replace.
dryRunString如果存在,则表示不应保留修改。无效或无法识别的dryRun指令将导致错误响应,并且不会进一步处理请求。有效值为:-全部:将处理所有干运行阶段。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[optional]
fieldManagerStringfieldManager是与进行这些更改的参与者或实体关联的名称。该值的长度必须小于或128个字符,并且仅包含可打印字符,如https://golang.org/pkg/unicode/#IsPrint.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.[optional]

Return type

Object

Authorization

BearerToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200OK-
401Unauthorized-

replaceNamespacedCustomObjectScale


回到CustomObjectsApi目录

replace scale of the specified namespace scoped custom object

Example

// Import classes:
import io.kubernetes.client.openapi.ApiClient;
import io.kubernetes.client.openapi.ApiException;
import io.kubernetes.client.openapi.Configuration;
import io.kubernetes.client.openapi.auth.*;
import io.kubernetes.client.openapi.models.*;
import io.kubernetes.client.openapi.apis.CustomObjectsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://localhost");
    
    // Configure API key authorization: BearerToken
    ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken");
    BearerToken.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //BearerToken.setApiKeyPrefix("Token");

    CustomObjectsApi apiInstance = new CustomObjectsApi(defaultClient);
    String group = "group_example"; // String | the custom resource's group
    String version = "version_example"; // String | the custom resource's version
    String namespace = "namespace_example"; // String | The custom resource's namespace
    String plural = "plural_example"; // String | 自定义资源的复数名。对于TPR,这将是小写复数形式。the custom resource's plural name. For TPRs this would be lowercase plural kind.
    String name = "name_example"; // String | the custom object's name
    Object body = null; // Object | 
    String dryRun = "dryRun_example"; // String | 如果存在,则表示不应保留修改。无效或无法识别的dryRun指令将导致错误响应,并且不会进一步处理请求。有效值为:-全部:将处理所有干运行阶段。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
    String fieldManager = "fieldManager_example"; // String |  fieldManager是与进行这些更改的参与者或实体关联的名称。该值的长度必须小于或128个字符,并且仅包含可打印字符,如https://golang.org/pkg/unicode/#IsPrint.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.
    try {
      Object result = apiInstance.replaceNamespacedCustomObjectScale(group, version, namespace, plural, name, body, dryRun, fieldManager);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CustomObjectsApi#replaceNamespacedCustomObjectScale");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

NameTypeDescriptionNotes
groupStringthe custom resource's group
versionStringthe custom resource's version
namespaceStringThe custom resource's namespace
pluralString自定义资源的复数名。对于TPR,这将是小写复数形式。
nameStringthe custom object's name
bodyObject
dryRunString如果存在,则表示不应保留修改。无效或无法识别的dryRun指令将导致错误响应,并且不会进一步处理请求。有效值为:-全部:将处理所有干运行阶段。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[optional]
fieldManagerStringfieldManager是与进行这些更改的参与者或实体关联的名称。该值的长度必须小于或128个字符,并且仅包含可打印字符,如https://golang.org/pkg/unicode/#IsPrint.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.[optional]

Return type

Object

Authorization

BearerToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/yaml, application/vnd.kubernetes.protobuf

HTTP response details

Status codeDescriptionResponse headers
200OK-
201Created-
401Unauthorized-

replaceNamespacedCustomObjectStatus


回到CustomObjectsApi目录

replace status of the specified namespace scoped custom object

Example

// Import classes:
import io.kubernetes.client.openapi.ApiClient;
import io.kubernetes.client.openapi.ApiException;
import io.kubernetes.client.openapi.Configuration;
import io.kubernetes.client.openapi.auth.*;
import io.kubernetes.client.openapi.models.*;
import io.kubernetes.client.openapi.apis.CustomObjectsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://localhost");
    
    // Configure API key authorization: BearerToken
    ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken");
    BearerToken.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //BearerToken.setApiKeyPrefix("Token");

    CustomObjectsApi apiInstance = new CustomObjectsApi(defaultClient);
    String group = "group_example"; // String | the custom resource's group
    String version = "version_example"; // String | the custom resource's version
    String namespace = "namespace_example"; // String | The custom resource's namespace
    String plural = "plural_example"; // String | 自定义资源的复数名。对于TPR,这将是小写复数形式。the custom resource's plural name. For TPRs this would be lowercase plural kind.
    String name = "name_example"; // String | the custom object's name
    Object body = null; // Object | 
    String dryRun = "dryRun_example"; // String | 如果存在,则表示不应保留修改。无效或无法识别的dryRun指令将导致错误响应,并且不会进一步处理请求。有效值为:-全部:将处理所有干运行阶段。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
    String fieldManager = "fieldManager_example"; // String |  fieldManager是与进行这些更改的参与者或实体关联的名称。该值的长度必须小于或128个字符,并且仅包含可打印字符,如https://golang.org/pkg/unicode/#IsPrint.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.
    try {
      Object result = apiInstance.replaceNamespacedCustomObjectStatus(group, version, namespace, plural, name, body, dryRun, fieldManager);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CustomObjectsApi#replaceNamespacedCustomObjectStatus");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

NameTypeDescriptionNotes
groupStringthe custom resource's group
versionStringthe custom resource's version
namespaceStringThe custom resource's namespace
pluralString自定义资源的复数名。对于TPR,这将是小写复数形式。.
nameStringthe custom object's name
bodyObject
dryRunString如果存在,则表示不应保留修改。无效或无法识别的dryRun指令将导致错误响应,并且不会进一步处理请求。有效值为:-全部:将处理所有干运行阶段。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[optional]
fieldManagerStringfieldManager是与进行这些更改的参与者或实体关联的名称。该值的长度必须小于或128个字符,并且仅包含可打印字符,如https://golang.org/pkg/unicode/#IsPrint.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.[optional]

Return type

Object

Authorization

BearerToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/yaml, application/vnd.kubernetes.protobuf

HTTP response details

Status codeDescriptionResponse headers
200OK-
201Created-
401Unauthorized-

CoreV1Api


回到K8sAPI根目录

All URIs are relative to http://localhost

MethodHTTP requestDescription
createNamespacePOST /api/v1/namespaces创建分区
deleteNamespaceDELETE /api/v1/namespaces/{name}删除分区
listNamespaceGET /api/v1/namespaces分区列表
patchNamespacePATCH /api/v1/namespaces/{name}更新分区内容
readNamespaceGET /api/v1/namespaces/{name}查询指定分区详情
replaceNamespacePUT /api/v1/namespaces/{name}替换分区内容
createNodePOST /api/v1/nodes创建节点
deleteCollectionNodeDELETE /api/v1/nodes删除多个节点
deleteNodeDELETE /api/v1/nodes/{name}删除节点
listNodeGET /api/v1/nodes节点列表
patchNodePATCH /api/v1/nodes/{name}更新节点
readNodeGET /api/v1/nodes/{name}查询指定节点
replaceNodePUT /api/v1/nodes/{name}替换指定节点内容
replaceNodeStatusPUT /api/v1/nodes/{name}/status修改节点状态
createNamespacedPodPOST /api/v1/namespaces/{namespace}/pods创建pod
deleteCollectionNamespacedPodDELETE /api/v1/namespaces/{namespace}/pods删除多个pod
deleteNamespacedPodDELETE /api/v1/namespaces/{namespace}/pods/{name}删除pod
listNamespacedPodGET /api/v1/namespaces/{namespace}/podspod列表
patchNamespacedPodPATCH /api/v1/namespaces/{namespace}/pods/{name}更新pod
readNamespacedPodGET /api/v1/namespaces/{namespace}/pods/{name}查询指定pod
replaceNamespacedPodPUT /api/v1/namespaces/{namespace}/pods/{name}替换指定pod内容
createNamespacedServicePOST /api/v1/namespaces/{namespace}/services创建服务
deleteNamespacedServiceDELETE /api/v1/namespaces/{namespace}/services/{name}删除服务
listNamespacedServiceGET /api/v1/namespaces/{namespace}/services服务列表
patchNamespacedServicePATCH /api/v1/namespaces/{namespace}/services/{name}修改指定服务内容
readNamespacedServiceGET /api/v1/namespaces/{namespace}/services/{name}查询指定服务内容
replaceNamespacedServicePUT /api/v1/namespaces/{namespace}/services/{name}替换指定服务内容

createNamespace


回到CoreV1Api目录

create a Namespace

Example

// Import classes:
import io.kubernetes.client.openapi.ApiClient;
import io.kubernetes.client.openapi.ApiException;
import io.kubernetes.client.openapi.Configuration;
import io.kubernetes.client.openapi.auth.*;
import io.kubernetes.client.openapi.models.*;
import io.kubernetes.client.openapi.apis.CoreV1Api;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://localhost");
    
    // Configure API key authorization: BearerToken
    ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken");
    BearerToken.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //BearerToken.setApiKeyPrefix("Token");

    CoreV1Api apiInstance = new CoreV1Api(defaultClient);
    V1Namespace body = new V1Namespace(); // V1Namespace | 
    String pretty = "pretty_example"; // String | 如果为“true”,则输出相当打印。If 'true', then the output is pretty printed.
    String dryRun = "dryRun_example"; // String | 如果存在,则表示不应保留修改。无效或无法识别的dryRun指令将导致错误响应,并且不会进一步处理请求。有效值为:-全部:将处理所有干运行阶段。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
    String fieldManager = "fieldManager_example"; // String |  fieldManager是与进行这些更改的参与者或实体关联的名称。该值的长度必须小于或128个字符,并且仅包含可打印字符,如https://golang.org/pkg/unicode/#IsPrint.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.
    try {
      V1Namespace result = apiInstance.createNamespace(body, pretty, dryRun, fieldManager);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CoreV1Api#createNamespace");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

NameTypeDescriptionNotes
bodyV1Namespace
prettyString如果为“true”,则输出相当打印。If 'true', then the output is pretty printed.[optional]
dryRunString如果存在,则表示不应保留修改。无效或无法识别的dryRun指令将导致错误响应,并且不会进一步处理请求。有效值为:-全部:将处理所有干运行阶段。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[optional]
fieldManagerStringfieldManager是与进行这些更改的参与者或实体关联的名称。该值的长度必须小于或128个字符,并且仅包含可打印字符,如https://golang.org/pkg/unicode/#IsPrint.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.[optional]

Return type

V1Namespace

Authorization

BearerToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/yaml, application/vnd.kubernetes.protobuf

HTTP response details

Status codeDescriptionResponse headers
200OK-
201Created-
202Accepted-
401Unauthorized-

deleteNamespace


回到CoreV1Api目录

delete a Namespace

Example

// Import classes:
import io.kubernetes.client.openapi.ApiClient;
import io.kubernetes.client.openapi.ApiException;
import io.kubernetes.client.openapi.Configuration;
import io.kubernetes.client.openapi.auth.*;
import io.kubernetes.client.openapi.models.*;
import io.kubernetes.client.openapi.apis.CoreV1Api;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://localhost");
    
    // Configure API key authorization: BearerToken
    ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken");
    BearerToken.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //BearerToken.setApiKeyPrefix("Token");

    CoreV1Api apiInstance = new CoreV1Api(defaultClient);
    String name = "name_example"; // String | name of the Namespace
    String pretty = "pretty_example"; // String | 如果为“true”,则输出相当打印。If 'true', then the output is pretty printed.
    String dryRun = "dryRun_example"; // String | 如果存在,则表示不应保留修改。无效或无法识别的dryRun指令将导致错误响应,并且不会进一步处理请求。有效值为:-全部:将处理所有干运行阶段。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
    Integer gracePeriodSeconds = 56; // Integer | 删除对象前的持续时间(秒)。值必须是非负整数。值为零表示立即删除。如果此值为nil,则将使用指定类型的默认宽限期。如果未指定,则默认为每对象值。零表示立即删除。The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.
    Boolean orphanDependents = true; // Boolean | 已弃用:请使用PropagationPolicy,此字段将在1.7中弃用。从属对象应该是孤立的吗。如果为真/假,“孤立”终结器将被添加到对象的终结器列表中或从中删除。可以设置此字段或PropagationPolicy,但不能同时设置两者。已弃用:请使用PropagationPolicy,此字段将在1.7中弃用。从属对象应该是孤立的吗。如果为真/假,“孤立”终结器将被添加到对象的终结器列表中或从中删除。可以设置此字段或PropagationPolicy,但不能同时设置两者。Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.
    String propagationPolicy = "propagationPolicy_example"; // String | 是否以及如何执行垃圾收集。可以设置此字段或孤立从属项,但不能同时设置两者。默认策略由元数据中设置的现有终结器决定。终结器和特定于资源的默认策略。Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.
    V1DeleteOptions body = new V1DeleteOptions(); // V1DeleteOptions | 
    try {
      V1Status result = apiInstance.deleteNamespace(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CoreV1Api#deleteNamespace");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

NameTypeDescriptionNotes
nameStringname of the Namespace
prettyString如果为“true”,则输出相当打印。If 'true', then the output is pretty printed.[optional]
dryRunString如果存在,则表示不应保留修改。无效或无法识别的dryRun指令将导致错误响应,并且不会进一步处理请求。有效值为:-全部:将处理所有干运行阶段。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[optional]
gracePeriodSecondsInteger删除对象前的持续时间(秒)。值必须是非负整数。值为零表示立即删除。如果此值为nil,则将使用指定类型的默认宽限期。如果未指定,则默认为每对象值。零表示立即删除。The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.[optional]
orphanDependentsBoolean已弃用:请使用PropagationPolicy,此字段将在1.7中弃用。从属对象应该是孤立的吗。如果为真/假,“孤立”终结器将被添加到对象的终结器列表中或从中删除。可以设置此字段或PropagationPolicy,但不能同时设置两者。已弃用:请使用PropagationPolicy,此字段将在1.7中弃用。从属对象应该是孤立的吗。如果为真/假,“孤立”终结器将被添加到对象的终结器列表中或从中删除。可以设置此字段或PropagationPolicy,但不能同时设置两者。Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the "orphan" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.[optional]
propagationPolicyString是否以及如何执行垃圾收集。可以设置此字段或孤立从属项,但不能同时设置两者。默认策略由元数据中设置的现有终结器决定。终结器和特定于资源的默认策略。Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.[optional]
bodyV1DeleteOptions[optional]

Return type

V1Status

Authorization

BearerToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/yaml, application/vnd.kubernetes.protobuf

HTTP response details

Status codeDescriptionResponse headers
200OK-
202Accepted-
401Unauthorized-

listNamespace


回到CoreV1Api目录

list or watch objects of kind Namespace

Example

// Import classes:
import io.kubernetes.client.openapi.ApiClient;
import io.kubernetes.client.openapi.ApiException;
import io.kubernetes.client.openapi.Configuration;
import io.kubernetes.client.openapi.auth.*;
import io.kubernetes.client.openapi.models.*;
import io.kubernetes.client.openapi.apis.CoreV1Api;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://localhost");
    
    // Configure API key authorization: BearerToken
    ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken");
    BearerToken.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //BearerToken.setApiKeyPrefix("Token");

    CoreV1Api apiInstance = new CoreV1Api(defaultClient);
    String pretty = "pretty_example"; // String | 如果为“true”,则输出相当打印。If 'true', then the output is pretty printed.
    Boolean allowWatchBookmarks = true; // Boolean |  allowWatchBookmarks请求观看类型为“BOOKMARK”的事件。未实现书签的服务器可能会忽略此标志,并由服务器自行决定是否发送书签。客户端不应假定书签是在任何特定的时间间隔返回的,也不应假定服务器将在会话期间发送任何书签事件。如果这不是手表,则忽略此字段。如果apiserver中未启用功能gate WatchBookmarks,则忽略此字段。allowWatchBookmarks请求观看类型为“的事件;书签"。未实现书签的服务器可能会忽略此标志,书签会在服务器上发送'这是自由裁量权。客户端不应假定书签是在任何特定的时间间隔返回的,也不应假定服务器将在会话期间发送任何书签事件。如果这不是手表,则忽略此字段。如果apiserver中未启用功能gate WatchBookmarks,则忽略此字段。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.
    String _continue = "_continue_example"; // String | 从服务器检索更多结果时,应设置“继续”选项。由于此值是服务器定义的,因此客户端只能使用具有相同查询参数(continue值除外)的上一个查询结果中的continue值,服务器可能会拒绝它无法识别的continue值。如果指定的continue值因过期(通常为5到15分钟)或服务器上的配置更改而不再有效,服务器将响应410 ResourceExpired错误和continue令牌。如果客户端需要一个一致的列表,它必须在不使用continue字段的情况下重新启动它们的列表。从另一台服务器发送的结果可能与前一台服务器发送的结果不一致,但从下一台服务器发送的结果可能与前一台服务器发送的结果不一致,只要他们的钥匙在“下一个钥匙”之后。watch为true时不支持此字段。客户端可以从服务器返回的最后一个resourceVersion值开始监视,并且不会错过任何修改。从服务器检索更多结果时,应设置“继续”选项。由于此值是服务器定义的,因此客户端只能使用具有相同查询参数(continue值除外)的上一个查询结果中的continue值,服务器可能会拒绝它无法识别的continue值。如果指定的continue值因过期(通常为5到15分钟)或服务器上的配置更改而不再有效,服务器将响应410 ResourceExpired错误和continue令牌。如果客户端需要一个一致的列表,它必须在不使用continue字段的情况下重新启动它们的列表。从另一台服务器发送的结果可能与前一台服务器发送的结果不一致,但从下一台服务器发送的结果可能与前一台服务器发送的结果不一致,只要他们的钥匙在“下一个钥匙”之后。watch为true时不支持此字段。客户端可以从服务器返回的最后一个resourceVersion值开始监视,并且不会错过任何修改。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.(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.
    String fieldSelector = "fieldSelector_example"; // String | 一个选择器,用于按字段限制返回对象的列表。默认为一切。A selector to restrict the list of returned objects by their fields. Defaults to everything.
    String labelSelector = "labelSelector_example"; // String | 一个选择器,用于根据返回对象的标签限制其列表。默认为一切。A selector to restrict the list of returned objects by their labels. Defaults to everything.
    Integer limit = 56; // Integer | limit是列表调用返回的最大响应数。如果存在更多项,服务器会将列表元数据上的“continue”字段设置为一个值,该值可用于同一初始查询,以检索下一组结果。如果所有请求的对象都被过滤掉,设置限制可能会返回少于请求数量的项目(最多为零个项目),客户端应该只使用continue字段来确定是否有更多结果可用。服务器可能会选择不支持limit参数,并将返回所有可用的结果。如果指定了limit且continue字段为空,则客户端可能会认为没有更多结果可用。如果watch为true,则不支持此字段。服务器保证在使用continue时返回的对象将与无限制地发出单个列表调用相同——也就是说,在发出第一个请求后创建、修改或删除的对象不会包含在任何后续的continue请求中。这有时被称为一致性快照,可以确保使用limit接收非常大结果的较小数据块的客户端可以确保看到所有可能的对象。如果在分块列表期间更新对象,则返回在计算第一个列表结果时存在的对象版本。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.
    String resourceVersion = "resourceVersion_example"; // String | 当通过监视调用指定时,显示在资源的特定版本之后发生的更改。默认为历史开始时的更改。为列表指定时:-如果未设置,则根据仲裁读取标志从远程存储返回结果;-如果是0,那么我们只返回当前缓存中的内容,不保证;-如果设置为非零,则结果至少与给定值一样新鲜When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.
    Integer timeoutSeconds = 56; // Integer | 列表/监视呼叫超时。这会限制通话的持续时间,而不管通话是否处于活动状态。列表/监视呼叫超时。这会限制通话的持续时间,而不管通话是否处于活动状态。Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.
    Boolean watch = true; // Boolean | 观察对所描述资源的更改,并将其作为添加、更新和删除通知流返回。指定resourceVersion。观察对所描述资源的更改,并将其作为添加、更新和删除通知流返回。Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.
    try {
      V1NamespaceList result = apiInstance.listNamespace(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CoreV1Api#listNamespace");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

NameTypeDescriptionNotes
prettyString如果为“true”,则输出相当打印。If 'true', then the output is pretty printed.[optional]
allowWatchBookmarks请求观看类型为“BOOKMARK”的事件。未实现书签的服务器可能会忽略此标志,并由服务器自行决定是否发送书签。客户端不应假定书签是在任何特定的时间间隔返回的,也不应假定服务器将在会话期间发送任何书签事件。如果这不是手表,则忽略此字段。如果apiserver中未启用功能gate WatchBookmarks,则忽略此字段。allowWatchBookmarks请求观看类型为“的事件;书签"。未实现书签的服务器可能会忽略此标志,书签会在服务器上发送'这是自由裁量权。客户端不应假定书签是在任何特定的时间间隔返回的,也不应假定服务器将在会话期间发送任何书签事件。如果这不是手表,则忽略此字段。如果apiserver中未启用功能gate WatchBookmarks,则忽略此字段。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.[optional]
_continueString从服务器检索更多结果时,应设置“继续”选项。由于此值是服务器定义的,因此客户端只能使用具有相同查询参数(continue值除外)的上一个查询结果中的continue值,服务器可能会拒绝它无法识别的continue值。如果指定的continue值因过期(通常为5到15分钟)或服务器上的配置更改而不再有效,服务器将响应410 ResourceExpired错误和continue令牌。如果客户端需要一个一致的列表,它必须在不使用continue字段的情况下重新启动它们的列表。从另一台服务器发送的结果可能与前一台服务器发送的结果不一致,但从下一台服务器发送的结果可能与前一台服务器发送的结果不一致,只要他们的钥匙在“下一个钥匙”之后。watch为true时不支持此字段。客户端可以从服务器返回的最后一个resourceVersion值开始监视,并且不会错过任何修改。从服务器检索更多结果时,应设置“继续”选项。由于此值是服务器定义的,因此客户端只能使用具有相同查询参数(continue值除外)的上一个查询结果中的continue值,服务器可能会拒绝它无法识别的continue值。如果指定的continue值因过期(通常为5到15分钟)或服务器上的配置更改而不再有效,服务器将响应410 ResourceExpired错误和continue令牌。如果客户端需要一个一致的列表,它必须在不使用continue字段的情况下重新启动它们的列表。从另一台服务器发送的结果可能与前一台服务器发送的结果不一致,但从下一台服务器发送的结果可能与前一台服务器发送的结果不一致,只要他们的钥匙在“下一个钥匙”之后。watch为true时不支持此字段。客户端可以从服务器返回的最后一个resourceVersion值开始监视,并且不会错过任何修改。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.(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.[optional]
fieldSelectorString一个选择器,用于按字段限制返回对象的列表。默认为一切。A selector to restrict the list of returned objects by their fields. Defaults to everything.[optional]
labelSelectorString一个选择器,用于根据返回对象的标签限制其列表。默认为一切。A selector to restrict the list of returned objects by their labels. Defaults to everything.[optional]
limitIntegerlimit是列表调用返回的最大响应数。如果存在更多项目,服务器将设置`继续`字段的值,该值可用于同一初始查询以检索下一组结果。如果所有请求的对象都被过滤掉,设置限制可能会返回少于请求数量的项目(最多为零个项目),客户端应该只使用continue字段来确定是否有更多结果可用。服务器可能会选择不支持limit参数,并将返回所有可用的结果。如果指定了limit且continue字段为空,则客户端可能会认为没有更多结果可用。如果watch为true,则不支持此字段。服务器保证在使用continue时返回的对象将与无限制地发出单个列表调用相同——也就是说,在发出第一个请求后创建、修改或删除的对象不会包含在任何后续的continue请求中。这有时被称为一致性快照,可以确保使用limit接收非常大结果的较小数据块的客户端可以确保看到所有可能的对象。如果在分块列表期间更新对象,则返回在计算第一个列表结果时存在的对象版本。 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.[optional]
resourceVersionString当通过监视调用指定时,显示在资源的特定版本之后发生的更改。默认为历史开始时的更改。为列表指定时:-如果未设置,则根据仲裁读取标志从远程存储返回结果;-如果是's 0,然后我们只返回当前缓存中的内容,不保证;-如果设置为非零,则结果至少与给定值一样新鲜。When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.[optional]
timeoutSecondsInteger列表/监视呼叫超时。这会限制通话的持续时间,而不管通话是否处于活动状态。列表/监视呼叫超时。这会限制通话的持续时间,而不管通话是否处于活动状态。Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.[optional]
watchBoolean观察对所描述资源的更改,并将其作为添加、更新和删除通知流返回。指定resourceVersion。观察对所描述资源的更改,并将其作为添加、更新和删除通知流返回。Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.[optional]

Return type

V1NamespaceList

Authorization

BearerToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch

HTTP response details

Status codeDescriptionResponse headers
200OK-
401Unauthorized-

patchNamespace


回到CoreV1Api目录

partially update the specified Namespace

Example

// Import classes:
import io.kubernetes.client.openapi.ApiClient;
import io.kubernetes.client.openapi.ApiException;
import io.kubernetes.client.openapi.Configuration;
import io.kubernetes.client.openapi.auth.*;
import io.kubernetes.client.openapi.models.*;
import io.kubernetes.client.openapi.apis.CoreV1Api;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://localhost");
    
    // Configure API key authorization: BearerToken
    ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken");
    BearerToken.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //BearerToken.setApiKeyPrefix("Token");

    CoreV1Api apiInstance = new CoreV1Api(defaultClient);
    String name = "name_example"; // String | name of the Namespace
    V1Patch body = new V1Patch(); // V1Patch | 
    String pretty = "pretty_example"; // String | 如果为“true”,则输出相当打印。If 'true', then the output is pretty printed.
    String dryRun = "dryRun_example"; // String | 如果存在,则表示不应保留修改。无效或无法识别的dryRun指令将导致错误响应,并且不会进一步处理请求。有效值为:-全部:将处理所有干运行阶段。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
    String fieldManager = "fieldManager_example"; // String |  fieldManager是与进行这些更改的参与者或实体关联的名称。该值的长度必须小于或128个字符,并且仅包含可打印字符,如https://golang.org/pkg/unicode/#IsPrint.fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).
    Boolean force = true; // Boolean | Force将“强制”应用请求。这意味着用户将重新获取其他人拥有的冲突字段。对于非应用补丁请求,必须取消设置强制标志。Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.
    try {
      V1Namespace result = apiInstance.patchNamespace(name, body, pretty, dryRun, fieldManager, force);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CoreV1Api#patchNamespace");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

NameTypeDescriptionNotes
nameStringname of the Namespace
bodyV1Patch
prettyString如果为“true”,则输出相当打印。If 'true', then the output is pretty printed.[optional]
dryRunString如果存在,则表示不应保留修改。无效或无法识别的dryRun指令将导致错误响应,并且不会进一步处理请求。有效值为:-全部:将处理所有干运行阶段。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[optional]
fieldManagerStringfieldManager是与进行这些更改的参与者或实体关联的名称。该值的长度必须小于或128个字符,并且仅包含可打印字符,如https://golang.org/pkg/unicode/#IsPrint.fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).[optional]
forceBooleanForce将“强制”应用请求。这意味着用户将重新获取其他人拥有的冲突字段。对于非应用补丁请求,必须取消设置强制标志。Force is going to "force" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.[optional]

Return type

V1Namespace

Authorization

BearerToken

HTTP request headers

  • Content-Type: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml
  • Accept: application/json, application/yaml, application/vnd.kubernetes.protobuf

HTTP response details

Status codeDescriptionResponse headers
200OK-
401Unauthorized-

readNamespace


回到CoreV1Api目录

read the specified Namespace

Example

// Import classes:
import io.kubernetes.client.openapi.ApiClient;
import io.kubernetes.client.openapi.ApiException;
import io.kubernetes.client.openapi.Configuration;
import io.kubernetes.client.openapi.auth.*;
import io.kubernetes.client.openapi.models.*;
import io.kubernetes.client.openapi.apis.CoreV1Api;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://localhost");
    
    // Configure API key authorization: BearerToken
    ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken");
    BearerToken.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //BearerToken.setApiKeyPrefix("Token");

    CoreV1Api apiInstance = new CoreV1Api(defaultClient);
    String name = "name_example"; // String | name of the Namespace
    String pretty = "pretty_example"; // String | 如果为“true”,则输出相当打印。If 'true', then the output is pretty printed.
    Boolean exact = true; // Boolean | 出口应该是准确的。Exact export维护特定于集群的字段,如“Namespace”。不赞成。计划于1.18年拆除。Should the export be exact.  Exact export maintains cluster-specific fields like 'Namespace'. Deprecated. Planned for removal in 1.18.
    Boolean export = true; // Boolean | 应该将该值导出。导出用户无法指定的字段。不赞成。计划于1.18年拆除。Should this value be exported.  Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18.
    try {
      V1Namespace result = apiInstance.readNamespace(name, pretty, exact, export);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CoreV1Api#readNamespace");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

NameTypeDescriptionNotes
nameStringname of the Namespace
prettyString如果为“true”,则输出相当打印。If 'true', then the output is pretty printed.[optional]
exactBoolean出口应该是准确的。Exact export维护特定于集群的字段,如“Namespace”。不赞成。计划于1.18年拆除。Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. Deprecated. Planned for removal in 1.18.[optional]
exportBoolean应该将该值导出。导出用户无法指定的字段。不赞成。计划于1.18年拆除。Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18.[optional]

Return type

V1Namespace

Authorization

BearerToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/yaml, application/vnd.kubernetes.protobuf

HTTP response details

Status codeDescriptionResponse headers
200OK-
401Unauthorized-

replaceNamespace


回到CoreV1Api目录

replace the specified Namespace

Example

// Import classes:
import io.kubernetes.client.openapi.ApiClient;
import io.kubernetes.client.openapi.ApiException;
import io.kubernetes.client.openapi.Configuration;
import io.kubernetes.client.openapi.auth.*;
import io.kubernetes.client.openapi.models.*;
import io.kubernetes.client.openapi.apis.CoreV1Api;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://localhost");
    
    // Configure API key authorization: BearerToken
    ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken");
    BearerToken.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //BearerToken.setApiKeyPrefix("Token");

    CoreV1Api apiInstance = new CoreV1Api(defaultClient);
    String name = "name_example"; // String | name of the Namespace
    V1Namespace body = new V1Namespace(); // V1Namespace | 
    String pretty = "pretty_example"; // String | 如果为“true”,则输出相当打印。If 'true', then the output is pretty printed.
    String dryRun = "dryRun_example"; // String | 如果存在,则表示不应保留修改。无效或无法识别的dryRun指令将导致错误响应,并且不会进一步处理请求。有效值为:-全部:将处理所有干运行阶段。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
    String fieldManager = "fieldManager_example"; // String |  fieldManager是与进行这些更改的参与者或实体关联的名称。该值的长度必须小于或128个字符,并且仅包含可打印字符,如https://golang.org/pkg/unicode/#IsPrint.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.
    try {
      V1Namespace result = apiInstance.replaceNamespace(name, body, pretty, dryRun, fieldManager);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CoreV1Api#replaceNamespace");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

NameTypeDescriptionNotes
nameStringname of the Namespace
bodyV1Namespace
prettyString如果为“true”,则输出相当打印。If 'true', then the output is pretty printed.[optional]
dryRunString如果存在,则表示不应保留修改。无效或无法识别的dryRun指令将导致错误响应,并且不会进一步处理请求。有效值为:-全部:将处理所有干运行阶段。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[optional]
fieldManagerStringfieldManager是与进行这些更改的参与者或实体关联的名称。该值的长度必须小于或128个字符,并且仅包含可打印字符,如https://golang.org/pkg/unicode/#IsPrint.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.[optional]

Return type

V1Namespace

Authorization

BearerToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/yaml, application/vnd.kubernetes.protobuf

HTTP response details

Status codeDescriptionResponse headers
200OK-
201Created-
401Unauthorized-

createNode


回到CoreV1Api目录

create a Node

Example

// Import classes:
import io.kubernetes.client.openapi.ApiClient;
import io.kubernetes.client.openapi.ApiException;
import io.kubernetes.client.openapi.Configuration;
import io.kubernetes.client.openapi.auth.*;
import io.kubernetes.client.openapi.models.*;
import io.kubernetes.client.openapi.apis.CoreV1Api;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://localhost");
    
    // Configure API key authorization: BearerToken
    ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken");
    BearerToken.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //BearerToken.setApiKeyPrefix("Token");

    CoreV1Api apiInstance = new CoreV1Api(defaultClient);
    V1Node body = new V1Node(); // V1Node | 
    String pretty = "pretty_example"; // String | 如果为“true”,则输出相当打印。If 'true', then the output is pretty printed.
    String dryRun = "dryRun_example"; // String | 如果存在,则表示不应保留修改。无效或无法识别的dryRun指令将导致错误响应,并且不会进一步处理请求。有效值为:-全部:将处理所有干运行阶段。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
    String fieldManager = "fieldManager_example"; // String |  fieldManager是与进行这些更改的参与者或实体关联的名称。该值的长度必须小于或128个字符,并且仅包含可打印字符,如https://golang.org/pkg/unicode/#IsPrint.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.
    try {
      V1Node result = apiInstance.createNode(body, pretty, dryRun, fieldManager);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CoreV1Api#createNode");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

NameTypeDescriptionNotes
bodyV1Node
prettyString如果为“true”,则输出相当打印。If 'true', then the output is pretty printed.[optional]
dryRunString如果存在,则表示不应保留修改。无效或无法识别的dryRun指令将导致错误响应,并且不会进一步处理请求。有效值为:-全部:将处理所有干运行阶段。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[optional]
fieldManagerStringfieldManager是与进行这些更改的参与者或实体关联的名称。该值的长度必须小于或128个字符,并且仅包含可打印字符,如https://golang.org/pkg/unicode/#IsPrint.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.[optional]

Return type

V1Node

Authorization

BearerToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/yaml, application/vnd.kubernetes.protobuf

HTTP response details

Status codeDescriptionResponse headers
200OK-
201Created-
202Accepted-
401Unauthorized-

deleteCollectionNode


回到CoreV1Api目录

delete collection of Node

Example

// Import classes:
import io.kubernetes.client.openapi.ApiClient;
import io.kubernetes.client.openapi.ApiException;
import io.kubernetes.client.openapi.Configuration;
import io.kubernetes.client.openapi.auth.*;
import io.kubernetes.client.openapi.models.*;
import io.kubernetes.client.openapi.apis.CoreV1Api;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://localhost");
    
    // Configure API key authorization: BearerToken
    ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken");
    BearerToken.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //BearerToken.setApiKeyPrefix("Token");

    CoreV1Api apiInstance = new CoreV1Api(defaultClient);
    String pretty = "pretty_example"; // String | 如果为“true”,则输出相当打印。If 'true', then the output is pretty printed.
    String _continue = "_continue_example"; // String | 从服务器检索更多结果时,应设置“继续”选项。由于此值是服务器定义的,因此客户端只能使用具有相同查询参数(continue值除外)的上一个查询结果中的continue值,服务器可能会拒绝它无法识别的continue值。如果指定的continue值因过期(通常为5到15分钟)或服务器上的配置更改而不再有效,服务器将响应410 ResourceExpired错误和continue令牌。如果客户端需要一个一致的列表,它必须在不使用continue字段的情况下重新启动它们的列表。从另一台服务器发送的结果可能与前一台服务器发送的结果不一致,但从下一台服务器发送的结果可能与前一台服务器发送的结果不一致,只要他们的钥匙在“下一个钥匙”之后。watch为true时不支持此字段。客户端可以从服务器返回的最后一个resourceVersion值开始监视,并且不会错过任何修改。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.(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.
    String dryRun = "dryRun_example"; // String | 如果存在,则表示不应保留修改。无效或无法识别的dryRun指令将导致错误响应,并且不会进一步处理请求。有效值为:-全部:将处理所有干运行阶段。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
    String fieldSelector = "fieldSelector_example"; // String | 一个选择器,用于按字段限制返回对象的列表。默认为一切。A selector to restrict the list of returned objects by their fields. Defaults to everything.
    Integer gracePeriodSeconds = 56; // Integer | 删除对象前的持续时间(秒)。值必须是非负整数。值为零表示立即删除。如果此值为nil,则将使用指定类型的默认宽限期。如果未指定,则默认为每对象值。零表示立即删除。The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.
    String labelSelector = "labelSelector_example"; // String | 一个选择器,用于根据返回对象的标签限制其列表。默认为一切。A selector to restrict the list of returned objects by their labels. Defaults to everything.
    Integer limit = 56; // Integer | limit是列表调用返回的最大响应数。如果存在更多项目,服务器将设置`继续`字段的值,该值可用于同一初始查询以检索下一组结果。如果所有请求的对象都被过滤掉,设置限制可能会返回少于请求数量的项目(最多为零个项目),客户端应该只使用continue字段来确定是否有更多结果可用。服务器可能会选择不支持limit参数,并将返回所有可用的结果。如果指定了limit且continue字段为空,则客户端可能会认为没有更多结果可用。如果watch为true,则不支持此字段。服务器保证在使用continue时返回的对象将与无限制地发出单个列表调用相同——也就是说,在发出第一个请求后创建、修改或删除的对象不会包含在任何后续的continue请求中。这有时被称为一致性快照,可以确保使用limit接收非常大结果的较小数据块的客户端可以确保看到所有可能的对象。如果在分块列表期间更新对象,则返回在计算第一个列表结果时存在的对象版本。limit是列表调用返回的最大响应数。如果存在更多项,服务器会将列表元数据上的“continue”字段设置为一个值,该值可用于同一初始查询,以检索下一组结果。如果所有请求的对象都被过滤掉,设置限制可能会返回少于请求数量的项目(最多为零个项目),客户端应该只使用continue字段来确定是否有更多结果可用。服务器可能会选择不支持limit参数,并将返回所有可用的结果。如果指定了limit且continue字段为空,则客户端可能会认为没有更多结果可用。如果watch为true,则不支持此字段。服务器保证在使用continue时返回的对象将与无限制地发出单个列表调用相同——也就是说,在发出第一个请求后创建、修改或删除的对象不会包含在任何后续的continue请求中。这有时被称为一致性快照,可以确保使用limit接收非常大结果的较小数据块的客户端可以确保看到所有可能的对象。如果在分块列表期间更新对象,则返回在计算第一个列表结果时存在的对象版本。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.
    Boolean orphanDependents = true; // Boolean | 已弃用:请使用PropagationPolicy,此字段将在1.7中弃用。从属对象应该是孤立的吗。如果为真/假,“孤立”终结器将被添加到对象的终结器列表中或从中删除。可以设置此字段或PropagationPolicy,但不能同时设置两者。已弃用:请使用PropagationPolicy,此字段将在1.7中弃用。从属对象应该是孤立的吗。如果为真/假,“孤立”终结器将被添加到对象的终结器列表中或从中删除。可以设置此字段或PropagationPolicy,但不能同时设置两者。Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.
    String propagationPolicy = "propagationPolicy_example"; // String | 是否以及如何执行垃圾收集。可以设置此字段或孤立从属项,但不能同时设置两者。默认策略由元数据中设置的现有终结器决定。终结器和特定于资源的默认策略。Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.
    String resourceVersion = "resourceVersion_example"; // String | 当通过监视调用指定时,显示在资源的特定版本之后发生的更改。默认为历史开始时的更改。为列表指定时:-如果未设置,则根据仲裁读取标志从远程存储返回结果;-如果是0,那么我们只返回当前缓存中的内容,不保证;-如果设置为非零,则结果至少与给定值一样新鲜When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.
    Integer timeoutSeconds = 56; // Integer | 列表/监视呼叫超时。这会限制通话的持续时间,而不管通话是否处于活动状态。列表/监视呼叫超时。这会限制通话的持续时间,而不管通话是否处于活动状态。Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.
    V1DeleteOptions body = new V1DeleteOptions(); // V1DeleteOptions | 
    try {
      V1Status result = apiInstance.deleteCollectionNode(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, timeoutSeconds, body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CoreV1Api#deleteCollectionNode");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

NameTypeDescriptionNotes
prettyString如果为“true”,则输出相当打印。If 'true', then the output is pretty printed.[optional]
_continueString从服务器检索更多结果时,应设置“继续”选项。由于此值是服务器定义的,因此客户端只能使用具有相同查询参数(continue值除外)的上一个查询结果中的continue值,服务器可能会拒绝它无法识别的continue值。如果指定的continue值因过期(通常为5到15分钟)或服务器上的配置更改而不再有效,服务器将响应410 ResourceExpired错误和continue令牌。如果客户端需要一个一致的列表,它必须在不使用continue字段的情况下重新启动它们的列表。从另一台服务器发送的结果可能与前一台服务器发送的结果不一致,但从下一台服务器发送的结果可能与前一台服务器发送的结果不一致,只要他们的钥匙在“下一个钥匙”之后。watch为true时不支持此字段。客户端可以从服务器返回的最后一个resourceVersion值开始监视,并且不会错过任何修改。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.(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.[optional]
dryRunString如果存在,则表示不应保留修改。无效或无法识别的dryRun指令将导致错误响应,并且不会进一步处理请求。有效值为:-全部:将处理所有干运行阶段。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[optional]
fieldSelectorString一个选择器,用于按字段限制返回对象的列表。默认为一切。A selector to restrict the list of returned objects by their fields. Defaults to everything.[optional]
gracePeriodSecondsInteger删除对象前的持续时间(秒)。值必须是非负整数。值为零表示立即删除。如果此值为nil,则将使用指定类型的默认宽限期。如果未指定,则默认为每对象值。零表示立即删除。The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.[optional]
labelSelectorString一个选择器,用于根据返回对象的标签限制其列表。默认为一切。A selector to restrict the list of returned objects by their labels. Defaults to everything.[optional]
limitIntegerlimit是列表调用返回的最大响应数。如果存在更多项目,服务器将设置`继续`字段的值,该值可用于同一初始查询以检索下一组结果。如果所有请求的对象都被过滤掉,设置限制可能会返回少于请求数量的项目(最多为零个项目),客户端应该只使用continue字段来确定是否有更多结果可用。服务器可能会选择不支持limit参数,并将返回所有可用的结果。如果指定了limit且continue字段为空,则客户端可能会认为没有更多结果可用。如果watch为true,则不支持此字段。服务器保证在使用continue时返回的对象将与无限制地发出单个列表调用相同——也就是说,在发出第一个请求后创建、修改或删除的对象不会包含在任何后续的continue请求中。这有时被称为一致性快照,可以确保使用limit接收非常大结果的较小数据块的客户端可以确保看到所有可能的对象。如果在分块列表期间更新对象,则返回在计算第一个列表结果时存在的对象版本。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.[optional]
orphanDependentsBoolean已弃用:请使用PropagationPolicy,此字段将在1.7中弃用。从属对象应该是孤立的吗。如果为真/假,“孤立”终结器将被添加到对象的终结器列表中或从中删除。可以设置此字段或PropagationPolicy,但不能同时设置两者。已弃用:请使用PropagationPolicy,此字段将在1.7中弃用。从属对象应该是孤立的吗。如果为真/假,“孤立”终结器将被添加到对象的终结器列表中或从中删除。可以设置此字段或PropagationPolicy,但不能同时设置两者。Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the "orphan" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.[optional]
propagationPolicyString是否以及如何执行垃圾收集。可以设置此字段或孤立从属项,但不能同时设置两者。默认策略由元数据中设置的现有终结器决定。终结器和特定于资源的默认策略。Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.[optional]
resourceVersionString当通过监视调用指定时,显示在资源的特定版本之后发生的更改。默认为历史开始时的更改。为列表指定时:-如果未设置,则根据仲裁读取标志从远程存储返回结果;-如果是's 0,然后我们只返回当前缓存中的内容,不保证;-如果设置为非零,则结果至少与给定值一样新鲜。When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.[optional]
timeoutSecondsInteger列表/监视呼叫超时。这会限制通话的持续时间,而不管通话是否处于活动状态。列表/监视呼叫超时。这会限制通话的持续时间,而不管通话是否处于活动状态。Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.[optional]
bodyV1DeleteOptions[optional]

Return type

V1Status

Authorization

BearerToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/yaml, application/vnd.kubernetes.protobuf

HTTP response details

Status codeDescriptionResponse headers
200OK-
401Unauthorized-

deleteNode


回到CoreV1Api目录

delete a Node

Example

// Import classes:
import io.kubernetes.client.openapi.ApiClient;
import io.kubernetes.client.openapi.ApiException;
import io.kubernetes.client.openapi.Configuration;
import io.kubernetes.client.openapi.auth.*;
import io.kubernetes.client.openapi.models.*;
import io.kubernetes.client.openapi.apis.CoreV1Api;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://localhost");
    
    // Configure API key authorization: BearerToken
    ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken");
    BearerToken.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //BearerToken.setApiKeyPrefix("Token");

    CoreV1Api apiInstance = new CoreV1Api(defaultClient);
    String name = "name_example"; // String | name of the Node
    String pretty = "pretty_example"; // String | 如果为“true”,则输出相当打印。If 'true', then the output is pretty printed.
    String dryRun = "dryRun_example"; // String | 如果存在,则表示不应保留修改。无效或无法识别的dryRun指令将导致错误响应,并且不会进一步处理请求。有效值为:-全部:将处理所有干运行阶段。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
    Integer gracePeriodSeconds = 56; // Integer | 删除对象前的持续时间(秒)。值必须是非负整数。值为零表示立即删除。如果此值为nil,则将使用指定类型的默认宽限期。如果未指定,则默认为每对象值。零表示立即删除。The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.
    Boolean orphanDependents = true; // Boolean | 已弃用:请使用PropagationPolicy,此字段将在1.7中弃用。从属对象应该是孤立的吗。如果为真/假,“孤立”终结器将被添加到对象的终结器列表中或从中删除。可以设置此字段或PropagationPolicy,但不能同时设置两者。已弃用:请使用PropagationPolicy,此字段将在1.7中弃用。从属对象应该是孤立的吗。如果为真/假,“孤立”终结器将被添加到对象的终结器列表中或从中删除。可以设置此字段或PropagationPolicy,但不能同时设置两者。Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.
    String propagationPolicy = "propagationPolicy_example"; // String | 是否以及如何执行垃圾收集。可以设置此字段或孤立从属项,但不能同时设置两者。默认策略由元数据中设置的现有终结器决定。终结器和特定于资源的默认策略。Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.
    V1DeleteOptions body = new V1DeleteOptions(); // V1DeleteOptions | 
    try {
      V1Status result = apiInstance.deleteNode(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CoreV1Api#deleteNode");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

NameTypeDescriptionNotes
nameStringname of the Node
prettyString如果为“true”,则输出相当打印。If 'true', then the output is pretty printed.[optional]
dryRunString如果存在,则表示不应保留修改。无效或无法识别的dryRun指令将导致错误响应,并且不会进一步处理请求。有效值为:-全部:将处理所有干运行阶段。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[optional]
gracePeriodSecondsInteger删除对象前的持续时间(秒)。值必须是非负整数。值为零表示立即删除。如果此值为nil,则将使用指定类型的默认宽限期。如果未指定,则默认为每对象值。零表示立即删除。The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.[optional]
orphanDependentsBoolean已弃用:请使用PropagationPolicy,此字段将在1.7中弃用。从属对象应该是孤立的吗。如果为真/假,“孤立”终结器将被添加到对象的终结器列表中或从中删除。可以设置此字段或PropagationPolicy,但不能同时设置两者。已弃用:请使用PropagationPolicy,此字段将在1.7中弃用。从属对象应该是孤立的吗。如果为真/假,“孤立”终结器将被添加到对象的终结器列表中或从中删除。可以设置此字段或PropagationPolicy,但不能同时设置两者。Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the "orphan" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.[optional]
propagationPolicyString是否以及如何执行垃圾收集。可以设置此字段或孤立从属项,但不能同时设置两者。默认策略由元数据中设置的现有终结器决定。终结器和特定于资源的默认策略。Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.[optional]
bodyV1DeleteOptions[optional]

Return type

V1Status

Authorization

BearerToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/yaml, application/vnd.kubernetes.protobuf

HTTP response details

Status codeDescriptionResponse headers
200OK-
202Accepted-
401Unauthorized-

listNode


回到CoreV1Api目录

list or watch objects of kind Node

Example

// Import classes:
import io.kubernetes.client.openapi.ApiClient;
import io.kubernetes.client.openapi.ApiException;
import io.kubernetes.client.openapi.Configuration;
import io.kubernetes.client.openapi.auth.*;
import io.kubernetes.client.openapi.models.*;
import io.kubernetes.client.openapi.apis.CoreV1Api;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://localhost");
    
    // Configure API key authorization: BearerToken
    ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken");
    BearerToken.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //BearerToken.setApiKeyPrefix("Token");

    CoreV1Api apiInstance = new CoreV1Api(defaultClient);
    String pretty = "pretty_example"; // String | 如果为“true”,则输出相当打印。If 'true', then the output is pretty printed.
    Boolean allowWatchBookmarks = true; // Boolean | allowWatchBookmarks请求观看类型为“BOOKMARK”的事件。未实现书签的服务器可能会忽略此标志,并由服务器自行决定是否发送书签。客户端不应假定书签是在任何特定的时间间隔返回的,也不应假定服务器将在会话期间发送任何书签事件。如果这不是手表,则忽略此字段。如果apiserver中未启用功能gate WatchBookmarks,则忽略此字段。allowWatchBookmarks请求观看类型为“的事件;书签"。未实现书签的服务器可能会忽略此标志,书签会在服务器上发送'这是自由裁量权。客户端不应假定书签是在任何特定的时间间隔返回的,也不应假定服务器将在会话期间发送任何书签事件。如果这不是手表,则忽略此字段。如果apiserver中未启用功能gate WatchBookmarks,则忽略此字段。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.
    String _continue = "_continue_example"; // String | 从服务器检索更多结果时,应设置“继续”选项。由于此值是服务器定义的,因此客户端只能使用具有相同查询参数(continue值除外)的上一个查询结果中的continue值,服务器可能会拒绝它无法识别的continue值。如果指定的continue值因过期(通常为5到15分钟)或服务器上的配置更改而不再有效,服务器将响应410 ResourceExpired错误和continue令牌。如果客户端需要一个一致的列表,它必须在不使用continue字段的情况下重新启动它们的列表。从另一台服务器发送的结果可能与前一台服务器发送的结果不一致,但从下一台服务器发送的结果可能与前一台服务器发送的结果不一致,只要他们的钥匙在“下一个钥匙”之后。watch为true时不支持此字段。客户端可以从服务器返回的最后一个resourceVersion值开始监视,并且不会错过任何修改。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.(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.
    String fieldSelector = "fieldSelector_example"; // String | 一个选择器,用于按字段限制返回对象的列表。默认为一切。A selector to restrict the list of returned objects by their fields. Defaults to everything.
    String labelSelector = "labelSelector_example"; // String | 一个选择器,用于根据返回对象的标签限制其列表。默认为一切。A selector to restrict the list of returned objects by their labels. Defaults to everything.
    Integer limit = 56; // Integer | limit是列表调用返回的最大响应数。如果存在更多项,服务器会将列表元数据上的“continue”字段设置为一个值,该值可用于同一初始查询,以检索下一组结果。如果所有请求的对象都被过滤掉,设置限制可能会返回少于请求数量的项目(最多为零个项目),客户端应该只使用continue字段来确定是否有更多结果可用。服务器可能会选择不支持limit参数,并将返回所有可用的结果。如果指定了limit且continue字段为空,则客户端可能会认为没有更多结果可用。如果watch为true,则不支持此字段。服务器保证在使用continue时返回的对象将与无限制地发出单个列表调用相同——也就是说,在发出第一个请求后创建、修改或删除的对象不会包含在任何后续的continue请求中。这有时被称为一致性快照,可以确保使用limit接收非常大结果的较小数据块的客户端可以确保看到所有可能的对象。如果在分块列表期间更新对象,则返回在计算第一个列表结果时存在的对象版本。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.
    String resourceVersion = "resourceVersion_example"; // String | 当通过监视调用指定时,显示在资源的特定版本之后发生的更改。默认为历史开始时的更改。为列表指定时:-如果未设置,则根据仲裁读取标志从远程存储返回结果;-如果是0,那么我们只返回当前缓存中的内容,不保证;-如果设置为非零,则结果至少与给定值一样新鲜When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.
    Integer timeoutSeconds = 56; // Integer | 列表/监视呼叫超时。这会限制通话的持续时间,而不管通话是否处于活动状态。列表/监视呼叫超时。这会限制通话的持续时间,而不管通话是否处于活动状态。Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.
    Boolean watch = true; // Boolean | 观察对所描述资源的更改,并将其作为添加、更新和删除通知流返回。指定resourceVersion。观察对所描述资源的更改,并将其作为添加、更新和删除通知流返回。Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.
    try {
      V1NodeList result = apiInstance.listNode(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CoreV1Api#listNode");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

NameTypeDescriptionNotes
prettyString如果为“true”,则输出相当打印。If 'true', then the output is pretty printed.[optional]
allowWatchBookmarksBooleanallowWatchBookmarks请求观看类型为“BOOKMARK”的事件。未实现书签的服务器可能会忽略此标志,并由服务器自行决定是否发送书签。客户端不应假定书签是在任何特定的时间间隔返回的,也不应假定服务器将在会话期间发送任何书签事件。如果这不是手表,则忽略此字段。如果apiserver中未启用功能gate WatchBookmarks,则忽略此字段。allowWatchBookmarks请求观看类型为“的事件;书签"。未实现书签的服务器可能会忽略此标志,书签会在服务器上发送'这是自由裁量权。客户端不应假定书签是在任何特定的时间间隔返回的,也不应假定服务器将在会话期间发送任何书签事件。如果这不是手表,则忽略此字段。如果apiserver中未启用功能gate WatchBookmarks,则忽略此字段。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.[optional]
_continueString从服务器检索更多结果时,应设置“继续”选项。由于此值是服务器定义的,因此客户端只能使用具有相同查询参数(continue值除外)的上一个查询结果中的continue值,服务器可能会拒绝它无法识别的continue值。如果指定的continue值因过期(通常为5到15分钟)或服务器上的配置更改而不再有效,服务器将响应410 ResourceExpired错误和continue令牌。如果客户端需要一个一致的列表,它必须在不使用continue字段的情况下重新启动它们的列表。从另一台服务器发送的结果可能与前一台服务器发送的结果不一致,但从下一台服务器发送的结果可能与前一台服务器发送的结果不一致,只要他们的钥匙在“下一个钥匙”之后。watch为true时不支持此字段。客户端可以从服务器返回的最后一个resourceVersion值开始监视,并且不会错过任何修改。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.(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.[optional]
fieldSelectorString一个选择器,用于按字段限制返回对象的列表。默认为一切。A selector to restrict the list of returned objects by their fields. Defaults to everything.[optional]
labelSelectorString一个选择器,用于根据返回对象的标签限制其列表。默认为一切。A selector to restrict the list of returned objects by their labels. Defaults to everything.[optional]
limitIntegerlimit是列表调用返回的最大响应数。如果存在更多项目,服务器将设置`继续`字段的值,该值可用于同一初始查询以检索下一组结果。如果所有请求的对象都被过滤掉,设置限制可能会返回少于请求数量的项目(最多为零个项目),客户端应该只使用continue字段来确定是否有更多结果可用。服务器可能会选择不支持limit参数,并将返回所有可用的结果。如果指定了limit且continue字段为空,则客户端可能会认为没有更多结果可用。如果watch为true,则不支持此字段。服务器保证在使用continue时返回的对象将与无限制地发出单个列表调用相同——也就是说,在发出第一个请求后创建、修改或删除的对象不会包含在任何后续的continue请求中。这有时被称为一致性快照,可以确保使用limit接收非常大结果的较小数据块的客户端可以确保看到所有可能的对象。如果在分块列表期间更新对象,则返回在计算第一个列表结果时存在的对象版本。 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.[optional]
resourceVersionString当通过监视调用指定时,显示在资源的特定版本之后发生的更改。默认为历史开始时的更改。为列表指定时:-如果未设置,则根据仲裁读取标志从远程存储返回结果;-如果是's 0,然后我们只返回当前缓存中的内容,不保证;-如果设置为非零,则结果至少与给定值一样新鲜。When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.[optional]
timeoutSecondsInteger列表/监视呼叫超时。这会限制通话的持续时间,而不管通话是否处于活动状态。列表/监视呼叫超时。这会限制通话的持续时间,而不管通话是否处于活动状态。Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.[optional]
watchBoolean观察对所描述资源的更改,并将其作为添加、更新和删除通知流返回。指定resourceVersion。观察对所描述资源的更改,并将其作为添加、更新和删除通知流返回。Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.[optional]

Return type

V1NodeList

Authorization

BearerToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch

HTTP response details

Status codeDescriptionResponse headers
200OK-
401Unauthorized-

patchNode


回到CoreV1Api目录

partially update the specified Node

Example

// Import classes:
import io.kubernetes.client.openapi.ApiClient;
import io.kubernetes.client.openapi.ApiException;
import io.kubernetes.client.openapi.Configuration;
import io.kubernetes.client.openapi.auth.*;
import io.kubernetes.client.openapi.models.*;
import io.kubernetes.client.openapi.apis.CoreV1Api;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://localhost");
    
    // Configure API key authorization: BearerToken
    ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken");
    BearerToken.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //BearerToken.setApiKeyPrefix("Token");

    CoreV1Api apiInstance = new CoreV1Api(defaultClient);
    String name = "name_example"; // String | name of the Node
    V1Patch body = new V1Patch(); // V1Patch | 
    String pretty = "pretty_example"; // String | 如果为“true”,则输出相当打印。If 'true', then the output is pretty printed.
    String dryRun = "dryRun_example"; // String | 如果存在,则表示不应保留修改。无效或无法识别的dryRun指令将导致错误响应,并且不会进一步处理请求。有效值为:-全部:将处理所有干运行阶段。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
    String fieldManager = "fieldManager_example"; // String |  fieldManager是与进行这些更改的参与者或实体关联的名称。该值的长度必须小于或128个字符,并且仅包含可打印字符,如https://golang.org/pkg/unicode/#IsPrint.fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).
    Boolean force = true; // Boolean | Force将“强制”应用请求。这意味着用户将重新获取其他人拥有的冲突字段。对于非应用补丁请求,必须取消设置强制标志。Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.
    try {
      V1Node result = apiInstance.patchNode(name, body, pretty, dryRun, fieldManager, force);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CoreV1Api#patchNode");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

NameTypeDescriptionNotes
nameStringname of the Node
bodyV1Patch
prettyString如果为“true”,则输出相当打印。If 'true', then the output is pretty printed.[optional]
dryRunString如果存在,则表示不应保留修改。无效或无法识别的dryRun指令将导致错误响应,并且不会进一步处理请求。有效值为:-全部:将处理所有干运行阶段。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[optional]
fieldManagerStringfieldManager是与进行这些更改的参与者或实体关联的名称。该值的长度必须小于或128个字符,并且仅包含可打印字符,如https://golang.org/pkg/unicode/#IsPrint.fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).[optional]
forceBooleanForce将“强制”应用请求。这意味着用户将重新获取其他人拥有的冲突字段。对于非应用补丁请求,必须取消设置强制标志。Force is going to "force" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.[optional]

Return type

V1Node

Authorization

BearerToken

HTTP request headers

  • Content-Type: application/json-patch+json, application/merge-patch+json, application/strategic-merge-patch+json, application/apply-patch+yaml
  • Accept: application/json, application/yaml, application/vnd.kubernetes.protobuf

HTTP response details

Status codeDescriptionResponse headers
200OK-
401Unauthorized-

readNode


回到CoreV1Api目录

read the specified Node

Example

// Import classes:
import io.kubernetes.client.openapi.ApiClient;
import io.kubernetes.client.openapi.ApiException;
import io.kubernetes.client.openapi.Configuration;
import io.kubernetes.client.openapi.auth.*;
import io.kubernetes.client.openapi.models.*;
import io.kubernetes.client.openapi.apis.CoreV1Api;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://localhost");
    
    // Configure API key authorization: BearerToken
    ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken");
    BearerToken.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //BearerToken.setApiKeyPrefix("Token");

    CoreV1Api apiInstance = new CoreV1Api(defaultClient);
    String name = "name_example"; // String | name of the Node
    String pretty = "pretty_example"; // String | 如果为“true”,则输出相当打印。If 'true', then the output is pretty printed.
    Boolean exact = true; // Boolean | 出口应该是准确的。Exact export维护特定于集群的字段,如“Namespace”。不赞成。计划于1.18年拆除。Should the export be exact.  Exact export maintains cluster-specific fields like 'Namespace'. Deprecated. Planned for removal in 1.18.
    Boolean export = true; // Boolean | 应该将该值导出。导出用户无法指定的字段。不赞成。计划于1.18年拆除。Should this value be exported.  Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18.
    try {
      V1Node result = apiInstance.readNode(name, pretty, exact, export);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CoreV1Api#readNode");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

NameTypeDescriptionNotes
nameStringname of the Node
prettyString如果为“true”,则输出相当打印。If 'true', then the output is pretty printed.[optional]
exactBooleanShould the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. Deprecated. Planned for removal in 1.18.[optional]
exportBoolean应该将该值导出。导出用户无法指定的字段。不赞成。计划于1.18年拆除。Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18.[optional]

Return type

V1Node

Authorization

BearerToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/yaml, application/vnd.kubernetes.protobuf

HTTP response details

Status codeDescriptionResponse headers
200OK-

replaceNode


回到CoreV1Api目录

replace the specified Node

Example

// Import classes:
import io.kubernetes.client.openapi.ApiClient;
import io.kubernetes.client.openapi.ApiException;
import io.kubernetes.client.openapi.Configuration;
import io.kubernetes.client.openapi.auth.*;
import io.kubernetes.client.openapi.models.*;
import io.kubernetes.client.openapi.apis.CoreV1Api;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://localhost");
    
    // Configure API key authorization: BearerToken
    ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken");
    BearerToken.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //BearerToken.setApiKeyPrefix("Token");

    CoreV1Api apiInstance = new CoreV1Api(defaultClient);
    String name = "name_example"; // String | name of the Node
    V1Node body = new V1Node(); // V1Node | 
    String pretty = "pretty_example"; // String | 如果为“true”,则输出相当打印。If 'true', then the output is pretty printed.
    String dryRun = "dryRun_example"; // String | 如果存在,则表示不应保留修改。无效或无法识别的dryRun指令将导致错误响应,并且不会进一步处理请求。有效值为:-全部:将处理所有干运行阶段。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
    String fieldManager = "fieldManager_example"; // String |  fieldManager是与进行这些更改的参与者或实体关联的名称。该值的长度必须小于或128个字符,并且仅包含可打印字符,如https://golang.org/pkg/unicode/#IsPrint.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.
    try {
      V1Node result = apiInstance.replaceNode(name, body, pretty, dryRun, fieldManager);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CoreV1Api#replaceNode");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

NameTypeDescriptionNotes
nameStringname of the Node
bodyV1Node
prettyString如果为“true”,则输出相当打印。If 'true', then the output is pretty printed.[optional]
dryRunString如果存在,则表示不应保留修改。无效或无法识别的dryRun指令将导致错误响应,并且不会进一步处理请求。有效值为:-全部:将处理所有干运行阶段。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[optional]
fieldManagerStringfieldManager是与进行这些更改的参与者或实体关联的名称。该值的长度必须小于或128个字符,并且仅包含可打印字符,如https://golang.org/pkg/unicode/#IsPrint.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.[optional]

Return type

V1Node

Authorization

BearerToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/yaml, application/vnd.kubernetes.protobuf

HTTP response details

Status codeDescriptionResponse headers
200OK-
201Created-
401Unauthorized-

replaceNodeStatus


回到CoreV1Api目录

replace status of the specified Node

Example

// Import classes:
import io.kubernetes.client.openapi.ApiClient;
import io.kubernetes.client.openapi.ApiException;
import io.kubernetes.client.openapi.Configuration;
import io.kubernetes.client.openapi.auth.*;
import io.kubernetes.client.openapi.models.*;
import io.kubernetes.client.openapi.apis.CoreV1Api;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://localhost");
    
    // Configure API key authorization: BearerToken
    ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken");
    BearerToken.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //BearerToken.setApiKeyPrefix("Token");

    CoreV1Api apiInstance = new CoreV1Api(defaultClient);
    String name = "name_example"; // String | name of the Node
    V1Node body = new V1Node(); // V1Node | 
    String pretty = "pretty_example"; // String | 如果为“true”,则输出相当打印。If 'true', then the output is pretty printed.
    String dryRun = "dryRun_example"; // String | 如果存在,则表示不应保留修改。无效或无法识别的dryRun指令将导致错误响应,并且不会进一步处理请求。有效值为:-全部:将处理所有干运行阶段。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
    String fieldManager = "fieldManager_example"; // String |  fieldManager是与进行这些更改的参与者或实体关联的名称。该值的长度必须小于或128个字符,并且仅包含可打印字符,如https://golang.org/pkg/unicode/#IsPrint.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.
    try {
      V1Node result = apiInstance.replaceNodeStatus(name, body, pretty, dryRun, fieldManager);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CoreV1Api#replaceNodeStatus");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

NameTypeDescriptionNotes
nameStringname of the Node
bodyV1Node
prettyString如果为“true”,则输出相当打印。If 'true', then the output is pretty printed.[optional]
dryRunString如果存在,则表示不应保留修改。无效或无法识别的dryRun指令将导致错误响应,并且不会进一步处理请求。有效值为:-全部:将处理所有干运行阶段。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[optional]
fieldManagerStringfieldManager是与进行这些更改的参与者或实体关联的名称。该值的长度必须小于或128个字符,并且仅包含可打印字符,如https://golang.org/pkg/unicode/#IsPrint.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.[optional]

Return type

V1Node

Authorization

BearerToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/yaml, application/vnd.kubernetes.protobuf

HTTP response details

Status codeDescriptionResponse headers
200OK-
201Created-
401Unauthorized-

createNamespacedPod


回到CoreV1Api目录

create a Pod

Example

// Import classes:
import io.kubernetes.client.openapi.ApiClient;
import io.kubernetes.client.openapi.ApiException;
import io.kubernetes.client.openapi.Configuration;
import io.kubernetes.client.openapi.auth.*;
import io.kubernetes.client.openapi.models.*;
import io.kubernetes.client.openapi.apis.CoreV1Api;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://localhost");
    
    // Configure API key authorization: BearerToken
    ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken");
    BearerToken.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //BearerToken.setApiKeyPrefix("Token");

    CoreV1Api apiInstance = new CoreV1Api(defaultClient);
    String namespace = "namespace_example"; // String | 对象名称和身份验证范围,例如团队和项目。object name and auth scope, such as for teams and projects
    V1Pod body = new V1Pod(); // V1Pod | 
    String pretty = "pretty_example"; // String | 如果为“true”,则输出相当打印。If 'true', then the output is pretty printed.
    String dryRun = "dryRun_example"; // String | 如果存在,则表示不应保留修改。无效或无法识别的dryRun指令将导致错误响应,并且不会进一步处理请求。有效值为:-全部:将处理所有干运行阶段。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
    String fieldManager = "fieldManager_example"; // String |  fieldManager是与进行这些更改的参与者或实体关联的名称。该值的长度必须小于或128个字符,并且仅包含可打印字符,如https://golang.org/pkg/unicode/#IsPrint.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.
    try {
      V1Pod result = apiInstance.createNamespacedPod(namespace, body, pretty, dryRun, fieldManager);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CoreV1Api#createNamespacedPod");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

NameTypeDescriptionNotes
namespaceString对象名称和身份验证范围,例如团队和项目。object name and auth scope, such as for teams and projects
bodyV1Pod
prettyString如果为“true”,则输出相当打印。If 'true', then the output is pretty printed.[optional]
dryRunString如果存在,则表示不应保留修改。无效或无法识别的dryRun指令将导致错误响应,并且不会进一步处理请求。有效值为:-全部:将处理所有干运行阶段。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[optional]
fieldManagerStringfieldManager是与进行这些更改的参与者或实体关联的名称。该值的长度必须小于或128个字符,并且仅包含可打印字符,如https://golang.org/pkg/unicode/#IsPrint.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.[optional]

Return type

V1Pod

Authorization

BearerToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/yaml, application/vnd.kubernetes.protobuf

HTTP response details

Status codeDescriptionResponse headers
200OK-
201Created-
202Accepted-
401Unauthorized-

deleteCollectionNamespacedPod


回到CoreV1Api目录

delete collection of Pod

Example

// Import classes:
import io.kubernetes.client.openapi.ApiClient;
import io.kubernetes.client.openapi.ApiException;
import io.kubernetes.client.openapi.Configuration;
import io.kubernetes.client.openapi.auth.*;
import io.kubernetes.client.openapi.models.*;
import io.kubernetes.client.openapi.apis.CoreV1Api;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://localhost");
    
    // Configure API key authorization: BearerToken
    ApiKeyAuth BearerToken = (ApiKeyAuth) defaultClient.getAuthentication("BearerToken");
    BearerToken.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //BearerToken.setApiKeyPrefix("Token");

    CoreV1Api apiInstance = new CoreV1Api(defaultClient);
    String namespace = "namespace_example"; // String | 对象名称和身份验证范围,例如团队和项目。object name and auth scope, such as for teams and projects
    String pretty = "pretty_example"; // String | 如果为“true”,则输出相当打印。If 'true', then the output is pretty printed.
    String _continue = "_continue_example"; // String | 从服务器检索更多结果时,应设置“继续”选项。由于此值是服务器定义的,因此客户端只能使用具有相同查询参数(continue值除外)的上一个查询结果中的continue值,服务器可能会拒绝它无法识别的continue值。如果指定的continue值因过期(通常为5到15分钟)或服务器上的配置更改而不再有效,服务器将响应410 ResourceExpired错误和continue令牌。如果客户端需要一个一致的列表,它必须在不使用continue字段的情况下重新启动它们的列表。从另一台服务器发送的结果可能与前一台服务器发送的结果不一致,但从下一台服务器发送的结果可能与前一台服务器发送的结果不一致,只要他们的钥匙在“下一个钥匙”之后。watch为true时不支持此字段。客户端可以从服务器返回的最后一个resourceVersion值开始监视,并且不会错过任何修改。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.(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.
    String dryRun = "dryRun_example"; // String |
举报

相关推荐

0 条评论