Package org.jclouds.rackspace.clouddns.v1.domain

Examples of org.jclouds.rackspace.clouddns.v1.domain.Domain


            .name("simple-" + JCLOUDS_EXAMPLE)
            .email("simple-jclouds@" + JCLOUDS_EXAMPLE)
            .build();

      Iterable<CreateDomain> createDomains = ImmutableList.of(createDomain);     
      Domain domain = awaitComplete(api, api.getDomainApi().create(createDomains)).iterator().next();
     
      assertEquals(domain.getName(), "simple-" + JCLOUDS_EXAMPLE);
      assertEquals(domain.getEmail(), "simple-jclouds@" + JCLOUDS_EXAMPLE);
     
      testDomains = Maps.newHashMap(testDomains);
      testDomains.put(domain.getName(), domain);
   }  
View Full Code Here


      assertEquals(domains.size(), 1);
   }

   @Test(dependsOnMethods = "testListDomainsWithFilter")
   public void testListSubdomains() throws Exception {
      Domain domain = testDomains.get(JCLOUDS_EXAMPLE);
      Set<Subdomain> subdomains = api.getDomainApi().listSubdomains(domain.getId()).concat().toSet();
      assertEquals(subdomains.size(), 2);
   }
View Full Code Here

      assertEquals(subdomains.size(), 2);
   }

   @Test(dependsOnMethods = "testListSubdomains")
   public void testGetDomain() throws Exception {
      Domain domain = testDomains.get(JCLOUDS_EXAMPLE);
      Domain jclouds = api.getDomainApi().get(domain.getId());

      Thread.sleep(1000);
      Date now = new Date();

      assertTrue(jclouds.getId() > 0);
      assertTrue(jclouds.getAccountId() > 0);
      assertEquals(jclouds.getName(), JCLOUDS_EXAMPLE);
      assertEquals(jclouds.getEmail(), "jclouds1@" + JCLOUDS_EXAMPLE);
      assertEquals(jclouds.getComment().get(), "Hello Domain 1");
      assertEquals(jclouds.getTTL(), 600001);
      assertTrue(jclouds.getCreated().before(now));
      assertTrue(jclouds.getUpdated().before(now));
     
      assertEquals(jclouds.getSubdomains().size(), 2);
     
      Subdomain devjclouds = null;
      Subdomain testjclouds = null;
     
      for (Subdomain subdomain: jclouds.getSubdomains()) {
         if (subdomain.getName().equals("dev." + JCLOUDS_EXAMPLE)) {
            devjclouds = subdomain;
         } else if (subdomain.getName().equals("test." + JCLOUDS_EXAMPLE)) {
            testjclouds = subdomain;
         }
      }
     
      assertTrue(devjclouds.getId() > 0);
      assertEquals(devjclouds.getName(), "dev." + JCLOUDS_EXAMPLE);
      assertEquals(devjclouds.getEmail(), "jclouds@" + JCLOUDS_EXAMPLE);
      assertEquals(devjclouds.getComment().get(), "Hello dev subdomain");
      assertTrue(devjclouds.getCreated().before(now));
      assertTrue(devjclouds.getUpdated().before(now));
     
      assertTrue(testjclouds.getId() > 0);
      assertEquals(testjclouds.getName(), "test." + JCLOUDS_EXAMPLE);
      assertEquals(testjclouds.getEmail(), "jclouds@" + JCLOUDS_EXAMPLE);
      assertEquals(testjclouds.getComment().get(), "Hello test subdomain");
      assertTrue(testjclouds.getCreated().before(now));
      assertTrue(testjclouds.getUpdated().before(now));
     
      assertEquals(jclouds.getRecords().size(), 4); // 2 created above + 2 nameserver (NS) records
     
      RecordDetail mxRecord = null;
      RecordDetail aRecord = null;
      RecordDetail nsRecord = null;
     
      for (RecordDetail record: jclouds.getRecords()) {
         if (record.getType().equals("MX")) {
            mxRecord = record;
         } else if (record.getType().equals("A")) {
            aRecord = record;
         } else if (record.getType().equals("NS")) {
View Full Code Here

            .ttl(600003)
            .comment("Hello Domain Update 3")
            .build();

      awaitComplete(api, api.getDomainApi().update(testDomains.get(JCLOUDS_EXAMPLE).getId(), updateDomain));
      Domain jclouds = api.getDomainApi().get(testDomains.get(JCLOUDS_EXAMPLE).getId());
     
      assertEquals(jclouds.getEmail(), "jclouds3@" + JCLOUDS_EXAMPLE);
      assertEquals(jclouds.getComment().get(), "Hello Domain Update 3");
      assertEquals(jclouds.getTTL(), 600003);
   }
View Full Code Here

   public void testUpdateDomainsTTL() throws Exception {
      List<Integer> ids = ImmutableList.of(
            testDomains.get(JCLOUDS_EXAMPLE).getId(), testDomains.get("alt-" + JCLOUDS_EXAMPLE).getId());
      awaitComplete(api, api.getDomainApi().updateTTL(ids, 1234567));
     
      Domain jclouds = api.getDomainApi().get(testDomains.get(JCLOUDS_EXAMPLE).getId());
      Domain altjclouds = api.getDomainApi().get(testDomains.get("alt-" + JCLOUDS_EXAMPLE).getId());
     
      assertEquals(jclouds.getTTL(), 1234567);
      assertEquals(altjclouds.getTTL(), 1234567);
   }
View Full Code Here

   public void testUpdateDomainsEmail() throws Exception {
      List<Integer> ids = ImmutableList.of(
            testDomains.get(JCLOUDS_EXAMPLE).getId(), testDomains.get("alt-" + JCLOUDS_EXAMPLE).getId());
      awaitComplete(api, api.getDomainApi().updateEmail(ids, "jclouds-up@" + JCLOUDS_EXAMPLE));

      Domain jclouds = api.getDomainApi().get(testDomains.get(JCLOUDS_EXAMPLE).getId());
      Domain altjclouds = api.getDomainApi().get(testDomains.get("alt-" + JCLOUDS_EXAMPLE).getId());

      assertEquals(jclouds.getEmail(), "jclouds-up@" + JCLOUDS_EXAMPLE);
      assertEquals(altjclouds.getEmail(), "jclouds-up@" + JCLOUDS_EXAMPLE);
   }
View Full Code Here

      assertEquals(altjclouds.getEmail(), "jclouds-up@" + JCLOUDS_EXAMPLE);
   }

   @Test(dependsOnMethods = "testUpdateDomainsEmail")
   public void testExportDomain() throws Exception {
      Domain domain = testDomains.get(JCLOUDS_EXAMPLE);
      List<String> domainExport = awaitComplete(api, api.getDomainApi().exportFormat(domain.getId(), Domain.Format.BIND_9));
     
      assertTrue(domainExport.get(0).contains(JCLOUDS_EXAMPLE));
   }
View Full Code Here

   public void testImportDomain() throws Exception {
      List<String> contents = ImmutableList.<String> of(
            "imp-" + JCLOUDS_EXAMPLE + ".      3600  IN SOA   ns.rackspace.com. jclouds.imp-" + JCLOUDS_EXAMPLE + ". 1363882703 3600 3600 3600 3600",
            "imp-" + JCLOUDS_EXAMPLE + ".      600   IN A  50.56.174.152");

      Domain domain = awaitComplete(api, api.getDomainApi().importFormat(contents, Domain.Format.BIND_9));
      RecordDetail record = domain.getRecords().iterator().next();
     
      assertEquals(domain.getName(), "imp-" + JCLOUDS_EXAMPLE);
      assertEquals(domain.getEmail(), "jclouds@imp-" + JCLOUDS_EXAMPLE);
      assertEquals(record.getType(), "A");
      assertEquals(record.getData(), "50.56.174.152");
      assertEquals(record.getTTL(), 600);
     
      testDomains = Maps.newHashMap(testDomains);
      testDomains.put(domain.getName(), domain);
   }
View Full Code Here

         return null;
      }
      else if (requestUrl.contains("import")) {
         Type type = new TypeLiteral<Map<String, Set<ParseDomain.RawDomain>>>() { }.getType();
         Map<String, Set<RawDomain>> domainMap = json.fromJson(response.toString(), type);
         Domain domain = Iterators.getOnlyElement(domainMap.get("domains").iterator()).getDomain();

         return domain;
      }
      else if (requestUrl.contains("export")) {
         Type type = new TypeLiteral<Map<String, String>>() { }.getType();
View Full Code Here

            .email("jclouds@" + JCLOUDS_EXAMPLE)
            .ttl(60000)
            .build();

      Iterable<CreateDomain> createDomains = ImmutableList.of(createDomain);     
      Domain domain = awaitComplete(api, api.getDomainApi().create(createDomains)).iterator().next();
     
      assertEquals(domain.getName(), JCLOUDS_EXAMPLE);
      assertEquals(domain.getEmail(), "jclouds@" + JCLOUDS_EXAMPLE);
      assertTrue(domain.getRecords().isEmpty());
     
      domainId = domain.getId();
   }  
View Full Code Here

TOP

Related Classes of org.jclouds.rackspace.clouddns.v1.domain.Domain

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.