http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/93aff921/profitbricks/src/main/java/org/jclouds/profitbricks/domain/Drive.java ---------------------------------------------------------------------- diff --git a/profitbricks/src/main/java/org/jclouds/profitbricks/domain/Drive.java b/profitbricks/src/main/java/org/jclouds/profitbricks/domain/Drive.java deleted file mode 100644 index c2efe09..0000000 --- a/profitbricks/src/main/java/org/jclouds/profitbricks/domain/Drive.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jclouds.profitbricks.domain; - -import com.google.auto.value.AutoValue; - -import org.jclouds.javax.annotation.Nullable; - -@AutoValue -public abstract class Drive { - - public abstract static class Request { - - @AutoValue - public abstract static class AddRomDriveToServerPayload { - - public abstract String serverId(); - - public abstract String imageId(); - - @Nullable - public abstract String deviceNumber(); - - public static Builder builder() { - return new AutoValue_Drive_Request_AddRomDriveToServerPayload.Builder(); - } - - @AutoValue.Builder - public abstract static class Builder { - - public abstract Builder serverId(String serverId); - - public abstract Builder imageId(String imageId); - - public abstract Builder deviceNumber(String deviceNumber); - - public abstract AddRomDriveToServerPayload build(); - } - } - } -}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/93aff921/profitbricks/src/main/java/org/jclouds/profitbricks/domain/Firewall.java ---------------------------------------------------------------------- diff --git a/profitbricks/src/main/java/org/jclouds/profitbricks/domain/Firewall.java b/profitbricks/src/main/java/org/jclouds/profitbricks/domain/Firewall.java deleted file mode 100644 index 78b30c1..0000000 --- a/profitbricks/src/main/java/org/jclouds/profitbricks/domain/Firewall.java +++ /dev/null @@ -1,188 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jclouds.profitbricks.domain; - -import static org.jclouds.profitbricks.util.Preconditions.checkIcmp; -import static org.jclouds.profitbricks.util.Preconditions.checkIp; -import static org.jclouds.profitbricks.util.Preconditions.checkMacAddress; -import static org.jclouds.profitbricks.util.Preconditions.checkPortRange; - -import java.util.List; - -import org.jclouds.javax.annotation.Nullable; - -import com.google.auto.value.AutoValue; -import com.google.common.base.Enums; -import com.google.common.collect.ImmutableList; - -@AutoValue -public abstract class Firewall { - - public enum Protocol { - - TCP, UDP, ICMP, ANY, UNRECOGNIZED; - - public static Protocol fromValue(String value) { - return Enums.getIfPresent(Protocol.class, value).or(UNRECOGNIZED); - } - } - - @Nullable - public abstract String id(); - - @Nullable - public abstract String nicId(); - - @Nullable - public abstract Boolean active(); - - @Nullable - public abstract ProvisioningState state(); - - @Nullable - public abstract List<Rule> rules(); - - public static Builder builder() { - return new AutoValue_Firewall.Builder() - .rules(ImmutableList.<Rule>of()); - } - - public abstract Builder toBuilder(); - - @AutoValue.Builder - public abstract static class Builder { - - public abstract Builder id(String id); - - public abstract Builder nicId(String nicId); - - public abstract Builder active(Boolean active); - - public abstract Builder state(ProvisioningState state); - - public abstract Builder rules(List<Rule> rules); - - abstract Firewall autoBuild(); - - public Firewall build(){ - Firewall built = autoBuild(); - - return built.toBuilder() - .rules(ImmutableList.copyOf(built.rules())) - .autoBuild(); - } - } - - public static final class Request { - - public static AddRulePayload createAddRulePayload(String nicId, List<Rule> rules) { - return new AutoValue_Firewall_Request_AddRulePayload(nicId, ImmutableList.copyOf(rules)); - } - - @AutoValue - public abstract static class AddRulePayload { - - public abstract String nicId(); - - public abstract List<Rule> rules(); - - } - } - - @AutoValue - public abstract static class Rule { - - @Nullable - public abstract String id(); - - @Nullable - public abstract String name(); - - @Nullable - public abstract Integer portRangeEnd(); - - @Nullable - public abstract Integer portRangeStart(); - - @Nullable - public abstract Protocol protocol(); - - @Nullable - public abstract String sourceIp(); - - @Nullable - public abstract String sourceMac(); - - @Nullable - public abstract String targetIp(); - - @Nullable - public abstract Integer icmpCode(); - - @Nullable - public abstract Integer icmpType(); - - public static Builder builder() { - return new AutoValue_Firewall_Rule.Builder() - .protocol(Protocol.ANY); - } - - public Builder toBuilder() { - return new AutoValue_Firewall_Rule.Builder(this); - } - - @AutoValue.Builder - public abstract static class Builder { - - public abstract Builder id(String id); - - public abstract Builder name(String name); - - public abstract Builder portRangeEnd(Integer portRangeEnd); - - public abstract Builder portRangeStart(Integer portRangeStart); - - public abstract Builder protocol(Protocol protocol); - - public abstract Builder sourceIp(String sourceIp); - - public abstract Builder sourceMac(String sourceMac); - - public abstract Builder targetIp(String targetIp); - - public abstract Builder icmpCode(Integer icmpCode); - - public abstract Builder icmpType(Integer icmpType); - - abstract Rule autoBuild(); - - public Rule build() { - Rule rule = autoBuild(); - if (rule.sourceIp() != null) - checkIp(rule.sourceIp()); - if (rule.targetIp() != null) - checkIp(rule.targetIp()); - if (rule.sourceMac() != null) - checkMacAddress(rule.sourceMac()); - checkPortRange(rule.portRangeStart(), rule.portRangeEnd(), rule.protocol()); - checkIcmp(rule.icmpType(), rule.icmpCode(), rule.protocol()); - - return rule; - } - } - } -} http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/93aff921/profitbricks/src/main/java/org/jclouds/profitbricks/domain/Image.java ---------------------------------------------------------------------- diff --git a/profitbricks/src/main/java/org/jclouds/profitbricks/domain/Image.java b/profitbricks/src/main/java/org/jclouds/profitbricks/domain/Image.java deleted file mode 100644 index 383a744..0000000 --- a/profitbricks/src/main/java/org/jclouds/profitbricks/domain/Image.java +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jclouds.profitbricks.domain; - -import com.google.auto.value.AutoValue; -import com.google.common.base.Enums; - -import org.jclouds.javax.annotation.Nullable; - -@AutoValue -public abstract class Image implements Provisionable { - - public enum Type { - - HDD, CDROM, UNRECOGNIZED; - - public static Type fromValue(String v) { - return Enums.getIfPresent(Type.class, v).or(UNRECOGNIZED); - } - } - - public abstract String id(); - - public abstract String name(); - - public abstract float size(); // MB - - public abstract Location location(); - - public abstract OsType osType(); - - public abstract Type type(); - - @Nullable - public abstract Boolean isPublic(); - - @Nullable - public abstract Boolean isWriteable(); - - @Nullable - public abstract Boolean isBootable(); - - @Nullable - public abstract Boolean isCpuHotPlug(); - - @Nullable - public abstract Boolean isCpuHotUnPlug(); - - @Nullable - public abstract Boolean isRamHotPlug(); - - @Nullable - public abstract Boolean isRamHotUnPlug(); - - @Nullable - public abstract Boolean isNicHotPlug(); - - @Nullable - public abstract Boolean isNicHotUnPlug(); - - @Nullable - public abstract Boolean isDiscVirtioHotPlug(); - - @Nullable - public abstract Boolean isDiscVirtioHotUnPlug(); - - public static Builder builder() { - return new AutoValue_Image.Builder(); - } - - public abstract Builder toBuilder(); - - @AutoValue.Builder - public abstract static class Builder { - - public abstract Builder id(String id); - - public abstract Builder name(String name); - - public abstract Builder size(float size); - - public abstract Builder location(Location location); - - public abstract Builder osType(OsType osType); - - public abstract Builder type(Type type); - - public abstract Builder isPublic(Boolean isPublic); - - public abstract Builder isWriteable(Boolean isWriteable); - - public abstract Builder isBootable(Boolean isBootable); - - public abstract Builder isCpuHotPlug(Boolean isCpuHotPlug); - - public abstract Builder isCpuHotUnPlug(Boolean isCpuHotUnPlug); - - public abstract Builder isRamHotPlug(Boolean isRamHotPlug); - - public abstract Builder isRamHotUnPlug(Boolean isRamHotUnPlug); - - public abstract Builder isNicHotPlug(Boolean isNicHotPlug); - - public abstract Builder isNicHotUnPlug(Boolean isNicHotUnPlug); - - public abstract Builder isDiscVirtioHotPlug(Boolean isDiscVirtioHotPlug); - - public abstract Builder isDiscVirtioHotUnPlug(Boolean isDiscVirtioHotUnPlug); - - public abstract Image build(); - - } - -} http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/93aff921/profitbricks/src/main/java/org/jclouds/profitbricks/domain/IpBlock.java ---------------------------------------------------------------------- diff --git a/profitbricks/src/main/java/org/jclouds/profitbricks/domain/IpBlock.java b/profitbricks/src/main/java/org/jclouds/profitbricks/domain/IpBlock.java deleted file mode 100644 index cc2c999..0000000 --- a/profitbricks/src/main/java/org/jclouds/profitbricks/domain/IpBlock.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jclouds.profitbricks.domain; - -import static org.jclouds.profitbricks.util.Preconditions.checkIp; -import static org.jclouds.profitbricks.util.Preconditions.checkIps; - -import com.google.auto.value.AutoValue; -import com.google.common.collect.ImmutableList; - -import java.util.List; - -import org.jclouds.javax.annotation.Nullable; - -@AutoValue -public abstract class IpBlock { - - public abstract String id(); - - public abstract Location location(); - - public abstract List<PublicIp> publicIps(); - - @Nullable - public abstract List<String> ips(); - - public static Builder builder() { - return new AutoValue_IpBlock.Builder() - .publicIps(ImmutableList.<PublicIp>of()) - .ips(ImmutableList.<String>of()); - } - - public abstract Builder toBuilder(); - - @AutoValue.Builder - public abstract static class Builder { - - public abstract Builder id(String id); - - public abstract Builder location(Location location); - - public abstract Builder publicIps(List<PublicIp> publicIps); - - public abstract Builder ips(List<String> ips); - - abstract IpBlock autoBuild(); - - public IpBlock build() { - IpBlock ipBlock = autoBuild(); - checkIps(ipBlock.ips()); - - return ipBlock.toBuilder() - .publicIps(ImmutableList.copyOf(ipBlock.publicIps())) - .ips(ImmutableList.copyOf(ipBlock.ips())) - .autoBuild(); - } - } - - @AutoValue - public abstract static class PublicIp { - - public abstract String ip(); - - @Nullable - public abstract String nicId(); - - public static Builder builder() { - return new AutoValue_IpBlock_PublicIp.Builder(); - } - - @AutoValue.Builder - public abstract static class Builder { - - public abstract Builder ip(String ip); - - public abstract Builder nicId(String nicId); - - abstract PublicIp autoBuild(); - - public PublicIp build() { - PublicIp publicIp = autoBuild(); - checkIp(publicIp.ip()); - - return publicIp; - } - } - - } -} http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/93aff921/profitbricks/src/main/java/org/jclouds/profitbricks/domain/LoadBalancer.java ---------------------------------------------------------------------- diff --git a/profitbricks/src/main/java/org/jclouds/profitbricks/domain/LoadBalancer.java b/profitbricks/src/main/java/org/jclouds/profitbricks/domain/LoadBalancer.java deleted file mode 100644 index 863890b..0000000 --- a/profitbricks/src/main/java/org/jclouds/profitbricks/domain/LoadBalancer.java +++ /dev/null @@ -1,257 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jclouds.profitbricks.domain; - -import static org.jclouds.profitbricks.util.Preconditions.checkIp; -import static org.jclouds.profitbricks.util.Preconditions.checkLanId; - -import java.util.Date; -import java.util.List; - -import com.google.auto.value.AutoValue; -import com.google.common.base.Enums; -import com.google.common.collect.ImmutableList; - -import org.jclouds.javax.annotation.Nullable; - -@AutoValue -public abstract class LoadBalancer { - - public enum Algorithm { - - ROUND_ROBIN, UNRECOGNIZED; - - public static Algorithm - fromValue(String value) { - return Enums.getIfPresent(Algorithm.class, value).or(UNRECOGNIZED); - } - } - - @Nullable - public abstract String id(); - - @Nullable - public abstract String name(); - - @Nullable - public abstract Algorithm algorithm(); - - @Nullable - public abstract DataCenter dataCenter(); - - @Nullable - public abstract Boolean internetAccess(); - - @Nullable - public abstract String ip(); - - @Nullable - public abstract Integer lanId(); - - @Nullable - public abstract ProvisioningState state(); - - @Nullable - public abstract Date creationTime(); - - @Nullable - public abstract Date lastModificationTime(); - - @Nullable - public abstract List<Server> balancedServers(); - - @Nullable - public abstract List<Firewall> firewalls(); - - public static Builder builder() { - return new AutoValue_LoadBalancer.Builder() - .balancedServers(ImmutableList.<Server>of()) - .firewalls(ImmutableList.<Firewall>of()); - } - - public abstract Builder toBuilder(); - - @AutoValue.Builder - public abstract static class Builder { - - public abstract Builder id(String id); - - public abstract Builder name(String name); - - public abstract Builder algorithm(Algorithm algorithm); - - public abstract Builder dataCenter(DataCenter dataCenter); - - public abstract Builder internetAccess(Boolean internetAccess); - - public abstract Builder ip(String ip); - - public abstract Builder lanId(Integer lanId); - - public abstract Builder creationTime(Date creationTime); - - public abstract Builder state(ProvisioningState state); - - public abstract Builder lastModificationTime(Date lastModificationTime); - - public abstract Builder balancedServers(List<Server> balancedServers); - - public abstract Builder firewalls(List<Firewall> firewalls); - - abstract LoadBalancer autoBuild(); - - public LoadBalancer build() { - LoadBalancer loadBalancer = autoBuild(); - if (loadBalancer.ip() != null) - checkIp(loadBalancer.ip()); - if (loadBalancer.lanId() != null) - checkLanId(loadBalancer.lanId()); - - return loadBalancer.toBuilder() - .balancedServers(ImmutableList.copyOf(loadBalancer.balancedServers())) - .firewalls(ImmutableList.copyOf(loadBalancer.firewalls())) - .autoBuild(); - } - } - - public static final class Request { - - public static CreatePayload.Builder creatingBuilder() { - return new AutoValue_LoadBalancer_Request_CreatePayload.Builder() - .serverIds(ImmutableList.<String>of()) - .algorithm(Algorithm.ROUND_ROBIN); - } - - public static UpdatePayload.Builder updatingBuilder() { - return new AutoValue_LoadBalancer_Request_UpdatePayload.Builder() - .algorithm(Algorithm.ROUND_ROBIN); - } - - public static RegisterPayload createRegisteringPaylod(String loadBalancerId, List<String> serverIds) { - return new AutoValue_LoadBalancer_Request_RegisterPayload(loadBalancerId, ImmutableList.copyOf(serverIds)); - } - - public static DeregisterPayload createDeregisteringPayload(String loadBalancerId, List<String> serverIds) { - return new AutoValue_LoadBalancer_Request_DeregisterPayload(loadBalancerId, ImmutableList.copyOf(serverIds)); - } - - @AutoValue - public abstract static class CreatePayload { - - public abstract String dataCenterId(); - - @Nullable - public abstract String name(); - - public abstract Algorithm algorithm(); - - @Nullable - public abstract String ip(); - - @Nullable - public abstract Integer lanId(); - - public abstract List<String> serverIds(); - - public abstract Builder toBuilder(); - - @AutoValue.Builder - public abstract static class Builder { - - public abstract Builder dataCenterId(String dataCenterId); - - public abstract Builder name(String name); - - public abstract Builder algorithm(Algorithm algorithm); - - public abstract Builder ip(String ip); - - public abstract Builder lanId(Integer lanId); - - public abstract Builder serverIds(List<String> serverIds); - - abstract CreatePayload autoBuild(); - - public CreatePayload build() { - CreatePayload payload = autoBuild(); - if (payload.ip() != null) - checkIp(payload.ip()); - if (payload.lanId() != null) - checkLanId(payload.lanId()); - - return payload.toBuilder() - .serverIds(ImmutableList.copyOf(payload.serverIds())) - .autoBuild(); - } - } - } - - @AutoValue - public abstract static class RegisterPayload { - - public abstract String id(); - - public abstract List<String> serverIds(); - - } - - @AutoValue - public abstract static class DeregisterPayload { - - public abstract String id(); - - public abstract List<String> serverIds(); - - } - - @AutoValue - public abstract static class UpdatePayload { - - public abstract String id(); - - @Nullable - public abstract String name(); - - public abstract Algorithm algorithm(); - - @Nullable - public abstract String ip(); - - @AutoValue.Builder - public abstract static class Builder { - - public abstract Builder id(String id); - - public abstract Builder name(String name); - - public abstract Builder algorithm(Algorithm algorithm); - - public abstract Builder ip(String ip); - - abstract UpdatePayload autoBuild(); - - public UpdatePayload build() { - UpdatePayload payload = autoBuild(); - if (payload.ip() != null) - checkIp(payload.ip()); - - return payload; - } - } - } - } -} http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/93aff921/profitbricks/src/main/java/org/jclouds/profitbricks/domain/Location.java ---------------------------------------------------------------------- diff --git a/profitbricks/src/main/java/org/jclouds/profitbricks/domain/Location.java b/profitbricks/src/main/java/org/jclouds/profitbricks/domain/Location.java deleted file mode 100644 index 834fa86..0000000 --- a/profitbricks/src/main/java/org/jclouds/profitbricks/domain/Location.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jclouds.profitbricks.domain; - -import com.google.common.base.Enums; - -public enum Location { - - DE_FKB("de/fkb", "Germany, Karlsruhe"), - DE_FRA("de/fra", "Germany, Frankfurt (M)"), - US_LAS("us/las", "USA, Las Vegas"), - US_LASDEV("us/lasdev", "USA Developer cluster"), - UNRECOGNIZED("unrecognized", "Unrecognized location"); - - private final String id; - private final String description; - - Location(String id, String description) { - this.id = id; - this.description = description; - } - - public String getId() { - return id; - } - - public String getDescription() { - return description; - } - - public static Location fromValue(String v) { - return Enums.getIfPresent(Location.class, v).or(UNRECOGNIZED); - } - - public static Location fromId(String id) { - for (Location location : values()) - if (location.id.equals(id)) - return location; - return UNRECOGNIZED; - } - - @Override - public String toString() { - return id; - } -} http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/93aff921/profitbricks/src/main/java/org/jclouds/profitbricks/domain/Nic.java ---------------------------------------------------------------------- diff --git a/profitbricks/src/main/java/org/jclouds/profitbricks/domain/Nic.java b/profitbricks/src/main/java/org/jclouds/profitbricks/domain/Nic.java deleted file mode 100644 index a7e421d..0000000 --- a/profitbricks/src/main/java/org/jclouds/profitbricks/domain/Nic.java +++ /dev/null @@ -1,248 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jclouds.profitbricks.domain; - -import static org.jclouds.profitbricks.util.Preconditions.checkIp; -import static org.jclouds.profitbricks.util.Preconditions.checkIps; -import static org.jclouds.profitbricks.util.Preconditions.checkLanId; -import static org.jclouds.profitbricks.util.Preconditions.checkMacAddress; - -import java.util.List; - -import com.google.auto.value.AutoValue; -import com.google.common.collect.ImmutableList; - -import org.jclouds.javax.annotation.Nullable; - -@AutoValue -public abstract class Nic { - - @Nullable - public abstract String id(); - - @Nullable - public abstract String name(); - - @Nullable - public abstract String dataCenterId(); - - @Nullable - public abstract Integer lanId(); - - @Nullable - public abstract Boolean internetAccess(); - - @Nullable - public abstract String serverId(); - - @Nullable - public abstract List<String> ips(); - - @Nullable - public abstract String macAddress(); - - @Nullable - public abstract Firewall firewall(); - - @Nullable - public abstract Boolean dhcpActive(); - - @Nullable - public abstract String gatewayIp(); - - @Nullable - public abstract ProvisioningState state(); - - public static Builder builder() { - return new AutoValue_Nic.Builder() - .ips(ImmutableList.<String>of()); - } - - public abstract Builder toBuilder(); - - @AutoValue.Builder - public abstract static class Builder { - - public abstract Builder id(String id); - - public abstract Builder name(String name); - - public abstract Builder dataCenterId(String dataCenterId); - - public abstract Builder lanId(Integer lanId); - - public abstract Builder internetAccess(Boolean internetAccess); - - public abstract Builder serverId(String serverId); - - public abstract Builder ips(List<String> ips); - - public abstract Builder macAddress(String macAddress); - - public abstract Builder firewall(Firewall firewall); - - public abstract Builder dhcpActive(Boolean dhcpActive); - - public abstract Builder gatewayIp(String gatewayIp); - - public abstract Builder state(ProvisioningState state); - - abstract Nic autoBuild(); - - public Nic build() { - Nic nic = autoBuild(); - if (nic.ips() != null) - checkIps(nic.ips()); - if (nic.gatewayIp() != null) - checkIp(nic.gatewayIp()); - if (nic.lanId() != null) - checkLanId(nic.lanId()); - if (nic.macAddress() != null) - checkMacAddress(nic.macAddress()); - - return nic.toBuilder() - .ips(ImmutableList.copyOf(nic.ips())) - .autoBuild(); - } - - } - - public static final class Request { - - public static CreatePayload.Builder creatingBuilder() { - return new AutoValue_Nic_Request_CreatePayload.Builder(); - } - - public static UpdatePayload.Builder updatingBuilder() { - return new AutoValue_Nic_Request_UpdatePayload.Builder(); - } - - public static SetInternetAccessPayload.Builder setInternetAccessBuilder() { - return new AutoValue_Nic_Request_SetInternetAccessPayload.Builder(); - } - - @AutoValue - public abstract static class CreatePayload { - - public abstract String serverId(); - - public abstract int lanId(); - - @Nullable - public abstract String ip(); - - @Nullable - public abstract String name(); - - @Nullable - public abstract Boolean dhcpActive(); - - @AutoValue.Builder - public abstract static class Builder { - - public abstract Builder serverId(String serverId); - - public abstract Builder lanId(int lanId); - - public abstract Builder ip(String ip); - - public abstract Builder name(String name); - - public abstract Builder dhcpActive(Boolean dhcpActive); - - abstract CreatePayload autoBuild(); - - public CreatePayload build() { - CreatePayload payload = autoBuild(); - if (payload.ip() != null) - checkIp(payload.ip()); - checkLanId(payload.lanId()); - - return payload; - } - } - } - - @AutoValue - public abstract static class UpdatePayload { - - public abstract String id(); - - @Nullable - public abstract String ip(); - - @Nullable - public abstract String name(); - - @Nullable - public abstract Boolean dhcpActive(); - - @Nullable - public abstract Integer lanId(); - - @AutoValue.Builder - public abstract static class Builder { - - public abstract Builder id(String id); - - public abstract Builder ip(String ip); - - public abstract Builder name(String name); - - public abstract Builder dhcpActive(Boolean dhcpActive); - - public abstract Builder lanId(Integer lanId); - - abstract UpdatePayload autoBuild(); - - public UpdatePayload build() { - UpdatePayload payload = autoBuild(); - if (payload.ip() != null) - checkIp(payload.ip()); - if (payload.lanId() != null) - checkLanId(payload.lanId()); - - return payload; - } - } - } - - @AutoValue - public abstract static class SetInternetAccessPayload { - - public abstract String dataCenterId(); - - public abstract int lanId(); - - public abstract boolean internetAccess(); - - @AutoValue.Builder - public abstract static class Builder { - - public abstract Builder dataCenterId(String dataCenterId); - - public abstract Builder lanId(int lanId); - - public abstract Builder internetAccess(boolean internetAccess); - - public abstract SetInternetAccessPayload build(); - - } - } - } - -} http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/93aff921/profitbricks/src/main/java/org/jclouds/profitbricks/domain/OsType.java ---------------------------------------------------------------------- diff --git a/profitbricks/src/main/java/org/jclouds/profitbricks/domain/OsType.java b/profitbricks/src/main/java/org/jclouds/profitbricks/domain/OsType.java deleted file mode 100644 index 25bc70b..0000000 --- a/profitbricks/src/main/java/org/jclouds/profitbricks/domain/OsType.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jclouds.profitbricks.domain; - -import com.google.common.base.Enums; - -public enum OsType { - - WINDOWS, LINUX, OTHER, UNRECOGNIZED; - - public static OsType fromValue(String v) { - return Enums.getIfPresent(OsType.class, v).or(UNRECOGNIZED); - } -} http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/93aff921/profitbricks/src/main/java/org/jclouds/profitbricks/domain/Provisionable.java ---------------------------------------------------------------------- diff --git a/profitbricks/src/main/java/org/jclouds/profitbricks/domain/Provisionable.java b/profitbricks/src/main/java/org/jclouds/profitbricks/domain/Provisionable.java deleted file mode 100644 index d3d29d4..0000000 --- a/profitbricks/src/main/java/org/jclouds/profitbricks/domain/Provisionable.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jclouds.profitbricks.domain; - -import com.google.common.base.Enums; - -/** - * Marker interface for {@link org.jclouds.profitbricks.domain.Image} and - * {@link org.jclouds.profitbricks.domain.Snapshot} - */ -public interface Provisionable { - - public enum Type { - - IMAGE, SNAPSHOT; - - public static Type fromValue(String v) { - return Enums.getIfPresent(Type.class, v).or(IMAGE); - } - } -} http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/93aff921/profitbricks/src/main/java/org/jclouds/profitbricks/domain/ProvisioningState.java ---------------------------------------------------------------------- diff --git a/profitbricks/src/main/java/org/jclouds/profitbricks/domain/ProvisioningState.java b/profitbricks/src/main/java/org/jclouds/profitbricks/domain/ProvisioningState.java deleted file mode 100644 index d00342e..0000000 --- a/profitbricks/src/main/java/org/jclouds/profitbricks/domain/ProvisioningState.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jclouds.profitbricks.domain; - -import com.google.common.base.Enums; - -public enum ProvisioningState { - - INACTIVE, INPROCESS, AVAILABLE, DELETED, ERROR, UNRECOGNIZED; - - public static ProvisioningState fromValue(String value) { - return Enums.getIfPresent(ProvisioningState.class, value).or(UNRECOGNIZED); - } -} http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/93aff921/profitbricks/src/main/java/org/jclouds/profitbricks/domain/Server.java ---------------------------------------------------------------------- diff --git a/profitbricks/src/main/java/org/jclouds/profitbricks/domain/Server.java b/profitbricks/src/main/java/org/jclouds/profitbricks/domain/Server.java deleted file mode 100644 index a36112d..0000000 --- a/profitbricks/src/main/java/org/jclouds/profitbricks/domain/Server.java +++ /dev/null @@ -1,410 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jclouds.profitbricks.domain; - -import static org.jclouds.profitbricks.util.Preconditions.checkCores; -import static org.jclouds.profitbricks.util.Preconditions.checkRam; - -import java.util.Date; -import java.util.List; - -import com.google.auto.value.AutoValue; -import com.google.common.base.Enums; -import com.google.common.collect.ImmutableList; - -import org.jclouds.javax.annotation.Nullable; - -@AutoValue -public abstract class Server { - - public enum Status { - - NOSTATE, RUNNING, BLOCKED, PAUSED, SHUTDOWN, SHUTOFF, CRASHED, UNRECOGNIZED; - - public String value() { - return name(); - } - - public static Status fromValue(String v) { - return Enums.getIfPresent(Status.class, v).or(UNRECOGNIZED); - } - } - - @Nullable - public abstract DataCenter dataCenter(); - - @Nullable - public abstract String id(); - - @Nullable - public abstract String name(); - - @Nullable - public abstract Integer cores(); - - @Nullable - public abstract Integer ram(); - - @Nullable - public abstract Boolean hasInternetAccess(); - - @Nullable - public abstract ProvisioningState state(); - - @Nullable - public abstract Status status(); - - @Nullable - public abstract OsType osType(); - - @Nullable - public abstract AvailabilityZone availabilityZone(); - - @Nullable - public abstract Date creationTime(); - - @Nullable - public abstract Date lastModificationTime(); - - @Nullable - public abstract List<Storage> storages(); - - @Nullable - public abstract List<Nic> nics(); - - @Nullable - public abstract String balancedNicId(); - - @Nullable - public abstract Boolean loadBalanced(); - - @Nullable - public abstract Boolean isCpuHotPlug(); - - @Nullable - public abstract Boolean isCpuHotUnPlug(); - - @Nullable - public abstract Boolean isRamHotPlug(); - - @Nullable - public abstract Boolean isRamHotUnPlug(); - - @Nullable - public abstract Boolean isNicHotPlug(); - - @Nullable - public abstract Boolean isNicHotUnPlug(); - - @Nullable - public abstract Boolean isDiscVirtioHotPlug(); - - @Nullable - public abstract Boolean isDiscVirtioHotUnPlug(); - - @Nullable - public abstract String hostname(); // Non-profitbricks property; Added to hold hostname parsed from image temporarily - - public static Builder builder() { - return new AutoValue_Server.Builder() - .storages(ImmutableList.<Storage>of()) - .nics(ImmutableList.<Nic>of()); - } - - public abstract Builder toBuilder(); - - @AutoValue.Builder - public abstract static class Builder { - - public abstract Builder dataCenter(DataCenter dataCenter); - - public abstract Builder id(String id); - - public abstract Builder name(String name); - - public abstract Builder cores(Integer cores); - - public abstract Builder ram(Integer ram); - - public abstract Builder hasInternetAccess(Boolean internetAccess); - - public abstract Builder state(ProvisioningState state); - - public abstract Builder status(Status status); - - public abstract Builder osType(OsType osType); - - public abstract Builder availabilityZone(AvailabilityZone availabilityZone); - - public abstract Builder creationTime(Date creationTime); - - public abstract Builder lastModificationTime(Date lastModificationTime); - - public abstract Builder storages(List<Storage> storages); - - public abstract Builder nics(List<Nic> nics); - - public abstract Builder balancedNicId(String balancedNicIds); - - public abstract Builder loadBalanced(Boolean isLoadBalanced); - - public abstract Builder isCpuHotPlug(Boolean isCpuHotPlug); - - public abstract Builder isCpuHotUnPlug(Boolean isCpuHotUnPlug); - - public abstract Builder isRamHotPlug(Boolean isRamHotPlug); - - public abstract Builder isRamHotUnPlug(Boolean isRamHotUnPlug); - - public abstract Builder isNicHotPlug(Boolean isNicHotPlug); - - public abstract Builder isNicHotUnPlug(Boolean isNicHotUnPlug); - - public abstract Builder isDiscVirtioHotPlug(Boolean isDiscVirtioHotPlug); - - public abstract Builder isDiscVirtioHotUnPlug(Boolean isDiscVirtioHotUnPlug); - - public abstract Builder hostname(String hostname); - - abstract Server autoBuild(); - - public Server build() { - Server server = autoBuild(); - if (server.cores() != null) - checkCores(server.cores()); - if (server.ram() != null) - checkRam(server.ram(), server.isRamHotUnPlug()); - return server.toBuilder() - .storages(ImmutableList.copyOf(server.storages())) - .nics(ImmutableList.copyOf(server.nics())) - .autoBuild(); - } - } - - public static final class Request { - - public static CreatePayload.Builder creatingBuilder() { - return new AutoValue_Server_Request_CreatePayload.Builder(); - } - - public static UpdatePayload.Builder updatingBuilder() { - return new AutoValue_Server_Request_UpdatePayload.Builder(); - } - - @AutoValue - public abstract static class CreatePayload { - - public abstract int cores(); - - public abstract int ram(); - - public abstract String dataCenterId(); - - public abstract String name(); - - @Nullable - public abstract String bootFromStorageId(); - - @Nullable - public abstract String bootFromImageId(); - - @Nullable - public abstract Integer lanId(); - - @Nullable - public abstract Boolean hasInternetAccess(); - - @Nullable - public abstract AvailabilityZone availabilityZone(); - - @Nullable - public abstract OsType osType(); - - @Nullable - public abstract Boolean isCpuHotPlug(); - - @Nullable - public abstract Boolean isCpuHotUnPlug(); - - @Nullable - public abstract Boolean isRamHotPlug(); - - @Nullable - public abstract Boolean isRamHotUnPlug(); - - @Nullable - public abstract Boolean isNicHotPlug(); - - @Nullable - public abstract Boolean isNicHotUnPlug(); - - @Nullable - public abstract Boolean isDiscVirtioHotPlug(); - - @Nullable - public abstract Boolean isDiscVirtioHotUnPlug(); - - @AutoValue.Builder - public abstract static class Builder { - - public abstract Builder cores(int cores); - - public abstract Builder ram(int ram); - - public abstract Builder dataCenterId(String dataCenterId); - - public abstract Builder name(String name); - - public abstract Builder bootFromStorageId(String bootFromStorageId); - - public abstract Builder bootFromImageId(String bootFromImageId); - - public abstract Builder lanId(Integer lanId); - - public abstract Builder hasInternetAccess(Boolean hasInternetAccess); - - public abstract Builder availabilityZone(AvailabilityZone availabilityZone); - - public abstract Builder osType(OsType osType); - - public abstract Builder isCpuHotPlug(Boolean isCpuHotPlug); - - public abstract Builder isCpuHotUnPlug(Boolean isCpuHotUnPlug); - - public abstract Builder isRamHotPlug(Boolean isRamHotPlug); - - public abstract Builder isRamHotUnPlug(Boolean isRamHotUnPlug); - - public abstract Builder isNicHotPlug(Boolean isNicHotPlug); - - public abstract Builder isNicHotUnPlug(Boolean isNicHotUnPlug); - - public abstract Builder isDiscVirtioHotPlug(Boolean isDiscVirtioHotPlug); - - public abstract Builder isDiscVirtioHotUnPlug(Boolean isDiscVirtioHotUnPlug); - - abstract CreatePayload autoBuild(); - - public CreatePayload build() { - CreatePayload payload = autoBuild(); - checkCores(payload.cores()); - checkRam(payload.ram(), payload.isRamHotUnPlug()); - return payload; - } - } - - } - - @AutoValue - public abstract static class UpdatePayload { - - public abstract String id(); - - @Nullable - public abstract Integer cores(); - - @Nullable - public abstract Integer ram(); - - @Nullable - public abstract String name(); - - @Nullable - public abstract String bootFromStorageId(); - - @Nullable - public abstract String bootFromImageId(); - - @Nullable - public abstract AvailabilityZone availabilityZone(); - - @Nullable - public abstract OsType osType(); - - @Nullable - public abstract Boolean isCpuHotPlug(); - - @Nullable - public abstract Boolean isCpuHotUnPlug(); - - @Nullable - public abstract Boolean isRamHotPlug(); - - @Nullable - public abstract Boolean isRamHotUnPlug(); - - @Nullable - public abstract Boolean isNicHotPlug(); - - @Nullable - public abstract Boolean isNicHotUnPlug(); - - @Nullable - public abstract Boolean isDiscVirtioHotPlug(); - - @Nullable - public abstract Boolean isDiscVirtioHotUnPlug(); - - @AutoValue.Builder - public abstract static class Builder { - - public abstract Builder id(String id); - - public abstract Builder cores(Integer cores); - - public abstract Builder ram(Integer ram); - - public abstract Builder name(String name); - - public abstract Builder bootFromStorageId(String bootFromStorageId); - - public abstract Builder bootFromImageId(String bootFromImageId); - - public abstract Builder availabilityZone(AvailabilityZone availabilityZone); - - public abstract Builder osType(OsType osType); - - public abstract Builder isCpuHotPlug(Boolean isCpuHotPlug); - - public abstract Builder isCpuHotUnPlug(Boolean isCpuHotUnPlug); - - public abstract Builder isRamHotPlug(Boolean isRamHotPlug); - - public abstract Builder isRamHotUnPlug(Boolean isRamHotUnPlug); - - public abstract Builder isNicHotPlug(Boolean isNicHotPlug); - - public abstract Builder isNicHotUnPlug(Boolean isNicHotUnPlug); - - public abstract Builder isDiscVirtioHotPlug(Boolean isDiscVirtioHotPlug); - - public abstract Builder isDiscVirtioHotUnPlug(Boolean isDiscVirtioHotUnPlug); - - abstract UpdatePayload autoBuild(); - - public UpdatePayload build() { - UpdatePayload payload = autoBuild(); - if (payload.cores() != null) - checkCores(payload.cores()); - if (payload.ram() != null) - checkRam(payload.ram(), payload.isRamHotUnPlug()); - return payload; - } - } - } - } -} http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/93aff921/profitbricks/src/main/java/org/jclouds/profitbricks/domain/ServiceFault.java ---------------------------------------------------------------------- diff --git a/profitbricks/src/main/java/org/jclouds/profitbricks/domain/ServiceFault.java b/profitbricks/src/main/java/org/jclouds/profitbricks/domain/ServiceFault.java deleted file mode 100644 index bcf9774..0000000 --- a/profitbricks/src/main/java/org/jclouds/profitbricks/domain/ServiceFault.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jclouds.profitbricks.domain; - -import com.google.auto.value.AutoValue; -import com.google.common.base.Enums; - -@AutoValue -public abstract class ServiceFault { - - public enum FaultCode { - - BAD_REQUEST, - UNEXPECTED, - UNAUTHORIZED, - RESOURCE_NOT_FOUND, - RESOURCE_DELETED, - PROVISIONING_IN_PROCESS, - PROVISIONING_NO_CHANGES, - OVER_LIMIT_SETTING, - SERVER_EXCEED_CAPACITY, - SERVICE_UNAVAILABLE, - UNRECOGNIZED; - - public static FaultCode fromValue(String v) { - return Enums.getIfPresent(FaultCode.class, v).or(UNRECOGNIZED); - } - } - - public abstract FaultCode faultCode(); - - public abstract int httpCode(); - - public abstract String message(); - - public abstract int requestId(); - - public static Builder builder() { - return new AutoValue_ServiceFault.Builder(); - } - - @AutoValue.Builder - public abstract static class Builder { - - public abstract Builder faultCode(FaultCode faultCode); - - public abstract Builder httpCode(int httpCode); - - public abstract Builder message(String message); - - public abstract Builder requestId(int requestId); - - public abstract ServiceFault build(); - - } -} http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/93aff921/profitbricks/src/main/java/org/jclouds/profitbricks/domain/Snapshot.java ---------------------------------------------------------------------- diff --git a/profitbricks/src/main/java/org/jclouds/profitbricks/domain/Snapshot.java b/profitbricks/src/main/java/org/jclouds/profitbricks/domain/Snapshot.java deleted file mode 100644 index 7f0be59..0000000 --- a/profitbricks/src/main/java/org/jclouds/profitbricks/domain/Snapshot.java +++ /dev/null @@ -1,251 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jclouds.profitbricks.domain; - -import java.util.Date; - -import com.google.auto.value.AutoValue; - -import org.jclouds.javax.annotation.Nullable; - -@AutoValue -public abstract class Snapshot implements Provisionable { - - @Nullable - public abstract String id(); - - @Nullable - public abstract String name(); - - @Nullable - public abstract Float size(); - - @Nullable - public abstract Location location(); - - @Nullable - public abstract OsType osType(); - - @Nullable - public abstract Boolean isBootable(); - - @Nullable - public abstract String description(); - - @Nullable - public abstract Date creationTime(); - - @Nullable - public abstract Date lastModificationTime(); - - @Nullable - public abstract ProvisioningState state(); - - @Nullable - public abstract Boolean isCpuHotPlug(); - - @Nullable - public abstract Boolean isCpuHotUnPlug(); - - @Nullable - public abstract Boolean isRamHotPlug(); - - @Nullable - public abstract Boolean isRamHotUnPlug(); - - @Nullable - public abstract Boolean isNicHotPlug(); - - @Nullable - public abstract Boolean isNicHotUnPlug(); - - @Nullable - public abstract Boolean isDiscVirtioHotPlug(); - - @Nullable - public abstract Boolean isDiscVirtioHotUnPlug(); - - public static Builder builder() { - return new AutoValue_Snapshot.Builder(); - } - - public abstract Builder toBuilder(); - - @AutoValue.Builder - public abstract static class Builder { - - public abstract Builder id(String id); - - public abstract Builder name(String name); - - public abstract Builder size(Float size); - - public abstract Builder location(Location location); - - public abstract Builder osType(OsType osType); - - public abstract Builder isBootable(Boolean bootable); - - public abstract Builder description(String description); - - public abstract Builder creationTime(Date creationTime); - - public abstract Builder lastModificationTime(Date lastModificationTime); - - public abstract Builder state(ProvisioningState state); - - public abstract Builder isCpuHotPlug(Boolean isCpuHotPlug); - - public abstract Builder isCpuHotUnPlug(Boolean isCpuHotUnPlug); - - public abstract Builder isRamHotPlug(Boolean isRamHotPlug); - - public abstract Builder isRamHotUnPlug(Boolean isRamHotUnPlug); - - public abstract Builder isNicHotPlug(Boolean isNicHotPlug); - - public abstract Builder isNicHotUnPlug(Boolean isNicHotUnPlug); - - public abstract Builder isDiscVirtioHotPlug(Boolean isDiscVirtioHotPlug); - - public abstract Builder isDiscVirtioHotUnPlug(Boolean isDiscVirtioHotUnPlug); - - public abstract Snapshot build(); - } - - public static final class Request { - - public static CreatePayload.Builder creatingBuilder() { - return new AutoValue_Snapshot_Request_CreatePayload.Builder(); - } - - public static UpdatePayload.Builder updatingBuilder() { - return new AutoValue_Snapshot_Request_UpdatePayload.Builder(); - } - - public static RollbackPayload createRollbackPayload(String snapshotId, String storageId) { - return new AutoValue_Snapshot_Request_RollbackPayload(snapshotId, storageId); - } - - @AutoValue - public abstract static class CreatePayload { - - public abstract String storageId(); - - public abstract String name(); - - @Nullable - public abstract String description(); - - @AutoValue.Builder - public abstract static class Builder { - - public abstract Builder storageId(String storageId); - - public abstract Builder name(String name); - - public abstract Builder description(String description); - - public abstract CreatePayload build(); - } - } - - @AutoValue - public abstract static class UpdatePayload { - - public abstract String id(); - - @Nullable - public abstract String description(); - - @Nullable - public abstract String name(); - - @Nullable - public abstract Boolean bootable(); - - @Nullable - public abstract OsType osType(); - - @Nullable - public abstract Boolean isCpuHotPlug(); - - @Nullable - public abstract Boolean isCpuHotUnPlug(); - - @Nullable - public abstract Boolean isRamHotPlug(); - - @Nullable - public abstract Boolean isRamHotUnPlug(); - - @Nullable - public abstract Boolean isNicHotPlug(); - - @Nullable - public abstract Boolean isNicHotUnPlug(); - - @Nullable - public abstract Boolean isDiscVirtioHotPlug(); - - @Nullable - public abstract Boolean isDiscVirtioHotUnPlug(); - - @AutoValue.Builder - public abstract static class Builder { - - public abstract Builder id(String snapshotId); - - public abstract Builder description(String description); - - public abstract Builder name(String name); - - public abstract Builder bootable(Boolean bootable); - - public abstract Builder osType(OsType osType); - - public abstract Builder isCpuHotPlug(Boolean isCpuHotPlug); - - public abstract Builder isCpuHotUnPlug(Boolean isCpuHotUnPlug); - - public abstract Builder isRamHotPlug(Boolean isRamHotPlug); - - public abstract Builder isRamHotUnPlug(Boolean isRamHotUnPlug); - - public abstract Builder isNicHotPlug(Boolean isNicHotPlug); - - public abstract Builder isNicHotUnPlug(Boolean isNicHotUnPlug); - - public abstract Builder isDiscVirtioHotPlug(Boolean isDiscVirtioHotPlug); - - public abstract Builder isDiscVirtioHotUnPlug(Boolean isDiscVirtioHotUnPlug); - - public abstract UpdatePayload build(); - } - - } - - @AutoValue - public abstract static class RollbackPayload { - - public abstract String snapshotId(); - - public abstract String storageId(); - - } - } -} http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/93aff921/profitbricks/src/main/java/org/jclouds/profitbricks/domain/Storage.java ---------------------------------------------------------------------- diff --git a/profitbricks/src/main/java/org/jclouds/profitbricks/domain/Storage.java b/profitbricks/src/main/java/org/jclouds/profitbricks/domain/Storage.java deleted file mode 100644 index 6a0e8a9..0000000 --- a/profitbricks/src/main/java/org/jclouds/profitbricks/domain/Storage.java +++ /dev/null @@ -1,234 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jclouds.profitbricks.domain; - -import static org.jclouds.profitbricks.util.Preconditions.checkPassword; -import static org.jclouds.profitbricks.util.Preconditions.checkSize; - -import java.util.Date; -import java.util.List; - -import com.google.auto.value.AutoValue; -import com.google.common.base.Enums; -import com.google.common.collect.ImmutableList; -import org.jclouds.javax.annotation.Nullable; - - -@AutoValue -public abstract class Storage { - - public enum BusType { - - IDE, SCSI, VIRTIO, UNRECOGNIZED; - - public static BusType fromValue(String value) { - return Enums.getIfPresent(BusType.class, value).or(UNRECOGNIZED); - } - } - - public abstract String id(); - - @Nullable - public abstract String name(); - - public abstract float size(); // GB - - @Nullable - public abstract Date creationTime(); - - @Nullable - public abstract Date lastModificationTime(); - - @Nullable - public abstract ProvisioningState state(); - - @Nullable - public abstract List<String> serverIds(); - - @Nullable - public abstract Boolean bootDevice(); - - @Nullable - public abstract BusType busType(); - - @Nullable - public abstract Integer deviceNumber(); - - public static Builder builder() { - return new AutoValue_Storage.Builder() - .serverIds(ImmutableList.<String>of()); - } - - public abstract Builder toBuilder(); - - @AutoValue.Builder - public abstract static class Builder { - - public abstract Builder id(String id); - - public abstract Builder name(String name); - - public abstract Builder size(float size); - - public abstract Builder creationTime(Date creationTime); - - public abstract Builder lastModificationTime(Date lastModificationTime); - - public abstract Builder state(ProvisioningState state); - - public abstract Builder serverIds(List<String> serverIds); - - public abstract Builder bootDevice(Boolean bootDevice); - - public abstract Builder busType(BusType busType); - - public abstract Builder deviceNumber(Integer deviceNumber); - - abstract Storage autoBuild(); - - public Storage build(){ - Storage built = autoBuild(); - return built.toBuilder() - .serverIds(ImmutableList.copyOf(built.serverIds())) - .autoBuild(); - } - - } - - public static final class Request { - - public static CreatePayload.Builder creatingBuilder() { - return new AutoValue_Storage_Request_CreatePayload.Builder(); - } - - public static UpdatePayload.Builder updatingBuilder() { - return new AutoValue_Storage_Request_UpdatePayload.Builder(); - } - - public static ConnectPayload.Builder connectingBuilder() { - return new AutoValue_Storage_Request_ConnectPayload.Builder(); - } - - @AutoValue - public abstract static class CreatePayload { - - public abstract String dataCenterId(); - - public abstract float size(); - - @Nullable - public abstract String name(); - - @Nullable - public abstract String mountImageId(); - - @Nullable - public abstract String imagePassword(); - - @AutoValue.Builder - public abstract static class Builder { - - public abstract Builder dataCenterId(String dataCenterId); - - public abstract Builder size(float size); - - public abstract Builder name(String name); - - public abstract Builder mountImageId(String mountImageId); - - public abstract Builder imagePassword(String profitBricksImagePassword); - - abstract CreatePayload autoBuild(); - - public CreatePayload build() { - CreatePayload payload = autoBuild(); - if (payload.imagePassword() != null) - checkPassword(payload.imagePassword()); - checkSize(payload.size()); - - return payload; - } - } - } - - @AutoValue - public abstract static class UpdatePayload { - - public abstract String id(); - - @Nullable - public abstract Float size(); - - @Nullable - public abstract String name(); - - @Nullable - public abstract String mountImageId(); - - @AutoValue.Builder - public abstract static class Builder { - - public abstract Builder id(String id); - - public abstract Builder size(Float size); - - public abstract Builder name(String name); - - public abstract Builder mountImageId(String mountImageId); - - abstract UpdatePayload autoBuild(); - - public UpdatePayload build() { - UpdatePayload payload = autoBuild(); - if (payload.size() != null) - checkSize(payload.size()); - - return payload; - } - } - } - - @AutoValue - public abstract static class ConnectPayload { - - public abstract String storageId(); - - public abstract String serverId(); - - @Nullable - public abstract BusType busType(); - - @Nullable - public abstract Integer deviceNumber(); - - @AutoValue.Builder - public abstract static class Builder { - - public abstract Builder storageId(String storageId); - - public abstract Builder serverId(String serverId); - - public abstract Builder busType(BusType busType); - - public abstract Builder deviceNumber(Integer deviceNumber); - - public abstract ConnectPayload build(); - } - } - - } -} http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/93aff921/profitbricks/src/main/java/org/jclouds/profitbricks/features/DataCenterApi.java ---------------------------------------------------------------------- diff --git a/profitbricks/src/main/java/org/jclouds/profitbricks/features/DataCenterApi.java b/profitbricks/src/main/java/org/jclouds/profitbricks/features/DataCenterApi.java deleted file mode 100644 index f660730..0000000 --- a/profitbricks/src/main/java/org/jclouds/profitbricks/features/DataCenterApi.java +++ /dev/null @@ -1,134 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jclouds.profitbricks.features; - -import java.util.List; -import javax.inject.Named; - -import javax.ws.rs.Consumes; -import javax.ws.rs.POST; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; - -import org.jclouds.Fallbacks; -import org.jclouds.http.filters.BasicAuthentication; -import org.jclouds.profitbricks.binder.datacenter.CreateDataCenterRequestBinder; -import org.jclouds.profitbricks.binder.datacenter.UpdateDataCenterRequestBinder; -import org.jclouds.profitbricks.domain.DataCenter; -import org.jclouds.profitbricks.domain.ProvisioningState; -import org.jclouds.profitbricks.http.filters.ProfitBricksSoapMessageEnvelope; -import org.jclouds.profitbricks.http.parser.datacenter.DataCenterInfoResponseHandler; -import org.jclouds.profitbricks.http.parser.datacenter.DataCenterListResponseHandler; -import org.jclouds.profitbricks.http.parser.state.GetProvisioningStateResponseHandler; -import org.jclouds.rest.annotations.Fallback; -import org.jclouds.rest.annotations.MapBinder; -import org.jclouds.rest.annotations.Payload; -import org.jclouds.rest.annotations.PayloadParam; -import org.jclouds.rest.annotations.RequestFilters; -import org.jclouds.rest.annotations.XMLResponseParser; - -@RequestFilters({BasicAuthentication.class, ProfitBricksSoapMessageEnvelope.class}) -@Consumes(MediaType.TEXT_XML) -@Produces(MediaType.TEXT_XML) -public interface DataCenterApi { - - /** - * @return Returns a list of all Virtual Data Centers created by the user, including ID, name and version number. - */ - @POST - @Named("datacenter:getall") - @Payload("<ws:getAllDataCenters/>") - @XMLResponseParser(DataCenterListResponseHandler.class) - @Fallback(Fallbacks.EmptyListOnNotFoundOr404.class) - List<DataCenter> getAllDataCenters(); - - /** - * @param identifier Data Center identifier - * @return Returns information about an existing virtual data center's state and configuration or <code>null</code> - * if it doesn't exist. - */ - @POST - @Named("datacenter:get") - @Payload("<ws:getDataCenter><dataCenterId>{id}</dataCenterId></ws:getDataCenter>") - @XMLResponseParser(DataCenterInfoResponseHandler.class) - @Fallback(Fallbacks.NullOnNotFoundOr404.class) - DataCenter getDataCenter(@PayloadParam("id") String identifier); - - /** - * This is a lightweight function for polling the current provisioning state of the Virtual Data Center. It is - * recommended to use this function for large Virtual Data Centers to query request results. - * <p> - * @param identifier Data Center identifier - */ - @POST - @Named("datacenter:getstate") - @Payload("<ws:getDataCenterState><dataCenterId>{id}</dataCenterId></ws:getDataCenterState>") - @XMLResponseParser(GetProvisioningStateResponseHandler.class) - ProvisioningState getDataCenterState(@PayloadParam("id") String identifier); - - /** - * Creates and saves a new, empty Virtual Data Center. Returns its identifier for further reference. - * <p> - * <b>Note: </b>Data center names cannot start with or contain (@, /, \, |, ââ, â) - * <p> - * @param createRequest VDC payload containing dataCenterName, region - * @return Response containing requestId, dataCenterId, version, and location - */ - @POST - @Named("datacenter:create") - @MapBinder(CreateDataCenterRequestBinder.class) - @XMLResponseParser(DataCenterInfoResponseHandler.class) - DataCenter createDataCenter(@PayloadParam("dataCenter") DataCenter.Request.CreatePayload createRequest); - - /** - * Updates the information associated to an existing Virtual Data Center. - * <p> - * @param updateRequest VDC payload containing dataCenterId, and name - * @return Response containing requestId, dataCenterId, version - */ - @POST - @Named("datacenter:update") - @MapBinder(UpdateDataCenterRequestBinder.class) - @XMLResponseParser(DataCenterInfoResponseHandler.class) - DataCenter updateDataCenter(@PayloadParam("dataCenter") DataCenter.Request.UpdatePayload updateRequest); - - /** - * Removes all components from an existing Virtual Data Center. - * <p> - * @param identifier Identifier of the virtual data center - * @return Response containing requestId, dataCenterId, version - */ - @POST - @Named("datacenter:clear") - @Payload("<ws:clearDataCenter><dataCenterId>{id}</dataCenterId></ws:clearDataCenter>") - @XMLResponseParser(DataCenterInfoResponseHandler.class) - DataCenter clearDataCenter(@PayloadParam("id") String identifier); - - /** - * Deletes an Virtual Data Center. If a previous request on the target data center is still in progress, the data - * center is going to be deleted after this request has been completed. Once a Data Center has been deleted, no - * further request can be performed on it. - * <p> - * @param identifier Identifier of the virtual data center - * @return Returns a boolean indicating whether delete operation was made - */ - @POST - @Named("datacenter:delete") - @Payload("<ws:deleteDataCenter><dataCenterId>{id}</dataCenterId></ws:deleteDataCenter>") - @Fallback(Fallbacks.FalseOnNotFoundOr404.class) - boolean deleteDataCenter(@PayloadParam("id") String identifier); -} http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/93aff921/profitbricks/src/main/java/org/jclouds/profitbricks/features/DrivesApi.java ---------------------------------------------------------------------- diff --git a/profitbricks/src/main/java/org/jclouds/profitbricks/features/DrivesApi.java b/profitbricks/src/main/java/org/jclouds/profitbricks/features/DrivesApi.java deleted file mode 100644 index 70f70a0..0000000 --- a/profitbricks/src/main/java/org/jclouds/profitbricks/features/DrivesApi.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jclouds.profitbricks.features; - -import javax.inject.Named; -import javax.ws.rs.Consumes; -import javax.ws.rs.POST; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; -import org.jclouds.http.filters.BasicAuthentication; -import org.jclouds.profitbricks.binder.drive.AddRomDriveToServerRequestBinder; -import org.jclouds.profitbricks.domain.Drive; -import org.jclouds.profitbricks.http.filters.ProfitBricksSoapMessageEnvelope; -import org.jclouds.profitbricks.http.parser.RequestIdOnlyResponseHandler; -import org.jclouds.rest.annotations.MapBinder; -import org.jclouds.rest.annotations.Payload; -import org.jclouds.rest.annotations.PayloadParam; -import org.jclouds.rest.annotations.RequestFilters; -import org.jclouds.rest.annotations.XMLResponseParser; - -@RequestFilters({BasicAuthentication.class, ProfitBricksSoapMessageEnvelope.class}) -@Consumes(MediaType.TEXT_XML) -@Produces(MediaType.TEXT_XML) -public interface DrivesApi { - - @POST - @Named("drives:add") - @MapBinder(AddRomDriveToServerRequestBinder.class) - @XMLResponseParser(RequestIdOnlyResponseHandler.class) - String addRomDriveToServer(@PayloadParam("payload") Drive.Request.AddRomDriveToServerPayload payload); - - @POST - @Named("drives:remove") - @Payload("<ws:removeRomDriveFromServer><imageId>{imageid}</imageId><serverId>{serverid}</serverId></ws:removeRomDriveFromServer>") - @XMLResponseParser(RequestIdOnlyResponseHandler.class) - String removeRomDriveFromServer(@PayloadParam("imageid") String imageid, @PayloadParam("serverid") String serverid); -} http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/93aff921/profitbricks/src/main/java/org/jclouds/profitbricks/features/FirewallApi.java ---------------------------------------------------------------------- diff --git a/profitbricks/src/main/java/org/jclouds/profitbricks/features/FirewallApi.java b/profitbricks/src/main/java/org/jclouds/profitbricks/features/FirewallApi.java deleted file mode 100644 index f0aefb9..0000000 --- a/profitbricks/src/main/java/org/jclouds/profitbricks/features/FirewallApi.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jclouds.profitbricks.features; - -import java.util.List; - -import javax.inject.Named; -import javax.ws.rs.Consumes; -import javax.ws.rs.POST; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; - -import org.jclouds.Fallbacks; -import org.jclouds.http.filters.BasicAuthentication; -import org.jclouds.profitbricks.binder.firewall.AddFirewallRuleToNicRequestBinder; -import org.jclouds.profitbricks.binder.firewall.FirewallBinder.ActivateFirewallRequestBinder; -import org.jclouds.profitbricks.binder.firewall.FirewallBinder.DeactivateFirewallRequestBinder; -import org.jclouds.profitbricks.binder.firewall.FirewallBinder.DeleteFirewallRequestBinder; -import org.jclouds.profitbricks.binder.firewall.FirewallBinder.RemoveFirewallRuleRequestBinder; -import org.jclouds.profitbricks.domain.Firewall; -import org.jclouds.profitbricks.http.filters.ProfitBricksSoapMessageEnvelope; -import org.jclouds.profitbricks.http.parser.firewall.FirewallListResponseHandler; -import org.jclouds.profitbricks.http.parser.firewall.FirewallResponseHandler; -import org.jclouds.rest.annotations.MapBinder; -import org.jclouds.rest.annotations.Payload; -import org.jclouds.rest.annotations.PayloadParam; -import org.jclouds.rest.annotations.RequestFilters; -import org.jclouds.rest.annotations.XMLResponseParser; -import org.jclouds.rest.annotations.Fallback; - -@RequestFilters({BasicAuthentication.class, ProfitBricksSoapMessageEnvelope.class}) -@Consumes(MediaType.TEXT_XML) -@Produces(MediaType.TEXT_XML) -public interface FirewallApi { - - @POST - @Named("firewall:get") - @Payload("<ws:getFirewall><firewallId>{id}</firewallId></ws:getFirewall>") - @XMLResponseParser(FirewallResponseHandler.class) - @Fallback(Fallbacks.NullOnNotFoundOr404.class) - Firewall getFirewall(@PayloadParam("id") String identifier); - - @POST - @Named("firewall:getall") - @Payload("<ws:getAllFirewalls/>") - @XMLResponseParser(FirewallListResponseHandler.class) - @Fallback(Fallbacks.EmptyListOnNotFoundOr404.class) - List<Firewall> getAllFirewalls(); - - @POST - @Named("firewall:addrule") - @MapBinder(AddFirewallRuleToNicRequestBinder.class) - @XMLResponseParser(FirewallResponseHandler.class) - Firewall addFirewallRuleToNic(@PayloadParam("firewall") Firewall.Request.AddRulePayload payload); - - @POST - @Named("firewall:removerule") - @MapBinder(RemoveFirewallRuleRequestBinder.class) - @Fallback(Fallbacks.FalseOnNotFoundOr404.class) - boolean removeFirewallRules(@PayloadParam("ids") List<String> firewallRuleIds); - - @POST - @Named("firewall:activate") - @MapBinder(ActivateFirewallRequestBinder.class) - @Fallback(Fallbacks.FalseOnNotFoundOr404.class) - boolean activateFirewall(@PayloadParam("ids") List<String> firewallIds); - - @POST - @Named("firewall:activate") - @MapBinder(DeactivateFirewallRequestBinder.class) - @Fallback(Fallbacks.FalseOnNotFoundOr404.class) - boolean deactivateFirewall(@PayloadParam("ids") List<String> firewallIds); - - @POST - @Named("firewall:activate") - @MapBinder(DeleteFirewallRequestBinder.class) - @Fallback(Fallbacks.FalseOnNotFoundOr404.class) - boolean deleteFirewall(@PayloadParam("ids") List<String> firewallIds); -} http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/93aff921/profitbricks/src/main/java/org/jclouds/profitbricks/features/ImageApi.java ---------------------------------------------------------------------- diff --git a/profitbricks/src/main/java/org/jclouds/profitbricks/features/ImageApi.java b/profitbricks/src/main/java/org/jclouds/profitbricks/features/ImageApi.java deleted file mode 100644 index 95d27c4..0000000 --- a/profitbricks/src/main/java/org/jclouds/profitbricks/features/ImageApi.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jclouds.profitbricks.features; - -import java.util.List; -import javax.inject.Named; - -import javax.ws.rs.Consumes; -import javax.ws.rs.POST; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; -import org.jclouds.Fallbacks; - -import org.jclouds.http.filters.BasicAuthentication; -import org.jclouds.profitbricks.domain.Image; -import org.jclouds.profitbricks.http.filters.ProfitBricksSoapMessageEnvelope; -import org.jclouds.profitbricks.http.parser.image.ImageInfoResponseHandler; -import org.jclouds.profitbricks.http.parser.image.ImageListResponseHandler; -import org.jclouds.rest.annotations.Fallback; -import org.jclouds.rest.annotations.Payload; -import org.jclouds.rest.annotations.PayloadParam; -import org.jclouds.rest.annotations.RequestFilters; -import org.jclouds.rest.annotations.XMLResponseParser; - -@RequestFilters({BasicAuthentication.class, ProfitBricksSoapMessageEnvelope.class}) -@Consumes(MediaType.TEXT_XML) -@Produces(MediaType.TEXT_XML) -public interface ImageApi { - - /** - * @return Outputs a list of all HDD and/or CD-ROM/DVD images existing on or uploaded to the ProfitBricks FTP server. - */ - @POST - @Named("image:getall") - @Payload("<ws:getAllImages/>") - @XMLResponseParser(ImageListResponseHandler.class) - @Fallback(Fallbacks.EmptyListOnNotFoundOr404.class) - List<Image> getAllImages(); - - /** - * - * @param identifier Image Id - * @return Returns information about a HDD or CD-ROM/DVD (ISO) image. - */ - @POST - @Named("image:get") - @Payload("<ws:getImage><imageId>{id}</imageId></ws:getImage>") - @XMLResponseParser(ImageInfoResponseHandler.class) - @Fallback(Fallbacks.NullOnNotFoundOr404.class) - Image getImage(@PayloadParam("id") String identifier); -}
