diff --git a/conf/reflect-config.json b/conf/reflect-config.json index c0722d73..d51d7bcc 100644 --- a/conf/reflect-config.json +++ b/conf/reflect-config.json @@ -1808,6 +1808,12 @@ "queryAllDeclaredMethods":true, "methods":[{"name":"","parameterTypes":[] }] }, +{ + "name":"io.seqera.tower.cli.commands.studios.UpdateCmd", + "allDeclaredFields":true, + "queryAllDeclaredMethods":true, + "methods":[{"name":"","parameterTypes":[] }] +}, { "name":"io.seqera.tower.cli.commands.studios.StudioCheckpointRefOptions", "allDeclaredFields":true, @@ -2399,6 +2405,12 @@ "queryAllDeclaredMethods":true, "queryAllDeclaredConstructors":true }, +{ + "name":"io.seqera.tower.cli.responses.studios.StudioUpdated", + "allDeclaredFields":true, + "queryAllDeclaredMethods":true, + "queryAllDeclaredConstructors":true +}, { "name":"io.seqera.tower.cli.responses.studios.StudiosCreated", "allDeclaredFields":true, diff --git a/conf/resource-config.json b/conf/resource-config.json index ff9d95a9..49fe282f 100644 --- a/conf/resource-config.json +++ b/conf/resource-config.json @@ -82,10 +82,10 @@ "locales":["und"] }, { "name":"org.glassfish.jersey.client.internal.localization", - "locales":["", "und"] + "locales":["und"] }, { "name":"org.glassfish.jersey.internal.localization", - "locales":["", "und"] + "locales":["und"] }, { "name":"org.glassfish.jersey.media.multipart.internal.localization" }] diff --git a/src/main/java/io/seqera/tower/cli/commands/StudiosCmd.java b/src/main/java/io/seqera/tower/cli/commands/StudiosCmd.java index 637d3d23..fce6cb9d 100644 --- a/src/main/java/io/seqera/tower/cli/commands/StudiosCmd.java +++ b/src/main/java/io/seqera/tower/cli/commands/StudiosCmd.java @@ -24,6 +24,7 @@ import io.seqera.tower.cli.commands.studios.StartCmd; import io.seqera.tower.cli.commands.studios.TemplatesCmd; import io.seqera.tower.cli.commands.studios.StopCmd; +import io.seqera.tower.cli.commands.studios.UpdateCmd; import io.seqera.tower.cli.commands.studios.ViewCmd; import picocli.CommandLine; @@ -39,6 +40,7 @@ CheckpointsCmd.class, AddAsNewCmd.class, StopCmd.class, + UpdateCmd.class, DeleteCmd.class, } ) diff --git a/src/main/java/io/seqera/tower/cli/commands/studios/UpdateCmd.java b/src/main/java/io/seqera/tower/cli/commands/studios/UpdateCmd.java new file mode 100644 index 00000000..a3f4bfb7 --- /dev/null +++ b/src/main/java/io/seqera/tower/cli/commands/studios/UpdateCmd.java @@ -0,0 +1,99 @@ +/* + * Copyright 2021-2026, 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. + */ + +package io.seqera.tower.cli.commands.studios; + +import java.util.List; + +import io.seqera.tower.ApiException; +import io.seqera.tower.cli.commands.global.WorkspaceOptionalOptions; +import io.seqera.tower.cli.commands.labels.Label; +import io.seqera.tower.cli.exceptions.StudioNotFoundException; +import io.seqera.tower.cli.exceptions.TowerException; +import io.seqera.tower.cli.responses.Response; +import io.seqera.tower.cli.responses.studios.StudioUpdated; +import io.seqera.tower.model.DataStudioConfiguration; +import io.seqera.tower.model.DataStudioDto; +import io.seqera.tower.model.DataStudioUpdateRequest; +import picocli.CommandLine; + +@CommandLine.Command( + name = "update", + description = "Update a studio." +) +public class UpdateCmd extends AbstractStudiosCmd { + + @CommandLine.Mixin + public WorkspaceOptionalOptions workspace; + + @CommandLine.Mixin + public StudioRefOptions studioRefOptions; + + @CommandLine.Mixin + public StudioConfigurationOptions studioConfigOptions; + + @CommandLine.Option(names = {"--labels"}, description = "Comma-separated list of labels", split = ",", converter = Label.StudioResourceLabelsConverter.class) + public List