1、鉴权模块

1.1 Login,获取token

POST  http://192.168.31.149:8080/auth/login

Headers

Content-Type: application/json

Body:

{

"username": "admin",

"password": "shipyard"

}

response

{

"auth_token": "$2a$10$kwlWJbgjkEWnN.JhHJINZOp6grcuio1.USA.io28tTLkKzuCnLl.m",

"user_agent": "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Firefox/38.0"

}

2、容器管理

2.1 获取容器列表

GET  http://192.168.31.149:8080/api/containers

Headers

User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Firefox/38.0

X-Access-Token: admin:$ $2a$10$kwlWJbgjkEWnN.JhHJINZOp6grcuio1.USA.io28tTLkKzuCnLl.m

response

[

{

"id": "5c12b9ad2961cba3a57947ef5a927dd01545bfe8a73785f7c3b13cb7d0704e38",

"name": "/shipyard",

"image": {

"name": "shipyard/shipyard:latest",

"entrypoint": [

"/controller"

],

"hostname": "5c12b9ad2961",

"bind_ports": [

{

"proto": "tcp",

"host_ip": "0.0.0.0",

"port": 8080,

"container_port": 8080

}

],

"restart_policy": {},

"network_mode": "bridge"

},

"engine": {

"id": "compute2",

"addr": "http://192.168.31.149:4243",

"cpus": 4,

"memory": 4096,

"labels": [

"dd"

]

},

"state": "running",

"ports": [

{

"proto": "tcp",

"host_ip": "0.0.0.0",

"port": 8080,

"container_port": 8080

}

]

},

{

"id": "4a5f16641c2a5ecca0b05b399bfdaf3c62abf3681289189ee5336feeeb96b4a9",

"name": "/gloomy_darwin",

"image": {

"name": "mysql_test:latest",

"environment": {

"CLOUD_URL": "http://192.168.31.147:8080/starott_cloud_client/cloud/commomconfig/"

},

"hostname": "mysqls",

"restart_policy": {},

"network_mode": "bridge"

},

"engine": {

"id": "compute2",

"addr": "http://192.168.31.149:4243",

"cpus": 4,

"memory": 4096,

"labels": [

"dd"

]

},

"state": "stopped"

},

 

2.2 创建容器

POST  /api/containers

Headers

User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Firefox/38.0

X-Access-Token: admin:$2a$10$P8jnLva2KnYP0xWOLCmYruD0B11z0JIpH3cOnDHplxFdbBIZv.iOW

Request body

{

"name": "ehazlett/go-demo",

"container_name": "demo",

"cpus": 0.1,

"memory": 32,

"type": "service",

"hostname": "",

"domain": "",

"labels": ["local"],

"args": [],

"environment": {

"FOO": "bar"

},

"restart_policy": {

"name": "always"

},

"bind_ports": [

{

"host_ip": "10.1.2.3",

"proto": "tcp",

"container_port": 8080

},

{

"proto": "tcp",

"port": 80,

"container_port": 8080

}

],

"links": {

"redis": "db"

}

}

Reponse

       [
  {
    "state": {
      "started_at": "2014-09-12T00:48:23.824260519Z",
      "pid": 5890,
      "running": true
    }, 
    "ports": [
      {
        "container_port": 8080,
        "host_ip": "10.1.2.3",
        "port": 49172,
        "proto": "tcp"
      }
    ],
    "engine": {
      "labels": [
        "local",
        "dev"
      ],
      "memory": 4096,
      "cpus": 4,
      "addr": "http://172.16.1.50:2375",
      "id": "local"
    },
    "image": {
      "restart_policy": {
        "name": "always"  
      },
      "labels": [
        "local"
      ],
      "bind_ports": [
        {
          "proto": "tcp",
          "port": 49153,
          "container_port": 8080
        },
        {
          "proto": "tcp",
          "port": 80,
          "container_port": 8080
        }
      ],
      "links": {
        "redis": "db"
      },
      "type": "service",
      "memory": 32,
      "cpus": 0.1,
      "name": "ehazlett/go-demo"
    },
    "id": "4a5da04b8428e7241a9d9993699513d11b89948399dedfa12"
  }
]

 

2.3 重启容器

GET /api/containers/<id>/restart
Restart a container
Request
GET /api/containers/3e532/restart HTTP/1.1
Response
HTTP/1.1 204 No Content

2.4 停止容器

GET /api/containers/<id>/stop
Stop a container
Request
GET /api/containers/3e532/stop HTTP/1.1
Response
HTTP/1.1 204 No Content

2.5 销毁容器

DELETE /api/containers/<id>
Destroy a container
Request
DELETE /api/containers/3e532 HTTP/1.1
Response
HTTP/1.1 204 No Content

 

3、计算节点管理

3.1 获取计算节点列表

GET  http://192.168.31.149:8080/api/engines

Headers

User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Firefox/38.0

X-Access-Token: admin:$2a$10$P8jnLva2KnYP0xWOLCmYruD0B11z0JIpH3cOnDHplxFdbBIZv.iOW

response

[

{

"id": "c589bf34-513e-4a15-8164-146511c5e177",

"engine": {

"id": "compute2",

"addr": "http://192.168.31.149:4243",

"cpus": 4,

"memory": 4096,

"labels": [

"dd"

]

},

"health": {

"status": "up",

"response_time": 1375306

},

"docker_version": "1.5.0-dev"

}

]

3.2 添加计算节点

POST /api/engines

Add an engine to the cluster

Request

POST /api/engines HTTP/1.1
Content-Type application/json
 
{
  "id": "local",
  "ssl_cert": "",
  "ssl_key": "",
  "ca_cert": "",
  "engine": {
    "id": "local",
    "addr": "http://10.1.2.3:2375",
    "cpus": 4.0,
    "memory": 8192,
    "labels": [
      "local",
      "dev"
    ]
  }
}
Response
HTTP/1.1 201 Created

3.3 删除计算节点

DELETE /api/engines/<id>

Remove an engine from the cluster

Request

DELETE /api/engines/99095f5f-7579-4a70-9369-04ad73c21312 HTTP/1.1

Response

HTTP/1.1 204 No Content

Shipyard远程API的更多相关文章

  1. Confluence 6 匿名访问远程 API

    Confluence 管理员可能希望为匿名用户禁用远程访问 API.这样能够避免恶意软件随意在网站进行批量修改. 希望禁用远程访问 API: 在屏幕的右上角单击 控制台按钮 ,然后选择 General ...

  2. Confluence 6 启用远程 API

    XML-RPC 和 SOAP 远程 API 从 Confluence 5.5 开始已经废弃了.我们推荐你使用完全支持的Confluence Server REST API. 希望启用 XML-RPC ...

  3. 在Mac OSX系统的Docker机上启用Docker远程API功能

    在Mac OSX系统的Docker机上启用Docker远程API功能 作者:chszs,未经博主同意不得转载.经许可的转载需注明作者和博客主页:http://blog.csdn.net/chszs D ...

  4. 不依赖远程API启动SEER区块链命令行钱包和网页钱包的方法

    不依赖远程API启动命令行钱包和网页钱包的方法 在SEER的见证人操作等需要使用命令行钱包的操作中,我们介绍了通过钱包连接远程API来和区块链交互的方法.类似这样: cli_wallet.exe -s ...

  5. 大叔也说Xamarin~Android篇~调用远程API接口,发POST请求

    回到目录 Xamarin我们在上节已经教大家如何去部署它的环境了,今天来说一个实际的例子,使用android客户调用.net web api的一个接口,并发送POST请求,当服务端回到请求后做出响应, ...

  6. JENKINS的远程API调用,然后用PYTHON解析出最新的版本及稳定成功的版本

    这个功能,我觉得在作自动作部署时,是可以派上用处的. 记录一下. import urllib f = urllib.urlopen('http://jenkinsurl/job/job_name/ap ...

  7. 本地调试远程api tag

    当你在本地开发js且需要跨域调用远程接口的时候.可按照下列步骤设置你的chrome.   1.创建chrome快捷方式.     2.右键属性新的快捷方式,在目标一栏后面追加 "--args ...

  8. hbase远程api调用, 远程连接开发,环境构建相关问题总结

    平时在开发的过程中,都是将hbase的环境装在虚拟机或者双系统上的,开发是直接在unix或者linux上进行的,这样对于使用上,有些繁琐. 下面我将介绍我在使用windows远程开发过程中的一些总结: ...

  9. 通过Hutool 调用远程API接口(POST/GET)

    背景:需要调用第三方接口,开启某项任务,用Hutool代替了HttpClient 调用第三方接口,简单粗暴. 代码如下: import java.util.Date; import org.apach ...

随机推荐

  1. VMware (威睿) 虚拟化产品简介

    VMware vSphere 是VMware(威睿)的一个虚拟化产品,VMware vSphere 是业界领先且最可靠的虚拟化平台.vSphere将应用程序和操作系统从底层硬件分离出来,从而简化了 I ...

  2. 用仿ActionScript的语法来编写html5——第九篇,仿URLLoader读取文件

    第九篇,仿URLLoader读取文件 先看看最后的代码 function readFile(){ urlloader = new LURLLoader(); urlloader.addEventLis ...

  3. category分类

    /* 使用继承关系来扩充一个类,有一个弊病,高耦合性 category(分类,类别) 能够帮我们扩充一个类的功能 */ - (void)superJump { //    [self eat]; [s ...

  4. 一个小玩意 PHP实现微信红包金额拆分试玩

    <meta charset="utf-8"> <?php // 新年红包金额拆分试玩 class CBonus { public $bonus;//红包 publ ...

  5. C++Primer 第四章

    //1.当我们对运算符进行重载的时候,其包括运算对象的类型和返回值的类型都是由该运算符定义的,但是运算对象的个数和优先级,结合律都是不能改变的 //2.当一个对象被用作右值的时候,用的是对象的值(内容 ...

  6. Swift游戏实战-跑酷熊猫 14 熊猫打滚

    这节内容我们来实现熊猫打滚.思路是这样的,当熊猫起跳时记录他的Y坐标,落到平台上的时候再记录它的Y坐标.两个坐标之间的差要是大于一定数值就判断它从高处落下要进行打滚缓冲.至此跑酷熊猫已经像一个游戏的样 ...

  7. Lintcode: Sort Letters by Case

    Given a string which contains only letters. Sort it by lower case first and upper case second. Note ...

  8. hunnu 修路

    ing········ 这题我一眼就想到二分修路的长度 可是还有一个问题,有个费用,如果没有的话就所有的边都连起来判断能否二分到最小可行的 可是,有费用... 怎么做呢... ... 有了费用后,就不 ...

  9. C# Enum Type

    class Program { public enum TimeOfDay { Morining, Afternoon, Evening } static void Main(string[] arg ...

  10. C++之路起航——标准模板库(list)

    list(链表):http://baike.baidu.com/link?url=gkVdBlHEzy6ssrgT5Iy2wze4jl37ka1G45TRpUHrQSYFZQg2HimtUCePV0t ...