knife-google 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/README.md +155 -66
- data/knife-google.gemspec +2 -1
- data/lib/chef/knife/google_base.rb +1 -1
- data/lib/chef/knife/google_disk_create.rb +17 -9
- data/lib/chef/knife/google_disk_delete.rb +2 -2
- data/lib/chef/knife/google_disk_list.rb +8 -8
- data/lib/chef/knife/google_project_list.rb +178 -0
- data/lib/chef/knife/google_region_list.rb +125 -0
- data/lib/chef/knife/google_server_create.rb +174 -46
- data/lib/chef/knife/google_server_delete.rb +9 -13
- data/lib/chef/knife/google_server_list.rb +5 -6
- data/lib/chef/knife/google_zone_list.rb +22 -28
- data/lib/google/compute.rb +2 -1
- data/lib/google/compute/client.rb +12 -7
- data/lib/google/compute/creatable_resource_collection.rb +12 -1
- data/lib/google/compute/disk.rb +0 -2
- data/lib/google/compute/image.rb +1 -2
- data/lib/google/compute/project.rb +2 -2
- data/lib/google/compute/{kernel.rb → region.rb} +12 -1
- data/lib/google/compute/region_operation.rb +62 -0
- data/lib/google/compute/server.rb +3 -2
- data/lib/google/compute/server/attached_disk.rb +3 -3
- data/lib/google/compute/zone.rb +6 -4
- data/lib/google/compute/zone_operation.rb +11 -9
- data/lib/knife-google/version.rb +1 -1
- data/spec/chef/knife/google_base_spec.rb +4 -4
- data/spec/chef/knife/google_disk_create_spec.rb +8 -7
- data/spec/chef/knife/google_disk_delete_spec.rb +15 -16
- data/spec/chef/knife/google_disk_list_spec.rb +6 -6
- data/spec/chef/knife/google_region_list_spec.rb +32 -0
- data/spec/chef/knife/google_server_create_spec.rb +78 -44
- data/spec/chef/knife/google_server_delete_spec.rb +37 -37
- data/spec/chef/knife/google_server_list_spec.rb +8 -7
- data/spec/chef/knife/google_setup_spec.rb +1 -2
- data/spec/chef/knife/google_zone_list_spec.rb +4 -4
- data/spec/data/{compute-v1beta15.json → compute-v1.json} +700 -246
- data/spec/data/disk.json +3 -4
- data/spec/data/firewall.json +2 -2
- data/spec/data/global_operation.json +3 -3
- data/spec/data/image.json +2 -2
- data/spec/data/machine_type.json +1 -1
- data/spec/data/network.json +1 -1
- data/spec/data/project.json +1 -1
- data/spec/data/region.json +23 -0
- data/spec/data/serial_port_output.json +1 -1
- data/spec/data/server.json +7 -7
- data/spec/data/snapshot.json +2 -2
- data/spec/data/zone.json +7 -15
- data/spec/data/zone_operation.json +3 -3
- data/spec/google/compute/disk_spec.rb +32 -32
- data/spec/google/compute/firewall_spec.rb +37 -37
- data/spec/google/compute/global_operation_spec.rb +9 -9
- data/spec/google/compute/image_spec.rb +17 -17
- data/spec/google/compute/machine_type_spec.rb +7 -7
- data/spec/google/compute/network_spec.rb +14 -14
- data/spec/google/compute/project_spec.rb +17 -17
- data/spec/google/compute/region_spec.rb +51 -0
- data/spec/google/compute/server_spec.rb +35 -42
- data/spec/google/compute/snapshot_spec.rb +11 -11
- data/spec/google/compute/zone_operation_spec.rb +9 -9
- data/spec/google/compute/zone_spec.rb +7 -7
- data/spec/spec_helper.rb +1 -0
- data/spec/support/mocks.rb +10 -10
- data/spec/support/resource_examples.rb +7 -7
- data/spec/support/spec_google_base.rb +4 -0
- metadata +14 -26
- data/spec/data/kernel.json +0 -15
- data/spec/google/compute/kernel_spec.rb +0 -49
data/spec/data/kernel.json
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"kind":"compute#kernel",
|
3
|
-
"id":"12941177846308850718",
|
4
|
-
"creationTimestamp":"2012-07-16 14:42:16 -0700",
|
5
|
-
"selfLink":"https://www.googleapis.com/compute/v1beta15/projects/mock-project/global/kernels/mock-kernel",
|
6
|
-
"name":"mock-kernel",
|
7
|
-
"description":"Mock description",
|
8
|
-
"deprecated":{
|
9
|
-
"state":"",
|
10
|
-
"replacement":"",
|
11
|
-
"deprecated":"",
|
12
|
-
"obsolete":"",
|
13
|
-
"deleted":""
|
14
|
-
}
|
15
|
-
}
|
@@ -1,49 +0,0 @@
|
|
1
|
-
# Copyright 2013 Google Inc. All Rights Reserved.
|
2
|
-
#
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
-
# you may not use this file except in compliance with the License.
|
5
|
-
# You may obtain a copy of the License at
|
6
|
-
#
|
7
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
-
#
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
-
# See the License for the specific language governing permissions and
|
13
|
-
# limitations under the License.
|
14
|
-
require 'spec_helper'
|
15
|
-
|
16
|
-
describe Google::Compute::Kernel do
|
17
|
-
|
18
|
-
before(:each) do
|
19
|
-
@mock_api_client=mock(Google::APIClient, :authorization= =>{}, :auto_refresh_token= =>{})
|
20
|
-
@mock_api_client.stub!(:discovered_api).and_return(mock_compute)
|
21
|
-
Google::APIClient.stub!(:new).and_return(@mock_api_client)
|
22
|
-
end
|
23
|
-
|
24
|
-
let(:client) do
|
25
|
-
Google::Compute::Client.from_json(mock_data_file(Google::Compute::Client))
|
26
|
-
end
|
27
|
-
|
28
|
-
it_should_behave_like Google::Compute::Resource
|
29
|
-
|
30
|
-
it '#get should return an individual kernel' do
|
31
|
-
@mock_api_client.should_receive(:execute).
|
32
|
-
with(:api_method=>mock_compute.kernels.get,
|
33
|
-
:parameters=>{'kernel'=>'mock-kernel', :project=>'mock-project'},:body_object=>nil).
|
34
|
-
and_return(mock_response(Google::Compute::Kernel))
|
35
|
-
|
36
|
-
kernel = client.kernels.get('mock-kernel')
|
37
|
-
kernel.should be_a_kind_of Google::Compute::Kernel
|
38
|
-
kernel.name.should eq('mock-kernel')
|
39
|
-
end
|
40
|
-
|
41
|
-
it '#list should return an array of kernels' do
|
42
|
-
@mock_api_client.should_receive(:execute).
|
43
|
-
with(:api_method=>mock_compute.kernels.list,
|
44
|
-
:parameters=>{ :project=>'mock-project'},:body_object=>nil).
|
45
|
-
and_return(mock_response(Google::Compute::Kernel, true))
|
46
|
-
kernels = client.kernels.list
|
47
|
-
kernels.all?{|kernel| kernel.is_a?(Google::Compute::Kernel)}.should be_true
|
48
|
-
end
|
49
|
-
end
|