Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

Problem with renaming virtual assets

alemayehu_bofa
alemayehu_bofa Posts: 25

Hello,
Using REST API, i have renamed virtual assets in a remote server (Using the PUT method). The new names of the virtual assets are correctly displayed in the Parasoft client. However, upon downloading the virtual assets locally, the names are not same as the new names of the virtual assets on the remote servers. Please advise.
thank you.

Answers

  • alemayehu_bofa
    alemayehu_bofa Posts: 25

    Follow up question: when renaming with PUT method, are we required to modify all the following elements in the payload to the NEW name?
    1) name
    2) transports:http:path
    3) pvaLocation: id

    when i try to modify three of them at the same time i am getting 404 (in some cases) and sometimes it works...

  • alemayehu_bofa
    alemayehu_bofa Posts: 25

    i am trying to test by converting virtual asset names between two values back and forth... changing the all the three elements in the payload works one way but gives 404 the other way.

  • williammccusker
    williammccusker Posts: 699 ✭✭✭

    Hi,

    Are you trying to rename the virtual asset deployment? Or the pva file? Based on your comment about updating a transport it sounds like you are calling PUT /soavirt/api/v6/virtualAssets. When you call that API the pvaLocation doesn't rename the pva file. It changes what pva file the virtual asset uses. To rename the pva file you would need to call POST /soavirt/api/v6/files/move

  • alemayehu_bofa
    alemayehu_bofa Posts: 25

    hi @williammccusker thanks for the quick reply... I believe the move option would be the preferred approach for what i wanted to accomplish. I will pursue it and see...

  • williammccusker
    williammccusker Posts: 699 ✭✭✭

    Ok, after moving the pva file then you would need to use the PUT call to update the pvaLocation on the virtual asset otherwise it won't work when it redeploys since the pva file moved.

  • alemayehu_bofa
    alemayehu_bofa Posts: 25

    hi @williammccusker following you suggestion, i was able to move the virtual asset file... however, while trying to reploy the pva in the new location, i encountered a 500 error... any idea why?
    by the way, i used the same virtual asset id as the original while trying to redeploy...

  • williammccusker
    williammccusker Posts: 699 ✭✭✭

    What API did you call? You need to call PUT /v6/virtualAssets/{id} and update the pvaLocation with the new name of the moved pva file before it can be redeploy.