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());
}
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;
}
Aggregations