knife-oraclecloud 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +9 -0
  3. data/.rspec +2 -0
  4. data/.rubocop.yml +12 -0
  5. data/CHANGELOG.md +5 -0
  6. data/Gemfile +3 -0
  7. data/LICENSE.txt +202 -0
  8. data/README.md +248 -0
  9. data/Rakefile +6 -0
  10. data/knife-oraclecloud.gemspec +28 -0
  11. data/lib/chef/knife/cloud/oraclecloud_service.rb +206 -0
  12. data/lib/chef/knife/cloud/oraclecloud_service_helpers.rb +48 -0
  13. data/lib/chef/knife/cloud/oraclecloud_service_options.rb +58 -0
  14. data/lib/chef/knife/oraclecloud_image_list.rb +63 -0
  15. data/lib/chef/knife/oraclecloud_orchestration_delete.rb +51 -0
  16. data/lib/chef/knife/oraclecloud_orchestration_list.rb +65 -0
  17. data/lib/chef/knife/oraclecloud_orchestration_show.rb +64 -0
  18. data/lib/chef/knife/oraclecloud_server_create.rb +105 -0
  19. data/lib/chef/knife/oraclecloud_server_delete.rb +48 -0
  20. data/lib/chef/knife/oraclecloud_server_list.rb +67 -0
  21. data/lib/chef/knife/oraclecloud_server_show.rb +52 -0
  22. data/lib/chef/knife/oraclecloud_shape_list.rb +51 -0
  23. data/lib/knife-oraclecloud/version.rb +21 -0
  24. data/spec/spec_helper.rb +17 -0
  25. data/spec/unit/cloud/oraclecloud_service_helpers_spec.rb +94 -0
  26. data/spec/unit/cloud/oraclecloud_service_spec.rb +386 -0
  27. data/spec/unit/oraclecloud_image_list_spec.rb +39 -0
  28. data/spec/unit/oraclecloud_orchestration_delete_spec.rb +59 -0
  29. data/spec/unit/oraclecloud_orchestration_list_spec.rb +56 -0
  30. data/spec/unit/oraclecloud_orchestration_show_spec.rb +96 -0
  31. data/spec/unit/oraclecloud_server_create_spec.rb +118 -0
  32. data/spec/unit/oraclecloud_server_delete_spec.rb +40 -0
  33. data/spec/unit/oraclecloud_server_list_spec.rb +59 -0
  34. data/spec/unit/oraclecloud_server_show_spec.rb +57 -0
  35. data/spec/unit/oraclecloud_shape_list_spec.rb +39 -0
  36. metadata +161 -0
