mirror of https://github.com/apache/jclouds.git
commit
48f2c9c5ec
|
@ -22,6 +22,7 @@ import org.jclouds.cloudstack.features.AccountAsyncClient;
|
|||
import org.jclouds.cloudstack.features.AddressAsyncClient;
|
||||
import org.jclouds.cloudstack.features.AsyncJobAsyncClient;
|
||||
import org.jclouds.cloudstack.features.ConfigurationAsyncClient;
|
||||
import org.jclouds.cloudstack.features.EventAsyncClient;
|
||||
import org.jclouds.cloudstack.features.FirewallAsyncClient;
|
||||
import org.jclouds.cloudstack.features.GuestOSAsyncClient;
|
||||
import org.jclouds.cloudstack.features.HypervisorAsyncClient;
|
||||
|
@ -32,8 +33,8 @@ import org.jclouds.cloudstack.features.OfferingAsyncClient;
|
|||
import org.jclouds.cloudstack.features.SSHKeyPairAsyncClient;
|
||||
import org.jclouds.cloudstack.features.SecurityGroupAsyncClient;
|
||||
import org.jclouds.cloudstack.features.TemplateAsyncClient;
|
||||
import org.jclouds.cloudstack.features.VirtualMachineAsyncClient;
|
||||
import org.jclouds.cloudstack.features.VMGroupAsyncClient;
|
||||
import org.jclouds.cloudstack.features.VirtualMachineAsyncClient;
|
||||
import org.jclouds.cloudstack.features.ZoneAsyncClient;
|
||||
import org.jclouds.rest.annotations.Delegate;
|
||||
|
||||
|
@ -43,7 +44,7 @@ import org.jclouds.rest.annotations.Delegate;
|
|||
*
|
||||
* @author Adrian Cole
|
||||
* @see CloudStackClient
|
||||
* @see <a href="http://download.cloud.com/releases/2.2.0/api/TOC_User.html" />
|
||||
* @see <a href="http://download.cloud.com/releases/2.2.0/api_2.2.12/TOC_User.html" />
|
||||
*/
|
||||
public interface CloudStackAsyncClient {
|
||||
|
||||
|
@ -150,4 +151,10 @@ public interface CloudStackAsyncClient {
|
|||
@Delegate
|
||||
VMGroupAsyncClient getVMGroupClient();
|
||||
|
||||
/**
|
||||
* Provides synchronous access to Events
|
||||
*/
|
||||
@Delegate
|
||||
EventAsyncClient getEventClient();
|
||||
|
||||
}
|
||||
|
|
|
@ -24,6 +24,7 @@ import org.jclouds.cloudstack.features.AccountClient;
|
|||
import org.jclouds.cloudstack.features.AddressClient;
|
||||
import org.jclouds.cloudstack.features.AsyncJobClient;
|
||||
import org.jclouds.cloudstack.features.ConfigurationClient;
|
||||
import org.jclouds.cloudstack.features.EventClient;
|
||||
import org.jclouds.cloudstack.features.FirewallClient;
|
||||
import org.jclouds.cloudstack.features.GuestOSClient;
|
||||
import org.jclouds.cloudstack.features.HypervisorClient;
|
||||
|
@ -45,7 +46,7 @@ import org.jclouds.rest.annotations.Delegate;
|
|||
* <p/>
|
||||
*
|
||||
* @see CloudStackAsyncClient
|
||||
* @see <a href="http://download.cloud.com/releases/2.2.0/api/TOC_User.html" />
|
||||
* @see <a href="http://download.cloud.com/releases/2.2.0/api_2.2.12/TOC_User.html" />
|
||||
* @author Adrian Cole
|
||||
*/
|
||||
@Timeout(duration = 60, timeUnit = TimeUnit.SECONDS)
|
||||
|
@ -153,4 +154,10 @@ public interface CloudStackClient {
|
|||
@Delegate
|
||||
VMGroupClient getVMGroupClient();
|
||||
|
||||
/**
|
||||
* Provides synchronous access to Events
|
||||
*/
|
||||
@Delegate
|
||||
EventClient getEventClient();
|
||||
|
||||
}
|
||||
|
|
|
@ -30,6 +30,8 @@ import org.jclouds.cloudstack.features.AsyncJobAsyncClient;
|
|||
import org.jclouds.cloudstack.features.AsyncJobClient;
|
||||
import org.jclouds.cloudstack.features.ConfigurationAsyncClient;
|
||||
import org.jclouds.cloudstack.features.ConfigurationClient;
|
||||
import org.jclouds.cloudstack.features.EventAsyncClient;
|
||||
import org.jclouds.cloudstack.features.EventClient;
|
||||
import org.jclouds.cloudstack.features.FirewallAsyncClient;
|
||||
import org.jclouds.cloudstack.features.FirewallClient;
|
||||
import org.jclouds.cloudstack.features.GuestOSAsyncClient;
|
||||
|
@ -94,6 +96,7 @@ public class CloudStackRestClientModule extends RestClientModule<CloudStackClien
|
|||
.put(HypervisorClient.class, HypervisorAsyncClient.class)//
|
||||
.put(ConfigurationClient.class, ConfigurationAsyncClient.class)//
|
||||
.put(AccountClient.class, AccountAsyncClient.class)//
|
||||
.put(EventClient.class, EventAsyncClient.class)//
|
||||
.put(SSHKeyPairClient.class, SSHKeyPairAsyncClient.class)//
|
||||
.put(VMGroupClient.class, VMGroupAsyncClient.class)//
|
||||
.build();
|
||||
|
|
|
@ -43,7 +43,7 @@ import com.google.common.util.concurrent.ListenableFuture;
|
|||
* <p/>
|
||||
*
|
||||
* @see AccountClient
|
||||
* @see <a href="http://download.cloud.com/releases/2.2.0/api/TOC_User.html" />
|
||||
* @see <a href="http://download.cloud.com/releases/2.2.0/api_2.2.12/TOC_User.html" />
|
||||
* @author Adrian Cole
|
||||
*/
|
||||
@RequestFilters(QuerySigner.class)
|
||||
|
|
|
@ -29,7 +29,7 @@ import org.jclouds.concurrent.Timeout;
|
|||
* Provides synchronous access to CloudStack Account features.
|
||||
* <p/>
|
||||
*
|
||||
* @see <a href="http://download.cloud.com/releases/2.2.0/api/TOC_User.html" />
|
||||
* @see <a href="http://download.cloud.com/releases/2.2.0/api_2.2.12/TOC_User.html" />
|
||||
* @author Adrian Cole
|
||||
*/
|
||||
@Timeout(duration = 60, timeUnit = TimeUnit.SECONDS)
|
||||
|
|
|
@ -47,7 +47,7 @@ import com.google.common.util.concurrent.ListenableFuture;
|
|||
* <p/>
|
||||
*
|
||||
* @see AddressClient
|
||||
* @see <a href="http://download.cloud.com/releases/2.2.0/api/TOC_User.html" />
|
||||
* @see <a href="http://download.cloud.com/releases/2.2.0/api_2.2.12/TOC_User.html" />
|
||||
* @author Adrian Cole
|
||||
*/
|
||||
@RequestFilters(QuerySigner.class)
|
||||
|
|
|
@ -32,7 +32,7 @@ import org.jclouds.concurrent.Timeout;
|
|||
* <p/>
|
||||
*
|
||||
* @see IPAddressAsyncClient
|
||||
* @see <a href="http://download.cloud.com/releases/2.2.0/api/TOC_User.html" />
|
||||
* @see <a href="http://download.cloud.com/releases/2.2.0/api_2.2.12/TOC_User.html" />
|
||||
* @author Adrian Cole
|
||||
*/
|
||||
@Timeout(duration = 60, timeUnit = TimeUnit.SECONDS)
|
||||
|
|
|
@ -44,7 +44,7 @@ import com.google.common.util.concurrent.ListenableFuture;
|
|||
* <p/>
|
||||
*
|
||||
* @see AsyncJobClient
|
||||
* @see <a href="http://download.cloud.com/releases/2.2.0/api/TOC_User.html" />
|
||||
* @see <a href="http://download.cloud.com/releases/2.2.0/api_2.2.12/TOC_User.html" />
|
||||
* @author Adrian Cole
|
||||
*/
|
||||
@RequestFilters(QuerySigner.class)
|
||||
|
|
|
@ -30,7 +30,7 @@ import org.jclouds.concurrent.Timeout;
|
|||
* <p/>
|
||||
*
|
||||
* @see AsyncJobAsyncClient
|
||||
* @see <a href="http://download.cloud.com/releases/2.2.0/api/TOC_User.html" />
|
||||
* @see <a href="http://download.cloud.com/releases/2.2.0/api_2.2.12/TOC_User.html" />
|
||||
* @author Adrian Cole
|
||||
*/
|
||||
@Timeout(duration = 60, timeUnit = TimeUnit.SECONDS)
|
||||
|
|
|
@ -35,7 +35,7 @@ import com.google.common.util.concurrent.ListenableFuture;
|
|||
* <p/>
|
||||
*
|
||||
* @see ConfigurationClient
|
||||
* @see <a href="http://download.cloud.com/releases/2.2.0/api/TOC_User.html" />
|
||||
* @see <a href="http://download.cloud.com/releases/2.2.0/api_2.2.12/TOC_User.html" />
|
||||
* @author Adrian Cole
|
||||
*/
|
||||
@RequestFilters(QuerySigner.class)
|
||||
|
|
|
@ -28,7 +28,7 @@ import org.jclouds.concurrent.Timeout;
|
|||
* <p/>
|
||||
*
|
||||
* @see ConfigurationAsyncClient
|
||||
* @see <a href="http://download.cloud.com/releases/2.2.0/api/TOC_User.html" />
|
||||
* @see <a href="http://download.cloud.com/releases/2.2.0/api_2.2.12/TOC_User.html" />
|
||||
* @author Adrian Cole
|
||||
*/
|
||||
@Timeout(duration = 60, timeUnit = TimeUnit.SECONDS)
|
||||
|
|
|
@ -0,0 +1,56 @@
|
|||
/**
|
||||
* Licensed to jclouds, Inc. (jclouds) under one or more
|
||||
* contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. jclouds 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.ws.rs.Consumes;
|
||||
import javax.ws.rs.GET;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import java.util.Set;
|
||||
|
||||
import com.google.common.util.concurrent.ListenableFuture;
|
||||
import org.jclouds.cloudstack.filters.QuerySigner;
|
||||
import org.jclouds.cloudstack.functions.ParseEventTypesFromHttpResponse;
|
||||
import org.jclouds.rest.annotations.ExceptionParser;
|
||||
import org.jclouds.rest.annotations.QueryParams;
|
||||
import org.jclouds.rest.annotations.RequestFilters;
|
||||
import org.jclouds.rest.annotations.ResponseParser;
|
||||
import org.jclouds.rest.functions.ReturnEmptySetOnNotFoundOr404;
|
||||
|
||||
/**
|
||||
* 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(QuerySigner.class)
|
||||
@QueryParams(keys = "response", values = "json")
|
||||
public interface EventAsyncClient {
|
||||
/**
|
||||
* @see EventClient#listEventTypes()
|
||||
*/
|
||||
@GET
|
||||
@QueryParams(keys = "command", values = "listEventTypes")
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
@ResponseParser(ParseEventTypesFromHttpResponse.class)
|
||||
@ExceptionParser(ReturnEmptySetOnNotFoundOr404.class)
|
||||
ListenableFuture<Set<String>> listEventTypes();
|
||||
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
/**
|
||||
* Licensed to jclouds, Inc. (jclouds) under one or more
|
||||
* contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. jclouds 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 java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.jclouds.concurrent.Timeout;
|
||||
|
||||
/**
|
||||
* 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" />
|
||||
*/
|
||||
@Timeout(duration = 60, timeUnit = TimeUnit.SECONDS)
|
||||
public interface EventClient {
|
||||
|
||||
/**
|
||||
* List Event Types
|
||||
*
|
||||
* @return event types or null if not found
|
||||
*/
|
||||
Set<String> listEventTypes();
|
||||
}
|
|
@ -44,7 +44,7 @@ import com.google.common.util.concurrent.ListenableFuture;
|
|||
* <p/>
|
||||
*
|
||||
* @see FirewallClient
|
||||
* @see <a href="http://download.cloud.com/releases/2.2.0/api/TOC_User.html" />
|
||||
* @see <a href="http://download.cloud.com/releases/2.2.0/api_2.2.12/TOC_User.html" />
|
||||
* @author Adrian Cole
|
||||
*/
|
||||
@RequestFilters(QuerySigner.class)
|
||||
|
|
|
@ -31,7 +31,7 @@ import org.jclouds.concurrent.Timeout;
|
|||
* <p/>
|
||||
*
|
||||
* @see PortForwardingRuleAsyncClient
|
||||
* @see <a href="http://download.cloud.com/releases/2.2.0/api/TOC_User.html" />
|
||||
* @see <a href="http://download.cloud.com/releases/2.2.0/api_2.2.12/TOC_User.html" />
|
||||
* @author Adrian Cole
|
||||
*/
|
||||
@Timeout(duration = 60, timeUnit = TimeUnit.SECONDS)
|
||||
|
|
|
@ -47,7 +47,7 @@ import com.google.common.util.concurrent.ListenableFuture;
|
|||
* <p/>
|
||||
*
|
||||
* @see AsyncJobClient
|
||||
* @see <a href="http://download.cloud.com/releases/2.2.0/api/TOC_User.html" />
|
||||
* @see <a href="http://download.cloud.com/releases/2.2.0/api_2.2.12/TOC_User.html" />
|
||||
* @author Adrian Cole
|
||||
*/
|
||||
@RequestFilters(QuerySigner.class)
|
||||
|
|
|
@ -31,7 +31,7 @@ import org.jclouds.concurrent.Timeout;
|
|||
* <p/>
|
||||
*
|
||||
* @see GuestOSAsyncClient
|
||||
* @see <a href="http://download.cloud.com/releases/2.2.0/api/TOC_User.html" />
|
||||
* @see <a href="http://download.cloud.com/releases/2.2.0/api_2.2.12/TOC_User.html" />
|
||||
* @author Adrian Cole
|
||||
*/
|
||||
@Timeout(duration = 60, timeUnit = TimeUnit.SECONDS)
|
||||
|
|
|
@ -38,7 +38,7 @@ import com.google.common.util.concurrent.ListenableFuture;
|
|||
* <p/>
|
||||
*
|
||||
* @see AsyncJobClient
|
||||
* @see <a href="http://download.cloud.com/releases/2.2.0/api/TOC_User.html" />
|
||||
* @see <a href="http://download.cloud.com/releases/2.2.0/api_2.2.12/TOC_User.html" />
|
||||
* @author Adrian Cole
|
||||
*/
|
||||
@RequestFilters(QuerySigner.class)
|
||||
|
|
|
@ -28,7 +28,7 @@ import org.jclouds.concurrent.Timeout;
|
|||
* <p/>
|
||||
*
|
||||
* @see GuestOSAsyncClient
|
||||
* @see <a href="http://download.cloud.com/releases/2.2.0/api/TOC_User.html" />
|
||||
* @see <a href="http://download.cloud.com/releases/2.2.0/api_2.2.12/TOC_User.html" />
|
||||
* @author Adrian Cole
|
||||
*/
|
||||
@Timeout(duration = 60, timeUnit = TimeUnit.SECONDS)
|
||||
|
|
|
@ -46,7 +46,7 @@ import com.google.common.util.concurrent.ListenableFuture;
|
|||
* <p/>
|
||||
*
|
||||
* @see LoadBalancerClient
|
||||
* @see <a href="http://download.cloud.com/releases/2.2.0/api/TOC_User.html" />
|
||||
* @see <a href="http://download.cloud.com/releases/2.2.0/api_2.2.12/TOC_User.html" />
|
||||
* @author Adrian Cole
|
||||
*/
|
||||
@RequestFilters(QuerySigner.class)
|
||||
|
|
|
@ -32,7 +32,7 @@ import org.jclouds.concurrent.Timeout;
|
|||
* <p/>
|
||||
*
|
||||
* @see LoadBalancerAsyncClient
|
||||
* @see <a href="http://download.cloud.com/releases/2.2.0/api/TOC_User.html" />
|
||||
* @see <a href="http://download.cloud.com/releases/2.2.0/api_2.2.12/TOC_User.html" />
|
||||
* @author Adrian Cole
|
||||
*/
|
||||
@Timeout(duration = 60, timeUnit = TimeUnit.SECONDS)
|
||||
|
|
|
@ -44,7 +44,7 @@ import com.google.common.util.concurrent.ListenableFuture;
|
|||
* <p/>
|
||||
*
|
||||
* @see NATClient
|
||||
* @see <a href="http://download.cloud.com/releases/2.2.0/api/TOC_User.html" />
|
||||
* @see <a href="http://download.cloud.com/releases/2.2.0/api_2.2.12/TOC_User.html" />
|
||||
* @author Adrian Cole
|
||||
*/
|
||||
@RequestFilters(QuerySigner.class)
|
||||
|
|
|
@ -32,7 +32,7 @@ import org.jclouds.concurrent.Timeout;
|
|||
* <p/>
|
||||
*
|
||||
* @see IPForwardingRuleAsyncClient
|
||||
* @see <a href="http://download.cloud.com/releases/2.2.0/api/TOC_User.html" />
|
||||
* @see <a href="http://download.cloud.com/releases/2.2.0/api_2.2.12/TOC_User.html" />
|
||||
* @author Adrian Cole
|
||||
*/
|
||||
@Timeout(duration = 60, timeUnit = TimeUnit.SECONDS)
|
||||
|
|
|
@ -44,7 +44,7 @@ import com.google.common.util.concurrent.ListenableFuture;
|
|||
* <p/>
|
||||
*
|
||||
* @see NetworkClient
|
||||
* @see <a href="http://download.cloud.com/releases/2.2.0/api/TOC_User.html" />
|
||||
* @see <a href="http://download.cloud.com/releases/2.2.0/api_2.2.12/TOC_User.html" />
|
||||
* @author Adrian Cole
|
||||
*/
|
||||
@RequestFilters(QuerySigner.class)
|
||||
|
|
|
@ -31,7 +31,7 @@ import org.jclouds.concurrent.Timeout;
|
|||
* <p/>
|
||||
*
|
||||
* @see NetworkAsyncClient
|
||||
* @see <a href="http://download.cloud.com/releases/2.2.0/api/TOC_User.html" />
|
||||
* @see <a href="http://download.cloud.com/releases/2.2.0/api_2.2.12/TOC_User.html" />
|
||||
* @author Adrian Cole
|
||||
*/
|
||||
@Timeout(duration = 60, timeUnit = TimeUnit.SECONDS)
|
||||
|
|
|
@ -47,7 +47,7 @@ import com.google.common.util.concurrent.ListenableFuture;
|
|||
* <p/>
|
||||
*
|
||||
* @see OfferingClient
|
||||
* @see <a href="http://download.cloud.com/releases/2.2.0/api/TOC_User.html" />
|
||||
* @see <a href="http://download.cloud.com/releases/2.2.0/api_2.2.12/TOC_User.html" />
|
||||
* @author Adrian Cole
|
||||
*/
|
||||
@RequestFilters(QuerySigner.class)
|
||||
|
|
|
@ -34,7 +34,7 @@ import org.jclouds.concurrent.Timeout;
|
|||
* <p/>
|
||||
*
|
||||
* @see OfferingAsyncClient
|
||||
* @see <a href="http://download.cloud.com/releases/2.2.0/api/TOC_User.html" />
|
||||
* @see <a href="http://download.cloud.com/releases/2.2.0/api_2.2.12/TOC_User.html" />
|
||||
* @author Adrian Cole
|
||||
*/
|
||||
@Timeout(duration = 60, timeUnit = TimeUnit.SECONDS)
|
||||
|
|
|
@ -50,7 +50,7 @@ import com.google.common.util.concurrent.ListenableFuture;
|
|||
* <p/>
|
||||
*
|
||||
* @see OfferingClient
|
||||
* @see <a href="http://download.cloud.com/releases/2.2.0/api/TOC_User.html" />
|
||||
* @see <a href="http://download.cloud.com/releases/2.2.0/api_2.2.12/TOC_User.html" />
|
||||
* @author Adrian Cole
|
||||
*/
|
||||
@RequestFilters(QuerySigner.class)
|
||||
|
|
|
@ -33,7 +33,7 @@ import com.google.common.collect.Multimap;
|
|||
* <p/>
|
||||
*
|
||||
* @see SecurityGroupAsyncClient
|
||||
* @see <a href="http://download.cloud.com/releases/2.2.0/api/TOC_User.html" />
|
||||
* @see <a href="http://download.cloud.com/releases/2.2.0/api_2.2.12/TOC_User.html" />
|
||||
* @author Adrian Cole
|
||||
*/
|
||||
@Timeout(duration = 60, timeUnit = TimeUnit.SECONDS)
|
||||
|
|
|
@ -43,7 +43,7 @@ import com.google.common.util.concurrent.ListenableFuture;
|
|||
* <p/>
|
||||
*
|
||||
* @see TemplateClient
|
||||
* @see <a href="http://download.cloud.com/releases/2.2.0/api/TOC_User.html" />
|
||||
* @see <a href="http://download.cloud.com/releases/2.2.0/api_2.2.12/TOC_User.html" />
|
||||
* @author Adrian Cole
|
||||
*/
|
||||
@RequestFilters(QuerySigner.class)
|
||||
|
|
|
@ -31,7 +31,7 @@ import org.jclouds.concurrent.Timeout;
|
|||
* <p/>
|
||||
*
|
||||
* @see TemplateAsyncClient
|
||||
* @see <a href="http://download.cloud.com/releases/2.2.0/api/TOC_User.html" />
|
||||
* @see <a href="http://download.cloud.com/releases/2.2.0/api_2.2.12/TOC_User.html" />
|
||||
* @author Adrian Cole
|
||||
*/
|
||||
@Timeout(duration = 60, timeUnit = TimeUnit.SECONDS)
|
||||
|
|
|
@ -41,7 +41,7 @@ import java.util.Set;
|
|||
*
|
||||
* @author Richard Downer
|
||||
* @see VMGroupClient
|
||||
* @see <a href="http://download.cloud.com/releases/2.2.0/api/TOC_User.html" />
|
||||
* @see <a href="http://download.cloud.com/releases/2.2.0/api_2.2.12/TOC_User.html" />
|
||||
*/
|
||||
@RequestFilters(QuerySigner.class)
|
||||
@QueryParams(keys = "response", values = "json")
|
||||
|
|
|
@ -33,7 +33,7 @@ import java.util.concurrent.TimeUnit;
|
|||
*
|
||||
* @author Richard Downer
|
||||
* @see VMGroupAsyncClient
|
||||
* @see <a href="http://download.cloud.com/releases/2.2.0/api/TOC_User.html" />
|
||||
* @see <a href="http://download.cloud.com/releases/2.2.0/api_2.2.12/TOC_User.html" />
|
||||
*/
|
||||
@Timeout(duration = 60, timeUnit = TimeUnit.SECONDS)
|
||||
public interface VMGroupClient {
|
||||
|
|
|
@ -46,7 +46,7 @@ import com.google.common.util.concurrent.ListenableFuture;
|
|||
* <p/>
|
||||
*
|
||||
* @see VirtualMachineClient
|
||||
* @see <a href="http://download.cloud.com/releases/2.2.0/api/TOC_User.html" />
|
||||
* @see <a href="http://download.cloud.com/releases/2.2.0/api_2.2.12/TOC_User.html" />
|
||||
* @author Adrian Cole
|
||||
*/
|
||||
@RequestFilters(QuerySigner.class)
|
||||
|
|
|
@ -32,7 +32,7 @@ import org.jclouds.concurrent.Timeout;
|
|||
* <p/>
|
||||
*
|
||||
* @see VirtualMachineAsyncClient
|
||||
* @see <a href="http://download.cloud.com/releases/2.2.0/api/TOC_User.html" />
|
||||
* @see <a href="http://download.cloud.com/releases/2.2.0/api_2.2.12/TOC_User.html" />
|
||||
* @author Adrian Cole
|
||||
*/
|
||||
@Timeout(duration = 60, timeUnit = TimeUnit.SECONDS)
|
||||
|
|
|
@ -43,7 +43,7 @@ import com.google.common.util.concurrent.ListenableFuture;
|
|||
* <p/>
|
||||
*
|
||||
* @see ZoneClient
|
||||
* @see <a href="http://download.cloud.com/releases/2.2.0/api/TOC_User.html" />
|
||||
* @see <a href="http://download.cloud.com/releases/2.2.0/api_2.2.12/TOC_User.html" />
|
||||
* @author Adrian Cole
|
||||
*/
|
||||
@RequestFilters(QuerySigner.class)
|
||||
|
|
|
@ -30,7 +30,7 @@ import org.jclouds.concurrent.Timeout;
|
|||
* <p/>
|
||||
*
|
||||
* @see ZoneAsyncClient
|
||||
* @see <a href="http://download.cloud.com/releases/2.2.0/api/TOC_User.html" />
|
||||
* @see <a href="http://download.cloud.com/releases/2.2.0/api_2.2.12/TOC_User.html" />
|
||||
* @author Adrian Cole
|
||||
*/
|
||||
@Timeout(duration = 60, timeUnit = TimeUnit.SECONDS)
|
||||
|
|
|
@ -0,0 +1,72 @@
|
|||
/**
|
||||
* Licensed to jclouds, Inc. (jclouds) under one or more
|
||||
* contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. jclouds 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.functions;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import javax.inject.Singleton;
|
||||
import java.util.Set;
|
||||
|
||||
import com.google.common.base.Function;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.collect.ImmutableSet.Builder;
|
||||
import com.google.inject.Inject;
|
||||
import com.google.inject.TypeLiteral;
|
||||
import org.jclouds.http.HttpResponse;
|
||||
import org.jclouds.http.functions.ParseFirstJsonValueNamed;
|
||||
import org.jclouds.json.internal.GsonWrapper;
|
||||
|
||||
/**
|
||||
* @author Vijay Kiran
|
||||
*/
|
||||
@Singleton
|
||||
public class ParseEventTypesFromHttpResponse implements Function<HttpResponse, Set<String>> {
|
||||
private final ParseFirstJsonValueNamed<Set<EventType>> parser;
|
||||
|
||||
private static class EventType {
|
||||
private String name;
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((name == null) ? 0 : name.hashCode());
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@Inject
|
||||
public ParseEventTypesFromHttpResponse(GsonWrapper gsonWrapper) {
|
||||
this.parser = new ParseFirstJsonValueNamed<Set<EventType>>(checkNotNull(gsonWrapper, "gsonWrapper"),
|
||||
new TypeLiteral<Set<EventType>>() {
|
||||
}, "eventtype");
|
||||
}
|
||||
|
||||
public Set<String> apply(HttpResponse response) {
|
||||
checkNotNull(response, "response");
|
||||
Set<EventType> toParse = parser.apply(response);
|
||||
checkNotNull(toParse, "parsed result from %s", response);
|
||||
Builder<String> builder = ImmutableSet.<String>builder();
|
||||
for (EventType entry : toParse)
|
||||
builder.add(entry.name);
|
||||
return builder.build();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -25,7 +25,7 @@ import com.google.common.collect.ImmutableSet;
|
|||
/**
|
||||
* Options for services that apply to accounts in domains
|
||||
*
|
||||
* @see <a href="http://download.cloud.com/releases/2.2.0/api/TOC_User.html" />
|
||||
* @see <a href="http://download.cloud.com/releases/2.2.0/api_2.2.12/TOC_User.html" />
|
||||
* @author Adrian Cole
|
||||
*/
|
||||
public class AccountInDomainOptions extends BaseHttpRequestOptions {
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
/**
|
||||
* Licensed to jclouds, Inc. (jclouds) under one or more
|
||||
* contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. jclouds 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.options;
|
||||
|
||||
/**
|
||||
* Options used to control what events are returned
|
||||
*
|
||||
* @author Vijay Kiran
|
||||
* @see <a href=
|
||||
* "http://download.cloud.com/releases/2.2.0/api_2.2.12/user/listEvents.html"
|
||||
* />
|
||||
*/
|
||||
public class ListEventsOptions {
|
||||
}
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
/**
|
||||
* Licensed to jclouds, Inc. (jclouds) under one or more
|
||||
* contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. jclouds 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.io.IOException;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import com.google.inject.TypeLiteral;
|
||||
import org.jclouds.cloudstack.functions.ParseEventTypesFromHttpResponse;
|
||||
import org.jclouds.http.HttpRequest;
|
||||
import org.jclouds.rest.functions.ReturnEmptySetOnNotFoundOr404;
|
||||
import org.jclouds.rest.internal.RestAnnotationProcessor;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/**
|
||||
* Tests behavior of {@code EventAsyncClient}
|
||||
*
|
||||
* @author Vijay Kiran
|
||||
*/
|
||||
// NOTE:without testName, this will not call @Before* and fail w/NPE during
|
||||
// surefire
|
||||
@Test(groups = "unit", testName = "EventAsyncClientTest")
|
||||
public class EventAsyncClientTest extends BaseCloudStackAsyncClientTest<EventAsyncClient> {
|
||||
|
||||
public void testListEventTypes() throws SecurityException, NoSuchMethodException, IOException {
|
||||
Method method = EventAsyncClient.class.getMethod("listEventTypes");
|
||||
HttpRequest httpRequest = processor.createRequest(method);
|
||||
|
||||
assertRequestLineEquals(httpRequest,
|
||||
"GET http://localhost:8080/client/api?response=json&command=listEventTypes HTTP/1.1");
|
||||
assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n");
|
||||
assertPayloadEquals(httpRequest, null, null, false);
|
||||
|
||||
assertResponseParserClassEquals(method, httpRequest, ParseEventTypesFromHttpResponse.class);
|
||||
assertSaxResponseParserClassEquals(method, null);
|
||||
assertExceptionParserClassEquals(method, ReturnEmptySetOnNotFoundOr404.class);
|
||||
|
||||
checkFilters(httpRequest);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected TypeLiteral<RestAnnotationProcessor<EventAsyncClient>> createTypeLiteral() {
|
||||
return new TypeLiteral<RestAnnotationProcessor<EventAsyncClient>>() {
|
||||
};
|
||||
}
|
||||
}
|
|
@ -0,0 +1,48 @@
|
|||
/**
|
||||
* Licensed to jclouds, Inc. (jclouds) under one or more
|
||||
* contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. jclouds 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 static org.testng.Assert.assertTrue;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/**
|
||||
* Tests behavior of {@code EventClient}
|
||||
*
|
||||
* @author Vijay Kiran
|
||||
*/
|
||||
@Test(groups = "live", singleThreaded = true, testName = "EventClientLiveTest")
|
||||
public class EventClientLiveTest extends BaseCloudStackClientLiveTest {
|
||||
|
||||
public void testlistEventTypes() throws Exception {
|
||||
Set<String> response = client.getEventClient().listEventTypes();
|
||||
assert null != response;
|
||||
assertTrue(response.size() >= 0);
|
||||
for (String type : response) {
|
||||
checkEventType(type);
|
||||
}
|
||||
}
|
||||
|
||||
protected void checkEventType(String eventType) {
|
||||
assert eventType != null : eventType;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
{ "listeventtypesresponse" : { "count":123 ,"eventtype" : [ {"name":"VM.CREATE"}, {"name":"VM.DESTROY"}, {"name":"VM.START"}, {"name":"VM.STOP"}, {"name":"VM.REBOOT"}, {"name":"VM.UPDATE"}, {"name":"VM.UPGRADE"}, {"name":"VM.RESETPASSWORD"}, {"name":"VM.MIGRATE"}, {"name":"ROUTER.CREATE"}, {"name":"ROUTER.DESTROY"}, {"name":"ROUTER.START"}, {"name":"ROUTER.STOP"}, {"name":"ROUTER.REBOOT"}, {"name":"ROUTER.HA"}, {"name":"ROUTER.UPGRADE"}, {"name":"PROXY.CREATE"}, {"name":"PROXY.DESTROY"}, {"name":"PROXY.START"}, {"name":"PROXY.STOP"}, {"name":"PROXY.REBOOT"}, {"name":"PROXY.HA"}, {"name":"VNC.CONNECT"}, {"name":"VNC.DISCONNECT"}, {"name":"NET.IPASSIGN"}, {"name":"NET.IPRELEASE"}, {"name":"NET.RULEADD"}, {"name":"NET.RULEDELETE"}, {"name":"NET.RULEMODIFY"}, {"name":"NETWORK.CREATE"}, {"name":"NETWORK.DELETE"}, {"name":"NETWORK.UPDATE"}, {"name":"LB.ASSIGN.TO.RULE"}, {"name":"LB.REMOVE.FROM.RULE"}, {"name":"LB.CREATE"}, {"name":"LB.DELETE"}, {"name":"LB.UPDATE"}, {"name":"ACCOUNT.DISABLE"}, {"name":"ACCOUNT.CREATE"}, {"name":"ACCOUNT.DELETE"}, {"name":"USER.LOGIN"}, {"name":"USER.LOGOUT"}, {"name":"USER.CREATE"}, {"name":"USER.DELETE"}, {"name":"USER.DISABLE"}, {"name":"USER.UPDATE"}, {"name":"USER.ENABLE"}, {"name":"TEMPLATE.CREATE"}, {"name":"TEMPLATE.DELETE"}, {"name":"TEMPLATE.UPDATE"}, {"name":"TEMPLATE.DOWNLOAD.START"}, {"name":"TEMPLATE.DOWNLOAD.SUCCESS"}, {"name":"TEMPLATE.DOWNLOAD.FAILED"}, {"name":"TEMPLATE.COPY"}, {"name":"TEMPLATE.EXTRACT"}, {"name":"TEMPLATE.UPLOAD"}, {"name":"TEMPLATE.CLEANUP"}, {"name":"VOLUME.CREATE"}, {"name":"VOLUME.DELETE"}, {"name":"VOLUME.ATTACH"}, {"name":"VOLUME.DETACH"}, {"name":"VOLUME.EXTRACT"}, {"name":"VOLUME.UPLOAD"}, {"name":"DOMAIN.CREATE"}, {"name":"DOMAIN.DELETE"}, {"name":"DOMAIN.UPDATE"}, {"name":"SNAPSHOT.CREATE"}, {"name":"SNAPSHOT.DELETE"}, {"name":"SNAPSHOTPOLICY.CREATE"}, {"name":"SNAPSHOTPOLICY.UPDATE"}, {"name":"SNAPSHOTPOLICY.DELETE"}, {"name":"ISO.CREATE"}, {"name":"ISO.DELETE"}, {"name":"ISO.COPY"}, {"name":"ISO.ATTACH"}, {"name":"ISO.DETACH"}, {"name":"ISO.EXTRACT"}, {"name":"ISO.UPLOAD"}, {"name":"SSVM.CREATE"}, {"name":"SSVM.DESTROY"}, {"name":"SSVM.START"}, {"name":"SSVM.STOP"}, {"name":"SSVM.REBOOT"}, {"name":"SSVM.HA"}, {"name":"SERVICE.OFFERING.CREATE"}, {"name":"SERVICE.OFFERING.EDIT"}, {"name":"SERVICE.OFFERING.DELETE"}, {"name":"DISK.OFFERING.CREATE"}, {"name":"DISK.OFFERING.EDIT"}, {"name":"DISK.OFFERING.DELETE"}, {"name":"NETWORK.OFFERING.CREATE"}, {"name":"NETWORK.OFFERING.ASSIGN"}, {"name":"NETWORK.OFFERING.EDIT"}, {"name":"NETWORK.OFFERING.REMOVE"}, {"name":"NETWORK.OFFERING.DELETE"}, {"name":"POD.CREATE"}, {"name":"POD.EDIT"}, {"name":"POD.DELETE"}, {"name":"ZONE.CREATE"}, {"name":"ZONE.EDIT"}, {"name":"ZONE.DELETE"}, {"name":"VLAN.IP.RANGE.CREATE"}, {"name":"VLAN.IP.RANGE.DELETE"}, {"name":"CONFIGURATION.VALUE.EDIT"}, {"name":"SG.AUTH.INGRESS"}, {"name":"SG.REVOKE.INGRESS"}, {"name":"SG.CREATE"}, {"name":"SG.DELETE"}, {"name":"HOST.RECONNECT"}, {"name":"MAINT.CANCEL"}, {"name":"MAINT.CANCEL.PS"}, {"name":"MAINT.PREPARE"}, {"name":"MAINT.PREPARE.PS"}, {"name":"VPN.REMOTE.ACCESS.CREATE"}, {"name":"VPN.REMOTE.ACCESS.DESTROY"}, {"name":"VPN.USER.ADD"}, {"name":"VPN.USER.REMOVE"}, {"name":"NETWORK.RESTART"}, {"name":"UPLOAD.CUSTOM.CERTIFICATE"}, {"name":"STATICNAT.ENABLE"}, {"name":"STATICNAT.DISABLE"}, {"name":"ZONE.VLAN.ASSIGN"}, {"name":"ZONE.VLAN.RELEASE"} ] } }
|
Loading…
Reference in New Issue