You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by ni...@apache.org on 2014/03/18 03:52:08 UTC
[15/20] fixing https://issues.apache.org/jira/browse/STRATOS-520 -
adding Openstack-nova module to dependencies
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/5857efca/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/VolumeSnapshot.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/VolumeSnapshot.java b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/VolumeSnapshot.java
new file mode 100644
index 0000000..bbd45a4
--- /dev/null
+++ b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/VolumeSnapshot.java
@@ -0,0 +1,239 @@
+/*
+ * 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.openstack.nova.v2_0.domain;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+
+import java.beans.ConstructorProperties;
+import java.util.Date;
+
+import javax.inject.Named;
+
+import org.jclouds.javax.annotation.Nullable;
+
+import com.google.common.base.Objects;
+import com.google.common.base.Objects.ToStringHelper;
+
+/**
+ * An OpenStack Nova Volume Snapshot
+*/
+public class VolumeSnapshot {
+
+ public static Builder<?> builder() {
+ return new ConcreteBuilder();
+ }
+
+ public Builder<?> toBuilder() {
+ return new ConcreteBuilder().fromVolumeSnapshot(this);
+ }
+
+ public abstract static class Builder<T extends Builder<T>> {
+ protected abstract T self();
+
+ protected String id;
+ protected String volumeId;
+ protected Volume.Status status;
+ protected int size;
+ protected Date created;
+ protected String name;
+ protected String description;
+
+ /**
+ * @see VolumeSnapshot#getId()
+ */
+ public T id(String id) {
+ this.id = id;
+ return self();
+ }
+
+ /**
+ * @see VolumeSnapshot#getVolumeId()
+ */
+ public T volumeId(String volumeId) {
+ this.volumeId = volumeId;
+ return self();
+ }
+
+ /**
+ * @see VolumeSnapshot#getStatus()
+ */
+ public T status(Volume.Status status) {
+ this.status = status;
+ return self();
+ }
+
+ /**
+ * @see VolumeSnapshot#getSize()
+ */
+ public T size(int size) {
+ this.size = size;
+ return self();
+ }
+
+ /**
+ * @see VolumeSnapshot#getCreated()
+ */
+ public T created(Date created) {
+ this.created = created;
+ return self();
+ }
+
+ /**
+ * @see VolumeSnapshot#getName()
+ */
+ public T name(String name) {
+ this.name = name;
+ return self();
+ }
+
+ /**
+ * @see VolumeSnapshot#getDescription()
+ */
+ public T description(String description) {
+ this.description = description;
+ return self();
+ }
+
+ public VolumeSnapshot build() {
+ return new VolumeSnapshot(id, volumeId, status, size, created, name, description);
+ }
+
+ public T fromVolumeSnapshot(VolumeSnapshot in) {
+ return this
+ .id(in.getId())
+ .volumeId(in.getVolumeId())
+ .status(in.getStatus())
+ .size(in.getSize())
+ .created(in.getCreated())
+ .name(in.getName())
+ .description(in.getDescription());
+ }
+ }
+
+ private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
+ @Override
+ protected ConcreteBuilder self() {
+ return this;
+ }
+ }
+
+ private final String id;
+ private final String volumeId;
+ private final Volume.Status status;
+ private final int size;
+ @Named("createdAt")
+ private final Date created;
+ @Named("displayName")
+ private final String name;
+ @Named("displayDescription")
+ private final String description;
+
+ @ConstructorProperties({
+ "id", "volumeId", "status", "size", "createdAt", "displayName", "displayDescription"
+ })
+ protected VolumeSnapshot(String id, String volumeId, Volume.Status status, int size, @Nullable Date created, @Nullable String name, @Nullable String description) {
+ this.id = checkNotNull(id, "id");
+ this.volumeId = checkNotNull(volumeId, "volumeId");
+ this.status = checkNotNull(status, "status");
+ this.size = size;
+ this.created = created;
+ this.name = name;
+ this.description = description;
+ }
+
+ /**
+ * @return the id of this snapshot
+ */
+ public String getId() {
+ return this.id;
+ }
+
+ /**
+ * @return the id of the Volume this snapshot was taken from
+ */
+ public String getVolumeId() {
+ return this.volumeId;
+ }
+
+ /**
+ * @return the status of this snapshot
+ */
+ public Volume.Status getStatus() {
+ return this.status;
+ }
+
+ /**
+ * @return the size in GB of the volume this snapshot was taken from
+ */
+ public int getSize() {
+ return this.size;
+ }
+
+ /**
+ * @return the data the snapshot was taken
+ */
+ @Nullable
+ public Date getCreated() {
+ return this.created;
+ }
+
+ /**
+ * @return the name of this snapshot - as displayed in the openstack console
+ */
+ @Nullable
+ public String getName() {
+ return this.name;
+ }
+
+ /**
+ * @return the description of this snapshot - as displayed in the openstack console
+ */
+ @Nullable
+ public String getDescription() {
+ return this.description;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(id, volumeId, status, size, created, name, description);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) return true;
+ if (obj == null || getClass() != obj.getClass()) return false;
+ VolumeSnapshot that = VolumeSnapshot.class.cast(obj);
+ return Objects.equal(this.id, that.id)
+ && Objects.equal(this.volumeId, that.volumeId)
+ && Objects.equal(this.status, that.status)
+ && Objects.equal(this.size, that.size)
+ && Objects.equal(this.created, that.created)
+ && Objects.equal(this.name, that.name)
+ && Objects.equal(this.description, that.description);
+ }
+
+ protected ToStringHelper string() {
+ return Objects.toStringHelper(this)
+ .add("id", id).add("volumeId", volumeId).add("status", status).add("size", size).add("created", created).add("name", name).add("description", description);
+ }
+
+ @Override
+ public String toString() {
+ return string().toString();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/5857efca/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/VolumeType.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/VolumeType.java b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/VolumeType.java
new file mode 100644
index 0000000..43a0aba
--- /dev/null
+++ b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/VolumeType.java
@@ -0,0 +1,192 @@
+/*
+ * 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.openstack.nova.v2_0.domain;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+
+import java.beans.ConstructorProperties;
+import java.util.Date;
+import java.util.Map;
+
+import javax.inject.Named;
+
+import org.jclouds.javax.annotation.Nullable;
+
+import com.google.common.base.Objects;
+import com.google.common.base.Objects.ToStringHelper;
+import com.google.common.base.Optional;
+import com.google.common.collect.ImmutableMap;
+
+/**
+ * Volume Type used in the Volume Type Extension for Nova
+ *
+ * @see org.jclouds.openstack.nova.v2_0.extensions.VolumeTypeApi
+*/
+public class VolumeType {
+
+ public static Builder<?> builder() {
+ return new ConcreteBuilder();
+ }
+
+ public Builder<?> toBuilder() {
+ return new ConcreteBuilder().fromVolumeType(this);
+ }
+
+ public abstract static class Builder<T extends Builder<T>> {
+ protected abstract T self();
+
+ protected String id;
+ protected String name;
+ protected Date created;
+ protected Date updated;
+ protected Map<String, String> extraSpecs = ImmutableMap.of();
+
+ /**
+ * @see VolumeType#getId()
+ */
+ public T id(String id) {
+ this.id = id;
+ return self();
+ }
+
+ /**
+ * @see VolumeType#getName()
+ */
+ public T name(String name) {
+ this.name = name;
+ return self();
+ }
+
+ /**
+ * @see VolumeType#getCreated()
+ */
+ public T created(Date created) {
+ this.created = created;
+ return self();
+ }
+
+ /**
+ * @see VolumeType#getUpdated()
+ */
+ public T updated(Date updated) {
+ this.updated = updated;
+ return self();
+ }
+
+ /**
+ * @see VolumeType#getExtraSpecs()
+ */
+ public T extraSpecs(Map<String, String> extraSpecs) {
+ this.extraSpecs = ImmutableMap.copyOf(checkNotNull(extraSpecs, "extraSpecs"));
+ return self();
+ }
+
+ public VolumeType build() {
+ return new VolumeType(id, name, created, updated, extraSpecs);
+ }
+
+ public T fromVolumeType(VolumeType in) {
+ return this
+ .id(in.getId())
+ .name(in.getName())
+ .created(in.getCreated())
+ .updated(in.getUpdated().orNull())
+ .extraSpecs(in.getExtraSpecs());
+ }
+ }
+
+ private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
+ @Override
+ protected ConcreteBuilder self() {
+ return this;
+ }
+ }
+
+ private final String id;
+ private final String name;
+ @Named("created_at")
+ private final Date created;
+ @Named("updated_at")
+ private final Optional<Date> updated;
+ @Named("extra_specs")
+ private final Map<String, String> extraSpecs;
+
+ @ConstructorProperties({
+ "id", "name", "created_at", "updated_at", "extra_specs"
+ })
+ protected VolumeType(String id, String name, Date created, @Nullable Date updated, Map<String, String> extraSpecs) {
+ this.id = checkNotNull(id, "id");
+ this.name = checkNotNull(name, "name");
+ this.created = checkNotNull(created, "created");
+ this.updated = Optional.fromNullable(updated);
+ this.extraSpecs = ImmutableMap.copyOf(checkNotNull(extraSpecs, "extraSpecs"));
+ }
+
+ public String getId() {
+ return this.id;
+ }
+
+ public String getName() {
+ return this.name;
+ }
+
+ /**
+ * The Date the VolumeType was created
+ */
+ public Date getCreated() {
+ return this.created;
+ }
+
+ /**
+ * The Date the VolumeType as last updated - absent if no updates have taken place
+ */
+ public Optional<Date> getUpdated() {
+ return this.updated;
+ }
+
+ public Map<String, String> getExtraSpecs() {
+ return this.extraSpecs;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(id, name, created, updated, extraSpecs);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) return true;
+ if (obj == null || getClass() != obj.getClass()) return false;
+ VolumeType that = VolumeType.class.cast(obj);
+ return Objects.equal(this.id, that.id)
+ && Objects.equal(this.name, that.name)
+ && Objects.equal(this.created, that.created)
+ && Objects.equal(this.updated, that.updated)
+ && Objects.equal(this.extraSpecs, that.extraSpecs);
+ }
+
+ protected ToStringHelper string() {
+ return Objects.toStringHelper(this)
+ .add("id", id).add("name", name).add("created", created).add("updated", updated).add("extraSpecs", extraSpecs);
+ }
+
+ @Override
+ public String toString() {
+ return string().toString();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/5857efca/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/AvailabilityZone.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/AvailabilityZone.java b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/AvailabilityZone.java
new file mode 100644
index 0000000..6946961
--- /dev/null
+++ b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/AvailabilityZone.java
@@ -0,0 +1,73 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.jclouds.openstack.nova.v2_0.domain.zonescoped;
+
+import com.google.common.base.Objects;
+import com.google.gson.annotations.SerializedName;
+
+import java.beans.ConstructorProperties;
+
+/**
+ * @author Inbar Stolberg
+ */
+public class AvailabilityZone {
+
+ @SerializedName("zoneName")
+ private final String name;
+ private final ZoneState state;
+
+ @ConstructorProperties({"zoneName" , "zoneState"})
+ protected AvailabilityZone(String name, ZoneState state) {
+ this.name = name;
+ this.state = state;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public ZoneState getState() {
+ return state;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(name, state);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this != obj) return false;
+ if (obj == null || getClass() != obj.getClass()) return false;
+ AvailabilityZone that = AvailabilityZone.class.cast(obj);
+ return Objects.equal(this.name, that.name) && Objects.equal(this.state, that.state);
+ }
+
+ protected Objects.ToStringHelper string() {
+ return Objects.toStringHelper(this)
+ .add("name", name)
+ .add("state", state);
+ }
+
+ @Override
+ public String toString() {
+ return string().toString();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/5857efca/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/FlavorInZone.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/FlavorInZone.java b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/FlavorInZone.java
new file mode 100644
index 0000000..5836ac2
--- /dev/null
+++ b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/FlavorInZone.java
@@ -0,0 +1,46 @@
+/*
+ * 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.openstack.nova.v2_0.domain.zonescoped;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+
+import org.jclouds.openstack.nova.v2_0.domain.Flavor;
+
+/**
+ * @author Adrian Cole
+ */
+public class FlavorInZone extends ZoneAndId {
+ protected final Flavor image;
+
+ public FlavorInZone(Flavor image, String zoneId) {
+ super(zoneId, checkNotNull(image, "image").getId());
+ this.image = image;
+ }
+
+ public Flavor getFlavor() {
+ return image;
+ }
+
+ // superclass hashCode/equals are good enough, and help us use ZoneAndId and FlavorInZone
+ // interchangeably as Map keys
+
+ @Override
+ public String toString() {
+ return "[image=" + image + ", zoneId=" + zoneId + "]";
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/5857efca/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/ImageInZone.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/ImageInZone.java b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/ImageInZone.java
new file mode 100644
index 0000000..b7d03f4
--- /dev/null
+++ b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/ImageInZone.java
@@ -0,0 +1,46 @@
+/*
+ * 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.openstack.nova.v2_0.domain.zonescoped;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+
+import org.jclouds.openstack.nova.v2_0.domain.Image;
+
+/**
+ * @author Adrian Cole
+ */
+public class ImageInZone extends ZoneAndId {
+ protected final Image image;
+
+ public ImageInZone(Image image, String zoneId) {
+ super(zoneId, checkNotNull(image, "image").getId());
+ this.image = image;
+ }
+
+ public Image getImage() {
+ return image;
+ }
+
+ // superclass hashCode/equals are good enough, and help us use ZoneAndId and ImageInZone
+ // interchangeably as Map keys
+
+ @Override
+ public String toString() {
+ return "[image=" + image + ", zoneId=" + zoneId + "]";
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/5857efca/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/SecurityGroupInZone.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/SecurityGroupInZone.java b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/SecurityGroupInZone.java
new file mode 100644
index 0000000..28e2b0f
--- /dev/null
+++ b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/SecurityGroupInZone.java
@@ -0,0 +1,46 @@
+/*
+ * 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.openstack.nova.v2_0.domain.zonescoped;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+
+import org.jclouds.openstack.nova.v2_0.domain.SecurityGroup;
+
+/**
+ * @author Adrian Cole
+ */
+public class SecurityGroupInZone extends ZoneAndName {
+ protected final SecurityGroup securityGroup;
+
+ public SecurityGroupInZone(SecurityGroup securityGroup, String zoneId) {
+ super(zoneId, checkNotNull(securityGroup, "securityGroup").getName());
+ this.securityGroup = securityGroup;
+ }
+
+ public SecurityGroup getSecurityGroup() {
+ return securityGroup;
+ }
+
+ // superclass hashCode/equals are good enough, and help us use ZoneAndName and ServerInZone
+ // interchangeably as Map keys
+
+ @Override
+ public String toString() {
+ return "[securityGroup=" + securityGroup + ", zoneId=" + zoneId + "]";
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/5857efca/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/ServerInZone.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/ServerInZone.java b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/ServerInZone.java
new file mode 100644
index 0000000..2249cf7
--- /dev/null
+++ b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/ServerInZone.java
@@ -0,0 +1,46 @@
+/*
+ * 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.openstack.nova.v2_0.domain.zonescoped;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+
+import org.jclouds.openstack.nova.v2_0.domain.Server;
+
+/**
+ * @author Adrian Cole
+ */
+public class ServerInZone extends ZoneAndId {
+ protected final Server server;
+
+ public ServerInZone(Server server, String zoneId) {
+ super(zoneId, checkNotNull(server, "server").getId());
+ this.server = server;
+ }
+
+ public Server getServer() {
+ return server;
+ }
+
+ // superclass hashCode/equals are good enough, and help us use ZoneAndId and ServerInZone
+ // interchangeably as Map keys
+
+ @Override
+ public String toString() {
+ return "[server=" + server + ", zoneId=" + zoneId + "]";
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/5857efca/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/ZoneAndId.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/ZoneAndId.java b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/ZoneAndId.java
new file mode 100644
index 0000000..6c6f0c6
--- /dev/null
+++ b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/ZoneAndId.java
@@ -0,0 +1,86 @@
+/*
+ * 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.openstack.nova.v2_0.domain.zonescoped;
+
+import static com.google.common.base.Preconditions.checkArgument;
+import static com.google.common.base.Preconditions.checkNotNull;
+
+import com.google.common.base.Objects;
+import com.google.common.base.Splitter;
+import com.google.common.collect.Iterables;
+
+/**
+ * @author Adam Lowe
+ */
+public class ZoneAndId {
+ public static ZoneAndId fromSlashEncoded(String id) {
+ Iterable<String> parts = Splitter.on('/').split(checkNotNull(id, "id"));
+ checkArgument(Iterables.size(parts) == 2, "id must be in format zoneId/id");
+ return new ZoneAndId(Iterables.get(parts, 0), Iterables.get(parts, 1));
+ }
+
+ public static ZoneAndId fromZoneAndId(String zoneId, String id) {
+ return new ZoneAndId(zoneId, id);
+ }
+
+ private static String slashEncodeZoneAndId(String zoneId, String id) {
+ return checkNotNull(zoneId, "zoneId") + "/" + checkNotNull(id, "id");
+ }
+
+ public String slashEncode() {
+ return slashEncodeZoneAndId(zoneId, id);
+ }
+
+ protected final String zoneId;
+ protected final String id;
+
+ protected ZoneAndId(String zoneId, String id) {
+ this.zoneId = checkNotNull(zoneId, "zoneId");
+ this.id = checkNotNull(id, "id");
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(zoneId, id);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ ZoneAndId other = (ZoneAndId) obj;
+ return Objects.equal(zoneId, other.zoneId) && Objects.equal(id, other.id);
+ }
+
+ public String getZone() {
+ return zoneId;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ @Override
+ public String toString() {
+ return "[zoneId=" + zoneId + ", id=" + id + "]";
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/5857efca/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/ZoneAndName.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/ZoneAndName.java b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/ZoneAndName.java
new file mode 100644
index 0000000..fdb49e1
--- /dev/null
+++ b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/ZoneAndName.java
@@ -0,0 +1,111 @@
+/*
+ * 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.openstack.nova.v2_0.domain.zonescoped;
+
+import static com.google.common.base.Objects.equal;
+import static com.google.common.base.Preconditions.checkArgument;
+import static com.google.common.base.Preconditions.checkNotNull;
+
+import com.google.common.base.Function;
+import com.google.common.base.Objects;
+import com.google.common.base.Splitter;
+import com.google.common.base.Objects.ToStringHelper;
+import com.google.common.collect.Iterables;
+
+/**
+ * Helpful when looking for resources by zone and name
+ *
+ * @author Adrian Cole
+ */
+public class ZoneAndName {
+
+ public static final Function<ZoneAndName, String> NAME_FUNCTION = new Function<ZoneAndName, String>() {
+
+ @Override
+ public String apply(ZoneAndName input) {
+ return input.getName();
+ }
+
+ };
+
+ public static final Function<ZoneAndName, String> ZONE_FUNCTION = new Function<ZoneAndName, String>() {
+
+ @Override
+ public String apply(ZoneAndName input) {
+ return input.getZone();
+ }
+
+ };
+
+ public static ZoneAndName fromSlashEncoded(String name) {
+ Iterable<String> parts = Splitter.on('/').split(checkNotNull(name, "name"));
+ checkArgument(Iterables.size(parts) == 2, "name must be in format zoneId/name");
+ return new ZoneAndName(Iterables.get(parts, 0), Iterables.get(parts, 1));
+ }
+
+ public static ZoneAndName fromZoneAndName(String zoneId, String name) {
+ return new ZoneAndName(zoneId, name);
+ }
+
+ private static String slashEncodeZoneAndName(String zoneId, String name) {
+ return checkNotNull(zoneId, "zoneId") + "/" + checkNotNull(name, "name");
+ }
+
+ public String slashEncode() {
+ return slashEncodeZoneAndName(zoneId, name);
+ }
+
+ protected final String zoneId;
+ protected final String name;
+
+ protected ZoneAndName(String zoneId, String name) {
+ this.zoneId = checkNotNull(zoneId, "zoneId");
+ this.name = checkNotNull(name, "name");
+ }
+
+ public String getZone() {
+ return zoneId;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o)
+ return true;
+ if (o == null || getClass() != o.getClass())
+ return false;
+ ZoneAndName that = ZoneAndName.class.cast(o);
+ return equal(this.zoneId, that.zoneId) && equal(this.name, that.name);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(zoneId, name);
+ }
+
+ @Override
+ public String toString() {
+ return string().toString();
+ }
+
+ protected ToStringHelper string() {
+ return Objects.toStringHelper("").add("zoneId", zoneId).add("name", name);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/5857efca/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/ZoneSecurityGroupNameAndPorts.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/ZoneSecurityGroupNameAndPorts.java b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/ZoneSecurityGroupNameAndPorts.java
new file mode 100644
index 0000000..4182d91
--- /dev/null
+++ b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/ZoneSecurityGroupNameAndPorts.java
@@ -0,0 +1,62 @@
+/*
+ * 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.openstack.nova.v2_0.domain.zonescoped;
+
+import static com.google.common.base.Objects.equal;
+import static com.google.common.base.Preconditions.checkNotNull;
+
+import java.util.Set;
+
+import com.google.common.base.Objects;
+import com.google.common.base.Objects.ToStringHelper;
+import com.google.common.collect.ImmutableSet;
+
+/**
+ * @author Adrian Cole
+ */
+public class ZoneSecurityGroupNameAndPorts extends ZoneAndName {
+ protected final Set<Integer> ports;
+
+ public ZoneSecurityGroupNameAndPorts(String zoneId, String name, Iterable<Integer> ports) {
+ super(zoneId, name);
+ this.ports = ImmutableSet.<Integer> copyOf(checkNotNull(ports, "ports"));
+ }
+
+ public Set<Integer> getPorts() {
+ return ports;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o)
+ return true;
+ if (o == null || getClass() != o.getClass())
+ return false;
+ ZoneSecurityGroupNameAndPorts that = ZoneSecurityGroupNameAndPorts.class.cast(o);
+ return super.equals(that) && equal(this.ports, that.ports);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(super.hashCode(), ports);
+ }
+
+ @Override
+ public ToStringHelper string() {
+ return super.string().add("ports", ports);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/5857efca/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/ZoneState.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/ZoneState.java b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/ZoneState.java
new file mode 100644
index 0000000..c786095
--- /dev/null
+++ b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/ZoneState.java
@@ -0,0 +1,61 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.jclouds.openstack.nova.v2_0.domain.zonescoped;
+
+import com.google.common.base.Objects;
+
+/**
+ * @author Inbar Stolberg
+ */
+public class ZoneState {
+
+ private final boolean available;
+
+ protected ZoneState(boolean available) {
+ this.available = available;
+ }
+
+ public boolean available() {
+ return this.available;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(available);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this != obj) return false;
+ if (obj == null || getClass() != obj.getClass()) return false;
+ ZoneState that = ZoneState.class.cast(obj);
+ return Objects.equal(this.available, that.available);
+ }
+
+ protected Objects.ToStringHelper string() {
+ return Objects.toStringHelper(this)
+ .add("available", available);
+ }
+
+ @Override
+ public String toString() {
+ return string().toString();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/5857efca/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/AvailabilityZoneAPI.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/AvailabilityZoneAPI.java b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/AvailabilityZoneAPI.java
new file mode 100644
index 0000000..d248681
--- /dev/null
+++ b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/AvailabilityZoneAPI.java
@@ -0,0 +1,40 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.jclouds.openstack.nova.v2_0.extensions;
+
+
+import com.google.common.annotations.Beta;
+import com.google.common.collect.FluentIterable;
+import org.jclouds.openstack.nova.v2_0.domain.zonescoped.AvailabilityZone;
+import org.jclouds.openstack.v2_0.ServiceType;
+import org.jclouds.openstack.v2_0.services.Extension;
+
+/**
+ * @author Inbar Stolberg
+ */
+@Beta
+@Extension(of = ServiceType.COMPUTE, namespace = ExtensionNamespaces.ADMIN_ACTIONS)
+public interface AvailabilityZoneAPI {
+
+ /**
+ * @return all availability zones
+ */
+ FluentIterable<? extends AvailabilityZone> list();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/5857efca/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/AvailabilityZoneAsyncApi.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/AvailabilityZoneAsyncApi.java b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/AvailabilityZoneAsyncApi.java
new file mode 100644
index 0000000..d85f305
--- /dev/null
+++ b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/AvailabilityZoneAsyncApi.java
@@ -0,0 +1,58 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.jclouds.openstack.nova.v2_0.extensions;
+
+
+import com.google.common.annotations.Beta;
+import com.google.common.collect.FluentIterable;
+import com.google.common.util.concurrent.ListenableFuture;
+import org.jclouds.Fallbacks;
+import org.jclouds.openstack.keystone.v2_0.filters.AuthenticateRequest;
+import org.jclouds.openstack.nova.v2_0.domain.zonescoped.AvailabilityZone;
+import org.jclouds.openstack.v2_0.ServiceType;
+import org.jclouds.openstack.v2_0.services.Extension;
+import org.jclouds.rest.annotations.Fallback;
+import org.jclouds.rest.annotations.RequestFilters;
+import org.jclouds.rest.annotations.SelectJson;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.core.MediaType;
+
+/**
+ * @author Inbar Stolberg
+ */
+
+@Beta
+@Extension(of = ServiceType.COMPUTE, namespace = ExtensionNamespaces.ADMIN_ACTIONS)
+@RequestFilters(AuthenticateRequest.class)
+public interface AvailabilityZoneAsyncApi {
+
+ /**
+ * @return all availability zones
+ */
+ @GET
+ @Path("/os-availability-zone")
+ @SelectJson("availabilityZoneInfo")
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Fallback(Fallbacks.EmptyFluentIterableOnNotFoundOr404.class)
+ ListenableFuture<? extends FluentIterable<? extends AvailabilityZone>> list();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/5857efca/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/ExtensionNamespaces.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/ExtensionNamespaces.java b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/ExtensionNamespaces.java
new file mode 100644
index 0000000..a249190
--- /dev/null
+++ b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/ExtensionNamespaces.java
@@ -0,0 +1,110 @@
+/*
+ * 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.openstack.nova.v2_0.extensions;
+
+/**
+ * Extension namespaces
+ *
+ * @author Adrian Cole
+ * @see <a href= "http://nova.openstack.org/api_ext/" />
+ */
+public interface ExtensionNamespaces {
+ /**
+ * Keypair Support
+ */
+ public static final String KEYPAIRS = "http://docs.openstack.org/ext/keypairs/api/v1.1";
+ /**
+ * Volumes support
+ */
+ public static final String VOLUMES = "http://docs.openstack.org/ext/volumes/api/v1.1";
+ /**
+ * Volume types support
+ */
+ public static final String VOLUME_TYPES = "http://docs.openstack.org/ext/volume_types/api/v1.1";
+ /**
+ * Security group support
+ */
+ public static final String SECURITY_GROUPS = "http://docs.openstack.org/ext/securitygroups/api/v1.1";
+ /**
+ * Floating IPs support
+ */
+ public static final String FLOATING_IPS = "http://docs.openstack.org/ext/floating_ips/api/v1.1";
+ /**
+ * Multiple network support
+ */
+ public static final String MULTINIC = "http://docs.openstack.org/ext/multinic/api/v1.1";
+ /**
+ * Host administration
+ */
+ public static final String HOSTS = "http://docs.openstack.org/ext/hosts/api/v1.1";
+ /**
+ * Quotas management support
+ */
+ public static final String QUOTAS = "http://docs.openstack.org/ext/quotas-sets/api/v1.1";
+ /**
+ * Instance type (flavor) extra specs
+ */
+ public static final String FLAVOR_EXTRA_SPECS = "http://docs.openstack.org/ext/flavor_extra_specs/api/v1.1";
+ /**
+ * Provide additional data for flavors
+ */
+ public static final String FLAVOR_EXTRA_DATA = "http://docs.openstack.org/ext/flavor_extra_data/api/v1.1";
+ /**
+ * Virtual interface support
+ */
+ public static final String VIRTUAL_INTERFACES = "http://docs.openstack.org/ext/virtual_interfaces/api/v1.1";
+ /**
+ * Extended support to the Create Server v1.1 API
+ */
+ public static final String CREATESERVEREXT = "http://docs.openstack.org/ext/createserverext/api/v1.1";
+ /**
+ * Virtual Storage Arrays support
+ */
+ public static final String VSA = "http://docs.openstack.org/ext/vsa/api/v1.1";
+ /**
+ * Simple tenant usage extension
+ */
+ public static final String SIMPLE_TENANT_USAGE = "http://docs.openstack.org/ext/os-simple-tenant-usage/api/v1.1";
+ /**
+ * Instance rescue mode
+ */
+ public static final String RESCUE = "http://docs.openstack.org/ext/rescue/api/v1.1";
+ /**
+ * Admin Action extension
+ */
+ public static final String ADMIN_ACTIONS = "http://docs.openstack.org/ext/admin-actions/api/v1.1";
+
+ /**
+ * Extended Server Status extension
+ */
+ public static final String EXTENDED_STATUS = "http://docs.openstack.org/compute/ext/extended_status/api/v1.1";
+
+ /**
+ * Quota Classes extension
+ */
+ public static final String QUOTA_CLASSES = "http://docs.openstack.org/ext/quota-classes-sets/api/v1.1";
+
+ /**
+ * Disk Config extension
+ */
+ public static final String DISK_CONFIG = "http://docs.openstack.org/compute/ext/disk_config/api/v1.1";
+
+ /**
+ * Aggregates extension
+ */
+ public static final String AGGREGATES = "http://docs.openstack.org/ext/aggregates/api/v1.1";
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/5857efca/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/FlavorExtraSpecsApi.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/FlavorExtraSpecsApi.java b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/FlavorExtraSpecsApi.java
new file mode 100644
index 0000000..946463c
--- /dev/null
+++ b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/FlavorExtraSpecsApi.java
@@ -0,0 +1,77 @@
+/*
+ * 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.openstack.nova.v2_0.extensions;
+
+import java.util.Map;
+import org.jclouds.openstack.v2_0.ServiceType;
+import org.jclouds.openstack.v2_0.services.Extension;
+
+import com.google.common.annotations.Beta;
+
+/**
+ * Provide access to extra metadata for Nova flavors.
+ *
+ * @author Adam Lowe
+ * @see <a href="http://nova.openstack.org/api/nova.api.openstack.compute.contrib.flavorextraspecs.html"/>
+ * @see org.jclouds.openstack.nova.v2_0.features.FlavorApi
+ * @see org.jclouds.openstack.nova.v2_0.extensions.FlavorExtraSpecsAsyncApi
+ */
+@Beta
+@Extension(of = ServiceType.COMPUTE, namespace = ExtensionNamespaces.FLAVOR_EXTRA_SPECS)
+public interface FlavorExtraSpecsApi {
+
+ /**
+ * Retrieve all extra specs for a flavor
+ *
+ * @return the set of extra metadata for the flavor
+ */
+ Map<String, String> getMetadata(String flavorId);
+
+ /**
+ * Creates or updates the extra specs for a given flavor
+ *
+ * @param flavorId the id of the flavor to modify
+ * @param specs the extra specs to apply
+ */
+ Boolean updateMetadata(String flavorId, Map<String, String> specs);
+
+ /**
+ * Return a single extra spec value
+ *
+ * @param flavorId the id of the flavor to modify
+ * @param key the extra spec key to retrieve
+ */
+ String getMetadataKey(String flavorId, String key);
+
+ /**
+ * Creates or updates a single extra spec value
+ *
+ * @param flavorId the id of the flavor to modify
+ * @param key the extra spec key (when creating ensure this does not include whitespace or other difficult characters)
+ * @param value the value to associate with the key
+ */
+ Boolean updateMetadataEntry(String flavorId, String key, String value);
+
+ /**
+ * Deletes an extra spec
+ *
+ * @param flavorId the id of the flavor to modify
+ * @param key the extra spec key to delete
+ */
+ Boolean deleteMetadataKey(String flavorId, String key);
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/5857efca/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/FlavorExtraSpecsAsyncApi.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/FlavorExtraSpecsAsyncApi.java b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/FlavorExtraSpecsAsyncApi.java
new file mode 100644
index 0000000..f788e6e
--- /dev/null
+++ b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/FlavorExtraSpecsAsyncApi.java
@@ -0,0 +1,118 @@
+/*
+ * 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.openstack.nova.v2_0.extensions;
+
+import java.util.Map;
+
+import javax.inject.Named;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+
+import org.jclouds.Fallbacks.EmptyMapOnNotFoundOr404;
+import org.jclouds.Fallbacks.FalseOnNotFoundOr404;
+import org.jclouds.Fallbacks.NullOnNotFoundOr404;
+import org.jclouds.openstack.keystone.v2_0.filters.AuthenticateRequest;
+import org.jclouds.openstack.v2_0.ServiceType;
+import org.jclouds.openstack.v2_0.services.Extension;
+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.SelectJson;
+import org.jclouds.rest.annotations.Unwrap;
+import org.jclouds.rest.binders.BindToJsonPayload;
+
+import com.google.common.annotations.Beta;
+import com.google.common.util.concurrent.ListenableFuture;
+
+/**
+ * Provide access to extra metadata for Nova flavors.
+ *
+ * @author Adam Lowe
+ * @see <a href="http://nova.openstack.org/api/nova.api.openstack.compute.contrib.flavorextraspecs.html"/>
+ * @see org.jclouds.openstack.nova.v2_0.features.FlavorApi
+ * @see FlavorExtraSpecsApi
+ */
+@Beta
+@Extension(of = ServiceType.COMPUTE, namespace = ExtensionNamespaces.FLAVOR_EXTRA_SPECS)
+@RequestFilters(AuthenticateRequest.class)
+@Consumes(MediaType.APPLICATION_JSON)
+public interface FlavorExtraSpecsAsyncApi {
+
+ /**
+ * @see FlavorExtraSpecsApi#getMetadata(String)
+ */
+ @Named("flavor:getmetadata")
+ @GET
+ @SelectJson("extra_specs")
+ @Path("/flavors/{flavor_id}/os-extra_specs")
+ @Fallback(EmptyMapOnNotFoundOr404.class)
+ ListenableFuture<Map<String, String>> getMetadata(@PathParam("flavor_id") String flavorId);
+
+ /**
+ * @see FlavorExtraSpecsApi#updateMetadataEntry(String, String, String)
+ */
+ @Named("flavor:updatemetadata")
+ @POST
+ @Path("/flavors/{flavor_id}/os-extra_specs")
+ @Produces(MediaType.APPLICATION_JSON)
+ @Fallback(FalseOnNotFoundOr404.class)
+ @MapBinder(BindToJsonPayload.class)
+ ListenableFuture<Boolean> updateMetadata(@PathParam("flavor_id") String flavorId, @PayloadParam("extra_specs") Map<String, String> specs);
+
+ /**
+ * @see FlavorExtraSpecsApi#getMetadataKey(String, String)
+ */
+ @Named("flavor:getmetadata")
+ @GET
+ @Path("/flavors/{flavor_id}/os-extra_specs/{key}")
+ @Unwrap
+ @Fallback(NullOnNotFoundOr404.class)
+ ListenableFuture<String> getMetadataKey(@PathParam("flavor_id") String flavorId, @PathParam("key") String key);
+
+ /**
+ * @see FlavorExtraSpecsApi#updateMetadataEntry(String, String, String)
+ */
+ @Named("flavor:updatemetadata")
+ @PUT
+ @Path("/flavors/{flavor_id}/os-extra_specs/{key}")
+ @Produces(MediaType.APPLICATION_JSON)
+ @Fallback(FalseOnNotFoundOr404.class)
+ @Payload("%7B\"{key}\":\"{value}\"%7D")
+ ListenableFuture<Boolean> updateMetadataEntry(@PathParam("flavor_id") String flavorId,
+ @PathParam("key") @PayloadParam("key") String key,
+ @PayloadParam("value") String value);
+
+ /**
+ * @see FlavorExtraSpecsApi#deleteMetadataKey(String, String)
+ */
+ @Named("flavor:deletemetadata")
+ @DELETE
+ @Path("/flavors/{flavor_id}/os-extra_specs/{key}")
+ @Fallback(FalseOnNotFoundOr404.class)
+ ListenableFuture<Boolean> deleteMetadataKey(@PathParam("flavor_id") String flavorId,
+ @PathParam("key") String key);
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/5857efca/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/FloatingIPApi.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/FloatingIPApi.java b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/FloatingIPApi.java
new file mode 100644
index 0000000..ddf720f
--- /dev/null
+++ b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/FloatingIPApi.java
@@ -0,0 +1,98 @@
+/*
+ * 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.openstack.nova.v2_0.extensions;
+
+import org.jclouds.openstack.nova.v2_0.domain.FloatingIP;
+import org.jclouds.openstack.v2_0.ServiceType;
+import org.jclouds.openstack.v2_0.services.Extension;
+
+import com.google.common.annotations.Beta;
+import com.google.common.collect.FluentIterable;
+
+/**
+ * Provides synchronous access to Floating IPs.
+ * <p/>
+ *
+ * @see FloatingIPAsyncApi
+ * @author Jeremy Daggett
+ */
+@Beta
+@Extension(of = ServiceType.COMPUTE, namespace = ExtensionNamespaces.FLOATING_IPS)
+public interface FloatingIPApi {
+
+ /**
+ * List all Floating IP addresses
+ *
+ * @return all Floating IPs
+ */
+ FluentIterable<? extends FloatingIP> list();
+
+ /**
+ * Get a specific Floating IP address
+ *
+ * @return all Floating IPs
+ */
+ FloatingIP get(String id);
+
+ /**
+ * Allocate a Floating IP address
+ *
+ * @return a newly created FloatingIP
+ */
+ FloatingIP create();
+
+ /**
+ * Allocate a Floating IP address from a pool
+ *
+ * @param pool
+ * Pool to allocate IP address from
+ * @return a newly created FloatingIP
+ */
+ FloatingIP allocateFromPool(String pool);
+
+ /**
+ * Decreate a Floating IP address
+ *
+ * @param id
+ * the Floating IP id
+ */
+ void delete(String id);
+
+ /**
+ * Add a Floating IP address to a Server
+ *
+ * @param serverId
+ * the serverId
+ * @param address
+ * the IP address to add
+ *
+ * NOTE: Possibly move this to ServerApi?
+ */
+ void addToServer(String address, String serverId);
+
+ /**
+ * Remove a Floating IP address from a Server
+ *
+ * @param serverId
+ * the serverId
+ * @param address
+ * the IP address to remove
+ *
+ * NOTE: Possibly move this to ServerApi?
+ */
+ void removeFromServer(String address, String serverId);
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/5857efca/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/FloatingIPAsyncApi.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/FloatingIPAsyncApi.java b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/FloatingIPAsyncApi.java
new file mode 100644
index 0000000..f6cc543
--- /dev/null
+++ b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/FloatingIPAsyncApi.java
@@ -0,0 +1,145 @@
+/*
+ * 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.openstack.nova.v2_0.extensions;
+
+import javax.inject.Named;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+
+import org.jclouds.Fallbacks.EmptyFluentIterableOnNotFoundOr404;
+import org.jclouds.Fallbacks.NullOnNotFoundOr404;
+import org.jclouds.openstack.keystone.v2_0.filters.AuthenticateRequest;
+import org.jclouds.openstack.nova.v2_0.domain.FloatingIP;
+import org.jclouds.openstack.v2_0.ServiceType;
+import org.jclouds.openstack.v2_0.services.Extension;
+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.SelectJson;
+
+import com.google.common.annotations.Beta;
+import com.google.common.collect.FluentIterable;
+import com.google.common.util.concurrent.ListenableFuture;
+
+/**
+ * Provides asynchronous access to Floating IPs via the REST API.
+ * <p/>
+ *
+ * @see FloatingIPApi
+ * @author Jeremy Daggett
+ * @see ExtensionAsyncApi
+ * @see <a href= "http://docs.openstack.org/api/openstack-compute/2/content/Extensions-d1e1444.html"
+ * />
+ * @see <a href="http://nova.openstack.org/api_ext" />
+ * @see <a href="http://wiki.openstack.org/os_api_floating_ip"/>
+ */
+@Beta
+@Extension(of = ServiceType.COMPUTE, namespace = ExtensionNamespaces.FLOATING_IPS)
+@RequestFilters(AuthenticateRequest.class)
+public interface FloatingIPAsyncApi {
+
+ /**
+ * @see FloatingIPApi#list
+ */
+ @Named("floatingip:list")
+ @GET
+ @Path("/os-floating-ips")
+ @SelectJson("floating_ips")
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Fallback(EmptyFluentIterableOnNotFoundOr404.class)
+ ListenableFuture<? extends FluentIterable<? extends FloatingIP>> list();
+
+ /**
+ * @see FloatingIPApi#get
+ */
+ @Named("floatingip:get")
+ @GET
+ @Path("/os-floating-ips/{id}")
+ @SelectJson("floating_ip")
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Fallback(NullOnNotFoundOr404.class)
+ ListenableFuture<? extends FloatingIP> get(@PathParam("id") String id);
+
+ /**
+ * @see FloatingIPApi#create
+ */
+ @Named("floatingip:create")
+ @POST
+ @Path("/os-floating-ips")
+ @SelectJson("floating_ip")
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Produces(MediaType.APPLICATION_JSON)
+ @Fallback(NullOnNotFoundOr404.class)
+ @Payload("{}")
+ ListenableFuture<? extends FloatingIP> create();
+
+ /**
+ * @see org.jclouds.openstack.nova.v2_0.extensions.FloatingIPApi#allocateFromPool
+ */
+ @Named("floatingip:create")
+ @POST
+ @Path("/os-floating-ips")
+ @SelectJson("floating_ip")
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Produces(MediaType.APPLICATION_JSON)
+ @Fallback(NullOnNotFoundOr404.class)
+ @Payload("%7B\"pool\":\"{pool}\"%7D")
+ ListenableFuture<? extends FloatingIP> allocateFromPool(@PayloadParam("pool") String pool);
+
+
+ /**
+ * @see FloatingIPApi#delete
+ */
+ @Named("floatingip:delete")
+ @DELETE
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Fallback(NullOnNotFoundOr404.class)
+ @Path("/os-floating-ips/{id}")
+ ListenableFuture<Void> delete(@PathParam("id") String id);
+
+ /**
+ * @see FloatingIPApi#addToServer
+ */
+ @Named("floatingip:add")
+ @POST
+ @Path("/servers/{server}/action")
+ @Consumes
+ @Produces(MediaType.APPLICATION_JSON)
+ @Payload("%7B\"addFloatingIp\":%7B\"address\":\"{address}\"%7D%7D")
+ ListenableFuture<Void> addToServer(@PayloadParam("address") String address,
+ @PathParam("server") String serverId);
+
+ /**
+ * @see FloatingIPApi#removeFromServer
+ */
+ @Named("floatingip:remove")
+ @POST
+ @Path("/servers/{server}/action")
+ @Consumes
+ @Produces(MediaType.APPLICATION_JSON)
+ @Payload("%7B\"removeFloatingIp\":%7B\"address\":\"{address}\"%7D%7D")
+ ListenableFuture<Void> removeFromServer(@PayloadParam("address") String address,
+ @PathParam("server") String serverId);
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/5857efca/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/HostAdministrationApi.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/HostAdministrationApi.java b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/HostAdministrationApi.java
new file mode 100644
index 0000000..95b8f42
--- /dev/null
+++ b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/HostAdministrationApi.java
@@ -0,0 +1,103 @@
+/*
+ * 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.openstack.nova.v2_0.extensions;
+
+import org.jclouds.openstack.nova.v2_0.domain.Host;
+import org.jclouds.openstack.nova.v2_0.domain.HostResourceUsage;
+import org.jclouds.openstack.v2_0.ServiceType;
+import org.jclouds.openstack.v2_0.services.Extension;
+
+import com.google.common.annotations.Beta;
+import com.google.common.collect.FluentIterable;
+
+/**
+ * Provides asynchronous access to Host Administration features via the REST API.
+ * <p/>
+ *
+ * @author Adam Lowe
+ * @see HostAdministrationAsyncApi
+ */
+@Beta
+@Extension(of = ServiceType.COMPUTE, namespace = ExtensionNamespaces.HOSTS)
+public interface HostAdministrationApi {
+
+ /**
+ * Returns the list of hosts
+ *
+ * @return the usage information
+ */
+ FluentIterable<? extends Host> list();
+
+ /**
+ * Retrieves the physical/usage resource on a specific host
+ *
+ * @return the usage information
+ */
+ FluentIterable<? extends HostResourceUsage> listResourceUsage(String hostId);
+
+ /**
+ * Allow the specified host to accept new instances.
+ *
+ * @return true if successful
+ */
+ boolean enable(String hostId);
+
+ /**
+ * Prevent the specified host from accepting new instances.
+ *
+ * @return true if successful
+ */
+ boolean disable(String hostId);
+
+ /**
+ * Start host maintenance window.
+ * <p/>
+ * Note: this triggers guest VMs evacuation.
+ *
+ * @return true if successful
+ */
+ boolean startMaintenance(String hostId);
+
+ /**
+ * Stop host maintenance window.
+ *
+ * @return true if successful
+ */
+ boolean stopMaintenance(String hostId);
+
+ /**
+ * Startup a host.
+ *
+ * @return true if successful
+ */
+ boolean startup(String hostId);
+
+ /**
+ * Shutdown a host.
+ *
+ * @return true if successful
+ */
+ boolean shutdown(String hostId);
+
+ /**
+ * Reboot a host.
+ *
+ * @return true if successful
+ */
+ boolean reboot(String hostId);
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/5857efca/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/HostAdministrationAsyncApi.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/HostAdministrationAsyncApi.java b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/HostAdministrationAsyncApi.java
new file mode 100644
index 0000000..cf066c2
--- /dev/null
+++ b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/HostAdministrationAsyncApi.java
@@ -0,0 +1,157 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jclouds.openstack.nova.v2_0.extensions;
+
+import javax.inject.Named;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+
+import org.jclouds.Fallbacks.EmptyFluentIterableOnNotFoundOr404;
+import org.jclouds.openstack.keystone.v2_0.filters.AuthenticateRequest;
+import org.jclouds.openstack.nova.v2_0.domain.Host;
+import org.jclouds.openstack.nova.v2_0.domain.HostResourceUsage;
+import org.jclouds.openstack.nova.v2_0.functions.FieldValueResponseParsers.MaintenanceModeDisabledResponseParser;
+import org.jclouds.openstack.nova.v2_0.functions.FieldValueResponseParsers.MaintenanceModeEnabledResponseParser;
+import org.jclouds.openstack.nova.v2_0.functions.FieldValueResponseParsers.PowerIsRebootResponseParser;
+import org.jclouds.openstack.nova.v2_0.functions.FieldValueResponseParsers.PowerIsShutdownResponseParser;
+import org.jclouds.openstack.nova.v2_0.functions.FieldValueResponseParsers.PowerIsStartupResponseParser;
+import org.jclouds.openstack.nova.v2_0.functions.FieldValueResponseParsers.StatusDisabledResponseParser;
+import org.jclouds.openstack.nova.v2_0.functions.FieldValueResponseParsers.StatusEnabledResponseParser;
+import org.jclouds.openstack.v2_0.ServiceType;
+import org.jclouds.openstack.v2_0.services.Extension;
+import org.jclouds.rest.annotations.Fallback;
+import org.jclouds.rest.annotations.Payload;
+import org.jclouds.rest.annotations.RequestFilters;
+import org.jclouds.rest.annotations.ResponseParser;
+import org.jclouds.rest.annotations.SelectJson;
+
+import com.google.common.annotations.Beta;
+import com.google.common.collect.FluentIterable;
+import com.google.common.util.concurrent.ListenableFuture;
+
+/**
+ * Provides asynchronous access to Host Administration features via the REST API.
+ * <p/>
+ *
+ * @author Adam Lowe
+ * @see HostAdministrationApi
+ * @see <a href= "http://docs.openstack.org/api/openstack-compute/2/content/Extensions-d1e1444.html"/>
+ * @see <a href="http://nova.openstack.org/api_ext" />
+ * @see <a href="http://nova.openstack.org/api/nova.api.openstack.compute.contrib.hosts.html" />
+ */
+@Beta
+@Extension(of = ServiceType.COMPUTE, namespace = ExtensionNamespaces.HOSTS)
+@RequestFilters(AuthenticateRequest.class)
+@Path("/os-hosts")
+@Consumes(MediaType.APPLICATION_JSON)
+public interface HostAdministrationAsyncApi {
+
+ /**
+ * @see HostAdministrationApi#list()
+ */
+ @Named("hostadmin:list")
+ @GET
+ @SelectJson("hosts")
+ @Fallback(EmptyFluentIterableOnNotFoundOr404.class)
+ ListenableFuture<? extends FluentIterable<? extends Host>> list();
+
+ /**
+ * @see HostAdministrationApi#listResourceUsage(String)
+ */
+ @Named("hostadmin:listresource")
+ @GET
+ @Path("/{id}")
+ @SelectJson("host")
+ @Fallback(EmptyFluentIterableOnNotFoundOr404.class)
+ ListenableFuture<? extends FluentIterable<? extends HostResourceUsage>> listResourceUsage(@PathParam("id") String hostId);
+
+ /**
+ * @see HostAdministrationApi#enable(String)
+ */
+ @Named("hostadmin:enable")
+ @PUT
+ @Produces(MediaType.APPLICATION_JSON)
+ @Path("/{id}")
+ @Payload("{\"status\":\"enable\"}")
+ @ResponseParser(StatusEnabledResponseParser.class)
+ ListenableFuture<Boolean> enable(@PathParam("id") String hostId);
+
+ /**
+ * @see HostAdministrationApi#disable(String)
+ */
+ @Named("hostadmin:disable")
+ @PUT
+ @Produces(MediaType.APPLICATION_JSON)
+ @Path("/{id}")
+ @Payload("{\"status\":\"disable\"}")
+ @ResponseParser(StatusDisabledResponseParser.class)
+ ListenableFuture<Boolean> disable(@PathParam("id") String hostId);
+
+ /**
+ * @see HostAdministrationApi#startMaintenance(String)
+ */
+ @Named("hostadmin:startmaintenance")
+ @PUT
+ @Produces(MediaType.APPLICATION_JSON)
+ @Path("/{id}")
+ @Payload("{\"maintenance_mode\":\"enable\"}")
+ @ResponseParser(MaintenanceModeEnabledResponseParser.class)
+ ListenableFuture<Boolean> startMaintenance(@PathParam("id") String hostId);
+
+ /**
+ * @see HostAdministrationApi#stopMaintenance(String)
+ */
+ @Named("hostadmin:stopmaintenance")
+ @PUT
+ @Produces(MediaType.APPLICATION_JSON)
+ @Path("/{id}")
+ @Payload("{\"maintenance_mode\":\"disable\"}")
+ @ResponseParser(MaintenanceModeDisabledResponseParser.class)
+ ListenableFuture<Boolean> stopMaintenance(@PathParam("id") String hostId);
+
+ /**
+ * @see HostAdministrationApi#startup(String)
+ */
+ @Named("hostadmin:startup")
+ @GET
+ @Path("/{id}/startup")
+ @ResponseParser(PowerIsStartupResponseParser.class)
+ ListenableFuture<Boolean> startup(@PathParam("id") String hostId);
+
+ /**
+ * @see HostAdministrationApi#shutdown(String)
+ */
+ @Named("hostadmin:shutdown")
+ @GET
+ @Path("/{id}/shutdown")
+ @ResponseParser(PowerIsShutdownResponseParser.class)
+ ListenableFuture<Boolean> shutdown(@PathParam("id") String hostId);
+
+ /**
+ * @see HostAdministrationApi#reboot(String)
+ */
+ @Named("hostadmin:reboot")
+ @GET
+ @Path("/{id}/reboot")
+ @ResponseParser(PowerIsRebootResponseParser.class)
+ ListenableFuture<Boolean> reboot(@PathParam("id") String hostId);
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/5857efca/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/HostAggregateApi.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/HostAggregateApi.java b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/HostAggregateApi.java
new file mode 100644
index 0000000..a6461aa
--- /dev/null
+++ b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/HostAggregateApi.java
@@ -0,0 +1,87 @@
+/*
+ * 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.openstack.nova.v2_0.extensions;
+
+import java.util.Map;
+import org.jclouds.openstack.nova.v2_0.domain.HostAggregate;
+import org.jclouds.openstack.v2_0.ServiceType;
+import org.jclouds.openstack.v2_0.services.Extension;
+
+import com.google.common.annotations.Beta;
+import com.google.common.collect.FluentIterable;
+
+/**
+ * Provide access to Host Aggregates in Nova (alias "OS-AGGREGATES")
+ *
+ * @author Adam Lowe
+ * @see HostAggregateAsyncApi
+ * @see <a href="http://nova.openstack.org/api_ext/ext_aggregates.html"/>
+ * @see <a href="http://wiki.openstack.org/host-aggregates"/>
+ */
+@Beta
+@Extension(of = ServiceType.COMPUTE, namespace = ExtensionNamespaces.AGGREGATES)
+public interface HostAggregateApi {
+
+ /**
+ * @return the set of host aggregates.
+ */
+ FluentIterable<? extends HostAggregate> list();
+
+ /**
+ * Retrieves the details of an aggregate, hosts and metadata included.
+ *
+ * @return the details of the aggregate requested.
+ */
+ HostAggregate get(String id);
+
+ /**
+ * Creates an aggregate, given its name and availability zone.
+ *
+ * @return the newly created Aggregate
+ */
+ HostAggregate createInAvailabilityZone(String name, String availabilityZone);
+
+ /**
+ * Updates the name of an aggregate.
+ */
+ HostAggregate updateName(String id, String name);
+
+ /**
+ * Updates the availability zone an aggregate.
+ */
+ HostAggregate updateAvailabilityZone(String id, String availabilityZone);
+
+ /**
+ * Removes an aggregate.
+ */
+ Boolean delete(String id);
+
+ /**
+ * Adds a host to an aggregate
+ */
+ HostAggregate addHost(String id, String host);
+
+ /**
+ * Removes a host from an aggregate
+ */
+ HostAggregate removeHost(String id, String host);
+
+ /**
+ * Adds metadata to an aggregate
+ */
+ HostAggregate setMetadata(String id, Map<String, String> metadata);
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/5857efca/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/HostAggregateAsyncApi.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/HostAggregateAsyncApi.java b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/HostAggregateAsyncApi.java
new file mode 100644
index 0000000..1ee3dc7
--- /dev/null
+++ b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/HostAggregateAsyncApi.java
@@ -0,0 +1,161 @@
+/*
+ * 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.openstack.nova.v2_0.extensions;
+
+import java.util.Map;
+
+import javax.inject.Named;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+
+import org.jclouds.Fallbacks.EmptyFluentIterableOnNotFoundOr404;
+import org.jclouds.Fallbacks.FalseOnNotFoundOr404;
+import org.jclouds.Fallbacks.NullOnNotFoundOr404;
+import org.jclouds.openstack.keystone.v2_0.filters.AuthenticateRequest;
+import org.jclouds.openstack.nova.v2_0.domain.HostAggregate;
+import org.jclouds.openstack.v2_0.ServiceType;
+import org.jclouds.openstack.v2_0.services.Extension;
+import org.jclouds.rest.annotations.Fallback;
+import org.jclouds.rest.annotations.PayloadParam;
+import org.jclouds.rest.annotations.RequestFilters;
+import org.jclouds.rest.annotations.SelectJson;
+import org.jclouds.rest.annotations.WrapWith;
+
+import com.google.common.annotations.Beta;
+import com.google.common.collect.FluentIterable;
+import com.google.common.util.concurrent.ListenableFuture;
+
+/**
+ * Provide access to Aggregates in Nova.
+ *
+ * @author Adam Lowe
+ * @see HostAggregateApi
+ */
+@Beta
+@Extension(of = ServiceType.COMPUTE, namespace = ExtensionNamespaces.AGGREGATES)
+@RequestFilters(AuthenticateRequest.class)
+@Path("/os-aggregates")
+public interface HostAggregateAsyncApi {
+
+ /**
+ * @see HostAggregateApi#list()
+ */
+ @Named("hostaggregate:list")
+ @GET
+ @SelectJson("aggregates")
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Fallback(EmptyFluentIterableOnNotFoundOr404.class)
+ ListenableFuture<? extends FluentIterable<? extends HostAggregate>> list();
+
+ /**
+ * @see HostAggregateApi#get(String)
+ */
+ @Named("hostaggregate:get")
+ @GET
+ @Path("/{id}")
+ @SelectJson("aggregate")
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Fallback(NullOnNotFoundOr404.class)
+ ListenableFuture<? extends HostAggregate> get(@PathParam("id") String id);
+
+ /**
+ * @see HostAggregateApi#createInAvailabilityZone(String, String)
+ */
+ @Named("hostaggregate:create")
+ @POST
+ @SelectJson("aggregate")
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Produces(MediaType.APPLICATION_JSON)
+ @WrapWith("aggregate")
+ ListenableFuture<? extends HostAggregate> createInAvailabilityZone(@PayloadParam("name") String name,
+ @PayloadParam("availability_zone") String availabilityZone);
+
+ /**
+ * @see HostAggregateApi#updateName
+ */
+ @Named("hostaggregate:update")
+ @POST
+ @Path("/{id}")
+ @SelectJson("aggregate")
+ @Consumes(MediaType.APPLICATION_JSON)
+ @WrapWith("aggregate")
+ ListenableFuture<? extends HostAggregate> updateName(@PathParam("id") String id, @PayloadParam("name") String name);
+
+ /**
+ * @see HostAggregateApi#updateAvailabilityZone
+ */
+ @Named("hostaggregate:update")
+ @POST
+ @Path("/{id}")
+ @SelectJson("aggregate")
+ @Consumes(MediaType.APPLICATION_JSON)
+ @WrapWith("aggregate")
+ ListenableFuture<? extends HostAggregate> updateAvailabilityZone(@PathParam("id") String id, @PayloadParam("availability_zone") String availabilityZone);
+
+ /**
+ * @see HostAggregateApi#delete(String)
+ */
+ @Named("hostaggregate:delete")
+ @DELETE
+ @Path("/{id}")
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Fallback(FalseOnNotFoundOr404.class)
+ ListenableFuture<Boolean> delete(@PathParam("id") String id);
+
+ /**
+ * @see HostAggregateApi#addHost(String,String)
+ */
+ @Named("hostaggregate:addhost")
+ @POST
+ @Path("/{id}/action")
+ @SelectJson("aggregate")
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Produces(MediaType.APPLICATION_JSON)
+ @WrapWith("add_host")
+ ListenableFuture<? extends HostAggregate> addHost(@PathParam("id") String id, @PayloadParam("host") String host);
+
+
+ /**
+ * @see HostAggregateApi#removeHost(String,String)
+ */
+ @Named("hostaggregate:removehost")
+ @POST
+ @Path("/{id}/action")
+ @SelectJson("aggregate")
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Produces(MediaType.APPLICATION_JSON)
+ @WrapWith("remove_host")
+ ListenableFuture<? extends HostAggregate> removeHost(@PathParam("id") String id, @PayloadParam("host") String host);
+
+ /**
+ * @see HostAggregateApi#setMetadata
+ */
+ @Named("hostaggregate:setmetadata")
+ @POST
+ @Path("/{id}/action")
+ @SelectJson("aggregate")
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Produces(MediaType.APPLICATION_JSON)
+ @WrapWith("set_metadata")
+ ListenableFuture<? extends HostAggregate> setMetadata(@PathParam("id") String id, @PayloadParam("metadata") Map<String, String> metadata);
+}