Search in sources :

Example 86 with ProgressResponseBody

use of io.kubernetes.client.ProgressResponseBody in project java by kubernetes-client.

the class CustomObjectsApi method deleteNamespacedCustomObjectCall.

/**
 * Build call for deleteNamespacedCustomObject
 * @param group the custom resource's group (required)
 * @param version the custom resource's version (required)
 * @param namespace The custom resource's namespace (required)
 * @param plural the custom resource's plural name. For TPRs this would be lowercase plural kind. (required)
 * @param name the custom object's name (required)
 * @param body  (required)
 * @param gracePeriodSeconds 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)
 * @param orphanDependents 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)
 * @param propagationPolicy 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)
 * @param progressListener Progress listener
 * @param progressRequestListener Progress request listener
 * @return Call to execute
 * @throws ApiException If fail to serialize the request body object
 */
public com.squareup.okhttp.Call deleteNamespacedCustomObjectCall(String group, String version, String namespace, String plural, String name, V1DeleteOptions body, Integer gracePeriodSeconds, Boolean orphanDependents, String propagationPolicy, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
    Object localVarPostBody = body;
    // create path and map variables
    String localVarPath = "/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}".replaceAll("\\{" + "group" + "\\}", apiClient.escapeString(group.toString())).replaceAll("\\{" + "version" + "\\}", apiClient.escapeString(version.toString())).replaceAll("\\{" + "namespace" + "\\}", apiClient.escapeString(namespace.toString())).replaceAll("\\{" + "plural" + "\\}", apiClient.escapeString(plural.toString())).replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString()));
    List<Pair> localVarQueryParams = new ArrayList<Pair>();
    List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
    if (gracePeriodSeconds != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("gracePeriodSeconds", gracePeriodSeconds));
    if (orphanDependents != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("orphanDependents", orphanDependents));
    if (propagationPolicy != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("propagationPolicy", propagationPolicy));
    Map<String, String> localVarHeaderParams = new HashMap<String, String>();
    Map<String, Object> localVarFormParams = new HashMap<String, Object>();
    final String[] localVarAccepts = { "application/json" };
    final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
    if (localVarAccept != null)
        localVarHeaderParams.put("Accept", localVarAccept);
    final String[] localVarContentTypes = { "*/*" };
    final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
    localVarHeaderParams.put("Content-Type", localVarContentType);
    if (progressListener != null) {
        apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {

            @Override
            public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
                com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
                return originalResponse.newBuilder().body(new ProgressResponseBody(originalResponse.body(), progressListener)).build();
            }
        });
    }
    String[] localVarAuthNames = new String[] { "BearerToken" };
    return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
Also used : HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) IOException(java.io.IOException) ProgressResponseBody(io.kubernetes.client.ProgressResponseBody) ApiResponse(io.kubernetes.client.ApiResponse) Pair(io.kubernetes.client.Pair)

Example 87 with ProgressResponseBody

use of io.kubernetes.client.ProgressResponseBody in project java by kubernetes-client.

the class ExtensionsApi method getAPIGroupCall.

/**
 * Build call for getAPIGroup
 * @param progressListener Progress listener
 * @param progressRequestListener Progress request listener
 * @return Call to execute
 * @throws ApiException If fail to serialize the request body object
 */
public com.squareup.okhttp.Call getAPIGroupCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
    Object localVarPostBody = null;
    // create path and map variables
    String localVarPath = "/apis/extensions/";
    List<Pair> localVarQueryParams = new ArrayList<Pair>();
    List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
    Map<String, String> localVarHeaderParams = new HashMap<String, String>();
    Map<String, Object> localVarFormParams = new HashMap<String, Object>();
    final String[] localVarAccepts = { "application/json", "application/yaml", "application/vnd.kubernetes.protobuf" };
    final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
    if (localVarAccept != null)
        localVarHeaderParams.put("Accept", localVarAccept);
    final String[] localVarContentTypes = { "application/json", "application/yaml", "application/vnd.kubernetes.protobuf" };
    final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
    localVarHeaderParams.put("Content-Type", localVarContentType);
    if (progressListener != null) {
        apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {

            @Override
            public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
                com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
                return originalResponse.newBuilder().body(new ProgressResponseBody(originalResponse.body(), progressListener)).build();
            }
        });
    }
    String[] localVarAuthNames = new String[] { "BearerToken" };
    return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
