Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added clone functionality #5

Open
wants to merge 271 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
271 commits
Select commit Hold shift + click to select a range
a59c63d
[Credential][API 1.0] adding credential api support
Feb 9, 2011
365a59b
[ActiveSupport] pinning verison of active_support to 2.3.10 for maxim…
Feb 16, 2011
7d67882
[ServerInterface] fixing up aki vs. ari conversion
Feb 25, 2011
ced8d30
updated for sshkey generation
Mar 2, 2011
9f33fb4
couple fixes, catches unexpected termination
Mar 7, 2011
771dc47
better at catching unexpected terminates
Mar 8, 2011
b7e83d5
mc bugfix and faster wait_for_state refresh
Mar 18, 2011
f64bcd3
wait_for_operational_with_dns fix
Mar 18, 2011
0be3c6b
cloud_id fixes for robustness
Mar 25, 2011
df17fb3
Merge branch 'master' of git://github.com/jeremyd/rest_connection int…
Mar 25, 2011
06b2912
Improved find_all modularity for gateway resources
Mar 29, 2011
e0edb79
bugfix
Mar 30, 2011
7bf0276
username/password prompting
Apr 4, 2011
96b06ca
bugfix
Apr 4, 2011
9998880
wait_for_servers option for destroy
Apr 8, 2011
a16ecd4
added optional do_not_log_result arg for spot_check
Apr 15, 2011
ff13c6a
cloud list fix
Apr 19, 2011
a8f133b
bugfix
Apr 19, 2011
2a94cda
bugfixes
Apr 19, 2011
d757ebf
bugfix
Apr 19, 2011
775e40c
Updates for cloud_var autonomy
Apr 20, 2011
0fc1988
Merge branch 'master' of git://github.com/jeremyd/rest_connection int…
Apr 21, 2011
682530c
Add McImage resource for 1.5
Apr 21, 2011
5612cbe
Experimental functionality to update multicloud server parameters
May 4, 2011
2ebc9a5
bugfix for saving server params through ServerInterface
May 5, 2011
fce2266
Updates for API 1.5 changes
May 6, 2011
1ac0695
additional shorthand
May 10, 2011
aeed96b
more shorthand
May 10, 2011
487a23d
bugfix for 1.0 -> 1.5 translations
May 11, 2011
5d8f8b7
Added Macro resource and hacked multicloud reboot
May 11, 2011
39d5d4b
Adding find_by_cloud_id to shorthand
May 11, 2011
14e69c8
Merge branch 'master' of git://github.com/jeremyd/rest_connection int…
May 20, 2011
8efbb2e
some bugfixes + S3Bucket resource
May 20, 2011
dde1064
Warning message if no servers in the deployment
May 31, 2011
6e69793
merged jeremyd's
Dec 10, 2010
a31c7c6
multicloud support
Jan 14, 2011
95bb9f6
some more upgrades for multicloud
Jan 18, 2011
96accf6
more multicloud support + bugfixes
Jan 19, 2011
f051059
[Logger] If request body contains "password", don't log.
May 31, 2011
cd5cf41
[Logger] If request body contains "password", don't log.
May 31, 2011
a54a15a
Added input manipulation to mc_instances
Jun 3, 2011
2c154f8
[Server] Much more robust cloud_id deciphering
Jun 6, 2011
d27ac34
[API 1.5] Fix for Euca dns_name
Jun 22, 2011
3ac72d8
Workaround for broken 'full' instance view on non-euca clouds
Jun 24, 2011
8835fb7
Added Taggable mixin
Jun 27, 2011
a069870
[Taggable] changed info tag function names
Jun 27, 2011
5f224b3
Fixes
Jun 27, 2011
edc587f
bug fixes; new API 1.5 resources
Jul 6, 2011
901fad5
Updates for cross-API ST and MCI support
Jul 7, 2011
0d8947f
[API 1.5] Added McInstanceType resource
Jul 8, 2011
9909ccf
adding private-ip method for *servers
Jul 8, 2011
cd01d06
Added get_sketchy_data, set_inputs, and reload_as_next
Jul 8, 2011
72dda71
bugfix: parameters should return a hash, even if empty
Jul 11, 2011
3577a3a
Swapped order of sleep and check state
Jul 16, 2011
f3d1602
bugfix
Jul 18, 2011
6eedcfd
API 1.5 uses posts instead of gets
Jul 18, 2011
f54cc83
bugfix for API 1.5 return
Jul 19, 2011
e990834
McDeployment, McServerArray, several fixes
Jul 26, 2011
5ff1a01
Ability to list all "info:" machine tags
Jul 27, 2011
ce5ce56
[API 1.5] added find_with_filter; [Server] added reachable_ip fn
Aug 9, 2011
1c67186
[ServerInterface] Inputs can't be an empty array
Aug 10, 2011
410db31
bugfixes
Aug 11, 2011
391d5f5
[API 1.0, 1.5] Several bugfixes regarding updating params
Aug 11, 2011
4f84517
bugfixes
Aug 12, 2011
8bbb396
AuditEntry timeout bubble up, tag bugfixes, McServer bugfix
Aug 23, 2011
ef74116
Tag bugfixes
Aug 23, 2011
9d62be6
Merge branch 'master' of github.com:jeremyd/rest_connection into mult…
Aug 25, 2011
24b7b06
[Server] Added ignore_lock option to run_executable
Aug 26, 2011
105bfb6
bugfix
Aug 26, 2011
f72e4c2
tags merge instead of reload
Aug 31, 2011
26bf1b6
bugfix
Aug 31, 2011
ffd232a
Revert "bugfix"
Aug 31, 2011
f6671fa
Revert "tags merge instead of reload"
Aug 31, 2011
03f36be
[API 1.5] Added Volume, VolumeAttachment, VolumeSnapshot, VolumeType
Aug 31, 2011
2c67820
[API 1.0 & API 1.5] Tag fixes
Sep 1, 2011
805e722
McTag fixes
Sep 1, 2011
c000926
Bugfix for McTaggable search
Sep 1, 2011
9fbca32
bugfix
Sep 2, 2011
cce4ad9
remove_info_tag fixes
Sep 7, 2011
9ad5d1d
Changed all dns_name references to reachable_ip for Private Clouds
Sep 9, 2011
1f3789a
net-ssh gem version conflict with fog-0.11
Sep 9, 2011
aa2a14d
net-ssh gem version conflict with fog-0.11
Sep 9, 2011
385897f
Merge branch 'master' of github.com:jeremyd/rest_connection into mult…
Sep 14, 2011
0925b4f
Merge fixes, ServerInterface fixes
Sep 16, 2011
bf35791
Bugfix for clear_tags
Sep 21, 2011
829075b
Whitespace cleanup and Taggable interface improvements
Sep 21, 2011
4e21b69
[API 1.5] Added standard Input interface
Sep 21, 2011
8fdb94a
[API 1.5] New Resources, Taggable fixes
Oct 4, 2011
6d7ea6f
[API 1.5] Added check for unlaunchable servers
Oct 5, 2011
9e52fe0
[API 1.0] Ensure Server is set to next before tag changes; bugfixes
Oct 5, 2011
4c038a9
Added .set_current_inputs and .set_next_inputs
Oct 14, 2011
c6fa6a5
Merge branch 'master' of git://github.com/christopherdeutsch/rest_con…
Oct 14, 2011
729c21d
Whitespace Fixes
Oct 14, 2011
faa8d29
Edited lib/rest_connection.rb via GitHub
alexpop Oct 14, 2011
f96636d
highline
alexpop Oct 14, 2011
9ca5d08
overriding settings example
alexpop Oct 14, 2011
cca562c
Merge pull request #1 from alexpop/multicloud
twrodriguez Oct 14, 2011
8c1e6ff
Added catch for "inactive" state during state wait
Oct 14, 2011
a826166
bugfix
Oct 14, 2011
d16b2a2
Bugfix for Taggable
Oct 15, 2011
24a923d
Bugfix for mc_server set_inputs
Oct 19, 2011
42b1037
Bugfix for cloud_id run before any .settings
Oct 19, 2011
bc1c740
Bugfix for Net::SSH hangs
Oct 20, 2011
5d6fad1
Fix for certain ssh configs that allow successful logins without -i
Oct 24, 2011
c0035ae
Workaround for API Bug
Oct 31, 2011
a035470
Merge branch 'multicloud' of github.com:twrodriguez/rest_connection
Nov 1, 2011
1c75d50
Version bump to 0.1.0
Nov 1, 2011
b12736b
Updated gemspec
Nov 1, 2011
849fb91
Added include_mcis param on ServerTemplate show; ssh raise fix
Nov 11, 2011
12af868
Timeout backoff on testing connectivity
Nov 11, 2011
add2487
Added new API resources, methods; Added .filters()
Nov 23, 2011
336d076
Update for new API resource and new AWS region
Dec 17, 2011
33c01d5
Version bump to 0.1.1
Dec 17, 2011
0598601
[API 1.5] Added undef's for mixin methods that aren't supported
Dec 17, 2011
c438e7a
Fix for timeout propogation in 1.5 Tasks
Dec 22, 2011
4cbf375
[API 1.0] [API 1.5] [Core] Big Release
Jan 26, 2012
74576d5
Version bump to 0.1.2
Jan 26, 2012
b28d4b9
look for per application configs
psschroeter Jan 30, 2012
bab56f9
Bugfix for ssh'ing to servers behind a IP forwarding gateway
Feb 3, 2012
564b790
[API 0.1, API 1.0, API 1.5, Core] Several Improvements
Feb 8, 2012
d15c987
Bugfixes
Feb 10, 2012
1ffbc24
Merge branch 'master' of github.com:rightscale/rest_connection
Feb 10, 2012
229f31a
Cleaning up bugs & additional code
Feb 10, 2012
c1ed5d1
Version bump to 0.1.3
Feb 10, 2012
0691d08
Updated README to put RightScale's repo as default
Feb 10, 2012
3a601d2
Added code to prevent @params from getting stepped on (non-hash) and …
jonmarinellors Feb 27, 2012
578104a
Updated to push 0.1.4
jonmarinellors Feb 27, 2012
a4ca36f
Updated the correct files this time to corretly upload the gem file.
jonmarinellors Feb 27, 2012
20b0bf5
Bumbed version number to allow us to fix the doc problem up on rubygems.
jonmarinellors Feb 27, 2012
44f3d00
class name of Ec2ServerArrayInternal was erroniously set to Ec2Server…
Mar 2, 2012
ecaf464
Added instructions for creating the gem and pusing to rubygems.org.
jonmarinellors Mar 6, 2012
3b14924
Christopher Deutsch's rest_connection fix for Ec2ServerArray regressi…
jonmarinellors Mar 6, 2012
a164c67
fix includes/extends required for internal API controllers
Mar 8, 2012
927b7cf
add nokogiri dependency for XML parsing
Mar 8, 2012
af9e8ee
return array of Status objects instead of just one
Mar 9, 2012
5dd9218
add nokogiri
Mar 14, 2012
caf0474
Updated VERSION to 0.1.7 and removed rest_connection.gemspec from git…
jonmarinellors Mar 14, 2012
73a3c4f
Merged timeouts into master: Squashed commit of the following:
jonmarinellors Mar 16, 2012
8e65ab7
Fixed problem where ssh(ing) into a rightscale server always failed f…
jonmarinello Mar 19, 2012
9edc5be
Bumped version to 0.1.9
jonmarinello Mar 19, 2012
e725214
Merged pre-commit branch into master.
jonmarinello Mar 20, 2012
e6ac663
Added rest_connection.gemspec ignore
jonmarinello Mar 22, 2012
f9a0456
Bumped version to 0.1.10
jonmarinellors Mar 26, 2012
0e75a22
support for some more CRUD operations for multicloud images
psschroeter Apr 30, 2012
0f21223
Added RubyMine.
jonmarinellors Jun 11, 2012
0db26e6
New rest_connection api log parser.
jonmarinellors Jun 11, 2012
56d9702
Sorted the results by API version and removed duplicates.
jonmarinellors Jun 11, 2012
7b5a9a5
Added computation of the api_start_column in log_api_call_parser as t…
jonmarinellors Jun 12, 2012
5e5204a
Added lock/unlock methods to Server class
Jun 26, 2012
cd48390
Update usage comment.
jonmarinellors Jun 26, 2012
db219dc
Updated config instructions comment.
jonmarinellors Jun 26, 2012
e638168
Merge pull request #4 from ryancragun/dev
Jun 26, 2012
4ed9393
Updated LICENSE file contents.
jonmarinellors Jul 10, 2012
2d4a484
Implemented Azure rest_connection McServer.launch() hack to return on…
jonmarinellors Jul 11, 2012
7de5e85
Added warning message for Azure launch hack.
jonmarinellors Jul 11, 2012
5930605
Added retry logic to Azure hack and some logging statements.
jonmarinellors Jul 11, 2012
888de64
Changed exception rescue on azure hack.
jonmarinellors Jul 11, 2012
6a7c683
Improved logging on azure hack.
jonmarinellors Jul 11, 2012
ba8d466
Fixed settings references in azure hack.
jonmarinellors Jul 11, 2012
25ec13a
Fixed regex and some logging changes for Azure hack.
jonmarinellors Jul 11, 2012
e4dd0cf
Cleaned up logging messages and added a raise if the retry didn't mat…
jonmarinellors Jul 11, 2012
859fffb
Added stars to logged sleep message for Azure hack.
jonmarinellors Jul 11, 2012
348aa82
added puts statement for extra logging of api calls. the puts changes…
EfrainOlivares Jul 27, 2012
677fb78
Added "504 Gateway Time-out" error special handling to McServer.launch()
jonmarinellors Jul 30, 2012
4de8fde
Merge branch 'azurehack'
jonmarinellors Aug 28, 2012
637958b
Version 0.1.11 - Merged in Azurehack branch.
jonmarinellors Aug 28, 2012
42b93ba
Changed all SSH probes to use 'right scale' instead of 'root' (This c…
jonmarinellors Sep 12, 2012
d8a3020
Added logic to obtain a pseudo-tty which is now required now that we …
jonmarinellors Sep 12, 2012
c482c7c
Bumped version t0 0.1.12.
jonmarinellors Sep 14, 2012
50c7271
Added logging, added whitespace for improved readability and added mo…
jonmarinellors Sep 14, 2012
09ea9c5
Added created of a pseudo tty for the tail command.
jonmarinellors Sep 14, 2012
19dbe3f
Commented out methods not used by the virtual monkey, the rest of res…
jonmarinellors Sep 14, 2012
914a005
Removed obsolete and unused code.
jonmarinellors Sep 17, 2012
b23041d
Added probe exit log statement.
jonmarinellors Oct 9, 2012
c83942c
Changed command string handling to use single quoted strings and conc…
jonmarinellors Oct 9, 2012
6d4e441
replacing api 0.1 basic auth to use /login cookie instead
Oct 9, 2012
d074c26
modified code to follow similar patterns in other .connection methods
Oct 10, 2012
629fe46
Removed unwanted functionality in git hooks.
jonmarinellors Nov 7, 2012
63ab6d5
Merge pull request #7 from rightscale/githooks
jonmarinellors Nov 8, 2012
9af197b
DEBUG API href statements are not controlled via the rest_connection …
jonmarinellors Nov 11, 2012
7a36c72
Merge pull request #8 from rightscale/apilogging
EfrainOlivares Nov 12, 2012
66000a7
Added "AWS AP-Sydney" cloud.
EfrainOlivares Nov 13, 2012
d2d2bff
Bumped version to 0.1.13 supporting "AWS AP-Sydney" cloud..
EfrainOlivares Nov 13, 2012
283b48e
Merge pull request #9 from rightscale/awsapsydney
EfrainOlivares Nov 13, 2012
dd744c9
Bump version number to 1.0.0
Nov 13, 2012
da06350
Version 1.0.1 - Cleaned up and added new timeout behavior to wait_for…
jonmarinellors Nov 20, 2012
09974ba
Updated comments and log messages to reflect differences on AWS vs. G…
jonmarinellors Nov 20, 2012
2933eb2
Updated a log message missed in last commit.
jonmarinellors Nov 20, 2012
c060f76
Merge pull request #11 from rightscale/waitfordns
Nov 20, 2012
42979f4
Add rconf and Gemfile, update Rakefile and version
Nov 22, 2012
daf95aa
Improved message logging in wait_for_state() to show actual early ter…
jonmarinellors Nov 27, 2012
f279b33
Revert to version 1.0.1; version should change in master, not feature…
Nov 27, 2012
e78113e
upgrade to the latest versions of ree, rubygems, bundler
Nov 27, 2012
2fe19fc
Bumped catch_early_terminated from 60 to 300 to fix problems with reb…
jonmarinellors Nov 27, 2012
3da29f0
add manual gemspec file
Nov 27, 2012
8975b41
update README with new install/publish instructions
Nov 27, 2012
c25f65b
Bumped catch_early_terminated from 300 to 600 to fix problems with re…
jonmarinellors Nov 28, 2012
1e8afc2
Bumped catch_early_terminated from 600 to 1200 to fix problems with r…
jonmarinellors Nov 28, 2012
66b03f3
Microsoft changed the 422 error message text so adjusted to that, add…
jonmarinellors Nov 28, 2012
707c961
Moved 504 gateway error handling inside azure_hack logic and changed …
jonmarinellors Nov 28, 2012
aa7362e
Azurehack: Added logging server nickname and logging subsequent excep…
jonmarinellors Nov 29, 2012
749b921
Merge pull request #17 from rightscale/waitforstate
Nov 29, 2012
27ef9bf
Removes argument expectation logic
Nov 29, 2012
e0ba53c
Merge pull request #6 from rightscale/red_12_14_nb_63589_fix_sg_add_rule
twrodriguez Dec 3, 2012
4a1a2e6
Added validation logic to sg add_rule method
Dec 4, 2012
b3c3e38
Use symbol instead of string to indicate its importance
Dec 4, 2012
17eb0a5
Changed from static class variable to constant
Dec 4, 2012
f4e9d45
Merge pull request #18 from rightscale/red_12_14_nb_63589_fix_sg_add_…
Dec 5, 2012
dad4f81
Put back the code that detected the OS type and correctly set the $st…
jonmarinellors Dec 13, 2012
4749d8a
Merge pull request #19 from rightscale/githooks
Dec 13, 2012
490b8a5
Merge remote-tracking branch 'origin/add_rconf'
Dec 13, 2012
8e5ea39
bump up version to 1.0.3 to prepare for gem publish
Dec 13, 2012
2bc919f
Merge pull request #6 from rightscale/nonbasicauth
Dec 21, 2012
31b1000
bump up version to 1.0.4 to prepare for gem publish
Dec 21, 2012
1e9afe4
Relax dependencies for activesupport and net-ssh
Dec 21, 2012
6dfe324
Don't store Gemfile.lock for gems
Dec 21, 2012
8a618a4
acu69289 - using 'sudo' instead of 'sudo -i --'
arangamani Dec 28, 2012
de9311b
Merge remote-tracking branch 'origin/rightlink58ssh'
Jan 3, 2013
a05b473
bump up version to 1.0.5 to prepare for gem publish
Jan 3, 2013
9b6bc8e
Merge pull request #20 from rightscale/yellow_12_14_acu70358_relax_de…
Jan 23, 2013
d25c927
acu76268 - fix rest_connection bug preventing chimp from running on g…
Feb 6, 2013
3d9fab1
acu76271 - move run_script_on_instances from api 0.1 to 1.0
Feb 6, 2013
0bb29a7
acu76271 - delete unnecessary file
Feb 11, 2013
336fd46
acu78873 - Add -tt to ssh call so there is no warning about not alloc…
douglaswth Feb 25, 2013
bf787f9
Merge pull request #23 from rightscale/white_13_01_acu78873_fix_ssh_c…
Feb 25, 2013
f95737a
acu78873 - Add -q to ssh call so it doesn't output connection closed …
douglaswth Feb 26, 2013
67ada35
Merge pull request #24 from rightscale/white_13_01_acu78873_fix_ssh_c…
Feb 26, 2013
1ac5208
Merge pull request #22 from rightscale/red_13_2_acu76271_acu76268_chi…
Feb 26, 2013
d9fb57d
acu80153 - remove require line for deleted ec2_server_array_internal.…
Feb 28, 2013
f3c7468
acu80153 - fixup for removed internal array class
Feb 28, 2013
06df205
Merge pull request #25 from rightscale/red_13_2_acu80153_fix_missing_…
Feb 28, 2013
1f4344c
acu83842 - Add support for ignore_lock parameter to McServer and McIn…
douglaswth Mar 14, 2013
7f56dd6
acu83923 rename read me and add mandatory ownership string
Mar 14, 2013
4b8b023
Merge pull request #27 from rightscale/yellow_13_03_acu83923_update_r…
Mar 14, 2013
b14fa87
Merge pull request #26 from rightscale/white_13_02_acu83842_mc_ignore…
Mar 15, 2013
9ad3c4e
acu87542 indent code using markdown syntax - 4 spaces
Apr 6, 2013
9b2235e
acu87542 updated README.md with more info
Apr 6, 2013
ed11af5
acu87542 Shortened a common comment.
Apr 6, 2013
7e9f389
acu87542 Shortened another comment.
Apr 6, 2013
cd0c66c
acu87542 add comment for more API 0.1 classes
Apr 6, 2013
4950e1a
acu87542 add comments for API 1.0 classes
Apr 6, 2013
9e2820a
acu87542 minor tweak to comment
Apr 6, 2013
e4753bc
acu87542 added some info about instance facing API 1.0
Apr 6, 2013
d1e8c30
acu87542 add even more comments to README.md
Apr 6, 2013
cdf32b2
acu87542 add some code comments in utility classes
Apr 6, 2013
418db19
acu87542 fix typo
Apr 8, 2013
4aa73ea
acu87542 fix typo
Apr 11, 2013
2210893
Merge pull request #28 from rightscale/yellow_13_04_acu87542_add_comm…
jonmarinellors Apr 11, 2013
12fde4e
acu89679 bump up version to 1.0.5 to prepare for gem publish
Apr 20, 2013
187fbcd
Merge branch 'master' of github.com:twrodriguez/rest_connection
Apr 22, 2013
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
*.swp
*.swo
pkg/*

## RubyMine
.idea
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source 'http://rubygems.org'

gemspec
10 changes: 10 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Copyright (c) 2012 RightScale, Inc, All Rights Reserved Worldwide.

THIS PROGRAM IS CONFIDENTIAL AND PROPRIETARY TO RIGHTSCALE
AND CONSTITUTES A VALUABLE TRADE SECRET. Any unauthorized use,
reproduction, modification, or disclosure of this program is
strictly prohibited. Any use of this program by an authorized
licensee is strictly subject to the terms and conditions,
including confidentiality obligations, set forth in the applicable
License Agreement between RightScale, Inc. and
the licensee.
140 changes: 140 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
# RightScale REST Connection

The rest_connection gem is a Ruby library for RightScale's API 0.1, 1.0 and 1.5.

Legacy clusters:
- API 0.1 AWS clouds
- API 1.0 AWS clouds
- API 1.5 non-AWS clouds

Unified clusters:
- API 1.0 AWS clouds
- API 1.5 all clouds

This gem also supports RightScale's instance facing API 1.0, which use the instance token to login.
The instance token is found in the instance's user data as 'RS_rn_auth' or alternatively as part of 'RS_api_url'.
The user data is available under the 'Info' tab on the server's page in the RightScale Dashboard.

This gem should be considered deprecated!

If you only use API 1.5, you should use the right_api_client gem instead:
https://rubygems.org/gems/right_api_client

- API 1.0 Documentation: http://support.rightscale.com/12-Guides/03-RightScale_API
- API 1.0 Reference Docs: http://reference.rightscale.com/api1.0
- API 1.5 Documentation: http://support.rightscale.com/12-Guides/RightScale_API_1.5
- API 1.5 Reference Docs: http://reference.rightscale.com/api1.5

Maintained by the RightScale "Yellow_team"

## Installation

Ruby 1.8.7 or higher is required.

### Installing from RubyGems

"gem install rest_connection"

### Installing from source

"git clone [email protected]:rightscale/rest_connection.git"
"cd rest_connection"
"gem install rconf"
"rconf" <- follow any further instructions from rconf
"bundle install"

## Versioning

This gem follows semantic versioning: http://semver.org

## Usage Instructions

You must setup '~/.rest_connection/rest_api_config.yaml' or '/etc/rest_connection/rest_api_config.yaml'

Copy the example from '$GEMHOME/rest_connection/config/rest_api_config.yaml.sample' and fill in your connection info.

Pro Tip: to find a $GEMHOME, use gemedit

"gem install gemedit"
"gem edit rest_connection"

The following examples assume an interactive ruby session (irb):

$ bundle exec irb
ruby> require 'rubygems'; require 'rest_connection'

### Look up and run a RightScript

first_fe = Server.find(:first) { |s| s.nickname =~ /Front End/ }
st = ServerTemplate.find(first_fe.server_template_href)
connect_script = st.executables.detect { |ex| ex.name =~ /LB [app|mongrels]+ to HA proxy connect/i }
state = first_fe.run_executable(connect_script)
state.wait_for_completed

### Stop a Deployment

deployment = Deployment.find(opts[:id])
my_servers = deployment.servers
my_servers.each { |s| s.stop }
my_servers.each { |s| s.wait_for_state("stopped") }

### Activate an Ec2ServerArray / Display instances IPs

my_array = Ec2ServerArray.find(opts[:href])
my_array.active = true
my_array.save

puts my_array.instances.map { |i| i['ip-address'] }

## Design Decisions

Currently, all API resources are represented by classes in 'lib/rest_connection/rightscale'.
Various helper modules are also located in this directory.

### API 0.1 resources

API 0.1 resources are often named with suffix '_internal'.

They often pull in common internal code:

include RightScale::Api::Internal
extend RightScale::Api::InternalExtend

### API 1.0 resources

API 1.0 resources are often named with prefix 'ec2_' for Amazon Elastic Compute Cloud.

They often pull in common internal code:

include RightScale::Api::Base
extend RightScale::Api::BaseExtend

### API 1.5 resources

API 1.5 resources are often named with prefix 'mc_' for MultiCloud.
They often talk to the MultiCloud gateway and therefore pull in some common gateway code:

include RightScale::Api::Gateway
extend RightScale::Api::GatewayExtend

## Troubleshooting

### Wrong ruby version

Ruby 1.8.7 or higher is required.

## Publishing

To cut a new gem and push to RubyGems:

Edit lib/rest_connection/version.rb with semantic version number.

"bundle exec gem build rest_connection.gemspec"
"ls *.gem" <- verify that gem was built
"cd /tmp"
"bundle exec gem install /path/to/local/rest_connection-X.Y.Z.gem" <- replace X.Y.Z with your new version number
"bundle exec gem uninstall rest_connection"
"cd -"
"bundle exec gem push rest_connection-X.Y.Z.gem"

Check it out: https://rubygems.org/gems/rest_connection
49 changes: 0 additions & 49 deletions README.rdoc

This file was deleted.

28 changes: 15 additions & 13 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
require 'rubygems'
require 'jeweler'
Jeweler::Tasks.new do |gemspec|
gemspec.name = "rest_connection"
gemspec.summary = "lib for restful connections to the rightscale api"
gemspec.description = "provides rest_connection"
gemspec.email = "[email protected]"
gemspec.homepage = "http://github.com/jeremyd/rest_connection"
gemspec.authors = ["Jeremy Deininger"]
gemspec.add_dependency('activesupport', "=2.3.10")
gemspec.add_dependency('net-ssh')
gemspec.add_dependency('json')
require File.expand_path('../lib/rest_connection', __FILE__)
require 'rake'
require 'spec/rake/spectask'

task :build do
system "gem build rest_connection.gemspec"
end

task :release => :build do
system "gem push rest_connection-#{RestConnection::VERSION}.gem"
end
Jeweler::GemcutterTasks.new

Spec::Rake::SpecTask.new('spec') do |t|
t.spec_files = Dir.glob('spec/*_spec.rb')
t.spec_opts << '--format nested'
t.spec_opts << '--colour'
end
1 change: 0 additions & 1 deletion VERSION

This file was deleted.

10 changes: 7 additions & 3 deletions config/rest_api_config.yaml.sample
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
---
:ssh_keys:
---
:ssh_keys:
- ~/.ssh/my_server_key
- ~/.ssh/my_server_key-eu
- ~/.ssh/my_server_key-west
:pass: myUltraSecurePasswordz
:user: [email protected]
:api_url: https://my.rightscale.com/api/acct/00000000
:common_headers:
:common_headers:
X_API_VERSION: "1.0"
:azure_hack_on: true
:azure_hack_retry_count: 5
:azure_hack_sleep_seconds: 60
:api_logging: false
23 changes: 23 additions & 0 deletions examples/console.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
#--
# Copyright (c) 2010-2012 RightScale Inc
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#++

require 'rubygems'
require 'rest_connection'
require 'ruby-debug'
Expand Down
23 changes: 23 additions & 0 deletions examples/cucumber/step_definitions/deployment_steps.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
#--
# Copyright (c) 2010-2012 RightScale Inc
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#++

require "rubygems"
require "rest_connection"
require "net/ssh"
Expand Down
23 changes: 23 additions & 0 deletions examples/cucumber/step_definitions/mysql_steps.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
#--
# Copyright (c) 2010-2012 RightScale Inc
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#++

require 'rubygems'
require 'sqlite3'

Expand Down
23 changes: 23 additions & 0 deletions examples/cucumber/step_definitions/recipe_steps.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
#--
# Copyright (c) 2010-2012 RightScale Inc
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#++

When /^I run a recipe named "([^\"]*)" on server "([^\"]*)"\.$/ do |recipe, server_index|
human_index = server_index.to_i - 1
STDOUT.puts "#{recipe} -> root@#{@servers[human_index].dns_name}"
Expand Down
Loading