Rename objects via REST API
search cancel

Rename objects via REST API

book

Article ID: 377361

calendar_today

Updated On:

Products

CA Automic Workload Automation - Automation Engine CA Automic One Automation Automic SaaS

Issue/Introduction

Is there a rename option using REST API in v12.3, 21.0 or v24?

Resolution

There is no option to rename anything in 12.3 or 21.0 via REST API

However there is a multi-step way to do this in version 24.X. 

There is a limitation in that there is no way to update any references in the steps below.  So if SCRI.CALL_JOB_TO_RENAME has an ACTIVATE_UC_OBJECT(JOBS.WIN.RENAME_VIA_RESTAPI) in it, and the JOBS object is renamed to JOBS.WIN.RENAME_VIA_RESTAPI.B, there's no way to have the script updated (or any workflows, prompsets, etc...).  It will always point to the original name.  

With this limitation in place  you can:

Run a POST {client}/objects/{object_name}/duplicate

and provide a new name for the duplicated object.  For example, if there is a JOBS.WIN.RENAME_VIA_RESTAPI that should be duplicated to JOBS.WIN.RENAME_VIA_RESTAPI.B in client 100, the following will work:

  1. POST http://{REST API DNS OR IP}:[REST API PORT}/ae/api/v1/0100/objects/JOBS.WIN.RENAME_VIA_RESTAPI/duplicate

    with BODY:

    {
      "name": "JOBS.WIN.RENAME_VIA_RESTAPI.B",
      "path": "OBJECTS/JOBS/RENAME_VIA_RESTAPI"
    }

  2. Then delete the original using the DELETE {client}/objects/{object_name} with the parameter ignore_references=true which will ignore any references like the ACTIVATE_UC_OBJECT in the script mentioned above above.  This would look like:

    DELETE http://{REST API DNS OR IP}:[REST API PORT}/ae/api/v1/0100/objects/JOBS.WIN.RENAME_VIA_RESTAPI/delete
 
This will allow for a duplicate and deletion of the original object, which in essence is a two step process for a rename that ignores references.  
 
 

Additional Information

Support would highly recommend putting in a idea to enhance the REST API for a true rename of object that also takes care of references as this is a good idea for an enhancement to the REST API.  This can be done on our ideation site.