sendToCloud
A Workflow Engine function that builds a payload from a CEvent object and exports it (via REST) to a configured Moogsoft Cloud endpoint. Both the Moogsoft endpoint and payload are defined in the Moogsoft Hybrid integration (see Moogsoft Hybrid Integration Installation).
In addition, you can configure this function with a retry queue (see Retry Queues Integration)—a failed export to Moogsoft is retried based on the Retry Queue configuration. If the Retry Queue argument is omitted, no retry is attempted, and the failed export results in a lost event.
Note
If Events are being exported (in the Event Workflow Engine) then retries will not be enabled. The retry mechanism is only supported for alerts and Situations.
This function is available as a feature of the Add-ons v2.4 download and later.
This function is available for event, alert, and Situation workflows.
Back to Workflow Engine Functions Reference.
Arguments
Workflow Engine function sendToCloud
takes the following arguments:
Name | Required | Type | Description |
---|---|---|---|
| yes | string | The name of the Moogsoft endpoint configured in the Moogsoft Hybrid integration |
| yes | string | The name of the payload map configured in the Moogsoft Hybrid integration |
| no | string | The name of the retry queue configured in the Retry Queues integration. If this is omitted, failed exports are not retried. |
Example
The following example demonstrates typical use of Workflow Engine function sendToCloud
.
Given a Moogsoft Hybrid configuration containing a Moogsoft endpoint named “Prod," a payload map named “AlertExport”, and a RetryQueue configuration with a retry queue named “AlertRetry”:
endpointName
: ProdmapName
: AlertExportretryQueue
: AlertRetry
The UI translates your settings to the following JSON:
{"endpointName":"Prod","mapName":"AlertExport","retryQueue":"AlertRetry"}
This function returns true
if the export to the Moogsoft endpoint was successful (a 20x return code), or false
if the export failed for any reason (a non-20x code).
The retry mechanism (if enabled) does not take account of the error status; for example, an export that fails due to an invalid apiKey will still be retried to the retry limit configured for the specified retry queue.
Selecting the "send heartbeat" checkbox in the Moogsoft Hybrid Endpoint configuration allows heartbeat events to be generated from Moogsoft Onprem/Hosted to Moogsoft in the integration. A synthetic event is generated every 60 seconds.
Using the generic workflow functions
The Moogsoft Hybrid integration and sendToCloud
function perform the same actions as a set of generic WFE functions but as a convenient, single integration and function. If the functionality of these does not meet a requirement (for example, if complex payload manipulation is required before dispatch), then the same behavior can be achieved using the following steps:
Define your target Moogsoft system in the REST Endpoints integration.
Ensure the apiKey is added as an additional header.
Define you event payload in the Payloads integration.
Ensure that the core fields are mapped appropriately and any additional fields are of the correct type (specifically tags and location).
Define Retry Queue for retries to be attempted (recommended)
Create an Export workflow:
Use a
getPayload
function referencing the Payload configurationUse the
convertCustomInfoToTags
function if required.Use the
copyToPayload
function to copy the flattened tags from theworkflowContext
to the outbound payload.Use the
exportViaRestWithRetry
function referencing the REST endpoint configuration and Retry Queue configuration.