Patching Credential using API in Ansible Automation Platform only updates parameters but not sub-elements of input parameter individually.

Solution Verified - Updated -

Issue

  • API call for Credential PATCH using curl will only update the sub-element of the parameter inputs mentioned in the command removing other data.

  • Following API call will PATCH the existing credential with new host "https://test2.com" but will remove related parameters like username and password.

    curl -kv --user admin:redhat https://controller.example.com/api/v2/credentials/11/ -H "Content-Type: application/json" -X PATCH -d '{"inputs": {"host": "https://test2.com"}}'
    

Environment

  • Red Hat® Ansible Automation Platform 2.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content