Examples of create()


Examples of org.jclouds.abiquo.AbiquoFallbacks.PropagateAbiquoExceptionOnNotFoundOr4xx.create()

   public void testOriginalExceptionIfNotResourceNotFound() {
      PropagateAbiquoExceptionOnNotFoundOr4xx function = new PropagateAbiquoExceptionOnNotFoundOr4xx();
      RuntimeException exception = new RuntimeException();

      try {
         function.create(exception);
      } catch (Exception ex) {
         assertEquals(ex, exception);
      }
   }

Examples of org.jclouds.glesys.features.DomainApi.create()

   }

   protected void createDomain(String domain) {
      final DomainApi domainApi = api.getDomainApi();
      int before = domainApi.list().size();
      domainApi.create(domain);

      Predicate<Integer> result = retry(new Predicate<Integer>() {
         public boolean apply(Integer value) {
            return domainApi.list().size() == value.intValue();
         }

Examples of org.jclouds.http.functions.ParseSax.Factory.create()

 
   public void test() {
      InputStream is = getClass().getResourceAsStream("/firewallService.xml");
      Injector injector = Guice.createInjector(new SaxParserModule());
      Factory factory = injector.getInstance(ParseSax.Factory.class);
      FirewallService result = factory.create(injector.getInstance(FirewallServiceHandler.class)).parse(is);
      assertEquals(result.isEnabled(), false);
      assertEquals(
            result.getFirewallRules(),
            ImmutableSet.<FirewallRule> of(
                FirewallRule.builder().firewallType("SERVER_TIER_FIREWALL").isEnabled(false).source("internet")

Examples of org.jclouds.joyent.cloudapi.v6_5.features.KeyApi.create()

      KeyApi keyApi = createMock(KeyApi.class);
      Key key = Key.builder().name("group-foo").key(keyPair.get("public")).build();

      expect(cloudApiApi.getKeyApi()).andReturn(keyApi);

      expect(keyApi.create(key)).andReturn(key);

      replay(cloudApiApi, keyApi);

      CreateUniqueKey parser = new CreateUniqueKey(cloudApiApi, namingConvention, sshKeyPairGenerator);

Examples of org.jclouds.openstack.keystone.v2_0.extensions.TenantAdminApi.create()

         System.out.format("    TenantAdminApi is present%n");

         TenantAdminApi tenantAdminApi = tenantAdminApiExtension.get();
         CreateTenantOptions tenantOptions = CreateTenantOptions.Builder
               .description("My New Tenant");
         Tenant tenant = tenantAdminApi.create("newTenant", tenantOptions);

         System.out.format("    %s%n", tenant);

         return tenant;
      } else {

Examples of org.jclouds.openstack.keystone.v2_0.extensions.UserAdminApi.create()

         UserAdminApi userAdminApi = userAdminApiExtension.get();
         CreateUserOptions userOptions = CreateUserOptions.Builder
               .tenant(tenant.getId())
               .email("new.email@example.com");
         User user = userAdminApi.create("newUser", "newPassword", userOptions);

         System.out.format("    %s%n", user);
      } else {
         System.out.format("    UserAdminApi is *not* present%n");
         System.exit(1);

Examples of org.jclouds.openstack.marconi.v1.features.MessageApi.create()

            CreateMessage createMessage = CreateMessage.builder().ttl(300).body(bodyBuilder.toString()).build();
            createMessages.add(createMessage);
         }

         messageApi.create(createMessages);

         System.out.format("  Created %d messages%n", createMessages.size());

         createMessages.clear();
      }

Examples of org.jclouds.openstack.neutron.v2.extensions.RouterApi.create()

         Router.CreateOptions createRouter = Router.createOptions().name("another_router").adminStateUp(true)
               .externalGatewayInfo(ExternalGatewayInfo.builder().networkId("8ca37218-28ff-41cb-9b10-039601ea7e6b").build())
               .build();

         Router router = api.create(createRouter);

         /*
          * Check request
          */
         assertAuthentication(server);

Examples of org.jclouds.openstack.neutron.v2_0.features.NetworkApi.create()

      for (String zone : api.getConfiguredZones()) {
         RouterApi routerApi = api.getRouterExtensionForZone(zone).get();
         NetworkApi networkApi = api.getNetworkApiForZone(zone);
         SubnetApi subnetApi = api.getSubnetApiForZone(zone);

         Network network = networkApi.create(CreateNetworkOptions.builder().name("jclouds-network-test").external(true).networkType(NetworkType.LOCAL).build());
         assertNotNull(network);

         Subnet subnet = subnetApi.create(network.getId(), 4, "192.168.0.0/16");
         assertNotNull(subnet);

Examples of org.jclouds.openstack.neutron.v2_0.features.PortApi.create()

         assertNotNull(network2);

         Subnet subnet2 = subnetApi.create(network2.getId(), 4, "192.169.0.0/16");
         assertNotNull(subnet2);

         Port port = portApi.create(network.getId());
         assertNotNull(port);

         Port port2 = portApi.create(network2.getId());
         assertNotNull(port2);
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.