Class: Jenkins2::CLI::GetCredentialsDomainAsXml

Inherits:
Jenkins2::CLI show all
Defined in:
lib/jenkins2/cli/credentials.rb

Instance Attribute Summary

Attributes inherited from Jenkins2::CLI

#errors, #options

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Jenkins2::CLI

#call, class_to_command, #initialize, #parse, subcommands

Constructor Details

This class inherits a constructor from Jenkins2::CLI

Class Method Details

.descriptionObject



131
132
133
# File 'lib/jenkins2/cli/credentials.rb', line 131

def self.description
	'Get credentials domain as XML.'
end

Instance Method Details

#add_optionsObject



135
136
137
138
139
140
141
142
143
# File 'lib/jenkins2/cli/credentials.rb', line 135

def add_options
	parser.separator 'Mandatory arguments:'
	parser.on '--store STORE', 'Store id. (e.g. "system")' do |s|
		options[:store] = s
	end
	parser.on '--domain DOMAIN', 'Domain id. (e.g. "_")' do |d|
		options[:domain] = d
	end
end

#mandatory_argumentsObject



145
146
147
# File 'lib/jenkins2/cli/credentials.rb', line 145

def mandatory_arguments
	super + %i[store domain]
end

#runObject



149
150
151
# File 'lib/jenkins2/cli/credentials.rb', line 149

def run
	jc.credentials.store(options[:store]).domain(options[:domain]).config_xml
end