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

Allow ordering of service templates resource #316

Merged
merged 1 commit into from
Feb 20, 2018

Conversation

jntullo
Copy link

@jntullo jntullo commented Feb 8, 2018

For the new ServiceTemplateTransformationPlan, ordering must happen directly on the service template. Currently, the API only allows ordering through a service catalog. It was discussed with @bzwei that ordering can be allowed in general for a service template, and no special case is needed for the new ServiceTemplateTransformationPlan since there is validation around whether a service template is "orderable".

Sample order without required fields:

POST /api/service_templates/:id
{
   "action": "order"
}

Sample order with required fields:

POST /api/service_templates/:id
{
   "action": "order",
   "required_field_1": "filled in field"
}

@jntullo jntullo force-pushed the service_template_order branch from 5e46950 to b5693a1 Compare February 8, 2018 19:43
@jntullo jntullo changed the title [WIP] Allow ordering of service templates resource Allow ordering of service templates resource Feb 8, 2018
@jntullo jntullo removed the wip label Feb 8, 2018
module Api
module Mixins
module ServiceTemplates
def order_template(id, data)
Copy link
Member

Choose a reason for hiding this comment

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

let's rename to order_service_template

}
expect(response).to have_http_status(:ok)
expect(response.parsed_body).to include(expected)
end
Copy link
Member

Choose a reason for hiding this comment

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

let's add a test on the collection, ordering 2 templates. Thanks.

@@ -2487,6 +2487,8 @@
:identifier: catalogitem_delete
- :name: create
:identifier: atomic_catalogitem_new
- :name: order
:identifier: svc_catalog_provision
Copy link
Member

Choose a reason for hiding this comment

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

don't we need the :validate_action option here too ?

Copy link
Author

Choose a reason for hiding this comment

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

@abellotti it doesn't go on the collection, only on the resource, which is consistent with the other places we have it

Copy link
Member

Choose a reason for hiding this comment

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

👍

@jntullo jntullo force-pushed the service_template_order branch from b5693a1 to 49d4909 Compare February 19, 2018 15:52
For the new ServiceTemplateTransformationPlan, ordering must happen directly on the service template. Currently, the API only allows ordering through a service catalog.
@jntullo jntullo force-pushed the service_template_order branch from 49d4909 to 06e955e Compare February 19, 2018 19:01
@jntullo
Copy link
Author

jntullo commented Feb 19, 2018

Now dependent on ManageIQ/manageiq#17023

@miq-bot
Copy link
Member

miq-bot commented Feb 19, 2018

Checked commit jntullo@06e955e with ruby 2.3.3, rubocop 0.52.0, haml-lint 0.20.0, and yamllint 1.10.0
4 files checked, 0 offenses detected
Everything looks fine. ⭐

@abellotti
Copy link
Member

Thanks @jntullo for the update and enhancement. LGTM!! 👍

@abellotti abellotti merged commit 2de9dcc into ManageIQ:master Feb 20, 2018
@abellotti abellotti added this to the Sprint 80 Ending Feb 26, 2018 milestone Feb 20, 2018
@jntullo jntullo deleted the service_template_order branch February 20, 2018 15:21
simaishi pushed a commit that referenced this pull request Jun 1, 2018
Allow ordering of service templates resource
(cherry picked from commit 2de9dcc)
@simaishi
Copy link
Contributor

simaishi commented Jun 1, 2018

Gaprindashvili backport details:

$ git log -1
commit c952f406381b13e463435946dd8a5d0f56a2ded5
Author: Alberto Bellotti <abellotti@users.noreply.github.com>
Date:   Tue Feb 20 09:59:34 2018 -0500

    Merge pull request #316 from jntullo/service_template_order
    
    Allow ordering of service templates resource
    (cherry picked from commit 2de9dcc3cb04c20f01bee57cbe8de6b7a8b0f4c8)

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.

4 participants