io.kubernetes.client.custom.V1Patch Java Examples

The following examples show how to use io.kubernetes.client.custom.V1Patch. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BatchV1Api.java    From java with Apache License 2.0 6 votes vote down vote up
@SuppressWarnings("rawtypes")
private okhttp3.Call patchNamespacedJobStatusValidateBeforeCall(String name, String namespace, V1Patch body, String pretty, String dryRun, String fieldManager, Boolean force, final ApiCallback _callback) throws ApiException {
    
    // verify the required parameter 'name' is set
    if (name == null) {
        throw new ApiException("Missing the required parameter 'name' when calling patchNamespacedJobStatus(Async)");
    }
    
    // verify the required parameter 'namespace' is set
    if (namespace == null) {
        throw new ApiException("Missing the required parameter 'namespace' when calling patchNamespacedJobStatus(Async)");
    }
    
    // verify the required parameter 'body' is set
    if (body == null) {
        throw new ApiException("Missing the required parameter 'body' when calling patchNamespacedJobStatus(Async)");
    }
    

    okhttp3.Call localVarCall = patchNamespacedJobStatusCall(name, namespace, body, pretty, dryRun, fieldManager, force, _callback);
    return localVarCall;

}
 
Example #2
Source File: CertificatesV1beta1Api.java    From java with Apache License 2.0 6 votes vote down vote up
@SuppressWarnings("rawtypes")
private okhttp3.Call patchCertificateSigningRequestStatusValidateBeforeCall(String name, V1Patch body, String pretty, String dryRun, String fieldManager, Boolean force, final ApiCallback _callback) throws ApiException {
    
    // verify the required parameter 'name' is set
    if (name == null) {
        throw new ApiException("Missing the required parameter 'name' when calling patchCertificateSigningRequestStatus(Async)");
    }
    
    // verify the required parameter 'body' is set
    if (body == null) {
        throw new ApiException("Missing the required parameter 'body' when calling patchCertificateSigningRequestStatus(Async)");
    }
    

    okhttp3.Call localVarCall = patchCertificateSigningRequestStatusCall(name, body, pretty, dryRun, fieldManager, force, _callback);
    return localVarCall;

}
 
Example #3
Source File: NetworkingV1beta1Api.java    From java with Apache License 2.0 6 votes vote down vote up
@SuppressWarnings("rawtypes")
private okhttp3.Call patchNamespacedIngressValidateBeforeCall(String name, String namespace, V1Patch body, String pretty, String dryRun, String fieldManager, Boolean force, final ApiCallback _callback) throws ApiException {
    
    // verify the required parameter 'name' is set
    if (name == null) {
        throw new ApiException("Missing the required parameter 'name' when calling patchNamespacedIngress(Async)");
    }
    
    // verify the required parameter 'namespace' is set
    if (namespace == null) {
        throw new ApiException("Missing the required parameter 'namespace' when calling patchNamespacedIngress(Async)");
    }
    
    // verify the required parameter 'body' is set
    if (body == null) {
        throw new ApiException("Missing the required parameter 'body' when calling patchNamespacedIngress(Async)");
    }
    

    okhttp3.Call localVarCall = patchNamespacedIngressCall(name, namespace, body, pretty, dryRun, fieldManager, force, _callback);
    return localVarCall;

}
 
Example #4
Source File: AutoscalingV2beta2Api.java    From java with Apache License 2.0 6 votes vote down vote up
@SuppressWarnings("rawtypes")
private okhttp3.Call patchNamespacedHorizontalPodAutoscalerStatusValidateBeforeCall(String name, String namespace, V1Patch body, String pretty, String dryRun, String fieldManager, Boolean force, final ApiCallback _callback) throws ApiException {
    
    // verify the required parameter 'name' is set
    if (name == null) {
        throw new ApiException("Missing the required parameter 'name' when calling patchNamespacedHorizontalPodAutoscalerStatus(Async)");
    }
    
    // verify the required parameter 'namespace' is set
    if (namespace == null) {
        throw new ApiException("Missing the required parameter 'namespace' when calling patchNamespacedHorizontalPodAutoscalerStatus(Async)");
    }
    
    // verify the required parameter 'body' is set
    if (body == null) {
        throw new ApiException("Missing the required parameter 'body' when calling patchNamespacedHorizontalPodAutoscalerStatus(Async)");
    }
    

    okhttp3.Call localVarCall = patchNamespacedHorizontalPodAutoscalerStatusCall(name, namespace, body, pretty, dryRun, fieldManager, force, _callback);
    return localVarCall;

}
 
Example #5
Source File: ApiregistrationV1beta1Api.java    From java with Apache License 2.0 6 votes vote down vote up
@SuppressWarnings("rawtypes")
private okhttp3.Call patchAPIServiceValidateBeforeCall(String name, V1Patch body, String pretty, String dryRun, String fieldManager, Boolean force, final ApiCallback _callback) throws ApiException {
    
    // verify the required parameter 'name' is set
    if (name == null) {
        throw new ApiException("Missing the required parameter 'name' when calling patchAPIService(Async)");
    }
    
    // verify the required parameter 'body' is set
    if (body == null) {
        throw new ApiException("Missing the required parameter 'body' when calling patchAPIService(Async)");
    }
    

    okhttp3.Call localVarCall = patchAPIServiceCall(name, body, pretty, dryRun, fieldManager, force, _callback);
    return localVarCall;

}
 
Example #6
Source File: ApiextensionsV1Api.java    From java with Apache License 2.0 6 votes vote down vote up
@SuppressWarnings("rawtypes")
private okhttp3.Call patchCustomResourceDefinitionStatusValidateBeforeCall(String name, V1Patch body, String pretty, String dryRun, String fieldManager, Boolean force, final ApiCallback _callback) throws ApiException {
    
    // verify the required parameter 'name' is set
    if (name == null) {
        throw new ApiException("Missing the required parameter 'name' when calling patchCustomResourceDefinitionStatus(Async)");
    }
    
    // verify the required parameter 'body' is set
    if (body == null) {
        throw new ApiException("Missing the required parameter 'body' when calling patchCustomResourceDefinitionStatus(Async)");
    }
    

    okhttp3.Call localVarCall = patchCustomResourceDefinitionStatusCall(name, body, pretty, dryRun, fieldManager, force, _callback);
    return localVarCall;

}
 
Example #7
Source File: SchedulingV1Api.java    From java with Apache License 2.0 6 votes vote down vote up
@SuppressWarnings("rawtypes")
private okhttp3.Call patchPriorityClassValidateBeforeCall(String name, V1Patch body, String pretty, String dryRun, String fieldManager, Boolean force, final ApiCallback _callback) throws ApiException {
    
    // verify the required parameter 'name' is set
    if (name == null) {
        throw new ApiException("Missing the required parameter 'name' when calling patchPriorityClass(Async)");
    }
    
    // verify the required parameter 'body' is set
    if (body == null) {
        throw new ApiException("Missing the required parameter 'body' when calling patchPriorityClass(Async)");
    }
    

    okhttp3.Call localVarCall = patchPriorityClassCall(name, body, pretty, dryRun, fieldManager, force, _callback);
    return localVarCall;

}
 
Example #8
Source File: AuditregistrationV1alpha1Api.java    From java with Apache License 2.0 6 votes vote down vote up
@SuppressWarnings("rawtypes")
private okhttp3.Call patchAuditSinkValidateBeforeCall(String name, V1Patch body, String pretty, String dryRun, String fieldManager, Boolean force, final ApiCallback _callback) throws ApiException {
    
    // verify the required parameter 'name' is set
    if (name == null) {
        throw new ApiException("Missing the required parameter 'name' when calling patchAuditSink(Async)");
    }
    
    // verify the required parameter 'body' is set
    if (body == null) {
        throw new ApiException("Missing the required parameter 'body' when calling patchAuditSink(Async)");
    }
    

    okhttp3.Call localVarCall = patchAuditSinkCall(name, body, pretty, dryRun, fieldManager, force, _callback);
    return localVarCall;

}
 
Example #9
Source File: NodeV1alpha1Api.java    From java with Apache License 2.0 6 votes vote down vote up
@SuppressWarnings("rawtypes")
private okhttp3.Call patchRuntimeClassValidateBeforeCall(String name, V1Patch body, String pretty, String dryRun, String fieldManager, Boolean force, final ApiCallback _callback) throws ApiException {
    
    // verify the required parameter 'name' is set
    if (name == null) {
        throw new ApiException("Missing the required parameter 'name' when calling patchRuntimeClass(Async)");
    }
    
    // verify the required parameter 'body' is set
    if (body == null) {
        throw new ApiException("Missing the required parameter 'body' when calling patchRuntimeClass(Async)");
    }
    

    okhttp3.Call localVarCall = patchRuntimeClassCall(name, body, pretty, dryRun, fieldManager, force, _callback);
    return localVarCall;

}
 
Example #10
Source File: DiscoveryV1beta1Api.java    From java with Apache License 2.0 6 votes vote down vote up
@SuppressWarnings("rawtypes")
private okhttp3.Call patchNamespacedEndpointSliceValidateBeforeCall(String name, String namespace, V1Patch body, String pretty, String dryRun, String fieldManager, Boolean force, final ApiCallback _callback) throws ApiException {
    
    // verify the required parameter 'name' is set
    if (name == null) {
        throw new ApiException("Missing the required parameter 'name' when calling patchNamespacedEndpointSlice(Async)");
    }
    
    // verify the required parameter 'namespace' is set
    if (namespace == null) {
        throw new ApiException("Missing the required parameter 'namespace' when calling patchNamespacedEndpointSlice(Async)");
    }
    
    // verify the required parameter 'body' is set
    if (body == null) {
        throw new ApiException("Missing the required parameter 'body' when calling patchNamespacedEndpointSlice(Async)");
    }
    

    okhttp3.Call localVarCall = patchNamespacedEndpointSliceCall(name, namespace, body, pretty, dryRun, fieldManager, force, _callback);
    return localVarCall;

}
 
Example #11
Source File: BatchV1beta1Api.java    From java with Apache License 2.0 6 votes vote down vote up
@SuppressWarnings("rawtypes")
private okhttp3.Call patchNamespacedCronJobValidateBeforeCall(String name, String namespace, V1Patch body, String pretty, String dryRun, String fieldManager, Boolean force, final ApiCallback _callback) throws ApiException {
    
    // verify the required parameter 'name' is set
    if (name == null) {
        throw new ApiException("Missing the required parameter 'name' when calling patchNamespacedCronJob(Async)");
    }
    
    // verify the required parameter 'namespace' is set
    if (namespace == null) {
        throw new ApiException("Missing the required parameter 'namespace' when calling patchNamespacedCronJob(Async)");
    }
    
    // verify the required parameter 'body' is set
    if (body == null) {
        throw new ApiException("Missing the required parameter 'body' when calling patchNamespacedCronJob(Async)");
    }
    

    okhttp3.Call localVarCall = patchNamespacedCronJobCall(name, namespace, body, pretty, dryRun, fieldManager, force, _callback);
    return localVarCall;

}
 
Example #12
Source File: CoordinationV1Api.java    From java with Apache License 2.0 6 votes vote down vote up
@SuppressWarnings("rawtypes")
private okhttp3.Call patchNamespacedLeaseValidateBeforeCall(String name, String namespace, V1Patch body, String pretty, String dryRun, String fieldManager, Boolean force, final ApiCallback _callback) throws ApiException {
    
    // verify the required parameter 'name' is set
    if (name == null) {
        throw new ApiException("Missing the required parameter 'name' when calling patchNamespacedLease(Async)");
    }
    
    // verify the required parameter 'namespace' is set
    if (namespace == null) {
        throw new ApiException("Missing the required parameter 'namespace' when calling patchNamespacedLease(Async)");
    }
    
    // verify the required parameter 'body' is set
    if (body == null) {
        throw new ApiException("Missing the required parameter 'body' when calling patchNamespacedLease(Async)");
    }
    

    okhttp3.Call localVarCall = patchNamespacedLeaseCall(name, namespace, body, pretty, dryRun, fieldManager, force, _callback);
    return localVarCall;

}
 
Example #13
Source File: NodeV1beta1Api.java    From java with Apache License 2.0 6 votes vote down vote up
@SuppressWarnings("rawtypes")
private okhttp3.Call patchRuntimeClassValidateBeforeCall(String name, V1Patch body, String pretty, String dryRun, String fieldManager, Boolean force, final ApiCallback _callback) throws ApiException {
    
    // verify the required parameter 'name' is set
    if (name == null) {
        throw new ApiException("Missing the required parameter 'name' when calling patchRuntimeClass(Async)");
    }
    
    // verify the required parameter 'body' is set
    if (body == null) {
        throw new ApiException("Missing the required parameter 'body' when calling patchRuntimeClass(Async)");
    }
    

    okhttp3.Call localVarCall = patchRuntimeClassCall(name, body, pretty, dryRun, fieldManager, force, _callback);
    return localVarCall;

}
 
Example #14
Source File: ApiextensionsV1beta1Api.java    From java with Apache License 2.0 6 votes vote down vote up
@SuppressWarnings("rawtypes")
private okhttp3.Call patchCustomResourceDefinitionStatusValidateBeforeCall(String name, V1Patch body, String pretty, String dryRun, String fieldManager, Boolean force, final ApiCallback _callback) throws ApiException {
    
    // verify the required parameter 'name' is set
    if (name == null) {
        throw new ApiException("Missing the required parameter 'name' when calling patchCustomResourceDefinitionStatus(Async)");
    }
    
    // verify the required parameter 'body' is set
    if (body == null) {
        throw new ApiException("Missing the required parameter 'body' when calling patchCustomResourceDefinitionStatus(Async)");
    }
    

    okhttp3.Call localVarCall = patchCustomResourceDefinitionStatusCall(name, body, pretty, dryRun, fieldManager, force, _callback);
    return localVarCall;

}
 
Example #15
Source File: ApiextensionsV1beta1Api.java    From java with Apache License 2.0 6 votes vote down vote up
@SuppressWarnings("rawtypes")
private okhttp3.Call patchCustomResourceDefinitionValidateBeforeCall(String name, V1Patch body, String pretty, String dryRun, String fieldManager, Boolean force, final ApiCallback _callback) throws ApiException {
    
    // verify the required parameter 'name' is set
    if (name == null) {
        throw new ApiException("Missing the required parameter 'name' when calling patchCustomResourceDefinition(Async)");
    }
    
    // verify the required parameter 'body' is set
    if (body == null) {
        throw new ApiException("Missing the required parameter 'body' when calling patchCustomResourceDefinition(Async)");
    }
    

    okhttp3.Call localVarCall = patchCustomResourceDefinitionCall(name, body, pretty, dryRun, fieldManager, force, _callback);
    return localVarCall;

}
 
Example #16
Source File: SettingsV1alpha1Api.java    From java with Apache License 2.0 6 votes vote down vote up
@SuppressWarnings("rawtypes")
private okhttp3.Call patchNamespacedPodPresetValidateBeforeCall(String name, String namespace, V1Patch body, String pretty, String dryRun, String fieldManager, Boolean force, final ApiCallback _callback) throws ApiException {
    
    // verify the required parameter 'name' is set
    if (name == null) {
        throw new ApiException("Missing the required parameter 'name' when calling patchNamespacedPodPreset(Async)");
    }
    
    // verify the required parameter 'namespace' is set
    if (namespace == null) {
        throw new ApiException("Missing the required parameter 'namespace' when calling patchNamespacedPodPreset(Async)");
    }
    
    // verify the required parameter 'body' is set
    if (body == null) {
        throw new ApiException("Missing the required parameter 'body' when calling patchNamespacedPodPreset(Async)");
    }
    

    okhttp3.Call localVarCall = patchNamespacedPodPresetCall(name, namespace, body, pretty, dryRun, fieldManager, force, _callback);
    return localVarCall;

}
 
Example #17
Source File: ApiregistrationV1Api.java    From java with Apache License 2.0 6 votes vote down vote up
@SuppressWarnings("rawtypes")
private okhttp3.Call patchAPIServiceStatusValidateBeforeCall(String name, V1Patch body, String pretty, String dryRun, String fieldManager, Boolean force, final ApiCallback _callback) throws ApiException {
    
    // verify the required parameter 'name' is set
    if (name == null) {
        throw new ApiException("Missing the required parameter 'name' when calling patchAPIServiceStatus(Async)");
    }
    
    // verify the required parameter 'body' is set
    if (body == null) {
        throw new ApiException("Missing the required parameter 'body' when calling patchAPIServiceStatus(Async)");
    }
    

    okhttp3.Call localVarCall = patchAPIServiceStatusCall(name, body, pretty, dryRun, fieldManager, force, _callback);
    return localVarCall;

}
 
Example #18
Source File: EventLoggerTest.java    From java with Apache License 2.0 5 votes vote down vote up
@Test
public void testPatchComputing() {
  V1Event event1 =
      new V1EventBuilder()
          .withSource(new V1EventSourceBuilder().build())
          .withMetadata(new V1ObjectMeta())
          .withInvolvedObject(new V1ObjectReferenceBuilder().build())
          .withCount(1)
          .withMessage("foo1")
          .build();
  V1Event event2 =
      new V1EventBuilder()
          .withSource(new V1EventSourceBuilder().build())
          .withMetadata(new V1ObjectMeta())
          .withInvolvedObject(new V1ObjectReferenceBuilder().build())
          .withCount(2)
          .withMessage("foo2")
          .build();
  String aggregatedKey = EventUtils.getAggregatedAndLocalKeyByReason(event1).getRight();
  EventLogger eventLogger = new EventLogger(100, EventUtils::getEventKey);
  MutablePair<V1Event, V1Patch> result1 = eventLogger.observe(event1, aggregatedKey);
  assertEquals(event1, result1.getLeft());
  assertNull(result1.getRight());

  MutablePair<V1Event, V1Patch> result2 = eventLogger.observe(event2, aggregatedKey);
  assertEquals(event2, result2.getLeft());
  assertNotNull(result2.getRight());
}
 
Example #19
Source File: KubernetesController.java    From twister2 with Apache License 2.0 5 votes vote down vote up
public static ApiClient getApiClient() {
  if (client != null) {
    return client;
  }
  try {
    client = ClientBuilder.standard()
        .setOverridePatchFormat(V1Patch.PATCH_FORMAT_JSON_PATCH)
        .build();
    return client;
  } catch (IOException e) {
    LOG.log(Level.SEVERE, "Exception when creating ApiClient: ", e);
    throw new RuntimeException(e);
  }
}
 
Example #20
Source File: LegacyEventBroadcaster.java    From java with Apache License 2.0 5 votes vote down vote up
private void recordToSink(V1Event event) throws InterruptedException {
  Optional<MutablePair<V1Event, V1Patch>> eventAndPatch = this.eventCorrelator.correlate(event);
  if (!eventAndPatch.isPresent()) {
    // skip
    return;
  }
  V1Event recordingEvent = eventAndPatch.get().getLeft();
  V1Patch patch = eventAndPatch.get().getRight();
  for (int retries = 0; retries < maxTriesPerEvent; retries++) {
    if (recordEvent(recordingEvent, patch, event.getCount() > 1)) {
      break;
    }
    Thread.sleep(sleepDuration.toMillis());
  }
}
 
Example #21
Source File: CoordinationV1Api.java    From java with Apache License 2.0 4 votes vote down vote up
/**
 * Build call for patchNamespacedLease
 * @param name name of the Lease (required)
 * @param namespace object name and auth scope, such as for teams and projects (required)
 * @param body  (required)
 * @param pretty If &#39;true&#39;, then the output is pretty printed. (optional)
 * @param 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)
 * @param fieldManager 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)
 * @param force Force is going to \&quot;force\&quot; 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)
 * @param _callback Callback for upload/download progress
 * @return Call to execute
 * @throws ApiException If fail to serialize the request body object
 * @http.response.details
 <table summary="Response Details" border="1">
    <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
    <tr><td> 200 </td><td> OK </td><td>  -  </td></tr>
    <tr><td> 401 </td><td> Unauthorized </td><td>  -  </td></tr>
 </table>
 */
