use of com.vmware.pbm.PbmProfileResourceType in project photon-model by vmware.
the class EnumerationClient method retrieveStoragePolicies.
/**
* Retrieve the list of storage profiles from the server.
*/
public List<PbmProfile> retrieveStoragePolicies() throws com.vmware.pbm.RuntimeFaultFaultMsg, InvalidArgumentFaultMsg {
// 1 Get PBM Profile Manager
ManagedObjectReference profileMgr = this.connection.getPbmServiceInstanceContent().getProfileManager();
// 2 Retrieve the list of profile identifiers.
PbmProfileResourceType pbmProfileResourceType = new PbmProfileResourceType();
pbmProfileResourceType.setResourceType(PbmProfileResourceTypeEnum.STORAGE.value());
List<PbmProfileId> profileIds = this.connection.getPbmPort().pbmQueryProfile(profileMgr, pbmProfileResourceType, null);
// 3 Retrieve the list of storage profiles.
if (profileIds != null && !profileIds.isEmpty()) {
return this.connection.getPbmPort().pbmRetrieveContent(profileMgr, profileIds);
}
return new ArrayList<>();
}
Aggregations