RUSTACK-ESU Cloud API Wrapper
Project description
rustack-esu
rustack-esu является Python библиотекой для работы с публичным облаком СБКлауд.
Установка
Минимальная версия Python для установки пакета: 3.5.
$ pip install rustack-esu
Примеры использования
Создание ВЦОД
from esu import Manager, Project, Vdc
token = '72321013a102d2d3da2eaa79f0a613d40cf642fb'
manager = Manager(token=token)
client = manager.get_all_clients()[0]
project = Project(name='Новый проект', client=client, token=token)
project.create()
hypervisor = next(h for h in project.get_available_hypervisors() \
if h.type == 'kvm')
vdc = Vdc(name='Новый ВЦОД', hypervisor=hypervisor, project=project,
token=token)
vdc.create()
print(f'ID нового ВЦОД: {vdc.id}')
Напечатает:
ID нового ВЦОД: 62a2df46-5412-4ca2-9d60-f6fcbe5f4b5f
Создание сервера
from esu import Manager, Project, Vdc
vdc = Vdc.get_object('62a2df46-5412-4ca2-9d60-f6fcbe5f4b5f', token=token)
vm = vdc.create_vm('Новый сервер', 'KVM Ubuntu 18', 'xj3$mNW11')
print(f'ID нового сервера: {vm.id}')
print(f'URL VNC консоли: {vm.get_vnc_url()}') # login: ubuntu
Напечатает:
ID нового сервера: 6c53c690-bd65-4fa5-888a-c9f8054a8ddc
URL VNC консоли: https://...
Документация
Более подробную информация можно получить в документации.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
rustack-esu-0.1.8.tar.gz
(17.4 kB
view details)
Built Distribution
File details
Details for the file rustack-esu-0.1.8.tar.gz
.
File metadata
- Download URL: rustack-esu-0.1.8.tar.gz
- Upload date:
- Size: 17.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6b4999b4eced042aabcbce4c108031c1592f300a0529940ecd7ec400af858d79 |
|
MD5 | 0835256a9ea4526f44749e7daafc9e00 |
|
BLAKE2b-256 | 7b654fef2fcfe62f7249cd3f245549a6dfb7897bae5ab8a630444d44009f554b |
File details
Details for the file rustack_esu-0.1.8-py3-none-any.whl
.
File metadata
- Download URL: rustack_esu-0.1.8-py3-none-any.whl
- Upload date:
- Size: 31.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c04f12488c30a3b24e97a969da8e7f9bc16ffa33a45255c75564775c00475afd |
|
MD5 | 6193e24acc47baf291661ed8cc8103ec |
|
BLAKE2b-256 | 28c2faf67fd40e0089a57ae11bd883b0f7b3b1cd09c1d4811169982712a0bb11 |