diff --git a/cloudhub/modules/ROOT/nav.adoc b/cloudhub/modules/ROOT/nav.adoc index d378714b4..56b106f4b 100644 --- a/cloudhub/modules/ROOT/nav.adoc +++ b/cloudhub/modules/ROOT/nav.adoc @@ -48,6 +48,7 @@ ** xref:lb-create-arm.adoc[Create a Load Balancer with Runtime Manager] ** xref:lb-create-cli.adoc[Create a Load Balancer with the Anypoint Platform CLI] ** xref:lb-create-api.adoc[Create a Load Balancer with the CloudHub API] + ** xref:lb-download-logs.adoc[Download Dedicated Load Balancer Logs] ** xref:lb-ssl-endpoints.adoc[Configure SSL Endpoints and Certificates] *** xref:lb-cert-upload.adoc[Add Certificates] *** xref:lb-cert-validation.adoc[Certificate Validation] diff --git a/cloudhub/modules/ROOT/pages/lb-download-logs.adoc b/cloudhub/modules/ROOT/pages/lb-download-logs.adoc new file mode 100644 index 000000000..bf1dd305b --- /dev/null +++ b/cloudhub/modules/ROOT/pages/lb-download-logs.adoc @@ -0,0 +1,153 @@ += Download Dedicated Load Balancer Logs +ifndef::env-site,env-github[] +include::_attributes.adoc[] +endif::[] +:page-aliases: runtime-manager::lb-download-logs.adoc + + +Download dedicated load balancer (DLB) logs using the CloudHub API. DLB log downloads run asynchronously. After initiating a request, check its status and retrieve the download URL when processing completes. Only one active download request per DLB is allowed at a time. + +DLB log downloads require two APIs: + +* Initiate Download +* Download Log Status + +The download process runs as follows: + +. Fetch the authorization token. +. Call the Initiate Download API. +. Periodically check the request status using the Download Log Status API. +. Retrieve the download URL when processing completes. + +== Initiate Download API: Absolute Query Type + +Use the absolute query type to request logs for a specific time range by specifying `startTime` and `endTime` in ISO 8601 format. + +[source,bash] +---- +curl --location 'https://stgx.anypoint.mulesoft.com/cloudhub/api/organizations/ab0bb8f2-b582-47f3-a06e-f5f7d828a15e/logs/download' \ +--header 'OrgId: bd32a4c5-6365-46ef-8823-7db5cb6342eb' \ +--header 'Content-Type: application/json' \ +--header 'Authorization: CUSTOMER_TOKEN' \ +--data '{ + "resourceType": "DLB_LOGS", + "resourceName": "test-clean-dlb-logs", + "queryType": "ABSOLUTE", + "startTime": "2025-12-25T10:00:00.000000Z", + "endTime": "2026-01-01T10:00:00.000000Z" +}' + +---- + +=== Sample Response + +The API returns a response similar to this: + +[source,json] +---- +{ + "executionName": "dlb-logs-test-clean-dlb-logs-relative-1767375489", + "startDate": "Fri Jan 02 17:38:09 UTC 2026", + "status": "RUNNING", + "message": "Log download request submitted successfully" +} +---- + +=== Validations + +These validations apply to the request: + +* `resourceType` is a required parameter and must be `DLB_LOGS`. +* `resourceName` is a required parameter and must be a valid DLB name associated with the requesting organization. +* `queryType` is a required parameter and must be `RELATIVE` or `ABSOLUTE`. If `queryType` is `ABSOLUTE`, `startTime` and `endTime` are required parameters. Time format must be ISO 8601. +* `validityMinutes` is an optional parameter. Default value is 60 minutes. Allowed range is 10 to 1440 minutes. + +== Initiate Download API: Relative Query Type + +Use the relative query type to request logs for a preset time window (for example, the last 1, 3, 6, or 24 hours) by specifying a `timeRange` value. + +[source,bash] +---- +curl --location 'https://stgx.anypoint.mulesoft.com/cloudhub/api/organizations/ab0bb8f2-b582-47f3-a06e-f5f7d828a15e/logs/download' \ +--header 'OrgId: bd32a4c5-6365-46ef-8823-7db5cb6342eb' \ +--header 'Content-Type: application/json' \ +--header 'Authorization: Bearer CUSTOMER_TOKEN' \ +--data '{ + "resourceType": "DLB_LOGS", + "resourceName": "test-clean-dlb-logs", + "queryType": "RELATIVE", + "timeRange": "LAST_3_HOURS", + "validityMinutes": 60 + }' +---- + +=== Validations + +These validations apply to the request: + +* `resourceType` is a required parameter and must be `DLB_LOGS`. +* `resourceName` is a required parameter and must be a valid DLB name associated with the requesting organization. +* `queryType` is a required parameter and must be `RELATIVE` or `ABSOLUTE`. If `queryType` is `RELATIVE`, `timeRange` is a required parameter and must be one of: +** `LAST_1_HOUR` +** `LAST_3_HOURS` +** `LAST_6_HOURS` +** `LAST_24_HOURS` +* `validityMinutes` is an optional parameter. Default value is 60 minutes. Allowed range is 10 to 1440 minutes. + +== Download Log Status API + +Check the request status and retrieve the download URL when processing completes. + +[source,bash] +---- +curl --location 'https://stgx.anypoint.mulesoft.com/cloudhub/api/organizations/ab0bb8f2-b582-47f3-a06e-f5f7d828a15e/logs/download/status?executionName=dlb-logs-test-clean-dlb-logs-absolute-1767370827' \ +--header 'OrgId: bd32a4c5-6365-46ef-8823-7db5cb6342eb' \ +--header 'Authorization: Bearer CUSTOMER_TOKEN' +---- + +=== Validations + +These validations apply to the request: + +* `executionName` is a required query parameter. +* `executionName` must be taken from the response of the Initiate Download API. +* `executionName` must be a valid parameter; missing, invalid, or unknown values are rejected. + +=== Sample Response + +While the logs are being processed, the API returns a response similar to this: + +[source,json] +---- +{ + "message": "Log download request is being processed", + "resourceName": "test-clean-dlb-logs" +} +---- + +=== Successful Execution Response + +When processing completes, the API returns a response similar to this, including the download URL: + +[source,json] +---- +{ + "message": "DLB logs processed successfully", + "downloadUrl": "https://cloudhub-logs-download-stgx.s3.amazonaws.com/results/ab0bb8f2-b582-47f3-a06e-f5f7d828a15e/test-clean-dlb-logs/20260102_162308_dlb_logs.zip?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=ASIAZMZ44LXLRBH2UJUQ%2F20260102%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20260102T162308Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Security-Token=IQoJb3JpZ2luX2VjEDkaCXVzLWVhc3QtMSJGMEQCIEfeSqdCPuq29ZgR0nERs9XZ2dpXA24bncxG9T%2Fa2GrEAiAC35poK1h99ptLhb37RnlBL64l2UeAybKM59nm2XzA0CqPAwgCEAMaDDY0NTk4MzM5NTI4NyIMXRqh3tZAebhztrcIKuwCLng%2Fo2Pgy1mpn75SULzco0jsUVm%2Bu9UedDTaEwlGoCryZOaloh33GR7nexO7gt9Db7vWCt6WuhgKSjVHUFtPhJSUBAaMOk0f1nqQtAAPrq7fHeSpSK5%2Feh9tldYFueb4XLSe5Q0tMYO7OmIFS1h8KqHwsbig5M6mO1ZnaLM3Vl1kfEqFWDM8GMc0qriEtvYOrtjnx3js9GHFu1h5VA2380f9SONnXbDFAqJXUHgp8xSZ9rPkVBEHjsYyaD01amoejSBTXS6jT11P4hOXDpiyNqI%2FhCz6DKXzYr1G5fc77aUZe44%2F78aJEO0As0iAZTAI0lln2vCd7ZrX1stQd5BxTfyIFBAydcadHXK%2FyFeY9XKBOPGL3WxZxqjG%2FU%2FRzbAHviKavJD%2FVXRyGpyRvCVqidf5O6CuU8AYkiJj7oIuwM0MAzj0HyKZ4xRG%2BtfKQEVPI0Wd2IyARxY5hIBZQqmoEmRM9BoHPIplRwmNfjDq4d%2FKBjqeAbUuWUNh3IefwBO32%2FVGrxuOTJTALzS22Tpe%2B%2FW9qgDkqzYgaFo1c08s0%2B2lmLaMXkBzG0X%2BUbvI%2BPDS54qi5AtxCi6tihvr9WIXtSe3pdDeXzflP8rHC%2BvEKN0BhRcRP4yDpRIO6elLZHx1BGP1nqFvorcC9k%2BzecW86p8AI4j1%2FkjnH%2BQoFYNVBQePEQkL7t5%2Fzl6DVx%2BMsezOp%2BTZ&X-Amz-Signature=694ae19f11e66a2e013647da0f163368bf745840e22498d66c7180edcb22f433", + "expiresIn": "60 minutes", + "token": "<>", + "resourceName": "test-clean-dlb-logs" +} +---- + +== Constraints + +These constraints apply to DLB log downloads: + +* You can download only log requests you initiated within your organization. Access to requests from other organizations isn't allowed. +* Only one request per DLB can be executed at a time. +* If a request is already in progress for a DLB and another request is made for the same DLB, the request fails with HTTP 429. + +== See Also + +* xref:cloudhub-dedicated-load-balancer.adoc[]