public okhttp3.Call patchNamespacedLeaseCall(String name, String namespace, V1Patch body, String pretty, String dryRun, String fieldManager, Boolean force, final ApiCallback _callback) throws ApiException {
    Object localVarPostBody = body;

    // create path and map variables
    String localVarPath = "/apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name}"
        .replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString()))
        .replaceAll("\\{" + "namespace" + "\\}", localVarApiClient.escapeString(namespace.toString()));

    List<Pair> localVarQueryParams = new ArrayList<Pair>();
    List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
    if (pretty != null) {
        localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty));
    }

    if (dryRun != null) {
        localVarQueryParams.addAll(localVarApiClient.parameterToPair("dryRun", dryRun));
    }

    if (fieldManager != null) {
        localVarQueryParams.addAll(localVarApiClient.parameterToPair("fieldManager", fieldManager));
    }

    if (force != null) {
        localVarQueryParams.addAll(localVarApiClient.parameterToPair("force", force));
    }

    Map<String, String> localVarHeaderParams = new HashMap<String, String>();
    Map<String, String> localVarCookieParams = 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 = localVarApiClient.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", "application/apply-patch+yaml"
    };
    final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
    localVarHeaderParams.put("Content-Type", localVarContentType);

    String[] localVarAuthNames = new String[] { "BearerToken" };
    return localVarApiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
 
Example #22
Source File: AuditregistrationV1alpha1Api.java    From java with Apache License 2.0 4 votes vote down vote up
/**
 * Build call for patchAuditSink
 * @param name name of the AuditSink (required)
 * @param body  (required)
 * @param pretty If &#39;true&#39;, then the output is pretty printed. (optional)
 * @param 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)
 * @param fieldManager 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)
 * @param force Force is going to \&quot;force\&quot; 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)
 * @param _callback Callback for upload/download progress
 * @return Call to execute
 * @throws ApiException If fail to serialize the request body object
 * @http.response.details
 <table summary="Response Details" border="1">
    <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
    <tr><td> 200 </td><td> OK </td><td>  -  </td></tr>
    <tr><td> 401 </td><td> Unauthorized </td><td>  -  </td></tr>
 </table>
 */
public okhttp3.Call patchAuditSinkCall(String name, V1Patch body, String pretty, String dryRun, String fieldManager, Boolean force, final ApiCallback _callback) throws ApiException {
    Object localVarPostBody = body;

    // create path and map variables
    String localVarPath = "/apis/auditregistration.k8s.io/v1alpha1/auditsinks/{name}"
        .replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString()));

    List<Pair> localVarQueryParams = new ArrayList<Pair>();
    List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
    if (pretty != null) {
        localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty));
    }

    if (dryRun != null) {
        localVarQueryParams.addAll(localVarApiClient.parameterToPair("dryRun", dryRun));
    }

    if (fieldManager != null) {
        localVarQueryParams.addAll(localVarApiClient.parameterToPair("fieldManager", fieldManager));
    }

    if (force != null) {
        localVarQueryParams.addAll(localVarApiClient.parameterToPair("force", force));
    }

    Map<String, String> localVarHeaderParams = new HashMap<String, String>();
    Map<String, String> localVarCookieParams = 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 = localVarApiClient.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", "application/apply-patch+yaml"
    };
    final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
    localVarHeaderParams.put("Content-Type", localVarContentType);

    String[] localVarAuthNames = new String[] { "BearerToken" };
    return localVarApiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
 
Example #23
Source File: StorageV1alpha1Api.java    From java with Apache License 2.0 4 votes vote down vote up
/**
 * Build call for patchVolumeAttachment
 * @param name name of the VolumeAttachment (required)
 * @param body  (required)
 * @param pretty If &#39;true&#39;, then the output is pretty printed. (optional)
 * @param 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)
 * @param fieldManager 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)
 * @param force Force is going to \&quot;force\&quot; 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)
 * @param _callback Callback for upload/download progress
 * @return Call to execute
 * @throws ApiException If fail to serialize the request body object
 * @http.response.details
 <table summary="Response Details" border="1">
    <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
    <tr><td> 200 </td><td> OK </td><td>  -  </td></tr>
    <tr><td> 401 </td><td> Unauthorized </td><td>  -  </td></tr>
 </table>
 */
public okhttp3.Call patchVolumeAttachmentCall(String name, V1Patch body, String pretty, String dryRun, String fieldManager, Boolean force, final ApiCallback _callback) throws ApiException {
    Object localVarPostBody = body;

    // create path and map variables
    String localVarPath = "/apis/storage.k8s.io/v1alpha1/volumeattachments/{name}"
        .replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString()));

    List<Pair> localVarQueryParams = new ArrayList<Pair>();
    List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
    if (pretty != null) {
        localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty));
    }

    if (dryRun != null) {
        localVarQueryParams.addAll(localVarApiClient.parameterToPair("dryRun", dryRun));
    }

    if (fieldManager != null) {
        localVarQueryParams.addAll(localVarApiClient.parameterToPair("fieldManager", fieldManager));
    }

    if (force != null) {
        localVarQueryParams.addAll(localVarApiClient.parameterToPair("force", force));
    }

    Map<String, String> localVarHeaderParams = new HashMap<String, String>();
    Map<String, String> localVarCookieParams = 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 = localVarApiClient.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", "application/apply-patch+yaml"
    };
    final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
    localVarHeaderParams.put("Content-Type", localVarContentType);

    String[] localVarAuthNames = new String[] { "BearerToken" };
    return localVarApiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
 
