Skip to content
This repository has been archived by the owner on Mar 25, 2018. It is now read-only.

Commit

Permalink
The Rackspace Cloud DNS APIs moved over from labs.
Browse files Browse the repository at this point in the history
  • Loading branch information
Everett Toews committed Apr 24, 2013
1 parent 20763b7 commit 998bfea
Show file tree
Hide file tree
Showing 104 changed files with 8,661 additions and 0 deletions.
15 changes: 15 additions & 0 deletions all/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@
<artifactId>openstack-cinder</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jclouds.api</groupId>
<artifactId>rackspace-clouddns</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jclouds.provider</groupId>
<artifactId>aws-cloudwatch</artifactId>
Expand All @@ -55,6 +60,16 @@
<artifactId>rackspace-cloudblockstorage-uk</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jclouds.provider</groupId>
<artifactId>rackspace-clouddns-us</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jclouds.provider</groupId>
<artifactId>rackspace-clouddns-uk</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jclouds.provider</groupId>
<artifactId>aws-sqs</artifactId>
Expand Down
1 change: 1 addition & 0 deletions apis/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
<module>cloudservers</module>
<module>rackspace-cloudidentity</module>
<module>rackspace-cloudloadbalancers</module>
<module>rackspace-clouddns</module>
<module>sts</module>
<module>route53</module>
</modules>
Expand Down
154 changes: 154 additions & 0 deletions apis/rackspace-clouddns/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to jclouds, Inc. (jclouds) under one or more
contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. jclouds licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.jclouds</groupId>
<artifactId>jclouds-project</artifactId>
<version>1.7.0-SNAPSHOT</version>
<relativePath>../../project/pom.xml</relativePath>
</parent>
<groupId>org.jclouds.api</groupId>
<artifactId>rackspace-clouddns</artifactId>
<name>jclouds rackspace clouddns api</name>
<description>jclouds components for Rackspace Cloud DNS</description>
<packaging>bundle</packaging>

<properties>
<test.rackspace-clouddns.endpoint>https://identity.api.rackspacecloud.com/v2.0/</test.rackspace-clouddns.endpoint>
<test.rackspace-clouddns.api-version>1.0</test.rackspace-clouddns.api-version>
<test.rackspace-clouddns.build-version />
<test.rackspace-clouddns.identity>${test.rackspace-us.identity}</test.rackspace-clouddns.identity>
<test.rackspace-clouddns.credential>${test.rackspace-us.credential}</test.rackspace-clouddns.credential>

<jclouds.osgi.export>org.jclouds.rackspace.clouddns.v1*;version="${project.version}"</jclouds.osgi.export>
<jclouds.osgi.import>
org.jclouds.rest.internal;version="${project.version}",
org.jclouds*;version="${project.version}",
*
</jclouds.osgi.import>
</properties>

<dependencies>
<dependency>
<groupId>org.jclouds</groupId>
<artifactId>jclouds-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jclouds.api</groupId>
<artifactId>openstack-keystone</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jclouds.api</groupId>
<artifactId>rackspace-cloudidentity</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jclouds</groupId>
<artifactId>jclouds-core</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jclouds</groupId>
<artifactId>jclouds-compute</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jclouds.api</groupId>
<artifactId>openstack-keystone</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jclouds.api</groupId>
<artifactId>openstack-nova</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jclouds.api</groupId>
<artifactId>rackspace-cloudidentity</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jclouds.provider</groupId>
<artifactId>rackspace-cloudservers-us</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jclouds.driver</groupId>
<artifactId>jclouds-slf4j</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<profiles>
<profile>
<id>live</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<executions>
<execution>
<id>integration</id>
<phase>integration-test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<!-- TODO: remove when multiple jobs/session are supported -->
<threadCount>1</threadCount>
<systemPropertyVariables>
<test.rackspace-clouddns.endpoint>${test.rackspace-clouddns.endpoint}</test.rackspace-clouddns.endpoint>
<test.rackspace-clouddns.api-version>${test.rackspace-clouddns.api-version}</test.rackspace-clouddns.api-version>
<test.rackspace-clouddns.build-version>${test.rackspace-clouddns.build-version}</test.rackspace-clouddns.build-version>
<test.rackspace-clouddns.identity>${test.rackspace-clouddns.identity}</test.rackspace-clouddns.identity>
<test.rackspace-clouddns.credential>${test.rackspace-clouddns.credential}</test.rackspace-clouddns.credential>
</systemPropertyVariables>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.rackspace.clouddns.v1;

import static javax.ws.rs.core.MediaType.APPLICATION_JSON;

import java.io.Closeable;

import javax.inject.Named;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;

