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

     1  # Tenant Fetcher Service
     2  
     3  ## Overview
     4  
     5  This application provides an API for managing tenant subscriptions.
     6  
     7  A subscription binds a provider runtime to a tenant. A given runtime is called a provider runtime when it has a specific label.
     8  Creating a subscription means that the provider runtime with a matching provider label can access tenant resources on behalf of the subscribed tenant. 
     9  
    10  ### Exposed API endpoints
    11  
    12  |                           API                           |                                                      Description                                                    |
    13  |---------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------|
    14  | `PUT <APP_ROOT_API>/<APP_REGIONAL_HANDLER_ENDPOINT>`    | You can use this endpoint to subscribe tenants to runtimes with the given labels. If the tenant does not exist it is                                                             created together with its relative tenants. Regional tenants are labeled with their subdomains and regions.                                                                       Subscribed runtimes are labeled with subscriber tenant IDs.                                                         |
    15  | `DELETE <APP_ROOT_API>/<APP_REGIONAL_HANDLER_ENDPOINT>` | You can use this endpoint to unsubscribe tenants from runtimes with the given labels. Then, the unsubscribing tenant                                                             ID is removed from subscribed runtimes label.                                                                       |
    16  | `GET <APP_ROOT_API>/<APP_REGIONAL_DEPENDENCIES_ENDPOINT>`        | You can use this endpoint to return all external applications, which must be informed for the tenant creation before                                                             Compass. That is, if Compass communicates with a multi-tenant application, and they share the same tenants, then                                                                 if a new tenant is created in Compass, the multi-tenant application must also create that tenant if it does not                                                                   exist.                                                                        |
    17  
    18  All endpoints expect the same body:
    19  
    20  ```
    21  {
    22      "<APP_TENANT_PROVIDER_TENANT_ID_PROPERTY>": "accountTenantID",
    23      "<APP_TENANT_PROVIDER_CUSTOMER_ID_PROPERTY>": "customerTenantID",
    24      "<APP_TENANT_PROVIDER_SUBACCOUNT_TENANT_ID_PROPERTY>": "subaccountTenantID",
    25      "<APP_TENANT_PROVIDER_SUBDOMAIN_PROPERTY>": "my-subdomain",
    26      "<APP_TENANT_PROVIDER_SUBSCRIPTION_PROVIDER_ID_PROPERTY>": "subscriptionProviderID",
    27  
    28  }
    29  ```
    30  Note that `<APP_TENANT_PROVIDER_CUSTOMER_ID_PROPERTY>` is optional.
    31  
    32  ## Development
    33  
    34  ### Prerequisites
    35  
    36  Tenant fetcher requires a running Director component.
    37  
    38  ### Run
    39  
    40  You can start the Tenant Fetcher in your IDE. To get the latest list of properties supported by the `run.sh` script, see [Director - Local Development](../../README.md#local-development).