Example #24
Source File: AutoscalingV1Api.java    From java with Apache License 2.0 4 votes vote down vote up
/**
 * Build call for patchNamespacedHorizontalPodAutoscalerStatus
 * @param name name of the HorizontalPodAutoscaler (required)
 * @param namespace object name and auth scope, such as for teams and projects (required)
 * @param body  (required)
 * @param pretty If &#39;true&#39;, then the output is pretty printed. (optional)
 * @param 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)
 * @param fieldManager 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)
 * @param force Force is going to \&quot;force\&quot; 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)
 * @param _callback Callback for upload/download progress
 * @return Call to execute
 * @throws ApiException If fail to serialize the request body object
 * @http.response.details
 <table summary="Response Details" border="1">
    <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
    <tr><td> 200 </td><td> OK </td><td>  -  </td></tr>
    <tr><td> 401 </td><td> Unauthorized </td><td>  -  </td></tr>
 </table>
 */
public okhttp3.Call patchNamespacedHorizontalPodAutoscalerStatusCall(String name, String namespace, V1Patch body, String pretty, String dryRun, String fieldManager, Boolean force, final ApiCallback _callback) throws ApiException {
    Object localVarPostBody = body;

    // create path and map variables
    String localVarPath = "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status"
        .replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString()))
        .replaceAll("\\{" + "namespace" + "\\}", localVarApiClient.escapeString(namespace.toString()));

    List<Pair> localVarQueryParams = new ArrayList<Pair>();
    List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
    if (pretty != null) {
        localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty));
    }

    if (dryRun != null) {
        localVarQueryParams.addAll(localVarApiClient.parameterToPair("dryRun", dryRun));
    }

    if (fieldManager != null) {
        localVarQueryParams.addAll(localVarApiClient.parameterToPair("fieldManager", fieldManager));
    }

    if (force != null) {
        localVarQueryParams.addAll(localVarApiClient.parameterToPair("force", force));
    }

    Map<String, String> localVarHeaderParams = new HashMap<String, String>();
    Map<String, String> localVarCookieParams = 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 = localVarApiClient.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", "application/apply-patch+yaml"
    };
    final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
    localVarHeaderParams.put("Content-Type", localVarContentType);

    String[] localVarAuthNames = new String[] { "BearerToken" };
    return localVarApiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
 
Example #25
Source File: AutoscalingV2beta2Api.java    From java with Apache License 2.0 4 votes vote down vote up
/**
 * Build call for patchNamespacedHorizontalPodAutoscalerStatus
 * @param name name of the HorizontalPodAutoscaler (required)
 * @param namespace object name and auth scope, such as for teams and projects (required)
 * @param body  (required)
 * @param pretty If &#39;true&#39;, then the output is pretty printed. (optional)
 * @param 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)
 * @param fieldManager 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)
 * @param force Force is going to \&quot;force\&quot; 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)
 * @param _callback Callback for upload/download progress
 * @return Call to execute
 * @throws ApiException If fail to serialize the request body object
 * @http.response.details
 <table summary="Response Details" border="1">
    <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
    <tr><td> 200 </td><td> OK </td><td>  -  </td></tr>
    <tr><td> 401 </td><td> Unauthorized </td><td>  -  </td></tr>
 </table>
 */
public okhttp3.Call patchNamespacedHorizontalPodAutoscalerStatusCall(String name, String namespace, V1Patch body, String pretty, String dryRun, String fieldManager, Boolean force, final ApiCallback _callback) throws ApiException {
    Object localVarPostBody = body;

    // create path and map variables
    String localVarPath = "/apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers/{name}/status"
        .replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString()))
        .replaceAll("\\{" + "namespace" + "\\}", localVarApiClient.escapeString(namespace.toString()));

    List<Pair> localVarQueryParams = new ArrayList<Pair>();
    List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
    if (pretty != null) {
        localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty));
    }

    if (dryRun != null) {
        localVarQueryParams.addAll(localVarApiClient.parameterToPair("dryRun", dryRun));
    }

    if (fieldManager != null) {
        localVarQueryParams.addAll(localVarApiClient.parameterToPair("fieldManager", fieldManager));
    }

    if (force != null) {
        localVarQueryParams.addAll(localVarApiClient.parameterToPair("force", force));
    }

    Map<String, String> localVarHeaderParams = new HashMap<String, String>();
    Map<String, String> localVarCookieParams = 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 = localVarApiClient.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", "application/apply-patch+yaml"
    };
    final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
    localVarHeaderParams.put("Content-Type", localVarContentType);

    String[] localVarAuthNames = new String[] { "BearerToken" };
    return localVarApiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
 
Example #26
Source File: NodeV1beta1Api.java    From java with Apache License 2.0 4 votes vote down vote up
/**
 * Build call for patchRuntimeClass
 * @param name name of the RuntimeClass (required)
 * @param body  (required)
 * @param pretty If &#39;true&#39;, then the output is pretty printed. (optional)
 * @param 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)
 * @param fieldManager 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)
 * @param force Force is going to \&quot;force\&quot; 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)
 * @param _callback Callback for upload/download progress
 * @return Call to execute
 * @throws ApiException If fail to serialize the request body object
 * @http.response.details
 <table summary="Response Details" border="1">
    <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
    <tr><td> 200 </td><td> OK </td><td>  -  </td></tr>
    <tr><td> 401 </td><td> Unauthorized </td><td>  -  </td></tr>
 </table>
 */
