From 0c812e13cece9615de78130ba3a3f92721f23201 Mon Sep 17 00:00:00 2001 From: Bruno Antonellini Date: Thu, 18 Sep 2025 15:39:50 -0300 Subject: [PATCH 1/3] initial bruno --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d63b44f..ab9c2ed 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ This website is built using [Docusaurus](https://docusaurus.io/), a modern stati yarn ``` -## Local Development +## Local Developmen ```bash yarn start From 82e60ef80084915e70796417bcc537a8d800e1cb Mon Sep 17 00:00:00 2001 From: Bruno Antonellini Date: Thu, 25 Sep 2025 17:38:05 -0300 Subject: [PATCH 2/3] DCV-3563 Document Tally(mark) API --- .../how_to_check_worker_consumption.md | 106 ++++++++++++++++++ migration-files/_sidebar.md | 1 + 2 files changed, 107 insertions(+) create mode 100644 docs/how-tos/datacoves/how_to_check_worker_consumption.md diff --git a/docs/how-tos/datacoves/how_to_check_worker_consumption.md b/docs/how-tos/datacoves/how_to_check_worker_consumption.md new file mode 100644 index 0000000..c69c30b --- /dev/null +++ b/docs/how-tos/datacoves/how_to_check_worker_consumption.md @@ -0,0 +1,106 @@ +--- +title: Check Worker Consumption +sidebar_position: 57 +--- + +# Billing API + +Datacoves provides API endpoints for users to retrieve billing information about their environments, specifically the number of minutes billed for Airflow and Airbyte services. These endpoints are secured and require a **Project-level token** for authentication. + +## Endpoints + +### 1. List Billing Info for All Environments + +**GET** `/api/v1/billing/` + +Returns billing data for all environments the authenticated user has access to. + +### 2. Billing Info for a Specific Environment + +**GET** `/api/v1/billing//` + +Returns billing data for a single environment, specified by its slug. + +## Authentication + +Use your **Project-level token** from your Project settings. Pass it as a Bearer token in the `Authorization` header: + +```shell +Authorization: Bearer +``` + +## Query Parameters + +- `start_date` (optional): Start date in `YYYY-MM-DD` format. Default is 30 days ago. +- `end_date` (optional): End date in `YYYY-MM-DD` format. Default is today. +- `service` (optional): Filter by service name (`airflow` or `airbyte`). + +**Note:** + +- Maximum allowed date range is 6 months (180 days). +- If the date range exceeds 6 months, the API returns an error. + +## Example Request + +```http +GET /api/v1/billing/?start_date=2025-03-01&end_date=2025-03-31&service=airflow +Authorization: Bearer +``` + +## Example Response + +```json +[ + { + "environment_slug": "prod-env", + "service": "airflow", + "date": "2025-03-01", + "minutes": 120 + }, + { + "environment_slug": "prod-env", + "service": "airbyte", + "date": "2025-03-01", + "minutes": 45 + } +] +``` + +## Error Responses + +- **Invalid date format:** + + ```json + { "error": "Invalid date format. Use YYYY-MM-DD." } + ``` + +- **Date range exceeds 6 months:** + + ```json + { "error": "Date range cannot exceed 6 months (180 days)." } + ``` + +- **Start date after end date:** + + ```json + { "error": "start_date must be before end_date." } + ``` + +## Field Descriptions + +- `environment_slug`: Slug identifier for the environment. +- `service`: Either `airflow` or `airbyte`. +- `date`: Date of the tally (YYYY-MM-DD). +- `minutes`: Billed minutes for the service on that date (rounded down from seconds). + +## Notes + +- Data is aggregated per day and per service. +- If no `service` parameter is provided, results include both Airflow and Airbyte. +- Only environments you have access to via your project token are included. + +## Troubleshooting + +- Ensure your token is valid and has access to the requested environments. +- Check date formats and range limits. +- For further assistance, contact Datacoves support. diff --git a/migration-files/_sidebar.md b/migration-files/_sidebar.md index 8ab9d39..6d675d1 100644 --- a/migration-files/_sidebar.md +++ b/migration-files/_sidebar.md @@ -58,6 +58,7 @@ - [Manage Users](/how-tos/datacoves/how_to_manage_users.md) - [Update Repository](/getting-started/Admin/configure-repository.md) - [Configure VSCode Environment Variables](/how-tos/datacoves/how_to_environment_variables.md) + - [Check Worker Consumption](/how-tos/datacoves/how_to_check_worker_consumption.md) - [Datahub](/how-tos/datahub/) - [Configure dbt metadata ingestion](/how-tos/datahub/how_to_datahub_dbt.md) - [Configure Snowflake metadata ingestion](/how-tos/datahub/how_to_datahub_snowflake.md) From b18b13a734d76c1c08f89cb21d1d651f5b423fa2 Mon Sep 17 00:00:00 2001 From: Bruno Antonellini Date: Thu, 25 Sep 2025 17:39:10 -0300 Subject: [PATCH 3/3] Fix typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ab9c2ed..d63b44f 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ This website is built using [Docusaurus](https://docusaurus.io/), a modern stati yarn ``` -## Local Developmen +## Local Development ```bash yarn start