美文网首页
【consul】consul tnx update接口

【consul】consul tnx update接口

作者: 不务正业的coder | 来源:发表于2020-02-18 12:34 被阅读0次

    注: 若通过cas更新,必须携带正确的ModifyIndex,否则会报错。

    1.请求http://consul.ali-bj-dev01.xx.net/v1/txn

    [
        {
            "Check":{
                "Verb":"cas",
                "Check":{
                    "Status":"passing",
                    "CheckID":"service:abapp.apps01.dev.xx.net-80",
                    "ServiceName":"abapp",
                    "Node":"aws_cn-northwest-1_dev_01",
                    "Definition":{
                        "Http":"http://abapp.apps01.dev.xx.net/abapp/home",
                        "Interval":"10s",
                        "DeregisterCriticalServiceAfter":"72h"
                    },
                    "ModifyIndex":56807,
                    "Name":"service-abapp-abapp.apps01.dev.xx.net-80",
                    "ServiceID":"abapp-abapp.apps01.dev.xx.ne-t80"
                }
            }
        }
    ]
    

    2.响应

    {
        "Results":[
            {
                "Check":{
                    "Node":"aws_cn-northwest-1_dev_01",
                    "CheckID":"service:abapp-abapp.apps01.dev.xx.net-80",
                    "Name":"service:[abapp-abapp.apps01.dev.caijj.net](http://abapp-abapp.apps01.dev.caijj.net/)-80",
                    "Status":"passing",
                    "Notes":"",
                    "Output":"",
                    "ServiceID":"[abapp-abapp.apps01.dev.xx.net-80",
                    "ServiceName":"abapp",
                    "ServiceTags":[
                        "secure=false",
                        "contextPath=/abapp"
                    ],
                    "Definition":{
                        "Interval":"10s",
                        "DeregisterCriticalServiceAfter":"72h0m0s",
                        "HTTP":"http://abapp.apps01.dev.xx.net/abapp/home"
                    },
                    "CreateIndex":19852,
                    "ModifyIndex":56807
                }
            }
        ],
        "Errors":null
    }
    

    相关文章

      网友评论

          本文标题:【consul】consul tnx update接口

          本文链接:https://www.haomeiwen.com/subject/mrlgfhtx.html