Class: TencentCloud::Iotcloud::V20210408::TopicRulePayload

Inherits:
Common::AbstractModel
  • Object
show all
Defined in:
lib/v20210408/models.rb

Overview

创建规则请求包体

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(sql = nil, actions = nil, description = nil, ruledisabled = nil) ⇒ TopicRulePayload

Returns a new instance of TopicRulePayload.



4304
4305
4306
4307
4308
4309
# File 'lib/v20210408/models.rb', line 4304

def initialize(sql=nil, actions=nil, description=nil, ruledisabled=nil)
  @Sql = sql
  @Actions = actions
  @Description = description
  @RuleDisabled = ruledisabled
end

Instance Attribute Details

#ActionsObject

[

{
    "republish": {
        "topic": "TEST/test"
    }
},
{
    "forward": {
        "api": "http://127.0.0.1:8080",
        "token":"xxx"
    }
},
{
    "ckafka": {
        "instance": {
            "id": "ckafka-test",
            "name": ""
        },
        "topic": {
            "id": "topic-test",
            "name": "test"
        },
        "region": "gz"
    }
},
{
    "cmqqueue": {
        "queuename": "queue-test-TEST",
        "region": "gz"
    }
},
{
    "mysql": {
        "instanceid": "cdb-test",
        "region": "gz",
        "username": "test",
        "userpwd": "*****",
        "dbname": "d_mqtt",
        "tablename": "t_test",
        "fieldpairs": [
            {
                "field": "test",
                "value": "test"
            }
        ],
        "devicetype": "CUSTOM"
    }
}

]

Parameters:

  • Sql:

    规则的SQL语句,如: SELECT * FROM ‘pid/dname/event’,然后对其进行base64编码,得:U0VMRUNUICogRlJPTSAncGlkL2RuYW1lL2V2ZW50Jw==

  • Actions:

    行为的JSON字符串,大部分种类举例如下:

  • Description:

    规则描述

  • RuleDisabled:

    是否禁用规则



4302
4303
4304
# File 'lib/v20210408/models.rb', line 4302

def Actions
  @Actions
end

#DescriptionObject

[

{
    "republish": {
        "topic": "TEST/test"
    }
},
{
    "forward": {
        "api": "http://127.0.0.1:8080",
        "token":"xxx"
    }
},
{
    "ckafka": {
        "instance": {
            "id": "ckafka-test",
            "name": ""
        },
        "topic": {
            "id": "topic-test",
            "name": "test"
        },
        "region": "gz"
    }
},
{
    "cmqqueue": {
        "queuename": "queue-test-TEST",
        "region": "gz"
    }
},
{
    "mysql": {
        "instanceid": "cdb-test",
        "region": "gz",
        "username": "test",
        "userpwd": "*****",
        "dbname": "d_mqtt",
        "tablename": "t_test",
        "fieldpairs": [
            {
                "field": "test",
                "value": "test"
            }
        ],
        "devicetype": "CUSTOM"
    }
}

]

Parameters:

  • Sql:

    规则的SQL语句,如: SELECT * FROM ‘pid/dname/event’,然后对其进行base64编码,得:U0VMRUNUICogRlJPTSAncGlkL2RuYW1lL2V2ZW50Jw==

  • Actions:

    行为的JSON字符串,大部分种类举例如下:

  • Description:

    规则描述

  • RuleDisabled:

    是否禁用规则



4302
4303
4304
# File 'lib/v20210408/models.rb', line 4302

def Description
  @Description
end

#RuleDisabledObject

[

{
    "republish": {
        "topic": "TEST/test"
    }
},
{
    "forward": {
        "api": "http://127.0.0.1:8080",
        "token":"xxx"
    }
},
{
    "ckafka": {
        "instance": {
            "id": "ckafka-test",
            "name": ""
        },
        "topic": {
            "id": "topic-test",
            "name": "test"
        },
        "region": "gz"
    }
},
{
    "cmqqueue": {
        "queuename": "queue-test-TEST",
        "region": "gz"
    }
},
{
    "mysql": {
        "instanceid": "cdb-test",
        "region": "gz",
        "username": "test",
        "userpwd": "*****",
        "dbname": "d_mqtt",
        "tablename": "t_test",
        "fieldpairs": [
            {
                "field": "test",
                "value": "test"
            }
        ],
        "devicetype": "CUSTOM"
    }
}

]

Parameters:

  • Sql:

    规则的SQL语句,如: SELECT * FROM ‘pid/dname/event’,然后对其进行base64编码,得:U0VMRUNUICogRlJPTSAncGlkL2RuYW1lL2V2ZW50Jw==

  • Actions:

    行为的JSON字符串,大部分种类举例如下:

  • Description:

    规则描述

  • RuleDisabled:

    是否禁用规则



4302
4303
4304
# File 'lib/v20210408/models.rb', line 4302

def RuleDisabled
  @RuleDisabled
end

#SqlObject

[

{
    "republish": {
        "topic": "TEST/test"
    }
},
{
    "forward": {
        "api": "http://127.0.0.1:8080",
        "token":"xxx"
    }
},
{
    "ckafka": {
        "instance": {
            "id": "ckafka-test",
            "name": ""
        },
        "topic": {
            "id": "topic-test",
            "name": "test"
        },
        "region": "gz"
    }
},
{
    "cmqqueue": {
        "queuename": "queue-test-TEST",
        "region": "gz"
    }
},
{
    "mysql": {
        "instanceid": "cdb-test",
        "region": "gz",
        "username": "test",
        "userpwd": "*****",
        "dbname": "d_mqtt",
        "tablename": "t_test",
        "fieldpairs": [
            {
                "field": "test",
                "value": "test"
            }
        ],
        "devicetype": "CUSTOM"
    }
}

]

Parameters:

  • Sql:

    规则的SQL语句,如: SELECT * FROM ‘pid/dname/event’,然后对其进行base64编码,得:U0VMRUNUICogRlJPTSAncGlkL2RuYW1lL2V2ZW50Jw==

  • Actions:

    行为的JSON字符串,大部分种类举例如下:

  • Description:

    规则描述

  • RuleDisabled:

    是否禁用规则



4302
4303
4304
# File 'lib/v20210408/models.rb', line 4302

def Sql
  @Sql
end

Instance Method Details

#deserialize(params) ⇒ Object



4311
4312
4313
4314
4315
4316
# File 'lib/v20210408/models.rb', line 4311

def deserialize(params)
  @Sql = params['Sql']
  @Actions = params['Actions']
  @Description = params['Description']
  @RuleDisabled = params['RuleDisabled']
end