RuntimeConfig: Unable to retrieve "text" value of the Variable #1
Labels
api: runtimeconfig
Issues related to the googleapis/python-runtimeconfig API.
type: feature request
‘Nice-to-have’ improvement, new feature or different behavior or design.
Description
The runtimeconfig.v1beta1.variable needs to be updated with "text" property so users will be able to access the text value.
Steps to reproduce with code samples
For creating the config with the name of my-config
gcloud beta runtime-config configs create my-config
For creating the key value pair, key is "some-gibberish" and value is "hahahablblblbl"
gcloud beta runtime-config configs variables set some-gibberish \
'hahahablblblbl' --config-name my-config
Now enter the Python command line by typing 'python' in the terminal and then hit enter.
Run following simple Python snippet
from google.cloud import runtimeconfig
client = runtimeconfig.Client()
config = client.config('my-config')
var = config.get_variable('some-gibberish')
Expected output:
>>> var.value
But what if we don't need the base64 encoding option given in the documentation?
So we're going to change this gcloud command to store the value of "some-gibberish" as text
gcloud beta runtime-config configs variables set some-gibberish \
'hahahablblblbl' --config-name my-config --is-text
Exit the python command line
Run the gcloud command with
--is-text
flagGo to the python command line again, execute the simple Python snippet from earlier.
Output for var.value
>>> var.value
>>>
Output for var.text
>>> var.text
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'Variable' object has no attribute 'text'
>>>
Effect
For now this would mean that there's no way to retrieve the text values in Python which would force users to store everything as base64 encoded values.
The text was updated successfully, but these errors were encountered: