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
Metadata
Release files for terrajinja-sbp-generic 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| terrajinja_sbp_generic-0.2.0.tar.gz | 36.1 kB | Without provenance | Details for terrajinja_sbp_generic-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| terrajinja_sbp_generic-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for terrajinja_sbp_generic-0.2.0-py3-none-any.whl |
Total release size: 43.7 kB
Release files / terrajinja_sbp_generic-0.2.0.tar.gz
| Download URL | terrajinja_sbp_generic-0.2.0.tar.gz |
|---|---|
| Size | 36.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
151a6cf962c813326333dcad81f7f3e5b9149d56fffe76e657b45eccf9b23e06
|
|
BLAKE2b-256 checksum How to use checksums |
5e7cffacf30ebc7fc940b7909a282c789913c68171c2e38fc9e35677c857e2d4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.5
|
Release files / terrajinja_sbp_generic-0.2.0-py3-none-any.whl
| Download URL | terrajinja_sbp_generic-0.2.0-py3-none-any.whl |
|---|---|
| Size | 7.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0b6141527d267139049e6f6f6d9d44b1d1aaec19fd0feed627ad57066e1a15a1
|
|
BLAKE2b-256 checksum How to use checksums |
9be944cfa2e6675c31d621090863c0d3c4215de1fd44015b737b9cc74977cac5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.5
|
Security for terrajinja-sbp-generic 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.