You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jclouds.apache.org by ab...@apache.org on 2013/07/01 21:15:09 UTC
[22/24] JCLOUDS-151 - CloudStack refactored to remove async,
*Client renamed to *Api.
http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/c6986efd/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/DomainDomainApi.java
----------------------------------------------------------------------
diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/DomainDomainApi.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/DomainDomainApi.java
new file mode 100644
index 0000000..99f3364
--- /dev/null
+++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/DomainDomainApi.java
@@ -0,0 +1,100 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.cloudstack.features;
+
+import java.util.Set;
+
+import javax.inject.Named;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.MediaType;
+
+import org.jclouds.Fallbacks.EmptySetOnNotFoundOr404;
+import org.jclouds.Fallbacks.NullOnNotFoundOr404;
+import org.jclouds.cloudstack.domain.Domain;
+import org.jclouds.cloudstack.filters.AuthenticationFilter;
+import org.jclouds.cloudstack.options.ListDomainChildrenOptions;
+import org.jclouds.cloudstack.options.ListDomainsOptions;
+import org.jclouds.rest.annotations.Fallback;
+import org.jclouds.rest.annotations.OnlyElement;
+import org.jclouds.rest.annotations.QueryParams;
+import org.jclouds.rest.annotations.RequestFilters;
+import org.jclouds.rest.annotations.SelectJson;
+
+/**
+ * Provides synchronous access to CloudStack Domain features available to Domain
+ * Admin users.
+ *
+ * @author Andrei Savu
+ * @see <a href=
+ * "http://download.cloud.com/releases/2.2.0/api_2.2.12/TOC_Domain_Admin.html"
+ * />
+ */
+@RequestFilters(AuthenticationFilter.class)
+@QueryParams(keys = "response", values = "json")
+public interface DomainDomainApi {
+
+ /**
+ * List domains with detailed information
+ *
+ * @param options
+ * list filtering optional arguments
+ * @return
+ * set of domain instances or empty
+ */
+ @Named("listDomains")
+ @GET
+ @QueryParams(keys = { "command", "listAll" }, values = { "listDomains", "true" })
+ @SelectJson("domain")
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Fallback(EmptySetOnNotFoundOr404.class)
+ Set<Domain> listDomains(ListDomainsOptions... options);
+
+ /**
+ * Get a domain by ID
+ *
+ * @param domainId
+ * domain ID
+ * @return
+ * domain instance or null
+ */
+ @Named("listDomains")
+ @GET
+ @QueryParams(keys = { "command", "listAll" }, values = { "listDomains", "true" })
+ @SelectJson("domain")
+ @OnlyElement
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Fallback(NullOnNotFoundOr404.class)
+ Domain getDomainById(@QueryParam("id") String domainId);
+
+ /**
+ * Lists all children domains belonging to a specified domain
+ *
+ * @param options
+ * list filtering optional arguments
+ * @return
+ * set of domain instances or empty
+ */
+ @Named("listDomainChildren")
+ @GET
+ @QueryParams(keys = { "command", "listAll" }, values = { "listDomainChildren", "true" })
+ @SelectJson("domain")
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Fallback(EmptySetOnNotFoundOr404.class)
+ Set<Domain> listDomainChildren(ListDomainChildrenOptions... options);
+}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/c6986efd/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/DomainDomainAsyncClient.java
----------------------------------------------------------------------
diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/DomainDomainAsyncClient.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/DomainDomainAsyncClient.java
deleted file mode 100644
index fc499a1..0000000
--- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/DomainDomainAsyncClient.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.cloudstack.features;
-
-import java.util.Set;
-
-import javax.inject.Named;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.GET;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.MediaType;
-
-import org.jclouds.Fallbacks.EmptySetOnNotFoundOr404;
-import org.jclouds.Fallbacks.NullOnNotFoundOr404;
-import org.jclouds.cloudstack.domain.Domain;
-import org.jclouds.cloudstack.filters.AuthenticationFilter;
-import org.jclouds.cloudstack.options.ListDomainChildrenOptions;
-import org.jclouds.cloudstack.options.ListDomainsOptions;
-import org.jclouds.rest.annotations.Fallback;
-import org.jclouds.rest.annotations.OnlyElement;
-import org.jclouds.rest.annotations.QueryParams;
-import org.jclouds.rest.annotations.RequestFilters;
-import org.jclouds.rest.annotations.SelectJson;
-
-import com.google.common.util.concurrent.ListenableFuture;
-
-/**
- * Provides asynchronous access to CloudStack Domain features available to Domain
- * Admin users.
- *
- * @author Andrei Savu
- * @see <a href=
- * "http://download.cloud.com/releases/2.2.0/api_2.2.12/TOC_Domain_Admin.html"
- * />
- */
-@RequestFilters(AuthenticationFilter.class)
-@QueryParams(keys = "response", values = "json")
-public interface DomainDomainAsyncClient {
-
- /**
- * @see DomainDomainClient#listDomains
- */
- @Named("listDomains")
- @GET
- @QueryParams(keys = { "command", "listAll" }, values = { "listDomains", "true" })
- @SelectJson("domain")
- @Consumes(MediaType.APPLICATION_JSON)
- @Fallback(EmptySetOnNotFoundOr404.class)
- ListenableFuture<Set<Domain>> listDomains(ListDomainsOptions... options);
-
- /**
- * @see DomainDomainClient#getDomainById
- */
- @Named("listDomains")
- @GET
- @QueryParams(keys = { "command", "listAll" }, values = { "listDomains", "true" })
- @SelectJson("domain")
- @OnlyElement
- @Consumes(MediaType.APPLICATION_JSON)
- @Fallback(NullOnNotFoundOr404.class)
- ListenableFuture<Domain> getDomainById(@QueryParam("id") String domainId);
-
- /**
- * @see DomainDomainClient#listDomainChildren
- */
- @Named("listDomainChildren")
- @GET
- @QueryParams(keys = { "command", "listAll" }, values = { "listDomainChildren", "true" })
- @SelectJson("domain")
- @Consumes(MediaType.APPLICATION_JSON)
- @Fallback(EmptySetOnNotFoundOr404.class)
- ListenableFuture<Set<Domain>> listDomainChildren(ListDomainChildrenOptions... options);
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/c6986efd/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/DomainDomainClient.java
----------------------------------------------------------------------
diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/DomainDomainClient.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/DomainDomainClient.java
deleted file mode 100644
index bdf2c27..0000000
--- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/DomainDomainClient.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.cloudstack.features;
-
-import java.util.Set;
-import org.jclouds.cloudstack.domain.Domain;
-import org.jclouds.cloudstack.options.ListDomainChildrenOptions;
-import org.jclouds.cloudstack.options.ListDomainsOptions;
-
-/**
- * Provides synchronous access to CloudStack Domain features available to Domain
- * Admin users.
- *
- * @author Andrei Savu
- * @see <a href=
- * "http://download.cloud.com/releases/2.2.0/api_2.2.12/TOC_Domain_Admin.html"
- * />
- */
-public interface DomainDomainClient {
-
- /**
- * List domains with detailed information
- *
- * @param options
- * list filtering optional arguments
- * @return
- * set of domain instances or empty
- */
- Set<Domain> listDomains(ListDomainsOptions... options);
-
- /**
- * Get a domain by ID
- *
- * @param domainId
- * domain ID
- * @return
- * domain instance or null
- */
- Domain getDomainById(String domainId);
-
- /**
- * Lists all children domains belonging to a specified domain
- *
- * @param options
- * list filtering optional arguments
- * @return
- * set of domain instances or empty
- */
- Set<Domain> listDomainChildren(ListDomainChildrenOptions... options);
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/c6986efd/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/DomainLimitApi.java
----------------------------------------------------------------------
diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/DomainLimitApi.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/DomainLimitApi.java
new file mode 100644
index 0000000..3ac22b0
--- /dev/null
+++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/DomainLimitApi.java
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.cloudstack.features;
+
+import javax.inject.Named;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
+import javax.ws.rs.core.MediaType;
+
+import org.jclouds.cloudstack.binders.ResourceLimitToQueryParams;
+import org.jclouds.cloudstack.domain.ResourceLimit;
+import org.jclouds.cloudstack.filters.AuthenticationFilter;
+import org.jclouds.rest.annotations.BinderParam;
+import org.jclouds.rest.annotations.QueryParams;
+import org.jclouds.rest.annotations.RequestFilters;
+import org.jclouds.rest.annotations.SelectJson;
+
+/**
+ * Provides synchronous access to CloudStack Limit features available to Domain
+ * Admin users.
+ *
+ * @author Adrian Cole
+ * @see <a href=
+ * "http://download.cloud.com/releases/2.2.0/api_2.2.12/TOC_Domain_Admin.html"
+ * />
+ */
+@RequestFilters(AuthenticationFilter.class)
+@QueryParams(keys = "response", values = "json")
+public interface DomainLimitApi extends LimitApi {
+ /**
+ * Updates resource limits for an account in a domain.
+ *
+ * @param limit
+ * what you are updating
+ */
+ @Named("updateResourceLimit")
+ @GET
+ @QueryParams(keys = "command", values = "updateResourceLimit")
+ @SelectJson("resourcelimit")
+ @Consumes(MediaType.APPLICATION_JSON)
+ ResourceLimit updateResourceLimit(@BinderParam(ResourceLimitToQueryParams.class) ResourceLimit limit);
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/c6986efd/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/DomainLimitAsyncClient.java
----------------------------------------------------------------------
diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/DomainLimitAsyncClient.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/DomainLimitAsyncClient.java
deleted file mode 100644
index 881fae7..0000000
--- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/DomainLimitAsyncClient.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.cloudstack.features;
-
-import javax.inject.Named;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.GET;
-import javax.ws.rs.core.MediaType;
-
-import org.jclouds.cloudstack.binders.ResourceLimitToQueryParams;
-import org.jclouds.cloudstack.domain.ResourceLimit;
-import org.jclouds.cloudstack.filters.AuthenticationFilter;
-import org.jclouds.rest.annotations.BinderParam;
-import org.jclouds.rest.annotations.QueryParams;
-import org.jclouds.rest.annotations.RequestFilters;
-import org.jclouds.rest.annotations.SelectJson;
-
-import com.google.common.util.concurrent.ListenableFuture;
-
-/**
- * Provides asynchronous access to CloudStack Limit features available to Domain
- * Admin users.
- *
- * @author Adrian Cole
- * @see <a href=
- * "http://download.cloud.com/releases/2.2.0/api_2.2.12/TOC_Domain_Admin.html"
- * />
- */
-@RequestFilters(AuthenticationFilter.class)
-@QueryParams(keys = "response", values = "json")
-public interface DomainLimitAsyncClient extends LimitAsyncClient {
- /**
- * @see DomainLimitClient#updateResourceLimit
- */
- @Named("updateResourceLimit")
- @GET
- @QueryParams(keys = "command", values = "updateResourceLimit")
- @SelectJson("resourcelimit")
- @Consumes(MediaType.APPLICATION_JSON)
- ListenableFuture<ResourceLimit> updateResourceLimit(
- @BinderParam(ResourceLimitToQueryParams.class) ResourceLimit limit);
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/c6986efd/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/DomainLimitClient.java
----------------------------------------------------------------------
diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/DomainLimitClient.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/DomainLimitClient.java
deleted file mode 100644
index d3e8d07..0000000
--- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/DomainLimitClient.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.cloudstack.features;
-
-import org.jclouds.cloudstack.domain.ResourceLimit;
-
-/**
- * Provides synchronous access to CloudStack Limit features available to Domain
- * Admin users.
- *
- * @author Adrian Cole
- * @see <a href=
- * "http://download.cloud.com/releases/2.2.0/api_2.2.12/TOC_Domain_Admin.html"
- * />
- */
-public interface DomainLimitClient extends LimitClient {
- /**
- * Updates resource limits for an account in a domain.
- *
- * @param limit
- * what you are updating
- */
- ResourceLimit updateResourceLimit(ResourceLimit limit);
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/c6986efd/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/DomainUserApi.java
----------------------------------------------------------------------
diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/DomainUserApi.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/DomainUserApi.java
new file mode 100644
index 0000000..d1167d7
--- /dev/null
+++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/DomainUserApi.java
@@ -0,0 +1,92 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.cloudstack.features;
+
+import java.util.Set;
+
+import javax.inject.Named;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.MediaType;
+
+import org.jclouds.Fallbacks.EmptySetOnNotFoundOr404;
+import org.jclouds.Fallbacks.NullOnNotFoundOr404;
+import org.jclouds.cloudstack.domain.AsyncCreateResponse;
+import org.jclouds.cloudstack.domain.User;
+import org.jclouds.cloudstack.filters.AuthenticationFilter;
+import org.jclouds.cloudstack.options.ListUsersOptions;
+import org.jclouds.rest.annotations.Fallback;
+import org.jclouds.rest.annotations.QueryParams;
+import org.jclouds.rest.annotations.RequestFilters;
+import org.jclouds.rest.annotations.SelectJson;
+import org.jclouds.rest.annotations.Unwrap;
+
+/**
+ * Provides synchronous access to CloudStack User features available to Domain
+ * Admin users.
+ *
+ * @author Andrei Savu
+ * @see <a href=
+ * "http://download.cloud.com/releases/2.2.0/api_2.2.12/TOC_Domain_Admin.html"
+ * />
+ */
+@RequestFilters(AuthenticationFilter.class)
+@QueryParams(keys = "response", values = "json")
+public interface DomainUserApi {
+
+ /**
+ * Lists Users
+ *
+ * @param options
+ * if present, how to constrain the list.
+ * @return Users matching query, or empty set, if no Accounts are found
+ */
+ @Named("listUsers")
+ @GET
+ @QueryParams(keys = "command", values = "listUsers")
+ @SelectJson("user")
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Fallback(EmptySetOnNotFoundOr404.class)
+ Set<User> listUsers(ListUsersOptions... options);
+
+ /**
+ * Enable a user with a specific ID
+ *
+ * @param userId
+ * the user ID to enable
+ */
+ @Named("enableUser")
+ @GET
+ @QueryParams(keys = "command", values = "enableUser")
+ @SelectJson("user")
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Fallback(NullOnNotFoundOr404.class)
+ User enableUser(@QueryParam("id") String userId);
+
+ /**
+ * Disable a user with a specific ID
+ */
+ @Named("disableUser")
+ @GET
+ @QueryParams(keys = "command", values = "disableUser")
+ @Unwrap
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Fallback(NullOnNotFoundOr404.class)
+ AsyncCreateResponse disableUser(@QueryParam("id") String userId);
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/c6986efd/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/DomainUserAsyncClient.java
----------------------------------------------------------------------
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
deleted file mode 100644
index a5d42a5..0000000
--- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/DomainUserAsyncClient.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.cloudstack.features;
-
-import java.util.Set;
-
-import javax.inject.Named;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.GET;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.MediaType;
-
-import org.jclouds.Fallbacks.EmptySetOnNotFoundOr404;
-import org.jclouds.Fallbacks.NullOnNotFoundOr404;
-import org.jclouds.cloudstack.domain.AsyncCreateResponse;
-import org.jclouds.cloudstack.domain.User;
-import org.jclouds.cloudstack.filters.AuthenticationFilter;
-import org.jclouds.cloudstack.options.ListUsersOptions;
-import org.jclouds.rest.annotations.Fallback;
-import org.jclouds.rest.annotations.QueryParams;
-import org.jclouds.rest.annotations.RequestFilters;
-import org.jclouds.rest.annotations.SelectJson;
-import org.jclouds.rest.annotations.Unwrap;
-
-import com.google.common.util.concurrent.ListenableFuture;
-
-/**
- * Provides asynchronous access to CloudStack User features available to Domain
- * Admin users.
- *
- * @author Andrei Savu
- * @see <a href=
- * "http://download.cloud.com/releases/2.2.0/api_2.2.12/TOC_Domain_Admin.html"
- * />
- */
-@RequestFilters(AuthenticationFilter.class)
-@QueryParams(keys = "response", values = "json")
-public interface DomainUserAsyncClient {
-
- /**
- * @see DomainUserClient#listUsers
- */
- @Named("listUsers")
- @GET
- @QueryParams(keys = "command", values = "listUsers")
- @SelectJson("user")
- @Consumes(MediaType.APPLICATION_JSON)
- @Fallback(EmptySetOnNotFoundOr404.class)
- ListenableFuture<Set<User>> listUsers(ListUsersOptions... options);
-
- /**
- * @see DomainUserClient#enableUser
- */
- @Named("enableUser")
- @GET
- @QueryParams(keys = "command", values = "enableUser")
- @SelectJson("user")
- @Consumes(MediaType.APPLICATION_JSON)
- @Fallback(NullOnNotFoundOr404.class)
- ListenableFuture<User> enableUser(@QueryParam("id") String userId);
-
- /**
- * @see DomainUserClient#disableUser
- */
- @Named("disableUser")
- @GET
- @QueryParams(keys = "command", values = "disableUser")
- @Unwrap
- @Consumes(MediaType.APPLICATION_JSON)
- @Fallback(NullOnNotFoundOr404.class)
- ListenableFuture<AsyncCreateResponse> disableUser(@QueryParam("id") String userId);
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/c6986efd/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/DomainUserClient.java
----------------------------------------------------------------------
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
deleted file mode 100644
index f1eeed0..0000000
--- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/DomainUserClient.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.cloudstack.features;
-
-import java.util.Set;
-import org.jclouds.cloudstack.domain.AsyncCreateResponse;
-import org.jclouds.cloudstack.domain.User;
-import org.jclouds.cloudstack.options.ListUsersOptions;
-
-/**
- * Provides synchronous access to CloudStack User features available to Domain
- * Admin users.
- *
- * @author Andrei Savu
- * @see <a href=
- * "http://download.cloud.com/releases/2.2.0/api_2.2.12/TOC_Domain_Admin.html"
- * />
- */
-public interface DomainUserClient {
-
- /**
- * Lists Users
- *
- * @param options
- * if present, how to constrain the list.
- * @return Users matching query, or empty set, if no Accounts are found
- */
- Set<User> listUsers(ListUsersOptions... options);
-
- /**
- * Enable a user with a specific ID
- *
- * @param userId
- * the user ID to enable
- */
- User enableUser(String userId);
-
- /**
- * Disable a user with a specific ID
- */
- AsyncCreateResponse disableUser(String userId);
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/c6986efd/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/EventApi.java
----------------------------------------------------------------------
diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/EventApi.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/EventApi.java
new file mode 100644
index 0000000..5834ecd
--- /dev/null
+++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/EventApi.java
@@ -0,0 +1,73 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.cloudstack.features;
+
+import java.util.Set;
+
+import javax.inject.Named;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
+import javax.ws.rs.core.MediaType;
+
+import org.jclouds.Fallbacks.EmptySetOnNotFoundOr404;
+import org.jclouds.cloudstack.domain.Event;
+import org.jclouds.cloudstack.filters.AuthenticationFilter;
+import org.jclouds.cloudstack.functions.ParseEventTypesFromHttpResponse;
+import org.jclouds.cloudstack.options.ListEventsOptions;
+import org.jclouds.rest.annotations.Fallback;
+import org.jclouds.rest.annotations.QueryParams;
+import org.jclouds.rest.annotations.RequestFilters;
+import org.jclouds.rest.annotations.ResponseParser;
+import org.jclouds.rest.annotations.SelectJson;
+
+/**
+ * Provides synchronous access to cloudstack via their REST API.
+ * <p/>
+ *
+ * @author Vijay Kiran
+ * @see <a href="http://download.cloud.com/releases/2.2.0/api_2.2.12/TOC_User.html" />
+ */
+@RequestFilters(AuthenticationFilter.class)
+@QueryParams(keys = { "response", "listAll" }, values = { "json", "true" })
+public interface EventApi {
+ /**
+ * List Event Types
+ *
+ * @return event types or null if not found
+ */
+ @Named("listEventTypes")
+ @GET
+ @QueryParams(keys = "command", values = "listEventTypes")
+ @Consumes(MediaType.APPLICATION_JSON)
+ @ResponseParser(ParseEventTypesFromHttpResponse.class)
+ @Fallback(EmptySetOnNotFoundOr404.class)
+ Set<String> listEventTypes();
+
+ /**
+ * List Events
+ *
+ * @return event list or null if not found
+ */
+ @Named("listEventTypes")
+ @GET
+ @QueryParams(keys = "command", values = "listEvents")
+ @SelectJson("event")
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Fallback(EmptySetOnNotFoundOr404.class)
+ Set<Event> listEvents(ListEventsOptions...options);
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/c6986efd/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/EventAsyncClient.java
----------------------------------------------------------------------
diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/EventAsyncClient.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/EventAsyncClient.java
deleted file mode 100644
index 4911cb4..0000000
--- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/EventAsyncClient.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.cloudstack.features;
-
-import java.util.Set;
-
-import javax.inject.Named;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.GET;
-import javax.ws.rs.core.MediaType;
-
-import org.jclouds.Fallbacks.EmptySetOnNotFoundOr404;
-import org.jclouds.cloudstack.domain.Event;
-import org.jclouds.cloudstack.filters.AuthenticationFilter;
-import org.jclouds.cloudstack.functions.ParseEventTypesFromHttpResponse;
-import org.jclouds.cloudstack.options.ListEventsOptions;
-import org.jclouds.rest.annotations.Fallback;
-import org.jclouds.rest.annotations.QueryParams;
-import org.jclouds.rest.annotations.RequestFilters;
-import org.jclouds.rest.annotations.ResponseParser;
-import org.jclouds.rest.annotations.SelectJson;
-
-import com.google.common.util.concurrent.ListenableFuture;
-
-/**
- * Provides asynchronous access to cloudstack via their REST API.
- * <p/>
- *
- * @author Vijay Kiran
- * @see org.jclouds.cloudstack.features.AccountClient
- * @see <a href="http://download.cloud.com/releases/2.2.0/api_2.2.12/TOC_User.html" />
- */
-@RequestFilters(AuthenticationFilter.class)
-@QueryParams(keys = { "response", "listAll" }, values = { "json", "true" })
-public interface EventAsyncClient {
- /**
- * @see EventClient#listEventTypes()
- */
- @Named("listEventTypes")
- @GET
- @QueryParams(keys = "command", values = "listEventTypes")
- @Consumes(MediaType.APPLICATION_JSON)
- @ResponseParser(ParseEventTypesFromHttpResponse.class)
- @Fallback(EmptySetOnNotFoundOr404.class)
- ListenableFuture<Set<String>> listEventTypes();
-
- /**
- * @see EventClient#listEventTypes()
- */
- @Named("listEventTypes")
- @GET
- @QueryParams(keys = "command", values = "listEvents")
- @SelectJson("event")
- @Consumes(MediaType.APPLICATION_JSON)
- @Fallback(EmptySetOnNotFoundOr404.class)
- ListenableFuture<Set<Event>> listEvents(ListEventsOptions...options);
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/c6986efd/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/EventClient.java
----------------------------------------------------------------------
diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/EventClient.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/EventClient.java
deleted file mode 100644
index dc598c4..0000000
--- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/EventClient.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.cloudstack.features;
-
-import java.util.Set;
-import org.jclouds.cloudstack.domain.Event;
-import org.jclouds.cloudstack.options.ListEventsOptions;
-
-/**
- * Provides synchronous access to CloudStack Event features.
- * <p/>
- *
- * @author Vijay Kiran
- * @see <a href="http://download.cloud.com/releases/2.2.0/api_2.2.12/TOC_User.html" />
- */
-public interface EventClient {
-
- /**
- * List Event Types
- *
- * @return event types or null if not found
- */
- Set<String> listEventTypes();
-
- /**
- * List Events
- *
- * @return event list or null if not found
- */
- Set<Event> listEvents(ListEventsOptions... options);
-
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/c6986efd/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/FirewallApi.java
----------------------------------------------------------------------
diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/FirewallApi.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/FirewallApi.java
new file mode 100644
index 0000000..60bb6f8
--- /dev/null
+++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/FirewallApi.java
@@ -0,0 +1,157 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.cloudstack.features;
+
+import java.util.Set;
+
+import javax.inject.Named;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.MediaType;
+
+import org.jclouds.Fallbacks.EmptySetOnNotFoundOr404;
+import org.jclouds.Fallbacks.NullOnNotFoundOr404;
+import org.jclouds.Fallbacks.VoidOnNotFoundOr404;
+import org.jclouds.cloudstack.domain.AsyncCreateResponse;
+import org.jclouds.cloudstack.domain.FirewallRule;
+import org.jclouds.cloudstack.domain.PortForwardingRule;
+import org.jclouds.cloudstack.filters.AuthenticationFilter;
+import org.jclouds.cloudstack.options.CreateFirewallRuleOptions;
+import org.jclouds.cloudstack.options.ListFirewallRulesOptions;
+import org.jclouds.cloudstack.options.ListPortForwardingRulesOptions;
+import org.jclouds.rest.annotations.Fallback;
+import org.jclouds.rest.annotations.OnlyElement;
+import org.jclouds.rest.annotations.QueryParams;
+import org.jclouds.rest.annotations.RequestFilters;
+import org.jclouds.rest.annotations.SelectJson;
+import org.jclouds.rest.annotations.Unwrap;
+
+/**
+ * Provides synchronous access to cloudstack via their REST API.
+ * <p/>
+ *
+ * @author Adrian Cole
+ * @see <a href="http://download.cloud.com/releases/2.2.0/api_2.2.12/TOC_User.html" />
+ */
+@RequestFilters(AuthenticationFilter.class)
+@QueryParams(keys = "response", values = "json")
+public interface FirewallApi {
+
+ /**
+ * @see FirewallApi#listFirewallRules
+ */
+ @Named("listFirewallRules")
+ @GET
+ @QueryParams(keys = { "command", "listAll" }, values = { "listFirewallRules", "true" })
+ @SelectJson("firewallrule")
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Fallback(EmptySetOnNotFoundOr404.class)
+ Set<FirewallRule> listFirewallRules(ListFirewallRulesOptions... options);
+
+ /**
+ * @see FirewallApi#getFirewallRule
+ */
+ @Named("listFirewallRules")
+ @GET
+ @QueryParams(keys = { "command", "listAll" }, values = { "listFirewallRules", "true" })
+ @SelectJson("firewallrule")
+ @OnlyElement
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Fallback(NullOnNotFoundOr404.class)
+ FirewallRule getFirewallRule(@QueryParam("id") String id);
+
+ /**
+ * @see FirewallApi#createFirewallRuleForIpAndProtocol
+ */
+ @Named("createFirewallRule")
+ @GET
+ @QueryParams(keys = "command", values = "createFirewallRule")
+ @Unwrap
+ @Consumes(MediaType.APPLICATION_JSON)
+ AsyncCreateResponse createFirewallRuleForIpAndProtocol(@QueryParam("ipaddressid") String ipAddressId,
+ @QueryParam("protocol") FirewallRule.Protocol protocol, CreateFirewallRuleOptions... options);
+
+ /**
+ * @see FirewallApi#createFirewallRuleForIpProtocolAndPort
+ */
+ @Named("createFirewallRule")
+ @GET
+ @QueryParams(keys = "command", values = "createFirewallRule")
+ @Unwrap
+ @Consumes(MediaType.APPLICATION_JSON)
+ AsyncCreateResponse createFirewallRuleForIpProtocolAndPort(@QueryParam("ipaddressid") String ipAddressId,
+ @QueryParam("protocol") FirewallRule.Protocol protocol,
+ @QueryParam("startPort") int startPort,
+ @QueryParam("endPort") int endPort);
+
+
+ /**
+ * @see FirewallApi#deleteFirewallRule
+ */
+ @Named("deleteFirewallRule")
+ @GET
+ @QueryParams(keys = "command", values = "deleteFirewallRule")
+ @Fallback(VoidOnNotFoundOr404.class)
+ void deleteFirewallRule(@QueryParam("id") String id);
+
+ /**
+ * @see FirewallApi#listPortForwardingRules
+ */
+ @Named("listPortForwardingRules")
+ @GET
+ @QueryParams(keys = { "command", "listAll" }, values = { "listPortForwardingRules", "true" })
+ @SelectJson("portforwardingrule")
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Fallback(EmptySetOnNotFoundOr404.class)
+ Set<PortForwardingRule> listPortForwardingRules(ListPortForwardingRulesOptions... options);
+
+ /**
+ * @see FirewallApi#getPortForwardingRule
+ */
+ @Named("listPortForwardingRules")
+ @GET
+ @QueryParams(keys = { "command", "listAll" }, values = { "listPortForwardingRules", "true" })
+ @SelectJson("portforwardingrule")
+ @OnlyElement
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Fallback(NullOnNotFoundOr404.class)
+ PortForwardingRule getPortForwardingRule(@QueryParam("id") String id);
+
+ /**
+ * @see FirewallApi#createPortForwardingRuleForVirtualMachine
+ */
+ @Named("createPortForwardingRule")
+ @GET
+ @QueryParams(keys = "command", values = "createPortForwardingRule")
+ @Unwrap
+ @Consumes(MediaType.APPLICATION_JSON)
+ AsyncCreateResponse createPortForwardingRuleForVirtualMachine(
+ @QueryParam("ipaddressid") String ipAddressId, @QueryParam("protocol") PortForwardingRule.Protocol protocol,
+ @QueryParam("publicport") int publicPort, @QueryParam("virtualmachineid") String virtualMachineId,
+ @QueryParam("privateport") int privatePort);
+
+ /**
+ * @see FirewallApi#deletePortForwardingRule
+ */
+ @Named("deletePortForwardingRule")
+ @GET
+ @QueryParams(keys = "command", values = "deletePortForwardingRule")
+ @Fallback(VoidOnNotFoundOr404.class)
+ void deletePortForwardingRule(@QueryParam("id") String id);
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/c6986efd/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/FirewallAsyncClient.java
----------------------------------------------------------------------
diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/FirewallAsyncClient.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/FirewallAsyncClient.java
deleted file mode 100644
index b4c5ee2..0000000
--- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/FirewallAsyncClient.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.cloudstack.features;
-
-import java.util.Set;
-
-import javax.inject.Named;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.GET;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.MediaType;
-
-import org.jclouds.Fallbacks.EmptySetOnNotFoundOr404;
-import org.jclouds.Fallbacks.NullOnNotFoundOr404;
-import org.jclouds.Fallbacks.VoidOnNotFoundOr404;
-import org.jclouds.cloudstack.domain.AsyncCreateResponse;
-import org.jclouds.cloudstack.domain.FirewallRule;
-import org.jclouds.cloudstack.domain.PortForwardingRule;
-import org.jclouds.cloudstack.filters.AuthenticationFilter;
-import org.jclouds.cloudstack.options.CreateFirewallRuleOptions;
-import org.jclouds.cloudstack.options.ListFirewallRulesOptions;
-import org.jclouds.cloudstack.options.ListPortForwardingRulesOptions;
-import org.jclouds.rest.annotations.Fallback;
-import org.jclouds.rest.annotations.OnlyElement;
-import org.jclouds.rest.annotations.QueryParams;
-import org.jclouds.rest.annotations.RequestFilters;
-import org.jclouds.rest.annotations.SelectJson;
-import org.jclouds.rest.annotations.Unwrap;
-
-import com.google.common.util.concurrent.ListenableFuture;
-
-/**
- * Provides asynchronous access to cloudstack via their REST API.
- * <p/>
- *
- * @author Adrian Cole
- * @see FirewallClient
- * @see <a href="http://download.cloud.com/releases/2.2.0/api_2.2.12/TOC_User.html" />
- */
-@RequestFilters(AuthenticationFilter.class)
-@QueryParams(keys = "response", values = "json")
-public interface FirewallAsyncClient {
-
- /**
- * @see FirewallClient#listFirewallRules
- */
- @Named("listFirewallRules")
- @GET
- @QueryParams(keys = { "command", "listAll" }, values = { "listFirewallRules", "true" })
- @SelectJson("firewallrule")
- @Consumes(MediaType.APPLICATION_JSON)
- @Fallback(EmptySetOnNotFoundOr404.class)
- ListenableFuture<Set<FirewallRule>> listFirewallRules(ListFirewallRulesOptions... options);
-
- /**
- * @see FirewallClient#getFirewallRule
- */
- @Named("listFirewallRules")
- @GET
- @QueryParams(keys = { "command", "listAll" }, values = { "listFirewallRules", "true" })
- @SelectJson("firewallrule")
- @OnlyElement
- @Consumes(MediaType.APPLICATION_JSON)
- @Fallback(NullOnNotFoundOr404.class)
- ListenableFuture<FirewallRule> getFirewallRule(@QueryParam("id") String id);
-
- /**
- * @see FirewallClient#createFirewallRuleForIpAndProtocol
- */
- @Named("createFirewallRule")
- @GET
- @QueryParams(keys = "command", values = "createFirewallRule")
- @Unwrap
- @Consumes(MediaType.APPLICATION_JSON)
- ListenableFuture<AsyncCreateResponse> createFirewallRuleForIpAndProtocol(@QueryParam("ipaddressid") String ipAddressId,
- @QueryParam("protocol") FirewallRule.Protocol protocol, CreateFirewallRuleOptions... options);
-
- /**
- * @see FirewallClient#createFirewallRuleForIpProtocolAndPort
- */
- @Named("createFirewallRule")
- @GET
- @QueryParams(keys = "command", values = "createFirewallRule")
- @Unwrap
- @Consumes(MediaType.APPLICATION_JSON)
- ListenableFuture<AsyncCreateResponse> createFirewallRuleForIpProtocolAndPort(@QueryParam("ipaddressid") String ipAddressId,
- @QueryParam("protocol") FirewallRule.Protocol protocol,
- @QueryParam("startPort") int startPort,
- @QueryParam("endPort") int endPort);
-
-
- /**
- * @see FirewallClient#deleteFirewallRule
- */
- @Named("deleteFirewallRule")
- @GET
- @QueryParams(keys = "command", values = "deleteFirewallRule")
- @Fallback(VoidOnNotFoundOr404.class)
- ListenableFuture<Void> deleteFirewallRule(@QueryParam("id") String id);
-
- /**
- * @see FirewallClient#listPortForwardingRules
- */
- @Named("listPortForwardingRules")
- @GET
- @QueryParams(keys = { "command", "listAll" }, values = { "listPortForwardingRules", "true" })
- @SelectJson("portforwardingrule")
- @Consumes(MediaType.APPLICATION_JSON)
- @Fallback(EmptySetOnNotFoundOr404.class)
- ListenableFuture<Set<PortForwardingRule>> listPortForwardingRules(ListPortForwardingRulesOptions... options);
-
- /**
- * @see FirewallClient#getPortForwardingRule
- */
- @Named("listPortForwardingRules")
- @GET
- @QueryParams(keys = { "command", "listAll" }, values = { "listPortForwardingRules", "true" })
- @SelectJson("portforwardingrule")
- @OnlyElement
- @Consumes(MediaType.APPLICATION_JSON)
- @Fallback(NullOnNotFoundOr404.class)
- ListenableFuture<PortForwardingRule> getPortForwardingRule(@QueryParam("id") String id);
-
- /**
- * @see FirewallClient#createPortForwardingRuleForVirtualMachine
- */
- @Named("createPortForwardingRule")
- @GET
- @QueryParams(keys = "command", values = "createPortForwardingRule")
- @Unwrap
- @Consumes(MediaType.APPLICATION_JSON)
- ListenableFuture<AsyncCreateResponse> createPortForwardingRuleForVirtualMachine(
- @QueryParam("ipaddressid") String ipAddressId, @QueryParam("protocol") PortForwardingRule.Protocol protocol,
- @QueryParam("publicport") int publicPort, @QueryParam("virtualmachineid") String virtualMachineId,
- @QueryParam("privateport") int privatePort);
-
- /**
- * @see FirewallClient#deletePortForwardingRule
- */
- @Named("deletePortForwardingRule")
- @GET
- @QueryParams(keys = "command", values = "deletePortForwardingRule")
- @Fallback(VoidOnNotFoundOr404.class)
- ListenableFuture<Void> deletePortForwardingRule(@QueryParam("id") String id);
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/c6986efd/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/FirewallClient.java
----------------------------------------------------------------------
diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/FirewallClient.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/FirewallClient.java
deleted file mode 100644
index 99f45af..0000000
--- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/FirewallClient.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.cloudstack.features;
-
-import java.util.Set;
-import org.jclouds.cloudstack.domain.AsyncCreateResponse;
-import org.jclouds.cloudstack.domain.FirewallRule;
-import org.jclouds.cloudstack.domain.PortForwardingRule;
-import org.jclouds.cloudstack.options.CreateFirewallRuleOptions;
-import org.jclouds.cloudstack.options.ListFirewallRulesOptions;
-import org.jclouds.cloudstack.options.ListPortForwardingRulesOptions;
-
-/**
- * Provides synchronous access to CloudStack PortForwardingRule features.
- * <p/>
- *
- * @see PortForwardingRuleAsyncClient
- * @see <a href="http://download.cloud.com/releases/2.2.0/api_2.2.12/TOC_User.html" />
- * @author Adrian Cole
- */
-public interface FirewallClient {
-
- /**
- * List the firewall rules
- *
- * @param options
- * if present, how to constrain the list.
- * @return
- * set of firewall rules or empty set if no rules are found
- */
- Set<FirewallRule> listFirewallRules(ListFirewallRulesOptions... options);
-
- /**
- * Get a firewall rule by ID
- *
- * @param id
- * the ID of the firewall rule
- * @return
- * firewall rule instance or null
- */
- FirewallRule getFirewallRule(String id);
-
- /**
- * Create new firewall rule for a specific IP address
- *
- * @param ipAddressId
- * the IP address id of the port forwarding rule
- * @param protocol
- * the protocol for the firewall rule. Valid values are TCP/UDP/ICMP
- * @param options
- * optional arguments for firewall rule creation
- * @return
- */
- AsyncCreateResponse createFirewallRuleForIpAndProtocol(String ipAddressId,
- FirewallRule.Protocol protocol, CreateFirewallRuleOptions... options);
-
-
- AsyncCreateResponse createFirewallRuleForIpProtocolAndPort(String ipAddressId,
- FirewallRule.Protocol protocol,
- int startPort,
- int endPort);
-
-
- /**
- * Deletes a firewall rule
- *
- * @param id
- * the ID of the firewall rule
- */
- Void deleteFirewallRule(String id);
-
- /**
- * List the port forwarding rules
- *
- * @param options
- * if present, how to constrain the list.
- * @return PortForwardingRules matching query, or empty set, if no
- * PortForwardingRules are found
- */
- Set<PortForwardingRule> listPortForwardingRules(ListPortForwardingRulesOptions... options);
-
- /**
- * Get a port forwarding rule by ID
- *
- * @param id
- * port forwarding rule ID
- * @return
- * rule instance or null
- */
- PortForwardingRule getPortForwardingRule(String id);
-
- /**
- * Creates an port forwarding rule
- *
- *
- * @param ipAddressId
- * @param protocol
- * the protocol for the rule. Valid values are TCP or UDP.
- * @param publicPort
- * the public port of the port forwarding rule
- * @param virtualMachineId
- * the ID of the virtual machine for the port forwarding rule
- * @param privatePort
- * the private port of the port forwarding rule
- * @return response used to track creation
- */
- AsyncCreateResponse createPortForwardingRuleForVirtualMachine(String ipAddressId,
- PortForwardingRule.Protocol protocol, int publicPort, String virtualMachineId, int privatePort);
-
- /**
- * Deletes an port forwarding rule
- *
- * @param id
- * the id of the forwarding rule
- */
- Void deletePortForwardingRule(String id);
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/c6986efd/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/GlobalAccountApi.java
----------------------------------------------------------------------
diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/GlobalAccountApi.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/GlobalAccountApi.java
new file mode 100644
index 0000000..56d2669
--- /dev/null
+++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/GlobalAccountApi.java
@@ -0,0 +1,104 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.cloudstack.features;
+
+import javax.inject.Named;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.MediaType;
+
+import org.jclouds.Fallbacks.NullOnNotFoundOr404;
+import org.jclouds.cloudstack.domain.Account;
+import org.jclouds.cloudstack.filters.AuthenticationFilter;
+import org.jclouds.cloudstack.options.CreateAccountOptions;
+import org.jclouds.cloudstack.options.UpdateAccountOptions;
+import org.jclouds.rest.annotations.Fallback;
+import org.jclouds.rest.annotations.QueryParams;
+import org.jclouds.rest.annotations.RequestFilters;
+import org.jclouds.rest.annotations.SelectJson;
+
+/**
+ * Provides synchronous access to CloudStack Account features available to Global
+ * Admin users.
+ *
+ * @author Adrian Cole, Andrei Savu
+ * @see <a href=
+ * "http://download.cloud.com/releases/2.2.0/api_2.2.12/TOC_Global_Admin.html"
+ * />
+ */
+@RequestFilters(AuthenticationFilter.class)
+@QueryParams(keys = "response", values = "json")
+public interface GlobalAccountApi extends DomainAccountApi {
+
+ /**
+ * Create a new Cloudstack account
+ *
+ * @param userName unique username.
+ * @param accountType type of account
+ * @param email
+ * @param firstName
+ * @param lastName
+ * @param hashedPassword
+ * Hashed password (Default is MD5). If you wish to use any other
+ * hashing algorithm, you would need to write a custom authentication adapter See Docs section.
+ * @param options
+ * optional parameters
+ * @return
+ */
+ @Named("createAccount")
+ @GET
+ @QueryParams(keys = "command", values = "createAccount")
+ @SelectJson("account")
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Fallback(NullOnNotFoundOr404.class)
+ Account createAccount(@QueryParam("username") String userName,
+ @QueryParam("accounttype") Account.Type accountType, @QueryParam("email") String email,
+ @QueryParam("firstname") String firstName, @QueryParam("lastname") String lastName,
+ @QueryParam("password") String hashedPassword, CreateAccountOptions... options);
+
+ /**
+ * Update an existing account
+ *
+ * @param accountName the current account name
+ * @param domainId the ID of the domain were the account exists
+ * @param newName new name for the account
+ * @param options optional arguments
+ * @return
+ */
+ @Named("updateAccount")
+ @GET
+ @QueryParams(keys = "command", values = "updateAccount")
+ @SelectJson("account")
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Fallback(NullOnNotFoundOr404.class)
+ Account updateAccount(@QueryParam("account") String accountName,
+ @QueryParam("domainid") String domainId, @QueryParam("newname") String newName, UpdateAccountOptions... options);
+
+ /**
+ * Delete an account with the specified ID
+ *
+ * @param accountId
+ * @return
+ */
+ @Named("deleteAccount")
+ @GET
+ @QueryParams(keys = "command", values = "deleteAccount")
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Fallback(NullOnNotFoundOr404.class)
+ void deleteAccount(@QueryParam("id") String id);
+}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/c6986efd/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/GlobalAccountAsyncClient.java
----------------------------------------------------------------------
diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/GlobalAccountAsyncClient.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/GlobalAccountAsyncClient.java
deleted file mode 100644
index 6da9b95..0000000
--- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/GlobalAccountAsyncClient.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.cloudstack.features;
-
-import javax.inject.Named;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.GET;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.MediaType;
-
-import org.jclouds.Fallbacks.NullOnNotFoundOr404;
-import org.jclouds.cloudstack.domain.Account;
-import org.jclouds.cloudstack.filters.AuthenticationFilter;
-import org.jclouds.cloudstack.options.CreateAccountOptions;
-import org.jclouds.cloudstack.options.UpdateAccountOptions;
-import org.jclouds.rest.annotations.Fallback;
-import org.jclouds.rest.annotations.QueryParams;
-import org.jclouds.rest.annotations.RequestFilters;
-import org.jclouds.rest.annotations.SelectJson;
-
-import com.google.common.util.concurrent.ListenableFuture;
-
-/**
- * Provides asynchronous access to CloudStack Account features available to Global
- * Admin users.
- *
- * @author Adrian Cole, Andrei Savu
- * @see <a href=
- * "http://download.cloud.com/releases/2.2.0/api_2.2.12/TOC_Global_Admin.html"
- * />
- */
-@RequestFilters(AuthenticationFilter.class)
-@QueryParams(keys = "response", values = "json")
-public interface GlobalAccountAsyncClient extends DomainAccountAsyncClient {
-
- /**
- * @see GlobalAccountClient#createAccount
- */
- @Named("createAccount")
- @GET
- @QueryParams(keys = "command", values = "createAccount")
- @SelectJson("account")
- @Consumes(MediaType.APPLICATION_JSON)
- @Fallback(NullOnNotFoundOr404.class)
- ListenableFuture<Account> createAccount(@QueryParam("username") String userName,
- @QueryParam("accounttype") Account.Type accountType, @QueryParam("email") String email,
- @QueryParam("firstname") String firstName, @QueryParam("lastname") String lastName,
- @QueryParam("password") String hashedPassword, CreateAccountOptions... options);
-
- /**
- * @see GlobalAccountClient#updateAccount
- */
- @Named("updateAccount")
- @GET
- @QueryParams(keys = "command", values = "updateAccount")
- @SelectJson("account")
- @Consumes(MediaType.APPLICATION_JSON)
- @Fallback(NullOnNotFoundOr404.class)
- ListenableFuture<Account> updateAccount(@QueryParam("account") String accountName,
- @QueryParam("domainid") String domainId, @QueryParam("newname") String newName, UpdateAccountOptions... options);
-
- /**
- * @see GlobalAccountClient#deleteAccount
- */
- @Named("deleteAccount")
- @GET
- @QueryParams(keys = "command", values = "deleteAccount")
- @Consumes(MediaType.APPLICATION_JSON)
- @Fallback(NullOnNotFoundOr404.class)
- ListenableFuture<Void> deleteAccount(@QueryParam("id") String id);
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/c6986efd/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/GlobalAccountClient.java
----------------------------------------------------------------------
diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/GlobalAccountClient.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/GlobalAccountClient.java
deleted file mode 100644
index 313a1be..0000000
--- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/GlobalAccountClient.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.cloudstack.features;
-
-import org.jclouds.cloudstack.domain.Account;
-import org.jclouds.cloudstack.options.CreateAccountOptions;
-import org.jclouds.cloudstack.options.UpdateAccountOptions;
-
-/**
- * Provides synchronous access to CloudStack Account features available to Global
- * Admin users.
- *
- * @author Adrian Cole, Andrei Savu
- * @see <a href=
- * "http://download.cloud.com/releases/2.2.0/api_2.2.12/TOC_Global_Admin.html"
- * />
- */
-public interface GlobalAccountClient extends DomainAccountClient {
-
- /**
- * Create a new Cloudstack account
- *
- * @param userName unique username.
- * @param accountType type of account
- * @param email
- * @param firstName
- * @param lastName
- * @param hashedPassword
- * Hashed password (Default is MD5). If you wish to use any other
- * hashing algorithm, you would need to write a custom authentication adapter See Docs section.
- * @param options
- * optional parameters
- * @return
- */
- Account createAccount(String userName, Account.Type accountType, String email,
- String firstName, String lastName, String hashedPassword, CreateAccountOptions... options);
-
- /**
- * Update an existing account
- *
- * @param accountName the current account name
- * @param domainId the ID of the domain were the account exists
- * @param newName new name for the account
- * @param options optional arguments
- * @return
- */
- Account updateAccount(String accountName, String domainId, String newName, UpdateAccountOptions... options);
-
- /**
- * Delete an account with the specified ID
- *
- * @param accountId
- * @return
- */
- Void deleteAccount(String accountId);
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/c6986efd/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/GlobalAlertApi.java
----------------------------------------------------------------------
diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/GlobalAlertApi.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/GlobalAlertApi.java
new file mode 100644
index 0000000..a25ed88
--- /dev/null
+++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/GlobalAlertApi.java
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.cloudstack.features;
+
+import java.util.Set;
+
+import javax.inject.Named;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
+import javax.ws.rs.core.MediaType;
+
+import org.jclouds.Fallbacks.EmptySetOnNotFoundOr404;
+import org.jclouds.cloudstack.domain.Alert;
+import org.jclouds.cloudstack.filters.AuthenticationFilter;
+import org.jclouds.cloudstack.options.ListAlertsOptions;
+import org.jclouds.rest.annotations.Fallback;
+import org.jclouds.rest.annotations.QueryParams;
+import org.jclouds.rest.annotations.RequestFilters;
+import org.jclouds.rest.annotations.SelectJson;
+
+/**
+ * Provides synchronous access to CloudStack Account features available to Global
+ * Admin users.
+ *
+ * @author Richard Downer
+ * @see <a href=
+ * "http://download.cloud.com/releases/2.2.0/api_2.2.12/TOC_Global_Admin.html"
+ * />
+ */
+@RequestFilters(AuthenticationFilter.class)
+@QueryParams(keys = "response", values = "json")
+public interface GlobalAlertApi {
+
+ /**
+ * List Alerts
+ *
+ * @return alert list or null if not found
+ */
+ @Named("listAlerts")
+ @GET
+ @QueryParams(keys = { "command", "listAll" }, values = { "listAlerts", "true" })
+ @SelectJson("alert")
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Fallback(EmptySetOnNotFoundOr404.class)
+ Set<Alert> listAlerts(ListAlertsOptions...options);
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/c6986efd/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/GlobalAlertAsyncClient.java
----------------------------------------------------------------------
diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/GlobalAlertAsyncClient.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/GlobalAlertAsyncClient.java
deleted file mode 100644
index 6d85fc2..0000000
--- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/GlobalAlertAsyncClient.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.cloudstack.features;
-
-import java.util.Set;
-
-import javax.inject.Named;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.GET;
-import javax.ws.rs.core.MediaType;
-
-import org.jclouds.Fallbacks.EmptySetOnNotFoundOr404;
-import org.jclouds.cloudstack.domain.Alert;
-import org.jclouds.cloudstack.filters.AuthenticationFilter;
-import org.jclouds.cloudstack.options.ListAlertsOptions;
-import org.jclouds.rest.annotations.Fallback;
-import org.jclouds.rest.annotations.QueryParams;
-import org.jclouds.rest.annotations.RequestFilters;
-import org.jclouds.rest.annotations.SelectJson;
-
-import com.google.common.util.concurrent.ListenableFuture;
-
-/**
- * Provides asynchronous access to CloudStack Account features available to Global
- * Admin users.
- *
- * @author Richard Downer
- * @see <a href=
- * "http://download.cloud.com/releases/2.2.0/api_2.2.12/TOC_Global_Admin.html"
- * />
- */
-@RequestFilters(AuthenticationFilter.class)
-@QueryParams(keys = "response", values = "json")
-public interface GlobalAlertAsyncClient {
-
- /**
- * @see GlobalAlertClient#listAlerts(org.jclouds.cloudstack.options.ListAlertsOptions...)
- */
- @Named("listAlerts")
- @GET
- @QueryParams(keys = { "command", "listAll" }, values = { "listAlerts", "true" })
- @SelectJson("alert")
- @Consumes(MediaType.APPLICATION_JSON)
- @Fallback(EmptySetOnNotFoundOr404.class)
- ListenableFuture<Set<Alert>> listAlerts(ListAlertsOptions...options);
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/c6986efd/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/GlobalAlertClient.java
----------------------------------------------------------------------
diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/GlobalAlertClient.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/GlobalAlertClient.java
deleted file mode 100644
index e019b58..0000000
--- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/GlobalAlertClient.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.cloudstack.features;
-
-import java.util.Set;
-import org.jclouds.cloudstack.domain.Alert;
-import org.jclouds.cloudstack.options.ListAlertsOptions;
-
-/**
- * Provides synchronous access to CloudStack Alerts features available to Global
- * Admin users.
- *
- * @author Richard Downer
- * @see <a href=
- * "http://download.cloud.com/releases/2.2.0/api_2.2.12/TOC_Global_Admin.html"
- * />
- */
-public interface GlobalAlertClient {
-
- /**
- * List Alerts
- *
- * @return alert list or null if not found
- */
- Set<Alert> listAlerts(ListAlertsOptions... options);
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/c6986efd/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/GlobalCapacityApi.java
----------------------------------------------------------------------
diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/GlobalCapacityApi.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/GlobalCapacityApi.java
new file mode 100644
index 0000000..180a6b5
--- /dev/null
+++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/GlobalCapacityApi.java
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.cloudstack.features;
+
+import java.util.Set;
+
+import javax.inject.Named;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
+import javax.ws.rs.core.MediaType;
+
+import org.jclouds.Fallbacks.EmptySetOnNotFoundOr404;
+import org.jclouds.cloudstack.domain.Capacity;
+import org.jclouds.cloudstack.filters.AuthenticationFilter;
+import org.jclouds.cloudstack.options.ListCapacityOptions;
+import org.jclouds.rest.annotations.Fallback;
+import org.jclouds.rest.annotations.QueryParams;
+import org.jclouds.rest.annotations.RequestFilters;
+import org.jclouds.rest.annotations.SelectJson;
+
+/**
+ * Provides synchronous access to CloudStack Account features available to Global
+ * Admin users.
+ *
+ * @author Richard Downer
+ * @see <a href=
+ * "http://download.cloud.com/releases/2.2.0/api_2.2.12/TOC_Global_Admin.html"
+ * />
+ */
+@RequestFilters(AuthenticationFilter.class)
+@QueryParams(keys = "response", values = "json")
+public interface GlobalCapacityApi {
+
+ /**
+ * List Capacities
+ *
+ * @return alert list or null if not found
+ */
+ @Named("listCapacity")
+ @GET
+ @QueryParams(keys = { "command", "listAll" }, values = { "listCapacity", "true" })
+ @SelectJson("capacity")
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Fallback(EmptySetOnNotFoundOr404.class)
+ Set<Capacity> listCapacity(ListCapacityOptions...options);
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/c6986efd/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/GlobalCapacityAsyncClient.java
----------------------------------------------------------------------
diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/GlobalCapacityAsyncClient.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/GlobalCapacityAsyncClient.java
deleted file mode 100644
index 5d0175b..0000000
--- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/GlobalCapacityAsyncClient.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.cloudstack.features;
-
-import java.util.Set;
-
-import javax.inject.Named;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.GET;
-import javax.ws.rs.core.MediaType;
-
-import org.jclouds.Fallbacks.EmptySetOnNotFoundOr404;
-import org.jclouds.cloudstack.domain.Capacity;
-import org.jclouds.cloudstack.filters.AuthenticationFilter;
-import org.jclouds.cloudstack.options.ListCapacityOptions;
-import org.jclouds.rest.annotations.Fallback;
-import org.jclouds.rest.annotations.QueryParams;
-import org.jclouds.rest.annotations.RequestFilters;
-import org.jclouds.rest.annotations.SelectJson;
-
-import com.google.common.util.concurrent.ListenableFuture;
-
-/**
- * Provides asynchronous access to CloudStack Account features available to Global
- * Admin users.
- *
- * @author Richard Downer
- * @see <a href=
- * "http://download.cloud.com/releases/2.2.0/api_2.2.12/TOC_Global_Admin.html"
- * />
- */
-@RequestFilters(AuthenticationFilter.class)
-@QueryParams(keys = "response", values = "json")
-public interface GlobalCapacityAsyncClient {
-
- /**
- * @see GlobalCapacityClient#listCapacity(org.jclouds.cloudstack.options.ListCapacityOptions...)
- */
- @Named("listCapacity")
- @GET
- @QueryParams(keys = { "command", "listAll" }, values = { "listCapacity", "true" })
- @SelectJson("capacity")
- @Consumes(MediaType.APPLICATION_JSON)
- @Fallback(EmptySetOnNotFoundOr404.class)
- ListenableFuture<Set<Capacity>> listCapacity(ListCapacityOptions...options);
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/c6986efd/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/GlobalCapacityClient.java
----------------------------------------------------------------------
diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/GlobalCapacityClient.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/GlobalCapacityClient.java
deleted file mode 100644
index 17dea20..0000000
--- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/GlobalCapacityClient.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.cloudstack.features;
-
-import java.util.Set;
-import org.jclouds.cloudstack.domain.Capacity;
-import org.jclouds.cloudstack.options.ListCapacityOptions;
-
-/**
- * Provides synchronous access to CloudStack Capacities features available to Global
- * Admin users.
- *
- * @author Richard Downer
- * @see <a href=
- * "http://download.cloud.com/releases/2.2.0/api_2.2.12/TOC_Global_Admin.html"
- * />
- */
-public interface GlobalCapacityClient {
-
- /**
- * List Capacities
- *
- * @return alert list or null if not found
- */
- Set<Capacity> listCapacity(ListCapacityOptions... options);
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/c6986efd/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/GlobalConfigurationApi.java
----------------------------------------------------------------------
diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/GlobalConfigurationApi.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/GlobalConfigurationApi.java
new file mode 100644
index 0000000..1cb3f11
--- /dev/null
+++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/GlobalConfigurationApi.java
@@ -0,0 +1,84 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.cloudstack.features;
+
+import java.util.Set;
+
+import javax.inject.Named;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.MediaType;
+
+import org.jclouds.Fallbacks.EmptySetOnNotFoundOr404;
+import org.jclouds.Fallbacks.NullOnNotFoundOr404;
+import org.jclouds.cloudstack.domain.ConfigurationEntry;
+import org.jclouds.cloudstack.filters.AuthenticationFilter;
+import org.jclouds.cloudstack.options.ListConfigurationEntriesOptions;
+import org.jclouds.rest.annotations.Fallback;
+import org.jclouds.rest.annotations.QueryParams;
+import org.jclouds.rest.annotations.RequestFilters;
+import org.jclouds.rest.annotations.SelectJson;
+
+/**
+ * Provides synchronous access to CloudStack Configuration 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"
+ * />
+ */
+@RequestFilters(AuthenticationFilter.class)
+@QueryParams(keys = "response", values = "json")
+public interface GlobalConfigurationApi extends ConfigurationApi {
+
+ /**
+ * List all configuration entries
+ *
+ * @param options
+ * result set filtering options
+ * @return
+ * a set of entries or empty
+ */
+ @Named("listConfigurations")
+ @GET
+ @QueryParams(keys = { "command", "listAll" }, values = { "listConfigurations", "true" })
+ @SelectJson("configuration")
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Fallback(EmptySetOnNotFoundOr404.class)
+ Set<ConfigurationEntry> listConfigurationEntries(ListConfigurationEntriesOptions... options);
+
+ /**
+ * Update a configuration entry
+ *
+ * @param name
+ * the name of the configuration
+ * @param value
+ * the value of the configuration
+ * @return
+ * the updated configuration value
+ */
+ @Named("updateConfiguration")
+ @GET
+ @QueryParams(keys = "command", values = "updateConfiguration")
+ @SelectJson("configuration")
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Fallback(NullOnNotFoundOr404.class)
+ ConfigurationEntry updateConfigurationEntry(
+ @QueryParam("name") String name, @QueryParam("value") String value);
+}