<div dir="ltr">Thanks for the feedback.<div>Will create a design on these lines and send across for review</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Mar 12, 2014 at 3:53 PM, Tim Hinrichs <span dir="ltr"><<a href="mailto:thinrichs@vmware.com" target="_blank">thinrichs@vmware.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="font-size:12pt;font-family:times new roman,new york,times,serif"><div>Hi Rajdeep,</div><div><br></div>
<div>This is an great problem to work on because it confronts one of the assumptions we're making in Congress: that cloud services can be represented as a collection of tables in a reasonable way.  You're asking good questions here.</div>
<div><br></div><div>More responses inline.</div><div><br></div><div>Tim</div><div><br></div><div><br></div><hr><blockquote><div style="font-size:12pt;font-style:normal;font-family:Helvetica,Arial,sans-serif;text-decoration:none;font-weight:normal">
<b>From: </b>"Rajdeep Dua" <<a href="mailto:rajdeep.dua@gmail.com" target="_blank">rajdeep.dua@gmail.com</a>><br><b>To: </b><a href="mailto:openstack-dev@lists.openstack.org" target="_blank">openstack-dev@lists.openstack.org</a><br>
<b>Sent: </b>Wednesday, March 12, 2014 11:54:28 AM<br><b>Subject: </b>[openstack-dev] [Congress][Data Integration]<div class=""><br><div><br></div><div dir="ltr">Need some guidance on how to convert nested types into flat tuples.<div>
Also should we reorder the tuple values in a particular sequence?</div><div><br></div></div></div></div></blockquote><div style="font-size:12pt;font-style:normal;font-family:Helvetica,Arial,sans-serif;text-decoration:none;font-weight:normal">
<div dir="ltr"><div><span style="color:#333333;font-family:monospace;font-size:13px;background-color:#fdfdfd">Order of tuples doesn't matter. Order of columns (values) within a tuple doesn't really matter either, except that all tuples must use the same order and the policies we write must know which column is which.</span><span style="color:#333333;font-family:monospace;font-size:13px;background-color:#fdfdfd"> </span><br>
</div></div></div><div class=""><blockquote><div style="font-size:12pt;font-style:normal;font-family:Helvetica,Arial,sans-serif;text-decoration:none;font-weight:normal"><div dir="ltr"><div><br></div><div>Thanks</div><div>
Rajdeep<br><div><br></div><div>
As an example i have shown networks and ports tuples with some nested types</div><div><br></div><div><div>networks - tuple format</div><div>-----------------------</div><div><br></div><div>keys (for reference)</div><div>
<br></div><div>{'status','subnets', 'name','test-network','provider:physical_network','admin_state_up',</div><div>'tenant_id','provider:network_type','router:external', 'shared',id,'provider:segmentation_id'}</div>
<div><br></div><div>values</div><div>-----------</div><div>('ACTIVE', ['4cef03d0-1d02-40bb-8c99-2f442aac6ab0'], 'test-network', None, True,</div><div>'570fe78a1dc54cffa053bd802984ede2', 'gre', False, False,</div>
<div>'240ff9df-df35-43ae-9df5-27fae87f2492', 4)</div><div><br></div></div></div></div></div></blockquote></div><div style="font-size:12pt;font-style:normal;font-family:Helvetica,Arial,sans-serif;text-decoration:none;font-weight:normal">
<div dir="ltr"><span style="color:#333333;font-family:monospace;font-size:13px;background-color:#fdfdfd">Here we'd want to pull the List out and replace it with an ID. Then create another table that shows which subnets belong to the list with that ID. (You can think of the ID as a pointer to the list---in the C/C++ sense.)  So something like...</span><span style="color:#333333;font-family:monospace;font-size:13px;background-color:#fdfdfd"> </span><br style="color:#333333;font-family:monospace;font-size:13px">
<br style="color:#333333;font-family:monospace;font-size:13px"><span style="color:#333333;font-family:monospace;font-size:13px;background-color:#fdfdfd">network( 'ACTIVE', 'ID1', 'test-network', None, True,</span><span style="color:#333333;font-family:monospace;font-size:13px;background-color:#fdfdfd"> </span><div class="">
<br style="color:#333333;font-family:monospace;font-size:13px"><span style="color:#333333;font-family:monospace;font-size:13px;background-color:#fdfdfd">'570fe78a1dc54cffa053bd802984ede2', 'gre', False, False,</span><span style="color:#333333;font-family:monospace;font-size:13px;background-color:#fdfdfd"> </span><br style="color:#333333;font-family:monospace;font-size:13px">
<span style="color:#333333;font-family:monospace;font-size:13px;background-color:#fdfdfd">'240ff9df-df35-43ae-9df5-27fae87f2492', 4)</span><span style="color:#333333;font-family:monospace;font-size:13px;background-color:#fdfdfd"> </span><br style="color:#333333;font-family:monospace;font-size:13px">
<br style="color:#333333;font-family:monospace;font-size:13px"></div><span style="color:#333333;font-family:monospace;font-size:13px;background-color:#fdfdfd">element('ID1', '4cef03d0-1d02-40bb-8c99-2f442aac6ab0')</span><span style="color:#333333;font-family:monospace;font-size:13px;background-color:#fdfdfd"> </span><br style="color:#333333;font-family:monospace;font-size:13px">
<span style="color:#333333;font-family:monospace;font-size:13px;background-color:#fdfdfd">element('ID1', <another subnet if one existed>)</span><span style="color:#333333;font-family:monospace;font-size:13px;background-color:#fdfdfd"> </span></div>
<div dir="ltr"><span style="color:#333333;font-family:monospace;font-size:13px;background-color:#fdfdfd"><br></span></div><div dir="ltr"><span style="color:rgb(51,51,51);font-family:monospace;font-size:13px;background-color:rgb(253,253,253)">The other thing to think about is whether we want 1 table with 10 columns or we want 10 tables with 2 columns each. In this example, we would have...</span><span style="color:rgb(51,51,51);font-family:monospace;font-size:13px;background-color:rgb(253,253,253)"> </span></div>
<div dir="ltr"><br style="color:#333333;font-family:monospace;font-size:13px"><span style="color:#333333;font-family:monospace;font-size:13px;background-color:#fdfdfd">network('net1')</span><span style="color:#333333;font-family:monospace;font-size:13px;background-color:#fdfdfd"> </span><br style="color:#333333;font-family:monospace;font-size:13px">
<span style="color:#333333;font-family:monospace;font-size:13px;background-color:#fdfdfd">network.status('net1', 'ACTIVE' )</span><span style="color:#333333;font-family:monospace;font-size:13px;background-color:#fdfdfd"> </span><br style="color:#333333;font-family:monospace;font-size:13px">
<span style="color:#333333;font-family:monospace;font-size:13px;background-color:#fdfdfd">network.subnets('net1', 'ID1')</span><span style="color:#333333;font-family:monospace;font-size:13px;background-color:#fdfdfd"> </span><br style="color:#333333;font-family:monospace;font-size:13px">
<span style="color:#333333;font-family:monospace;font-size:13px;background-color:#fdfdfd"><a href="http://network.name" target="_blank">network.name</a>('net1', 'test-network')</span><span style="color:#333333;font-family:monospace;font-size:13px;background-color:#fdfdfd"> </span><br style="color:#333333;font-family:monospace;font-size:13px">
<span style="color:#333333;font-family:monospace;font-size:13px;background-color:#fdfdfd">...</span><span style="color:#333333;font-family:monospace;font-size:13px;background-color:#fdfdfd"> </span><br style="color:#333333;font-family:monospace;font-size:13px">
<br style="color:#333333;font-family:monospace;font-size:13px"><span style="color:#333333;font-family:monospace;font-size:13px;background-color:#fdfdfd">The period is just another character in the tablename. Nothing fancy happening here. </span></div>
<div dir="ltr"><span style="color:#333333;font-family:monospace;font-size:13px;background-color:#fdfdfd"><br></span></div><div dir="ltr"><span style="color:#333333;font-family:monospace;font-size:13px;background-color:#fdfdfd"><span style="color:#333333;font-family:monospace;font-size:13px;background-color:#fdfdfd"></span></span><div dir="ltr" style="font-family:Helvetica,Arial,sans-serif">
<span style="color:#333333;font-family:monospace;font-size:13px;background-color:#fdfdfd">The ports example below would need a similar flattening.  To handle dictionaries, I would use the dot-notation shown above. </span></div>
<span style="color:#333333;font-family:monospace;font-size:13px;background-color:#fdfdfd"><span style="color:#333333;font-family:monospace;font-size:13px;background-color:#fdfdfd"></span></span><div><span style="color:#333333;font-family:monospace;font-size:13px;background-color:#fdfdfd"> </span></div>
</div><div dir="ltr"><span style="color:#333333;font-family:monospace;font-size:13px;background-color:#fdfdfd">A single Neutron API call might populate several Congress tables.</span><span style="color:#333333;font-family:monospace;font-size:13px;background-color:#fdfdfd"><br>
</span></div><div dir="ltr"><span style="color:#333333;font-family:monospace;font-size:13px;background-color:#fdfdfd"><br></span></div><div dir="ltr"><span style="color:#333333;font-family:monospace;font-size:13px;background-color:#fdfdfd">Tim</span></div>
</div><div class=""><blockquote><div style="font-size:12pt;font-style:normal;font-family:Helvetica,Arial,sans-serif;text-decoration:none;font-weight:normal"><div dir="ltr"><div><div><div><br></div><div>ports - tuple format</div>
<div>----------------------------</div><div>keys (for reference)</div><div><br></div><div>{'status','binding:host_id', 'name', 'allowed_address_pairs',</div><div>'admin_state_up', 'network_id',</div>
<div>'tenant_id', 'extra_dhcp_opts': [],</div><div>'binding:vif_type', 'device_owner',</div><div>'binding:capabilities', 'mac_address',</div><div>'fixed_ips' , 'id', 'security_groups',</div>
<div>'device_id'}</div><div><br></div><div>Values</div><div><br></div><div>('ACTIVE', 'havana', '', [], True, '240ff9df-df35-43ae-9df5-27fae87f2492',</div><div>'570fe78a1dc54cffa053bd802984ede2', [], 'ovs', 'network:router_interface',</div>
<div>{'port_filter': True}, 'fa:16:3e:ab:90:df', [{'subnet_id':</div><div>'4cef03d0-1d02-40bb-8c99-2f442aac6ab0', 'ip_address': '90.0.0.1'}],</div><div>'0a2ce569-85a8-45ec-abb3-0d4b34ff69ba', [], '864e4acf-bf8e-4664-8cf7-ad5daa95681e')</div>
</div></div></div></div></blockquote></div><div style="font-size:12pt;font-style:normal;font-family:Helvetica,Arial,sans-serif;text-decoration:none;font-weight:normal">_______________________________________________<br>OpenStack-dev mailing list<br>
<a href="mailto:OpenStack-dev@lists.openstack.org" target="_blank">OpenStack-dev@lists.openstack.org</a><br><a href="https://urldefense.proofpoint.com/v1/url?u=http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev&k=oIvRg1%2BdGAgOoM1BIlLLqw%3D%3D%0A&r=%2FZ35AkRhp2kCW4Q3MPeE%2BxY2bqaf%2FKm29ZfiqAKXxeo%3D%0A&m=A86YVKfBX5U3g6F7eNScJYjr6Qwjv4dyDyVxE9Im8g8%3D%0A&s=0345ab3711a58ec1ebcee08649f047826cec593f57e9843df0fec2f8cfb03b42" target="_blank">https://urldefense.proofpoint.com/v1/url?u=http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev&k=oIvRg1%2BdGAgOoM1BIlLLqw%3D%3D%0A&r=%2FZ35AkRhp2kCW4Q3MPeE%2BxY2bqaf%2FKm29ZfiqAKXxeo%3D%0A&m=A86YVKfBX5U3g6F7eNScJYjr6Qwjv4dyDyVxE9Im8g8%3D%0A&s=0345ab3711a58ec1ebcee08649f047826cec593f57e9843df0fec2f8cfb03b42</a><br>
</div><blockquote><div><br></div></blockquote></div></div><br>_______________________________________________<br>
OpenStack-dev mailing list<br>
<a href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
<br></blockquote></div><br></div>