Class: Kontena::Plugin::Packet::Nodes::CreateCommand
- Inherits:
-
Command
- Object
- Command
- Kontena::Plugin::Packet::Nodes::CreateCommand
- Includes:
- Cli::Common, Cli::GridOptions, FacilityOption, ProjectOption, SshKeyOption, TokenOption, TypeOption
- Defined in:
- lib/kontena/plugin/packet/nodes/create_command.rb
Constant Summary
Constants included from SshKeyOption
Instance Method Summary collapse
Methods included from SshKeyOption
Methods included from FacilityOption
Methods included from TypeOption
Methods included from ProjectOption
Methods included from TokenOption
Instance Method Details
#execute ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/kontena/plugin/packet/nodes/create_command.rb', line 22 def execute require_api_url require_current_grid require 'kontena/machine/packet' grid = fetch_grid provisioner = provisioner(client, token) provisioner.run!( master_uri: api_url, grid_token: grid['token'], grid: current_grid, project: project, billing: billing, ssh_key: ssh_key, plan: plan, facility: facility, version: version ) end |
#fetch_grid ⇒ Hash
48 49 50 |
# File 'lib/kontena/plugin/packet/nodes/create_command.rb', line 48 def fetch_grid client.get("grids/#{current_grid}") end |
#provisioner(client, token) ⇒ Object
43 44 45 |
# File 'lib/kontena/plugin/packet/nodes/create_command.rb', line 43 def provisioner(client, token) Kontena::Machine::Packet::NodeProvisioner.new(client, token) end |