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.16.tar.gz
(25.1 kB
view details)
Built Distribution
File details
Details for the file rustack-esu-0.1.16.tar.gz
.
File metadata
- Download URL: rustack-esu-0.1.16.tar.gz
- Upload date:
- Size: 25.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 36436a44f521fe4f342e078b4bfb5ce10f1d415c4d7915c3d461cc1629770bc5 |
|
MD5 | 2621ee49d0a2dcce3d4db45ea16ef687 |
|
BLAKE2b-256 | b2c2e63c14b551099d1baa8d4a1df98f9be9688a5d2f5e6a80615e3eaa04e177 |
File details
Details for the file rustack_esu-0.1.16-py3-none-any.whl
.
File metadata
- Download URL: rustack_esu-0.1.16-py3-none-any.whl
- Upload date:
- Size: 50.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fa5ec14b328d7fdcc5f2caaf586fa08a73de8b9bbf9d4bfe0fe690471fe27539 |
|
MD5 | 928505208ae5bc289789811a61a4cc04 |
|
BLAKE2b-256 | 03f610b7b20a385f27c4214df24157b7f720d55ee90d002b1bb944eece2bde9f |