Skip to main content

jelapi: A Jelastic API Python library

Project description

Lint and Tests codecov

jelapi

A Jelastic API Python library

Installation

pip3 install jelapi

Usage

import jelapi

jelapi.api_url = "https://app.jpc.infomaniak.com/1.0/"
jelapi.api_token = "your-long-token"

jelenvs = jelapi.JelasticEnvironment.list()

jelenv = next(
    env
    for env in jelenvs.values()
    if all(eg in env.envGroups for eg in ["clients/envgroup", "prod"])
)

for ng in jelenv.nodeGroups.values():
    for n in ng.nodes:
        n.fixedCloudlets = 2

cpnodegroup = jelenv.nodeGroups("cp"]
cpnodegroup.nodes[0].fixedCloudlets = 2
cpnodegroup.envVars["AN_ENV_VARIABLE"] = "Content"

sqlnode = jelenv.nodeGroups["sqldb"].nodes[0]
sqlnode.flexibleCloudlets = max(sqlnode.flexibleCloudlets - 2, 0)
sqlnode.allowFlexibleCloudletsReduction = True

jelenv.save()

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

jelapi-0.1.1.tar.gz (31.3 kB view details)

Uploaded Source

Built Distribution

jelapi-0.1.1-py3-none-any.whl (127.6 kB view details)

Uploaded Python 3

File details

Details for the file jelapi-0.1.1.tar.gz.

File metadata

  • Download URL: jelapi-0.1.1.tar.gz
  • Upload date:
  • Size: 31.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for jelapi-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0019769b6354587742930a525478e499ad3abb09c9272b291c9f0ff511e79c44
MD5 ce4b1b1f27462327938ff73400ce4aca
BLAKE2b-256 bec0b8cd7111abe7772aa69a5dd7522b72b0cc095ff9ae8fa773dcc3a38bb969

See more details on using hashes here.

File details

Details for the file jelapi-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: jelapi-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 127.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for jelapi-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b9a6ec7e17c1b6fcfa014160e50edf58a087cc1365ffa58daf8e72cfdbbb132d
MD5 2588d505869f98e5bddbd41dda1729e3
BLAKE2b-256 a1e7bd0942e2fd6f5136791ee0e24835875e5fd621e532593740bce7ebb11baf

See more details on using hashes here.

Supported by

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