http://git-wip-us.apache.org/repos/asf/stratos/blob/897edde8/dependencies/jclouds/apis/openstack-neutron/1.8.1-stratos/src/main/java/org/jclouds/openstack/neutron/v2/domain/lbaas/v1/Member.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/openstack-neutron/1.8.1-stratos/src/main/java/org/jclouds/openstack/neutron/v2/domain/lbaas/v1/Member.java b/dependencies/jclouds/apis/openstack-neutron/1.8.1-stratos/src/main/java/org/jclouds/openstack/neutron/v2/domain/lbaas/v1/Member.java deleted file mode 100644 index da53e23..0000000 --- a/dependencies/jclouds/apis/openstack-neutron/1.8.1-stratos/src/main/java/org/jclouds/openstack/neutron/v2/domain/lbaas/v1/Member.java +++ /dev/null @@ -1,367 +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.openstack.neutron.v2.domain.lbaas.v1; - -import java.beans.ConstructorProperties; - -import javax.inject.Named; - -import org.jclouds.javax.annotation.Nullable; - -import com.google.common.base.Objects; - -/** - * A Neutron LBaaS v1 Member. - */ -public class Member { - - // Mandatory attributes when creating - @Named("tenant_id") - private String tenantId; - private String address; - @Named("protocol_port") - private Integer protocolPort; - // Mandatory attributes that can be updated - @Named("pool_id") - private String poolId; - // Optional attributes that can be updated - private Integer weight; - @Named("admin_state_up") - private Boolean adminStateUp; - // Read-only attributes - private String id; - private LBaaSStatus status; - @Named("status_description") - private String statusDescription; - - /** - * Deserialization constructor. - */ - @ConstructorProperties({ "id", "tenant_id", "pool_id", "address", "protocol_port", "weight", "admin_state_up", - "status", "status_description" }) - private Member(String id, String tenantId, String poolId, String address, Integer protocolPort, Integer weight, - Boolean adminStateUp, LBaaSStatus status, String statusDescription) { - this.id = id; - this.tenantId = tenantId; - this.poolId = poolId; - this.address = address; - this.protocolPort = protocolPort; - this.weight = weight; - this.adminStateUp = adminStateUp; - this.status = status; - this.statusDescription = statusDescription; - } - - /** - * Default constructor. - */ - private Member() { - } - - /** - * Copy constructor. - * - * @param member the Member to copy from. - */ - private Member(Member member) { - this(member.id, member.tenantId, member.poolId, member.address, member.protocolPort, member.weight, - member.adminStateUp, member.status, member.statusDescription); - } - - /** - * @return the id of the Member. - */ - @Nullable - public String getId() { - return id; - } - - /** - * @return the tenant id of the Member. - */ - @Nullable - public String getTenantId() { - return tenantId; - } - - /** - * @return the pool id for this Member. - */ - @Nullable - public String getPoolId() { - return poolId; - } - - /** - * @return the address for this Member. - */ - @Nullable - public String getAddress() { - return address; - } - - /** - * @return the protocol port for this Member. - */ - @Nullable - public Integer getProtocolPort() { - return protocolPort; - } - - /** - * @return the weight for this Member. - */ - @Nullable - public Integer getWeight() { - return weight; - } - - /** - * @return the administrative state for this Member. - */ - @Nullable - public Boolean getAdminStateUp() { - return adminStateUp; - } - - /** - * @return the status for this Member. - */ - @Nullable - public LBaaSStatus getStatus() { - return status; - } - - /** - * @return the status description for this Member. - */ - @Nullable - public String getStatusDescription() { - return statusDescription; - } - - @Override - public boolean equals(Object o) { - if (this == o) - return true; - if (o == null || getClass() != o.getClass()) - return false; - - Member that = (Member) o; - - return Objects.equal(this.id, that.id) && Objects.equal(this.tenantId, that.tenantId) - && Objects.equal(this.poolId, that.poolId) && Objects.equal(this.address, that.address) - && Objects.equal(this.protocolPort, that.protocolPort) && Objects.equal(this.weight, that.weight) - && Objects.equal(this.adminStateUp, that.adminStateUp) && Objects.equal(this.status, that.status) - && Objects.equal(this.statusDescription, that.statusDescription); - } - - @Override - public int hashCode() { - return Objects.hashCode(id, tenantId, poolId, address, protocolPort, weight, adminStateUp, status, - statusDescription); - } - - @Override - public String toString() { - return Objects.toStringHelper(this).add("id", id).add("tenantId", tenantId).add("poolId", poolId) - .add("address", address).add("protocolPort", protocolPort).add("weight", weight) - .add("adminStateUp", adminStateUp).add("status", status).add("statusDescription", statusDescription) - .toString(); - } - - /* - * Methods to get the Create and Update builders follow. - */ - - /** - * @return the Builder for creating a new Member. - */ - public static CreateBuilder createBuilder(String poolId, String address, Integer port) { - return new CreateBuilder(poolId, address, port); - } - - /** - * @return the Builder for updating a Member. - */ - public static UpdateBuilder updateBuilder() { - return new UpdateBuilder(); - } - - private abstract static class Builder<ParameterizedBuilderType> { - protected Member member; - - /** - * Default constructor. - */ - private Builder() { - member = new Member(); - } - - protected abstract ParameterizedBuilderType self(); - - /** - * Provides the pool id for this Member's Builder. - * - * @return the Builder. - * @see Member#getPoolId() - */ - public ParameterizedBuilderType poolId(String poolId) { - member.poolId = poolId; - return self(); - } - - /** - * Provides the weight for this Member's Builder. - * - * @return the Builder. - * @see Member#getWeight() - */ - public ParameterizedBuilderType weight(Integer weight) { - member.weight = weight; - return self(); - } - - /** - * Provides the administrative state for this Member's Builder. - * - * @return the Builder. - * @see Member#getAdminStateUp() - */ - public ParameterizedBuilderType adminStateUp(Boolean adminStateUp) { - member.adminStateUp = adminStateUp; - return self(); - } - } - - /** - * Create builder (inheriting from Builder). - */ - public static class CreateBuilder extends Builder<CreateBuilder> { - /** - * Supply required properties for creating a Member's CreateBuilder. - * - * @param poolId the pool id. - * @param address the IP address. - * @param port the protocol port. - */ - private CreateBuilder(String poolId, String address, Integer port) { - poolId(poolId).address(address).protocolPort(port); - } - - /** - * Provides the tenantId for this Member's Builder. Admin-only. - * When keystone is enabled, it is not mandatory to specify tenant_id for resources in create requests, as the - * tenant identifier will be derived from the Authentication token. Please note that the default authorization - * settings only allow administrative users to create resources on behalf of a different tenant. - * - * @return the Builder. - * @see Member#getTenantId() - */ - public CreateBuilder tenantId(String tenantId) { - member.tenantId = tenantId; - return self(); - } - - /** - * Provides the address for this Member's Builder. - * - * @return the Builder. - * @see Member#getAddress() - */ - public CreateBuilder address(String address) { - member.address = address; - return self(); - } - - /** - * Provides the protocol port for this Member's Builder. - * - * @return the Builder. - * @see Member#getProtocolPort() - */ - public CreateBuilder protocolPort(Integer protocolPort) { - member.protocolPort = protocolPort; - return self(); - } - - /** - * @return a CreateMember constructed with this Builder. - */ - public CreateMember build() { - return new CreateMember(member); - } - - @Override - protected CreateBuilder self() { - return this; - } - } - - /** - * Update builder (inheriting from Builder). - */ - public static class UpdateBuilder extends Builder<UpdateBuilder> { - /** - * Supply required properties for creating a Member's UpdateBuilder. - */ - private UpdateBuilder() { - } - - /** - * @return a UpdateMember constructed with this Builder. - */ - public UpdateMember build() { - return new UpdateMember(member); - } - - @Override - protected UpdateBuilder self() { - return this; - } - } - - /** - * Create options - extend the domain class, passed to API create calls. - * Essentially the same as the domain class. Ensure validation and safe typing. - */ - public static class CreateMember extends Member { - /** - * Copy constructor. - * - * @param member the Member to copy from. - */ - private CreateMember(Member member) { - super(member); - } - } - - /** - * Update options - extend the domain class, passed to API update calls. - * Essentially the same as the domain class. Ensure validation and safe typing. - */ - public static class UpdateMember extends Member { - /** - * Copy constructor. - * - * @param member the Member to copy from. - */ - private UpdateMember(Member member) { - super(member); - } - } -}
http://git-wip-us.apache.org/repos/asf/stratos/blob/897edde8/dependencies/jclouds/apis/openstack-neutron/1.8.1-stratos/src/main/java/org/jclouds/openstack/neutron/v2/domain/lbaas/v1/Members.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/openstack-neutron/1.8.1-stratos/src/main/java/org/jclouds/openstack/neutron/v2/domain/lbaas/v1/Members.java b/dependencies/jclouds/apis/openstack-neutron/1.8.1-stratos/src/main/java/org/jclouds/openstack/neutron/v2/domain/lbaas/v1/Members.java deleted file mode 100644 index 74a464d..0000000 --- a/dependencies/jclouds/apis/openstack-neutron/1.8.1-stratos/src/main/java/org/jclouds/openstack/neutron/v2/domain/lbaas/v1/Members.java +++ /dev/null @@ -1,36 +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.openstack.neutron.v2.domain.lbaas.v1; - -import java.beans.ConstructorProperties; - -import org.jclouds.openstack.v2_0.domain.Link; -import org.jclouds.openstack.v2_0.domain.PaginatedCollection; - -import com.google.common.collect.ImmutableSet; - -/** - * A collection of of Neutron LBaaS v1 Members. - */ -public class Members extends PaginatedCollection<Member> { - public static final Members EMPTY = new Members(ImmutableSet.<Member> of(), ImmutableSet.<Link> of()); - - @ConstructorProperties({ "members", "members_links" }) - protected Members(Iterable<Member> members, Iterable<Link> membersLinks) { - super(members, membersLinks); - } -} http://git-wip-us.apache.org/repos/asf/stratos/blob/897edde8/dependencies/jclouds/apis/openstack-neutron/1.8.1-stratos/src/main/java/org/jclouds/openstack/neutron/v2/domain/lbaas/v1/Pool.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/openstack-neutron/1.8.1-stratos/src/main/java/org/jclouds/openstack/neutron/v2/domain/lbaas/v1/Pool.java b/dependencies/jclouds/apis/openstack-neutron/1.8.1-stratos/src/main/java/org/jclouds/openstack/neutron/v2/domain/lbaas/v1/Pool.java deleted file mode 100644 index c1aa88d..0000000 --- a/dependencies/jclouds/apis/openstack-neutron/1.8.1-stratos/src/main/java/org/jclouds/openstack/neutron/v2/domain/lbaas/v1/Pool.java +++ /dev/null @@ -1,481 +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.openstack.neutron.v2.domain.lbaas.v1; - -import java.beans.ConstructorProperties; - -import javax.inject.Named; - -import org.jclouds.javax.annotation.Nullable; - -import com.google.common.base.Objects; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableSet; - -/** - * A Neutron LBaaS v1 Pool. - */ -public class Pool { - - // Load balancing methods that must be supported by all providers. - // Not an enum type because any provider may support additional balancing methods. - public static String ROUND_ROBIN = "ROUND_ROBIN"; - public static String LEAST_CONNECTIONS = "LEAST_CONNECTIONS"; - public static String SOURCE_IP = "SOURCE_IP"; - - // Mandatory attributes when creating - @Named("tenant_id") - private String tenantId; - @Named("subnet_id") - private String subnetId; - private Protocol protocol; - // Mandatory attributes that can be updated - @Named("lb_method") - private String lbMethod; - // Optional attributes when creating - private String provider; - // Optional attributes that can be updated - private String name; - private String description; - @Named("health_monitors") - private ImmutableSet<String> healthMonitors; - @Named("admin_state_up") - private Boolean adminStateUp; - // Read-only attributes - private String id; - @Named("vip_id") - private String vipId; - private ImmutableSet<String> members; - @Named("health_monitors_status") - private ImmutableList<HealthMonitorStatus> healthMonitorsStatus; - private LBaaSStatus status; - @Named("status_description") - private String statusDescription; - - /** - * Deserialization constructor. - */ - @ConstructorProperties({ "id", "tenant_id", "vip_id", "name", "description", "subnet_id", "protocol", "provider", - "lb_method", "health_monitors", "health_monitors_status", "members", "admin_state_up", "status", - "status_description" }) - private Pool(String id, String tenantId, String vipId, String name, String description, String subnetId, - Protocol protocol, String provider, String lbMethod, ImmutableSet<String> healthMonitors, - ImmutableList<HealthMonitorStatus> healthMonitorsStatus, ImmutableSet<String> members, Boolean adminStateUp, - LBaaSStatus status, String statusDescription) { - this.id = id; - this.tenantId = tenantId; - this.vipId = vipId; - this.name = name; - this.description = description; - this.subnetId = subnetId; - this.protocol = protocol; - this.provider = provider; - this.lbMethod = lbMethod; - this.healthMonitors = healthMonitors; - this.healthMonitorsStatus = healthMonitorsStatus; - this.members = members; - this.adminStateUp = adminStateUp; - this.status = status; - this.statusDescription = statusDescription; - } - - /** - * Default constructor. - */ - private Pool() { - } - - /** - * Copy constructor. - * - * @param pool the Pool to copy from. - */ - private Pool(Pool pool) { - this(pool.id, pool.tenantId, pool.vipId, pool.name, pool.description, pool.subnetId, pool.protocol, - pool.provider, pool.lbMethod, pool.healthMonitors, pool.healthMonitorsStatus, pool.members, - pool.adminStateUp, pool.status, pool.statusDescription); - } - - /** - * @return the id of the Pool. - */ - @Nullable - public String getId() { - return id; - } - - /** - * @return the tenant id of the Pool. - */ - @Nullable - public String getTenantId() { - return tenantId; - } - - /** - * @return the virtual IP id of the Pool. - */ - @Nullable - public String getVIPId() { - return vipId; - } - - /** - * @return the name of the Pool. - */ - @Nullable - public String getName() { - return name; - } - - /** - * @return the description of the Pool. - */ - @Nullable - public String getDescription() { - return description; - } - - /** - * @return the subnet id for this Pool. - */ - @Nullable - public String getSubnetId() { - return subnetId; - } - - /** - * @return the protocol for this Pool. - */ - @Nullable - public Protocol getProtocol() { - return protocol; - } - - /** - * @return the provider for this Pool. - */ - @Nullable - public String getProvider() { - return provider; - } - - /** - * @return the load balancing method for this Pool. - */ - @Nullable - public String getLBMethod() { - return lbMethod; - } - - /** - * @return the health monitors for this Pool. - */ - @Nullable - public ImmutableSet<String> getHealthMonitors() { - return healthMonitors; - } - - /** - * @return the health monitors status for this Pool. - */ - @Nullable - public ImmutableList<HealthMonitorStatus> getHealthMonitorsStatus() { - return healthMonitorsStatus; - } - - /** - * @return the members for this Pool. - */ - @Nullable - public ImmutableSet<String> getMembers() { - return members; - } - - /** - * @return the administrative state for this Pool. - */ - @Nullable - public Boolean getAdminStateUp() { - return adminStateUp; - } - - /** - * @return the status for this Pool. - */ - @Nullable - public LBaaSStatus getStatus() { - return status; - } - - /** - * @return the status description for this Pool. - */ - @Nullable - public String getStatusDescription() { - return statusDescription; - } - - @Override - public boolean equals(Object o) { - if (this == o) - return true; - if (o == null || getClass() != o.getClass()) - return false; - - Pool that = (Pool) o; - - return Objects.equal(this.id, that.id) && Objects.equal(this.tenantId, that.tenantId) - && Objects.equal(this.vipId, that.vipId) && Objects.equal(this.name, that.name) - && Objects.equal(this.description, that.description) && Objects.equal(this.subnetId, that.subnetId) - && Objects.equal(this.protocol, that.protocol) && Objects.equal(this.provider, that.provider) - && Objects.equal(this.lbMethod, that.lbMethod) && Objects.equal(this.healthMonitors, that.healthMonitors) - && Objects.equal(this.healthMonitorsStatus, that.healthMonitorsStatus) - && Objects.equal(this.members, that.members) && Objects.equal(this.adminStateUp, that.adminStateUp) - && Objects.equal(this.status, that.status) && Objects.equal(this.statusDescription, that.statusDescription); - } - - @Override - public int hashCode() { - return Objects.hashCode(id, tenantId, vipId, name, description, subnetId, protocol, provider, lbMethod, - healthMonitors, healthMonitorsStatus, members, adminStateUp, status, statusDescription); - } - - @Override - public String toString() { - return Objects.toStringHelper(this).add("id", id).add("tenantId", tenantId).add("vipId", vipId) - .add("name", name).add("description", description).add("subnetId", subnetId).add("protocol", protocol) - .add("provider", provider).add("lbMethod", lbMethod).add("healthMonitors", healthMonitors) - .add("healthMonitorsStatus", healthMonitorsStatus).add("members", members) - .add("adminStateUp", adminStateUp).add("status", status).add("statusDescription", statusDescription) - .toString(); - } - - /* - * Methods to get the Create and Update builders follow. - */ - - /** - * @return the Builder for creating a new Pool. - */ - public static CreateBuilder createBuilder(String subnetId, Protocol protocol, String lbMethod) { - return new CreateBuilder(subnetId, protocol, lbMethod); - } - - /** - * @return the Builder for updating a Pool. - */ - public static UpdateBuilder updateBuilder() { - return new UpdateBuilder(); - } - - private abstract static class Builder<ParameterizedBuilderType> { - protected Pool pool; - - /** - * Default constructor. - */ - private Builder() { - pool = new Pool(); - } - - protected abstract ParameterizedBuilderType self(); - - /** - * Provides the name for this Pool's Builder. - * - * @return the Builder. - * @see Pool#getName() - */ - public ParameterizedBuilderType name(String name) { - pool.name = name; - return self(); - } - - /** - * Provides the description for this Pool's Builder. - * - * @return the Builder. - * @see Pool#getDescription() - */ - public ParameterizedBuilderType description(String description) { - pool.description = description; - return self(); - } - - /** - * Provides the load balancing method for this Pool's Builder. - * - * @return the Builder. - * @see Pool#getLBMethod() - */ - public ParameterizedBuilderType lbMethod(String lbMethod) { - pool.lbMethod = lbMethod; - return self(); - } - - /** - * Provides the health monitors for this Pool's Builder. - * - * @return the Builder. - * @see Pool#getHealthMonitors() - */ - public ParameterizedBuilderType healthMonitors(ImmutableSet<String> healthMonitors) { - pool.healthMonitors = healthMonitors; - return self(); - } - - /** - * Provides the administrative state for this Pool's Builder. - * - * @return the Builder. - * @see Pool#getAdminStateUp() - */ - public ParameterizedBuilderType adminStateUp(Boolean adminStateUp) { - pool.adminStateUp = adminStateUp; - return self(); - } - } - - /** - * Create builder (inheriting from Builder). - */ - public static class CreateBuilder extends Builder<CreateBuilder> { - /** - * Supply required properties for creating a Pool's CreateBuilder. - * - * @param subnetId the subnet id. - * @param protocol the protocol. - * @param lbMethod the load balancing method. - */ - private CreateBuilder(String subnetId, Protocol protocol, String lbMethod) { - subnetId(subnetId).protocol(protocol).lbMethod(lbMethod); - } - - /** - * Provides the tenantId for this Pool's Builder. Admin-only. - * When keystone is enabled, it is not mandatory to specify tenant_id for resources in create requests, as the - * tenant identifier will be derived from the Authentication token. Please note that the default authorization - * settings only allow administrative users to create resources on behalf of a different tenant. - * - * @return the Builder. - * @see Pool#getTenantId() - */ - public CreateBuilder tenantId(String tenantId) { - pool.tenantId = tenantId; - return self(); - } - - /** - * Provides the subnet id for this Pool's Builder. - * - * @return the Builder. - * @see Pool#getSubnetId() - */ - public CreateBuilder subnetId(String subnetId) { - pool.subnetId = subnetId; - return self(); - } - - /** - * Provides the protocol for this Pool's Builder. - * - * @return the Builder. - * @see Pool#getProtocol() - */ - public CreateBuilder protocol(Protocol protocol) { - pool.protocol = protocol; - return self(); - } - - /** - * Provides the provider for this Pool's Builder. - * - * @return the Builder. - * @see Pool#getProvider() - */ - public CreateBuilder provider(String provider) { - pool.provider = provider; - return self(); - } - - /** - * @return a CreatePool constructed with this Builder. - */ - public CreatePool build() { - return new CreatePool(pool); - } - - @Override - protected CreateBuilder self() { - return this; - } - } - - /** - * Update builder (inheriting from Builder). - */ - public static class UpdateBuilder extends Builder<UpdateBuilder> { - /** - * Supply required properties for creating a Pool's UpdateBuilder. - */ - private UpdateBuilder() { - } - - /** - * @return a UpdatePool constructed with this Builder. - */ - public UpdatePool build() { - return new UpdatePool(pool); - } - - @Override - protected UpdateBuilder self() { - return this; - } - } - - /** - * Create options - extend the domain class, passed to API create calls. - * Essentially the same as the domain class. Ensure validation and safe typing. - */ - public static class CreatePool extends Pool { - /** - * Copy constructor. - * - * @param pool the Pool to copy from. - */ - private CreatePool(Pool pool) { - super(pool); - } - } - - /** - * Update options - extend the domain class, passed to API update calls. - * Essentially the same as the domain class. Ensure validation and safe typing. - */ - public static class UpdatePool extends Pool { - /** - * Copy constructor. - * - * @param pool the Pool to copy from. - */ - private UpdatePool(Pool pool) { - super(pool); - } - } -} http://git-wip-us.apache.org/repos/asf/stratos/blob/897edde8/dependencies/jclouds/apis/openstack-neutron/1.8.1-stratos/src/main/java/org/jclouds/openstack/neutron/v2/domain/lbaas/v1/PoolStatus.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/openstack-neutron/1.8.1-stratos/src/main/java/org/jclouds/openstack/neutron/v2/domain/lbaas/v1/PoolStatus.java b/dependencies/jclouds/apis/openstack-neutron/1.8.1-stratos/src/main/java/org/jclouds/openstack/neutron/v2/domain/lbaas/v1/PoolStatus.java deleted file mode 100644 index 869eb81..0000000 --- a/dependencies/jclouds/apis/openstack-neutron/1.8.1-stratos/src/main/java/org/jclouds/openstack/neutron/v2/domain/lbaas/v1/PoolStatus.java +++ /dev/null @@ -1,100 +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.openstack.neutron.v2.domain.lbaas.v1; - -import java.beans.ConstructorProperties; - -import javax.inject.Named; - -import org.jclouds.javax.annotation.Nullable; - -import com.google.common.base.Objects; - -/** - * A Neutron LBaaS v1 PoolStatus. - * Contains an id and status describing the pool's status. - * - * @see HealthMonitor#getPools() - */ -public class PoolStatus { - - // Mandatory attributes - @Named("pool_id") - protected final String id; - protected final LBaaSStatus status; - // Optional attributes - @Named("status_description") - protected final String statusDescription; - - @ConstructorProperties({ "pool_id", "status", "status_description" }) - protected PoolStatus(String id, LBaaSStatus status, String statusDescription) { - this.id = id; - this.status = status; - this.statusDescription = statusDescription; - } - - /** - * @return the id of the PoolStatus. - */ - @Nullable - public String getId() { - return id; - } - - /** - * @return the status of the PoolStatus. - */ - @Nullable - public LBaaSStatus getStatus() { - return status; - } - - /** - * @return the status description of the PoolStatus. - */ - @Nullable - public String getStatusDescription() { - return statusDescription; - } - - @Override - public int hashCode() { - return Objects.hashCode(id, status, statusDescription); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) - return true; - if (obj == null || getClass() != obj.getClass()) - return false; - PoolStatus that = PoolStatus.class.cast(obj); - return Objects.equal(this.id, that.id) && Objects.equal(this.status, that.status) - && Objects.equal(this.statusDescription, that.statusDescription); - } - - protected Objects.ToStringHelper string() { - return Objects.toStringHelper(this).add("id", id).add("status", status) - .add("statusDescription", statusDescription); - } - - @Override - public String toString() { - return string().toString(); - } - -} http://git-wip-us.apache.org/repos/asf/stratos/blob/897edde8/dependencies/jclouds/apis/openstack-neutron/1.8.1-stratos/src/main/java/org/jclouds/openstack/neutron/v2/domain/lbaas/v1/Pools.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/openstack-neutron/1.8.1-stratos/src/main/java/org/jclouds/openstack/neutron/v2/domain/lbaas/v1/Pools.java b/dependencies/jclouds/apis/openstack-neutron/1.8.1-stratos/src/main/java/org/jclouds/openstack/neutron/v2/domain/lbaas/v1/Pools.java deleted file mode 100644 index c30bc13..0000000 --- a/dependencies/jclouds/apis/openstack-neutron/1.8.1-stratos/src/main/java/org/jclouds/openstack/neutron/v2/domain/lbaas/v1/Pools.java +++ /dev/null @@ -1,36 +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.openstack.neutron.v2.domain.lbaas.v1; - -import java.beans.ConstructorProperties; - -import org.jclouds.openstack.v2_0.domain.Link; -import org.jclouds.openstack.v2_0.domain.PaginatedCollection; - -import com.google.common.collect.ImmutableSet; - -/** - * A collection of of Neutron LBaaS v1 Pools. - */ -public class Pools extends PaginatedCollection<Pool> { - public static final Pools EMPTY = new Pools(ImmutableSet.<Pool> of(), ImmutableSet.<Link> of()); - - @ConstructorProperties({ "pools", "pools_links" }) - protected Pools(Iterable<Pool> pools, Iterable<Link> poolsLinks) { - super(pools, poolsLinks); - } -} http://git-wip-us.apache.org/repos/asf/stratos/blob/897edde8/dependencies/jclouds/apis/openstack-neutron/1.8.1-stratos/src/main/java/org/jclouds/openstack/neutron/v2/domain/lbaas/v1/ProbeType.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/openstack-neutron/1.8.1-stratos/src/main/java/org/jclouds/openstack/neutron/v2/domain/lbaas/v1/ProbeType.java b/dependencies/jclouds/apis/openstack-neutron/1.8.1-stratos/src/main/java/org/jclouds/openstack/neutron/v2/domain/lbaas/v1/ProbeType.java deleted file mode 100644 index fb5d565..0000000 --- a/dependencies/jclouds/apis/openstack-neutron/1.8.1-stratos/src/main/java/org/jclouds/openstack/neutron/v2/domain/lbaas/v1/ProbeType.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.openstack.neutron.v2.domain.lbaas.v1; - -/** - * Enumerates supported types of probe sent by health monitor to verify member state. - */ -public enum ProbeType { - /** - * Health monitor pings the members by using ICMP. - */ - PING("PING"), - /** - * Health monitor connects to the members by using TCP. - */ - TCP("TCP"), - /** - * Health monitor sends an HTTP request to the member. - */ - HTTP("HTTP"), - /** - * Health monitor sends a secure HTTP request to the member. - */ - HTTPS("HTTPS"), - /** - * Used by jclouds when the service returns an unknown value other than null. - */ - UNRECOGNIZED("unrecognized"); - - private String name; - - private ProbeType(String name) { - this.name = name; - } - - @Override - public String toString() { - return name; - } - - /* - * This provides GSON enum support in jclouds. - * */ - public static ProbeType fromValue(String name){ - if (name != null) { - for (ProbeType value : ProbeType.values()) { - if (name.equalsIgnoreCase(value.name)) { - return value; - } - } - return UNRECOGNIZED; - } - return null; - } -} http://git-wip-us.apache.org/repos/asf/stratos/blob/897edde8/dependencies/jclouds/apis/openstack-neutron/1.8.1-stratos/src/main/java/org/jclouds/openstack/neutron/v2/domain/lbaas/v1/Protocol.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/openstack-neutron/1.8.1-stratos/src/main/java/org/jclouds/openstack/neutron/v2/domain/lbaas/v1/Protocol.java b/dependencies/jclouds/apis/openstack-neutron/1.8.1-stratos/src/main/java/org/jclouds/openstack/neutron/v2/domain/lbaas/v1/Protocol.java deleted file mode 100644 index e353863..0000000 --- a/dependencies/jclouds/apis/openstack-neutron/1.8.1-stratos/src/main/java/org/jclouds/openstack/neutron/v2/domain/lbaas/v1/Protocol.java +++ /dev/null @@ -1,67 +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.openstack.neutron.v2.domain.lbaas.v1; - -/** - * Enumerates supported protocols. - * Protocol must be specified for the front-end (see {@link VIP}) and for the back-end instances (see {@link Pool}). - */ -public enum Protocol { - /** - * Use TCP for routing traffic. - */ - TCP("TCP"), - /** - * Use HTTP for routing traffic. - */ - HTTP("HTTP"), - /** - * Use HTTPS for routing traffic. - */ - HTTPS("HTTPS"), - /** - * Used by jclouds when the service returns an unknown value other than null. - */ - UNRECOGNIZED("unrecognized"); - - private String name; - - private Protocol(String name) { - this.name = name; - } - - @Override - public String toString() { - return name; - } - - /* - * This provides GSON enum support in jclouds. - * */ - public static Protocol fromValue(String name){ - if (name != null) { - for (Protocol value : Protocol.values()) { - if (name.equalsIgnoreCase(value.name)) { - return value; - } - } - return UNRECOGNIZED; - } - return null; - } -} http://git-wip-us.apache.org/repos/asf/stratos/blob/897edde8/dependencies/jclouds/apis/openstack-neutron/1.8.1-stratos/src/main/java/org/jclouds/openstack/neutron/v2/domain/lbaas/v1/SessionPersistence.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/openstack-neutron/1.8.1-stratos/src/main/java/org/jclouds/openstack/neutron/v2/domain/lbaas/v1/SessionPersistence.java b/dependencies/jclouds/apis/openstack-neutron/1.8.1-stratos/src/main/java/org/jclouds/openstack/neutron/v2/domain/lbaas/v1/SessionPersistence.java deleted file mode 100644 index b1c49dd..0000000 --- a/dependencies/jclouds/apis/openstack-neutron/1.8.1-stratos/src/main/java/org/jclouds/openstack/neutron/v2/domain/lbaas/v1/SessionPersistence.java +++ /dev/null @@ -1,182 +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.openstack.neutron.v2.domain.lbaas.v1; - -import java.beans.ConstructorProperties; - -import javax.inject.Named; - -import org.jclouds.javax.annotation.Nullable; - -import com.google.common.base.Objects; - -/** - * A Neutron LBaaS v1 SessionPersistence. - * Contains a type and cookie name describing the session persistence. - */ -public class SessionPersistence { - - // Mandatory attributes - protected final Type type; - // Optional attributes - @Named("cookie_name") - protected final String cookieName; - - @ConstructorProperties({ "type", "cookie_name" }) - protected SessionPersistence(Type type, String cookieName) { - this.type = type; - this.cookieName = cookieName; - } - - /** - * @return the type of the SessionPersistence. - */ - @Nullable - public Type getType() { - return type; - } - - /** - * @return the cookie name of the SessionPersistence. - */ - @Nullable - public String getCookieName() { - return cookieName; - } - - @Override - public int hashCode() { - return Objects.hashCode(type, cookieName); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) - return true; - if (obj == null || getClass() != obj.getClass()) - return false; - SessionPersistence that = SessionPersistence.class.cast(obj); - return Objects.equal(this.type, that.type) && Objects.equal(this.cookieName, that.cookieName); - } - - protected Objects.ToStringHelper string() { - return Objects.toStringHelper(this).add("type", type).add("cookieName", cookieName); - } - - @Override - public String toString() { - return string().toString(); - } - - /* - * Methods to get the builder follow. - */ - - /** - * @return the Builder for SessionPersistence. - */ - public static Builder builder() { - return new Builder(); - } - - /** - * Builder. - */ - public static class Builder { - protected Type type; - protected String cookieName; - - /** - * Provides the type to the SessionPersistence's Builder. - * - * @return the Builder. - * @see SessionPersistence#getType() - */ - public Builder type(Type type) { - this.type = type; - return this; - } - - /** - * Provides the cookie name to the SessionPersistence's Builder. - * - * @return the Builder. - * @see SessionPersistence#getCookieName() - */ - public Builder cookieName(String cookieName) { - this.cookieName = cookieName; - return this; - } - - /** - * @return a SessionPersistence constructed with this Builder. - */ - public SessionPersistence build() { - return new SessionPersistence(type, cookieName); - } - } - - /** - * Enumerates supported SessionPersistence types. - */ - public static enum Type { - /** - * All connections that originate from the same source IP address are handled by the same member of the pool. - */ - SOURCE_IP("SOURCE_IP"), - /** - * The load balancing function creates a cookie on the first request from a client. Subsequent requests that - * contain the same cookie value are handled by the same member of the pool. - */ - HTTP_COOKIE("HTTP_COOKIE"), - /** - * The load balancing function relies on a cookie established by the back-end application. All requests with the - * same cookie value are handled by the same member of the pool. - */ - APP_COOKIE("APP_COOKIE"), - /** - * Used by jclouds when the service returns an unknown value other than null. - */ - UNRECOGNIZED("unrecognized"); - - private String name; - - private Type(String name) { - this.name = name; - } - - @Override - public String toString() { - return name; - } - - /* - * This provides GSON enum support in jclouds. - * */ - public static Type fromValue(String name){ - if (name != null) { - for (Type value : Type.values()) { - if (name.equalsIgnoreCase(value.name)) { - return value; - } - } - return UNRECOGNIZED; - } - return null; - } - } -} http://git-wip-us.apache.org/repos/asf/stratos/blob/897edde8/dependencies/jclouds/apis/openstack-neutron/1.8.1-stratos/src/main/java/org/jclouds/openstack/neutron/v2/domain/lbaas/v1/VIP.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/openstack-neutron/1.8.1-stratos/src/main/java/org/jclouds/openstack/neutron/v2/domain/lbaas/v1/VIP.java b/dependencies/jclouds/apis/openstack-neutron/1.8.1-stratos/src/main/java/org/jclouds/openstack/neutron/v2/domain/lbaas/v1/VIP.java deleted file mode 100644 index ae62625..0000000 --- a/dependencies/jclouds/apis/openstack-neutron/1.8.1-stratos/src/main/java/org/jclouds/openstack/neutron/v2/domain/lbaas/v1/VIP.java +++ /dev/null @@ -1,492 +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.openstack.neutron.v2.domain.lbaas.v1; - -import java.beans.ConstructorProperties; - -import javax.inject.Named; - -import org.jclouds.javax.annotation.Nullable; - -import com.google.common.base.Objects; - -/** - * A Neutron LBaaS v1 VIP. - */ -public class VIP { - - // Mandatory attributes when creating - @Named("tenant_id") - private String tenantId; - @Named("subnet_id") - private String subnetId; - private Protocol protocol; - @Named("protocol_port") - private Integer protocolPort; - // Mandatory attributes that can be updated - @Named("pool_id") - private String poolId; - // Optional attributes when creating - private String address; - // Optional attributes that can be updated - private String name; - private String description; - @Named("session_persistence") - private SessionPersistence sessionPersistence; - @Named("connection_limit") - private Integer connectionLimit; - @Named("admin_state_up") - private Boolean adminStateUp; - // Read-only attributes - private String id; - @Named("port_id") - private String portId; - private LBaaSStatus status; - @Named("status_description") - private String statusDescription; - - /** - * Deserialization constructor. - */ - @ConstructorProperties({ "id", "tenant_id", "name", "description", "subnet_id", "address", "port_id", "protocol", - "protocol_port", "pool_id", "session_persistence", "connection_limit", "admin_state_up", "status", - "status_description" }) - private VIP(String id, String tenantId, String name, String description, String subnetId, String address, - String portId, Protocol protocol, Integer protocolPort, String poolId, SessionPersistence sessionPersistence, - Integer connectionLimit, Boolean adminStateUp, LBaaSStatus status, String statusDescription) { - this.id = id; - this.tenantId = tenantId; - this.name = name; - this.description = description; - this.subnetId = subnetId; - this.address = address; - this.portId = portId; - this.protocol = protocol; - this.protocolPort = protocolPort; - this.poolId = poolId; - this.sessionPersistence = sessionPersistence; - this.connectionLimit = connectionLimit; - this.adminStateUp = adminStateUp; - this.status = status; - this.statusDescription = statusDescription; - } - - /** - * Default constructor. - */ - private VIP() { - } - - /** - * Copy constructor. - * - * @param VIP the VIP to copy from. - */ - private VIP(VIP vip) { - this(vip.id, vip.tenantId, vip.name, vip.description, vip.subnetId, vip.address, vip.portId, vip.protocol, - vip.protocolPort, vip.poolId, vip.sessionPersistence, vip.connectionLimit, vip.adminStateUp, vip.status, - vip.statusDescription); - } - - /** - * @return the id of the VIP. - */ - @Nullable - public String getId() { - return id; - } - - /** - * @return the tenant id of the VIP. - */ - @Nullable - public String getTenantId() { - return tenantId; - } - - /** - * @return the name of the VIP. - */ - @Nullable - public String getName() { - return name; - } - - /** - * @return the description of the VIP. - */ - @Nullable - public String getDescription() { - return description; - } - - /** - * @return the subnet id for this VIP. - */ - @Nullable - public String getSubnetId() { - return subnetId; - } - - /** - * @return the address for this VIP. - */ - @Nullable - public String getAddress() { - return address; - } - - /** - * @return the port id for this VIP. - */ - @Nullable - public String getPortId() { - return portId; - } - - /** - * @return the protocol for this VIP. - */ - @Nullable - public Protocol getProtocol() { - return protocol; - } - - /** - * @return the protocol port for this VIP. - */ - @Nullable - public Integer getProtocolPort() { - return protocolPort; - } - - /** - * @return the pool id for this VIP. - */ - @Nullable - public String getPoolId() { - return poolId; - } - - /** - * @return the session persistence for this VIP. - */ - @Nullable - public SessionPersistence getSessionPersistence() { - return sessionPersistence; - } - - /** - * @return the connection limit for this VIP. - */ - @Nullable - public Integer getConnectionLimit() { - return connectionLimit; - } - - /** - * @return the administrative state for this VIP. - */ - @Nullable - public Boolean getAdminStateUp() { - return adminStateUp; - } - - /** - * @return the status for this VIP. - */ - @Nullable - public LBaaSStatus getStatus() { - return status; - } - - /** - * @return the status description for this VIP. - */ - @Nullable - public String getStatusDescription() { - return statusDescription; - } - - @Override - public boolean equals(Object o) { - if (this == o) - return true; - if (o == null || getClass() != o.getClass()) - return false; - - VIP that = (VIP) o; - - return Objects.equal(this.id, that.id) && Objects.equal(this.tenantId, that.tenantId) - && Objects.equal(this.name, that.name) && Objects.equal(this.description, that.description) - && Objects.equal(this.subnetId, that.subnetId) && Objects.equal(this.address, that.address) - && Objects.equal(this.portId, that.portId) && Objects.equal(this.protocol, that.protocol) - && Objects.equal(this.protocolPort, that.protocolPort) && Objects.equal(this.poolId, that.poolId) - && Objects.equal(this.sessionPersistence, that.sessionPersistence) - && Objects.equal(this.connectionLimit, that.connectionLimit) - && Objects.equal(this.adminStateUp, that.adminStateUp) && Objects.equal(this.status, that.status) - && Objects.equal(this.statusDescription, that.statusDescription); - } - - @Override - public int hashCode() { - return Objects.hashCode(id, tenantId, name, description, subnetId, address, portId, protocol, protocolPort, - poolId, sessionPersistence, connectionLimit, adminStateUp, status, statusDescription); - } - - @Override - public String toString() { - return Objects.toStringHelper(this).add("id", id).add("tenantId", tenantId).add("name", name) - .add("description", description).add("subnetId", subnetId).add("address", address).add("portId", portId) - .add("protocol", protocol).add("protocolPort", protocolPort).add("poolId", poolId) - .add("sessionPersistence", sessionPersistence).add("connectionLimit", connectionLimit) - .add("adminStateUp", adminStateUp).add("status", status).add("statusDescription", statusDescription) - .toString(); - } - - /* - * Methods to get the Create and Update builders follow. - */ - - /** - * @return the Builder for creating a new VIP. - */ - public static CreateBuilder createBuilder(String subnetId, Protocol protocol, Integer port, String poolId) { - return new CreateBuilder(subnetId, protocol, port, poolId); - } - - /** - * @return the Builder for updating a VIP. - */ - public static UpdateBuilder updateBuilder() { - return new UpdateBuilder(); - } - - private abstract static class Builder<ParameterizedBuilderType> { - protected VIP vip; - - /** - * Default constructor. - */ - private Builder() { - vip = new VIP(); - } - - protected abstract ParameterizedBuilderType self(); - - /** - * Provides the name for this VIP's Builder. - * - * @return the Builder. - * @see VIP#getName() - */ - public ParameterizedBuilderType name(String name) { - vip.name = name; - return self(); - } - - /** - * Provides the description for this VIP's Builder. - * - * @return the Builder. - * @see VIP#getDescription() - */ - public ParameterizedBuilderType description(String description) { - vip.description = description; - return self(); - } - - /** - * Provides the pool id for this VIP's Builder. - * - * @return the Builder. - * @see VIP#getPoolId() - */ - public ParameterizedBuilderType poolId(String poolId) { - vip.poolId = poolId; - return self(); - } - - /** - * Provides the session persistence for this VIP's Builder. - * - * @return the Builder. - * @see VIP#getSessionPersistence() - */ - public ParameterizedBuilderType sessionPersistence(SessionPersistence sessionPersistence) { - vip.sessionPersistence = sessionPersistence; - return self(); - } - - /** - * Provides the connection limit for this VIP's Builder. - * - * @return the Builder. - * @see VIP#getConnectionLimit() - */ - public ParameterizedBuilderType connectionLimit(Integer connectionLimit) { - vip.connectionLimit = connectionLimit; - return self(); - } - - /** - * Provides the administrative state for this VIP's Builder. - * - * @return the Builder. - * @see VIP#getAdminStateUp() - */ - public ParameterizedBuilderType adminStateUp(Boolean adminStateUp) { - vip.adminStateUp = adminStateUp; - return self(); - } - } - - /** - * Create builder (inheriting from Builder). - */ - public static class CreateBuilder extends Builder<CreateBuilder> { - /** - * Supply required properties for creating a VIP's CreateBuilder - */ - private CreateBuilder(String subnetId, Protocol protocol, Integer port, String poolId) { - subnetId(subnetId).protocol(protocol).protocolPort(port).poolId(poolId); - } - - /** - * Provides the tenantId for this VIP's Builder. Admin-only. - * When keystone is enabled, it is not mandatory to specify tenant_id for resources in create requests, as the - * tenant identifier will be derived from the Authentication token. Please note that the default authorization - * settings only allow administrative users to create resources on behalf of a different tenant. - * - * @return the Builder. - * @see VIP#getTenantId() - */ - public CreateBuilder tenantId(String tenantId) { - vip.tenantId = tenantId; - return self(); - } - - /** - * Provides the subnet id for this VIP's Builder. - * - * @return the Builder. - * @see VIP#getSubnetId() - */ - public CreateBuilder subnetId(String subnetId) { - vip.subnetId = subnetId; - return self(); - } - - /** - * Provides the address for this VIP's Builder. - * - * @return the Builder. - * @see VIP#getAddress() - */ - public CreateBuilder address(String address) { - vip.address = address; - return self(); - } - - /** - * Provides the protocol for this VIP's Builder. - * - * @return the Builder. - * @see VIP#getProtocol() - */ - public CreateBuilder protocol(Protocol protocol) { - vip.protocol = protocol; - return self(); - } - - /** - * Provides the protocol port for this VIP's Builder. - * - * @return the Builder. - * @see VIP#getProtocolPort() - */ - public CreateBuilder protocolPort(Integer protocolPort) { - vip.protocolPort = protocolPort; - return self(); - } - - /** - * @return a CreateVIP constructed with this Builder. - */ - public CreateVIP build() { - return new CreateVIP(vip); - } - - @Override - protected CreateBuilder self() { - return this; - } - } - - /** - * Update builder (inheriting from Builder). - */ - public static class UpdateBuilder extends Builder<UpdateBuilder> { - /** - * Supply required properties for creating a VIP's UpdateBuilder. - */ - private UpdateBuilder() { - } - - /** - * @return a UpdateVIP constructed with this Builder. - */ - public UpdateVIP build() { - return new UpdateVIP(vip); - } - - @Override - protected UpdateBuilder self() { - return this; - } - } - - /** - * Create options - extend the domain class, passed to API create calls. - * Essentially the same as the domain class. Ensure validation and safe typing. - */ - public static class CreateVIP extends VIP { - /** - * Copy constructor. - * - * @param vip the VIP to copy from. - */ - private CreateVIP(VIP vip) { - super(vip); - } - } - - /** - * Update options - extend the domain class, passed to API update calls. - * Essentially the same as the domain class. Ensure validation and safe typing. - */ - public static class UpdateVIP extends VIP { - /** - * Copy constructor. - * - * @param vip the VIP to copy from. - */ - private UpdateVIP(VIP vip) { - super(vip); - } - } -} http://git-wip-us.apache.org/repos/asf/stratos/blob/897edde8/dependencies/jclouds/apis/openstack-neutron/1.8.1-stratos/src/main/java/org/jclouds/openstack/neutron/v2/domain/lbaas/v1/VIPs.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/openstack-neutron/1.8.1-stratos/src/main/java/org/jclouds/openstack/neutron/v2/domain/lbaas/v1/VIPs.java b/dependencies/jclouds/apis/openstack-neutron/1.8.1-stratos/src/main/java/org/jclouds/openstack/neutron/v2/domain/lbaas/v1/VIPs.java deleted file mode 100644 index f53223d..0000000 --- a/dependencies/jclouds/apis/openstack-neutron/1.8.1-stratos/src/main/java/org/jclouds/openstack/neutron/v2/domain/lbaas/v1/VIPs.java +++ /dev/null @@ -1,36 +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.openstack.neutron.v2.domain.lbaas.v1; - -import java.beans.ConstructorProperties; - -import org.jclouds.openstack.v2_0.domain.Link; -import org.jclouds.openstack.v2_0.domain.PaginatedCollection; - -import com.google.common.collect.ImmutableSet; - -/** - * A collection of of Neutron LBaaS v1 VIPs. - */ -public class VIPs extends PaginatedCollection<VIP> { - public static final VIPs EMPTY = new VIPs(ImmutableSet.<VIP> of(), ImmutableSet.<Link> of()); - - @ConstructorProperties({ "vips", "vips_links" }) - protected VIPs(Iterable<VIP> vips, Iterable<Link> vipsLinks) { - super(vips, vipsLinks); - } -} http://git-wip-us.apache.org/repos/asf/stratos/blob/897edde8/dependencies/jclouds/apis/openstack-neutron/1.8.1-stratos/src/main/java/org/jclouds/openstack/neutron/v2/extensions/ExtensionNamespaces.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/openstack-neutron/1.8.1-stratos/src/main/java/org/jclouds/openstack/neutron/v2/extensions/ExtensionNamespaces.java b/dependencies/jclouds/apis/openstack-neutron/1.8.1-stratos/src/main/java/org/jclouds/openstack/neutron/v2/extensions/ExtensionNamespaces.java deleted file mode 100644 index 60d23a3..0000000 --- a/dependencies/jclouds/apis/openstack-neutron/1.8.1-stratos/src/main/java/org/jclouds/openstack/neutron/v2/extensions/ExtensionNamespaces.java +++ /dev/null @@ -1,39 +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.openstack.neutron.v2.extensions; - -/** - * Extension Namespaces for OpenStack Networking (Neutron). - */ -public final class ExtensionNamespaces { - /** - * Neutron Layer-3 Router Extension - */ - public static final String L3_ROUTER = "http://docs.openstack.org/ext/neutron/router/api/v1.0"; - /** - * Neutron Security Groups Extension - */ - public static final String SECURITY_GROUPS = "http://docs.openstack.org/ext/securitygroups/api/v2.0"; - /** - * LBaaS Extension. - */ - public static final String LBAAS = "http://wiki.openstack.org/neutron/LBaaS/API_1.0"; - - private ExtensionNamespaces() { - throw new AssertionError("intentionally unimplemented"); - } -} http://git-wip-us.apache.org/repos/asf/stratos/blob/897edde8/dependencies/jclouds/apis/openstack-neutron/1.8.1-stratos/src/main/java/org/jclouds/openstack/neutron/v2/extensions/FloatingIPApi.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/openstack-neutron/1.8.1-stratos/src/main/java/org/jclouds/openstack/neutron/v2/extensions/FloatingIPApi.java b/dependencies/jclouds/apis/openstack-neutron/1.8.1-stratos/src/main/java/org/jclouds/openstack/neutron/v2/extensions/FloatingIPApi.java deleted file mode 100644 index 9a65543..0000000 --- a/dependencies/jclouds/apis/openstack-neutron/1.8.1-stratos/src/main/java/org/jclouds/openstack/neutron/v2/extensions/FloatingIPApi.java +++ /dev/null @@ -1,138 +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.openstack.neutron.v2.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.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.core.MediaType; - -import org.jclouds.Fallbacks.EmptyPagedIterableOnNotFoundOr404; -import org.jclouds.Fallbacks.FalseOnNotFoundOr404; -import org.jclouds.Fallbacks.NullOnNotFoundOr404; -import org.jclouds.collect.PagedIterable; -import org.jclouds.javax.annotation.Nullable; -import org.jclouds.openstack.keystone.v2_0.filters.AuthenticateRequest; -import org.jclouds.openstack.neutron.v2.domain.FloatingIP; -import org.jclouds.openstack.neutron.v2.domain.FloatingIPs; -import org.jclouds.openstack.neutron.v2.fallbacks.EmptyFloatingIPsFallback; -import org.jclouds.openstack.neutron.v2.functions.FloatingIPsToPagedIterable; -import org.jclouds.openstack.neutron.v2.functions.ParseFloatingIPs; -import org.jclouds.openstack.v2_0.options.PaginationOptions; -import org.jclouds.rest.annotations.Fallback; -import org.jclouds.rest.annotations.RequestFilters; -import org.jclouds.rest.annotations.ResponseParser; -import org.jclouds.rest.annotations.SelectJson; -import org.jclouds.rest.annotations.Transform; -import org.jclouds.rest.annotations.WrapWith; - -import com.google.common.annotations.Beta; - -/** - * Provides access to Floating IP operations for the OpenStack Networking (Neutron) v2 API. - * <p/> - * A floating IP is an IP address on an external network, which is associated with a specific port, and optionally a - * specific IP address, on a private OpenStack Networking network. Therefore a floating IP allows access to an - * instance on a private network from an external network. Floating IPs can only be defined on networks for which the - * attribute floatingip:external (by the external network extension) has been set to True. - */ -@Beta -@Path("/floatingips") -@RequestFilters(AuthenticateRequest.class) -@Consumes(MediaType.APPLICATION_JSON) -public interface FloatingIPApi { - - /** - * Returns a list of floating IPs to which the tenant has access. Default policy settings return only - * those floating IPs that are owned by the tenant who submits the request, unless the request is submitted by an - * user with administrative rights. - * - * @return the list of all floatingIP references configured for the tenant. - */ - @Named("floatingip:list") - @GET - @Transform(FloatingIPsToPagedIterable.class) - @ResponseParser(ParseFloatingIPs.class) - @Fallback(EmptyPagedIterableOnNotFoundOr404.class) - PagedIterable<FloatingIP> list(); - - /** - * @return the list of all floatingIP references configured for the tenant. - */ - @Named("floatingip:list") - @GET - @ResponseParser(ParseFloatingIPs.class) - @Fallback(EmptyFloatingIPsFallback.class) - FloatingIPs list(PaginationOptions options); - - /** - * Returns the details for a specific floating IP. - * - * @param id the id of the floatingIP to return - * @return FloatingIPs collection or empty if not found - */ - @Named("floatingip:get") - @GET - @Path("/{id}") - @SelectJson("floatingip") - @Fallback(NullOnNotFoundOr404.class) - @Nullable - FloatingIP get(@PathParam("id") String id); - - /** - * Creates a floating IP. - * - * @param createFloatingIP Options for creating a Floating IP - * @return the newly created Floating IP - */ - @Named("floatingip:create") - @POST - @SelectJson("floatingip") - FloatingIP create(@WrapWith("floatingip") FloatingIP.CreateFloatingIP createFloatingIP); - - /** - * Update a Floating IP - * - * @param id the id of the Floating IP to update - * @param updateFloatingIP Contains only the attributes to update - * @return The modified Floating IP - */ - @Named("floatingip:update") - @PUT - @Path("/{id}") - @SelectJson("floatingip") - @Fallback(NullOnNotFoundOr404.class) - @Nullable - FloatingIP update(@PathParam("id") String id, @WrapWith("floatingip") FloatingIP.UpdateFloatingIP updateFloatingIP); - - /** - * Deletes the specified floatingIP - * - * @param id the id of the floatingIP to delete - * @return true if delete successful, false if not - */ - @Named("floatingip:delete") - @DELETE - @Path("/{id}") - @Fallback(FalseOnNotFoundOr404.class) - boolean delete(@PathParam("id") String id); -} http://git-wip-us.apache.org/repos/asf/stratos/blob/897edde8/dependencies/jclouds/apis/openstack-neutron/1.8.1-stratos/src/main/java/org/jclouds/openstack/neutron/v2/extensions/RouterApi.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/openstack-neutron/1.8.1-stratos/src/main/java/org/jclouds/openstack/neutron/v2/extensions/RouterApi.java b/dependencies/jclouds/apis/openstack-neutron/1.8.1-stratos/src/main/java/org/jclouds/openstack/neutron/v2/extensions/RouterApi.java deleted file mode 100644 index e259d69..0000000 --- a/dependencies/jclouds/apis/openstack-neutron/1.8.1-stratos/src/main/java/org/jclouds/openstack/neutron/v2/extensions/RouterApi.java +++ /dev/null @@ -1,198 +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.openstack.neutron.v2.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.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.core.MediaType; - -import org.jclouds.Fallbacks.EmptyPagedIterableOnNotFoundOr404; -import org.jclouds.Fallbacks.FalseOnNotFoundOr404; -import org.jclouds.Fallbacks.NullOnNotFoundOr404; -import org.jclouds.collect.PagedIterable; -import org.jclouds.javax.annotation.Nullable; -import org.jclouds.openstack.keystone.v2_0.filters.AuthenticateRequest; -import org.jclouds.openstack.neutron.v2.domain.Router; -import org.jclouds.openstack.neutron.v2.domain.RouterInterface; -import org.jclouds.openstack.neutron.v2.domain.Routers; -import org.jclouds.openstack.neutron.v2.fallbacks.EmptyRoutersFallback; -import org.jclouds.openstack.neutron.v2.functions.ParseRouters; -import org.jclouds.openstack.neutron.v2.functions.RouterToPagedIterable; -import org.jclouds.openstack.neutron.v2.options.EmptyOptions; -import org.jclouds.openstack.v2_0.options.PaginationOptions; -import org.jclouds.rest.annotations.Fallback; -import org.jclouds.rest.annotations.MapBinder; -import org.jclouds.rest.annotations.PayloadParam; -import org.jclouds.rest.annotations.RequestFilters; -import org.jclouds.rest.annotations.ResponseParser; -import org.jclouds.rest.annotations.SelectJson; -import org.jclouds.rest.annotations.Transform; -import org.jclouds.rest.annotations.WrapWith; - -import com.google.common.annotations.Beta; - -/** - * Provides access to Router operations for the OpenStack Networking (Neutron) v2 API. - * <p/> - * A logical entity for forwarding packets across internal subnets and NATting them on external - * networks through an appropriate external gateway. - * - * @see <a href= - * "http://docs.openstack.org/api/openstack-network/2.0/content/router_ext.html">api doc</a> - */ -@Beta -@Path("/routers") -@RequestFilters(AuthenticateRequest.class) -@Consumes(MediaType.APPLICATION_JSON) -public interface RouterApi { - - /** - * Returns the list of all routers currently defined in Neutron for the current tenant. The list provides the unique - * identifier of each router configured for the tenant - * - * @return the list of all router references configured for the tenant. - */ - @Named("router:list") - @GET - @Transform(RouterToPagedIterable.class) - @ResponseParser(ParseRouters.class) - @Fallback(EmptyPagedIterableOnNotFoundOr404.class) - PagedIterable<Router> list(); - - /** - * @see <a href="http://docs.openstack.org/api/openstack-network/2.0/content/pagination.html">api doc</a> - */ - @Named("router:list") - @GET - @ResponseParser(ParseRouters.class) - @Fallback(EmptyRoutersFallback.class) - Routers list(PaginationOptions options); - - /** - * Returns a Routers collection that should contain a single router with the id requested. - * - * @param id the id of the router to return - * @return Routers collection or empty if not found - */ - @Named("router:get") - @GET - @Path("/{id}") - @SelectJson("router") - @Fallback(NullOnNotFoundOr404.class) - @Nullable - Router get(@PathParam("id") String id); - - /** - * Create a new router - * - * @param router Options for creating a router - * @return the newly created router - */ - @Named("router:create") - @POST - @SelectJson("router") - Router create(@WrapWith("router") Router.CreateRouter router); - - /** - * Update a router - * - * @param id the id of the router to update - * @param router Contains only the attributes to update - * @return The modified router - */ - @Named("router:update") - @PUT - @Path("/{id}") - @SelectJson("router") - @Fallback(NullOnNotFoundOr404.class) - @Nullable - Router update(@PathParam("id") String id, @WrapWith("router") Router.UpdateRouter router); - - /** - * Deletes the specified router - * - * @param id the id of the router to delete - * @return true if delete successful, false if not - */ - @Named("router:delete") - @DELETE - @Path("/{id}") - @Fallback(FalseOnNotFoundOr404.class) - boolean delete(@PathParam("id") String id); - - /** - * Add a interface to a router to connect to the specified subnet - * - * @param routerId the id of the router to create the interface at - * @param subnetId the id of the subnet to connect with the interface - * @return the newly-created router interface - */ - @Named("router:addInterfaceForSubnet") - @PUT - @Path("/{id}/add_router_interface") - @MapBinder(EmptyOptions.class) - @Fallback(NullOnNotFoundOr404.class) - @Nullable - RouterInterface addInterfaceForSubnet(@PathParam("id") String routerId, @PayloadParam("subnet_id") String subnetId); - - /** - * Add a interface to a router to connect to the specified port - * - * @param routerId the id of the router to create the interface at - * @param portId the id of the port to connect with the interface - * @return the newly-created router interface - */ - @Named("router:addInterfaceForPort") - @PUT - @Path("/{id}/add_router_interface") - @MapBinder(EmptyOptions.class) - @Fallback(NullOnNotFoundOr404.class) - @Nullable - RouterInterface addInterfaceForPort(@PathParam("id") String routerId, @PayloadParam("port_id") String portId); - - /** - * Remove the interface where the specified subnet is connected to - * - * @param routerId the id of the router to remove the interface from - * @param subnetId the id of the subnet to disconnect from the interface - */ - @Named("router:removeInterfaceForSubnet") - @PUT - @Path("/{id}/remove_router_interface") - @MapBinder(EmptyOptions.class) - @Fallback(FalseOnNotFoundOr404.class) - boolean removeInterfaceForSubnet(@PathParam("id") String routerId, @PayloadParam("subnet_id") String subnetId); - - /** - * Remove the interface where the specified port is connected to - * - * @param routerId the id of the router to remove the interface from - * @param portId the id of the port to disconnect from the interface - */ - @Named("router:removeInterfaceForPort") - @PUT - @Path("/{id}/remove_router_interface") - @MapBinder(EmptyOptions.class) - @Fallback(FalseOnNotFoundOr404.class) - boolean removeInterfaceForPort(@PathParam("id") String routerId, @PayloadParam("port_id") String portId); -} http://git-wip-us.apache.org/repos/asf/stratos/blob/897edde8/dependencies/jclouds/apis/openstack-neutron/1.8.1-stratos/src/main/java/org/jclouds/openstack/neutron/v2/extensions/SecurityGroupApi.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/openstack-neutron/1.8.1-stratos/src/main/java/org/jclouds/openstack/neutron/v2/extensions/SecurityGroupApi.java b/dependencies/jclouds/apis/openstack-neutron/1.8.1-stratos/src/main/java/org/jclouds/openstack/neutron/v2/extensions/SecurityGroupApi.java deleted file mode 100644 index 0832d4c..0000000 --- a/dependencies/jclouds/apis/openstack-neutron/1.8.1-stratos/src/main/java/org/jclouds/openstack/neutron/v2/extensions/SecurityGroupApi.java +++ /dev/null @@ -1,186 +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.openstack.neutron.v2.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; -import org.jclouds.Fallbacks.EmptyPagedIterableOnNotFoundOr404; -import org.jclouds.collect.PagedIterable; -import org.jclouds.javax.annotation.Nullable; -import org.jclouds.openstack.keystone.v2_0.filters.AuthenticateRequest; -import org.jclouds.openstack.neutron.v2.domain.Rule; -import org.jclouds.openstack.neutron.v2.domain.Rules; -import org.jclouds.openstack.neutron.v2.domain.SecurityGroup; -import org.jclouds.openstack.neutron.v2.domain.SecurityGroups; -import org.jclouds.openstack.neutron.v2.fallbacks.EmptyRulesFallback; -import org.jclouds.openstack.neutron.v2.fallbacks.EmptySecurityGroupsFallback; -import org.jclouds.openstack.neutron.v2.functions.ParseRules; -import org.jclouds.openstack.neutron.v2.functions.ParseSecurityGroups; -import org.jclouds.openstack.neutron.v2.functions.RulesToPagedIterable; -import org.jclouds.openstack.neutron.v2.functions.SecurityGroupsToPagedIterable; -import org.jclouds.openstack.v2_0.options.PaginationOptions; -import org.jclouds.rest.annotations.Fallback; -import org.jclouds.rest.annotations.RequestFilters; -import org.jclouds.rest.annotations.ResponseParser; -import org.jclouds.rest.annotations.SelectJson; -import org.jclouds.rest.annotations.Transform; -import org.jclouds.rest.annotations.WrapWith; -import com.google.common.annotations.Beta; - -/** - * Provides access to Security Group extension operations for the OpenStack Networking (Neutron) v2 API. - * <p/> - * Security groups and security group rules allows administrators and tenants the ability to specify the type of - * traffic and direction (ingress/egress) that is allowed to pass through a port. A security group is a container for - * security group rules. - */ -@Beta -@RequestFilters(AuthenticateRequest.class) -@Consumes(MediaType.APPLICATION_JSON) -@Produces(MediaType.APPLICATION_JSON) -public interface SecurityGroupApi { - /** - * Groups - */ - - /** - * @return all security groups currently defined in Neutron for the current tenant. - */ - @Path("/security-groups") - @Named("security-group:list") - @GET - @ResponseParser(ParseSecurityGroups.class) - @Transform(SecurityGroupsToPagedIterable.class) - @Fallback(EmptyPagedIterableOnNotFoundOr404.class) - PagedIterable<SecurityGroup> listSecurityGroups(); - - /** - * @return all security groups currently defined in Neutron for the current tenant. - */ - @Path("/security-groups") - @Named("security-group:list") - @GET - @ResponseParser(ParseSecurityGroups.class) - @Fallback(EmptySecurityGroupsFallback.class) - SecurityGroups listSecurityGroups(PaginationOptions options); - - /** - * @param id the id of the security group to return - * @return SecurityGroup or null if not found. - */ - @Path("/security-groups/{id}") - @Named("security-group:get") - @GET - @SelectJson("security_group") - @Fallback(Fallbacks.NullOnNotFoundOr404.class) - @Nullable - SecurityGroup getSecurityGroup(@PathParam("id") String id); - - /** - * Creates a new SecurityGroup. - * - * @param securityGroup Describes the security group to be created. - * @return a reference of the newly-created security group - */ - @Path("/security-groups") - @Named("secuity-group:create") - @POST - @SelectJson("security_group") - SecurityGroup create(@WrapWith("security_group") SecurityGroup.CreateSecurityGroup securityGroup); - - /** - * Deletes the specified Security Group. - * - * @param id the id of the security group to delete - * @return true if delete was successful, false if not - */ - @Path("/security-groups/{id}") - @Named("security-group:delete") - @DELETE - @Fallback(Fallbacks.FalseOnNotFoundOr404.class) - boolean deleteSecurityGroup(@PathParam("id") String id); - - /** - * Rules - */ - - /** - * @return all security groups rules currently defined in Neutron for the current tenant. - */ - @Path("/security-group-rules") - @Named("security-group-rule:list") - @GET - @ResponseParser(ParseRules.class) - @Transform(RulesToPagedIterable.class) - @Fallback(EmptyPagedIterableOnNotFoundOr404.class) - PagedIterable<Rule> listRules(); - - /** - * @return all security groups rules currently defined in Neutron for the current tenant. - */ - @Path("/security-group-rules") - @Named("security-group-rule:list") - @GET - @ResponseParser(ParseRules.class) - @Fallback(EmptyRulesFallback.class) - Rules listRules(PaginationOptions options); - - /** - * @param id the id of the security group rule to return. - * @return SecurityGroupRule or null if not found. - */ - @Path("/security-group-rules/{id}") - @Named("security-group-rule:get") - @GET - @SelectJson("security_group_rule") - @Fallback(Fallbacks.NullOnNotFoundOr404.class) - @Nullable - Rule get(@PathParam("id") String id); - - /** - * Creates a new Security Group Rule. - * - * @param securityGroupRule Describes the security group rule to be created. - * @return a reference of the newly-created security group rule. - */ - @Path("/security-group-rules") - @Named("security-group-rule:create") - @POST - @SelectJson("security_group_rule") - Rule create(@WrapWith("security_group_rule") Rule.CreateRule securityGroupRule); - - /** - * Deletes the specified Security Group Rule. - * - * @param id the id of the security group rule to delete. - * @return true if delete was successful, false if not. - */ - @Path("/security-group-rules/{id}") - @Named("security-group-rule:delete") - @DELETE - @Fallback(Fallbacks.FalseOnNotFoundOr404.class) - boolean deleteRule(@PathParam("id") String id); -}
