Package com.dyn.client.v3.traffic

Examples of com.dyn.client.v3.traffic.DynTrafficApi


            this.rdata = rdata;
            return this;
         }

         public Value build() {
            return new Value(label, weight, rdata);
         }
View Full Code Here


            if (weights == null)
               weights = ImmutableList.of();

            List<String> labels = creepyGeoRegionGroup.label.get(type.toLowerCase() + "_label");
            for (int i = 0; i < entry.getValue().size(); i++) {
               Builder elementBuilder = Value.builder().rdata(entry.getValue().get(i));
               // chance of index out of bounds
               if (i < labels.size())
                  elementBuilder.label(labels.get(i));
               if (i < weights.size())
                  elementBuilder.weight(weights.get(i));
               rset.add(elementBuilder.build());
            }
            rsets.add(rset.build());
         }
         builder.recordSets(rsets.build());
         return builder.build();
View Full Code Here

            .userName(key.identity.substring(key.identity.indexOf(':') + 1)).password(key.credential).build();
   }

   @Override
   public HttpRequest filter(HttpRequest request) throws HttpException {
      Session session = sessionCache.getUnchecked(creds.get());
      Builder<?> builder = request.toBuilder();
      builder.replaceHeader("Auth-Token", session.getToken());
      return builder.build();
   }
View Full Code Here

      checkNotNull(zone.getVersion()"Version cannot be null for a Session.");
   }

   @Test
   protected void testCreateSession() {
      SessionCredentials credentials = SessionCredentials.builder()
                                                         .customerName(identity.substring(0, identity.indexOf(':')))
                                                         .userName(identity.substring(identity.indexOf(':') + 1))
                                                         .password(credential).build();
      session = api().login(credentials);
      checkSession(session);
View Full Code Here

   protected void testListAndGetZones() {
      ImmutableList<String> zones = api().list().toList();
      getAnonymousLogger().info("zones: " + zones.size());

      for (String fqdn : zones) {
         Zone zone = api().get(fqdn);
         checkNotNull(zone, "zone was null for Zone: %s", fqdn);
         checkZone(zone);
      }
   }
View Full Code Here

      assertEquals(api.getJob(job.getId()), job);
   }

   @Test(dependsOnMethods = "testCreateZone")
   public void testPublishZone() {
      Zone zone = api().publish(fqdn);
      checkNotNull(zone, "unable to publish zone %s", fqdn);
      getAnonymousLogger().info("published zone: " + zone);
      checkZone(zone);
   }
View Full Code Here

   HttpRedirect redirect = HttpRedirect.builder().zone(fqdn).fqdn(redirectName).code(302).keepUri(true).url("http://foo.com/").build();
   String unknownRedirectName = "nodirect." + fqdn;

   @Test
   private void testCreatePublishZone() throws Exception {
      Zone zone = api.getZoneApi().get(fqdn);
      if (zone == null) {
         Job job = api.getZoneApi().scheduleCreateWithContact(fqdn, contact);
         checkNotNull(job, "unable to create zone %s", fqdn);
         getAnonymousLogger().info("created zone: " + job);
         assertEquals(job.getStatus(), Status.SUCCESS);
View Full Code Here

   public void testCreateAndPublishHttpRedirect() throws Exception {
      Thread.sleep(3000); // FIXME - figure out delays
      Job job = api().scheduleCreate(redirect);
      assertEquals(job.getStatus(), Status.SUCCESS);
      assertEquals(api.getJob(job.getId()), job);
      Zone zone = api.getZoneApi().publish(fqdn);
      checkZone(zone);
      getAndVerifyRedirect(redirectName, 302, "Y", "http://foo.com/");
   }
View Full Code Here

      Thread.sleep(3000); // FIXME - figure out delays

      Job job = api().scheduleUpdate(HttpRedirect.builder().zone(fqdn).fqdn(redirectName).code(301).keepUri(false).url("http://bar.com/").build());
      assertEquals(job.getStatus(), Status.SUCCESS);
      assertEquals(api.getJob(job.getId()), job);
      Zone zone = api.getZoneApi().publish(fqdn);
      checkZone(zone);
      getAndVerifyRedirect(redirectName, 301, "N", "http://bar.com/");
   }
View Full Code Here

      checkNotNull(rdata.getMinimum(), "rdata.minimum cannot be null for SOARecord: %s", record);
      return record;
   }

   private Record<SPFData> checkSPFRecord(Record<SPFData> record) {
      SPFData rdata = record.getRData();
      checkNotNull(rdata.getTxtdata(), "rdata.txtdata cannot be null for SPFRecord: %s", record);
      return record;
   }
View Full Code Here

TOP

Related Classes of com.dyn.client.v3.traffic.DynTrafficApi

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.