Also used : HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) IOException(java.io.IOException) ProgressResponseBody(io.kubernetes.client.ProgressResponseBody) ApiResponse(io.kubernetes.client.ApiResponse) Pair(io.kubernetes.client.Pair)

Example 88 with ProgressResponseBody

use of io.kubernetes.client.ProgressResponseBody in project java by kubernetes-client.

the class CustomObjectsApi method getNamespacedCustomObjectCall.

/**
 * Build call for getNamespacedCustomObject
 * @param group the custom resource&#39;s group (required)
 * @param version the custom resource&#39;s version (required)
 * @param namespace The custom resource&#39;s namespace (required)
 * @param plural the custom resource&#39;s plural name. For TPRs this would be lowercase plural kind. (required)
 * @param name the custom object&#39;s name (required)
 * @param progressListener Progress listener
 * @param progressRequestListener Progress request listener
 * @return Call to execute
 * @throws ApiException If fail to serialize the request body object
 */
public com.squareup.okhttp.Call getNamespacedCustomObjectCall(String group, String version, String namespace, String plural, String name, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
    Object localVarPostBody = null;
    // create path and map variables
    String localVarPath = "/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}".replaceAll("\\{" + "group" + "\\}", apiClient.escapeString(group.toString())).replaceAll("\\{" + "version" + "\\}", apiClient.escapeString(version.toString())).replaceAll("\\{" + "namespace" + "\\}", apiClient.escapeString(namespace.toString())).replaceAll("\\{" + "plural" + "\\}", apiClient.escapeString(plural.toString())).replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString()));
    List<Pair> localVarQueryParams = new ArrayList<Pair>();
    List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
    Map<String, String> localVarHeaderParams = new HashMap<String, String>();
    Map<String, Object> localVarFormParams = new HashMap<String, Object>();
    final String[] localVarAccepts = { "application/json" };
    final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
    if (localVarAccept != null)
        localVarHeaderParams.put("Accept", localVarAccept);
    final String[] localVarContentTypes = { "*/*" };
    final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
    localVarHeaderParams.put("Content-Type", localVarContentType);
    if (progressListener != null) {
        apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {

            @Override
            public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
                com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
                return originalResponse.newBuilder().body(new ProgressResponseBody(originalResponse.body(), progressListener)).build();
            }
        });
    }
    String[] localVarAuthNames = new String[] { "BearerToken" };
    return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
Also used : HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) IOException(java.io.IOException) ProgressResponseBody(io.kubernetes.client.ProgressResponseBody) ApiResponse(io.kubernetes.client.ApiResponse) Pair(io.kubernetes.client.Pair)

Example 89 with ProgressResponseBody

use of io.kubernetes.client.ProgressResponseBody in project java by kubernetes-client.

the class RbacAuthorizationV1beta1Api method deleteClusterRoleBindingCall.

/**
 * Build call for deleteClusterRoleBinding
 * @param name name of the ClusterRoleBinding (required)
 * @param body  (required)
 * @param pretty If &#39;true&#39;, then the output is pretty printed. (optional)
 * @param gracePeriodSeconds 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)
 * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \&quot;orphan\&quot; finalizer will be added to/removed from the object&#39;s finalizers list. Either this field or PropagationPolicy may be set, but not both. (optional)
 * @param propagationPolicy 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)
 * @param progressListener Progress listener
 * @param progressRequestListener Progress request listener
 * @return Call to execute
 * @throws ApiException If fail to serialize the request body object
 */
