Bug 1806702 - [RFE] API: Support create/edit/delete for /api/policy_profiles
Summary: [RFE] API: Support create/edit/delete for /api/policy_profiles
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: API
Version: 5.11.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: GA
: 5.11.4
Assignee: drew uhlmann
QA Contact: Parthvi Vala
Red Hat CloudForms Documentation
URL:
Whiteboard:
Depends On: 1806701
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-02-24 19:12 UTC by Satoe Imaishi
Modified: 2020-07-15 18:26 UTC (History)
3 users (show)

Fixed In Version: 5.11.4.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1806701
Environment:
Last Closed: 2020-03-17 13:11:39 UTC
Category: ---
Cloudforms Team: CFME Core
Target Upstream Version:
Embargoed:
pm-rhel: cfme-5.11.z+
simaishi: mirror+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2020:0867 0 None None None 2020-03-17 13:11:49 UTC

Comment 2 CFME Bot 2020-02-24 19:17:14 UTC
New commit detected on ManageIQ/manageiq-api/ivanchuk:

https://github.com/ManageIQ/manageiq-api/commit/c330a9c6b8bf41ab1ef1278a1154d717d244e317
commit c330a9c6b8bf41ab1ef1278a1154d717d244e317
Author:     Alberto Bellotti <abellotti.github.com>
AuthorDate: Mon Feb 24 18:03:15 2020 +0000
Commit:     Alberto Bellotti <abellotti.github.com>
CommitDate: Mon Feb 24 18:03:15 2020 +0000

    Merge pull request #749 from gtanzillo/enable-add-edit-policy-profiles

    Enable add and edit resource for /api/policy_profiles endpoint

    (cherry picked from commit 32ea08e8a31da847d5a3cf607733ed75b58bea6f)

    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1806702

 app/controllers/api/policy_profiles_controller.rb | 12 +
 config/api.yml | 11 +-
 spec/requests/policies_spec.rb | 75 +
 3 files changed, 91 insertions(+), 7 deletions(-)

Comment 3 Parthvi Vala 2020-02-26 12:37:28 UTC
PARTIALLY FIXED. Tested on 5.11.4.0.20200224230733_ab25bbf.

Observations:
1. I was able to create a policy profile.
2. I was able to delete the policy profile.
3. I was not able to edit or delete a read only policy profile, which is expected.
4. I was able to edit the policy but **not** via collection.
This is the query I passed and the response received.
POST /api/policy_profiles
{
    "action": "edit",
    "resource": {
        "href": :pp_href
        "id": :pp_id,
        "name": "New name"
    }
}

Response:
{
  "error": {
    "kind": "not_found",
    "message": "Couldn't find MiqPolicySet without an ID",
    "klass": "ActiveRecord::RecordNotFound"
  }
}


Moving this BZ to ASSIGNED since it failed while editing a policy profile via Policy Profiles Collection.
Let me know if this seems wrong.

Comment 4 Parthvi Vala 2020-02-27 13:57:56 UTC
I was probably sending a bad request here because I worked with Drew and it seems to be working. Moving this to Verified.

Comment 7 errata-xmlrpc 2020-03-17 13:11:39 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:0867


Note You need to log in before you can comment on or make changes to this bug.