desc stringlengths 3 26.7k | decl stringlengths 11 7.89k | bodies stringlengths 8 553k |
|---|---|---|
'Get all EBS Snapshots associated with the current credentials.
:type snapshot_ids: list
:param snapshot_ids: Optional list of snapshot ids. If this list is
present, only the Snapshots associated with
these snapshot ids will be returned.
:type owner: str or list
:param owner: If present, only the snapshots owned by th... | def get_all_snapshots(self, snapshot_ids=None, owner=None, restorable_by=None, filters=None, dry_run=False):
| params = {}
if snapshot_ids:
self.build_list_params(params, snapshot_ids, 'SnapshotId')
if owner:
self.build_list_params(params, owner, 'Owner')
if restorable_by:
self.build_list_params(params, restorable_by, 'RestorableBy')
if filters:
self.build_filter_params(params... |
'Create a snapshot of an existing EBS Volume.
:type volume_id: str
:param volume_id: The ID of the volume to be snapshot\'ed
:type description: str
:param description: A description of the snapshot.
Limited to 255 characters.
:type dry_run: bool
:param dry_run: Set to True if the operation should not actually run.
:rty... | def create_snapshot(self, volume_id, description=None, dry_run=False):
| params = {'VolumeId': volume_id}
if description:
params['Description'] = description[0:255]
if dry_run:
params['DryRun'] = 'true'
snapshot = self.get_object('CreateSnapshot', params, Snapshot, verb='POST')
volume = self.get_all_volumes([volume_id], dry_run=dry_run)[0]
volume_name... |
':type dry_run: bool
:param dry_run: Set to True if the operation should not actually run.'
| def delete_snapshot(self, snapshot_id, dry_run=False):
| params = {'SnapshotId': snapshot_id}
if dry_run:
params['DryRun'] = 'true'
return self.get_status('DeleteSnapshot', params, verb='POST')
|
'Copies a point-in-time snapshot of an Amazon Elastic Block Store
(Amazon EBS) volume and stores it in Amazon Simple Storage Service
(Amazon S3). You can copy the snapshot within the same region or from
one region to another. You can use the snapshot to create new Amazon
EBS volumes or Amazon Machine Images (AMIs).
:ty... | def copy_snapshot(self, source_region, source_snapshot_id, description=None, dry_run=False):
| params = {'SourceRegion': source_region, 'SourceSnapshotId': source_snapshot_id}
if (description is not None):
params['Description'] = description
if dry_run:
params['DryRun'] = 'true'
snapshot = self.get_object('CopySnapshot', params, Snapshot, verb='POST')
return snapshot.id
|
'Trim excess snapshots, based on when they were taken. More current
snapshots are retained, with the number retained decreasing as you
move back in time.
If ebs volumes have a \'Name\' tag with a value, their snapshots
will be assigned the same tag when they are created. The values
of the \'Name\' tags for snapshots ar... | def trim_snapshots(self, hourly_backups=8, daily_backups=7, weekly_backups=4, monthly_backups=True):
| now = datetime.utcnow()
last_hour = datetime(now.year, now.month, now.day, now.hour)
last_midnight = datetime(now.year, now.month, now.day)
last_sunday = (datetime(now.year, now.month, now.day) - timedelta(days=((now.weekday() + 1) % 7)))
start_of_month = datetime(now.year, now.month, 1)
target_... |
'Get information about an attribute of a snapshot. Only one attribute
can be specified per call.
:type snapshot_id: str
:param snapshot_id: The ID of the snapshot.
:type attribute: str
:param attribute: The requested attribute. Valid values are:
* createVolumePermission
:type dry_run: bool
:param dry_run: Set to True... | def get_snapshot_attribute(self, snapshot_id, attribute='createVolumePermission', dry_run=False):
| params = {'Attribute': attribute}
if snapshot_id:
params['SnapshotId'] = snapshot_id
if dry_run:
params['DryRun'] = 'true'
return self.get_object('DescribeSnapshotAttribute', params, SnapshotAttribute, verb='POST')
|
'Changes an attribute of an image.
:type snapshot_id: string
:param snapshot_id: The snapshot id you wish to change
:type attribute: string
:param attribute: The attribute you wish to change. Valid values are:
createVolumePermission
:type operation: string
:param operation: Either add or remove (this is required for c... | def modify_snapshot_attribute(self, snapshot_id, attribute='createVolumePermission', operation='add', user_ids=None, groups=None, dry_run=False):
| params = {'SnapshotId': snapshot_id, 'Attribute': attribute, 'OperationType': operation}
if user_ids:
self.build_list_params(params, user_ids, 'UserId')
if groups:
self.build_list_params(params, groups, 'UserGroup')
if dry_run:
params['DryRun'] = 'true'
return self.get_status... |
'Resets an attribute of a snapshot to its default value.
:type snapshot_id: string
:param snapshot_id: ID of the snapshot
:type attribute: string
:param attribute: The attribute to reset
:type dry_run: bool
:param dry_run: Set to True if the operation should not actually run.
:rtype: bool
:return: Whether the operation... | def reset_snapshot_attribute(self, snapshot_id, attribute='createVolumePermission', dry_run=False):
| params = {'SnapshotId': snapshot_id, 'Attribute': attribute}
if dry_run:
params['DryRun'] = 'true'
return self.get_status('ResetSnapshotAttribute', params, verb='POST')
|
'Get all key pairs associated with your account.
:type keynames: list
:param keynames: A list of the names of keypairs to retrieve.
If not provided, all key pairs will be returned.
:type filters: dict
:param filters: Optional filters that can be used to limit the
results returned. Filters are provided in the form of a... | def get_all_key_pairs(self, keynames=None, filters=None, dry_run=False):
| params = {}
if keynames:
self.build_list_params(params, keynames, 'KeyName')
if filters:
self.build_filter_params(params, filters)
if dry_run:
params['DryRun'] = 'true'
return self.get_list('DescribeKeyPairs', params, [('item', KeyPair)], verb='POST')
|
'Convenience method to retrieve a specific keypair (KeyPair).
:type keyname: string
:param keyname: The name of the keypair to retrieve
:type dry_run: bool
:param dry_run: Set to True if the operation should not actually run.
:rtype: :class:`boto.ec2.keypair.KeyPair`
:return: The KeyPair specified or None if it is not ... | def get_key_pair(self, keyname, dry_run=False):
| try:
return self.get_all_key_pairs(keynames=[keyname], dry_run=dry_run)[0]
except self.ResponseError as e:
if (e.code == 'InvalidKeyPair.NotFound'):
return None
else:
raise
|
'Create a new key pair for your account.
This will create the key pair within the region you
are currently connected to.
:type key_name: string
:param key_name: The name of the new keypair
:type dry_run: bool
:param dry_run: Set to True if the operation should not actually run.
:rtype: :class:`boto.ec2.keypair.KeyPair`... | def create_key_pair(self, key_name, dry_run=False):
| params = {'KeyName': key_name}
if dry_run:
params['DryRun'] = 'true'
return self.get_object('CreateKeyPair', params, KeyPair, verb='POST')
|
'Delete a key pair from your account.
:type key_name: string
:param key_name: The name of the keypair to delete
:type dry_run: bool
:param dry_run: Set to True if the operation should not actually run.'
| def delete_key_pair(self, key_name, dry_run=False):
| params = {'KeyName': key_name}
if dry_run:
params['DryRun'] = 'true'
return self.get_status('DeleteKeyPair', params, verb='POST')
|
'imports the public key from an RSA key pair that you created
with a third-party tool.
Supported formats:
* OpenSSH public key format (e.g., the format
in ~/.ssh/authorized_keys)
* Base64 encoded DER format
* SSH public key file format as specified in RFC4716
DSA keys are not supported. Make sure your key generator is
... | def import_key_pair(self, key_name, public_key_material, dry_run=False):
| public_key_material = base64.b64encode(public_key_material)
params = {'KeyName': key_name, 'PublicKeyMaterial': public_key_material}
if dry_run:
params['DryRun'] = 'true'
return self.get_object('ImportKeyPair', params, KeyPair, verb='POST')
|
'Get all security groups associated with your account in a region.
:type groupnames: list
:param groupnames: A list of the names of security groups to retrieve.
If not provided, all security groups will be
returned.
:type group_ids: list
:param group_ids: A list of IDs of security groups to retrieve for
security groups... | def get_all_security_groups(self, groupnames=None, group_ids=None, filters=None, dry_run=False):
| params = {}
if (groupnames is not None):
self.build_list_params(params, groupnames, 'GroupName')
if (group_ids is not None):
self.build_list_params(params, group_ids, 'GroupId')
if (filters is not None):
self.build_filter_params(params, filters)
if dry_run:
params['Dr... |
'Create a new security group for your account.
This will create the security group within the region you
are currently connected to.
:type name: string
:param name: The name of the new security group
:type description: string
:param description: The description of the new security group
:type vpc_id: string
:param vpc_... | def create_security_group(self, name, description, vpc_id=None, dry_run=False):
| params = {'GroupName': name, 'GroupDescription': description}
if (vpc_id is not None):
params['VpcId'] = vpc_id
if dry_run:
params['DryRun'] = 'true'
group = self.get_object('CreateSecurityGroup', params, SecurityGroup, verb='POST')
group.name = name
group.description = descripti... |
'Delete a security group from your account.
:type name: string
:param name: The name of the security group to delete.
:type group_id: string
:param group_id: The ID of the security group to delete within
a VPC.
:type dry_run: bool
:param dry_run: Set to True if the operation should not actually run.
:rtype: bool
:retur... | def delete_security_group(self, name=None, group_id=None, dry_run=False):
| params = {}
if (name is not None):
params['GroupName'] = name
elif (group_id is not None):
params['GroupId'] = group_id
if dry_run:
params['DryRun'] = 'true'
return self.get_status('DeleteSecurityGroup', params, verb='POST')
|
'NOTE: This method uses the old-style request parameters
that did not allow a port to be specified when
authorizing a group.
:type group_name: string
:param group_name: The name of the security group you are adding
the rule to.
:type src_security_group_name: string
:param src_security_group_name: The name of the securi... | def authorize_security_group_deprecated(self, group_name, src_security_group_name=None, src_security_group_owner_id=None, ip_protocol=None, from_port=None, to_port=None, cidr_ip=None, dry_run=False):
| params = {'GroupName': group_name}
if src_security_group_name:
params['SourceSecurityGroupName'] = src_security_group_name
if src_security_group_owner_id:
params['SourceSecurityGroupOwnerId'] = src_security_group_owner_id
if ip_protocol:
params['IpProtocol'] = ip_protocol
if ... |
'Add a new rule to an existing security group.
You need to pass in either src_security_group_name and
src_security_group_owner_id OR ip_protocol, from_port, to_port,
and cidr_ip. In other words, either you are authorizing another
group or you are authorizing some ip-based rule.
:type group_name: string
:param group_na... | def authorize_security_group(self, group_name=None, src_security_group_name=None, src_security_group_owner_id=None, ip_protocol=None, from_port=None, to_port=None, cidr_ip=None, group_id=None, src_security_group_group_id=None, dry_run=False):
| if src_security_group_name:
if ((from_port is None) and (to_port is None) and (ip_protocol is None)):
return self.authorize_security_group_deprecated(group_name, src_security_group_name, src_security_group_owner_id)
params = {}
if group_name:
params['GroupName'] = group_name
... |
'The action adds one or more egress rules to a VPC security
group. Specifically, this action permits instances in a
security group to send traffic to one or more destination
CIDR IP address ranges, or to one or more destination
security groups in the same VPC.
:type dry_run: bool
:param dry_run: Set to True if the oper... | def authorize_security_group_egress(self, group_id, ip_protocol, from_port=None, to_port=None, src_group_id=None, cidr_ip=None, dry_run=False):
| params = {'GroupId': group_id, 'IpPermissions.1.IpProtocol': ip_protocol}
if (from_port is not None):
params['IpPermissions.1.FromPort'] = from_port
if (to_port is not None):
params['IpPermissions.1.ToPort'] = to_port
if (src_group_id is not None):
params['IpPermissions.1.Groups.... |
'NOTE: This method uses the old-style request parameters
that did not allow a port to be specified when
authorizing a group.
Remove an existing rule from an existing security group.
You need to pass in either src_security_group_name and
src_security_group_owner_id OR ip_protocol, from_port, to_port,
and cidr_ip. In ot... | def revoke_security_group_deprecated(self, group_name, src_security_group_name=None, src_security_group_owner_id=None, ip_protocol=None, from_port=None, to_port=None, cidr_ip=None, dry_run=False):
| params = {'GroupName': group_name}
if src_security_group_name:
params['SourceSecurityGroupName'] = src_security_group_name
if src_security_group_owner_id:
params['SourceSecurityGroupOwnerId'] = src_security_group_owner_id
if ip_protocol:
params['IpProtocol'] = ip_protocol
if ... |
'Remove an existing rule from an existing security group.
You need to pass in either src_security_group_name and
src_security_group_owner_id OR ip_protocol, from_port, to_port,
and cidr_ip. In other words, either you are revoking another
group or you are revoking some ip-based rule.
:type group_name: string
:param gro... | def revoke_security_group(self, group_name=None, src_security_group_name=None, src_security_group_owner_id=None, ip_protocol=None, from_port=None, to_port=None, cidr_ip=None, group_id=None, src_security_group_group_id=None, dry_run=False):
| if src_security_group_name:
if ((from_port is None) and (to_port is None) and (ip_protocol is None)):
return self.revoke_security_group_deprecated(group_name, src_security_group_name, src_security_group_owner_id)
params = {}
if (group_name is not None):
params['GroupName'] = grou... |
'Remove an existing egress rule from an existing VPC security
group. You need to pass in an ip_protocol, from_port and
to_port range only if the protocol you are using is
port-based. You also need to pass in either a src_group_id or
cidr_ip.
:type group_name: string
:param group_id: The name of the security group you... | def revoke_security_group_egress(self, group_id, ip_protocol, from_port=None, to_port=None, src_group_id=None, cidr_ip=None, dry_run=False):
| params = {}
if group_id:
params['GroupId'] = group_id
if ip_protocol:
params['IpPermissions.1.IpProtocol'] = ip_protocol
if (from_port is not None):
params['IpPermissions.1.FromPort'] = from_port
if (to_port is not None):
params['IpPermissions.1.ToPort'] = to_port
... |
'Get all available regions for the EC2 service.
:type region_names: list of str
:param region_names: Names of regions to limit output
:type filters: dict
:param filters: Optional filters that can be used to limit
the results returned. Filters are provided
in the form of a dictionary consisting of
filter names as the k... | def get_all_regions(self, region_names=None, filters=None, dry_run=False):
| params = {}
if region_names:
self.build_list_params(params, region_names, 'RegionName')
if filters:
self.build_filter_params(params, filters)
if dry_run:
params['DryRun'] = 'true'
regions = self.get_list('DescribeRegions', params, [('item', RegionInfo)], verb='POST')
for ... |
'Describes Reserved Instance offerings that are available for purchase.
:type reserved_instances_offering_ids: list
:param reserved_instances_id: One or more Reserved Instances
offering IDs.
:type instance_type: str
:param instance_type: Displays Reserved Instances of the specified
instance type.
:type availability_zon... | def get_all_reserved_instances_offerings(self, reserved_instances_offering_ids=None, instance_type=None, availability_zone=None, product_description=None, filters=None, instance_tenancy=None, offering_type=None, include_marketplace=None, min_duration=None, max_duration=None, max_instance_count=None, next_token=None, ma... | params = {}
if (reserved_instances_offering_ids is not None):
self.build_list_params(params, reserved_instances_offering_ids, 'ReservedInstancesOfferingId')
if instance_type:
params['InstanceType'] = instance_type
if availability_zone:
params['AvailabilityZone'] = availability_zo... |
'Describes one or more of the Reserved Instances that you purchased.
:type reserved_instance_ids: list
:param reserved_instance_ids: A list of the reserved instance ids that
will be returned. If not provided, all reserved instances
will be returned.
:type filters: dict
:param filters: Optional filters that can be used ... | def get_all_reserved_instances(self, reserved_instances_id=None, filters=None, dry_run=False):
| params = {}
if reserved_instances_id:
self.build_list_params(params, reserved_instances_id, 'ReservedInstancesId')
if filters:
self.build_filter_params(params, filters)
if dry_run:
params['DryRun'] = 'true'
return self.get_list('DescribeReservedInstances', params, [('item', R... |
'Purchase a Reserved Instance for use with your account.
** CAUTION **
This request can result in large amounts of money being charged to your
AWS account. Use with caution!
:type reserved_instances_offering_id: string
:param reserved_instances_offering_id: The offering ID of the Reserved
Instance to purchase
:type in... | def purchase_reserved_instance_offering(self, reserved_instances_offering_id, instance_count=1, limit_price=None, dry_run=False):
| params = {'ReservedInstancesOfferingId': reserved_instances_offering_id, 'InstanceCount': instance_count}
if (limit_price is not None):
params['LimitPrice.Amount'] = str(limit_price[0])
params['LimitPrice.CurrencyCode'] = str(limit_price[1])
if dry_run:
params['DryRun'] = 'true'
... |
'Creates a new listing for Reserved Instances.
Creates a new listing for Amazon EC2 Reserved Instances that will be
sold in the Reserved Instance Marketplace. You can submit one Reserved
Instance listing at a time.
The Reserved Instance Marketplace matches sellers who want to resell
Reserved Instance capacity that they... | def create_reserved_instances_listing(self, reserved_instances_id, instance_count, price_schedules, client_token, dry_run=False):
| params = {'ReservedInstancesId': reserved_instances_id, 'InstanceCount': str(instance_count), 'ClientToken': client_token}
for (i, schedule) in enumerate(price_schedules):
(price, term) = schedule
params[('PriceSchedules.%s.Price' % i)] = str(price)
params[('PriceSchedules.%s.Term' % i)]... |
'Cancels the specified Reserved Instance listing.
:type reserved_instances_listing_ids: List of strings
:param reserved_instances_listing_ids: The ID of the
Reserved Instance listing to be cancelled.
:type dry_run: bool
:param dry_run: Set to True if the operation should not actually run.
:rtype: list
:return: A list o... | def cancel_reserved_instances_listing(self, reserved_instances_listing_ids=None, dry_run=False):
| params = {}
if (reserved_instances_listing_ids is not None):
self.build_list_params(params, reserved_instances_listing_ids, 'ReservedInstancesListingId')
if dry_run:
params['DryRun'] = 'true'
return self.get_list('CancelReservedInstancesListing', params, [('item', ReservedInstanceListing... |
'Modifies the specified Reserved Instances.
:type client_token: string
:param client_token: A unique, case-sensitive, token you provide to
ensure idempotency of your modification request.
:type reserved_instance_ids: List of strings
:param reserved_instance_ids: The IDs of the Reserved Instances to
modify.
:type target... | def modify_reserved_instances(self, client_token, reserved_instance_ids, target_configurations):
| params = {}
if (client_token is not None):
params['ClientToken'] = client_token
if (reserved_instance_ids is not None):
self.build_list_params(params, reserved_instance_ids, 'ReservedInstancesId')
if (target_configurations is not None):
self.build_configurations_param_list(params... |
'A request to describe the modifications made to Reserved Instances in
your account.
:type reserved_instances_modification_ids: list
:param reserved_instances_modification_ids: An optional list of
Reserved Instances modification IDs to describe.
:type next_token: str
:param next_token: A string specifying the next pagi... | def describe_reserved_instances_modifications(self, reserved_instances_modification_ids=None, next_token=None, filters=None):
| params = {}
if reserved_instances_modification_ids:
self.build_list_params(params, reserved_instances_modification_ids, 'ReservedInstancesModificationId')
if next_token:
params['NextToken'] = next_token
if filters:
self.build_filter_params(params, filters)
return self.get_lis... |
'Enable detailed CloudWatch monitoring for the supplied instances.
:type instance_id: list of strings
:param instance_id: The instance ids
:type dry_run: bool
:param dry_run: Set to True if the operation should not actually run.
:rtype: list
:return: A list of :class:`boto.ec2.instanceinfo.InstanceInfo`'
| def monitor_instances(self, instance_ids, dry_run=False):
| params = {}
self.build_list_params(params, instance_ids, 'InstanceId')
if dry_run:
params['DryRun'] = 'true'
return self.get_list('MonitorInstances', params, [('item', InstanceInfo)], verb='POST')
|
'Deprecated Version, maintained for backward compatibility.
Enable detailed CloudWatch monitoring for the supplied instance.
:type instance_id: string
:param instance_id: The instance id
:type dry_run: bool
:param dry_run: Set to True if the operation should not actually run.
:rtype: list
:return: A list of :class:`bot... | def monitor_instance(self, instance_id, dry_run=False):
| return self.monitor_instances([instance_id], dry_run=dry_run)
|
'Disable CloudWatch monitoring for the supplied instance.
:type instance_id: list of string
:param instance_id: The instance id
:type dry_run: bool
:param dry_run: Set to True if the operation should not actually run.
:rtype: list
:return: A list of :class:`boto.ec2.instanceinfo.InstanceInfo`'
| def unmonitor_instances(self, instance_ids, dry_run=False):
| params = {}
self.build_list_params(params, instance_ids, 'InstanceId')
if dry_run:
params['DryRun'] = 'true'
return self.get_list('UnmonitorInstances', params, [('item', InstanceInfo)], verb='POST')
|
'Deprecated Version, maintained for backward compatibility.
Disable detailed CloudWatch monitoring for the supplied instance.
:type instance_id: string
:param instance_id: The instance id
:type dry_run: bool
:param dry_run: Set to True if the operation should not actually run.
:rtype: list
:return: A list of :class:`bo... | def unmonitor_instance(self, instance_id, dry_run=False):
| return self.unmonitor_instances([instance_id], dry_run=dry_run)
|
'Bundle Windows instance.
:type instance_id: string
:param instance_id: The instance id
:type s3_bucket: string
:param s3_bucket: The bucket in which the AMI should be stored.
:type s3_prefix: string
:param s3_prefix: The beginning of the file name for the AMI.
:type s3_upload_policy: string
:param s3_upload_policy: Ba... | def bundle_instance(self, instance_id, s3_bucket, s3_prefix, s3_upload_policy, dry_run=False):
| params = {'InstanceId': instance_id, 'Storage.S3.Bucket': s3_bucket, 'Storage.S3.Prefix': s3_prefix, 'Storage.S3.UploadPolicy': s3_upload_policy}
s3auth = boto.auth.get_auth_handler(None, boto.config, self.provider, ['s3'])
params['Storage.S3.AWSAccessKeyId'] = self.aws_access_key_id
signature = s3auth.... |
'Retrieve current bundling tasks. If no bundle id is specified, all
tasks are retrieved.
:type bundle_ids: list
:param bundle_ids: A list of strings containing identifiers for
previously created bundling tasks.
:type filters: dict
:param filters: Optional filters that can be used to limit
the results returned. Filters... | def get_all_bundle_tasks(self, bundle_ids=None, filters=None, dry_run=False):
| params = {}
if bundle_ids:
self.build_list_params(params, bundle_ids, 'BundleId')
if filters:
self.build_filter_params(params, filters)
if dry_run:
params['DryRun'] = 'true'
return self.get_list('DescribeBundleTasks', params, [('item', BundleInstanceTask)], verb='POST')
|
'Cancel a previously submitted bundle task
:type bundle_id: string
:param bundle_id: The identifier of the bundle task to cancel.
:type dry_run: bool
:param dry_run: Set to True if the operation should not actually run.'
| def cancel_bundle_task(self, bundle_id, dry_run=False):
| params = {'BundleId': bundle_id}
if dry_run:
params['DryRun'] = 'true'
return self.get_object('CancelBundleTask', params, BundleInstanceTask, verb='POST')
|
'Get encrypted administrator password for a Windows instance.
:type instance_id: string
:param instance_id: The identifier of the instance to retrieve the
password for.
:type dry_run: bool
:param dry_run: Set to True if the operation should not actually run.'
| def get_password_data(self, instance_id, dry_run=False):
| params = {'InstanceId': instance_id}
if dry_run:
params['DryRun'] = 'true'
rs = self.get_object('GetPasswordData', params, ResultSet, verb='POST')
return rs.passwordData
|
'Get all placement groups associated with your account in a region.
:type groupnames: list
:param groupnames: A list of the names of placement groups to retrieve.
If not provided, all placement groups will be
returned.
:type filters: dict
:param filters: Optional filters that can be used to limit
the results returned. ... | def get_all_placement_groups(self, groupnames=None, filters=None, dry_run=False):
| params = {}
if groupnames:
self.build_list_params(params, groupnames, 'GroupName')
if filters:
self.build_filter_params(params, filters)
if dry_run:
params['DryRun'] = 'true'
return self.get_list('DescribePlacementGroups', params, [('item', PlacementGroup)], verb='POST')
|
'Create a new placement group for your account.
This will create the placement group within the region you
are currently connected to.
:type name: string
:param name: The name of the new placement group
:type strategy: string
:param strategy: The placement strategy of the new placement group.
Currently, the only accept... | def create_placement_group(self, name, strategy='cluster', dry_run=False):
| params = {'GroupName': name, 'Strategy': strategy}
if dry_run:
params['DryRun'] = 'true'
group = self.get_status('CreatePlacementGroup', params, verb='POST')
return group
|
'Delete a placement group from your account.
:type key_name: string
:param key_name: The name of the keypair to delete
:type dry_run: bool
:param dry_run: Set to True if the operation should not actually run.'
| def delete_placement_group(self, name, dry_run=False):
| params = {'GroupName': name}
if dry_run:
params['DryRun'] = 'true'
return self.get_status('DeletePlacementGroup', params, verb='POST')
|
'Retrieve all the metadata tags associated with your account.
:type filters: dict
:param filters: Optional filters that can be used to limit
the results returned. Filters are provided
in the form of a dictionary consisting of
filter names as the key and filter values
as the value. The set of allowable filter
names/va... | def get_all_tags(self, filters=None, dry_run=False, max_results=None):
| params = {}
if filters:
self.build_filter_params(params, filters)
if dry_run:
params['DryRun'] = 'true'
if (max_results is not None):
params['MaxResults'] = max_results
return self.get_list('DescribeTags', params, [('item', Tag)], verb='POST')
|
'Create new metadata tags for the specified resource ids.
:type resource_ids: list
:param resource_ids: List of strings
:type tags: dict
:param tags: A dictionary containing the name/value pairs.
If you want to create only a tag name, the
value for that tag should be the empty string
(e.g. \'\').
:type dry_run: bool
:p... | def create_tags(self, resource_ids, tags, dry_run=False):
| params = {}
self.build_list_params(params, resource_ids, 'ResourceId')
self.build_tag_param_list(params, tags)
if dry_run:
params['DryRun'] = 'true'
return self.get_status('CreateTags', params, verb='POST')
|
'Delete metadata tags for the specified resource ids.
:type resource_ids: list
:param resource_ids: List of strings
:type tags: dict or list
:param tags: Either a dictionary containing name/value pairs
or a list containing just tag names.
If you pass in a dictionary, the values must
match the actual tag values or the t... | def delete_tags(self, resource_ids, tags, dry_run=False):
| if isinstance(tags, list):
tags = {}.fromkeys(tags, None)
params = {}
self.build_list_params(params, resource_ids, 'ResourceId')
self.build_tag_param_list(params, tags)
if dry_run:
params['DryRun'] = 'true'
return self.get_status('DeleteTags', params, verb='POST')
|
'Retrieve all of the Elastic Network Interfaces (ENI\'s)
associated with your account.
:type network_interface_ids: list
:param network_interface_ids: a list of strings representing ENI IDs
:type filters: dict
:param filters: Optional filters that can be used to limit
the results returned. Filters are provided
in the ... | def get_all_network_interfaces(self, network_interface_ids=None, filters=None, dry_run=False):
| params = {}
if network_interface_ids:
self.build_list_params(params, network_interface_ids, 'NetworkInterfaceId')
if filters:
self.build_filter_params(params, filters)
if dry_run:
params['DryRun'] = 'true'
return self.get_list('DescribeNetworkInterfaces', params, [('item', Ne... |
'Creates a network interface in the specified subnet.
:type subnet_id: str
:param subnet_id: The ID of the subnet to associate with the
network interface.
:type private_ip_address: str
:param private_ip_address: The private IP address of the
network interface. If not supplied, one will be chosen
for you.
:type descrip... | def create_network_interface(self, subnet_id, private_ip_address=None, description=None, groups=None, dry_run=False):
| params = {'SubnetId': subnet_id}
if private_ip_address:
params['PrivateIpAddress'] = private_ip_address
if description:
params['Description'] = description
if groups:
ids = []
for group in groups:
if isinstance(group, SecurityGroup):
ids.append... |
'Attaches a network interface to an instance.
:type network_interface_id: str
:param network_interface_id: The ID of the network interface to attach.
:type instance_id: str
:param instance_id: The ID of the instance that will be attached
to the network interface.
:type device_index: int
:param device_index: The index o... | def attach_network_interface(self, network_interface_id, instance_id, device_index, dry_run=False):
| params = {'NetworkInterfaceId': network_interface_id, 'InstanceId': instance_id, 'DeviceIndex': device_index}
if dry_run:
params['DryRun'] = 'true'
return self.get_status('AttachNetworkInterface', params, verb='POST')
|
'Detaches a network interface from an instance.
:type attachment_id: str
:param attachment_id: The ID of the attachment.
:type force: bool
:param force: Set to true to force a detachment.
:type dry_run: bool
:param dry_run: Set to True if the operation should not actually run.'
| def detach_network_interface(self, attachment_id, force=False, dry_run=False):
| params = {'AttachmentId': attachment_id}
if force:
params['Force'] = 'true'
if dry_run:
params['DryRun'] = 'true'
return self.get_status('DetachNetworkInterface', params, verb='POST')
|
'Delete the specified network interface.
:type network_interface_id: str
:param network_interface_id: The ID of the network interface to delete.
:type dry_run: bool
:param dry_run: Set to True if the operation should not actually run.'
| def delete_network_interface(self, network_interface_id, dry_run=False):
| params = {'NetworkInterfaceId': network_interface_id}
if dry_run:
params['DryRun'] = 'true'
return self.get_status('DeleteNetworkInterface', params, verb='POST')
|
'Get all instance_types available on this cloud (eucalyptus specific)
:rtype: list of :class:`boto.ec2.instancetype.InstanceType`
:return: The requested InstanceType objects'
| def get_all_instance_types(self):
| params = {}
return self.get_list('DescribeInstanceTypes', params, [('item', InstanceType)], verb='POST')
|
':type dry_run: bool
:param dry_run: Set to True if the operation should not actually run.
:rtype: :class:`boto.ec2.image.CopyImage`
:return: Object containing the image_id of the copied image.'
| def copy_image(self, source_region, source_image_id, name=None, description=None, client_token=None, dry_run=False, encrypted=None, kms_key_id=None):
| params = {'SourceRegion': source_region, 'SourceImageId': source_image_id}
if (name is not None):
params['Name'] = name
if (description is not None):
params['Description'] = description
if (client_token is not None):
params['ClientToken'] = client_token
if (encrypted is not N... |
':type dry_run: bool
:param dry_run: Set to True if the operation should not actually run.'
| def describe_account_attributes(self, attribute_names=None, dry_run=False):
| params = {}
if (attribute_names is not None):
self.build_list_params(params, attribute_names, 'AttributeName')
if dry_run:
params['DryRun'] = 'true'
return self.get_list('DescribeAccountAttributes', params, [('item', AccountAttribute)], verb='POST')
|
':type dry_run: bool
:param dry_run: Set to True if the operation should not actually run.'
| def describe_vpc_attribute(self, vpc_id, attribute=None, dry_run=False):
| params = {'VpcId': vpc_id}
if (attribute is not None):
params['Attribute'] = attribute
if dry_run:
params['DryRun'] = 'true'
return self.get_object('DescribeVpcAttribute', params, VPCAttribute, verb='POST')
|
':type dry_run: bool
:param dry_run: Set to True if the operation should not actually run.'
| def modify_vpc_attribute(self, vpc_id, enable_dns_support=None, enable_dns_hostnames=None, dry_run=False):
| params = {'VpcId': vpc_id}
if (enable_dns_support is not None):
params['EnableDnsSupport.Value'] = ('true' if enable_dns_support else 'false')
if (enable_dns_hostnames is not None):
params['EnableDnsHostnames.Value'] = ('true' if enable_dns_hostnames else 'false')
if dry_run:
par... |
'Get all of your linked EC2-Classic instances. This request only
returns information about EC2-Classic instances linked to
a VPC through ClassicLink
:type instance_ids: list
:param instance_ids: A list of strings of instance IDs. Must be
instances linked to a VPC through ClassicLink.
:type filters: dict
:param filters... | def get_all_classic_link_instances(self, instance_ids=None, filters=None, dry_run=False, max_results=None, next_token=None):
| params = {}
if instance_ids:
self.build_list_params(params, instance_ids, 'InstanceId')
if filters:
self.build_filter_params(params, filters)
if dry_run:
params['DryRun'] = 'true'
if (max_results is not None):
params['MaxResults'] = max_results
if next_token:
... |
':ivar boto.ec2.elb.loadbalancer.LoadBalancer load_balancer: The
load balancer this instance is registered to.
:ivar str description: A description of the instance.
:ivar str instance_id: The EC2 instance ID.
:ivar str reason_code: Provides information about the cause of
an OutOfService instance. Specifically, it indic... | def __init__(self, load_balancer=None, description=None, state=None, instance_id=None, reason_code=None):
| self.load_balancer = load_balancer
self.description = description
self.state = state
self.instance_id = instance_id
self.reason_code = reason_code
|
'Init method to create a new connection to EC2 Load Balancing Service.
.. note:: The region argument is overridden by the region specified in
the boto configuration file.'
| def __init__(self, aws_access_key_id=None, aws_secret_access_key=None, is_secure=True, port=None, proxy=None, proxy_port=None, proxy_user=None, proxy_pass=None, debug=0, https_connection_factory=None, region=None, path='/', security_token=None, validate_certs=True, profile_name=None):
| if (not region):
region = RegionInfo(self, self.DefaultRegionName, self.DefaultRegionEndpoint)
self.region = region
super(ELBConnection, self).__init__(aws_access_key_id, aws_secret_access_key, is_secure, port, proxy, proxy_port, proxy_user, proxy_pass, self.region.endpoint, debug, https_connection_... |
'Retrieve all load balancers associated with your account.
:type load_balancer_names: list
:keyword load_balancer_names: An optional list of load balancer names.
:type marker: string
:param marker: Use this only when paginating results and only
in follow-up request after you\'ve received a response
where the results ar... | def get_all_load_balancers(self, load_balancer_names=None, marker=None):
| params = {}
if load_balancer_names:
self.build_list_params(params, load_balancer_names, 'LoadBalancerNames.member.%d')
if marker:
params['Marker'] = marker
return self.get_list('DescribeLoadBalancers', params, [('member', LoadBalancer)])
|
'Create a new load balancer for your account. By default the load
balancer will be created in EC2. To create a load balancer inside a
VPC, parameter zones must be set to None and subnets must not be None.
The load balancer will be automatically created under the VPC that
contains the subnet(s) specified.
:type name: st... | def create_load_balancer(self, name, zones, listeners=None, subnets=None, security_groups=None, scheme='internet-facing', complex_listeners=None):
| if ((not listeners) and (not complex_listeners)):
return None
params = {'LoadBalancerName': name, 'Scheme': scheme}
if listeners:
for (index, listener) in enumerate(listeners):
i = (index + 1)
protocol = listener[2].upper()
params[('Listeners.member.%d.Loa... |
'Creates a Listener (or group of listeners) for an existing
Load Balancer
:type name: string
:param name: The name of the load balancer to create the listeners for
:type listeners: List of tuples
:param listeners: Each tuple contains three or four values,
(LoadBalancerPortNumber, InstancePortNumber, Protocol,
[SSLCerti... | def create_load_balancer_listeners(self, name, listeners=None, complex_listeners=None):
| if ((not listeners) and (not complex_listeners)):
return None
params = {'LoadBalancerName': name}
if listeners:
for (index, listener) in enumerate(listeners):
i = (index + 1)
protocol = listener[2].upper()
params[('Listeners.member.%d.LoadBalancerPort' % i... |
'Delete a Load Balancer from your account.
:type name: string
:param name: The name of the Load Balancer to delete'
| def delete_load_balancer(self, name):
| params = {'LoadBalancerName': name}
return self.get_status('DeleteLoadBalancer', params)
|
'Deletes a load balancer listener (or group of listeners)
:type name: string
:param name: The name of the load balancer to create the listeners for
:type ports: List int
:param ports: Each int represents the port on the ELB to be removed
:return: The status of the request'
| def delete_load_balancer_listeners(self, name, ports):
| params = {'LoadBalancerName': name}
for (index, port) in enumerate(ports):
params[('LoadBalancerPorts.member.%d' % (index + 1))] = port
return self.get_status('DeleteLoadBalancerListeners', params)
|
'Add availability zones to an existing Load Balancer
All zones must be in the same region as the Load Balancer
Adding zones that are already registered with the Load Balancer
has no effect.
:type load_balancer_name: string
:param load_balancer_name: The name of the Load Balancer
:type zones: List of strings
:param zone... | def enable_availability_zones(self, load_balancer_name, zones_to_add):
| params = {'LoadBalancerName': load_balancer_name}
self.build_list_params(params, zones_to_add, 'AvailabilityZones.member.%d')
obj = self.get_object('EnableAvailabilityZonesForLoadBalancer', params, LoadBalancerZones)
return obj.zones
|
'Remove availability zones from an existing Load Balancer.
All zones must be in the same region as the Load Balancer.
Removing zones that are not registered with the Load Balancer
has no effect.
You cannot remove all zones from an Load Balancer.
:type load_balancer_name: string
:param load_balancer_name: The name of th... | def disable_availability_zones(self, load_balancer_name, zones_to_remove):
| params = {'LoadBalancerName': load_balancer_name}
self.build_list_params(params, zones_to_remove, 'AvailabilityZones.member.%d')
obj = self.get_object('DisableAvailabilityZonesForLoadBalancer', params, LoadBalancerZones)
return obj.zones
|
'Changes an attribute of a Load Balancer
:type load_balancer_name: string
:param load_balancer_name: The name of the Load Balancer
:type attribute: string
:param attribute: The attribute you wish to change.
* crossZoneLoadBalancing - Boolean (true)
* connectingSettings - :py:class:`ConnectionSettingAttribute` instance
... | def modify_lb_attribute(self, load_balancer_name, attribute, value):
| bool_reqs = ('crosszoneloadbalancing',)
if (attribute.lower() in bool_reqs):
if isinstance(value, bool):
if value:
value = 'true'
else:
value = 'false'
params = {'LoadBalancerName': load_balancer_name}
if (attribute.lower() == 'crosszoneloa... |
'Gets all Attributes of a Load Balancer
:type load_balancer_name: string
:param load_balancer_name: The name of the Load Balancer
:rtype: boto.ec2.elb.attribute.LbAttributes
:return: The attribute object of the ELB.'
| def get_all_lb_attributes(self, load_balancer_name):
| from boto.ec2.elb.attributes import LbAttributes
params = {'LoadBalancerName': load_balancer_name}
return self.get_object('DescribeLoadBalancerAttributes', params, LbAttributes)
|
'Gets an attribute of a Load Balancer
This will make an EC2 call for each method call.
:type load_balancer_name: string
:param load_balancer_name: The name of the Load Balancer
:type attribute: string
:param attribute: The attribute you wish to see.
* accessLog - :py:class:`AccessLogAttribute` instance
* crossZoneLoadB... | def get_lb_attribute(self, load_balancer_name, attribute):
| attributes = self.get_all_lb_attributes(load_balancer_name)
if (attribute.lower() == 'accesslog'):
return attributes.access_log
if (attribute.lower() == 'crosszoneloadbalancing'):
return attributes.cross_zone_load_balancing.enabled
if (attribute.lower() == 'connectiondraining'):
... |
'Add new Instances to an existing Load Balancer.
:type load_balancer_name: string
:param load_balancer_name: The name of the Load Balancer
:type instances: List of strings
:param instances: The instance ID\'s of the EC2 instances to add.
:rtype: List of strings
:return: An updated list of instances for this Load Balanc... | def register_instances(self, load_balancer_name, instances):
| params = {'LoadBalancerName': load_balancer_name}
self.build_list_params(params, instances, 'Instances.member.%d.InstanceId')
return self.get_list('RegisterInstancesWithLoadBalancer', params, [('member', InstanceInfo)])
|
'Remove Instances from an existing Load Balancer.
:type load_balancer_name: string
:param load_balancer_name: The name of the Load Balancer
:type instances: List of strings
:param instances: The instance ID\'s of the EC2 instances to remove.
:rtype: List of strings
:return: An updated list of instances for this Load Ba... | def deregister_instances(self, load_balancer_name, instances):
| params = {'LoadBalancerName': load_balancer_name}
self.build_list_params(params, instances, 'Instances.member.%d.InstanceId')
return self.get_list('DeregisterInstancesFromLoadBalancer', params, [('member', InstanceInfo)])
|
'Get current state of all Instances registered to an Load Balancer.
:type load_balancer_name: string
:param load_balancer_name: The name of the Load Balancer
:type instances: List of strings
:param instances: The instance ID\'s of the EC2 instances
to return status for. If not provided,
the state of all instances will... | def describe_instance_health(self, load_balancer_name, instances=None):
| params = {'LoadBalancerName': load_balancer_name}
if instances:
self.build_list_params(params, instances, 'Instances.member.%d.InstanceId')
return self.get_list('DescribeInstanceHealth', params, [('member', InstanceState)])
|
'Define a health check for the EndPoints.
:type name: string
:param name: The mnemonic name associated with the load balancer
:type health_check: :class:`boto.ec2.elb.healthcheck.HealthCheck`
:param health_check: A HealthCheck object populated with the desired
values.
:rtype: :class:`boto.ec2.elb.healthcheck.HealthChec... | def configure_health_check(self, name, health_check):
| params = {'LoadBalancerName': name, 'HealthCheck.Timeout': health_check.timeout, 'HealthCheck.Target': health_check.target, 'HealthCheck.Interval': health_check.interval, 'HealthCheck.UnhealthyThreshold': health_check.unhealthy_threshold, 'HealthCheck.HealthyThreshold': health_check.healthy_threshold}
return se... |
'Sets the certificate that terminates the specified listener\'s SSL
connections. The specified certificate replaces any prior certificate
that was used on the same LoadBalancer and port.'
| def set_lb_listener_SSL_certificate(self, lb_name, lb_port, ssl_certificate_id):
| params = {'LoadBalancerName': lb_name, 'LoadBalancerPort': lb_port, 'SSLCertificateId': ssl_certificate_id}
return self.get_status('SetLoadBalancerListenerSSLCertificate', params)
|
'Generates a stickiness policy with sticky session lifetimes that follow
that of an application-generated cookie. This policy can only be
associated with HTTP listeners.
This policy is similar to the policy created by
CreateLBCookieStickinessPolicy, except that the lifetime of the special
Elastic Load Balancing cookie ... | def create_app_cookie_stickiness_policy(self, name, lb_name, policy_name):
| params = {'CookieName': name, 'LoadBalancerName': lb_name, 'PolicyName': policy_name}
return self.get_status('CreateAppCookieStickinessPolicy', params)
|
'Generates a stickiness policy with sticky session lifetimes controlled
by the lifetime of the browser (user-agent) or a specified expiration
period. This policy can only be associated only with HTTP listeners.
When a load balancer implements this policy, the load balancer uses a
special cookie to track the backend ser... | def create_lb_cookie_stickiness_policy(self, cookie_expiration_period, lb_name, policy_name):
| params = {'LoadBalancerName': lb_name, 'PolicyName': policy_name}
if (cookie_expiration_period is not None):
params['CookieExpirationPeriod'] = cookie_expiration_period
return self.get_status('CreateLBCookieStickinessPolicy', params)
|
'Creates a new policy that contains the necessary attributes
depending on the policy type. Policies are settings that are
saved for your load balancer and that can be applied to the
front-end listener, or the back-end application server.'
| def create_lb_policy(self, lb_name, policy_name, policy_type, policy_attributes):
| params = {'LoadBalancerName': lb_name, 'PolicyName': policy_name, 'PolicyTypeName': policy_type}
for (index, (name, value)) in enumerate(six.iteritems(policy_attributes), 1):
params[('PolicyAttributes.member.%d.AttributeName' % index)] = name
params[('PolicyAttributes.member.%d.AttributeValue' %... |
'Deletes a policy from the LoadBalancer. The specified policy must not
be enabled for any listeners.'
| def delete_lb_policy(self, lb_name, policy_name):
| params = {'LoadBalancerName': lb_name, 'PolicyName': policy_name}
return self.get_status('DeleteLoadBalancerPolicy', params)
|
'Associates, updates, or disables a policy with a listener on the load
balancer. Currently only zero (0) or one (1) policy can be associated
with a listener.'
| def set_lb_policies_of_listener(self, lb_name, lb_port, policies):
| params = {'LoadBalancerName': lb_name, 'LoadBalancerPort': lb_port}
if len(policies):
self.build_list_params(params, policies, 'PolicyNames.member.%d')
else:
params['PolicyNames'] = ''
return self.get_status('SetLoadBalancerPoliciesOfListener', params)
|
'Replaces the current set of policies associated with a port on which
the back-end server is listening with a new set of policies.'
| def set_lb_policies_of_backend_server(self, lb_name, instance_port, policies):
| params = {'LoadBalancerName': lb_name, 'InstancePort': instance_port}
if policies:
self.build_list_params(params, policies, 'PolicyNames.member.%d')
else:
params['PolicyNames'] = ''
return self.get_status('SetLoadBalancerPoliciesForBackendServer', params)
|
'Associates one or more security groups with the load balancer.
The provided security groups will override any currently applied
security groups.
:type name: string
:param name: The name of the Load Balancer
:type security_groups: List of strings
:param security_groups: The name of the security group(s) to add.
:rtype:... | def apply_security_groups_to_lb(self, name, security_groups):
| params = {'LoadBalancerName': name}
self.build_list_params(params, security_groups, 'SecurityGroups.member.%d')
return self.get_list('ApplySecurityGroupsToLoadBalancer', params, None)
|
'Attaches load balancer to one or more subnets.
Attaching subnets that are already registered with the
Load Balancer has no effect.
:type name: string
:param name: The name of the Load Balancer
:type subnets: List of strings
:param subnets: The name of the subnet(s) to add.
:rtype: List of strings
:return: An updated l... | def attach_lb_to_subnets(self, name, subnets):
| params = {'LoadBalancerName': name}
self.build_list_params(params, subnets, 'Subnets.member.%d')
return self.get_list('AttachLoadBalancerToSubnets', params, None)
|
'Detaches load balancer from one or more subnets.
:type name: string
:param name: The name of the Load Balancer
:type subnets: List of strings
:param subnets: The name of the subnet(s) to detach.
:rtype: List of strings
:return: An updated list of subnets for this Load Balancer.'
| def detach_lb_from_subnets(self, name, subnets):
| params = {'LoadBalancerName': name}
self.build_list_params(params, subnets, 'Subnets.member.%d')
return self.get_list('DetachLoadBalancerFromSubnets', params, None)
|
':ivar str access_point: The name of the load balancer this
health check is associated with.
:ivar int interval: Specifies how many seconds there are between
health checks.
:ivar str target: Determines what to check on an instance. See the
Amazon HealthCheck_ documentation for possible Target values.
.. _HealthCheck: h... | def __init__(self, access_point=None, interval=30, target=None, healthy_threshold=3, timeout=5, unhealthy_threshold=5):
| self.access_point = access_point
self.interval = interval
self.target = target
self.healthy_threshold = healthy_threshold
self.timeout = timeout
self.unhealthy_threshold = unhealthy_threshold
|
'In the case where you have accessed an existing health check on a
load balancer, this method applies this instance\'s health check
values to the load balancer it is attached to.
.. note:: This method will not do anything if the :py:attr:`access_point`
attribute isn\'t set, as is the case with a newly instantiated
Heal... | def update(self):
| if (not self.access_point):
return
new_hc = self.connection.configure_health_check(self.access_point, self)
self.interval = new_hc.interval
self.target = new_hc.target
self.healthy_threshold = new_hc.healthy_threshold
self.unhealthy_threshold = new_hc.unhealthy_threshold
self.timeout... |
':ivar boto.ec2.elb.ELBConnection connection: The connection this load
balancer was instance was instantiated from.
:ivar list listeners: A list of tuples in the form of
``(<Inbound port>, <Outbound port>, <Protocol>)``
:ivar boto.ec2.elb.healthcheck.HealthCheck health_check: The health
check policy for this load balan... | def __init__(self, connection=None, name=None, endpoints=None):
| self.connection = connection
self.name = name
self.listeners = None
self.health_check = None
self.policies = None
self.dns_name = None
self.created_time = None
self.instances = None
self.availability_zones = ListElement()
self.canonical_hosted_zone_name = None
self.canonical_... |
'Enable availability zones to this Access Point.
All zones must be in the same region as the Access Point.
:type zones: string or List of strings
:param zones: The name of the zone(s) to add.'
| def enable_zones(self, zones):
| if isinstance(zones, six.string_types):
zones = [zones]
new_zones = self.connection.enable_availability_zones(self.name, zones)
self.availability_zones = new_zones
|
'Disable availability zones from this Access Point.
:type zones: string or List of strings
:param zones: The name of the zone(s) to add.'
| def disable_zones(self, zones):
| if isinstance(zones, six.string_types):
zones = [zones]
new_zones = self.connection.disable_availability_zones(self.name, zones)
self.availability_zones = new_zones
|
'Gets the LbAttributes. The Attributes will be cached.
:type force: bool
:param force: Ignore cache value and reload.
:rtype: boto.ec2.elb.attributes.LbAttributes
:return: The LbAttribues object'
| def get_attributes(self, force=False):
| if ((not self._attributes) or force):
self._attributes = self.connection.get_all_lb_attributes(self.name)
return self._attributes
|
'Identifies if the ELB is current configured to do CrossZone Balancing.
:type force: bool
:param force: Ignore cache value and reload.
:rtype: bool
:return: True if balancing is enabled, False if not.'
| def is_cross_zone_load_balancing(self, force=False):
| return self.get_attributes(force).cross_zone_load_balancing.enabled
|
'Turns on CrossZone Load Balancing for this ELB.
:rtype: bool
:return: True if successful, False if not.'
| def enable_cross_zone_load_balancing(self):
| success = self.connection.modify_lb_attribute(self.name, 'crossZoneLoadBalancing', True)
if (success and self._attributes):
self._attributes.cross_zone_load_balancing.enabled = True
return success
|
'Turns off CrossZone Load Balancing for this ELB.
:rtype: bool
:return: True if successful, False if not.'
| def disable_cross_zone_load_balancing(self):
| success = self.connection.modify_lb_attribute(self.name, 'crossZoneLoadBalancing', False)
if (success and self._attributes):
self._attributes.cross_zone_load_balancing.enabled = False
return success
|
'Adds instances to this load balancer. All instances must be in the same
region as the load balancer. Adding endpoints that are already
registered with the load balancer has no effect.
:param list instances: List of instance IDs (strings) that you\'d like
to add to this load balancer.'
| def register_instances(self, instances):
| if isinstance(instances, six.string_types):
instances = [instances]
new_instances = self.connection.register_instances(self.name, instances)
self.instances = new_instances
|
'Remove instances from this load balancer. Removing instances that are
not registered with the load balancer has no effect.
:param list instances: List of instance IDs (strings) that you\'d like
to remove from this load balancer.'
| def deregister_instances(self, instances):
| if isinstance(instances, six.string_types):
instances = [instances]
new_instances = self.connection.deregister_instances(self.name, instances)
self.instances = new_instances
|
'Delete this load balancer.'
| def delete(self):
| return self.connection.delete_load_balancer(self.name)
|
'Configures the health check behavior for the instances behind this
load balancer. See :ref:`elb-configuring-a-health-check` for a
walkthrough.
:param boto.ec2.elb.healthcheck.HealthCheck health_check: A
HealthCheck instance that tells the load balancer how to check
its instances for health.'
| def configure_health_check(self, health_check):
| return self.connection.configure_health_check(self.name, health_check)
|
'Returns a list of :py:class:`boto.ec2.elb.instancestate.InstanceState`
objects, which show the health of the instances attached to this
load balancer.
:rtype: list
:returns: A list of
:py:class:`InstanceState <boto.ec2.elb.instancestate.InstanceState>`
instances, representing the instances
attached to this load balanc... | def get_instance_health(self, instances=None):
| return self.connection.describe_instance_health(self.name, instances)
|
'Deletes a policy from the LoadBalancer. The specified policy must not
be enabled for any listeners.'
| def delete_policy(self, policy_name):
| return self.connection.delete_lb_policy(self.name, policy_name)
|
'Attaches load balancer to one or more subnets.
Attaching subnets that are already registered with the
Load Balancer has no effect.
:type subnets: string or List of strings
:param subnets: The name of the subnet(s) to add.'
| def attach_subnets(self, subnets):
| if isinstance(subnets, six.string_types):
subnets = [subnets]
new_subnets = self.connection.attach_lb_to_subnets(self.name, subnets)
self.subnets = new_subnets
|
'Detaches load balancer from one or more subnets.
:type subnets: string or List of strings
:param subnets: The name of the subnet(s) to detach.'
| def detach_subnets(self, subnets):
| if isinstance(subnets, six.string_types):
subnets = [subnets]
new_subnets = self.connection.detach_lb_from_subnets(self.name, subnets)
self.subnets = new_subnets
|
'Associates one or more security groups with the load balancer.
The provided security groups will override any currently applied
security groups.
:type security_groups: string or List of strings
:param security_groups: The name of the security group(s) to add.'
| def apply_security_groups(self, security_groups):
| if isinstance(security_groups, six.string_types):
security_groups = [security_groups]
new_sgs = self.connection.apply_security_groups_to_lb(self.name, security_groups)
self.security_groups = new_sgs
|
'Update the data associated with this ENI by querying EC2.
:type validate: bool
:param validate: By default, if EC2 returns no data about the
ENI the update method returns quietly. If
the validate param is True, however, it will
raise a ValueError exception if no data is
returned from EC2.'
| def update(self, validate=False, dry_run=False):
| rs = self.connection.get_all_network_interfaces([self.id], dry_run=dry_run)
if (len(rs) > 0):
self._update(rs[0])
elif validate:
raise ValueError(('%s is not a valid ENI ID' % self.id))
return self.status
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.