use of com.emc.storageos.model.systems.StorageSystemList in project coprhd-controller by CoprHD.
the class StorageSystemService method getStorageSystems.
/**
* Gets the id, name, and self link for all registered storage systems.
*
* @brief List storage systems
* @return A reference to a StorageSystemList.
*/
@GET
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@CheckPermission(roles = { Role.SYSTEM_ADMIN, Role.SYSTEM_MONITOR })
public StorageSystemList getStorageSystems() {
StorageSystemList systemsList = new StorageSystemList();
List<URI> ids = _dbClient.queryByType(StorageSystem.class, true);
Iterator<StorageSystem> iter = _dbClient.queryIterativeObjects(StorageSystem.class, ids);
while (iter.hasNext()) {
systemsList.getStorageSystems().add(toNamedRelatedResource(iter.next()));
}
return systemsList;
}
use of com.emc.storageos.model.systems.StorageSystemList in project coprhd-controller by CoprHD.
the class SMISProviderService method getStorageSystems.
/**
* Allows the user to get the id, name, and self link for all storage
* systems visible to the provider with the passed id.
* <p>
* The method is deprecated. Use /vdc/storage-providers/{id}/storage-systems
*
* @param id the URN of a ViPR SMI-S provider
*
* @brief List SMI-S provider storage systems
* @return A StorageSystemList reference specifying the id, name, and self
* link for the storage systems visible to the provider.
*/
@GET
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@Path("/{id}/storage-systems")
@CheckPermission(roles = { Role.SYSTEM_ADMIN, Role.SYSTEM_MONITOR })
public StorageSystemList getStorageSystems(@PathParam("id") URI id) {
// Validate the provider
ArgValidator.checkFieldUriType(id, StorageProvider.class, "id");
StorageProvider provider = _dbClient.queryObject(StorageProvider.class, id);
ArgValidator.checkEntityNotNull(provider, id, isIdEmbeddedInURL(id));
// Return the list of storage systems for the provider.
StorageSystemList storageSystemsForProvider = new StorageSystemList();
StringSet providerSystemURIStrs = provider.getStorageSystems();
if (providerSystemURIStrs != null) {
for (String providerSystemURIStr : providerSystemURIStrs) {
StorageSystem storageSystem = _dbClient.queryObject(StorageSystem.class, URI.create(providerSystemURIStr));
if (storageSystem != null) {
storageSystemsForProvider.getStorageSystems().add(toNamedRelatedResource(storageSystem));
}
}
}
return storageSystemsForProvider;
}
use of com.emc.storageos.model.systems.StorageSystemList in project coprhd-controller by CoprHD.
the class StorageProviderService method getStorageSystems.
/**
* Allows the user to get the id, name, and self link for all storage
* systems visible to the provider with the passed id.
*
* @param id the URN of a ViPR Storage provider
*
* @brief List Storage provider storage systems
* @return A StorageSystemList reference specifying the id, name, and self
* link for the storage systems visible to the provider.
*/
@GET
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@Path("/{id}/storage-systems")
@CheckPermission(roles = { Role.SYSTEM_ADMIN, Role.SYSTEM_MONITOR })
public StorageSystemList getStorageSystems(@PathParam("id") URI id) {
// Validate the provider
ArgValidator.checkFieldUriType(id, StorageProvider.class, "id");
StorageProvider provider = _dbClient.queryObject(StorageProvider.class, id);
ArgValidator.checkEntityNotNull(provider, id, isIdEmbeddedInURL(id));
// Return the list of storage systems for the provider.
StorageSystemList storageSystemsForProvider = new StorageSystemList();
StringSet providerSystemURIStrs = provider.getStorageSystems();
if (providerSystemURIStrs != null) {
for (String providerSystemURIStr : providerSystemURIStrs) {
StorageSystem storageSystem = _dbClient.queryObject(StorageSystem.class, URI.create(providerSystemURIStr));
if (storageSystem != null) {
storageSystemsForProvider.getStorageSystems().add(toNamedRelatedResource(storageSystem));
}
}
}
return storageSystemsForProvider;
}
use of com.emc.storageos.model.systems.StorageSystemList in project coprhd-controller by CoprHD.
the class ApiTest method updateAllVnxAndVmaxPorts.
/**
* Update the discovered VNX/VMAX storage ports to set the transport zone.
*
* @param provider : Provider.
*/
private void updateAllVnxAndVmaxPorts(SMISProviderRestRep provider) {
StorageSystemList systemList = rZAdmin.path("/vdc/storage-systems").get(StorageSystemList.class);
for (RelatedResourceRep resRep : systemList.getStorageSystems()) {
StorageSystemRestRep system = rZAdmin.path(String.format("/vdc/storage-systems/%s", resRep.getId()).toString()).get(StorageSystemRestRep.class);
if (system.getSystemType().equals(Type.vnxblock.toString()) || system.getSystemType().equals(Type.vmax.toString())) {
// Register all the discovered storage ports .
StoragePortList vnxBlockPortList = rZAdmin.path(String.format("/vdc/storage-systems/%s/storage-ports", system.getId()).toString()).get(StoragePortList.class);
List<NamedRelatedResourceRep> vnxBlockPortURIList = vnxBlockPortList.getPorts();
for (RelatedResourceRep portURI : vnxBlockPortURIList) {
updateStoragePortTZ(resRep.getId(), portURI);
}
}
}
}
Aggregations