Forum Discussion

doubtsreadyapi's avatar
doubtsreadyapi
Contributor
4 years ago
Solved

Using Ready APi How to SSH into remote servers and run commans

Using Ready APi How to SSH into remote servers and run commands

 

like purging the files, and purging backups in nfsshare

  • richie's avatar
    richie
    4 years ago
    Hey doubtsreadyapi,

    You can but it looks like youll need to download some .jars to support SSHing into your remote endpoint. Just plugging that code into a groovystep wont work on its own. There's an embedded link on the page that looks like it will help.

    However, i want to reiterate what i stated before. Relying on some other component in the jenkins pipeline thats more appropriate for the job would probably make it a lot easier. You could create a putty batch file to login via SSH and then truncate the relevant directory and this would be a LOT easier than trying to do the same thing via readyapi! (https://stackoverflow.com/questions/36979376/how-to-open-putty-using-batch-and-login-then-execute-list-of-commands-on-bash)

    Rich

7 Replies

  • richie's avatar
    richie
    Community Hero
    Hey doubtsreadyapi,

    ReadyAPI! does not do what youre asking. Is there a reason you believe it does?
    ReadyAPI! and SoapUI is/are tools that supports a tester's efforts in exercising an api, it doesn't include functionality to login to a remote endpoint and exercise functionality within that remote endpoint like purging backups etc.

    The only way ReadyAPI!/SoapUI updates/inserts/deletes a resource via an endpoint is if your endpoint includes exposed apis that have methods that support those update/insert/delete transactions (so your endpoint could have 3 apis, 1 http POST method that inserts a new resource, 1 http PUT or PATCH method which updates a resource or 1 http DELETE method which deletesa resource).

    In summary if someone had exposed an api that has been coded to allow you to purge a backup, ReadyAPI!/SoapUI could do this no problem.
    However, unless an api has been coded to support this and exposed allowing the tester to hit it, ReadyAPI!/SoapUI wont be able to do this.

    Cheers,

    Rich
    • doubtsreadyapi's avatar
      doubtsreadyapi
      Contributor

      Hi richie 

       

      Thanks for the information and update, Through groovy script also we can't Achieve to Ssh into remote servers via ReadyAPi? 

       

      Thanks in Advance.

      • richie's avatar
        richie
        Community Hero
        Hey doubtsreadyapi,

        Yep....sure it'd be quite straight forward to SSH into an endpoint using groovyscript but that raises the question of what would be the point of doing this if any further action you want to do isnt possible via ReadyAPI! then surely there is no purpose to logging into the remote endpoint?

        Ta

        Rich