All Projects → Arubacloud → pyArubaCloud

Arubacloud / pyArubaCloud

Licence: Apache-2.0 license
Python Interface for ArubaCloud IaaS Service

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to pyArubaCloud

Wakame Vdc
Datacenter Hypervisor - Open Source Cloud Computing / IaaS
Stars: ✭ 110 (+243.75%)
Mutual labels:  iaas
xxcloud
xxcloud,旨在整合数据中心异构虚拟化资源为统一的资源池,并在资源池上为用户提供各类IAAS、PAAS服务。
Stars: ✭ 64 (+100%)
Mutual labels:  iaas
cloudpods
A cloud-native open-source unified multi-cloud and hybrid-cloud platform. 开源、云原生的多云管理及混合云融合平台
Stars: ✭ 1,469 (+4490.63%)
Mutual labels:  iaas
Pyvcloud
Python SDK for VMware vCloud Director
Stars: ✭ 143 (+346.88%)
Mutual labels:  iaas
Vagrant Openstack Provider
Use Vagrant to manage OpenStack Cloud instances.
Stars: ✭ 229 (+615.63%)
Mutual labels:  iaas
docker-machine-driver-arubacloud
ArubaCloud Cloud driver for Docker Machine
Stars: ✭ 30 (-6.25%)
Mutual labels:  aruba
My Cheat Sheets
A place to keep all my cheat sheets for the complete development of ASIC/FPGA hardware or a software app/service.
Stars: ✭ 94 (+193.75%)
Mutual labels:  iaas
countapi-js
Wrapper for CountAPI using promises.
Stars: ✭ 37 (+15.63%)
Mutual labels:  iaas
cb-tumblebug
Cloud-Barista Multi-Cloud Infra Management Framework
Stars: ✭ 33 (+3.13%)
Mutual labels:  iaas
awesome-hosting
List of awesome hosting
Stars: ✭ 134 (+318.75%)
Mutual labels:  iaas
Openstack Folsom Install Guide
A full installation guide for OpenStack Folsom with Quantum
Stars: ✭ 161 (+403.13%)
Mutual labels:  iaas
N8n
Free and open fair-code licensed node based Workflow Automation Tool. Easily automate tasks across different services.
Stars: ✭ 19,252 (+60062.5%)
Mutual labels:  iaas
cheat-sheets
Cheat sheets to help you in daily hands-on tasks of trouble shooting, configuration, and diagnostics with Fortinet, HP/Aruba, Cisco, Checkpoint and others' gear.
Stars: ✭ 63 (+96.88%)
Mutual labels:  aruba
Vcd Cli
Command Line Interface for VMware vCloud Director
Stars: ✭ 143 (+346.88%)
Mutual labels:  iaas
verification-tests
Blackbox test suite for OpenShift.
Stars: ✭ 41 (+28.13%)
Mutual labels:  iaas
Python Scaleway
🐍 Python SDK to query Scaleway APIs.
Stars: ✭ 107 (+234.38%)
Mutual labels:  iaas
aruba-ansible-modules
Aruba Ansible Modules
Stars: ✭ 66 (+106.25%)
Mutual labels:  aruba
ArubaOTP-seed-extractor
Extract TOTP seed instead of using ArubaOTP app
Stars: ✭ 23 (-28.12%)
Mutual labels:  aruba
CADLab Loyalty
This is a end to end Loyalty business scenario
Stars: ✭ 21 (-34.37%)
Mutual labels:  iaas
aoscx-ansible-role
Ansible roles for AOS-CX switches
Stars: ✭ 15 (-53.12%)
Mutual labels:  aruba

Code Climate

Python Interface for ArubaCloud IaaS Service. This is an early-stage release, not every features has been covered.

This project is under development, the classes, methods and parameters might change over time. This README usually reflects the syntax of the latest version.

Getting Started

Installation

Python Package:

pip install pyarubacloud

Git Version:

git clone https://github.com/Arubacloud/pyArubaCloud.git pyArubaCloud
cd pyArubaCloud
python setup.py install

Usage

In the examples folder you can find some examples on various operations which can be done via API.

Log in to the service

from ArubaCloud.PyArubaAPI import CloudInterface

ci = CloudInterface(dc=1)
ci.login(username="XXX-XXXX", password="XXXXXXXX", load=True)

Once you have instantiated CloudInterface object by specifying the number of the datacenter(1 to 6), keeping in mind this association:

  • 1 -> DC1 -> Italy 1
  • 2 -> DC2 -> Italy 2
  • 3 -> DC3 -> Czech Republic
  • 4 -> DC4 -> France
  • 5 -> DC5 -> Germany
  • 6 -> DC6 -> UK
  • 7 -> DC7 -> Italy 3
  • 8 -> DC8 -> Poland

