Skip to content

Commit

Permalink
Merge pull request #1133 from Grim-lock/bugfix
Browse files Browse the repository at this point in the history
add vip_network_id and vip_port_id for lb post
  • Loading branch information
auhlig authored Jan 22, 2018
2 parents bcf3a13 + 81b651a commit 7a45d4a
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ public interface LoadBalancerV2 extends ModelEntity, Buildable<LoadBalancerV2Bu
*/
String getDescription();

/**
* @return The vip network id of the loadbalancer.
*/
String getVipNetworkId();

/**
* @return The vip subnet id of the loadbalancer.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,32 @@ public interface LoadBalancerV2Builder extends Buildable.Builder<LoadBalancerV2B
/**
* Optional
*
* @param vipSubnetId
* @param vipNetworkId
* The network on which to allocate the load balancer's vip address.
* A tenant can only create load balancer vips on networks authorized by policy (e.g. her own networks or shared/provider networks).
* @return LoadBalancerV2Builder
*/
LoadBalancerV2Builder networkId(String vipNetworkId);

/**
* Optional
*
* @param vipSubnetId
* The subnet on which to allocate the load balancer's vip address.
* A tenant can only create load balancer vips on subnets authorized by policy.
* @return LoadBalancerV2Builder
*/
LoadBalancerV2Builder subnetId(String vipSubnetId);

/**
* Optional
*
* @param vipPortId
* The vip port.
* @return LoadBalancerV2Builder
*/
LoadBalancerV2Builder portId(String vipPortId);

/**
* Optional
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ public class OctaviaLoadBalancerV2 implements LoadBalancerV2 {

private String description;

/**
* The ID of the network on which to allocate the VIP address.
*/
@JsonProperty("vip_network_id")
private String vipNetworkId;

/**
* The ID of the subnet on which to allocate the VIP address.
*/
Expand Down Expand Up @@ -89,6 +95,15 @@ public String getDescription(){
return description;
}

/**
* {@inheritDoc}
*/
@JsonProperty("vip_network_id")
@Override
public String getVipNetworkId(){
return vipNetworkId;
}

/**
* {@inheritDoc}
*/
Expand Down Expand Up @@ -169,6 +184,7 @@ public String toString(){
.add("projectId", projectId)
.add("name", name)
.add("description", description)
.add("vipNetworkId", vipNetworkId)
.add("vipSubnetId", vipSubnetId)
.add("vipAddress", vipAddress)
.add("adminStateUp", adminStateUp)
Expand Down Expand Up @@ -253,6 +269,15 @@ public LoadBalancerV2Builder description(String description){
return this;
}

/**
* {@inheritDoc}
*/
@Override
public LoadBalancerV2Builder networkId(String vipNetworkId){
m.vipNetworkId = vipNetworkId;
return this;
}

/**
* {@inheritDoc}
*/
Expand All @@ -262,6 +287,15 @@ public LoadBalancerV2Builder subnetId(String vipSubnetId){
return this;
}

/**
* {@inheritDoc}
*/
@Override
public LoadBalancerV2Builder portId(String vipPortId){
m.vipPortId = vipPortId;
return this;
}

/**
* {@inheritDoc}
*/
Expand Down

0 comments on commit 7a45d4a

Please sign in to comment.