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



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

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

#app_templatesObject



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

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

#appsObject



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

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

#cloudsObject



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

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

#custom_instance_typesObject



110
111
112
# File 'lib/morpheus/api/api_client.rb', line 110

def custom_instance_types
	Morpheus::CustomInstanceTypesInterface.new(@access_token, @refresh_token, @expires_at, @base_url)
end

#dashboardObject



114
115
116
# File 'lib/morpheus/api/api_client.rb', line 114

def dashboard
	Morpheus::DashboardInterface.new(@access_token, @refresh_token, @expires_at, @base_url)
end

#deployObject



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

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

#deploymentsObject



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

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

#groupsObject



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

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

#instance_typesObject



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

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

#instancesObject



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

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

#key_pairsObject



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

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

#licenseObject



106
107
108
# File 'lib/morpheus/api/api_client.rb', line 106

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

#load_balancersObject



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

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

#logsObject



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

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

#optionsObject



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

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

#provision_typesObject



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

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

#rolesObject



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

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

#security_group_rulesObject



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

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

#security_groupsObject



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

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

#serversObject



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

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

#task_setsObject



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

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

#tasksObject



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

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

#usersObject



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

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

#virtual_imagesObject



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

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

#whoamiObject



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

def whoami
	Morpheus::WhoamiInterface.new(@access_token, @refresh_token, @expires_at, @base_url)
end