Skip to main content

HAProxy Data Plane API

Project description

API for editing and managing haproxy instances. Provides process information, configuration management, haproxy stats and logs.

This Python package is automatically generated by the Swagger Codegen project:

Requirements.

Python 2.7 and 3.4+

Installation & Usage

pip install

If the python package is hosted on Github, you can install directly from Github

pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git

(you may need to run pip with root permission: sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git)

Then import the package:

import dataplaneapi

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 dataplaneapi

Getting Started

Please follow the installation procedure and then run the following:

from __future__ import print_function
import time
import dataplaneapi
from dataplaneapi.rest import ApiException
from pprint import pprint

# Configure HTTP basic authorization: basic_auth
configuration = dataplaneapi.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'

# create an instance of the API class
api_instance = dataplaneapi.ACLApi(dataplaneapi.ApiClient(configuration))
body = dataplaneapi.Acl()  # Acl |
parent_name = 'parent_name_example'  # str | Parent name
parent_type = 'parent_type_example'  # str | Parent type
transaction_id = 'transaction_id_example'  # str | ID of the transaction where we want to add the operation. Cannot be used when version is specified. (optional)
version = 56  # int | Version used for checking configuration version. Cannot be used when transaction is specified, transaction has it's own version. (optional)
force_reload = False  # bool | If set, do a force reload, do not wait for the configured reload-delay. Cannot be used when transaction is specified, as changes in transaction are not applied directly to configuration. (optional) (default to false)

try:
    # Add a new ACL line
    api_response = api_instance.create_acl(body, parent_name, parent_type, transaction_id=transaction_id,
                                           version=version, force_reload=force_reload)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ACLApi->create_acl: %s\n" % e)
# Configure HTTP basic authorization: basic_auth
configuration = dataplaneapi.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'

# create an instance of the API class
api_instance = dataplaneapi.ACLApi(dataplaneapi.ApiClient(configuration))
index = 56  # int | ACL line Index
parent_name = 'parent_name_example'  # str | Parent name
parent_type = 'parent_type_example'  # str | Parent type
transaction_id = 'transaction_id_example'  # str | ID of the transaction where we want to add the operation. Cannot be used when version is specified. (optional)
version = 56  # int | Version used for checking configuration version. Cannot be used when transaction is specified, transaction has it's own version. (optional)
force_reload = False  # bool | If set, do a force reload, do not wait for the configured reload-delay. Cannot be used when transaction is specified, as changes in transaction are not applied directly to configuration. (optional) (default to false)

try:
    # Delete a ACL line
    api_instance.delete_acl(index, parent_name, parent_type, transaction_id=transaction_id, version=version,
                            force_reload=force_reload)
except ApiException as e:
    print("Exception when calling ACLApi->delete_acl: %s\n" % e)
# Configure HTTP basic authorization: basic_auth
configuration = dataplaneapi.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'

# create an instance of the API class
api_instance = dataplaneapi.ACLApi(dataplaneapi.ApiClient(configuration))
index = 56  # int | ACL line Index
parent_name = 'parent_name_example'  # str | Parent name
parent_type = 'parent_type_example'  # str | Parent type
transaction_id = 'transaction_id_example'  # str | ID of the transaction where we want to add the operation. Cannot be used when version is specified. (optional)

try:
    # Return one ACL line
    api_response = api_instance.get_acl(index, parent_name, parent_type, transaction_id=transaction_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ACLApi->get_acl: %s\n" % e)
# Configure HTTP basic authorization: basic_auth
configuration = dataplaneapi.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'

# create an instance of the API class
api_instance = dataplaneapi.ACLApi(dataplaneapi.ApiClient(configuration))
parent_name = 'parent_name_example'  # str | Parent name
parent_type = 'parent_type_example'  # str | Parent type
acl_name = 'acl_name_example'  # str | ACL name (optional)
transaction_id = 'transaction_id_example'  # str | ID of the transaction where we want to add the operation. Cannot be used when version is specified. (optional)

try:
    # Return an array of all ACL lines
    api_response = api_instance.get_acls(parent_name, parent_type, acl_name=acl_name, transaction_id=transaction_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ACLApi->get_acls: %s\n" % e)
# Configure HTTP basic authorization: basic_auth
configuration = dataplaneapi.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'

# create an instance of the API class
api_instance = dataplaneapi.ACLApi(dataplaneapi.ApiClient(configuration))
body = dataplaneapi.Acl()  # Acl |
parent_name = 'parent_name_example'  # str | Parent name
parent_type = 'parent_type_example'  # str | Parent type
index = 56  # int | ACL line Index
transaction_id = 'transaction_id_example'  # str | ID of the transaction where we want to add the operation. Cannot be used when version is specified. (optional)
version = 56  # int | Version used for checking configuration version. Cannot be used when transaction is specified, transaction has its own version. (optional)
force_reload = False  # bool | If set, do a force reload, do not wait for the configured reload-delay. Cannot be used when transaction is specified, as changes in transaction are not applied directly to configuration. (optional) (default to false)

try:
    # Replace a ACL line
    api_response = api_instance.replace_acl(body, parent_name, parent_type, index, transaction_id=transaction_id,
                                            version=version, force_reload=force_reload)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ACLApi->replace_acl: %s\n" % e)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

haproxy_py-0.0.1-py3.8.egg (2.1 MB view details)

Uploaded Source

haproxy_py-0.0.1-py3-none-any.whl (875.6 kB view details)

Uploaded Python 3

File details

Details for the file haproxy_py-0.0.1-py3.8.egg.

File metadata

  • Download URL: haproxy_py-0.0.1-py3.8.egg
  • Upload date:
  • Size: 2.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.28.2 setuptools/62.0.0 requests-toolbelt/0.10.1 tqdm/4.30.0 CPython/3.8.10

File hashes

Hashes for haproxy_py-0.0.1-py3.8.egg
Algorithm Hash digest
SHA256 898e78c212d7345eebf533126dbd2b84a7c4fdb4ea76139bf21eb4e7b23dfae1
MD5 3f09cb59854362bd5ef49b23c01f1c46
BLAKE2b-256 37fd717eb81bf28cc8e3694e88ec9930e45396aeefe1e78ede64e6b01021a868

See more details on using hashes here.

File details

Details for the file haproxy_py-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: haproxy_py-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 875.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.28.2 setuptools/62.0.0 requests-toolbelt/0.10.1 tqdm/4.30.0 CPython/3.8.10

File hashes

Hashes for haproxy_py-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 241ac2c0b385af02f86bf7b622e8e23c47659062e85b7bc9e084ca9ebd3d72cb
MD5 6ff7e0533303f7aa86f3c813d1beae7a
BLAKE2b-256 06b9d120ad2824ee0f9d47539979c1a6aa39206369d83f536a75e3fb2186e0b9

See more details on using hashes here.

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