Airavata Managed File Transfer Service and Clients
/bin/bash build.sh
/bin/bash start-consul.sh <os distribution>
. For example /bin/bash start-consul.sh mac
. You can see supported distributions by running /bin/bash start-consul.sh -h
/bin/bash start-mft.sh
. This will start all the services and an Agent to transfer data/bin/bash start-mft.sh
/bin/bash log.sh <service name>
. For example, /bin/bash log.sh secret
. To view available services, run /bin/bash log.sh -h
This sample is for the Java gRPC client of MFT API. Request resource ids and secret ids are analogous to default values in secret.json and resources.json files available for File based backends.
You should have mft-api-client dependency in your project
<dependency> <groupId>org.apache.airavata</groupId> <artifactId>mft-api-client</artifactId> <version>0.01-SNAPSHOT</version> </dependency>
import org.apache.airavata.mft.api.client.MFTApiClient; import org.apache.airavata.mft.api.service.*; public class SampleClient { public static void main(String args[]) throws InterruptedException { MFTApiServiceGrpc.MFTApiServiceBlockingStub client = MFTApiClient.buildClient("localhost", 7004); String sourceId = "remote-ssh-resource2"; String sourceToken = "local-ssh-cred"; String destId = "remote-ssh-resource"; String destToken = "local-ssh-cred"; TransferApiRequest request = TransferApiRequest.newBuilder() .setSourceId(sourceId) .setSourceToken(sourceToken) .setSourceType("SCP") .setDestinationId(destId) .setDestinationToken(destToken) .setDestinationType("SCP") .setAffinityTransfer(false).build(); // Submitting the transfer to MFT TransferApiResponse transferApiResponse = client.submitTransfer(request); while(true) { // Monitoring transfer status try { TransferStateApiResponse transferState = client.getTransferState(TransferStateApiRequest.newBuilder().setTransferId(transferApiResponse.getTransferId()).build()); System.out.println("Latest Transfer State " + transferState.getState()); } catch (Exception e) { System.out.println("Errored " + e.getMessage()); } Thread.sleep(1000); } } }