Class: Jenkins2::CLI::GetCredentialsAsXml
Instance Attribute Summary
#errors, #options
Class Method Summary
collapse
Instance Method Summary
collapse
#call, class_to_command, #initialize, #parse, subcommands
Constructor Details
This class inherits a constructor from Jenkins2::CLI
Class Method Details
.description ⇒ Object
103
104
105
|
# File 'lib/jenkins2/cli/credentials.rb', line 103
def self.description
'Get a credential as XML (secrets redacted).'
end
|
Instance Method Details
#add_options ⇒ Object
107
108
109
110
111
112
113
114
115
116
117
118
|
# File 'lib/jenkins2/cli/credentials.rb', line 107
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
parser.on '--credential ID', 'Credential id.' do |c|
options[:credential] = c
end
end
|
#mandatory_arguments ⇒ Object
120
121
122
|
# File 'lib/jenkins2/cli/credentials.rb', line 120
def mandatory_arguments
super + %i[store domain credential]
end
|
#run ⇒ Object
124
125
126
127
|
# File 'lib/jenkins2/cli/credentials.rb', line 124
def run
jc.credentials.store(options[:store]).domain(options[:domain]).
credential(options[:credential]).config_xml
end
|