Skip to content
This repository has been archived by the owner on Jun 27, 2018. It is now read-only.

Commit

Permalink
fix GCE merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
shahms committed Feb 5, 2013
2 parents 83ec240 + 4a45ab0 commit 3be6c5c
Show file tree
Hide file tree
Showing 188 changed files with 14,976 additions and 2,793 deletions.
18 changes: 18 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
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, dis-
tribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the fol-
lowing 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 MERCHANTABIL-
ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
SHALL THE AUTHOR 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.
30 changes: 16 additions & 14 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
####
boto
####
boto 2.6.0
19-Sep-2012
boto 2.8.0
31-Jan-2013

.. image:: https://secure.travis-ci.org/boto/boto.png?branch=develop
:target: https://secure.travis-ci.org/boto/boto
Expand All @@ -19,8 +19,11 @@ At the moment, boto supports:
* Amazon Elastic Compute Cloud (EC2)
* Amazon Elastic Map Reduce (EMR)
* AutoScaling
<<<<<<< HEAD
* Elastic Load Balancing (ELB)
* Google Compute Engine (GCE)
=======
>>>>>>> upstream/develop

* Content Delivery

Expand All @@ -31,13 +34,17 @@ At the moment, boto supports:
* Amazon Relational Data Service (RDS)
* Amazon DynamoDB
* Amazon SimpleDB
* Amazon ElastiCache

* Deployment and Management

* AWS Identity and Access Management (IAM)
* Amazon CloudWatch
* AWS Elastic Beanstalk
* AWS CloudFormation
* AWS Data Pipeline

* Identity & Access

* AWS Identity and Access Management (IAM)

* Application Services

Expand All @@ -47,10 +54,15 @@ At the moment, boto supports:
* Amazon Simple Notification Server (SNS)
* Amazon Simple Email Service (SES)

* Montoring

* Amazon CloudWatch

* Networking

* Amazon Route53
* Amazon Virtual Private Cloud (VPC)
* Elastic Load Balancing (ELB)

* Payments and Billing

Expand Down Expand Up @@ -107,16 +119,6 @@ ChangeLogs
To see what has changed over time in boto, you can check out the
`release notes`_ in the wiki.

*********************************
Special Note for Python 3.x Users
*********************************

If you are interested in trying out boto with Python 3.x, check out the
`neo`_ branch. This is under active development and the goal is a version
of boto that works in Python 2.6, 2.7, and 3.x. Not everything is working
just yet but many things are and it's worth a look if you are an active
Python 3.x user.

***************************
Finding Out More About Boto
***************************
Expand Down
26 changes: 22 additions & 4 deletions bin/elbadmin
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,30 @@ def get(elb, name):

print

# Make map of all instance Id's to Name tags
ec2 = boto.connect_ec2()

instance_health = b.get_instance_health()
instances = [state.instance_id for state in instance_health]

names = {}
for r in ec2.get_all_instances(instances):
for i in r.instances:
names[i.id] = i.tags.get('Name', '')

name_column_width = max([4] + [len(v) for k,v in names.iteritems()]) + 2

print "Instances"
print "---------"
print "%-12s %-15s %s" % ("ID", "STATE", "DESCRIPTION")
for state in b.get_instance_health():
print "%-12s %-15s %s" % (state.instance_id, state.state,
state.description)
print "%-12s %-15s %-*s %s" % ("ID",
"STATE",
name_column_width, "NAME",
"DESCRIPTION")
for state in instance_health:
print "%-12s %-15s %-*s %s" % (state.instance_id,
state.state,
name_column_width, names[state.instance_id],
state.description)

print

Expand Down
34 changes: 20 additions & 14 deletions bin/fetch_file
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,29 @@
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-
# ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
# SHALL THE AUTHOR 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.
#
if __name__ == "__main__":
from optparse import OptionParser
parser = OptionParser(version="0.1", usage="Usage: %prog [options] url")
parser.add_option("-o", "--out-file", help="Output file", dest="outfile")
from optparse import OptionParser
usage = """%prog [options] URI
Fetch a URI using the boto library and (by default) pipe contents to STDOUT
The URI can be either an HTTP URL, or "s3://bucket_name/key_name"
"""
parser = OptionParser(version="0.1", usage=usage)
parser.add_option("-o", "--out-file",
help="File to receive output instead of STDOUT",
dest="outfile")

