manageiq-api icon indicating copy to clipboard operation
manageiq-api copied to clipboard

[RFE] Enable/Disable automate domains

Open ThomasBuchinger opened this issue 5 years ago • 11 comments

ManageIQ recently implemented the create_from_git action on /api/automate_domains. By default the new domain is set to disabled. This is by design, because there should be an administrator "approving" the domain, by enabling it manually.

However CI/CD pipelines need to enable the new domains automatically. My particular use case involves generating Automate Domains on the fly, based on pull requests in git. These Domains are pushed to the central git repo as orphaned branch, a call to create_from_git that imports the domain, before the orphaned branch is cleaned up.

A separate action to set the enabled field in MiqAeDomain would solve that problem

Original RFE: https://github.com/ManageIQ/manageiq-api/issues/354 PR: https://github.com/ManageIQ/manageiq-api/pull/571 My Project: https://github.com/ThomasBuchinger/miq-flow/issues/52 Gitter conversation:

  • https://gitter.im/ManageIQ/api?at=5d509e5f4e17537f5215b319
  • https://gitter.im/ManageIQ/api?at=5d52b8b39507182477cedd2b

ThomasBuchinger avatar Aug 13 '19 13:08 ThomasBuchinger

As discussed, in my opinion this should already be possible since it's an attribute and attributes can be modified via PUT/PATCH

Fryguy avatar Aug 13 '19 20:08 Fryguy

if exposed yes, but it is not today. The API needs to be enhanced to support /api/automate_domains updates (post edit action or patch).

From miq_product_features.yml, looks like the user entitlement to be associated with this action would be "miq_ae_domain_edit", so essentially adding:

:post:
- :name: edit
   :identifier: miq_ae_domain_edit

in collection & resource actions for automate_domains.

base controller's update methods should handle this fine unless some other checks are needed in the api controller, should be minor.

/cc @mkanoor

abellotti avatar Aug 13 '19 20:08 abellotti

I did some testing on my Ivanchuck appliance today. And just adding @abellotti snippet to config/api.yml does work for me

POST /api/automate_domains/169
{
    "action": "edit"
    "resource": {
        "enabled": true
    }
}

In theory you could already patch any attribute over API as it is today:

PATCH /api/automate_domains/169
{
    "enabled": true
}

ThomasBuchinger avatar Aug 16 '19 12:08 ThomasBuchinger

PR resolving this issue by @skateman: https://github.com/ManageIQ/manageiq-api/pull/647

abellotti avatar Aug 16 '19 13:08 abellotti

You guys are faster with the implementation, than I am with setting up my development environment Anyway is there anything I can do to get that feature into Ivanchuk down the line? Probably it is best to talk to RedHat support?

Second, I think nobody is currently working on an update to the API reference? I am going to open a PR

ThomasBuchinger avatar Aug 18 '19 14:08 ThomasBuchinger

@abellotti ^

ThomasBuchinger avatar Aug 21 '19 12:08 ThomasBuchinger

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!

miq-bot avatar Feb 24 '20 00:02 miq-bot

@abellotti has this been addressed? can it be closed?

mfeifer avatar Mar 06 '20 14:03 mfeifer

Not yet, discussions are pending with the related PR https://github.com/ManageIQ/manageiq-api/pull/647 so let's keep this open.

abellotti avatar Mar 06 '20 15:03 abellotti

This issue has been automatically marked as stale because it has not been updated for at least 3 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! More information about the ManageIQ triage process can be found in the triage process documentation.

miq-bot avatar Feb 27 '23 00:02 miq-bot

This issue has been automatically closed because it has not been updated for at least 3 months.

Feel free to reopen this issue if this issue is still valid.

Thank you for all your contributions! More information about the ManageIQ triage process can be found in the triage process documentation.

miq-bot avatar May 29 '23 00:05 miq-bot