use of com.emc.storageos.model.object.ObjectNamespaceRestRep in project coprhd-controller by CoprHD.
the class ObjectNamespaceService method getObjectNamespace.
/**
* Get details of the object storage namespace specified
*
* @param id object storage namespace id
* @brief Show details for a namespace
* @return details of the namespace
*/
@GET
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@Path("/{id}")
@CheckPermission(roles = { Role.SYSTEM_ADMIN, Role.SYSTEM_MONITOR, Role.TENANT_ADMIN, Role.SECURITY_ADMIN })
public ObjectNamespaceRestRep getObjectNamespace(@PathParam("id") URI id) {
_log.info("Getting details for the namespace: {}", id);
ArgValidator.checkFieldUriType(id, ObjectNamespace.class, "id");
ArgValidator.checkUri(id);
ObjectNamespace objNamespace = _dbClient.queryObject(ObjectNamespace.class, id);
ArgValidator.checkEntity(objNamespace, id, isIdEmbeddedInURL(id));
ObjectNamespaceRestRep restRep = toObjectNamespaceRestRep(objNamespace, _dbClient, _coordinator);
return restRep;
}
use of com.emc.storageos.model.object.ObjectNamespaceRestRep in project coprhd-controller by CoprHD.
the class TenantUtils method getUnmappedNamespace.
public static List<StringOption> getUnmappedNamespace() {
ObjectNamespaceList objNamespaceList = getViprClient().objectNamespace().getObjectNamespaces();
List<StringOption> namespaceOptions = Lists.newArrayList();
List<NamedRelatedResourceRep> ObjNamedList = objNamespaceList.getNamespaces();
for (NamedRelatedResourceRep namedRes : ObjNamedList) {
URI uri = namedRes.getId();
ObjectNamespaceRestRep objNs = getViprClient().objectNamespace().getObjectNamespace(uri);
if (objNs != null && objNs.getMapped() == false) {
// only unmapped namespaces to be added to list
namespaceOptions.add(new StringOption(objNs.getNativeId(), objNs.getNsName()));
}
}
return namespaceOptions;
}
use of com.emc.storageos.model.object.ObjectNamespaceRestRep in project coprhd-controller by CoprHD.
the class SystemsMapper method map.
public static ObjectNamespaceRestRep map(ObjectNamespace from) {
if (from == null) {
return null;
}
ObjectNamespaceRestRep to = new ObjectNamespaceRestRep();
to.setNsName(from.getNsName());
to.setNativeId(from.getNativeId());
to.setMapped(from.getMapped());
to.setTenant(from.getTenant());
to.setStorageDevice(from.getStorageDevice());
return to;
}
Aggregations