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
121 changes: 0 additions & 121 deletions _data/navigation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,70 +14,6 @@ items:
- url: /extend/
title: Extending Keboola
items:
- url: /extend/component/
title: Components
items:
- url: /extend/component/tutorial/
title: Tutorial
items:
- url: /extend/component/tutorial/input-mapping/
title: Input Mapping

- url: /extend/component/tutorial/output-mapping/
title: Output Mapping

- url: /extend/component/tutorial/configuration/
title: Configuration

- url: /extend/component/tutorial/processors/
title: Processors

- url: /extend/component/tutorial/debugging/
title: Debugging

- url: /extend/component/processors/
title: Processors

- url: /extend/component/code-patterns/
title: Code Patterns
items:
- url: /extend/component/code-patterns/interface/
title: Interface

- url: /extend/component/code-patterns/tutorial/
title: Tutorial

- url: /extend/component/implementation/
title: Implementation Notes
items:
- url: /extend/component/implementation/php/
title: PHP Implementation Notes

- url: /extend/component/implementation/python/
title: Python Implementation Notes

- url: /extend/component/implementation/r/
title: R Implementation Notes

- url: /extend/component/running/
title: Running Components

- url: /extend/component/ui-options/
title: UI Options
items:
- url: /extend/component/ui-options/configuration-schema/
title: Configuration Schema
items:
- url: /extend/component/ui-options/configuration-schema/examples
title: Examples
- url: /extend/component/ui-options/configuration-schema/sync-action-examples
title: Sync Action Examples
- url: /extend/component/ui-options/default-configuration/
title: Default Configuration

- url: /extend/component/deployment/
title: Deployment

- url: /extend/generic-extractor/
title: Generic Extractor
items:
Expand Down Expand Up @@ -201,63 +137,6 @@ items:
- url: /extend/generic-writer/configuration-examples/
title: Configuration Examples

- url: /extend/common-interface/
title: Common Interface
items:
- url: /extend/common-interface/folders/
title: Data Folders

- url: /extend/common-interface/config-file/
title: Configuration File

- url: /extend/common-interface/environment/
title: Environment

- url: /extend/common-interface/manifest-files/
title: Manifest Files
items:
- url: /extend/common-interface/manifest-files/in-tables-manifests/
title: IN tables

- url: /extend/common-interface/manifest-files/in-files-manifests/
title: IN files

- url: /extend/common-interface/manifest-files/in-files-s3-staging/
title: IN files S3 staging

- url: /extend/common-interface/manifest-files/in-files-abs-staging/
title: IN files ABS staging

- url: /extend/common-interface/manifest-files/out-tables-manifests/
title: OUT tables

- url: /extend/common-interface/manifest-files/out-tables-manifests-native-types/
title: OUT tables with Native Types

- url: /extend/common-interface/manifest-files/out-files-manifests/
title: OUT files

- url: /extend/common-interface/oauth/
title: OAuth2

- url: /extend/common-interface/actions/
title: Actions

- url: /extend/common-interface/logging/
title: Logging

- url: /extend/common-interface/development-branches/
title: Development branches

- url: /extend/job-queue/
title: Job Queue

- url: /extend/publish/
title: Publishing Component
items:
- url: /extend/publish/checklist/
title: Checklist

