Skip to content
This repository was archived by the owner on Jul 25, 2020. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import org.jclouds.cloudsigma2.binders.BindUuidStringsToJsonArray;
import org.jclouds.cloudsigma2.binders.BindVLANToJsonRequest;
import org.jclouds.cloudsigma2.domain.AccountBalance;
import org.jclouds.cloudsigma2.domain.CalcSubscription;
import org.jclouds.cloudsigma2.domain.CreateSubscriptionRequest;
import org.jclouds.cloudsigma2.domain.CurrentUsage;
import org.jclouds.cloudsigma2.domain.Discount;
Expand All @@ -53,6 +54,7 @@
import org.jclouds.cloudsigma2.domain.ServerAvailabilityGroup;
import org.jclouds.cloudsigma2.domain.ServerInfo;
import org.jclouds.cloudsigma2.domain.Subscription;
import org.jclouds.cloudsigma2.domain.SubscriptionCalculator;
import org.jclouds.cloudsigma2.domain.Tag;
import org.jclouds.cloudsigma2.domain.Transaction;
import org.jclouds.cloudsigma2.domain.VLANInfo;
Expand Down Expand Up @@ -82,6 +84,7 @@
import org.jclouds.rest.annotations.SelectJson;
import org.jclouds.rest.annotations.SkipEncoding;
import org.jclouds.rest.annotations.Transform;
import org.jclouds.rest.binders.BindToJsonPayload;

