You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Configuration for generating Source of Truth (SOT) CSV files from EPS data.
2
+
3
+
[sot_columns]
4
+
# Defines the exact column names expected in the *final* Cluster Intent and template SOT CSV files.
5
+
# These are the target column names after any renaming specified in [rename_columns].
6
+
# If a column is NOT renamed below, its name here MUST match the corresponding column name in EPS or else that column will be ignored in csv generation
7
+
# The order of columns in the lists below dictates the exact column order in the generated CSV file.
8
+
9
+
#Column names of the Cluster Intent SOT to be generated
Copy file name to clipboardExpand all lines: examples/eps_to_csv/resources/README.md
+8-5Lines changed: 8 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,10 @@
1
1
# EPS to CSV Converter
2
2
3
-
This set of script and configuration is designed to fetch cluster data from an EPS API and generate CSV files suitable for use as Source of Truth (SoT) data, specifically for cluster intent and cluster template data.
3
+
This set of script and csv configuration defined in [config directory](../config) is designed to fetch cluster data from an EPS API and generate CSV files suitable for use as Source of Truth (SoT) data, specifically for cluster intent and cluster template data.
4
4
5
5
## Purpose
6
6
7
-
The primary goal is to automate the retrieval and transformation of cluster information from an EPS system into standardized CSV formats. These CSV files can then be used for potential integrations with HRM, Cluster Provisioner and other tools that use GitOps workflows.
7
+
The primary goal is to automate the retrieval and transformation of cluster information from EPS system into standardized CSV formats. These CSV files can then be used for potential integrations with HRM, Cluster Provisioner and other tools that use GitOps workflows.
8
8
9
9
## Components
10
10
@@ -14,7 +14,7 @@ The script requires Google Cloud [Application Default Credentials](https://cloud
14
14
* A service Account credentials file (`GOOGLE_APPLICATION_CREDENTIALS` env variable to be set to the path of Service Account credentials)
15
15
* Run from a Workload Identity Federated location (which sets up `GOOGLE_APPLICATION_CREDENTIALS` for you eg: GitHub Actions)
16
16
* If gcloud SDK is installed, the credentials generated by `gcloud auth application-default login --impersonate-service-account`
17
-
* The attached service account returned by the metadata server if run from Compute Engine, Cloud Run
17
+
* The attached service account returned by the metadata server if run from Compute Engine, Cloud Run, GKE ..etc
18
18
19
19
### Required Environment Variables
20
20
@@ -39,6 +39,9 @@ This file defines the structure and renaming rules for the output CSV files.
39
39
***`[sot_columns]`**: Specifies the exact column names expected in the final CSVs for both `cluster_intent_sot` and `cluster_data_sot`. These names should align with the data structure in the EPS system. If the columns are to be generated with different names to that of EPS, please specify them explicitly in `rename_columns` below.
40
40
***`[rename_columns]`**: Defines rules for renaming columns fetched from the EPS API to the desired names in the processed DataFrame before CSV generation (e.g., `name = cluster_name`.. This would fetch the cluster attribute `name` from EPS and generate the data under the csv column `cluster_name` ).
41
41
42
+
* Please [check here](../config/sot_csv_config.ini) for a sample config file.
43
+
44
+
42
45
### Main Conversion Script (`eps_to_csv_converter.py`)
43
46
44
47
This Python script orchestrates the entire process:
@@ -50,7 +53,7 @@ This Python script orchestrates the entire process:
50
53
* Makes a GET request to the EPS API endpoint (`/api/v1/clusters`) to retrieve cluster data in JSON format.
51
54
***Processes Data**:
52
55
* Flattens the nested JSON response from the API into a Pandas DataFrame.
0 commit comments