Class: Qtc::Cli::Eds::Instances
- Inherits:
-
Base
- Object
- Base
- Qtc::Cli::Eds::Instances
show all
- Defined in:
- lib/qtc/cli/eds/instances.rb
Instance Method Summary
collapse
Methods included from Common
#base_url, #client, #extract_app_in_dir, #ini_filename, #inifile, #instance_info, #platform_base_url, #platform_client
Instance Method Details
#create(cloud_id, name) ⇒ Object
19
20
21
22
23
24
25
26
27
|
# File 'lib/qtc/cli/eds/instances.rb', line 19
def create(cloud_id, name)
data = {
name: name,
serviceProviderId: 'eds',
datacenterId: options.datacenter || 'eu-1'
}
response = platform_client.post("/accounts/#{cloud_id}/instances", data)
puts response['id']
end
|
#list ⇒ Object
7
8
9
10
11
12
13
14
15
16
17
|
# File 'lib/qtc/cli/eds/instances.rb', line 7
def list
accounts = platform_client.get('/user/accounts')
accounts['results'].each do |account|
print color("== #{account['name']}: #{account['id']}", :cyan)
instances = platform_client.get("/accounts/#{account['id']}/instances", {provider: 'eds'})
instances['results'].each do |instance|
say(" ~ <%= color('#{instance['id']}', :green) %> #{instance['name']} <%= color('#{instance['tags'].join(', ')}', :yellow) %>")
end
puts ''
end
end
|