Skip to main content

aliyun swarm api

Project description

集群接入点地址:

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

使用指南:

配置环境变量(linux 或 mac 操作系统):

export SWARM_URL="https://host:port"

设置当前路径为您保存集群证书的文件路径

export CA_PEM="/path/ca.pem"
export CERT_PEM="/path/cert.pem"
export KEY_PEM="/path/key.pem"

Test

from aliyunswarm import *

if __name__ == "__main__":
    swarm_api = SwarmApi()

    ################################################
    # applications api
    ################################################
    # 查询全部应用
    swarm_api.query_applications()
    # 查询应用
    swarm_api.query_applications('swarmtest')
    # 创建应用
    swarm_api.create_application('./compose/compose.yaml', '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')
    # 更新应用
    swarm_api.update_application('swarmtest')

    ################################################
    # 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')

Project details


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.9.tar.gz (4.0 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.9-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: aliyunswarm-0.0.9.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7

File hashes

Hashes for aliyunswarm-0.0.9.tar.gz
Algorithm Hash digest
SHA256 28f185ab8ccfe90d8659511e60bedfeeb4e19795923085066e31c108312ffaee
MD5 d186d377883fdfd9fcdbbc00b3709477
BLAKE2b-256 e4eb0cdbe236fb0eb00c1012c35be4f795e930d8cbdecaa2e2d1a90a2d99e1c7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: aliyunswarm-0.0.9-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7

File hashes

Hashes for aliyunswarm-0.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 47578664bc2335c368f57f1d5235f92a3ce559ee64b2126dfa035394986db802
MD5 e642d7afb79d86362910f3e37510675f
BLAKE2b-256 b3321b4856308612b0b55f58e9292545e1a2b1e06a9ae0d387626d935b45e259

See more details on using hashes here.

Supported by

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