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

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


      try {
         List<String> argsList = Lists.newArrayList(args);
         argsList.add("1"); // the number of Cloud Servers to start
         NodeMetadata node = CloudServersPublish.getPublishedCloudServers(argsList).iterator().next();

         RecordDetail recordDetail = crudReverseDNSRecords.createReverseDNSRecords(node);
         crudReverseDNSRecords.listReverseDNSRecords(node);
         crudReverseDNSRecords.updateReverseDNSRecords(node, recordDetail);
         crudReverseDNSRecords.deleteAllReverseDNSRecords(node);
      }
      catch (Exception e) {
View Full Code Here


      Set<Record> records = ImmutableSet.of(createPTRRecordIPv4);

      Iterable<RecordDetail> recordDetails = awaitComplete(dnsApi, reverseDNSApi.create(node.getUri(), records));

      RecordDetail recordDetail = recordDetails.iterator().next();
      System.out.format("  %s%n", recordDetail);

      return recordDetail;
   }
View Full Code Here

   }

   private void updateRecord(Domain domain) throws TimeoutException {
      System.out.format("Update Record%n");

      RecordDetail recordDetail = dnsApi.getRecordApiForDomain(domain.getId()).getByNameAndTypeAndData(NAME, "A", "10.0.0.1");
      Record updateRecord = recordDetail.getRecord().toBuilder().data("10.0.1.0").build();

      awaitComplete(dnsApi, dnsApi.getRecordApiForDomain(domain.getId()).update(recordDetail.getId(), updateRecord));

      System.out.format("  %s%n", dnsApi.getRecordApiForDomain(domain.getId()).get(recordDetail.getId()));
   }
View Full Code Here

      assertEquals(job.getStatus(), Job.Status.COMPLETED);
      assertTrue(job.getResource().isPresent());
     
      Set<RecordDetail> records = job.getResource().get();
      Date now = new Date();
      RecordDetail mxRecord = null;
      RecordDetail aRecord = null;
     
      for (RecordDetail record : records) {
         if (record.getType().equals("MX")) {
            mxRecord = record;
         } else if (record.getType().equals("A")) {
            aRecord = record;
         }
      }
     
      assertNotNull(mxRecord.getId());
      assertEquals(mxRecord.getType(), "MX");
      assertEquals(mxRecord.getName(), JCLOUDS_EXAMPLE);
      assertEquals(mxRecord.getPriority().intValue(), 11235);
      assertEquals(mxRecord.getComment(), "MX Record");
      assertEquals(mxRecord.getTTL(), 60000);
      assertTrue(mxRecord.getCreated().before(now));
      assertTrue(mxRecord.getUpdated().before(now));
     
      assertNotNull(aRecord.getId());
      assertEquals(aRecord.getType(), "A");
      assertEquals(aRecord.getName(), JCLOUDS_EXAMPLE);
      assertNull(aRecord.getPriority());
      assertEquals(aRecord.getTTL(), 60000);
      assertTrue(aRecord.getCreated().before(now));
      assertTrue(aRecord.getUpdated().before(now));
   }
View Full Code Here

            responseWithAccess,
            authenticatedGET().endpoint(endpoint).build(),
            HttpResponse.builder().statusCode(OK.getStatusCode()).payload(payloadFromResource("/record-list-with-filter.json")).build())
            .getRecordApi(3650908);

      RecordDetail record = api.getByNameAndTypeAndData(JCLOUDS_EXAMPLE, "A", "10.0.1.0");
      Date now = new Date();
     
      assertEquals(record.getId(), "A-9846146");
      assertEquals(record.getName(), JCLOUDS_EXAMPLE);
      assertEquals(record.getType(), "A");
      assertEquals(record.getData(), "10.0.1.0");
      assertEquals(record.getTTL(), 60000);
      assertTrue(record.getCreated().before(now));
      assertTrue(record.getUpdated().before(now));
   }
View Full Code Here

            responseWithAccess,
            authenticatedGET().endpoint(endpoint).build(),
            HttpResponse.builder().statusCode(OK.getStatusCode()).payload(payloadFromResource("/record-get.json")).build())
            .getRecordApi(3650908);

      RecordDetail record = api.get("A-9846146");
      Date now = new Date();

      assertEquals(record.getId(), "A-9846146");
      assertEquals(record.getName(), JCLOUDS_EXAMPLE);
      assertEquals(record.getType(), "A");
      assertEquals(record.getData(), "10.0.1.0");
      assertEquals(record.getTTL(), 60000);
      assertTrue(record.getCreated().before(now));
      assertTrue(record.getUpdated().before(now));
   }
