无标题文章

    <!DOCTYPE html>
      <head>
        <title>API</title>
        <meta charset="utf-8">
        <style>body {

width: 65%;
border: 1px solid #ddd;
outline: 1300px solid #fff;
margin: 16px auto;
}
body .markdown-body {
padding: 30px;
}
@font-face {
font-family: octicons-anchor;
src: url(data:font/woff;charset=utf-8;base64,d09GRgABAAAAAAYcAA0AAAAACjQAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAABMAAAABwAAAAca8vGTk9TLzIAAAFMAAAARAAAAFZG1VHVY21hcAAAAZAAAAA+AAABQgAP9AdjdnQgAAAB0AAAAAQAAAAEACICiGdhc3AAAAHUAAAACAAAAAj//wADZ2x5ZgAAAdwAAADRAAABEKyikaNoZWFkAAACsAAAAC0AAAA2AtXoA2hoZWEAAALgAAAAHAAAACQHngNFaG10eAAAAvwAAAAQAAAAEAwAACJsb2NhAAADDAAAAAoAAAAKALIAVG1heHAAAAMYAAAAHwAAACABEAB2bmFtZQAAAzgAAALBAAAFu3I9x/Nwb3N0AAAF/AAAAB0AAAAvaoFvbwAAAAEAAAAAzBdyYwAAAADP2IQvAAAAAM/bz7t4nGNgZGFgnMDAysDB1Ml0hoGBoR9CM75mMGLkYGBgYmBlZsAKAtJcUxgcPsR8iGF2+O/AEMPsznAYKMwIkgMA5REMOXicY2BgYGaAYBkGRgYQsAHyGMF8FgYFIM0ChED+h5j//yEk/3KoSgZGNgYYk4GRCUgwMaACRoZhDwCs7QgGAAAAIgKIAAAAAf//AAJ4nHWMMQrCQBBF/0zWrCCIKUQsTDCL2EXMohYGSSmorScInsRGL2DOYJe0Ntp7BK+gJ1BxF1stZvjz/v8DRghQzEc4kIgKwiAppcA9LtzKLSkdNhKFY3HF4lK69ExKslx7Xa+vPRVS43G98vG1DnkDMIBUgFN0MDXflU8tbaZOUkXUH0+U27RoRpOIyCKjbMCVejwypzJJG4jIwb43rfl6wbwanocrJm9XFYfskuVC5K/TPyczNU7b84CXcbxks1Un6H6tLH9vf2LRnn8Ax7A5WQAAAHicY2BkYGAA4teL1+yI57f5ysDNwgAC529f0kOmWRiYVgEpDgYmEA8AUzEKsQAAAHicY2BkYGB2+O/AEMPCAAJAkpEBFbAAADgKAe0EAAAiAAAAAAQAAAAEAAAAAAAAKgAqACoAiAAAeJxjYGRgYGBhsGFgYgABEMkFhAwM/xn0QAIAD6YBhwB4nI1Ty07cMBS9QwKlQapQW3VXySvEqDCZGbGaHULiIQ1FKgjWMxknMfLEke2A+IJu+wntrt/QbVf9gG75jK577Lg8K1qQPCfnnnt8fX1NRC/pmjrk/zprC+8D7tBy9DHgBXoWfQ44Av8t4Bj4Z8CLtBL9CniJluPXASf0Lm4CXqFX8Q84dOLnMB17N4c7tBo1AS/Qi+hTwBH4rwHHwN8DXqQ30XXAS7QaLwSc0Gn8NuAVWou/gFmnjLrEaEh9GmDdDGgL3B4JsrRPDU2hTOiMSuJUIdKQQayiAth69r6akSSFqIJuA19TrzCIaY8sIoxyrNIrL//pw7A2iMygkX5vDj+G+kuoLdX4GlGK/8Lnlz6/h9MpmoO9rafrz7ILXEHHaAx95s9lsI7AHNMBWEZHULnfAXwG9/ZqdzLI08iuwRloXE8kfhXYAvE23+23DU3t626rbs8/8adv+9DWknsHp3E17oCf+Z48rvEQNZ78paYM38qfk3v/u3l3u3GXN2Dmvmvpf1Srwk3pB/VSsp512bA/GG5i2WJ7wu430yQ5K3nFGiOqgtmSB5pJVSizwaacmUZzZhXLlZTq8qGGFY2YcSkqbth6aW1tRmlaCFs2016m5qn36SbJrqosG4uMV4aP2PHBmB3tjtmgN2izkGQyLWprekbIntJFing32a5rKWCN/SdSoga45EJykyQ7asZvHQ8PTm6cslIpwyeyjbVltNikc2HTR7YKh9LBl9DADC0U/jLcBZDKrMhUBfQBvXRzLtFtjU9eNHKin0x5InTqb8lNpfKv1s1xHzTXRqgKzek/mb7nB8RZTCDhGEX3kK/8Q75AmUM/eLkfA+0Hi908Kx4eNsMgudg5GLdRD7a84npi+YxNr5i5KIbW5izXas7cHXIMAau1OueZhfj+cOcP3P8MNIWLyYOBuxL6DRylJ4cAAAB4nGNgYoAALjDJyIAOWMCiTIxMLDmZedkABtIBygAAAA==) format('woff');
}
.markdown-body {
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
color: #333;
font-family: "Helvetica Neue", Helvetica, "Segoe UI", Arial, freesans, sans-serif;
font-size: 16px;
line-height: 1.6;
word-wrap: break-word;
}
.markdown-body a {
background: transparent;
}
.markdown-body a:active,
.markdown-body a:hover {
outline: 0;
}
.markdown-body strong {
font-weight: bold;
}
.markdown-body h1 {
font-size: 2em;
margin: 0.67em 0;
}
.markdown-body img {
border: 0;
}
.markdown-body hr {
-moz-box-sizing: content-box;
box-sizing: content-box;
height: 0;
}
.markdown-body pre {
overflow: auto;
}
.markdown-body code,
.markdown-body kbd,
.markdown-body pre {
font-family: monospace, monospace;
font-size: 1em;
}
.markdown-body input {
color: inherit;
font: inherit;
margin: 0;
}
.markdown-body html input[disabled] {
cursor: default;
}
.markdown-body input {
line-height: normal;
}
.markdown-body input[type="checkbox"] {
-moz-box-sizing: border-box;
box-sizing: border-box;
padding: 0;
}
.markdown-body table {
border-collapse: collapse;
border-spacing: 0;
}
.markdown-body td,
.markdown-body th {
padding: 0;
}
.markdown-body _ {
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.markdown-body input {
font: 13px/1.4 Helvetica, arial, freesans, clean, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol";
}
.markdown-body a {
color: #4183c4;
text-decoration: none;
}
.markdown-body a:hover,
.markdown-body a:focus,
.markdown-body a:active {
text-decoration: underline;
}
.markdown-body hr {
height: 0;
margin: 15px 0;
overflow: hidden;
background: transparent;
border: 0;
border-bottom: 1px solid #ddd;
}
.markdown-body hr:before {
display: table;
content: "";
}
.markdown-body hr:after {
display: table;
clear: both;
content: "";
}
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
margin-top: 15px;
margin-bottom: 15px;
line-height: 1.1;
}
.markdown-body h1 {
font-size: 30px;
}
.markdown-body h2 {
font-size: 21px;
}
.markdown-body h3 {
font-size: 16px;
}
.markdown-body h4 {
font-size: 14px;
}
.markdown-body h5 {
font-size: 12px;
}
.markdown-body h6 {
font-size: 11px;
}
.markdown-body blockquote {
margin: 0;
}
.markdown-body ul,
.markdown-body ol {
padding: 0;
margin-top: 0;
margin-bottom: 0;
}
.markdown-body ol ol,
.markdown-body ul ol {
list-style-type: lower-roman;
}
.markdown-body ul ul ol,
.markdown-body ul ol ol,
.markdown-body ol ul ol,
.markdown-body ol ol ol {
list-style-type: lower-alpha;
}
.markdown-body dd {
margin-left: 0;
}
.markdown-body code {
font: 12px Consolas, "Liberation Mono", Menlo, Courier, monospace;
}
.markdown-body pre {
margin-top: 0;
margin-bottom: 0;
font: 12px Consolas, "Liberation Mono", Menlo, Courier, monospace;
}
.markdown-body .octicon {
font: normal normal 16px octicons-anchor;
line-height: 1;
display: inline-block;
text-decoration: none;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.markdown-body .octicon-link:before {
content: '\f05c';
}
.markdown-body > _:first-child {
margin-top: 0 !important;
}
.markdown-body > *:last-child {
margin-bottom: 0 !important;
}
.markdown-body .anchor {
position: absolute;
top: 0;
bottom: 0;
left: 0;
display: block;
padding-right: 6px;
padding-left: 30px;
margin-left: -30px;
}
.markdown-body .anchor:focus {
outline: none;
}
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
position: relative;
margin-top: 1em;
margin-bottom: 16px;
font-weight: bold;
line-height: 1.4;
}
.markdown-body h1 .octicon-link,
.markdown-body h2 .octicon-link,
.markdown-body h3 .octicon-link,
.markdown-body h4 .octicon-link,
.markdown-body h5 .octicon-link,
.markdown-body h6 .octicon-link {
display: none;
color: #000;
vertical-align: middle;
}
.markdown-body h1:hover .anchor,
.markdown-body h2:hover .anchor,
.markdown-body h3:hover .anchor,
.markdown-body h4:hover .anchor,
.markdown-body h5:hover .anchor,
.markdown-body h6:hover .anchor {
padding-left: 8px;
margin-left: -30px;
line-height: 1;
text-decoration: none;
}
.markdown-body h1:hover .anchor .octicon-link,
.markdown-body h2:hover .anchor .octicon-link,
.markdown-body h3:hover .anchor .octicon-link,
.markdown-body h4:hover .anchor .octicon-link,
.markdown-body h5:hover .anchor .octicon-link,
.markdown-body h6:hover .anchor .octicon-link {
display: inline-block;
}
.markdown-body h1 {
padding-bottom: 0.3em;
font-size: 2.25em;
line-height: 1.2;
border-bottom: 1px solid #eee;
}
.markdown-body h2 {
padding-bottom: 0.3em;
font-size: 1.75em;
line-height: 1.225;
border-bottom: 1px solid #eee;
}
.markdown-body h3 {
font-size: 1.5em;
line-height: 1.43;
}
.markdown-body h4 {
font-size: 1.25em;
}
.markdown-body h5 {
font-size: 1em;
}
.markdown-body h6 {
font-size: 1em;
color: #777;
}
.markdown-body p,
.markdown-body blockquote,
.markdown-body ul,
.markdown-body ol,
.markdown-body dl,
.markdown-body table,
.markdown-body pre {
margin-top: 0;
margin-bottom: 16px;
}
.markdown-body hr {
height: 4px;
padding: 0;
margin: 16px 0;
background-color: #e7e7e7;
border: 0 none;
}
.markdown-body ul,
.markdown-body ol {
padding-left: 2em;
}
.markdown-body ul ul,
.markdown-body ul ol,
.markdown-body ol ol,
.markdown-body ol ul {
margin-top: 0;
margin-bottom: 0;
}
.markdown-body li > p {
margin-top: 16px;
}
.markdown-body dl {
padding: 0;
}
.markdown-body dl dt {
padding: 0;
margin-top: 16px;
font-size: 1em;
font-style: italic;
font-weight: bold;
}
.markdown-body dl dd {
padding: 0 16px;
margin-bottom: 16px;
}
.markdown-body blockquote {
padding: 0 15px;
color: #777;
border-left: 4px solid #ddd;
}
.markdown-body blockquote > :first-child {
margin-top: 0;
}
.markdown-body blockquote > :last-child {
margin-bottom: 0;
}
.markdown-body table {
display: block;
width: 100%;
overflow: auto;
word-break: normal;
word-break: keep-all;
}
.markdown-body table th {
font-weight: bold;
}
.markdown-body table th,
.markdown-body table td {
padding: 6px 13px;
border: 1px solid #ddd;
}
.markdown-body table tr {
background-color: #fff;
border-top: 1px solid #ccc;
}
.markdown-body table tr:nth-child(2n) {
background-color: #f8f8f8;
}
.markdown-body img {
max-width: 100%;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.markdown-body code {
padding: 0;
padding-top: 0.2em;
padding-bottom: 0.2em;
margin: 0;
font-size: 85%;
background-color: rgba(0, 0, 0, 0.04);
border-radius: 3px;
}
.markdown-body code:before,
.markdown-body code:after {
letter-spacing: -0.2em;
content: "\00a0";
}
.markdown-body pre > code {
padding: 0;
margin: 0;
font-size: 100%;
word-break: normal;
white-space: pre;
background: transparent;
border: 0;
}
.markdown-body .highlight {
margin-bottom: 16px;
}
.markdown-body .highlight pre,
.markdown-body pre {
padding: 16px;
overflow: auto;
font-size: 85%;
line-height: 1.45;
background-color: #f7f7f7;
border-radius: 3px;
}
.markdown-body .highlight pre {
margin-bottom: 0;
word-break: normal;
}
.markdown-body pre {
word-wrap: normal;
}
.markdown-body pre code {
display: inline;
max-width: initial;
padding: 0;
margin: 0;
overflow: initial;
line-height: inherit;
word-wrap: normal;
background-color: transparent;
border: 0;
}
.markdown-body pre code:before,
.markdown-body pre code:after {
content: normal;
}
.markdown-body .pl-c {
color: #969896;
}
.markdown-body .pl-c1,
.markdown-body .pl-mdh,
.markdown-body .pl-mm,
.markdown-body .pl-mp,
.markdown-body .pl-mr,
.markdown-body .pl-s1 .pl-v,
.markdown-body .pl-s3,
.markdown-body .pl-sc,
.markdown-body .pl-sv {
color: #0086b3;
}
.markdown-body .pl-e,
.markdown-body .pl-en {
color: #795da3;
}
.markdown-body .pl-s1 .pl-s2,
.markdown-body .pl-smi,
.markdown-body .pl-smp,
.markdown-body .pl-stj,
.markdown-body .pl-vo,
.markdown-body .pl-vpf {
color: #333;
}
.markdown-body .pl-ent {
color: #63a35c;
}
.markdown-body .pl-k,
.markdown-body .pl-s,
.markdown-body .pl-st {
color: #a71d5d;
}
.markdown-body .pl-pds,
.markdown-body .pl-s1,
.markdown-body .pl-s1 .pl-pse .pl-s2,
.markdown-body .pl-sr,
.markdown-body .pl-sr .pl-cce,
.markdown-body .pl-sr .pl-sra,
.markdown-body .pl-sr .pl-sre,
.markdown-body .pl-src,
.markdown-body .pl-v {
color: #df5000;
}
.markdown-body .pl-id {
color: #b52a1d;
}
.markdown-body .pl-ii {
background-color: #b52a1d;
color: #f8f8f8;
}
.markdown-body .pl-sr .pl-cce {
color: #63a35c;
font-weight: bold;
}
.markdown-body .pl-ml {
color: #693a17;
}
.markdown-body .pl-mh,
.markdown-body .pl-mh .pl-en,
.markdown-body .pl-ms {
color: #1d3e81;
font-weight: bold;
}
.markdown-body .pl-mq {
color: #008080;
}
.markdown-body .pl-mi {
color: #333;
font-style: italic;
}
.markdown-body .pl-mb {
color: #333;
font-weight: bold;
}
.markdown-body .pl-md,
.markdown-body .pl-mdhf {
background-color: #ffecec;
color: #bd2c00;
}
.markdown-body .pl-mdht,
.markdown-body .pl-mi1 {
background-color: #eaffea;
color: #55a532;
}
.markdown-body .pl-mdr {
color: #795da3;
font-weight: bold;
}
.markdown-body .pl-mo {
color: #1d3e81;
}
.markdown-body kbd {
background-color: #e7e7e7;
background-image: -webkit-linear-gradient(#fefefe, #e7e7e7);
background-image: linear-gradient(#fefefe, #e7e7e7);
background-repeat: repeat-x;
display: inline-block;
padding: 3px 5px;
font: 11px Consolas, "Liberation Mono", Menlo, Courier, monospace;
line-height: 10px;
color: #000;
border: 1px solid #cfcfcf;
border-radius: 2px;
}
.markdown-body .task-list-item {
list-style-type: none;
}
.markdown-body .task-list-item + .task-list-item {
margin-top: 3px;
}
.markdown-body .task-list-item input {
float: left;
margin: 0.3em 0 0.25em -1.6em;
vertical-align: middle;
}
.file {
list-style-image: url('https://cdn4.iconfinder.com/data/icons/linecon/512/file-16.png');
}
.dir {
list-style-image: url('https://cdn1.iconfinder.com/data/icons/hawcons/32/699086-icon-94-folder-16.png');
}
.md {
list-style-image: url('https://cdn0.iconfinder.com/data/icons/octicons/1024/markdown-16.png');
}
</style>

        <link rel="stylesheet" href="//sindresorhus.com/github-markdown-css/github-markdown.css">
        <script src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
        <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/highlight.min.js"></script>
        <link rel="stylesheet" href="https://highlightjs.org/static/demo/styles/github-gist.css">
        <script type="text/x-mathjax-config">

MathJax.Hub.Config({
tex2jax: {inlineMath: [['','']]}
});
</script>

<script type="text/javascript" async
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>

      </head>
      <body>
        <article class="markdown-body"><h2 id="-">目录</h2>

<ol>
<li><a href="#-未命名接口">未命名接口</a></li>
<li><a href="#-创建用户组">创建用户组</a></li>
<li><a href="#-修改用户组">修改用户组</a></li>
<li><a href="#-查询用户所在的用户组">查询用户所在的用户组</a></li>
<li><a href="#-创建实例旧">创建实例(旧)</a></li>
<li><a href="#-修改实例旧">修改实例(旧)</a></li>
<li><a href="#-批量删除实例接口旧">批量删除实例接口(旧)</a></li>
<li><a href="#-批量创建对象实例">批量创建对象实例</a></li>
<li><a href="#-查询模型工具盒子列表">查询模型工具盒子列表</a></li>
<li><a href="#-新建修改任意门工具列表">新建修改任意门工具列表</a></li>
<li><a href="#-创建单个任意门工具盒子">创建单个任意门工具盒子</a></li>
<li><a href="#-修改指定模型单个任意门信息">修改指定模型单个任意门信息</a></li>
<li><a href="#-获取指定模型单个任意门信息">获取指定模型单个任意门信息</a></li>
<li><a href="#-修删除指定模型单个任意门">修删除指定模型单个任意门</a></li>
<li><a href="#-修改模型任意门状态">修改模型任意门状态</a></li>
<li><a href="#-获取模型任意门状态">获取模型任意门状态</a></li>
<li><a href="#-管理员查询用户">管理员查询用户</a></li>
<li><a href="#-管理员修改用户信息">管理员修改用户信息</a></li>
<li><a href="#-管理员查询所有用户信息">管理员查询所有用户信息</a></li>
<li><a href="#-管理员删除用户信息">管理员删除用户信息</a></li>
<li><a href="#-管理员禁用用户">管理员禁用用户</a></li>
<li><a href="#-管理员解禁用户">管理员解禁用户</a></li>
<li><a href="#-用户id列表查询">用户ID列表查询</a></li>
<li><a href="#-用户id/昵称映射列表查询">用户ID/昵称映射列表查询</a></li>
<li><a href="#-查询用户登录信息">查询用户登录信息</a></li>
<li><a href="#-查询所有org">查询所有org</a></li>
<li><a href="#-查询设备列表">查询设备列表</a></li>
<li><a href="#-自动注册设备信息">自动注册设备信息</a></li>
<li><a href="#-根据设备查应用">根据设备查应用</a></li>
<li><a href="#-查询设备信息,支持批量">查询设备信息,支持批量</a></li>
<li><a href="#-用户注册接口">用户注册接口</a></li>
<li><a href="#-绑定流水线">绑定流水线</a></li>
<li><a href="#-解绑流水线">解绑流水线</a></li>
<li><a href="#-列出流水线">列出流水线</a></li>
<li><a href="#-查询流水线">查询流水线</a></li>
<li><a href="#-修改流水线">修改流水线</a></li>
<li><a href="#-根据key-value查询集群列表">根据key value查询集群列表</a></li>
<li><a href="#-批量获取集群列表">批量获取集群列表</a></li>
<li><a href="#-根据应用获取集群列表">根据应用获取集群列表</a></li>
<li><a href="#-获取集群信息">获取集群信息</a></li>
<li><a href="#-安装agent">安装agent</a></li>
<li><a href="#-查询安装结果">查询安装结果</a></li>
<li><a href="#-获取agent安装密钥">获取agent安装密钥</a></li>
<li><a href="#-获取agent代理安装脚本">获取agent代理安装脚本</a></li>
<li><a href="#-获取agent安装脚本">获取agent安装脚本</a></li>
<li><a href="#-查询邀请码">查询邀请码</a></li>
<li><a href="#-重置邀请码">重置邀请码</a></li>
<li><a href="#-创建集群">创建集群</a></li>
<li><a href="#-修改集群">修改集群</a></li>
<li><a href="#-删除集群">删除集群</a></li>
<li><a href="#-集群添加设备">集群添加设备</a></li>
<li><a href="#-解除集群关联设备">解除集群关联设备</a></li>
<li><a href="#-集群关联包">集群关联包</a></li>
<li><a href="#-解除集群关联包">解除集群关联包</a></li>
<li><a href="#-修改集群关联包">修改集群关联包</a></li>
<li><a href="#-管理员修改用户信息">管理员修改用户信息</a></li>
<li><a href="#-用户邀请注册">用户邀请注册</a></li>
<li><a href="#-分页查询apikey">分页查询apikey</a></li>
<li><a href="#-创建apikey">创建apikey</a></li>
<li><a href="#-重置apikey">重置apikey</a></li>
<li><a href="#-启用apikey">启用apikey</a></li>
<li><a href="#-禁用apikey">禁用apikey</a></li>
<li><a href="#-删除apikey">删除apikey</a></li>
<li><a href="#-获取所有密钥对">获取所有密钥对</a></li>
<li><a href="#-获取密钥对">获取密钥对</a></li>
<li><a href="#-添加密钥对">添加密钥对</a></li>
<li><a href="#-修改密钥对">修改密钥对</a></li>
<li><a href="#-删除密钥对">删除密钥对</a></li>
<li><a href="#-创建订阅规则">创建订阅规则</a></li>
<li><a href="#-修改订阅规则">修改订阅规则</a></li>
<li><a href="#-删除订阅规则">删除订阅规则</a></li>
<li><a href="#-获取订阅规则">获取订阅规则</a></li>
<li><a href="#-查询关系查询策略是否被订阅规则使用">查询关系查询策略是否被订阅规则使用</a></li>
<li><a href="#-发送邮件">发送邮件</a></li>
<li><a href="#-用户登录">用户登录</a></li>
<li><a href="#-发现基础拓扑节点信息">发现基础拓扑节点信息</a></li>
<li><a href="#-查询基础拓扑节点信息">查询基础拓扑节点信息</a></li>
<li><a href="#-删除基础拓扑节点信息">删除基础拓扑节点信息</a></li>
<li><a href="#-创建基础拓扑节点信息">创建基础拓扑节点信息</a></li>
<li><a href="#-更新基础拓扑节点信息">更新基础拓扑节点信息</a></li>
<li><a href="#-查询拓扑信息">查询拓扑信息</a></li>
<li><a href="#-创建拓扑信息">创建拓扑信息</a></li>
<li><a href="#-更新拓扑信息">更新拓扑信息</a></li>
<li><a href="#-删除拓扑信息">删除拓扑信息</a></li>
<li><a href="#-获取应用信息">获取应用信息</a></li>
<li><a href="#-创建应用">创建应用</a></li>
<li><a href="#-修改应用">修改应用</a></li>
<li><a href="#-删除应用">删除应用</a></li>
<li><a href="#-应用关联程序包">应用关联程序包</a></li>
<li><a href="#-应用解除关联包">应用解除关联包</a></li>
<li><a href="#-修改应用关联包">修改应用关联包</a></li>
<li><a href="#-程序包排序">程序包排序</a></li>
<li><a href="#-创建文档">创建文档</a></li>
<li><a href="#-修改文档">修改文档</a></li>
<li><a href="#-查询文档">查询文档</a></li>
<li><a href="#-查询所有文档">查询所有文档</a></li>
<li><a href="#-删除文档">删除文档</a></li>
<li><a href="#-搜索文档">搜索文档</a></li>
<li><a href="#-通过用户-instanceid-或者用户组-instanceid发送邮件">通过用户 instanceId 或者用户组 instanceId发送邮件</a></li>
<li><a href="#-查询单个资源模型">查询单个资源模型</a></li>
<li><a href="#-分页查询资源模型">分页查询资源模型</a></li>
<li><a href="#-创建资源模型">创建资源模型</a></li>
<li><a href="#-修改资源模型">修改资源模型</a></li>
<li><a href="#-删除资源模型">删除资源模型</a></li>
<li><a href="#-引用对象反向查询接口">引用对象反向查询接口</a></li>
<li><a href="#-添加资源模型属性">添加资源模型属性</a></li>
<li><a href="#-查询资源模型属性列表">查询资源模型属性列表</a></li>
<li><a href="#-获取资源模型属性">获取资源模型属性</a></li>
<li><a href="#-删除资源模型属性">删除资源模型属性</a></li>
<li><a href="#-修改资源模型属性">修改资源模型属性</a></li>
<li><a href="#-查询剩余可自定义对象数量">查询剩余可自定义对象数量</a></li>
<li><a href="#-查询图标和模型对应关系">查询图标和模型对应关系</a></li>
<li><a href="#-新建实例手动审计日志记录">新建实例手动审计日志记录</a></li>
<li><a href="#-新建实例自动巡检审计日志记录">新建实例自动巡检审计日志记录</a></li>
<li><a href="#-用户组id列表查询">用户组ID列表查询</a></li>
<li><a href="#-用户组id名称映射列表查询">用户组ID名称映射列表查询</a></li>
<li><a href="#-全文搜索接口">全文搜索接口</a></li>
<li><a href="#-全文搜索接口">全文搜索接口</a></li>
<li><a href="#-单个实例查询接口">单个实例查询接口</a></li>
<li><a href="#-分页查询实例">分页查询实例</a></li>
<li><a href="#-分页查询归档实例">分页查询归档实例</a></li>
<li><a href="#-归档实例">归档实例</a></li>
<li><a href="#-激活实例">激活实例</a></li>
<li><a href="#-实例搜索接口">实例搜索接口</a></li>
<li><a href="#-引用实例反向查询接口">引用实例反向查询接口</a></li>
<li><a href="#-查询单个实例约束接口">查询单个实例约束接口</a></li>
<li><a href="#-业务创建接口">业务创建接口</a></li>
<li><a href="#-主机创建接口">主机创建接口</a></li>
<li><a href="#-单个实例创建接口">单个实例创建接口</a></li>
<li><a href="#-单个实例修改接口">单个实例修改接口</a></li>
<li><a href="#-单个实例删除接口">单个实例删除接口</a></li>
<li><a href="#-获取实例变更日志">获取实例变更日志</a></li>
<li><a href="#-数据导入接口">数据导入接口</a></li>
<li><a href="#-批量编辑接口">批量编辑接口</a></li>
<li><a href="#-获取实例默认值">获取实例默认值</a></li>
<li><a href="#-处理实例修改后动作">处理实例修改后动作</a></li>
<li><a href="#-实时同步全文搜索数据">实时同步全文搜索数据</a></li>
<li><a href="#-刷新冗余数据">刷新冗余数据</a></li>
<li><a href="#-查询业务列表">查询业务列表</a></li>
<li><a href="#-查询业务关联链路">查询业务关联链路</a></li>
<li><a href="#-根据一级业务id遍历查询子业务下的所有应用">根据一级业务id遍历查询子业务下的所有应用</a></li>
<li><a href="#-查询某个业务的信息">查询某个业务的信息</a></li>
<li><a href="#-查询子业务信息">查询子业务信息</a></li>
<li><a href="#-查询业务信息">查询业务信息</a></li>
<li><a href="#-获取用户配置信息namespace">获取用户配置信息namespace</a></li>
<li><a href="#-获取用户配置信息值">获取用户配置信息值</a></li>
<li><a href="#-修改用户配置信息值">修改用户配置信息值</a></li>
<li><a href="#-获取资源模型下某一属性的值">获取资源模型下某一属性的值</a></li>
<li><a href="#-更新冗余数据">更新冗余数据</a></li>
<li><a href="#-多实例查询">多实例查询</a></li>
<li><a href="#-个人信息查询">个人信息查询</a></li>
<li><a href="#-查询个人apikey">查询个人apikey</a></li>
<li><a href="#-修改个人密码">修改个人密码</a></li>
<li><a href="#-用户忘记密码">用户忘记密码</a></li>
<li><a href="#-用户重置密码">用户重置密码</a></li>
<li><a href="#-查询应用">查询应用</a></li>
<li><a href="#-查询应用列表">查询应用列表</a></li>
<li><a href="#-获取应用下的设备以及集群信息数量">获取应用下的设备以及集群信息数量</a></li>
<li><a href="#-批量查询应用信息">批量查询应用信息</a></li>
<li><a href="#-批量获取应用列表">批量获取应用列表</a></li>
<li><a href="#-搜索应用列表">搜索应用列表</a></li>
</ol>
<h2 id="-a-id-a-"><a id="-未命名接口"></a> 未命名接口</h2>
<blockquote>
<p>执行查询sql(仅支持查询sql)
</p>
</blockquote>
<h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>result</td> <td>null</td> <td>array</td> <td>是</td> <td>[<br> {object(PhpOrient\Protocols\Binary\Data\Record)}<br> ]</td> </tr> <tr> <td>fetchPlan</td>
<td>string</td>
<td>是</td>
<td>获取数据的策略, 默认展开两层的关系数据
<a href="http://orientdb.com/docs/2.2.x/Fetching-Strategies.html">http://orientdb.com/docs/2.2.x/Fetching-Strategies.html</a></td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

int
</p>
</blockquote>
<h2 id="-a-id-a-"><a id="-创建用户组"></a> 创建用户组</h2>
<h3 id="-">- 测试关键字</h3>
<pre><code>create user group
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>POST /object/USER_GROUP/instance
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>name</td>
<td>string</td>
<td>是</td>
<td>名称</td>
</tr>
<tr>
<td>_description</td>
<td>string</td>
<td>否</td>
<td>描述</td>
</tr>
<tr>
<td>_members</td>
<td>array</td>
<td>否</td>
<td>组成员</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

用户组实例id
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
<tr>
<td>130600</td>
<td>权限错误</td>
</tr>
</tbody>
</table>
<h3 id="-">- 请求示例</h3>
<pre><code>{
"name": "CMDB开发组",
"_description": "this is a greate team",
"_members": ["56dfea1bc8a96","56dfea253c80f"],
}
</code></pre><h3 id="-">- 返回示例</h3>
<pre><code>{
"message": "Success",
"code": 0,
"data": "5715e1aa4a014",
"error": "\u6210\u529f"
}
</code></pre><h2 id="-a-id-a-"><a id="-修改用户组"></a> 修改用户组</h2>
<h3 id="-">- 测试关键字</h3>
<pre><code>modify user group
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>PUT /object/USER_GROUP/instance/@instance_id
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>instance_id</td>
<td>string</td>
<td>是</td>
<td>用户组实例Id</td>
</tr>
<tr>
<td>_description</td>
<td>string</td>
<td>否</td>
<td>描述</td>
</tr>
<tr>
<td>_members</td>
<td>array</td>
<td>否</td>
<td>组成员</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

null
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
<tr>
<td>130600</td>
<td>权限错误</td>
</tr>
</tbody>
</table>
<h3 id="-">- 请求示例</h3>
<pre><code>{
"_members": [
"56dfea1bc8a96",
"56dfea253c80f"
],
"_description": "this is a greate team"
}
</code></pre><h3 id="-">- 返回示例</h3>
<pre><code>{
"message": "Success",
"code": 0,
"data": null,
"error": "\u6210\u529f"
}
</code></pre><h2 id="-a-id-a-"><a id="-查询用户所在的用户组"></a> 查询用户所在的用户组</h2>
<blockquote>
<p>查询用户组, 支持根据用户查询所在用户组
</p>
</blockquote>
<h3 id="-url">- 接口访问URL</h3>
<pre><code>GET /object/USER_GROUP/instance
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>username</td>
<td>string</td>
<td>否</td>
<td>用户名,用分号隔开</td>
</tr>
<tr>
<td>page</td>
<td>int</td>
<td>否</td>
<td>页码</td>
<td>1</td>
</tr>
<tr>
<td>page_size</td>
<td>int</td>
<td>否</td>
<td>页大小</td>
<td>30</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

用户与所在的用户组信息
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
<tr>
<td>130601</td>
<td>权限错误</td>
</tr>
</tbody>
</table>
<h3 id="-">- 请求示例</h3>
<pre><code>GET /object/USER_GROUP/instance?username=light;index
</code></pre><h2 id="-a-id-a-"><a id="-创建实例旧"></a> 创建实例(旧)</h2>
<blockquote>
<p>deprecated, 因格式问题, 建议弃用
</p>
</blockquote>
<h3 id="-">- 测试关键字</h3>
<pre><code>create instance old
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>POST /object/instance/@objectId
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>objectId</td>
<td>string</td>
<td>是</td>
<td>资源模型ID</td>
</tr>
<tr>
<td>name</td>
<td>string</td>
<td>是</td>
<td>实例名称</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

创建后的实例Id
</p>
</blockquote>
<h2 id="-a-id-a-"><a id="-修改实例旧"></a> 修改实例(旧)</h2>
<blockquote>
<p>deprecated, 因格式问题, 建议弃用
</p>
</blockquote>
<h3 id="-">- 测试关键字</h3>
<pre><code>modify instance old
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>PUT /object/instance/@objectId/@instanceId
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>objectId</td>
<td>string</td>
<td>是</td>
<td>资源模型ID</td>
</tr>
<tr>
<td>instanceId</td>
<td>string</td>
<td>是</td>
<td>实例ID</td>
</tr>
<tr>
<td>name</td>
<td>string</td>
<td>否</td>
<td>实例名称</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

修改后的实例Id
</p>
</blockquote>
<h2 id="-a-id-a-"><a id="-批量删除实例接口旧"></a> 批量删除实例接口(旧)</h2>
<h3 id="-">- 测试关键字</h3>
<pre><code>delete instances batch
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>DELETE /object/instance/@objectId
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>objectId</td>
<td>string</td>
<td>是</td>
<td>资源模型ID</td>
</tr>
<tr>
<td>ids</td>
<td>string</td>
<td>是</td>
<td>实例Id,用分号隔开</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

实例Id数组
</p>
</blockquote>
<h2 id="-a-id-a-"><a id="-批量创建对象实例"></a> 批量创建对象实例</h2>
<blockquote>
<p>deprecated 接口已弃用
</p>
</blockquote>
<h3 id="-">- 测试关键字</h3>
<pre><code>create instance list
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>POST /object/instance/list/@objectId
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>objectId</td>
<td>string</td>
<td>是</td>
<td>资源模型ID</td>
</tr>
<tr>
<td>instance_list</td>
<td>struct</td>
<td>是</td>
<td>实例列表</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

创建成功后的实例id
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
</tbody>
</table>
<h3 id="-">- 请求示例</h3>
<pre><code>[
{
"name": "\u535a\u5ba2\u5e94\u7528",
"installPath": "/data/easyops/blog/"
}
]
</code></pre><h3 id="-">- 返回示例</h3>
<pre><code>{
"message": "Success",
"code": 0,
"data": [
"570b535423f98"
],
"error": "\u6210\u529f"
}
</code></pre><h2 id="-a-id-a-"><a id="-查询模型工具盒子列表"></a> 查询模型工具盒子列表</h2>
<h3 id="-">- 测试关键字</h3>
<pre><code>get object toolkit list
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>GET /toolkit/tools/@objectId
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>objectId</td>
<td>string</td>
<td>是</td>
<td>模型Id</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

模型工具盒子详情
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
</tbody>
</table>
<h3 id="-">- 请求示例</h3>
<pre><code>GET /toolkit/tools/APP
</code></pre><h3 id="-">- 返回示例</h3>
<pre><code>{
"message": "Success",
"code": 0,
"data": {
"toolList": [
{
"style": {
"color": "primary",
"icon": "fa fa-wrench"
},
"type": "tool",
"name": "Test",
"metadata": {
"toolId": "d3d453ab1412cd2102da83ff761a526a",
"params": [
{
"cmdbAttrId": "ip",
"multiple": true,
"name": "@agents",
"showInjectCheckbox": false,
"required": true,
"value": [
"192.168.100.75"
],
"label": "\u6267\u884c\u76ee\u6807",
"cmdbObjectId": "HOST",
"inject": false,
"type": "cmdbInstances",
"instanceIds": [
"5ad79c6288455"
]
}
]
}
}
],
"enabled": true
},
"error": "\u6210\u529f"
}
</code></pre><h2 id="-a-id-a-"><a id="-新建修改任意门工具列表"></a> 新建修改任意门工具列表</h2>
<h3 id="-">- 测试关键字</h3>
<pre><code>create or modify object toolkit
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>PUT /toolkit/tools
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>enabled</td>
<td>string</td>
<td>是</td>
<td>任意门状态</td>
</tr>
<tr>
<td>objectId</td>
<td>string</td>
<td>是</td>
<td>模型Id</td>
</tr>
<tr>
<td>toolList</td>
<td>array</td>
<td>是</td>
<td>工具list</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

json
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
</tbody>
</table>
<h3 id="-">- 请求示例</h3>
<pre><code>PUT /toolkit/tools
{
"enabled": true,
"objectId": "APP",
"toolList": [
{
"metadata": {
"params": [
{
"cmdbAttrId": "ip",
"cmdbObjectId": "HOST",
"inject": false,
"instanceIds": [
"5ad79c6288455"
],
"label": "执行目标",
"multiple": true,
"name": "@agents",
"required": true,
"showInjectCheckbox": false,
"type": "cmdbInstances",
"value": [
"192.168.100.75"
]
}
],
"toolId": "d3d453ab1412cd2102da83ff761a526a"
},
"name": "Test",
"style": {
"color": "primary",
"icon": "fa fa-wrench"
},
"type": "tool"
}
</code></pre><h3 id="-">- 返回示例</h3>
<pre><code>{
"message": "Success",
"code": 0,
"data": 0,
"error": "\u6210\u529f"
}
</code></pre><h2 id="-a-id-a-"><a id="-创建单个任意门工具盒子"></a> 创建单个任意门工具盒子</h2>
<h3 id="-">- 测试关键字</h3>
<pre><code>create object one toolkit
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>POST /toolkit/@objectId
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>objectId</td> <td>string</td> <td>是</td> <td>模型Id</td> </tr> <tr> <td>name</td> <td>string</td> <td>是</td> <td>任意门名字</td> </tr> <tr> <td>type</td> <td>string</td> <td>是</td> <td>任意门类型</td> </tr> <tr> <td>metadata</td> <td>array</td> <td>否</td> <td>任意门对应资源数据</td> </tr> <tr> <td>style</td> <td>array</td> <td>否</td> <td>任意门显示样式</td> </tr> <tr> <td>ignoreSecondCheck</td> <td>bool</td> <td>否</td> <td>是否忽略二次验证</td> </tr> </tbody> </table> <h3 id="-">- 返回值说明</h3> <blockquote> <p>返回类型: json <br> json <br></p> </blockquote> <h3 id="-">- 返回码</h3> <table> <thead> <tr> <th>返回码</th> <th>备注</th> </tr> </thead> <tbody> <tr> <td>130300</td> <td>数据库错误</td> </tr> <tr> <td>130501</td> <td>参数不足</td> </tr> <tr> <td>0</td> <td>成功</td> </tr> </tbody> </table> <h3 id="-">- 请求示例</h3> <pre><code>POST /toolkit/APP { "name": "Test", "style": { "color": "primary", "icon": "fa fa-wrench" }, "type": "tool" "ignoreSecondCheck": true "metadata": { "params": [ { "cmdbAttrId": "ip", "cmdbObjectId": "HOST", "inject": false, "instanceIds": [ "5ad79c6288455" ], "label": "执行目标", "multiple": true, "name": "@agents", "required": true, "showInjectCheckbox": false, "type": "cmdbInstances", "value": [ "192.168.100.75" ] } ] </code></pre><h3 id="-">- 返回示例</h3> <pre><code>{ "code": 0, "error": "成功", "message": "Success", "data": { "_id": { "oid": "5b336a5c59b8ce996928b236"
},
"type": "flow",
"ignoreSecondCheck": true,
"name": "二人若若ddddd",
"style": {
"color": "primary",
"icon": "fa fa-battery-half"
},
"metadata": {
"flowId": "35a62ccebc414d6f5350345111da3879",
"params": [{
"cmdbAttrId": "ip",
"cmdbObjectId": "HOST",
"label": "执行目标",
"multiple": true,
"name": "@agents",
"required": true,
"type": "cmdbInstances",
"showInjectCheckbox": false,
"inject": false,
"rawParamType": "cmdbInstances",
"paramMap": false,
"inputType": "custom",
"value": ["172.17.0.56"],
"instanceIds": ["5b0248704f01b"],
"attrName": "执行目标"
}]
}
}
}
}
</code></pre><h2 id="-a-id-a-"><a id="-修改指定模型单个任意门信息"></a> 修改指定模型单个任意门信息</h2>
<h3 id="-">- 测试关键字</h3>
<pre><code>modify object one toolkit
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>PUT /toolkit/@objectId/@toolkitId
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>objectId</td> <td>string</td> <td>是</td> <td>模型Id</td> </tr> <tr> <td>toolkitId</td>
<td>string</td>
<td>是</td>
<td>任意门toolkitId</td>
</tr>
<tr>
<td>name</td>
<td>string</td>
<td>否</td>
<td>任意门名字</td>
</tr>
<tr>
<td>type</td>
<td>string</td>
<td>否</td>
<td>任意门类型</td>
</tr>
<tr>
<td>metadata</td>
<td>array</td>
<td>否</td>
<td>任意门对应资源数据</td>
</tr>
<tr>
<td>style</td>
<td>array</td>
<td>否</td>
<td>任意门显示样式</td>
</tr>
<tr>
<td>ignoreSecondCheck</td>
<td>bool</td>
<td>否</td>
<td>是否忽略二次验证</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

json
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
<tr>
<td>0</td>
<td>成功</td>
</tr>
</tbody>
</table>
<h3 id="-">- 请求示例</h3>
<pre><code>PUT /toolkit/APP/5b336a5c59b8ce996928b236
{
"name": "Test",
"style": {
"color": "primary",
"icon": "fa fa-wrench"
},
"type": "tool"
"ignoreSecondCheck": true
"metadata": {
"params": [
{
"cmdbAttrId": "ip",
"cmdbObjectId": "HOST",
"inject": false,
"instanceIds": [
"5ad79c6288455"
],
"label": "执行目标",
"multiple": true,
"name": "@agents",
"required": true,
"showInjectCheckbox": false,
"type": "cmdbInstances",
"value": [
"192.168.100.75"
]
}
]
</code></pre><h3 id="-">- 返回示例</h3>
<pre><code>{
"code": 0,
"error": "成功",
"message": "Success",
"data": {
"_id": {
"oid": "5b336a5c59b8ce996928b236" }, "type": "flow", "ignoreSecondCheck": true "name": "二人若若ddddd", "style": { "color": "primary", "icon": "fa fa-battery-half" }, "metadata": { "flowId": "35a62ccebc414d6f5350345111da3879", "params": [{ "cmdbAttrId": "ip", "cmdbObjectId": "HOST", "label": "执行目标", "multiple": true, "name": "@agents", "required": true, "type": "cmdbInstances", "showInjectCheckbox": false, "inject": false, "rawParamType": "cmdbInstances", "paramMap": false, "inputType": "custom", "value": ["172.17.0.56"], "instanceIds": ["5b0248704f01b"], "attrName": "执行目标" }] } } } } </code></pre><h2 id="-a-id-a-"><a id="-获取指定模型单个任意门信息"></a> 获取指定模型单个任意门信息</h2> <h3 id="-">- 测试关键字</h3> <pre><code>get object one toolkit info </code></pre><h3 id="-url">- 接口访问URL</h3> <pre><code>GET /toolkit/@objectId/@toolkitId </code></pre><h3 id="-">- 参数</h3> <table> <thead> <tr> <th>名称</th> <th>类型</th> <th>必选</th> <th>备注</th> <th>默认值</th> </tr> </thead> <tbody> <tr> <td>objectId</td>
<td>string</td>
<td>是</td>
<td>模型ID</td>
</tr>
<tr>
<td>toolkitId</td> <td>string</td> <td>是</td> <td>任意门资源ID</td> </tr> </tbody> </table> <h3 id="-">- 返回值说明</h3> <blockquote> <p>返回类型: json <br> json <br></p> </blockquote> <h3 id="-">- 返回码</h3> <table> <thead> <tr> <th>返回码</th> <th>备注</th> </tr> </thead> <tbody> <tr> <td>130300</td> <td>数据库错误</td> </tr> <tr> <td>0</td> <td>成功</td> </tr> </tbody> </table> <h3 id="-">- 请求示例</h3> <pre><code>GET /toolkit/APP/5b336a5c59b8ce996928b236 </code></pre><h3 id="-">- 返回示例</h3> <pre><code>{ "code": 0, "error": "成功", "message": "Success", "data": { "_id": { "oid": "5b336a5c59b8ce996928b236"
},
"type": "flow",
"name": "二人若若ddddd",
"style": {
"color": "primary",
"icon": "fa fa-battery-half"
},
"metadata": {
"flowId": "35a62ccebc414d6f5350345111da3879",
"params": [{
"cmdbAttrId": "ip",
"cmdbObjectId": "HOST",
"label": "执行目标",
"multiple": true,
"name": "@agents",
"required": true,
"type": "cmdbInstances",
"showInjectCheckbox": false,
"inject": false,
"rawParamType": "cmdbInstances",
"paramMap": false,
"inputType": "custom",
"value": ["172.17.0.56"],
"instanceIds": ["5b0248704f01b"],
"attrName": "执行目标"
}]
}
}
}
}
</code></pre><h2 id="-a-id-a-"><a id="-修删除指定模型单个任意门"></a> 修删除指定模型单个任意门</h2>
<h3 id="-">- 测试关键字</h3>
<pre><code>delete object toolkit
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>DELETE /toolkit/@objectId/@toolkitId
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>objectId</td> <td>string</td> <td>是</td> <td>模型Id</td> </tr> <tr> <td>toolkitId</td>
<td>string</td>
<td>是</td>
<td>任意门toolkitId</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

json
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
<tr>
<td>130502</td>
<td>toolkitId格式错误</td>
</tr>
<tr>
<td>130308</td>
<td>查询无结果</td>
</tr>
<tr>
<td>0</td>
<td>成功</td>
</tr>
</tbody>
</table>
<h3 id="-">- 请求示例</h3>
<pre><code>DELETE /toolkit/APP/5b336a5c59b8ce996928b236
</code></pre><h3 id="-">- 返回示例</h3>
<pre><code>{
"message": "Success",
"code": 0,
"data": null,
"error": "\u6210\u529f"
}
</code></pre><h2 id="-a-id-a-"><a id="-修改模型任意门状态"></a> 修改模型任意门状态</h2>
<blockquote>
<p>状态 开启 关闭
</p>
</blockquote>
<h3 id="-">- 测试关键字</h3>
<pre><code>set object toolkit status
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>PUT /toolkit/setting/@objectId
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>objectId</td>
<td>string</td>
<td>是</td>
<td>实例ID</td>
</tr>
<tr>
<td>enabled</td>
<td>string</td>
<td>是</td>
<td>任意门状态 true false</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

json
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
</tbody>
</table>
<h3 id="-">- 请求示例</h3>
<pre><code>PUT /toolkit/setting/APP
{
"enabled": true
}
</code></pre><h3 id="-">- 返回示例</h3>
<pre><code>{
"message": "Success",
"code": 0,
"data": null,
"error": "\u6210\u529f"
}
</code></pre><h2 id="-a-id-a-"><a id="-获取模型任意门状态"></a> 获取模型任意门状态</h2>
<h3 id="-">- 测试关键字</h3>
<pre><code>get object toolkit setting
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>GET /toolkit/setting/@objectId
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>objectId</td>
<td>string</td>
<td>是</td>
<td>实例ID</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

json
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
</tbody>
</table>
<h3 id="-">- 请求示例</h3>
<pre><code>GET /toolkit/setting/APP
</code></pre><h3 id="-">- 返回示例</h3>
<pre><code>{
"message": "Success",
"code": 0,
"data": {
"enabled": true
},
"error": "\u6210\u529f"
}
</code></pre><h2 id="-a-id-a-"><a id="-管理员查询用户"></a> 管理员查询用户</h2>
<h3 id="-">- 测试关键字</h3>
<pre><code>get user by admin
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>GET /admin/users/@username
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>username</td>
<td>string</td>
<td>是</td>
<td>用户名</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

用户信息
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
</tbody>
</table>
<h2 id="-a-id-a-"><a id="-管理员修改用户信息"></a> 管理员修改用户信息</h2>
<h3 id="-">- 测试关键字</h3>
<pre><code>modify user by admin
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>PUT /admin/users/@username
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>username</td>
<td>string</td>
<td>是</td>
<td>用户名</td>
</tr>
<tr>
<td>email</td>
<td>string</td>
<td>否</td>
<td>邮箱</td>
</tr>
<tr>
<td>phone</td>
<td>string</td>
<td>否</td>
<td>手机</td>
</tr>
<tr>
<td>password</td>
<td>string</td>
<td>否</td>
<td>密码</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

null
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
<tr>
<td>130601</td>
<td>权限错误</td>
</tr>
</tbody>
</table>
<h2 id="-a-id-a-"><a id="-管理员查询所有用户信息"></a> 管理员查询所有用户信息</h2>
<h3 id="-">- 测试关键字</h3>
<pre><code>get users by admin
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>GET /admin/users
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>page</td>
<td>int</td>
<td>否</td>
<td>页码</td>
</tr>
<tr>
<td>pageSize</td>
<td>int</td>
<td>否</td>
<td>页大小</td>
</tr>
<tr>
<td>state</td>
<td>string</td>
<td>否</td>
<td>用户可用状态, 枚举型 valid, invalid</td>
</tr>
<tr>
<td>name</td>
<td>stirng</td>
<td>否</td>
<td>用户名, 用分号隔开</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

用户信息列表
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
</tbody>
</table>
<h2 id="-a-id-a-"><a id="-管理员删除用户信息"></a> 管理员删除用户信息</h2>
<h3 id="-">- 测试关键字</h3>
<pre><code>remove user by admin
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>DELETE /admin/users/@username
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>username</td>
<td>string</td>
<td>是</td>
<td>用户名</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

null
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
<tr>
<td>130601</td>
<td>权限错误</td>
</tr>
</tbody>
</table>
<h2 id="-a-id-a-"><a id="-管理员禁用用户"></a> 管理员禁用用户</h2>
<blockquote>
<p>无法禁用自己
</p>
</blockquote>
<h3 id="-">- 测试关键字</h3>
<pre><code>block user by admin
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>PUT /admin/users/@username/_block
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>username</td>
<td>string</td>
<td>是</td>
<td>用户名</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

null
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
<tr>
<td>130601</td>
<td>权限错误</td>
</tr>
</tbody>
</table>
<h2 id="-a-id-a-"><a id="-管理员解禁用户"></a> 管理员解禁用户</h2>
<blockquote>
<p>无法解禁自己
</p>
</blockquote>
<h3 id="-">- 测试关键字</h3>
<pre><code>unblock user by admin
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>PUT /admin/users/@username/_unblock
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>username</td>
<td>string</td>
<td>是</td>
<td>用户名</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

null
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
<tr>
<td>130601</td>
<td>权限错误</td>
</tr>
</tbody>
</table>
<h2 id="-a-id-id-a-id-"><a id="-用户id列表查询"></a> 用户ID列表查询</h2>
<h3 id="-url">- 接口访问URL</h3>
<pre><code>GET /users/id
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>state</td>
<td>string</td>
<td>否</td>
<td>用户状态valid/invalid, 默认返回所有用户id</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

用户id列表
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
</tbody>
</table>
<h3 id="-">- 请求示例</h3>
<pre><code>GET http://cmdb.easyops-only.com/users/id?state=valid
</code></pre><h3 id="-">- 返回示例</h3>
<pre><code>{
"code": 0,
"error": "成功",
"message": "Success",
"data": [
"easyops",
"linuschen",
"lightjiao",
"lulutest",
"indexzhuo", * "rufusyang",
"robotname",
"robota",
"index"
]
}
</code></pre><h2 id="-a-id-id-a-id-"><a id="-用户id/昵称映射列表查询"></a> 用户ID/昵称映射列表查询</h2>
<h3 id="-url">- 接口访问URL</h3>
<pre><code>GET /users/id_map_nickname
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>state</td>
<td>string</td>
<td>否</td>
<td>用户状态valid/invalid, 默认返回所有用户id</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

用户id/昵称映射列表
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
</tbody>
</table>
<h3 id="-">- 请求示例</h3>
<pre><code>GET http://cmdb.easyops-only.com/users/id_map_nickname?state=valid
</code></pre><h3 id="-">- 返回示例</h3>
<pre><code>{
"code": 0,
"error": "成功",
"message": "Success",
"data": [
"easyops": "easyops",
"linuschen": "linuschen",
"lightjiao": "lightjiao",
"lulutest": "lulutest",
"indexzhuo": "indexzhuo",
"rufusyang": "rufusyang",
"robotname": "robotname",
"robota": "robota",
"index": "index"
]
}
</code></pre><h2 id="-a-id-a-"><a id="-查询用户登录信息"></a> 查询用户登录信息</h2>
<blockquote>
<p>指定key和value返回用户的登录信息(org和name), 请求这个接口的header里面不需要user和org
</p>
</blockquote>
<h3 id="-">- 测试关键字</h3>
<pre><code>get user login info
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>GET /user/login_info
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>login_key</td>
<td>string</td>
<td>是</td>
<td>登录的key字符串, 例如SSO登录时候的工号的key</td>
</tr>
<tr>
<td>login_value</td>
<td>string</td>
<td>是</td>
<td>登录的值, 例如SSO登录时候的工号的值</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

用户登录信息的name和org
</p>
</blockquote>
<h3 id="-">- 请求示例</h3>
<pre><code>GET /user/login_info?login_key=userNo&login_value=12342234
</code></pre><h3 id="-">- 返回示例</h3>
<pre><code>{
"message": "Success",
"code": 0,
"data": {
"org": 8888,
"name": "easyops"
},
"error": "\u6210\u529f"
}
</code></pre><h2 id="-a-id-org-a-org"><a id="-查询所有org"></a> 查询所有org</h2>
<blockquote>
<p>暂时不做自动化测试
</p>
</blockquote>
<h3 id="-url">- 接口访问URL</h3>
<pre><code>GET /org/list
</code></pre><h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

org信息列表
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
</tbody>
</table>
<h2 id="-a-id-a-"><a id="-查询设备列表"></a> 查询设备列表</h2>
<blockquote>
<p>@deprecated, 接口较老,不再建议使用
</p>
</blockquote>
<h3 id="-">- 测试关键字</h3>
<pre><code>search device
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>GET /device/search
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>ip</td>
<td>string</td>
<td>否</td>
<td>设备IP</td>
</tr>
<tr>
<td>hostname</td>
<td>string</td>
<td>否</td>
<td>主机名</td>
</tr>
<tr>
<td>provider</td>
<td>string</td>
<td>否</td>
<td>服务商</td>
</tr>
<tr>
<td>deviceId</td>
<td>int</td>
<td>否</td>
<td>设备ID</td>
</tr>
<tr>
<td>status</td>
<td>string</td>
<td>否</td>
<td>设备状态</td>
</tr>
<tr>
<td>location</td>
<td>string</td>
<td>否</td>
<td>设备状态</td>
</tr>
<tr>
<td>user_name</td>
<td>string</td>
<td>否</td>
<td>设备状态</td>
</tr>
<tr>
<td>order</td>
<td>string</td>
<td>否</td>
<td>排序字段</td>
</tr>
<tr>
<td>fields</td>
<td>string</td>
<td>否</td>
<td>查询字段</td>
</tr>
<tr>
<td>ignore</td>
<td>string</td>
<td>否</td>
<td>过滤字段</td>
</tr>
<tr>
<td>page</td>
<td>int</td>
<td>否</td>
<td>分页</td>
</tr>
<tr>
<td>pageSize</td>
<td>int</td>
<td>否</td>
<td>分页大小</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

设备列表
</p>
</blockquote>
<h2 id="-a-id-a-"><a id="-自动注册设备信息"></a> 自动注册设备信息</h2>
<h3 id="-">- 测试关键字</h3>
<pre><code>register device
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>POST /device/register
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>hostname</td>
<td>string</td>
<td>是</td>
<td>主机名</td>
</tr>
<tr>
<td>ip</td>
<td>string</td>
<td>是</td>
<td>主机IP</td>
</tr>
<tr>
<td>status</td>
<td>string</td>
<td>是</td>
<td>运营状态</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

null
</p>
</blockquote>
<h2 id="-a-id-a-"><a id="-根据设备查应用"></a> 根据设备查应用</h2>
<blockquote>
<p>@deprecated接口较老,不再建议使用
</p>
</blockquote>
<h3 id="-">- 测试关键字</h3>
<pre><code>search app by device_ids
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>GET /device/app-list
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>deviceIdList</td>
<td>string</td>
<td>是</td>
<td>设备id列表,以分号分隔</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

应用列表
</p>
</blockquote>
<h2 id="-a-id-a-"><a id="-查询设备信息,支持批量"></a> 查询设备信息,支持批量</h2>
<blockquote>
<p>@deprecated, 接口较老,已弃用

高级查询请使用接口POST /object/@object_id/instance/_search
</p>
</blockquote>
<h3 id="-">- 测试关键字</h3>
<pre><code>get device by key value
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>GET /v2/device/@key/@val
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>key</td>
<td>string</td>
<td>是</td>
<td>键</td>
</tr>
<tr>
<td>val</td>
<td>string</td>
<td>是</td>
<td>值</td>
</tr>
<tr>
<td>fields</td>
<td>string</td>
<td>否</td>
<td>需要的字段,默认全部返回, 用分号隔开多个字段</td>
</tr>
<tr>
<td>ignore</td>
<td>string</td>
<td>否</td>
<td>忽略的字段,默认全部返回, 用分号隔开多个字段</td>
</tr>
<tr>
<td>page</td>
<td>int</td>
<td>否</td>
<td>分页</td>
</tr>
<tr>
<td>pageSize</td>
<td>int</td>
<td>否</td>
<td>分页大小</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

设备列表
</p>
</blockquote>
<h2 id="-a-id-a-"><a id="-用户注册接口"></a> 用户注册接口</h2>
<blockquote>
<p>注册用户, 提供username, password和org
</p>
</blockquote>
<h3 id="-">- 测试关键字</h3>
<pre><code>signup
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>POST /sign_up
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>username</td>
<td>string</td>
<td>是</td>
<td>用户名</td>
</tr>
<tr>
<td>password</td>
<td>string</td>
<td>是</td>
<td>用户密码</td>
</tr>
<tr>
<td>org</td>
<td>int</td>
<td>是</td>
<td>组织id</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

用户信息
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
</tbody>
</table>
<h2 id="-a-id-a-"><a id="-绑定流水线"></a> 绑定流水线</h2>
<h3 id="-url">- 接口访问URL</h3>
<pre><code>POST /application/@app_id/pipeline
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>app_id</td>
<td>string</td>
<td>是</td>
<td>应用ID</td>
</tr>
<tr>
<td>name</td>
<td>string</td>
<td>是</td>
<td>流水线名称</td>
</tr>
<tr>
<td>flowId</td>
<td>string</td>
<td>是</td>
<td>流程ID</td>
</tr>
<tr>
<td>flowVersion</td>
<td>int</td>
<td>是</td>
<td>流程版本ID</td>
</tr>
<tr>
<td>templateId</td>
<td>string</td>
<td>否</td>
<td>模板ID</td>
</tr>
<tr>
<td>templateVersion</td>
<td>int</td>
<td>否</td>
<td>模板版本ID</td>
</tr>
<tr>
<td>rules</td>
<td>array</td>
<td>否</td>
<td>流水线规则</td>
</tr>
<tr>
<td>subscribers</td>
<td>array</td>
<td>否</td>
<td>订阅者列表</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

流水线信息
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
<tr>
<td>130601</td>
<td>权限错误</td>
</tr>
</tbody>
</table>
<h3 id="-">- 请求示例</h3>
<pre><code>{
"name": "",
"flowId": "",
"flowVersion": "",
"templateId": "",
"templateVersion": "",
"rules": {
hooks: { enabled: true },
schedules: { enabled: true },
},
"subscribers": []
}
</code></pre><h3 id="-">- 返回示例</h3>
<pre><code>{
"code": 0,
"error": "成功",
"message": "Success",
"data": {
"name": "",
"flowId": "",
"flowVersion": "",
"templateId": "",
"templateVersion": "",
"rules": {
hooks: { enabled: true },
schedules: { enabled: true },
},
"subscribers": []
}
}
</code></pre><h2 id="-a-id-a-"><a id="-解绑流水线"></a> 解绑流水线</h2>
<h3 id="-url">- 接口访问URL</h3>
<pre><code>DELETE /application/@app_id/pipeline/@flow_id
</code></pre><h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

null
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
<tr>
<td>130601</td>
<td>权限错误</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回示例</h3>
<pre><code>{
"message": "Success",
"code": 0,
"data": null,
"error": "\u6210\u529f"
}
</code></pre><h2 id="-a-id-a-"><a id="-列出流水线"></a> 列出流水线</h2>
<h3 id="-url">- 接口访问URL</h3>
<pre><code>GET /application/@app_id/pipeline
</code></pre><h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

流水线列表
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
<tr>
<td>130601</td>
<td>权限错误</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回示例</h3>
<pre><code>{
"message": "Success",
"code": 0,
"data": {
"list": [
{
"flowId": "",
"templateId": "",
"templateVersion": "",
"flowVersion": ""
},
{
"flowId": "",
"templateId": "",
"templateVersion": "",
"flowVersion": ""
}
]
},
"error": "\u6210\u529f"
}
</code></pre><h2 id="-a-id-a-"><a id="-查询流水线"></a> 查询流水线</h2>
<h3 id="-url">- 接口访问URL</h3>
<pre><code>GET /application/@app_id/pipeline/@flow_id
</code></pre><h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

流水线列表
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
<tr>
<td>130601</td>
<td>权限错误</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回示例</h3>
<pre><code>{
"message": "Success",
"code": 0,
"data": {
"flowId": "",
"templateId": "",
"templateVersion": "",
"flowVersion": ""
},
"error": "\u6210\u529f"
}
</code></pre><h2 id="-a-id-a-"><a id="-修改流水线"></a> 修改流水线</h2>
<h3 id="-url">- 接口访问URL</h3>
<pre><code>PUT /application/@app_id/pipeline/@flow_id
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>app_id</td>
<td>string</td>
<td>是</td>
<td>应用ID</td>
</tr>
<tr>
<td>name</td>
<td>string</td>
<td>是</td>
<td>流水线名称</td>
</tr>
<tr>
<td>flowVersion</td>
<td>int</td>
<td>否</td>
<td>流程版本ID</td>
</tr>
<tr>
<td>templateVersion</td>
<td>int</td>
<td>否</td>
<td>模板版本ID</td>
</tr>
<tr>
<td>rules</td>
<td>array</td>
<td>否</td>
<td>流水线规则</td>
</tr>
<tr>
<td>subscribers</td>
<td>array</td>
<td>否</td>
<td>订阅者列表</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

流水线信息
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
<tr>
<td>130601</td>
<td>权限错误</td>
</tr>
</tbody>
</table>
<h3 id="-">- 请求示例</h3>
<pre><code>{
"templateVersion": "",
"flowVersion": ""
}
</code></pre><h3 id="-">- 返回示例</h3>
<pre><code>{
"code": 0,
"error": "成功",
"message": "Success",
"data": {
"name": "",
"flowId": "",
"flowVersion": "",
"templateId": "",
"templateVersion": "",
"rules": {
hooks: { enabled: true },
schedules: { enabled: true },
},
"subscribers": []
}
}
</code></pre><h2 id="-a-id-key-value-a-key-value-"><a id="-根据key-value查询集群列表"></a> 根据key value查询集群列表</h2>
<blockquote>
<p>暂时不做自动化测试
</p>
</blockquote>
<h3 id="-url">- 接口访问URL</h3>
<pre><code>GET /v2/cluster/@key/@val
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>key</td>
<td>string</td>
<td>是</td>
<td>键</td>
</tr>
<tr>
<td>val</td>
<td>string</td>
<td>是</td>
<td>值</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

集群列表
</p>
</blockquote>
<h2 id="-a-id-a-"><a id="-批量获取集群列表"></a> 批量获取集群列表</h2>
<blockquote>
<p>@deprecated, 接口较老,已弃用

高级查询请使用接口POST /object/@object_id/instance/_search
</p>
</blockquote>
<h3 id="-">- 测试关键字</h3>
<pre><code>get cluster list by instanceids
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>GET /clusters/@instanceIds
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>instanceIds</td>
<td>string</td>
<td>否</td>
<td>instanceId列表,逗号分割,id为空时,获取所有应用列表</td>
</tr>
<tr>
<td>page</td>
<td>int</td>
<td>否</td>
<td>当前页码</td>
<td>1</td>
</tr>
<tr>
<td>pageSize</td>
<td>int</td>
<td>否</td>
<td>每页大小</td>
<td>30</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

集群列表
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回示例</h3>
<pre><code>{
"code": 0,
"error": "成功",
"message": null,
"data": {
"total": 78,
"list": [
{
"name": "test",
"clusterId": "e71ad9c15fe8a989db8a8912a58d4693",
"packageId": null,
"deviceList": null,
"appId": {
"appId": "5c9bba099758cb89c7f1d394f6a08286",
"instanceId": "56dff11497f66"
},
"type": "0",
"memo": null,
"instanceId": "56e0a79e8f2fb",
"ctime": "2016-03-10 06:45:50",
"org": 8888,
"mtime": "2016-04-06 14:56:55",
"modifier": "colintest"
}
]
}
</code></pre><h2 id="-a-id-a-"><a id="-根据应用获取集群列表"></a> 根据应用获取集群列表</h2>
<h3 id="-">- 测试关键字</h3>
<pre><code>get cluster list by app
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>GET /cluster/appid/@appId
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>appId</td>
<td>string</td>
<td>是</td>
<td>应用ID</td>
</tr>
<tr>
<td>page</td>
<td>int</td>
<td>否</td>
<td>页码</td>
</tr>
<tr>
<td>pageSize</td>
<td>int</td>
<td>否</td>
<td>每页大小</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

集群列表
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
</tbody>
</table>
<h2 id="-a-id-a-"><a id="-获取集群信息"></a> 获取集群信息</h2>
<blockquote>
<p>@deprecated 接口较老不建议使用,建议使用接口 GET /object/@object_id/instance/@instance_id
</p>
</blockquote>
<h3 id="-">- 测试关键字</h3>
<pre><code>get cluster info
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>GET /cluster/@instanceId
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>instanceId</td>
<td>string</td>
<td>是</td>
<td>集群id</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

集群详情
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
</tbody>
</table>
<h2 id="-a-id-agent-a-agent"><a id="-安装agent"></a> 安装agent</h2>
<blockquote>
<p>自动安装暂时不纳入自动化测试
</p>
</blockquote>
<h3 id="-url">- 接口访问URL</h3>
<pre><code>POST /agent/install
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>ip</td>
<td>string</td>
<td>是</td>
<td>安装agent的目标ip</td>
</tr>
<tr>
<td>port</td>
<td>string</td>
<td>是</td>
<td>安装agent的目标端口</td>
</tr>
<tr>
<td>username</td>
<td>string</td>
<td>是</td>
<td>机器用户名</td>
</tr>
<tr>
<td>password</td>
<td>string</td>
<td>是</td>
<td>机器密码</td>
</tr>
<tr>
<td>async</td>
<td>bool</td>
<td>否</td>
<td>是否异步安装</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

应用详情
</p>
</blockquote>
<h3 id="-">- 请求示例</h3>
<pre><code>{
"username": "root",
"ip": "192.168.1.2",
"password": "123456",
"port": 22,
"async": true
}
</code></pre><h3 id="-">- 返回示例</h3>
<pre><code>{
"message": "Success",
"code": 0,
"data": {},
"error": "\u6210\u529f"
}
</code></pre><h2 id="-a-id-a-"><a id="-查询安装结果"></a> 查询安装结果</h2>
<blockquote>
<p>自动安装暂时不纳入自动化测试
</p>
</blockquote>
<h3 id="-url">- 接口访问URL</h3>
<pre><code>GET /agent/install
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>ip</td>
<td>string</td>
<td>是</td>
<td>安装agent的目标ip</td>
</tr>
<tr>
<td>port</td>
<td>string</td>
<td>是</td>
<td>安装agent的目标端口</td>
</tr>
<tr>
<td>username</td>
<td>string</td>
<td>是</td>
<td>机器用户名</td>
</tr>
<tr>
<td>password</td>
<td>string</td>
<td>是</td>
<td>机器密码</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

结果 status ["run","ok","failed"]
</p>
</blockquote>
<h3 id="-">- 请求示例</h3>
<pre><code>{
"ip":"192.168.1.2",
"port":22,
"username":"root",
"password":"123456",
}
</code></pre><h3 id="-">- 返回示例</h3>
<pre><code>{
"message": "Success",
"code": 0,
"data": {
"status": "ok",
"retCode": "0",
"detail": "###SCRIPT_START###\nstart to install...\nCentOS release 6.7 (Final)\nCentOS release 6.7 (Final)\nCentOS release 6.7 (Final)\nstart to download...\nstart to run...\npath is: /usr/local/easyops/pkg/conf/agent/e9c35bb\nthere are monitor logs, package.conf.yaml, and so on. enjoy it\n###result=success&code=0&msg=success###\n###result=success&code=0&msg=ok###\n###CODE#0#CODE###\n###SCRIPT_END###\n"
},
"error": "\u6210\u529f"
}
</code></pre><h2 id="-a-id-agent-a-agent-"><a id="-获取agent安装密钥"></a> 获取agent安装密钥</h2>
<h3 id="-">- 测试关键字</h3>
<pre><code>agent get install key
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>GET /agent/install_key
</code></pre><h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

agent安装密钥
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
<tr>
<td>130601</td>
<td>权限错误</td>
</tr>
<tr>
<td>133015</td>
<td>获取密钥失败</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回示例</h3>
<pre><code>{
"message": "Success",
"code": 0,
"data": "656a9d406b86b21bfc47340bc1e079f7595e145d",
"error": "\u6210\u529f"
}
</code></pre><h2 id="-a-id-agent-a-agent-"><a id="-获取agent代理安装脚本"></a> 获取agent代理安装脚本</h2>
<blockquote>
<p>暂时不做自动化测试
</p>
</blockquote>
<h3 id="-url">- 接口访问URL</h3>
<pre><code>GET /agent/proxy_install_script
</code></pre><h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: file

安装脚本文件
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130202</td>
<td>文件不存在</td>
</tr>
<tr>
<td>130205</td>
<td>打开文件错误</td>
</tr>
</tbody>
</table>
<h2 id="-a-id-agent-a-agent-"><a id="-获取agent安装脚本"></a> 获取agent安装脚本</h2>
<h3 id="-">- 测试关键字</h3>
<pre><code>agent get install script
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>GET /agent/install_script/@os
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>os</td>
<td>string</td>
<td>是</td>
<td>操作系统</td>
</tr>
<tr>
<td>install_key</td>
<td>string</td>
<td>是</td>
<td>Agent安装密钥</td>
</tr>
<tr>
<td>proxy_ip</td>
<td>string</td>
<td>否</td>
<td>代理地址</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: file

安装脚本文件
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130202</td>
<td>文件不存在</td>
</tr>
<tr>
<td>130205</td>
<td>打开文件错误</td>
</tr>
</tbody>
</table>
<h2 id="-a-id-a-"><a id="-查询邀请码"></a> 查询邀请码</h2>
<blockquote>
<p>根据用户信息获取邀请码
</p>
</blockquote>
<h3 id="-">- 测试关键字</h3>
<pre><code>get invite code
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>GET /invitation/code
</code></pre><h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

邀请码及相关信息
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
<tr>
<td>130601</td>
<td>权限错误</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回示例</h3>
<pre><code>{
"message": "Success",
"code": 0,
"data": {
"code": "SAV35SRYV",
"org": 8888,
"_id": "0ddb5877c896f43e8734e10b001e7f1eb92889cd",
"ts": 1492107569,
"expires": "2017-04-17 02:19:29"
},
"error": "\u6210\u529f"
}
</code></pre><h2 id="-a-id-a-"><a id="-重置邀请码"></a> 重置邀请码</h2>
<h3 id="-">- 测试关键字</h3>
<pre><code>reset invite code
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>PUT /invitation/code/_reset
</code></pre><h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

新的邀请码
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
<tr>
<td>130601</td>
<td>权限错误</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回示例</h3>
<pre><code>{
"message": "Success",
"code": 0,
"data": {
"org": 8888,
"code": "SAV35SRYV",
"ts": 1492107569,
"expires": "2017-04-17 02:19:29"
},
"error": "\u6210\u529f"
}
</code></pre><h2 id="-a-id-a-"><a id="-创建集群"></a> 创建集群</h2>
<h3 id="-">- 测试关键字</h3>
<pre><code>create cluster
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>POST /cluster
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>name</td>
<td>string</td>
<td>是</td>
<td>集群名称</td>
</tr>
<tr>
<td>appId</td>
<td>string</td>
<td>是</td>
<td>集群所属应用的appId</td>
</tr>
<tr>
<td>type</td>
<td>string</td>
<td>是</td>
<td>集群类型</td>
</tr>
<tr>
<td>deviceList</td>
<td>array</td>
<td>否</td>
<td>主机列表</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

instanceId
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
<tr>
<td>130600</td>
<td>权限错误</td>
</tr>
</tbody>
</table>
<h3 id="-">- 请求示例</h3>
<pre><code>{
"deviceList": [
"56dfea1bc8a96",
"56dfea253c80f"
],
"type": 1,
"name": "\u535a\u5ba2\u96c6\u7fa4",
"appId": "56dff11497f66"
}
</code></pre><h3 id="-">- 返回示例</h3>
<pre><code>{
"message": "Success",
"code": 0,
"data": "5715e1aa4a014",
"error": "\u6210\u529f"
}
</code></pre><h2 id="-a-id-a-"><a id="-修改集群"></a> 修改集群</h2>
<h3 id="-">- 测试关键字</h3>
<pre><code>update cluster
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>PUT /cluster/@instanceId
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>instanceId</td>
<td>string</td>
<td>是</td>
<td>实例ID</td>
</tr>
<tr>
<td>type</td>
<td>string</td>
<td>否</td>
<td>集群类型</td>
</tr>
<tr>
<td>name</td>
<td>string</td>
<td>否</td>
<td>集群名称</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

集群instanceId
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
<tr>
<td>130600</td>
<td>权限错误</td>
</tr>
</tbody>
</table>
<h3 id="-">- 请求示例</h3>
<pre><code>{
"name": "\u535a\u5ba2\u5e94\u7528"
}
</code></pre><h3 id="-">- 返回示例</h3>
<pre><code>{
"message": "Success",
"code": 0,
"data": "5715e1aa4a014",
"error": "\u6210\u529f"
}
</code></pre><h2 id="-a-id-a-"><a id="-删除集群"></a> 删除集群</h2>
<h3 id="-">- 测试关键字</h3>
<pre><code>delete cluster
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>DELETE /cluster/@instanceId
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>instanceId</td>
<td>string</td>
<td>是</td>
<td>集群id</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

instanceId
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
<tr>
<td>130600</td>
<td>权限错误</td>
</tr>
</tbody>
</table>
<h2 id="-a-id-a-"><a id="-集群添加设备"></a> 集群添加设备</h2>
<blockquote>
<p>URL中的clusterId为集群的instanceId; deviceIds 为主机instanceId列表, 用分号隔开
</p>
</blockquote>
<h3 id="-">- 测试关键字</h3>
<pre><code>add devices to cluster
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>POST /cluster/@clusterId/device/@deviceIds
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>clusterId</td>
<td>string</td>
<td>是</td>
<td>集群实例ID</td>
</tr>
<tr>
<td>deviceIds</td>
<td>string</td>
<td>是</td>
<td>主机实例ID列表, 用分号隔开</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

集群instanceId
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
<tr>
<td>130600</td>
<td>权限错误</td>
</tr>
</tbody>
</table>
<h2 id="-a-id-a-"><a id="-解除集群关联设备"></a> 解除集群关联设备</h2>
<blockquote>
<p>URL中的clusterId为集群的instanceId; deviceIds 为主机instanceId列表, 用分号隔开
</p>
</blockquote>
<h3 id="-">- 测试关键字</h3>
<pre><code>delete devices from cluster
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>DELETE /cluster/@clusterId/device/@deviceIds
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>clusterId</td>
<td>string</td>
<td>是</td>
<td>集群实例ID</td>
</tr>
<tr>
<td>deviceIds</td>
<td>string</td>
<td>是</td>
<td>主机实例ID列表, 用分号隔开</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

集群instanceId
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
<tr>
<td>130600</td>
<td>权限错误</td>
</tr>
</tbody>
</table>
<h2 id="-a-id-a-"><a id="-集群关联包"></a> 集群关联包</h2>
<blockquote>
<p>URL中的ClusterId 为集群InstanceId
</p>
</blockquote>
<h3 id="-">- 测试关键字</h3>
<pre><code>add package list to cluster
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>POST /cluster/@clusterId/package
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>clusterId</td>
<td>string</td>
<td>是</td>
<td>集群实例ID</td>
</tr>
<tr>
<td>package_list</td>
<td>struct</td>
<td>是</td>
<td>包列表</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

null
</p>
</blockquote>
<h3 id="-">- 请求示例</h3>
<pre><code>[
{
"packageId": "3d81bc9e85ea9ffc5959303c0ed09780",
"installPath": "/data/test"
}
]
</code></pre><h2 id="-a-id-a-"><a id="-解除集群关联包"></a> 解除集群关联包</h2>
<h3 id="-">- 测试关键字</h3>
<pre><code>delete package from cluster
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>DELETE /cluster/@clusterId/package/@packageIds
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>clusterId</td>
<td>string</td>
<td>是</td>
<td>集群实例ID</td>
</tr>
<tr>
<td>packageIds</td>
<td>string</td>
<td>是</td>
<td>包ID列表, 用分号隔开</td>
</tr>
<tr>
<td>installPath</td>
<td>string</td>
<td>是</td>
<td>包安装路径</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

null
</p>
</blockquote>
<h2 id="-a-id-a-"><a id="-修改集群关联包"></a> 修改集群关联包</h2>
<h3 id="-">- 测试关键字</h3>
<pre><code>update package in cluster
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>PUT /cluster/@clusterId/package
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>clusterId</td>
<td>string</td>
<td>是</td>
<td>应用id</td>
</tr>
<tr>
<td>packageId</td>
<td>string</td>
<td>是</td>
<td>包id</td>
</tr>
<tr>
<td>installPath</td>
<td>string</td>
<td>是</td>
<td>安装路径</td>
</tr>
<tr>
<td>installPathNew</td>
<td>string</td>
<td>否</td>
<td>修改后的安装路径,可选</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

null
</p>
</blockquote>
<h3 id="-">- 请求示例</h3>
<pre><code>{
"installPathNew": "data/test1",
"isMaster": "true",
"packageId": "3d81bc9e85ea9ffc5959303c0ed09780",
"installPath": "/data/test"
}
</code></pre><h2 id="-a-id-a-"><a id="-管理员修改用户信息"></a> 管理员修改用户信息</h2>
<h3 id="-">- 测试关键字</h3>
<pre><code>modify user by admin
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>PUT /admin/users/@name
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>name</td>
<td>string</td>
<td>是</td>
<td>用户名</td>
</tr>
<tr>
<td>email</td>
<td>string</td>
<td>否</td>
<td>邮箱</td>
</tr>
<tr>
<td>phone</td>
<td>string</td>
<td>否</td>
<td>手机</td>
</tr>
<tr>
<td>password</td>
<td>string</td>
<td>否</td>
<td>密码</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

null
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
<tr>
<td>130601</td>
<td>权限错误</td>
</tr>
</tbody>
</table>
<h2 id="-a-id-a-"><a id="-用户邀请注册"></a> 用户邀请注册</h2>
<h3 id="-">- 测试关键字</h3>
<pre><code>register by invite
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>POST /users/register
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>name</td>
<td>string</td>
<td>是</td>
<td>用户名</td>
</tr>
<tr>
<td>password</td>
<td>string</td>
<td>是</td>
<td>密码</td>
</tr>
<tr>
<td>email</td>
<td>string</td>
<td>是</td>
<td>邮箱</td>
</tr>
<tr>
<td>invite</td>
<td>string</td>
<td>是</td>
<td>邀请码</td>
</tr>
<tr>
<td>phone</td>
<td>string</td>
<td>否</td>
<td>电话</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

注册后用户信息
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
<tr>
<td>133201</td>
<td>邀请码无效</td>
</tr>
<tr>
<td>133210</td>
<td>用户名或信息重复</td>
</tr>
</tbody>
</table>
<h3 id="-">- 请求示例</h3>
<pre><code>{
"password": "dev@easyops",
"name": "indexzhuo3",
"invite": "SMRKTSKQY",
"email": "indexzhuo3@easyops.cn"
}
</code></pre><h3 id="-">- 返回示例</h3>
<pre><code>{
"message": "Success",
"code": 0,
"data": {
"name": "indexzhuo3",
"email_verified": "0",
"userId": "8",
"phone": "18888888888",
"role": "USER",
"phone_verified": "0",
"mtime": null,
"org": "1040",
"email": "indexzhuo3@easyops.cn",
"ctime": "2016-02-19 13:22:11"
},
"error": "\u6210\u529f"
}
</code></pre><h2 id="-a-id-apikey-a-apikey"><a id="-分页查询apikey"></a> 分页查询apikey</h2>
<h3 id="-">- 测试关键字</h3>
<pre><code>list apikey
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>GET /apikey
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>page</td>
<td>int</td>
<td>否</td>
<td>页码</td>
</tr>
<tr>
<td>page_size</td>
<td>int</td>
<td>否</td>
<td>页大小</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

apikey列表
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回示例</h3>
<pre><code>{
"message": "Success",
"code": 0,
"data": {
"total": 2,
"list": [
{
"access_key": "60ff85cf36510cd2ba91bd64",
"ctime": "2017-01-10 17:34:57",
"ts": 1490752672,
"state": "valid",
"user": "openapi",
"org": 8888,
"secret_key": "72261ec386cffc7597aa81530a606435e2ce26a181fca7a7749bf3ed70355812"
},
{
"access_key": "e7b6a060b55b42713332b93c",
"ctime": "2017-03-29 10:11:38",
"ts": 1490753498,
"state": "valid",
"user": "lightjiao11",
"org": 8888,
"secret_key": "f1ede17ef5078a9ef62fa0a113b43a710820257700ff67ae9b6a29eed891ec5a"
}
],
"page": 1,
"page_size": 30
},
"error": "\u6210\u529f"
}
</code></pre><h2 id="-a-id-apikey-a-apikey"><a id="-创建apikey"></a> 创建apikey</h2>
<h3 id="-">- 测试关键字</h3>
<pre><code>create apikey
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>POST /apikey
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>username</td>
<td>string</td>
<td>是</td>
<td>用户名</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

apikey信息
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
</tbody>
</table>
<h3 id="-">- 请求示例</h3>
<pre><code>{
"username": "lightjiao11",
}
</code></pre><h3 id="-">- 返回示例</h3>
<pre><code>{
"message": "Success",
"code": 0,
"data": {
"access_key": "e7b6a060b55b42713332b93c",
"ctime": "2017-03-29 10:11:38",
"ts": 1490753498,
"state": "valid",
"user": "lightjiao11",
"org": 8888,
"secret_key": "f1ede17ef5078a9ef62fa0a113b43a710820257700ff67ae9b6a29eed891ec5a"
},
"error": "\u6210\u529f"
}
</code></pre><h2 id="-a-id-apikey-a-apikey"><a id="-重置apikey"></a> 重置apikey</h2>
<h3 id="-">- 测试关键字</h3>
<pre><code>reset apikey
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>POST /apikey/_reset
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>username</td>
<td>string</td>
<td>是</td>
<td>用户名</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

apikey信息
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
</tbody>
</table>
<h3 id="-">- 请求示例</h3>
<pre><code>{
"username": "lightjiao11",
}
</code></pre><h3 id="-">- 返回示例</h3>
<pre><code>{
"message": "Success",
"code": 0,
"data": {
"access_key": "e7b6a060b55b42713332b93c",
"ctime": "2017-03-29 10:11:38",
"ts": 1490753498,
"state": "valid",
"user": "lightjiao11",
"org": 8888,
"secret_key": "f1ede17ef5078a9ef62fa0a113b43a710820257700ff67ae9b6a29eed891ec5a"
},
"error": "\u6210\u529f"
}
</code></pre><h2 id="-a-id-apikey-a-apikey"><a id="-启用apikey"></a> 启用apikey</h2>
<blockquote>
<p>根据access_key启用apikey, 启用后apikey的state值为valid
</p>
</blockquote>
<h3 id="-">- 测试关键字</h3>
<pre><code>enable apikey
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>PUT /apikey/@access_key/_enable
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>access_key</td>
<td>string</td>
<td>是</td>
<td>access_key</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

apikey信息
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
</tbody>
</table>
<h3 id="-">- 请求示例</h3>
<pre><code>PUT /apikey/e7b6a060b55b42713332b93c/_enable
</code></pre><h3 id="-">- 返回示例</h3>
<pre><code>{
"message": "Success",
"code": 0,
"data": {
"access_key": "e7b6a060b55b42713332b93c",
"ctime": "2017-03-29 10:11:38",
"ts": 1490753498,
"state": "valid",
"user": "lightjiao11",
"org": 8888,
"secret_key": "f1ede17ef5078a9ef62fa0a113b43a710820257700ff67ae9b6a29eed891ec5a"
},
"error": "\u6210\u529f"
}
</code></pre><h2 id="-a-id-apikey-a-apikey"><a id="-禁用apikey"></a> 禁用apikey</h2>
<blockquote>
<p>根据access_key禁用apikey, 禁用后apikey的state值为invalid
</p>
</blockquote>
<h3 id="-">- 测试关键字</h3>
<pre><code>disable apikey
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>PUT /apikey/@access_key/_disable
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>access_key</td>
<td>string</td>
<td>是</td>
<td>access_key</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

apikey信息
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
</tbody>
</table>
<h3 id="-">- 请求示例</h3>
<pre><code>PUT /apikey/e7b6a060b55b42713332b93c/_disable
</code></pre><h3 id="-">- 返回示例</h3>
<pre><code>{
"message": "Success",
"code": 0,
"data": {
"access_key": "e7b6a060b55b42713332b93c",
"ctime": "2017-03-29 10:11:38",
"ts": 1490753498,
"state": "invalid",
"user": "lightjiao11",
"org": 8888,
"secret_key": "f1ede17ef5078a9ef62fa0a113b43a710820257700ff67ae9b6a29eed891ec5a"
},
"error": "\u6210\u529f"
}
</code></pre><h2 id="-a-id-apikey-a-apikey"><a id="-删除apikey"></a> 删除apikey</h2>
<h3 id="-">- 测试关键字</h3>
<pre><code>delete apikey
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>DELETE /apikey/@access_key
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>access_key</td>
<td>int</td>
<td>是</td>
<td>access_key</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

json
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回示例</h3>
<pre><code>{
"message": "\u5220\u9664OpenAPI Key\u5931\u8d25",
"code": 130308,
"data": null,
"error": "\u67e5\u8be2\u65e0\u7ed3\u679c"
}
</code></pre><h2 id="-a-id-a-"><a id="-获取所有密钥对"></a> 获取所有密钥对</h2>
<h3 id="-">- 测试关键字</h3>
<pre><code>get keypair page
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>GET /v1/key_pairs
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>company</td>
<td>string</td>
<td>否</td>
<td>云提供商</td>
</tr>
<tr>
<td>page</td>
<td>int</td>
<td>否</td>
<td>页码</td>
</tr>
<tr>
<td>pageSize</td>
<td>int</td>
<td>否</td>
<td>每页数量</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

KeyPair列表
</p>
</blockquote>
<h3 id="-">- 返回示例</h3>
<pre><code>{
"message": "Success",
"code": 0,
"data": {
"total": 1,
"list": [
{
"name": "aws_easyops",
"login_private_key": "nogpoMJBuTdbGhoM1sgI2aIxqRO2bhG87/SEYKhhsQ0FMzdUUbFiEIfy4arCNe3SrGkH6wmsrEd2zjKLVrx1UTHDBG9uXXkZXnNcvgKmoibLAXwyIrjLIe5nu+TnWp91CsXqibBF7S6PUJrUSBul2awcXtNo8bxSl2ilRSbcvQxDlsWihbdFpJveXwVtldyNmRZ3t5dm3E3hWxGAQpoGy/vJGlrzJabCBZZjQk4zbXaunK3FhxP/FxvkZkWXGBG5k7WQZ0LDYetjbKpVqmwbf91HVB0mKGT9fpEIv9PfrqAVMB3mQHxUfcV6L2xnvzt3AJOEzTz5WAonuVxNoyO+dqszXh/28QW6HXNBOtau7Xzp90mWyqLvd2E/uRChA5se0gW6lnO10c2bs6BdwyMjtjTe7PR341hTLLv4k3znmmuI/k9tERpssDWVOO14nanxgEKLK3AlB41hwdMfJKbuCShfl6cc6m0CeqwwnsuzDqU1P1PKv8WVLO9IJuqBNmGH1jq+wme5GR5Izwxzw9SICoWq0kxDoySajfS771d8YmZHJTR0/f3bJYHl6rSpAUVWp4Mtw/bvpRcTstPUCizS8IlQjaLxfcVBYKrGAQNaLDAKDEZ9jh86g/cCh2De5nFS22MVLh4KWVrb7/abxaCYX051h5yBcpNZVdJUTaHCGknrkuQV2jWvaoMo67HIYGxIt/rca1CZOlStsnWpMaiN2oYrcB16fL7pmGSrzs0Ynifw2JA4wtjFGe+fpmsLvTeNuY7oZQeu3KtdBwSIke+hOn4TQ/6/MNQxcmewSMZVJOTD8CwrIoz0MQuQdn4p8zMgLJXk4iOQfV2C3LDxK9xp3rtqM4MJXhWDxBjZ5LKCn75iAiZ7JS/Sz1gTM3aaHo+M1hsqMMMNnjgkLhKn7CpCMZ9+VeHfrYLfeckP6BSWlE39864lwyDNOA17XZ2SxbAi7mlXkTUHIHAjw5zfccVWdPAsidbdeyeijLe0eVS5JrRTcU2+KIxd3y/rwldo4EHZIQ9doDQmyQlRfL2FGEn+I3JUKaLCF08vUXuaq6p0sD61c2oISV8W2Yr94Hmo2bzPc/1RU9v2MPARhhl6cYO8svTsMvttP+f/RnwKp+A3DF427v3tor3H/w0tJ3BQ127VXIfdp1D3FLA8/sFj3tY6gRDVyzLxS+2HeMbCc2XFfTnHA1UgEsM/9GIdBKnPzkb6FgEi0eqA+kjcq3YPCRhuKK9UMSJ0C6NFe1sxJNCel8U6juTcIOXvpX3hEqERcqSOoHqGHAJsCZZcRyv1Mh1rmWL4D7HSmiy+LWzF7dV3xROvfRBJ84kO3MJDFAUtjAkkV0GJj3e302voZP9nYm/f1uqtOii5tlzJEkDKcPkWXPQF5Mr/NJEQBFuYlapLzXyQVHMq8OBb8LhII3rBeVZ3l7ypLnA+S+Xat+u8PQRwtrZouaFchHqC9AxIgB0BJzCfTck/cfgE2oQ+eS2ZRSgGrqPvcXBcYX16p8Q/j9aNsJ/sKaZqHWoNepsBcTPax6CGWIJKoT97nxmPzxqla5Pck2sVwPEL4RWnNVKqsqLu+GrXy2AFBXuLwEZjmFaAqlsUzyMdtMBgw3gk+n4OyEyclphbavBZ9kOynz69UilsScIw1JS8hnyzfitPYohHsUV9fWVuink+fDbg5W5AyAx94wEASJSLxsp/aG7ZqydYA2knsk4NNy6oHop2mCKXz9f36Nl1T6tDQHihejpUuK/Rhy878jsu/TWQ5pqgg5dU5lNl4D06KV7DPJL48o585FUQjHt6rFB0ZozjHY4+slocc6Bi9Aavtvlz4+l7LksTGFRLrZ6TIh9QPBPOUE2/JDmKXjsK3AXHibIFvAjaX9HnL+7JwLzPrTXk9f2BxAjwquy+T0T3x7G1Ro/yYlqjoShE+jC4fnmvks63CqPdiooT82uD9ZQovPxVevjRTU9KuVsJ13du7xobUAeNPNRVfLp2eAduzCCyMUOrTTjDLzK28r34Ss1qfL2PqGDMaiDpSdl3g2WWTjpZ+tymsN5Ao2P5usjbdSDOGjkTzR3UEnrwG1h90SYHtya5cD7VM6XWbCB678SHBrA5z6pYJWIAzURwokztW54edMY6NXKFTgOywdhzKCaP4Py+pa9aK1ry8sUJvjhOWlFaLeYM+smDMfv8Crtbyu4+C78fzVfekQiLdz4eM8WHF+VBgipPYFH0foc7fd6GzD5ElWNkukTu/9GCC8doF/hReZSY63tCXjxcgw==",
"company": "Amazon Web Services",
"mtime": null,
"state": "valid",
"secret": "aj/iQM6W33fx3QMZvmDPW6ESXYbAAjndw4iJaoCITFeKV5vpmfomCczMQ91no7cQ",
"org": 8888,
"key_id": "AKIAPDBJETHSWZKAZXPQ",
"_id": "58b14c0959b8ce640b1e59c7",
"ctime": "2017-02-25 17:19:05"
}
],
"page": 0,
"pageSize": 200
},
"error": "\u6210\u529f"
}
</code></pre><h2 id="-a-id-a-"><a id="-获取密钥对"></a> 获取密钥对</h2>
<blockquote>
<p>参数中的id为Mongo数据库中的 _id
</p>
</blockquote>
<h3 id="-">- 测试关键字</h3>
<pre><code>get keypair
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>GET /v1/key_pairs/@id
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>id</td>
<td>string</td>
<td>是</td>
<td>密钥对的 _id</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

密钥对数据
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>默认数据库错误</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回示例</h3>
<pre><code>{
"message": "Success",
"code": 0,
"data": {
"name": "aws_easyops",
"login_private_key": "nogpoMJBuTdbGhoM1sgI2aIxqRO2bhG87/SEYKhhsQ0FMzdUUbFiEIfy4arCNe3SrGkH6wmsrEd2zjKLVrx1UTHDBG9uXXkZXnNcvgKmoibLAXwyIrjLIe5nu+TnWp91CsXqibBF7S6PUJrUSBul2awcXtNo8bxSl2ilRSbcvQxDlsWihbdFpJveXwVtldyNmRZ3t5dm3E3hWxGAQpoGy/vJGlrzJabCBZZjQk4zbXaunK3FhxP/FxvkZkWXGBG5k7WQZ0LDYetjbKpVqmwbf91HVB0mKGT9fpEIv9PfrqAVMB3mQHxUfcV6L2xnvzt3AJOEzTz5WAonuVxNoyO+dqszXh/28QW6HXNBOtau7Xzp90mWyqLvd2E/uRChA5se0gW6lnO10c2bs6BdwyMjtjTe7PR341hTLLv4k3znmmuI/k9tERpssDWVOO14nanxgEKLK3AlB41hwdMfJKbuCShfl6cc6m0CeqwwnsuzDqU1P1PKv8WVLO9IJuqBNmGH1jq+wme5GR5Izwxzw9SICoWq0kxDoySajfS771d8YmZHJTR0/f3bJYHl6rSpAUVWp4Mtw/bvpRcTstPUCizS8IlQjaLxfcVBYKrGAQNaLDAKDEZ9jh86g/cCh2De5nFS22MVLh4KWVrb7/abxaCYX051h5yBcpNZVdJUTaHCGknrkuQV2jWvaoMo67HIYGxIt/rca1CZOlStsnWpMaiN2oYrcB16fL7pmGSrzs0Ynifw2JA4wtjFGe+fpmsLvTeNuY7oZQeu3KtdBwSIke+hOn4TQ/6/MNQxcmewSMZVJOTD8CwrIoz0MQuQdn4p8zMgLJXk4iOQfV2C3LDxK9xp3rtqM4MJXhWDxBjZ5LKCn75iAiZ7JS/Sz1gTM3aaHo+M1hsqMMMNnjgkLhKn7CpCMZ9+VeHfrYLfeckP6BSWlE39864lwyDNOA17XZ2SxbAi7mlXkTUHIHAjw5zfccVWdPAsidbdeyeijLe0eVS5JrRTcU2+KIxd3y/rwldo4EHZIQ9doDQmyQlRfL2FGEn+I3JUKaLCF08vUXuaq6p0sD61c2oISV8W2Yr94Hmo2bzPc/1RU9v2MPARhhl6cYO8svTsMvttP+f/RnwKp+A3DF427v3tor3H/w0tJ3BQ127VXIfdp1D3FLA8/sFj3tY6gRDVyzLxS+2HeMbCc2XFfTnHA1UgEsM/9GIdBKnPzkb6FgEi0eqA+kjcq3YPCRhuKK9UMSJ0C6NFe1sxJNCel8U6juTcIOXvpX3hEqERcqSOoHqGHAJsCZZcRyv1Mh1rmWL4D7HSmiy+LWzF7dV3xROvfRBJ84kO3MJDFAUtjAkkV0GJj3e302voZP9nYm/f1uqtOii5tlzJEkDKcPkWXPQF5Mr/NJEQBFuYlapLzXyQVHMq8OBb8LhII3rBeVZ3l7ypLnA+S+Xat+u8PQRwtrZouaFchHqC9AxIgB0BJzCfTck/cfgE2oQ+eS2ZRSgGrqPvcXBcYX16p8Q/j9aNsJ/sKaZqHWoNepsBcTPax6CGWIJKoT97nxmPzxqla5Pck2sVwPEL4RWnNVKqsqLu+GrXy2AFBXuLwEZjmFaAqlsUzyMdtMBgw3gk+n4OyEyclphbavBZ9kOynz69UilsScIw1JS8hnyzfitPYohHsUV9fWVuink+fDbg5W5AyAx94wEASJSLxsp/aG7ZqydYA2knsk4NNy6oHop2mCKXz9f36Nl1T6tDQHihejpUuK/Rhy878jsu/TWQ5pqgg5dU5lNl4D06KV7DPJL48o585FUQjHt6rFB0ZozjHY4+slocc6Bi9Aavtvlz4+l7LksTGFRLrZ6TIh9QPBPOUE2/JDmKXjsK3AXHibIFvAjaX9HnL+7JwLzPrTXk9f2BxAjwquy+T0T3x7G1Ro/yYlqjoShE+jC4fnmvks63CqPdiooT82uD9ZQovPxVevjRTU9KuVsJ13du7xobUAeNPNRVfLp2eAduzCCyMUOrTTjDLzK28r34Ss1qfL2PqGDMaiDpSdl3g2WWTjpZ+tymsN5Ao2P5usjbdSDOGjkTzR3UEnrwG1h90SYHtya5cD7VM6XWbCB678SHBrA5z6pYJWIAzURwokztW54edMY6NXKFTgOywdhzKCaP4Py+pa9aK1ry8sUJvjhOWlFaLeYM+smDMfv8Crtbyu4+C78fzVfekQiLdz4eM8WHF+VBgipPYFH0foc7fd6GzD5ElWNkukTu/9GCC8doF/hReZSY63tCXjxcgw==",
"company": "Amazon Web Services",
"mtime": null,
"state": "valid",
"secret": "aj/iQM6W33fx3QMZvmDPW6ESXYbAAjndw4iJaoCITFeKV5vpmfomCczMQ91no7cQ",
"org": 8888,
"key_id": "AKIAPDBJETHSWZKAZXPQ",
"_id": "58b14c0959b8ce640b1e59c7",
"ctime": "2017-02-25 17:19:05"
},
"error": "\u6210\u529f"
}
</code></pre><h2 id="-a-id-a-"><a id="-添加密钥对"></a> 添加密钥对</h2>
<blockquote>
<p>添加密钥对的行为为覆盖添加, 即删除掉已经存在的密钥对重新添加, 以company为唯一
</p>
</blockquote>
<h3 id="-">- 测试关键字</h3>
<pre><code>add keypair
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>POST /v1/key_pairs
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>company</td>
<td>string</td>
<td>是</td>
<td>公司</td>
</tr>
<tr>
<td>name</td>
<td>string</td>
<td>是</td>
<td>键值对名称</td>
</tr>
<tr>
<td>key_id</td>
<td>string</td>
<td>是</td>
<td>键值对ID</td>
</tr>
<tr>
<td>secret</td>
<td>string</td>
<td>是</td>
<td>键值对密码</td>
</tr>
<tr>
<td>login_private_key</td>
<td>string</td>
<td>是</td>
<td>登录私钥</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

创建成功的密钥对信息
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
<tr>
<td>130601</td>
<td>权限错误</td>
</tr>
<tr>
<td>130313</td>
<td>重复键错误</td>
</tr>
</tbody>
</table>
<h2 id="-a-id-a-"><a id="-修改密钥对"></a> 修改密钥对</h2>
<blockquote>
<p>参数中的id为Mongo数据库中的 _id; 提供商不可修改
</p>
</blockquote>
<h3 id="-">- 测试关键字</h3>
<pre><code>update key pair
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>PUT /v1/key_pairs/@id
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>id</td>
<td>string</td>
<td>是</td>
<td>密钥对的 _id</td>
</tr>
<tr>
<td>name</td>
<td>string</td>
<td>否</td>
<td>键值对名称</td>
</tr>
<tr>
<td>key_id</td>
<td>string</td>
<td>否</td>
<td>键值对ID</td>
</tr>
<tr>
<td>secret</td>
<td>string</td>
<td>否</td>
<td>键值对密码</td>
</tr>
<tr>
<td>login_private_key</td>
<td>string</td>
<td>否</td>
<td>登录私钥</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

修改后的键值对信息
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
<tr>
<td>130601</td>
<td>权限错误</td>
</tr>
</tbody>
</table>
<h2 id="-a-id-a-"><a id="-删除密钥对"></a> 删除密钥对</h2>
<blockquote>
<p>参数中的id为Mongo数据库中的 _id
</p>
</blockquote>
<h3 id="-">- 测试关键字</h3>
<pre><code>delete key pair
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>DELETE /v1/key_pairs/@id
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>id</td>
<td>string</td>
<td>是</td>
<td>密钥对的 _id</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

删除的 _id
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
<tr>
<td>130601</td>
<td>权限错误</td>
</tr>
</tbody>
</table>
<h2 id="-a-id-a-"><a id="-创建订阅规则"></a> 创建订阅规则</h2>
<h3 id="-">- 测试关键字</h3>
<pre><code>create subscription rule
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>POST /object/@object_id/subscription
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>object_id</td>
<td>string</td>
<td>是</td>
<td>资源模型ID</td>
</tr>
<tr>
<td>type</td>
<td>string</td>
<td>是</td>
<td>规则类型 instance/relation_query_strategy</td>
</tr>
<tr>
<td>crontab</td>
<td>string</td>
<td>是</td>
<td>定时任务策略</td>
</tr>
<tr>
<td>receive_user</td>
<td>array</td>
<td>否</td>
<td>导出结果接收用户实例Id列表</td>
</tr>
<tr>
<td>receive_group</td>
<td>array</td>
<td>否</td>
<td>导出结果接收用户组实例Id列表</td>
</tr>
<tr>
<td>relation_query_strategy_id</td>
<td>string</td>
<td>否</td>
<td>关系查询策略Id,当type=relation_query_strategy时,需必填</td>
</tr>
<tr>
<td>query_url</td>
<td>string</td>
<td>是</td>
<td>查询结果页URL</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

订阅规则创建结果
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
</tbody>
</table>
<h3 id="-">- 请求示例</h3>
<pre><code>POST /object/APP/subscription
{
"type":"instance/relation_query_strategy",
"crontab":"* * * * ",
"receive_user":["5a77377","883a883838"],
"receive_group":["5a5555e5","5a62663"],
"relation_query_strategy_id":"4252535",
"query_url":"https://www.google.com.hk"
}
</code></pre><h3 id="-">- 返回示例</h3>
<pre><code>{
"code": 0,
"error": "成功",
"message": "Success",
"data": {
"subscription_id": "590bdb58e53ae0061a0ce812",
"object_id": "APP",
"type":"instance/relation_query_strategy",
"crontab":"
* * * ",
"receive_user":["5a77377","883a883838"],
"receive_group":["5a5555e5","5a62663"],
"relation_query_strategy_id":"4252535",
"scheduler_id":"5ade9d2f59b8ce775ed8da3c",
"query_url":"https://www.google.com.hk",
"operator":"easyops",
"ts":"22222222",
}
</code></pre><h2 id="-a-id-a-"><a id="-修改订阅规则"></a> 修改订阅规则</h2>
<h3 id="-">- 测试关键字</h3>
<pre><code>modify subscription rule
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>PUT /object/@object_id/subscription/@subscription_id
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>object_id</td>
<td>string</td>
<td>是</td>
<td>资源模型ID</td>
</tr>
<tr>
<td>subscription_id</td>
<td>string</td>
<td>是</td>
<td>订阅规则Id</td>
</tr>
<tr>
<td>crontab</td>
<td>string</td>
<td>否</td>
<td>定时任务策略</td>
</tr>
<tr>
<td>receive_user</td>
<td>array</td>
<td>否</td>
<td>导出结果接收用户实例Id列表</td>
</tr>
<tr>
<td>receive_group</td>
<td>array</td>
<td>否</td>
<td>导出结果接收用户组实例Id列表</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

订阅规则修改结果
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
<tr>
<td>134000</td>
<td>订阅策略失效</td>
</tr>
</tbody>
</table>
<h3 id="-">- 请求示例</h3>
<pre><code>PUT /object/APP/subscription/535356253
{
"crontab":"
* * * ",
"receive_user":["5a77377","883a883838"],
"receive_group":["5a5555e5","5a62663"],
}
</code></pre><h3 id="-">- 返回示例</h3>
<pre><code>{
"message": "Success",
"code": 0,
"data": {
"scheduler_id": "5af2cf6e7231367e93b5fa99",
"object_id": "APP",
"ts": 1525862481,
"receive_group": [
"5a5555e5",
"5a62663"
],
"query_url": "https://www.google.com.hk",
"relation_query_strategy_id": "123",
"crontab": "
* * * *",
"operator": "easyops",
"subscription_id": "5af2cf6d7c587",
"_id": {
"oid": "5af2cf6e723136357c748616" }, "type": "relation_query_strategy", "receive_user": [ "5a77377", "883a883838" ] }, "error": "\u6210\u529f" } </code></pre><h2 id="-a-id-a-"><a id="-删除订阅规则"></a> 删除订阅规则</h2> <h3 id="-">- 测试关键字</h3> <pre><code>delete subscription rule </code></pre><h3 id="-url">- 接口访问URL</h3> <pre><code>DELETE /object/@object_id/subscription/@subscription_id </code></pre><h3 id="-">- 参数</h3> <table> <thead> <tr> <th>名称</th> <th>类型</th> <th>必选</th> <th>备注</th> <th>默认值</th> </tr> </thead> <tbody> <tr> <td>object_id</td> <td>string</td> <td>是</td> <td>资源模型ID</td> </tr> <tr> <td>subscription_id</td> <td>string</td> <td>是</td> <td>订阅规则Id</td> </tr> </tbody> </table> <h3 id="-">- 返回值说明</h3> <blockquote> <p>返回类型: json <br> 订阅规则删除结果 <br></p> </blockquote> <h3 id="-">- 返回码</h3> <table> <thead> <tr> <th>返回码</th> <th>备注</th> </tr> </thead> <tbody> <tr> <td>130300</td> <td>数据库错误</td> </tr> </tbody> </table> <h3 id="-">- 请求示例</h3> <pre><code>DELETE /object/APP/subscription/535356253 </code></pre><h3 id="-">- 返回示例</h3> <pre><code>{ "message": "Success", "code": 0, "data": null, "error": "\u6210\u529f" } </code></pre><h2 id="-a-id-a-"><a id="-获取订阅规则"></a> 获取订阅规则</h2> <h3 id="-">- 测试关键字</h3> <pre><code>get subscription list </code></pre><h3 id="-url">- 接口访问URL</h3> <pre><code>GET /object/@object_id/subscription/@type/list </code></pre><h3 id="-">- 参数</h3> <table> <thead> <tr> <th>名称</th> <th>类型</th> <th>必选</th> <th>备注</th> <th>默认值</th> </tr> </thead> <tbody> <tr> <td>object_id</td> <td>string</td> <td>是</td> <td>资源模型ID</td> </tr> <tr> <td>type</td> <td>string</td> <td>是</td> <td>订阅规则type,值为instance或relation_query_strategy,当type=relation_query_strategy时,需有relation_query_strategy_id参数</td> </tr> <tr> <td>relation_query_strategy_id</td> <td>string</td> <td>否</td> <td>关系查询策略Id</td> </tr> </tbody> </table> <h3 id="-">- 返回值说明</h3> <blockquote> <p>返回类型: json <br> 订阅规则查询结果列表 <br></p> </blockquote> <h3 id="-">- 返回码</h3> <table> <thead> <tr> <th>返回码</th> <th>备注</th> </tr> </thead> <tbody> <tr> <td>130300</td> <td>数据库错误</td> </tr> </tbody> </table> <h3 id="-">- 请求示例</h3> <pre><code>GET /object/APP/subscription/relation_query_strategy/list?relation_query_strategy_id=544444434 </code></pre><h3 id="-">- 返回示例</h3> <pre><code>{ "message": "Success", "code": 0, "data": [ { "scheduler_id": "5ade9d2f59b8ce775ed8da3c", "object_id": "APP", "ts": "22222222", "receive_group": [ "5a5555e5", "5a62663" ], "query_url": "https://www.google.com.hk", "relation_query_strategy_id": "4252535", "crontab": "* * * * *", "operator": "easyops", "subscription_id": "590bdb58e53ae0061a0ce812", "type": "instance/relation_query_strategy", "receive_user": [ "5a77377", "883a883838" ] } ], "error": "\u6210\u529f" } </code></pre><h2 id="-a-id-a-"><a id="-查询关系查询策略是否被订阅规则使用"></a> 查询关系查询策略是否被订阅规则使用</h2> <h3 id="-">- 测试关键字</h3> <pre><code>check object relation query strategy in use </code></pre><h3 id="-url">- 接口访问URL</h3> <pre><code>GET /object/@object_id/relation_query_strategy/@relation_query_strategy_id/_check_in_use </code></pre><h3 id="-">- 参数</h3> <table> <thead> <tr> <th>名称</th> <th>类型</th> <th>必选</th> <th>备注</th> <th>默认值</th> </tr> </thead> <tbody> <tr> <td>object_id</td> <td>string</td> <td>是</td> <td>资源模型ID</td> </tr> <tr> <td>relation_query_strategy_id</td> <td>string</td> <td>是</td> <td>策略ID</td> </tr> </tbody> </table> <h3 id="-">- 返回值说明</h3> <blockquote> <p>返回类型: json <br> json <br></p> </blockquote> <h3 id="-">- 返回示例</h3> <pre><code>{ "message": "Success", "code": 0, "data": { "in_use": true }, "error": "\u6210\u529f" } </code></pre><h2 id="-a-id-a-"><a id="-发送邮件"></a> 发送邮件</h2> <h3 id="-">- 测试关键字</h3> <pre><code>send mail </code></pre><h3 id="-url">- 接口访问URL</h3> <pre><code>POST /message/email </code></pre><h3 id="-">- 参数</h3> <table> <thead> <tr> <th>名称</th> <th>类型</th> <th>必选</th> <th>备注</th> <th>默认值</th> </tr> </thead> <tbody> <tr> <td>sendTo</td> <td>string</td> <td>是</td> <td>目标地址</td> </tr> <tr> <td>subject</td> <td>string</td> <td>是</td> <td>邮件标题</td> </tr> <tr> <td>msg</td> <td>string</td> <td>是</td> <td>消息内容</td> </tr> <tr> <td>cc</td> <td>string</td> <td>否</td> <td>抄送</td> </tr> <tr> <td>sendFrom</td> <td>string</td> <td>否</td> <td>发送方地址</td> </tr> <tr> <td>sendFromName</td> <td>string</td> <td>否</td> <td>发送方名称</td> </tr> <tr> <td>contentType</td> <td>string</td> <td>否</td> <td>发送内容类型, 请参考网址<a href="https://en.wikipedia.org/wiki/Media_type">https://en.wikipedia.org/wiki/Media_type</a>, 默认为text/plain</td> </tr> </tbody> </table> <h3 id="-">- 返回值说明</h3> <blockquote> <p>返回类型: json <br> null <br></p> </blockquote> <h3 id="-">- 返回码</h3> <table> <thead> <tr> <th>返回码</th> <th>备注</th> </tr> </thead> <tbody> <tr> <td>130300</td> <td>数据库错误</td> </tr> </tbody> </table> <h2 id="-a-id-a-"><a id="-用户登录"></a> 用户登录</h2> <blockquote> <p>用户登录接口 <br></p> </blockquote> <h3 id="-">- 测试关键字</h3> <pre><code>login </code></pre><h3 id="-url">- 接口访问URL</h3> <pre><code>POST /login </code></pre><h3 id="-">- 参数</h3> <table> <thead> <tr> <th>名称</th> <th>类型</th> <th>必选</th> <th>备注</th> <th>默认值</th> </tr> </thead> <tbody> <tr> <td>uid</td> <td>string</td> <td>是</td> <td>登录id</td> </tr> <tr> <td>password</td> <td>string</td> <td>是</td> <td>登录密码</td> </tr> </tbody> </table> <h3 id="-">- 返回值说明</h3> <blockquote> <p>返回类型: json <br> 用户信息 <br></p> </blockquote> <h3 id="-">- 返回码</h3> <table> <thead> <tr> <th>返回码</th> <th>备注</th> </tr> </thead> <tbody> <tr> <td>130300</td> <td>数据库错误</td> </tr> </tbody> </table> <h3 id="-">- 请求示例</h3> <pre><code>{ "password": "654321", "uid": "indexzhuo" } </code></pre><h3 id="-">- 返回示例</h3> <pre><code>{ "message": "Success", "code": 0, "data": { "org": 8888, "name": "indexzhuo" }, "error": "\u6210\u529f" } </code></pre><h2 id="-a-id-a-"><a id="-发现基础拓扑节点信息"></a> 发现基础拓扑节点信息</h2> <h3 id="-url">- 接口访问URL</h3> <pre><code>PUT /topology/base/@type/@node/_discover </code></pre><h3 id="-">- 参数</h3> <table> <thead> <tr> <th>名称</th> <th>类型</th> <th>必选</th> <th>备注</th> <th>默认值</th> </tr> </thead> <tbody> <tr> <td>type</td> <td>string</td> <td>是</td> <td>基础拓扑类型</td> </tr> <tr> <td>node</td> <td>string</td> <td>是</td> <td>基础拓扑点ID</td> </tr> <tr> <td>edge_list</td> <td>array</td> <td>是</td> <td>基础拓扑边信息</td> </tr> </tbody> </table> <h3 id="-">- 返回值说明</h3> <blockquote> <p>返回类型: json <br> null <br></p> </blockquote> <h3 id="-">- 返回码</h3> <table> <thead> <tr> <th>返回码</th> <th>备注</th> </tr> </thead> <tbody> <tr> <td>130300</td> <td>数据库错误</td> </tr> </tbody> </table> <h2 id="-a-id-a-"><a id="-查询基础拓扑节点信息"></a> 查询基础拓扑节点信息</h2> <h3 id="-url">- 接口访问URL</h3> <pre><code>GET /topology/base/@type/@node </code></pre><h3 id="-">- 参数</h3> <table> <thead> <tr> <th>名称</th> <th>类型</th> <th>必选</th> <th>备注</th> <th>默认值</th> </tr> </thead> <tbody> <tr> <td>type</td> <td>string</td> <td>是</td> <td>基础拓扑类型</td> </tr> <tr> <td>node</td> <td>string</td> <td>是</td> <td>基础拓扑点ID</td> </tr> </tbody> </table> <h3 id="-">- 返回值说明</h3> <blockquote> <p>返回类型: json <br> 拓扑节点信息 <br></p> </blockquote> <h3 id="-">- 返回码</h3> <table> <thead> <tr> <th>返回码</th> <th>备注</th> </tr> </thead> <tbody> <tr> <td>130300</td> <td>数据库错误</td> </tr> </tbody> </table> <h2 id="-a-id-a-"><a id="-删除基础拓扑节点信息"></a> 删除基础拓扑节点信息</h2> <h3 id="-url">- 接口访问URL</h3> <pre><code>DELETE /topology/base/@type/@node </code></pre><h3 id="-">- 参数</h3> <table> <thead> <tr> <th>名称</th> <th>类型</th> <th>必选</th> <th>备注</th> <th>默认值</th> </tr> </thead> <tbody> <tr> <td>type</td> <td>string</td> <td>是</td> <td>基础拓扑类型</td> </tr> <tr> <td>node</td> <td>string</td> <td>是</td> <td>基础拓扑点ID</td> </tr> </tbody> </table> <h3 id="-">- 返回值说明</h3> <blockquote> <p>返回类型: json <br> null <br></p> </blockquote> <h3 id="-">- 返回码</h3> <table> <thead> <tr> <th>返回码</th> <th>备注</th> </tr> </thead> <tbody> <tr> <td>130300</td> <td>数据库错误</td> </tr> </tbody> </table> <h2 id="-a-id-a-"><a id="-创建基础拓扑节点信息"></a> 创建基础拓扑节点信息</h2> <h3 id="-url">- 接口访问URL</h3> <pre><code>POST /topology/base/@type/@node </code></pre><h3 id="-">- 参数</h3> <table> <thead> <tr> <th>名称</th> <th>类型</th> <th>必选</th> <th>备注</th> <th>默认值</th> </tr> </thead> <tbody> <tr> <td>type</td> <td>string</td> <td>是</td> <td>基础拓扑类型</td> </tr> <tr> <td>node</td> <td>string</td> <td>是</td> <td>基础拓扑点ID</td> </tr> <tr> <td>edge_list</td> <td>array</td> <td>是</td> <td>基础拓扑边信息</td> </tr> </tbody> </table> <h3 id="-">- 返回值说明</h3> <blockquote> <p>返回类型: json <br> 拓扑点ID <br></p> </blockquote> <h3 id="-">- 返回码</h3> <table> <thead> <tr> <th>返回码</th> <th>备注</th> </tr> </thead> <tbody> <tr> <td>130300</td> <td>数据库错误</td> </tr> </tbody> </table> <h2 id="-a-id-a-"><a id="-更新基础拓扑节点信息"></a> 更新基础拓扑节点信息</h2> <h3 id="-url">- 接口访问URL</h3> <pre><code>PUT /topology/base/@type/@node/@version </code></pre><h3 id="-">- 参数</h3> <table> <thead> <tr> <th>名称</th> <th>类型</th> <th>必选</th> <th>备注</th> <th>默认值</th> </tr> </thead> <tbody> <tr> <td>type</td> <td>string</td> <td>是</td> <td>基础拓扑类型</td> </tr> <tr> <td>node</td> <td>string</td> <td>是</td> <td>基础拓扑点ID</td> </tr> <tr> <td>version</td> <td>string</td> <td>是</td> <td>文档版本</td> </tr> <tr> <td>edge_list</td> <td>array</td> <td>否</td> <td>基础拓扑边列表</td> </tr> </tbody> </table> <h3 id="-">- 返回值说明</h3> <blockquote> <p>返回类型: json <br> 更新后节点信息 <br></p> </blockquote> <h3 id="-">- 返回码</h3> <table> <thead> <tr> <th>返回码</th> <th>备注</th> </tr> </thead> <tbody> <tr> <td>130300</td> <td>数据库错误</td> </tr> </tbody> </table> <h2 id="-a-id-a-"><a id="-查询拓扑信息"></a> 查询拓扑信息</h2> <h3 id="-url">- 接口访问URL</h3> <pre><code>GET /topology/custom/@id </code></pre><h3 id="-">- 参数</h3> <table> <thead> <tr> <th>名称</th> <th>类型</th> <th>必选</th> <th>备注</th> <th>默认值</th> </tr> </thead> <tbody> <tr> <td>id</td> <td>string</td> <td>是</td> <td>文档_id</td> </tr> </tbody> </table> <h3 id="-">- 返回值说明</h3> <blockquote> <p>返回类型: json <br> 拓扑信息 <br></p> </blockquote> <h3 id="-">- 返回码</h3> <table> <thead> <tr> <th>返回码</th> <th>备注</th> </tr> </thead> <tbody> <tr> <td>130300</td> <td>数据库错误</td> </tr> </tbody> </table> <h2 id="-a-id-a-"><a id="-创建拓扑信息"></a> 创建拓扑信息</h2> <h3 id="-url">- 接口访问URL</h3> <pre><code>POST /topology/custom </code></pre><h3 id="-">- 参数</h3> <table> <thead> <tr> <th>名称</th> <th>类型</th> <th>必选</th> <th>备注</th> <th>默认值</th> </tr> </thead> <tbody> <tr> <td>name</td> <td>string</td> <td>是</td> <td>节点名称</td> </tr> <tr> <td>nodes</td> <td>array</td> <td>是</td> <td>节点信息</td> </tr> <tr> <td>links</td> <td>array</td> <td>是</td> <td>节点链接</td> </tr> </tbody> </table> <h3 id="-">- 返回值说明</h3> <blockquote> <p>返回类型: json <br> 创建后的节点ID <br></p> </blockquote> <h3 id="-">- 返回码</h3> <table> <thead> <tr> <th>返回码</th> <th>备注</th> </tr> </thead> <tbody> <tr> <td>130300</td> <td>数据库错误</td> </tr> </tbody> </table> <h2 id="-a-id-a-"><a id="-更新拓扑信息"></a> 更新拓扑信息</h2> <h3 id="-url">- 接口访问URL</h3> <pre><code>PUT /topology/custom/@id/@version </code></pre><h3 id="-">- 参数</h3> <table> <thead> <tr> <th>名称</th> <th>类型</th> <th>必选</th> <th>备注</th> <th>默认值</th> </tr> </thead> <tbody> <tr> <td>id</td> <td>string</td> <td>是</td> <td>文档_id</td> </tr> <tr> <td>version</td> <td>string</td> <td>是</td> <td>文档版本</td> </tr> <tr> <td>name</td> <td>string</td> <td>是</td> <td>节点名称</td> </tr> <tr> <td>nodes</td> <td>array</td> <td>是</td> <td>节点信息</td> </tr> <tr> <td>links</td> <td>array</td> <td>是</td> <td>节点链接</td> </tr> </tbody> </table> <h3 id="-">- 返回值说明</h3> <blockquote> <p>返回类型: json <br> 更新后的节点信息 <br></p> </blockquote> <h3 id="-">- 返回码</h3> <table> <thead> <tr> <th>返回码</th> <th>备注</th> </tr> </thead> <tbody> <tr> <td>130300</td> <td>数据库错误</td> </tr> </tbody> </table> <h2 id="-a-id-a-"><a id="-删除拓扑信息"></a> 删除拓扑信息</h2> <h3 id="-url">- 接口访问URL</h3> <pre><code>DELETE /topology/custom/@id </code></pre><h3 id="-">- 参数</h3> <table> <thead> <tr> <th>名称</th> <th>类型</th> <th>必选</th> <th>备注</th> <th>默认值</th> </tr> </thead> <tbody> <tr> <td>id</td> <td>string</td> <td>是</td> <td>文档_id</td> </tr> </tbody> </table> <h3 id="-">- 返回值说明</h3> <blockquote> <p>返回类型: json <br> null <br></p> </blockquote> <h2 id="-a-id-a-"><a id="-获取应用信息"></a> 获取应用信息</h2> <h3 id="-">- 测试关键字</h3> <pre><code>get app </code></pre><h3 id="-url">- 接口访问URL</h3> <pre><code>GET /app/@instanceId </code></pre><h3 id="-">- 参数</h3> <table> <thead> <tr> <th>名称</th> <th>类型</th> <th>必选</th> <th>备注</th> <th>默认值</th> </tr> </thead> <tbody> <tr> <td>instanceId</td> <td>string</td> <td>是</td> <td>实例ID</td> </tr> </tbody> </table> <h3 id="-">- 返回值说明</h3> <blockquote> <p>返回类型: json <br> 应用详情 <br></p> </blockquote> <h3 id="-">- 返回码</h3> <table> <thead> <tr> <th>返回码</th> <th>备注</th> </tr> </thead> <tbody> <tr> <td>130300</td> <td>数据库错误</td> </tr> <tr> <td>130600</td> <td>权限错误</td> </tr> </tbody> </table> <h2 id="-a-id-a-"><a id="-创建应用"></a> 创建应用</h2> <h3 id="-">- 测试关键字</h3> <pre><code>create app </code></pre><h3 id="-url">- 接口访问URL</h3> <pre><code>POST /app </code></pre><h3 id="-">- 参数</h3> <table> <thead> <tr> <th>名称</th> <th>类型</th> <th>必选</th> <th>备注</th> <th>默认值</th> </tr> </thead> <tbody> <tr> <td>name</td> <td>string</td> <td>是</td> <td>应用名</td> </tr> <tr> <td>owner</td> <td>array</td> <td>是</td> <td>运维负责人实例id列表</td> </tr> <tr> <td>developer</td> <td>array</td> <td>否</td> <td>开发负责人实例id列表</td> </tr> <tr> <td>tester</td> <td>array</td> <td>否</td> <td>测试负责人实例id列表</td> </tr> <tr> <td>businesses</td> <td>string</td> <td>否</td> <td>关联业务实例id</td> </tr> <tr> <td>memo</td> <td>string</td> <td>否</td> <td>备注信息</td> </tr> </tbody> </table> <h3 id="-">- 返回值说明</h3> <blockquote> <p>返回类型: json <br> 应用实例id <br></p> </blockquote> <h3 id="-">- 返回码</h3> <table> <thead> <tr> <th>返回码</th> <th>备注</th> </tr> </thead> <tbody> <tr> <td>130300</td> <td>数据库错误</td> </tr> <tr> <td>130600</td> <td>权限错误</td> </tr> </tbody> </table> <h3 id="-">- 请求示例</h3> <pre><code>{ "name": "博客应用", "owner": ["56dfea1bc8a96","56dfea253c80f"], "developer": ["56dfea1bc8a96","56dfea253c80f"], "tester": ["56dfea1bc8a96","56dfea253c80f"], "businesses": 56dfea1bc8aab, "memo": "WordPress博客", } </code></pre><h3 id="-">- 返回示例</h3> <pre><code>{ "message": "Success", "code": 0, "data": "5715e1aa4a014", "error": "\u6210\u529f" } </code></pre><h2 id="-a-id-a-"><a id="-修改应用"></a> 修改应用</h2> <h3 id="-">- 测试关键字</h3> <pre><code>update app </code></pre><h3 id="-url">- 接口访问URL</h3> <pre><code>PUT /app/@instanceId </code></pre><h3 id="-">- 参数</h3> <table> <thead> <tr> <th>名称</th> <th>类型</th> <th>必选</th> <th>备注</th> <th>默认值</th> </tr> </thead> <tbody> <tr> <td>instanceId</td> <td>string</td> <td>是</td> <td>应用id</td> </tr> <tr> <td>name</td> <td>string</td> <td>否</td> <td>应用名</td> </tr> <tr> <td>owner</td> <td>array</td> <td>否</td> <td>运维负责人实例id列表</td> </tr> <tr> <td>developer</td> <td>array</td> <td>否</td> <td>开发负责人实例id列表</td> </tr> <tr> <td>tester</td> <td>array</td> <td>否</td> <td>测试负责人实例id列表</td> </tr> <tr> <td>memo</td> <td>string</td> <td>否</td> <td>备注信息</td> </tr> </tbody> </table> <h3 id="-">- 返回值说明</h3> <blockquote> <p>返回类型: json <br> 应用实例ID <br></p> </blockquote> <h3 id="-">- 返回码</h3> <table> <thead> <tr> <th>返回码</th> <th>备注</th> </tr> </thead> <tbody> <tr> <td>130300</td> <td>数据库错误</td> </tr> <tr> <td>130600</td> <td>权限错误</td> </tr> </tbody> </table> <h3 id="-">- 请求示例</h3> <pre><code>{ "runUser": "root:users", "name": "\u535a\u5ba2\u5e94\u7528", "tester": [ "56dfea1bc8a96", "56dfea253c80f" ], "memo": [ "56dfea1bc8a96", "56dfea253c80f" ], "installPath": "/data/easyops/blog/", "owner": [ "56dfea1bc8a96", "56dfea253c80f" ], "developer": [ "56dfea1bc8a96", "56dfea253c80f" ] } </code></pre><h2 id="-a-id-a-"><a id="-删除应用"></a> 删除应用</h2> <h3 id="-">- 测试关键字</h3> <pre><code>delete app </code></pre><h3 id="-url">- 接口访问URL</h3> <pre><code>DELETE /app/@instanceId </code></pre><h3 id="-">- 参数</h3> <table> <thead> <tr> <th>名称</th> <th>类型</th> <th>必选</th> <th>备注</th> <th>默认值</th> </tr> </thead> <tbody> <tr> <td>instanceId</td> <td>string</td> <td>是</td> <td>应用id</td> </tr> </tbody> </table> <h3 id="-">- 返回值说明</h3> <blockquote> <p>返回类型: json <br> 应用实例ID <br></p> </blockquote> <h3 id="-">- 返回码</h3> <table> <thead> <tr> <th>返回码</th> <th>备注</th> </tr> </thead> <tbody> <tr> <td>130300</td> <td>数据库错误</td> </tr> <tr> <td>130600</td> <td>权限错误</td> </tr> </tbody> </table> <h3 id="-">- 返回示例</h3> <pre><code>{ "message": "Success", "code": 0, "data": "5715e1aa4a014", "error": "\u6210\u529f" } </code></pre><h2 id="-a-id-a-"><a id="-应用关联程序包"></a> 应用关联程序包</h2> <h3 id="-">- 测试关键字</h3> <pre><code>add package list to app </code></pre><h3 id="-url">- 接口访问URL</h3> <pre><code>POST /app/@appId/package </code></pre><h3 id="-">- 参数</h3> <table> <thead> <tr> <th>名称</th> <th>类型</th> <th>必选</th> <th>备注</th> <th>默认值</th> </tr> </thead> <tbody> <tr> <td>appId</td> <td>string</td> <td>是</td> <td>应用id</td> </tr> <tr> <td>package_list</td> <td>struct</td> <td>是</td> <td>包列表</td> </tr> </tbody> </table> <h3 id="-">- 返回值说明</h3> <blockquote> <p>返回类型: json <br> null <br></p> </blockquote> <h3 id="-">- 返回码</h3> <table> <thead> <tr> <th>返回码</th> <th>备注</th> </tr> </thead> <tbody> <tr> <td>130300</td> <td>数据库错误</td> </tr> <tr> <td>130600</td> <td>权限错误</td> </tr> </tbody> </table> <h3 id="-">- 请求示例</h3> <pre><code>[ { "isMaster": "true", "packageId": "3d81bc9e85ea9ffc5959303c0ed09780", "installPath": "/data/test" } ] </code></pre><h2 id="-a-id-a-"><a id="-应用解除关联包"></a> 应用解除关联包</h2> <h3 id="-">- 测试关键字</h3> <pre><code>delete package from app </code></pre><h3 id="-url">- 接口访问URL</h3> <pre><code>delete /app/@appId/package/@packageId </code></pre><h3 id="-">- 参数</h3> <table> <thead> <tr> <th>名称</th> <th>类型</th> <th>必选</th> <th>备注</th> <th>默认值</th> </tr> </thead> <tbody> <tr> <td>appId</td> <td>string</td> <td>是</td> <td>应用id</td> </tr> <tr> <td>packageId</td> <td>string</td> <td>是</td> <td>包id</td> </tr> <tr> <td>installPath</td> <td>string</td> <td>否</td> <td>安装包路径</td> </tr> </tbody> </table> <h3 id="-">- 返回值说明</h3> <blockquote> <p>返回类型: json <br> null <br></p> </blockquote> <h3 id="-">- 返回码</h3> <table> <thead> <tr> <th>返回码</th> <th>备注</th> </tr> </thead> <tbody> <tr> <td>130300</td> <td>数据库错误</td> </tr> <tr> <td>130600</td> <td>权限错误</td> </tr> </tbody> </table> <h2 id="-a-id-a-"><a id="-修改应用关联包"></a> 修改应用关联包</h2> <blockquote> <p>以packageId 和installPath 组合键标识唯一的程序包做修改 <br></p> </blockquote> <h3 id="-">- 测试关键字</h3> <pre><code>update package in app </code></pre><h3 id="-url">- 接口访问URL</h3> <pre><code>PUT /app/@appId/package </code></pre><h3 id="-">- 参数</h3> <table> <thead> <tr> <th>名称</th> <th>类型</th> <th>必选</th> <th>备注</th> <th>默认值</th> </tr> </thead> <tbody> <tr> <td>appId</td> <td>string</td> <td>是</td> <td>应用实例ID</td> </tr> <tr> <td>packageId</td> <td>string</td> <td>是</td> <td>包id</td> </tr> <tr> <td>installPath</td> <td>string</td> <td>是</td> <td>安装路径</td> </tr> <tr> <td>installPathNew</td> <td>string</td> <td>否</td> <td>修改后的安装路径,可选</td> </tr> <tr> <td>isMaster</td> <td>string</td> <td>否</td> <td>设置是否是主程序包,可选</td> </tr> </tbody> </table> <h3 id="-">- 返回值说明</h3> <blockquote> <p>返回类型: json <br> null <br></p> </blockquote> <h3 id="-">- 返回码</h3> <table> <thead> <tr> <th>返回码</th> <th>备注</th> </tr> </thead> <tbody> <tr> <td>130300</td> <td>数据库错误</td> </tr> <tr> <td>130600</td> <td>权限错误</td> </tr> </tbody> </table> <h3 id="-">- 请求示例</h3> <pre><code>{ "installPathNew": "data/test1", "isMaster": "true", "packageId": "3d81bc9e85ea9ffc5959303c0ed09780", "installPath": "/data/test" } </code></pre><h2 id="-a-id-a-"><a id="-程序包排序"></a> 程序包排序</h2> <blockquote> <p>对应用的程序包做排序功能,传入的参数为排序好的该应用的所有程序包 <br></p> </blockquote> <h3 id="-">- 测试关键字</h3> <pre><code>update package list in app for sort </code></pre><h3 id="-url">- 接口访问URL</h3> <pre><code>PUT /app/@appId/package_list/_sort </code></pre><h3 id="-">- 参数</h3> <table> <thead> <tr> <th>名称</th> <th>类型</th> <th>必选</th> <th>备注</th> <th>默认值</th> </tr> </thead> <tbody> <tr> <td>appId</td> <td>string</td> <td>是</td> <td>应用ID</td> </tr> <tr> <td>package_list</td> <td>struct</td> <td>是</td> <td>包列表</td> </tr> </tbody> </table> <h3 id="-">- 返回值说明</h3> <blockquote> <p>返回类型: json <br> null <br></p> </blockquote> <h3 id="-">- 返回码</h3> <table> <thead> <tr> <th>返回码</th> <th>备注</th> </tr> </thead> <tbody> <tr> <td>130300</td> <td>数据库错误</td> </tr> <tr> <td>130600</td> <td>权限错误</td> </tr> </tbody> </table> <h3 id="-">- 请求示例</h3> <pre><code>[ { "isMaster": "true", "packageId": "3d81bc9e85ea9ffc5959303c0ed09780", "installPath": "/data/test" } ] </code></pre><h2 id="-a-id-a-"><a id="-创建文档"></a> 创建文档</h2> <blockquote> <p>接口存在风险,会污染既定的文档数据; <br> 参数中的 data字段只是为了自动化测试方便所添加的, 实际使用场景可以忽略 <br></p> </blockquote> <h3 id="-">- 测试关键字</h3> <pre><code>create document in collection </code></pre><h3 id="-url">- 接口访问URL</h3> <pre><code>POST /system/storage/collection/@collectionName/document/@id </code></pre><h3 id="-">- 参数</h3> <table> <thead> <tr> <th>名称</th> <th>类型</th> <th>必选</th> <th>备注</th> <th>默认值</th> </tr> </thead> <tbody> <tr> <td>collectionName</td> <td>string</td> <td>是</td> <td>集合名称</td> </tr> <tr> <td>id</td> <td>string</td> <td>否</td> <td>文档_id</td> </tr> <tr> <td>doc_data</td> <td>string</td> <td>否</td> <td>文档数据内容</td> </tr> </tbody> </table> <h3 id="-">- 返回值说明</h3> <blockquote> <p>返回类型: json <br> 创建成功的文档数据 <br></p> </blockquote> <h3 id="-">- 返回码</h3> <table> <thead> <tr> <th>返回码</th> <th>备注</th> </tr> </thead> <tbody> <tr> <td>130300</td> <td>数据库错误</td> </tr> </tbody> </table> <h2 id="-a-id-a-"><a id="-修改文档"></a> 修改文档</h2> <blockquote> <p>接口存在风险,会污染既定的文档数据 <br> 参数中的 data字段只是为了自动化测试方便所添加的, 实际使用场景可以忽略 <br></p> </blockquote> <h3 id="-">- 测试关键字</h3> <pre><code>update document in collection </code></pre><h3 id="-url">- 接口访问URL</h3> <pre><code>PUT /system/storage/collection/@collectionName/document/@id </code></pre><h3 id="-">- 参数</h3> <table> <thead> <tr> <th>名称</th> <th>类型</th> <th>必选</th> <th>备注</th> <th>默认值</th> </tr> </thead> <tbody> <tr> <td>collectionName</td> <td>string</td> <td>是</td> <td>集合名称</td> </tr> <tr> <td>id</td> <td>string</td> <td>是</td> <td>文档_id</td> </tr> <tr> <td>doc_data</td> <td>string</td> <td>否</td> <td>文档数据内容</td> </tr> </tbody> </table> <h3 id="-">- 返回值说明</h3> <blockquote> <p>返回类型: json <br> 修改成功的文档数据 <br></p> </blockquote> <h3 id="-">- 返回码</h3> <table> <thead> <tr> <th>返回码</th> <th>备注</th> </tr> </thead> <tbody> <tr> <td>130300</td> <td>数据库错误</td> </tr> </tbody> </table> <h2 id="-a-id-a-"><a id="-查询文档"></a> 查询文档</h2> <blockquote> <p>接口存在风险,会污染既定的文档数据 <br></p> </blockquote> <h3 id="-">- 测试关键字</h3> <pre><code>get one document in collection </code></pre><h3 id="-url">- 接口访问URL</h3> <pre><code>GET /system/storage/collection/@collectionName/document/@id </code></pre><h3 id="-">- 参数</h3> <table> <thead> <tr> <th>名称</th> <th>类型</th> <th>必选</th> <th>备注</th> <th>默认值</th> </tr> </thead> <tbody> <tr> <td>collectionName</td> <td>string</td> <td>是</td> <td>集合名称</td> </tr> <tr> <td>id</td> <td>string</td> <td>是</td> <td>文档_id</td> </tr> </tbody> </table> <h3 id="-">- 返回值说明</h3> <blockquote> <p>返回类型: json <br> 文档数据 <br></p> </blockquote> <h3 id="-">- 返回码</h3> <table> <thead> <tr> <th>返回码</th> <th>备注</th> </tr> </thead> <tbody> <tr> <td>130300</td> <td>数据库错误</td> </tr> </tbody> </table> <h2 id="-a-id-a-"><a id="-查询所有文档"></a> 查询所有文档</h2> <blockquote> <p>接口存在风险,会污染既定的文档数据 <br></p> </blockquote> <h3 id="-">- 测试关键字</h3> <pre><code>get all document in collection </code></pre><h3 id="-url">- 接口访问URL</h3> <pre><code>GET /system/storage/collection/@collectionName/document/all </code></pre><h3 id="-">- 参数</h3> <table> <thead> <tr> <th>名称</th> <th>类型</th> <th>必选</th> <th>备注</th> <th>默认值</th> </tr> </thead> <tbody> <tr> <td>collectionName</td> <td>string</td> <td>是</td> <td>集合名称</td> </tr> <tr> <td>page</td> <td>int</td> <td>否</td> <td>页码</td> <td>1</td> </tr> <tr> <td>pageSize</td> <td>int</td> <td>否</td> <td>页大小</td> <td>30</td> </tr> </tbody> </table> <h3 id="-">- 返回值说明</h3> <blockquote> <p>返回类型: json <br> 所有文档数据 <br></p> </blockquote> <h3 id="-">- 返回码</h3> <table> <thead> <tr> <th>返回码</th> <th>备注</th> </tr> </thead> <tbody> <tr> <td>130300</td> <td>数据库错误</td> </tr> </tbody> </table> <h2 id="-a-id-a-"><a id="-删除文档"></a> 删除文档</h2> <blockquote> <p>接口存在风险,会污染既定的文档数据 <br></p> </blockquote> <h3 id="-">- 测试关键字</h3> <pre><code>delete document in collection </code></pre><h3 id="-url">- 接口访问URL</h3> <pre><code>DELETE /system/storage/collection/@collectionName/document/@id </code></pre><h3 id="-">- 参数</h3> <table> <thead> <tr> <th>名称</th> <th>类型</th> <th>必选</th> <th>备注</th> <th>默认值</th> </tr> </thead> <tbody> <tr> <td>collectionName</td> <td>string</td> <td>是</td> <td>集合名称</td> </tr> <tr> <td>id</td> <td>string</td> <td>是</td> <td>文档_id</td> </tr> </tbody> </table> <h3 id="-">- 返回值说明</h3> <blockquote> <p>返回类型: json <br> null <br></p> </blockquote> <h3 id="-">- 返回码</h3> <table> <thead> <tr> <th>返回码</th> <th>备注</th> </tr> </thead> <tbody> <tr> <td>130300</td> <td>数据库错误</td> </tr> </tbody> </table> <h2 id="-a-id-a-"><a id="-搜索文档"></a> 搜索文档</h2> <blockquote> <p>接口存在风险,会污染既定的文档数据 <br></p> </blockquote> <h3 id="-">- 测试关键字</h3> <pre><code>search document in collection </code></pre><h3 id="-url">- 接口访问URL</h3> <pre><code>GET /system/storage/collection/@collectionName/document/search </code></pre><h3 id="-">- 参数</h3> <table> <thead> <tr> <th>名称</th> <th>类型</th> <th>必选</th> <th>备注</th> <th>默认值</th> </tr> </thead> <tbody> <tr> <td>collectionName</td> <td>string</td> <td>是</td> <td>集合名称</td> </tr> <tr> <td>page</td> <td>int</td> <td>否</td> <td>页码</td> <td>1</td> </tr> <tr> <td>pageSize</td> <td>int</td> <td>否</td> <td>页大小</td> <td>30</td> </tr> </tbody> </table> <h3 id="-">- 返回值说明</h3> <blockquote> <p>返回类型: json <br> 文档数据列表 <br></p> </blockquote> <h3 id="-">- 返回码</h3> <table> <thead> <tr> <th>返回码</th> <th>备注</th> </tr> </thead> <tbody> <tr> <td>130300</td> <td>数据库错误</td> </tr> </tbody> </table> <h2 id="-a-id-instanceid-instanceid-a-instanceid-instanceid-"><a id="-通过用户-instanceid-或者用户组-instanceid发送邮件"></a> 通过用户 instanceId 或者用户组 instanceId发送邮件</h2> <h3 id="-">- 测试关键字</h3> <pre><code>send mail by instanceId </code></pre><h3 id="-url">- 接口访问URL</h3> <pre><code>POST /v2/message/email </code></pre><h3 id="-">- 参数</h3> <table> <thead> <tr> <th>名称</th> <th>类型</th> <th>必选</th> <th>备注</th> <th>默认值</th> </tr> </thead> <tbody> <tr> <td>send_to_user</td> <td>array</td> <td>否</td> <td>目标 user instanceId</td> </tr> <tr> <td>send_to_group</td> <td>array</td> <td>否</td> <td>目标用户群组 instanceId</td> </tr> <tr> <td>subject</td> <td>string</td> <td>是</td> <td>邮件标题</td> </tr> <tr> <td>message</td> <td>string</td> <td>是</td> <td>消息内容</td> </tr> <tr> <td>cc_to_user</td> <td>array</td> <td>否</td> <td>抄送 user instanceId</td> </tr> <tr> <td>cc_to_group</td> <td>array</td> <td>否</td> <td>抄送 group instanceId</td> </tr> <tr> <td>send_from_name</td> <td>string</td> <td>否</td> <td>发送方名称</td> </tr> <tr> <td>contentType</td> <td>string</td> <td>否</td> <td>发送内容类型, 请参考网址<a href="https://en.wikipedia.org/wiki/Media_type">https://en.wikipedia.org/wiki/Media_type</a>, 默认为text/plain</td> </tr> </tbody> </table> <h3 id="-">- 返回值说明</h3> <blockquote> <p>返回类型: json <br> 发送邮件结果 <br></p> </blockquote> <h3 id="-">- 返回码</h3> <table> <thead> <tr> <th>返回码</th> <th>备注</th> </tr> </thead> <tbody> <tr> <td>130300</td> <td>数据库错误</td> </tr> <tr> <td>130106</td> <td>邮件发送失败</td> </tr> <tr> <td>130107</td> <td>用户无邮箱信息</td> </tr> <tr> <td>133004</td> <td>邮箱无效</td> </tr> <tr> <td>133011</td> <td>用户不存在</td> </tr> </tbody> </table> <h3 id="-">- 请求示例</h3> <pre><code>{ "send_from_name": "easyops\u544a\u8b66\u901a\u9053", "message": "21:43\u53d1\u751f\u544a\u8b66, \u5e94\u7528\u5165\u6d41\u91cf\u544a\u8b66#\u544a\u8b66\u5bf9\u8c61: luna6 \uff0c\u544a\u8b66\u503c:357.0kbit \u9ad8\u4e8e\u9608\u503c: 80.0kbit, \u5f71\u54cd\u8303\u56f4: luna6", "send_to_group": [ "5a27d75b87abb" ], "send_to_user": [ "5a27608d65834" ], "subject": "\u3010\u544a\u8b66\u301121:43, \u5e94\u7528\u5165\u6d41\u91cf\u544a\u8b66" } </code></pre><h3 id="-">- 返回示例</h3> <pre><code>{ "code": 130106, "error": "失败", "message": "send email failed", "data": { [ { "instanceId": "5a27608d65834", "name": "lightjiao", "email": "lightjiao@easyops.cn", "send_result": 0 }, { "instanceId": "5a27608d65834", "name": "willniu", "email": "willniu@easyops.cn", "send_result": 130109 }, { "instanceId": "5a27608d65834", "name": "lightjiao", "email": "", "send_result": 130107 } ] } } </code></pre><h2 id="-a-id-a-"><a id="-查询单个资源模型"></a> 查询单个资源模型</h2> <h3 id="-">- 测试关键字</h3> <pre><code>get object </code></pre><h3 id="-url">- 接口访问URL</h3> <pre><code>GET /object/@object_id </code></pre><h3 id="-">- 参数</h3> <table> <thead> <tr> <th>名称</th> <th>类型</th> <th>必选</th> <th>备注</th> <th>默认值</th> </tr> </thead> <tbody> <tr> <td>object_id</td> <td>string</td> <td>是</td> <td>资源模型ID</td> </tr> </tbody> </table> <h3 id="-">- 返回值说明</h3> <blockquote> <p>返回类型: json <br> 资源模型数据 <br></p> </blockquote> <h3 id="-">- 返回码</h3> <table> <thead> <tr> <th>返回码</th> <th>备注</th> </tr> </thead> <tbody> <tr> <td>130300</td> <td>数据库错误</td> </tr> <tr> <td>133114</td> <td>数据库无结果</td> </tr> </tbody> </table> <h3 id="-">- 返回示例</h3> <pre><code>{ "code": 0, "error": "成功", "message": "Success", "data": { "_id": { "oid": "590bdb58e53ae0061a0ce812"
},
"objectId": "auto_test_object_id_will",
"name": "auto_test_object_name_2",
"category": "test",
"attrList": [...],
"memo": null,
"view": [],
"creator": "easyops",
"delete": "true",
"protected": false,
"ctime": "2017-05-05 09:54:32",
"org": 8888,
"_ts": 1493949277,
"_version": 5,
"_wrong_fks": [
{
"attr_id": "name",
"ref_object_id": "HOST",
"ref_object_exist": False
}
],
"relation_groups" : [
{
"id" : "group_1",
"name" : "关系分组1",
"relations" " [
{"id" : "relation_1", "name" : "关系名称1"},
{"id" : "relation_2", "name" : "关系名称2"}
]
}
]
}
}
</code></pre><h2 id="-a-id-a-"><a id="-分页查询资源模型"></a> 分页查询资源模型</h2>
<h3 id="-">- 测试关键字</h3>
<pre><code>get object page
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>GET /object
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>page</td>
<td>int</td>
<td>否</td>
<td>页码</td>
</tr>
<tr>
<td>pagrSize</td>
<td>int</td>
<td>否</td>
<td>页大小</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

资源模型列表
</p>
</blockquote>
<h2 id="-a-id-a-"><a id="-创建资源模型"></a> 创建资源模型</h2>
<h3 id="-">- 测试关键字</h3>
<pre><code>create object
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>POST /object
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>objectId</td>
<td>string</td>
<td>是</td>
<td>资源模型Id</td>
</tr>
<tr>
<td>name</td>
<td>string</td>
<td>否</td>
<td>资源模型名称</td>
</tr>
<tr>
<td>memo</td>
<td>string</td>
<td>否</td>
<td>资源模型备注</td>
</tr>
<tr>
<td>category</td>
<td>string</td>
<td>否</td>
<td>资源模型类别</td>
</tr>
<tr>
<td>view</td>
<td>string</td>
<td>否</td>
<td>资源模型的显示</td>
</tr>
<tr>
<td>auto_detect</td>
<td>string</td>
<td>否</td>
<td>定时任务Id</td>
</tr>
<tr>
<td>icon</td>
<td>string</td>
<td>否</td>
<td>资源模型图标</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

创建成功的资源模型数据
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
<tr>
<td>130600</td>
<td>权限错误</td>
</tr>
<tr>
<td>130313</td>
<td>数据重复</td>
</tr>
</tbody>
</table>
<h2 id="-a-id-a-"><a id="-修改资源模型"></a> 修改资源模型</h2>
<h3 id="-">- 测试关键字</h3>
<pre><code>modify object
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>PUT /object/@object_id
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>object_id</td>
<td>string</td>
<td>是</td>
<td>资源模型ID</td>
</tr>
<tr>
<td>name</td>
<td>string</td>
<td>否</td>
<td>资源模型名称</td>
</tr>
<tr>
<td>memo</td>
<td>string</td>
<td>否</td>
<td>资源模型备注</td>
</tr>
<tr>
<td>category</td>
<td>string</td>
<td>否</td>
<td>资源模型类别</td>
</tr>
<tr>
<td>view</td>
<td>string</td>
<td>否</td>
<td>资源模型的显示</td>
</tr>
<tr>
<td>auto_detect</td>
<td>string</td>
<td>否</td>
<td>定时任务Id</td>
</tr>
<tr>
<td>icon</td>
<td>string</td>
<td>否</td>
<td>资源模型图标</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

null
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
<tr>
<td>130600</td>
<td>权限错误</td>
</tr>
<tr>
<td>130313</td>
<td>数据重复</td>
</tr>
</tbody>
</table>
<h2 id="-a-id-a-"><a id="-删除资源模型"></a> 删除资源模型</h2>
<h3 id="-">- 测试关键字</h3>
<pre><code>delete object
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>DELETE /object/@object_id
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>object_id</td>
<td>string</td>
<td>是</td>
<td>资源模型ID</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

null
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
<tr>
<td>130600</td>
<td>权限错误</td>
</tr>
</tbody>
</table>
<h2 id="-a-id-a-"><a id="-引用对象反向查询接口"></a> 引用对象反向查询接口</h2>
<h3 id="-">- 测试关键字</h3>
<pre><code>search object ref
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>GET /object/_ref
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>ref_object</td>
<td>string</td>
<td>是</td>
<td>引用对象id</td>
</tr>
<tr>
<td>ref_instance</td>
<td>string</td>
<td>否</td>
<td>引用实例id</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

引用了指定实例或对象的所有对象数据
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
</tbody>
</table>
<h2 id="-a-id-a-"><a id="-添加资源模型属性"></a> 添加资源模型属性</h2>
<h3 id="-">- 测试关键字</h3>
<pre><code>add attribute to object
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>POST /object/@object_id/attr
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>object_id</td>
<td>string</td>
<td>是</td>
<td>资源模型ID</td>
</tr>
<tr>
<td>id</td>
<td>string</td>
<td>是</td>
<td>属性ID</td>
</tr>
<tr>
<td>name</td>
<td>string</td>
<td>是</td>
<td>属性名称</td>
</tr>
<tr>
<td>value</td>
<td>array</td>
<td>是</td>
<td>值类型声明</td>
</tr>
<tr>
<td>view</td>
<td>array</td>
<td>否</td>
<td>外键的值在实例详情页面显示的字段</td>
</tr>
<tr>
<td>unique</td>
<td>bool</td>
<td>否</td>
<td>是否唯一</td>
</tr>
<tr>
<td>required</td>
<td>bool</td>
<td>否</td>
<td>是否必填</td>
</tr>
<tr>
<td>readonly</td>
<td>bool</td>
<td>否</td>
<td>是否只读</td>
</tr>
<tr>
<td>tag</td>
<td>array</td>
<td>否</td>
<td>标签</td>
</tr>
<tr>
<td>tips</td>
<td>string</td>
<td>否</td>
<td>在实例输入框中的提示消息</td>
</tr>
<tr>
<td>description</td>
<td>string</td>
<td>否</td>
<td>外键关系属性描述</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

null
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
</tbody>
</table>
<h3 id="-">- 请求示例</h3>
<pre><code>POST /object/APP/attr
{
"id" : "my_first_id",
"name" : "我新建的一个ID",
"value" : {
"type" : "str",
"regex" : "",
"default" : "default value",
"default_type" : "function"
},
"unique" : "true",
"required" : "true",
"readonly" : "true",
"tag" : ["核心属性", "用户自定义属性"],
"description" : "这是一个属性描述"
}
</code></pre><h2 id="-a-id-a-"><a id="-查询资源模型属性列表"></a> 查询资源模型属性列表</h2>
<h3 id="-">- 测试关键字</h3>
<pre><code>get attribute list in object
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>GET /object/@object_id/attr
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>object_id</td>
<td>string</td>
<td>是</td>
<td>资源模型ID</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

资源模型属性列表
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
</tbody>
</table>
<h2 id="-a-id-a-"><a id="-获取资源模型属性"></a> 获取资源模型属性</h2>
<h3 id="-">- 测试关键字</h3>
<pre><code>get attribute in object
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>GET /object/@object_id/attr/@attr_id
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>object_id</td>
<td>string</td>
<td>是</td>
<td>资源模型ID</td>
</tr>
<tr>
<td>attr_id</td>
<td>string</td>
<td>是</td>
<td>属性ID</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

资源模型属性
</p>
</blockquote>
<h2 id="-a-id-a-"><a id="-删除资源模型属性"></a> 删除资源模型属性</h2>
<h3 id="-">- 测试关键字</h3>
<pre><code>delete attribute in object
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>DELETE /object/@object_id/attr/@attr_id
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>object_id</td>
<td>string</td>
<td>是</td>
<td>资源模型ID</td>
</tr>
<tr>
<td>attr_id</td>
<td>string</td>
<td>是</td>
<td>属性ID</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

null
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
<tr>
<td>130602</td>
<td>核心属性不允许删除</td>
</tr>
<tr>
<td>133212</td>
<td>属性不存在</td>
</tr>
</tbody>
</table>
<h2 id="-a-id-a-"><a id="-修改资源模型属性"></a> 修改资源模型属性</h2>
<h3 id="-">- 测试关键字</h3>
<pre><code>modify attribute in object
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>PUT /object/@object_id/attr/@attr_id
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>object_id</td>
<td>string</td>
<td>是</td>
<td>资源模型ID</td>
</tr>
<tr>
<td>attr_id</td>
<td>string</td>
<td>是</td>
<td>属性ID</td>
</tr>
<tr>
<td>name</td>
<td>string</td>
<td>否</td>
<td>属性名称</td>
</tr>
<tr>
<td>value</td>
<td>array</td>
<td>否</td>
<td>值类型声明</td>
</tr>
<tr>
<td>view</td>
<td>array</td>
<td>否</td>
<td>外键的值在实例详情页面显示的字段</td>
</tr>
<tr>
<td>unique</td>
<td>bool</td>
<td>否</td>
<td>是否唯一</td>
</tr>
<tr>
<td>required</td>
<td>bool</td>
<td>否</td>
<td>是否必填</td>
</tr>
<tr>
<td>readonly</td>
<td>bool</td>
<td>否</td>
<td>是否只读</td>
</tr>
<tr>
<td>tag</td>
<td>array</td>
<td>否</td>
<td>标签</td>
</tr>
<tr>
<td>tips</td>
<td>string</td>
<td>否</td>
<td>在实例输入框中的提示消息</td>
</tr>
<tr>
<td>description</td>
<td>string</td>
<td>否</td>
<td>外键关系属性描述</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

null
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
<tr>
<td>130310</td>
<td>创建唯一索引失败</td>
</tr>
<tr>
<td>133212</td>
<td>属性不存在</td>
</tr>
</tbody>
</table>
<h3 id="-">- 请求示例</h3>
<pre><code>PUT /object/APP/attr/my_first_id
{
"name" : "我新建的一个ID",
"value" : {
"type" : "str",
"regex" : "",
"default" : "guid()",
"default_type" : "function"
},
"unique" : "true",
"required" : "true",
"readonly" : "true",
"tag" : ["核心属性", "用户自定义属性"],
"description" : "这是一个属性描述"
}
</code></pre><h2 id="-a-id-a-"><a id="-查询剩余可自定义对象数量"></a> 查询剩余可自定义对象数量</h2>
<h3 id="-">- 测试关键字</h3>
<pre><code>get custom object limit remain
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>GET /object/_limit
</code></pre><h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

自定义对象数量限制信息
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回示例</h3>
<pre><code>{
"message": "Success",
"code": 0,
"data": {
"remain": null,
"total": 33,
"limit": null
},
"error": "\u6210\u529f"
}
</code></pre><h2 id="-a-id-a-"><a id="-查询图标和模型对应关系"></a> 查询图标和模型对应关系</h2>
<h3 id="-url">- 接口访问URL</h3>
<pre><code>GET /all_object_icon
</code></pre><h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

图标和id的对应关系数据
</p>
</blockquote>
<h3 id="-">- 返回示例</h3>
<pre><code>{
"message": "Success",
"code": 0,
"data": {
"APP": "icon-1",
"HOST": ""
},
"error": "\u6210\u529f"
}
</code></pre><h2 id="-a-id-a-"><a id="-新建实例手动审计日志记录"></a> 新建实例手动审计日志记录</h2>
<h3 id="-">- 测试关键字</h3>
<pre><code>insert instance manual audit log
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>POST /object/@object_id/instance/_manual_audit
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>object_id</td>
<td>string</td>
<td>是</td>
<td>资源模型ID</td>
</tr>
<tr>
<td>mark_memo</td>
<td>string</td>
<td>是</td>
<td>标记备注</td>
</tr>
<tr>
<td>instance_id_url</td>
<td>array</td>
<td>是</td>
<td>实例id对应URL列表</td>
</tr>
<tr>
<td>email_user_id</td>
<td>array</td>
<td>否</td>
<td>通知用户Id列表</td>
</tr>
<tr>
<td>email_group_id</td>
<td>array</td>
<td>否</td>
<td>通知用户组Id列表</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

json
</p>
</blockquote>
<h3 id="-">- 请求示例</h3>
<pre><code>POST /object/APP/instance/_manual_audit
{
"mark_memo": "应用备注不明确",
"instance_id_url": {
"536363526": "http://192.168.0.67/object/APP/instance/536372727",
"536363524": "http://192.168.0.67/object/APP/instance/536372724"
},
"email_user_id": [
"3652263767",
"36363553635"
],
"email_group_id": [
"736363663",
"365363663"
]
}
</code></pre><h3 id="-">- 返回示例</h3>
<pre><code>{
"message": "Success",
"code": 0,
"data": null,
"error": "\u6210\u529f"
}
</code></pre><h2 id="-a-id-a-"><a id="-新建实例自动巡检审计日志记录"></a> 新建实例自动巡检审计日志记录</h2>
<h3 id="-">- 测试关键字</h3>
<pre><code>insert instance auto audit log
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>POST /audit/object/instance/_auto_audit
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>instance_invalid_fields</td>
<td>array</td>
<td>是</td>
<td>自动巡检实例错误信息</td>
</tr>
<tr>
<td>email_user_id</td>
<td>array</td>
<td>否</td>
<td>通知用户Id列表</td>
</tr>
<tr>
<td>email_group_id</td>
<td>array</td>
<td>否</td>
<td>通知用户组Id列表</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

json
</p>
</blockquote>
<h3 id="-">- 请求示例</h3>
<pre><code>POST /audit/object/instance/_auto_audit
{
"instance_invalid_fields": {
"APP": {
"536363526": {
"url": "http://192.168.0.67/object/APP/instance/536372727",
"invalid_fields": {
"name": "name null",
"memo": "memo null"
}
},
"536363524": {
"url": "http://192.168.0.67/object/APP/instance/536372727",
"invalid_fields": {
"name": "name null",
"memo": "memo null"
}
}
},
"HOST": {
"333333": {
"url": "http://192.168.0.67/object/APP/instance/536372727",
"invalid_fields": {
"name": "name null",
"memo": "memo null"
}
}
}
},
"email_user_id": [
"3652263767",
"36363553635"
],
"email_group_id": [
"736363663",
"365363663"
]
}
</code></pre><h3 id="-">- 返回示例</h3>
<pre><code>{
"message": "Success",
"code": 0,
"data": null,
"error": "\u6210\u529f"
}
</code></pre><h2 id="-a-id-id-a-id-"><a id="-用户组id列表查询"></a> 用户组ID列表查询</h2>
<h3 id="-url">- 接口访问URL</h3>
<pre><code>GET /groups/id
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>user_id</td>
<td>string</td>
<td>否</td>
<td>用户id, 传此参数返回用户所在的所有用户组, 默认返回所有用户组</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

用户组id列表
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
</tbody>
</table>
<h3 id="-">- 请求示例</h3>
<pre><code>GET http://cmdb.easyops-only.com/groups/id?user_id=lightjiao
</code></pre><h3 id="-">- 返回示例</h3>
<pre><code>{
"message": "Success",
"code": 0,
"data": [
":59228ffb4ccdb",
":5943345194b49"
],
"error": "\u6210\u529f"
}
</code></pre><h2 id="-a-id-id-a-id-"><a id="-用户组id名称映射列表查询"></a> 用户组ID名称映射列表查询</h2>
<h3 id="-url">- 接口访问URL</h3>
<pre><code>GET /groups/id_map_name
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>user_id</td>
<td>string</td>
<td>否</td>
<td>用户id, 传此参数返回用户所在的所有用户组, 默认返回所有用户组</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

用户组id名称映射列表
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
</tbody>
</table>
<h3 id="-">- 请求示例</h3>
<pre><code>GET http://cmdb.easyops-only.com/groups/id_map_name?user_id=lightjiao
</code></pre><h3 id="-">- 返回示例</h3>
<pre><code>{
"code": 0,
"error": "成功",
"message": "Success",
"data": [
":59228ffb4ccdb": "运维组",
":5943345194b49": "CMDB"
]
}
</code></pre><h2 id="-a-id-a-"><a id="-全文搜索接口"></a> 全文搜索接口</h2>
<blockquote>
<p>指定单个资源模型做全文搜索
</p>
</blockquote>
<h3 id="-">- 测试关键字</h3>
<pre><code>fulltext search of objectId
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>GET /fulltext/@objectId/_search
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>objectId</td>
<td>string</td>
<td>是</td>
<td>对象ID</td>
</tr>
<tr>
<td>keyword</td>
<td>string</td>
<td>是</td>
<td>搜索关键字</td>
</tr>
<tr>
<td>page</td>
<td>string</td>
<td>否</td>
<td>页码</td>
</tr>
<tr>
<td>pageSize</td>
<td>string</td>
<td>否</td>
<td>页大小</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

搜索结果及统计结果
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
</tbody>
</table>
<h3 id="-">- 请求示例</h3>
<pre><code>GET /fulltext/APP/_search?count=true
</code></pre><h3 id="-">- 返回示例</h3>
<pre><code>{
"code": 0,
"error": "成功",
"message": "Success",
"data": {
"total": 1,
"page": 1,
"pageSize": 30,
"list": [#实例列表#],
"count": {
"APP": 1
}
}
}
</code></pre><h2 id="-a-id-a-"><a id="-全文搜索接口"></a> 全文搜索接口</h2>
<blockquote>
<p>真·全文搜索
</p>
</blockquote>
<h3 id="-">- 测试关键字</h3>
<pre><code>fulltext search
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>GET /fulltext/_search
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>keyword</td>
<td>string</td>
<td>是</td>
<td>搜索关键字</td>
</tr>
<tr>
<td>page</td>
<td>string</td>
<td>否</td>
<td>页码</td>
</tr>
<tr>
<td>pageSize</td>
<td>string</td>
<td>否</td>
<td>页大小</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

搜索结果及统计结果
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
</tbody>
</table>
<h3 id="-">- 请求示例</h3>
<pre><code>GET /fulltext/_search?count=true
</code></pre><h3 id="-">- 返回示例</h3>
<pre><code>{
"code": 0,
"error": "成功",
"message": "Success",
"data": {
"total": 4,
"page": 1,
"pageSize": 30,
"list": [#实例列表#],
"count": {
"BUSINESS": 3,
"APP": 1
}
}
}
</code></pre><h2 id="-a-id-a-"><a id="-单个实例查询接口"></a> 单个实例查询接口</h2>
<h3 id="-">- 测试关键字</h3>
<pre><code>get instance
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>GET /object/@object_id/instance/@instance_id
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>object_id</td>
<td>string</td>
<td>是</td>
<td>资源模型ID</td>
</tr>
<tr>
<td>instance_id</td>
<td>string</td>
<td>是</td>
<td>实例ID</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

单个实例数据
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130600</td>
<td>权限错误</td>
</tr>
<tr>
<td>133116</td>
<td>数据不存在</td>
</tr>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回示例</h3>
<pre><code>{
"message": "Success",
"code": 0,
"data": {
"ctime": "2016-12-26 15:35:15",
"creator": "steve15",
"instanceId": "5860c8333c0f0",
"_ts": 1482737715,
"_version": 1,
"businesses": {
"instanceId": "56e92c9c30164",
"parentId": null,
"name": "TEST",
"businessId": "87dae4d207972ad0d586e1f2e01d63c6",
"level": null
},
"org": 8888,
"name": "indexTest"
},
"error": "\u6210\u529f"
}
</code></pre><h2 id="-a-id-a-"><a id="-分页查询实例"></a> 分页查询实例</h2>
<h3 id="-">- 测试关键字</h3>
<pre><code>get instance page
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>GET /object/@object_id/instance
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>object_id</td>
<td>string</td>
<td>是</td>
<td>资源模型ID</td>
</tr>
<tr>
<td>page</td>
<td>int</td>
<td>否</td>
<td>页码</td>
<td>1</td>
</tr>
<tr>
<td>page_size</td>
<td>int</td>
<td>否</td>
<td>页大小</td>
<td>30</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

分页实例数据
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130600</td>
<td>权限错误</td>
</tr>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回示例</h3>
<pre><code>{
"message": "Success",
"code": 0,
"data": {
"total": 10,
"list": [
{
"ctime": "2016-12-26 15:35:15",
"creator": "steve15",
"instanceId": "5860c8333c0f0",
"_ts": 1482737715,
"_version": 1,
"businesses": {
"instanceId": "56e92c9c30164",
"parentId": null,
"name": "TEST",
"businessId": "87dae4d207972ad0d586e1f2e01d63c6",
"level": null
},
"org": 8888,
"name": "indexTest"
},
{},
{}
],
"page": 1,
"page_size": 30
},
"error": "\u6210\u529f"
}
</code></pre><h2 id="-a-id-a-"><a id="-分页查询归档实例"></a> 分页查询归档实例</h2>
<h3 id="-">- 测试关键字</h3>
<pre><code>get archive instance page
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>GET /object/@object_id/instance/_archive
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>object_id</td>
<td>string</td>
<td>是</td>
<td>资源模型ID</td>
</tr>
<tr>
<td>page</td>
<td>int</td>
<td>否</td>
<td>页码, 默认1</td>
</tr>
<tr>
<td>page_size</td>
<td>int</td>
<td>否</td>
<td>页大小, 默认30</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

分页归档实例数据
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130600</td>
<td>权限错误</td>
</tr>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回示例</h3>
<pre><code>{
"message": "Success",
"code": 0,
"data": {
"total": 10,
"list": [
{
"ctime": "2016-12-26 15:35:15",
"creator": "steve15",
"instanceId": "5860c8333c0f0",
"_ts": 1482737715,
"_version": 1,
"businesses": {
"instanceId": "56e92c9c30164",
"parentId": null,
"name": "TEST",
"businessId": "87dae4d207972ad0d586e1f2e01d63c6",
"level": null
},
"org": 8888,
"name": "indexTest"
},
{},
{}
],
"page": 1,
"page_size": 30
},
"error": "\u6210\u529f"
}
</code></pre><h2 id="-a-id-a-"><a id="-归档实例"></a> 归档实例</h2>
<h3 id="-">- 测试关键字</h3>
<pre><code>archive instance
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>POST /object/@object_id/instance/@instance_id/_archive
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>object_id</td>
<td>string</td>
<td>是</td>
<td>资源模型ID</td>
</tr>
<tr>
<td>instance_id</td>
<td>string</td>
<td>是</td>
<td>实例ID</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

null
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
<tr>
<td>130116</td>
<td>实例不存在</td>
</tr>
<tr>
<td>133119</td>
<td>实例归档失败</td>
</tr>
<tr>
<td>130600</td>
<td>权限错误</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回示例</h3>
<pre><code>{
"message": "xxx",
"code": 0,
"data": null,
"error": "xxx"
}
</code></pre><h2 id="-a-id-a-"><a id="-激活实例"></a> 激活实例</h2>
<h3 id="-">- 测试关键字</h3>
<pre><code>active instance
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>POST /object/@object_id/instance/@instance_id/_active
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>object_id</td>
<td>string</td>
<td>是</td>
<td>资源模型ID</td>
</tr>
<tr>
<td>instance_id</td>
<td>string</td>
<td>是</td>
<td>实例ID</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

null
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
<tr>
<td>130116</td>
<td>实例不存在</td>
</tr>
<tr>
<td>133120</td>
<td>实例激活失败</td>
</tr>
<tr>
<td>130600</td>
<td>权限错误</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回示例</h3>
<pre><code>{
"message": "xxx",
"code": 0,
"data": null,
"error": "xxx"
}
</code></pre><h2 id="-a-id-a-"><a id="-实例搜索接口"></a> 实例搜索接口</h2>
<blockquote>
<p>实例数据高级查询接口, query字段的内容对应的是MongoDB的find语法
</p>
</blockquote>
<h3 id="-">- 测试关键字</h3>
<pre><code>search instances
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>POST /object/@object_id/instance/_search
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>object_id</td>
<td>string</td>
<td>是</td>
<td>资源模型ID</td>
</tr>
<tr>
<td>query</td>
<td>array</td>
<td>否</td>
<td>查询条件</td>
</tr>
<tr>
<td>page</td>
<td>int</td>
<td>否</td>
<td>页码, 默认1</td>
<td>1</td>
</tr>
<tr>
<td>page_size</td>
<td>int</td>
<td>否</td>
<td>页大小, 默认30</td>
<td>30</td>
</tr>
<tr>
<td>fields</td>
<td>array</td>
<td>否</td>
<td>过滤字段, 留空代表返回所有字段</td>
</tr>
<tr>
<td>sort</td>
<td>array</td>
<td>否</td>
<td>按字段排序, 留空代表不排序</td>
</tr>
<tr>
<td>permission</td>
<td>array</td>
<td>否</td>
<td>按照权限过滤</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

被搜索实例数据
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
<tr>
<td>130600</td>
<td>权限错误</td>
</tr>
</tbody>
</table>
<h3 id="-">- 请求示例</h3>
<pre><code>{
"sort": {
"instanceId": 1
},
"permission": [
"operate",
"update"
],
"fields": {
"instanceId": true,
"ip": true,
"_id": false,
"name": true
},
"page_size": 100,
"query": {
"ip": {
"in": [ "127.0.0.1", "192.168.100.1" ] }, "name": { "regex": "light"
}
},
"page": 1
}
</code></pre><h3 id="-">- 返回示例</h3>
<pre><code>{
"message": "Success",
"code": 0,
"data": {
"total": 1,
"list": [
{
"instanceId": "56e7cca0b1b80",
"ip": "192.168.100.162"
}
],
"page": 1,
"page_size": 30
},
"error": "\u6210\u529f"
}
</code></pre><h2 id="-a-id-a-"><a id="-引用实例反向查询接口"></a> 引用实例反向查询接口</h2>
<h3 id="-">- 测试关键字</h3>
<pre><code>search instance ref
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>GET /object/@object_id/instance/_ref
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>object_id</td>
<td>string</td>
<td>是</td>
<td>资源模型ID</td>
</tr>
<tr>
<td>ref_object</td>
<td>string</td>
<td>是</td>
<td>引用对象id</td>
</tr>
<tr>
<td>ref_instance</td>
<td>string</td>
<td>是</td>
<td>引用实例id</td>
</tr>
<tr>
<td>page</td>
<td>int</td>
<td>否</td>
<td>页码, 默认1</td>
<td>1</td>
</tr>
<tr>
<td>page_size</td>
<td>int</td>
<td>否</td>
<td>页大小, 默认30</td>
<td>30</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

引用了指定实例的所有实例数据
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
<tr>
<td>130600</td>
<td>权限错误</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回示例</h3>
<pre><code>{
"message": "Success",
"code": 0,
"data": {
"total": 10,
"list": [
{
"ctime": "2016-12-26 15:35:15",
"creator": "steve15",
"instanceId": "5860c8333c0f0",
"_ts": 1482737715,
"_version": 1,
"businesses": {
"instanceId": "56e92c9c30164",
"parentId": null,
"name": "TEST",
"businessId": "87dae4d207972ad0d586e1f2e01d63c6",
"level": null
},
"org": 8888,
"name": "indexTest"
},
{},
{}
],
"page": 1,
"page_size": 30
},
"error": "\u6210\u529f"
}
</code></pre><h2 id="-a-id-a-"><a id="-查询单个实例约束接口"></a> 查询单个实例约束接口</h2>
<h3 id="-">- 测试关键字</h3>
<pre><code>get instance constraints
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>GET /object/@object_id/instance/@instance_id/_constraints
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>object_id</td>
<td>string</td>
<td>是</td>
<td>资源模型ID</td>
</tr>
<tr>
<td>instance_id</td>
<td>string</td>
<td>是</td>
<td>实例ID</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

约束的对象数组
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
<tr>
<td>130600</td>
<td>权限错误</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回示例</h3>
<pre><code>{
"message": "Success",
"code": 0,
"data": [
{
"object_name": "\u96c6\u7fa4\u7ba1\u7406",
"total": 4,
"object_id": "CLUSTER"
}
],
"error": "\u6210\u529f"
}
</code></pre><h2 id="-a-id-a-"><a id="-业务创建接口"></a> 业务创建接口</h2>
<blockquote>
<p>业务创建使用的是通用实例创建接口但是参数比较特殊,所以单独一个doc声明
</p>
</blockquote>
<h3 id="-">- 测试关键字</h3>
<pre><code>create business
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>POST /object/BUSINESS/instance
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>name</td>
<td>string</td>
<td>是</td>
<td>业务名称</td>
</tr>
<tr>
<td>owner</td>
<td>array</td>
<td>是</td>
<td>负责人(Fks)</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

新创建的业务数据
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
<tr>
<td>130600</td>
<td>权限错误</td>
</tr>
<tr>
<td>130313</td>
<td>数据重复</td>
</tr>
</tbody>
</table>
<h2 id="-a-id-a-"><a id="-主机创建接口"></a> 主机创建接口</h2>
<blockquote>
<p>主机创建使用的是通用实例创建接口但是参数比较特殊,所以单独一个doc声明
</p>
</blockquote>
<h3 id="-">- 测试关键字</h3>
<pre><code>create host
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>POST /object/HOST/instance
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>hostname</td>
<td>string</td>
<td>是</td>
<td>主机名称</td>
</tr>
<tr>
<td>ip</td>
<td>string</td>
<td>是</td>
<td>主机IP (要符合IP正则)</td>
</tr>
<tr>
<td>status</td>
<td>string</td>
<td>是</td>
<td>运营状态 (枚举: 运营中; 故障中; 未上线; 下线隔离中; 开发机; 测试机; 维修中; 报废)</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

新创建的主机数据
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
<tr>
<td>130600</td>
<td>权限错误</td>
</tr>
<tr>
<td>130313</td>
<td>数据重复</td>
</tr>
</tbody>
</table>
<h2 id="-a-id-a-"><a id="-单个实例创建接口"></a> 单个实例创建接口</h2>
<blockquote>
<p>参数对应具体的资源模型
</p>
</blockquote>
<h3 id="-">- 测试关键字</h3>
<pre><code>create instance
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>POST /object/@object_id/instance
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>object_id</td>
<td>string</td>
<td>是</td>
<td>资源模型ID</td>
</tr>
<tr>
<td>name</td>
<td>string</td>
<td>是</td>
<td>实例名称</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

新创建的实例数据
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
<tr>
<td>130600</td>
<td>权限错误</td>
</tr>
<tr>
<td>130313</td>
<td>数据重复</td>
</tr>
</tbody>
</table>
<h3 id="-">- 请求示例</h3>
<pre><code>{
"_manager": [],
"name": "indexTest",
"_manager_group": [],
"enum": null,
"businesses": {
"instanceId": "56e92c9c30164"
},
"time": null,
"owner": [
{
"instanceId": "57b434115412e"
},
{
"instanceId": "56dfea1bc8a96"
}
],
"_visitor_group": [],
"_visitor": []
}
</code></pre><h3 id="-">- 返回示例</h3>
<pre><code>{
"message": "Success",
"code": 0,
"data": {
"_manager": [],
"ctime": "2016-12-26 15:35:15",
"_manager_group": [],
"creator": "steve15",
"instanceId": "5860c8333c0f0",
"_ts": 1482737715,
"_version": 1,
"businesses": {
"instanceId": "56e92c9c30164",
"parentId": null,
"name": "TEST",
"businessId": "87dae4d207972ad0d586e1f2e01d63c6",
"level": null
},
"_visitor_group": [],
"owner": [
{
"instanceId": "57b434115412e",
"user_tel": "18503050129",
"name": "indexzhuo",
"user_email": "indexzhuo@easyops.cn"
},
{
"instanceId": "56dfea1bc8a96",
"user_tel": null,
"name": "linuschen",
"user_email": "easyops@easyops.cn"
}
],
"org": 8888,
"_visitor": [],
"name": "indexTest"
},
"error": "\u6210\u529f"
}
</code></pre><h2 id="-a-id-a-"><a id="-单个实例修改接口"></a> 单个实例修改接口</h2>
<blockquote>
<p>参数对应具体的资源模型
</p>
</blockquote>
<h3 id="-">- 测试关键字</h3>
<pre><code>modify instance
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>PUT /object/@object_id/instance/@instance_id
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>object_id</td>
<td>string</td>
<td>是</td>
<td>资源模型ID</td>
</tr>
<tr>
<td>instance_id</td>
<td>string</td>
<td>是</td>
<td>实例ID</td>
</tr>
<tr>
<td>name</td>
<td>string</td>
<td>否</td>
<td>实例名称</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

修改后的实例数据
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
<tr>
<td>130600</td>
<td>权限错误</td>
</tr>
<tr>
<td>130313</td>
<td>数据重复</td>
</tr>
</tbody>
</table>
<h3 id="-">- 请求示例</h3>
<pre><code>{
"_visitor_group": [],
"_visitor": [],
"businesses": {
"instanceId": "56e92c9c30164"
},
"_manager": [],
"_manager_group": []
}
</code></pre><h3 id="-">- 返回示例</h3>
<pre><code>{
"message": "Success",
"code": 0,
"data": {
"_manager": [],
"ctime": "2016-12-26 15:35:15",
"_manager_group": [],
"creator": "steve15",
"instanceId": "5860c8333c0f0",
"_ts": 1482737715,
"_version": 1,
"businesses": {
"instanceId": "56e92c9c30164",
"parentId": null,
"name": "TEST",
"businessId": "87dae4d207972ad0d586e1f2e01d63c6",
"level": null
},
"_visitor_group": [],
"org": 8888,
"_visitor": [],
"name": "indexTest"
},
"error": "\u6210\u529f"
}
</code></pre><h2 id="-a-id-a-"><a id="-单个实例删除接口"></a> 单个实例删除接口</h2>
<h3 id="-">- 测试关键字</h3>
<pre><code>delete instance
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>DELETE /object/@object_id/instance/@instance_id
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>object_id</td>
<td>string</td>
<td>是</td>
<td>资源模型ID</td>
</tr>
<tr>
<td>instance_id</td>
<td>string</td>
<td>是</td>
<td>实例ID</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

null; 如果由于实例约束原因导致删除失败, 返回约束该实例的对象id
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
<tr>
<td>130600</td>
<td>权限错误</td>
</tr>
<tr>
<td>133117</td>
<td>外键关联错误</td>
</tr>
</tbody>
</table>
<h2 id="-a-id-a-"><a id="-获取实例变更日志"></a> 获取实例变更日志</h2>
<h3 id="-">- 测试关键字</h3>
<pre><code>get instance log
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>GET /object/@object_id/instance/@instance_id/_logs
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>object_id</td>
<td>string</td>
<td>是</td>
<td>资源模型ID</td>
</tr>
<tr>
<td>instance_id</td>
<td>string</td>
<td>是</td>
<td>实例ID</td>
</tr>
<tr>
<td>page</td>
<td>int</td>
<td>否</td>
<td>页码, 默认1</td>
<td>1</td>
</tr>
<tr>
<td>page_size</td>
<td>int</td>
<td>否</td>
<td>页大小, 默认30</td>
<td>30</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

实例变更历史
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
</tbody>
</table>
<h3 id="-">- 请求示例</h3>
<pre><code>GET /object/APP/instance/588071b97e9da/_logs
{
"page": 1,
"page_size": 1000,
"month": "201705"
}
</code></pre><h3 id="-">- 返回示例</h3>
<pre><code>{
"code": 0,
"error": "成功",
"message": "Success",
"data": [
{
"instanceId": "588071b97e9da",
"_object_id": "lightTest",
"difference": [
{ "attr": "name", "op": "update", "from": "rose_1", "to": "rose_2" },
{ "attr": "modifier", "op": "add", "to": "lights" }
],
"databaseOperations": "update"
"user": "lights"
},
{
"instanceId": "588071b97e9da",
"_object_id": "lightTest",
"user": "lights",
"databaseOperations": "insert"
}
]
}
</code></pre><h2 id="-a-id-a-"><a id="-数据导入接口"></a> 数据导入接口</h2>
<h3 id="-">- 测试关键字</h3>
<pre><code>import instances
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>POST /object/@object_id/instance/_import
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>object_id</td>
<td>string</td>
<td>是</td>
<td>资源模型ID</td>
</tr>
<tr>
<td>keys</td>
<td>array</td>
<td>是</td>
<td>导入的key</td>
</tr>
<tr>
<td>datas</td>
<td>array</td>
<td>是</td>
<td>实例数组</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

数据导入结果
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>133121</td>
<td>实例导入失败</td>
</tr>
</tbody>
</table>
<h3 id="-">- 请求示例</h3>
<pre><code>{
"keys" : ['name'],
"datas" : [
{"name" : "jack", "socre" : 100, "randString" : "adhasjkdfghasjkdfhas"},
{"name" : "rose", "socre" : 90, "randString" : "adhasjkdfghasjkdfhas"}
]
}
</code></pre><h3 id="-">- 返回示例</h3>
<pre><code>{
"code" : 133121,
"error" : "实例导入失败",
"message" : null,
"data" : [
"failed_count" : 4,
"insert_count" : 0,
"update_count" : 10,
"data" : [
{
"code" : 130313,
"error" : "重复键错误",
"data" : [
{"name" : "jack", "socre" : 100, "randString" : "adhasjkdfghasjkdfhas"}
]
},
{
"code" : 130300,
"error" : "默认数据库错误",
"data" : [
{"name" : "rose", "socre" : 90, "randString" : "adhasjkdfghasjkdfhas"}
]
}
]
]
}
</code></pre><h2 id="-a-id-a-"><a id="-批量编辑接口"></a> 批量编辑接口</h2>
<h3 id="-">- 测试关键字</h3>
<pre><code>modify instances
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>PUT /object/@object_id/instance/_batch_modify
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>object_id</td>
<td>string</td>
<td>是</td>
<td>资源模型ID</td>
</tr>
<tr>
<td>instances</td>
<td>struct</td>
<td>是</td>
<td>实例列表</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

null
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
<tr>
<td>130600</td>
<td>权限错误</td>
</tr>
</tbody>
</table>
<h3 id="-">- 请求示例</h3>
<pre><code>[
{"instanceId" : "balabalabalaba1", "modify_field" : "new value"},
{"instanceId" : "balabalabalaba2", "modify_field" : "new value"},
]
</code></pre><h2 id="-a-id-a-"><a id="-获取实例默认值"></a> 获取实例默认值</h2>
<blockquote>
<p>根据模型定义获取实例默认值提供给前端填充表单用
</p>
</blockquote>
<h3 id="-">- 测试关键字</h3>
<pre><code>get instance default value template
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>GET /object/@object_id/instance/_default_value_template
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>object_id</td>
<td>string</td>
<td>是</td>
<td>资源模型ID</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

null
</p>
</blockquote>
<h3 id="-">- 返回示例</h3>
<pre><code>{
"message": "Success",
"code": 0,
"data": {
"default_os": "linux",
"uuid": "cc49c1e317ee95362a5c6fd31bbcc2e1"
},
"error": "\u6210\u529f"
}
</code></pre><h2 id="-a-id-a-"><a id="-处理实例修改后动作"></a> 处理实例修改后动作</h2>
<blockquote>
<p>实例修改后, 刷新相关联的冗余数据等操作
</p>
</blockquote>
<h3 id="-">- 测试关键字</h3>
<pre><code>process instance modify
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>POST /notification/instance_modify_log
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>data</td>
<td>array</td>
<td>否</td>
<td>实例数据</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

null
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
</tbody>
</table>
<h2 id="-a-id-a-"><a id="-实时同步全文搜索数据"></a> 实时同步全文搜索数据</h2>
<h3 id="-">- 测试关键字</h3>
<pre><code>process instance fulltext index
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>POST /notification/instance_fulltext_index
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>data</td>
<td>array</td>
<td>否</td>
<td>实例数据</td>
</tr>
<tr>
<td>topic</td>
<td>string</td>
<td>是</td>
<td>数据变更行为</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

null
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
</tbody>
</table>
<h2 id="-a-id-a-"><a id="-刷新冗余数据"></a> 刷新冗余数据</h2>
<h3 id="-">- 测试关键字</h3>
<pre><code>process instance refresh task
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>POST /notification/instance_refresh_task
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>data</td>
<td>array</td>
<td>否</td>
<td>实例数据</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

null
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
</tbody>
</table>
<h2 id="-a-id-a-"><a id="-查询业务列表"></a> 查询业务列表</h2>
<blockquote>
<p>@deprecated, 接口较老,已弃用

高级查询请使用接口POST /object/@object_id/instance/_search
</p>
</blockquote>
<h3 id="-url">- 接口访问URL</h3>
<pre><code>GET /business/search
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>name</td>
<td>string</td>
<td>否</td>
<td>业务名称</td>
</tr>
<tr>
<td>businessId</td>
<td>string</td>
<td>否</td>
<td>业务ID</td>
</tr>
<tr>
<td>parentId</td>
<td>string</td>
<td>否</td>
<td>父ID</td>
</tr>
<tr>
<td>order</td>
<td>string</td>
<td>否</td>
<td>排序字段</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

array 业务列表
</p>
</blockquote>
<h2 id="-a-id-a-"><a id="-查询业务关联链路"></a> 查询业务关联链路</h2>
<blockquote>
<p>deprecated parentID不存在
</p>
</blockquote>
<h3 id="-">- 测试关键字</h3>
<pre><code>get business link
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>GET /business/search-link
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>parentId</td>
<td>string</td>
<td>是</td>
<td>业务id</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

关联链路列表
</p>
</blockquote>
<h2 id="-a-id-id-a-id-"><a id="-根据一级业务id遍历查询子业务下的所有应用"></a> 根据一级业务id遍历查询子业务下的所有应用</h2>
<blockquote>
<p>我现在根据一级业务id获取所有子业务的应用列表,得遍历整棵"一级业务树",效率可能不高...

由于我们现在限制了层数,我可以最多只遍历三层,但是一旦把业务层级限制放开,就复杂些了,现在就做得通用些?
</p>
</blockquote>
<h3 id="-">- 测试关键字</h3>
<pre><code>get app by businessid
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>GET /business/appList/@businessId
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>businessId</td>
<td>string</td>
<td>是</td>
<td>业务ID</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

应用列表
</p>
</blockquote>
<h2 id="-a-id-a-"><a id="-查询某个业务的信息"></a> 查询某个业务的信息</h2>
<blockquote>
<p>deprecated parentID不存在
</p>
</blockquote>
<h3 id="-">- 测试关键字</h3>
<pre><code>get business info
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>GET /business/@businessId
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>businessId</td>
<td>string</td>
<td>是</td>
<td>业务ID</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

业务信息
</p>
</blockquote>
<h2 id="-a-id-a-"><a id="-查询子业务信息"></a> 查询子业务信息</h2>
<h3 id="-">- 测试关键字</h3>
<pre><code>get businesses children
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>GET /business/children/@businessId
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>businessId</td>
<td>string</td>
<td>是</td>
<td>业务ID</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

业务信息
</p>
</blockquote>
<h2 id="-a-id-a-"><a id="-查询业务信息"></a> 查询业务信息</h2>
<blockquote>
<p>根据key value 查询业务信息
</p>
</blockquote>
<h3 id="-">- 测试关键字</h3>
<pre><code>get business by key value
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>GET /v2/business/@key/@val
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>key</td>
<td>string</td>
<td>是</td>
<td>键</td>
</tr>
<tr>
<td>val</td>
<td>string</td>
<td>是</td>
<td>值</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

应用信息
</p>
</blockquote>
<h2 id="-a-id-namespace-a-namespace"><a id="-获取用户配置信息namespace"></a> 获取用户配置信息namespace</h2>
<h3 id="-url">- 接口访问URL</h3>
<pre><code>GET /user/profile/@namespace
</code></pre><h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

返回用户配置信息namespace
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
<tr>
<td>130308</td>
<td>查询无结果</td>
</tr>
</tbody>
</table>
<h2 id="-a-id-a-"><a id="-获取用户配置信息值"></a> 获取用户配置信息值</h2>
<h3 id="-url">- 接口访问URL</h3>
<pre><code>GET /user/profile/@namespace/@key
</code></pre><h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

返回用户配置信息值
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
<tr>
<td>130308</td>
<td>查询无结果</td>
</tr>
</tbody>
</table>
<h2 id="-a-id-a-"><a id="-修改用户配置信息值"></a> 修改用户配置信息值</h2>
<h3 id="-url">- 接口访问URL</h3>
<pre><code>PUT /user/profile/@namespace/@key
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>namespace</td>
<td>string</td>
<td>是</td>
<td>用户配置命名空间</td>
</tr>
<tr>
<td>key</td>
<td>string</td>
<td>是</td>
<td>用户配置项</td>
</tr>
<tr>
<td>value</td>
<td>mix</td>
<td>是</td>
<td>用户配置数据</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
<tr>
<td>130305</td>
<td>数据库更新错误</td>
</tr>
</tbody>
</table>
<h2 id="-a-id-a-"><a id="-获取资源模型下某一属性的值"></a> 获取资源模型下某一属性的值</h2>
<h3 id="-">- 测试关键字</h3>
<pre><code>get attribute value in object
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>GET /object/instance/attr/@objectId/@attrId
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>objectId</td>
<td>string</td>
<td>是</td>
<td>资源模型ID</td>
</tr>
<tr>
<td>attrId</td>
<td>string</td>
<td>是</td>
<td>属性ID</td>
</tr>
<tr>
<td>sort</td>
<td>int</td>
<td>否</td>
<td>排序</td>
</tr>
<tr>
<td>page</td>
<td>int</td>
<td>否</td>
<td>页码</td>
<td>1</td>
</tr>
<tr>
<td>pagrSize</td>
<td>int</td>
<td>否</td>
<td>页大小</td>
<td>30</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

某一属性的所有值
</p>
</blockquote>
<h3 id="-">- 返回示例</h3>
<pre><code>{
"message": "Success",
"code": 0,
"data": {
"total": 70,
"list": [
"\u751f\u4ea7\u96c6\u7fa41",
"\u6d4b\u8bd5\u96c6\u7fa41",
"\u9884\u53d1\u5e03\u96c6\u7fa4",
"\u9ec4\u4ec1\u7684\u96c6\u7fa4",
"\u7070\u5ea6\u96c6\u7fa4"
],
"page": 1,
"pageSize": 30
},
"error": "\u6210\u529f"
}
</code></pre><h2 id="-a-id-a-"><a id="-更新冗余数据"></a> 更新冗余数据</h2>
<blockquote>
<p>@deprecated 实例数据中不包含objectId、instanceId或者org被视为非法数据直接消费
</p>
</blockquote>
<h3 id="-url">- 接口访问URL</h3>
<pre><code>POST /object/instance/message
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>data</td>
<td>array</td>
<td>否</td>
<td>实例数据,</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

null
</p>
</blockquote>
<h2 id="-a-id-a-"><a id="-多实例查询"></a> 多实例查询</h2>
<blockquote>
<p>url中包含查询对象的ID,body中包含需要查询的实例ID
</p>
</blockquote>
<h3 id="-">- 测试关键字</h3>
<pre><code>get instance list by instanceids for export
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>POST /object/@objectId/instances/_export
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>objectId</td>
<td>string</td>
<td>是</td>
<td>查询的对象ID</td>
</tr>
<tr>
<td>instanceIds</td>
<td>array</td>
<td>否</td>
<td>实例Id列表</td>
</tr>
<tr>
<td>page</td>
<td>int</td>
<td>否</td>
<td>页码</td>
<td>1</td>
</tr>
<tr>
<td>pagrSize</td>
<td>int</td>
<td>否</td>
<td>页大小</td>
<td>30</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

实例列表
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
</tbody>
</table>
<h3 id="-">- 请求示例</h3>
<pre><code>{
"instanceIds":['123', '456']
}
</code></pre><h3 id="-">- 返回示例</h3>
<pre><code>{
"code": 0,
"error": "成功",
"message": "Success",
"list": [
{'instanceField_1': 'value_1', instanceField_2: 'value_2'},
{'instanceField_1': 'value_3', instanceField_2: 'value_4'}
]
}
</code></pre><h2 id="-a-id-a-"><a id="-个人信息查询"></a> 个人信息查询</h2>
<h3 id="-">- 测试关键字</h3>
<pre><code>get my profile
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>GET /profile
</code></pre><h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

个人信息
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回示例</h3>
<pre><code>{
"message": "Success",
"code": 0,
"data": {
"modifier": "admin",
"user_tel": null,
"name": "lights",
"creator": "admin",
"instanceId": "5875f71840da5",
"org": 8888,
"user_type": null,
"phone": null,
"state": "valid",
"user_memo": null,
"mtime": "2016-03-28 12:42:02",
"user_active": "\u6fc0\u6d3b",
"_id": {},
"email": "lightjiao@easyops.cn",
"user_email": "lightjiao@easyops.cn",
"ctime": "2016-03-09 17:17:15"
},
"error": "\u6210\u529f"
}
</code></pre><h2 id="-a-id-apikey-a-apikey"><a id="-查询个人apikey"></a> 查询个人apikey</h2>
<h3 id="-">- 测试关键字</h3>
<pre><code>get my apikey
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>GET /profile/apikey
</code></pre><h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

apikey
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回示例</h3>
<pre><code>{
"message": "Success",
"code": 0,
"data": {
"access_key": "e7b6a060b55b42713332b93c",
"ctime": "2017-03-29 10:11:38",
"ts": 1490753498,
"state": "valid",
"user": "lightjiao11",
"org": 8888,
"secret_key": "f1ede17ef5078a9ef62fa0a113b43a710820257700ff67ae9b6a29eed891ec5a"
},
"error": "\u6210\u529f"
}
</code></pre><h2 id="-a-id-a-"><a id="-修改个人密码"></a> 修改个人密码</h2>
<h3 id="-">- 测试关键字</h3>
<pre><code>modify my password
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>PUT /profile/password
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>password</td>
<td>string</td>
<td>是</td>
<td>旧密码</td>
</tr>
<tr>
<td>new_password</td>
<td>string</td>
<td>是</td>
<td>新密码</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

null
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
</tbody>
</table>
<h3 id="-">- 请求示例</h3>
<pre><code>{
"new_password": "654321",
"password": "123456"
}
</code></pre><h3 id="-">- 返回示例</h3>
<pre><code>{
"message": "Success",
"code": 0,
"data": null,
"error": "\u6210\u529f"
}
</code></pre><h2 id="-a-id-a-"><a id="-用户忘记密码"></a> 用户忘记密码</h2>
<blockquote>
<p>用户忘记密码接口
</p>
</blockquote>
<h3 id="-">- 测试关键字</h3>
<pre><code>forgot password
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>POST /password/forgot
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>email</td>
<td>string</td>
<td>是</td>
<td>邮件地址</td>
</tr>
<tr>
<td>url</td>
<td>string</td>
<td>是</td>
<td>重置密码地址</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

重置密码信息
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
</tbody>
</table>
<h2 id="-a-id-a-"><a id="-用户重置密码"></a> 用户重置密码</h2>
<blockquote>
<p>暂时不做自动化测试,因为自动化测试无法获取到重置密码的验证码
</p>
</blockquote>
<h3 id="-url">- 接口访问URL</h3>
<pre><code>POST /password/reset
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>username</td>
<td>string</td>
<td>是</td>
<td>用户名</td>
</tr>
<tr>
<td>ts</td>
<td>int</td>
<td>是</td>
<td>时间戳</td>
</tr>
<tr>
<td>password</td>
<td>string</td>
<td>是</td>
<td>新密码</td>
</tr>
<tr>
<td>key</td>
<td>string</td>
<td>是</td>
<td>重置密码key</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

重置密码key
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
</tbody>
</table>
<h2 id="-a-id-a-"><a id="-查询应用"></a> 查询应用</h2>
<blockquote>
<p>@deprecated, 接口较老,已弃用

高级查询请使用接口POST /object/@object_id/instance/_search
</p>
</blockquote>
<h3 id="-">- 测试关键字</h3>
<pre><code>search app
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>GET /application/search
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>name</td>
<td>string</td>
<td>否</td>
<td>应用名称</td>
</tr>
<tr>
<td>appId</td>
<td>string</td>
<td>否</td>
<td>应用ID</td>
</tr>
<tr>
<td>businessId</td>
<td>string</td>
<td>否</td>
<td>业务ID</td>
</tr>
<tr>
<td>order</td>
<td>string</td>
<td>否</td>
<td>排序字段</td>
</tr>
<tr>
<td>fields</td>
<td>string</td>
<td>否</td>
<td>选择字段</td>
</tr>
<tr>
<td>ignore</td>
<td>string</td>
<td>否</td>
<td>忽略字段</td>
</tr>
<tr>
<td>page</td>
<td>int</td>
<td>否</td>
<td>分页</td>
</tr>
<tr>
<td>pageSize</td>
<td>int</td>
<td>否</td>
<td>分页大小</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

应用列表
</p>
</blockquote>
<h2 id="-a-id-a-"><a id="-查询应用列表"></a> 查询应用列表</h2>
<blockquote>
<p>@deprecated, 接口较老,已弃用

高级查询请使用接口POST /object/@object_id/instance/_search
</p>
</blockquote>
<h3 id="-">- 测试关键字</h3>
<pre><code>search app list
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>GET /application/search-all
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>name</td>
<td>string</td>
<td>否</td>
<td>应用名称</td>
</tr>
<tr>
<td>appId</td>
<td>string</td>
<td>否</td>
<td>应用ID</td>
</tr>
<tr>
<td>appIds</td>
<td>string</td>
<td>否</td>
<td>应用ID, 用分号隔开</td>
</tr>
<tr>
<td>businessId</td>
<td>string</td>
<td>否</td>
<td>业务ID</td>
</tr>
<tr>
<td>order</td>
<td>string</td>
<td>否</td>
<td>排序字段</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

应用列表
</p>
</blockquote>
<h2 id="-a-id-a-"><a id="-获取应用下的设备以及集群信息数量"></a> 获取应用下的设备以及集群信息数量</h2>
<blockquote>
<p>自动化测试的keyword不使用自动生成而是自定义编写
</p>
</blockquote>
<h3 id="-url">- 接口访问URL</h3>
<pre><code>GET /applications/extra
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>appIds</td>
<td>array</td>
<td>是</td>
<td>应用id列表</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

获取的信息列表array
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
</tbody>
</table>
<h3 id="-">- 请求示例</h3>
<pre><code>GET /applications/extra?appIds[0]=56dff11497f66&appIds[1]=56e0dbec4da6f
</code></pre><h3 id="-">- 返回示例</h3>
<pre><code>{
"message": "Success",
"code": 0,
"data": {
"56e0dbec4da6f": {
"device": 0,
"cluster": 0
},
"56dff11497f66": {
"device": 38,
"cluster": 0
}
},
"error": "\u6210\u529f"
}
</code></pre><h2 id="-a-id-a-"><a id="-批量查询应用信息"></a> 批量查询应用信息</h2>
<blockquote>
<p>根据指定字段以及字段值查询应用

@deprecated, 接口较老,不建议使用

高级查询请使用接口POST /object/@object_id/instance/_search
</p>
</blockquote>
<h3 id="-">- 测试关键字</h3>
<pre><code>get app by key value
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>GET /v2/app/@key/@val
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>key</td>
<td>string</td>
<td>是</td>
<td>键</td>
</tr>
<tr>
<td>val</td>
<td>string</td>
<td>是</td>
<td>值</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

应用信息
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
</tbody>
</table>
<h2 id="-a-id-a-"><a id="-批量获取应用列表"></a> 批量获取应用列表</h2>
<blockquote>
<p>@deprecated, 接口较老,不建议使用

高级查询请使用接口POST /object/@object_id/instance/_search
</p>
</blockquote>
<h3 id="-">- 测试关键字</h3>
<pre><code>get app list by instanceids
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>GET /apps/@instanceIds
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>instanceIds</td>
<td>string</td>
<td>否</td>
<td>应用id列表,逗号分割,id为空时,获取所有应用列表</td>
</tr>
<tr>
<td>page</td>
<td>int</td>
<td>否</td>
<td>当前页码</td>
<td>1</td>
</tr>
<tr>
<td>pageSize</td>
<td>int</td>
<td>否</td>
<td>每页大小</td>
<td>30</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

应用列表
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回示例</h3>
<pre><code>{
"message": null,
"code": 0,
"data": {
"total": 78,
"list": [
{
"runUser": null,
"name": "\u5e94\u7528\u529f\u80fd",
"businessId": null,
"installPath": null,
"instanceId": "56e7cd0fe76cf",
"mtime": "2016-04-18 21:43:38",
"memo": null,
"tester": null,
"org": 8888,
"ctime": "2016-03-15 16:51:27",
"businesses": null,
"packageId": null,
"appId": "f12e441dbba9d7acd36212ab4906eaca",
"owner": [
{
"instanceId": "56dfea1c74405",
"name": "davidcui"
}
],
"clusters": [
{
"name": "\u9ed8\u8ba4\u96c6\u7fa4",
"deviceList": [
{
"status": "\u8fd0\u8425\u4e2d",
"instanceId": "56e674a85fe98",
"ip": "192.168.26.22",
"hostname": "192.168.26.22",
"deviceId": "122",
"provider": "1",
"location": "1"
}
],
"clusterId": "e876a01a75196e35a1f8416f405d9719",
"instanceId": "56e7cd1047479",
"packageId": null,
"type": 2
}
],
"modifier": "indexzhuo",
"creator": "davidcui",
"developer": null
}
]
},
"error": "\u6210\u529f"
}
</code></pre><h2 id="-a-id-a-"><a id="-搜索应用列表"></a> 搜索应用列表</h2>
<blockquote>
<p>@deprecated, 接口较老,不建议使用

高级查询请使用接口POST /object/@object_id/instance/_search
</p>
</blockquote>
<h3 id="-">- 测试关键字</h3>
<pre><code>search apps by key value
</code></pre><h3 id="-url">- 接口访问URL</h3>
<pre><code>GET /apps/@key/@val
</code></pre><h3 id="-">- 参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>备注</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>key</td>
<td>string</td>
<td>是</td>
<td>搜索的应用属性</td>
</tr>
<tr>
<td>val</td>
<td>string</td>
<td>是</td>
<td>搜索的应用属性值</td>
</tr>
<tr>
<td>page</td>
<td>int</td>
<td>否</td>
<td>当前页码</td>
</tr>
<tr>
<td>pageSize</td>
<td>int</td>
<td>否</td>
<td>每页大小</td>
</tr>
</tbody>
</table>
<h3 id="-">- 返回值说明</h3>
<blockquote>
<p>返回类型: json

应用列表
</p>
</blockquote>
<h3 id="-">- 返回码</h3>
<table>
<thead>
<tr>
<th>返回码</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>130300</td>
<td>数据库错误</td>
</tr>
</tbody>
</table>
</article>
</body>
<script src="http://localhost:35729/livereload.js?snipver=1"></script>
<script>hljs.initHighlightingOnLoad();</script>

推荐阅读更多精彩内容

  • # 一度蜜v3.0协议 --- # 交互协议 [TOC] ## 协议说明 ### 请求参数 下表列出了v3.0版协...
    c5e350bc5b40阅读 178评论 0 0
  • JAVA面试题 1、作用域public,private,protected,以及不写时的区别答:区别如下:作用域 ...
    JA尐白阅读 417评论 1 0
  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 105,322评论 12 126
  • 我已感受到了风 我握紧了手掌 风里有花香 风里有鸟鸣 风里有歌声 我张开了手掌 风是自由的精灵 风从我指间穿过 金...
    yhbred95阅读 1,291评论 0 0
  • 原本无比坚信,我靠它,竞不能养活自己,又何况家人。更远的,怎么以此为事业。想到这无限迷茫。
    常小识阅读 111评论 1 0