github.com/kyma-incubator/compass/components/director@v0.0.0-20230623144113-d764f56ff805/cmd/tenantloader/README.md (about)

     1  # Tenant Loader
     2  
     3  ## Overview
     4  
     5  Tenant Loader is an application that loads tenants from a given directory to Compass.
     6  
     7  ## Usage
     8  
     9  To run the application, provide these environment variables:
    10  
    11  | Environment variable           | Default value      | Description                                    |
    12  | ------------------------------ | ------------------ | ---------------------------------------------- |
    13  | **APP_DB_USER**                | `postgres`         | Database username                              |
    14  | **APP_DB_PASSWORD**            | `pgsql@12345`      | Database password                              |
    15  | **APP_DB_HOST**                | `localhost`        | Database host                                  |
    16  | **APP_DB_PORT**                | `5432`             | Database port                                  |
    17  | **APP_DB_NAME**                | `postgres`         | Database name                                  |
    18  | **APP_DB_SSL**                 | `disable`          | Parameter that activates database SSL mode     |
    19  
    20  ## Details
    21  
    22  Tenant Loader basic workflow looks as follows:
    23  
    24  1. Tenant Loader reads the `/data/` directory where tenant files reside.
    25  2. Tenant Loader tries to parse each `.json` file from the directory to the tenant structure.
    26  3. Tenant Loader creates tenants with IDs that are not yet in database.
    27  
    28  
    29  This is the supported format of the `.json` file that can be parsed to the tenant structure:
    30  ```json
    31  [
    32    {
    33      "name": "tenant-name-1",
    34      "id": "tenant-id-1"
    35    },
    36    {
    37      "name": "tenant-name-2",
    38      "id": "tenant-id-2"
    39    }
    40  ]
    41  ```