Esempio n. 1
0
    def describe_db_instances(self,
                              db_instance_identifier=None,
                              marker=None,
                              max_records=None):
        request = Request()
        request.set_action('DescribeDBInstances')
        if db_instance_identifier is not None:
            request.set_db_instance_identifier(db_instance_identifier)
        if marker is not None:
            request.set_marker(marker)
        if max_records is not None:
            request.set_max_records(max_records)

        try:
            response = self.call(request)
        except AwsServiceException as ex:
            if ex.code == 404:
                raise RdsDBInstanceNotFoundException(ex)
            raise

        results = response['DescribeDBInstancesResponse']\
            ['DescribeDBInstancesResult']['DBInstances']
        marker = response['DescribeDBInstancesResponse']\
            ['DescribeDBInstancesResult']['Marker']
        request_id = response['DescribeDBInstancesResponse']\
            ['ResponseMetadata']['RequestId']

        instances = []
        for result in results:
            instances.append(DBInstance.from_json(result))
        return Response(request_id, instances, marker)
Esempio n. 2
0
 def describe_db_instances(self, db_instance_identifier = None, 
                           marker = None, max_records = None):
     request = Request()
     request.set_action(u'DescribeDBInstances')
     if db_instance_identifier is not None: 
         request.set_db_instance_identifier(db_instance_identifier)
     if marker is not None: 
         request.set_marker(marker)
     if max_records is not None: 
         request.set_max_records(max_records)
     
     try:    
         response = self.call(request)
     except AwsServiceException as ex:
         if ex.code == 404:
             raise RdsDBInstanceNotFoundException(ex)
         raise
     
     results = response[u'DescribeDBInstancesResponse']\
         [u'DescribeDBInstancesResult'][u'DBInstances']
     marker = response[u'DescribeDBInstancesResponse']\
         [u'DescribeDBInstancesResult'][u'Marker']
     request_id = response[u'DescribeDBInstancesResponse']\
         [u'ResponseMetadata'][u'RequestId']
             
     instances = []
     for result in results:
         instances.append(DBInstance.from_json(result))
     return Response(request_id, instances, marker)
Esempio n. 3
0
    def describe_db_engine_versions(self,
                                    db_parameter_group_family=None,
                                    default_only=None,
                                    engine=None,
                                    engine_version=None,
                                    list_supported_character_sets=None,
                                    marker=None,
                                    max_records=None):
        request = Request()
        request.set_action('DescribeDBEngineVersions')
        if db_parameter_group_family is not None:
            request.set_db_parameter_group_family(db_parameter_group_family)
        if default_only is not None:
            request.set_default_only(default_only)
        if engine is not None:
            request.set_engine(engine)
        if engine_version is not None:
            request.set_engine_version(engine_version)
        if list_supported_character_sets is not None:
            request.set_list_supported_character_sets(
                list_supported_character_sets)
        if marker is not None:
            request.set_marker(marker)
        if max_records is not None:
            request.set_max_records(max_records)

        try:
            response = self.call(request)
        except AwsServiceException:
            raise

        results = response['DescribeDBEngineVersionsResponse']\
            ['DescribeDBEngineVersionsResult']['DBEngineVersions']
        marker = response['DescribeDBEngineVersionsResponse']\
            ['DescribeDBEngineVersionsResult']['Marker']
        request_id = response['DescribeDBEngineVersionsResponse']\
            ['ResponseMetadata']['RequestId']

        engine_versions = []
        for result in results:
            engine_versions.append(DBEngineVersion.from_json(result))
        return Response(request_id, engine_versions, marker)