import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
Expand Down Expand Up @@ -140,8 +143,8 @@ public interface CloudSigma2Api extends Closeable {
@GET
@Path("/drives/")
@SelectJson("objects")
List<DriveInfo> listDrives(@QueryParam("fields") DrivesListRequestFieldsGroup fields
, @DefaultValue("0") @QueryParam("limit") int limit);
List<DriveInfo> listDrives(@QueryParam("fields") DrivesListRequestFieldsGroup fields,
@DefaultValue("0") @QueryParam("limit") int limit);

/**
* Gets the detailed list of drives with additional information to which the authenticated user has access.
Expand Down Expand Up @@ -238,8 +241,7 @@ List<DriveInfo> listDrives(@QueryParam("fields") DrivesListRequestFieldsGroup fi
@PUT
@Path("/drives/{uuid}/")
@Fallback(Fallbacks.VoidOnNotFoundOr404.class)
DriveInfo editDrive(@PathParam("uuid") String sourceUuid
, @BinderParam(BindDriveToJson.class) DriveInfo driveInfo);
DriveInfo editDrive(@PathParam("uuid") String sourceUuid, @BinderParam(BindDriveToJson.class) DriveInfo driveInfo);


/**
Expand All @@ -253,8 +255,8 @@ DriveInfo editDrive(@PathParam("uuid") String sourceUuid
@POST
@Path("/drives/{uuid}/action/?do=clone")
@Fallback(Fallbacks.VoidOnNotFoundOr404.class)
DriveInfo cloneDrive(@PathParam("uuid") String sourceUuid
, @Nullable @BinderParam(BindDriveToJson.class) DriveInfo driveInfo);
DriveInfo cloneDrive(@PathParam("uuid") String sourceUuid,
@Nullable @BinderParam(BindDriveToJson.class) DriveInfo driveInfo);

/**
* Gets the list of library drives to which the authenticated user has access.
Expand Down Expand Up @@ -481,8 +483,8 @@ ServerInfo editServer(@PathParam("uuid") String uuid
@POST
@Path("/servers/{uuid}/action/?do=start")
@Fallback(Fallbacks.NullOnNotFoundOr404.class)
void startServerInSeparateAvailabilityGroup(@PathParam("uuid") String uuid
, @QueryParam("avoid") List<String> uuidGroup);
void startServerInSeparateAvailabilityGroup(@PathParam("uuid") String uuid,
@QueryParam("avoid") List<String> uuidGroup);

/**
* Opens a VNC tunnel to a server with specific UUID.
Expand Down Expand Up @@ -753,8 +755,8 @@ VLANInfo editVLAN(@PathParam("uuid") String uuid
@PUT
@Path("/ips/{uuid}/")
@Fallback(Fallbacks.NullOnNotFoundOr404.class)
IPInfo editIP(@PathParam("uuid") String uuid
, @BinderParam(BindIPInfoToJsonRequest.class) IPInfo ipInfo);
IPInfo editIP(@PathParam("uuid") String uuid,
@BinderParam(BindIPInfoToJsonRequest.class) IPInfo ipInfo);

/**
* Gets the list of tags to which the authenticated user has access.
Expand Down Expand Up @@ -944,25 +946,13 @@ IPInfo editIP(@PathParam("uuid") String uuid
/**
* This is identical to the listSubscriptions(), except that subscriptions are not actually bought.
*
* @return list of subscriptions that are not actually bought.
* @return SubscriptionCalculator with subscriptions that are not actually bought.
*/
@Named("subscription:listSubscriptionsCalculator")
@GET
@Path("/subscriptioncalculator/")
@ResponseParser(ParseSubscriptions.class)
@Transform(ParseSubscriptions.ToPagedIterableCalculator.class)
PagedIterable<Subscription> listSubscriptionsCalculator();

/**
* This is identical to the listSubscriptions(), except that subscriptions are not actually bought.
*
* @return PaginatedCollection of subscriptions that are not actually bought.
*/
@Named("subscription:listSubscriptionsCalculator")
@GET
@Named("subscription:calculateSubscriptions")
@POST
@Path("/subscriptioncalculator/")
@ResponseParser(ParseSubscriptions.class)
PaginatedCollection<Subscription> listSubscriptionsCalculator(PaginationOptions options);
SubscriptionCalculator calculateSubscriptions(@BinderParam(BindToJsonPayload.class)
Iterable<CalcSubscription> subscriptions);

/**
* Creates a new subscription.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ public BindCreateSubscriptionRequest(CreateSubscriptionRequestToJson subscriptio

@Override
public <R extends HttpRequest> R bindToRequest(R request, Object input) {
checkArgument(input instanceof CreateSubscriptionRequest
, "this binder is only valid for CreateSubscriptionRequest!");
checkArgument(input instanceof CreateSubscriptionRequest,
"this binder is only valid for CreateSubscriptionRequest!");
CreateSubscriptionRequest create = CreateSubscriptionRequest.class.cast(input);
JsonObject subscriptionObject = subscriptionRequestJsonObjectFunction.apply(create);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ public <R extends HttpRequest> R bindToRequest(R request, Object input) {
checkArgument(input instanceof List, "this binder is only valid for List<CreateSubscriptionRequest>!");
List list = List.class.cast(input);
for (Object o : list) {
checkArgument(o instanceof CreateSubscriptionRequest
, "this binder is only valid for List<CreateSubscriptionRequest>!");
checkArgument(o instanceof CreateSubscriptionRequest,
"this binder is only valid for List<CreateSubscriptionRequest>!");
}
List<CreateSubscriptionRequest> createSubscriptionRequests = (List<CreateSubscriptionRequest>) input;
JsonArray subscriptionsJsonArray = new JsonArray();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ public Builder sms(Usage sms) {
}

public AccountUsage build() {
return new AccountUsage(cpu, dssd, ip, mem, windowsWebServer2008, windowsServer2008Standard
, sqlServerStandard2008, sms, ssd, tx, vlan);
return new AccountUsage(cpu, dssd, ip, mem, windowsWebServer2008, windowsServer2008Standard,
sqlServerStandard2008, sms, ssd, tx, vlan);
}
}

Expand All @@ -117,8 +117,9 @@ public AccountUsage build() {
@ConstructorProperties({
"cpu", "dssd", "ip", "mem", "msft_lwa_00135", "msft_p37_04837", "msft_tfa_00009", "sms", "ssd", "tx", "vlan"
})
public AccountUsage(Usage cpu, Usage dssd, Usage ip, Usage mem, Usage windowsWebServer2008
, Usage windowsServer2008Standard, Usage sqlServerStandard2008, Usage sms, Usage ssd, Usage tx, Usage vlan) {
public AccountUsage(Usage cpu, Usage dssd, Usage ip, Usage mem, Usage windowsWebServer2008,
Usage windowsServer2008Standard, Usage sqlServerStandard2008, Usage sms, Usage ssd, Usage tx,
Usage vlan) {
this.cpu = cpu;
this.dssd = dssd;
this.ip = ip;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ public Builder sms(int sms) {
}

public BurstLevel build() {
return new BurstLevel(cpu, dssd, ip, mem, windowsWebServer2008, windowsServer2008Standard, sqlServerStandard2008, sms, ssd, tx, vlan);
return new BurstLevel(cpu, dssd, ip, mem, windowsWebServer2008, windowsServer2008Standard,
sqlServerStandard2008, sms, ssd, tx, vlan);
}
}

Expand All @@ -116,8 +117,8 @@ public BurstLevel build() {
@ConstructorProperties({
"cpu", "dssd", "ip", "mem", "msft_lwa_00135", "msft_p37_04837", "msft_tfa_00009", "sms", "ssd", "tx", "vlan"
})
public BurstLevel(int cpu, int dssd, int ip, int mem, int windowsWebServer2008
, int windowsServer2008Standard, int sqlServerStandard2008, int sms, int ssd, int tx, int vlan) {
public BurstLevel(int cpu, int dssd, int ip, int mem, int windowsWebServer2008, int windowsServer2008Standard,
int sqlServerStandard2008, int sms, int ssd, int tx, int vlan) {
this.cpu = cpu;
this.dssd = dssd;
this.ip = ip;
Expand Down
Loading