new-integration-tests/src/test/java/oracle/weblogic/kubernetes/actions/impl/primitive/Kubernetes.java
public static String createNamespacedJob(V1Job jobBody) throws ApiException {
    String name = null;
    String namespace = jobBody.getMetadata().getNamespace();
    try {
      BatchV1Api apiInstance = new BatchV1Api(apiClient);
      V1Job createdJob = apiInstance.createNamespacedJob(
              namespace, // String | namespace in which to create job
              jobBody, // V1Job | body of the V1Job containing job data
              PRETTY, // String | pretty print output.
              null, // String | dry run or permanent change
              null // String | field manager who is making the change
      );
      if (createdJob != null) {
        name = createdJob.getMetadata().getName();
      }
    } catch (ApiException apex) {
      getLogger().severe(apex.getResponseBody());
      throw apex;
    }
    return name;
  }
/**
   * Create a job.
   *
   * @param jobBody V1Job object containing job configuration data
   * @return String job name if job creation is successful
   * @throws ApiException when create job fails
   */
Create a job.
@param jobBody V1Job object containing job configuration data
@return String job name if job creation is successful
@throws ApiException when create job fails
Create a job . @param jobBody V1Job object containing job configuration data @return String job name if job creation is successful @throws ApiException when create job fails
public static String createNamespacedJob(V1Job jobBody) throws ApiException {
    String name = null;
    String namespace = jobBody.getMetadata().getNamespace();
    try {
      BatchV1Api apiInstance = new BatchV1Api(apiClient);
      V1Job createdJob = apiInstance.createNamespacedJob(
              namespace, 
              jobBody, 
              PRETTY, 
              null, 
              null 
      );
      if (createdJob != null) {
        name = createdJob.getMetadata().getName();
      }
    } catch (ApiException apex) {
      getLogger().severe(apex.getResponseBody());
      throw apex;
    }
    return name;
  }
public static String createNamespacedJob ( V1Job jobBody ) throws ApiException { String name = null ; String namespace = jobBody . getMetadata ( ) . getNamespace ( ) ; try { BatchV1Api apiInstance = new BatchV1Api ( apiClient ) ; V1Job createdJob = apiInstance . createNamespacedJob ( namespace , jobBody , PRETTY , null , null ) ; if ( createdJob != null ) { name = createdJob . getMetadata ( ) . getName ( ) ; } } catch ( ApiException apex ) { getLogger ( ) . severe ( apex . getResponseBody ( ) ) ; throw apex ; } return name ; }
Create a job.
Create a job .
// String | namespace in which to create job // V1Job | body of the V1Job containing job data // String | pretty print output. // String | dry run or permanent change // String | field manager who is making the change