Module: MgmtConsole::Client::ServerEnvironments

Included in:
MgmtConsole::Client
Defined in:
lib/mgmt_console/client/server_environments.rb

Overview

Methods for the ServerEnvironmentsAPI

Instance Method Summary collapse

Instance Method Details

#create_server_environment(name = nil, options = {}) ⇒ Sawyer::Resource

Create Server Environment

Examples:

Create server environment

@client.create_server_environment()

Returns:

  • (Sawyer::Resource)

    Server Environment



21
22
23
24
# File 'lib/mgmt_console/client/server_environments.rb', line 21

def create_server_environment(name=nil, options = {})
  params = { :name => name }
  data = post("#{api_endpoint}/server_environments", options.merge(params))
end

#server_environments(options = {}) ⇒ Array<Sawyer::Resource>

Get Server Environments list

Examples:

Get server environments

@client.server_environments

Returns:

  • (Array<Sawyer::Resource>)

    Array of server environments



12
13
14
# File 'lib/mgmt_console/client/server_environments.rb', line 12

def server_environments(options = {})
  data = get("#{api_endpoint}/server_environments", options)
end