• 控制器
    • 应用
      • 创建App
      • 获取App
      • 获取App列表
      • 更新App
      • 删除App
      • 获取应用日志
      • 应用的日志流
    • 中间件
      • 创建中间件
      • 获取中间件列表
    • Formation
      • 更新 Formation
      • 获取 Formation
      • 获取 Formation 列表
      • 删除 Formation
    • 扩展的 Expanded
      • 获取扩展的 formation
      • 获取运行的 formation 列表
    • 部署
      • 创建部署
      • 获取部署
      • 列出所有部署
    • 新任务
      • 运行任务
    • 任务
      • 获取任务列表
      • 更新任务
      • 获取任务
      • 删除任务
    • 端口
    • 进程类型
    • 提供程序
    • 创建提供程序
    • 获取提供程序
    • 获取提供程序列表
    • 版本
      • 获取应用初始化版本
      • 设置应用版本
      • 获取应用版本
      • 创建版本
      • 获取版本列表
    • 资源请求
      • 创建资源
    • 资源
      • 添加资源
      • 列出应用资源
      • 获取资源
      • 获取资源列表
  • 删除资源
    • 路由
      • 创建路由
      • 获取路由
      • 更新路由
      • 获取路由列表
      • 删除路由
    • 错误
      • 创建无效应用
    • 事件
      • 事件流
      • 列出事件
      • 获取事件
    • CA 证书
      • 获取 CA 证书
    • 备份
      • 获取集群备份
    • 域名迁移
      • 迁移集群域名

    控制器

    所有请求都通过 basic auth 进行验证,其中用户名为空,密码为控制器密钥。可以为事件流(在浏览器中允许通过JS来使用)选择把控制器密码作为密钥 URL 参数,你可以通过运行以下命令获取控制器密钥:

    1. flynn -a controller env get AUTH_KEY

    API 根路径是控制器的域,默认为:

    1. https://controller.$CLUSTER_DOMAIN

    应用

    应用是进程的组成及其依赖和元数据的命名空间。https://flynn.io/schema/controller/app#

    属性 类型 描述
    id uuid string 唯一标示
    name string matching ^[a-z\d]+(-[a-z\d]+)*$ 应用名称
    protected boolean 假如为true,当删除或归零时应用会被保护
    meta object 客户端指定的元数据
    strategy string
    release uuid string 唯一标示
    deploy_timeout integer 部署超时时间(默认30秒)
    created_at date-time string 对象创建的时间
    updated_at date-time string 对象最新更新时间

    创建App

    实例:—————————————————————请求————————————————————

    1. POST /apps HTTP/1.1
    2. Authorization: Basic OnMzY3IzdA==
    3. Content-Type: application/json
    1. {
    2. "name": "my-app-1422557606845347930",
    3. "protected": false
    4. }

    —————————————————————响应————————————————————

    1. Content-Type: application/json
    1. {
    2. "id": "7406a4d71a0c43d3ac4b39f006cb0342",
    3. "name": "my-app-1422557606845347930",
    4. "protected": false,
    5. "strategy": "all-at-once",
    6. "created_at": "2015-01-29T18:53:26.845896Z",
    7. "updated_at": "2015-01-29T18:53:26.845896Z"
    8. }

    获取App

    实例:—————————————————————请求————————————————————

    1. GET /apps/7406a4d71a0c43d3ac4b39f006cb0342 HTTP/1.1
    2. Authorization: Basic OnMzY3IzdA==
    3. Content-Type: application/json

    —————————————————————响应————————————————————

    1. Content-Type: application/json
    1. {
    2. "id": "7406a4d71a0c43d3ac4b39f006cb0342",
    3. "name": "my-app-1422557606845347930",
    4. "protected": false,
    5. "strategy": "all-at-once",
    6. "created_at": "2015-01-29T18:53:26.845896Z",
    7. "updated_at": "2015-01-29T18:53:26.845896Z"
    8. }

    获取App列表

    实例:—————————————————————请求————————————————————

    1. GET /apps HTTP/1.1
    2. Authorization: Basic OnMzY3IzdA==
    3. Content-Type: application/json

    —————————————————————响应————————————————————

    1. Content-Type: application/json
    1. {
    2. [
    3. {
    4. "id": "7406a4d71a0c43d3ac4b39f006cb0342",
    5. "name": "my-app-1422557606845347930",
    6. "protected": false,
    7. "strategy": "all-at-once",
    8. "created_at": "2015-01-29T18:53:26.845896Z",
    9. "updated_at": "2015-01-29T18:53:26.845896Z"
    10. },
    11. {
    12. "id": "79b56ad29bac4cefb83c37965ae4ce1c",
    13. "name": "dashboard",
    14. "protected": true,
    15. "strategy": "all-at-once",
    16. "created_at": "2015-01-29T18:53:24.997991Z",
    17. "updated_at": "2015-01-29T18:53:25.015618Z"
    18. },
    19. {
    20. "id": "b6f62b8fda484f6e825484a668e161b7",
    21. "name": "taffy",
    22. "protected": true,
    23. "strategy": "all-at-once",
    24. "created_at": "2015-01-29T18:53:24.981366Z",
    25. "updated_at": "2015-01-29T18:53:24.996193Z"
    26. },
    27. {
    28. "id": "48a30977ae9c4b64ba33b773f1808915",
    29. "name": "gitreceive",
    30. "protected": true,
    31. "strategy": "all-at-once",
    32. "created_at": "2015-01-29T18:53:22.46581Z",
    33. "updated_at": "2015-01-29T18:53:22.480289Z"
    34. },
    35. {
    36. "id": "b1061d0a149a4a7498a70367c42d4013",
    37. "name": "router",
    38. "protected": true,
    39. "strategy": "all-at-once",
    40. "created_at": "2015-01-29T18:53:21.72534Z",
    41. "updated_at": "2015-01-29T18:53:21.7391Z"
    42. },
    43. {
    44. "id": "3a6f75c62c68489c82c91922d45429ad",
    45. "name": "blobstore",
    46. "protected": true,
    47. "strategy": "all-at-once",
    48. "created_at": "2015-01-29T18:53:21.415441Z",
    49. "updated_at": "2015-01-29T18:53:21.722021Z"
    50. },
    51. {
    52. "id": "eb11600643d24b5f8e18c0a42afe7f91",
    53. "name": "postgres",
    54. "protected": true,
    55. "strategy": "all-at-once",
    56. "created_at": "2015-01-29T18:53:20.053148Z",
    57. "updated_at": "2015-01-29T18:53:20.06459Z"
    58. },
    59. {
    60. "id": "a78f01dc04fb4fe3bccd85c05ae3fd73",
    61. "name": "controller",
    62. "protected": false,
    63. "strategy": "all-at-once",
    64. "created_at": "2015-01-29T18:53:20.013969Z",
    65. "updated_at": "2015-01-29T18:53:20.049305Z"
    66. }
    67. ]}

    更新App

    实例:—————————————————————请求————————————————————

    1. GET /apps/7406a4d71a0c43d3ac4b39f006cb0342 HTTP/1.1
    2. Authorization: Basic OnMzY3IzdA==
    3. Content-Type: application/json
    1. {
    2. "id": "7406a4d71a0c43d3ac4b39f006cb0342",
    3. "protected": false,
    4. "meta": {
    5. "bread": "with hemp"
    6. }
    7. }

    —————————————————————响应————————————————————

    1. Content-Type: application/json
    1. {
    2. "id": "7406a4d71a0c43d3ac4b39f006cb0342",
    3. "name": "my-app-1422557606845347930",
    4. "protected": false,
    5. "meta": {
    6. "bread": "with hemp"
    7. },
    8. "strategy": "all-at-once",
    9. "created_at": "2015-01-29T18:53:26.845896Z",
    10. "updated_at": "2015-01-29T18:53:26.845896Z"
    11. }

    删除App

    实例:—————————————————————请求————————————————————

    1. GET /apps/7406a4d71a0c43d3ac4b39f006cb0342 HTTP/1.1
    2. Authorization: Basic OnMzY3IzdA==
    3. Content-Type: application/json

    —————————————————————响应————————————————————

    1. Content-Type: text/plain; charset=utf-8

    获取应用日志

    属性 类型 描述
    follow boolean 当新日志产生时将它们发送出去
    job_id uuid string 唯一标识
    lines integer 从缓冲区要返回的行数
    process_type string 只返回给定进程类型的 log

    以 JSON 格式来返回每个日志的每行条目

    实例:—————————————————————请求————————————————————

    1. GET /apps/7406a4d71a0c43d3ac4b39f006cb0342 HTTP/1.1
    2. Authorization: Basic OnMzY3IzdA==
    3. Content-Type: application/json

    —————————————————————响应————————————————————

    1. Content-Type: text/plain
    1. {"host_id":"host","job_id":"host-9869a97a-ef83-4c39-91a2-ca3110f91079","msg":"t=2015-12-16T02:20:56+0000 lvl=info msg=\"request completed\" component=controller req_id=344d4b61-d437-437c-a3c4-e4aa015647cd status=200 duration=6.151899ms","process_type":"web","source":"app","stream":"stdout","timestamp":"2015-12-16T02:20:56.663589985Z"}
    2. {"host_id":"host","job_id":"host-9869a97a-ef83-4c39-91a2-ca3110f91079","msg":"t=2015-12-16T02:20:56+0000 lvl=info msg=\"request started\" component=controller req_id=312895c5-4b45-4e65-b906-a46ee9bf3599 method=GET path=/apps/gitreceive/release client_ip=100.100.45.12","process_type":"web","source":"app","stream":"stdout","timestamp":"2015-12-16T02:20:56.664482277Z"}
    3. {"host_id":"host","job_id":"host-9869a97a-ef83-4c39-91a2-ca3110f91079","msg":"t=2015-12-16T02:20:56+0000 lvl=info msg=\"request completed\" component=controller req_id=312895c5-4b45-4e65-b906-a46ee9bf3599 status=200 duration=1.274184ms","process_type":"web","source":"app","stream":"stdout","timestamp":"2015-12-16T02:20:56.66574836Z"}
    4. {"host_id":"host","job_id":"host-9869a97a-ef83-4c39-91a2-ca3110f91079","msg":"t=2015-12-16T02:20:56+0000 lvl=info msg=\"request started\" component=controller req_id=cea0a133-93c9-4ff6-b532-cd719c888eb6 method=GET path=/apps/adcccdb4-b1a4-4209-a03a-762f4e021632 client_ip=100.100.45.12","process_type":"web","source":"app","stream":"stdout","timestamp":"2015-12-16T02:20:56.667514227Z"}
    5. {"host_id":"host","job_id":"host-9869a97a-ef83-4c39-91a2-ca3110f91079","msg":"t=2015-12-16T02:20:56+0000 lvl=info msg=\"request completed\" component=controller req_id=cea0a133-93c9-4ff6-b532-cd719c888eb6 status=200 duration=1.132266ms","process_type":"web","source":"app","stream":"stdout","timestamp":"2015-12-16T02:20:56.66782991Z"}
    6. {"host_id":"host","job_id":"host-9869a97a-ef83-4c39-91a2-ca3110f91079","msg":"t=2015-12-16T02:20:56+0000 lvl=info msg=\"request started\" req_id=7cce8772-bdad-485e-ac35-320465d70b6e component=controller method=GET path=/apps client_ip=100.100.45.12","process_type":"web","source":"app","stream":"stdout","timestamp":"2015-12-16T02:20:56.668616602Z"}
    7. {"host_id":"host","job_id":"host-9869a97a-ef83-4c39-91a2-ca3110f91079","msg":"t=2015-12-16T02:20:56+0000 lvl=info msg=\"request completed\" req_id=7cce8772-bdad-485e-ac35-320465d70b6e component=controller status=200 duration=750.095µs","process_type":"web","source":"app","stream":"stdout","timestamp":"2015-12-16T02:20:56.669398265Z"}
    8. {"host_id":"host","job_id":"host-9869a97a-ef83-4c39-91a2-ca3110f91079","msg":"t=2015-12-16T02:20:56+0000 lvl=info msg=\"request started\" component=controller req_id=99c6ab06-b4be-4996-8321-9f41847ac50c method=GET path=/apps/controller client_ip=100.100.45.12","process_type":"web","source":"app","stream":"stdout","timestamp":"2015-12-16T02:20:56.670213173Z"}
    9. {"host_id":"host","job_id":"host-9869a97a-ef83-4c39-91a2-ca3110f91079","msg":"t=2015-12-16T02:20:56+0000 lvl=info msg=\"request completed\" component=controller req_id=99c6ab06-b4be-4996-8321-9f41847ac50c status=200 duration=492.8µs","process_type":"web","source":"app","stream":"stdout","timestamp":"2015-12-16T02:20:56.670729161Z"}
    10. {"host_id":"host","job_id":"host-9869a97a-ef83-4c39-91a2-ca3110f91079","msg":"t=2015-12-16T02:20:56+0000 lvl=info msg=\"request started\" component=controller req_id=0738164d-2c09-41ae-a391-b550c0710fae method=GET path=/apps/f7064b9f-c968-4f16-be0e-f2efd1b2c7b7/log client_ip=100.100.45.12","process_type":"web","source":"app","stream":"stdout","timestamp":"2015-12-16T02:20:56.671577593Z"}

    应用的日志流

    属性 类型 描述
    follow boolean 当新日志产生时将它们发送出去
    job_id uuid string 唯一标识
    lines integer 从缓冲区要返回的行数
    process_type string 只返回给定进程类型的 log

    实例:—————————————————————请求————————————————————

    1. GET /apps/f7064b9f-c968-4f16-be0e-f2efd1b2c7b7/log?lines=10 HTTP/1.1
    2. Accept: text/event-stream
    3. Authorization: Basic OnMzY3IzdA==
    4. Content-Type: application/json

    —————————————————————响应————————————————————

    1. Content-Type: text/plain
    1. data: {"event":"message","data":{"host_id":"host","job_id":"host-9869a97a-ef83-4c39-91a2-ca3110f91079","msg":"t=2015-12-16T02:20:56+0000 lvl=info msg=\"request completed\" component=controller req_id=312895c5-4b45-4e65-b906-a46ee9bf3599 status=200 duration=1.274184ms","process_type":"web","source":"app","stream":"stdout","timestamp":"2015-12-16T02:20:56.66574836Z"}}
    2. data: {"event":"message","data":{"host_id":"host","job_id":"host-9869a97a-ef83-4c39-91a2-ca3110f91079","msg":"t=2015-12-16T02:20:56+0000 lvl=info msg=\"request started\" component=controller req_id=cea0a133-93c9-4ff6-b532-cd719c888eb6 method=GET path=/apps/adcccdb4-b1a4-4209-a03a-762f4e021632 client_ip=100.100.45.12","process_type":"web","source":"app","stream":"stdout","timestamp":"2015-12-16T02:20:56.667514227Z"}}
    3. data: {"event":"message","data":{"host_id":"host","job_id":"host-9869a97a-ef83-4c39-91a2-ca3110f91079","msg":"t=2015-12-16T02:20:56+0000 lvl=info msg=\"request completed\" component=controller req_id=cea0a133-93c9-4ff6-b532-cd719c888eb6 status=200 duration=1.132266ms","process_type":"web","source":"app","stream":"stdout","timestamp":"2015-12-16T02:20:56.66782991Z"}}
    4. data: {"event":"message","data":{"host_id":"host","job_id":"host-9869a97a-ef83-4c39-91a2-ca3110f91079","msg":"t=2015-12-16T02:20:56+0000 lvl=info msg=\"request started\" req_id=7cce8772-bdad-485e-ac35-320465d70b6e component=controller method=GET path=/apps client_ip=100.100.45.12","process_type":"web","source":"app","stream":"stdout","timestamp":"2015-12-16T02:20:56.668616602Z"}}
    5. data: {"event":"message","data":{"host_id":"host","job_id":"host-9869a97a-ef83-4c39-91a2-ca3110f91079","msg":"t=2015-12-16T02:20:56+0000 lvl=info msg=\"request completed\" req_id=7cce8772-bdad-485e-ac35-320465d70b6e component=controller status=200 duration=750.095µs","process_type":"web","source":"app","stream":"stdout","timestamp":"2015-12-16T02:20:56.669398265Z"}}
    6. data: {"event":"message","data":{"host_id":"host","job_id":"host-9869a97a-ef83-4c39-91a2-ca3110f91079","msg":"t=2015-12-16T02:20:56+0000 lvl=info msg=\"request started\" component=controller req_id=99c6ab06-b4be-4996-8321-9f41847ac50c method=GET path=/apps/controller client_ip=100.100.45.12","process_type":"web","source":"app","stream":"stdout","timestamp":"2015-12-16T02:20:56.670213173Z"}}
    7. data: {"event":"message","data":{"host_id":"host","job_id":"host-9869a97a-ef83-4c39-91a2-ca3110f91079","msg":"t=2015-12-16T02:20:56+0000 lvl=info msg=\"request completed\" component=controller req_id=99c6ab06-b4be-4996-8321-9f41847ac50c status=200 duration=492.8µs","process_type":"web","source":"app","stream":"stdout","timestamp":"2015-12-16T02:20:56.670729161Z"}}
    8. data: {"event":"message","data":{"host_id":"host","job_id":"host-9869a97a-ef83-4c39-91a2-ca3110f91079","msg":"t=2015-12-16T02:20:56+0000 lvl=info msg=\"request started\" component=controller req_id=0738164d-2c09-41ae-a391-b550c0710fae method=GET path=/apps/f7064b9f-c968-4f16-be0e-f2efd1b2c7b7/log client_ip=100.100.45.12","process_type":"web","source":"app","stream":"stdout","timestamp":"2015-12-16T02:20:56.671577593Z"}}
    9. data: {"event":"message","data":{"host_id":"host","job_id":"host-9869a97a-ef83-4c39-91a2-ca3110f91079","msg":"t=2015-12-16T02:20:56+0000 lvl=info msg=\"request completed\" component=controller req_id=0738164d-2c09-41ae-a391-b550c0710fae status=200 duration=7.132192ms","process_type":"web","source":"app","stream":"stdout","timestamp":"2015-12-16T02:20:56.678703917Z"}}
    10. data: {"event":"message","data":{"host_id":"host","job_id":"host-9869a97a-ef83-4c39-91a2-ca3110f91079","msg":"t=2015-12-16T02:20:56+0000 lvl=info msg=\"request started\" req_id=2809d7e8-dcc6-4457-971e-307ebb5919e5 component=controller method=GET path=/apps/f7064b9f-c968-4f16-be0e-f2efd1b2c7b7/log client_ip=100.100.45.12","process_type":"web","source":"app","stream":"stdout","timestamp":"2015-12-16T02:20:56.679319917Z"}}
    11. data: {"event":"eof"}

    中间件

    中间件是进程所使用的镜像的固定引用。https://flynn.io/schema/controller/artifact#

    属性 类型 描述
    id uuid string 唯一标示
    type string 中间件类型
    uri uri string 用于获取中间件的uri
    created_at date-time string 对象的创建时间

    创建中间件

    实例:—————————————————————请求————————————————————

    1. POST /artifacts HTTP/1.1
    2. Authorization: Basic OnMzY3IzdA==
    3. Content-Type: application/json
    1. {
    2. "type": "docker",
    3. "uri": "https://registry.hub.docker.com/flynn/slugrunner?id=039222f9884412eb0667988933caeb0ed06da28f71e3dff540a61d13d0d85ae0"
    4. }

    —————————————————————响应————————————————————

    1. Content-Type: application/json
    1. {
    2. "id": "4d365e6cdb1d47b8b98c9cd9a7b047fd",
    3. "type": "docker",
    4. "uri": "https://registry.hub.docker.com/flynn/slugrunner?id=039222f9884412eb0667988933caeb0ed06da28f71e3dff540a61d13d0d85ae0",
    5. "created_at": "2015-01-29T18:53:26.889875Z"
    6. }

    获取中间件列表

    实例:—————————————————————请求————————————————————

    1. POST /artifacts HTTP/1.1
    2. Authorization: Basic OnMzY3IzdA==
    3. Content-Type: application/json

    —————————————————————响应————————————————————

    1. Content-Type: application/json
    1. [
    2. {
    3. "id": "4d365e6cdb1d47b8b98c9cd9a7b047fd",
    4. "type": "docker",
    5. "uri": "https://registry.hub.docker.com/flynn/slugrunner?id=039222f9884412eb0667988933caeb0ed06da28f71e3dff540a61d13d0d85ae0",
    6. "created_at": "2015-01-29T18:53:26.889875Z"
    7. },
    8. {
    9. "id": "8b6548e25bc8477e905deee8a33eab2a",
    10. "type": "docker",
    11. "uri": "https://registry.hub.docker.com/flynn/dashboard?id=04b11c64060562a786281b73481049c7867658fc979d62c102e9a095fd73aadd",
    12. "created_at": "2015-01-29T18:53:25.000437Z"
    13. },
    14. {
    15. "id": "03f9d97aeab94f2b9bb23f4ade0eb270",
    16. "type": "docker",
    17. "uri": "https://registry.hub.docker.com/flynn/taffy?id=f9fec4547fcec06160a32da164cad79541b1e2edd96c4a55dee7fc64814a8b26",
    18. "created_at": "2015-01-29T18:53:24.983953Z"
    19. },
    20. {
    21. "id": "74010365c551463386bae39cf4ad0a47",
    22. "type": "docker",
    23. "uri": "https://registry.hub.docker.com/flynn/receiver?id=c2cfc8c7715c8300f3d0d1c318eb7a2fbeba6fd678a5a7d7ab8bd0f1659fad2f",
    24. "created_at": "2015-01-29T18:53:22.469009Z"
    25. },
    26. {
    27. "id": "73d37c1bdacd432f9e5c3cbe121c365e",
    28. "type": "docker",
    29. "uri": "https://registry.hub.docker.com/flynn/router?id=9ff4d42de0758dfe3278dbc0877e08b596c5f726cbb06819ff99fe4fdb448aa5",
    30. "created_at": "2015-01-29T18:53:21.728047Z"
    31. },
    32. {
    33. "id": "afe339ec9a0f46b28cfa5dff383e5179",
    34. "type": "docker",
    35. "uri": "https://registry.hub.docker.com/flynn/blobstore?id=75231ad60a567fa118cc003462612abc37a4646e5688ced2e7308f0951392f87",
    36. "created_at": "2015-01-29T18:53:21.711605Z"
    37. },
    38. {
    39. "id": "61b804fd0f9c42359ac8d8e3131d16bf",
    40. "type": "docker",
    41. "uri": "https://registry.hub.docker.com/flynn/postgresql?id=5cb8db666db41d1f86091c06d709f282295ded77e854241bef6ebee25fda09d0",
    42. "created_at": "2015-01-29T18:53:20.055663Z"
    43. },
    44. {
    45. "id": "1b7c8dcfd0b14755a452367e5f6723b6",
    46. "type": "docker",
    47. "uri": "https://registry.hub.docker.com/flynn/controller?id=e65f0f3d5e5853f2fc1f60758fb134d8ba7b746da0d8f4fdda473ff5a57fee6c",
    48. "created_at": "2015-01-29T18:53:20.024582Z"
    49. }
    50. ]

    Formation

    Formation 是一个正在运行的版本。https://flynn.io/schema/controller/formation#

    属性 类型 描述
    app uuid string 唯一标示
    release uuid string 唯一标示
    processes object 每种进程所运行的进程数
    created_at date-time string 对象的创建时间
    updated_at date-time string 对象最新更新时间

    更新 Formation

    实例:—————————————————————请求————————————————————

    1. PUT /apps/7406a4d71a0c43d3ac4b39f006cb0342/formations/689ce5b9ad1541ab975d51cba1e051d0 HTTP/1.1
    2. Authorization: Basic OnMzY3IzdA==
    3. Content-Type: application/json
    1. {
    2. "app": "7406a4d71a0c43d3ac4b39f006cb0342",
    3. "release": "689ce5b9ad1541ab975d51cba1e051d0",
    4. "processes": {
    5. "foo": 1
    6. }
    7. }

    —————————————————————响应————————————————————

    1. Content-Type: application/json
    1. {
    2. "app": "7406a4d71a0c43d3ac4b39f006cb0342",
    3. "release": "689ce5b9ad1541ab975d51cba1e051d0",
    4. "processes": {
    5. "foo": 1
    6. },
    7. "created_at": "2015-01-29T18:53:26.907195Z",
    8. "updated_at": "2015-01-29T18:53:26.907195Z"
    9. }

    获取 Formation

    实例:—————————————————————请求————————————————————

    1. GET /apps/7406a4d71a0c43d3ac4b39f006cb0342/formations/689ce5b9ad1541ab975d51cba1e051d0 HTTP/1.1
    2. Authorization: Basic OnMzY3IzdA==
    3. Content-Type: application/json

    —————————————————————响应————————————————————

    1. Content-Type: application/json
    1. {
    2. "app": "7406a4d71a0c43d3ac4b39f006cb0342",
    3. "release": "689ce5b9ad1541ab975d51cba1e051d0",
    4. "processes": {
    5. "foo": 1
    6. },
    7. "created_at": "2015-01-29T18:53:26.907195Z",
    8. "updated_at": "2015-01-29T18:53:26.907195Z"
    9. }

    获取 Formation 列表

    实例:—————————————————————请求————————————————————

    1. GET /apps/7406a4d71a0c43d3ac4b39f006cb0342/formations HTTP/1.1
    2. Authorization: Basic OnMzY3IzdA==
    3. Content-Type: application/json

    —————————————————————响应————————————————————

    1. Content-Type: application/json
    1. [
    2. {
    3. "app": "7406a4d71a0c43d3ac4b39f006cb0342",
    4. "release": "689ce5b9ad1541ab975d51cba1e051d0",
    5. "processes": {
    6. "foo": 1
    7. },
    8. "created_at": "2015-01-29T18:53:26.907195Z",
    9. "updated_at": "2015-01-29T18:53:26.907195Z"
    10. }
    11. ]

    删除 Formation

    实例:—————————————————————请求————————————————————

    1. DELETE /apps/7406a4d71a0c43d3ac4b39f006cb0342/formations/40202cf3b0e946a4b2c4db42a0c14194 HTTP/1.1
    2. Authorization: Basic OnMzY3IzdA==
    3. Content-Type: application/json

    —————————————————————响应————————————————————

    1. Content-Type: text/plain; charset=utf-8

    扩展的 Expanded

    Formation 是一个正在运行的版本。https://flynn.io/schema/controller/expanded_formation#

    属性 类型 描述
    app object 应用是进程的组成及其依赖和元数据的命名空间
    app.id uuid string 唯一标示
    app.name string matching ^[a-z\d]+(-[a-z\d]+)*$ 应用名称
    app.protected boolean 若为真,则应用可以受保护不被删除
    app.meta object 用户自定义元数据
    app.strategy string all-at-once one-by-one postgres discoverd-meta
    app.release uuid string 唯一标示
    app.deploy_timeout integer 部署超时时间(默认30秒)
    app.created_at date-time string 对象创建时间
    app.updated_at date-time string 对象更新时间
    release object
    release.id uuid string 唯一标示
    release.artifact uuid string 唯一标示
    release.meta object 用户自定义元数据
    release.env object 环境变量
    release.processes object
    release.created_at date-time string 对象创建时间
    artifact object 中间件是进程所使用的镜像的固定引用
    artifact.id uuid string 唯一标示
    artifact.type string docker
    artifact.uri uri string 唯一标示
    artifact.created_at date-time string 对象的创建时间
    processes object 每种进程所运行的进程数
    updated_at date-time string 对象最新更新时间

    获取扩展的 formation

    实例:—————————————————————请求————————————————————

    1. GET /apps/adcccdb4-b1a4-4209-a03a-762f4e021632/formations/47154f8c-a604-469d-ae6a-e431990ddee8?expand=true HTTP/1.1
    2. Authorization: Basic OnMzY3IzdA==
    3. Content-Type: application/json

    —————————————————————响应————————————————————

    1. Content-Type: application/json
    1. {
    2. "app": {
    3. "id": "adcccdb4-b1a4-4209-a03a-762f4e021632",
    4. "name": "my-app-1450232456657062340",
    5. "meta": null
    6. },
    7. "release": {
    8. "id": "47154f8c-a604-469d-ae6a-e431990ddee8",
    9. "artifact": "c1889f55-c244-43ce-af70-ead357daa6ec",
    10. "env": {
    11. "some": "info"
    12. },
    13. "processes": {
    14. "foo": {
    15. "cmd": [
    16. "ls",
    17. "-l"
    18. ],
    19. "env": {
    20. "BAR": "baz"
    21. },
    22. "resources": {
    23. "max_fd": {
    24. "request": 10000,
    25. "limit": 10000
    26. },
    27. "memory": {
    28. "request": 1073741824,
    29. "limit": 1073741824
    30. }
    31. }
    32. }
    33. }
    34. },
    35. "artifact": {
    36. "id": "c1889f55-c244-43ce-af70-ead357daa6ec",
    37. "type": "docker",
    38. "uri": "https://dl.flynn.io/tuf?name=flynn/slugrunner&id=dc1dadc66c31a1957bad101a22c4b607b2dd4f8f42ae5593ec28f3eef45e7b97"
    39. },
    40. "processes": {
    41. "foo": 1
    42. },
    43. "updated_at": "2015-12-16T02:21:06.748757Z"
    44. }

    获取运行的 formation 列表

    实例:—————————————————————请求————————————————————

    1. GET /formations?active=true HTTP/1.1
    2. Authorization: Basic OnMzY3IzdA==
    3. Content-Type: application/json

    —————————————————————响应————————————————————

    1. Content-Type: application/json
    1. [
    2. {
    3. "app": {
    4. "id": "adcccdb4-b1a4-4209-a03a-762f4e021632",
    5. "name": "my-app-1450232456657062340",
    6. "meta": null
    7. },
    8. "release": {
    9. "id": "47154f8c-a604-469d-ae6a-e431990ddee8",
    10. "artifact": "c1889f55-c244-43ce-af70-ead357daa6ec",
    11. "env": {
    12. "some": "info"
    13. },
    14. "processes": {
    15. "foo": {
    16. "cmd": [
    17. "ls",
    18. "-l"
    19. ],
    20. "env": {
    21. "BAR": "baz"
    22. },
    23. "resources": {
    24. "max_fd": {
    25. "request": 10000,
    26. "limit": 10000
    27. },
    28. "memory": {
    29. "request": 1073741824,
    30. "limit": 1073741824
    31. }
    32. }
    33. }
    34. }
    35. },
    36. "artifact": {
    37. "id": "c1889f55-c244-43ce-af70-ead357daa6ec",
    38. "type": "docker",
    39. "uri": "https://dl.flynn.io/tuf?name=flynn/slugrunner&id=dc1dadc66c31a1957bad101a22c4b607b2dd4f8f42ae5593ec28f3eef45e7b97"
    40. },
    41. "processes": {
    42. "foo": 1
    43. },
    44. "updated_at": "2015-12-16T02:21:06.748757Z"
    45. },
    46. {
    47. "app": {
    48. "id": "28a8aed1-a50d-446e-b4ad-38ca3e95fb8f",
    49. "name": "status",
    50. "meta": null
    51. },
    52. "release": {
    53. "id": "fff9dd4b-9f38-4f71-b3c5-5cd5fc19d31a",
    54. "artifact": "e88714df-27b5-40aa-900e-717384fddcdd",
    55. "env": {
    56. "AUTH_KEY": "44335767c99fb93b23c9a1500bf1ebeb"
    57. },
    58. "processes": {
    59. "web": {
    60. "ports": [
    61. {
    62. "port": 80,
    63. "proto": "tcp",
    64. "service": {
    65. "name": "status-web",
    66. "create": true
    67. }
    68. }
    69. ],
    70. "resources": {
    71. "max_fd": {
    72. "request": 10000,
    73. "limit": 10000
    74. },
    75. "memory": {
    76. "request": 1073741824,
    77. "limit": 1073741824
    78. }
    79. }
    80. }
    81. }
    82. },
    83. "artifact": {
    84. "id": "e88714df-27b5-40aa-900e-717384fddcdd",
    85. "type": "docker",
    86. "uri": "https://dl.flynn.io/tuf?name=flynn/status&id=33c003b37b2919a841d6e14a6335ff440607957efeb2e9022dce05a36f86203f"
    87. },
    88. "processes": {
    89. "web": 1
    90. },
    91. "updated_at": "2015-12-16T02:20:50.513318Z"
    92. },
    93. {
    94. "app": {
    95. "id": "52e4cac9-3e4a-42ab-8b87-b714403aafc6",
    96. "name": "dashboard",
    97. "meta": null
    98. },
    99. "release": {
    100. "id": "93f1f03e-30c4-4c1f-8c4b-7c0c7e295421",
    101. "artifact": "ec791440-fa5b-4d8e-903a-94999f634ea1",
    102. "env": {
    103. "APP_NAME": "dashboard",
    104. "CA_CERT": "-----BEGIN CERTIFICATE-----\nMIIDBDCCAe6gAwIBAgIRAP6BP9TQKrq0l1CCcSI4gb4wCwYJKoZIhvcNAQELMC0x\nDjAMBgNVBAoTBUZseW5uMRswGQYDVQQLExJGbHlubiBFcGhlbWVyYWwgQ0EwHhcN\nMTUxMjE2MDIyMDQxWhcNMjAxMjE0MDIyMDQxWjAtMQ4wDAYDVQQKEwVGbHlubjEb\nMBkGA1UECxMSRmx5bm4gRXBoZW1lcmFsIENBMIIBIjANBgkqhkiG9w0BAQEFAAOC\nAQ8AMIIBCgKCAQEAn+KUccUSVeWoJZTlOxqaiXacGECGAPETxfmnL9ep1rA/4DWi\n2OTpZoeSFdyL1yV5KJxPkq6XMNyl/BR72SOomCmoFRnZzDih//+gfuJAFVGaF1j9\nFOIX+VyO8jyFzqk2vZg9R+ncRyFgjEgpHn0gDdt4WLWDxPpfFMClEZU6Mpu02ngj\n1kmlNgzajl71qhhKtrv3W7ACKh6O3fMSBg4n/ZiVnVQjdkejHskV5R43FH4bpZzP\nhb82rI6FNBNOCKqwbQ/AdGGVvJSzXPypvzCMkGghhx8pckoZw7DONXhSojfIO6Kt\nlxUYO1Odmnb+nyJjxGyidSperhfm+CuSFPn2BwIDAQABoyMwITAOBgNVHQ8BAf8E\nBAMCAAYwDwYDVR0TAQH/BAUwAwEB/zALBgkqhkiG9w0BAQsDggEBAGvEqq1ko+pE\nS5RBHmTWW6mJom9rA+aii9n88lMhbdjikeVFkQkH6Qi8zR5O4hCdDUC4qYUp+rIF\nZ4XZ9Ogl4CcR1gEPGu1KX2EnjVKloS1LThugCuP5YJgQ5qoMsQs681s1ZpPd/0gh\ntjASQy1Y72wY1SxVWqJzkuzf8mMDg52I4wwD9Eif2zq1/+sJa9mdilhvd0Wp+hDV\n6qN6xbH65V2VKwDrkD2p7CIn3NmknYhmw+obezqRkSl6N5Is/QPVg59bOu0evWfS\nDyaOehm1EmmRVehNj8IR0noFwUMbIASnpTescLd4Nz9pEjbgHQ+m6Swe8hnaZ3dd\n1TvxABm/4VY=\n-----END CERTIFICATE-----\n",
    105. "CONTROLLER_DOMAIN": "controller.dev.localflynn.com",
    106. "CONTROLLER_KEY": "s3cr3t",
    107. "DEFAULT_ROUTE_DOMAIN": "dev.localflynn.com",
    108. "LOGIN_TOKEN": "c8414bceb41bd679535c76f87472a8c2",
    109. "SECURE_COOKIES": "true",
    110. "SESSION_SECRET": "f180d52702a70f23a5eb6b1d87d5ab3a",
    111. "URL": "https://dashboard.dev.localflynn.com"
    112. },
    113. "processes": {
    114. "web": {
    115. "ports": [
    116. {
    117. "port": 80,
    118. "proto": "tcp",
    119. "service": {
    120. "name": "dashboard-web",
    121. "create": true,
    122. "check": {
    123. "type": "http",
    124. "status.omitempty": 0
    125. }
    126. }
    127. }
    128. ],
    129. "resources": {
    130. "max_fd": {
    131. "request": 10000,
    132. "limit": 10000
    133. },
    134. "memory": {
    135. "request": 1073741824,
    136. "limit": 1073741824
    137. }
    138. }
    139. }
    140. }
    141. },
    142. "artifact": {
    143. "id": "ec791440-fa5b-4d8e-903a-94999f634ea1",
    144. "type": "docker",
    145. "uri": "https://dl.flynn.io/tuf?name=flynn/dashboard&id=d602235982d4d3e4a75253aae15f5ced25d2a6b3585518b644788ac5f0f943ec"
    146. },
    147. "processes": {
    148. "web": 1
    149. },
    150. "updated_at": "2015-12-16T02:20:50.47223Z"
    151. },
    152. {
    153. "app": {
    154. "id": "3ccdfb02-1dfb-4148-9ade-caa9ac918947",
    155. "name": "logaggregator",
    156. "meta": null
    157. },
    158. "release": {
    159. "id": "d755489a-89ce-4c8c-b717-73d5589bab41",
    160. "artifact": "08d14942-65c0-456e-b1ef-e7d46717dcd4",
    161. "processes": {
    162. "app": {
    163. "cmd": [
    164. "-logaddr",
    165. ":514",
    166. "-apiaddr",
    167. ":80"
    168. ],
    169. "ports": [
    170. {
    171. "port": 80,
    172. "proto": "tcp"
    173. },
    174. {
    175. "port": 514,
    176. "proto": "tcp"
    177. }
    178. ],
    179. "resources": {
    180. "max_fd": {
    181. "request": 10000,
    182. "limit": 10000
    183. },
    184. "memory": {
    185. "request": 1073741824,
    186. "limit": 1073741824
    187. }
    188. }
    189. }
    190. }
    191. },
    192. "artifact": {
    193. "id": "08d14942-65c0-456e-b1ef-e7d46717dcd4",
    194. "type": "docker",
    195. "uri": "https://dl.flynn.io/tuf?name=flynn/logaggregator&id=cd30beb1606288f61eae7a4fe83ad3652689e644d9bb3e8bc10ca22d8ca0652b"
    196. },
    197. "processes": {
    198. "app": 1
    199. },
    200. "updated_at": "2015-12-16T02:20:50.392915Z"
    201. },
    202. {
    203. "app": {
    204. "id": "86750e3a-927f-4146-8651-4c8b7cc2de01",
    205. "name": "gitreceive",
    206. "meta": null
    207. },
    208. "release": {
    209. "id": "ea333a70-5971-467a-ba92-1d2e724db07f",
    210. "artifact": "1a5bf802-3337-48b3-b812-b994f1cde371",
    211. "env": {
    212. "CONTROLLER_KEY": "s3cr3t",
    213. "SLUGBUILDER_IMAGE_URI": "https://dl.flynn.io/tuf?name=flynn/slugbuilder&id=304a939ca74764b7e356133d7559cc245207deca8c65e782d4a043f14a566cae",
    214. "SLUGRUNNER_IMAGE_URI": "https://dl.flynn.io/tuf?name=flynn/slugrunner&id=dc1dadc66c31a1957bad101a22c4b607b2dd4f8f42ae5593ec28f3eef45e7b97"
    215. },
    216. "processes": {
    217. "app": {
    218. "ports": [
    219. {
    220. "port": 0,
    221. "proto": "tcp",
    222. "service": {
    223. "name": "gitreceive",
    224. "create": true
    225. }
    226. }
    227. ],
    228. "resources": {
    229. "max_fd": {
    230. "request": 10000,
    231. "limit": 10000
    232. },
    233. "memory": {
    234. "request": 1073741824,
    235. "limit": 1073741824
    236. }
    237. }
    238. }
    239. }
    240. },
    241. "artifact": {
    242. "id": "1a5bf802-3337-48b3-b812-b994f1cde371",
    243. "type": "docker",
    244. "uri": "https://dl.flynn.io/tuf?name=flynn/gitreceive&id=426e13b19a91af29a373f59d7edae7e54fe9d035961738d342e4b2c001027cde"
    245. },
    246. "processes": {
    247. "app": 1
    248. },
    249. "updated_at": "2015-12-16T02:20:47.071423Z"
    250. },
    251. {
    252. "app": {
    253. "id": "aaae4e4b-dc79-4753-bc99-71e40c7d24dd",
    254. "name": "router",
    255. "meta": null
    256. },
    257. "release": {
    258. "id": "c8268dcf-8f16-48e5-9c40-797a399dac99",
    259. "artifact": "48953db6-1c0a-4af2-b687-7fe6971fcf84",
    260. "env": {
    261. "COOKIE_KEY": "7AaXi7KZDeWu4FotDN+7wi6RbHWywW6ClN2qap78cSg=",
    262. "DATABASE_URL": "postgres://975487bc5a45fc80ade5765db668d873:46aabd4df6f39a1a23e63d9a76dece78@leader.postgres.discoverd:5432/6e63ce03061c8788f766994d9a9be92a",
    263. "FLYNN_POSTGRES": "postgres",
    264. "PGDATABASE": "6e63ce03061c8788f766994d9a9be92a",
    265. "PGHOST": "leader.postgres.discoverd",
    266. "PGPASSWORD": "46aabd4df6f39a1a23e63d9a76dece78",
    267. "PGUSER": "975487bc5a45fc80ade5765db668d873",
    268. "TLSCERT": "-----BEGIN CERTIFICATE-----\nMIIDSjCCAjSgAwIBAgIQDH8zACle7B+pqJB3QfwthDALBgkqhkiG9w0BAQswLTEO\nMAwGA1UEChMFRmx5bm4xGzAZBgNVBAsTEkZseW5uIEVwaGVtZXJhbCBDQTAeFw0x\nNTEyMTYwMjIwNDJaFw0yMDEyMTQwMjIwNDJaMC0xDjAMBgNVBAoTBUZseW5uMRsw\nGQYDVQQDExJkZXYubG9jYWxmbHlubi5jb20wggEiMA0GCSqGSIb3DQEBAQ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RTI\nlRd4mwEwkMW8KKau0f5KwyDwBNy3OmAZ0OAg3z/Dpya4G6B8rn+IUDODLdOvnD3b\nNgDXTSbqK5NFV07Egf7dEQKBgHdthvrRckOJW3dY2JqH3U0YWkABbqpwo3N16sgQ\nB69TReL6XYK1zidZe1UlnVUxmx1gM9Q7aLsd7ykikIw4mYtPIY5d140juqdajH4f\nuEVTsiH+ShJYTIcOxPG9bYZ+VAD+GIEraT+boD28Z1DZKgJUABylYnFkIxBnAS6i\nzwaxAoGAa3TWYsK0VUrn1EwlI9zzCLW8myjzyPLgpEQ6264ETNSw4K42M2fthcS4\nzlVMrPJ5yhftxCkxbXNFp74lt5Nhryv9K3RWdnL6aXoxR4juhfXBPUBPK+bk/g6F\nohfHj/PeDJFBe0MWC1Q4x7jbeHgqXQ9q7mun+9xH8ZziMdknHc4=\n-----END RSA PRIVATE KEY-----\n"
    270. },
    271. "processes": {
    272. "app": {
    273. "cmd": [
    274. "-http-port",
    275. "80",
    276. "-https-port",
    277. "443",
    278. "-tcp-range-start",
    279. "3000",
    280. "-tcp-range-end",
    281. "3500"
    282. ],
    283. "omni": true,
    284. "host_network": true,
    285. "resources": {
    286. "max_fd": {
    287. "request": 10000,
    288. "limit": 10000
    289. },
    290. "memory": {
    291. "request": 1073741824,
    292. "limit": 1073741824
    293. }
    294. }
    295. }
    296. }
    297. },
    298. "artifact": {
    299. "id": "48953db6-1c0a-4af2-b687-7fe6971fcf84",
    300. "type": "docker",
    301. "uri": "https://dl.flynn.io/tuf?name=flynn/router&id=35dd76cf940ed67fdb4f373f79fc79dda327a0fb36d3dffb3894cb5f981b4a21"
    302. },
    303. "processes": {
    304. "app": 1
    305. },
    306. "updated_at": "2015-12-16T02:20:47.037485Z"
    307. },
    308. {
    309. "app": {
    310. "id": "0b5fb9b4-af2b-462e-aaca-cc64591573e5",
    311. "name": "blobstore",
    312. "meta": null
    313. },
    314. "release": {
    315. "id": "53815de9-8a78-4ab1-909e-a465242f57e7",
    316. "artifact": "a436a3d6-a2c5-430e-961d-96518dacddff",
    317. "env": {
    318. "DATABASE_URL": "postgres://8a4906b3587c5faabef321d34936ac3a:6ac0c933a4abba2a2f8ec0e87ccb8f68@leader.postgres.discoverd:5432/d2f1b01c72f997dc2dbc0e1bc6c4c6ec",
    319. "FLYNN_POSTGRES": "postgres",
    320. "PGDATABASE": "d2f1b01c72f997dc2dbc0e1bc6c4c6ec",
    321. "PGHOST": "leader.postgres.discoverd",
    322. "PGPASSWORD": "6ac0c933a4abba2a2f8ec0e87ccb8f68",
    323. "PGUSER": "8a4906b3587c5faabef321d34936ac3a"
    324. },
    325. "processes": {
    326. "web": {
    327. "ports": [
    328. {
    329. "port": 80,
    330. "proto": "tcp"
    331. }
    332. ],
    333. "resources": {
    334. "max_fd": {
    335. "request": 10000,
    336. "limit": 10000
    337. },
    338. "memory": {
    339. "request": 1073741824,
    340. "limit": 1073741824
    341. }
    342. }
    343. }
    344. }
    345. },
    346. "artifact": {
    347. "id": "a436a3d6-a2c5-430e-961d-96518dacddff",
    348. "type": "docker",
    349. "uri": "https://dl.flynn.io/tuf?name=flynn/blobstore&id=8b27756a551d5dd5e29181209b842c71288494d2fd7aded04fe7608c74bf4f9c"
    350. },
    351. "processes": {
    352. "web": 1
    353. },
    354. "updated_at": "2015-12-16T02:20:46.608041Z"
    355. },
    356. {
    357. "app": {
    358. "id": "f7064b9f-c968-4f16-be0e-f2efd1b2c7b7",
    359. "name": "controller",
    360. "meta": null
    361. },
    362. "release": {
    363. "id": "9afcffd7-6278-47c9-a2f0-1326b42b4a03",
    364. "artifact": "c8400666-26d9-493f-9630-3d34045f8498",
    365. "env": {
    366. "AUTH_KEY": "s3cr3t",
    367. "CA_CERT": "-----BEGIN CERTIFICATE-----\nMIIDBDCCAe6gAwIBAgIRAP6BP9TQKrq0l1CCcSI4gb4wCwYJKoZIhvcNAQELMC0x\nDjAMBgNVBAoTBUZseW5uMRswGQYDVQQLExJGbHlubiBFcGhlbWVyYWwgQ0EwHhcN\nMTUxMjE2MDIyMDQxWhcNMjAxMjE0MDIyMDQxWjAtMQ4wDAYDVQQKEwVGbHlubjEb\nMBkGA1UECxMSRmx5bm4gRXBoZW1lcmFsIENBMIIBIjANBgkqhkiG9w0BAQEFAAOC\nAQ8AMIIBCgKCAQEAn+KUccUSVeWoJZTlOxqaiXacGECGAPETxfmnL9ep1rA/4DWi\n2OTpZoeSFdyL1yV5KJxPkq6XMNyl/BR72SOomCmoFRnZzDih//+gfuJAFVGaF1j9\nFOIX+VyO8jyFzqk2vZg9R+ncRyFgjEgpHn0gDdt4WLWDxPpfFMClEZU6Mpu02ngj\n1kmlNgzajl71qhhKtrv3W7ACKh6O3fMSBg4n/ZiVnVQjdkejHskV5R43FH4bpZzP\nhb82rI6FNBNOCKqwbQ/AdGGVvJSzXPypvzCMkGghhx8pckoZw7DONXhSojfIO6Kt\nlxUYO1Odmnb+nyJjxGyidSperhfm+CuSFPn2BwIDAQABoyMwITAOBgNVHQ8BAf8E\nBAMCAAYwDwYDVR0TAQH/BAUwAwEB/zALBgkqhkiG9w0BAQsDggEBAGvEqq1ko+pE\nS5RBHmTWW6mJom9rA+aii9n88lMhbdjikeVFkQkH6Qi8zR5O4hCdDUC4qYUp+rIF\nZ4XZ9Ogl4CcR1gEPGu1KX2EnjVKloS1LThugCuP5YJgQ5qoMsQs681s1ZpPd/0gh\ntjASQy1Y72wY1SxVWqJzkuzf8mMDg52I4wwD9Eif2zq1/+sJa9mdilhvd0Wp+hDV\n6qN6xbH65V2VKwDrkD2p7CIn3NmknYhmw+obezqRkSl6N5Is/QPVg59bOu0evWfS\nDyaOehm1EmmRVehNj8IR0noFwUMbIASnpTescLd4Nz9pEjbgHQ+m6Swe8hnaZ3dd\n1TvxABm/4VY=\n-----END CERTIFICATE-----\n",
    368. "DATABASE_URL": "postgres://df60a79e03b92c3157aaad47dab10278:623f1831ed89cd811ea1da0fb985bd81@leader.postgres.discoverd:5432/33c5b220c9eed7307d65a2b367236d10",
    369. "DEFAULT_ROUTE_DOMAIN": "dev.localflynn.com",
    370. "FLYNN_POSTGRES": "postgres",
    371. "NAME_SEED": "e53b1785be43a8569707",
    372. "PGDATABASE": "33c5b220c9eed7307d65a2b367236d10",
    373. "PGHOST": "leader.postgres.discoverd",
    374. "PGPASSWORD": "623f1831ed89cd811ea1da0fb985bd81",
    375. "PGUSER": "df60a79e03b92c3157aaad47dab10278"
    376. },
    377. "processes": {
    378. "scheduler": {
    379. "cmd": [
    380. "scheduler"
    381. ],
    382. "ports": [
    383. {
    384. "port": 0,
    385. "proto": "tcp"
    386. }
    387. ],
    388. "omni": true,
    389. "service": "controller-scheduler",
    390. "resurrect": true,
    391. "resources": {
    392. "max_fd": {
    393. "request": 10000,
    394. "limit": 10000
    395. },
    396. "memory": {
    397. "request": 1073741824,
    398. "limit": 1073741824
    399. }
    400. }
    401. },
    402. "web": {
    403. "cmd": [
    404. "controller"
    405. ],
    406. "ports": [
    407. {
    408. "port": 80,
    409. "proto": "tcp"
    410. }
    411. ],
    412. "resurrect": true,
    413. "resources": {
    414. "max_fd": {
    415. "request": 10000,
    416. "limit": 10000
    417. },
    418. "memory": {
    419. "request": 1073741824,
    420. "limit": 1073741824
    421. }
    422. }
    423. },
    424. "worker": {
    425. "cmd": [
    426. "worker"
    427. ],
    428. "ports": [
    429. {
    430. "port": 0,
    431. "proto": "tcp"
    432. }
    433. ],
    434. "resources": {
    435. "max_fd": {
    436. "request": 10000,
    437. "limit": 10000
    438. },
    439. "memory": {
    440. "request": 1073741824,
    441. "limit": 1073741824
    442. }
    443. }
    444. }
    445. }
    446. },
    447. "artifact": {
    448. "id": "c8400666-26d9-493f-9630-3d34045f8498",
    449. "type": "docker",
    450. "uri": "https://dl.flynn.io/tuf?name=flynn/controller&id=38242063cc75f2f6e3cfc15ce44899d103191c0be9b11403e44ee4bf4749db72"
    451. },
    452. "processes": {
    453. "scheduler": 1,
    454. "web": 1,
    455. "worker": 1
    456. },
    457. "updated_at": "2015-12-16T02:20:44.205169Z"
    458. },
    459. {
    460. "app": {
    461. "id": "4940a4fe-3acc-4be7-aa97-7c3f982ba552",
    462. "name": "discoverd",
    463. "meta": null
    464. },
    465. "release": {
    466. "id": "dd6a3a63-a920-4954-8a0b-7f6e9e4e1b79",
    467. "artifact": "b2b4c646-aef0-4b3b-a501-cd282c31299e",
    468. "env": {
    469. "DISCOVERD": "none",
    470. "DISCOVERD_PEERS": "10.0.2.15:1111,"
    471. },
    472. "processes": {
    473. "app": {
    474. "ports": [
    475. {
    476. "port": 1111,
    477. "proto": "tcp"
    478. },
    479. {
    480. "port": 53,
    481. "proto": "tcp"
    482. }
    483. ],
    484. "data": true,
    485. "omni": true,
    486. "host_network": true,
    487. "service": "discoverd",
    488. "resurrect": true,
    489. "resources": {
    490. "max_fd": {
    491. "request": 10000,
    492. "limit": 10000
    493. },
    494. "memory": {
    495. "request": 1073741824,
    496. "limit": 1073741824
    497. }
    498. }
    499. }
    500. }
    501. },
    502. "artifact": {
    503. "id": "b2b4c646-aef0-4b3b-a501-cd282c31299e",
    504. "type": "docker",
    505. "uri": "https://dl.flynn.io/tuf?name=flynn/discoverd&id=da0bd1401a6df09efb904a852992cd3a19b657223347bad6b427350e52c254a4"
    506. },
    507. "processes": {
    508. "app": 1
    509. },
    510. "updated_at": "2015-12-16T02:20:44.193653Z"
    511. },
    512. {
    513. "app": {
    514. "id": "291b591e-ea67-4393-9dd8-f8b8f79ea34c",
    515. "name": "flannel",
    516. "meta": null
    517. },
    518. "release": {
    519. "id": "ce17ef61-be09-4f60-b12d-d8aa87eb0a82",
    520. "artifact": "172410eb-4e75-4597-a366-efe596b0af27",
    521. "env": {
    522. "DISCOVERD": "none"
    523. },
    524. "processes": {
    525. "app": {
    526. "ports": [
    527. {
    528. "port": 5002,
    529. "proto": "tcp"
    530. }
    531. ],
    532. "omni": true,
    533. "host_network": true,
    534. "resurrect": true,
    535. "resources": {
    536. "max_fd": {
    537. "request": 10000,
    538. "limit": 10000
    539. },
    540. "memory": {
    541. "request": 1073741824,
    542. "limit": 1073741824
    543. }
    544. }
    545. }
    546. }
    547. },
    548. "artifact": {
    549. "id": "172410eb-4e75-4597-a366-efe596b0af27",
    550. "type": "docker",
    551. "uri": "https://dl.flynn.io/tuf?name=flynn/flannel&id=7d6c9acf4dc854210cc753c6a8c889899200b35fd45f50fb35d1bb9189c92510"
    552. },
    553. "processes": {
    554. "app": 1
    555. },
    556. "updated_at": "2015-12-16T02:20:44.170687Z"
    557. },
    558. {
    559. "app": {
    560. "id": "2b18fac0-cb75-4243-ba0e-1a96d5e2ddda",
    561. "name": "postgres",
    562. "meta": null
    563. },
    564. "release": {
    565. "id": "6244ff18-44a3-4db1-a0d4-ceab0abded24",
    566. "artifact": "e3e69c33-dd0c-4381-b9a9-30cf0c417ce7",
    567. "env": {
    568. "FLYNN_POSTGRES": "postgres",
    569. "PGDATABASE": "postgres",
    570. "PGHOST": "leader.postgres.discoverd",
    571. "PGPASSWORD": "2b12bf3d5a0bfae0ed5723947e21af7b",
    572. "PGUSER": "flynn"
    573. },
    574. "processes": {
    575. "postgres": {
    576. "cmd": [
    577. "postgres"
    578. ],
    579. "env": {
    580. "SINGLETON": "true"
    581. },
    582. "ports": [
    583. {
    584. "port": 5432,
    585. "proto": "tcp"
    586. }
    587. ],
    588. "data": true,
    589. "service": "postgres",
    590. "resurrect": true,
    591. "resources": {
    592. "max_fd": {
    593. "request": 10000,
    594. "limit": 10000
    595. },
    596. "memory": {
    597. "request": 1073741824,
    598. "limit": 1073741824
    599. }
    600. }
    601. },
    602. "web": {
    603. "cmd": [
    604. "api"
    605. ],
    606. "ports": [
    607. {
    608. "port": 80,
    609. "proto": "tcp"
    610. }
    611. ],
    612. "resources": {
    613. "max_fd": {
    614. "request": 10000,
    615. "limit": 10000
    616. },
    617. "memory": {
    618. "request": 1073741824,
    619. "limit": 1073741824
    620. }
    621. }
    622. }
    623. }
    624. },
    625. "artifact": {
    626. "id": "e3e69c33-dd0c-4381-b9a9-30cf0c417ce7",
    627. "type": "docker",
    628. "uri": "https://dl.flynn.io/tuf?name=flynn/postgresql&id=7447010d0a300f45d6785bb6cef4858500821d7afcb8febaabefbe55bf03fd0f"
    629. },
    630. "processes": {
    631. "postgres": 1,
    632. "web": 1
    633. },
    634. "updated_at": "2015-12-16T02:20:44.152134Z"
    635. }
    636. ]

    部署

    https://flynn.io/schema/controller/deployment#

    属性 类型 描述
    id uuid string 唯一标示
    app uuid string 唯一标示
    old_release object 唯一标示
    new_release date-time string 唯一标示
    status date-time string pending running complete failed
    strategy uuid string all-at-once one-by-one postgres discoverd-meta
    processes uuid string 每种进程运行的进程数
    deploy_timeout integer 部署超时时间(默认30秒)
    created_at date-time string 对象的创建时间
    finished_at date-time string
    name string null
    url url string null

    创建部署

    实例:—————————————————————请求————————————————————

    POST /apps/7406a4d71a0c43d3ac4b39f006cb0342/deploy HTTP/1.1
    Authorization: Basic OnMzY3IzdA==
    Content-Type: application/json
    
    {
      "id": "40202cf3b0e946a4b2c4db42a0c14194"
    }
    

    —————————————————————响应————————————————————

    Content-Type: application/json
    
    {
      "id": "ccef998b56374bca8d4c402c655b4534",
      "app": "7406a4d71a0c43d3ac4b39f006cb0342",
      "old_release": "689ce5b9ad1541ab975d51cba1e051d0",
      "new_release": "40202cf3b0e946a4b2c4db42a0c14194",
      "strategy": "all-at-once",
      "created_at": "2015-01-29T18:53:26.927187Z"
    }
    

    获取部署

    实例:—————————————————————请求————————————————————

    GET /deployments/aab1ee14-776d-4ba4-979b-1b4bda2d9b35 HTTP/1.1
    Authorization: Basic OnMzY3IzdA==
    Content-Type: application/json
    

    —————————————————————响应————————————————————

    Content-Type: application/json
    
    {
      "id": "aab1ee14-776d-4ba4-979b-1b4bda2d9b35",
      "app": "adcccdb4-b1a4-4209-a03a-762f4e021632",
      "old_release": "47154f8c-a604-469d-ae6a-e431990ddee8",
      "new_release": "77e9e956-ecf9-427f-a031-222c2f394fb8",
      "strategy": "all-at-once",
      "status": "pending",
      "processes": {
        "foo": 1
      },
      "deploy_timeout": 30,
      "created_at": "2015-12-16T02:21:16.782263Z"
    }
    

    列出所有部署

    实例:—————————————————————请求————————————————————

    GET /apps/adcccdb4-b1a4-4209-a03a-762f4e021632/deployments HTTP/1.1
    Authorization: Basic OnMzY3IzdA==
    Content-Type: application/json
    

    —————————————————————响应————————————————————

    Content-Type: application/json
    
    [
      {
        "id": "aab1ee14-776d-4ba4-979b-1b4bda2d9b35",
        "app": "adcccdb4-b1a4-4209-a03a-762f4e021632",
        "old_release": "47154f8c-a604-469d-ae6a-e431990ddee8",
        "new_release": "77e9e956-ecf9-427f-a031-222c2f394fb8",
        "strategy": "all-at-once",
        "status": "pending",
        "processes": {
          "foo": 1
        },
        "deploy_timeout": 30,
        "created_at": "2015-12-16T02:21:16.782263Z"
      }
    ]
    

    新任务

    新任务描述了一个所需流程配置https://flynn.io/schema/controller/new_job#

    属性 类型 描述
    release uuid string 唯一标示
    cmd array of strings shell命令
    entrypoint array of strings
    env object 环境变量
    meta object 客户端指定元数据
    tty boolean 初始化tty会话
    tty_columns integer tty中的列数
    tty_lines integer tty中的行数
    release_env boolean 包括版本环境
    disable_log boolean 不拷贝标准输入/输出到日志流中
    resources object 资源请求和限制

    运行任务

    实例:—————————————————————请求————————————————————

    POST /apps/7406a4d71a0c43d3ac4b39f006cb0342/jobs HTTP/1.1
    Authorization: Basic OnMzY3IzdA==
    Content-Type: application/json
    
    {
      "release": "40202cf3b0e946a4b2c4db42a0c14194",
      "cmd": [
        "echo",
        "$BODY"
      ],
      "env": {
        "BODY": "Hello!"
      }
    }
    

    —————————————————————响应————————————————————

    Content-Type: application/json
    
    {
      "id": "flynn-cef74685c83b47889c69fa95451e75b3",
      "release": "40202cf3b0e946a4b2c4db42a0c14194",
      "cmd": [
        "echo",
        "$BODY"
      ]
    }
    

    任务

    一个任务就是容器中的一个单进程。https://flynn.io/schema/controller/job#

    属性 类型 描述
    id uuid string 唯一标示
    app uuid string 唯一标示
    release uuid string 唯一标示
    type string 进程类型名字
    state string 客户端指定元数据
    cmd array of strings shell命令
    meta object 客户端指定元数据
    exit_status integer 任务退出状态
    created_at date-time string 对象创建时间
    updated_at date-time string 对象最新更新时间

    获取任务列表

    实例:—————————————————————请求————————————————————

    GET /apps/7406a4d71a0c43d3ac4b39f006cb0342/jobs HTTP/1.1
    Authorization: Basic OnMzY3IzdA==
    Content-Type: application/json
    

    —————————————————————响应————————————————————

    Content-Type: application/jsonb
    
    [
      {
        "id": "flynn-68940e0fe9664ce0b369baaeb10b4cc4",
        "app": "7406a4d71a0c43d3ac4b39f006cb0342",
        "release": "40202cf3b0e946a4b2c4db42a0c14194",
        "type": "foo",
        "state": "starting",
        "created_at": "2015-01-29T18:53:28.595924Z",
        "updated_at": "2015-01-29T18:53:28.595924Z"
      },
      {
        "id": "flynn-cef74685c83b47889c69fa95451e75b3",
        "app": "7406a4d71a0c43d3ac4b39f006cb0342",
        "release": "40202cf3b0e946a4b2c4db42a0c14194",
        "state": "starting",
        "created_at": "2015-01-29T18:53:27.81058Z",
        "updated_at": "2015-01-29T18:53:27.81058Z"
      },
      {
        "id": "flynn-c96be7a9527047e4b11e3c19d3bef904",
        "app": "7406a4d71a0c43d3ac4b39f006cb0342",
        "release": "689ce5b9ad1541ab975d51cba1e051d0",
        "type": "foo",
        "state": "crashed",
        "created_at": "2015-01-29T18:53:26.933346Z",
        "updated_at": "2015-01-29T18:53:27.954494Z"
      }
    ]
    

    更新任务

    实例:—————————————————————请求————————————————————

    PUT /apps/7406a4d71a0c43d3ac4b39f006cb0342/jobs/flynn-cef74685c83b47889c69fa95451e75b3 HTTP/1.1
    Authorization: Basic OnMzY3IzdA==
    Content-Type: application/
    
    {
      "id": "flynn-cef74685c83b47889c69fa95451e75b3",
      "app": "7406a4d71a0c43d3ac4b39f006cb0342",
      "release": "40202cf3b0e946a4b2c4db42a0c14194",
      "state": "down"
    }
    

    —————————————————————响应————————————————————

    Content-Type: application/json
    
    {
      "id": "flynn-cef74685c83b47889c69fa95451e75b3",
      "app": "7406a4d71a0c43d3ac4b39f006cb0342",
      "release": "40202cf3b0e946a4b2c4db42a0c14194",
      "state": "down",
      "created_at": "2015-01-29T18:53:27.81058Z",
      "updated_at": "2015-01-29T18:53:28.723854Z"
    }
    

    获取任务

    实例:—————————————————————请求————————————————————

    GET /apps/adcccdb4-b1a4-4209-a03a-762f4e021632/jobs/host-40cc2d07-7a48-4fda-9790-ba9768a3f616 HTTP/1.1
    Authorization: Basic OnMzY3IzdA==
    Content-Type: application/json
    

    —————————————————————响应————————————————————

    Content-Type: application/json
    
    {
      "id": "host-40cc2d07-7a48-4fda-9790-ba9768a3f616",
      "app": "adcccdb4-b1a4-4209-a03a-762f4e021632",
      "release": "77e9e956-ecf9-427f-a031-222c2f394fb8",
      "state": "down",
      "created_at": "2015-12-16T02:21:16.799294Z",
      "updated_at": "2015-12-16T02:21:16.811094Z"
    }
    

    删除任务

    实例:—————————————————————请求————————————————————

    DELETE /apps/7406a4d71a0c43d3ac4b39f006cb0342/jobs/flynn-cef74685c83b47889c69fa95451e75b3 HTTP/1.1
    Authorization: Basic OnMzY3IzdA==
    Content-Type: application/json
    

    —————————————————————响应————————————————————

    Content-Type: text/plain; charset=utf-8
    

    端口

    https://flynn.io/schema/controller/port#

    属性 类型 描述
    port integer null
    proto string tcp udp

    进程类型

    https://flynn.io/schema/controller/process_type#

    属性 类型 描述
    cmd array of strings shell命令
    env object 环境变量
    entrypoint array of strings null
    ports array of objects null
    ports[].port integer null
    ports[].proto string null
    data boolean null
    omni boolean null

    提供程序

    https://flynn.io/schema/controller/provider#

    属性 类型 描述
    id uuid string 唯一标识符
    created_at date-time string 对象的创建时间戳
    updated_at date-time string 对象最后更新的时间戳
    name string null
    url uri string null

    创建提供程序

    实例:—————————————————————请求————————————————————

    POST /providers HTTP/1.1
    Authorization: Basic OnMzY3IzdA==
    Content-Type: application/json
    
    {
      "url": "http://example-provider-1422557608732167310.discoverd:12345/providers/1422557608732167310",
      "name": "example-provider-1422557608732167310"
    }
    

    —————————————————————响应————————————————————

    Content-Type: application/json
    
    {
      "id": "7277db2655e44b4ba7128ff5ff01a0ff",
      "url": "http://example-provider-1422557608732167310.discoverd:12345/providers/1422557608732167310",
      "name": "example-provider-1422557608732167310",
      "created_at": "2015-01-29T18:53:28.733018Z",
      "updated_at": "2015-01-29T18:53:28.733018Z"
    }
    

    获取提供程序

    实例:—————————————————————请求————————————————————

    GET /providers/7277db2655e44b4ba7128ff5ff01a0ff HTTP/1.1
    Authorization: Basic OnMzY3IzdA==
    Content-Type: application/json
    

    —————————————————————响应————————————————————

    Content-Type: application/json
    
    {
      "id": "7277db2655e44b4ba7128ff5ff01a0ff",
      "url": "http://example-provider-1422557608732167310.discoverd:12345/providers/1422557608732167310",
      "name": "example-provider-1422557608732167310",
      "created_at": "2015-01-29T18:53:28.733018Z",
      "updated_at": "2015-01-29T18:53:28.733018Z"
    }
    

    获取提供程序列表

    实例:—————————————————————请求————————————————————

    GET /providers HTTP/1.1
    Authorization: Basic OnMzY3IzdA==
    Content-Type: application/json
    

    —————————————————————响应————————————————————

    Content-Type: application/json
    
    [
      {
        "id": "7277db2655e44b4ba7128ff5ff01a0ff",
        "url": "http://example-provider-1422557608732167310.discoverd:12345/providers/1422557608732167310",
        "name": "example-provider-1422557608732167310",
        "created_at": "2015-01-29T18:53:28.733018Z",
        "updated_at": "2015-01-29T18:53:28.733018Z"
      },
      {
        "id": "d9ba709dc3e7413db3cba9b86e7cf325",
        "url": "http://pg-api.discoverd/databases",
        "name": "postgres",
        "created_at": "2015-01-29T18:53:20.031975Z",
        "updated_at": "2015-01-29T18:53:20.031975Z"
      }
    ]
    

    版本

    https://flynn.io/schema/controller/release#

    属性 类型 描述
    id uuid string 唯一标识
    artifact uuid string 唯一标识
    meta object 客户指定元数据
    env object 环境变量
    processes object
    created_at object 对象的创建时间戳

    获取应用初始化版本

    实例:—————————————————————请求————————————————————

    GET /apps/gitreceive/release HTTP/1.1
    Authorization: Basic OnMzY3IzdA==
    Content-Type: application/json
    

    —————————————————————响应————————————————————

    Content-Type: application/json
    
    {
      "id": "8a9760deeba7486c987267196edd9032",
      "artifact": "74010365c551463386bae39cf4ad0a47",
      "processes": {
        "app": {
          "env": {
            "CONTROLLER_AUTH_KEY": "s3cr3t",
            "SLUGBUILDER_IMAGE_URI": "https://registry.hub.docker.com/flynn/slugbuilder?id=a4a8a9489eacbad331ced4ad5b4b63238c7592d42d30b04058aac914912344f3",
            "SLUGRUNNER_IMAGE_URI": "https://registry.hub.docker.com/flynn/slugrunner?id=039222f9884412eb0667988933caeb0ed06da28f71e3dff540a61d13d0d85ae0",
            "SSH_PRIVATE_KEYS": "-----BEGIN RSA PRIVATE KEY-----\nMIIEpAIBAAKCAQEAvVM5o2jcAO9qN/Bza+omOXxqJlPySHkxGEmpBBGOJ/thjF63\njrx4nsDAYB8x5fkVYNR4QPqIEfAAvvRAK1walOPrvPcrtp/TAD1csYYADIj11gs7\nD5VcNo46H9gc8Bw7ZQN+vB20/ZfhjdJHVVS3oi1co74rBIwEQq3FEQUTMEsLESJb\nzr4JqllKq4VsDHUqxEcIUVllnt0l/3Y1ou9kp2s0EGIzbGL8W0ku8V+PrG3/3iI9\n8eEQ043hawSrQTYY8zCQxQvss3GlKpMQDT4y14gS6gnD6F9Xf26ZOqVvkezshDtR\n8hrsSnaAB2JO3WCvu4101nE2Ahqm5SlogrL8rwIDAQABAoIBAG5b5wtEAophBK+a\n8A0FrkZwKYgyAtcQHfgkZ+tBOHZB6HjkdWc0obMYdIsTZAjECxwoffiSkWKzXhvx\nUL51r+D+gtnh0o9f1qUbH78zdy/XXkXowgKxc9ExUtxhI20rZ8vYH7YUMv5n3EjJ\nPF+XRHu6qXehUH4UCB++H1Nue+L3ulk9GViGO3/PXSbF0awVl3c2VKvgrGvMkgKP\nT+JH7KZj318m3DM+w4xGBpvhNAcTHf7+WXO+IToGect/be5aQ4dDycnp28Sb0vdR\nvgmMEMrP+AqkHiaduGWyXjWpLImdJoxqTZT9Y/XxIT4u9e4PEVcuC2QL0PinyY5C\nDS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joU07JN/mxYlk\nAfiET9Yqq5viMFr2ydOKXGlVU5khmjiOnA==\n-----END EC PRIVATE KEY-----\n"
          },
          "ports": [
            {
              "port": 0,
              "proto": "tcp",
              "range_end": 0
            }
          ]
        }
      },
      "created_at": "2015-01-29T18:53:22.471286Z"
    }
    

    设置应用版本

    实例:—————————————————————请求————————————————————

    PUT /apps/7406a4d71a0c43d3ac4b39f006cb0342/release HTTP/1.1
    Authorization: Basic OnMzY3IzdA==
    Content-Type: application/json
    
    {
      "id": "689ce5b9ad1541ab975d51cba1e051d0"
    }
    

    —————————————————————响应————————————————————

    Content-Type: application/json
    

    获取应用版本

    实例:—————————————————————请求————————————————————

    GET /apps/7406a4d71a0c43d3ac4b39f006cb0342/release HTTP/1.1
    Authorization: Basic OnMzY3IzdA==
    Content-Type: application/json
    

    —————————————————————响应————————————————————

    Content-Type: application/json
    
    {
      "id": "689ce5b9ad1541ab975d51cba1e051d0",
      "artifact": "4d365e6cdb1d47b8b98c9cd9a7b047fd",
      "env": {
        "some": "info"
      },
      "processes": {
        "foo": {
          "cmd": [
            "ls",
            "-l"
          ],
          "env": {
            "BAR": "baz"
          }
        }
      },
      "created_at": "2015-01-29T18:53:26.89224Z"
    }
    

    创建版本

    实例:—————————————————————请求————————————————————

    POST /releases HTTP/1.1
    Authorization: Basic OnMzY3IzdA==
    Content-Type: application/json
    
    {
      "artifact": "4d365e6cdb1d47b8b98c9cd9a7b047fd",
      "env": {
        "some": "info"
      },
      "processes": {
        "foo": {
          "cmd": [
            "ls",
            "-l"
          ],
          "env": {
            "BAR": "baz"
          }
        }
      }
    }
    

    —————————————————————响应————————————————————

    Content-Type: application/json
    
    {
      "id": "689ce5b9ad1541ab975d51cba1e051d0",
      "artifact": "4d365e6cdb1d47b8b98c9cd9a7b047fd",
      "env": {
        "some": "info"
      },
      "processes": {
        "foo": {
          "cmd": [
            "ls",
            "-l"
          ],
          "env": {
            "BAR": "baz"
          }
        }
      },
      "created_at": "2015-01-29T18:53:26.89224Z"
    }
    

    获取版本列表

    实例:—————————————————————请求————————————————————

    GET /releases HTTP/1.1
    Authorization: Basic OnMzY3IzdA==
    Content-Type: application/json
    

    —————————————————————响应————————————————————

    Content-Type: application/json
    
    [
      {
        "id": "689ce5b9ad1541ab975d51cba1e051d0",
        "artifact": "4d365e6cdb1d47b8b98c9cd9a7b047fd",
        "env": {
          "some": "info"
        },
        "processes": {
          "foo": {
            "cmd": [
              "ls",
              "-l"
            ],
            "env": {
              "BAR": "baz"
            }
          }
        },
        "created_at": "2015-01-29T18:53:26.89224Z"
      },
      {
        "id": "258c9a2f43124c76b85ba24fa127dc3b",
        "artifact": "8b6548e25bc8477e905deee8a33eab2a",
        "env": {
          "APP_NAME": "dashboard",
          "CA_CERT": "-----BEGIN CERTIFICATE-----\nMIIC5DCCAc6gAwIBAgIRAL1sRMV4diGUf9Lztaw9/OkwCwYJKoZIhvcNAQELMB0x\nDjAMBgNVBAoTBUZseW5uMQswCQYDVQQLEwJDQTAeFw0xNTAxMjkxODUzMjNaFw0y\nMDAxMjgxODUzMjNaMB0xDjAMBgNVBAoTBUZseW5uMQswCQYDVQQLEwJDQTCCASIw\nDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJeMZ5RC7Aan+JImyIDEN4dfikjO\nr323YWPdYiLM7bi/o4x6Lp2+LOeeV+1Y7xky3gybuekBtNveEp6wHg3pqXCvAfxV\nQ4EGDXs0/9RyXNCgHsiDmnftB1OtmjPTZjtbgDWVhkJZcq1X6hlcTgD9rs1HOVmg\n7m/gPCa0avI30QTajb2/DBQbKIQovY7vcQLaPbhqknVK1WZoCnxDomT0ueFllD8h\n6p/sJ5qk/ZQF2WL8gL9elQOUm/K7jUjkfLbHN3hzx2QQgNqlTDKMgPApMri5UjUa\nnxdLoYOPiUj0QZmMyZkaYwG0cyGp/8MuEzY6F/dgSEt1gemS5lGI7s+TDNECAwEA\nAaMjMCEwDgYDVR0PAQH/BAQDAgAGMA8GA1UdEwEB/wQFMAMBAf8wCwYJKoZIhvcN\nAQELA4IBAQAjiAj10RbsCxzp0wp79g/BLRaYcypFWnjenn6aWUD2pvc7oK2n8XX1\nbhSym0O4aUlTbx1lc+N4R+MI/Hx83MPFEMXNoLGMnwZ+6IxYKuoXnqt6rFdm2kh4\nOUABwknyNx4jLFniAEIlPa+fcbHacgJtkxm85OpdW9kVrZU3Af7NaXl9u1TDJ0ww\nwtOlMRGBMByuKxU5zwXBz28rgmBIZ2F3w5guZxnNUDKuk8z9WIowJumB+DymDYxh\nSSAfL2jHwdDBeZK5XMmXRobWpf4oSm2z6Nx+0RWHms8tKTQXUDOlwLdMMho1jj/l\nJAvqe8tmpQBg90lc3bCCLmaeJG3nkfSA\n-----END CERTIFICATE-----\n",
          "CONTROLLER_DOMAIN": "controller.dev.localflynn.com",
          "CONTROLLER_KEY": "s3cr3t",
          "DEFAULT_ROUTE_DOMAIN": "dev.localflynn.com",
          "LOGIN_TOKEN": "a9b51e131d3f444074aa35425eb8fdc3",
          "SECURE_COOKIES": "true",
          "SESSION_SECRET": "4fd6d9c447b02a5e3b8d03ab818652d9",
          "STATIC_PATH": "/app",
          "URL": "https://dashboard.dev.localflynn.com"
        },
        "processes": {
          "web": {
            "ports": [
              {
                "port": 80,
                "proto": "tcp",
                "range_end": 0
              }
            ]
          }
        },
        "created_at": "2015-01-29T18:53:25.003718Z"
      },
      {
        "id": "b9aa14dd9fbe4ea6a06acd88da3b3c80",
        "artifact": "03f9d97aeab94f2b9bb23f4ade0eb270",
        "env": {
          "CONTROLLER_AUTH_KEY": "s3cr3t",
          "SLUGBUILDER_IMAGE_URI": "https://registry.hub.docker.com/flynn/slugbuilder?id=a4a8a9489eacbad331ced4ad5b4b63238c7592d42d30b04058aac914912344f3",
          "SLUGRUNNER_IMAGE_URI": "https://registry.hub.docker.com/flynn/slugrunner?id=039222f9884412eb0667988933caeb0ed06da28f71e3dff540a61d13d0d85ae0"
        },
        "created_at": "2015-01-29T18:53:24.986924Z"
      },
      {
        "id": "8a9760deeba7486c987267196edd9032",
        "artifact": "74010365c551463386bae39cf4ad0a47",
        "processes": {
          "app": {
            "env": {
              "CONTROLLER_AUTH_KEY": "s3cr3t",
              "SLUGBUILDER_IMAGE_URI": "https://registry.hub.docker.com/flynn/slugbuilder?id=a4a8a9489eacbad331ced4ad5b4b63238c7592d42d30b04058aac914912344f3",
              "SLUGRUNNER_IMAGE_URI": "https://registry.hub.docker.com/flynn/slugrunner?id=039222f9884412eb0667988933caeb0ed06da28f71e3dff540a61d13d0d85ae0",
              "SSH_PRIVATE_KEYS": "-----BEGIN RSA PRIVATE KEY-----\nMIIEpAIBAAKCAQEAvVM5o2jcAO9qN/Bza+omOXxqJlPySHkxGEmpBBGOJ/thjF63\njrx4nsDAYB8x5fkVYNR4QPqIEfAAvvRAK1walOPrvPcrtp/TAD1csYYADIj11gs7\nD5VcNo46H9gc8Bw7ZQN+vB20/ZfhjdJHVVS3oi1co74rBIwEQq3FEQUTMEsLESJb\nzr4JqllKq4VsDHUqxEcIUVllnt0l/3Y1ou9kp2s0EGIzbGL8W0ku8V+PrG3/3iI9\n8eEQ043hawSrQTYY8zCQxQvss3GlKpMQDT4y14gS6gnD6F9Xf26ZOqVvkezshDtR\n8hrsSnaAB2JO3WCvu4101nE2Ahqm5SlogrL8rwIDAQABAoIBAG5b5wtEAophBK+a\n8A0FrkZwKYgyAtcQHfgkZ+tBOHZB6HjkdWc0obMYdIsTZAjECxwoffiSkWKzXhvx\nUL51r+D+gtnh0o9f1qUbH78zdy/XXkXowgKxc9ExUtxhI20rZ8vYH7YUMv5n3EjJ\nPF+XRHu6qXehUH4UCB++H1Nue+L3ulk9GViGO3/PXSbF0awVl3c2VKvgrGvMkgKP\nT+JH7KZj318m3DM+w4xGBpvhNAcTHf7+WXO+IToGect/be5aQ4dDycnp28Sb0vdR\nvgmMEMrP+AqkHiaduGWyXjWpLImdJoxqTZT9Y/XxIT4u9e4PEVcuC2QL0PinyY5C\nDSq20iECgYEA6dJaAcpeKMRcr4cVxogC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r2ydOKXGlVU5khmjiOnA==\n-----END EC PRIVATE KEY-----\n"
            },
            "ports": [
              {
                "port": 0,
                "proto": "tcp",
                "range_end": 0
              }
            ]
          }
        },
        "created_at": "2015-01-29T18:53:22.471286Z"
      },
      {
        "id": "2222dd828450483d96b425b8b1294040",
        "artifact": "73d37c1bdacd432f9e5c3cbe121c365e",
        "processes": {
          "app": {
            "cmd": [
              "-httpaddr",
              ":80",
              "-httpsaddr",
              ":443",
              "-tcp-range-start",
              "3000",
              "-tcp-range-end",
              "3500"
            ],
            "omni": true,
            "host_network": true
          }
        },
        "created_at": "2015-01-29T18:53:21.730018Z"
      },
      {
        "id": "e48208857b6e42c1baaba738e766ec7e",
        "artifact": "afe339ec9a0f46b28cfa5dff383e5179",
        "env": {
          "FLYNN_POSTGRES": "pg",
          "PGDATABASE": "c69edca77f27f07c70f10521dc1b9271",
          "PGPASSWORD": "5883fcfe1603a1bc54883cab0e835b6e",
          "PGUSER": "af3dd154197bb764a5fb377fa6d39f31"
        },
        "processes": {
          "web": {
            "ports": [
              {
                "port": 80,
                "proto": "tcp",
                "range_end": 0
              }
            ]
          }
        },
        "created_at": "2015-01-29T18:53:21.713992Z"
      },
      {
        "id": "fdaba774be0a4332bfb5be1d440cdc60",
        "artifact": "61b804fd0f9c42359ac8d8e3131d16bf",
        "processes": {
          "postgres": {
            "cmd": [
              "postgres"
            ],
            "ports": [
              {
                "port": 5432,
                "proto": "tcp",
                "range_end": 0
              }
            ],
            "data": true
          },
          "web": {
            "cmd": [
              "api"
            ],
            "ports": [
              {
                "port": 80,
                "proto": "tcp",
                "range_end": 0
              }
            ]
          }
        },
        "created_at": "2015-01-29T18:53:20.058243Z"
      },
      {
        "id": "a665aa801cbb45f4a41831b66416f4b9",
        "artifact": "1b7c8dcfd0b14755a452367e5f6723b6",
        "env": {
          "AUTH_KEY": "s3cr3t",
          "BACKOFF_PERIOD": "",
          "DEFAULT_ROUTE_DOMAIN": "dev.localflynn.com",
          "FLYNN_POSTGRES": "pg",
          "NAME_SEED": "f09d8d597f0a39acf991",
          "PGDATABASE": "51b7cf0edd53ca6921147823f40737eb",
          "PGPASSWORD": "4bbb7b6bdff41444d876e02e9bfc7133",
          "PGUSER": "f331aec77952871eeec5f7b5f16253bd"
        },
        "processes": {
          "deployer": {
            "cmd": [
              "deployer"
            ]
          },
          "scheduler": {
            "cmd": [
              "scheduler"
            ],
            "omni": true
          },
          "web": {
            "cmd": [
              "controller"
            ],
            "ports": [
              {
                "port": 80,
                "proto": "tcp",
                "range_end": 0
              }
            ]
          }
        },
        "created_at": "2015-01-29T18:53:20.02833Z"
      }
    ]
    

    资源请求

    https://flynn.io/schema/controller/resource_req#

    属性 类型 描述
    apps array of uuid string
    config object

    创建资源

    实例:—————————————————————请求————————————————————

    POST /providers/7277db2655e44b4ba7128ff5ff01a0ff/resources HTTP/1.1
    Authorization: Basic OnMzY3IzdA==
    Content-Type: application/json
    
    {
      "config": {
      }
    }
    

    —————————————————————响应————————————————————

    Content-Type: application/json
    
    {
      "id": "5489d2758d9b452783de686c0ca5fe9d",
      "provider": "7277db2655e44b4ba7128ff5ff01a0ff",
      "env": {
        "some": "data"
      },
      "created_at": "2015-01-29T18:53:28.757571Z"
    }
    

    资源

    https://flynn.io/schema/controller/resource#

    属性 类型 描述
    id uuid string 唯一标示
    provider uuid string 唯一标示
    external_id uuid string 唯一标示
    env object 环境变量
    apps array of uuid strings
    created_at date-time string 对象创建时间

    添加资源

    实例:—————————————————————请求————————————————————

    PUT /providers/0952f692-2667-4be0-a159-9d68382a262c/resources/cc9f3342-bed0-4ed3-840e-c462e05808c6 HTTP/1.1
    Authorization: Basic OnMzY3IzdA==
    Content-Type: application/json
    
    {
      "id": "cc9f3342-bed0-4ed3-840e-c462e05808c6",
      "provider": "0952f692-2667-4be0-a159-9d68382a262c",
      "external_id": "/foo/bar",
      "env": {
        "FOO": "BAR"
      },
      "apps": [
        "adcccdb4-b1a4-4209-a03a-762f4e021632"
      ]
    }
    

    —————————————————————响应————————————————————

    Content-Type: application/json
    
    {
      "id": "cc9f3342-bed0-4ed3-840e-c462e05808c6",
      "provider": "0952f692-2667-4be0-a159-9d68382a262c",
      "external_id": "/foo/bar",
      "env": {
        "FOO": "BAR"
      },
      "apps": [
        "adcccdb4-b1a4-4209-a03a-762f4e021632"
      ],
      "created_at": "2015-12-16T02:21:16.838613Z"
    }
    

    列出应用资源

    实例:—————————————————————请求————————————————————

    GET /apps/7406a4d71a0c43d3ac4b39f006cb0342/resources HTTP/1.1
    Authorization: Basic OnMzY3IzdA==
    Content-Type: application/json
    

    —————————————————————响应————————————————————

    Content-Type: application/json
    
    [
      {
        "id": "cc9f3342-bed0-4ed3-840e-c462e05808c6",
        "provider": "0952f692-2667-4be0-a159-9d68382a262c",
        "external_id": "/foo/bar",
        "env": {
          "FOO": "BAR"
        },
        "apps": [
          "adcccdb4-b1a4-4209-a03a-762f4e021632"
        ],
        "created_at": "2015-12-16T02:21:16.838613Z"
      }
    ]
    

    获取资源

    实例:—————————————————————请求————————————————————

    GET /providers/7277db2655e44b4ba7128ff5ff01a0ff/resources/5489d2758d9b452783de686c0ca5fe9d HTTP/1.1
    Authorization: Basic OnMzY3IzdA==
    Content-Type: application/json
    

    —————————————————————响应————————————————————

    Content-Type: application/json
    
    {
      "id": "5489d2758d9b452783de686c0ca5fe9d",
      "provider": "7277db2655e44b4ba7128ff5ff01a0ff",
      "env": {
        "some": "data"
      },
      "created_at": "2015-01-29T18:53:28.757571Z"
    }
    

    获取资源列表

    实例:—————————————————————请求————————————————————

    GET /providers/7277db2655e44b4ba7128ff5ff01a0ff/resources HTTP/1.1
    Authorization: Basic OnMzY3IzdA==
    Content-Type: application/json
    

    —————————————————————响应————————————————————

    Content-Type: application/json
    
    [
      {
        "id": "5489d2758d9b452783de686c0ca5fe9d",
        "provider": "7277db2655e44b4ba7128ff5ff01a0ff",
        "env": {
          "some": "data"
        },
        "created_at": "2015-01-29T18:53:28.757571Z"
      }
    ]
    

    删除资源

    实例:—————————————————————请求————————————————————

    DELETE /providers/0952f692-2667-4be0-a159-9d68382a262c/resources/ HTTP/1.1
    Authorization: Basic OnMzY3IzdA==
    Content-Type: application/json
    

    —————————————————————响应————————————————————

    Content-Type: text/plain; charset=utf-8
    

    路由

    https://flynn.io/schema/controller/route#

    属性 类型 描述
    id uuid string 唯一标示
    parent_ref uuid string 唯一标示
    type string
    service uuid string 唯一标示
    domain string 路由域名。仅适用于HTTP路由。
    tls_cert string 路由可选的TLS公证书。仅用于HTTP路由。
    tls_key string 路由可选的TLS私钥。仅用于HTTP路由。
    sticky boolean 无论路由是否使用粘性会话。仅用于HTTP路由。
    port integer TCP端口上监听TCP路由。
    created_at date-time string 对象创建的时间
    updated_at date-time string 对象最新更新时间

    创建路由

    实例:—————————————————————请求————————————————————

    POST /apps/7406a4d71a0c43d3ac4b39f006cb0342/routes HTTP/1.1
    Authorization: Basic OnMzY3IzdA==
    Content-Type: application/json
    
    {
      "type": "http",
      "config": {
        "domain": "http://example.com",
        "service": "my-app-1422557606845347930-web"
      }
    }
    

    —————————————————————响应————————————————————

    Content-Type: application/json
    
    {
      "id": "http/a9b9f04336ce0181a08e774e01113b31",
      "parent_ref": "controller/apps/7406a4d71a0c43d3ac4b39f006cb0342",
      "type": "http",
      "config": {
        "domain": "http://example.com",
        "service": "my-app-1422557606845347930-web"
      },
      "created_at": "2015-01-29T18:53:26.870533465Z",
      "updated_at": "2015-01-29T18:53:26.870533465Z"
    }
    

    获取路由

    实例:—————————————————————请求————————————————————

    GET /apps/7406a4d71a0c43d3ac4b39f006cb0342/routes/http/a9b9f04336ce0181a08e774e01113b31 HTTP/1.1
    Authorization: Basic OnMzY3IzdA==
    Content-Type: application/json
    

    —————————————————————响应————————————————————

    Content-Type: application/json
    
    {
      "id": "http/a9b9f04336ce0181a08e774e01113b31",
      "parent_ref": "controller/apps/7406a4d71a0c43d3ac4b39f006cb0342",
      "type": "http",
      "config": {
        "domain": "http://example.com",
        "service": "my-app-1422557606845347930-web"
      },
      "created_at": "2015-01-29T18:53:26.870533465Z",
      "updated_at": "2015-01-29T18:53:26.870533465Z"
    }
    

    更新路由

    实例:—————————————————————请求————————————————————

    PUT /apps/adcccdb4-b1a4-4209-a03a-762f4e021632/routes/http/5bfb9c8b-ae1f-4a5a-af0c-94fa2996d543 HTTP/1.1
    Authorization: Basic OnMzY3IzdA==
    Content-Type: application/json
    
    {
      "type": "http",
      "id": "5bfb9c8b-ae1f-4a5a-af0c-94fa2996d543",
      "parent_ref": "controller/apps/adcccdb4-b1a4-4209-a03a-762f4e021632",
      "service": "my-app-1450232456657062340-other",
      "created_at": "2015-12-16T02:21:06.704111Z",
      "updated_at": "2015-12-16T02:21:06.704111Z",
      "domain": "http://example.com",
      "sticky": true,
      "path": "/"
    }
    

    —————————————————————响应————————————————————

    Content-Type: application/json
    
    {
      "type": "http",
      "id": "5bfb9c8b-ae1f-4a5a-af0c-94fa2996d543",
      "parent_ref": "controller/apps/adcccdb4-b1a4-4209-a03a-762f4e021632",
      "service": "my-app-1450232456657062340-other",
      "created_at": "2015-12-16T02:21:06.704111Z",
      "updated_at": "2015-12-16T02:21:06.71424Z",
      "domain": "http://example.com",
      "sticky": true,
      "path": "/"
    }
    

    获取路由列表

    实例:—————————————————————请求————————————————————

    GET /apps/7406a4d71a0c43d3ac4b39f006cb0342/routes HTTP/1.1
    Authorization: Basic OnMzY3IzdA==
    Content-Type: application/json
    

    —————————————————————响应————————————————————

    Content-Type: application/json
    
    [
      {
        "id": "http/a9b9f04336ce0181a08e774e01113b31",
        "parent_ref": "controller/apps/7406a4d71a0c43d3ac4b39f006cb0342",
        "type": "http",
        "config": {
          "domain": "http://example.com",
          "service": "my-app-1422557606845347930-web"
        },
        "created_at": "2015-01-29T18:53:26.870533465Z",
        "updated_at": "2015-01-29T18:53:26.870533465Z"
      },
      {
        "id": "http/55b43353e8ae0779b3579ef7661bee91",
        "parent_ref": "controller/apps/7406a4d71a0c43d3ac4b39f006cb0342",
        "type": "http",
        "config": {
          "domain": "my-app-1422557606845347930.dev.localflynn.com",
          "service": "my-app-1422557606845347930-web"
        },
        "created_at": "2015-01-29T18:53:26.847692447Z",
        "updated_at": "2015-01-29T18:53:26.847692447Z"
      }
    ]
    

    删除路由

    实例:—————————————————————请求————————————————————

    DELETE /apps/7406a4d71a0c43d3ac4b39f006cb0342/routes/http/a9b9f04336ce0181a08e774e01113b31 HTTP/1.1
    Authorization: Basic OnMzY3IzdA==
    Content-Type: application/json
    

    —————————————————————响应————————————————————

    Content-Type: text/plain; charset=utf-8
    

    错误

    https://flynn.io/schema/controller/error#

    属性 类型 描述
    code string not_found object_not_found object_exists syntax_error validation_error unknown_error
    message string
    detail boolean

    创建无效应用

    实例:—————————————————————请求————————————————————

    POST /apps HTTP/1.1
    Authorization: Basic OnMzY3IzdA==
    Content-Type: application/json
    
    {
      "name": "this is not valid",
      "protected": false
    }
    

    —————————————————————响应————————————————————

    Content-Type: application/json
    
    {
      "code": "validation_error",
      "message": "name String must match the pattern: \"^[a-z\\d]+(-[a-z\\d]+)*$\".",
      "detail": {
        "field": "name"
      }
    }
    

    事件

    https://flynn.io/schema/controller/event#

    属性 类型 描述
    id integer
    app uuid string 唯一标志符
    object_type string app app_deletion app_release deployment job scale release artifact provider resource resource_deletion key key_deletion route route_deletion domain_migration
    object_id uuid string 唯一标志符
    data object
    created_at date-time string 对象创建时间戳

    事件流

    属性 类型 描述
    app_id uuid string 唯一标志符
    object_types string app app_deletion app_release deployment job scale release artifact provider resource resource_deletion key key_deletion route route_deletion domain_migration
    past boolean 返回之前运行的事件
    count integer 限制返回的之前运行事件的数量

    实例:—————————————————————请求————————————————————

    GET /events?count=10&past=true HTTP/1.1
    Accept: text/event-stream
    Authorization: Basic OnMzY3IzdA==
    Content-Type: application/json
    Last-Event-Id: 0
    

    —————————————————————响应————————————————————

    Content-Type: text/event-stream; charset=utf-8
    
    data: {"id":102,"app":"adcccdb4-b1a4-4209-a03a-762f4e021632","object_type":"job","object_id":"host-26c0ea34-e655-40d2-8d5e-c5694470af6c","data":{"id":"host-26c0ea34-e655-40d2-8d5e-c5694470af6c","app":"adcccdb4-b1a4-4209-a03a-762f4e021632","meta":{"bread":"with hemp"},"type":"foo","state":"up","release":"47154f8c-a604-469d-ae6a-e431990ddee8","created_at":"2015-12-16T02:21:06.765744Z","updated_at":"2015-12-16T02:21:07.689399Z"},"created_at":"2015-12-16T02:21:07.691418Z"}
    
    data: {"id":103,"app":"adcccdb4-b1a4-4209-a03a-762f4e021632","object_type":"job","object_id":"host-26c0ea34-e655-40d2-8d5e-c5694470af6c","data":{"id":"host-26c0ea34-e655-40d2-8d5e-c5694470af6c","app":"adcccdb4-b1a4-4209-a03a-762f4e021632","meta":{"bread":"with hemp"},"type":"foo","state":"down","release":"47154f8c-a604-469d-ae6a-e431990ddee8","created_at":"2015-12-16T02:21:06.765744Z","updated_at":"2015-12-16T02:21:07.704057Z","exit_status":2},"created_at":"2015-12-16T02:21:07.707269Z"}
    
    data: {"id":104,"app":"adcccdb4-b1a4-4209-a03a-762f4e021632","object_type":"job","object_id":"host-e6582097-9aee-4b6d-94fc-83c0a3d1b51c","data":{"id":"host-e6582097-9aee-4b6d-94fc-83c0a3d1b51c","app":"adcccdb4-b1a4-4209-a03a-762f4e021632","meta":{"bread":"with hemp"},"type":"foo","state":"starting","release":"47154f8c-a604-469d-ae6a-e431990ddee8","created_at":"2015-12-16T02:21:07.710312Z","updated_at":"2015-12-16T02:21:07.710312Z"},"created_at":"2015-12-16T02:21:07.711479Z"}
    
    data: {"id":105,"app":"adcccdb4-b1a4-4209-a03a-762f4e021632","object_type":"job","object_id":"host-e6582097-9aee-4b6d-94fc-83c0a3d1b51c","data":{"id":"host-e6582097-9aee-4b6d-94fc-83c0a3d1b51c","app":"adcccdb4-b1a4-4209-a03a-762f4e021632","meta":{"bread":"with hemp"},"type":"foo","state":"up","release":"47154f8c-a604-469d-ae6a-e431990ddee8","created_at":"2015-12-16T02:21:07.710312Z","updated_at":"2015-12-16T02:21:08.529747Z"},"created_at":"2015-12-16T02:21:08.531191Z"}
    
    data: {"id":106,"app":"adcccdb4-b1a4-4209-a03a-762f4e021632","object_type":"job","object_id":"host-e6582097-9aee-4b6d-94fc-83c0a3d1b51c","data":{"id":"host-e6582097-9aee-4b6d-94fc-83c0a3d1b51c","app":"adcccdb4-b1a4-4209-a03a-762f4e021632","meta":{"bread":"with hemp"},"type":"foo","state":"down","release":"47154f8c-a604-469d-ae6a-e431990ddee8","created_at":"2015-12-16T02:21:07.710312Z","updated_at":"2015-12-16T02:21:08.534753Z","exit_status":2},"created_at":"2015-12-16T02:21:08.5359Z"}
    
    data: {"id":107,"object_type":"release","object_id":"77e9e956-ecf9-427f-a031-222c2f394fb8","data":{"id":"77e9e956-ecf9-427f-a031-222c2f394fb8","env":{"some":"info"},"artifact":"c1889f55-c244-43ce-af70-ead357daa6ec","processes":{"foo":{"cmd":["ls","-l"],"env":{"BAR":"baz"},"resources":{"max_fd":{"limit":10000,"request":10000},"memory":{"limit":1073741824,"request":1073741824}}}},"created_at":"2015-12-16T02:21:16.775714Z"},"created_at":"2015-12-16T02:21:16.775714Z"}
    
    data: {"id":108,"app":"adcccdb4-b1a4-4209-a03a-762f4e021632","object_type":"deployment","object_id":"aab1ee14-776d-4ba4-979b-1b4bda2d9b35","data":{"app":"adcccdb4-b1a4-4209-a03a-762f4e021632","status":"pending","release":"77e9e956-ecf9-427f-a031-222c2f394fb8","deployment":"aab1ee14-776d-4ba4-979b-1b4bda2d9b35"},"created_at":"2015-12-16T02:21:16.784374Z"}
    
    data: {"id":109,"app":"adcccdb4-b1a4-4209-a03a-762f4e021632","object_type":"job","object_id":"host-40cc2d07-7a48-4fda-9790-ba9768a3f616","data":{"id":"host-40cc2d07-7a48-4fda-9790-ba9768a3f616","app":"adcccdb4-b1a4-4209-a03a-762f4e021632","state":"starting","release":"77e9e956-ecf9-427f-a031-222c2f394fb8","created_at":"2015-12-16T02:21:16.799294Z","updated_at":"2015-12-16T02:21:16.799294Z"},"created_at":"2015-12-16T02:21:16.806296Z"}
    
    data: {"id":110,"app":"adcccdb4-b1a4-4209-a03a-762f4e021632","object_type":"job","object_id":"host-40cc2d07-7a48-4fda-9790-ba9768a3f616","data":{"id":"host-40cc2d07-7a48-4fda-9790-ba9768a3f616","app":"adcccdb4-b1a4-4209-a03a-762f4e021632","state":"down","release":"77e9e956-ecf9-427f-a031-222c2f394fb8","created_at":"2015-12-16T02:21:16.799294Z","updated_at":"2015-12-16T02:21:16.811094Z"},"created_at":"2015-12-16T02:21:16.812493Z"}
    
    data: {"id":111,"app":"adcccdb4-b1a4-4209-a03a-762f4e021632","object_type":"resource","object_id":"cc9f3342-bed0-4ed3-840e-c462e05808c6","data":{"id":"cc9f3342-bed0-4ed3-840e-c462e05808c6","env":{"FOO":"BAR"},"apps":["adcccdb4-b1a4-4209-a03a-762f4e021632"],"provider":"0952f692-2667-4be0-a159-9d68382a262c","created_at":"2015-12-16T02:21:16.838613Z","external_id":"/foo/bar"},"created_at":"2015-12-16T02:21:16.838613Z"}
    
    data: {"id":112,"app":"adcccdb4-b1a4-4209-a03a-762f4e021632","object_type":"deployment","object_id":"aab1ee14-776d-4ba4-979b-1b4bda2d9b35","data":{"app":"adcccdb4-b1a4-4209-a03a-762f4e021632","status":"running","release":"77e9e956-ecf9-427f-a031-222c2f394fb8","job_type":"foo","job_state":"starting","deployment":"aab1ee14-776d-4ba4-979b-1b4bda2d9b35"},"created_at":"2015-12-16T02:21:17.017287Z"}
    
    data: {"id":113,"app":"adcccdb4-b1a4-4209-a03a-762f4e021632","object_type":"scale","object_id":"adcccdb4-b1a4-4209-a03a-762f4e021632:77e9e956-ecf9-427f-a031-222c2f394fb8","data":{"release":"77e9e956-ecf9-427f-a031-222c2f394fb8","processes":{"foo":1}},"created_at":"2015-12-16T02:21:17.018787Z"}
    
    data: {"id":114,"app":"adcccdb4-b1a4-4209-a03a-762f4e021632","object_type":"job","object_id":"host-8ba33370-e3b5-4b09-8eaa-629279403202","data":{"id":"host-8ba33370-e3b5-4b09-8eaa-629279403202","app":"adcccdb4-b1a4-4209-a03a-762f4e021632","meta":{"bread":"with hemp"},"type":"foo","state":"starting","release":"77e9e956-ecf9-427f-a031-222c2f394fb8","created_at":"2015-12-16T02:21:17.062294Z","updated_at":"2015-12-16T02:21:17.062294Z"},"created_at":"2015-12-16T02:21:17.064426Z"}
    
    data: {"id":115,"app":"adcccdb4-b1a4-4209-a03a-762f4e021632","object_type":"route_deletion","object_id":"32cd199d-9e83-48e6-96c2-05ab7167eab8","data":{"id":"32cd199d-9e83-48e6-96c2-05ab7167eab8","path":"/","type":"http","domain":"my-app-1450232456657062340.dev.localflynn.com","service":"my-app-1450232456657062340-web","created_at":"2015-12-16T02:20:56.661301Z","parent_ref":"controller/apps/adcccdb4-b1a4-4209-a03a-762f4e021632","updated_at":"2015-12-16T02:20:56.661301Z"},"created_at":"2015-12-16T02:21:17.532255Z"}
    
    data: {"id":116,"app":"adcccdb4-b1a4-4209-a03a-762f4e021632","object_type":"resource_deletion","object_id":"cc9f3342-bed0-4ed3-840e-c462e05808c6","data":{"id":"cc9f3342-bed0-4ed3-840e-c462e05808c6","env":{"FOO":"BAR"},"apps":["adcccdb4-b1a4-4209-a03a-762f4e021632"],"provider":"0952f692-2667-4be0-a159-9d68382a262c","created_at":"2015-12-16T02:21:16.838613Z","external_id":"/foo/bar"},"created_at":"2015-12-16T02:21:17.537413Z"}
    
    data: {"id":117,"app":"adcccdb4-b1a4-4209-a03a-762f4e021632","object_type":"app_deletion","object_id":"adcccdb4-b1a4-4209-a03a-762f4e021632","data":{"error":"","app_deletion":{"app":"adcccdb4-b1a4-4209-a03a-762f4e021632","deleted_routes":[{"id":"32cd199d-9e83-48e6-96c2-05ab7167eab8","path":"/","type":"http","domain":"my-app-1450232456657062340.dev.localflynn.com","service":"my-app-1450232456657062340-web","created_at":"2015-12-16T02:20:56.661301Z","parent_ref":"controller/apps/adcccdb4-b1a4-4209-a03a-762f4e021632","updated_at":"2015-12-16T02:20:56.661301Z"}],"deleted_resources":[{"id":"cc9f3342-bed0-4ed3-840e-c462e05808c6","env":{"FOO":"BAR"},"apps":["adcccdb4-b1a4-4209-a03a-762f4e021632"],"provider":"0952f692-2667-4be0-a159-9d68382a262c","created_at":"2015-12-16T02:21:16.838613Z","external_id":"/foo/bar"}]}},"created_at":"2015-12-16T02:21:17.564196Z"}
    

    列出事件

    属性 类型 描述
    app_id uuid string 唯一标志符
    object_types string app app_deletion app_release deployment job scale release artifact provider resource resource_deletion key key_deletion route route_deletion domain_migration
    before_id integer 只返回发生在指定 ID 事件之前的事件
    since_id integer 只返回发生在指定 ID 事件之后的事件
    count integer 限制返回的之前运行事件的数量

    实例:—————————————————————请求————————————————————

    GET /events?count=10 HTTP/1.1
    Accept: application/json
    Authorization: Basic OnMzY3IzdA==
    Content-Type: application/json
    

    —————————————————————响应————————————————————

    Content-Type: text/event-stream; charset=utf-8
    
    [
      {
        "id": 111,
        "app": "adcccdb4-b1a4-4209-a03a-762f4e021632",
        "object_type": "resource",
        "object_id": "cc9f3342-bed0-4ed3-840e-c462e05808c6",
        "data": {
          "id": "cc9f3342-bed0-4ed3-840e-c462e05808c6",
          "env": {
            "FOO": "BAR"
          },
          "apps": [
            "adcccdb4-b1a4-4209-a03a-762f4e021632"
          ],
          "provider": "0952f692-2667-4be0-a159-9d68382a262c",
          "created_at": "2015-12-16T02:21:16.838613Z",
          "external_id": "/foo/bar"
        },
        "created_at": "2015-12-16T02:21:16.838613Z"
      },
      {
        "id": 110,
        "app": "adcccdb4-b1a4-4209-a03a-762f4e021632",
        "object_type": "job",
        "object_id": "host-40cc2d07-7a48-4fda-9790-ba9768a3f616",
        "data": {
          "id": "host-40cc2d07-7a48-4fda-9790-ba9768a3f616",
          "app": "adcccdb4-b1a4-4209-a03a-762f4e021632",
          "state": "down",
          "release": "77e9e956-ecf9-427f-a031-222c2f394fb8",
          "created_at": "2015-12-16T02:21:16.799294Z",
          "updated_at": "2015-12-16T02:21:16.811094Z"
        },
        "created_at": "2015-12-16T02:21:16.812493Z"
      },
      {
        "id": 109,
        "app": "adcccdb4-b1a4-4209-a03a-762f4e021632",
        "object_type": "job",
        "object_id": "host-40cc2d07-7a48-4fda-9790-ba9768a3f616",
        "data": {
          "id": "host-40cc2d07-7a48-4fda-9790-ba9768a3f616",
          "app": "adcccdb4-b1a4-4209-a03a-762f4e021632",
          "state": "starting",
          "release": "77e9e956-ecf9-427f-a031-222c2f394fb8",
          "created_at": "2015-12-16T02:21:16.799294Z",
          "updated_at": "2015-12-16T02:21:16.799294Z"
        },
        "created_at": "2015-12-16T02:21:16.806296Z"
      },
      {
        "id": 108,
        "app": "adcccdb4-b1a4-4209-a03a-762f4e021632",
        "object_type": "deployment",
        "object_id": "aab1ee14-776d-4ba4-979b-1b4bda2d9b35",
        "data": {
          "app": "adcccdb4-b1a4-4209-a03a-762f4e021632",
          "status": "pending",
          "release": "77e9e956-ecf9-427f-a031-222c2f394fb8",
          "deployment": "aab1ee14-776d-4ba4-979b-1b4bda2d9b35"
        },
        "created_at": "2015-12-16T02:21:16.784374Z"
      },
      {
        "id": 107,
        "object_type": "release",
        "object_id": "77e9e956-ecf9-427f-a031-222c2f394fb8",
        "data": {
          "id": "77e9e956-ecf9-427f-a031-222c2f394fb8",
          "env": {
            "some": "info"
          },
          "artifact": "c1889f55-c244-43ce-af70-ead357daa6ec",
          "processes": {
            "foo": {
              "cmd": [
                "ls",
                "-l"
              ],
              "env": {
                "BAR": "baz"
              },
              "resources": {
                "max_fd": {
                  "limit": 10000,
                  "request": 10000
                },
                "memory": {
                  "limit": 1073741824,
                  "request": 1073741824
                }
              }
            }
          },
          "created_at": "2015-12-16T02:21:16.775714Z"
        },
        "created_at": "2015-12-16T02:21:16.775714Z"
      },
      {
        "id": 106,
        "app": "adcccdb4-b1a4-4209-a03a-762f4e021632",
        "object_type": "job",
        "object_id": "host-e6582097-9aee-4b6d-94fc-83c0a3d1b51c",
        "data": {
          "id": "host-e6582097-9aee-4b6d-94fc-83c0a3d1b51c",
          "app": "adcccdb4-b1a4-4209-a03a-762f4e021632",
          "meta": {
            "bread": "with hemp"
          },
          "type": "foo",
          "state": "down",
          "release": "47154f8c-a604-469d-ae6a-e431990ddee8",
          "created_at": "2015-12-16T02:21:07.710312Z",
          "updated_at": "2015-12-16T02:21:08.534753Z",
          "exit_status": 2
        },
        "created_at": "2015-12-16T02:21:08.5359Z"
      },
      {
        "id": 105,
        "app": "adcccdb4-b1a4-4209-a03a-762f4e021632",
        "object_type": "job",
        "object_id": "host-e6582097-9aee-4b6d-94fc-83c0a3d1b51c",
        "data": {
          "id": "host-e6582097-9aee-4b6d-94fc-83c0a3d1b51c",
          "app": "adcccdb4-b1a4-4209-a03a-762f4e021632",
          "meta": {
            "bread": "with hemp"
          },
          "type": "foo",
          "state": "up",
          "release": "47154f8c-a604-469d-ae6a-e431990ddee8",
          "created_at": "2015-12-16T02:21:07.710312Z",
          "updated_at": "2015-12-16T02:21:08.529747Z"
        },
        "created_at": "2015-12-16T02:21:08.531191Z"
      },
      {
        "id": 104,
        "app": "adcccdb4-b1a4-4209-a03a-762f4e021632",
        "object_type": "job",
        "object_id": "host-e6582097-9aee-4b6d-94fc-83c0a3d1b51c",
        "data": {
          "id": "host-e6582097-9aee-4b6d-94fc-83c0a3d1b51c",
          "app": "adcccdb4-b1a4-4209-a03a-762f4e021632",
          "meta": {
            "bread": "with hemp"
          },
          "type": "foo",
          "state": "starting",
          "release": "47154f8c-a604-469d-ae6a-e431990ddee8",
          "created_at": "2015-12-16T02:21:07.710312Z",
          "updated_at": "2015-12-16T02:21:07.710312Z"
        },
        "created_at": "2015-12-16T02:21:07.711479Z"
      },
      {
        "id": 103,
        "app": "adcccdb4-b1a4-4209-a03a-762f4e021632",
        "object_type": "job",
        "object_id": "host-26c0ea34-e655-40d2-8d5e-c5694470af6c",
        "data": {
          "id": "host-26c0ea34-e655-40d2-8d5e-c5694470af6c",
          "app": "adcccdb4-b1a4-4209-a03a-762f4e021632",
          "meta": {
            "bread": "with hemp"
          },
          "type": "foo",
          "state": "down",
          "release": "47154f8c-a604-469d-ae6a-e431990ddee8",
          "created_at": "2015-12-16T02:21:06.765744Z",
          "updated_at": "2015-12-16T02:21:07.704057Z",
          "exit_status": 2
        },
        "created_at": "2015-12-16T02:21:07.707269Z"
      },
      {
        "id": 102,
        "app": "adcccdb4-b1a4-4209-a03a-762f4e021632",
        "object_type": "job",
        "object_id": "host-26c0ea34-e655-40d2-8d5e-c5694470af6c",
        "data": {
          "id": "host-26c0ea34-e655-40d2-8d5e-c5694470af6c",
          "app": "adcccdb4-b1a4-4209-a03a-762f4e021632",
          "meta": {
            "bread": "with hemp"
          },
          "type": "foo",
          "state": "up",
          "release": "47154f8c-a604-469d-ae6a-e431990ddee8",
          "created_at": "2015-12-16T02:21:06.765744Z",
          "updated_at": "2015-12-16T02:21:07.689399Z"
        },
        "created_at": "2015-12-16T02:21:07.691418Z"
      }
    ]
    

    获取事件

    实例:—————————————————————请求————————————————————

    GET /events/111 HTTP/1.1
    Authorization: Basic OnMzY3IzdA==
    Content-Type: application/json
    

    —————————————————————响应————————————————————

    Content-Type: application/json
    
    {
      "id": 111,
      "app": "adcccdb4-b1a4-4209-a03a-762f4e021632",
      "object_type": "resource",
      "object_id": "cc9f3342-bed0-4ed3-840e-c462e05808c6",
      "data": {
        "id": "cc9f3342-bed0-4ed3-840e-c462e05808c6",
        "env": {
          "FOO": "BAR"
        },
        "apps": [
          "adcccdb4-b1a4-4209-a03a-762f4e021632"
        ],
        "provider": "0952f692-2667-4be0-a159-9d68382a262c",
        "created_at": "2015-12-16T02:21:16.838613Z",
        "external_id": "/foo/bar"
      },
      "created_at": "2015-12-16T02:21:16.838613Z"
    }
    

    CA 证书

    获取 CA 证书

    实例:—————————————————————请求————————————————————

    GET /ca-cert HTTP/1.1
    Authorization: Basic OnMzY3IzdA==
    Content-Type: application/json
    

    —————————————————————响应————————————————————

    Content-Type: application/x-x509-ca-cert
    
    -----BEGIN CERTIFICATE-----
    MIIDBDCCAe6gAwIBAgIRAP6BP9TQKrq0l1CCcSI4gb4wCwYJKoZIhvcNAQELMC0x
    DjAMBgNVBAoTBUZseW5uMRswGQYDVQQLExJGbHlubiBFcGhlbWVyYWwgQ0EwHhcN
    MTUxMjE2MDIyMDQxWhcNMjAxMjE0MDIyMDQxWjAtMQ4wDAYDVQQKEwVGbHlubjEb
    MBkGA1UECxMSRmx5bm4gRXBoZW1lcmFsIENBMIIBIjANBgkqhkiG9w0BAQEFAAOC
    AQ8AMIIBCgKCAQEAn+KUccUSVeWoJZTlOxqaiXacGECGAPETxfmnL9ep1rA/4DWi
    2OTpZoeSFdyL1yV5KJxPkq6XMNyl/BR72SOomCmoFRnZzDih//+gfuJAFVGaF1j9
    FOIX+VyO8jyFzqk2vZg9R+ncRyFgjEgpHn0gDdt4WLWDxPpfFMClEZU6Mpu02ngj
    1kmlNgzajl71qhhKtrv3W7ACKh6O3fMSBg4n/ZiVnVQjdkejHskV5R43FH4bpZzP
    hb82rI6FNBNOCKqwbQ/AdGGVvJSzXPypvzCMkGghhx8pckoZw7DONXhSojfIO6Kt
    lxUYO1Odmnb+nyJjxGyidSperhfm+CuSFPn2BwIDAQABoyMwITAOBgNVHQ8BAf8E
    BAMCAAYwDwYDVR0TAQH/BAUwAwEB/zALBgkqhkiG9w0BAQsDggEBAGvEqq1ko+pE
    S5RBHmTWW6mJom9rA+aii9n88lMhbdjikeVFkQkH6Qi8zR5O4hCdDUC4qYUp+rIF
    Z4XZ9Ogl4CcR1gEPGu1KX2EnjVKloS1LThugCuP5YJgQ5qoMsQs681s1ZpPd/0gh
    tjASQy1Y72wY1SxVWqJzkuzf8mMDg52I4wwD9Eif2zq1/+sJa9mdilhvd0Wp+hDV
    6qN6xbH65V2VKwDrkD2p7CIn3NmknYhmw+obezqRkSl6N5Is/QPVg59bOu0evWfS
    DyaOehm1EmmRVehNj8IR0noFwUMbIASnpTescLd4Nz9pEjbgHQ+m6Swe8hnaZ3dd
    1TvxABm/4VY=
    -----END CERTIFICATE-----
    

    备份

    获取集群备份

    下载集群的全备份实例:—————————————————————请求————————————————————

    GET /backup HTTP/1.1
    Authorization: Basic OnMzY3IzdA==
    Content-Type: application/json
    

    —————————————————————响应————————————————————

    Content-Disposition: attachment; filename="flynn-backup-2015-12-16_022126.tar"
    Content-Type: application/tar
    

    域名迁移

    https://flynn.io/schema/controller/domain_migration#

    属性 类型 描述
    id uuid string 唯一标志符
    old_tls_cert string 旧域名的 TLS 证书,迁移任务时会设置它
    tls_cert string 域名的 TLS 证书,若没有会生成一个
    old_domain uri string 旧的迁出的域名
    domain uri string 新的迁入的域名
    created_at date-time string 对象创建时间戳
    finished_at date-time string 迁入完成时间

    迁移集群域名

    将集群域名迁移的任务排队。从 domain_migration 事件流来看什么时候完成集群域名迁移。实例:—————————————————————请求————————————————————

    PUT /domain HTTP/1.1
    Authorization: Basic OnMzY3IzdA==
    Content-Type: application/json
    
    {
      "id": "",
      "old_domain": "dev.localflynn.com",
      "domain": "127.0.0.1.xip.io"
    }
    

    —————————————————————响应————————————————————

    Content-Type: application/json
    
    {
      "id": "5d4c321b-fe6a-42df-867e-ea1a55282396",
      "old_tls_cert": {
        "ca_cert": "",
        "cert": "-----BEGIN CERTIFICATE-----\nMIIDSjCCAjSgAwIBAgIQDH8zACle7B+pqJB3QfwthDALBgkqhkiG9w0BAQswLTEO\nMAwGA1UEChMFRmx5bm4xGzAZBgNVBAsTEkZseW5uIEVwaGVtZXJhbCBDQTAeFw0x\nNTEyMTYwMjIwNDJaFw0yMDEyMTQwMjIwNDJaMC0xDjAMBgNVBAoTBUZseW5uMRsw\nGQYDVQQDExJkZXYubG9jYWxmbHlubi5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IB\nDwAwggEKAoIBAQC3NsEp+fYsbgr94cOBVnSK3ZcHBobwcCdzNvNqh6y1V9wn7x4C\nS6Rk0pn1Zz/FS1F+uA8KMVUzwWCCSl/jW4BNAqbLbVi4I5oap8mCDQDt+MDPZyn5\noOCn6vj5OCJXva3RmhJR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gM9Q7aLsd7ykikIw4mYtPIY5d140juqdajH4f\nuEVTsiH+ShJYTIcOxPG9bYZ+VAD+GIEraT+boD28Z1DZKgJUABylYnFkIxBnAS6i\nzwaxAoGAa3TWYsK0VUrn1EwlI9zzCLW8myjzyPLgpEQ6264ETNSw4K42M2fthcS4\nzlVMrPJ5yhftxCkxbXNFp74lt5Nhryv9K3RWdnL6aXoxR4juhfXBPUBPK+bk/g6F\nohfHj/PeDJFBe0MWC1Q4x7jbeHgqXQ9q7mun+9xH8ZziMdknHc4=\n-----END RSA PRIVATE KEY-----\n"
      },
      "old_domain": "dev.localflynn.com",
      "domain": "127.0.0.1.xip.io",
      "created_at": "2015-12-16T02:21:26.911192Z"
    }
    

    原文: http://doc.oschina.net/flynn?t=54125