This package provides proxy class for calling gcloud commands directly from Python.
Project description
gcloud-pyproxy
This Python package provides a proxy class for calling gcloud commands directly from Python.
Requirements
- gcloud
- Python 3.x
Installation
python setup.py build
python setup.py install
Usage
from gcloud_pyproxy import GCloud
gcloud = GCloud()
# comamnd: gcloud compute instances list
gcloud.compute_instances_list()
# command: gcloud compute instances start virtual
gcloud.compute_instances_start("virtual")
# additional flags and parameters
# next method call expands like this:
# gcloud compute instances list --project="gcp-project-id"
gcloud.compute_instances_list(project="gcp-project-id")
# positional arguments are simply concatenated after the command call
gcloud.compute_instances_start("virtual", project="gcp-project-id")
# expands as:
# gcloud compute instances start virtual --project="gcp-project-id"
# by default, underscores in flag names are replace with dashes
gcloud.kms_encrypt(plaintext_file="file.txt")
# gcloud kms encrypt --plaintext-file="file.txt"
# however, this can be overriden by specifying replace_underscore=False
gcloud.kms_encrypt(plaintext_file="file.txt", replace_underscore=False)
# gcloud kms encrypt --plaintext_file="file.txt"
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
GCloudPyProxy-0.9rc4.tar.gz
(2.5 kB
view hashes)
Built Distribution
Close
Hashes for GCloudPyProxy-0.9rc4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 53af20488178e358315da742370e297aca4e8f752e7606ccad4445b25fc72bf0 |
|
MD5 | 12d05e2e2bdcec5b4be5ff3121b519bc |
|
BLAKE2b-256 | 277a8a1255174a5e42aa5bfc8a31f35e1db29c7753c4d76968ed92898bb7bfd3 |