new-integration-tests/src/test/java/oracle/weblogic/kubernetes/actions/impl/primitive/Kubernetes.java
public static List<String> listNamespaces() throws ApiException {
    ArrayList<String> nameSpaces = new ArrayList<>();
    V1NamespaceList namespaceList;
    try {
      namespaceList = coreV1Api.listNamespace(
              PRETTY, // pretty print output
              ALLOW_WATCH_BOOKMARKS, // allowWatchBookmarks requests watch events with type "BOOKMARK"
              null, // set when retrieving more results from the server
              null, // selector to restrict the list of returned objects by their fields
              null, // selector to restrict the list of returned objects by their labels
              null, // maximum number of responses to return for a list call
              RESOURCE_VERSION, // shows changes that occur after that particular version of a resource
              TIMEOUT_SECONDS, // Timeout for the list/watch call
              false // Watch for changes to the described resources
      );
    } catch (ApiException apex) {
      getLogger().severe(apex.getResponseBody());
      throw apex;
    }

    for (V1Namespace namespace : namespaceList.getItems()) {
      nameSpaces.add(namespace.getMetadata().getName());
    }

    return nameSpaces;
  }
/**
   * List namespaces in the Kubernetes cluster.
   * @return List of all Namespace names in the Kubernetes cluster
   * @throws ApiException if Kubernetes client API call fails
   */
List namespaces in the Kubernetes cluster.
@return List of all Namespace names in the Kubernetes cluster
@throws ApiException if Kubernetes client API call fails
List namespaces in the Kubernetes cluster . @return List of all Namespace names in the Kubernetes cluster @throws ApiException if Kubernetes client API call fails
public static List<String> listNamespaces() throws ApiException {
    ArrayList<String> nameSpaces = new ArrayList<>();
    V1NamespaceList namespaceList;
    try {
      namespaceList = coreV1Api.listNamespace(
              PRETTY, 
              ALLOW_WATCH_BOOKMARKS, 
              null, 
              null, 
              null, 
              null, 
              RESOURCE_VERSION, 
              TIMEOUT_SECONDS, 
              false 
      );
    } catch (ApiException apex) {
      getLogger().severe(apex.getResponseBody());
      throw apex;
    }
    for (V1Namespace namespace : namespaceList.getItems()) {
      nameSpaces.add(namespace.getMetadata().getName());
    }
    return nameSpaces;
  }
public static List < String > listNamespaces ( ) throws ApiException { ArrayList < String > nameSpaces = new ArrayList < > ( ) ; V1NamespaceList namespaceList ; try { namespaceList = coreV1Api . listNamespace ( PRETTY , ALLOW_WATCH_BOOKMARKS , null , null , null , null , RESOURCE_VERSION , TIMEOUT_SECONDS , false ) ; } catch ( ApiException apex ) { getLogger ( ) . severe ( apex . getResponseBody ( ) ) ; throw apex ; } for ( V1Namespace namespace : namespaceList . getItems ( ) ) { nameSpaces . add ( namespace . getMetadata ( ) . getName ( ) ) ; } return nameSpaces ; }
List namespaces in the Kubernetes cluster.
List namespaces in the Kubernetes cluster .
// pretty print output // allowWatchBookmarks requests watch events with type "BOOKMARK" // set when retrieving more results from the server // selector to restrict the list of returned objects by their fields // selector to restrict the list of returned objects by their labels // maximum number of responses to return for a list call // shows changes that occur after that particular version of a resource // Timeout for the list/watch call // Watch for changes to the described resources