fog-arubacloud 0.0.3 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.codeclimate.yml +0 -0
- data/.gitignore +0 -0
- data/.rubocop.yml +0 -0
- data/.ruby-version +0 -0
- data/.travis.yml +0 -0
- data/CONTRIBUTING.md +0 -0
- data/CONTRIBUTORS.md +0 -0
- data/Gemfile +0 -0
- data/LICENSE.md +0 -0
- data/README.md +3 -3
- data/Rakefile +99 -5
- data/{lib/fog/arubacloud/examples → examples}/create_pro_server.rb +3 -3
- data/{lib/fog/arubacloud/examples → examples}/create_smart_server.rb +0 -0
- data/{lib/fog/arubacloud/examples → examples}/get_objects.rb +1 -1
- data/{lib/fog/arubacloud/examples → examples}/get_servers.rb +0 -0
- data/{lib/fog/arubacloud/examples → examples}/vm_operations.rb +1 -1
- data/fog-arubacloud.gemspec +12 -12
- data/gemfiles/fog-arubacloud-0.0.4.gem +0 -0
- data/lib/fog/arubacloud/compute/models/custom_template.rb +60 -0
- data/lib/fog/arubacloud/compute/models/custom_templates.rb +19 -0
- data/lib/fog/arubacloud/{models/compute → compute/models}/disk.rb +6 -5
- data/lib/fog/arubacloud/{models/compute → compute/models}/disks.rb +7 -7
- data/lib/fog/arubacloud/{models/compute → compute/models}/ip.rb +6 -5
- data/lib/fog/arubacloud/{models/compute → compute/models}/ips.rb +6 -6
- data/lib/fog/arubacloud/compute/models/loadbalancer.rb +135 -0
- data/lib/fog/arubacloud/compute/models/loadbalancers.rb +21 -0
- data/lib/fog/arubacloud/{models/compute → compute/models}/network_adapter.rb +2 -2
- data/lib/fog/arubacloud/{models/compute → compute/models}/network_adapters.rb +4 -4
- data/lib/fog/arubacloud/compute/models/schedule.rb +90 -0
- data/lib/fog/arubacloud/compute/models/schedules.rb +19 -0
- data/lib/fog/arubacloud/{models/compute → compute/models}/server.rb +74 -35
- data/lib/fog/arubacloud/{models/compute → compute/models}/servers.rb +10 -9
- data/lib/fog/arubacloud/compute/models/sharedstorage.rb +58 -0
- data/lib/fog/arubacloud/compute/models/sharedstorages.rb +19 -0
- data/lib/fog/arubacloud/compute/models/snapshot.rb +58 -0
- data/lib/fog/arubacloud/compute/models/snapshots.rb +19 -0
- data/lib/fog/arubacloud/{models/compute → compute/models}/template.rb +2 -2
- data/lib/fog/arubacloud/{models/compute → compute/models}/templates.rb +10 -10
- data/lib/fog/arubacloud/compute/requests/add_contact.rb +59 -0
- data/lib/fog/arubacloud/compute/requests/add_instance.rb +56 -0
- data/lib/fog/arubacloud/compute/requests/add_lb_rule.rb +58 -0
- data/lib/fog/arubacloud/compute/requests/apply_snapshot.rb +53 -0
- data/lib/fog/arubacloud/compute/requests/archive_vm.rb +59 -0
- data/lib/fog/arubacloud/compute/requests/create_loadbalancer.rb +76 -0
- data/lib/fog/arubacloud/compute/requests/create_scheduled_occurrence.rb +71 -0
- data/lib/fog/arubacloud/compute/requests/create_scheduled_operation.rb +56 -0
- data/lib/fog/arubacloud/compute/requests/create_shared_storage.rb +55 -0
- data/lib/fog/arubacloud/compute/requests/create_snapshot.rb +54 -0
- data/lib/fog/arubacloud/{requests/compute → compute/requests}/create_vm_pro.rb +9 -14
- data/lib/fog/arubacloud/{requests/compute → compute/requests}/create_vm_smart.rb +11 -15
- data/lib/fog/arubacloud/compute/requests/delete_custom_template.rb +43 -0
- data/lib/fog/arubacloud/compute/requests/delete_scheduled_operation.rb +43 -0
- data/lib/fog/arubacloud/compute/requests/delete_shared_storage.rb +49 -0
- data/lib/fog/arubacloud/compute/requests/delete_snapshot.rb +60 -0
- data/lib/fog/arubacloud/{requests/compute → compute/requests}/delete_vm.rb +13 -13
- data/lib/fog/arubacloud/compute/requests/disable_loadbalancer.rb +47 -0
- data/lib/fog/arubacloud/compute/requests/edit_shared_storage.rb +50 -0
- data/lib/fog/arubacloud/compute/requests/enable_loadbalancer.rb +47 -0
- data/lib/fog/arubacloud/compute/requests/get_custom_templates.rb +43 -0
- data/lib/fog/arubacloud/{requests/compute → compute/requests}/get_hypervisors.rb +8 -11
- data/lib/fog/arubacloud/compute/requests/get_lb_loads.rb +49 -0
- data/lib/fog/arubacloud/compute/requests/get_lb_stats.rb +49 -0
- data/lib/fog/arubacloud/compute/requests/get_loadbalancer.rb +47 -0
- data/lib/fog/arubacloud/compute/requests/get_notifications.rb +50 -0
- data/lib/fog/arubacloud/compute/requests/get_package_id.rb +60 -0
- data/lib/fog/arubacloud/{requests/compute → compute/requests}/get_purchased_ip_addresses.rb +7 -11
- data/lib/fog/arubacloud/compute/requests/get_scheduled_operations.rb +42 -0
- data/lib/fog/arubacloud/{requests/compute → compute/requests}/get_server_details.rb +7 -13
- data/lib/fog/arubacloud/{requests/compute → compute/requests}/get_servers.rb +11 -14
- data/lib/fog/arubacloud/compute/requests/get_shared_storage.rb +43 -0
- data/lib/fog/arubacloud/compute/requests/manage_custom_template.rb +72 -0
- data/lib/fog/arubacloud/compute/requests/modify_loadbalancer.rb +49 -0
- data/lib/fog/arubacloud/{requests/compute → compute/requests}/power_off_vm.rb +8 -11
- data/lib/fog/arubacloud/{requests/compute → compute/requests}/power_on_vm.rb +8 -11
- data/lib/fog/arubacloud/{requests/compute → compute/requests}/purchase_ip.rb +7 -11
- data/lib/fog/arubacloud/{requests/compute → compute/requests}/reinitialize_vm.rb +8 -14
- data/lib/fog/arubacloud/compute/requests/remove_contact.rb +48 -0
- data/lib/fog/arubacloud/compute/requests/remove_instance.rb +56 -0
- data/lib/fog/arubacloud/{requests/compute → compute/requests}/remove_ip.rb +7 -11
- data/lib/fog/arubacloud/compute/requests/remove_loadbalancer.rb +47 -0
- data/lib/fog/arubacloud/compute/requests/rename_shared_storage.rb +50 -0
- data/lib/fog/arubacloud/compute/requests/restore_vm.rb +61 -0
- data/lib/fog/arubacloud/compute/requests/suspend_scheduled_operations.rb +43 -0
- data/lib/fog/arubacloud/compute.rb +106 -22
- data/lib/fog/arubacloud/error.rb +4 -0
- data/lib/fog/arubacloud/service.rb +4 -2
- data/lib/fog/arubacloud/version.rb +3 -2
- data/lib/fog/arubacloud.rb +4 -12
- data/spec/fog/arubacloud/config_spec.rb +0 -0
- data/spec/fog/compute/arubacloud/models/disk_spec.rb +63 -0
- data/spec/fog/compute/arubacloud/models/disks_spec.rb +11 -0
- data/spec/fog/compute/arubacloud/models/ip_spec.rb +53 -0
- data/spec/fog/compute/arubacloud/models/ips_spec.rb +11 -0
- data/spec/fog/compute/arubacloud/models/loadbalancer_spec.rb +100 -0
- data/spec/fog/compute/arubacloud/models/loadbalancers_spec.rb +15 -0
- data/spec/fog/compute/arubacloud/models/network_adapter_spec.rb +33 -0
- data/spec/fog/compute/arubacloud/models/network_adapters_spec.rb +11 -0
- data/spec/fog/compute/arubacloud/models/schedule_spec.rb +102 -0
- data/spec/fog/compute/arubacloud/models/schedules_spec.rb +11 -0
- data/spec/fog/compute/arubacloud/models/server_spec.rb +155 -0
- data/spec/fog/compute/arubacloud/models/servers_spec.rb +15 -0
- data/spec/fog/compute/arubacloud/models/sharedstorage_spec.rb +86 -0
- data/spec/fog/compute/arubacloud/models/sharedstorages_spec.rb +10 -0
- data/spec/fog/compute/arubacloud/models/snapshot_spec.rb +17 -0
- data/spec/fog/compute/arubacloud/models/snapshots_spec.rb +11 -0
- data/spec/fog/compute/arubacloud/models/template_spec.rb +39 -0
- data/spec/fog/compute/arubacloud/models/templates_spec.rb +21 -0
- data/spec/fog/compute/arubacloud_spec.rb +21 -4
- data/spec/model_setup.rb +3 -1
- data/spec/spec_helper.rb +1 -1
- metadata +121 -48
- data/gemfiles/fog-arubacloud-0.0.1.gem +0 -0
- data/gemfiles/fog-arubacloud-0.0.2.gem +0 -0
- data/spec/fog/compute/arubacloud/server_spec.rb +0 -26
- data/spec/fog/compute/arubacloud/servers_spec.rb +0 -11
- data/tests/test_helper.rb +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: ffa635004717fc04fec344b20fd32351155d890a61d81feb1a024de92ac818d0
|
4
|
+
data.tar.gz: 222d0047f68b9082a59e5d20a64226d2ce08726bc6ac82f036f0f205c2dd3b61
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5bd96f4d0cf62987126ab6e59ad71df609b54dd344f9a1f67ddf857a138f62859f9301512a52b1fb86170e54f38e2dc663fb79ed217fbd4da91b77a136c29688
|
7
|
+
data.tar.gz: c14069bb59ab739dbe82f36ff9e76cded50b592e3ecb0b7a4cc6985caf19f2b883649baefbbf914971ff9b8c0e593f839ddfb07d4b9442c7a780c844a57e17b8
|
data/.codeclimate.yml
CHANGED
File without changes
|
data/.gitignore
CHANGED
File without changes
|
data/.rubocop.yml
CHANGED
File without changes
|
data/.ruby-version
CHANGED
File without changes
|
data/.travis.yml
CHANGED
File without changes
|
data/CONTRIBUTING.md
CHANGED
File without changes
|
data/CONTRIBUTORS.md
CHANGED
File without changes
|
data/Gemfile
CHANGED
File without changes
|
data/LICENSE.md
CHANGED
File without changes
|
data/README.md
CHANGED
@@ -3,6 +3,7 @@
|
|
3
3
|
[![Code Climate](https://codeclimate.com/github/fog/fog-arubacloud/badges/gpa.svg)](https://codeclimate.com/github/fog/fog-arubacloud)
|
4
4
|
[![Test Coverage](https://codeclimate.com/github/fog/fog-arubacloud/badges/coverage.svg)](https://codeclimate.com/github/fog/fog-arubacloud/coverage)
|
5
5
|
[![Gitter](https://badges.gitter.im/fog/fog-arubacloud.svg)](https://gitter.im/fog/fog-arubacloud?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=body_badge)
|
6
|
+
[![Build Status](https://travis-ci.org/fog/fog-arubacloud.svg?branch=master)](https://travis-ci.org/fog/fog-arubacloud)
|
6
7
|
|
7
8
|
Module for the 'fog' gem to support ArubaCloud IaaS Service
|
8
9
|
|
@@ -28,9 +29,8 @@ TODO: Write usage instructions here
|
|
28
29
|
|
29
30
|
## Contributing
|
30
31
|
|
31
|
-
1. Fork it ( https://github.com/
|
32
|
+
1. Fork it ( https://github.com/fog/fog-arubacloud/fork )
|
32
33
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
33
34
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
34
35
|
4. Push to the branch (`git push origin my-new-feature`)
|
35
|
-
5. Create
|
36
|
-
# fog-arubacloud
|
36
|
+
5. Create new Pull Request
|
data/Rakefile
CHANGED
@@ -7,18 +7,112 @@ require 'rake/testtask'
|
|
7
7
|
require File.dirname(__FILE__) + '/lib/fog/arubacloud'
|
8
8
|
|
9
9
|
task :default => :test
|
10
|
-
|
10
|
+
|
11
|
+
def name
|
12
|
+
@name ||= Dir['*.gemspec'].first.split('.').first
|
13
|
+
end
|
14
|
+
|
15
|
+
GEM_NAME = "#{name}"
|
16
|
+
|
17
|
+
def version
|
18
|
+
Fog::ArubaCloud::VERSION
|
19
|
+
end
|
20
|
+
|
21
|
+
def gem_file
|
22
|
+
"#{name}-#{version}.gem"
|
23
|
+
end
|
24
|
+
|
25
|
+
def gemspec_file
|
26
|
+
"#{name}.gemspec"
|
27
|
+
end
|
28
|
+
|
29
|
+
def replace_header(head, header_name)
|
30
|
+
head.sub!(/(\.#{header_name}\s*= ').*'/) { "#{$1}#{send(header_name)}'"}
|
31
|
+
end
|
11
32
|
|
12
33
|
Rake::TestTask.new do |t|
|
13
34
|
t.pattern = File.join('spec', '**', '*_spec.rb')
|
14
35
|
t.libs << 'spec'
|
36
|
+
t.verbose = true
|
15
37
|
end
|
16
38
|
|
17
39
|
namespace :test do
|
18
|
-
|
19
|
-
|
40
|
+
mock = 'true' || ENV['FOG_MOCK']
|
41
|
+
task :travis do
|
42
|
+
ENV['COVERAGE'] = 'false' if RUBY_PLATFORM == 'java'
|
43
|
+
sh("export FOG_MOCK=#{mock} && bundle exec rake")
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
task :release => %w(release:prepare release:publish)
|
48
|
+
|
49
|
+
namespace :release do
|
50
|
+
task :preflight do
|
51
|
+
unless `git branch` =~ /^\* master$/
|
52
|
+
puts 'You must be on the master branch to release!'
|
53
|
+
exit!
|
54
|
+
end
|
55
|
+
if `git tag` =~ /^\* v#{version}$/
|
56
|
+
puts "Tag v#{version} already exists!"
|
57
|
+
exit!
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
task :prepare => :preflight do
|
62
|
+
Rake::Task[:build].invoke
|
63
|
+
sh "gem install pkg/#{name}-#{version}.gem"
|
64
|
+
Rake::Task[:git_mark_release].invoke
|
65
|
+
end
|
66
|
+
|
67
|
+
task :publish do
|
68
|
+
Rake::Task[:git_push_release].invoke
|
69
|
+
Rake::Task[:gem_push].invoke
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
task :git_mark_release do
|
74
|
+
sh "git commit --allow-empty -a -m 'Release #{version}'"
|
75
|
+
sh "git tag v#{version}"
|
76
|
+
end
|
77
|
+
|
78
|
+
task :git_push_release do
|
79
|
+
sh 'git push origin master'
|
80
|
+
sh "git push origin v#{version}"
|
81
|
+
end
|
82
|
+
|
83
|
+
task :gem_push do
|
84
|
+
sh "gem push pkg/#{name}-#{version}.gem"
|
85
|
+
end
|
86
|
+
|
87
|
+
desc "Build fog-#{version}.gem"
|
88
|
+
task :build => :gemspec do
|
89
|
+
sh 'mkdir -p pkg'
|
90
|
+
sh "gem build #{gemspec_file}"
|
91
|
+
sh "mv #{gem_file} gemfiles"
|
92
|
+
end
|
93
|
+
task :gem => :build
|
94
|
+
|
95
|
+
desc "Updates the gemspec and runs 'validate'"
|
96
|
+
task :gemspec => :validate do
|
97
|
+
spec = File.read(gemspec_file)
|
98
|
+
|
99
|
+
replace_header(spec, :name)
|
100
|
+
replace_header(spec, :version)
|
101
|
+
replace_header(spec, :date)
|
102
|
+
|
103
|
+
File.open(gemspec_file, 'w') { |io| io.write(spec) }
|
104
|
+
puts "Updated #{gemspec_file}"
|
105
|
+
end
|
106
|
+
|
107
|
+
desc 'Run before pushing out the code'
|
108
|
+
task :validate do
|
109
|
+
libfiles = Dir['lib/*'] - %W(lib/#{name}.rb lib/#{name} lib/tasks)
|
110
|
+
unless libfiles.empty?
|
111
|
+
puts "Directory `lib` should only contain a `#{name}.rb` file and `#{name}` dir."
|
112
|
+
#exit!
|
20
113
|
end
|
21
|
-
|
22
|
-
|
114
|
+
unless Dir['VERSION*'].empty?
|
115
|
+
puts 'A `VERSION` file at root level violates Gem best practices.'
|
116
|
+
exit!
|
23
117
|
end
|
24
118
|
end
|
@@ -29,12 +29,12 @@ rnd_string = SecureRandom.hex(2)
|
|
29
29
|
|
30
30
|
# Create a Pro VM
|
31
31
|
## Create first disk
|
32
|
-
disk0 = service.disks.
|
32
|
+
disk0 = service.disks.create_loadbalancer({
|
33
33
|
:size => 20,
|
34
34
|
:virtual_disk_type => 0
|
35
35
|
}).get_hash
|
36
36
|
## Create second disk
|
37
|
-
disk1 = service.disks.
|
37
|
+
disk1 = service.disks.create_loadbalancer({
|
38
38
|
:size => 30,
|
39
39
|
:virtual_disk_type => 1
|
40
40
|
}).get_hash
|
@@ -42,7 +42,7 @@ disk1 = service.disks.create({
|
|
42
42
|
disks = [disk0, disk1]
|
43
43
|
|
44
44
|
## Create the virtual machine
|
45
|
-
server = service.servers.
|
45
|
+
server = service.servers.create_loadbalancer({
|
46
46
|
:name => "testpro#{rnd_string}",
|
47
47
|
:vm_type => 'pro',
|
48
48
|
:admin_passwd => 'Prova123',
|
File without changes
|
@@ -11,7 +11,7 @@ require 'optparse'
|
|
11
11
|
|
12
12
|
options = {}
|
13
13
|
OptionParser.new do |opts|
|
14
|
-
opts.banner = 'Usage:
|
14
|
+
opts.banner = 'Usage: get_objects.rb [options]'
|
15
15
|
opts.on('-uUSERNAME', '--username=USERNAME', 'ArubaCloud Username') { |n| options[:username] = n}
|
16
16
|
opts.on('-pPASSWORD', '--password=PASSWORD', 'ArubaCloud Password') { |p| options[:password] = p}
|
17
17
|
end.parse!
|
File without changes
|
@@ -29,7 +29,7 @@ servers = service.servers
|
|
29
29
|
# Poweroff and delete every VM in a Datacenter
|
30
30
|
servers.each do |s|
|
31
31
|
puts("Powering Off and Deleting VM: #{s.name}...")
|
32
|
-
next if s.state == Fog::Compute::
|
32
|
+
next if s.state == Fog::ArubaCloud::Compute::Server::CREATING
|
33
33
|
s.power_off unless s.stopped?
|
34
34
|
until s.stopped?
|
35
35
|
s.get_server_details
|
data/fog-arubacloud.gemspec
CHANGED
@@ -5,13 +5,13 @@ require 'fog/arubacloud/version'
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = 'fog-arubacloud'
|
8
|
-
spec.version = Fog::
|
9
|
-
spec.authors = ['
|
10
|
-
spec.email = ['
|
8
|
+
spec.version = Fog::ArubaCloud::VERSION
|
9
|
+
spec.authors = ['Aruba S.p.A.']
|
10
|
+
spec.email = ['cloudsdk@staff.aruba.it']
|
11
11
|
spec.summary = %q{Module for the 'fog' gem to support ArubaCloud}
|
12
12
|
spec.description = %q{This library can be used as a module for 'fog' or a standalone provider to use
|
13
13
|
the ArubaCloud IaaS in applications}
|
14
|
-
spec.homepage = 'https://www.github.com/
|
14
|
+
spec.homepage = 'https://www.github.com/ArubaCloud/fog-arubacloud'
|
15
15
|
spec.license = 'MIT'
|
16
16
|
|
17
17
|
spec.files = `git ls-files -z`.split("\x0")
|
@@ -19,13 +19,13 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
20
20
|
spec.require_paths = ['lib']
|
21
21
|
|
22
|
-
spec.
|
23
|
-
spec.
|
22
|
+
spec.add_runtime_dependency 'fog-core', '~> 1.32'
|
23
|
+
spec.add_runtime_dependency 'fog-json', '~> 1.0'
|
24
24
|
|
25
|
-
spec.add_development_dependency
|
26
|
-
spec.add_development_dependency
|
27
|
-
spec.add_development_dependency
|
28
|
-
spec.add_development_dependency
|
29
|
-
spec.add_development_dependency
|
30
|
-
spec.add_development_dependency
|
25
|
+
spec.add_development_dependency 'bundler'
|
26
|
+
spec.add_development_dependency 'rake'
|
27
|
+
spec.add_development_dependency 'rspec'
|
28
|
+
spec.add_development_dependency 'webmock'
|
29
|
+
spec.add_development_dependency 'shindo'
|
30
|
+
spec.add_development_dependency 'minitest'
|
31
31
|
end
|
Binary file
|
@@ -0,0 +1,60 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
#
|
3
|
+
# Author:: Dangleterre Michaël
|
4
|
+
# © Copyright ArubaCloud.
|
5
|
+
#
|
6
|
+
# LICENSE: MIT (http://opensource.org/licenses/MIT)
|
7
|
+
#
|
8
|
+
|
9
|
+
require 'fog/core/model'
|
10
|
+
require 'fog/arubacloud/error'
|
11
|
+
|
12
|
+
|
13
|
+
module Fog
|
14
|
+
module ArubaCloud
|
15
|
+
class Compute
|
16
|
+
class Custom_Template < Fog::Model
|
17
|
+
identity :id, :aliases => 'id'
|
18
|
+
|
19
|
+
attribute :appliancetypeid, :aliases => 'appliancetypeid'
|
20
|
+
attribute :architecturetypeid, :aliases => 'architecturetypeid'
|
21
|
+
attribute :osfamilyid, :aliases => 'osfamilyid'
|
22
|
+
attribute :osversion, :aliases => 'osversion'
|
23
|
+
attribute :revision, :aliases => 'revision'
|
24
|
+
attribute :defaultvalue, :aliases => 'defaultvalue'
|
25
|
+
attribute :maxvalue, :aliases => 'maxvalue'
|
26
|
+
attribute :minvalue, :aliases => 'minvalue'
|
27
|
+
attribute :resourcetype, :aliases => 'resourcetype'
|
28
|
+
attribute :templateboundid, :aliases => 'templateboundid'
|
29
|
+
attribute :templatedescription, :aliases => 'templatedescription'
|
30
|
+
attribute :templateexternaldescription, :aliases => 'templateexternaldescription'
|
31
|
+
attribute :templatepassword, :aliases => 'templatepassword'
|
32
|
+
attribute :templateusername, :aliases => 'templateusername'
|
33
|
+
attribute :virtualmachineid, :aliases => 'virtualmachineid'
|
34
|
+
|
35
|
+
def initialize(attributes = {})
|
36
|
+
@service = attributes[:service]
|
37
|
+
end # initialize
|
38
|
+
|
39
|
+
def create
|
40
|
+
requires :appliancetypeid, :architecturetypeid, :osfamilyid, :osversion, :revision, :defaultvalue, :maxvalue, :minvalue, :resourcetype, :templateboundid,:templatedescription, :templateexternaldescription, :templatepassword, :templateusername, :virtualmachineid
|
41
|
+
data = :attributes
|
42
|
+
service.create_custom_template(data)
|
43
|
+
end # create
|
44
|
+
|
45
|
+
def edit
|
46
|
+
requires :appliancetypeid, :architecturetypeid, :osfamilyid, :osversion, :revision, :defaultvalue, :maxvalue, :minvalue, :resourcetype, :templateboundid,:templatedescription, :templateexternaldescription, :templatepassword, :templateusername, :virtualmachineid
|
47
|
+
data = :attributes
|
48
|
+
service.edit_custom_template(data)
|
49
|
+
end # edit
|
50
|
+
|
51
|
+
def delete
|
52
|
+
requires :id
|
53
|
+
data = :attributes
|
54
|
+
service.delete_custom_template(data)
|
55
|
+
end # delete
|
56
|
+
|
57
|
+
end # Custom_Template
|
58
|
+
end # Compute
|
59
|
+
end # ArubaCloud
|
60
|
+
end # Fog
|
@@ -0,0 +1,19 @@
|
|
1
|
+
#
|
2
|
+
# Author:: Dangleterre Michaël
|
3
|
+
# © Copyright ArubaCloud.
|
4
|
+
#
|
5
|
+
# LICENSE: MIT (http://opensource.org/licenses/MIT)
|
6
|
+
#
|
7
|
+
|
8
|
+
require 'fog/core/collection'
|
9
|
+
require 'fog/arubacloud/compute/models/custom_templates'
|
10
|
+
|
11
|
+
module Fog
|
12
|
+
module ArubaCloud
|
13
|
+
class Compute
|
14
|
+
class Custom_Templates < Fog::Collection
|
15
|
+
model Fog::ArubaCloud::Compute::Custom_Templates
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# coding: utf-8
|
1
2
|
#
|
2
3
|
# Author:: Alessio Rocchi (<alessio.rocchi@staff.aruba.it>)
|
3
4
|
# © Copyright ArubaCloud.
|
@@ -9,8 +10,8 @@ require 'fog/core/model'
|
|
9
10
|
require 'fog/arubacloud/error'
|
10
11
|
|
11
12
|
module Fog
|
12
|
-
module
|
13
|
-
class
|
13
|
+
module ArubaCloud
|
14
|
+
class Compute
|
14
15
|
class Disk < Fog::Model
|
15
16
|
attribute :size
|
16
17
|
attribute :virtual_disk_type
|
@@ -42,6 +43,6 @@ module Fog
|
|
42
43
|
end
|
43
44
|
|
44
45
|
end #Disk
|
45
|
-
end #
|
46
|
-
end #
|
47
|
-
end #Fog
|
46
|
+
end # Compute
|
47
|
+
end # ArubaCloud
|
48
|
+
end #Fog
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# coding: utf-8
|
1
2
|
#
|
2
3
|
# Author:: Alessio Rocchi (<alessio.rocchi@staff.aruba.it>)
|
3
4
|
# © Copyright ArubaCloud.
|
@@ -6,14 +7,13 @@
|
|
6
7
|
#
|
7
8
|
|
8
9
|
require 'fog/core/collection'
|
9
|
-
require 'fog/arubacloud/models/
|
10
|
+
require 'fog/arubacloud/compute/models/disk'
|
10
11
|
|
11
12
|
module Fog
|
12
|
-
module
|
13
|
-
class
|
14
|
-
|
13
|
+
module ArubaCloud
|
14
|
+
class Compute
|
15
15
|
class Disks < Fog::Collection
|
16
|
-
model Fog::Compute::
|
16
|
+
model Fog::ArubaCloud::Compute::Disk
|
17
17
|
|
18
18
|
# Dummy Method, only to maintain fog structure, it returns nothings.
|
19
19
|
# @return [Nil]
|
@@ -26,6 +26,6 @@ module Fog
|
|
26
26
|
end
|
27
27
|
end #Disks
|
28
28
|
|
29
|
-
end #
|
30
|
-
end #
|
29
|
+
end # Compute
|
30
|
+
end # ArubaCloud
|
31
31
|
end #Fog
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# coding: utf-8
|
1
2
|
#
|
2
3
|
# Author:: Alessio Rocchi (<alessio.rocchi@staff.aruba.it>)
|
3
4
|
# © Copyright ArubaCloud.
|
@@ -9,8 +10,8 @@ require 'fog/core/model'
|
|
9
10
|
require 'fog/arubacloud/error'
|
10
11
|
|
11
12
|
module Fog
|
12
|
-
module
|
13
|
-
class
|
13
|
+
module ArubaCloud
|
14
|
+
class Compute
|
14
15
|
class IP < Fog::Model
|
15
16
|
identity :id, :aliases => 'ResourceId'
|
16
17
|
|
@@ -40,6 +41,6 @@ module Fog
|
|
40
41
|
end
|
41
42
|
|
42
43
|
end #IP
|
43
|
-
end #
|
44
|
-
end #
|
45
|
-
end #Fog
|
44
|
+
end # Compute
|
45
|
+
end # ArubaCloud
|
46
|
+
end #Fog
|
@@ -6,17 +6,17 @@
|
|
6
6
|
#
|
7
7
|
|
8
8
|
require 'fog/core/collection'
|
9
|
-
require 'fog/arubacloud/models/
|
9
|
+
require 'fog/arubacloud/compute/models/ip'
|
10
10
|
|
11
11
|
module Fog
|
12
|
-
module
|
13
|
-
class
|
12
|
+
module ArubaCloud
|
13
|
+
class Compute
|
14
14
|
|
15
15
|
class Ips < Fog::Collection
|
16
|
-
model Fog::Compute::
|
16
|
+
model Fog::ArubaCloud::Compute::IP
|
17
17
|
|
18
18
|
# Returns list of Ip Addresses
|
19
|
-
# @return [Fog::Compute::
|
19
|
+
# @return [Fog::ArubaCloud::Compute::Ips]
|
20
20
|
# @raise [Fog::ArubaCloud::Errors::NotFound]
|
21
21
|
def all
|
22
22
|
data = service.get_purchased_ip_addresses
|
@@ -26,7 +26,7 @@ module Fog
|
|
26
26
|
|
27
27
|
# Returns a single IpAddress object
|
28
28
|
# @param ip [String]
|
29
|
-
# @return [Fog::Compute::
|
29
|
+
# @return [Fog::ArubaCloud::Compute::IP]
|
30
30
|
# @raise [Fog::ArubaCloud::Errors::NotFound]
|
31
31
|
def get(ip)
|
32
32
|
# TODO: Implement single item retrieve
|
@@ -0,0 +1,135 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
#
|
3
|
+
# Author:: Dangleterre Michaël
|
4
|
+
# © Copyright ArubaCloud.
|
5
|
+
#
|
6
|
+
# LICENSE: MIT (http://opensource.org/licenses/MIT)
|
7
|
+
#
|
8
|
+
|
9
|
+
require 'fog/core/model'
|
10
|
+
require 'fog/arubacloud/error'
|
11
|
+
|
12
|
+
module Fog
|
13
|
+
module ArubaCloud
|
14
|
+
class Compute
|
15
|
+
class LoadBalancer < Fog::Model
|
16
|
+
identity :id, :aliases => 'id'
|
17
|
+
|
18
|
+
attribute :name, :aliases => 'name'
|
19
|
+
#attribute :rules, :aliases => 'rules'
|
20
|
+
attribute :starttime, :aliases => 'starttime'
|
21
|
+
attribute :endtime, :aliases => 'endtime'
|
22
|
+
attribute :ipaddress, :aliases => 'ipaddress'
|
23
|
+
attribute :notificationcontacts, :aliases => 'notificationcontacts'
|
24
|
+
attribute :contactvalue, :aliases => 'ContactValue'
|
25
|
+
attribute :loadbalancercontactid, :aliases => 'LoadBalancerContactID'
|
26
|
+
attribute :type, :aliases => 'type'
|
27
|
+
attribute :contactid, :aliases => 'contactid'
|
28
|
+
attribute :ipaddressesresourceid, :aliases => 'ipaddressesresourceid'
|
29
|
+
attribute :healthchecknotification, :aliases => 'healthchecknotification'
|
30
|
+
attribute :newrule, :aliases => 'newrule'
|
31
|
+
attribute :ruleid, :aliases => 'ruleid'
|
32
|
+
attribute :balancetype, :aliases => 'balancetype'
|
33
|
+
attribute :certificate, :aliases => 'certificate'
|
34
|
+
attribute :creationdate, :aliases => 'creationdate'
|
35
|
+
attribute :instanceport, :aliases => 'instanceport'
|
36
|
+
attribute :loadbalancerport, :aliases => 'loadbalancerport'
|
37
|
+
attribute :protocol, :aliases => 'protocol'
|
38
|
+
|
39
|
+
ignore_attributes :loadbalancerclassofserviceid, :rules
|
40
|
+
|
41
|
+
def initialize(attributes = {})
|
42
|
+
@service = attributes[:service]
|
43
|
+
super
|
44
|
+
end # initialize
|
45
|
+
|
46
|
+
def create_loadbalancer
|
47
|
+
requires :name, :ipaddressesresourceid, :balancetype, :certificate, :creationdate, :ruleid, :instanceport,
|
48
|
+
:loadbalancerport, :protocol, :contactvalue, :loadbalancercontactid, :type
|
49
|
+
data = attributes
|
50
|
+
service.create_loadbalancer(data)
|
51
|
+
end # create
|
52
|
+
|
53
|
+
def remove_loadbalancer
|
54
|
+
requires :id
|
55
|
+
data = attributes
|
56
|
+
service.remove_loadbalancer(data)
|
57
|
+
end # remove
|
58
|
+
|
59
|
+
def get_loadbalancer
|
60
|
+
requires :id
|
61
|
+
response = service.get_loadbalancer(id)
|
62
|
+
new_attributes = response['Value']
|
63
|
+
merge_attributes(new_attributes)
|
64
|
+
end # get
|
65
|
+
|
66
|
+
def modify_loadbalancer
|
67
|
+
requires :id, :name, :healthchecknotification
|
68
|
+
data = attributes
|
69
|
+
service.modify_loadbalancer(data)
|
70
|
+
end # edit
|
71
|
+
|
72
|
+
def get_lb_stats
|
73
|
+
requires :id, :starttime, :endtime
|
74
|
+
data = attributes
|
75
|
+
response = service.get_lb_stats(data)
|
76
|
+
new_attributes = response['Value']
|
77
|
+
merge_attributes(new_attributes)
|
78
|
+
end # get stats
|
79
|
+
|
80
|
+
def get_lb_loads
|
81
|
+
requires :id, :starttime, :endtime
|
82
|
+
data = attributes
|
83
|
+
response = service.get_lb_loads(data)
|
84
|
+
new_attributes = response['Value']
|
85
|
+
merge_attributes(new_attributes)
|
86
|
+
end # get loads
|
87
|
+
|
88
|
+
def add_lb_rule
|
89
|
+
requires :id, :newrule
|
90
|
+
data = attributes
|
91
|
+
service.add_lb_rule(data)
|
92
|
+
end # add rule
|
93
|
+
|
94
|
+
def remove_instance
|
95
|
+
requires :id, :ipaddress
|
96
|
+
data = attributes
|
97
|
+
service.remove_instance(data)
|
98
|
+
end # remove instance
|
99
|
+
|
100
|
+
def add_instance
|
101
|
+
requires :id, :ipaddress
|
102
|
+
data = attributes
|
103
|
+
service.add_instance(data)
|
104
|
+
end # add instance
|
105
|
+
|
106
|
+
def get_notifications
|
107
|
+
requires :id, :starttime, :endtime, :ruleid
|
108
|
+
data = attributes
|
109
|
+
response = service.get_notifications(data)
|
110
|
+
new_attributes = response['Value']
|
111
|
+
merge_attributes(new_attributes)
|
112
|
+
end # get notifications
|
113
|
+
|
114
|
+
def add_contact
|
115
|
+
requires :id, :notificationcontacts
|
116
|
+
data = attributes
|
117
|
+
service.add_contact(data)
|
118
|
+
end # add contact
|
119
|
+
|
120
|
+
def remove_contact
|
121
|
+
requires :id, :contactid
|
122
|
+
data = attributes
|
123
|
+
service.remove_contact(data)
|
124
|
+
end # remove contact
|
125
|
+
|
126
|
+
def enable_loadbalancer
|
127
|
+
requires :id
|
128
|
+
data = attributes
|
129
|
+
service.enable_loadbalancer(data)
|
130
|
+
end
|
131
|
+
|
132
|
+
end # LoadBalancer
|
133
|
+
end # Compute
|
134
|
+
end # ArubaCloud
|
135
|
+
end # Fog
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
#
|
3
|
+
# Author:: Dangleterre Michaël
|
4
|
+
# © Copyright ArubaCloud.
|
5
|
+
#
|
6
|
+
# LICENSE: MIT (http://opensource.org/licenses/MIT)
|
7
|
+
#
|
8
|
+
|
9
|
+
require 'fog/core/collection'
|
10
|
+
require 'fog/arubacloud/compute/models/loadbalancer'
|
11
|
+
|
12
|
+
|
13
|
+
module Fog
|
14
|
+
module ArubaCloud
|
15
|
+
class Compute
|
16
|
+
class LoadBalancers < Fog::Collection
|
17
|
+
model Fog::ArubaCloud::Compute::LoadBalancer
|
18
|
+
end # Load Balancers
|
19
|
+
end # Compute
|
20
|
+
end # ArubaCloud
|
21
|
+
end # Fog
|
@@ -6,14 +6,14 @@
|
|
6
6
|
#
|
7
7
|
|
8
8
|
require 'fog/core/collection'
|
9
|
-
require 'fog/arubacloud/models/
|
9
|
+
require 'fog/arubacloud/compute/models/network_adapter'
|
10
10
|
|
11
11
|
|
12
12
|
module Fog
|
13
|
-
module
|
14
|
-
class
|
13
|
+
module ArubaCloud
|
14
|
+
class Compute
|
15
15
|
class NetworkAdapters < Fog::Collection
|
16
|
-
model Fog::Compute::
|
16
|
+
model Fog::ArubaCloud::Compute::NetworkAdapter
|
17
17
|
end
|
18
18
|
end
|
19
19
|
end
|