View Full Code Here

      assertTrue(testjclouds.getCreated().before(now));
      assertTrue(testjclouds.getUpdated().before(now));
     
      assertEquals(jclouds.getRecords().size(), 2);
     
      RecordDetail mxRecord = null;
      RecordDetail aRecord = null;
     
      for (RecordDetail record : jclouds.getRecords()) {
         if (record.getType().equals("MX")) {
            mxRecord = record;
         } else if (record.getType().equals("A")) {
            aRecord = record;
         }
      }
     
      assertNotNull(mxRecord.getId());
      assertEquals(mxRecord.getType(), "MX");
      assertEquals(mxRecord.getName(), JCLOUDS_EXAMPLE);
      assertEquals(mxRecord.getPriority().intValue(), 11235);
      assertEquals(mxRecord.getComment(), "MX Record");
      assertEquals(mxRecord.getTTL(), 60000);
      assertTrue(mxRecord.getCreated().before(now));
      assertTrue(mxRecord.getUpdated().before(now));
     
      assertNotNull(aRecord.getId());
      assertEquals(aRecord.getType(), "A");
      assertEquals(aRecord.getName(), JCLOUDS_EXAMPLE);
      assertNull(aRecord.getPriority());
      assertEquals(aRecord.getComment(), "A Record");
      assertEquals(aRecord.getTTL(), 60000);
      assertTrue(aRecord.getCreated().before(now));
      assertTrue(aRecord.getUpdated().before(now));
     
      assertTrue(altjclouds.getId() > 0);
      assertTrue(altjclouds.getAccountId() > 0);
      assertEquals(altjclouds.getName(), "alt-" + JCLOUDS_EXAMPLE);
      assertEquals(altjclouds.getEmail(), "jclouds2@" + JCLOUDS_EXAMPLE);
View Full Code Here

      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")) {
            nsRecord = record; // don't care which one we get
         }
      }
     
      assertNotNull(mxRecord.getId());
      assertEquals(mxRecord.getType(), "MX");
      assertEquals(mxRecord.getName(), JCLOUDS_EXAMPLE);
      assertEquals(mxRecord.getPriority().intValue(), 11235);
      assertEquals(mxRecord.getComment(), "MX Record");
      assertEquals(mxRecord.getTTL(), 60000);
      assertTrue(mxRecord.getCreated().before(now));
      assertTrue(mxRecord.getUpdated().before(now));
     
      assertNotNull(aRecord.getId());
      assertEquals(aRecord.getType(), "A");
      assertEquals(aRecord.getName(), JCLOUDS_EXAMPLE);
      assertNull(aRecord.getPriority());
      assertEquals(aRecord.getComment(), "A Record");
      assertEquals(aRecord.getTTL(), 60000);
      assertTrue(aRecord.getCreated().before(now));
      assertTrue(aRecord.getUpdated().before(now));

      assertNotNull(nsRecord.getId());
      assertEquals(nsRecord.getType(), "NS");
      assertEquals(nsRecord.getName(), JCLOUDS_EXAMPLE);
      assertEquals(nsRecord.getTTL(), 600001);
      assertTrue(nsRecord.getCreated().before(now));
      assertTrue(nsRecord.getUpdated().before(now));
   }
View Full Code Here

      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

      assertEquals(job.getStatus(), Job.Status.COMPLETED);
      assertTrue(job.getResource().isPresent());
     
      Set<RecordDetail> records = job.getResource().get();
      Date now = new Date();
      RecordDetail ptrRecordIPv4 = null;
      RecordDetail ptrRecordIPv6 = null;
     
      for (RecordDetail record : records) {
         if (record.getData().startsWith("166")) {
            ptrRecordIPv4 = record;
         } else if (record.getData().startsWith("2001")) {
            ptrRecordIPv6 = record;
         }
      }
     
      assertNotNull(ptrRecordIPv4.getId());
      assertEquals(ptrRecordIPv4.getType(), "PTR");
      assertEquals(ptrRecordIPv4.getName(), JCLOUDS_EXAMPLE);
      assertEquals(ptrRecordIPv4.getData(), "166.78.146.80");
      assertEquals(ptrRecordIPv4.getTTL(), 11235);
      assertNull(ptrRecordIPv4.getPriority());
      assertNull(ptrRecordIPv4.getComment());
      assertTrue(ptrRecordIPv4.getCreated().before(now));
      assertTrue(ptrRecordIPv4.getUpdated().before(now));
     
      assertNotNull(ptrRecordIPv6.getId());
      assertEquals(ptrRecordIPv6.getType(), "PTR");
      assertEquals(ptrRecordIPv6.getName(), JCLOUDS_EXAMPLE);
      assertEquals(ptrRecordIPv6.getData(), "2001:4800:7812:514:9a32:3c2a:ff04:aed2"); // leading 0 in 0514 removed
      assertTrue(ptrRecordIPv6.getTTL() > 0);
      assertNull(ptrRecordIPv6.getPriority());
      assertEquals(ptrRecordIPv6.getComment(), "Hello IPv6");
      assertTrue(ptrRecordIPv6.getCreated().before(now));
      assertTrue(ptrRecordIPv6.getUpdated().before(now));
   }
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.