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

Commit 998bfea

Browse files
author
Everett Toews
committed
The Rackspace Cloud DNS APIs moved over from labs.
1 parent 20763b7 commit 998bfea

File tree

104 files changed

+8661
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+8661
-0
lines changed

all/pom.xml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@
4040
<artifactId>openstack-cinder</artifactId>
4141
<version>${project.version}</version>
4242
</dependency>
43+
<dependency>
44+
<groupId>org.jclouds.api</groupId>
45+
<artifactId>rackspace-clouddns</artifactId>
46+
<version>${project.version}</version>
47+
</dependency>
4348
<dependency>
4449
<groupId>org.jclouds.provider</groupId>
4550
<artifactId>aws-cloudwatch</artifactId>
@@ -55,6 +60,16 @@
5560
<artifactId>rackspace-cloudblockstorage-uk</artifactId>
5661
<version>${project.version}</version>
5762
</dependency>
63+
<dependency>
64+
<groupId>org.jclouds.provider</groupId>
65+
<artifactId>rackspace-clouddns-us</artifactId>
66+
<version>${project.version}</version>
67+
</dependency>
68+
<dependency>
69+
<groupId>org.jclouds.provider</groupId>
70+
<artifactId>rackspace-clouddns-uk</artifactId>
71+
<version>${project.version}</version>
72+
</dependency>
5873
<dependency>
5974
<groupId>org.jclouds.provider</groupId>
6075
<artifactId>aws-sqs</artifactId>

apis/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
<module>cloudservers</module>
5353
<module>rackspace-cloudidentity</module>
5454
<module>rackspace-cloudloadbalancers</module>
55+
<module>rackspace-clouddns</module>
5556
<module>sts</module>
5657
<module>route53</module>
5758
</modules>

apis/rackspace-clouddns/pom.xml

Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
4+
Licensed to jclouds, Inc. (jclouds) under one or more
5+
contributor license agreements. See the NOTICE file
6+
distributed with this work for additional information
7+
regarding copyright ownership. jclouds licenses this file
8+
to you under the Apache License, Version 2.0 (the
9+
"License"); you may not use this file except in compliance
10+
with the License. You may obtain a copy of the License at
11+
12+
http://www.apache.org/licenses/LICENSE-2.0
13+
14+
Unless required by applicable law or agreed to in writing,
15+
software distributed under the License is distributed on an
16+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17+
KIND, either express or implied. See the License for the
18+
specific language governing permissions and limitations
19+
under the License.
20+
21+
-->
22+
<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">
23+
<modelVersion>4.0.0</modelVersion>
24+
<parent>
25+
<groupId>org.jclouds</groupId>
26+
<artifactId>jclouds-project</artifactId>
27+
<version>1.7.0-SNAPSHOT</version>
28+
<relativePath>../../project/pom.xml</relativePath>
29+
</parent>
30+
<groupId>org.jclouds.api</groupId>
31+
<artifactId>rackspace-clouddns</artifactId>
32+
<name>jclouds rackspace clouddns api</name>
33+
<description>jclouds components for Rackspace Cloud DNS</description>
34+
<packaging>bundle</packaging>
35+
36+
<properties>
37+
<test.rackspace-clouddns.endpoint>https://identity.api.rackspacecloud.com/v2.0/</test.rackspace-clouddns.endpoint>
38+
<test.rackspace-clouddns.api-version>1.0</test.rackspace-clouddns.api-version>
39+
<test.rackspace-clouddns.build-version />
40+
<test.rackspace-clouddns.identity>${test.rackspace-us.identity}</test.rackspace-clouddns.identity>
41+
<test.rackspace-clouddns.credential>${test.rackspace-us.credential}</test.rackspace-clouddns.credential>
42+
43+
<jclouds.osgi.export>org.jclouds.rackspace.clouddns.v1*;version="${project.version}"</jclouds.osgi.export>
44+
<jclouds.osgi.import>
45+
org.jclouds.rest.internal;version="${project.version}",
46+
org.jclouds*;version="${project.version}",
47+
*
48+
</jclouds.osgi.import>
49+
</properties>
50+
51+
<dependencies>
52+
<dependency>
53+
<groupId>org.jclouds</groupId>
54+
<artifactId>jclouds-core</artifactId>
55+
<version>${project.version}</version>
56+
</dependency>
57+
<dependency>
58+
<groupId>org.jclouds.api</groupId>
59+
<artifactId>openstack-keystone</artifactId>
60+
<version>${project.version}</version>
61+
</dependency>
62+
<dependency>
63+
<groupId>org.jclouds.api</groupId>
64+
<artifactId>rackspace-cloudidentity</artifactId>
65+
<version>${project.version}</version>
66+
</dependency>
67+
<dependency>
68+
<groupId>org.jclouds</groupId>
69+
<artifactId>jclouds-core</artifactId>
70+
<version>${project.version}</version>
71+
<type>test-jar</type>
72+
<scope>test</scope>
73+
</dependency>
74+
<dependency>
75+
<groupId>org.jclouds</groupId>
76+
<artifactId>jclouds-compute</artifactId>
77+
<version>${project.version}</version>
78+
<type>test-jar</type>
79+
<scope>test</scope>
80+
</dependency>
81+
<dependency>
82+
<groupId>org.jclouds.api</groupId>
83+
<artifactId>openstack-keystone</artifactId>
84+
<version>${project.version}</version>
85+
<type>test-jar</type>
86+
<scope>test</scope>
87+
</dependency>
88+
<dependency>
89+
<groupId>org.jclouds.api</groupId>
90+
<artifactId>openstack-nova</artifactId>
91+
<version>${project.version}</version>
92+
<scope>test</scope>
93+
</dependency>
94+
<dependency>
95+
<groupId>org.jclouds.api</groupId>
96+
<artifactId>rackspace-cloudidentity</artifactId>
97+
<version>${project.version}</version>
98+
<type>test-jar</type>
99+
<scope>test</scope>
100+
</dependency>
101+
<dependency>
102+
<groupId>org.jclouds.provider</groupId>
103+
<artifactId>rackspace-cloudservers-us</artifactId>
104+
<version>${project.version}</version>
105+
<scope>test</scope>
106+
</dependency>
107+
<dependency>
108+
<groupId>org.jclouds.driver</groupId>
109+
<artifactId>jclouds-slf4j</artifactId>
110+
<version>${project.version}</version>
111+
<scope>test</scope>
112+
</dependency>
113+
<dependency>
114+
<groupId>ch.qos.logback</groupId>
115+
<artifactId>logback-classic</artifactId>
116+
<scope>test</scope>
117+
</dependency>
118+
</dependencies>
119+
120+
<profiles>
121+
<profile>
122+
<id>live</id>
123+
<build>
124+
<plugins>
125+
<plugin>
126+
<groupId>org.apache.maven.plugins</groupId>
127+
<artifactId>maven-surefire-plugin</artifactId>
128+
<executions>
129+
<execution>
130+
<id>integration</id>
131+
<phase>integration-test</phase>
132+
<goals>
133+
<goal>test</goal>
134+
</goals>
135+
<configuration>
136+
<!-- TODO: remove when multiple jobs/session are supported -->
137+
<threadCount>1</threadCount>
138+
<systemPropertyVariables>
139+
<test.rackspace-clouddns.endpoint>${test.rackspace-clouddns.endpoint}</test.rackspace-clouddns.endpoint>
140+
<test.rackspace-clouddns.api-version>${test.rackspace-clouddns.api-version}</test.rackspace-clouddns.api-version>
141+
<test.rackspace-clouddns.build-version>${test.rackspace-clouddns.build-version}</test.rackspace-clouddns.build-version>
142+
<test.rackspace-clouddns.identity>${test.rackspace-clouddns.identity}</test.rackspace-clouddns.identity>
143+
<test.rackspace-clouddns.credential>${test.rackspace-clouddns.credential}</test.rackspace-clouddns.credential>
144+
</systemPropertyVariables>
145+
</configuration>
146+
</execution>
147+
</executions>
148+
</plugin>
149+
</plugins>
150+
</build>
151+
</profile>
152+
</profiles>
153+
154+
</project>
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
/**
2+
* Licensed to jclouds, Inc. (jclouds) under one or more
3+
* contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. jclouds licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
package org.jclouds.rackspace.clouddns.v1;
20+
21+
import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
22+
23+
import java.io.Closeable;
24+
25+
import javax.inject.Named;
26+
import javax.ws.rs.Consumes;
27+
import javax.ws.rs.GET;
28+
import javax.ws.rs.Path;
29+
import javax.ws.rs.PathParam;
30+
31+
import org.jclouds.Fallbacks.NullOnNotFoundOr404;
32+
import org.jclouds.javax.annotation.Nullable;
33+
import org.jclouds.openstack.keystone.v2_0.filters.AuthenticateRequest;
34+
import org.jclouds.rackspace.clouddns.v1.config.CloudDNS;
35+
import org.jclouds.rackspace.clouddns.v1.domain.Job;
36+
import org.jclouds.rackspace.clouddns.v1.features.DomainApi;
37+
import org.jclouds.rackspace.clouddns.v1.features.LimitApi;
38+
import org.jclouds.rackspace.clouddns.v1.features.RecordApi;
39+
import org.jclouds.rackspace.clouddns.v1.features.ReverseDNSApi;
40+
import org.jclouds.rackspace.clouddns.v1.functions.ParseJob;
41+
import org.jclouds.rackspace.clouddns.v1.predicates.JobPredicates;
42+
import org.jclouds.rest.annotations.Delegate;
43+
import org.jclouds.rest.annotations.Endpoint;
44+
import org.jclouds.rest.annotations.Fallback;
45+
import org.jclouds.rest.annotations.PayloadParam;
46+
import org.jclouds.rest.annotations.QueryParams;
47+
import org.jclouds.rest.annotations.RequestFilters;
48+
import org.jclouds.rest.annotations.ResponseParser;
49+
50+
/**
51+
* Provides access to the Rackspace Cloud DNS API.
52+
* <p/>
53+
* See <a href="http://docs.rackspace.com/cdns/api/v1.0/cdns-devguide/content/index.html">Cloud DNS Developer Guide</a>
54+
*
55+
* @author Everett Toews
56+
*/
57+
public interface CloudDNSApi extends Closeable {
58+
59+
/**
60+
* Returns the current status of a job.
61+
* </p>
62+
* Operations that create, update, or delete resources may take some time to process. Therefore they return
63+
* a Job containing information, which allows the status and response information of the job to be
64+
* retrieved at a later point in time.
65+
* </p>
66+
* You likely won't need to use this method directly. Use {@link JobPredicates#awaitComplete(CloudDNSApi, Job)}.
67+
*
68+
* @return null, if not found.
69+
*/
70+
@Named("job:get")
71+
@Endpoint(CloudDNS.class)
72+
@RequestFilters(AuthenticateRequest.class)
73+
@GET
74+
@Consumes(APPLICATION_JSON)
75+
@ResponseParser(ParseJob.class)
76+
@Fallback(NullOnNotFoundOr404.class)
77+
@QueryParams(keys = "showDetails", values = "true")
78+
@Path("/status/{jobId}")
79+
@Nullable
80+
<T> Job<T> getJob(@PathParam("jobId") String jobId);
81+
82+
/**
83+
* Provides access to Limit features.
84+
*/
85+
@Delegate
86+
LimitApi getLimitApi();
87+
88+
/**
89+
* Provides access to Domain features.
90+
*/
91+
@Delegate
92+
DomainApi getDomainApi();
93+
94+
/**
95+
* Provides access to Record features.
96+
*/
97+
@Delegate
98+
@Path("/domains/{domainId}")
99+
RecordApi getRecordApiForDomain(@PathParam("domainId") int domainId);
100+
101+
/**
102+
* Provides access to Reverse DNS features.
103+
*/
104+
@Delegate
105+
ReverseDNSApi getReverseDNSApiForService(@PayloadParam("serviceName") @PathParam("serviceName") String serviceName);
106+
}
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
/**
2+
* Licensed to jclouds, Inc. (jclouds) under one or more
3+
* contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. jclouds licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
package org.jclouds.rackspace.clouddns.v1;
20+
21+
import static org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties.CREDENTIAL_TYPE;
22+
import static org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties.SERVICE_TYPE;
23+
import static org.jclouds.rackspace.cloudidentity.v2_0.ServiceType.DNS;
24+
import static org.jclouds.rackspace.cloudidentity.v2_0.config.CloudIdentityCredentialTypes.API_KEY_CREDENTIALS;
25+
26+
import java.net.URI;
27+
import java.util.Properties;
28+
29+
import org.jclouds.apis.ApiMetadata;
30+
import org.jclouds.openstack.keystone.v2_0.config.KeystoneAuthenticationModule.ProviderModule;
31+
import org.jclouds.rackspace.clouddns.v1.config.CloudDNSHttpApiModule;
32+
import org.jclouds.rackspace.cloudidentity.v2_0.config.CloudIdentityAuthenticationApiModule;
33+
import org.jclouds.rackspace.cloudidentity.v2_0.config.CloudIdentityAuthenticationModule;
34+
import org.jclouds.rest.internal.BaseHttpApiMetadata;
35+
36+
import com.google.common.collect.ImmutableSet;
37+
import com.google.inject.Module;
38+
39+
/**
40+
* Implementation of {@link ApiMetadata} for Rackspace Cloud DNS 1.0 API
41+
*
42+
* @author Everett Toews
43+
*/
44+
public class CloudDNSApiMetadata extends BaseHttpApiMetadata<CloudDNSApi> {
45+
46+
@Override
47+
public Builder toBuilder() {
48+
return new Builder().fromApiMetadata(this);
49+
}
50+
51+
public CloudDNSApiMetadata() {
52+
this(new Builder());
53+
}
54+
55+
protected CloudDNSApiMetadata(Builder builder) {
56+
super(builder);
57+
}
58+
59+
public static Properties defaultProperties() {
60+
Properties properties = BaseHttpApiMetadata.defaultProperties();
61+
properties.setProperty(SERVICE_TYPE, DNS);
62+
properties.setProperty(CREDENTIAL_TYPE, API_KEY_CREDENTIALS);
63+
return properties;
64+
}
65+
66+
public static class Builder extends BaseHttpApiMetadata.Builder<CloudDNSApi, Builder> {
67+
68+
protected Builder() {
69+
id("rackspace-clouddns")
70+
.name("Rackspace Cloud DNS API")
71+
.identityName("Username")
72+
.credentialName("API Key")
73+
.documentation(URI.create("http://docs.rackspace.com/cdns/api/v1.0/cdns-devguide/content/index.html"))
74+
.version("1.0")
75+
.defaultEndpoint("https://identity.api.rackspacecloud.com/v2.0/")
76+
.defaultProperties(CloudDNSApiMetadata.defaultProperties())
77+
.defaultModules(ImmutableSet.<Class<? extends Module>> builder()
78+
.add(CloudIdentityAuthenticationApiModule.class)
79+
.add(CloudIdentityAuthenticationModule.class)
80+
.add(ProviderModule.class)
81+
.add(CloudDNSHttpApiModule.class)
82+
.build());
83+
}
84+
85+
@Override
86+
public CloudDNSApiMetadata build() {
87+
return new CloudDNSApiMetadata(this);
88+
}
89+
90+
@Override
91+
protected Builder self() {
92+
return this;
93+
}
94+
}
95+
}

0 commit comments

Comments
 (0)