new-integration-tests/src/test/java/oracle/weblogic/kubernetes/actions/impl/primitive/Kubernetes.java
public static boolean createService(V1Service service) throws ApiException {
    if (service == null) {
      throw new IllegalArgumentException(
              "Parameter 'service' cannot be null when calling createService()");
    }

    if (service.getMetadata() == null) {
      throw new IllegalArgumentException(
              "'metadata' field of the parameter 'service' cannot be null when calling createService()");
    }

    if (service.getMetadata().getNamespace() == null) {
      throw new IllegalArgumentException(
              "'namespace' field in the metadata cannot be null when calling createService()");
    }

    String namespace = service.getMetadata().getNamespace();

    V1Service svc;
    try {
      svc = coreV1Api.createNamespacedService(
              namespace, // name of the Namespace
              service, // service configuration data
              PRETTY, // pretty print output
              null, // indicates that modifications should not be persisted
              null // fieldManager is a name associated with the actor
      );
    } catch (ApiException apex) {
      getLogger().severe(apex.getResponseBody());
      throw apex;
    }

    return true;
  }
/**
   * Create a Kubernetes Service.
   *
   * @param service V1Service object containing service configuration data
   * @return true if successful
   * @throws ApiException if Kubernetes client API call fails
   */
Create a Kubernetes Service.
@param service V1Service object containing service configuration data
@return true if successful
@throws ApiException if Kubernetes client API call fails
Create a Kubernetes Service . @param service V1Service object containing service configuration data @return true if successful @throws ApiException if Kubernetes client API call fails
public static boolean createService(V1Service service) throws ApiException {
    if (service == null) {
      throw new IllegalArgumentException(
              "Parameter 'service' cannot be null when calling createService()");
    }
    if (service.getMetadata() == null) {
      throw new IllegalArgumentException(
              "'metadata' field of the parameter 'service' cannot be null when calling createService()");
    }
    if (service.getMetadata().getNamespace() == null) {
      throw new IllegalArgumentException(
              "'namespace' field in the metadata cannot be null when calling createService()");
    }
    String namespace = service.getMetadata().getNamespace();
    V1Service svc;
    try {
      svc = coreV1Api.createNamespacedService(
              namespace, 
              service, 
              PRETTY, 
              null, 
              null 
      );
    } catch (ApiException apex) {
      getLogger().severe(apex.getResponseBody());
      throw apex;
    }
    return true;
  }
public static boolean createService ( V1Service service ) throws ApiException { if ( service == null ) { throw new IllegalArgumentException ( "Parameter 'service' cannot be null when calling createService()" ) ; } if ( service . getMetadata ( ) == null ) { throw new IllegalArgumentException ( "'metadata' field of the parameter 'service' cannot be null when calling createService()" ) ; } if ( service . getMetadata ( ) . getNamespace ( ) == null ) { throw new IllegalArgumentException ( "'namespace' field in the metadata cannot be null when calling createService()" ) ; } String namespace = service . getMetadata ( ) . getNamespace ( ) ; V1Service svc ; try { svc = coreV1Api . createNamespacedService ( namespace , service , PRETTY , null , null ) ; } catch ( ApiException apex ) { getLogger ( ) . severe ( apex . getResponseBody ( ) ) ; throw apex ; } return true ; }
Create a Kubernetes Service.
Create a Kubernetes Service .
// name of the Namespace // service configuration data // pretty print output // indicates that modifications should not be persisted // fieldManager is a name associated with the actor