Google Cloud RuntimeConfig API Client
raw JSON → 0.36.1 verified Mon Apr 27 auth: no python
Client library for the Google Cloud Runtime Configuration API, which allows you to dynamically store and retrieve configuration data for your applications. Current version 0.36.1, requires Python >=3.9, maintained by Google.
pip install google-cloud-runtimeconfig Common errors
error google.api_core.exceptions.PermissionDenied: 403 The caller does not have permission ↓
cause Service account or user lacks the 'runtimeconfig.configs.get' permission on the config.
fix
Grant the role 'roles/runtimeconfig.admin' or appropriate IAM role to the identity.
error ModuleNotFoundError: No module named 'google.cloud.runtimeconfig' ↓
cause The package 'google-cloud-runtimeconfig' is not installed.
fix
pip install google-cloud-runtimeconfig
error AttributeError: module 'google.cloud.runtimeconfig' has no attribute 'RuntimeConfigClient' ↓
cause Using 'from google.cloud.runtimeconfig import RuntimeConfigClient' from a wrong installation or version.
fix
Ensure you installed the correct package: pip install google-cloud-runtimeconfig
Warnings
gotcha The RuntimeConfig API is a v1beta1 API and may have limited GA guarantees. Behavior may change. ↓
fix Check official Google Cloud documentation for the current API version lifecycle.
gotcha Some quota and limits apply, such as variable size (max 64 KB) and number of variables per config. Exceeding these may cause errors. ↓
fix See https://cloud.google.com/deployment-manager/runtime-configurator/quotas
gotcha The library uses gRPC for communication. Ensure that the 'grpcio' and 'grpcio-status' packages are installed and updated. ↓
fix pip install --upgrade grpcio grpcio-status
Imports
- RuntimeConfigClient wrong
from google.cloud import runtimeconfigcorrectfrom google.cloud.runtimeconfig import RuntimeConfigClient - Variable wrong
from google.cloud.runtimeconfig.types import Variablecorrectfrom google.cloud.runtimeconfig import Variable
Quickstart
from google.cloud.runtimeconfig import RuntimeConfigClient
client = RuntimeConfigClient()
project_id = 'my-project'
config_name = 'my-config'
config_path = client.config_path(project_id, config_name)
print(config_path)