use of com.emc.storageos.model.network.WwnAliasesParam in project coprhd-controller by CoprHD.
the class NetworkSystemService method getAliases.
/**
* Returns a list of aliases for the specified network system. For Brocade, aliases
* can be retrieved per fabric only and fabric-id is a required parameter. For MDS,
* the full list of device aliases for the network system is returned and fabric-id is
* ignored if provided.
*
* 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.
* @param fabricId The name of the fabric as returned by
* /vdc/network-systems/{id}/san-fabrics or the WWN of the fabric
* @prereq none
* @brief List aliases in a network system or a fabric
* @return A list of aliases.
* @throws InternalException
*/
@GET
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@Path("/{id}/san-aliases")
@CheckPermission(roles = { Role.SYSTEM_ADMIN })
public WwnAliasesParam getAliases(@PathParam("id") URI id, @QueryParam("fabric-id") String fabricId) throws InternalException {
ArgValidator.checkFieldUriType(id, NetworkSystem.class, "id");
NetworkSystem device = queryResource(id);
if (Type.brocade.toString().equals(device.getSystemType())) {
ArgValidator.checkFieldNotEmpty(fabricId, "fabric-id");
}
String fabricWwn = null;
if (WWNUtility.isValidWWN(fabricId)) {
fabricWwn = fabricId;
fabricId = fabricId.replaceAll(":", "");
}
NetworkController controller = getNetworkController(device.getSystemType());
List<WwnAliasParam> aliases = new ArrayList<WwnAliasParam>(controller.getAliases(device.getId(), fabricId, fabricWwn));
return new WwnAliasesParam(aliases);
}
use of com.emc.storageos.model.network.WwnAliasesParam in project coprhd-controller by CoprHD.
the class NetworkSystems method getAliases.
/**
* Gets the list of WWN Aliases in the given network system by ID and fabric name.
* <p>
* API Call: <tt>GET {@value PathConstants#SAN_ALIAS_URL}[?fabric-id={fabric}]</tt>
*
* @param id
* the ID of the network system.
* @param fabric
* the name of the fabric, or {@code null} if there is no fabric.
* @return the list of WWN Aliases.
*/
public List<? extends WwnAliasParam> getAliases(URI id, String fabric) {
UriBuilder builder = client.uriBuilder(PathConstants.SAN_ALIAS_URL);
if (fabric != null) {
builder.queryParam("fabric-id", fabric);
}
WwnAliasesParam response = client.getURI(WwnAliasesParam.class, builder.build(id));
return defaultList(response.getAliases());
}
Aggregations