Thank you for supporting the Cloud Customer Connect Community in 2024. It's a gift to work with you!

Look back
You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

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)

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!