Examples of ComputeService


Examples of org.jclouds.compute.ComputeService

                builder = builder.name(id).credentials(identity, credential).overrides(props);

                ComputeServiceContext context = builder.build(ComputeServiceContext.class);

                ComputeService service = null;

                if (enableEventSupport) {
                    service = new ComputeServiceEventProxy(bundleContext, context.getComputeService());
                } else {
                    service = context.getComputeService();
View Full Code Here

Examples of org.jclouds.compute.ComputeService

      Properties properties = new Properties();
      properties.setProperty("oauth.identity", "MOMMA");
      properties.setProperty("oauth.credential", "MiA");

      ComputeService client = requestsSendResponses(ImmutableMap.<HttpRequest, HttpResponse>of(), createModule(),
              properties);
      Template template = client.templateBuilder().build();
      Template toMatch = client.templateBuilder().imageId(template.getImage().getId()).build();
      assertEquals(toMatch.getImage(), template.getImage());
   }
View Full Code Here

Examples of org.jclouds.compute.ComputeService

              .put(LIST_PROJECT_IMAGES_REQUEST, LIST_PROJECT_IMAGES_RESPONSE)
              .put(LIST_GOOGLE_IMAGES_REQUEST, LIST_GOOGLE_IMAGES_RESPONSE)
              .put(LIST_MACHINE_TYPES_REQUEST, LIST_MACHINE_TYPES_RESPONSE)
              .build();

      ComputeService client = requestsSendResponses(requestResponseMap);
      Template template = client.templateBuilder().build();
      Template toMatch = client.templateBuilder().imageId(template.getImage().getId()).build();
      assertEquals(toMatch.getImage(), template.getImage());
   }
View Full Code Here

Examples of org.jclouds.compute.ComputeService

              .add(GET_OPERATION_RESPONSE)
              .add(SUCESSFULL_OPERATION_RESPONSE)
              .add(GET_OPERATION_RESPONSE)
              .build();

      ComputeService client = orderedRequestsSendResponses(orderedRequests, orderedResponses);
      client.destroyNode("test-delete-networks");

   }
View Full Code Here

Examples of org.jclouds.compute.ComputeService

              .put(LIST_PROJECT_IMAGES_REQUEST, LIST_PROJECT_IMAGES_RESPONSE)
              .put(LIST_GOOGLE_IMAGES_REQUEST, LIST_GOOGLE_IMAGES_RESPONSE)
              .put(LIST_MACHINE_TYPES_REQUEST, LIST_MACHINE_TYPES_RESPONSE)
              .build();

      ComputeService apiWhenServersExist = requestsSendResponses(requestResponseMap);

      Set<? extends Location> locations = apiWhenServersExist.listAssignableLocations();

      assertNotNull(locations);
      assertEquals(locations.size(), 2);
      assertEquals(locations.iterator().next().getId(), "us-central1-a");

      assertNotNull(apiWhenServersExist.listNodes());
      assertEquals(apiWhenServersExist.listNodes().size(), 1);
      assertEquals(apiWhenServersExist.listNodes().iterator().next().getId(), "test-0");
      assertEquals(apiWhenServersExist.listNodes().iterator().next().getName(), "test-0");
   }
View Full Code Here

Examples of org.jclouds.compute.ComputeService

              .add(LIST_ZONES_RESPONSE)
              .add(LIST_MACHINE_TYPES_RESPONSE)
              .build();


      ComputeService computeService = orderedRequestsSendResponses(orderedRequests, orderedResponses);

      GoogleComputeEngineTemplateOptions options = computeService.templateOptions().as(GoogleComputeEngineTemplateOptions.class);

      getOnlyElement(computeService.createNodesInGroup("test", 1, options));
   }
View Full Code Here

Examples of org.jclouds.compute.ComputeService

      Set<? extends NodeMetadata> deadNodesGroup2 = (Set) ImmutableSet.builder()
              .add(new IdAndGroupOnlyNodeMetadata("b", "2", NodeMetadata.Status.TERMINATED)).build();

      Set<? extends NodeMetadata> allDeadNodes = Sets.union(deadNodesGroup1, deadNodesGroup2);

      ComputeService mock = createMock(ComputeService.class);
      expect(mock.listNodesDetailsMatching(EasyMock.<Predicate<ComputeMetadata>>anyObject()))
              .andReturn((Set) deadNodesGroup1).once();
      expect(mock.listNodesDetailsMatching(EasyMock.<Predicate<ComputeMetadata>>anyObject()))
              .andReturn((Set) deadNodesGroup2).once();

      replay(mock);

      OrphanedGroupsFromDeadNodes orphanedGroupsFromDeadNodes = new OrphanedGroupsFromDeadNodes(new
View Full Code Here

Examples of org.jclouds.compute.ComputeService

      Set<? extends NodeMetadata> deadNodesGroup2 = (Set) ImmutableSet.builder()
              .add(new IdAndGroupOnlyNodeMetadata("b", "2", NodeMetadata.Status.TERMINATED)).build();

      Set<? extends NodeMetadata> allDeadNodes = Sets.union(deadNodesGroup1, deadNodesGroup2);

      ComputeService mock = createMock(ComputeService.class);
      expect(mock.listNodesDetailsMatching(EasyMock.<Predicate<ComputeMetadata>>anyObject()))
              .andReturn((Set) deadNodesGroup1).once();
      expect(mock.listNodesDetailsMatching(EasyMock.<Predicate<ComputeMetadata>>anyObject()))
              .andReturn((Set) ImmutableSet.of()).once();

      replay(mock);

      OrphanedGroupsFromDeadNodes orphanedGroupsFromDeadNodes = new OrphanedGroupsFromDeadNodes(new
View Full Code Here

Examples of org.jclouds.compute.ComputeService

      Set<? extends NodeMetadata> deadNodesGroup2 = (Set) ImmutableSet.builder()
              .add(new IdAndGroupOnlyNodeMetadata("b", "2", NodeMetadata.Status.RUNNING)).build();

      Set<? extends NodeMetadata> allDeadNodes = Sets.union(deadNodesGroup1, deadNodesGroup2);

      ComputeService mock = createMock(ComputeService.class);
      expect(mock.listNodesDetailsMatching(EasyMock.<Predicate<ComputeMetadata>>anyObject()))
              .andReturn((Set) deadNodesGroup1).once();
      expect(mock.listNodesDetailsMatching(EasyMock.<Predicate<ComputeMetadata>>anyObject()))
              .andReturn((Set) deadNodesGroup2).once();

      replay(mock);

      OrphanedGroupsFromDeadNodes orphanedGroupsFromDeadNodes = new OrphanedGroupsFromDeadNodes(new
View Full Code Here

Examples of org.jclouds.compute.ComputeService

                throw new Exception("Invalid Endpoint URI. It should contains a valid provider name");
            }
        } else if (JcloudsConstants.COMPUTE.endsWith(endpointType)) {
            if (uriParts.length >= 2) {
                String provider = uriParts[1];
                ComputeService computeService = getComputeServiceForProvider(provider);
                endpoint = new JcloudsComputeEndpoint(uri, this, computeService);
            } else {
                throw new Exception("Invalid Endpoint URI. It should contains a valid provider name");
            }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.