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

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


      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

            HttpResponse.builder().statusCode(OK.getStatusCode()).payload(payloadFromResource("/domain-list-changes.json")).build())
            .getDomainApi();

      Calendar cal = Calendar.getInstance(new SimpleTimeZone(0, "GMT"));
      cal.set(2013, 2, 22, 3, 39, 31);
      DomainChange domainChange = api.listChanges(3650908, cal.getTime());
     
      assertEquals(domainChange.getChanges().size(), 25);
   }
View Full Code Here

            .email("everett@" + JCLOUDS_EXAMPLE)
            .ttl(600001)
            .comment("Hello Domain Update")
            .build();

      Job job = api.update(3650908, updateDomain);
     
      assertEquals(job.getStatus(), Job.Status.COMPLETED);
   }
View Full Code Here

               .build(),
            HttpResponse.builder().statusCode(OK.getStatusCode()).payload(payloadFromResource("/domain-update-response.json")).build())
            .getDomainApi();

      List<Integer> ids = ImmutableList.of(3650906, 3650908);
      Job job = api.updateTTL(ids, 1234567);
     
      assertEquals(job.getStatus(), Job.Status.COMPLETED);
   }
View Full Code Here

               .build(),
            HttpResponse.builder().statusCode(OK.getStatusCode()).payload(payloadFromResource("/domain-update-response.json")).build())
            .getDomainApi();

      List<Integer> ids = ImmutableList.of(3650906, 3650908);
      Job job = api.updateEmail(ids, "everett@" + JCLOUDS_EXAMPLE);
     
      assertEquals(job.getStatus(), Job.Status.COMPLETED);
   }
View Full Code Here

            authenticatedGET().method("DELETE").replaceHeader("Accept", MediaType.WILDCARD).endpoint(endpoint).build(),
            HttpResponse.builder().statusCode(OK.getStatusCode()).payload(payloadFromResource("/domain-delete.json")).build())
            .getDomainApi();

      List<Integer> domainIds = ImmutableList.<Integer> of(3650907, 3650906, 3650908, 3650909);     
      Job job = api.delete(domainIds, true);

      assertEquals(job.getStatus(), Job.Status.COMPLETED);
   }
View Full Code Here

      domainId = domain.getId();
   }

   @Test(dependsOnMethods = "testCreateDomain")
   public void testCreateReverseDNSRecords() throws Exception {
      Record createPTRRecordIPv4 = Record.builder().type("PTR").name(JCLOUDS_EXAMPLE).data(serverIPv4).ttl(11235)
            .build();

      Record createPTRRecordIPv6 = Record.builder().type("PTR").name(JCLOUDS_EXAMPLE).data(serverIPv6)
            .comment("Hello IPv6").build();

      List<Record> createRecords = ImmutableList.of(createPTRRecordIPv4, createPTRRecordIPv6);
      Set<RecordDetail> records = awaitComplete(api,
            api.getReverseDNSApiForService(CLOUD_SERVERS_OPEN_STACK).create(serverURI, createRecords));
View Full Code Here

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

   @Test(dependsOnMethods = "testListReverseDNSRecords")
   public void testUpdateAndGetReverseDNSRecords() throws Exception {
      Record updatePTRRecordIPv4 = Record.builder().type("PTR").name(JCLOUDS_EXAMPLE).data(serverIPv4).ttl(12358)
            .build();

      Map<String, Record> idsToRecords = ImmutableMap.<String, Record> of(ptrRecordIPv4Id, updatePTRRecordIPv4);

      awaitComplete(api, api.getReverseDNSApiForService(CLOUD_SERVERS_OPEN_STACK).update(serverURI, idsToRecords));
View Full Code Here

TOP

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

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.