Search in sources :

Example 1 with Fabrics

use of com.emc.storageos.model.network.Fabrics in project coprhd-controller by CoprHD.

the class NetworkSystemService method getFabrics.

/**
 * Returns a list of the VSAN or fabric names configured on this network system.
 * Note: This is a synchronous call to the device and may take a while to receive a response.
 *
 * @param id the URN of a ViPR network system.
 * @prereq none
 * @brief List network system VSANs and fabrics
 * @return A list of fabric names configured on the Network System.
 * @throws InternalException
 */
@GET
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@Path("/{id}/san-fabrics")
@CheckPermission(roles = { Role.SYSTEM_ADMIN, Role.SYSTEM_MONITOR })
public Fabrics getFabrics(@PathParam("id") URI id) throws InternalException {
    Fabrics fabrics = new Fabrics();
    ArgValidator.checkFieldUriType(id, NetworkSystem.class, "id");
    NetworkSystem device = queryResource(id);
    NetworkController controller = getNetworkController(device.getSystemType());
    List<String> fabricIds = controller.getFabricIds(device.getId());
    fabrics.setFabricIds(fabricIds);
    return fabrics;
}
Also used : NetworkSystem(com.emc.storageos.db.client.model.NetworkSystem) MapNetworkSystem(com.emc.storageos.api.mapper.functions.MapNetworkSystem) Fabrics(com.emc.storageos.model.network.Fabrics) NetworkController(com.emc.storageos.networkcontroller.NetworkController) Path(javax.ws.rs.Path) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET) CheckPermission(com.emc.storageos.security.authorization.CheckPermission)

Aggregations

MapNetworkSystem (com.emc.storageos.api.mapper.functions.MapNetworkSystem)1 NetworkSystem (com.emc.storageos.db.client.model.NetworkSystem)1 Fabrics (com.emc.storageos.model.network.Fabrics)1 NetworkController (com.emc.storageos.networkcontroller.NetworkController)1 CheckPermission (com.emc.storageos.security.authorization.CheckPermission)1 GET (javax.ws.rs.GET)1 Path (javax.ws.rs.Path)1 Produces (javax.ws.rs.Produces)1