create-trigger

Description

After registering the trigger, every time data is input to the channel specified by the --input_service_id option, processing is performed using the model specified using--deployment_id and --version_id, andOutput to the channel specified by --output_service_id.

Synopsis

$ abeja model create-trigger [--help]
Usage: abeja model create-trigger [OPTIONS]

  Create trigger

Options:
  -d, --deployment_id TEXT        Deployment identifier  [required]
  -v, --version_id TEXT           Version identifier  [required]
  --input_service_name TEXT       Input service name  [required]
  --input_service_id TEXT         Input service id  [required]
  --output_service_name TEXT      Output service name
  --output_service_id TEXT        Output service id
  --retry_count INTEGER           Retry count. By default, retries 5 times.
  -e, --environment               ENVIRONMENTSTRING
                                  Trigger environment variable
  --help                          Show this message and exit.

Options

-d, --deployment_id Specify deployment_id issued by create-deployment command when input data to a input channel, run with using a model specified this extension (or --version_id)

-v, --version_id

Specify version_id issued by create-deployment command when input data to a input channel, run with using a model specified this extension (or --deployment_id)

--input_service_name

Specify a data type of a input channel Specify datalake or datamart-rdb depending on a input channel type. (you need to create a channel with datalake-API or database-API in advance)

--input_service_id

Specify CHANNEL_ID of a input channel

--output_service_name

Specify a data type of a output channel Specify datamart-rdb according to a output channel (you need to create a channel with database-API in advance)

--output_service_id

Specify channel ID to save the output data.

--retry_count You can specify the number of retries. The default is 5 times.

-e, --environment

Specifies environment variables. The registered environment variables can be referenced from the code. E.g.)IMAGE_WIDTH:100
For more information on user-specifiable environment variables, see here.

Example

Trigger registration

Prerequisite: - ModelDeployment、and Model version have already registered - Input channel and Output channel have already registered

Command:

$ abeja model create-trigger --deployment_id 1234567890123 \
                           --version_id ver-1234567890abcdef \
                           --input_service_name datamart-rdb \
                           --input_service_id 2345678901234 \
                           --output_service_name datamart-rdb \
                           --output_service_id 3456789012345

output:

{
  "deployment_id": "1234567890123",
  "input_service_id": "2345678901234",
  "input_service_name": "datamart-rdb",
  "model_version": "1.0",
  "model_version_id": "ver-1234567890abcdef",
  "output_service_id": "3456789012345",
  "output_service_name": "datamart-rdb",
  "trigger_id": "tri-f1234567890abcde"
}

trigger_id from output information is a extensiont of this trigger