Permalink
Browse files

Added a connect_euca and connect_walrus function.

  • Loading branch information...
1 parent 526c702 commit 120ba0b659f8d579c7cccd34d61d1345051756ce Mitch Garnaat committed Sep 16, 2010
Showing with 52 additions and 0 deletions.
  1. +52 −0 boto/__init__.py
View
@@ -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

0 comments on commit 120ba0b

Please sign in to comment.