Skip to main content

terrajinja-sbp-generic

python helper functions for other terrajinja resources

human_read_to_megabyte

converts human readable numbers (e.g. "10TB") to a size in MB (int)

def human_read_to_megabyte(size: str) -> int:
    Convert human formatted size to megabytes value.

    Args:
        size: string of human formatted size

    Returns:
        megabytes represented in the initial human format

placement policies

various commands to control the placement policy of a vm

    # create a placement polict based on placements and strategy
    placement_policy = SbpGenericVmPlacementPolicy(strategy=placement_strategy, placements=placements)
    # create a vm iteration that combines placement policy and naming policy
    vms = SbpGenericVm(placement_policy=placement_policy, name=name, count=count, first_digit=first_digit,
                       formatting=naming_format, ip_addresses=ip_addresses)

    # list all vm's in policy
    for vm in vms:
        print(f'- host: {vm.name} in zone: {vm.zone_name} ip: {vm.ip}')

        # return the placement policy id for the creation of the vm in the correct place
        placement_policy_id = SbpDataVcdVmPlacementPolicy(scope=scope, id_='', name=vms.placement_policy.name,
                                                          urn=vdc_urn).id

History

0.0.1 (14-03-2024)

  • First code creation

Download files

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

Source Distribution

terrajinja_sbp_generic-0.2.0.tar.gz (36.1 kB view details)

Uploaded Source

Built Distribution

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

terrajinja_sbp_generic-0.2.0-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file terrajinja_sbp_generic-0.2.0.tar.gz.

File metadata

  • Download URL: terrajinja_sbp_generic-0.2.0.tar.gz
  • Upload date:
  • Size: 36.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.5

File hashes

Hashes for terrajinja_sbp_generic-0.2.0.tar.gz
Algorithm Hash digest
SHA256 151a6cf962c813326333dcad81f7f3e5b9149d56fffe76e657b45eccf9b23e06
MD5 0a77b771584a1b2bb1191f939f8c542a
BLAKE2b-256 5e7cffacf30ebc7fc940b7909a282c789913c68171c2e38fc9e35677c857e2d4

See more details on using hashes here.

File details

Details for the file terrajinja_sbp_generic-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for terrajinja_sbp_generic-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0b6141527d267139049e6f6f6d9d44b1d1aaec19fd0feed627ad57066e1a15a1
MD5 8ddf6cbc2c03b35425b64f28bfef226c
BLAKE2b-256 9be944cfa2e6675c31d621090863c0d3c4215de1fd44015b737b9cc74977cac5

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 files

0.1.0

2 files

0.0.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page