import org.jclouds.Fallbacks.NullOnNotFoundOr404;
import org.jclouds.javax.annotation.Nullable;
import org.jclouds.openstack.keystone.v2_0.filters.AuthenticateRequest;
import org.jclouds.rackspace.clouddns.v1.config.CloudDNS;
import org.jclouds.rackspace.clouddns.v1.domain.Job;
import org.jclouds.rackspace.clouddns.v1.features.DomainApi;
import org.jclouds.rackspace.clouddns.v1.features.LimitApi;
import org.jclouds.rackspace.clouddns.v1.features.RecordApi;
import org.jclouds.rackspace.clouddns.v1.features.ReverseDNSApi;
import org.jclouds.rackspace.clouddns.v1.functions.ParseJob;
import org.jclouds.rackspace.clouddns.v1.predicates.JobPredicates;
import org.jclouds.rest.annotations.Delegate;
import org.jclouds.rest.annotations.Endpoint;
import org.jclouds.rest.annotations.Fallback;
import org.jclouds.rest.annotations.PayloadParam;
import org.jclouds.rest.annotations.QueryParams;
import org.jclouds.rest.annotations.RequestFilters;
import org.jclouds.rest.annotations.ResponseParser;

/**
* Provides access to the Rackspace Cloud DNS API.
* <p/>
* See <a href="http://docs.rackspace.com/cdns/api/v1.0/cdns-devguide/content/index.html">Cloud DNS Developer Guide</a>
*
* @author Everett Toews
*/
public interface CloudDNSApi extends Closeable {

/**
* Returns the current status of a job.
* </p>
* Operations that create, update, or delete resources may take some time to process. Therefore they return
* a Job containing information, which allows the status and response information of the job to be
* retrieved at a later point in time.
* </p>
* You likely won't need to use this method directly. Use {@link JobPredicates#awaitComplete(CloudDNSApi, Job)}.
*
* @return null, if not found.
*/
@Named("job:get")
@Endpoint(CloudDNS.class)
@RequestFilters(AuthenticateRequest.class)
@GET
@Consumes(APPLICATION_JSON)
@ResponseParser(ParseJob.class)
@Fallback(NullOnNotFoundOr404.class)
@QueryParams(keys = "showDetails", values = "true")
@Path("/status/{jobId}")
@Nullable
<T> Job<T> getJob(@PathParam("jobId") String jobId);

/**
* Provides access to Limit features.
*/
@Delegate
LimitApi getLimitApi();

/**
* Provides access to Domain features.
*/
@Delegate
DomainApi getDomainApi();

/**
* Provides access to Record features.
*/
@Delegate
@Path("/domains/{domainId}")
RecordApi getRecordApiForDomain(@PathParam("domainId") int domainId);

/**
* Provides access to Reverse DNS features.
*/
@Delegate
ReverseDNSApi getReverseDNSApiForService(@PayloadParam("serviceName") @PathParam("serviceName") String serviceName);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.rackspace.clouddns.v1;

import static org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties.CREDENTIAL_TYPE;
import static org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties.SERVICE_TYPE;
import static org.jclouds.rackspace.cloudidentity.v2_0.ServiceType.DNS;
import static org.jclouds.rackspace.cloudidentity.v2_0.config.CloudIdentityCredentialTypes.API_KEY_CREDENTIALS;

import java.net.URI;
import java.util.Properties;

import org.jclouds.apis.ApiMetadata;
import org.jclouds.openstack.keystone.v2_0.config.KeystoneAuthenticationModule.ProviderModule;
import org.jclouds.rackspace.clouddns.v1.config.CloudDNSHttpApiModule;
import org.jclouds.rackspace.cloudidentity.v2_0.config.CloudIdentityAuthenticationApiModule;
import org.jclouds.rackspace.cloudidentity.v2_0.config.CloudIdentityAuthenticationModule;
import org.jclouds.rest.internal.BaseHttpApiMetadata;

import com.google.common.collect.ImmutableSet;
import com.google.inject.Module;

/**
* Implementation of {@link ApiMetadata} for Rackspace Cloud DNS 1.0 API
*
* @author Everett Toews
*/
public class CloudDNSApiMetadata extends BaseHttpApiMetadata<CloudDNSApi> {

@Override
public Builder toBuilder() {
return new Builder().fromApiMetadata(this);
}

public CloudDNSApiMetadata() {
this(new Builder());
}

protected CloudDNSApiMetadata(Builder builder) {
super(builder);
}

public static Properties defaultProperties() {
Properties properties = BaseHttpApiMetadata.defaultProperties();
properties.setProperty(SERVICE_TYPE, DNS);
properties.setProperty(CREDENTIAL_TYPE, API_KEY_CREDENTIALS);
return properties;
}

public static class Builder extends BaseHttpApiMetadata.Builder<CloudDNSApi, Builder> {

protected Builder() {
id("rackspace-clouddns")
.name("Rackspace Cloud DNS API")
.identityName("Username")
.credentialName("API Key")
.documentation(URI.create("http://docs.rackspace.com/cdns/api/v1.0/cdns-devguide/content/index.html"))
.version("1.0")
.defaultEndpoint("https://identity.api.rackspacecloud.com/v2.0/")
.defaultProperties(CloudDNSApiMetadata.defaultProperties())
.defaultModules(ImmutableSet.<Class<? extends Module>> builder()
.add(CloudIdentityAuthenticationApiModule.class)
.add(CloudIdentityAuthenticationModule.class)
.add(ProviderModule.class)
.add(CloudDNSHttpApiModule.class)
.build());
}

@Override
public CloudDNSApiMetadata build() {
return new CloudDNSApiMetadata(this);
}

@Override
protected Builder self() {
return this;
}
}
}
Loading

0 comments on commit 998bfea

Please sign in to comment.