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

#accountsObject



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

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

#appsObject



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

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

#cloudsObject



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

#deployObject



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

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

#groupsObject



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_typesObject



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

#instancesObject



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_pairsObject



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

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

#licenseObject



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

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

#load_balancersObject



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

#logsObject



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

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

#optionsObject



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_typesObject



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

#rolesObject



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

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

#security_group_rulesObject



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

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

#security_groupsObject



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

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

#serversObject



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_setsObject



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

#tasksObject



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

#usersObject



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

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