Copy to SFTP
Summary:
Experts -
I am trying to automate back up process and move the file to SFTP server with the new REST API Command Copy to SFTP.
Below are the steps.
1- Business groovy rule to create new back up of the application snapshot and rename it.
/STARTCOMPONENT:SCRIPT/
String sdate = new Date()
Date date = Date.parse("E MMM dd HH:mm:ss Z yyyy",sdate)
String new_Date = date. format('ddMMyyy')
def RSname1 = "Artifact Snapshot " + new_Date
import org.json.JSONObject
def body = new JSONObject()
.put("snapshotName", "Artifact Snapshot")
.put("newSnapshotName", RSname1)
def uri = "interop/rest/v2/snapshots/rename"
HttpResponse<String> jsonResponse = operation.application.getConnection("PLANABCUAT").put(uri)