MCPcopy
hub / github.com/PrefectHQ/prefect / get

Function get

src/prefect/cli/variable.py:138–147  ·  view source on GitHub ↗

Get a variable's value.

(name: str)

Source from the content-addressed store, hash-verified

136@variable_app.command(name="get")
137@with_cli_exception_handling
138async def get(name: str):
139 """Get a variable's value."""
140 from prefect.client.orchestration import get_client
141
142 async with get_client() as client:
143 variable = await client.read_variable_by_name(name=name)
144 if variable:
145 _cli.console.print(json.dumps(variable.value))
146 else:
147 exit_with_error(f"Variable {name!r} not found.")
148
149
150@variable_app.command(name="set")

Callers 1

Calls 4

get_clientFunction · 0.90
exit_with_errorFunction · 0.90
read_variable_by_nameMethod · 0.45
dumpsMethod · 0.45

Tested by

no test coverage detected