download_db_log_file_portion
async
¶
download_db_log_file_portion(
*,
config_overrides: Optional[AsyncRDSClientConfig] = None,
db_instance_identifier: Optional[String] = None,
log_file_name: Optional[String] = None,
marker: Optional[String] = None,
number_of_lines: Optional[Integer] = None,
) -> DownloadDBLogFilePortionDetails
Downloads all or a portion of the specified log file, up to 1 MB in size.
This command doesn't apply to RDS Custom.
This operation uses resources on database instances. Because of this, we recommend publishing database logs to CloudWatch and then using the GetLogEvents operation. For more information, see GetLogEvents in the Amazon CloudWatch Logs API Reference.
Parameters:
-
db_instance_identifier(Optional[String], default:None) –The customer-assigned name of the DB instance that contains the log files you want to list.
Constraints:
-
Must match the identifier of an existing DBInstance.
-
-
log_file_name(Optional[String], default:None) –The name of the log file to be downloaded.
-
marker(Optional[String], default:None) –The pagination token provided in the previous request or "0". If the Marker parameter is specified the response includes only records beyond the marker until the end of the file or up to NumberOfLines.
-
number_of_lines(Optional[Integer], default:None) –The number of lines to download. If the number of lines specified results in a file over 1 MB in size, the file is truncated at 1 MB in size.
If the NumberOfLines parameter is specified, then the block of lines returned can be from the beginning or the end of the log file, depending on the value of the Marker parameter.
-
If neither Marker or NumberOfLines are specified, the entire log file is returned up to a maximum of 10000 lines, starting with the most recent log entries first.
-
If NumberOfLines is specified and Marker isn't specified, then the most recent lines from the end of the log file are returned.
-
If Marker is specified as "0", then the specified number of lines from the beginning of the log file are returned.
-
You can download the log file in blocks of lines by specifying the size of the block using the NumberOfLines parameter, and by specifying a value of "0" for the Marker parameter in your first request. Include the Marker value returned in the response as the Marker value for the next request, continuing until the AdditionalDataPending response element returns false.
-
Raises:
-
DBInstanceNotFoundFault–DBInstanceIdentifierdoesn't refer to an existing DB instance. -
DBInstanceNotReadyFault–An attempt to download or examine log files didn't succeed because an Aurora Serverless v2 instance was paused.
-
DBLogFileNotFoundFault–LogFileNamedoesn't refer to an existing DB log file. -
UnknownServiceError–The service returned an error code this client does not model.
Examples:
To download a DB log file The following example downloads only the latest part of your log file.
>>> await client.download_db_log_file_portion(db_instance_identifier='test-instance', log_file_name='log.txt')
Source code in docs_src/capo_rds/_services/async_rds.py
9854 9855 9856 9857 9858 9859 9860 9861 9862 9863 9864 9865 9866 9867 9868 9869 9870 9871 9872 9873 9874 9875 9876 9877 9878 9879 9880 9881 9882 9883 9884 9885 9886 9887 9888 9889 9890 9891 9892 9893 9894 9895 9896 9897 9898 9899 9900 9901 9902 9903 9904 9905 9906 9907 9908 9909 9910 9911 9912 9913 9914 9915 9916 9917 9918 9919 9920 9921 9922 9923 9924 9925 9926 9927 9928 | |