Search in sources :

Example 1 with FCEndpoints

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

the class NetworkSystems method getFCEndpoints.

/**
 * Gets the list of FC endpoints in the given network system by ID.
 * <p>
 * API Call: <tt>GET {@value PathConstants#FC_ENDPOINT_URL}[?fabric-id={fabric-id}]</tt>
 *
 * @param id
 *            the ID of the network system.
 * @param fabricId
 *            the fabric ID, or {@code null} if there is no fabric.
 * @return the list of FC endpoints.
 */
public List<FCEndpointRestRep> getFCEndpoints(URI id, String fabricId) {
    UriBuilder builder = client.uriBuilder(PathConstants.FC_ENDPOINT_URL);
    if (fabricId != null) {
        builder.queryParam("fabric-id", fabricId);
    }
    FCEndpoints response = client.getURI(FCEndpoints.class, builder.build(id));
    return defaultList(response.getConnections());
}
Also used : FCEndpoints(com.emc.storageos.model.network.FCEndpoints) UriBuilder(javax.ws.rs.core.UriBuilder)

Example 2 with FCEndpoints

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

the class NetworkSystemService method getFCEndpointsByFabric.

/**
 * This returns the cached fiber channel connectivity information of a given fabric id
 * between the network system and external systems, such as host initiators or storage array ports.
 * If fabric id is not specified, get all connections of the network system.
 * The connectivity information is periodically updated, or can be refreshed on demand
 * using a POST /vdc/network-systems/{id}/refresh.
 *
 * @prereq none
 * @param id the URN of a ViPR Network System
 * @param fabricId The name of the VSAN or fabric as returned by /vdc/network-systems/{id}/san-fabrics
 *            or the VSAN or fabric WWN
 * @brief List network system fiber channel connectivity
 * @return A list of FCEndpoint structures, each containing information about one connection.
 */
@GET
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@Path("/{id}/fc-endpoints/")
@CheckPermission(roles = { Role.SYSTEM_ADMIN, Role.SYSTEM_MONITOR })
public FCEndpoints getFCEndpointsByFabric(@PathParam("id") URI id, @QueryParam("fabric-id") String fabricId) {
    FCEndpoints connections = new FCEndpoints();
    ArgValidator.checkFieldUriType(id, NetworkSystem.class, "id");
    if (WWNUtility.isValidWWN(fabricId)) {
        fabricId = fabricId.replaceAll(":", "");
    }
    NetworkSystem device = queryResource(id);
    List<URI> uriList = _dbClient.queryByConstraint(ContainmentConstraint.Factory.getNetworkSystemFCPortConnectionConstraint(device.getId()));
    connections.setConnections(getFCEndPointRestReps(uriList, fabricId));
    return connections;
}
Also used : FCEndpoints(com.emc.storageos.model.network.FCEndpoints) NetworkSystem(com.emc.storageos.db.client.model.NetworkSystem) MapNetworkSystem(com.emc.storageos.api.mapper.functions.MapNetworkSystem) URI(java.net.URI) Path(javax.ws.rs.Path) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET) CheckPermission(com.emc.storageos.security.authorization.CheckPermission)

Aggregations

FCEndpoints (com.emc.storageos.model.network.FCEndpoints)2 MapNetworkSystem (com.emc.storageos.api.mapper.functions.MapNetworkSystem)1 NetworkSystem (com.emc.storageos.db.client.model.NetworkSystem)1 CheckPermission (com.emc.storageos.security.authorization.CheckPermission)1 URI (java.net.URI)1 GET (javax.ws.rs.GET)1 Path (javax.ws.rs.Path)1 Produces (javax.ws.rs.Produces)1 UriBuilder (javax.ws.rs.core.UriBuilder)1