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

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


            .comment("Hello test subdomain")
            .build();
     
      List<CreateSubdomain> createSubdomains = ImmutableList.of(createSubdomain1, createSubdomain2);

      CreateDomain createDomain1 = CreateDomain.builder()
            .name(JCLOUDS_EXAMPLE)
            .email("jclouds1@" + JCLOUDS_EXAMPLE)
            .ttl(600001)
            .comment("Hello Domain 1")
            .subdomains(createSubdomains)
            .records(createRecords)
            .build();

      CreateDomain createDomain2 = CreateDomain.builder()
            .name("alt-" + JCLOUDS_EXAMPLE)
            .email("jclouds2@" + JCLOUDS_EXAMPLE)
            .ttl(600002)
            .comment("Hello Domain 2")
            .build();
View Full Code Here


      assertTrue(altjclouds.getUpdated().before(now));
   }  

   @Test(dependsOnMethods = "testCreateDomainsWithSubdomainsAndRecords")
   public void testCreateSimpleDomain() throws Exception {
      CreateDomain createDomain = CreateDomain.builder()
            .name("simple-" + JCLOUDS_EXAMPLE)
            .email("simple-jclouds@" + JCLOUDS_EXAMPLE)
            .build();

      Iterable<CreateDomain> createDomains = ImmutableList.of(createDomain);     
View Full Code Here

            .data("10.0.0.1")
            .build();
     
      List<Record> createRecords = ImmutableList.of(createMXRecord, createARecord);
     
      CreateSubdomain createSubdomain1 = CreateSubdomain.builder()
            .name("dev." + JCLOUDS_EXAMPLE)
            .email("jclouds@" + JCLOUDS_EXAMPLE)
            .comment("Hello dev subdomain")
            .build();
     
      CreateSubdomain createSubdomain2 = CreateSubdomain.builder()
            .name("test." + JCLOUDS_EXAMPLE)
            .email("jclouds@" + JCLOUDS_EXAMPLE)
            .comment("Hello test subdomain")
            .build();
     
View Full Code Here

            .ttl(60000)
            .build();
     
      List<Record> createRecords = ImmutableList.of(createMXRecord, createARecord);
     
      CreateSubdomain createSubdomain1 = CreateSubdomain.builder()
            .name("dev." + JCLOUDS_EXAMPLE)
            .email("jclouds@" + JCLOUDS_EXAMPLE)
            .comment("Hello dev subdomain")
            .build();
     
      CreateSubdomain createSubdomain2 = CreateSubdomain.builder()
            .name("test." + JCLOUDS_EXAMPLE)
            .email("jclouds@" + JCLOUDS_EXAMPLE)
            .comment("Hello test subdomain")
            .build();
     
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

   public void testCreateDomain() throws Exception {
      CreateDomain createDomain = CreateDomain.builder().name(JCLOUDS_EXAMPLE).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

            .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

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

      Domain domain = api.get(3650908);
      assertEquals(domain.getName(), "test." + JCLOUDS_EXAMPLE);
      assertEquals(domain.getRecords().size(), 2);
      assertEquals(domain.getComment().get(), "Hello test subdomain");
      assertEquals(domain.getTTL(), 3600);
   }
View Full Code Here

      Iterable<CreateDomain> createDomains = ImmutableList.of(createDomain1, createDomain2);     
      testDomains = DomainFunctions.toDomainMap(awaitComplete(api, api.getDomainApi().create(createDomains)));

      assertEquals(testDomains.size(), 2);

      Domain jclouds = testDomains.get(JCLOUDS_EXAMPLE);
      Domain altjclouds = testDomains.get("alt-" + JCLOUDS_EXAMPLE);
     
      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(), 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);
      assertEquals(altjclouds.getComment().get(), "Hello Domain 2");
      assertEquals(altjclouds.getTTL(), 600002);
      assertTrue(altjclouds.getCreated().before(now));
      assertTrue(altjclouds.getUpdated().before(now));
   }  
View Full Code Here

            .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

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.