Package org.jclouds.joyent.cloudapi.v6_5.domain.datacenterscoped

Examples of org.jclouds.joyent.cloudapi.v6_5.domain.datacenterscoped.MachineInDatacenter


      for (String datacenterId : cloudApiContext.getApi().getConfiguredDatacenters()) {
         DatasetApi api = cloudApiContext.getApi().getDatasetApiForDatacenter(datacenterId);
         Set<Dataset> response = api.list();
         assert null != response;
         for (Dataset dataset : response) {
            Dataset newDetails = api.get(dataset.getId());
            assertEquals(newDetails.getId(), dataset.getId());
            assertEquals(newDetails.getName(), dataset.getName());
            assertEquals(newDetails.getType(), dataset.getType());
            assertEquals(newDetails.getVersion(), dataset.getVersion());
            assertEquals(newDetails.getUrn(), dataset.getUrn());
            assertEquals(newDetails.getCreated(), dataset.getCreated());
            assertEquals(newDetails.isDefault(), dataset.isDefault());
         }
      }
   }
View Full Code Here


@Test(testName = "DatasetToOperatingSystemTest")
public class DatasetToOperatingSystemTest {

   public void testCentos6() {

      Dataset datasetToConvert = new ParseDatasetTest().expected();

      OperatingSystem convertedOs = new DatasetToOperatingSystem(ImmutableMap.<OsFamily, Map<String, String>> of(
            OsFamily.CENTOS, ImmutableMap.of("6", "6.0"))).apply(datasetToConvert);

      assertEquals(convertedOs.getName(), datasetToConvert.getName());
      assertEquals(convertedOs.getFamily(), OsFamily.CENTOS);
      assertEquals(convertedOs.getDescription(), datasetToConvert.getUrn());
      assertEquals(convertedOs.getVersion(), "6.0");
      assertEquals(convertedOs.getArch(), null);
      assertTrue(convertedOs.is64Bit());
   }
View Full Code Here

            return keyPair;
         }

      };
      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);
View Full Code Here

      String publicKey = keyPair.get("public");
      String privateKey = keyPair.get("private");

      logger.debug(">> creating key datacenter(%s) prefix(%s)", datacenterId, prefix);

      Key key = null;
      while (key == null) {
         String name = namingConvention.createWithoutPrefix().uniqueNameForGroup(prefix);
         try {
            key = cloudApiApi.getKeyApi().create(Key.builder().name(name).key(publicKey).build());
         } catch (IllegalStateException e) {
            logger.trace("error creating keypair named %s, %s", name, e.getMessage());
         }
      }

      logger.debug("<< created key(%s)", key.getName());
      return KeyAndPrivateKey.fromKeyAndPrivateKey(key, privateKey);
   }
View Full Code Here

   public void testListAndGetKeys() throws Exception {
      KeyApi api = cloudApiContext.getApi().getKeyApi();
      Set<Key> response = api.list();
      assert null != response;
      for (Key key : response) {
         Key newDetails = api.get(key.getName());
         assertEquals(newDetails.getName(), key.getName());
         assertEquals(newDetails.get(), key.get());
         assertEquals(newDetails.getCreated(), key.getCreated());
      }

   }
View Full Code Here

   }

   public void testCreateKey() {
      KeyApi api = cloudApiContext.getApi().getKeyApi();

      Key newKey = api.create(Key.builder().name(fingerprint).key(keyText).build());
      assertEquals(newKey.getName(), fingerprint);
      assertEquals(newKey.get(), keyText);

      newKey = api.get(fingerprint);
      assertEquals(newKey.getName(), fingerprint);
      assertEquals(newKey.get(), keyText);
   }
View Full Code Here

   public void testListAndGetKeys() throws Exception {
      KeyApi api = cloudApiContext.getApi().getKeyApi();
      Set<Key> response = api.list();
      assert null != response;
      for (Key key : response) {
         Key newDetails = api.get(key.getName());
         assertEquals(newDetails.getName(), key.getName());
         assertEquals(newDetails.get(), key.get());
         assertEquals(newDetails.getCreated(), key.getCreated());
      }

   }
View Full Code Here

   }

   public void testCreateKey() {
      KeyApi api = cloudApiContext.getApi().getKeyApi();

      Key newKey = api.create(Key.builder().name(fingerprint).key(keyText).build());
      assertEquals(newKey.getName(), fingerprint);
      assertEquals(newKey.get(), keyText);

      newKey = api.get(fingerprint);
      assertEquals(newKey.getName(), fingerprint);
      assertEquals(newKey.get(), keyText);
   }
View Full Code Here

            return keyPair;
         }

      };
      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);
View Full Code Here

      String publicKey = keyPair.get("public");
      String privateKey = keyPair.get("private");

      logger.debug(">> creating key datacenter(%s) prefix(%s)", datacenterId, prefix);

      Key key = null;
      while (key == null) {
         String name = namingConvention.createWithoutPrefix().uniqueNameForGroup(prefix);
         try {
            key = cloudApiApi.getKeyApi().create(Key.builder().name(name).key(publicKey).build());
         } catch (IllegalStateException e) {
            logger.trace("error creating keypair named %s, %s", name, e.getMessage());
         }
      }

      logger.debug("<< created key(%s)", key.getName());
      return KeyAndPrivateKey.fromKeyAndPrivateKey(key, privateKey);
   }
View Full Code Here

TOP

Related Classes of org.jclouds.joyent.cloudapi.v6_5.domain.datacenterscoped.MachineInDatacenter

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.