1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-25 00:07:47 +01:00

doc: add import query params in doc (#673) (#903)

Document query params in import API (/api/admin/state/import)
This commit is contained in:
Dorian Monnier 2021-08-10 14:02:48 +02:00 committed by GitHub
parent 097141a926
commit b713ccd037
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -32,7 +32,7 @@ await stateService.importFile({file: 'exported-data.yml', userName: 'import', dr
If you want the database to be cleaned before import (all strategies and features will be removed), set the `dropBeforeImport` parameter.
It is also possible to not override exiting feature toggles (and strategies) by using the `keepExisting` parameter.
It is also possible to not override existing feature toggles (and strategies) by using the `keepExisting` parameter.
### API Export {#api-export}
@ -67,7 +67,14 @@ curl -X GET -H "Content-Type: application/json" \
You can import feature-toggles and strategies by POSTing to the `/api/admin/state/import` endpoint (keep in mind this will require authentication).\
You can either send the data as JSON in the POST-body or send a `file` parameter with `multipart/form-data` (YAML files are also accepted here).
If you want the database to be cleaned before import (all strategies and features will be removed), specify a `drop` query parameter.
You can customize the import with query parameters:
| Parameter | Default | Description |
| --- | --- | --- |
| drop | `false` | If the database should be cleaned before import (see comment below) |
| keep | `true` | If true, the existing feature toggles and strategies will not be override |
If you want the database to be cleaned before import (**all strategies and features will be removed**), specify a `drop` query parameter.
> You should never use this in production environments.