-
Notifications
You must be signed in to change notification settings - Fork 25
Implement custom sapcontrol webservices #81
Implement custom sapcontrol webservices #81
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @fabriziosestito . Fantastic work!
Just added some few details.
About your questions. I think the xml
annotations are needed to the marshalling, I'm not sure about the json
ones. @stefanotorresi will know for sure.
If we can remove them, let's remove them.
Edit. Yes, add a link to the full autogenerated code, it will make easier for newcomers
Great work @fabriziosestito ! Thanks for the PR, I didn't find anything worth commenting other than the small typo on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fabriziosestito Green light from my side. If you tested the changes in a real trento env, and it still works the same as before, we can merge
Delegate webservice initialization to webservice constructor, remove viper from the mix.
f1c9b71
to
9923fd3
Compare
I was not sure how I should confidence-test against a real trento env, so I basically exported the contents of the consul kv store from the master/this branch and compared them. master.json Comparing the two shows that only the key names and time-related values are changed. Here the You might need to re-approve the PR since I squashed the fixup commits. |
LGTM |
great stuff! |
This PR decouples trento from sap_host_exporter, introducing
trento/internal/sapsystems/sapcontrol
containing a stripped-down version of thegowsdl
generated soap webservice.Here the
sap_host_exporter
original code for reference: https://github.com/SUSE/sap_host_exporter/tree/master/lib/sapcontrolWebservice and soap client initialization has been moved away from
internal/sapsystem
to the webservice constructor, since we are just using a unix socket here, removing the need to use aviper
configuration object.Adds
mapstructure
tags to webservice result structs.It also refactors tests by removing
sap_host_exporter
dependencygomock
, using themockery
generator to be consistent with the rest of the project.Resolves #79
Some questions:
should we add and link the full generated
gowsdl
code as reference to the documentation (see for example here: https://github.com/SUSE/sap_host_exporter/blob/master/doc/development.md#sapcontrol-web-service)?Are the generated json/xml tags in the webservice's structs necessary?