code
string
signature
string
docstring
string
loss_without_docstring
float64
loss_with_docstring
float64
factor
float64
params = {} if volume_ids: self.build_list_params(params, volume_ids, 'VolumeId') if filters: self.build_filter_params(params, filters) return self.get_list('DescribeVolumes', params, [('item', Volume)], verb='POST')
def get_all_volumes(self, volume_ids=None, filters=None)
Get all Volumes associated with the current credentials. :type volume_ids: list :param volume_ids: Optional list of volume ids. If this list is present, only the volumes associated with these volume ids will be returned. :type filters: dic...
2.212623
2.28124
0.969921
if isinstance(zone, Zone): zone = zone.name params = {'AvailabilityZone' : zone} if size: params['Size'] = size if snapshot: if isinstance(snapshot, Snapshot): snapshot = snapshot.id params['SnapshotId'] = snapshot ...
def create_volume(self, size, zone, snapshot=None)
Create a new EBS Volume. :type size: int :param size: The size of the new volume, in GiB :type zone: string or :class:`boto.ec2.zone.Zone` :param zone: The availability zone in which the Volume will be created. :type snapshot: string or :class:`boto.ec2.snapshot.Snapshot` ...
2.39176
2.573585
0.929349
params = {'InstanceId' : instance_id, 'VolumeId' : volume_id, 'Device' : device} return self.get_status('AttachVolume', params, verb='POST')
def attach_volume(self, volume_id, instance_id, device)
Attach an EBS volume to an EC2 instance. :type volume_id: str :param volume_id: The ID of the EBS volume to be attached. :type instance_id: str :param instance_id: The ID of the EC2 instance to which it will be attached. :type device: str :p...
2.631399
3.671035
0.7168
params = {'VolumeId' : volume_id} if instance_id: params['InstanceId'] = instance_id if device: params['Device'] = device if force: params['Force'] = 'true' return self.get_status('DetachVolume', params, verb='POST')
def detach_volume(self, volume_id, instance_id=None, device=None, force=False)
Detach an EBS volume from an EC2 instance. :type volume_id: str :param volume_id: The ID of the EBS volume to be attached. :type instance_id: str :param instance_id: The ID of the EC2 instance from which it will be detached. :type device: str ...
1.907982
2.311782
0.82533
params = {} if snapshot_ids: self.build_list_params(params, snapshot_ids, 'SnapshotId') if owner: params['Owner'] = owner if restorable_by: params['RestorableBy'] = restorable_by if filters: self.build_filter_params(params,...
def get_all_snapshots(self, snapshot_ids=None, owner=None, restorable_by=None, filters=None)
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. ...
1.771417
1.87002
0.947271
params = {'VolumeId' : volume_id} if description: params['Description'] = description[0:255] snapshot = self.get_object('CreateSnapshot', params, Snapshot, verb='POST') volume = self.get_all_volumes([volume_id])[0] volume_na...
def create_snapshot(self, volume_id, description=None)
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. :rtype: bool :ret...
2.933812
3.454253
0.849333
params = {'Attribute' : attribute} if snapshot_id: params['SnapshotId'] = snapshot_id return self.get_object('DescribeSnapshotAttribute', params, SnapshotAttribute, verb='POST')
def get_snapshot_attribute(self, snapshot_id, attribute='createVolumePermission')
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: * cr...
3.083272
3.719304
0.828991
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') ...
def modify_snapshot_attribute(self, snapshot_id, attribute='createVolumePermission', operation='add', user_ids=None, groups=None)
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: s...
1.934036
2.338041
0.827204
params = {'SnapshotId' : snapshot_id, 'Attribute' : attribute} return self.get_status('ResetSnapshotAttribute', params, verb='POST')
def reset_snapshot_attribute(self, snapshot_id, attribute='createVolumePermission')
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 :rtype: bool :return: Whether the operation succeeded or not
2.96244
4.680075
0.63299
params = {} if keynames: self.build_list_params(params, keynames, 'KeyName') if filters: self.build_filter_params(params, filters) return self.get_list('DescribeKeyPairs', params, [('item', KeyPair)], verb='POST')
def get_all_key_pairs(self, keynames=None, filters=None)
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 ...
2.26255
2.369155
0.955003
try: return self.get_all_key_pairs(keynames=[keyname])[0] except self.ResponseError, e: if e.code == 'InvalidKeyPair.NotFound': return None else: raise
def get_key_pair(self, keyname)
Convenience method to retrieve a specific keypair (KeyPair). :type image_id: string :param image_id: the ID of the Image to retrieve :rtype: :class:`boto.ec2.keypair.KeyPair` :return: The KeyPair specified or None if it is not found
2.603666
2.66479
0.977062
params = {'KeyName':key_name} return self.get_object('CreateKeyPair', params, KeyPair, verb='POST')
def create_key_pair(self, key_name)
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 :rtype: :class:`boto.ec2.keypair.KeyPair` :return: The newly created :class:`boto....
3.790871
4.78501
0.792239
public_key_material = base64.b64encode(public_key_material) params = {'KeyName' : key_name, 'PublicKeyMaterial' : public_key_material} return self.get_object('ImportKeyPair', params, KeyPair, verb='POST')
def import_key_pair(self, key_name, public_key_material)
mports 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 ...
2.219111
2.475897
0.896286
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) ...
def get_all_security_groups(self, groupnames=None, group_ids=None, filters=None)
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 ...
1.708807
1.845836
0.925763
params = { 'GroupName': name, 'GroupDescription': description } if vpc_id is not None: params['VpcId'] = vpc_id group = self.get_object('CreateSecurityGroup', params, SecurityGroup, verb='POST') group....
def create_security_group(self, name, description, vpc_id=None)
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 ne...
2.332562
2.456081
0.949709
params = {} if name is not None: params['GroupName'] = name elif group_id is not None: params['GroupId'] = group_id return self.get_status('DeleteSecurityGroup', params, verb='POST')
def delete_security_group(self, name=None, group_id=None)
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. :rtype: bool :return: True if successful.
2.368236
2.935805
0.806674
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 = {} ...
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=N...
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. ...
1.421236
1.505527
0.944012
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...
def authorize_security_group_egress(self, group_id, ip_protocol, from_port=None, to_port=None, src_group_id=None, ...
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.
1.440448
1.485889
0.969418
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...
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_...
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 ...
1.263156
1.428663
0.884153
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 = {} i...
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_securi...
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. ...
1.427299
1.515949
0.941522
params = {} if region_names: self.build_list_params(params, region_names, 'RegionName') if filters: self.build_filter_params(params, filters) regions = self.get_list('DescribeRegions', params, [('item', RegionInfo)], verb...
def get_all_regions(self, region_names=None, filters=None)
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 ...
3.039953
2.660243
1.142735
params = {} if reserved_instances_id: params['ReservedInstancesId'] = reserved_instances_id if instance_type: params['InstanceType'] = instance_type if availability_zone: params['AvailabilityZone'] = availability_zone if product_descri...
def get_all_reserved_instances_offerings(self, reserved_instances_id=None, instance_type=None, availability_zone=None, product_description=None, ...
Describes Reserved Instance offerings that are available for purchase. :type reserved_instances_id: str :param reserved_instances_id: Displays Reserved Instances with the specified offering IDs. :type instance_type: str :param instance_type: Displa...
1.549004
1.642645
0.942993
params = {} if reserved_instances_id: self.build_list_params(params, reserved_instances_id, 'ReservedInstancesId') if filters: self.build_filter_params(params, filters) return self.get_list('DescribeReservedInstances', ...
def get_all_reserved_instances(self, reserved_instances_id=None, filters=None)
Describes Reserved Instance offerings that are available for purchase. :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 ins...
2.245745
2.445966
0.918142
params = { 'ReservedInstancesOfferingId' : reserved_instances_offering_id, 'InstanceCount' : instance_count} return self.get_object('PurchaseReservedInstancesOffering', params, ReservedInstance, verb='POST')
def purchase_reserved_instance_offering(self, reserved_instances_offering_id, instance_count=1)
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 th...
2.352657
2.930596
0.802791
params = {} self.build_list_params(params, instance_ids, 'InstanceId') return self.get_list('MonitorInstances', params, [('item', InstanceInfo)], verb='POST')
def monitor_instances(self, instance_ids)
Enable CloudWatch monitoring for the supplied instances. :type instance_id: list of strings :param instance_id: The instance ids :rtype: list :return: A list of :class:`boto.ec2.instanceinfo.InstanceInfo`
3.681086
3.714541
0.990994
params = {} self.build_list_params(params, instance_ids, 'InstanceId') return self.get_list('UnmonitorInstances', params, [('item', InstanceInfo)], verb='POST')
def unmonitor_instances(self, instance_ids)
Disable CloudWatch monitoring for the supplied instance. :type instance_id: list of string :param instance_id: The instance id :rtype: list :return: A list of :class:`boto.ec2.instanceinfo.InstanceInfo`
3.351134
3.383446
0.99045
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, ...
def bundle_instance(self, instance_id, s3_bucket, s3_prefix, s3_upload_policy)
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. ...
3.347634
3.478811
0.962293
params = {} if bundle_ids: self.build_list_params(params, bundle_ids, 'BundleId') if filters: self.build_filter_params(params, filters) return self.get_list('DescribeBundleTasks', params, [('item', BundleInstanceTask)], verb=...
def get_all_bundle_tasks(self, bundle_ids=None, filters=None)
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: Optio...
3.239914
2.952512
1.097341
params = {'BundleId' : bundle_id} return self.get_object('CancelBundleTask', params, BundleInstanceTask, verb='POST')
def cancel_bundle_task(self, bundle_id)
Cancel a previously submitted bundle task :type bundle_id: string :param bundle_id: The identifier of the bundle task to cancel.
6.960296
8.157175
0.853273
params = {'InstanceId' : instance_id} rs = self.get_object('GetPasswordData', params, ResultSet, verb='POST') return rs.passwordData
def get_password_data(self, instance_id)
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.
6.299899
7.60931
0.82792
params = {} if groupnames: self.build_list_params(params, groupnames, 'GroupName') if filters: self.build_filter_params(params, filters) return self.get_list('DescribePlacementGroups', params, [('item', PlacementGroup)], verb=...
def get_all_placement_groups(self, groupnames=None, filters=None)
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 ...
2.178055
2.308011
0.943693
params = {'GroupName':name, 'Strategy':strategy} group = self.get_status('CreatePlacementGroup', params, verb='POST') return group
def create_placement_group(self, name, strategy='cluster')
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 th...
4.907627
7.988772
0.614316
params = {} if filters: self.build_filter_params(params, filters) return self.get_list('DescribeTags', params, [('item', Tag)], verb='POST')
def get_all_tags(self, filters=None)
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 filte...
5.983562
5.125071
1.167508
params = {} self.build_list_params(params, resource_ids, 'ResourceId') self.build_tag_param_list(params, tags) return self.get_status('CreateTags', params, verb='POST')
def create_tags(self, resource_ids, tags)
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 ...
2.925266
3.728902
0.784485
if isinstance(tags, list): tags = {}.fromkeys(tags, None) params = {} self.build_list_params(params, resource_ids, 'ResourceId') self.build_tag_param_list(params, tags) return self.get_status('DeleteTags', params, verb='POST')
def delete_tags(self, resource_ids, tags)
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...
2.919519
3.067674
0.951705
params = {} if filters: self.build_filter_params(params, filters) return self.get_list('DescribeNetworkInterfaces', params, [('item', NetworkInterface)], verb='POST')
def get_all_network_interfaces(self, filters=None)
Retrieve all of the Elastic Network Interfaces (ENI's) 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 ...
4.560018
3.625872
1.257633
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(gro...
def create_network_interface(self, subnet_id, private_ip_address=None, description=None, groups=None)
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. I...
1.84421
1.819954
1.013328
params = {'NetworkInterfaceId' : network_interface_id, 'InstanceId' : instance_id, 'Deviceindex' : device_index} return self.get_status('AttachNetworkInterface', params, verb='POST')
def attach_network_interface(self, network_interface_id, instance_id, device_index)
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. :t...
2.505902
3.561008
0.703706
params = {'NetworkInterfaceId' : network_interface_id} if force: params['Force'] = 'true' return self.get_status('DetachNetworkInterface', params, verb='POST')
def detach_network_interface(self, network_interface_id, force=False)
Detaches a network interface from an instance. :type network_interface_id: str :param network_interface_id: The ID of the network interface to detach. :type force: bool :param force: Set to true to force a detachment.
2.522765
4.17695
0.603973
params = {'AutoScalingGroupName' : self.name, 'DesiredCapacity' : capacity} req = self.connection.get_object('SetDesiredCapacity', params, Request) self.connection.last_request = req return req
def set_capacity(self, capacity)
Set the desired capacity for the group.
5.065201
4.581817
1.105501
self.min_size = 0 self.max_size = 0 self.desired_capacity = 0 self.update()
def shutdown_instances(self)
Convenience method which shuts down all instances associated with this group.
4.616804
4.063964
1.136035
return self.connection.delete_auto_scaling_group(self.name, force_delete)
def delete(self, force_delete=False)
Delete this auto-scaling group if no instances attached or no scaling activities in progress.
4.842568
3.950585
1.225785
return self.connection.get_all_activities(self, activity_ids, max_records)
def get_activities(self, activity_ids=None, max_records=50)
Get all activies for this group.
5.626857
4.917898
1.144159
if not parent: parent = self response = self.make_request(action, params, path, verb) body = response.read() boto.log.debug(body) if response.status == 200: e = boto.jsonresponse.Element(list_marker=list_marker, ...
def get_response(self, action, params, path='/', parent=None, verb='GET', list_marker='Set')
Utility method to handle calls to IAM and parsing of responses.
2.529744
2.495666
1.013655
params = {} if path_prefix: params['PathPrefix'] = path_prefix if marker: params['Marker'] = marker if max_items: params['MaxItems'] = max_items return self.get_response('ListGroups', params, list_marke...
def get_all_groups(self, path_prefix='/', marker=None, max_items=None)
List the groups that have the specified path prefix. :type path_prefix: string :param path_prefix: If provided, only groups whose paths match the provided prefix will be returned. :type marker: string :param marker: Use this only when paginating results and ...
2.356986
2.627587
0.897015
params = {'GroupName' : group_name} if marker: params['Marker'] = marker if max_items: params['MaxItems'] = max_items return self.get_response('GetGroup', params, list_marker='Users')
def get_group(self, group_name, marker=None, max_items=None)
Return a list of users that are in the specified group. :type group_name: string :param group_name: The name of the group whose information should be returned. :type marker: string :param marker: Use this only when paginating results and only in ...
2.687449
3.202536
0.839163
params = {'GroupName' : group_name, 'Path' : path} return self.get_response('CreateGroup', params)
def create_group(self, group_name, path='/')
Create a group. :type group_name: string :param group_name: The name of the new group :type path: string :param path: The path to the group (Optional). Defaults to /.
3.981868
6.286642
0.633386
params = {'GroupName' : group_name} if new_group_name: params['NewGroupName'] = new_group_name if new_path: params['NewPath'] = new_path return self.get_response('UpdateGroup', params)
def update_group(self, group_name, new_group_name=None, new_path=None)
Updates name and/or path of the specified group. :type group_name: string :param group_name: The name of the new group :type new_group_name: string :param new_group_name: If provided, the name of the group will be changed to this name. :type new_...
2.040949
2.390599
0.85374
params = {'GroupName' : group_name, 'UserName' : user_name} return self.get_response('AddUserToGroup', params)
def add_user_to_group(self, group_name, user_name)
Add a user to a group :type group_name: string :param group_name: The name of the group :type user_name: string :param user_name: The to be added to the group.
3.043547
4.676263
0.65085
params = {'GroupName' : group_name, 'UserName' : user_name} return self.get_response('RemoveUserFromGroup', params)
def remove_user_from_group(self, group_name, user_name)
Remove a user from a group. :type group_name: string :param group_name: The name of the group :type user_name: string :param user_name: The user to remove from the group.
2.962322
4.74082
0.624854
params = {'GroupName' : group_name, 'PolicyName' : policy_name, 'PolicyDocument' : policy_json} return self.get_response('PutGroupPolicy', params, verb='POST')
def put_group_policy(self, group_name, policy_name, policy_json)
Adds or updates the specified policy document for the specified group. :type group_name: string :param group_name: The name of the group the policy is associated with. :type policy_name: string :param policy_name: The policy document to get. :type policy_json: string :...
2.454266
3.257253
0.753477
params = {'GroupName' : group_name} if marker: params['Marker'] = marker if max_items: params['MaxItems'] = max_items return self.get_response('ListGroupPolicies', params, list_marker='PolicyNames')
def get_all_group_policies(self, group_name, marker=None, max_items=None)
List the names of the policies associated with the specified group. :type group_name: string :param group_name: The name of the group the policy is associated with. :type marker: string :param marker: Use this only when paginating results and only in follow-up re...
2.287243
2.942056
0.77743
params = {'GroupName' : group_name, 'PolicyName' : policy_name} return self.get_response('GetGroupPolicy', params, verb='POST')
def get_group_policy(self, group_name, policy_name)
Retrieves the specified policy document for the specified group. :type group_name: string :param group_name: The name of the group the policy is associated with. :type policy_name: string :param policy_name: The policy document to get.
3.050347
4.904064
0.622004
params = {'GroupName' : group_name, 'PolicyName' : policy_name} return self.get_response('DeleteGroupPolicy', params, verb='POST')
def delete_group_policy(self, group_name, policy_name)
Deletes the specified policy document for the specified group. :type group_name: string :param group_name: The name of the group the policy is associated with. :type policy_name: string :param policy_name: The policy document to delete.
2.709347
4.29026
0.631511
params = {'PathPrefix' : path_prefix} if marker: params['Marker'] = marker if max_items: params['MaxItems'] = max_items return self.get_response('ListUsers', params, list_marker='Users')
def get_all_users(self, path_prefix='/', marker=None, max_items=None)
List the users that have the specified path prefix. :type path_prefix: string :param path_prefix: If provided, only users whose paths match the provided prefix will be returned. :type marker: string :param marker: Use this only when paginating results and on...
2.370703
3.073277
0.771392
params = {'UserName' : user_name, 'Path' : path} return self.get_response('CreateUser', params)
def create_user(self, user_name, path='/')
Create a user. :type user_name: string :param user_name: The name of the new user :type path: string :param path: The path in which the user will be created. Defaults to /.
3.948509
6.439888
0.613133
params = {} if user_name: params['UserName'] = user_name return self.get_response('GetUser', params)
def get_user(self, user_name=None)
Retrieve information about the specified user. If the user_name is not specified, the user_name is determined implicitly based on the AWS Access Key ID used to sign the request. :type user_name: string :param user_name: The name of the user to delete. If not s...
3.494008
4.482691
0.779444
params = {'UserName' : user_name} if new_user_name: params['NewUserName'] = new_user_name if new_path: params['NewPath'] = new_path return self.get_response('UpdateUser', params)
def update_user(self, user_name, new_user_name=None, new_path=None)
Updates name and/or path of the specified user. :type user_name: string :param user_name: The name of the user :type new_user_name: string :param new_user_name: If provided, the username of the user will be changed to this username. :type new_path...
2.029257
2.381404
0.852126
params = {'UserName' : user_name} if marker: params['Marker'] = marker if max_items: params['MaxItems'] = max_items return self.get_response('ListUserPolicies', params, list_marker='PolicyNames')
def get_all_user_policies(self, user_name, marker=None, max_items=None)
List the names of the policies associated with the specified user. :type user_name: string :param user_name: The name of the user the policy is associated with. :type marker: string :param marker: Use this only when paginating results and only in follow-up reques...
2.174833
2.908913
0.747644
params = {'UserName' : user_name, 'PolicyName' : policy_name, 'PolicyDocument' : policy_json} return self.get_response('PutUserPolicy', params, verb='POST')
def put_user_policy(self, user_name, policy_name, policy_json)
Adds or updates the specified policy document for the specified user. :type user_name: string :param user_name: The name of the user the policy is associated with. :type policy_name: string :param policy_name: The policy document to get. :type policy_json: string :para...
2.416324
3.22351
0.749594
params = {'UserName' : user_name, 'PolicyName' : policy_name} return self.get_response('GetUserPolicy', params, verb='POST')
def get_user_policy(self, user_name, policy_name)
Retrieves the specified policy document for the specified user. :type user_name: string :param user_name: The name of the user the policy is associated with. :type policy_name: string :param policy_name: The policy document to get.
2.970059
5.043168
0.588927
params = {'UserName' : user_name, 'PolicyName' : policy_name} return self.get_response('DeleteUserPolicy', params, verb='POST')
def delete_user_policy(self, user_name, policy_name)
Deletes the specified policy document for the specified user. :type user_name: string :param user_name: The name of the user the policy is associated with. :type policy_name: string :param policy_name: The policy document to delete.
2.624472
4.268334
0.61487
params = {'UserName' : user_name} if marker: params['Marker'] = marker if max_items: params['MaxItems'] = max_items return self.get_response('ListGroupsForUser', params, list_marker='Groups')
def get_groups_for_user(self, user_name, marker=None, max_items=None)
List the groups that a specified user belongs to. :type user_name: string :param user_name: The name of the user to list groups for. :type marker: string :param marker: Use this only when paginating results and only in follow-up request after you've received a re...
2.388726
2.992718
0.79818
params = {'UserName' : user_name} if marker: params['Marker'] = marker if max_items: params['MaxItems'] = max_items return self.get_response('ListAccessKeys', params, list_marker='AccessKeyMetadata')
def get_all_access_keys(self, user_name, marker=None, max_items=None)
Get all access keys associated with an account. :type user_name: string :param user_name: The username of the user :type marker: string :param marker: Use this only when paginating results and only in follow-up request after you've received a response ...
2.150455
2.890327
0.744018
params = {'AccessKeyId' : access_key_id, 'Status' : status} if user_name: params['UserName'] = user_name return self.get_response('UpdateAccessKey', params)
def update_access_key(self, access_key_id, status, user_name=None)
Changes the status of the specified access key from Active to Inactive or vice versa. This action can be used to disable a user's key as part of a key rotation workflow. If the user_name is not specified, the user_name is determined implicitly based on the AWS Access Key ID used to sig...
2.300366
2.841185
0.80965
params = {'AccessKeyId' : access_key_id} if user_name: params['UserName'] = user_name return self.get_response('DeleteAccessKey', params)
def delete_access_key(self, access_key_id, user_name=None)
Delete an access key associated with a user. If the user_name is not specified, it is determined implicitly based on the AWS Access Key ID used to sign the request. :type access_key_id: string :param access_key_id: The ID of the access key to be deleted. :type user_name: strin...
2.26702
3.377686
0.671176
params = {} if marker: params['Marker'] = marker if max_items: params['MaxItems'] = max_items if user_name: params['UserName'] = user_name return self.get_response('ListSigningCertificates', params, lis...
def get_all_signing_certs(self, marker=None, max_items=None, user_name=None)
Get all signing certificates associated with an account. If the user_name is not specified, it is determined implicitly based on the AWS Access Key ID used to sign the request. :type marker: string :param marker: Use this only when paginating results and only in ...
2.059334
2.559785
0.804495
params = {'CertificateId' : cert_id, 'Status' : status} if user_name: params['UserName'] = user_name return self.get_response('UpdateSigningCertificate', params)
def update_signing_cert(self, cert_id, status, user_name=None)
Change the status of the specified signing certificate from Active to Inactive or vice versa. If the user_name is not specified, it is determined implicitly based on the AWS Access Key ID used to sign the request. :type cert_id: string :param cert_id: The ID of the signing cert...
2.529
3.289293
0.768858
params = {'CertificateBody' : cert_body} if user_name: params['UserName'] = user_name return self.get_response('UploadSigningCertificate', params, verb='POST')
def upload_signing_cert(self, cert_body, user_name=None)
Uploads an X.509 signing certificate and associates it with the specified user. If the user_name is not specified, it is determined implicitly based on the AWS Access Key ID used to sign the request. :type cert_body: string :param cert_body: The body of the signing certificate....
2.983515
4.557527
0.654635
params = {'CertificateId' : cert_id} if user_name: params['UserName'] = user_name return self.get_response('DeleteSigningCertificate', params)
def delete_signing_cert(self, cert_id, user_name=None)
Delete a signing certificate associated with a user. If the user_name is not specified, it is determined implicitly based on the AWS Access Key ID used to sign the request. :type user_name: string :param user_name: The username of the user :type cert_id: string :param ...
2.536652
3.412957
0.743242
params = {} if path_prefix: params['PathPrefix'] = path_prefix if marker: params['Marker'] = marker if max_items: params['MaxItems'] = max_items return self.get_response('ListServerCertificates', params...
def get_all_server_certs(self, path_prefix='/', marker=None, max_items=None)
Lists the server certificates that have the specified path prefix. If none exist, the action returns an empty list. :type path_prefix: string :param path_prefix: If provided, only certificates whose paths match the provided prefix will be returned. :type mar...
2.116284
2.491981
0.849238
params = {'ServerCertificateName' : cert_name} if new_cert_name: params['NewServerCertificateName'] = new_cert_name if new_path: params['NewPath'] = new_path return self.get_response('UpdateServerCertificate', params)
def update_server_cert(self, cert_name, new_cert_name=None, new_path=None)
Updates the name and/or the path of the specified server certificate. :type cert_name: string :param cert_name: The name of the server certificate that you want to update. :type new_cert_name: string :param new_cert_name: The new name for the server certificat...
1.918674
2.338095
0.820614
params = {'ServerCertificateName' : cert_name, 'CertificateBody' : cert_body, 'PrivateKey' : private_key} if cert_chain: params['CertificateChain'] = cert_chain if path: params['Path'] = path return self.get_response('U...
def upload_server_cert(self, cert_name, cert_body, private_key, cert_chain=None, path=None)
Uploads a server certificate entity for the AWS Account. The server certificate entity includes a public key certificate, a private key, and an optional certificate chain, which should all be PEM-encoded. :type cert_name: string :param cert_name: The name for the server certific...
1.935006
2.275405
0.8504
params = {'UserName' : user_name} if marker: params['Marker'] = marker if max_items: params['MaxItems'] = max_items return self.get_response('ListMFADevices', params, list_marker='MFADevices')
def get_all_mfa_devices(self, user_name, marker=None, max_items=None)
Get all MFA devices associated with an account. :type user_name: string :param user_name: The username of the user :type marker: string :param marker: Use this only when paginating results and only in follow-up request after you've received a response ...
2.33109
2.974952
0.783572
params = {'UserName' : user_name, 'SerialNumber' : serial_number, 'AuthenticationCode1' : auth_code_1, 'AuthenticationCode2' : auth_code_2} return self.get_response('EnableMFADevice', params)
def enable_mfa_device(self, user_name, serial_number, auth_code_1, auth_code_2)
Enables the specified MFA device and associates it with the specified user. :type user_name: string :param user_name: The username of the user :type serial_number: string :param seriasl_number: The serial number which uniquely identifies t...
1.887713
2.341184
0.806307
params = {'UserName' : user_name, 'SerialNumber' : serial_number} return self.get_response('DeactivateMFADevice', params)
def deactivate_mfa_device(self, user_name, serial_number)
Deactivates the specified MFA device and removes it from association with the user. :type user_name: string :param user_name: The username of the user :type serial_number: string :param seriasl_number: The serial number which uniquely identifies ...
2.614427
4.012882
0.651509
params = {'UserName' : user_name, 'SerialNumber' : serial_number, 'AuthenticationCode1' : auth_code_1, 'AuthenticationCode2' : auth_code_2} return self.get_response('ResyncMFADevice', params)
def resync_mfa_device(self, user_name, serial_number, auth_code_1, auth_code_2)
Syncronizes the specified MFA device with the AWS servers. :type user_name: string :param user_name: The username of the user :type serial_number: string :param seriasl_number: The serial number which uniquely identifies the MFA device. :...
1.980558
2.264293
0.874692
params = {'UserName' : user_name, 'Password' : password} return self.get_response('CreateLoginProfile', params)
def create_login_profile(self, user_name, password)
Creates a login profile for the specified user, give the user the ability to access AWS services and the AWS Management Console. :type user_name: string :param user_name: The name of the user :type password: string :param password: The new password for the user
3.513637
4.818176
0.729246
params = {'UserName' : user_name, 'Password' : password} return self.get_response('UpdateLoginProfile', params)
def update_login_profile(self, user_name, password)
Resets the password associated with the user's login profile. :type user_name: string :param user_name: The name of the user :type password: string :param password: The new password for the user
3.71808
5.796821
0.6414
alias = self.get_account_alias() if not alias: raise Exception('No alias associated with this account. Please use iam.create_account_alias() first.') return "https://%s.signin.aws.amazon.com/console/%s" % (alias, service)
def get_signin_url(self, service='ec2')
Get the URL where IAM users can use their login profile to sign in to this account's console. :type service: string :param service: Default service to go to in the console.
3.914429
4.019615
0.973832
if self.iter == None: self.iter = iter(self.objs) try: return self.iter.next() except StopIteration: self.iter = None self.objs = [] if int(self.page) < int(self.total_pages): self.page += 1 self...
def next(self)
Special paging functionality
3.050982
2.95974
1.030828
"Read exactly length bytes from file; raise EOFError if file ends sooner." data = file.read(length) if len(data) != length: raise EOFError return data
def xread(file, length)
Read exactly length bytes from file; raise EOFError if file ends sooner.
5.033806
2.830117
1.778656
"Open filename, or do nothing if filename is already an open file object" if isinstance(filename, str): file = open(filename, mode) try: yield file finally: if not file.closed: file.close() else: yield filename
def opened(filename, mode)
Open filename, or do nothing if filename is already an open file object
4.335226
3.025917
1.432698
interrupted = False def sigint_handler(signum, frame): nonlocal interrupted interrupted = True s = signal.signal(signal.SIGINT, sigint_handler) try: yield None finally: signal.signal(signal.SIGINT, s) if interrupted: raise KeyboardInterrupt()
def suppress_interrupt()
Suppress KeyboardInterrupt exceptions while the context is active. The suppressed interrupt (if any) is raised when the context is exited.
2.326559
2.347431
0.991108
with suppress_interrupt(): _replace_chunk(filename, offset, length, chunk, in_place, max_mem)
def replace_chunk(filename, offset, length, chunk, in_place=True, max_mem=5)
Replace length bytes of data with chunk, starting at offset. Any KeyboardInterrupts arriving while replace_chunk is runnning are deferred until the operation is complete. If in_place is true, the operation works directly on the original file; this is fast and works on files that are already open, but ...
4.798018
4.821499
0.99513
"Copy length bytes from file src to file dst." BUFSIZE = 128 * 1024 while length > 0: l = min(BUFSIZE, length) buf = src.read(l) assert len(buf) == l dst.write(buf) length -= l
def _copy_chunk(src, dst, length)
Copy length bytes from file src to file dst.
2.846197
2.886781
0.985941
if self._closed: raise RuntimeError('Symbolizer is closed') dsym_path = normalize_dsym_path(dsym_path) image_vmaddr = parse_addr(image_vmaddr) if not image_vmaddr: di = self._symbolizer.get_debug_info(dsym_path) if di is not None: ...
def symbolize(self, dsym_path, image_vmaddr, image_addr, instruction_addr, cpu_name, symbolize_inlined=False)
Symbolizes a single frame based on the information provided. If the symbolication fails a `SymbolicationError` is raised. `dsym_path` is the path to the dsym file on the file system. `image_vmaddr` is the slide of the image. For most situations this can just be set to `0`. If it's ze...
2.543019
2.544807
0.999297
s = p.split(six.u('==')) if len(s) == 1: return (to_text(s[0]), None) else: return (to_text(s[0]), to_text(s[1]))
def split_package_name(p)
Splits the given package name and returns a tuple (name, ver).
3.021079
2.774391
1.088916
return self.get_key(key_name, headers=headers, callback=callback)
def lookup(self, key_name, headers=None, callback=None)
Deprecated: Please use get_key method. :type key_name: string :param key_name: The name of the key to retrieve :rtype: :class:`boto.s3.key.Key` :returns: A Key object from this bucket.
3.957809
4.488911
0.881686
return self._get_all([('Contents', self.key_class), ('CommonPrefixes', boto.s3.prefix.Prefix)], '', headers, callback=callback, **params)
def get_all_keys(self, headers=None, callback=None, **params)
A lower-level method for listing contents of a bucket. This closely models the actual S3 API and requires you to manually handle the paging of results. For a higher-level method that handles the details of paging for you, you can use the list method. :type max_keys: int ...
7.119027
7.859535
0.905782
provider = self.connection.provider if version_id: query_args = 'versionId=%s' % version_id else: query_args = None if mfa_token: if not headers: headers = {} headers[provider.mfa_header] = ' '.join(mfa_token) ...
def delete_key(self, key_name, headers=None, version_id=None, mfa_token=None, callback=None)
Deletes a key from the bucket. If a version_id is provided, only that version of the key will be deleted. :type key_name: string :param key_name: The key name to delete :type version_id: string :param version_id: The version ID (optional) :type mfa_tok...
2.449094
2.484283
0.985835
headers = {'X-Amz-Target' : '%s_%s.%s' % (self.ServiceName, self.Version, action), 'Content-Type' : 'application/x-amz-json-1.0', 'Content-Length' : str(len(body))} http_request = self.build_base_http_reques...
def make_request(self, action, body='', object_hook=None)
:raises: ``DynamoDBExpiredTokenError`` if the security token expires.
2.70706
2.724844
0.993474
data = {} if limit: data['Limit'] = limit if start_table: data['ExclusiveStartTableName'] = start_table json_input = json.dumps(data) return self.make_request('ListTables', json_input)
def list_tables(self, limit=None, start_table=None)
Return a list of table names associated with the current account and endpoint. :type limit: int :param limit: The maximum number of tables to return. :type start_table: str :param limit: The name of the table that starts the list. If you ran a previous list_tables ...
2.968919
2.901663
1.023178
data = {'TableName' : table_name} json_input = json.dumps(data) return self.make_request('DescribeTable', json_input)
def describe_table(self, table_name)
Returns information about the table including current state of the table, primary key schema and when the table was created. :type table_name: str :param table_name: The name of the table to describe.
4.155334
4.896416
0.848648
data = {'TableName' : table_name, 'KeySchema' : schema, 'ProvisionedThroughput': provisioned_throughput} json_input = json.dumps(data) response_dict = self.make_request('CreateTable', json_input) return response_dict
def create_table(self, table_name, schema, provisioned_throughput)
Add a new table to your account. The table name must be unique among those associated with the account issuing the request. This request triggers an asynchronous workflow to begin creating the table. When the workflow is complete, the state of the table will be ACTIVE. :type t...
2.689213
3.193861
0.841995
data = {'TableName': table_name, 'ProvisionedThroughput': provisioned_throughput} json_input = json.dumps(data) return self.make_request('UpdateTable', json_input)
def update_table(self, table_name, provisioned_throughput)
Updates the provisioned throughput for a given table. :type table_name: str :param table_name: The name of the table to update. :type provisioned_throughput: dict :param provisioned_throughput: A Python version of the ProvisionedThroughput data structure def...
2.677569
3.414328
0.784215
data = {'TableName': table_name} json_input = json.dumps(data) return self.make_request('DeleteTable', json_input)
def delete_table(self, table_name)
Deletes the table and all of it's data. After this request the table will be in the DELETING state until DynamoDB completes the delete operation. :type table_name: str :param table_name: The name of the table to delete.
3.778259
4.415109
0.855757
data = {'TableName': table_name, 'Key': key} if attributes_to_get: data['AttributesToGet'] = attributes_to_get if consistent_read: data['ConsistentRead'] = True json_input = json.dumps(data) response = self.make_request('GetItem', ...
def get_item(self, table_name, key, attributes_to_get=None, consistent_read=False, object_hook=None)
Return a set of attributes for an item that matches the supplied key. :type table_name: str :param table_name: The name of the table containing the item. :type key: dict :param key: A Python version of the Key data structure defined by DynamoDB. :type attri...
2.236933
2.603586
0.859174
data = {'RequestItems' : request_items} json_input = json.dumps(data) return self.make_request('BatchGetItem', json_input, object_hook=object_hook)
def batch_get_item(self, request_items, object_hook=None)
Return a set of attributes for a multiple items in multiple tables using their primary keys. :type request_items: dict :param request_items: A Python version of the RequestItems data structure defined by DynamoDB.
3.374149
4.709072
0.716521
data = {'TableName' : table_name, 'Item' : item} if expected: data['Expected'] = expected if return_values: data['ReturnValues'] = return_values json_input = json.dumps(data) return self.make_request('PutItem', json_input, ...
def put_item(self, table_name, item, expected=None, return_values=None, object_hook=None)
Create a new item or replace an old item with a new item (including all attributes). If an item already exists in the specified table with the same primary key, the new item will completely replace the old item. You can perform a conditional put by specifying an expected rule. ...
2.111448
2.899376
0.728242