- url: /integrate/
title: Integration
items:
Expand Down
65 changes: 65 additions & 0 deletions _layouts/redirect.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<!DOCTYPE html>
{%- comment -%}
Overrides the template jekyll-redirect-from ships with, for every page carrying
`redirect_to` or `redirect_from`. The plugin only injects its own template when
the site has no `redirect` layout of its own (see Generator#generate).

The redirect still fires immediately — this markup is what a reader sees when it
does not (JS off, meta refresh blocked, printed copy), so it has to say where the
page went on its own.
{%- endcomment -%}
{%- assign target = page.redirect.to -%}
{%- assign target_label = target | remove: "https://" | remove: "http://" -%}
{%- assign moved_to_help = false -%}
{%- if target contains "help.keboola.com" -%}{%- assign moved_to_help = true -%}{%- endif -%}
{%- comment -%} Same path on the other host, or a genuinely different one? {%- endcomment -%}
{%- assign target_path = target | remove: "https://help.keboola.com" -%}
{%- assign same_path = false -%}
{%- if target_path == page.redirect.from -%}{%- assign same_path = true -%}{%- endif -%}
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{% if moved_to_help %}Moved to the Keboola help docs{% else %}Redirecting&hellip;{% endif %} | Keboola Developers Knowledge Base</title>
<link rel="canonical" href="{{ target }}">
<meta name="robots" content="noindex">
<script>location.replace("{{ target }}")</script>
<meta http-equiv="refresh" content="0; url={{ target }}">
<style>
body { margin: 0; padding: 3rem 1.5rem; color: #333; background: #fff;
font: 16px/1.6 Lato, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif; }
.box { max-width: 34rem; margin: 0 auto; }
.logo { height: 34px; margin-bottom: 2.5rem; }
h1 { margin: 0 0 1rem; font-size: 1.6rem; font-weight: 700; }
p { margin: 0 0 1rem; }
a { color: #337ab7; }
.target { display: block; margin: 1.5rem 0; padding: .9rem 1.1rem;
background: #f5f5f5; border-left: 3px solid #337ab7;
word-break: break-all; font-weight: 700; }
.muted { color: #777; font-size: .9rem; }
</style>
</head>
<body>
<div class="box">
<a href="/"><img class="logo" src="/assets/img/logo.png" alt="Keboola"></a>
{% if moved_to_help %}
<h1>This page has moved</h1>
<p>
{% if page.title %}<strong>{{ page.title }}</strong> is{% else %}This page is{% endif %}
now part of the Keboola documentation at <a href="https://help.keboola.com/">help.keboola.com</a>,
alongside the rest of the product documentation.{% if same_path %}
The path did not change &mdash; only the host.{% endif %}
</p>
<a class="target" href="{{ target }}">{{ target_label }}</a>
<p class="muted">
Taking you there now &mdash; use the link above if nothing happens.
Please update any bookmarks, links or component <code>documentation_url</code>s pointing here.
</p>
{% else %}
<h1>This page has a new address</h1>
<a class="target" href="{{ target }}">{{ target_label }}</a>
<p class="muted">Taking you there now &mdash; use the link above if nothing happens.</p>
{% endif %}
</div>
</body>
</html>
4 changes: 2 additions & 2 deletions cli/commands/local/validate/config/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ permalink: /cli/commands/local/validate/config/
{:toc}


**Validate a [configuration JSON file](/extend/common-interface/config-file/).**
**Validate a [configuration JSON file](https://help.keboola.com/extend/common-interface/config-file/).**

```
kbc local validate config component.id config.json [flags]
```

Each [component](/extend/component/) definition optionally contains a **schema of the configuration `parameters` key**.
Each [component](https://help.keboola.com/extend/component/) definition optionally contains a **schema of the configuration `parameters` key**.

The command validates the content of the specified JSON file against the schema.
It can be used both in a project [local directory](/cli/structure/) and also separately.
Expand Down
2 changes: 1 addition & 1 deletion cli/commands/local/validate/row/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ permalink: /cli/commands/local/validate/row/
kbc local validate row component.id row.json [flags]
```

Each [component](/extend/component/) definition optionally contains a **schema of the configuration row `parameters` key**.
Each [component](https://help.keboola.com/extend/component/) definition optionally contains a **schema of the configuration row `parameters` key**.

The command validates the content of the specified JSON file against the schema.
It can be used both in a project [local directory](/cli/structure/) and also separately.
Expand Down
4 changes: 2 additions & 2 deletions cli/commands/local/validate/schema/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ permalink: /cli/commands/local/validate/schema/
{:toc}


**Validate a [configuration](/extend/common-interface/config-file/)/[row](https://help.keboola.com/components/#configuration-rows) JSON file by a JSON schema file.**
**Validate a [configuration](https://help.keboola.com/extend/common-interface/config-file/)/[row](https://help.keboola.com/components/#configuration-rows) JSON file by a JSON schema file.**

```
kbc local validate schema schema.json config.json [flags]
Expand All @@ -17,7 +17,7 @@ Validate the content of the specified JSON file
against the specified JSON schema file.

The JSON schema should contain a schema for the `parameters` key,
just like the configuration/row schema in a [component](/extend/component/) definition.
just like the configuration/row schema in a [component](https://help.keboola.com/extend/component/) definition.

The main purpose of this command is to **test
a new JSON schema before it is changed in a component definition**.
Expand Down
103 changes: 1 addition & 102 deletions extend/common-interface/actions.md
Original file line number Diff line number Diff line change
@@ -1,106 +1,5 @@
---
title: Actions
permalink: /extend/common-interface/actions/
redirect_to: https://help.keboola.com/extend/common-interface/actions/
---

* TOC
{:toc}

Actions provide a way to execute very quick tasks in a single Component, using a single code base.
The default component's action (`run`) executes as a background, asynchronous job. It is queued, has plenty of
execution time, and there are cases when you might not want to wait for it. Apart from the default `run`, there
can be synchronous actions with limited execution time and you must wait for them. When we refer to
**actions**, we mean *synchronous actions*. Using actions is fully optional.

## Use Case
For example, in our database extractor, the main task (`run` action) is the data extraction itself. But we also want to be
able to test the database credentials and list tables available in the database.
These tasks would be very helpful in the UI. It is not possible to do these things directly in the browser. Setting up a
separate component would bring an overhead of maintaining both the extractor's Docker image and the new component.

## Solution
For each Component, you can specify other actions (apart from the default `run`). These
actions will be executed using the same Docker image, but [Job Queue](/extend/job-queue/) will wait for its execution and use
the returned value as the API response. So, these additional actions are executed *synchronously* and have a very
limited execution time (maximum 30 seconds). These actions also cannot access Storage.

The [configuration file](/extend/common-interface/config-file/#configuration-file-structure)
contains the `action` property with the name of the currently executed action. Just grab the value and act accordingly.
All actions must be explicitly specified in the component configuration in [Developer Portal](https://components.keboola.com/).

## Running Actions
Actions are available through the [API](https://api.keboola.com/?service=sync-actions#post-/actions).
They do not load the configuration from Storage, so you need to fully specify the whole configuration in the request body.
If any of your parameters are encrypted, they will be decrypted before they are passed to your component.

Do not specify the `action` attribute in the request body, it is already in the URI. Use any of `parameters` and `runtime` inside the `configData` root element as you would when creating an asynchronous job. Using `storage` configuration in actions makes no sense, because actions cannot read or write to Storage. For instance:

{% highlight json %}

{
"configData": {
"parameters": {
"key": "val"
}
}
}

{% endhighlight %}

### Return Values

As the component output is passed back through the API, all output from an action **MUST** be JSON (except for errors).

If your component outputs an invalid JSON on its STDOUT, an application error will be raised.

## Handling User and Application errors

Actions use the same [exit codes](/extend/common-interface/environment/#return-values) as the default `run` action.

If an user or application error is detected, STDERR/STDOUT is handled as the message string and is returned to the user. The message is wrapped into a standardized structure.

For example

{% highlight python %}
print('user error message')
sys.exit(1)
{% endhighlight %}

yields this message on the API (HTTP status code 400)

{% highlight json %}
{
"status": "error",
"error": "User error",
"code": 400,
"message": "user error message",
"exceptionId": "docker-7ed4c3b599776e8a2a84a7f185f5f7f2",
"runId": 0
}
{% endhighlight %}

and

{% highlight python %}
print('application error message')
sys.exit(2)
{% endhighlight %}

yields this message on the API (HTTP status code 500)

{% highlight json %}
{
"status": "error",
"error": "Application error",
"code": 500,
"message": "Contact support@keboola.com and attach this exception id.",
"exceptionId": "docker-2a51922e0753cf78297ad6d384200206",
"runId": 0
}
{% endhighlight %}

## Limits

**Sync actions may not read from or write data to the Storage.**
Otherwise actions share the same limits as the default `run` action, only the execution time is limited to 30 seconds.
This time does not include pulling the Docker image.
Loading
Loading