Search in sources :

Example 1 with XtremIOTagsInfo

use of com.emc.storageos.xtremio.restapi.model.response.XtremIOTagsInfo in project coprhd-controller by CoprHD.

the class XtremIOV2Client method getTagNames.

@Override
public List<String> getTagNames(String clusterName) throws Exception {
    // No need to throw exception if we are not able to get tag names.
    List<String> tagNames = new ArrayList<String>();
    try {
        ClientResponse response = get(XtremIOConstants.XTREMIO_V2_TAGS_URI);
        XtremIOTagsInfo responseObjs = getResponseObject(XtremIOTagsInfo.class, response);
        for (XtremIOObjectInfo objectInfo : responseObjs.getTagsInfo()) {
            tagNames.add(objectInfo.getName());
        }
    } catch (Exception ex) {
        log.warn("Error getting tag names", ex.getMessage());
        log.info("Ignoring this as we again check if the tag is present before creating a new tag");
    }
    return tagNames;
}
Also used : ClientResponse(com.sun.jersey.api.client.ClientResponse) ArrayList(java.util.ArrayList) XtremIOObjectInfo(com.emc.storageos.xtremio.restapi.model.response.XtremIOObjectInfo) XtremIOApiException(com.emc.storageos.xtremio.restapi.errorhandling.XtremIOApiException) XtremIOTagsInfo(com.emc.storageos.xtremio.restapi.model.response.XtremIOTagsInfo)

Aggregations

XtremIOApiException (com.emc.storageos.xtremio.restapi.errorhandling.XtremIOApiException)1 XtremIOObjectInfo (com.emc.storageos.xtremio.restapi.model.response.XtremIOObjectInfo)1 XtremIOTagsInfo (com.emc.storageos.xtremio.restapi.model.response.XtremIOTagsInfo)1 ClientResponse (com.sun.jersey.api.client.ClientResponse)1 ArrayList (java.util.ArrayList)1