public okhttp3.Call patchRuntimeClassCall(String name, V1Patch body, String pretty, String dryRun, String fieldManager, Boolean force, final ApiCallback _callback) throws ApiException {
    Object localVarPostBody = body;

    // create path and map variables
    String localVarPath = "/apis/node.k8s.io/v1beta1/runtimeclasses/{name}"
        .replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString()));

    List<Pair> localVarQueryParams = new ArrayList<Pair>();
    List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
    if (pretty != null) {
        localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty));
    }

    if (dryRun != null) {
        localVarQueryParams.addAll(localVarApiClient.parameterToPair("dryRun", dryRun));
    }

    if (fieldManager != null) {
        localVarQueryParams.addAll(localVarApiClient.parameterToPair("fieldManager", fieldManager));
    }

    if (force != null) {
        localVarQueryParams.addAll(localVarApiClient.parameterToPair("force", force));
    }

    Map<String, String> localVarHeaderParams = new HashMap<String, String>();
    Map<String, String> localVarCookieParams = 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 = localVarApiClient.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", "application/apply-patch+yaml"
    };
    final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
    localVarHeaderParams.put("Content-Type", localVarContentType);

    String[] localVarAuthNames = new String[] { "BearerToken" };
    return localVarApiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
 
Example #27
Source File: AutoscalingV2beta2Api.java    From java with Apache License 2.0 4 votes vote down vote up
/**
 * Build call for patchNamespacedHorizontalPodAutoscaler
 * @param name name of the HorizontalPodAutoscaler (required)
 * @param namespace object name and auth scope, such as for teams and projects (required)
 * @param body  (required)
 * @param pretty If &#39;true&#39;, then the output is pretty printed. (optional)
 * @param 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)
 * @param fieldManager 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)
 * @param force Force is going to \&quot;force\&quot; 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)
 * @param _callback Callback for upload/download progress
 * @return Call to execute
 * @throws ApiException If fail to serialize the request body object
 * @http.response.details
 <table summary="Response Details" border="1">
    <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
    <tr><td> 200 </td><td> OK </td><td>  -  </td></tr>
    <tr><td> 401 </td><td> Unauthorized </td><td>  -  </td></tr>
 </table>
 */
public okhttp3.Call patchNamespacedHorizontalPodAutoscalerCall(String name, String namespace, V1Patch body, String pretty, String dryRun, String fieldManager, Boolean force, final ApiCallback _callback) throws ApiException {
    Object localVarPostBody = body;

    // create path and map variables
    String localVarPath = "/apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers/{name}"
        .replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString()))
        .replaceAll("\\{" + "namespace" + "\\}", localVarApiClient.escapeString(namespace.toString()));

    List<Pair> localVarQueryParams = new ArrayList<Pair>();
    List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
    if (pretty != null) {
        localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty));
    }

    if (dryRun != null) {
        localVarQueryParams.addAll(localVarApiClient.parameterToPair("dryRun", dryRun));
    }

    if (fieldManager != null) {
        localVarQueryParams.addAll(localVarApiClient.parameterToPair("fieldManager", fieldManager));
    }

    if (force != null) {
        localVarQueryParams.addAll(localVarApiClient.parameterToPair("force", force));
    }

    Map<String, String> localVarHeaderParams = new HashMap<String, String>();
    Map<String, String> localVarCookieParams = 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 = localVarApiClient.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", "application/apply-patch+yaml"
    };
    final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
    localVarHeaderParams.put("Content-Type", localVarContentType);

    String[] localVarAuthNames = new String[] { "BearerToken" };
    return localVarApiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
 
Example #28
Source File: KubeOpt.java    From dew with Apache License 2.0 4 votes vote down vote up
/**
 * Patch.
 *
 * @param name      the name
 * @param patchers  the patchers
 * @param namespace the namespace
 * @param res       the res
 * @throws ApiException the api exception
 * @see <a href="http://jsonpatch.com/">Jsonpatch</a>
 */
public void patch(String name, List<String> patchers, String namespace, KubeRES res) throws ApiException {
    String jsonPatchers = patchers.stream()
            .collect(Collectors.joining(",", "[", "]"));
    V1Patch v1Patch = new V1Patch(jsonPatchers);
    try {
        switch (res) {
            case NAME_SPACE:
                coreApi.patchNamespace(
                        name, v1Patch, null, null, null, null);
                break;
            case INGRESS:
                extensionsApi.patchNamespacedIngress(
                        name, namespace, v1Patch, null, null, null, null);
                break;
            case SERVICE:
                coreApi.patchNamespacedService(
                        name, namespace, v1Patch, null, null, null, null);
                break;
            case DEPLOYMENT:
                appsApi.patchNamespacedDeployment(
                        name, namespace, v1Patch, null, null, null, null);
                break;
            case POD:
                coreApi.patchNamespacedPod(
                        name, namespace, v1Patch, null, null, null, null);
                break;
            case SECRET:
                coreApi.patchNamespacedSecret(
                        name, namespace, v1Patch, null, null, null, null);
                break;
            case CONFIG_MAP:
                coreApi.patchNamespacedConfigMap(
                        name, namespace, v1Patch, null, null, null, null);
                break;
            case SERVICE_ACCOUNT:
                coreApi.patchNamespacedServiceAccount(
                        name, namespace, v1Patch, null, null, null, null);
                break;
            case DAEMON_SET:
                appsApi.patchNamespacedDaemonSet(
                        name, namespace, v1Patch, null, null, null, null);
                break;
            case ROLE:
                rbacAuthorizationApi.patchNamespacedRole(
                        name, namespace, v1Patch, null, null, null, null);
                break;
            case ROLE_BINDING:
                rbacAuthorizationApi.patchNamespacedRoleBinding(
                        name, namespace, v1Patch, null, null, null, null);
                break;
            case CLUSTER_ROLE:
                rbacAuthorizationApi.patchClusterRole(
                        name, v1Patch, null, null, null, null);
                break;
            case CLUSTER_ROLE_BINDING:
                rbacAuthorizationApi.patchClusterRoleBinding(
                        name, v1Patch, null, null, null, null);
                break;
            case HORIZONTAL_POD_AUTOSCALER:
                autoscalingApi.patchNamespacedHorizontalPodAutoscaler(
                        name, namespace, v1Patch, null, null, null, null);
                break;
            default:
                throw new ApiException("The resource [" + res.getVal() + "] operation NOT implementation");
        }
    } catch (ApiException e) {
        log.error("Patch error for \r\n" + $.json.toJsonString(patchers), e);
        throw e;
    }
}
 
Example #29
Source File: ApiregistrationV1beta1Api.java    From java with Apache License 2.0 4 votes vote down vote up
/**
 * Build call for patchAPIService
 * @param name name of the APIService (required)
 * @param body  (required)
 * @param pretty If &#39;true&#39;, then the output is pretty printed. (optional)
 * @param 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)
 * @param fieldManager 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)
 * @param force Force is going to \&quot;force\&quot; 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)
 * @param _callback Callback for upload/download progress
 * @return Call to execute
 * @throws ApiException If fail to serialize the request body object
 * @http.response.details
 <table summary="Response Details" border="1">
    <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
    <tr><td> 200 </td><td> OK </td><td>  -  </td></tr>
    <tr><td> 401 </td><td> Unauthorized </td><td>  -  </td></tr>
 </table>
 */
public okhttp3.Call patchAPIServiceCall(String name, V1Patch body, String pretty, String dryRun, String fieldManager, Boolean force, final ApiCallback _callback) throws ApiException {
    Object localVarPostBody = body;

    // create path and map variables
    String localVarPath = "/apis/apiregistration.k8s.io/v1beta1/apiservices/{name}"
        .replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString()));

    List<Pair> localVarQueryParams = new ArrayList<Pair>();
    List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
    if (pretty != null) {
        localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty));
    }

    if (dryRun != null) {
        localVarQueryParams.addAll(localVarApiClient.parameterToPair("dryRun", dryRun));
    }

    if (fieldManager != null) {
        localVarQueryParams.addAll(localVarApiClient.parameterToPair("fieldManager", fieldManager));
    }

    if (force != null) {
        localVarQueryParams.addAll(localVarApiClient.parameterToPair("force", force));
    }

    Map<String, String> localVarHeaderParams = new HashMap<String, String>();
    Map<String, String> localVarCookieParams = 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 = localVarApiClient.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", "application/apply-patch+yaml"
    };
    final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
    localVarHeaderParams.put("Content-Type", localVarContentType);

    String[] localVarAuthNames = new String[] { "BearerToken" };
    return localVarApiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
 
Example #30
Source File: ApiextensionsV1beta1Api.java    From java with Apache License 2.0 4 votes vote down vote up
/**
 * Build call for patchCustomResourceDefinition
 * @param name name of the CustomResourceDefinition (required)
 * @param body  (required)
 * @param pretty If &#39;true&#39;, then the output is pretty printed. (optional)
 * @param 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)
 * @param fieldManager 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)
 * @param force Force is going to \&quot;force\&quot; 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)
 * @param _callback Callback for upload/download progress
 * @return Call to execute
 * @throws ApiException If fail to serialize the request body object
 * @http.response.details
 <table summary="Response Details" border="1">
    <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
    <tr><td> 200 </td><td> OK </td><td>  -  </td></tr>
    <tr><td> 401 </td><td> Unauthorized </td><td>  -  </td></tr>
 </table>
 */
public okhttp3.Call patchCustomResourceDefinitionCall(String name, V1Patch body, String pretty, String dryRun, String fieldManager, Boolean force, final ApiCallback _callback) throws ApiException {
    Object localVarPostBody = body;

    // create path and map variables
    String localVarPath = "/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/{name}"
        .replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString()));

    List<Pair> localVarQueryParams = new ArrayList<Pair>();
    List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
    if (pretty != null) {
        localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty));
    }

    if (dryRun != null) {
        localVarQueryParams.addAll(localVarApiClient.parameterToPair("dryRun", dryRun));
    }

    if (fieldManager != null) {
        localVarQueryParams.addAll(localVarApiClient.parameterToPair("fieldManager", fieldManager));
    }

    if (force != null) {
        localVarQueryParams.addAll(localVarApiClient.parameterToPair("force", force));
    }

    Map<String, String> localVarHeaderParams = new HashMap<String, String>();
    Map<String, String> localVarCookieParams = 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 = localVarApiClient.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", "application/apply-patch+yaml"
    };
    final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
    localVarHeaderParams.put("Content-Type", localVarContentType);

    String[] localVarAuthNames = new String[] { "BearerToken" };
    return localVarApiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}