use of com.emc.ecs.management.entity.ListNamespacesResult in project ecs-dashboard by carone1.
the class NamespaceBO method getNamespaces.
/**
* Gathers all namespaces present on a cluster
*
* @return List - List of namespace
*/
public List<Namespace> getNamespaces() {
List<Namespace> namespaceList = new ArrayList<Namespace>();
ListNamespaceRequest listNamespaceRequest = new ListNamespaceRequest();
// first batch
ListNamespacesResult namespacesResult = client.listNamespaces(listNamespaceRequest);
namespaceList.addAll(namespacesResult.getNamespaces());
// n subsequent batches
while (namespacesResult.getNextMarker() != null) {
listNamespaceRequest.setNextMarker(namespacesResult.getNextMarker());
namespacesResult = client.listNamespaces(listNamespaceRequest);
if (namespacesResult.getNamespaces() != null) {
namespaceList.addAll(namespacesResult.getNamespaces());
}
}
return namespaceList;
}
use of com.emc.ecs.management.entity.ListNamespacesResult in project ecs-dashboard by carone1.
the class BillingBO method getNamespaces.
/**
* Gathers all namespaces present on a cluster
* @return List - List of namespace
*/
public List<Namespace> getNamespaces() {
// Start collecting billing data from ECS systems
List<Namespace> namespaceList = new ArrayList<Namespace>();
// collect namespace names
ListNamespaceRequest listNamespaceRequest = new ListNamespaceRequest();
// first batch
ListNamespacesResult namespacesResult = client.listNamespaces(listNamespaceRequest);
namespaceList.addAll(namespacesResult.getNamespaces());
// n subsequent batches
while (namespacesResult.getNextMarker() != null) {
listNamespaceRequest.setNextMarker(namespacesResult.getNextMarker());
namespacesResult = client.listNamespaces(listNamespaceRequest);
if (namespacesResult.getNamespaces() != null) {
namespaceList.addAll(namespacesResult.getNamespaces());
}
}
return namespaceList;
}
use of com.emc.ecs.management.entity.ListNamespacesResult in project ecs-dashboard by carone1.
the class ManagementClient method listNamespaces.
// ================================
// Public Methods
// ================================
/**
* lists namespaces
* @param namespaceRequest - namespace request
* @return ListNamespacesResult
*/
public ListNamespacesResult listNamespaces(ListNamespaceRequest namespaceRequest) {
String authToken = getAuthToken();
WebResource mgmtResource = this.mgmtClient.resource(uri);
// list namespaces
WebResource listNamespacesResource = mgmtResource.path(REST_LIST_NAMESPACES);
if (namespaceRequest.getNextMarker() != null) {
listNamespacesResource = listNamespacesResource.queryParam(REST_MARKER_PARAMETER, namespaceRequest.getNextMarker());
}
ListNamespacesResult listNamespacetResponse = listNamespacesResource.header(X_SDS_AUTH_TOKEN, authToken).get(ListNamespacesResult.class);
return listNamespacetResponse;
}
Aggregations