use of com.emc.storageos.model.host.vcenter.VcenterList in project coprhd-controller by CoprHD.
the class TenantsService method listVcenters.
/**
* Lists the id and name for all the vCenters that belong to the given tenant organization.
*
* @param id the URN of a ViPR tenant organization
* @prereq none
* @brief List tenant vCenters
* @return a list of hosts that belong to the tenant organization.
* @throws DatabaseException when a DB error occurs
*/
@GET
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@Path("/{id}/vcenters")
public VcenterList listVcenters(@PathParam("id") URI id) throws DatabaseException {
// this call is for validating the tenant Id
getTenantById(id, false);
// check the user permissions for this tenant org
verifyAuthorizedInTenantOrg(id, getUserFromContext());
// get all children vcenters
VcenterList list = new VcenterList();
list.setVcenters(map(ResourceTypeEnum.VCENTER, listChildrenWithAcls(id, Vcenter.class, "label")));
return list;
}
Aggregations