public com.squareup.okhttp.Call deleteClusterRoleBindingCall(String name, V1DeleteOptions body, String pretty, Integer gracePeriodSeconds, Boolean orphanDependents, String propagationPolicy, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
    Object localVarPostBody = body;
    // create path and map variables
    String localVarPath = "/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings/{name}".replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString()));
    List<Pair> localVarQueryParams = new ArrayList<Pair>();
    List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
    if (pretty != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("pretty", pretty));
    if (gracePeriodSeconds != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("gracePeriodSeconds", gracePeriodSeconds));
    if (orphanDependents != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("orphanDependents", orphanDependents));
    if (propagationPolicy != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("propagationPolicy", propagationPolicy));
    Map<String, String> localVarHeaderParams = new HashMap<String, String>();
    Map<String, Object> localVarFormParams = new HashMap<String, Object>();
    final String[] localVarAccepts = { "application/json", "application/yaml", "application/vnd.kubernetes.protobuf" };
    final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
    if (localVarAccept != null)
        localVarHeaderParams.put("Accept", localVarAccept);
    final String[] localVarContentTypes = { "*/*" };
    final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
    localVarHeaderParams.put("Content-Type", localVarContentType);
    if (progressListener != null) {
        apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {

            @Override
            public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
                com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
                return originalResponse.newBuilder().body(new ProgressResponseBody(originalResponse.body(), progressListener)).build();
            }
        });
    }
    String[] localVarAuthNames = new String[] { "BearerToken" };
    return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
Also used : HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) IOException(java.io.IOException) ProgressResponseBody(io.kubernetes.client.ProgressResponseBody) ApiResponse(io.kubernetes.client.ApiResponse) Pair(io.kubernetes.client.Pair)

Example 90 with ProgressResponseBody

use of io.kubernetes.client.ProgressResponseBody in project java by kubernetes-client.

the class RbacAuthorizationV1beta1Api method patchClusterRoleBindingCall.

/**
 * Build call for patchClusterRoleBinding
 * @param name name of the ClusterRoleBinding (required)
 * @param body  (required)
 * @param pretty If &#39;true&#39;, then the output is pretty printed. (optional)
 * @param progressListener Progress listener
 * @param progressRequestListener Progress request listener
 * @return Call to execute
 * @throws ApiException If fail to serialize the request body object
 */
public com.squareup.okhttp.Call patchClusterRoleBindingCall(String name, Object body, String pretty, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
    Object localVarPostBody = body;
    // create path and map variables
    String localVarPath = "/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings/{name}".replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString()));
    List<Pair> localVarQueryParams = new ArrayList<Pair>();
    List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
    if (pretty != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("pretty", pretty));
    Map<String, String> localVarHeaderParams = new HashMap<String, String>();
    Map<String, Object> localVarFormParams = new HashMap<String, Object>();
    final String[] localVarAccepts = { "application/json", "application/yaml", "application/vnd.kubernetes.protobuf" };
    final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
    if (localVarAccept != null)
        localVarHeaderParams.put("Accept", localVarAccept);
    final String[] localVarContentTypes = { "application/json-patch+json", "application/merge-patch+json", "application/strategic-merge-patch+json" };
    final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
    localVarHeaderParams.put("Content-Type", localVarContentType);
    if (progressListener != null) {
        apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {

            @Override
            public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
                com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
                return originalResponse.newBuilder().body(new ProgressResponseBody(originalResponse.body(), progressListener)).build();
            }
        });
    }
    String[] localVarAuthNames = new String[] { "BearerToken" };
    return apiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
Also used : HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) IOException(java.io.IOException) ProgressResponseBody(io.kubernetes.client.ProgressResponseBody) ApiResponse(io.kubernetes.client.ApiResponse) Pair(io.kubernetes.client.Pair)

Aggregations

ApiResponse (io.kubernetes.client.ApiResponse)707 Pair (io.kubernetes.client.Pair)707 ProgressResponseBody (io.kubernetes.client.ProgressResponseBody)707 IOException (java.io.IOException)707 ArrayList (java.util.ArrayList)707 HashMap (java.util.HashMap)707