Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Topology addHost is broken. #11

Open
flashvoid opened this issue Dec 13, 2015 · 3 comments
Open

Topology addHost is broken. #11

flashvoid opened this issue Dec 13, 2015 · 3 comments
Assignees
Labels

Comments

@flashvoid
Copy link
Contributor

This commit #ce9d91e1e85a3df5af93f7eaeb6fb57b2b5b2c07 introduces change that brakes syntax for registering new host in topology.

What is done: Adding a host using following syntax

curl -v -H 'Accept: application/json' -H 'Content-Type: application/json' 
    http://192.168.0.10:9603/hosts 
    -XPOST 
    -d '{"Ip" : "192.168.0.12", "Name": "ip-192-168-0-12", "RomanaIp" : "10.1.0.0/16", "AgentPort" : 8899 }'

Expecting result: Host created with all fields recognised

{"id":"14","name":"ip-192-168-0-12","ip":"192.168.0.12","romana_ip":"10.1.0.0/16","agentPort":8899,"links":null}

Actual result: Host created with romana_ip field empty

{"id":"9","name":"ip-192-168-0-12","ip":"192.168.0.12","romana_ip":"","agentPort":8899,"links":null

Additional information: since #ce9d91e1e85 following syntax works, but it mixes different spelling conventions together.

curl -v -H 'Accept: application/json' -H 'Content-Type: application/json' http://192.168.0.10:9603/hosts -XPOST -d '{"Ip" : "192.168.0.12", "Name": "ip-192-168-0-12", "romana_ip" : "10.1.0.0/16", "AgentPort" : 8899 }'
@debedb
Copy link
Contributor

debedb commented Dec 14, 2015

The syntax should really be underscore_fields for JSON, not CamelCase... That change was to make tests pass, and indeed it should be correct... JSON should really be underscore... So let's see what it broke - I mean which request was calling the addHost?

@flashvoid
Copy link
Contributor Author

You see, in form fields i'm using CamelCase, it's mostly recognised but response comes in underscore_case. I don't really care which one to use, but your tools are expecting CamelCase most of the time.

I'm calling addHost in this script https://github.com/romana/romana/blob/test/core-pr/POC/ansible/poc-topology.sh

@debedb
Copy link
Contributor

debedb commented Dec 14, 2015

Which revision is it?

pritesh added a commit that referenced this issue Jun 17, 2016
This PR is against feature/gg/external_id
pritesh added a commit that referenced this issue Sep 29, 2016
Implement dynamic romana segment creation via CNI plugin
pritesh added a commit that referenced this issue Nov 29, 2016
Implement dynamic romana segment creation via CNI plugin
pritesh added a commit that referenced this issue Nov 29, 2016
Combine PR #9 and #10 (Card #443 #445) in a single one.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants