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

Configuration Script Sources API #13626

Merged
merged 3 commits into from
Feb 7, 2017
Merged

Configuration Script Sources API #13626

merged 3 commits into from
Feb 7, 2017

Conversation

jntullo
Copy link

@jntullo jntullo commented Jan 23, 2017

Add GET /api/configuration_script_sources to the REST api. This is needed to populate the dropdown on the new "Playbook" Service Template Type screen.

@miq-bot add_label enhancement, api
@miq-bot assign @abellotti
cc: @h-kataria

Links

config/api.yml Outdated
@@ -42,6 +42,20 @@
- :subcollection
:verbs: *g
:klass: Account
:ansible_repositories:
:description: Ansible Repositories
Copy link
Member

@abellotti abellotti Jan 23, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking at the exposed class below, are these repositories or playbooks/scripts ? i.e. /api/ansible_scripts or /api/ansible_job_templates maybe ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/cc @bdunne for guidance/suggestions.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a little confused for a few reasons...

  • Does it make sense for this endpoint Ansible specific?
  • Do we usually look at only one subclass rather than the base class?
  • The class doesn't match the endpoint / description

Copy link
Author

@jntullo jntullo Jan 24, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bdunne sorry for the confusion. Per the ticket assigned to me, it was my understanding that this was known as repositories. I should have reached out for more information.

Also based on that ticket and the specific use case of it, I thought it made sense to make an ansible specific endpoint.

cc: @h-kataria

@jntullo jntullo changed the title ansible_repositories API Configuration Script Sources API Jan 25, 2017
config/api.yml Outdated
:collection_actions:
:get:
- :name: read
:identifier: configuration_script_view
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be configuration_script_source_view?

config/api.yml Outdated
:resource_actions:
:get:
- :name: read
:identifier: configuration_script_view
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same

'subcount' => 1,
'name' => 'configuration_script_sources',
'resources' =>
[hash_including('href' => a_string_matching(configuration_script_sources_url(repository.id)))]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this intended to be on a new line?

- :name: List
:description: List Configuration Script Sources
:feature_type: view
:identifier: configuration_script_sources_list
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@h-kataria would appreciate your 👀 - should I wait for #13526 ? I am not sure it makes sense to have it ansible specific after reviewing that, would something like this work?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jntullo, i think it's better to wait, these features will need to be moved under new location once #13526 is merged

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@h-kataria please let us know when the move is done so @jntullo can update accordingly.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RBAC features PR - #13716

@miq-bot
Copy link
Member

miq-bot commented Jan 30, 2017

This pull request is not mergeable. Please rebase and repush.

@miq-bot
Copy link
Member

miq-bot commented Feb 6, 2017

This pull request is not mergeable. Please rebase and repush.

@miq-bot
Copy link
Member

miq-bot commented Feb 7, 2017

Checked commits jntullo/manageiq@fc6dfc6~...dc84f65 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
2 files checked, 0 offenses detected
Everything looks good. 👍

@abellotti
Copy link
Member

LGTM!! Thanks @jntullo

@abellotti abellotti added this to the Sprint 54 Ending Feb 13, 2017 milestone Feb 7, 2017
@abellotti abellotti merged commit a0d42cf into ManageIQ:master Feb 7, 2017
:collection_actions:
:get:
- :name: read
:identifier: embedded_configuration_script_source_view
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not configuration_script_source_view? What is the embedded for?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@Fryguy Fryguy Feb 7, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bdunne There are two subclasses that UI can target: ExternalAutomationManager and EmbededAutomationManager. @lgalis and I discussed and felt that the External ones would be named without any decoration (e.g. configuration_script_source_view), but Embedded would be named with decoration (e.g. embedded_configuration_script_source_view)

Copy link
Member

@Fryguy Fryguy Feb 7, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although, I have to agree with @bdunne about the need for differentiating anything at the API level. A user should just get all of the configuration_script_sources they can see, regardless of what providers they are tied to. If they want ones from a particular provider, they would go through a subcollection.

I understand needing to filter the collection, but how do we do it with respect to something like VMs and Instances (i.e. Infra vs Cloud)

cc @abellotti

@Fryguy
Copy link
Member

Fryguy commented Feb 7, 2017

Yeah ,the more I read into this, the more wrong it seems. Just because the UI needs to differentiate between embedded vs external does not mean the API should at this level. At the top level, I'd expect all configuration_script_resources to be returned regardless of provider (but obivously only the ones I have permission to), and thus I don't understand why the identifier is limited to embedded.

@abellotti
Copy link
Member

@jntullo please hold off on using this new endpoint until we discuss further. API/UI role identifier disconnect and general usage/filtering issues. Thanks.

@jntullo jntullo deleted the enhancement/get_ansible_repositories branch November 28, 2017 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants