Skip to main content

API library for Core API.

Project description

python3-cyberfusion-cluster-support

API library for Core API.

Install

PyPI

Run the following command to install the package from PyPI:

pip3 install python3-cyberfusion-cluster-support

Debian

Run the following commands to build a Debian package:

mk-build-deps -i -t 'apt -o Debug::pkgProblemResolver=yes --no-install-recommends -y'
dpkg-buildpackage -us -uc

Configure

Config file options

  • Section clusterapi, key clusterid. Only objects belonging to the specified cluster are loaded.
  • Section clusterapi, key serviceaccountid. Only objects belonging to a cluster for which a service account to cluster exists for the specified service account are loaded.

Class options

  • config_file_path. Non-default config file path.
  • cluster_ids. Only objects belonging to the specified clusters are loaded.

Cluster IDs: order of precedence

The cluster_ids class option takes precedence over the clusterid config file option.

If neither is set, all objects are loaded.

If the clusterid config file option is set, but you want to load all objects, setting the cluster_ids class option to None (default) will not work. Instead, use the sentinel value cyberfusion.ClusterSupport.ALL_CLUSTERS.

Usage

Basic

from cyberfusion.ClusterSupport import ClusterSupport

s = ClusterSupport()

Read

API objects without parameters

Some API objects do not require parameters to be retrieved.

These API objects are retrieved from the Core API once. They are then cached.

Examples:

print(s.database_users)
print(s.unix_users)
print(s.fpm_pools)

API objects with parameters

Some API objects require parameters to be retrieved.

These API objects are retrieved from the Core API on every call.

Example:

print(s.access_logs(virtual_host_id=s.virtual_hosts[0].id, ...))

Update

Example:

d = s.database_users[0]
d.password = "newpassword"
d.update()

Create

Example:

from cyberfusion.ClusterSupport import ClusterSupport
from cyberfusion.ClusterSupport.certificates import Certificate

s = ClusterSupport()

c = Certificate(s)
assert c.id is None

c.create(common_names=["domlimev.nl", "www.domlimev.nl"])
assert c.id is not None
assert c.common_names == common_names=["domlimev.nl", "www.domlimev.nl"]

Delete

Example:

from cyberfusion.ClusterSupport import ClusterSupport

s = ClusterSupport()

c = s.certificates[0]
c.delete()

Tests

Tests with cassettes

Tests re-use cassettes. Tests run with PyCharm automatically (re)write cassettes.

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

python3_cyberfusion_cluster_support-3.9.2.tar.gz (62.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file python3_cyberfusion_cluster_support-3.9.2.tar.gz.

File metadata

File hashes

Hashes for python3_cyberfusion_cluster_support-3.9.2.tar.gz
Algorithm Hash digest
SHA256 66f5763e7f1598d161ebe0cee224632502fd6665057ddaba22f493ae1fe0e102
MD5 80ae03c3aac3cbf97ce179c0ec4c1052
BLAKE2b-256 3a5ff6b366588c87e91a21bcae6c6d4216d91fc8d0279b215aeec005ec5cc8b2

See more details on using hashes here.

File details

Details for the file python3_cyberfusion_cluster_support-3.9.2-py3-none-any.whl.

File metadata

File hashes

Hashes for python3_cyberfusion_cluster_support-3.9.2-py3-none-any.whl
Algorithm Hash digest
SHA256 faf8158dac445d27fcbbc7d3d4b62d1d388e24d875929eeeb7607676a9226bb3
MD5 9b84010b5e23fbbe1e1ca65985b31cba
BLAKE2b-256 214e589da53a99c5b07b7c961b5a98e9a538b6b15915698aa0d8df4de537e0ce

See more details on using hashes here.

Supported by

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