Skip to main content

Python SDK for the ionoscloud-vm-autoscaling API

Project description

Gitter Quality Gate Status Bugs Maintainability Rating Reliability Rating Security Rating Vulnerabilities Release Release Date PyPI version

Alt text

Python API client for ionoscloud_vm_autoscaling

The VM Auto Scaling Service enables IONOS clients to horizontally scale the number of VM replicas based on configured rules. You can use VM Auto Scaling to ensure that you have a sufficient number of replicas to handle your application loads at all times.

For this purpose, create a VM Auto Scaling Group that contains the server replicas. The VM Auto Scaling Service ensures that the number of replicas in the group is always within the defined limits.

When scaling policies are set, VM Auto Scaling creates or deletes replicas according to the requirements of your applications. For each policy, specified 'scale-in' and 'scale-out' actions are performed when the corresponding thresholds are reached.

Overview

The IONOS Cloud SDK for Python provides you with access to the IONOS Cloud API. The client library supports both simple and complex requests. It is designed for developers who are building applications in Python. All API operations are performed over SSL and authenticated using your IONOS Cloud portal credentials. The API can be accessed within an instance running in IONOS Cloud or directly over the Internet from any application that can send an HTTPS request and receive an HTTPS response.

Installation & Usage

Requirements:

  • Python >= 3.5

pip install

Since this package is hosted on Pypi you can install it by using:

pip install ionoscloud-vm-autoscaling

If the python package is hosted on a repository, you can install directly using:

pip install git+https://github.com/ionos-cloud/sdk-python-vm-autoscaling.git

Note: you may need to run pip with root permission: sudo pip install git+https://github.com/ionos-cloud/sdk-python-vm-autoscaling.git

Then import the package:

import ionoscloud_vm_autoscaling

Setuptools

Install via Setuptools.

python setup.py install --user

or sudo python setup.py install to install the package for all users

Then import the package:

import ionoscloud_vm_autoscaling

NOTE: The Python SDK does not support Python 2. It only supports Python >= 3.5.

Authentication

The username and password or the authentication token can be manually specified when initializing the SDK client:

configuration = ionoscloud_vm_autoscaling.Configuration(
                username='YOUR_USERNAME',
                password='YOUR_PASSWORD',
                token='YOUR_TOKEN'
                )
client = ionoscloud_vm_autoscaling.ApiClient(configuration)

Environment variables can also be used. This is an example of how one would do that:

import os

configuration = ionoscloud_vm_autoscaling.Configuration(
                username=os.environ.get('IONOS_USERNAME'),
                password=os.environ.get('IONOS_PASSWORD'),
                token=os.environ.get('IONOS_TOKEN')
                )
client = ionoscloud_vm_autoscaling.ApiClient(configuration)

Warning: Make sure to follow the Information Security Best Practices when using credentials within your code or storing them in a file.

HTTP proxies

You can use http proxies by setting the following environment variables:

  • IONOS_HTTP_PROXY - proxy URL
  • IONOS_HTTP_PROXY_HEADERS - proxy headers

Each line in IONOS_HTTP_PROXY_HEADERS represents one header, where the header name and value is separated by a colon. Newline characters within a value need to be escaped. See this example:

Connection: Keep-Alive
User-Info: MyID
User-Group: my long\nheader value

Changing the base URL

Base URL for the HTTP operation can be changed in the following way:

import os

configuration = ionoscloud_vm_autoscaling.Configuration(
                username=os.environ.get('IONOS_USERNAME'),
                password=os.environ.get('IONOS_PASSWORD'),
                host=os.environ.get('IONOS_API_URL'),
                server_index=None,
                )
client = ionoscloud_vm_autoscaling.ApiClient(configuration)

Certificate pinning:

You can enable certificate pinning if you want to bypass the normal certificate checking procedure, by doing the following:

Set env variable IONOS_PINNED_CERT=<insert_sha256_public_fingerprint_here>

You can get the sha256 fingerprint most easily from the browser by inspecting the certificate.

Documentation for API Endpoints

All URIs are relative to https://api.ionos.com/autoscaling

API Endpoints table
Class Method HTTP request Description
AutoScalingGroupsApi groups_actions_find_by_id GET /groups/{groupId}/actions/{actionId} Get Scaling Action Details by ID
AutoScalingGroupsApi groups_actions_get GET /groups/{groupId}/actions Get Scaling Actions
AutoScalingGroupsApi groups_delete DELETE /groups/{groupId} Delete a VM Auto Scaling Group by ID
AutoScalingGroupsApi groups_find_by_id GET /groups/{groupId} Get an Auto Scaling by ID
AutoScalingGroupsApi groups_get GET /groups Get VM Auto Scaling Groups
AutoScalingGroupsApi groups_post POST /groups Create a VM Auto Scaling Group
AutoScalingGroupsApi groups_put PUT /groups/{groupId} Update a VM Auto Scaling Group by ID
AutoScalingGroupsApi groups_servers_find_by_id GET /groups/{groupId}/servers/{serverId} Get VM Auto Scaling Group Server by ID
AutoScalingGroupsApi groups_servers_get GET /groups/{groupId}/servers Get VM Auto Scaling Group Servers

Documentation For Models

All URIs are relative to https://api.ionos.com/autoscaling

API models list

[Back to API list] [Back to Model list]

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

ionoscloud-vm-autoscaling-1.0.1.tar.gz (70.8 kB view hashes)

Uploaded Source

Built Distribution

ionoscloud_vm_autoscaling-1.0.1-py3-none-any.whl (227.4 kB view hashes)

Uploaded Python 3

Supported by

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