@@ -0,0 +1,57 @@
1
+ #
2
+ # Author:: Chef Partner Engineering (<partnereng@chef.io>)
3
+ # Copyright:: Copyright (c) 2015 Chef Software, Inc.
4
+ # License:: Apache License, Version 2.0
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+ #
18
+
19
+ require 'spec_helper'
20
+ require 'chef/knife/oraclecloud_server_show'
21
+ require 'support/shared_examples_for_command'
22
+
23
+ describe Chef::Knife::Cloud::OraclecloudServerShow do
24
+ let(:command) { described_class.new(%w(server1)) }
25
+ let(:service) { double('service') }
26
+
27
+ before do
28
+ allow(command).to receive(:service).and_return(service)
29
+ end
30
+
31
+ it_behaves_like Chef::Knife::Cloud::Command, described_class.new
32
+
33
+ describe '#validate_params!' do
34
+ context 'when no server is provided' do
35
+ let(:command) { described_class.new }
36
+ it 'print an error and exits' do
37
+ expect(command.ui).to receive(:error)
38
+ expect { command.validate_params! }.to raise_error(SystemExit)
39
+ end
40
+ end
41
+
42
+ context 'when more than one server is provided' do
43
+ let(:command) { described_class.new(%w(server1 server2)) }
44
+ it 'print an error and exits' do
45
+ expect(command.ui).to receive(:error)
46
+ expect { command.validate_params! }.to raise_error(SystemExit)
47
+ end
48
+ end
49
+
50
+ context 'when one server is provided' do
51
+ it 'does not print an error and does not exit' do
52
+ expect(command.ui).not_to receive(:error)
53
+ expect { command.validate_params! }.not_to raise_error
54
+ end
55
+ end
56
+ end
57
+ end
@@ -0,0 +1,39 @@
1
+ #
2
+ # Author:: Chef Partner Engineering (<partnereng@chef.io>)
3
+ # Copyright:: Copyright (c) 2015 Chef Software, Inc.
4
+ # License:: Apache License, Version 2.0
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+ #
18
+
19
+ require 'spec_helper'
20
+ require 'chef/knife/oraclecloud_shape_list'
21
+ require 'support/shared_examples_for_command'
22
+
23
+ describe Chef::Knife::Cloud::OraclecloudShapeList do
24
+ let(:command) { described_class.new }
25
+ let(:service) { double('service') }
26
+
27
+ before do
28
+ allow(command).to receive(:service).and_return(service)
29
+ end
30
+
31
+ it_behaves_like Chef::Knife::Cloud::Command, described_class.new
32
+
33
+ describe '#query_resource' do
34
+ it 'calls list_shapes' do
35
+ expect(service).to receive(:list_shapes)
36
+ command.query_resource
37
+ end
38
+ end
39
+ end
metadata ADDED
@@ -0,0 +1,161 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: knife-oraclecloud
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Chef Partner Engineering
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-10-15 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: chef
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '12.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '12.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: knife-cloud
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 1.2.0
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 1.2.0
41
+ - !ruby/object:Gem::Dependency
42
+ name: oraclecloud
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: bundler
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '1.7'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '1.7'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rake
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '10.0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '10.0'
83
+ description: Knife plugin to interact with Oracle Cloud.
84
+ email:
85
+ - partnereng@chef.io
86
+ executables: []
87
+ extensions: []
88
+ extra_rdoc_files: []
89
+ files:
90
+ - ".gitignore"
91
+ - ".rspec"
92
+ - ".rubocop.yml"
93
+ - CHANGELOG.md
94
+ - Gemfile
95
+ - LICENSE.txt
96
+ - README.md
97
+ - Rakefile
98
+ - knife-oraclecloud.gemspec
99
+ - lib/chef/knife/cloud/oraclecloud_service.rb
100
+ - lib/chef/knife/cloud/oraclecloud_service_helpers.rb
101
+ - lib/chef/knife/cloud/oraclecloud_service_options.rb
102
+ - lib/chef/knife/oraclecloud_image_list.rb
103
+ - lib/chef/knife/oraclecloud_orchestration_delete.rb
104
+ - lib/chef/knife/oraclecloud_orchestration_list.rb
105
+ - lib/chef/knife/oraclecloud_orchestration_show.rb
106
+ - lib/chef/knife/oraclecloud_server_create.rb
107
+ - lib/chef/knife/oraclecloud_server_delete.rb
108
+ - lib/chef/knife/oraclecloud_server_list.rb
109
+ - lib/chef/knife/oraclecloud_server_show.rb
110
+ - lib/chef/knife/oraclecloud_shape_list.rb
111
+ - lib/knife-oraclecloud/version.rb
112
+ - spec/spec_helper.rb
113
+ - spec/unit/cloud/oraclecloud_service_helpers_spec.rb
114
+ - spec/unit/cloud/oraclecloud_service_spec.rb
115
+ - spec/unit/oraclecloud_image_list_spec.rb
116
+ - spec/unit/oraclecloud_orchestration_delete_spec.rb
117
+ - spec/unit/oraclecloud_orchestration_list_spec.rb
118
+ - spec/unit/oraclecloud_orchestration_show_spec.rb
119
+ - spec/unit/oraclecloud_server_create_spec.rb
120
+ - spec/unit/oraclecloud_server_delete_spec.rb
121
+ - spec/unit/oraclecloud_server_list_spec.rb
122
+ - spec/unit/oraclecloud_server_show_spec.rb
123
+ - spec/unit/oraclecloud_shape_list_spec.rb
124
+ homepage: https://github.com/chef-partners/knife-oraclecloud
125
+ licenses:
126
+ - Apache 2.0
127
+ metadata: {}
128
+ post_install_message:
129
+ rdoc_options: []
130
+ require_paths:
131
+ - lib
132
+ required_ruby_version: !ruby/object:Gem::Requirement
133
+ requirements:
134
+ - - ">="
135
+ - !ruby/object:Gem::Version
136
+ version: '0'
137
+ required_rubygems_version: !ruby/object:Gem::Requirement
138
+ requirements:
139
+ - - ">="
140
+ - !ruby/object:Gem::Version
141
+ version: '0'
142
+ requirements: []
143
+ rubyforge_project:
144
+ rubygems_version: 2.4.8
145
+ signing_key:
146
+ specification_version: 4
147
+ summary: Knife plugin to interact with Oracle Cloud.
148
+ test_files:
149
+ - spec/spec_helper.rb
150
+ - spec/unit/cloud/oraclecloud_service_helpers_spec.rb
151
+ - spec/unit/cloud/oraclecloud_service_spec.rb
152
+ - spec/unit/oraclecloud_image_list_spec.rb
153
+ - spec/unit/oraclecloud_orchestration_delete_spec.rb
154
+ - spec/unit/oraclecloud_orchestration_list_spec.rb
155
+ - spec/unit/oraclecloud_orchestration_show_spec.rb
156
+ - spec/unit/oraclecloud_server_create_spec.rb
157
+ - spec/unit/oraclecloud_server_delete_spec.rb
158
+ - spec/unit/oraclecloud_server_list_spec.rb
159
+ - spec/unit/oraclecloud_server_show_spec.rb
160
+ - spec/unit/oraclecloud_shape_list_spec.rb
161
+ has_rdoc: