Skip to main content

CronReplace

@webda/kubernetes


Function: CronReplace()

CronReplace(template, cron, replacements?): any

Defined in: kubernetes/src/cron.ts:16

Replaces placeholders in a given template string with values from a CronDefinition object and other replacements.

Besides the CronDefinition fields (cron.operationId, cron.cron, ...), the cron exposes:

  • operationName: the operation id with its dots replaced by dashes, usable in a resource name
  • inputJson: the operation input as JSON
  • inputb64: the operation input as base64 encoded JSON

Parameters​

template​

any

The template string to replace placeholders in.

cron​

CronDefinition

The CronDefinition object containing values to replace placeholders with.

replacements?​

any = {}

Optional additional replacements to use in the template string.

Returns​

any

The template string with all placeholders replaced with their corresponding values.