全部产品
Search
文档中心

资源编排:DATASOURCE::KAFKA::Topic

更新时间:Oct 29, 2024

DATASOURCE::KAFKA::Topic类型用于获取Topic信息。

语法

{
  "Type": "DATASOURCE::KAFKA::Topic",
  "Properties": {
    "InstanceId": String,
    "Topic": String,
    "RefreshOptions": String
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

InstanceId

String

Topic所属实例的ID。

Topic

String

获取指定Topic信息的Topic名称。

RefreshOptions

String

当资源栈更新时,数据源资源的刷新策略。

有效值:

  • Never(默认值):更新堆栈时,从不刷新数据源资源。

  • Always:更新堆栈时,始终刷新数据源资源。

返回值

Fn::GetAtt

  • PartitionNum:Topic的分区数量。

  • CompactTopic:LocalTopic配置为true时,会配置日志清理策略。

  • InstanceId:实例ID。

  • CreateTime:创建时间戳。单位:毫秒

  • StatusName:服务状态名称。

  • TopicStatus:Topic状态。

  • Topic:Topic名称。

  • LocalTopic:Topic的存储引擎。

  • Tags:标签。

  • Remark:备注。

示例

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  InstanceId:
    Description:
      en: Resource id.
    Required: true
    Type: String
  Topic:
    Description:
      en: Topic Name.
    Required: true
    Type: String
Resources:
  ExtensionDataSource:
    Properties:
      InstanceId:
        Ref: InstanceId
      Topic:
        Ref: Topic
    Type: DATASOURCE::KAFKA::Topic
Outputs:
  CompactTopic:
    Description: Can log merge.
    Value:
      Fn::GetAtt:
      - ExtensionDataSource
      - CompactTopic
  CreateTime:
    Description: Creation time.
    Value:
      Fn::GetAtt:
      - ExtensionDataSource
      - CreateTime
  InstanceId:
    Description: Resource id.
    Value:
      Fn::GetAtt:
      - ExtensionDataSource
      - InstanceId
  LocalTopic:
    Description: Whether to store locally.
    Value:
      Fn::GetAtt:
      - ExtensionDataSource
      - LocalTopic
  PartitionNum:
    Description: Number of partitions.
    Value:
      Fn::GetAtt:
      - ExtensionDataSource
      - PartitionNum
  Remark:
    Description: Remarks.
    Value:
      Fn::GetAtt:
      - ExtensionDataSource
      - Remark
  StatusName:
    Description: Meaning of status value.
    Value:
      Fn::GetAtt:
      - ExtensionDataSource
      - StatusName
  Tags:
    Description: The tag of the kafka console, which is used to group instance,topic,
      and consumption.
    Value:
      Fn::GetAtt:
      - ExtensionDataSource
      - Tags
  Topic:
    Description: Topic Name.
    Value:
      Fn::GetAtt:
      - ExtensionDataSource
      - Topic
  TopicStatus:
    Description: The Topic status.
    Value:
      Fn::GetAtt:
      - ExtensionDataSource
      - TopicStatus
                        
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "InstanceId": {
      "Type": "String",
      "Description": {
        "en": "Resource id."
      },
      "Required": true
    },
    "Topic": {
      "Type": "String",
      "Description": {
        "en": "Topic Name."
      },
      "Required": true
    }
  },
  "Resources": {
    "ExtensionDataSource": {
      "Type": "DATASOURCE::KAFKA::Topic",
      "Properties": {
        "InstanceId": {
          "Ref": "InstanceId"
        },
        "Topic": {
          "Ref": "Topic"
        }
      }
    }
  },
  "Outputs": {
    "PartitionNum": {
      "Description": "Number of partitions.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "PartitionNum"
        ]
      }
    },
    "CompactTopic": {
      "Description": "Can log merge.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "CompactTopic"
        ]
      }
    },
    "InstanceId": {
      "Description": "Resource id.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "InstanceId"
        ]
      }
    },
    "CreateTime": {
      "Description": "Creation time.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "CreateTime"
        ]
      }
    },
    "StatusName": {
      "Description": "Meaning of status value.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "StatusName"
        ]
      }
    },
    "TopicStatus": {
      "Description": "The Topic status.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "TopicStatus"
        ]
      }
    },
    "Topic": {
      "Description": "Topic Name.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "Topic"
        ]
      }
    },
    "LocalTopic": {
      "Description": "Whether to store locally.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "LocalTopic"
        ]
      }
    },
    "Tags": {
      "Description": "The tag of the kafka console, which is used to group instance,topic, and consumption.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "Tags"
        ]
      }
    },
    "Remark": {
      "Description": "Remarks.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "Remark"
        ]
      }
    }
  }
}