This is an automated email from the ASF dual-hosted git repository.
dimuthuupe pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airavata-mft.git
The following commit(s) were added to refs/heads/master by this push:
new 65d721a Removing java cli as python cli replaces it
65d721a is described below
commit 65d721a2a8bd5a9d8134f4113106590fba251422
Author: Dimuthu Wannipurage <[email protected]>
AuthorDate: Thu Feb 2 13:10:27 2023 -0500
Removing java cli as python cli replaces it
---
command-line/pom.xml | 91 ------------------
.../airavata/mft/command/line/CommandLineUtil.java | 37 -------
.../airavata/mft/command/line/MainRunner.java | 38 --------
.../mft/command/line/sub/gcs/GCSAddSubCommand.java | 93 ------------------
.../command/line/sub/gcs/GCSRemoteSubCommand.java | 106 ---------------------
.../mft/command/line/sub/gcs/GCSSubCommand.java | 24 -----
.../line/sub/odata/ODataRemoteAddSubCommand.java | 76 ---------------
.../line/sub/odata/ODataRemoteSubCommand.java | 57 -----------
.../command/line/sub/odata/ODataSubCommand.java | 26 -----
.../mft/command/line/sub/s3/S3SubCommand.java | 28 ------
.../sub/s3/storage/S3StorageAddSubCommand.java | 89 -----------------
.../line/sub/s3/storage/S3StorageSubCommand.java | 69 --------------
.../command/line/sub/swift/SwiftAddSubCommand.java | 99 -------------------
.../line/sub/swift/SwiftRemoteSubCommand.java | 24 -----
.../command/line/sub/swift/SwiftSubCommand.java | 25 -----
.../sub/transfer/SubmitTransferSubCommand.java | 83 ----------------
.../line/sub/transfer/TransferStateSubCommand.java | 91 ------------------
.../line/sub/transfer/TransferSubCommand.java | 25 -----
pom.xml | 8 +-
19 files changed, 7 insertions(+), 1082 deletions(-)
diff --git a/command-line/pom.xml b/command-line/pom.xml
deleted file mode 100644
index 520d5ec..0000000
--- a/command-line/pom.xml
+++ /dev/null
@@ -1,91 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
-
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <parent>
- <artifactId>airavata-mft</artifactId>
- <groupId>org.apache.airavata</groupId>
- <version>0.01-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
-
- <artifactId>mft-command-line</artifactId>
-
- <properties>
- <maven.compiler.source>11</maven.compiler.source>
- <maven.compiler.target>11</maven.compiler.target>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.airavata</groupId>
- <artifactId>mft-api-client</artifactId>
- <version>0.01-SNAPSHOT</version>
- <exclusions>
- <exclusion>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>info.picocli</groupId>
- <artifactId>picocli</artifactId>
- <version>4.6.3</version>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-assembly-plugin</artifactId>
- <version>3.1.1</version>
-
- <configuration>
- <descriptorRefs>
- <descriptorRef>jar-with-dependencies</descriptorRef>
- </descriptorRefs>
- <archive>
- <manifest>
-
<mainClass>org.apache.airavata.mft.command.line.MainRunner</mainClass>
- </manifest>
- </archive>
- </configuration>
-
- <executions>
- <execution>
- <id>make-assembly</id>
- <phase>package</phase>
- <goals>
- <goal>single</goal>
- </goals>
- </execution>
- </executions>
-
- </plugin>
- </plugins>
- </build>
-
-</project>
\ No newline at end of file
diff --git
a/command-line/src/main/java/org/apache/airavata/mft/command/line/CommandLineUtil.java
b/command-line/src/main/java/org/apache/airavata/mft/command/line/CommandLineUtil.java
deleted file mode 100644
index 9a8446c..0000000
---
a/command-line/src/main/java/org/apache/airavata/mft/command/line/CommandLineUtil.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.airavata.mft.command.line;
-
-public final class CommandLineUtil {
-
- public static void printTable(int[] columnWidths, String[][] content) {
- for (String[] row : content) {
- for (int i = 0; i < columnWidths.length; i++) {
- System.out.print("|");
- for (int loc = 0; loc < columnWidths[i]; loc++) {
- if (row[i].length() > loc) {
- System.out.print(row[i].charAt(loc));
- } else {
- System.out.print(" ");
- }
- }
- }
- System.out.println("|");
- }
- }
-}
diff --git
a/command-line/src/main/java/org/apache/airavata/mft/command/line/MainRunner.java
b/command-line/src/main/java/org/apache/airavata/mft/command/line/MainRunner.java
deleted file mode 100644
index 355acb8..0000000
---
a/command-line/src/main/java/org/apache/airavata/mft/command/line/MainRunner.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.airavata.mft.command.line;
-
-import org.apache.airavata.mft.command.line.sub.gcs.GCSSubCommand;
-import org.apache.airavata.mft.command.line.sub.odata.ODataSubCommand;
-import org.apache.airavata.mft.command.line.sub.s3.S3SubCommand;
-import org.apache.airavata.mft.command.line.sub.swift.SwiftSubCommand;
-import org.apache.airavata.mft.command.line.sub.transfer.TransferSubCommand;
-import picocli.CommandLine;
-import picocli.CommandLine.Command;
-
-@Command(name = "checksum", mixinStandardHelpOptions = true, version =
"checksum 4.0",
- description = "Prints the checksum (SHA-256 by default) of a file to
STDOUT.",
- subcommands = {S3SubCommand.class, TransferSubCommand.class,
SwiftSubCommand.class, ODataSubCommand.class, GCSSubCommand.class})
-class MainRunner {
-
- public static void main(String... args) {
- int exitCode = new CommandLine(new MainRunner())
- .execute(args);
- System.exit(exitCode);
- }
-}
diff --git
a/command-line/src/main/java/org/apache/airavata/mft/command/line/sub/gcs/GCSAddSubCommand.java
b/command-line/src/main/java/org/apache/airavata/mft/command/line/sub/gcs/GCSAddSubCommand.java
deleted file mode 100644
index 5b129e3..0000000
---
a/command-line/src/main/java/org/apache/airavata/mft/command/line/sub/gcs/GCSAddSubCommand.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.airavata.mft.command.line.sub.gcs;
-
-import org.apache.airavata.mft.api.client.MFTApiClient;
-import org.apache.airavata.mft.common.AuthToken;
-import org.apache.airavata.mft.credential.stubs.gcs.GCSSecret;
-import org.apache.airavata.mft.credential.stubs.gcs.GCSSecretCreateRequest;
-import org.apache.airavata.mft.resource.service.gcs.GCSStorageServiceGrpc;
-import org.apache.airavata.mft.resource.stubs.gcs.storage.GCSStorage;
-import
org.apache.airavata.mft.resource.stubs.gcs.storage.GCSStorageCreateRequest;
-import org.apache.airavata.mft.resource.stubs.storage.common.SecretForStorage;
-import
org.apache.airavata.mft.resource.stubs.storage.common.StorageCommonServiceGrpc;
-import org.apache.airavata.mft.resource.stubs.storage.common.StorageType;
-import picocli.CommandLine;
-
-import java.util.concurrent.Callable;
-
[email protected]( name = "add" )
-public class GCSAddSubCommand implements Callable<Integer>
-{
-
- @CommandLine.Option( names = {"-n", "--name"}, description = "Storage
Name" )
- private String name;
-
- @CommandLine.Option( names = {"-b", "--bucket"}, description = "Bucket
Name" )
- private String bucket;
-
- @CommandLine.Option( names = {"-s", "--storageId"}, description = "Storage
ID" )
- private String storageId;
-
- @CommandLine.Option( names = {"-pid", "--projectId"}, description =
"Project Id", required = true )
- private String projectId;
-
- @CommandLine.Option( names = {"-p", "--privateKey"}, description =
"Private Key", required = true )
- private String privateKey;
-
- @CommandLine.Option( names = {"-c", "--clientEmail"}, description =
"Client Email", required = true )
- private String clientEmail;
-
-
-
- @Override
- public Integer call() throws Exception
- {
- AuthToken authToken = AuthToken.newBuilder().build();
-
- MFTApiClient mftApiClient =
MFTApiClient.MFTApiClientBuilder.newBuilder().build();
-
- GCSSecret gcsSecret = mftApiClient.getSecretServiceClient().gcs().
- createGCSSecret( GCSSecretCreateRequest.newBuilder().
- setProjectId( projectId ).
- setPrivateKey( privateKey ).
- setClientEmail( clientEmail ).
- setAuthzToken( authToken ).build() );
-
- System.out.println( "Created the gcs secret " +
gcsSecret.getSecretId() );
-
- GCSStorageServiceGrpc.GCSStorageServiceBlockingStub gcsStorageClient =
- mftApiClient.getStorageServiceClient().gcs();
-
- GCSStorage gcsStorage = gcsStorageClient.createGCSStorage(
GCSStorageCreateRequest.newBuilder()
- .setStorageId( storageId )
- .setBucketName( bucket )
- .setName( name ).build() );
- System.out.println( "Created gcs storage " + gcsStorage.getStorageId()
);
-
- StorageCommonServiceGrpc.StorageCommonServiceBlockingStub commonClient
= mftApiClient.getStorageServiceClient().common();
- commonClient.registerSecretForStorage(SecretForStorage.newBuilder()
- .setStorageId(gcsStorage.getStorageId())
- .setSecretId(gcsSecret.getSecretId())
- .setStorageType(StorageType.GCS).build());
-
- System.out.println( "Storage Id " + gcsStorage.getStorageId() );
-
- return 0;
- }
-}
diff --git
a/command-line/src/main/java/org/apache/airavata/mft/command/line/sub/gcs/GCSRemoteSubCommand.java
b/command-line/src/main/java/org/apache/airavata/mft/command/line/sub/gcs/GCSRemoteSubCommand.java
deleted file mode 100644
index 08a7801..0000000
---
a/command-line/src/main/java/org/apache/airavata/mft/command/line/sub/gcs/GCSRemoteSubCommand.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.airavata.mft.command.line.sub.gcs;
-
-import org.apache.airavata.mft.api.client.MFTApiClient;
-import org.apache.airavata.mft.command.line.CommandLineUtil;
-import org.apache.airavata.mft.resource.stubs.gcs.storage.GCSStorage;
-import
org.apache.airavata.mft.resource.stubs.gcs.storage.GCSStorageDeleteRequest;
-import
org.apache.airavata.mft.resource.stubs.gcs.storage.GCSStorageDeleteResponse;
-import org.apache.airavata.mft.resource.stubs.gcs.storage.GCSStorageGetRequest;
-import
org.apache.airavata.mft.resource.stubs.gcs.storage.GCSStorageListRequest;
-import
org.apache.airavata.mft.resource.stubs.gcs.storage.GCSStorageListResponse;
-import picocli.CommandLine;
-
-import java.util.ArrayList;
-import java.util.List;
-
[email protected]( name = "remote", subcommands = {GCSAddSubCommand.class} )
-public class GCSRemoteSubCommand
-{
-
- @CommandLine.Command( name = "get" )
- void getGSCResource( @CommandLine.Parameters( index = "0" ) String
resourceId )
- {
- System.out.println( "Getting GCS Resource " + resourceId );
- MFTApiClient mftApiClient =
MFTApiClient.MFTApiClientBuilder.newBuilder().build();
-
- GCSStorage gcsStorage = mftApiClient.getStorageServiceClient().gcs()
- .getGCSStorage(
GCSStorageGetRequest.newBuilder().setStorageId( resourceId ).build() );
-
- List<GCSStorage> storagesList = new ArrayList<>();
- storagesList.add( gcsStorage );
-
- int[] columnWidth = {40, 15, 15};
- String[][] content = new String[storagesList.size() + 1][3];
- String[] headers = {"STORAGE ID", "NAME", "BUCKET"};
- content[0] = headers;
-
- for ( int i = 1; i <= storagesList.size(); i++ )
- {
- GCSStorage gcs= storagesList.get( i - 1 );
- content[i][0] = gcs.getStorageId();
- content[i][1] = gcs.getName();
- content[i][2] = gcs.getBucketName();
- }
- CommandLineUtil.printTable( columnWidth, content );
- }
-
- @CommandLine.Command( name = "delete" )
- void deleteGCSResource( @CommandLine.Parameters( index = "0" ) String
resourceId )
- {
- System.out.println( "Deleting GCS Resource " + resourceId );
- MFTApiClient mftApiClient =
MFTApiClient.MFTApiClientBuilder.newBuilder().build();
-
- GCSStorageDeleteResponse gcsStorageDeleteResponse =
mftApiClient.getStorageServiceClient().gcs()
- .deleteGCSStorage(
GCSStorageDeleteRequest.newBuilder().setStorageId( resourceId ).build() );
- System.out.println( "Delete GCS Resource status : " +
gcsStorageDeleteResponse.getStatus() );
-
- }
-
- @CommandLine.Command( name = "list" )
- void listS3Resource()
- {
- System.out.println( "Listing GSC Resource" );
- MFTApiClient mftApiClient =
MFTApiClient.MFTApiClientBuilder.newBuilder().build();
-
- GCSStorageListResponse gcsStorageListResponse =
mftApiClient.getStorageServiceClient().gcs()
- .listGCSStorage( GCSStorageListRequest.newBuilder().setOffset(
0 ).setLimit( 10 ).build() );
-
- List<GCSStorage> storagesList =
gcsStorageListResponse.getStoragesList();
-
- int[] columnWidth = {40, 15, 15};
- String[][] content = new String[storagesList.size() + 1][3];
- String[] headers = {"STORAGE ID", "NAME", "BUCKET"};
- content[0] = headers;
-
-
- for ( int i = 1; i <= storagesList.size(); i++ )
- {
- GCSStorage gcsStorage = storagesList.get( i - 1 );
- content[i][0] = gcsStorage.getStorageId();
- content[i][1] = gcsStorage.getName();
- content[i][2] = gcsStorage.getBucketName();
-
- }
-
- CommandLineUtil.printTable( columnWidth, content );
- }
-
-
-}
diff --git
a/command-line/src/main/java/org/apache/airavata/mft/command/line/sub/gcs/GCSSubCommand.java
b/command-line/src/main/java/org/apache/airavata/mft/command/line/sub/gcs/GCSSubCommand.java
deleted file mode 100644
index bdacccb..0000000
---
a/command-line/src/main/java/org/apache/airavata/mft/command/line/sub/gcs/GCSSubCommand.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.airavata.mft.command.line.sub.gcs;
-
-import picocli.CommandLine;
-
[email protected]( name = "gcs", description = "Manage GCS resources and
credentials",
- subcommands = {GCSRemoteSubCommand.class} )
-public class GCSSubCommand {
-}
diff --git
a/command-line/src/main/java/org/apache/airavata/mft/command/line/sub/odata/ODataRemoteAddSubCommand.java
b/command-line/src/main/java/org/apache/airavata/mft/command/line/sub/odata/ODataRemoteAddSubCommand.java
deleted file mode 100644
index 81cda2a..0000000
---
a/command-line/src/main/java/org/apache/airavata/mft/command/line/sub/odata/ODataRemoteAddSubCommand.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.airavata.mft.command.line.sub.odata;
-
-import org.apache.airavata.mft.api.client.MFTApiClient;
-import org.apache.airavata.mft.common.AuthToken;
-import org.apache.airavata.mft.credential.stubs.odata.ODataSecret;
-import org.apache.airavata.mft.credential.stubs.odata.ODataSecretCreateRequest;
-import org.apache.airavata.mft.resource.stubs.odata.storage.ODataStorage;
-import
org.apache.airavata.mft.resource.stubs.odata.storage.ODataStorageCreateRequest;
-import org.apache.airavata.mft.resource.stubs.storage.common.SecretForStorage;
-import
org.apache.airavata.mft.resource.stubs.storage.common.StorageCommonServiceGrpc;
-import org.apache.airavata.mft.resource.stubs.storage.common.StorageType;
-import picocli.CommandLine;
-
-import java.util.concurrent.Callable;
-
[email protected](name = "add")
-public class ODataRemoteAddSubCommand implements Callable<Integer> {
-
- @CommandLine.Option(names = {"-n", "--name"}, description = "Storage
Name", required = true)
- private String remoteName;
-
- @CommandLine.Option(names = {"-U", "--url"}, description = "Base URL for
OData Endpoint", required = true)
- private String baseURL;
-
- @CommandLine.Option(names = {"-u", "--user"}, description = "User Name",
required = true)
- private String userName;
-
- @CommandLine.Option(names = {"-p", "--password"}, description =
"Password", required = true)
- private String password;
-
-
- @Override
- public Integer call() throws Exception {
- AuthToken authToken = AuthToken.newBuilder().build();
-
- MFTApiClient mftApiClient =
MFTApiClient.MFTApiClientBuilder.newBuilder().build();
-
- ODataSecret oDataSecret =
mftApiClient.getSecretServiceClient().odata().createODataSecret(ODataSecretCreateRequest.newBuilder()
-
.setAuthzToken(authToken).setPassword(password).setUserName(userName).build());
-
- System.out.println("Created the OData secret " +
oDataSecret.getSecretId());
-
- ODataStorage oDataStorage =
mftApiClient.getStorageServiceClient().odata().createODataStorage(
-
ODataStorageCreateRequest.newBuilder().setName(remoteName).setBaseUrl(baseURL).build());
-
- System.out.println("Created OData storage " +
oDataStorage.getStorageId());
-
- StorageCommonServiceGrpc.StorageCommonServiceBlockingStub
commonStorageClient = mftApiClient.getStorageServiceClient().common();
-
-
commonStorageClient.registerSecretForStorage(SecretForStorage.newBuilder()
- .setStorageId(oDataStorage.getStorageId())
- .setSecretId(oDataSecret.getSecretId())
- .setStorageType(StorageType.ODATA).build());
-
- System.out.println("Successfully added OData remote endpoint");
-
- return 0;
- }
-}
diff --git
a/command-line/src/main/java/org/apache/airavata/mft/command/line/sub/odata/ODataRemoteSubCommand.java
b/command-line/src/main/java/org/apache/airavata/mft/command/line/sub/odata/ODataRemoteSubCommand.java
deleted file mode 100644
index 3628a73..0000000
---
a/command-line/src/main/java/org/apache/airavata/mft/command/line/sub/odata/ODataRemoteSubCommand.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.airavata.mft.command.line.sub.odata;
-
-import org.apache.airavata.mft.api.client.MFTApiClient;
-import org.apache.airavata.mft.command.line.CommandLineUtil;
-import org.apache.airavata.mft.resource.stubs.odata.storage.ODataStorage;
-import
org.apache.airavata.mft.resource.stubs.odata.storage.ODataStorageListRequest;
-import
org.apache.airavata.mft.resource.stubs.odata.storage.ODataStorageListResponse;
-import picocli.CommandLine;
-
-import java.util.List;
-
[email protected](name = "remote", subcommands =
{ODataRemoteAddSubCommand.class})
-public class ODataRemoteSubCommand {
-
- @CommandLine.Command(name = "list")
- void listS3Resource() {
- System.out.println("Listing S3 Resource");
- MFTApiClient mftApiClient =
MFTApiClient.MFTApiClientBuilder.newBuilder().build();
-
- ODataStorageListResponse oDataStorageListResponse =
mftApiClient.getStorageServiceClient().odata()
-
.listODataStorage(ODataStorageListRequest.newBuilder().setOffset(0).setLimit(10).build());
-
- List<ODataStorage> storagesList =
oDataStorageListResponse.getStoragesList();
-
- int[] columnWidth = {40, 15, 55,};
- String[][] content = new String[storagesList.size() + 1][3];
- String[] headers = {"STORAGE ID", "NAME", "BASE URL"};
- content[0] = headers;
-
-
- for (int i = 1; i <= storagesList.size(); i ++) {
- ODataStorage storage = storagesList.get(i - 1);
- content[i][0] = storage.getStorageId();
- content[i][1] = storage.getName();
- content[i][2] = storage.getBaseUrl();
- }
-
- CommandLineUtil.printTable(columnWidth, content);
- }
-}
diff --git
a/command-line/src/main/java/org/apache/airavata/mft/command/line/sub/odata/ODataSubCommand.java
b/command-line/src/main/java/org/apache/airavata/mft/command/line/sub/odata/ODataSubCommand.java
deleted file mode 100644
index c2b4ae9..0000000
---
a/command-line/src/main/java/org/apache/airavata/mft/command/line/sub/odata/ODataSubCommand.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.airavata.mft.command.line.sub.odata;
-
-import org.apache.airavata.mft.command.line.sub.swift.SwiftRemoteSubCommand;
-import picocli.CommandLine;
-
[email protected](name = "odata", description = "Manage OData resources and
credentials",
- subcommands = {ODataRemoteSubCommand.class})
-public class ODataSubCommand {
-}
diff --git
a/command-line/src/main/java/org/apache/airavata/mft/command/line/sub/s3/S3SubCommand.java
b/command-line/src/main/java/org/apache/airavata/mft/command/line/sub/s3/S3SubCommand.java
deleted file mode 100644
index 93f985e..0000000
---
a/command-line/src/main/java/org/apache/airavata/mft/command/line/sub/s3/S3SubCommand.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.airavata.mft.command.line.sub.s3;
-
-import org.apache.airavata.mft.command.line.sub.s3.storage.S3StorageSubCommand;
-import picocli.CommandLine;
-
[email protected](name = "s3", description = "Manage S3 resources and
credentials",
- subcommands = {S3StorageSubCommand.class})
-public class S3SubCommand {
-
-
-}
diff --git
a/command-line/src/main/java/org/apache/airavata/mft/command/line/sub/s3/storage/S3StorageAddSubCommand.java
b/command-line/src/main/java/org/apache/airavata/mft/command/line/sub/s3/storage/S3StorageAddSubCommand.java
deleted file mode 100644
index b90f1f7..0000000
---
a/command-line/src/main/java/org/apache/airavata/mft/command/line/sub/s3/storage/S3StorageAddSubCommand.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.airavata.mft.command.line.sub.s3.storage;
-
-import org.apache.airavata.mft.api.client.MFTApiClient;
-import org.apache.airavata.mft.common.AuthToken;
-import org.apache.airavata.mft.credential.stubs.s3.S3Secret;
-import org.apache.airavata.mft.credential.stubs.s3.S3SecretCreateRequest;
-import org.apache.airavata.mft.resource.service.s3.S3StorageServiceGrpc;
-import org.apache.airavata.mft.resource.stubs.s3.storage.S3Storage;
-import
org.apache.airavata.mft.resource.stubs.s3.storage.S3StorageCreateRequest;
-import org.apache.airavata.mft.resource.stubs.storage.common.SecretForStorage;
-import
org.apache.airavata.mft.resource.stubs.storage.common.StorageCommonServiceGrpc;
-import org.apache.airavata.mft.resource.stubs.storage.common.StorageType;
-import picocli.CommandLine;
-
-import java.util.concurrent.Callable;
-
[email protected](name = "add")
-public class S3StorageAddSubCommand implements Callable<Integer> {
-
- @CommandLine.Option(names = {"-n", "--name"}, description = "Storage
Name", required = true)
- private String remoteName;
-
- @CommandLine.Option(names = {"-b", "--bucket"}, description = "Bucket
Name", required = true)
- private String bucket;
-
- @CommandLine.Option(names = {"-r", "--region"}, description = "Region",
required = true)
- private String region;
-
- @CommandLine.Option(names = {"-e", "--endpoint"}, description = "S3 API
Endpoint. For AWS S3 use https://s3.<REGION>.amazonaws.com", required = true)
- private String endpoint;
-
- @CommandLine.Option(names = {"-k", "--key"}, description = "Access Key",
required = true)
- private String accessKey;
-
- @CommandLine.Option(names = {"-s", "--secret"}, description = "Access
Secret", required = true)
- private String accessSecret;
-
- @CommandLine.Option(names = {"-t", "--token"}, description = "Session
Token", defaultValue = "")
- private String sessionToken;
-
- @Override
- public Integer call() throws Exception {
-
- AuthToken authToken = AuthToken.newBuilder().build();
-
- MFTApiClient mftApiClient =
MFTApiClient.MFTApiClientBuilder.newBuilder().build();
-
- S3Secret s3Secret = mftApiClient.getSecretServiceClient().s3()
- .createS3Secret(S3SecretCreateRequest.newBuilder()
- .setAccessKey(accessKey)
- .setSecretKey(accessSecret)
- .setSessionToken(sessionToken)
- .setAuthzToken(authToken).build());
-
- S3StorageServiceGrpc.S3StorageServiceBlockingStub s3StorageClient =
mftApiClient.getStorageServiceClient().s3();
- StorageCommonServiceGrpc.StorageCommonServiceBlockingStub
commonStorageClient = mftApiClient.getStorageServiceClient().common();
-
- S3Storage s3Storage =
s3StorageClient.createS3Storage(S3StorageCreateRequest.newBuilder()
- .setName(remoteName)
- .setEndpoint(endpoint)
- .setBucketName(bucket)
- .setRegion(region).build());
-
-
commonStorageClient.registerSecretForStorage(SecretForStorage.newBuilder()
- .setStorageId(s3Storage.getStorageId())
- .setSecretId(s3Secret.getSecretId())
- .setStorageType(StorageType.S3).build());
-
- System.out.println("Storage Id " + s3Storage.getStorageId());
- return 0;
- }
-}
diff --git
a/command-line/src/main/java/org/apache/airavata/mft/command/line/sub/s3/storage/S3StorageSubCommand.java
b/command-line/src/main/java/org/apache/airavata/mft/command/line/sub/s3/storage/S3StorageSubCommand.java
deleted file mode 100644
index de2e722..0000000
---
a/command-line/src/main/java/org/apache/airavata/mft/command/line/sub/s3/storage/S3StorageSubCommand.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.airavata.mft.command.line.sub.s3.storage;
-
-import org.apache.airavata.mft.api.client.MFTApiClient;
-import org.apache.airavata.mft.command.line.CommandLineUtil;
-import org.apache.airavata.mft.resource.stubs.s3.storage.S3Storage;
-import org.apache.airavata.mft.resource.stubs.s3.storage.S3StorageListRequest;
-import org.apache.airavata.mft.resource.stubs.s3.storage.S3StorageListResponse;
-import picocli.CommandLine;
-
-import java.util.List;
-
[email protected](name = "remote", subcommands =
{S3StorageAddSubCommand.class})
-public class S3StorageSubCommand {
-
- @CommandLine.Command(name = "delete")
- void deleteS3Resource(@CommandLine.Parameters(index = "0") String
resourceId) {
- System.out.println("Deleting S3 Resource " + resourceId);
- }
-
- @CommandLine.Command(name = "list")
- void listS3Resource() {
- System.out.println("Listing S3 Resource");
- MFTApiClient mftApiClient =
MFTApiClient.MFTApiClientBuilder.newBuilder().build();
-
- S3StorageListResponse s3StorageListResponse =
mftApiClient.getStorageServiceClient().s3()
-
.listS3Storage(S3StorageListRequest.newBuilder().setOffset(0).setLimit(10).build());
-
- List<S3Storage> storagesList = s3StorageListResponse.getStoragesList();
-
- int[] columnWidth = {40, 15, 15, 15, 35};
- String[][] content = new String[storagesList.size() + 1][5];
- String[] headers = {"STORAGE ID", "NAME", "BUCKET", "REGION",
"ENDPOINT"};
- content[0] = headers;
-
-
- for (int i = 1; i <= storagesList.size(); i ++) {
- S3Storage s3Storage = storagesList.get(i - 1);
- content[i][0] = s3Storage.getStorageId();
- content[i][1] = s3Storage.getName();
- content[i][2] = s3Storage.getBucketName();
- content[i][3] = s3Storage.getRegion();
- content[i][4] = s3Storage.getEndpoint();
- }
-
- CommandLineUtil.printTable(columnWidth, content);
- }
-
- @CommandLine.Command(name = "get")
- void getS3Resource(@CommandLine.Parameters(index = "0") String resourceId)
{
- System.out.println("Getting S3 Resource " + resourceId);
- }
-}
diff --git
a/command-line/src/main/java/org/apache/airavata/mft/command/line/sub/swift/SwiftAddSubCommand.java
b/command-line/src/main/java/org/apache/airavata/mft/command/line/sub/swift/SwiftAddSubCommand.java
deleted file mode 100644
index d53eddf..0000000
---
a/command-line/src/main/java/org/apache/airavata/mft/command/line/sub/swift/SwiftAddSubCommand.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.airavata.mft.command.line.sub.swift;
-
-import org.apache.airavata.mft.api.client.MFTApiClient;
-import org.apache.airavata.mft.common.AuthToken;
-import org.apache.airavata.mft.credential.stubs.swift.SwiftPasswordSecret;
-import org.apache.airavata.mft.credential.stubs.swift.SwiftSecret;
-import org.apache.airavata.mft.credential.stubs.swift.SwiftSecretCreateRequest;
-import org.apache.airavata.mft.resource.stubs.storage.common.SecretForStorage;
-import
org.apache.airavata.mft.resource.stubs.storage.common.StorageCommonServiceGrpc;
-import org.apache.airavata.mft.resource.stubs.storage.common.StorageType;
-import org.apache.airavata.mft.resource.stubs.swift.storage.SwiftStorage;
-import
org.apache.airavata.mft.resource.stubs.swift.storage.SwiftStorageCreateRequest;
-import picocli.CommandLine;
-
-import java.util.concurrent.Callable;
-
[email protected](name = "add")
-public class SwiftAddSubCommand implements Callable<Integer> {
-
- @CommandLine.Option(names = {"-n", "--name"}, description = "Storage
Name", required = true)
- private String remoteName;
-
- @CommandLine.Option(names = {"-c", "--container"}, description = "Swift
Container Name", required = true)
- private String container;
-
- @CommandLine.Option(names = {"-e", "--endpoint"}, description = "Endpoint
Name", required = true)
- private String endpoint;
-
- @CommandLine.Option(names = {"-r", "--region"}, description = "Region",
required = true)
- private String region;
-
- @CommandLine.Option(names = {"-v", "--keystoneversion"}, description =
"Keystone Version", required = true)
- private int keystoneVersion;
-
- @CommandLine.Option(names = {"-u", "--user"}, description = "User Name
(Password Credentials", required = true)
- private String userName;
-
- @CommandLine.Option(names = {"-p", "--password"}, description = "Password
(Password Credentials", required = true)
- private String password;
-
- @CommandLine.Option(names = {"-pid", "--projectId"}, description =
"Project Id (Password Credentials", required = true)
- private String projectId;
-
- @CommandLine.Option(names = {"-d", "--domainId"}, description = "Domain Id
(Password Credentials", required = true)
- private String domainId;
-
-
- @Override
- public Integer call() throws Exception {
- AuthToken authToken = AuthToken.newBuilder().build();
-
- MFTApiClient mftApiClient =
MFTApiClient.MFTApiClientBuilder.newBuilder().build();
-
- SwiftSecret swiftSecret =
mftApiClient.getSecretServiceClient().swift().createSwiftSecret(SwiftSecretCreateRequest.newBuilder()
-
.setAuthzToken(authToken).setPasswordSecret(SwiftPasswordSecret.newBuilder()
- .setUserName(userName)
- .setPassword(password)
- .setProjectId(projectId)
- .setDomainId(domainId).build()).build());
-
- System.out.println("Created the swift secret " +
swiftSecret.getSecretId());
-
- SwiftStorage swiftStorage =
mftApiClient.getStorageServiceClient().swift().createSwiftStorage(SwiftStorageCreateRequest.newBuilder()
- .setName(remoteName)
- .setContainer(container)
- .setEndpoint(endpoint)
- .setKeystoneVersion(keystoneVersion)
- .setRegion(region).build());
-
- System.out.println("Created swift storage " +
swiftStorage.getStorageId());
-
- StorageCommonServiceGrpc.StorageCommonServiceBlockingStub commonClient
= mftApiClient.getStorageServiceClient().common();
- commonClient.registerSecretForStorage(SecretForStorage.newBuilder()
- .setStorageId(swiftStorage.getStorageId())
- .setSecretId(swiftSecret.getSecretId())
- .setStorageType(StorageType.SWIFT).build());
-
- System.out.println("Successfully added Swift remote endpoint");
-
- return 0;
- }
-}
diff --git
a/command-line/src/main/java/org/apache/airavata/mft/command/line/sub/swift/SwiftRemoteSubCommand.java
b/command-line/src/main/java/org/apache/airavata/mft/command/line/sub/swift/SwiftRemoteSubCommand.java
deleted file mode 100644
index ab99e54..0000000
---
a/command-line/src/main/java/org/apache/airavata/mft/command/line/sub/swift/SwiftRemoteSubCommand.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.airavata.mft.command.line.sub.swift;
-
-import picocli.CommandLine;
-
[email protected](name = "remote", subcommands = {SwiftAddSubCommand.class})
-public class SwiftRemoteSubCommand {
-}
diff --git
a/command-line/src/main/java/org/apache/airavata/mft/command/line/sub/swift/SwiftSubCommand.java
b/command-line/src/main/java/org/apache/airavata/mft/command/line/sub/swift/SwiftSubCommand.java
deleted file mode 100644
index f3ee16d..0000000
---
a/command-line/src/main/java/org/apache/airavata/mft/command/line/sub/swift/SwiftSubCommand.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.airavata.mft.command.line.sub.swift;
-
-import picocli.CommandLine;
-
[email protected](name = "swift", description = "Manage Swift resources and
credentials",
- subcommands = {SwiftRemoteSubCommand.class})
-public class SwiftSubCommand {
-}
diff --git
a/command-line/src/main/java/org/apache/airavata/mft/command/line/sub/transfer/SubmitTransferSubCommand.java
b/command-line/src/main/java/org/apache/airavata/mft/command/line/sub/transfer/SubmitTransferSubCommand.java
deleted file mode 100644
index 92a1c2a..0000000
---
a/command-line/src/main/java/org/apache/airavata/mft/command/line/sub/transfer/SubmitTransferSubCommand.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.airavata.mft.command.line.sub.transfer;
-
-import org.apache.airavata.mft.api.client.MFTApiClient;
-import org.apache.airavata.mft.api.service.EndpointPaths;
-import org.apache.airavata.mft.api.service.TransferApiRequest;
-import org.apache.airavata.mft.api.service.TransferApiResponse;
-import org.apache.airavata.mft.common.AuthToken;
-import org.apache.airavata.mft.resource.stubs.storage.common.Error;
-import org.apache.airavata.mft.resource.stubs.storage.common.SecretForStorage;
-import
org.apache.airavata.mft.resource.stubs.storage.common.SecretForStorageGetRequest;
-import
org.apache.airavata.mft.resource.stubs.storage.common.StorageCommonServiceGrpc;
-import picocli.CommandLine;
-
-import java.util.concurrent.Callable;
-
[email protected](name = "submit", description = "Submit a data transfer
job")
-public class SubmitTransferSubCommand implements Callable<Integer> {
-
- @CommandLine.Option(names = {"-s", "--source"}, description = "Source
Storage Id", required = true)
- private String sourceStorageId;
-
- @CommandLine.Option(names = {"-d", "--destination"}, description =
"Destination Storage Id", required = true)
- private String destinationStorageId;
-
- @CommandLine.Option(names = {"-sp", "--source-path"}, description =
"Source Path", required = true)
- private String sourcePath;
-
- @CommandLine.Option(names = {"-dp", "--destination-path"}, description =
"Destination Path", required = true)
- private String destinationPath;
-
- @Override
- public Integer call() throws Exception {
- System.out.println("Transferring data from " + sourceStorageId + " to
" + destinationStorageId);
- MFTApiClient mftApiClient =
MFTApiClient.MFTApiClientBuilder.newBuilder().build();
-
- AuthToken token = AuthToken.newBuilder().build();
-
- StorageCommonServiceGrpc.StorageCommonServiceBlockingStub commonClient
= mftApiClient.getStorageServiceClient().common();
- SecretForStorage sourceSecretForStorage = commonClient
-
.getSecretForStorage(SecretForStorageGetRequest.newBuilder().setStorageId(sourceStorageId).build());
-
- if (sourceSecretForStorage.getError() != Error.UNRECOGNIZED) {
- System.out.println("Errored while fetching credentials for source
storage " + sourceStorageId
- + ". Error: " + sourceSecretForStorage.getError());
- }
-
- SecretForStorage destSecretForStorage = commonClient
-
.getSecretForStorage(SecretForStorageGetRequest.newBuilder().setStorageId(destinationStorageId).build());
-
- if (destSecretForStorage.getError() != Error.UNRECOGNIZED) {
- System.out.println("Errored while fetching credentials for
destination storage " + sourceStorageId
- + ". Error: " + destSecretForStorage.getError());
- }
-
- TransferApiResponse transferResp =
mftApiClient.getTransferClient().submitTransfer(TransferApiRequest.newBuilder()
- .setSourceSecretId(sourceSecretForStorage.getSecretId())
- .setDestinationSecretId(destSecretForStorage.getSecretId())
- .setDestinationStorageId(destinationStorageId)
- .setSourceStorageId(sourceStorageId)
-
.addEndpointPaths(EndpointPaths.newBuilder().setSourcePath(sourcePath)
- .setDestinationPath(destinationPath).build()).build());
-
- System.out.println("Submitted Transfer " +
transferResp.getTransferId());
- return 0;
- }
-}
diff --git
a/command-line/src/main/java/org/apache/airavata/mft/command/line/sub/transfer/TransferStateSubCommand.java
b/command-line/src/main/java/org/apache/airavata/mft/command/line/sub/transfer/TransferStateSubCommand.java
deleted file mode 100644
index 4683562..0000000
---
a/command-line/src/main/java/org/apache/airavata/mft/command/line/sub/transfer/TransferStateSubCommand.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.airavata.mft.command.line.sub.transfer;
-
-import org.apache.airavata.mft.api.client.MFTApiClient;
-import org.apache.airavata.mft.api.service.TransferStateApiRequest;
-import org.apache.airavata.mft.api.service.TransferStateResponse;
-import org.apache.airavata.mft.api.service.TransferStateSummaryResponse;
-import org.apache.airavata.mft.command.line.CommandLineUtil;
-import org.apache.airavata.mft.common.AuthToken;
-import picocli.CommandLine;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.concurrent.Callable;
-
[email protected](name = "state", description = "Returns state of a
transfer")
-public class TransferStateSubCommand implements Callable<Integer> {
- @CommandLine.Option(names = {"-a", "--all"}, description = "All transfer
states")
- private boolean all;
-
- @CommandLine.Parameters(index = "0", description = "Transfer Id")
- private String transferId;
-
- @Override
- public Integer call() throws Exception {
-
- MFTApiClient mftApiClient =
MFTApiClient.MFTApiClientBuilder.newBuilder().build();
-
- AuthToken token = AuthToken.newBuilder().build();
- int[] columnWidth = {15, 15, 35, 10};
-
-
- if (!all) {
- TransferStateSummaryResponse transferState =
mftApiClient.getTransferClient().getTransferStateSummary(
- TransferStateApiRequest.newBuilder()
- .setMftAuthorizationToken(token)
- .setTransferId(transferId).build());
-
-
- String[][] content = new String[2][4];
- String[] headers = {"UPDATE TIME", "STATE", "DESCRIPTION",
"PERCENTAGE"};
- content[0] = headers;
-
- content[1][0] = transferState.getUpdateTimeMils() + "";
- content[1][1] = transferState.getState();
- content[1][2] = transferState.getDescription();
- content[1][3] = transferState.getPercentage() + "";
-
- CommandLineUtil.printTable(columnWidth, content);
-
- } else {
- Iterator<TransferStateResponse> transferStates =
mftApiClient.getTransferClient().getAllTransferStates(TransferStateApiRequest.newBuilder()
-
.setMftAuthorizationToken(token).setTransferId(transferId).build());
-
- List<TransferStateResponse> states = new ArrayList<>();
- while (transferStates.hasNext()) {
- states.add(transferStates.next());
- }
- String[][] content = new String[states.size() + 1][4];
- String[] headers = {"UPDATE TIME", "STATE", "DESCRIPTION",
"PERCENTAGE"};
- content[0] = headers;
- for (int i = 1; i <= states.size(); i ++) {
- TransferStateResponse transferState = states.get(i -1);
- content[i][0] = transferState.getUpdateTimeMils() + "";
- content[i][1] = transferState.getState();
- content[i][2] = transferState.getDescription();
- content[i][3] = transferState.getPercentage() + "";
- }
- CommandLineUtil.printTable(columnWidth, content);
-
- }
- return 0;
- }
-}
diff --git
a/command-line/src/main/java/org/apache/airavata/mft/command/line/sub/transfer/TransferSubCommand.java
b/command-line/src/main/java/org/apache/airavata/mft/command/line/sub/transfer/TransferSubCommand.java
deleted file mode 100644
index bf8f2b9..0000000
---
a/command-line/src/main/java/org/apache/airavata/mft/command/line/sub/transfer/TransferSubCommand.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.airavata.mft.command.line.sub.transfer;
-
-import picocli.CommandLine;
-
[email protected](name = "transfer", description = "Data transfer
operations",
- subcommands = {SubmitTransferSubCommand.class,
TransferStateSubCommand.class})
-public class TransferSubCommand {
-}
diff --git a/pom.xml b/pom.xml
index 17b03af..f796710 100755
--- a/pom.xml
+++ b/pom.xml
@@ -48,7 +48,6 @@
<module>transport</module>
<module>agent</module>
<module>controller</module>
- <module>command-line</module>
<module>standalone-service</module>
</modules>
@@ -101,6 +100,13 @@
<groupId>org.apache.rat</groupId>
<artifactId>apache-rat-plugin</artifactId>
<version>0.15</version>
+ <configuration>
+ <excludes>
+ <exclude>**/venv/**/*</exclude>
+ <exclude>**/dist/**/*</exclude>
+ <exclude>**/*.egg-info/**/*</exclude>
+ </excludes>
+ </configuration>
</plugin>
</plugins>
</build>