knife-google 0.0.1 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +22 -0
- data/CONTRIB.md +64 -0
- data/Gemfile +11 -0
- data/README.md +287 -0
- data/Rakefile +53 -0
- data/knife-google.gemspec +26 -0
- data/lib/chef/knife/google_base.rb +39 -68
- data/lib/chef/knife/google_disk_create.rb +60 -0
- data/lib/chef/knife/google_disk_delete.rb +60 -0
- data/lib/chef/knife/google_disk_list.rb +75 -0
- data/lib/chef/knife/google_server_create.rb +273 -184
- data/lib/chef/knife/google_server_delete.rb +74 -32
- data/lib/chef/knife/google_server_list.rb +45 -64
- data/lib/chef/knife/google_setup.rb +31 -0
- data/lib/chef/knife/google_zone_list.rb +78 -0
- data/lib/google/compute.rb +46 -0
- data/lib/google/compute/client.rb +188 -0
- data/lib/google/compute/config.rb +23 -0
- data/lib/google/compute/creatable_resource_collection.rb +38 -0
- data/lib/google/compute/deletable_resource_collection.rb +51 -0
- data/lib/google/compute/disk.rb +40 -0
- data/lib/google/compute/exception.rb +28 -0
- data/lib/google/compute/firewall.rb +65 -0
- data/lib/google/compute/global_operation.rb +60 -0
- data/lib/google/compute/image.rb +30 -0
- data/lib/google/compute/kernel.rb +20 -0
- data/lib/google/compute/listable_resource_collection.rb +33 -0
- data/lib/google/compute/machine_type.rb +36 -0
- data/lib/google/compute/mixins/utils.rb +58 -0
- data/lib/google/compute/network.rb +29 -0
- data/lib/google/compute/project.rb +76 -0
- data/lib/google/compute/resource.rb +81 -0
- data/lib/google/compute/resource_collection.rb +78 -0
- data/lib/google/compute/server.rb +87 -0
- data/lib/google/compute/server/attached_disk.rb +39 -0
- data/lib/google/compute/server/network_interface.rb +38 -0
- data/lib/google/compute/server/network_interface/access_config.rb +35 -0
- data/lib/google/compute/server/serial_port_output.rb +31 -0
- data/lib/google/compute/snapshot.rb +30 -0
- data/lib/google/compute/version.rb +19 -0
- data/lib/google/compute/zone.rb +32 -0
- data/lib/google/compute/zone_operation.rb +60 -0
- data/lib/knife-google/version.rb +18 -2
- data/spec/chef/knife/google_base_spec.rb +46 -0
- data/spec/chef/knife/google_disk_create_spec.rb +36 -0
- data/spec/chef/knife/google_disk_delete_spec.rb +65 -0
- data/spec/chef/knife/google_disk_list_spec.rb +36 -0
- data/spec/chef/knife/google_server_create_spec.rb +84 -0
- data/spec/chef/knife/google_server_delete_spec.rb +105 -0
- data/spec/chef/knife/google_server_list_spec.rb +39 -0
- data/spec/chef/knife/google_setup_spec.rb +25 -0
- data/spec/chef/knife/google_zone_list_spec.rb +32 -0
- data/spec/data/client.json +14 -0
- data/spec/data/compute-v1beta14.json +3386 -0
- data/spec/data/disk.json +15 -0
- data/spec/data/firewall.json +13 -0
- data/spec/data/global_operation.json +36 -0
- data/spec/data/image.json +12 -0
- data/spec/data/kernel.json +15 -0
- data/spec/data/machine_type.json +24 -0
- data/spec/data/network.json +10 -0
- data/spec/data/project.json +21 -0
- data/spec/data/serial_port_output.json +5 -0
- data/spec/data/server.json +46 -0
- data/spec/data/snapshot.json +12 -0
- data/spec/data/zone.json +30 -0
- data/spec/data/zone_operation.json +36 -0
- data/spec/google/compute/disk_spec.rb +105 -0
- data/spec/google/compute/firewall_spec.rb +128 -0
- data/spec/google/compute/global_operation_spec.rb +62 -0
- data/spec/google/compute/image_spec.rb +75 -0
- data/spec/google/compute/kernel_spec.rb +49 -0
- data/spec/google/compute/machine_type_spec.rb +53 -0
- data/spec/google/compute/network_spec.rb +68 -0
- data/spec/google/compute/project_spec.rb +71 -0
- data/spec/google/compute/server_spec.rb +125 -0
- data/spec/google/compute/snapshot_spec.rb +69 -0
- data/spec/google/compute/zone_operation_spec.rb +62 -0
- data/spec/google/compute/zone_spec.rb +50 -0
- data/spec/spec_helper.rb +44 -0
- data/spec/support/mocks.rb +62 -0
- data/spec/support/resource_examples.rb +70 -0
- data/spec/support/spec_google_base.rb +56 -0
- metadata +121 -31
- data/README.rdoc +0 -96
data/README.rdoc
DELETED
@@ -1,96 +0,0 @@
|
|
1
|
-
= Knife Google
|
2
|
-
|
3
|
-
= DESCRIPTION:
|
4
|
-
|
5
|
-
This is the official Opscode Knife plugin for Google. This plugin gives knife the ability to create, bootstrap, and manage servers on the Google Cloud.
|
6
|
-
|
7
|
-
= INSTALLATION (LINUX/OSX):
|
8
|
-
Be sure you are running the latest version Chef. Versions earlier than 0.10.0 don't support plugins:
|
9
|
-
|
10
|
-
gem install chef
|
11
|
-
|
12
|
-
This plugin depends on the gcutil CLI utility
|
13
|
-
pip install https://dl.google.com/dl/compute/gcutil.tar.gz
|
14
|
-
|
15
|
-
This plugin is distributed as a Ruby Gem. To build and install it, run:
|
16
|
-
|
17
|
-
gem build knife-google
|
18
|
-
gem install knife-google
|
19
|
-
|
20
|
-
Alternatively, the rake utility installs the gcutil CLI utility as part of installation
|
21
|
-
|
22
|
-
rake install
|
23
|
-
|
24
|
-
= INSTALLATION (WINDOWS):
|
25
|
-
Be sure you are running the latest version Chef. Versions earlier than 0.10.0 don't support plugins:
|
26
|
-
|
27
|
-
Follow these instructions to install Chef-Workstation on Windows: http://wiki.opscode.com/display/chef/Workstation+Setup+for+Windows
|
28
|
-
|
29
|
-
The gcutil tool can be installed on Windows, via Cygwin.
|
30
|
-
|
31
|
-
Install Cygwin with Python Environment: https://developers.google.com/compute/docs/gcutil_setup
|
32
|
-
|
33
|
-
In Windows, set CYGWINPATH environment variable to point the Cygwin Installation and add %CYGWINPATH%\\bin to the PATH environment variable
|
34
|
-
|
35
|
-
set CYGWINPATH=<CYGWIN INSTALLATION PATH>
|
36
|
-
set PATH=%CYGWINPATH%\\bin;%PATH%
|
37
|
-
|
38
|
-
Use the rake utility to install gcutil CLI utility and the knife plugin
|
39
|
-
|
40
|
-
rake install
|
41
|
-
|
42
|
-
= CONFIGURATION:
|
43
|
-
Run gcutil auth to request a token. This command prints a URL where you can acquire an OAuth 2.0 refresh token for Google Compute.
|
44
|
-
|
45
|
-
gcutil auth --project_id=<your_project_id>
|
46
|
-
Go to the following link in your browser:
|
47
|
-
<link>
|
48
|
-
|
49
|
-
Enter verification code:
|
50
|
-
|
51
|
-
|
52
|
-
# provision a new 2 Core 1GB Ubuntu 10.04 webserver
|
53
|
-
knife google server create -N <server-name> -i <SSH Identity Key> -k <SSH Public Key> --tcp 22,80,8080
|
54
|
-
--udp 10000 --project_id <project-name> --flavor standard-2-cpu-ephemeral-disk
|
55
|
-
|
56
|
-
Additionally the following options may be set in your `knife.rb`:
|
57
|
-
|
58
|
-
* flavor
|
59
|
-
* image
|
60
|
-
* distro
|
61
|
-
* template_file
|
62
|
-
|
63
|
-
= SUBCOMMANDS:
|
64
|
-
|
65
|
-
This plugin provides the following Knife subcommands. Specific command options can be found by invoking the subcommand with a <tt>--help</tt> flag
|
66
|
-
|
67
|
-
== knife google server create
|
68
|
-
|
69
|
-
Provisions a new server in the Google Cloud and then perform a Chef bootstrap (using the SSH protocol). The goal of the bootstrap is to get Chef installed
|
70
|
-
on the target system so it can run Chef Client with a Chef Server. The main assumption is a baseline OS installation exists (provided by the provisioning). It is primarily intended for Chef Client systems that talk to a Chef server. By default the server is bootstrapped using the {ubuntu10.04-gems}[https://github.com/opscode/chef/blob/master/chef/lib/chef/knife/bootstrap/ubuntu10.04-gems.erb] template. This can be overridden using the <tt>-d</tt> or <tt>--template-file</tt> command options.
|
71
|
-
|
72
|
-
== knife google server delete
|
73
|
-
|
74
|
-
Deletes an existing server in the currently configured Google Cloud account by the server/instance id. You can find the instance id by entering 'knife google server list'. Please note - this does not delete the associated node and client objects from the Chef server.
|
75
|
-
|
76
|
-
== knife google server list
|
77
|
-
|
78
|
-
Outputs a list of all servers in the currently configured Google Cloud account. Please note - this shows all instances associated with the account, some of which may not be currently managed by the Chef server.
|
79
|
-
|
80
|
-
= LICENSE:
|
81
|
-
|
82
|
-
Author:: Chirag Jog (<chiragj@websym.com>)
|
83
|
-
Copyright:: Copyright (c) 2012 Opscode, Inc.
|
84
|
-
License:: Apache License, Version 2.0
|
85
|
-
|
86
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
87
|
-
you may not use this file except in compliance with the License.
|
88
|
-
You may obtain a copy of the License at
|
89
|
-
|
90
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
91
|
-
|
92
|
-
Unless required by applicable law or agreed to in writing, software
|
93
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
94
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
95
|
-
See the License for the specific language governing permissions and
|
96
|
-
limitations under the License.
|