From a41db1e1945408d33e0b7905e63d2ae9164b1c49 Mon Sep 17 00:00:00 2001 From: Brett Smith Date: Mon, 9 Nov 2015 06:05:28 -0500 Subject: [PATCH] 3585: Add --project-uuid switch to a-r-p-i. --- sdk/cli/bin/arv-run-pipeline-instance | 33 +++++++++++++++++---------- 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/sdk/cli/bin/arv-run-pipeline-instance b/sdk/cli/bin/arv-run-pipeline-instance index d9e00dc22b..3e72658d47 100755 --- a/sdk/cli/bin/arv-run-pipeline-instance +++ b/sdk/cli/bin/arv-run-pipeline-instance @@ -149,6 +149,10 @@ p = Trollop::Parser.new do "Description for the pipeline instance.", :short => :none, :type => :string) + opt(:project_uuid, + "UUID of the project for the pipeline instance.", + short: :none, + type: :string) stop_on [:'--'] end $options = Trollop::with_standard_exception_handling p do @@ -440,18 +444,23 @@ class WhRunPipelineInstance end end else - description = $options[:description] - description = ("Created at #{Time.now.localtime}" + (@template[:name].andand.size.andand>0 ? " using the pipeline template *#{@template[:name]}*" : "")) if !description - @instance = PipelineInstance. - create(components: @components, - properties: { - run_options: { - enable_job_reuse: !@options[:no_reuse] - } - }, - pipeline_template_uuid: @template[:uuid], - description: description, - state: ($options[:submit] ? 'RunningOnServer' : 'RunningOnClient')) + description = $options[:description] || + ("Created at #{Time.now.localtime}" + (@template[:name].andand.size.andand>0 ? " using the pipeline template *#{@template[:name]}*" : "")) + instance_body = { + components: @components, + properties: { + run_options: { + enable_job_reuse: !@options[:no_reuse] + } + }, + pipeline_template_uuid: @template[:uuid], + description: description, + state: ($options[:submit] ? 'RunningOnServer' : 'RunningOnClient') + } + if @options[:project_uuid] + instance_body[:owner_uuid] = @options[:project_uuid] + end + @instance = PipelineInstance.create(instance_body) end self end -- 2.39.5