Skip to content

Commit

Permalink
Merge "schema changes for ecmp(native) loadbalancer"
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed Oct 10, 2016
2 parents c53002c + 8a9604b commit 0f12c85
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/config/api-server/vnc_cfg_types.py
Expand Up @@ -222,6 +222,9 @@ def pre_dbe_update(cls, id, fq_name, obj_dict, db_conn, **kwargs):
class FloatingIpServer(Resource, FloatingIp):
@classmethod
def pre_dbe_create(cls, tenant_name, obj_dict, db_conn):
if obj_dict['parent_type'] == 'instance-ip':
return True, ""

vn_fq_name = obj_dict['fq_name'][:-2]
req_ip = obj_dict.get("floating_ip_address")
if req_ip and cls.addr_mgmt.is_ip_allocated(req_ip, vn_fq_name):
Expand Down Expand Up @@ -252,6 +255,9 @@ def undo():

@classmethod
def post_dbe_delete(cls, id, obj_dict, db_conn):
if obj_dict['parent_type'] == 'instance-ip':
return True, ""

vn_fq_name = obj_dict['fq_name'][:-2]
fip_addr = obj_dict['floating_ip_address']
db_conn.config_log('AddrMgmt: free FIP %s for vn=%s'
Expand All @@ -265,13 +271,19 @@ def post_dbe_delete(cls, id, obj_dict, db_conn):

@classmethod
def dbe_create_notification(cls, obj_ids, obj_dict):
if obj_dict['parent_type'] == 'instance-ip':
return

fip_addr = obj_dict['floating_ip_address']
vn_fq_name = obj_dict['fq_name'][:-2]
cls.addr_mgmt.ip_alloc_notify(fip_addr, vn_fq_name)
# end dbe_create_notification

@classmethod
def dbe_delete_notification(cls, obj_ids, obj_dict):
if obj_dict['parent_type'] == 'instance-ip':
return

fip_addr = obj_dict['floating_ip_address']
vn_fq_name = obj_dict['fq_name'][:-2]
cls.addr_mgmt.ip_free_notify(fip_addr, vn_fq_name)
Expand Down
27 changes: 27 additions & 0 deletions src/schema/vnc_cfg.xsd
Expand Up @@ -153,6 +153,19 @@ targetNamespace="http://www.contrailsystems.com/2012/VNC-CONFIG/0">
</xsd:sequence>
</xsd:complexType>

<xsd:complexType name="PortMap">
<xsd:all>
<xsd:element name="src-port" type="xsd:integer"/>
<xsd:element name="dst-port" type="xsd:integer"/>
</xsd:all>
</xsd:complexType>

<xsd:complexType name="PortMappings">
<xsd:all>
<xsd:element name="port-mappings" type="PortMap" maxOccurs="65535"/>
</xsd:all>
</xsd:complexType>

<xsd:complexType name="MatchConditionType">
<xsd:sequence>
<xsd:element name="protocol" type="xsd:string" required='true'
Expand Down Expand Up @@ -1779,6 +1792,20 @@ targetNamespace="http://www.contrailsystems.com/2012/VNC-CONFIG/0">
Link('floating-ip-virtual-machine-interface',
'floating-ip', 'virtual-machine-interface', ['ref'], 'optional', 'CRUD',
'Reference to virtual machine interface to which this floating ip is attached.') -->
<xsd:element name="instance-ip-floating-ip"/>
<!--#IFMAP-SEMANTICS-IDL
Link('instance-ip-floating-ip',
'instance-ip', 'floating-ip', ['has'], 'optional', 'CRUD',
'floating-ip can be child of instance-ip. By doing so instance-ip can be used as floating-ip.') -->
<xsd:element name="floating-ip-port-mappings-enable" type="xsd:boolean" default='false'/>
<!--#IFMAP-SEMANTICS-IDL
Property('floating-ip-port-mappings-enable',
'floating-ip', 'optional', 'CRUD',
'If it is false, floating-ip Nat is done for all Ports. If it is true, floating-ip Nat is done to the list of PortMaps.') -->
<xsd:element name="floating-ip-port-mappings" type="PortMappings"/>
<!--#IFMAP-SEMANTICS-IDL
ListProperty('floating-ip-port-mappings', 'floating-ip', 'optional', 'CRUD',
'List of PortMaps for this floating-ip.') -->

<xsd:element name="alias-ip-pool" type="ifmap:IdentityType"/>
<xsd:element name="virtual-network-alias-ip-pool"/>
Expand Down

0 comments on commit 0f12c85

Please sign in to comment.