(options, args) = parser.parse_args()
if len(args) < 1:
parser.print_help()
exit(1)
from boto.utils import fetch_file
f = fetch_file(args[0])
if options.outfile:
open(options.outfile, "w").write(f.read())
else:
print f.read()
(options, args) = parser.parse_args()
if len(args) < 1:
parser.print_help()
exit(1)
from boto.utils import fetch_file
f = fetch_file(args[0])
if options.outfile:
open(options.outfile, "w").write(f.read())
else:
print f.read()
30 changes: 15 additions & 15 deletions bin/glacier
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@ glacier <command> [args]
created
Common args:
access_key - Your AWS Access Key ID. If not supplied, boto will
use the value of the environment variable
AWS_ACCESS_KEY_ID
secret_key - Your AWS Secret Access Key. If not supplied, boto
will use the value of the environment variable
AWS_SECRET_ACCESS_KEY
region - AWS region to use. Possible vaules: us-east-1, us-west-1,
us-west-2, ap-northeast-1, eu-west-1.
Default: us-east-1
--access_key - Your AWS Access Key ID. If not supplied, boto will
use the value of the environment variable
AWS_ACCESS_KEY_ID
--secret_key - Your AWS Secret Access Key. If not supplied, boto
will use the value of the environment variable
AWS_SECRET_ACCESS_KEY
--region - AWS region to use. Possible values: us-east-1, us-west-1,
us-west-2, ap-northeast-1, eu-west-1.
Default: us-east-1
Vaults operations:
Expand Down Expand Up @@ -91,18 +91,18 @@ def connect(region, debug_level=0, access_key=None, secret_key=None):


def list_vaults(region, access_key=None, secret_key=None):
layer2 = connect(region, access_key, secret_key)
layer2 = connect(region, access_key = access_key, secret_key = secret_key)
for vault in layer2.list_vaults():
print vault.arn


def list_jobs(vault_name, region, access_key=None, secret_key=None):
layer2 = connect(region, access_key, secret_key)
layer2 = connect(region, access_key = access_key, secret_key = secret_key)
print layer2.layer1.list_jobs(vault_name)


def upload_files(vault_name, filenames, region, access_key=None, secret_key=None):
layer2 = connect(region, access_key, secret_key)
layer2 = connect(region, access_key = access_key, secret_key = secret_key)
layer2.create_vault(vault_name)
glacier_vault = layer2.get_vault(vault_name)
for filename in filenames:
Expand Down Expand Up @@ -131,11 +131,11 @@ def main():
access_key = secret_key = None
region = 'us-east-1'
for option, value in opts:
if option in ('a', '--access_key'):
if option in ('-a', '--access_key'):
access_key = value
elif option in ('s', '--secret_key'):
elif option in ('-s', '--secret_key'):
secret_key = value
elif option in ('r', '--region'):
elif option in ('-r', '--region'):
region = value
# handle each command
if command == 'vaults':
Expand Down
10 changes: 9 additions & 1 deletion bin/list_instances
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ def main():
parser.add_option("-r", "--region", help="Region (default us-east-1)", dest="region", default="us-east-1")
parser.add_option("-H", "--headers", help="Set headers (use 'T:tagname' for including tags)", default=None, action="store", dest="headers", metavar="ID,Zone,Groups,Hostname,State,T:Name")
parser.add_option("-t", "--tab", help="Tab delimited, skip header - useful in shell scripts", action="store_true", default=False)
parser.add_option("-f", "--filter", help="Filter option sent to DescribeInstances API call, format is key1=value1,key2=value2,...", default=None)
(options, args) = parser.parse_args()


# Connect the region
for r in regions():
if r.name == options.region:
Expand All @@ -62,13 +64,19 @@ def main():
format_string += "%%-%ds" % HEADERS[h]['length']


# Parse filters (if any)
if options.filter:
filters = dict([entry.split('=') for entry in options.filter.split(',')])
else:
filters = {}

# List and print

if not options.tab:
print format_string % headers
print "-" * len(format_string % headers)

for r in ec2.get_all_instances():
for r in ec2.get_all_instances(filters=filters):
groups = [g.name for g in r.groups]
for i in r.instances:
i.groups = ','.join(groups)
Expand Down
Loading

0 comments on commit 3be6c5c

Please sign in to comment.