Implemented deleteUser global admin API

This commit is contained in:
andreisavu 2011-12-11 16:35:15 +02:00
parent a5fd2f7a05
commit f25289bf0f
2 changed files with 27 additions and 2 deletions

View File

@ -18,14 +18,22 @@
*/
package org.jclouds.cloudstack.features;
import com.google.common.util.concurrent.ListenableFuture;
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.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 Global
* Admin users.
*
*
* @author Andrei Savu
* @see <a href=
* "http://download.cloud.com/releases/2.2.0/api_2.2.12/TOC_Global_Admin.html"
@ -34,5 +42,14 @@ import org.jclouds.rest.annotations.RequestFilters;
@RequestFilters(QuerySigner.class)
@QueryParams(keys = "response", values = "json")
public interface GlobalUserAsyncClient extends DomainUserAsyncClient {
/**
* @see GlobalUserClient#deleteUser
*/
@GET
@QueryParams(keys = "command", values = "deleteUser")
@Consumes(MediaType.APPLICATION_JSON)
@ExceptionParser(ReturnNullOnNotFoundOr404.class)
ListenableFuture<Void> deleteUser(@QueryParam("id") long id);
}

View File

@ -20,6 +20,7 @@ package org.jclouds.cloudstack.features;
import java.util.concurrent.TimeUnit;
import org.jclouds.cloudstack.domain.User;
import org.jclouds.concurrent.Timeout;
/**
@ -34,4 +35,11 @@ import org.jclouds.concurrent.Timeout;
@Timeout(duration = 60, timeUnit = TimeUnit.SECONDS)
public interface GlobalUserClient extends DomainUserClient {
/**
* Delete an user with the specified ID
*
* @param id user ID
*/
Void deleteUser(long id);
}