desc
stringlengths
3
26.7k
decl
stringlengths
11
7.89k
bodies
stringlengths
8
553k
'DEPRECATED: Marks an ``Item`` instance as needing to be saved. This method is no longer necessary, as the state tracking on ``Item`` has been improved to automatically detect proper state.'
def mark_dirty(self):
return
'This is only useful when being handed raw data from DynamoDB directly. If you have a Python datastructure already, use the ``__init__`` or manually set the data instead. Largely internal, unless you know what you\'re doing or are trying to mix the low-level & high-level APIs.'
def load(self, data):
self._data = {} for (field_name, field_value) in data.get('Item', {}).items(): self[field_name] = self._dynamizer.decode(field_value) self._loaded = True self._orig_data = deepcopy(self._data)
'Returns a Python-style dict of the keys/values. Largely internal.'
def get_keys(self):
key_fields = self.table.get_key_fields() key_data = {} for key in key_fields: key_data[key] = self[key] return key_data
'Returns a DynamoDB-style dict of the keys/values. Largely internal.'
def get_raw_keys(self):
raw_key_data = {} for (key, value) in self.get_keys().items(): raw_key_data[key] = self._dynamizer.encode(value) return raw_key_data
'Builds up a list of expecations to hand off to DynamoDB on save. Largely internal.'
def build_expects(self, fields=None):
expects = {} if (fields is None): fields = (list(self._data.keys()) + list(self._orig_data.keys())) fields = set(fields) for key in fields: expects[key] = {'Exists': True} value = None if ((not (key in self._orig_data)) and (not (key in self._data))): raise Va...
'Runs through all fields & encodes them to be handed off to DynamoDB as part of an ``save`` (``put_item``) call. Largely internal.'
def prepare_full(self):
final_data = {} for (key, value) in self._data.items(): if (not self._is_storable(value)): continue final_data[key] = self._dynamizer.encode(value) return final_data
'Runs through **ONLY** the changed/deleted fields & encodes them to be handed off to DynamoDB as part of an ``partial_save`` (``update_item``) call. Largely internal.'
def prepare_partial(self):
final_data = {} fields = set() alterations = self._determine_alterations() for (key, value) in alterations['adds'].items(): final_data[key] = {'Action': 'PUT', 'Value': self._dynamizer.encode(self._data[key])} fields.add(key) for (key, value) in alterations['changes'].items(): ...
'Saves only the changed data to DynamoDB. Extremely useful for high-volume/high-write data sets, this allows you to update only a handful of fields rather than having to push entire items. This prevents many accidental overwrite situations as well as saves on the amount of data to transfer over the wire. Returns ``True...
def partial_save(self):
key = self.get_keys() (final_data, fields) = self.prepare_partial() if (not final_data): return False for (fieldname, value) in key.items(): if (fieldname in final_data): del final_data[fieldname] try: fields.remove(fieldname) except Ke...
'Saves all data to DynamoDB. By default, this attempts to ensure that none of the underlying data has changed. If any fields have changed in between when the ``Item`` was constructed & when it is saved, this call will fail so as not to cause any data loss. If you\'re sure possibly overwriting data is acceptable, you ca...
def save(self, overwrite=False):
if ((not self.needs_save()) and (not overwrite)): return False final_data = self.prepare_full() expects = None if (overwrite is False): expects = self.build_expects() returned = self.table._put_item(final_data, expects=expects) self.mark_clean() return returned
'Deletes the item\'s data to DynamoDB. Returns ``True`` on success. Example:: # Buh-bye now. >>> user.delete()'
def delete(self):
key_data = self.get_keys() return self.table.delete_item(**key_data)
'Resets the internal state of the ``ResultSet``. This prevents results from being cached long-term & consuming excess memory. Largely internal.'
def _reset(self):
self._results = [] self._offset = 0
'Sets up the callable & any arguments to run it with. This is stored for subsequent calls so that those queries can be run without requiring user intervention. Example:: # Just an example callable. >>> def squares_to(y): ... for x in range(1, y): ... yield x**2 >>> rs = ResultSet() # Set up what to call & a...
def to_call(self, the_callable, *args, **kwargs):
if (not callable(the_callable)): raise ValueError('You must supply an object or function to be called.') self._limit = kwargs.pop('limit', None) if ((self._limit is not None) and (self._limit < 0)): self._limit = None self.the_callable = the_callable self.c...
'When the iterator runs out of results, this method is run to re-execute the callable (& arguments) to fetch the next page. Largely internal.'
def fetch_more(self):
self._reset() args = self.call_args[:] kwargs = self.call_kwargs.copy() if (self._last_key_seen is not None): kwargs[self.first_key] = self._last_key_seen if (self._limit and self._max_page_size and (self._max_page_size > self._limit)): self._max_page_size = self._limit if (self....
'Adds an inbound (ingress) rule to an Amazon Redshift security group. Depending on whether the application accessing your cluster is running on the Internet or an EC2 instance, you can authorize inbound access to either a Classless Interdomain Routing (CIDR) IP address range or an EC2 security group. You can add as man...
def authorize_cluster_security_group_ingress(self, cluster_security_group_name, cidrip=None, ec2_security_group_name=None, ec2_security_group_owner_id=None):
params = {'ClusterSecurityGroupName': cluster_security_group_name} if (cidrip is not None): params['CIDRIP'] = cidrip if (ec2_security_group_name is not None): params['EC2SecurityGroupName'] = ec2_security_group_name if (ec2_security_group_owner_id is not None): params['EC2Securi...
'Authorizes the specified AWS customer account to restore the specified snapshot. For more information about working with snapshots, go to `Amazon Redshift Snapshots`_ in the Amazon Redshift Management Guide . :type snapshot_identifier: string :param snapshot_identifier: The identifier of the snapshot the account is au...
def authorize_snapshot_access(self, snapshot_identifier, account_with_restore_access, snapshot_cluster_identifier=None):
params = {'SnapshotIdentifier': snapshot_identifier, 'AccountWithRestoreAccess': account_with_restore_access} if (snapshot_cluster_identifier is not None): params['SnapshotClusterIdentifier'] = snapshot_cluster_identifier return self._make_request(action='AuthorizeSnapshotAccess', verb='POST', path=...
'Copies the specified automated cluster snapshot to a new manual cluster snapshot. The source must be an automated snapshot and it must be in the available state. When you delete a cluster, Amazon Redshift deletes any automated snapshots of the cluster. Also, when the retention period of the snapshot expires, Amazon Re...
def copy_cluster_snapshot(self, source_snapshot_identifier, target_snapshot_identifier, source_snapshot_cluster_identifier=None):
params = {'SourceSnapshotIdentifier': source_snapshot_identifier, 'TargetSnapshotIdentifier': target_snapshot_identifier} if (source_snapshot_cluster_identifier is not None): params['SourceSnapshotClusterIdentifier'] = source_snapshot_cluster_identifier return self._make_request(action='CopyClusterS...
'Creates a new cluster. To create the cluster in virtual private cloud (VPC), you must provide cluster subnet group name. If you don\'t provide a cluster subnet group name or the cluster security group parameter, Amazon Redshift creates a non-VPC cluster, it associates the default cluster security group with the cluste...
def create_cluster(self, cluster_identifier, node_type, master_username, master_user_password, db_name=None, cluster_type=None, cluster_security_groups=None, vpc_security_group_ids=None, cluster_subnet_group_name=None, availability_zone=None, preferred_maintenance_window=None, cluster_parameter_group_name=None, automat...
params = {'ClusterIdentifier': cluster_identifier, 'NodeType': node_type, 'MasterUsername': master_username, 'MasterUserPassword': master_user_password} if (db_name is not None): params['DBName'] = db_name if (cluster_type is not None): params['ClusterType'] = cluster_type if (cluster_se...
'Creates an Amazon Redshift parameter group. Creating parameter groups is independent of creating clusters. You can associate a cluster with a parameter group when you create the cluster. You can also associate an existing cluster with a parameter group after the cluster is created by using ModifyCluster. Parameters in...
def create_cluster_parameter_group(self, parameter_group_name, parameter_group_family, description):
params = {'ParameterGroupName': parameter_group_name, 'ParameterGroupFamily': parameter_group_family, 'Description': description} return self._make_request(action='CreateClusterParameterGroup', verb='POST', path='/', params=params)
'Creates a new Amazon Redshift security group. You use security groups to control access to non-VPC clusters. For information about managing security groups, go to `Amazon Redshift Cluster Security Groups`_ in the Amazon Redshift Management Guide . :type cluster_security_group_name: string :param cluster_security_group...
def create_cluster_security_group(self, cluster_security_group_name, description):
params = {'ClusterSecurityGroupName': cluster_security_group_name, 'Description': description} return self._make_request(action='CreateClusterSecurityGroup', verb='POST', path='/', params=params)
'Creates a manual snapshot of the specified cluster. The cluster must be in the `available` state. For more information about working with snapshots, go to `Amazon Redshift Snapshots`_ in the Amazon Redshift Management Guide . :type snapshot_identifier: string :param snapshot_identifier: A unique identifier for the sna...
def create_cluster_snapshot(self, snapshot_identifier, cluster_identifier):
params = {'SnapshotIdentifier': snapshot_identifier, 'ClusterIdentifier': cluster_identifier} return self._make_request(action='CreateClusterSnapshot', verb='POST', path='/', params=params)
'Creates a new Amazon Redshift subnet group. You must provide a list of one or more subnets in your existing Amazon Virtual Private Cloud (Amazon VPC) when creating Amazon Redshift subnet group. For information about subnet groups, go to `Amazon Redshift Cluster Subnet Groups`_ in the Amazon Redshift Management Guide ....
def create_cluster_subnet_group(self, cluster_subnet_group_name, description, subnet_ids):
params = {'ClusterSubnetGroupName': cluster_subnet_group_name, 'Description': description} self.build_list_params(params, subnet_ids, 'SubnetIds.member') return self._make_request(action='CreateClusterSubnetGroup', verb='POST', path='/', params=params)
'Creates an Amazon Redshift event notification subscription. This action requires an ARN (Amazon Resource Name) of an Amazon SNS topic created by either the Amazon Redshift console, the Amazon SNS console, or the Amazon SNS API. To obtain an ARN with Amazon SNS, you must create a topic in Amazon SNS and subscribe to th...
def create_event_subscription(self, subscription_name, sns_topic_arn, source_type=None, source_ids=None, event_categories=None, severity=None, enabled=None):
params = {'SubscriptionName': subscription_name, 'SnsTopicArn': sns_topic_arn} if (source_type is not None): params['SourceType'] = source_type if (source_ids is not None): self.build_list_params(params, source_ids, 'SourceIds.member') if (event_categories is not None): self.buil...
'Creates an HSM client certificate that an Amazon Redshift cluster will use to connect to the client\'s HSM in order to store and retrieve the keys used to encrypt the cluster databases. The command returns a public key, which you must store in the HSM. In addition to creating the HSM certificate, you must create an Am...
def create_hsm_client_certificate(self, hsm_client_certificate_identifier):
params = {'HsmClientCertificateIdentifier': hsm_client_certificate_identifier} return self._make_request(action='CreateHsmClientCertificate', verb='POST', path='/', params=params)
'Creates an HSM configuration that contains the information required by an Amazon Redshift cluster to store and use database encryption keys in a Hardware Security Module (HSM). After creating the HSM configuration, you can specify it as a parameter when creating a cluster. The cluster will then store its encryption ke...
def create_hsm_configuration(self, hsm_configuration_identifier, description, hsm_ip_address, hsm_partition_name, hsm_partition_password, hsm_server_public_certificate):
params = {'HsmConfigurationIdentifier': hsm_configuration_identifier, 'Description': description, 'HsmIpAddress': hsm_ip_address, 'HsmPartitionName': hsm_partition_name, 'HsmPartitionPassword': hsm_partition_password, 'HsmServerPublicCertificate': hsm_server_public_certificate} return self._make_request(action=...
'Deletes a previously provisioned cluster. A successful response from the web service indicates that the request was received correctly. If a final cluster snapshot is requested the status of the cluster will be "final-snapshot" while the snapshot is being taken, then it\'s "deleting" once Amazon Redshift begins deleti...
def delete_cluster(self, cluster_identifier, skip_final_cluster_snapshot=None, final_cluster_snapshot_identifier=None):
params = {'ClusterIdentifier': cluster_identifier} if (skip_final_cluster_snapshot is not None): params['SkipFinalClusterSnapshot'] = str(skip_final_cluster_snapshot).lower() if (final_cluster_snapshot_identifier is not None): params['FinalClusterSnapshotIdentifier'] = final_cluster_snapshot...
'Deletes a specified Amazon Redshift parameter group. :type parameter_group_name: string :param parameter_group_name: The name of the parameter group to be deleted. Constraints: + Must be the name of an existing cluster parameter group. + Cannot delete a default cluster parameter group.'
def delete_cluster_parameter_group(self, parameter_group_name):
params = {'ParameterGroupName': parameter_group_name} return self._make_request(action='DeleteClusterParameterGroup', verb='POST', path='/', params=params)
'Deletes an Amazon Redshift security group. For information about managing security groups, go to `Amazon Redshift Cluster Security Groups`_ in the Amazon Redshift Management Guide . :type cluster_security_group_name: string :param cluster_security_group_name: The name of the cluster security group to be deleted.'
def delete_cluster_security_group(self, cluster_security_group_name):
params = {'ClusterSecurityGroupName': cluster_security_group_name} return self._make_request(action='DeleteClusterSecurityGroup', verb='POST', path='/', params=params)
'Deletes the specified manual snapshot. The snapshot must be in the `available` state, with no other users authorized to access the snapshot. Unlike automated snapshots, manual snapshots are retained even after you delete your cluster. Amazon Redshift does not delete your manual snapshots. You must delete manual snapsh...
def delete_cluster_snapshot(self, snapshot_identifier, snapshot_cluster_identifier=None):
params = {'SnapshotIdentifier': snapshot_identifier} if (snapshot_cluster_identifier is not None): params['SnapshotClusterIdentifier'] = snapshot_cluster_identifier return self._make_request(action='DeleteClusterSnapshot', verb='POST', path='/', params=params)
'Deletes the specified cluster subnet group. :type cluster_subnet_group_name: string :param cluster_subnet_group_name: The name of the cluster subnet group name to be deleted.'
def delete_cluster_subnet_group(self, cluster_subnet_group_name):
params = {'ClusterSubnetGroupName': cluster_subnet_group_name} return self._make_request(action='DeleteClusterSubnetGroup', verb='POST', path='/', params=params)
'Deletes an Amazon Redshift event notification subscription. :type subscription_name: string :param subscription_name: The name of the Amazon Redshift event notification subscription to be deleted.'
def delete_event_subscription(self, subscription_name):
params = {'SubscriptionName': subscription_name} return self._make_request(action='DeleteEventSubscription', verb='POST', path='/', params=params)
'Deletes the specified HSM client certificate. :type hsm_client_certificate_identifier: string :param hsm_client_certificate_identifier: The identifier of the HSM client certificate to be deleted.'
def delete_hsm_client_certificate(self, hsm_client_certificate_identifier):
params = {'HsmClientCertificateIdentifier': hsm_client_certificate_identifier} return self._make_request(action='DeleteHsmClientCertificate', verb='POST', path='/', params=params)
'Deletes the specified Amazon Redshift HSM configuration. :type hsm_configuration_identifier: string :param hsm_configuration_identifier: The identifier of the Amazon Redshift HSM configuration to be deleted.'
def delete_hsm_configuration(self, hsm_configuration_identifier):
params = {'HsmConfigurationIdentifier': hsm_configuration_identifier} return self._make_request(action='DeleteHsmConfiguration', verb='POST', path='/', params=params)
'Returns a list of Amazon Redshift parameter groups, including parameter groups you created and the default parameter group. For each parameter group, the response includes the parameter group name, description, and parameter group family name. You can optionally specify a name to retrieve the description of a specific...
def describe_cluster_parameter_groups(self, parameter_group_name=None, max_records=None, marker=None):
params = {} if (parameter_group_name is not None): params['ParameterGroupName'] = parameter_group_name if (max_records is not None): params['MaxRecords'] = max_records if (marker is not None): params['Marker'] = marker return self._make_request(action='DescribeClusterParamete...
'Returns a detailed list of parameters contained within the specified Amazon Redshift parameter group. For each parameter the response includes information such as parameter name, description, data type, value, whether the parameter value is modifiable, and so on. You can specify source filter to retrieve parameters of...
def describe_cluster_parameters(self, parameter_group_name, source=None, max_records=None, marker=None):
params = {'ParameterGroupName': parameter_group_name} if (source is not None): params['Source'] = source if (max_records is not None): params['MaxRecords'] = max_records if (marker is not None): params['Marker'] = marker return self._make_request(action='DescribeClusterParame...
'Returns information about Amazon Redshift security groups. If the name of a security group is specified, the response will contain only information about only that security group. For information about managing security groups, go to `Amazon Redshift Cluster Security Groups`_ in the Amazon Redshift Management Guide . ...
def describe_cluster_security_groups(self, cluster_security_group_name=None, max_records=None, marker=None):
params = {} if (cluster_security_group_name is not None): params['ClusterSecurityGroupName'] = cluster_security_group_name if (max_records is not None): params['MaxRecords'] = max_records if (marker is not None): params['Marker'] = marker return self._make_request(action='Des...
'Returns one or more snapshot objects, which contain metadata about your cluster snapshots. By default, this operation returns information about all snapshots of all clusters that are owned by you AWS customer account. No information is returned for snapshots owned by inactive AWS customer accounts. :type cluster_ident...
def describe_cluster_snapshots(self, cluster_identifier=None, snapshot_identifier=None, snapshot_type=None, start_time=None, end_time=None, max_records=None, marker=None, owner_account=None):
params = {} if (cluster_identifier is not None): params['ClusterIdentifier'] = cluster_identifier if (snapshot_identifier is not None): params['SnapshotIdentifier'] = snapshot_identifier if (snapshot_type is not None): params['SnapshotType'] = snapshot_type if (start_time is ...
'Returns one or more cluster subnet group objects, which contain metadata about your cluster subnet groups. By default, this operation returns information about all cluster subnet groups that are defined in you AWS account. :type cluster_subnet_group_name: string :param cluster_subnet_group_name: The name of the cluste...
def describe_cluster_subnet_groups(self, cluster_subnet_group_name=None, max_records=None, marker=None):
params = {} if (cluster_subnet_group_name is not None): params['ClusterSubnetGroupName'] = cluster_subnet_group_name if (max_records is not None): params['MaxRecords'] = max_records if (marker is not None): params['Marker'] = marker return self._make_request(action='DescribeC...
'Returns descriptions of the available Amazon Redshift cluster versions. You can call this operation even before creating any clusters to learn more about the Amazon Redshift versions. For more information about managing clusters, go to `Amazon Redshift Clusters`_ in the Amazon Redshift Management Guide :type cluster_v...
def describe_cluster_versions(self, cluster_version=None, cluster_parameter_group_family=None, max_records=None, marker=None):
params = {} if (cluster_version is not None): params['ClusterVersion'] = cluster_version if (cluster_parameter_group_family is not None): params['ClusterParameterGroupFamily'] = cluster_parameter_group_family if (max_records is not None): params['MaxRecords'] = max_records if...
'Returns properties of provisioned clusters including general cluster properties, cluster database properties, maintenance and backup properties, and security and access properties. This operation supports pagination. For more information about managing clusters, go to `Amazon Redshift Clusters`_ in the Amazon Redshift...
def describe_clusters(self, cluster_identifier=None, max_records=None, marker=None):
params = {} if (cluster_identifier is not None): params['ClusterIdentifier'] = cluster_identifier if (max_records is not None): params['MaxRecords'] = max_records if (marker is not None): params['Marker'] = marker return self._make_request(action='DescribeClusters', verb='POS...
'Returns a list of parameter settings for the specified parameter group family. For more information about managing parameter groups, go to `Amazon Redshift Parameter Groups`_ in the Amazon Redshift Management Guide . :type parameter_group_family: string :param parameter_group_family: The name of the cluster parameter ...
def describe_default_cluster_parameters(self, parameter_group_family, max_records=None, marker=None):
params = {'ParameterGroupFamily': parameter_group_family} if (max_records is not None): params['MaxRecords'] = max_records if (marker is not None): params['Marker'] = marker return self._make_request(action='DescribeDefaultClusterParameters', verb='POST', path='/', params=params)
'Displays a list of event categories for all event source types, or for a specified source type. For a list of the event categories and source types, go to `Amazon Redshift Event Notifications`_. :type source_type: string :param source_type: The source type, such as cluster or parameter group, to which the described ev...
def describe_event_categories(self, source_type=None):
params = {} if (source_type is not None): params['SourceType'] = source_type return self._make_request(action='DescribeEventCategories', verb='POST', path='/', params=params)
'Lists descriptions of all the Amazon Redshift event notifications subscription for a customer account. If you specify a subscription name, lists the description for that subscription. :type subscription_name: string :param subscription_name: The name of the Amazon Redshift event notification subscription to be describ...
def describe_event_subscriptions(self, subscription_name=None, max_records=None, marker=None):
params = {} if (subscription_name is not None): params['SubscriptionName'] = subscription_name if (max_records is not None): params['MaxRecords'] = max_records if (marker is not None): params['Marker'] = marker return self._make_request(action='DescribeEventSubscriptions', ve...
'Returns events related to clusters, security groups, snapshots, and parameter groups for the past 14 days. Events specific to a particular cluster, security group, snapshot or parameter group can be obtained by providing the name as a parameter. By default, the past hour of events are returned. :type source_identifier...
def describe_events(self, source_identifier=None, source_type=None, start_time=None, end_time=None, duration=None, max_records=None, marker=None):
params = {} if (source_identifier is not None): params['SourceIdentifier'] = source_identifier if (source_type is not None): params['SourceType'] = source_type if (start_time is not None): params['StartTime'] = start_time if (end_time is not None): params['EndTime'] =...
'Returns information about the specified HSM client certificate. If no certificate ID is specified, returns information about all the HSM certificates owned by your AWS customer account. :type hsm_client_certificate_identifier: string :param hsm_client_certificate_identifier: The identifier of a specific HSM client cer...
def describe_hsm_client_certificates(self, hsm_client_certificate_identifier=None, max_records=None, marker=None):
params = {} if (hsm_client_certificate_identifier is not None): params['HsmClientCertificateIdentifier'] = hsm_client_certificate_identifier if (max_records is not None): params['MaxRecords'] = max_records if (marker is not None): params['Marker'] = marker return self._make_r...
'Returns information about the specified Amazon Redshift HSM configuration. If no configuration ID is specified, returns information about all the HSM configurations owned by your AWS customer account. :type hsm_configuration_identifier: string :param hsm_configuration_identifier: The identifier of a specific Amazon Re...
def describe_hsm_configurations(self, hsm_configuration_identifier=None, max_records=None, marker=None):
params = {} if (hsm_configuration_identifier is not None): params['HsmConfigurationIdentifier'] = hsm_configuration_identifier if (max_records is not None): params['MaxRecords'] = max_records if (marker is not None): params['Marker'] = marker return self._make_request(action=...
'Describes whether information, such as queries and connection attempts, is being logged for the specified Amazon Redshift cluster. :type cluster_identifier: string :param cluster_identifier: The identifier of the cluster to get the logging status from. Example: `examplecluster`'
def describe_logging_status(self, cluster_identifier):
params = {'ClusterIdentifier': cluster_identifier} return self._make_request(action='DescribeLoggingStatus', verb='POST', path='/', params=params)
'Returns a list of orderable cluster options. Before you create a new cluster you can use this operation to find what options are available, such as the EC2 Availability Zones (AZ) in the specific AWS region that you can specify, and the node types you can request. The node types differ by available storage, memory, CP...
def describe_orderable_cluster_options(self, cluster_version=None, node_type=None, max_records=None, marker=None):
params = {} if (cluster_version is not None): params['ClusterVersion'] = cluster_version if (node_type is not None): params['NodeType'] = node_type if (max_records is not None): params['MaxRecords'] = max_records if (marker is not None): params['Marker'] = marker ...
'Returns a list of the available reserved node offerings by Amazon Redshift with their descriptions including the node type, the fixed and recurring costs of reserving the node and duration the node will be reserved for you. These descriptions help you determine which reserve node offering you want to purchase. You the...
def describe_reserved_node_offerings(self, reserved_node_offering_id=None, max_records=None, marker=None):
params = {} if (reserved_node_offering_id is not None): params['ReservedNodeOfferingId'] = reserved_node_offering_id if (max_records is not None): params['MaxRecords'] = max_records if (marker is not None): params['Marker'] = marker return self._make_request(action='DescribeR...
'Returns the descriptions of the reserved nodes. :type reserved_node_id: string :param reserved_node_id: Identifier for the node reservation. :type max_records: integer :param max_records: The maximum number of response records to return in each call. If the number of remaining response records exceeds the specified `M...
def describe_reserved_nodes(self, reserved_node_id=None, max_records=None, marker=None):
params = {} if (reserved_node_id is not None): params['ReservedNodeId'] = reserved_node_id if (max_records is not None): params['MaxRecords'] = max_records if (marker is not None): params['Marker'] = marker return self._make_request(action='DescribeReservedNodes', verb='POST'...
'Returns information about the last resize operation for the specified cluster. If no resize operation has ever been initiated for the specified cluster, a `HTTP 404` error is returned. If a resize operation was initiated and completed, the status of the resize remains as `SUCCEEDED` until the next resize. A resize ope...
def describe_resize(self, cluster_identifier):
params = {'ClusterIdentifier': cluster_identifier} return self._make_request(action='DescribeResize', verb='POST', path='/', params=params)
'Stops logging information, such as queries and connection attempts, for the specified Amazon Redshift cluster. :type cluster_identifier: string :param cluster_identifier: The identifier of the cluster on which logging is to be stopped. Example: `examplecluster`'
def disable_logging(self, cluster_identifier):
params = {'ClusterIdentifier': cluster_identifier} return self._make_request(action='DisableLogging', verb='POST', path='/', params=params)
'Disables the automatic copying of snapshots from one region to another region for a specified cluster. :type cluster_identifier: string :param cluster_identifier: The unique identifier of the source cluster that you want to disable copying of snapshots to a destination region. Constraints: Must be the valid name of an...
def disable_snapshot_copy(self, cluster_identifier):
params = {'ClusterIdentifier': cluster_identifier} return self._make_request(action='DisableSnapshotCopy', verb='POST', path='/', params=params)
'Starts logging information, such as queries and connection attempts, for the specified Amazon Redshift cluster. :type cluster_identifier: string :param cluster_identifier: The identifier of the cluster on which logging is to be started. Example: `examplecluster` :type bucket_name: string :param bucket_name: The name o...
def enable_logging(self, cluster_identifier, bucket_name, s3_key_prefix=None):
params = {'ClusterIdentifier': cluster_identifier, 'BucketName': bucket_name} if (s3_key_prefix is not None): params['S3KeyPrefix'] = s3_key_prefix return self._make_request(action='EnableLogging', verb='POST', path='/', params=params)
'Enables the automatic copy of snapshots from one region to another region for a specified cluster. :type cluster_identifier: string :param cluster_identifier: The unique identifier of the source cluster to copy snapshots from. Constraints: Must be the valid name of an existing cluster that does not already have cross-...
def enable_snapshot_copy(self, cluster_identifier, destination_region, retention_period=None):
params = {'ClusterIdentifier': cluster_identifier, 'DestinationRegion': destination_region} if (retention_period is not None): params['RetentionPeriod'] = retention_period return self._make_request(action='EnableSnapshotCopy', verb='POST', path='/', params=params)
'Modifies the settings for a cluster. For example, you can add another security or parameter group, update the preferred maintenance window, or change the master user password. Resetting a cluster password or modifying the security groups associated with a cluster do not need a reboot. However, modifying a parameter gr...
def modify_cluster(self, cluster_identifier, cluster_type=None, node_type=None, number_of_nodes=None, cluster_security_groups=None, vpc_security_group_ids=None, master_user_password=None, cluster_parameter_group_name=None, automated_snapshot_retention_period=None, preferred_maintenance_window=None, cluster_version=None...
params = {'ClusterIdentifier': cluster_identifier} if (cluster_type is not None): params['ClusterType'] = cluster_type if (node_type is not None): params['NodeType'] = node_type if (number_of_nodes is not None): params['NumberOfNodes'] = number_of_nodes if (cluster_security_g...
'Modifies the parameters of a parameter group. For more information about managing parameter groups, go to `Amazon Redshift Parameter Groups`_ in the Amazon Redshift Management Guide . :type parameter_group_name: string :param parameter_group_name: The name of the parameter group to be modified. :type parameters: list ...
def modify_cluster_parameter_group(self, parameter_group_name, parameters):
params = {'ParameterGroupName': parameter_group_name} self.build_complex_list_params(params, parameters, 'Parameters.member', ('ParameterName', 'ParameterValue', 'Description', 'Source', 'DataType', 'AllowedValues', 'IsModifiable', 'MinimumEngineVersion')) return self._make_request(action='ModifyClusterPara...
'Modifies a cluster subnet group to include the specified list of VPC subnets. The operation replaces the existing list of subnets with the new list of subnets. :type cluster_subnet_group_name: string :param cluster_subnet_group_name: The name of the subnet group to be modified. :type description: string :param descrip...
def modify_cluster_subnet_group(self, cluster_subnet_group_name, subnet_ids, description=None):
params = {'ClusterSubnetGroupName': cluster_subnet_group_name} self.build_list_params(params, subnet_ids, 'SubnetIds.member') if (description is not None): params['Description'] = description return self._make_request(action='ModifyClusterSubnetGroup', verb='POST', path='/', params=params)
'Modifies an existing Amazon Redshift event notification subscription. :type subscription_name: string :param subscription_name: The name of the modified Amazon Redshift event notification subscription. :type sns_topic_arn: string :param sns_topic_arn: The Amazon Resource Name (ARN) of the SNS topic to be used by the e...
def modify_event_subscription(self, subscription_name, sns_topic_arn=None, source_type=None, source_ids=None, event_categories=None, severity=None, enabled=None):
params = {'SubscriptionName': subscription_name} if (sns_topic_arn is not None): params['SnsTopicArn'] = sns_topic_arn if (source_type is not None): params['SourceType'] = source_type if (source_ids is not None): self.build_list_params(params, source_ids, 'SourceIds.member') ...
'Modifies the number of days to retain automated snapshots in the destination region after they are copied from the source region. :type cluster_identifier: string :param cluster_identifier: The unique identifier of the cluster for which you want to change the retention period for automated snapshots that are copied to...
def modify_snapshot_copy_retention_period(self, cluster_identifier, retention_period):
params = {'ClusterIdentifier': cluster_identifier, 'RetentionPeriod': retention_period} return self._make_request(action='ModifySnapshotCopyRetentionPeriod', verb='POST', path='/', params=params)
'Allows you to purchase reserved nodes. Amazon Redshift offers a predefined set of reserved node offerings. You can purchase one of the offerings. You can call the DescribeReservedNodeOfferings API to obtain the available reserved node offerings. You can call this API by providing a specific reserved node offering and ...
def purchase_reserved_node_offering(self, reserved_node_offering_id, node_count=None):
params = {'ReservedNodeOfferingId': reserved_node_offering_id} if (node_count is not None): params['NodeCount'] = node_count return self._make_request(action='PurchaseReservedNodeOffering', verb='POST', path='/', params=params)
'Reboots a cluster. This action is taken as soon as possible. It results in a momentary outage to the cluster, during which the cluster status is set to `rebooting`. A cluster event is created when the reboot is completed. Any pending cluster modifications (see ModifyCluster) are applied at this reboot. For more inform...
def reboot_cluster(self, cluster_identifier):
params = {'ClusterIdentifier': cluster_identifier} return self._make_request(action='RebootCluster', verb='POST', path='/', params=params)
'Sets one or more parameters of the specified parameter group to their default values and sets the source values of the parameters to "engine-default". To reset the entire parameter group specify the ResetAllParameters parameter. For parameter changes to take effect you must reboot any associated clusters. :type parame...
def reset_cluster_parameter_group(self, parameter_group_name, reset_all_parameters=None, parameters=None):
params = {'ParameterGroupName': parameter_group_name} if (reset_all_parameters is not None): params['ResetAllParameters'] = str(reset_all_parameters).lower() if (parameters is not None): self.build_complex_list_params(params, parameters, 'Parameters.member', ('ParameterName', 'ParameterValue...
'Creates a new cluster from a snapshot. Amazon Redshift creates the resulting cluster with the same configuration as the original cluster from which the snapshot was created, except that the new cluster is created with the default cluster security and parameter group. After Amazon Redshift creates the cluster you can u...
def restore_from_cluster_snapshot(self, cluster_identifier, snapshot_identifier, snapshot_cluster_identifier=None, port=None, availability_zone=None, allow_version_upgrade=None, cluster_subnet_group_name=None, publicly_accessible=None, owner_account=None, hsm_client_certificate_identifier=None, hsm_configuration_identi...
params = {'ClusterIdentifier': cluster_identifier, 'SnapshotIdentifier': snapshot_identifier} if (snapshot_cluster_identifier is not None): params['SnapshotClusterIdentifier'] = snapshot_cluster_identifier if (port is not None): params['Port'] = port if (availability_zone is not None): ...
'Revokes an ingress rule in an Amazon Redshift security group for a previously authorized IP range or Amazon EC2 security group. To add an ingress rule, see AuthorizeClusterSecurityGroupIngress. For information about managing security groups, go to `Amazon Redshift Cluster Security Groups`_ in the Amazon Redshift Manag...
def revoke_cluster_security_group_ingress(self, cluster_security_group_name, cidrip=None, ec2_security_group_name=None, ec2_security_group_owner_id=None):
params = {'ClusterSecurityGroupName': cluster_security_group_name} if (cidrip is not None): params['CIDRIP'] = cidrip if (ec2_security_group_name is not None): params['EC2SecurityGroupName'] = ec2_security_group_name if (ec2_security_group_owner_id is not None): params['EC2Securi...
'Removes the ability of the specified AWS customer account to restore the specified snapshot. If the account is currently restoring the snapshot, the restore will run to completion. For more information about working with snapshots, go to `Amazon Redshift Snapshots`_ in the Amazon Redshift Management Guide . :type snap...
def revoke_snapshot_access(self, snapshot_identifier, account_with_restore_access, snapshot_cluster_identifier=None):
params = {'SnapshotIdentifier': snapshot_identifier, 'AccountWithRestoreAccess': account_with_restore_access} if (snapshot_cluster_identifier is not None): params['SnapshotClusterIdentifier'] = snapshot_cluster_identifier return self._make_request(action='RevokeSnapshotAccess', verb='POST', path='/'...
'Rotates the encryption keys for a cluster. :type cluster_identifier: string :param cluster_identifier: The unique identifier of the cluster that you want to rotate the encryption keys for. Constraints: Must be the name of valid cluster that has encryption enabled.'
def rotate_encryption_key(self, cluster_identifier):
params = {'ClusterIdentifier': cluster_identifier} return self._make_request(action='RotateEncryptionKey', verb='POST', path='/', params=params)
'Creates a new log group with the specified name. The name of the log group must be unique within a region for an AWS account. You can create up to 100 log groups per account. You must use the following guidelines when naming a log group: + Log group names can be between 1 and 512 characters long. + Allowed characters ...
def create_log_group(self, log_group_name):
params = {'logGroupName': log_group_name} return self.make_request(action='CreateLogGroup', body=json.dumps(params))
'Creates a new log stream in the specified log group. The name of the log stream must be unique within the log group. There is no limit on the number of log streams that can exist in a log group. You must use the following guidelines when naming a log stream: + Log stream names can be between 1 and 512 characters long....
def create_log_stream(self, log_group_name, log_stream_name):
params = {'logGroupName': log_group_name, 'logStreamName': log_stream_name} return self.make_request(action='CreateLogStream', body=json.dumps(params))
'Deletes the log group with the specified name. Amazon CloudWatch Logs will delete a log group only if there are no log streams and no metric filters associated with the log group. If this condition is not satisfied, the request will fail and the log group will not be deleted. :type log_group_name: string :param log_gr...
def delete_log_group(self, log_group_name):
params = {'logGroupName': log_group_name} return self.make_request(action='DeleteLogGroup', body=json.dumps(params))
'Deletes a log stream and permanently deletes all the archived log events associated with it. :type log_group_name: string :param log_group_name: :type log_stream_name: string :param log_stream_name:'
def delete_log_stream(self, log_group_name, log_stream_name):
params = {'logGroupName': log_group_name, 'logStreamName': log_stream_name} return self.make_request(action='DeleteLogStream', body=json.dumps(params))
'Deletes a metric filter associated with the specified log group. :type log_group_name: string :param log_group_name: :type filter_name: string :param filter_name: The name of the metric filter.'
def delete_metric_filter(self, log_group_name, filter_name):
params = {'logGroupName': log_group_name, 'filterName': filter_name} return self.make_request(action='DeleteMetricFilter', body=json.dumps(params))
':type log_group_name: string :param log_group_name:'
def delete_retention_policy(self, log_group_name):
params = {'logGroupName': log_group_name} return self.make_request(action='DeleteRetentionPolicy', body=json.dumps(params))
'Returns all the log groups that are associated with the AWS account making the request. The list returned in the response is ASCII-sorted by log group name. By default, this operation returns up to 50 log groups. If there are more log groups to list, the response would contain a `nextToken` value in the response body....
def describe_log_groups(self, log_group_name_prefix=None, next_token=None, limit=None):
params = {} if (log_group_name_prefix is not None): params['logGroupNamePrefix'] = log_group_name_prefix if (next_token is not None): params['nextToken'] = next_token if (limit is not None): params['limit'] = limit return self.make_request(action='DescribeLogGroups', body=jso...
'Returns all the log streams that are associated with the specified log group. The list returned in the response is ASCII-sorted by log stream name. By default, this operation returns up to 50 log streams. If there are more log streams to list, the response would contain a `nextToken` value in the response body. You ca...
def describe_log_streams(self, log_group_name, log_stream_name_prefix=None, next_token=None, limit=None):
params = {'logGroupName': log_group_name} if (log_stream_name_prefix is not None): params['logStreamNamePrefix'] = log_stream_name_prefix if (next_token is not None): params['nextToken'] = next_token if (limit is not None): params['limit'] = limit return self.make_request(act...
'Returns all the metrics filters associated with the specified log group. The list returned in the response is ASCII-sorted by filter name. By default, this operation returns up to 50 metric filters. If there are more metric filters to list, the response would contain a `nextToken` value in the response body. You can a...
def describe_metric_filters(self, log_group_name, filter_name_prefix=None, next_token=None, limit=None):
params = {'logGroupName': log_group_name} if (filter_name_prefix is not None): params['filterNamePrefix'] = filter_name_prefix if (next_token is not None): params['nextToken'] = next_token if (limit is not None): params['limit'] = limit return self.make_request(action='Descri...
'Retrieves log events from the specified log stream. You can provide an optional time range to filter the results on the event `timestamp`. By default, this operation returns as much log events as can fit in a response size of 1MB, up to 10,000 log events. The response will always include a `nextForwardToken` and a `ne...
def get_log_events(self, log_group_name, log_stream_name, start_time=None, end_time=None, next_token=None, limit=None, start_from_head=None):
params = {'logGroupName': log_group_name, 'logStreamName': log_stream_name} if (start_time is not None): params['startTime'] = start_time if (end_time is not None): params['endTime'] = end_time if (next_token is not None): params['nextToken'] = next_token if (limit is not Non...
'Uploads a batch of log events to the specified log stream. Every PutLogEvents request must include the `sequenceToken` obtained from the response of the previous request. An upload in a newly created log stream does not require a `sequenceToken`. The batch of events must satisfy the following constraints: + The maximu...
def put_log_events(self, log_group_name, log_stream_name, log_events, sequence_token=None):
params = {'logGroupName': log_group_name, 'logStreamName': log_stream_name, 'logEvents': log_events} if (sequence_token is not None): params['sequenceToken'] = sequence_token return self.make_request(action='PutLogEvents', body=json.dumps(params))
'Creates or updates a metric filter and associates it with the specified log group. Metric filters allow you to configure rules to extract metric data from log events ingested through `PutLogEvents` requests. :type log_group_name: string :param log_group_name: :type filter_name: string :param filter_name: The name of t...
def put_metric_filter(self, log_group_name, filter_name, filter_pattern, metric_transformations):
params = {'logGroupName': log_group_name, 'filterName': filter_name, 'filterPattern': filter_pattern, 'metricTransformations': metric_transformations} return self.make_request(action='PutMetricFilter', body=json.dumps(params))
':type log_group_name: string :param log_group_name: :type retention_in_days: integer :param retention_in_days: Specifies the number of days you want to retain log events in the specified log group. Possible values are: 1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 547, 730.'
def put_retention_policy(self, log_group_name, retention_in_days):
params = {'logGroupName': log_group_name, 'retentionInDays': retention_in_days} return self.make_request(action='PutRetentionPolicy', body=json.dumps(params))
'Sets the retention of the specified log group. Log groups are created with a default retention of 14 days. The retention attribute allow you to configure the number of days you want to retain log events in the specified log group. :type log_group_name: string :param log_group_name: :type retention_in_days: integer :pa...
def set_retention(self, log_group_name, retention_in_days):
params = {'logGroupName': log_group_name, 'retentionInDays': retention_in_days} return self.make_request(action='SetRetention', body=json.dumps(params))
'Tests the filter pattern of a metric filter against a sample of log event messages. You can use this operation to validate the correctness of a metric filter pattern. :type filter_pattern: string :param filter_pattern: :type log_event_messages: list :param log_event_messages:'
def test_metric_filter(self, filter_pattern, log_event_messages):
params = {'filterPattern': filter_pattern, 'logEventMessages': log_event_messages} return self.make_request(action='TestMetricFilter', body=json.dumps(params))
'Creates a new Amazon ECS cluster. By default, your account will receive a `default` cluster when you launch your first container instance. However, you can create your own cluster with a unique name with the `CreateCluster` action. During the preview, each account is limited to two clusters. :type cluster_name: string...
def create_cluster(self, cluster_name=None):
params = {} if (cluster_name is not None): params['clusterName'] = cluster_name return self._make_request(action='CreateCluster', verb='POST', path='/', params=params)
'Deletes the specified cluster. You must deregister all container instances from this cluster before you may delete it. You can list the container instances in a cluster with ListContainerInstances and deregister them with DeregisterContainerInstance. :type cluster: string :param cluster: The cluster you want to delete...
def delete_cluster(self, cluster):
params = {'cluster': cluster} return self._make_request(action='DeleteCluster', verb='POST', path='/', params=params)
'Deregisters an Amazon ECS container instance from the specified cluster. This instance will no longer be available to run tasks. :type cluster: string :param cluster: The short name or full Amazon Resource Name (ARN) of the cluster that hosts the container instance you want to deregister. If you do not specify a clust...
def deregister_container_instance(self, container_instance, cluster=None, force=None):
params = {'containerInstance': container_instance} if (cluster is not None): params['cluster'] = cluster if (force is not None): params['force'] = str(force).lower() return self._make_request(action='DeregisterContainerInstance', verb='POST', path='/', params=params)
'Deregisters the specified task definition. You will no longer be able to run tasks from this definition after deregistration. :type task_definition: string :param task_definition: The `family` and `revision` ( `family:revision`) or full Amazon Resource Name (ARN) of the task definition that you want to deregister.'
def deregister_task_definition(self, task_definition):
params = {'taskDefinition': task_definition} return self._make_request(action='DeregisterTaskDefinition', verb='POST', path='/', params=params)
'Describes one or more of your clusters. :type clusters: list :param clusters: A space-separated list of cluster names or full cluster Amazon Resource Name (ARN) entries. If you do not specify a cluster, the default cluster is assumed.'
def describe_clusters(self, clusters=None):
params = {} if (clusters is not None): self.build_list_params(params, clusters, 'clusters.member') return self._make_request(action='DescribeClusters', verb='POST', path='/', params=params)
'Describes Amazon EC2 Container Service container instances. Returns metadata about registered and remaining resources on each container instance requested. :type cluster: string :param cluster: The short name or full Amazon Resource Name (ARN) of the cluster that hosts the container instances you want to describe. If ...
def describe_container_instances(self, container_instances, cluster=None):
params = {} self.build_list_params(params, container_instances, 'containerInstances.member') if (cluster is not None): params['cluster'] = cluster return self._make_request(action='DescribeContainerInstances', verb='POST', path='/', params=params)
'Describes a task definition. :type task_definition: string :param task_definition: The `family` and `revision` ( `family:revision`) or full Amazon Resource Name (ARN) of the task definition that you want to describe.'
def describe_task_definition(self, task_definition):
params = {'taskDefinition': task_definition} return self._make_request(action='DescribeTaskDefinition', verb='POST', path='/', params=params)
'Describes a specified task or tasks. :type cluster: string :param cluster: The short name or full Amazon Resource Name (ARN) of the cluster that hosts the task you want to describe. If you do not specify a cluster, the default cluster is assumed. :type tasks: list :param tasks: A space-separated list of task UUIDs or ...
def describe_tasks(self, tasks, cluster=None):
params = {} self.build_list_params(params, tasks, 'tasks.member') if (cluster is not None): params['cluster'] = cluster return self._make_request(action='DescribeTasks', verb='POST', path='/', params=params)
'This action is only used by the Amazon EC2 Container Service agent, and it is not intended for use outside of the agent. Returns an endpoint for the Amazon EC2 Container Service agent to poll for updates. :type container_instance: string :param container_instance: The container instance UUID or full Amazon Resource Na...
def discover_poll_endpoint(self, container_instance=None):
params = {} if (container_instance is not None): params['containerInstance'] = container_instance return self._make_request(action='DiscoverPollEndpoint', verb='POST', path='/', params=params)
'Returns a list of existing clusters. :type next_token: string :param next_token: The `nextToken` value returned from a previous paginated `ListClusters` request where `maxResults` was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the ...
def list_clusters(self, next_token=None, max_results=None):
params = {} if (next_token is not None): params['nextToken'] = next_token if (max_results is not None): params['maxResults'] = max_results return self._make_request(action='ListClusters', verb='POST', path='/', params=params)
'Returns a list of container instances in a specified cluster. :type cluster: string :param cluster: The short name or full Amazon Resource Name (ARN) of the cluster that hosts the container instances you want to list. If you do not specify a cluster, the default cluster is assumed.. :type next_token: string :param nex...
def list_container_instances(self, cluster=None, next_token=None, max_results=None):
params = {} if (cluster is not None): params['cluster'] = cluster if (next_token is not None): params['nextToken'] = next_token if (max_results is not None): params['maxResults'] = max_results return self._make_request(action='ListContainerInstances', verb='POST', path='/', p...
'Returns a list of task definitions that are registered to your account. You can filter the results by family name with the `familyPrefix` parameter. :type family_prefix: string :param family_prefix: The name of the family that you want to filter the `ListTaskDefinitions` results with. Specifying a `familyPrefix` will ...
def list_task_definitions(self, family_prefix=None, next_token=None, max_results=None):
params = {} if (family_prefix is not None): params['familyPrefix'] = family_prefix if (next_token is not None): params['nextToken'] = next_token if (max_results is not None): params['maxResults'] = max_results return self._make_request(action='ListTaskDefinitions', verb='POST...
'Returns a list of tasks for a specified cluster. You can filter the results by family name or by a particular container instance with the `family` and `containerInstance` parameters. :type cluster: string :param cluster: The short name or full Amazon Resource Name (ARN) of the cluster that hosts the tasks you want to ...
def list_tasks(self, cluster=None, container_instance=None, family=None, next_token=None, max_results=None):
params = {} if (cluster is not None): params['cluster'] = cluster if (container_instance is not None): params['containerInstance'] = container_instance if (family is not None): params['family'] = family if (next_token is not None): params['nextToken'] = next_token ...
'This action is only used by the Amazon EC2 Container Service agent, and it is not intended for use outside of the agent. Registers an Amazon EC2 instance into the specified cluster. This instance will become available to place containers on. :type cluster: string :param cluster: The short name or full Amazon Resource ...
def register_container_instance(self, cluster=None, instance_identity_document=None, instance_identity_document_signature=None, total_resources=None):
params = {} if (cluster is not None): params['cluster'] = cluster if (instance_identity_document is not None): params['instanceIdentityDocument'] = instance_identity_document if (instance_identity_document_signature is not None): params['instanceIdentityDocumentSignature'] = inst...
'Registers a new task definition from the supplied `family` and `containerDefinitions`. :type family: string :param family: You can specify a `family` for a task definition, which allows you to track multiple versions of the same task definition. You can think of the `family` as a name for your task definition. :type c...
def register_task_definition(self, family, container_definitions):
params = {'family': family} self.build_complex_list_params(params, container_definitions, 'containerDefinitions.member', ('name', 'image', 'cpu', 'memory', 'links', 'portMappings', 'essential', 'entryPoint', 'command', 'environment')) return self._make_request(action='RegisterTaskDefinition', verb='POST', p...
'Start a task using random placement and the default Amazon ECS scheduler. If you want to use your own scheduler or place a task on a specific container instance, use `StartTask` instead. :type cluster: string :param cluster: The short name or full Amazon Resource Name (ARN) of the cluster that you want to run your tas...
def run_task(self, task_definition, cluster=None, overrides=None, count=None):
params = {'taskDefinition': task_definition} if (cluster is not None): params['cluster'] = cluster if (overrides is not None): params['overrides'] = overrides if (count is not None): params['count'] = count return self._make_request(action='RunTask', verb='POST', path='/', pa...
'Starts a new task from the specified task definition on the specified container instance or instances. If you want to use the default Amazon ECS scheduler to place your task, use `RunTask` instead. :type cluster: string :param cluster: The short name or full Amazon Resource Name (ARN) of the cluster that you want to s...
def start_task(self, task_definition, container_instances, cluster=None, overrides=None):
params = {'taskDefinition': task_definition} self.build_list_params(params, container_instances, 'containerInstances.member') if (cluster is not None): params['cluster'] = cluster if (overrides is not None): params['overrides'] = overrides return self._make_request(action='StartTask'...
'Stops a running task. :type cluster: string :param cluster: The short name or full Amazon Resource Name (ARN) of the cluster that hosts the task you want to stop. If you do not specify a cluster, the default cluster is assumed.. :type task: string :param task: The task UUIDs or full Amazon Resource Name (ARN) entry of...
def stop_task(self, task, cluster=None):
params = {'task': task} if (cluster is not None): params['cluster'] = cluster return self._make_request(action='StopTask', verb='POST', path='/', params=params)
'This action is only used by the Amazon EC2 Container Service agent, and it is not intended for use outside of the agent. Sent to acknowledge that a container changed states. :type cluster: string :param cluster: The short name or full Amazon Resource Name (ARN) of the cluster that hosts the container. :type task: stri...
def submit_container_state_change(self, cluster=None, task=None, container_name=None, status=None, exit_code=None, reason=None, network_bindings=None):
params = {} if (cluster is not None): params['cluster'] = cluster if (task is not None): params['task'] = task if (container_name is not None): params['containerName'] = container_name if (status is not None): params['status'] = status if (exit_code is not None): ...