Consul ACL规范规范(HTTP API)

时间:2016-10-06 17:21:40

标签: acl consul

我正在尝试通过HTTP API发送以下JSON来修改我刚刚创建的ACL令牌:

{
  "ID": "UUID HERE",
  "Name": "loadbalancer",
  "Type": "client",
  "Rules": "service {policy=read}"
}

但是,我的规则的这种语法被拒绝了。我也尝试过以JSON格式发送信息,类似于ACL Internals页面中记录的信息:

{
  "ID: "UUID HERE",
  "Name": "loadbalancer",
  "Type": "client",
  "Rules": 
  {
    "service":
    {
      "": { "policy": "read" }
    }
  }
}

这些都被拒绝,因为格式不正确。这里的语法是什么?

1 个答案:

答案 0 :(得分:0)

{
      "ID: "UUID HERE", ==> missing double quote in "ID"
      "Name": "loadbalancer",
      "Type": "client",
      "Rules": 
      {
        "service":
        {
          "": { "policy": "read" }
        }
      }
    }