更新时间:2023-12-13 GMT+08:00

FGS.DmsEventMap

模型说明

FGS.DmsEventMap元素用来创建函数工作流服务的DMS定时触发器资源。DMS触发器依赖分布式消息服务DMS,通过DMS事件触发函数执行。创建DMS触发器需开通DMS服务,并为函数配置访问DMS服务的IAM委托。

模型属性

表1 模型定义属性说明

属性

是否必选

描述

pollingInterval

拉取流数据的周期

参数类型:integer

取值说明:该字段为可选字段,单位是秒。当未配置该字段时,采用默认拉取流数据的周期30秒

默认值:30

取值约束:有效范围为1到60

使用建议:将该字段通过get_input函数传入,在AOS界面创建堆栈填写输入参数时可自动获取

queueId

DMS队列ID

参数类型:string

取值说明:该字段必选。该字段从已创建的DMS队列中获取

使用建议:将该字段通过get_input函数传入,在AOS界面创建堆栈填写输入参数时可自动获取

consumerGroupId

DMS消费组ID

参数类型:string

取值说明:该字段必选。该字段从已创建的DMS消费组中获取

使用建议:将该字段通过get_input函数传入,在AOS界面创建堆栈填写输入参数时可自动获取

funcId

函数urn

参数类型:string

使用建议:采用默认配置

关联关系

表2 关联关系说明

关系说明

关联节点

被包含关系

FGS.Function

输出

blueprint样例

tosca_definitions_version: huaweicloud_tosca_version_1_0
inputs:
  codeUrl:
    description: >-
      The address of the function code package on OBS. You need to upload the
      function code to OBS barrel in advance.
    label: Function
    type: string
  handler:
    default: index.handler
    description: >-
      The Execution Entry of the function. Default value is index. handler. It
      can be configured independently by code file name and entry function name.
    label: Function
    type: string
  memorySize:
    constraints:
      valid_values:
        - 128
        - 256
        - 512
        - 768
        - 1024
        - 1280
        - 1536
    default: 128
    description: The memory size of the function.
    label: Function
    type: integer
  name:
    constraints:
      regex: '^[a-zA-Z]([a-zA-Z0-9_-]*[a-zA-Z0-9])?$'
    default: image_watermark
    description: The name of the function.
    label: Function
    type: string
  runtime:
    constraints:
      valid_values:
        - Node.js6.10
        - Python2.7
        - Python3.6
        - Java8
        - Go1.8
        - Node.js8.10
    description: The runtime of the function.
    label: Function
    type: string
  timeout:
    constraints:
      in_range:
        - 3
        - 300
    default: 3
    description: The timeout of the function. The effective range is 3~300.
    label: Function
    type: integer
  xrole:
    description: The agency of the function. It should be created in advance.
    label: Function
    type: string
  dms_queue_id:
    description: Dms queue id.
    label: DMS trigger
    type: string
  dms_consumerGroup_id:
    description: Dms consumer group id.
    label: DMS trigger
    type: string
  dms_polling_interval:
    description: Interval at which messages are pulled from a DMS queue.
    default: 30
    type: integer
    constraints:
      in_range:
        - 1
        - 60
node_templates:
  fgsf36en:
    properties:
      codeUrl:
        get_input: codeUrl
      handler:
        get_input: handler
      memorySize:
        get_input: memorySize
      name:
        get_input: name
      role:
        get_input: xrole
      runtime:
        get_input: runtime
      timeout:
        get_input: timeout
      code: ''
      codeType: obs
    type: HuaweiCloud.FGS.Function
  fgsde1t5:
    type: HuaweiCloud.FGS.DmsEventMap
    properties:
      consumerGroupId:
        get_input: dms_consumerGroup_id
      queueId:
        get_input: dms_queue_id
      funcId:
        get_reference: fgsf36en
      pollingInterval:
        get_input: dms_polling_interval
    requirements:
      - funcId:
          node: fgsf36en
outputs:
  function-urn:
    description: function URN
    value:
      get_attribute:
        - fgsf36en
        - refID
  dms_trigger_info:
    description: DMS trigger info
    value:
      get_attribute:
        - fgsde1t5
        - dmsEventMap