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

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

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

    String namespace = domain.metadata().getNamespace();

    JsonElement json = convertToJson(domain);

    Object response;
    try {
      response = customObjectsApi.createNamespacedCustomObject(
              DOMAIN_GROUP, // custom resource's group name
              DOMAIN_VERSION, // //custom resource's version
              namespace, // custom resource's namespace
              DOMAIN_PLURAL, // custom resource's plural name
              json, // JSON schema of the Resource to create
              null, // pretty print output
              null, // dry run
              null // field manager
      );
    } catch (ApiException apex) {
      getLogger().severe(apex.getResponseBody());
      throw apex;
    }

    return true;
  }
/**
   * Create a Domain Custom Resource.
   *
   * @param domain Domain custom resource model object
   * @return true on success, false otherwise
   * @throws ApiException if Kubernetes client API call fails
   */
Create a Domain Custom Resource.
@param domain Domain custom resource model object
@return true on success, false otherwise
@throws ApiException if Kubernetes client API call fails
Create a Domain Custom Resource . @param domain Domain custom resource model object @return true on success false otherwise @throws ApiException if Kubernetes client API call fails
public static boolean createDomainCustomResource(Domain domain) throws ApiException {
    if (domain == null) {
      throw new IllegalArgumentException(
              "Parameter 'domain' cannot be null when calling createDomainCustomResource()");
    }
    if (domain.metadata() == null) {
      throw new IllegalArgumentException(
              "'metadata' field of the parameter 'domain' cannot be null when calling createDomainCustomResource()");
    }
    if (domain.metadata().getNamespace() == null) {
      throw new IllegalArgumentException(
              "'namespace' field in the metadata cannot be null when calling createDomainCustomResource()");
    }
    String namespace = domain.metadata().getNamespace();
    JsonElement json = convertToJson(domain);
    Object response;
    try {
      response = customObjectsApi.createNamespacedCustomObject(
              DOMAIN_GROUP, 
              DOMAIN_VERSION, 
              namespace, 
              DOMAIN_PLURAL, 
              json, 
              null, 
              null, 
              null 
      );
    } catch (ApiException apex) {
      getLogger().severe(apex.getResponseBody());
      throw apex;
    }
    return true;
  }
public static boolean createDomainCustomResource ( Domain domain ) throws ApiException { if ( domain == null ) { throw new IllegalArgumentException ( "Parameter 'domain' cannot be null when calling createDomainCustomResource()" ) ; } if ( domain . metadata ( ) == null ) { throw new IllegalArgumentException ( "'metadata' field of the parameter 'domain' cannot be null when calling createDomainCustomResource()" ) ; } if ( domain . metadata ( ) . getNamespace ( ) == null ) { throw new IllegalArgumentException ( "'namespace' field in the metadata cannot be null when calling createDomainCustomResource()" ) ; } String namespace = domain . metadata ( ) . getNamespace ( ) ; JsonElement json = convertToJson ( domain ) ; Object response ; try { response = customObjectsApi . createNamespacedCustomObject ( DOMAIN_GROUP , DOMAIN_VERSION , namespace , DOMAIN_PLURAL , json , null , null , null ) ; } catch ( ApiException apex ) { getLogger ( ) . severe ( apex . getResponseBody ( ) ) ; throw apex ; } return true ; }
Create a Domain Custom Resource.
Create a Domain Custom Resource .
// custom resource's group name // //custom resource's version // custom resource's namespace // custom resource's plural name // JSON schema of the Resource to create // pretty print output // dry run // field manager