Class: TerraformEnterprise::CommandLine::Commands::VariablesCommand
- Inherits:
-
TerraformEnterprise::CommandLine::Command
- Object
- Thor
- TerraformEnterprise::CommandLine::Command
- TerraformEnterprise::CommandLine::Commands::VariablesCommand
- Defined in:
- lib/terraform_enterprise/command_line/commands/variables.rb
Constant Summary collapse
Constants included from TerraformEnterprise::CommandLine
Instance Method Summary collapse
- #create(key, value) ⇒ Object
- #delete(id) ⇒ Object
- #get(id) ⇒ Object
- #list ⇒ Object
- #update(id) ⇒ Object
Methods included from Util::Tar
Instance Method Details
#create(key, value) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/terraform_enterprise/command_line/commands/variables.rb', line 24 def create(key, value) params = { category: [:category], hcl: [:hcl], key: key, organization: [:organization], sensitive: [:sensitive], value: value, workspace: [:workspace], } render client.variables.create(params) end |
#delete(id) ⇒ Object
57 58 59 |
# File 'lib/terraform_enterprise/command_line/commands/variables.rb', line 57 def delete(id) render client.variables.delete(id: id) end |
#get(id) ⇒ Object
52 53 54 |
# File 'lib/terraform_enterprise/command_line/commands/variables.rb', line 52 def get(id) render client.variables.get(id:id) end |
#list ⇒ Object
14 15 16 |
# File 'lib/terraform_enterprise/command_line/commands/variables.rb', line 14 def list render client.variables.list() end |
#update(id) ⇒ Object
42 43 44 45 46 47 48 49 |
# File 'lib/terraform_enterprise/command_line/commands/variables.rb', line 42 def update(id) params = {id: id} params[:hcl] = [:hcl] if .include?('hcl') params[:key] = [:key] if [:key] params[:sensitive] = [:sensitive] if .include?('sensitive') params[:value] = [:value] if [:value] render client.variables.update(params) end |