-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathTower.java
More file actions
127 lines (109 loc) · 4.41 KB
/
Tower.java
File metadata and controls
127 lines (109 loc) · 4.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
/*
* Copyright 2021-2025, Seqera.
*
* Licensed 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.
*
*/
/*
* This Java source file was generated by the Gradle 'init' task.
*/
package io.seqera.tower.cli;
import io.seqera.tower.cli.commands.AbstractCmd;
import io.seqera.tower.cli.commands.ActionsCmd;
import io.seqera.tower.cli.commands.CollaboratorsCmd;
import io.seqera.tower.cli.commands.ComputeEnvsCmd;
import io.seqera.tower.cli.commands.CredentialsCmd;
import io.seqera.tower.cli.commands.DataLinksCmd;
import io.seqera.tower.cli.commands.StudiosCmd;
import io.seqera.tower.cli.commands.DatasetsCmd;
import io.seqera.tower.cli.commands.InfoCmd;
import io.seqera.tower.cli.commands.LaunchCmd;
import io.seqera.tower.cli.commands.MembersCmd;
import io.seqera.tower.cli.commands.OrganizationsCmd;
import io.seqera.tower.cli.commands.ParticipantsCmd;
import io.seqera.tower.cli.commands.PipelinesCmd;
import io.seqera.tower.cli.commands.RunsCmd;
import io.seqera.tower.cli.commands.SecretsCmd;
import io.seqera.tower.cli.commands.TeamsCmd;
import io.seqera.tower.cli.commands.WorkspacesCmd;
import io.seqera.tower.cli.commands.enums.OutputType;
import io.seqera.tower.cli.commands.labels.LabelsCmd;
import picocli.CommandLine;
import picocli.CommandLine.Command;
import picocli.CommandLine.Model.CommandSpec;
import picocli.CommandLine.Option;
import picocli.CommandLine.Spec;
import java.io.PrintWriter;
import static picocli.AutoComplete.GenerateCompletion;
@Command(
name = "tw",
description = "Seqera Platform CLI.",
subcommands = {
ActionsCmd.class,
CollaboratorsCmd.class,
ComputeEnvsCmd.class,
CredentialsCmd.class,
DataLinksCmd.class,
StudiosCmd.class,
DatasetsCmd.class,
GenerateCompletion.class,
InfoCmd.class,
LabelsCmd.class,
LaunchCmd.class,
MembersCmd.class,
OrganizationsCmd.class,
ParticipantsCmd.class,
PipelinesCmd.class,
RunsCmd.class,
TeamsCmd.class,
WorkspacesCmd.class,
SecretsCmd.class,
}
)
public class Tower extends AbstractCmd {
@Spec
public CommandSpec spec;
@Option(names = {"-t", "--access-token"}, description = "Seqera Platform personal access token (TOWER_ACCESS_TOKEN).", defaultValue = "${TOWER_ACCESS_TOKEN}")
public String token;
@Option(names = {"-u", "--url"}, description = "Seqera Platform server API endpoint URL (TOWER_API_ENDPOINT) [default: 'api.cloud.seqera.io'].", defaultValue = "${TOWER_API_ENDPOINT:-https://api.cloud.seqera.io}")
public String url;
@Option(names = {"-o", "--output"}, description = "Show output in defined format (only the 'json' option is available at the moment).", defaultValue = "${TOWER_CLI_OUTPUT_FORMAT:-console}")
public OutputType output;
@Option(names = {"-v", "--verbose"}, description = "Show HTTP request/response logs at stderr.")
public boolean verbose;
@Option(names = {"--insecure"}, description = "Explicitly allow to connect to a non-SSL secured Seqera Platform server (this is not recommended).")
public boolean insecure;
public Tower() {
}
public static void main(String[] args) {
System.exit(buildCommandLine().execute(args));
}
protected static CommandLine buildCommandLine() {
Tower app = new Tower();
CommandLine cmd = new CommandLine(app);
cmd.setUsageHelpLongOptionsMaxWidth(40);
return cmd;
}
@Override
public Integer call() {
// if the command was invoked without subcommand, show the usage help
spec.commandLine().usage(System.err);
return -1;
}
public PrintWriter getErr() {
return spec.commandLine().getErr();
}
public PrintWriter getOut() {
return spec.commandLine().getOut();
}
}