Esempio n. 4
0
 def describe_db_engine_versions(self, db_parameter_group_family = None, default_only = None, 
                                 engine = None, engine_version = None, 
                                 list_supported_character_sets = None,
                                 marker = None, max_records = None):
     request = Request()
     request.set_action(u'DescribeDBEngineVersions')
     if db_parameter_group_family is not None: 
         request.set_db_parameter_group_family(db_parameter_group_family)
     if default_only is not None: 
         request.set_default_only(default_only)
     if engine is not None: 
         request.set_engine(engine)
     if engine_version is not None: 
         request.set_engine_version(engine_version)
     if list_supported_character_sets is not None: 
         request.set_list_supported_character_sets(list_supported_character_sets)
     if marker is not None: 
         request.set_marker(marker)
     if max_records is not None: 
         request.set_max_records(max_records)
     
     try:    
         response = self.call(request)
     except AwsServiceException:
         raise 
     
     results = response[u'DescribeDBEngineVersionsResponse']\
         [u'DescribeDBEngineVersionsResult'][u'DBEngineVersions']
     marker = response[u'DescribeDBEngineVersionsResponse']\
         [u'DescribeDBEngineVersionsResult'][u'Marker']
     request_id = response[u'DescribeDBEngineVersionsResponse']\
         [u'ResponseMetadata'][u'RequestId']
             
     engine_versions = []
     for result in results:
         engine_versions.append(DBEngineVersion.from_json(result))
     return Response(request_id, engine_versions, marker)
Esempio n. 5
0
 def describe_db_snapshots(self, db_instance_identifier = None, 
                           db_snapshot_identifier = None, 
                           snapshot_type = None, marker = None, max_records = None):
     request = Request()
     request.set_action('DescribeDBSnapshots')
     if db_instance_identifier is not None: 
         request.set_db_instance_identifier(db_instance_identifier)
     if db_snapshot_identifier is not None: 
         request.set_db_snapshot_identifier(db_snapshot_identifier)
     if snapshot_type is not None: 
         request.set_snapshot_type(snapshot_type)
     if marker is not None: 
         request.set_marker(marker)
     if max_records is not None: 
         request.set_max_records(max_records)
     
     try:    
         response = self.call(request)
     except AwsServiceException as ex:
         if ex.code == 404:
             raise RdsDBSnapshotNotFoundException(ex)
         raise
     
     results = response['DescribeDBSnapshotsResponse']\
         ['DescribeDBSnapshotsResult']['DBSnapshots']
     marker = response['DescribeDBSnapshotsResponse']\
         ['DescribeDBSnapshotsResult']['Marker']
     request_id = response['DescribeDBSnapshotsResponse']\
         ['ResponseMetadata']['RequestId']
             
     snapshots = []
     for result in results:
         snapshots.append(DBSnapshot.from_json(result))
     return Response(request_id, snapshots, marker)
Esempio n. 6
0
    def describe_db_snapshots(self,
                              db_instance_identifier=None,
                              db_snapshot_identifier=None,
                              snapshot_type=None,
                              marker=None,
                              max_records=None):
        request = Request()
        request.set_action(u'DescribeDBSnapshots')
        if db_instance_identifier is not None:
            request.set_db_instance_identifier(db_instance_identifier)
        if db_snapshot_identifier is not None:
            request.set_db_snapshot_identifier(db_snapshot_identifier)
        if snapshot_type is not None:
            request.set_snapshot_type(snapshot_type)
        if marker is not None:
            request.set_marker(marker)
        if max_records is not None:
            request.set_max_records(max_records)

        try:
            response = self.call(request)
        except AwsServiceException as ex:
            if ex.code == 404:
                raise RdsDBSnapshotNotFoundException(ex)
            raise

        results = response[u'DescribeDBSnapshotsResponse']\
            [u'DescribeDBSnapshotsResult'][u'DBSnapshots']
        marker = response[u'DescribeDBSnapshotsResponse']\
            [u'DescribeDBSnapshotsResult'][u'Marker']
        request_id = response[u'DescribeDBSnapshotsResponse']\
            [u'ResponseMetadata'][u'RequestId']

        snapshots = []
        for result in results:
            snapshots.append(DBSnapshot.from_json(result))
        return Response(request_id, snapshots, marker)