コード例 #1
0
 @FlashException("list")
 public static void detachStorage(@As(",") String[] ids) {
   for (URI id : ResourceUtils.uris(ids)) {
     VCenterUtils.detachStorage(id);
   }
   flash.success(MessagesUtils.get(DETACH_STORAGE));
   list();
 }
コード例 #2
0
 @FlashException("list")
 public static void delete(@As(",") String[] ids, boolean detachStorage) {
   for (URI id : ResourceUtils.uris(ids)) {
     VCenterUtils.deactivateVCenter(id, detachStorage);
   }
   flash.success(MessagesUtils.get(DELETED));
   list();
 }
コード例 #3
0
 protected BlockVirtualPoolRestRep doSave() {
   BlockVirtualPoolRestRep virtualPool;
   if (isNew()) {
     BlockVirtualPoolBuilder builder = apply(new BlockVirtualPoolBuilder());
     virtualPool = VirtualPoolUtils.create(builder.getVirtualPool());
     this.id = ResourceUtils.stringId(virtualPool);
   } else {
     BlockVirtualPoolRestRep oldVirtualPool = VirtualPoolUtils.getBlockVirtualPool(id);
     BlockVirtualPoolUpdateBuilder builder =
         apply(new BlockVirtualPoolUpdateBuilder(oldVirtualPool));
     virtualPool = VirtualPoolUtils.update(id, builder.getVirtualPoolUpdate());
     List<NamedRelatedResourceRep> matchingPools =
         VirtualPoolUtils.refreshMatchingPools(virtualPool);
     Logger.info(
         "Refreshed Block Virtual Pool '%s' matching pools: %d",
         virtualPool.getName(), matchingPools.size());
   }
   virtualPool = saveStoragePools(virtualPool);
   return virtualPool;
 }
コード例 #4
0
 /**
  * Lists all authentication providers.
  *
  * <p>API Call: <tt>GET /vdc/admin/authnproviders</tt>
  *
  * @return the list of authentication providers.
  */
 @Override
 public List<NamedRelatedResourceRep> list() {
   AuthnProviderList response = client.get(AuthnProviderList.class, baseUrl);
   return ResourceUtils.defaultList(response.getProviders());
 }
コード例 #5
0
 /**
  * Finds the list of resources in the given project, optionally filtering the results.
  *
  * @param project the project.
  * @param filter the resource filter to apply to the results as they are returned (optional).
  * @return the list of resources.
  */
 public List<T> findByProject(ProjectRestRep project, ResourceFilter<T> filter) {
   return findByProject(ResourceUtils.id(project), filter);
 }
コード例 #6
0
 /**
  * Finds the list of resources in the given project.
  *
  * @param project the project.
  * @return the list of resources.
  */
 public List<T> findByProject(ProjectRestRep project) {
   return findByProject(ResourceUtils.id(project), null);
 }