Class: TerraformEnterprise::CommandLine::Commands::WorkspacesCommand
- Inherits:
-
TerraformEnterprise::CommandLine::Command
- Object
- Thor
- TerraformEnterprise::CommandLine::Command
- TerraformEnterprise::CommandLine::Commands::WorkspacesCommand
- Defined in:
- lib/terraform_enterprise/command_line/commands/workspaces.rb
Constant Summary collapse
Constants included from TerraformEnterprise::CommandLine
Instance Method Summary collapse
- #create(name) ⇒ Object
- #delete(name) ⇒ Object
- #get(name) ⇒ Object
- #list ⇒ Object
- #lock(id) ⇒ Object
- #unlock(id) ⇒ Object
- #update(name) ⇒ Object
Methods included from Util::Tar
Instance Method Details
#create(name) ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/terraform_enterprise/command_line/commands/workspaces.rb', line 26 def create(name) params = { organization: [:organization], name: name, 'working-directory' => [:working_directory] || '', } if [:repo] && [:oauth_token] repo = {} repo['branch'] = [:branch] || '' repo['identifier'] = [:repo] repo['oauth-token-id'] = [:oauth_token] repo['ingress-submodules'] = [:ingress_submodules] || false params['vcs-repo'] = repo end params['migration-environment'] = [:import_legacy_environment] if [:import_legacy_environment] params['terraform_version'] = [:terraform_version] if [:terraform_version] render client.workspaces.create(params), except:[:permissions, :actions, :environment] end |
#delete(name) ⇒ Object
58 59 60 61 62 63 64 |
# File 'lib/terraform_enterprise/command_line/commands/workspaces.rb', line 58 def delete(name) params = { organization: [:organization], workspace: name } render client.workspaces.delete(params), except:[:permissions, :actions, :environment] end |
#get(name) ⇒ Object
48 49 50 51 52 53 54 |
# File 'lib/terraform_enterprise/command_line/commands/workspaces.rb', line 48 def get(name) params = { organization: [:organization], workspace: name } render client.workspaces.get(params), except:[:permissions, :environment] end |
#list ⇒ Object
13 14 15 |
# File 'lib/terraform_enterprise/command_line/commands/workspaces.rb', line 13 def list render client.workspaces.list(), except:[:permissions, :actions, :environment, 'created-at'] end |
#lock(id) ⇒ Object
78 79 80 |
# File 'lib/terraform_enterprise/command_line/commands/workspaces.rb', line 78 def lock(id) render client.workspaces.action(action: :lock, id: id), except:[:permissions, :environment] end |
#unlock(id) ⇒ Object
83 84 85 |
# File 'lib/terraform_enterprise/command_line/commands/workspaces.rb', line 83 def unlock(id) render client.workspaces.action(action: :unlock, id: id), except:[:permissions, :environment] end |
#update(name) ⇒ Object
71 72 73 74 75 |
# File 'lib/terraform_enterprise/command_line/commands/workspaces.rb', line 71 def update(name) params = params[:workspace] = name render client.workspaces.update(params), except:[:permissions, :environment] end |