Merge pull request #1188 from petergardfjall/master

#1184: fix for GleSYS provider
This commit is contained in:
Adrian Cole 2013-01-17 09:35:14 -08:00
commit 106fb99d6c
10 changed files with 67 additions and 10 deletions

View File

@ -29,7 +29,7 @@ import com.google.common.collect.FluentIterable;
*
* @author Adam Lowe
* @see ArchiveAsyncApi
* @see <a href="https://customer.glesys.com/api.php" />
* @see <a href="https://github.com/GleSYS/API/wiki/API-Documentation" />
*/
public interface ArchiveApi {

View File

@ -18,6 +18,7 @@
*/
package org.jclouds.glesys.features;
import javax.inject.Named;
import javax.ws.rs.Consumes;
import javax.ws.rs.FormParam;
import javax.ws.rs.GET;
@ -43,7 +44,7 @@ import com.google.common.util.concurrent.ListenableFuture;
*
* @author Adam Lowe
* @see ArchiveApi
* @see <a href="https://customer.glesys.com/api.php" />
* @see <a href="https://github.com/GleSYS/API/wiki/API-Documentation" />
*/
@RequestFilters(BasicAuthentication.class)
public interface ArchiveAsyncApi {
@ -51,6 +52,7 @@ public interface ArchiveAsyncApi {
/**
* @see ArchiveApi#list
*/
@Named("archive:list")
@POST
@Path("/archive/list/format/json")
@SelectJson("archives")
@ -61,6 +63,7 @@ public interface ArchiveAsyncApi {
/**
* @see ArchiveApi#get
*/
@Named("archive:details")
@POST
@Path("/archive/details/format/json")
@SelectJson("details")
@ -71,6 +74,7 @@ public interface ArchiveAsyncApi {
/**
* @see ArchiveApi#createWithCredentialsAndSize
*/
@Named("archive:create")
@POST
@Path("/archive/create/format/json")
@SelectJson("details")
@ -81,6 +85,7 @@ public interface ArchiveAsyncApi {
/**
* @see ArchiveApi#delete
*/
@Named("archive:delete")
@POST
@Path("/archive/delete/format/json")
ListenableFuture<Void> delete(@FormParam("username") String username);
@ -88,6 +93,7 @@ public interface ArchiveAsyncApi {
/**
* @see ArchiveApi#resize
*/
@Named("archive:resize")
@POST
@Path("/archive/resize/format/json")
@SelectJson("details")
@ -96,6 +102,7 @@ public interface ArchiveAsyncApi {
/**
* @see ArchiveApi#changePassword
*/
@Named("archive:changepassword")
@POST
@Path("/archive/changepassword/format/json")
@SelectJson("details")
@ -105,6 +112,7 @@ public interface ArchiveAsyncApi {
/**
* @see org.jclouds.glesys.features.ArchiveApi#getAllowedArguments
*/
@Named("archive:allowedarguments")
@GET
@Path("/archive/allowedarguments/format/json")
@SelectJson("argumentslist")

View File

@ -34,7 +34,7 @@ import com.google.common.collect.FluentIterable;
*
* @author Adam Lowe
* @see DomainAsyncApi
* @see <a href="https://customer.glesys.com/api.php" />
* @see <a href="https://github.com/GleSYS/API/wiki/API-Documentation" />
*/
public interface DomainApi {

View File

@ -20,6 +20,7 @@ package org.jclouds.glesys.features;
import java.util.Set;
import javax.inject.Named;
import javax.ws.rs.Consumes;
import javax.ws.rs.FormParam;
import javax.ws.rs.POST;
@ -48,7 +49,7 @@ import com.google.common.util.concurrent.ListenableFuture;
*
* @author Adam Lowe
* @see DomainApi
* @see <a href="https://customer.glesys.com/api.php" />
* @see <a href="https://github.com/GleSYS/API/wiki/API-Documentation" />
*/
@RequestFilters(BasicAuthentication.class)
public interface DomainAsyncApi {
@ -56,6 +57,7 @@ public interface DomainAsyncApi {
/**
* @see org.jclouds.glesys.features.DomainApi#list
*/
@Named("domain:list")
@POST
@Path("/domain/list/format/json")
@SelectJson("domains")
@ -66,6 +68,7 @@ public interface DomainAsyncApi {
/**
* @see org.jclouds.glesys.features.DomainApi#get
*/
@Named("domain:details")
@POST
@Path("/domain/details/format/json")
@SelectJson("domain")
@ -76,6 +79,7 @@ public interface DomainAsyncApi {
/**
* @see DomainApi#create
*/
@Named("domain:add")
@POST
@Path("/domain/add/format/json")
@SelectJson("domain")
@ -85,6 +89,7 @@ public interface DomainAsyncApi {
/**
* @see DomainApi#update
*/
@Named("domain:edit")
@POST
@Path("/domain/edit/format/json")
@SelectJson("domain")
@ -95,6 +100,7 @@ public interface DomainAsyncApi {
/**
* @see DomainApi#delete
*/
@Named("domain:delete")
@POST
@Path("/domain/delete/format/json")
ListenableFuture<Void> delete(@FormParam("domainname") String domain);
@ -102,6 +108,7 @@ public interface DomainAsyncApi {
/**
* @see DomainApi#listRecords
*/
@Named("domain:listrecords")
@POST
@Path("/domain/listrecords/format/json")
@SelectJson("records")
@ -111,6 +118,7 @@ public interface DomainAsyncApi {
/**
* @see DomainApi#createRecord
*/
@Named("domain:addrecord")
@POST
@Path("/domain/addrecord/format/json")
@SelectJson("record")
@ -122,6 +130,7 @@ public interface DomainAsyncApi {
/**
* @see DomainApi#updateRecord
*/
@Named("domain:updaterecord")
@POST
@Path("/domain/updaterecord/format/json")
@SelectJson("record")
@ -131,6 +140,7 @@ public interface DomainAsyncApi {
/**
* @see DomainApi#deleteRecord
*/
@Named("domain:deleterecord")
@POST
@Path("/domain/deleterecord/format/json")
ListenableFuture<Void> deleteRecord(@FormParam("recordid") String recordId);

View File

@ -32,7 +32,7 @@ import com.google.common.collect.FluentIterable;
*
* @author Adam Lowe
* @see org.jclouds.glesys.features.EmailAccountAsyncApi
* @see <a href="https://customer.glesys.com/api.php" />
* @see <a href="https://github.com/GleSYS/API/wiki/API-Documentation" />
*/
public interface EmailAccountApi {

View File

@ -18,6 +18,7 @@
*/
package org.jclouds.glesys.features;
import javax.inject.Named;
import javax.ws.rs.Consumes;
import javax.ws.rs.FormParam;
import javax.ws.rs.POST;
@ -46,7 +47,7 @@ import com.google.common.util.concurrent.ListenableFuture;
*
* @author Adam Lowe
* @see org.jclouds.glesys.features.EmailAccountApi
* @see <a href="https://customer.glesys.com/api.php" />
* @see <a href="https://github.com/GleSYS/API/wiki/API-Documentation" />
*/
@RequestFilters(BasicAuthentication.class)
public interface EmailAccountAsyncApi {
@ -54,6 +55,7 @@ public interface EmailAccountAsyncApi {
/**
* @see org.jclouds.glesys.features.EmailAccountApi#getOverview
*/
@Named("email:overview")
@POST
@Path("/email/overview/format/json")
@SelectJson("overview")
@ -64,6 +66,7 @@ public interface EmailAccountAsyncApi {
/**
* @see org.jclouds.glesys.features.EmailAccountApi#listDomain
*/
@Named("email:list:accounts")
@POST
@Path("/email/list/format/json")
@SelectJson("emailaccounts")
@ -74,6 +77,7 @@ public interface EmailAccountAsyncApi {
/**
* @see org.jclouds.glesys.features.EmailAccountApi#listAliasesInDomain
*/
@Named("email:list:aliases")
@POST
@Path("/email/list/format/json")
@SelectJson("emailaliases")
@ -84,6 +88,7 @@ public interface EmailAccountAsyncApi {
/**
* @see org.jclouds.glesys.features.EmailAccountApi#createWithPassword
*/
@Named("email:createaccount")
@POST
@Consumes(MediaType.APPLICATION_JSON)
@SelectJson("emailaccount")
@ -93,6 +98,7 @@ public interface EmailAccountAsyncApi {
/**
* @see org.jclouds.glesys.features.EmailAccountApi#createAlias
*/
@Named("email:createalias")
@POST
@Consumes(MediaType.APPLICATION_JSON)
@SelectJson("alias")
@ -102,6 +108,7 @@ public interface EmailAccountAsyncApi {
/**
* @see org.jclouds.glesys.features.EmailAccountApi#update
*/
@Named("email:editaccount")
@POST
@Consumes(MediaType.APPLICATION_JSON)
@SelectJson("emailaccount")
@ -111,6 +118,7 @@ public interface EmailAccountAsyncApi {
/**
* @see org.jclouds.glesys.features.EmailAccountApi#updateAlias
*/
@Named("email:editalias")
@POST
@Consumes(MediaType.APPLICATION_JSON)
@SelectJson("alias")
@ -120,6 +128,7 @@ public interface EmailAccountAsyncApi {
/**
* @see org.jclouds.glesys.features.EmailAccountApi#delete
*/
@Named("email:delete")
@POST
@Path("/email/delete/format/json")
@Fallback(TrueOnNotFoundOr404.class)

View File

@ -29,7 +29,7 @@ import com.google.common.collect.FluentIterable;
*
* @author Adrian Cole, Mattias Holmqvist, Adam Lowe
* @see IpAsyncApi
* @see <a href="https://customer.glesys.com/api.php" />
* @see <a href="https://github.com/GleSYS/API/wiki/API-Documentation" />
*/
public interface IpApi {
/**

View File

@ -18,6 +18,7 @@
*/
package org.jclouds.glesys.features;
import javax.inject.Named;
import javax.ws.rs.Consumes;
import javax.ws.rs.FormParam;
import javax.ws.rs.GET;
@ -45,13 +46,14 @@ import com.google.common.util.concurrent.ListenableFuture;
*
* @author Adrian Cole, Mattias Holmqvist, Adam Lowe
* @see IpApi
* @see <a href="https://customer.glesys.com/api.php" />
* @see <a href="https://github.com/GleSYS/API/wiki/API-Documentation" />
*/
@RequestFilters(BasicAuthentication.class)
public interface IpAsyncApi {
/**
* @see IpApi#listFree
*/
@Named("ip:listfree")
@GET
@Path("/ip/listfree/ipversion/{ipversion}/datacenter/{datacenter}/platform/{platform}/format/json")
@Consumes(MediaType.APPLICATION_JSON)
@ -64,6 +66,7 @@ public interface IpAsyncApi {
/**
* @see IpApi#take
*/
@Named("ip:take")
@POST
@Path("/ip/take/format/json")
@SelectJson("details")
@ -73,6 +76,7 @@ public interface IpAsyncApi {
/**
* @see IpApi#release
*/
@Named("ip:release")
@POST
@Path("/ip/release/format/json")
@SelectJson("details")
@ -82,6 +86,7 @@ public interface IpAsyncApi {
/**
* @see IpApi#list
*/
@Named("ip:listown")
@GET
@Path("/ip/listown/format/json")
@Consumes(MediaType.APPLICATION_JSON)
@ -92,6 +97,7 @@ public interface IpAsyncApi {
/**
* @see IpApi#get
*/
@Named("ip:details")
@GET
@Path("/ip/details/ipaddress/{ipaddress}/format/json")
@SelectJson("details")
@ -102,6 +108,7 @@ public interface IpAsyncApi {
/**
* @see IpApi#addToServer
*/
@Named("ip:add")
@POST
@Path("/ip/add/format/json")
@SelectJson("details")
@ -112,6 +119,7 @@ public interface IpAsyncApi {
/**
* @see IpApi#removeFromServer
*/
@Named("ip:remove")
@POST
@Path("/ip/remove/format/json")
@SelectJson("details")
@ -122,6 +130,7 @@ public interface IpAsyncApi {
/**
* @see IpApi#removeFromServer
*/
@Named("ip:remove:release")
@POST
@FormParams(keys = "release", values = "true")
@Path("/ip/remove/format/json")
@ -133,6 +142,7 @@ public interface IpAsyncApi {
/**
* @see IpApi#setPtr
*/
@Named("ip:setptr")
@POST
@Path("/ip/setptr/format/json")
@SelectJson("details")
@ -143,6 +153,7 @@ public interface IpAsyncApi {
/**
* @see IpApi#resetPtr
*/
@Named("ip:resetptr")
@POST
@Path("/ip/resetptr/format/json")
@SelectJson("details")

View File

@ -44,7 +44,7 @@ import com.google.common.collect.FluentIterable;
* @author Adrian Cole
* @author Adam Lowe
* @see ServerAsyncApi
* @see <a href="https://customer.glesys.com/api.php" />
* @see <a href="https://github.com/GleSYS/API/wiki/API-Documentation" />
*/
public interface ServerApi {

View File

@ -21,6 +21,7 @@ package org.jclouds.glesys.features;
import java.util.Map;
import java.util.SortedMap;
import javax.inject.Named;
import javax.ws.rs.Consumes;
import javax.ws.rs.FormParam;
import javax.ws.rs.GET;
@ -64,7 +65,7 @@ import com.google.common.util.concurrent.ListenableFuture;
* @author Adrian Cole
* @author Adam Lowe
* @see ServerApi
* @see <a href="https://customer.glesys.com/api.php" />
* @see <a href="https://github.com/GleSYS/API/wiki/API-Documentation" />
*/
@RequestFilters(BasicAuthentication.class)
public interface ServerAsyncApi {
@ -72,6 +73,7 @@ public interface ServerAsyncApi {
/**
* @see ServerApi#list
*/
@Named("server:list")
@POST
@Path("/server/list/format/json")
@SelectJson("servers")
@ -82,6 +84,7 @@ public interface ServerAsyncApi {
/**
* @see ServerApi#get
*/
@Named("server:details")
@POST
@Path("/server/details/format/json")
@SelectJson("server")
@ -93,6 +96,7 @@ public interface ServerAsyncApi {
/**
* @see ServerApi#getStatus
*/
@Named("server:status")
@POST
@Path("/server/status/format/json")
@SelectJson("server")
@ -103,6 +107,7 @@ public interface ServerAsyncApi {
/**
* @see ServerApi#getLimits
*/
@Named("server:limits")
@POST
@Path("/server/limits/format/json")
@SelectJson("limits")
@ -113,6 +118,7 @@ public interface ServerAsyncApi {
/**
* @see ServerApi#getConsole
*/
@Named("server:console")
@POST
@Path("/server/console/format/json")
@SelectJson("console")
@ -123,6 +129,7 @@ public interface ServerAsyncApi {
/**
* @see ServerApi#getAllowedArgumentsForCreateByPlatform
*/
@Named("server:allowedarguments")
@GET
@Path("/server/allowedarguments/format/json")
@SelectJson("argumentslist")
@ -132,6 +139,7 @@ public interface ServerAsyncApi {
/**
* @see ServerApi#listTemplates
*/
@Named("server:templates")
@GET
@Path("/server/templates/format/json")
@ResponseParser(ParseTemplatesFromHttpResponse.class)
@ -142,6 +150,7 @@ public interface ServerAsyncApi {
/**
* @see ServerApi#stop
*/
@Named("server:resetlimit")
@POST
@Path("/server/resetlimit/format/json")
@Consumes(MediaType.APPLICATION_JSON)
@ -151,6 +160,7 @@ public interface ServerAsyncApi {
/**
* @see ServerApi#reboot
*/
@Named("server:reboot")
@POST
@SelectJson("server")
@Path("/server/reboot/format/json")
@ -160,6 +170,7 @@ public interface ServerAsyncApi {
/**
* @see ServerApi#start
*/
@Named("server:start")
@POST
@SelectJson("server")
@Path("/server/start/format/json")
@ -169,6 +180,7 @@ public interface ServerAsyncApi {
/**
* @see ServerApi#stop
*/
@Named("server:stop")
@POST
@SelectJson("server")
@Path("/server/stop/format/json")
@ -178,6 +190,7 @@ public interface ServerAsyncApi {
/**
* @see ServerApi#hardStop
*/
@Named("server:stop:hard")
@POST
@SelectJson("server")
@Path("/server/stop/format/json")
@ -188,6 +201,7 @@ public interface ServerAsyncApi {
/**
* @see ServerApi#createWithHostnameAndRootPassword
*/
@Named("server:create")
@POST
@SelectJson("server")
@Path("/server/create/format/json")
@ -200,6 +214,7 @@ public interface ServerAsyncApi {
/**
* @see ServerApi#clone
*/
@Named("server:clone")
@POST
@Path("/server/clone/format/json")
@SelectJson("server")
@ -210,6 +225,7 @@ public interface ServerAsyncApi {
/**
* @see ServerApi#update
*/
@Named("server:edit")
@POST
@Path("/server/edit/format/json")
@SelectJson("server")
@ -219,6 +235,7 @@ public interface ServerAsyncApi {
/**
* @see ServerApi#destroy
*/
@Named("server:destroy")
@POST
@Path("/server/destroy/format/json")
ListenableFuture<Void> destroy(@FormParam("serverid") String id, DestroyServerOptions keepIp);
@ -226,6 +243,7 @@ public interface ServerAsyncApi {
/**
* @see ServerApi#resetPassword
*/
@Named("server:resetpassword")
@POST
@Path("/server/resetpassword/format/json")
@SelectJson("server")
@ -235,6 +253,7 @@ public interface ServerAsyncApi {
/**
* @see ServerApi#getResourceUsage
*/
@Named("server:resourceusage")
@POST
@Path("/server/resourceusage/format/json")
@SelectJson("usage")