cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X

Access repository files from other things

Yoshihiko.N
13-Aquamarine

Access repository files from other things

Hi All,

We'd like to access files in repository folder of ThingA from another things which are in the same project like ThingB.

Can we do that ?

 

img.PNG

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Yoshihiko.N 

 

This is definitely possible to copy files from one Repository to another. Please refer to this  link for more details on how to achieve this use-case.

 

You can also make use of Copy Service of FileTransferSubsystem which gives an option to select source and target repository.

 

Do revert back for further query.

View solution in original post

5 REPLIES 5

Hi @Yoshihiko.N 

 

This is definitely possible to copy files from one Repository to another. Please refer to this  link for more details on how to achieve this use-case.

 

You can also make use of Copy Service of FileTransferSubsystem which gives an option to select source and target repository.

 

Do revert back for further query.

Yoshihiko.N
13-Aquamarine
(To:suverma)

@suverma 

Thank you for your quick response.

I confirmed we can use "copy" service in "FileTransferSubsystem".
and I have one more question.

 

How can we call the copy service from services in other things ?

if you provide me code example, I'd be happy.

img.PNG

Hi @Yoshihiko.N 

 

You can try something like below in your custom service where Thing A and Thing B can be your source and target repository: 

Spoiler

var params = {

async: false /* BOOLEAN */,

sourceRepo: "RepoThing" /* STRING */,

targetRepo: "TargetRepo" /* STRING */,

targetFile: "Openssl command.txt" /* STRING */,

targetPath: "/" /* STRING */,

sourceFile: "Openssl command.txt" /* STRING */,

sourcePath: "/" /* STRING */,

timeout: undefined /* INTEGER */

};

// result: INFOTABLE dataShape: FileTransferJob

var result = Subsystems["FileTransferSubsystem"].Copy(params);

Yoshihiko.N
13-Aquamarine
(To:suverma)

@suverma 

Really appreciate for your super quick response !!!

 

I'll try it !!!

Hi @Yoshihiko.N 

 

If the last shared response has resolved our query, please mark the appropriate response as the Accepted Solution for the benefit of others with the same problem.

 

Regards,

Sudeepta

Top Tags