-
Notifications
You must be signed in to change notification settings - Fork 898
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
Adding support for a format_attributes parameter #14449
Adding support for a format_attributes parameter #14449
Conversation
This is an alternate approach to #14389 which sticks to querying the orchestration stack and not implementing POST actions to fetching virtual attributes. Initial thought was to us providing a virtual attribute in the model for each stdout format provided by AnsibleTower, simply a wrapper call to fetching stdout from the provider with a given parameter, not too much code to add to model each time. No change to API for each, just the model. With this approach, we're leveraging the virtual attribute accessor mechanism of the API, plus introducing a format_attributes= parameter which allows us to simply pass the specified format down to the generic (get_stdout or whatever it gets named) method in the model that's simply sent over to the provider. No additional code in API or model needed for every format they introduce in the future. Other general concerns include:
|
885adc4
to
8dd2ce4
Compare
/cc @gtanzillo @gmcculloug updated as per meeting today, also added specs. |
format_attributes=attr1=format1,attr2=format2,attr3=format3,.... Implementation to support an stdout virtual attribute on orchestration_stacks with optional rendering as follows: GET /api/services/:id/orchestration_stacks ?expand=resources &attributes=stdout &format_attributes=stdout=raw
8dd2ce4
to
0653eaf
Compare
Some comments on commits abellotti/manageiq@0653eaf~...d0701b9 spec/requests/api/services_spec.rb
|
Checked commits abellotti/manageiq@0653eaf~...d0701b9 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 |
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.
👍
Adding support for a format_attributes parameter with syntax:
Implementation to support an stdout virtual attribute on orchestration_stacks with optional attribute rendering as follows: