ManageIQ / manageiq

ManageIQ Open-Source Management Platform
https://manageiq.org
Apache License 2.0
1.35k stars 898 forks source link

configuration_script_id required by service_catalog action create is not exposed anywhere #17587

Open greg-at-symcor-dot-com opened 6 years ago

greg-at-symcor-dot-com commented 6 years ago

Trying to create a catalog item via the REST api.

I sent this request:

{
    "action": "create",
    "resources": [
        {
            "config_info": {
                "provision": {
                    "dialog_id": "1000000000003",
                    "fqname": "/AutomationManagement/AnsibleTower/Service/Provisioning/StateMachines/Provision/CatalogItemInitialization",
                    "manager_id": "1000000000012"
                }
            },
            "description": "test catalog item",
            "display": true,
            "long_description": "long description with possibly html fancy stuff",
            "name": "test",
            "options": {},
            "prov_type": "generic_ansible_tower",
            "service_template_catalog_id": "1000000000001",
            "service_type": "atomic",
            "type": "ServiceTemplateAnsibleTower"
        }
    ]
}

Got this back:

"error": {
    "kind": "bad_request",
    "klass": "Api::BadRequestError",
    "message": "Could not create Service Template - Must provide configuration_script_id or configuration"
}

Tried passing ID’s from /api/configuration_script_sources and /api/configuration_script_payloads

Got these errors making me think the id’s are not correct:

"Could not create Service Template - Couldn't find ConfigurationScript with 'id'=1000000000010 [WHERE \"configuration_scripts\".\"type\" IN ('ConfigurationScript', 'ManageIQ::Providers::AutomationManager::ConfigurationScript', 'ManageIQ::Providers::ExternalAutomat
ionManager::ConfigurationScript', 'ManageIQ::Providers::EmbeddedAutomationManager::ConfigurationScript', 'ManageIQ::Providers::AnsibleTower::AutomationManager::ConfigurationScript', 'ManageIQ::Providers::EmbeddedAnsible::AutomationManager::ConfigurationScript')]"

when I crawl through the database I see the script ID i need and hardcoding it in my rest code allows the catalog item to be created. However this is not useful as I want to be able to get the script ID via the rest API which does not appear to be exposed at all.

    vmdb_production=# select id,name from configuration_scripts where type = 'ManageIQ::Providers::AnsibleTower::AutomationManager::ConfigurationScript';
          id       |        name
    ---------------+--------------------
     1000000000074 | myTestScript

Thoughts?

miq-bot commented 5 years ago

This issue has been automatically marked as stale because it has not been updated for at least 6 months.

If you can still reproduce this issue on the current release or on master, please reply with all of the information you have about it in order to keep the issue open.

Thank you for all your contributions!

JPrause commented 5 years ago

@greg-at-symcor-dot-com is this still a valid issue. If not can you close. If there's no update by next week, I'll be closing this issue.

JPrause commented 5 years ago

Closing issue. If you feel the issue needs to remain open, please let me know and it will be reopened. @miq-bot close_issue

greg-at-symcor-dot-com commented 5 years ago

@JPrause To my knowledge this issue was never resolved.

JPrause commented 5 years ago

@greg-at-symcor-dot-com would you like me to reopen this issue?

greg-at-symcor-dot-com commented 5 years ago

@greg-at-symcor-dot-com would you like me to reopen this issue?

@JPrause yes please.

JPrause commented 5 years ago

@miq-bot open_issue

JPrause commented 5 years ago

@miq-bot remove_label stale

miq-bot commented 5 years ago

@JPrause unrecognized command 'open_issue', ignoring...

Accepted commands are: add_label, add_reviewer, assign, close_issue, move_issue, remove_label, rm_label, set_milestone

miq-bot commented 5 years ago

This issue has been automatically marked as stale because it has not been updated for at least 6 months.

If you can still reproduce this issue on the current release or on master, please reply with all of the information you have about it in order to keep the issue open.

Thank you for all your contributions!

JPrause commented 5 years ago

@miq-bot remove_label stale @miq-bot add_label pinned