summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitch Garnaat <mitch@cloudright.com>2010-09-16 01:22:36 -0400
committerMitch Garnaat <mitch@cloudright.com>2010-09-16 01:22:36 -0400
commit120ba0b659f8d579c7cccd34d61d1345051756ce (patch)
tree2832b4d28e7490c669b7e9c7c97796b74bd6c6bd
parent526c7026d4537c54b0c5504f4bcfff8a41541591 (diff)
downloadboto-120ba0b659f8d579c7cccd34d61d1345051756ce.tar.gz
Added a connect_euca and connect_walrus function.
-rw-r--r--boto/__init__.py52
1 files changed, 52 insertions, 0 deletions
diff --git a/boto/__init__.py b/boto/__init__.py
index a348be80..cfaaa117 100644
--- a/boto/__init__.py
+++ b/boto/__init__.py
@@ -301,6 +301,58 @@ def connect_iam(aws_access_key_id=None, aws_secret_access_key=None, **kwargs):
from boto.iam import IAMConnection
return IAMConnection(aws_access_key_id, aws_secret_access_key, **kwargs)
+def connect_euca(host, aws_access_key_id=None, aws_secret_access_key=None,
+ port=8773, path='/services/Eucalyptus', is_secure=False,
+ **kwargs):
+ """
+ Connect to a Eucalyptus service.
+
+ :type host: string
+ :param host: the host name or ip address of the Eucalyptus server
+
+ :type aws_access_key_id: string
+ :param aws_access_key_id: Your AWS Access Key ID
+
+ :type aws_secret_access_key: string
+ :param aws_secret_access_key: Your AWS Secret Access Key
+
+ :rtype: :class:`boto.sns.IAMConnection`
+ :return: A connection to Amazon's IAM
+ """
+ from boto.ec2 import EC2Connection
+ from boto.ec2.regioninfo import RegionInfo
+
+ reg = RegionInfo(name='eucalyptus', endpoint=host)
+ return EC2Connection(aws_access_key_id, aws_secret_access_key,
+ region=reg, port=port, path=path,
+ is_secure=is_secure, **kwargs)
+
+def connect_walrus(host, aws_access_key_id=None, aws_secret_access_key=None,
+ port=8773, path='/services/Walrus', is_secure=False,
+ **kwargs):
+ """
+ Connect to a Walrus service.
+
+ :type host: string
+ :param host: the host name or ip address of the Walrus server
+
+ :type aws_access_key_id: string
+ :param aws_access_key_id: Your AWS Access Key ID
+
+ :type aws_secret_access_key: string
+ :param aws_secret_access_key: Your AWS Secret Access Key
+
+ :rtype: :class:`boto.sns.IAMConnection`
+ :return: A connection to Amazon's IAM
+ """
+ from boto.s3.connection import S3Connection
+ from boto.s3.connection import OrdinaryCallingFormat
+
+ return S3Connection(aws_access_key_id, aws_secret_access_key,
+ host=host, port=port, path=path,
+ calling_format=OrdinaryCallingFormat(),
+ is_secure=is_secure, **kwargs)
+
def check_extensions(module_name, module_path):
"""
This function checks for extensions to boto modules. It should be called in the