From 140d810430a8bb26bb74a54a82954c461b354c8c Mon Sep 17 00:00:00 2001 From: sebprt Date: Thu, 6 Jul 2023 17:21:55 +0200 Subject: [PATCH 1/4] Started to write the documentation about actions --- config.toml | 17 ++++ content/action/custom/index.en.md | 32 +++++++ content/core-concept/action/index.end.md | 102 +++++++++++++++++++++++ 3 files changed, 151 insertions(+) create mode 100644 content/action/custom/index.en.md create mode 100644 content/core-concept/action/index.end.md diff --git a/config.toml b/config.toml index fdb6cb6..77dd943 100644 --- a/config.toml +++ b/config.toml @@ -68,6 +68,12 @@ hasChildren = true url = "core-concept/workflow" weight = 3 + [[menu.main]] + parent = "Core concepts" + name = "Action" + url = "core-concept/action" + weight = 4 + [[menu.main]] weight = 3 name = "Features" @@ -180,6 +186,17 @@ hasChildren = true url = "connectivity/filtering" weight = 12 +[[menu.main]] +name = "Actions" +weight = 4 +hasChildren = true + + [[menu.main]] + parent = "Actions" + name = "Custom" + url = "action/custom" + weight = 1 + [params] logo = "logo-web.svg" logo_white = "logo-web.svg" diff --git a/content/action/custom/index.en.md b/content/action/custom/index.en.md new file mode 100644 index 0000000..2524c78 --- /dev/null +++ b/content/action/custom/index.en.md @@ -0,0 +1,32 @@ +--- +title: "Custom" +date: 2023-07-06T15:54:13+02:00 +draft: false +weight: 1 +--- + +- [What is it ?](#what-is-it-) +- [Installation](#installation) +- [Usage](#usage) + - [Building an extractor](#building-an-extractor) + - [Building a transformer](#building-a-transformer) + - [Building a loader](#building-a-loader) +--- + +## Definition + +The custom connector allows you to use your own source code in your [actions](https://php-etl.github.io/documentation/core-concept/action/), +allowing you to connect tools that are not supported by the standard distribution. + +## Installation + +This feature is already integrated into the Satellite package, so you can’t require it with the composer. + +## Usage + +First you need to [determine your services](../../feature/services) in your pipeline or workflow and then use the `use` +option which allows you to define which service to use. + +```yaml + +``` diff --git a/content/core-concept/action/index.end.md b/content/core-concept/action/index.end.md new file mode 100644 index 0000000..0c574f7 --- /dev/null +++ b/content/core-concept/action/index.end.md @@ -0,0 +1,102 @@ +--- +title: "Action" +date: 2023-07-06T15:06:20+02:00 +draft: false +weight: 4 +--- + +{{< feature-state for_mw_version="0.1" state="alpha" >}} + +- [What is it for?](#what-is-it-for) +- [Installation](#installation) +- [Basic Usage](#basic-usage) +- [Advanced Usage](#advanced-usage) + - [Using expressions](#using-expressions) + - [Adding logger](#adding-logger) + - [Adding state](#adding-state) + +--- + +> An action is a process that enables a task to be carried out before, during or at the end of the execution of a workflow. + +## What is it for? + +This package provides a process capable of executing actions. + +## Installation + +```shell +composer require php-etl/action +``` + +## Basic usage + +At present, actions can only be used within a workflow. It is therefore not currently possible to launch an action on its own. + +```yaml +workflow: + jobs: + - action: # ... + - pipeline: # ... + - action: # ... +``` + +## Advanced usage + +### Using expressions + +It's possible to use expressions in your pipeline using the `expression_language` option. To use these expressions, +you need to use our customised Providers which provide the different expressions. For more information, please visit +the [detailed documentation](../../feature/expression-language) of the language expressions. + +```yaml +action: + expression_language: + - 'Kiboko\Component\Satellite\ExpressionLanguage\Provider' +``` + +### Adding logger + +It's possible to add a `logger` at each action of a workflow. + +For more details, go to the [detailed logger documentation](../../feature/logger). + +```yaml +satellite: + # ... + workflow: + jobs: + - action: + # ... + logger: + channel: pipeline + destinations: + - elasticsearch: + level: warning + hosts: + - http://user:password@elasticsearch.example.com:9200 +``` + +### Adding state + +It's possible to add a `state` at each action of a workflow. + +For more details, go to the [detailed state documentation](../../feature/state) + +```yaml +satellite: +# ... + workflow: + jobs: + - action: + # ... + state: + destinations: + - rabbitmq: + host: rabbitmq.example.com + vhost: / + topic: foo.rejects +``` + +> As you can see, actions are only able to manage the logs and states of their processes, +> but cannot deal with rejects that are contrary to pipelines. From a643a041bbd8716f1c6afe784ad40b4a75ad9cd7 Mon Sep 17 00:00:00 2001 From: sebprt Date: Thu, 21 Sep 2023 12:06:10 +0200 Subject: [PATCH 2/4] Improved the action documentation --- config.toml | 6 +++ .../{ => satellite}/action/index.end.md | 40 ++++++++++++++++--- 2 files changed, 41 insertions(+), 5 deletions(-) rename content/core-concept/{ => satellite}/action/index.end.md (72%) diff --git a/config.toml b/config.toml index 34dcca0..bea4c89 100644 --- a/config.toml +++ b/config.toml @@ -80,6 +80,12 @@ hasChildren = true url = "core-concept/satellite/http-api" weight = 5 + [[menu.main]] + parent = "Core concepts" + name = "Action" + url = "core-concept/satellite/action" + weight = 6 + [[menu.main]] weight = 3 name = "Features" diff --git a/content/core-concept/action/index.end.md b/content/core-concept/satellite/action/index.end.md similarity index 72% rename from content/core-concept/action/index.end.md rename to content/core-concept/satellite/action/index.end.md index 0c574f7..bf0031c 100644 --- a/content/core-concept/action/index.end.md +++ b/content/core-concept/satellite/action/index.end.md @@ -18,6 +18,7 @@ weight: 4 --- > An action is a process that enables a task to be carried out before, during or at the end of the execution of a workflow. +> For example, an action can be used to retrieve or upload files to an SFTP server. ## What is it for? @@ -37,8 +38,37 @@ At present, actions can only be used within a workflow. It is therefore not curr workflow: jobs: - action: # ... - - pipeline: # ... - - action: # ... +``` + +We've made sure that you can use your own actions. + +You need to implement the `Kiboko\Contract\Action\Interface` and in the `execute` method, you simply write your script. + +```php + Date: Thu, 21 Sep 2023 12:28:48 +0200 Subject: [PATCH 3/4] Improved the action documentation --- .../core-concept/satellite/action/{index.end.md => index.en.md} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename content/core-concept/satellite/action/{index.end.md => index.en.md} (99%) diff --git a/content/core-concept/satellite/action/index.end.md b/content/core-concept/satellite/action/index.en.md similarity index 99% rename from content/core-concept/satellite/action/index.end.md rename to content/core-concept/satellite/action/index.en.md index bf0031c..cfa9689 100644 --- a/content/core-concept/satellite/action/index.end.md +++ b/content/core-concept/satellite/action/index.en.md @@ -117,7 +117,7 @@ For more details, go to the [detailed state documentation](../../../feature/stat satellite: # ... workflow: - jobs: + jobs: - action: # ... state: From 4e34d12355c55707f3e02219744377afc4016a99 Mon Sep 17 00:00:00 2001 From: sebprt Date: Thu, 21 Sep 2023 12:29:01 +0200 Subject: [PATCH 4/4] Removed wrong content --- content/action/custom/index.en.md | 32 ------------------------------- 1 file changed, 32 deletions(-) delete mode 100644 content/action/custom/index.en.md diff --git a/content/action/custom/index.en.md b/content/action/custom/index.en.md deleted file mode 100644 index 2524c78..0000000 --- a/content/action/custom/index.en.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -title: "Custom" -date: 2023-07-06T15:54:13+02:00 -draft: false -weight: 1 ---- - -- [What is it ?](#what-is-it-) -- [Installation](#installation) -- [Usage](#usage) - - [Building an extractor](#building-an-extractor) - - [Building a transformer](#building-a-transformer) - - [Building a loader](#building-a-loader) ---- - -## Definition - -The custom connector allows you to use your own source code in your [actions](https://php-etl.github.io/documentation/core-concept/action/), -allowing you to connect tools that are not supported by the standard distribution. - -## Installation - -This feature is already integrated into the Satellite package, so you can’t require it with the composer. - -## Usage - -First you need to [determine your services](../../feature/services) in your pipeline or workflow and then use the `use` -option which allows you to define which service to use. - -```yaml - -```