Class: Morpheus::APIClient

Inherits:
Object
  • Object
show all
Defined in:
lib/morpheus/api/api_client.rb

Instance Method Summary collapse

Constructor Details

#initialize(access_token, refresh_token = nil, expires_in = nil, base_url = nil) ⇒ APIClient

Returns a new instance of APIClient.



5
6
7
8
9
10
11
12
# File 'lib/morpheus/api/api_client.rb', line 5

def initialize(access_token, refresh_token=nil,expires_in = nil, base_url=nil) 
  @access_token = access_token
  @refresh_token = refresh_token
  @base_url = base_url
  if expires_in != nil
    @expires_at = DateTime.now + expires_in.seconds
  end
end

Instance Method Details

#accounts ⇒ Object



82
83
84
# File 'lib/morpheus/api/api_client.rb', line 82

def accounts
  Morpheus::AccountsInterface.new(@access_token, @refresh_token, @expires_at, @base_url)
end

#app_templates ⇒ Object



62
63
64
# File 'lib/morpheus/api/api_client.rb', line 62

def app_templates
  Morpheus::AppTemplatesInterface.new(@access_token, @refresh_token, @expires_at, @base_url)
end

#apps ⇒ Object



58
59
60
# File 'lib/morpheus/api/api_client.rb', line 58

def apps
  Morpheus::AppsInterface.new(@access_token, @refresh_token, @expires_at, @base_url)
end

#clouds ⇒ Object



22
23
24
# File 'lib/morpheus/api/api_client.rb', line 22

def clouds
  Morpheus::CloudsInterface.new(@access_token, @refresh_token, @expires_at, @base_url)
end

#deploy ⇒ Object



66
67
68
# File 'lib/morpheus/api/api_client.rb', line 66

def deploy
  Morpheus::DeployInterface.new(@access_token, @refresh_token, @expires_at, @base_url)
end

#deployments ⇒ Object



70
71
72
# File 'lib/morpheus/api/api_client.rb', line 70

def deployments
  Morpheus::DeploymentsInterface.new(@access_token, @refresh_token, @expires_at, @base_url)
end

#groups ⇒ Object



18
19
20
# File 'lib/morpheus/api/api_client.rb', line 18

def groups
  Morpheus::GroupsInterface.new(@access_token, @refresh_token, @expires_at, @base_url)
end

#instance_types ⇒ Object



34
35
36
# File 'lib/morpheus/api/api_client.rb', line 34

def instance_types
  Morpheus::InstanceTypesInterface.new(@access_token, @refresh_token, @expires_at, @base_url)
end

#instances ⇒ Object



30
31
32
# File 'lib/morpheus/api/api_client.rb', line 30

def instances
  Morpheus::InstancesInterface.new(@access_token, @refresh_token, @expires_at, @base_url)
end

#key_pairs ⇒ Object



98
99
100
# File 'lib/morpheus/api/api_client.rb', line 98

def key_pairs
  Morpheus::KeyPairsInterface.new(@access_token, @refresh_token, @expires_at, @base_url)
end

#license ⇒ Object



102
103
104
# File 'lib/morpheus/api/api_client.rb', line 102

def license
  Morpheus::LicenseInterface.new(@access_token, @refresh_token, @expires_at, @base_url)
end

#load_balancers ⇒ Object



42
43
44
# File 'lib/morpheus/api/api_client.rb', line 42

def load_balancers
  Morpheus::LoadBalancersInterface.new(@access_token, @refresh_token, @expires_at, @base_url)
end

#logs ⇒ Object



90
91
92
# File 'lib/morpheus/api/api_client.rb', line 90

def logs
  Morpheus::LogsInterface.new(@access_token, @refresh_token, @expires_at, @base_url)
end

#options ⇒ Object



14
15
16
# File 'lib/morpheus/api/api_client.rb', line 14

def options
  Morpheus::OptionsInterface.new(@access_token, @refresh_token, @expires_at, @base_url)
end

#provision_types ⇒ Object



38
39
40
# File 'lib/morpheus/api/api_client.rb', line 38

def provision_types
  Morpheus::ProvisionTypesInterface.new(@access_token, @refresh_token, @expires_at, @base_url)
end

#roles ⇒ Object



94
95
96
# File 'lib/morpheus/api/api_client.rb', line 94

def roles
  Morpheus::RolesInterface.new(@access_token, @refresh_token, @expires_at, @base_url)
end

#security_group_rules ⇒ Object



78
79
80
# File 'lib/morpheus/api/api_client.rb', line 78

def security_group_rules
  Morpheus::SecurityGroupRulesInterface.new(@access_token, @refresh_token, @expires_at, @base_url)
end

#security_groups ⇒ Object



74
75
76
# File 'lib/morpheus/api/api_client.rb', line 74

def security_groups
  Morpheus::SecurityGroupsInterface.new(@access_token, @refresh_token, @expires_at, @base_url)
end

#servers ⇒ Object



26
27
28
# File 'lib/morpheus/api/api_client.rb', line 26

def servers
  Morpheus::ServersInterface.new(@access_token, @refresh_token, @expires_at, @base_url)
end

#task_sets ⇒ Object



50
51
52
# File 'lib/morpheus/api/api_client.rb', line 50

def task_sets
  Morpheus::TaskSetsInterface.new(@access_token, @refresh_token, @expires_at, @base_url)
end

#tasks ⇒ Object



46
47
48
# File 'lib/morpheus/api/api_client.rb', line 46

def tasks
  Morpheus::TasksInterface.new(@access_token, @refresh_token, @expires_at, @base_url)
end

#users ⇒ Object



86
87
88
# File 'lib/morpheus/api/api_client.rb', line 86

def users
  Morpheus::UsersInterface.new(@access_token, @refresh_token, @expires_at, @base_url)
end

#virtual_images ⇒ Object



54
55
56
# File 'lib/morpheus/api/api_client.rb', line 54

def virtual_images
  Morpheus::VirtualImagesInterface.new(@access_token, @refresh_token, @expires_at, @base_url)
end