diff --git a/docs/installation/config_cli.rst b/docs/installation/config_cli.rst index 79e499b9..0f733163 100644 --- a/docs/installation/config_cli.rst +++ b/docs/installation/config_cli.rst @@ -8,10 +8,6 @@ Configuration (CLI) After deploying Objecttypes API and Objects API, they need to be configured to be fully functional. The command line tool `setup_configuration`_ assist with this configuration: -* It uses environment variables for all configuration choices, therefore you can integrate this with your - infrastructure tooling such as init containers and/or Kubernetes Jobs. -* The command can self-test the configuration to detect problems early on - You can get the full command documentation with: .. code-block:: bash @@ -28,9 +24,9 @@ Preparation =========== The command executes the list of pluggable configuration steps, and each step -required specific environment variables, that should be prepared. -Here is the description of all available configuration steps and the environment variables, -use by each step for both APIs. +requires specific configuration information, that should be prepared. +Here is the description of all available configuration steps and the configuration +format, use by each step. Objects API @@ -39,75 +35,55 @@ Objects API Sites configuration ------------------- -Configure the domain where Objects API is hosted +.. + _TODO: -* ``SITES_CONFIG_ENABLE``: enable Site configuration. Defaults to ``False``. -* ``OBJECTS_DOMAIN``: a ``[host]:[port]`` or ``[host]`` value. Required. -* ``OBJECTS_ORGANIZATION``: name of Objects API organization. Required. Objecttypes configuration ------------------------- -Objects API uses Objecttypes API to validate data against JSON schemas, therefore -it should be able to request Objecttypes API. +Create a (single) YAML configuration file with your settings: -* ``OBJECTS_OBJECTTYPES_CONFIG_ENABLE``: enable Objecttypes configuration. Defaults - to ``False``. -* ``OBJECTTYPES_API_ROOT``: full URL to the Objecttypes API root, for example - ``https://objecttypes.gemeente.local/api/v1/``. Required. -* ``OBJECTTYPES_API_OAS``: full URL to the Objecttypes OpenAPI specification. -* ``OBJECTS_OBJECTTYPES_TOKEN``: authorization token. Required. -* ``OBJECTS_OBJECTTYPES_PERSON``: Objects API contact person. Required. -* ``OBJECTS_OBJECTTYPES_EMAIL``: Objects API contact email. Required. +.. code-block:: yaml + objecttypes_config_enable: true + objecttypes: + items: + - uuid: b427ef84-189d-43aa-9efd-7bb2c459e281 + name: Object Type 1 + service_identifier: service-1 -Demo user configuration ------------------------ + - uuid: b0e8553f-8b1a-4d55-ab90-6d02f1bcf2c2 + name: Object Type 2 + service_identifier: service-2 -Demo user can be created to check if Objects API work. It has superuser permissions, -so its creation is not recommended on production environment. +.. note:: The ``uuid`` field will be used to lookup existing ``ObjectType``'s. -* ``DEMO_CONFIG_ENABLE``: enable demo user configuration. Defaults to ``False``. -* ``DEMO_PERSON``: demo user contact person. Required. -* ``DEMO_EMAIL``: demo user email. Required. -* ``DEMO_TOKEN``: demo token. Required. +Demo user configuration +----------------------- +.. + _TODO: -Objecttypes API -=============== - -ObjectTypes API has similar configuration steps as the Objects API. Sites configuration ------------------- -Configure the domain where Objects API is hosted +.. + _TODO: -* ``SITES_CONFIG_ENABLE``: enable Site configuration. Defaults to ``False``. -* ``OBJECTTYPES_DOMAIN``: a ``[host]:[port]`` or ``[host]`` value. Required. -* ``OBJECTTYPES_ORGANIZATION``: name of Objecttypes API organization. Required. Objects configuration --------------------- -Objects API uses Objecttypes API to validate data against JSON schemas, therefore -it should be able to request Objecttypes API. +.. + _TODO: -* ``OBJECTS_OBJECTTYPES_CONFIG_ENABLE``: enable Objecttypes configuration. Defaults - to ``False``. -* ``OBJECTTYPES_API_ROOT``: full URL to the Objecttypes API root, for example - ``https://objecttypes.gemeente.local/api/v1/``. Required. -* ``OBJECTTYPES_API_OAS``: full URL to the Objecttypes OpenAPI specification. -* ``OBJECTS_OBJECTTYPES_TOKEN``: authorization token. Required. Demo user configuration ----------------------- -The similar configuration as in Objects API. - -* ``DEMO_CONFIG_ENABLE``: enable demo user configuration. Defaults to ``False``. -* ``DEMO_PERSON``: demo user contact person. Required. -* ``DEMO_EMAIL``: demo user email. Required. -* ``DEMO_TOKEN``: demo token. Required. +.. + _TODO: Execution @@ -119,19 +95,4 @@ tested. .. code-block:: bash - src/manage.py setup_configuration - - -You can skip the self-tests by using the ``--no-selftest`` flag. - -.. code-block:: bash - - src/manage.py setup_configuration --no-self-test - - -``setup_configuration`` command checks if the configuration already exists before changing it. -If you want to change some of the values of the existing configuration you can use ``--overwrite`` flag. - -.. code-block:: bash - - src/manage.py setup_configuration --overwrite + src/manage.py setup_configuration --yaml-file /path/to/config.yaml diff --git a/src/objects/config/objecttypes.py b/src/objects/config/objecttypes.py index 243c1ce0..41bb050e 100644 --- a/src/objects/config/objecttypes.py +++ b/src/objects/config/objecttypes.py @@ -10,7 +10,6 @@ # TODO: remove previously used django settings? -# TODO: update documenation class ObjectTypesConfigurationStep(BaseConfigurationStep): config_model = ObjectTypesConfigurationModel verbose_name = "Objecttypes Configuration"