Package org.jclouds.googlecomputeengine.domain

Examples of org.jclouds.googlecomputeengine.domain.Project$Builder


      return MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.create(authException,
              compose(new Function<Credentials, String>() {
                 public String apply(Credentials in) {
                    checkState(in.identity.indexOf("@") != 1,
                            "identity should be in project_id@developer.gserviceaccount.com format");
                    Project project = api.getProjectApi().get(Iterables.get(Splitter.on("@").split(in.identity), 0));
                    return project.getName();
                 }
              }, creds), seconds, TimeUnit.SECONDS);
   }
View Full Code Here


      assertNotNull(project.getName());
   }

   @Test(groups = "live")
   public void testGetProjectWhenNotExists() {
      Project project = projectApi().get("momma");
      assertNull(project);
   }
View Full Code Here

    * <p/>
    * Beyond it's use here it is also used as a cheap way of generating Operations to both test the OperationApi and
    * the pagination system.
    */
   public static Operation addItemToMetadata(ProjectApi projectApi, String projectName, String key, String value) {
      Project project = projectApi.get(projectName);
      assertNotNull(project);
      ImmutableMap.Builder<String, String> metadataBuilder = ImmutableMap.builder();
      metadataBuilder.putAll(project.getCommonInstanceMetadata());
      metadataBuilder.put(key, value);
      return projectApi.setCommonInstanceMetadata(projectName, metadataBuilder.build());
   }
View Full Code Here

    * <p/>
    * Beyond it's use here it is also used as a cheap way of generating Operation's to both test the OperationApi and
    * the pagination system.
    */
   public static Operation deleteItemFromMetadata(ProjectApi projectApi, String projectName, String key) {
      Project project = projectApi.get(projectName);
      assertNotNull(project);
      ImmutableMap.Builder<String, String> metadataBuilder = ImmutableMap.builder();
      metadataBuilder.putAll(Maps.filterKeys(project.getCommonInstanceMetadata(), not(equalTo(key))));
      return projectApi.setCommonInstanceMetadata(projectName, metadataBuilder.build());
   }
View Full Code Here

      assertNotNull(project.getName());
   }

   @Test(groups = "live")
   public void testGetProjectWhenNotExists() {
      Project project = projectApi().get("momma");
      assertNull(project);
   }
View Full Code Here

    * <p/>
    * Beyond it's use here it is also used as a cheap way of generating Operations to both test the OperationApi and
    * the pagination system.
    */
   public static Operation addItemToMetadata(ProjectApi projectApi, String projectName, String key, String value) {
      Project project = projectApi.get(projectName);
      assertNotNull(project);
      ImmutableMap.Builder<String, String> metadataBuilder = ImmutableMap.builder();
      metadataBuilder.putAll(project.getCommonInstanceMetadata().getItems());
      metadataBuilder.put(key, value);
      return projectApi.setCommonInstanceMetadata(projectName, metadataBuilder.build(),
              project.getCommonInstanceMetadata().getFingerprint());
   }
View Full Code Here

    * <p/>
    * Beyond it's use here it is also used as a cheap way of generating Operation's to both test the OperationApi and
    * the pagination system.
    */
   public static Operation deleteItemFromMetadata(ProjectApi projectApi, String projectName, String key) {
      Project project = projectApi.get(projectName);
      assertNotNull(project);
      ImmutableMap.Builder<String, String> metadataBuilder = ImmutableMap.builder();
      metadataBuilder.putAll(Maps.filterKeys(project.getCommonInstanceMetadata().getItems(), not(equalTo(key))));
      return projectApi.setCommonInstanceMetadata(projectName, metadataBuilder.build(),
              project.getCommonInstanceMetadata().getFingerprint());
   }
View Full Code Here

      return api.getDiskApiForProject(userProject.get());
   }

   @Test(groups = "live")
   public void testInsertDisk() {
      Project project = api.getProjectApi().get(userProject.get());
      assertZoneOperationDoneSucessfully(api().createInZone(DISK_NAME, sizeGb, DEFAULT_ZONE_NAME), TIME_WAIT);

   }
View Full Code Here

                       if (projectName.indexOf("-") != -1) {
                          // if ID is of the form project_id-extended_uid@developer.gserviceaccount.com
                          projectName = Iterables.get(Splitter.on("-").split(projectName), 0);
                       }
                    }
                    Project project = api.getProjectApi().get(projectName);
                    return project.getName();
                 }
              }, creds), seconds, TimeUnit.SECONDS);
   }
View Full Code Here

TOP

Related Classes of org.jclouds.googlecomputeengine.domain.Project$Builder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.