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()

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

Built Distribution

File details

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

File metadata

File hashes

Hashes for python3_cyberfusion_cluster_support-1.50.tar.gz
Algorithm Hash digest
SHA256 5f412d44899366864c1958d3e0a1e7f6bd489f474b1c878b6cd4c251c3bbbb28
MD5 9a340ece31ad47ec6e30df60019e6fc5
BLAKE2b-256 bc42127b0a2f46a3ec3aced3737838fa3f1fd7dbea5a3931421af7d1820dd7e9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for python3_cyberfusion_cluster_support-1.50-py3-none-any.whl
Algorithm Hash digest
SHA256 9dea538e17c7d8ed80646f182d1815cab416438be578f7a00c1da3d72144186e
MD5 5397ae07531716a1baa6ef14ed0902b9
BLAKE2b-256 4816f333ec46e0f4ce62f990c0399e2a19c30c06bf63e1ef18fd8f91892e0fbd

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