diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/DomainUserAsyncClient.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/DomainUserAsyncClient.java index a3af532e67..b50bd7dcf8 100644 --- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/DomainUserAsyncClient.java +++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/DomainUserAsyncClient.java @@ -18,9 +18,19 @@ */ package org.jclouds.cloudstack.features; +import com.google.common.util.concurrent.ListenableFuture; +import org.jclouds.cloudstack.domain.User; import org.jclouds.cloudstack.filters.QuerySigner; +import org.jclouds.rest.annotations.ExceptionParser; import org.jclouds.rest.annotations.QueryParams; import org.jclouds.rest.annotations.RequestFilters; +import org.jclouds.rest.annotations.SelectJson; +import org.jclouds.rest.functions.ReturnNullOnNotFoundOr404; + +import javax.ws.rs.Consumes; +import javax.ws.rs.GET; +import javax.ws.rs.QueryParam; +import javax.ws.rs.core.MediaType; /** * Provides asynchronous access to CloudStack User features available to Domain @@ -33,6 +43,26 @@ import org.jclouds.rest.annotations.RequestFilters; */ @RequestFilters(QuerySigner.class) @QueryParams(keys = "response", values = "json") -public interface DomainUserAsyncClient extends AccountAsyncClient { +public interface DomainUserAsyncClient { + + /** + * @see DomainUserClient#enableUser + */ + @GET + @QueryParams(keys = "command", values = "enableUser") + @SelectJson("user") + @Consumes(MediaType.APPLICATION_JSON) + @ExceptionParser(ReturnNullOnNotFoundOr404.class) + ListenableFuture enableUser(@QueryParam("id") long userId); + + /** + * @see DomainUserClient#disableUser + */ + @GET + @QueryParams(keys = "command", values = "disableUser") + @SelectJson("user") + @Consumes(MediaType.APPLICATION_JSON) + @ExceptionParser(ReturnNullOnNotFoundOr404.class) + ListenableFuture disableUser(@QueryParam("id") long userId); } diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/DomainUserClient.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/DomainUserClient.java index 036300102e..f78a719874 100644 --- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/DomainUserClient.java +++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/DomainUserClient.java @@ -18,6 +18,7 @@ */ package org.jclouds.cloudstack.features; +import org.jclouds.cloudstack.domain.User; import org.jclouds.concurrent.Timeout; import java.util.concurrent.TimeUnit; @@ -32,7 +33,19 @@ import java.util.concurrent.TimeUnit; * /> */ @Timeout(duration = 60, timeUnit = TimeUnit.SECONDS) -public interface DomainUserClient extends AccountClient { +public interface DomainUserClient { + /** + * Enable a user with a specific ID + * + * @param userId + * the user ID to enable + */ + User enableUser(long userId); + + /** + * Disable a user with a specific ID + */ + User disableUser(long userId); }