Cloudstack convention is to capitalize abbreviations, so change Iso to ISO

This commit is contained in:
Richard Downer 2011-11-10 17:28:39 +02:00
parent e0b468b0a6
commit 5ce18320eb
15 changed files with 264 additions and 264 deletions

View File

@ -26,7 +26,7 @@ import org.jclouds.cloudstack.features.EventAsyncClient;
import org.jclouds.cloudstack.features.FirewallAsyncClient;
import org.jclouds.cloudstack.features.GuestOSAsyncClient;
import org.jclouds.cloudstack.features.HypervisorAsyncClient;
import org.jclouds.cloudstack.features.IsoAsyncClient;
import org.jclouds.cloudstack.features.ISOAsyncClient;
import org.jclouds.cloudstack.features.LimitAsyncClient;
import org.jclouds.cloudstack.features.LoadBalancerAsyncClient;
import org.jclouds.cloudstack.features.NATAsyncClient;
@ -169,5 +169,5 @@ public interface CloudStackAsyncClient {
* Provides asynchronous access to ISOs
*/
@Delegate
IsoAsyncClient getIsoClient();
ISOAsyncClient getISOClient();
}

View File

@ -28,7 +28,7 @@ import org.jclouds.cloudstack.features.EventClient;
import org.jclouds.cloudstack.features.FirewallClient;
import org.jclouds.cloudstack.features.GuestOSClient;
import org.jclouds.cloudstack.features.HypervisorClient;
import org.jclouds.cloudstack.features.IsoClient;
import org.jclouds.cloudstack.features.ISOClient;
import org.jclouds.cloudstack.features.LimitClient;
import org.jclouds.cloudstack.features.LoadBalancerClient;
import org.jclouds.cloudstack.features.NATClient;
@ -172,5 +172,5 @@ public interface CloudStackClient {
* Provides synchronous access to ISOs
*/
@Delegate
IsoClient getIsoClient();
ISOClient getISOClient();
}

View File

@ -39,8 +39,8 @@ import org.jclouds.cloudstack.features.GuestOSAsyncClient;
import org.jclouds.cloudstack.features.GuestOSClient;
import org.jclouds.cloudstack.features.HypervisorAsyncClient;
import org.jclouds.cloudstack.features.HypervisorClient;
import org.jclouds.cloudstack.features.IsoAsyncClient;
import org.jclouds.cloudstack.features.IsoClient;
import org.jclouds.cloudstack.features.ISOAsyncClient;
import org.jclouds.cloudstack.features.ISOClient;
import org.jclouds.cloudstack.features.LimitAsyncClient;
import org.jclouds.cloudstack.features.LimitClient;
import org.jclouds.cloudstack.features.LoadBalancerAsyncClient;
@ -103,7 +103,7 @@ public class CloudStackRestClientModule extends RestClientModule<CloudStackClien
.put(LimitClient.class, LimitAsyncClient.class)//
.put(SSHKeyPairClient.class, SSHKeyPairAsyncClient.class)//
.put(VMGroupClient.class, VMGroupAsyncClient.class)//
.put(IsoClient.class, IsoAsyncClient.class)//
.put(ISOClient.class, ISOAsyncClient.class)//
.build();
public CloudStackRestClientModule() {

View File

@ -27,7 +27,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
/**
* @author Richard Downer
*/
public class Iso implements Comparable<Iso> {
public class ISO implements Comparable<ISO> {
public static Builder builder() {
return new Builder();
@ -382,7 +382,7 @@ public class Iso implements Comparable<Iso> {
/**
* present only for serializer
*/
Iso() {
ISO() {
}
/**
@ -625,15 +625,15 @@ public class Iso implements Comparable<Iso> {
}
@Override
public int compareTo(Iso other) {
public int compareTo(ISO other) {
throw new RuntimeException("FIXME: Implement me");
}
public enum IsoFilter {
public enum ISOFilter {
featured, self, self_executable, executable, community, UNRECOGNIZED;
public static IsoFilter fromValue(String format) {
public static ISOFilter fromValue(String format) {
try {
return valueOf(checkNotNull(format, "format"));
} catch (IllegalArgumentException e) {

View File

@ -25,7 +25,7 @@ import java.util.Date;
/**
* @author Richard Downer
*/
public class IsoExtraction implements Comparable<IsoExtraction> {
public class ISOExtraction implements Comparable<ISOExtraction> {
public static Builder builder() {
return new Builder();
@ -175,7 +175,7 @@ public class IsoExtraction implements Comparable<IsoExtraction> {
/**
* present only for serializer
*/
IsoExtraction() {
ISOExtraction() {
}
/**
@ -285,7 +285,7 @@ public class IsoExtraction implements Comparable<IsoExtraction> {
}
@Override
public int compareTo(IsoExtraction other) {
public int compareTo(ISOExtraction other) {
throw new RuntimeException("FIXME: Implement me");
}

View File

@ -23,7 +23,7 @@ import com.google.gson.annotations.SerializedName;
/**
* @author Richard Downer
*/
public class IsoPermissions implements Comparable<IsoPermissions> {
public class ISOPermissions implements Comparable<ISOPermissions> {
public static Builder builder() {
return new Builder();
@ -80,7 +80,7 @@ public class IsoPermissions implements Comparable<IsoPermissions> {
/**
* present only for serializer
*/
IsoPermissions() {
ISOPermissions() {
}
/**
@ -127,7 +127,7 @@ public class IsoPermissions implements Comparable<IsoPermissions> {
}
@Override
public int compareTo(IsoPermissions other) {
public int compareTo(ISOPermissions other) {
throw new RuntimeException("FIXME: Implement me");
}

View File

@ -21,16 +21,16 @@ package org.jclouds.cloudstack.features;
import com.google.common.util.concurrent.ListenableFuture;
import org.jclouds.cloudstack.domain.AsyncCreateResponse;
import org.jclouds.cloudstack.domain.ExtractMode;
import org.jclouds.cloudstack.domain.Iso;
import org.jclouds.cloudstack.domain.IsoPermissions;
import org.jclouds.cloudstack.domain.ISO;
import org.jclouds.cloudstack.domain.ISOPermissions;
import org.jclouds.cloudstack.filters.QuerySigner;
import org.jclouds.cloudstack.options.AccountInDomainOptions;
import org.jclouds.cloudstack.options.DeleteIsoOptions;
import org.jclouds.cloudstack.options.ExtractIsoOptions;
import org.jclouds.cloudstack.options.ListIsosOptions;
import org.jclouds.cloudstack.options.RegisterIsoOptions;
import org.jclouds.cloudstack.options.UpdateIsoOptions;
import org.jclouds.cloudstack.options.UpdateIsoPermissionsOptions;
import org.jclouds.cloudstack.options.DeleteISOOptions;
import org.jclouds.cloudstack.options.ExtractISOOptions;
import org.jclouds.cloudstack.options.ListISOsOptions;
import org.jclouds.cloudstack.options.RegisterISOOptions;
import org.jclouds.cloudstack.options.UpdateISOOptions;
import org.jclouds.cloudstack.options.UpdateISOPermissionsOptions;
import org.jclouds.rest.annotations.QueryParams;
import org.jclouds.rest.annotations.RequestFilters;
import org.jclouds.rest.annotations.SkipEncoding;
@ -46,14 +46,14 @@ import java.util.Set;
*
* <p/>
*
* @see IsoClient
* @see ISOClient
* @see http://download.cloud.com/releases/2.2.12/api/TOC_User.html
* @author Richard Downer
*/
@RequestFilters(QuerySigner.class)
@QueryParams(keys = "response", values = "json")
@SkipEncoding({'/', ','})
public interface IsoAsyncClient {
public interface ISOAsyncClient {
/**
* Attaches an ISO to a virtual machine.
@ -64,9 +64,9 @@ public interface IsoAsyncClient {
*/
@GET
@Consumes(MediaType.APPLICATION_JSON)
@QueryParams(keys = "command", values = "attachIso")
@QueryParams(keys = "command", values = "attachISO")
@Unwrap
ListenableFuture<AsyncCreateResponse> attachIso(@QueryParam("id") long isoId, @QueryParam("virtualmachineid") long vmId);
ListenableFuture<AsyncCreateResponse> attachISO(@QueryParam("id") long isoId, @QueryParam("virtualmachineid") long vmId);
/**
* Detaches any ISO file (if any) currently attached to a virtual machine.
@ -76,9 +76,9 @@ public interface IsoAsyncClient {
*/
@GET
@Consumes(MediaType.APPLICATION_JSON)
@QueryParams(keys = "command", values = "detachIso")
@QueryParams(keys = "command", values = "detachISO")
@Unwrap
ListenableFuture<AsyncCreateResponse> detachIso(@QueryParam("virtualmachineid") long vmId);
ListenableFuture<AsyncCreateResponse> detachISO(@QueryParam("virtualmachineid") long vmId);
/**
* Gets information about an ISO by its ID.
@ -88,9 +88,9 @@ public interface IsoAsyncClient {
*/
@GET
@Consumes(MediaType.APPLICATION_JSON)
@QueryParams(keys = "command", values = "listIsos")
@QueryParams(keys = "command", values = "listISOs")
@Unwrap
ListenableFuture<Iso> getIso(@QueryParam("id") long id);
ListenableFuture<ISO> getISO(@QueryParam("id") long id);
/**
* Lists all available ISO files.
@ -100,9 +100,9 @@ public interface IsoAsyncClient {
*/
@GET
@Consumes(MediaType.APPLICATION_JSON)
@QueryParams(keys = "command", values = "listIsos")
@QueryParams(keys = "command", values = "listISOs")
@Unwrap
ListenableFuture<Set<Iso>> listIsos(ListIsosOptions... options);
ListenableFuture<Set<ISO>> listISOs(ListISOsOptions... options);
/**
* Registers an existing ISO into the Cloud.com Cloud.
@ -116,9 +116,9 @@ public interface IsoAsyncClient {
*/
@GET
@Consumes(MediaType.APPLICATION_JSON)
@QueryParams(keys = "command", values = "registerIso")
@QueryParams(keys = "command", values = "registerISO")
@Unwrap
ListenableFuture<Iso> registerIso(@QueryParam("name") String name, @QueryParam("displaytext") String displayText, @QueryParam("url") String url, @QueryParam("zoneid") long zoneId, RegisterIsoOptions... options);
ListenableFuture<ISO> registerISO(@QueryParam("name") String name, @QueryParam("displaytext") String displayText, @QueryParam("url") String url, @QueryParam("zoneid") long zoneId, RegisterISOOptions... options);
/**
*
@ -129,9 +129,9 @@ public interface IsoAsyncClient {
*/
@GET
@Consumes(MediaType.APPLICATION_JSON)
@QueryParams(keys = "command", values = "updateIso")
@QueryParams(keys = "command", values = "updateISO")
@Unwrap
ListenableFuture<Iso> updateIso(@QueryParam("id") long id, UpdateIsoOptions... options);
ListenableFuture<ISO> updateISO(@QueryParam("id") long id, UpdateISOOptions... options);
/**
* Deletes an ISO file.
@ -142,9 +142,9 @@ public interface IsoAsyncClient {
*/
@GET
@Consumes(MediaType.APPLICATION_JSON)
@QueryParams(keys = "command", values = "deleteIso")
@QueryParams(keys = "command", values = "deleteISO")
@Unwrap
ListenableFuture<AsyncCreateResponse> deleteIso(@QueryParam("id") long id, DeleteIsoOptions... options);
ListenableFuture<AsyncCreateResponse> deleteISO(@QueryParam("id") long id, DeleteISOOptions... options);
/**
* Copies a template from one zone to another.
@ -156,9 +156,9 @@ public interface IsoAsyncClient {
*/
@GET
@Consumes(MediaType.APPLICATION_JSON)
@QueryParams(keys = "command", values = "copyIso")
@QueryParams(keys = "command", values = "copyISO")
@Unwrap
ListenableFuture<AsyncCreateResponse> copyIso(@QueryParam("id") long isoId, @QueryParam("sourcezoneid") long sourceZoneId, @QueryParam("destzoneid") long destZoneId);
ListenableFuture<AsyncCreateResponse> copyISO(@QueryParam("id") long isoId, @QueryParam("sourcezoneid") long sourceZoneId, @QueryParam("destzoneid") long destZoneId);
/**
* Updates iso permissions
@ -169,9 +169,9 @@ public interface IsoAsyncClient {
*/
@GET
@Consumes(MediaType.APPLICATION_JSON)
@QueryParams(keys = "command", values = "updateIsoPermissions")
@QueryParams(keys = "command", values = "updateISOPermissions")
@Unwrap
ListenableFuture<Void> updateIsoPermissions(@QueryParam("id") long id, UpdateIsoPermissionsOptions... options);
ListenableFuture<Void> updateISOPermissions(@QueryParam("id") long id, UpdateISOPermissionsOptions... options);
/**
* List template visibility and all accounts that have permissions to view this template.
@ -182,9 +182,9 @@ public interface IsoAsyncClient {
*/
@GET
@Consumes(MediaType.APPLICATION_JSON)
@QueryParams(keys = "command", values = "listIsoPermissions")
@QueryParams(keys = "command", values = "listISOPermissions")
@Unwrap
ListenableFuture<Set<IsoPermissions>> listIsoPermissions(@QueryParam("id") long id, AccountInDomainOptions... options);
ListenableFuture<Set<ISOPermissions>> listISOPermissions(@QueryParam("id") long id, AccountInDomainOptions... options);
/**
* Extracts an ISO
@ -197,8 +197,8 @@ public interface IsoAsyncClient {
*/
@GET
@Consumes(MediaType.APPLICATION_JSON)
@QueryParams(keys = "command", values = "extractIso")
@QueryParams(keys = "command", values = "extractISO")
@Unwrap
ListenableFuture<AsyncCreateResponse> extractIso(@QueryParam("id") long id, @QueryParam("mode") ExtractMode mode, @QueryParam("zoneid") long zoneId, ExtractIsoOptions... options);
ListenableFuture<AsyncCreateResponse> extractISO(@QueryParam("id") long id, @QueryParam("mode") ExtractMode mode, @QueryParam("zoneid") long zoneId, ExtractISOOptions... options);
}

View File

@ -20,15 +20,15 @@ package org.jclouds.cloudstack.features;
import org.jclouds.cloudstack.domain.AsyncCreateResponse;
import org.jclouds.cloudstack.domain.ExtractMode;
import org.jclouds.cloudstack.domain.Iso;
import org.jclouds.cloudstack.domain.IsoPermissions;
import org.jclouds.cloudstack.domain.ISO;
import org.jclouds.cloudstack.domain.ISOPermissions;
import org.jclouds.cloudstack.options.AccountInDomainOptions;
import org.jclouds.cloudstack.options.DeleteIsoOptions;
import org.jclouds.cloudstack.options.ExtractIsoOptions;
import org.jclouds.cloudstack.options.ListIsosOptions;
import org.jclouds.cloudstack.options.RegisterIsoOptions;
import org.jclouds.cloudstack.options.UpdateIsoOptions;
import org.jclouds.cloudstack.options.UpdateIsoPermissionsOptions;
import org.jclouds.cloudstack.options.DeleteISOOptions;
import org.jclouds.cloudstack.options.ExtractISOOptions;
import org.jclouds.cloudstack.options.ListISOsOptions;
import org.jclouds.cloudstack.options.RegisterISOOptions;
import org.jclouds.cloudstack.options.UpdateISOOptions;
import org.jclouds.cloudstack.options.UpdateISOPermissionsOptions;
import org.jclouds.concurrent.Timeout;
import java.util.Set;
@ -38,12 +38,12 @@ import java.util.concurrent.TimeUnit;
*
* <p/>
*
* @see IsoAsyncClient
* @see ISOAsyncClient
* @see http://download.cloud.com/releases/2.2.12/api/TOC_User.html
* @author Richard Downer
*/
@Timeout(duration = 60, timeUnit = TimeUnit.SECONDS)
public interface IsoClient {
public interface ISOClient {
/**
* Attaches an ISO to a virtual machine.
@ -52,7 +52,7 @@ public interface IsoClient {
* @param vmId the ID of the virtual machine
* @return an asynchronous job response.
*/
AsyncCreateResponse attachIso(long isoId, long vmId);
AsyncCreateResponse attachISO(long isoId, long vmId);
/**
* Detaches any ISO file (if any) currently attached to a virtual machine.
@ -60,7 +60,7 @@ public interface IsoClient {
* @param vmId The ID of the virtual machine
* @return an asynchronous job response.
*/
AsyncCreateResponse detachIso(long vmId);
AsyncCreateResponse detachISO(long vmId);
/**
* Gets information about an ISO by its ID.
@ -68,7 +68,7 @@ public interface IsoClient {
* @param id the ID of the ISO file
* @return the ISO object matching the ID
*/
Iso getIso(long id);
ISO getISO(long id);
/**
* Lists all available ISO files.
@ -76,7 +76,7 @@ public interface IsoClient {
* @param options optional arguments
* @return a set of ISO objects the match the filter
*/
Set<Iso> listIsos(ListIsosOptions... options);
Set<ISO> listISOs(ListISOsOptions... options);
/**
* Registers an existing ISO into the Cloud.com Cloud.
@ -88,7 +88,7 @@ public interface IsoClient {
* @param options optional arguments
* @return the newly-added ISO
*/
Iso registerIso(String name, String displayText, String url, long zoneId, RegisterIsoOptions... options);
ISO registerISO(String name, String displayText, String url, long zoneId, RegisterISOOptions... options);
/**
*
@ -97,7 +97,7 @@ public interface IsoClient {
* @param options optional arguments
* @return the ISO object matching the ID
*/
Iso updateIso(long id, UpdateIsoOptions... options);
ISO updateISO(long id, UpdateISOOptions... options);
/**
* Deletes an ISO file.
@ -106,7 +106,7 @@ public interface IsoClient {
* @param options optional arguments
* @return an asynchronous job response.
*/
AsyncCreateResponse deleteIso(long id, DeleteIsoOptions... options);
AsyncCreateResponse deleteISO(long id, DeleteISOOptions... options);
/**
* Copies a template from one zone to another.
@ -116,7 +116,7 @@ public interface IsoClient {
* @param destZoneId ID of the zone the template is being copied to.
* @return an asynchronous job response.
*/
AsyncCreateResponse copyIso(long isoId, long sourceZoneId, long destZoneId);
AsyncCreateResponse copyISO(long isoId, long sourceZoneId, long destZoneId);
/**
* Updates iso permissions
@ -125,7 +125,7 @@ public interface IsoClient {
* @param options optional arguments
* @return
*/
void updateIsoPermissions(long id, UpdateIsoPermissionsOptions... options);
void updateISOPermissions(long id, UpdateISOPermissionsOptions... options);
/**
* List template visibility and all accounts that have permissions to view this template.
@ -134,7 +134,7 @@ public interface IsoClient {
* @param options optional arguments
* @return A set of the permissions on this ISO
*/
Set<IsoPermissions> listIsoPermissions(long id, AccountInDomainOptions... options);
Set<ISOPermissions> listISOPermissions(long id, AccountInDomainOptions... options);
/**
* Extracts an ISO
@ -145,6 +145,6 @@ public interface IsoClient {
* @param options optional arguments
* @return an asynchronous job response.
*/
AsyncCreateResponse extractIso(long id, ExtractMode mode, long zoneId, ExtractIsoOptions... options);
AsyncCreateResponse extractISO(long id, ExtractMode mode, long zoneId, ExtractISOOptions... options);
}

View File

@ -22,20 +22,20 @@ import com.google.common.collect.ImmutableSet;
import org.jclouds.http.options.BaseHttpRequestOptions;
/**
* Options for the Iso deleteIso method.
* Options for the ISO deleteISO method.
*
* @see org.jclouds.cloudstack.features.IsoClient#deleteIso
* @see org.jclouds.cloudstack.features.IsoAsyncClient#deleteIso
* @see org.jclouds.cloudstack.features.ISOClient#deleteISO
* @see org.jclouds.cloudstack.features.ISOAsyncClient#deleteISO
* @author Richard Downer
*/
public class DeleteIsoOptions extends BaseHttpRequestOptions {
public class DeleteISOOptions extends BaseHttpRequestOptions {
public static final DeleteIsoOptions NONE = new DeleteIsoOptions();
public static final DeleteISOOptions NONE = new DeleteISOOptions();
/**
* @param zoneId the ID of the zone of the ISO file. If not specified, the ISO will be deleted from all the zones
*/
public DeleteIsoOptions zoneId(long zoneId) {
public DeleteISOOptions zoneId(long zoneId) {
this.queryParameters.replaceValues("zoneid", ImmutableSet.of(zoneId + ""));
return this;
}
@ -45,8 +45,8 @@ public class DeleteIsoOptions extends BaseHttpRequestOptions {
/**
* @param zoneId the ID of the zone of the ISO file. If not specified, the ISO will be deleted from all the zones
*/
public static DeleteIsoOptions zoneId(long zoneId) {
return new DeleteIsoOptions().zoneId(zoneId);
public static DeleteISOOptions zoneId(long zoneId) {
return new DeleteISOOptions().zoneId(zoneId);
}
}

View File

@ -22,20 +22,20 @@ import com.google.common.collect.ImmutableSet;
import org.jclouds.http.options.BaseHttpRequestOptions;
/**
* Options for the Iso extractIso method.
* Options for the ISO extractISO method.
*
* @see org.jclouds.cloudstack.features.IsoClient#extractIso
* @see org.jclouds.cloudstack.features.IsoAsyncClient#extractIso
* @see org.jclouds.cloudstack.features.ISOClient#extractISO
* @see org.jclouds.cloudstack.features.ISOAsyncClient#extractISO
* @author Richard Downer
*/
public class ExtractIsoOptions extends BaseHttpRequestOptions {
public class ExtractISOOptions extends BaseHttpRequestOptions {
public static final ExtractIsoOptions NONE = new ExtractIsoOptions();
public static final ExtractISOOptions NONE = new ExtractISOOptions();
/**
* @param url the url to which the ISO would be extracted
*/
public ExtractIsoOptions url(String url) {
public ExtractISOOptions url(String url) {
this.queryParameters.replaceValues("url", ImmutableSet.of(url + ""));
return this;
}
@ -45,8 +45,8 @@ public class ExtractIsoOptions extends BaseHttpRequestOptions {
/**
* @param url the url to which the ISO would be extracted
*/
public static ExtractIsoOptions url(String url) {
return new ExtractIsoOptions().url(url);
public static ExtractISOOptions url(String url) {
return new ExtractISOOptions().url(url);
}
}

View File

@ -19,24 +19,24 @@
package org.jclouds.cloudstack.options;
import com.google.common.collect.ImmutableSet;
import org.jclouds.cloudstack.domain.Iso;
import org.jclouds.cloudstack.domain.ISO;
import org.jclouds.http.options.BaseHttpRequestOptions;
/**
* Options for the Iso listIsos method.
* Options for the ISO listISOs method.
*
* @see org.jclouds.cloudstack.features.IsoClient#listIsos
* @see org.jclouds.cloudstack.features.IsoAsyncClient#listIsos
* @see org.jclouds.cloudstack.features.ISOClient#listISOs
* @see org.jclouds.cloudstack.features.ISOAsyncClient#listISOs
* @author Richard Downer
*/
public class ListIsosOptions extends AccountInDomainOptions {
public class ListISOsOptions extends AccountInDomainOptions {
public static final ListIsosOptions NONE = new ListIsosOptions();
public static final ListISOsOptions NONE = new ListISOsOptions();
/**
* @param bootable true if the ISO is bootable, false otherwise
*/
public ListIsosOptions bootable(boolean bootable) {
public ListISOsOptions bootable(boolean bootable) {
this.queryParameters.replaceValues("bootable", ImmutableSet.of(bootable + ""));
return this;
}
@ -44,7 +44,7 @@ public class ListIsosOptions extends AccountInDomainOptions {
/**
* @param hypervisor the hypervisor for which to restrict the search
*/
public ListIsosOptions hypervisor(String hypervisor) {
public ListISOsOptions hypervisor(String hypervisor) {
this.queryParameters.replaceValues("hypervisor", ImmutableSet.of(hypervisor + ""));
return this;
}
@ -52,7 +52,7 @@ public class ListIsosOptions extends AccountInDomainOptions {
/**
* @param id list all isos by id
*/
public ListIsosOptions id(long id) {
public ListISOsOptions id(long id) {
this.queryParameters.replaceValues("id", ImmutableSet.of(id + ""));
return this;
}
@ -60,7 +60,7 @@ public class ListIsosOptions extends AccountInDomainOptions {
/**
* @param isoFilter possible values are "featured", "self", "self-executable","executable", and "community".
*/
public ListIsosOptions isoFilter(Iso.IsoFilter isoFilter) {
public ListISOsOptions isoFilter(ISO.ISOFilter isoFilter) {
this.queryParameters.replaceValues("isofilter", ImmutableSet.of(isoFilter + ""));
return this;
}
@ -68,7 +68,7 @@ public class ListIsosOptions extends AccountInDomainOptions {
/**
* @param isPublic true if the ISO is publicly available to all users, false otherwise.
*/
public ListIsosOptions isPublic(boolean isPublic) {
public ListISOsOptions isPublic(boolean isPublic) {
this.queryParameters.replaceValues("ispublic", ImmutableSet.of(isPublic + ""));
return this;
}
@ -76,7 +76,7 @@ public class ListIsosOptions extends AccountInDomainOptions {
/**
* @param isReady true if this ISO is ready to be deployed
*/
public ListIsosOptions isReady(boolean isReady) {
public ListISOsOptions isReady(boolean isReady) {
this.queryParameters.replaceValues("isready", ImmutableSet.of(isReady + ""));
return this;
}
@ -84,7 +84,7 @@ public class ListIsosOptions extends AccountInDomainOptions {
/**
* @param keyword List by keyword
*/
public ListIsosOptions keyword(String keyword) {
public ListISOsOptions keyword(String keyword) {
this.queryParameters.replaceValues("keyword", ImmutableSet.of(keyword + ""));
return this;
}
@ -92,7 +92,7 @@ public class ListIsosOptions extends AccountInDomainOptions {
/**
* @param name list all isos by name
*/
public ListIsosOptions name(String name) {
public ListISOsOptions name(String name) {
this.queryParameters.replaceValues("name", ImmutableSet.of(name + ""));
return this;
}
@ -100,7 +100,7 @@ public class ListIsosOptions extends AccountInDomainOptions {
/**
* @param zoneId the ID of the zone
*/
public ListIsosOptions zoneId(long zoneId) {
public ListISOsOptions zoneId(long zoneId) {
this.queryParameters.replaceValues("zoneid", ImmutableSet.of(zoneId + ""));
return this;
}
@ -110,78 +110,78 @@ public class ListIsosOptions extends AccountInDomainOptions {
/**
* @param account the account of the ISO file. Must be used with the domainId parameter.
*/
public static ListIsosOptions accountInDomain(String account, long domainId) {
return (ListIsosOptions) new ListIsosOptions().accountInDomain(account, domainId);
public static ListISOsOptions accountInDomain(String account, long domainId) {
return (ListISOsOptions) new ListISOsOptions().accountInDomain(account, domainId);
}
/**
* @param bootable true if the ISO is bootable, false otherwise
*/
public static ListIsosOptions bootable(boolean bootable) {
return new ListIsosOptions().bootable(bootable);
public static ListISOsOptions bootable(boolean bootable) {
return new ListISOsOptions().bootable(bootable);
}
/**
* @param domainId lists all available ISO files by ID of a domain. If used with the account parameter, lists all available ISO files for the account in the ID of a domain.
*/
public static ListIsosOptions domainId(long domainId) {
return (ListIsosOptions) new ListIsosOptions().domainId(domainId);
public static ListISOsOptions domainId(long domainId) {
return (ListISOsOptions) new ListISOsOptions().domainId(domainId);
}
/**
* @param hypervisor the hypervisor for which to restrict the search
*/
public static ListIsosOptions hypervisor(String hypervisor) {
return new ListIsosOptions().hypervisor(hypervisor);
public static ListISOsOptions hypervisor(String hypervisor) {
return new ListISOsOptions().hypervisor(hypervisor);
}
/**
* @param id list all isos by id
*/
public static ListIsosOptions id(long id) {
return new ListIsosOptions().id(id);
public static ListISOsOptions id(long id) {
return new ListISOsOptions().id(id);
}
/**
* @param isoFilter possible values are "featured", "self", "self-executable","executable", and "community".
*/
public static ListIsosOptions isoFilter(Iso.IsoFilter isoFilter) {
return new ListIsosOptions().isoFilter(isoFilter);
public static ListISOsOptions isoFilter(ISO.ISOFilter isoFilter) {
return new ListISOsOptions().isoFilter(isoFilter);
}
/**
* @param isPublic true if the ISO is publicly available to all users, false otherwise.
*/
public static ListIsosOptions isPublic(boolean isPublic) {
return new ListIsosOptions().isPublic(isPublic);
public static ListISOsOptions isPublic(boolean isPublic) {
return new ListISOsOptions().isPublic(isPublic);
}
/**
* @param isReady true if this ISO is ready to be deployed
*/
public static ListIsosOptions isReady(boolean isReady) {
return new ListIsosOptions().isReady(isReady);
public static ListISOsOptions isReady(boolean isReady) {
return new ListISOsOptions().isReady(isReady);
}
/**
* @param keyword List by keyword
*/
public static ListIsosOptions keyword(String keyword) {
return new ListIsosOptions().keyword(keyword);
public static ListISOsOptions keyword(String keyword) {
return new ListISOsOptions().keyword(keyword);
}
/**
* @param name list all isos by name
*/
public static ListIsosOptions name(String name) {
return new ListIsosOptions().name(name);
public static ListISOsOptions name(String name) {
return new ListISOsOptions().name(name);
}
/**
* @param zoneId the ID of the zone
*/
public static ListIsosOptions zoneId(long zoneId) {
return new ListIsosOptions().zoneId(zoneId);
public static ListISOsOptions zoneId(long zoneId) {
return new ListISOsOptions().zoneId(zoneId);
}
}

View File

@ -22,20 +22,20 @@ import com.google.common.collect.ImmutableSet;
import org.jclouds.http.options.BaseHttpRequestOptions;
/**
* Options for the Iso registerIso method.
* Options for the ISO registerISO method.
*
* @see org.jclouds.cloudstack.features.IsoClient#registerIso
* @see org.jclouds.cloudstack.features.IsoAsyncClient#registerIso
* @see org.jclouds.cloudstack.features.ISOClient#registerISO
* @see org.jclouds.cloudstack.features.ISOAsyncClient#registerISO
* @author Richard Downer
*/
public class RegisterIsoOptions extends AccountInDomainOptions {
public class RegisterISOOptions extends AccountInDomainOptions {
public static final RegisterIsoOptions NONE = new RegisterIsoOptions();
public static final RegisterISOOptions NONE = new RegisterISOOptions();
/**
* @param bootable true if this ISO is bootable
*/
public RegisterIsoOptions bootable(boolean bootable) {
public RegisterISOOptions bootable(boolean bootable) {
this.queryParameters.replaceValues("bootable", ImmutableSet.of(bootable + ""));
return this;
}
@ -43,7 +43,7 @@ public class RegisterIsoOptions extends AccountInDomainOptions {
/**
* @param isExtractable true if the iso or its derivatives are extractable; default is false
*/
public RegisterIsoOptions isExtractable(boolean isExtractable) {
public RegisterISOOptions isExtractable(boolean isExtractable) {
this.queryParameters.replaceValues("isextractable", ImmutableSet.of(isExtractable + ""));
return this;
}
@ -51,7 +51,7 @@ public class RegisterIsoOptions extends AccountInDomainOptions {
/**
* @param isFeatured true if you want this ISO to be featured
*/
public RegisterIsoOptions isFeatured(boolean isFeatured) {
public RegisterISOOptions isFeatured(boolean isFeatured) {
this.queryParameters.replaceValues("isfeatured", ImmutableSet.of(isFeatured + ""));
return this;
}
@ -59,7 +59,7 @@ public class RegisterIsoOptions extends AccountInDomainOptions {
/**
* @param isPublic true if you want to register the ISO to be publicly available to all users, false otherwise.
*/
public RegisterIsoOptions isPublic(boolean isPublic) {
public RegisterISOOptions isPublic(boolean isPublic) {
this.queryParameters.replaceValues("ispublic", ImmutableSet.of(isPublic + ""));
return this;
}
@ -67,7 +67,7 @@ public class RegisterIsoOptions extends AccountInDomainOptions {
/**
* @param osTypeId the ID of the OS Type that best represents the OS of this ISO
*/
public RegisterIsoOptions osTypeId(long osTypeId) {
public RegisterISOOptions osTypeId(long osTypeId) {
this.queryParameters.replaceValues("ostypeid", ImmutableSet.of(osTypeId + ""));
return this;
}
@ -77,50 +77,50 @@ public class RegisterIsoOptions extends AccountInDomainOptions {
/**
* @param account an optional account name. Must be used with domainId.
*/
public static RegisterIsoOptions accountInDomain(String account, long domainId) {
return (RegisterIsoOptions) new RegisterIsoOptions().accountInDomain(account, domainId);
public static RegisterISOOptions accountInDomain(String account, long domainId) {
return (RegisterISOOptions) new RegisterISOOptions().accountInDomain(account, domainId);
}
/**
* @param bootable true if this ISO is bootable
*/
public static RegisterIsoOptions bootable(boolean bootable) {
return new RegisterIsoOptions().bootable(bootable);
public static RegisterISOOptions bootable(boolean bootable) {
return new RegisterISOOptions().bootable(bootable);
}
/**
* @param domainId an optional domainId. If the account parameter is used, domainId must also be used.
*/
public static RegisterIsoOptions domainId(long domainId) {
return (RegisterIsoOptions) new RegisterIsoOptions().domainId(domainId);
public static RegisterISOOptions domainId(long domainId) {
return (RegisterISOOptions) new RegisterISOOptions().domainId(domainId);
}
/**
* @param isExtractable true if the iso or its derivatives are extractable; default is false
*/
public static RegisterIsoOptions isExtractable(boolean isExtractable) {
return new RegisterIsoOptions().isExtractable(isExtractable);
public static RegisterISOOptions isExtractable(boolean isExtractable) {
return new RegisterISOOptions().isExtractable(isExtractable);
}
/**
* @param isFeatured true if you want this ISO to be featured
*/
public static RegisterIsoOptions isFeatured(boolean isFeatured) {
return new RegisterIsoOptions().isFeatured(isFeatured);
public static RegisterISOOptions isFeatured(boolean isFeatured) {
return new RegisterISOOptions().isFeatured(isFeatured);
}
/**
* @param isPublic true if you want to register the ISO to be publicly available to all users, false otherwise.
*/
public static RegisterIsoOptions isPublic(boolean isPublic) {
return new RegisterIsoOptions().isPublic(isPublic);
public static RegisterISOOptions isPublic(boolean isPublic) {
return new RegisterISOOptions().isPublic(isPublic);
}
/**
* @param osTypeId the ID of the OS Type that best represents the OS of this ISO
*/
public static RegisterIsoOptions osTypeId(long osTypeId) {
return new RegisterIsoOptions().osTypeId(osTypeId);
public static RegisterISOOptions osTypeId(long osTypeId) {
return new RegisterISOOptions().osTypeId(osTypeId);
}
}

View File

@ -22,20 +22,20 @@ import com.google.common.collect.ImmutableSet;
import org.jclouds.http.options.BaseHttpRequestOptions;
/**
* Options for the Iso updateIso method.
* Options for the ISO updateISO method.
*
* @see org.jclouds.cloudstack.features.IsoClient#updateIso
* @see org.jclouds.cloudstack.features.IsoAsyncClient#updateIso
* @see org.jclouds.cloudstack.features.ISOClient#updateISO
* @see org.jclouds.cloudstack.features.ISOAsyncClient#updateISO
* @author Richard Downer
*/
public class UpdateIsoOptions extends BaseHttpRequestOptions {
public class UpdateISOOptions extends BaseHttpRequestOptions {
public static final UpdateIsoOptions NONE = new UpdateIsoOptions();
public static final UpdateISOOptions NONE = new UpdateISOOptions();
/**
* @param bootable true if image is bootable, false otherwise
*/
public UpdateIsoOptions bootable(boolean bootable) {
public UpdateISOOptions bootable(boolean bootable) {
this.queryParameters.replaceValues("bootable", ImmutableSet.of(bootable + ""));
return this;
}
@ -43,7 +43,7 @@ public class UpdateIsoOptions extends BaseHttpRequestOptions {
/**
* @param displayText the display text of the image
*/
public UpdateIsoOptions displayText(String displayText) {
public UpdateISOOptions displayText(String displayText) {
this.queryParameters.replaceValues("displaytext", ImmutableSet.of(displayText + ""));
return this;
}
@ -51,7 +51,7 @@ public class UpdateIsoOptions extends BaseHttpRequestOptions {
/**
* @param format the format for the image
*/
public UpdateIsoOptions format(String format) {
public UpdateISOOptions format(String format) {
this.queryParameters.replaceValues("format", ImmutableSet.of(format + ""));
return this;
}
@ -59,7 +59,7 @@ public class UpdateIsoOptions extends BaseHttpRequestOptions {
/**
* @param name the name of the image file
*/
public UpdateIsoOptions name(String name) {
public UpdateISOOptions name(String name) {
this.queryParameters.replaceValues("name", ImmutableSet.of(name + ""));
return this;
}
@ -67,7 +67,7 @@ public class UpdateIsoOptions extends BaseHttpRequestOptions {
/**
* @param osTypeId the ID of the OS type that best represents the OS of this image.
*/
public UpdateIsoOptions osTypeId(long osTypeId) {
public UpdateISOOptions osTypeId(long osTypeId) {
this.queryParameters.replaceValues("ostypeid", ImmutableSet.of(osTypeId + ""));
return this;
}
@ -75,7 +75,7 @@ public class UpdateIsoOptions extends BaseHttpRequestOptions {
/**
* @param passwordEnabled true if the image supports the password reset feature; default is false
*/
public UpdateIsoOptions passwordEnabled(boolean passwordEnabled) {
public UpdateISOOptions passwordEnabled(boolean passwordEnabled) {
this.queryParameters.replaceValues("passwordenabled", ImmutableSet.of(passwordEnabled + ""));
return this;
}
@ -85,43 +85,43 @@ public class UpdateIsoOptions extends BaseHttpRequestOptions {
/**
* @param bootable true if image is bootable, false otherwise
*/
public static UpdateIsoOptions bootable(boolean bootable) {
return new UpdateIsoOptions().bootable(bootable);
public static UpdateISOOptions bootable(boolean bootable) {
return new UpdateISOOptions().bootable(bootable);
}
/**
* @param displayText the display text of the image
*/
public static UpdateIsoOptions displayText(String displayText) {
return new UpdateIsoOptions().displayText(displayText);
public static UpdateISOOptions displayText(String displayText) {
return new UpdateISOOptions().displayText(displayText);
}
/**
* @param format the format for the image
*/
public static UpdateIsoOptions format(String format) {
return new UpdateIsoOptions().format(format);
public static UpdateISOOptions format(String format) {
return new UpdateISOOptions().format(format);
}
/**
* @param name the name of the image file
*/
public static UpdateIsoOptions name(String name) {
return new UpdateIsoOptions().name(name);
public static UpdateISOOptions name(String name) {
return new UpdateISOOptions().name(name);
}
/**
* @param osTypeId the ID of the OS type that best represents the OS of this image.
*/
public static UpdateIsoOptions osTypeId(long osTypeId) {
return new UpdateIsoOptions().osTypeId(osTypeId);
public static UpdateISOOptions osTypeId(long osTypeId) {
return new UpdateISOOptions().osTypeId(osTypeId);
}
/**
* @param passwordEnabled true if the image supports the password reset feature; default is false
*/
public static UpdateIsoOptions passwordEnabled(boolean passwordEnabled) {
return new UpdateIsoOptions().passwordEnabled(passwordEnabled);
public static UpdateISOOptions passwordEnabled(boolean passwordEnabled) {
return new UpdateISOOptions().passwordEnabled(passwordEnabled);
}
}

View File

@ -24,20 +24,20 @@ import org.jclouds.cloudstack.domain.PermissionOperation;
import org.jclouds.http.options.BaseHttpRequestOptions;
/**
* Options for the Iso updateIsoPermissions method.
* Options for the ISO updateISOPermissions method.
*
* @see org.jclouds.cloudstack.features.IsoClient#updateIsoPermissions
* @see org.jclouds.cloudstack.features.IsoAsyncClient#updateIsoPermissions
* @see org.jclouds.cloudstack.features.ISOClient#updateISOPermissions
* @see org.jclouds.cloudstack.features.ISOAsyncClient#updateISOPermissions
* @author Richard Downer
*/
public class UpdateIsoPermissionsOptions extends BaseHttpRequestOptions {
public class UpdateISOPermissionsOptions extends BaseHttpRequestOptions {
public static final UpdateIsoPermissionsOptions NONE = new UpdateIsoPermissionsOptions();
public static final UpdateISOPermissionsOptions NONE = new UpdateISOPermissionsOptions();
/**
* @param accounts a comma delimited list of accounts. If specified, "op" parameter has to be passed in.
*/
public UpdateIsoPermissionsOptions accounts(Iterable<String> accounts) {
public UpdateISOPermissionsOptions accounts(Iterable<String> accounts) {
this.queryParameters.replaceValues("accounts", ImmutableSet.of(Joiner.on(',').join(accounts)));
return this;
}
@ -45,7 +45,7 @@ public class UpdateIsoPermissionsOptions extends BaseHttpRequestOptions {
/**
* @param isExtractable true if the template/iso is extractable, false other wise. Can be set only by root admin
*/
public UpdateIsoPermissionsOptions isExtractable(boolean isExtractable) {
public UpdateISOPermissionsOptions isExtractable(boolean isExtractable) {
this.queryParameters.replaceValues("isextractable", ImmutableSet.of(isExtractable + ""));
return this;
}
@ -53,7 +53,7 @@ public class UpdateIsoPermissionsOptions extends BaseHttpRequestOptions {
/**
* @param isFeatured true for featured template/iso, false otherwise
*/
public UpdateIsoPermissionsOptions isFeatured(boolean isFeatured) {
public UpdateISOPermissionsOptions isFeatured(boolean isFeatured) {
this.queryParameters.replaceValues("isfeatured", ImmutableSet.of(isFeatured + ""));
return this;
}
@ -61,7 +61,7 @@ public class UpdateIsoPermissionsOptions extends BaseHttpRequestOptions {
/**
* @param isPublic true for public template/iso, false for private templates/isos
*/
public UpdateIsoPermissionsOptions isPublic(boolean isPublic) {
public UpdateISOPermissionsOptions isPublic(boolean isPublic) {
this.queryParameters.replaceValues("ispublic", ImmutableSet.of(isPublic + ""));
return this;
}
@ -69,7 +69,7 @@ public class UpdateIsoPermissionsOptions extends BaseHttpRequestOptions {
/**
* @param operation permission operator (add, remove, reset)
*/
public UpdateIsoPermissionsOptions operation(PermissionOperation operation) {
public UpdateISOPermissionsOptions operation(PermissionOperation operation) {
this.queryParameters.replaceValues("op", ImmutableSet.of(operation + ""));
return this;
}
@ -79,36 +79,36 @@ public class UpdateIsoPermissionsOptions extends BaseHttpRequestOptions {
/**
* @param accounts a comma delimited list of accounts. If specified, "op" parameter has to be passed in.
*/
public static UpdateIsoPermissionsOptions accounts(Iterable<String> accounts) {
return new UpdateIsoPermissionsOptions().accounts(accounts);
public static UpdateISOPermissionsOptions accounts(Iterable<String> accounts) {
return new UpdateISOPermissionsOptions().accounts(accounts);
}
/**
* @param isExtractable true if the template/iso is extractable, false other wise. Can be set only by root admin
*/
public static UpdateIsoPermissionsOptions isExtractable(boolean isExtractable) {
return new UpdateIsoPermissionsOptions().isExtractable(isExtractable);
public static UpdateISOPermissionsOptions isExtractable(boolean isExtractable) {
return new UpdateISOPermissionsOptions().isExtractable(isExtractable);
}
/**
* @param isFeatured true for featured template/iso, false otherwise
*/
public static UpdateIsoPermissionsOptions isFeatured(boolean isFeatured) {
return new UpdateIsoPermissionsOptions().isFeatured(isFeatured);
public static UpdateISOPermissionsOptions isFeatured(boolean isFeatured) {
return new UpdateISOPermissionsOptions().isFeatured(isFeatured);
}
/**
* @param isPublic true for public template/iso, false for private templates/isos
*/
public static UpdateIsoPermissionsOptions isPublic(boolean isPublic) {
return new UpdateIsoPermissionsOptions().isPublic(isPublic);
public static UpdateISOPermissionsOptions isPublic(boolean isPublic) {
return new UpdateISOPermissionsOptions().isPublic(isPublic);
}
/**
* @param operation permission operator (add, remove, reset)
*/
public static UpdateIsoPermissionsOptions operation(PermissionOperation operation) {
return new UpdateIsoPermissionsOptions().operation(operation);
public static UpdateISOPermissionsOptions operation(PermissionOperation operation) {
return new UpdateISOPermissionsOptions().operation(operation);
}
}

View File

@ -21,15 +21,15 @@ package org.jclouds.cloudstack.features;
import com.google.common.collect.ImmutableSet;
import com.google.inject.TypeLiteral;
import org.jclouds.cloudstack.domain.ExtractMode;
import org.jclouds.cloudstack.domain.Iso;
import org.jclouds.cloudstack.domain.ISO;
import org.jclouds.cloudstack.domain.PermissionOperation;
import org.jclouds.cloudstack.options.AccountInDomainOptions;
import org.jclouds.cloudstack.options.DeleteIsoOptions;
import org.jclouds.cloudstack.options.ExtractIsoOptions;
import org.jclouds.cloudstack.options.ListIsosOptions;
import org.jclouds.cloudstack.options.RegisterIsoOptions;
import org.jclouds.cloudstack.options.UpdateIsoOptions;
import org.jclouds.cloudstack.options.UpdateIsoPermissionsOptions;
import org.jclouds.cloudstack.options.DeleteISOOptions;
import org.jclouds.cloudstack.options.ExtractISOOptions;
import org.jclouds.cloudstack.options.ListISOsOptions;
import org.jclouds.cloudstack.options.RegisterISOOptions;
import org.jclouds.cloudstack.options.UpdateISOOptions;
import org.jclouds.cloudstack.options.UpdateISOPermissionsOptions;
import org.jclouds.http.HttpRequest;
import org.jclouds.http.functions.ReleasePayloadAndReturn;
import org.jclouds.http.functions.UnwrapOnlyJsonValue;
@ -39,22 +39,22 @@ import org.testng.annotations.Test;
import java.lang.reflect.Method;
/**
* Tests the behaviour of IsoAsyncClient.
* Tests the behaviour of ISOAsyncClient.
*
* @see IsoAsyncClient
* @see ISOAsyncClient
* @author Richard Downer
*/
// NOTE:without testName, this will not call @Before* and fail w/NPE during
// surefire
@Test(groups = "unit", testName = "IsoAsyncClientTest")
public class IsoAsyncClientTest extends BaseCloudStackAsyncClientTest<IsoAsyncClient> {
@Test(groups = "unit", testName = "ISOAsyncClientTest")
public class ISOAsyncClientTest extends BaseCloudStackAsyncClientTest<ISOAsyncClient> {
public void testAttachIso() throws NoSuchMethodException {
Method method = IsoAsyncClient.class.getMethod("attachIso", long.class, long.class);
public void testAttachISO() throws NoSuchMethodException {
Method method = ISOAsyncClient.class.getMethod("attachISO", long.class, long.class);
HttpRequest httpRequest = processor.createRequest(method, 3, 5);
assertRequestLineEquals(httpRequest,
"GET http://localhost:8080/client/api?response=json&command=attachIso&id=3&virtualmachineid=5 HTTP/1.1");
"GET http://localhost:8080/client/api?response=json&command=attachISO&id=3&virtualmachineid=5 HTTP/1.1");
assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n");
assertPayloadEquals(httpRequest, null, null, false);
@ -65,12 +65,12 @@ public class IsoAsyncClientTest extends BaseCloudStackAsyncClientTest<IsoAsyncCl
checkFilters(httpRequest);
}
public void testDetachIso() throws NoSuchMethodException {
Method method = IsoAsyncClient.class.getMethod("detachIso", long.class);
public void testDetachISO() throws NoSuchMethodException {
Method method = ISOAsyncClient.class.getMethod("detachISO", long.class);
HttpRequest httpRequest = processor.createRequest(method, 3);
assertRequestLineEquals(httpRequest,
"GET http://localhost:8080/client/api?response=json&command=detachIso&virtualmachineid=3 HTTP/1.1");
"GET http://localhost:8080/client/api?response=json&command=detachISO&virtualmachineid=3 HTTP/1.1");
assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n");
assertPayloadEquals(httpRequest, null, null, false);
@ -81,12 +81,12 @@ public class IsoAsyncClientTest extends BaseCloudStackAsyncClientTest<IsoAsyncCl
checkFilters(httpRequest);
}
public void testGetIso() throws NoSuchMethodException {
Method method = IsoAsyncClient.class.getMethod("getIso", long.class);
public void testGetISO() throws NoSuchMethodException {
Method method = ISOAsyncClient.class.getMethod("getISO", long.class);
HttpRequest httpRequest = processor.createRequest(method, 3);
assertRequestLineEquals(httpRequest,
"GET http://localhost:8080/client/api?response=json&command=listIsos&id=3 HTTP/1.1");
"GET http://localhost:8080/client/api?response=json&command=listISOs&id=3 HTTP/1.1");
assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n");
assertPayloadEquals(httpRequest, null, null, false);
@ -97,12 +97,12 @@ public class IsoAsyncClientTest extends BaseCloudStackAsyncClientTest<IsoAsyncCl
checkFilters(httpRequest);
}
public void testListIsos() throws NoSuchMethodException {
Method method = IsoAsyncClient.class.getMethod("listIsos", ListIsosOptions[].class);
public void testListISOs() throws NoSuchMethodException {
Method method = ISOAsyncClient.class.getMethod("listISOs", ListISOsOptions[].class);
HttpRequest httpRequest = processor.createRequest(method);
assertRequestLineEquals(httpRequest,
"GET http://localhost:8080/client/api?response=json&command=listIsos HTTP/1.1");
"GET http://localhost:8080/client/api?response=json&command=listISOs HTTP/1.1");
assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n");
assertPayloadEquals(httpRequest, null, null, false);
@ -113,12 +113,12 @@ public class IsoAsyncClientTest extends BaseCloudStackAsyncClientTest<IsoAsyncCl
checkFilters(httpRequest);
}
public void testListIsosOptions() throws NoSuchMethodException {
Method method = IsoAsyncClient.class.getMethod("listIsos", ListIsosOptions[].class);
HttpRequest httpRequest = processor.createRequest(method, ListIsosOptions.Builder.accountInDomain("fred", 5).bootable(true).hypervisor("xen").id(3).isoFilter(Iso.IsoFilter.featured).isPublic(true).isReady(true).keyword("bob").name("bob's iso").zoneId(7));
public void testListISOsOptions() throws NoSuchMethodException {
Method method = ISOAsyncClient.class.getMethod("listISOs", ListISOsOptions[].class);
HttpRequest httpRequest = processor.createRequest(method, ListISOsOptions.Builder.accountInDomain("fred", 5).bootable(true).hypervisor("xen").id(3).isoFilter(ISO.ISOFilter.featured).isPublic(true).isReady(true).keyword("bob").name("bob's iso").zoneId(7));
assertRequestLineEquals(httpRequest,
"GET http://localhost:8080/client/api?response=json&command=listIsos&account=fred&domainid=5&bootable=true&hypervisor=xen&id=3&isofilter=featured&ispublic=true&isready=true&keyword=bob&name=bob%27s%20iso&zoneid=7 HTTP/1.1");
"GET http://localhost:8080/client/api?response=json&command=listISOs&account=fred&domainid=5&bootable=true&hypervisor=xen&id=3&isofilter=featured&ispublic=true&isready=true&keyword=bob&name=bob%27s%20iso&zoneid=7 HTTP/1.1");
assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n");
assertPayloadEquals(httpRequest, null, null, false);
@ -129,12 +129,12 @@ public class IsoAsyncClientTest extends BaseCloudStackAsyncClientTest<IsoAsyncCl
checkFilters(httpRequest);
}
public void testRegisterIso() throws NoSuchMethodException {
Method method = IsoAsyncClient.class.getMethod("registerIso", String.class, String.class, String.class, long.class, RegisterIsoOptions[].class);
public void testRegisterISO() throws NoSuchMethodException {
Method method = ISOAsyncClient.class.getMethod("registerISO", String.class, String.class, String.class, long.class, RegisterISOOptions[].class);
HttpRequest httpRequest = processor.createRequest(method, "bob's iso", "bob's copy of linux", "http://example.com/", 9);
assertRequestLineEquals(httpRequest,
"GET http://localhost:8080/client/api?response=json&command=registerIso&name=bob%27s%20iso&url=http%3A//example.com/&displaytext=bob%27s%20copy%20of%20linux&zoneid=9 HTTP/1.1");
"GET http://localhost:8080/client/api?response=json&command=registerISO&name=bob%27s%20iso&url=http%3A//example.com/&displaytext=bob%27s%20copy%20of%20linux&zoneid=9 HTTP/1.1");
assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n");
assertPayloadEquals(httpRequest, null, null, false);
@ -145,12 +145,12 @@ public class IsoAsyncClientTest extends BaseCloudStackAsyncClientTest<IsoAsyncCl
checkFilters(httpRequest);
}
public void testRegisterIsoOptions() throws NoSuchMethodException {
Method method = IsoAsyncClient.class.getMethod("registerIso", String.class, String.class, String.class, long.class, RegisterIsoOptions[].class);
HttpRequest httpRequest = processor.createRequest(method, "bob's iso", "bob's copy of linux", "http://example.com/", 9, RegisterIsoOptions.Builder.accountInDomain("fred", 5).bootable(true).isExtractable(true).isFeatured(true).isPublic(true).osTypeId(7));
public void testRegisterISOOptions() throws NoSuchMethodException {
Method method = ISOAsyncClient.class.getMethod("registerISO", String.class, String.class, String.class, long.class, RegisterISOOptions[].class);
HttpRequest httpRequest = processor.createRequest(method, "bob's iso", "bob's copy of linux", "http://example.com/", 9, RegisterISOOptions.Builder.accountInDomain("fred", 5).bootable(true).isExtractable(true).isFeatured(true).isPublic(true).osTypeId(7));
assertRequestLineEquals(httpRequest,
"GET http://localhost:8080/client/api?response=json&command=registerIso&name=bob%27s%20iso&url=http%3A//example.com/&displaytext=bob%27s%20copy%20of%20linux&zoneid=9&account=fred&domainid=5&bootable=true&isextractable=true&isfeatured=true&ispublic=true&ostypeid=7 HTTP/1.1");
"GET http://localhost:8080/client/api?response=json&command=registerISO&name=bob%27s%20iso&url=http%3A//example.com/&displaytext=bob%27s%20copy%20of%20linux&zoneid=9&account=fred&domainid=5&bootable=true&isextractable=true&isfeatured=true&ispublic=true&ostypeid=7 HTTP/1.1");
assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n");
assertPayloadEquals(httpRequest, null, null, false);
@ -161,12 +161,12 @@ public class IsoAsyncClientTest extends BaseCloudStackAsyncClientTest<IsoAsyncCl
checkFilters(httpRequest);
}
public void testUpdateIso() throws NoSuchMethodException {
Method method = IsoAsyncClient.class.getMethod("updateIso", long.class, UpdateIsoOptions[].class);
public void testUpdateISO() throws NoSuchMethodException {
Method method = ISOAsyncClient.class.getMethod("updateISO", long.class, UpdateISOOptions[].class);
HttpRequest httpRequest = processor.createRequest(method, 3);
assertRequestLineEquals(httpRequest,
"GET http://localhost:8080/client/api?response=json&command=updateIso&id=3 HTTP/1.1");
"GET http://localhost:8080/client/api?response=json&command=updateISO&id=3 HTTP/1.1");
assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n");
assertPayloadEquals(httpRequest, null, null, false);
@ -177,12 +177,12 @@ public class IsoAsyncClientTest extends BaseCloudStackAsyncClientTest<IsoAsyncCl
checkFilters(httpRequest);
}
public void testUpdateIsoOptions() throws NoSuchMethodException {
Method method = IsoAsyncClient.class.getMethod("updateIso", long.class, UpdateIsoOptions[].class);
HttpRequest httpRequest = processor.createRequest(method, 3, UpdateIsoOptions.Builder.bootable(true).displayText("robert").format("format").name("bob").osTypeId(9).passwordEnabled(true));
public void testUpdateISOOptions() throws NoSuchMethodException {
Method method = ISOAsyncClient.class.getMethod("updateISO", long.class, UpdateISOOptions[].class);
HttpRequest httpRequest = processor.createRequest(method, 3, UpdateISOOptions.Builder.bootable(true).displayText("robert").format("format").name("bob").osTypeId(9).passwordEnabled(true));
assertRequestLineEquals(httpRequest,
"GET http://localhost:8080/client/api?response=json&command=updateIso&id=3&bootable=true&displaytext=robert&format=format&name=bob&ostypeid=9&passwordenabled=true HTTP/1.1");
"GET http://localhost:8080/client/api?response=json&command=updateISO&id=3&bootable=true&displaytext=robert&format=format&name=bob&ostypeid=9&passwordenabled=true HTTP/1.1");
assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n");
assertPayloadEquals(httpRequest, null, null, false);
@ -193,12 +193,12 @@ public class IsoAsyncClientTest extends BaseCloudStackAsyncClientTest<IsoAsyncCl
checkFilters(httpRequest);
}
public void testDeleteIso() throws NoSuchMethodException {
Method method = IsoAsyncClient.class.getMethod("deleteIso", long.class, DeleteIsoOptions[].class);
public void testDeleteISO() throws NoSuchMethodException {
Method method = ISOAsyncClient.class.getMethod("deleteISO", long.class, DeleteISOOptions[].class);
HttpRequest httpRequest = processor.createRequest(method, 3);
assertRequestLineEquals(httpRequest,
"GET http://localhost:8080/client/api?response=json&command=deleteIso&id=3 HTTP/1.1");
"GET http://localhost:8080/client/api?response=json&command=deleteISO&id=3 HTTP/1.1");
assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n");
assertPayloadEquals(httpRequest, null, null, false);
@ -209,12 +209,12 @@ public class IsoAsyncClientTest extends BaseCloudStackAsyncClientTest<IsoAsyncCl
checkFilters(httpRequest);
}
public void testDeleteIsoOptions() throws NoSuchMethodException {
Method method = IsoAsyncClient.class.getMethod("deleteIso", long.class, DeleteIsoOptions[].class);
HttpRequest httpRequest = processor.createRequest(method, 3, DeleteIsoOptions.Builder.zoneId(5));
public void testDeleteISOOptions() throws NoSuchMethodException {
Method method = ISOAsyncClient.class.getMethod("deleteISO", long.class, DeleteISOOptions[].class);
HttpRequest httpRequest = processor.createRequest(method, 3, DeleteISOOptions.Builder.zoneId(5));
assertRequestLineEquals(httpRequest,
"GET http://localhost:8080/client/api?response=json&command=deleteIso&id=3&zoneid=5 HTTP/1.1");
"GET http://localhost:8080/client/api?response=json&command=deleteISO&id=3&zoneid=5 HTTP/1.1");
assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n");
assertPayloadEquals(httpRequest, null, null, false);
@ -225,12 +225,12 @@ public class IsoAsyncClientTest extends BaseCloudStackAsyncClientTest<IsoAsyncCl
checkFilters(httpRequest);
}
public void testCopyIso() throws NoSuchMethodException {
Method method = IsoAsyncClient.class.getMethod("copyIso", long.class, long.class, long.class);
public void testCopyISO() throws NoSuchMethodException {
Method method = ISOAsyncClient.class.getMethod("copyISO", long.class, long.class, long.class);
HttpRequest httpRequest = processor.createRequest(method, 3, 5, 7);
assertRequestLineEquals(httpRequest,
"GET http://localhost:8080/client/api?response=json&command=copyIso&id=3&destzoneid=7&sourcezoneid=5 HTTP/1.1");
"GET http://localhost:8080/client/api?response=json&command=copyISO&id=3&destzoneid=7&sourcezoneid=5 HTTP/1.1");
assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n");
assertPayloadEquals(httpRequest, null, null, false);
@ -241,12 +241,12 @@ public class IsoAsyncClientTest extends BaseCloudStackAsyncClientTest<IsoAsyncCl
checkFilters(httpRequest);
}
public void testUpdateIsoPermissions() throws NoSuchMethodException {
Method method = IsoAsyncClient.class.getMethod("updateIsoPermissions", long.class, UpdateIsoPermissionsOptions[].class);
public void testUpdateISOPermissions() throws NoSuchMethodException {
Method method = ISOAsyncClient.class.getMethod("updateISOPermissions", long.class, UpdateISOPermissionsOptions[].class);
HttpRequest httpRequest = processor.createRequest(method, 3);
assertRequestLineEquals(httpRequest,
"GET http://localhost:8080/client/api?response=json&command=updateIsoPermissions&id=3 HTTP/1.1");
"GET http://localhost:8080/client/api?response=json&command=updateISOPermissions&id=3 HTTP/1.1");
assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n");
assertPayloadEquals(httpRequest, null, null, false);
@ -257,12 +257,12 @@ public class IsoAsyncClientTest extends BaseCloudStackAsyncClientTest<IsoAsyncCl
checkFilters(httpRequest);
}
public void testUpdateIsoPermissionsOptions() throws NoSuchMethodException {
Method method = IsoAsyncClient.class.getMethod("updateIsoPermissions", long.class, UpdateIsoPermissionsOptions[].class);
HttpRequest httpRequest = processor.createRequest(method, 3, UpdateIsoPermissionsOptions.Builder.accounts(ImmutableSet.<String>of("fred", "bob")).isExtractable(true).isFeatured(true).isPublic(true).operation(PermissionOperation.add));
public void testUpdateISOPermissionsOptions() throws NoSuchMethodException {
Method method = ISOAsyncClient.class.getMethod("updateISOPermissions", long.class, UpdateISOPermissionsOptions[].class);
HttpRequest httpRequest = processor.createRequest(method, 3, UpdateISOPermissionsOptions.Builder.accounts(ImmutableSet.<String>of("fred", "bob")).isExtractable(true).isFeatured(true).isPublic(true).operation(PermissionOperation.add));
assertRequestLineEquals(httpRequest,
"GET http://localhost:8080/client/api?response=json&command=updateIsoPermissions&id=3&accounts=fred,bob&isextractable=true&isfeatured=true&ispublic=true&op=add HTTP/1.1");
"GET http://localhost:8080/client/api?response=json&command=updateISOPermissions&id=3&accounts=fred,bob&isextractable=true&isfeatured=true&ispublic=true&op=add HTTP/1.1");
assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n");
assertPayloadEquals(httpRequest, null, null, false);
@ -273,12 +273,12 @@ public class IsoAsyncClientTest extends BaseCloudStackAsyncClientTest<IsoAsyncCl
checkFilters(httpRequest);
}
public void testListIsoPermissions() throws NoSuchMethodException {
Method method = IsoAsyncClient.class.getMethod("listIsoPermissions", long.class, AccountInDomainOptions[].class);
public void testListISOPermissions() throws NoSuchMethodException {
Method method = ISOAsyncClient.class.getMethod("listISOPermissions", long.class, AccountInDomainOptions[].class);
HttpRequest httpRequest = processor.createRequest(method, 3);
assertRequestLineEquals(httpRequest,
"GET http://localhost:8080/client/api?response=json&command=listIsoPermissions&id=3 HTTP/1.1");
"GET http://localhost:8080/client/api?response=json&command=listISOPermissions&id=3 HTTP/1.1");
assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n");
assertPayloadEquals(httpRequest, null, null, false);
@ -289,12 +289,12 @@ public class IsoAsyncClientTest extends BaseCloudStackAsyncClientTest<IsoAsyncCl
checkFilters(httpRequest);
}
public void testListIsoPermissionsOptions() throws NoSuchMethodException {
Method method = IsoAsyncClient.class.getMethod("listIsoPermissions", long.class, AccountInDomainOptions[].class);
public void testListISOPermissionsOptions() throws NoSuchMethodException {
Method method = ISOAsyncClient.class.getMethod("listISOPermissions", long.class, AccountInDomainOptions[].class);
HttpRequest httpRequest = processor.createRequest(method, 3, AccountInDomainOptions.Builder.accountInDomain("fred", 5));
assertRequestLineEquals(httpRequest,
"GET http://localhost:8080/client/api?response=json&command=listIsoPermissions&id=3&account=fred&domainid=5 HTTP/1.1");
"GET http://localhost:8080/client/api?response=json&command=listISOPermissions&id=3&account=fred&domainid=5 HTTP/1.1");
assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n");
assertPayloadEquals(httpRequest, null, null, false);
@ -305,12 +305,12 @@ public class IsoAsyncClientTest extends BaseCloudStackAsyncClientTest<IsoAsyncCl
checkFilters(httpRequest);
}
public void testExtractIso() throws NoSuchMethodException {
Method method = IsoAsyncClient.class.getMethod("extractIso", long.class, ExtractMode.class, long.class, ExtractIsoOptions[].class);
public void testExtractISO() throws NoSuchMethodException {
Method method = ISOAsyncClient.class.getMethod("extractISO", long.class, ExtractMode.class, long.class, ExtractISOOptions[].class);
HttpRequest httpRequest = processor.createRequest(method, 3, ExtractMode.HTTP_DOWNLOAD, 5);
assertRequestLineEquals(httpRequest,
"GET http://localhost:8080/client/api?response=json&command=extractIso&id=3&zoneid=5&mode=HTTP_DOWNLOAD HTTP/1.1");
"GET http://localhost:8080/client/api?response=json&command=extractISO&id=3&zoneid=5&mode=HTTP_DOWNLOAD HTTP/1.1");
assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n");
assertPayloadEquals(httpRequest, null, null, false);
@ -321,12 +321,12 @@ public class IsoAsyncClientTest extends BaseCloudStackAsyncClientTest<IsoAsyncCl
checkFilters(httpRequest);
}
public void testExtractIsoOptions() throws NoSuchMethodException {
Method method = IsoAsyncClient.class.getMethod("extractIso", long.class, ExtractMode.class, long.class, ExtractIsoOptions[].class);
HttpRequest httpRequest = processor.createRequest(method, 3, ExtractMode.HTTP_DOWNLOAD, 5, ExtractIsoOptions.Builder.url("http://example.com/"));
public void testExtractISOOptions() throws NoSuchMethodException {
Method method = ISOAsyncClient.class.getMethod("extractISO", long.class, ExtractMode.class, long.class, ExtractISOOptions[].class);
HttpRequest httpRequest = processor.createRequest(method, 3, ExtractMode.HTTP_DOWNLOAD, 5, ExtractISOOptions.Builder.url("http://example.com/"));
assertRequestLineEquals(httpRequest,
"GET http://localhost:8080/client/api?response=json&command=extractIso&id=3&zoneid=5&mode=HTTP_DOWNLOAD&url=http%3A//example.com/ HTTP/1.1");
"GET http://localhost:8080/client/api?response=json&command=extractISO&id=3&zoneid=5&mode=HTTP_DOWNLOAD&url=http%3A//example.com/ HTTP/1.1");
assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n");
assertPayloadEquals(httpRequest, null, null, false);
@ -338,8 +338,8 @@ public class IsoAsyncClientTest extends BaseCloudStackAsyncClientTest<IsoAsyncCl
}
@Override
protected TypeLiteral<RestAnnotationProcessor<IsoAsyncClient>> createTypeLiteral() {
return new TypeLiteral<RestAnnotationProcessor<IsoAsyncClient>>() {
protected TypeLiteral<RestAnnotationProcessor<ISOAsyncClient>> createTypeLiteral() {
return new TypeLiteral<RestAnnotationProcessor<ISOAsyncClient>>() {
};
}