Exemplo n.º 1
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)
Exemplo n.º 2
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)