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

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

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

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

    try {
      serviceAccount = coreV1Api.createNamespacedServiceAccount(
              namespace, // name of the Namespace
              serviceAccount, // service account 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 serviceAccount;
  }
/**
   * Create a Kubernetes Service Account.
   *
   * @param serviceAccount V1ServiceAccount object containing service account configuration data
   * @return created service account
   * @throws ApiException if Kubernetes client API call fails
   */
Create a Kubernetes Service Account.
@param serviceAccount V1ServiceAccount object containing service account configuration data
@return created service account
@throws ApiException if Kubernetes client API call fails
Create a Kubernetes Service Account . @param serviceAccount V1ServiceAccount object containing service account configuration data @return created service account @throws ApiException if Kubernetes client API call fails
public static V1ServiceAccount createServiceAccount(V1ServiceAccount serviceAccount)
          throws ApiException {
    if (serviceAccount == null) {
      throw new IllegalArgumentException(
              "Parameter 'serviceAccount' cannot be null when calling createServiceAccount()");
    }
    if (serviceAccount.getMetadata() == null) {
      throw new IllegalArgumentException(
              "'metadata' field of the parameter 'serviceAccount' cannot be null when calling createServiceAccount()");
    }
    if (serviceAccount.getMetadata().getNamespace() == null) {
      throw new IllegalArgumentException(
              "'namespace' field in the metadata cannot be null when calling createServiceAccount()");
    }
    String namespace = serviceAccount.getMetadata().getNamespace();
    try {
      serviceAccount = coreV1Api.createNamespacedServiceAccount(
              namespace, 
              serviceAccount, 
              PRETTY, 
              null, 
              null 
      );
    } catch (ApiException apex) {
      getLogger().severe(apex.getResponseBody());
      throw apex;
    }
    return serviceAccount;
  }
public static V1ServiceAccount createServiceAccount ( V1ServiceAccount serviceAccount ) throws ApiException { if ( serviceAccount == null ) { throw new IllegalArgumentException ( "Parameter 'serviceAccount' cannot be null when calling createServiceAccount()" ) ; } if ( serviceAccount . getMetadata ( ) == null ) { throw new IllegalArgumentException ( "'metadata' field of the parameter 'serviceAccount' cannot be null when calling createServiceAccount()" ) ; } if ( serviceAccount . getMetadata ( ) . getNamespace ( ) == null ) { throw new IllegalArgumentException ( "'namespace' field in the metadata cannot be null when calling createServiceAccount()" ) ; } String namespace = serviceAccount . getMetadata ( ) . getNamespace ( ) ; try { serviceAccount = coreV1Api . createNamespacedServiceAccount ( namespace , serviceAccount , PRETTY , null , null ) ; } catch ( ApiException apex ) { getLogger ( ) . severe ( apex . getResponseBody ( ) ) ; throw apex ; } return serviceAccount ; }
Create a Kubernetes Service Account.
Create a Kubernetes Service Account .
// name of the Namespace // service account configuration data // pretty print output // indicates that modifications should not be persisted // fieldManager is a name associated with the actor