Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion docs/deployment/provision/provider.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,13 @@ The high-level provisioning mechanism:

Provider configurations can be updated dynamically by changing the YAML files in the `KEEP_PROVIDERS_DIRECTORY` directory.

On every restart, Keep reads the YAML files in the `KEEP_PROVIDERS_DIRECTORY` directory and determines which providers need to be added or removed.
Provider provisioning is done on every restart. It can also be triggered without a restart via the `/providers/provision` endpoint of the API. The user needs `write` permissions on providers.

```
curl -XPOST -u user:password http://localhost:8080/providers/provision
```

Keep reads the YAML files in the `KEEP_PROVIDERS_DIRECTORY` directory and determines which providers need to be added or removed.

The high-level provisioning mechanism:
1. Keep reads the YAML files in the `KEEP_PROVIDERS_DIRECTORY` directory.
Expand Down
10 changes: 8 additions & 2 deletions docs/deployment/provision/workflow.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,15 @@ Example directory structure:
```
### Update Provisioned Workflows

On every restart, Keep reads the `KEEP_WORKFLOWS_DIRECTORY` environment variable and determines which workflows need to be added, removed, or updated.
You can efficiently add new workflows, remove existing ones, or modify their configurations by simply updating the workflow files in the `KEEP_WORKFLOWS_DIRECTORY`. This process allows for flexible management of workflows without requiring manual intervention.

This process allows for flexible management of workflows without requiring manual intervention. By simply updating the workflow files in the `KEEP_WORKFLOWS_DIRECTORY` and restarting the application, you can efficiently add new workflows, remove existing ones, or modify their configurations.
Workflow provisioning is done on every restart. It can also be triggered without a restart via the `/workflows/provision` endpoint of the API. The user needs `write` permissions on workflows.

```
curl -XPOST -u user:password http://localhost:8080/workflows/provision
```

Keep reads the `KEEP_WORKFLOWS_DIRECTORY` environment variable and determines which workflows need to be added, removed, or updated.

The high-level provisioning mechanism:
1. Keep reads the `KEEP_WORKFLOWS_DIRECTORY` value.
Expand Down
2 changes: 1 addition & 1 deletion docs/openapi.json

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions keep/api/routes/providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,21 @@ def _is_localhost():
return False


@router.post("/provision", description="Provision providers from file or directory")
def provision_providers(
authenticated_entity: AuthenticatedEntity = Depends(
IdentityManagerFactory.get_auth_verifier(["write:providers"])
),
):
tenant_id = authenticated_entity.tenant_id
logger.info("Reloading provisioned providers", extra={"tenant_id": tenant_id})
ProvidersService.provision_providers(tenant_id)
return {
"provision": "done",
"is_localhost": _is_localhost(),
}


@router.get("", description="Get all providers")
def get_providers(
authenticated_entity: AuthenticatedEntity = Depends(
Expand Down
14 changes: 14 additions & 0 deletions keep/api/routes/workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,20 @@
PLATFORM_URL = config("KEEP_PLATFORM_URL", default="https://platform.keephq.dev")


@router.post("/provision", description="Provision workflows from a directory")
def provision_providers(
authenticated_entity: AuthenticatedEntity = Depends(
IdentityManagerFactory.get_auth_verifier(["write:workflows"])
),
):
tenant_id = authenticated_entity.tenant_id
logger.info("Reloading provisioned workfflows", extra={"tenant_id": tenant_id})
WorkflowStore.provision_workflows(tenant_id)
return {
"provision": "done",
}


@router.post(
"/facets/options",
description="Query workflows facet options. Accepts dictionary where key is facet id and value is cel to query facet",
Expand Down
Loading