Skip to main content

集群接入点地址:

参考:
https://help.aliyun.com/document_detail/26063.html?spm=a2c4g.11186623.6.768.81bb2d05Wmhak0

Test

from aliyunswarm import *

if __name__ == "__main__":
    swarm_api = SwarmApi("https://host:port/",
                        "/path/ca.pem",
                        "/path/cert.pem",
                        "/path/key.pem")

    ################################################
    # applications api
    ################################################
    # 查询全部应用
    swarm_api.query_applications()
    # 查询应用
    swarm_api.query_applications('swarmtest')
    # 创建应用
    template = open('./compose/compose_ngx.yaml', 'r').read()
    swarm_api.create_application(template, 'swarmtest', 'swarm test')
    # 停止应用
    swarm_api.stop_application('swarmtest')
    # 启动应用
    swarm_api.start_application('swarmtest')
    # 终止应用
    swarm_api.kill_application('swarmtest')
    # 删除应用
    swarm_api.delete_application('swarmtest')
    # 重新部署应用
    swarm_api.redeploy_application('swarmtest')
    # 更新应用
    template = open('./compose/compose_ngx.yaml', 'r').read()
    swarm_api.update_application(template, 'swarmtest', 'swarmtest 2', version='2.0')

    ################################################
    # services api
    ################################################
    # 查询服务
    swarm_api.query_services('api')
    # 查询指定应用的服务
    swarm_api.query_service('swarmtest', 'api')
    # 启动指定应用的服务
    swarm_api.start_service('swarmtest', 'api')
    # 停止指定应用的服务
    swarm_api.stop_service('swarmtest', 'api')
    # 中止指定应用的服务
    swarm_api.kill_service('swarmtest', 'api')

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aliyunswarm-0.0.20.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aliyunswarm-0.0.20-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file aliyunswarm-0.0.20.tar.gz.

File metadata

  • Download URL: aliyunswarm-0.0.20.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.4

File hashes

Hashes for aliyunswarm-0.0.20.tar.gz
Algorithm Hash digest
SHA256 b12d18d8513e725e3988cace94a82734717bedf0bfedeba1bfef43eebd8c3169
MD5 08991f1809a92ca9a02500b748fefab9
BLAKE2b-256 402bb1feae21dc891e7a4094c77e5a02bdae449ae18fa4cc32194d3015f98971

See more details on using hashes here.

File details

Details for the file aliyunswarm-0.0.20-py3-none-any.whl.

File metadata

  • Download URL: aliyunswarm-0.0.20-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.4

File hashes

Hashes for aliyunswarm-0.0.20-py3-none-any.whl
Algorithm Hash digest
SHA256 dfb57fd54c665b5b627afc29beefef78968dc41da8e267f1bae18ca894a17db0
MD5 74f41ea3f65ad7c9f4aea47d2f212b7f
BLAKE2b-256 648c57377ec57cdb68bf4df0438f8a4535bedd91a28836c32ede6cc82985474d

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.0.20 This release

2 files

0.0.19

2 files

0.0.18

2 files

0.0.17

2 files

0.0.16

2 files

0.0.15

2 files

0.0.14

2 files

0.0.13

2 files

0.0.12

2 files

0.0.11

2 files

0.0.10

2 files

0.0.9

2 files

0.0.8

2 files

0.0.7

2 files

0.0.6

2 files

0.0.5

2 files

0.0.4

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page