{"action":"created","issue":{"url":"https://api.github.com/repos/REANNZ/faucet/issues/126","repository_url":"https://api.github.com/repos/REANNZ/faucet","labels_url":"https://api.github.com/repos/REANNZ/faucet/issues/126/labels{/name}","comments_url":"https://api.github.com/repos/REANNZ/faucet/issues/126/comments","events_url":"https://api.github.com/repos/REANNZ/faucet/issues/126/events","html_url":"https://github.com/REANNZ/faucet/issues/126","id":167274253,"number":126,"title":"Consistency of configuration structure","user":{"login":"KitL","id":1981461,"avatar_url":"https://avatars.githubusercontent.com/u/1981461?v=3","gravatar_id":"","url":"https://api.github.com/users/KitL","html_url":"https://github.com/KitL","followers_url":"https://api.github.com/users/KitL/followers","following_url":"https://api.github.com/users/KitL/following{/other_user}","gists_url":"https://api.github.com/users/KitL/gists{/gist_id}","starred_url":"https://api.github.com/users/KitL/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KitL/subscriptions","organizations_url":"https://api.github.com/users/KitL/orgs","repos_url":"https://api.github.com/users/KitL/repos","events_url":"https://api.github.com/users/KitL/events{/privacy}","received_events_url":"https://api.github.com/users/KitL/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/REANNZ/faucet/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":{"login":"KitL","id":1981461,"avatar_url":"https://avatars.githubusercontent.com/u/1981461?v=3","gravatar_id":"","url":"https://api.github.com/users/KitL","html_url":"https://github.com/KitL","followers_url":"https://api.github.com/users/KitL/followers","following_url":"https://api.github.com/users/KitL/following{/other_user}","gists_url":"https://api.github.com/users/KitL/gists{/gist_id}","starred_url":"https://api.github.com/users/KitL/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KitL/subscriptions","organizations_url":"https://api.github.com/users/KitL/orgs","repos_url":"https://api.github.com/users/KitL/repos","events_url":"https://api.github.com/users/KitL/events{/privacy}","received_events_url":"https://api.github.com/users/KitL/received_events","type":"User","site_admin":false},"assignees":[{"login":"KitL","id":1981461,"avatar_url":"https://avatars.githubusercontent.com/u/1981461?v=3","gravatar_id":"","url":"https://api.github.com/users/KitL","html_url":"https://github.com/KitL","followers_url":"https://api.github.com/users/KitL/followers","following_url":"https://api.github.com/users/KitL/following{/other_user}","gists_url":"https://api.github.com/users/KitL/gists{/gist_id}","starred_url":"https://api.github.com/users/KitL/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KitL/subscriptions","organizations_url":"https://api.github.com/users/KitL/orgs","repos_url":"https://api.github.com/users/KitL/repos","events_url":"https://api.github.com/users/KitL/events{/privacy}","received_events_url":"https://api.github.com/users/KitL/received_events","type":"User","site_admin":false}],"milestone":null,"comments":7,"created_at":"2016-07-25T03:16:02Z","updated_at":"2016-07-29T04:12:27Z","closed_at":null,"body":"I am touching up my change that does most of this. I just wanted to check a couple of things through with you guys before I change too much more.\r\n\r\nFirstly this is kind of a big change. Here is an overview:\r\n\r\nThe main goal is to have consistency between how faucet and gauge are configured. I migrate gauge to using yaml, and make the database configuration actually configurable. I also try to make gauge and faucet more consistent in how the code is structured.\r\n\r\nThe  gauge config looks something like this:\r\n```\r\n\r\nvalve_configs:\r\n        - \"faucet1.yaml\"\r\n        - \"/etc/ryu/faucet/faucet2.yaml\"\r\npollers:\r\n        flow_table_poller:     #the name of the poller\r\n                gauge_type: \"flow_table\"\r\n                dps: [\"switch-1\", \"switch-2\", \"switch-3\"]\r\n                interval: 60\r\n                db: \"flow_table_file\"\r\n        port_state_poller:\r\n                gauge_type:\"port_state\"\r\n                dps: [\"office-switch-1\"]\r\n                db: \"influx\"\r\ndbs:\r\n        influx:\r\n               type: \"influx\"\r\n                db: \"faucet\"\r\n                host: \"localhost\"\r\n                port: 8086\r\n        flow_table_file:\r\n                type: \"text\"\r\n               output_file: \"gauge_flow_table.txt\"\r\n```\r\n\r\n\r\nFor consistencies sake I would like to change it so all of the configuration for faucet key's things by names rather than by the id number (eg port number, vid or dp_id). We can do this easily without breaking existing configs. My plan is that we check if a dp_id is configured elsewhere. If not then the key is the dp_id. So this will not break existing configs so doesnt need a new config version.\r\n\r\nSo the config for valve would look more like:\r\n```\r\n---\r\n   version: 2\r\n \r\n   dps:\r\n      test-switch-1:\r\n           dp_id: 0x000000000002\r\n           interfaces:\r\n               1:\r\n                   native_vlan: 2040\r\n                   acl_in: 1\r\n       test-switch-2:\r\n           dp_id: 0x000000000002\r\n           interfaces:\r\n               port_1:\r\n                   of_number: 1\r\n                   native_vlan: 2040\r\n                   acl_in: 1\r\n \r\n   vlans:\r\n       \"dev VLAN\":\r\n           vid: 2040\r\n \r\n   acls:\r\n       1:\r\n           - rule:\r\n               nw_dst: \"172.0.0.0/8\"\r\n               dl_type: 0x800\r\n               allow: 1\r\n \r\n           - rule:\r\n               dl_type: 0x0806\r\n               allow: 1\r\n \r\n           - rule:\r\n               nw_dst: \"10.0.0.0/16\"\r\n               dl_type: 0x800\r\n               allow: 0\r\n```\r\n\r\nAnd just a reminder, this will work so that the name used for the key will be the default value for the numeric id of the object (if it has one) and as the name of the object. Either of these can be rewritten, but I think we should try to deprecate that usage.\r\n\r\nI add a file called parser.py this handles parsing configs for faucet and gauge. It reads in yaml files, builds configs and calls the factories and return fully built valve/gauge objects.\r\n\r\nI added a file which I am currently calling poller.py (I would like a better name for this since it refers to both pollers and event loggers---actually come to think of it maybe logger is a better generic name). This has all the code for the loggers and pollers and the main gauge class sits in its own thread.\r\n\r\nSo I guess the most important question I have is about how we would like routers to be configured going forward. I feel like these should not be tied to vlans, since you might want to route between vlans, but perhaps the ryu bgp design means that makes sense?\r\n\r\nAnd does anyone have any issues with this?\r\n"},"comment":{"url":"https://api.github.com/repos/REANNZ/faucet/issues/comments/236090415","html_url":"https://github.com/REANNZ/faucet/issues/126#issuecomment-236090415","issue_url":"https://api.github.com/repos/REANNZ/faucet/issues/126","id":236090415,"user":{"login":"KitL","id":1981461,"avatar_url":"https://avatars.githubusercontent.com/u/1981461?v=3","gravatar_id":"","url":"https://api.github.com/users/KitL","html_url":"https://github.com/KitL","followers_url":"https://api.github.com/users/KitL/followers","following_url":"https://api.github.com/users/KitL/following{/other_user}","gists_url":"https://api.github.com/users/KitL/gists{/gist_id}","starred_url":"https://api.github.com/users/KitL/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KitL/subscriptions","organizations_url":"https://api.github.com/users/KitL/orgs","repos_url":"https://api.github.com/users/KitL/repos","events_url":"https://api.github.com/users/KitL/events{/privacy}","received_events_url":"https://api.github.com/users/KitL/received_events","type":"User","site_admin":false},"created_at":"2016-07-29T04:12:27Z","updated_at":"2016-07-29T04:12:27Z","body":"Got these working now. Unfortunately when dealing with config you kinda need to document things, so as soon as that is done I'll upstream this. Hopefully monday!"}}
{"actor":{"display_login":"KitL"}}