Class: Bmc::Sdk::CreateServer

Inherits:
Object
  • Object
show all
Defined in:
lib/commands.rb

Overview

CreateServer command create (request) a new server for account. Server DNS will be configured to access Google’s public DNS at 8.8.8.8.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client, server) ⇒ CreateServer

server is a ProvisionedServer



13
14
15
16
# File 'lib/commands.rb', line 13

def initialize(client, server)
  @client = client
  @server = server
end

Instance Attribute Details

#serverObject

Returns the value of attribute server.



10
11
12
# File 'lib/commands.rb', line 10

def server
  @server
end

Instance Method Details

#executeObject



18
19
20
21
22
23
# File 'lib/commands.rb', line 18

def execute
  return @client.post(
    "#{Entrypoint}servers",
    headers: {'Content-Type': 'application/json'},
    body: @server.to_json)
end