aliyun-swarm-sdk-4.2
توضیحات
阿里云 swarm SDK
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | aliyun-swarm-sdk-4.2 |
| نام | aliyun-swarm-sdk |
| نسخه کتابخانه | 4.2 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | eagle |
| ایمیل نویسنده | 1032231418@qq.com |
| آدرس صفحه اصلی | - |
| آدرس اینترنتی | https://pypi.org/project/aliyun-swarm-sdk/ |
| مجوز | Apache License Version 2.0 |
#create_application=====================================================================
"""
data = {
"name": "nginx",
"description": "This is a test application",
'template': 'version: \'2\'\r\nservices: \r\n nginx4:\r\n volumes:\r\n - /data/servicesLog:/data/servicesLog\r\n image: "xxxx"\r\n restart: always\r\n environment:\r\n - msjvm="2048"\r\n - mxjvm="2048"\r\n - env_tag=prod\r\n command: ["/bin/sh","/usr/local/run.sh"]\r\n labels:\r\n aliyun.routing.port_8080: nginx4;http://nginx4.xxxx.com\r\n aliyun.routing.session_sticky: false\r\n aliyun.global: true',
"version": "1.0",
}
Swarm_Object.create_application('https://xxxxxxxxxxx:20180', 'ca.pem', 'cert.pem', 'key.pem', data)
"""
#update_application
"""
data = {
"description": "This is a test application",
'template': 'version: \'2\'\r\nservices: \r\n nginx4:\r\n volumes:\r\n - /data/servicesLog:/data/servicesLog\r\n image: "docker.wanshifu.com:5000/worker"\r\n restart: always\r\n environment:\r\n - msjvm="2048"\r\n - mxjvm="2048"\r\n command: ["/bin/sh","/usr/local/run.sh"]\r\n labels:\r\n aliyun.routing.port_8080: nginx4;http://nginx4.wanshifu.com\r\n aliyun.routing.session_sticky: false\r\n aliyun.global: true',
"version": "4.0",
}
Swarm_Object.update_application('https://xxxxxxxxxxx:20180', 'ca.pem', 'cert.pem', 'key.pem', data, 'nginx' )
"""
#update_application
"""
data = {
"update_method": "blue-green",
"description": "This is a test application",
'template': 'version: \'2\'\r\nservices: \r\n nginx8:\r\n volumes:\r\n - /data/servicesLog:/data/servicesLog\r\n image: "docker.wanshifu.com:5000/worker"\r\n restart: always\r\n environment:\r\n - msjvm="2048"\r\n - mxjvm="2048"\r\n command: ["/bin/sh","/usr/local/run.sh"]\r\n labels:\r\n aliyun.routing.port_8080: nginx4;http://nginx4.wanshifu.com\r\n aliyun.routing.session_sticky: false\r\n aliyun.global: true',
"version": "5.0",
}
Swarm_Object.update_application('https://xxxxxxxxxxx:20180', 'ca.pem', 'cert.pem', 'key.pem', data, 'nginx')
"""
#update_confirmation
#Swarm_Object.update_confirmation('https://xxxxxxxxxxx:20180', 'ca.pem', 'cert.pem', 'key.pem','nginx')
#redeploy_application
"""redeploy_application"""
#Swarm_Object.redeploy_application('https://xxxxxxxxxxx:20180', 'ca.pem', 'cert.pem', 'key.pem', 'nginx')
#stop_application
#Swarm_Object.stop_application('https://xxxxxxxxxxx:20180', 'ca.pem', 'cert.pem', 'key.pem', 'nginx')
#start_application
#Swarm_Object.start_application('https://xxxxxxxxxxx:20180', 'ca.pem', 'cert.pem', 'key.pem', 'nginx')
#kill_application
#Swarm_Object.kill_application('https://xxxxxxxxxxx:20180', 'ca.pem', 'cert.pem', 'key.pem', 'nginx')
#delete_application
#Swarm_Object.delete_application('https://xxxxxxxxxxx:201801', 'ca.pem', 'cert.pem', 'key.pem', 'nginx')
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.6 | Python |
نحوه نصب
نصب پکیج whl aliyun-swarm-sdk-4.2:
pip install aliyun-swarm-sdk-4.2.whl
نصب پکیج tar.gz aliyun-swarm-sdk-4.2:
pip install aliyun-swarm-sdk-4.2.tar.gz