You can login with your username and password (i.e. AWI-19054), load parameter is used to cache all of the data related to the account (within the datacenter) at the login phase.

Retrieve all templates related to a hypervisor

You have the following 4 types of hypervisors to choose from:

  • 1 -> Microsoft Hyper-V - Cloud Pro
  • 2 -> VMWare - Cloud Pro
  • 3 -> Microsoft Hyper-V Low Cost - Cloud Pro
  • 4 -> VMWare - Cloud Smart

Assuming that we want to list every template that contains Debian in the Description for hypervisor 4 in Datacenter 2, the code will be the following:

from ArubaCloud.PyArubaAPI import CloudInterface

ci = CloudInterface(dc=1)
ci.login(username="XXX-XXXX", password="XXXXXXXX", load=True)
ci.get_hypervisors()

from pprint import pprint
pprint(ci.find_template(name='Debian', hv=4))

When you select a template to create a new machine the template has to be enabled. In the result of find_template you can check if a template is enabled.

[Template Name: Debian 5 32bit, Hypervisor: SMART, Id: 959, Enabled: False,
 Template Name: Debian 5 64bit, Hypervisor: SMART, Id: 960, Enabled: False,
 Template Name: Debian 6 32bit, Hypervisor: SMART, Id: 961, Enabled: False,
 Template Name: Debian 6 64bit, Hypervisor: SMART, Id: 962, Enabled: False,
 Template Name: Debian 7 64bit, Hypervisor: SMART, Id: 1114, Enabled: True,
 Template Name: Debian 7 32bit, Hypervisor: SMART, Id: 1115, Enabled: True,
 Template Name: Debian 8 64bit, Hypervisor: SMART, Id: 1723, Enabled: True]

Create a new VM

In order to create a VM you have to instantiate the specific object exposed by the ArubaCloud.objects package:

  • ProVmCreator
  • SmartVmCreator

About Pro VMs, you can choose from a large number of customizations, such as, number of cpu, ram quantity, number and size of virtual disks, public IPs, private IPs and so on.

Smart Servers are not customizable (this reflects the behaviour of the service itself), but you can choose 4 different sizes:

  • Small
  • Medium
  • Large
  • Extra Large

Example of how to create a Pro VM

from ArubaCloud.PyArubaAPI import CloudInterface
from ArubaCloud.objects import ProVmCreator

ci = CloudInterface(dc=1)
ci.login(username="XXX-XXXX", password="XXXXXXXX", load=True)

ip = ci.purchase_ip()

# template_id: 1605 [Template Name: CentOS 7.x 64bit, Hypervisor: VW, Id: 1605, Enabled: True]
c = ProVmCreator(name='debian01', admin_password='MyStrongPassword', template_id='1605', auth_obj=ci.auth)
c.set_cpu_qty(2)
c.set_ram_qty(6)
  
c.add_public_ip(public_ip_address_resource_id=ip.resid)
c.add_virtual_disk(20)
c.add_virtual_disk(40)

print(c.commit(url=ci.wcf_baseurl, debug=True))

Example of how to create a Smart VM

from ArubaCloud.PyArubaAPI import CloudInterface
from ArubaCloud.objects import SmartVmCreator

ci = CloudInterface(dc=1)
ci.login(username="XXX-XXXX", password="XXXXXXXX", load=True)

# template_id: 1114 [Hypervisor: SMART (Debian 7 - 64bit)]
c = SmartVmCreator(name='small01', admin_password='MyStrongPassword', template_id=1114, auth_obj=ci.auth)
c.set_type(ci.get_package_id('small'))

print(c.commit(url=ci.wcf_baseurl, debug=True))

Example of how to set a SSH key

c.set_ssh_key('your_public_key.pub')

Example to use ReverseDns

from ArubaCloud.PyArubaAPI import CloudInterface
from ArubaCloud.ReverseDns import ReverseDns

ci = CloudInterface(dc=1)
rdns = ReverseDns.ReverseDns(username='XXXXXX', password='XXXXX', ws_uri=ci.wcf_baseurl)

# get configured reverse dns
print(rdns.get(addresses=['XXX.XXX.XXX.XXX']))

# set a new reverse dns with one or more PTR hosts
#print(rdns.set(address='XXX.XXX.XXX.XXX', host_name=['xxxx.domain.com', 'xxxx2.domain.com']))

# reset a reverse dns
#print(rdns.reset(addresses=['XXX.XXX.XXX.XXX']))

More examples can be found in the examples folder, following the complete list:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].