Expand lab seed tiers, OpenAPI PARAMS, and console DATA/Params UX.
This commit is contained in:
@@ -207,6 +207,7 @@ async def rest_delete_tag(
|
||||
|
||||
@router.post("/rest/com/vmware/cis/tagging/tag-association")
|
||||
async def rest_tag_association(
|
||||
request: Request,
|
||||
body: dict[str, Any] | None = None,
|
||||
action: str | None = Query(default=None, alias="~action"),
|
||||
database: Database = Depends(get_database),
|
||||
@@ -215,9 +216,21 @@ async def rest_tag_association(
|
||||
"""govmomi/terraform use ``?~action=`` instead of JSON ``action``."""
|
||||
|
||||
payload = dict(body or {})
|
||||
if action and "action" not in payload:
|
||||
payload["action"] = action
|
||||
result = await tagging_rest.tag_association(body=payload, database=database, _=session)
|
||||
# Some clients send ``?~action=``; FastAPI alias can miss ``~`` — also read raw query.
|
||||
resolved = (
|
||||
action
|
||||
or request.query_params.get("~action")
|
||||
or request.query_params.get("action")
|
||||
or payload.get("action")
|
||||
)
|
||||
if resolved:
|
||||
payload["action"] = resolved
|
||||
result = await tagging_rest.tag_association(
|
||||
body=payload,
|
||||
action=str(resolved) if resolved else None,
|
||||
database=database,
|
||||
_=session,
|
||||
)
|
||||
if isinstance(result, Response):
|
||||
return result
|
||||
return _value(result)
|
||||
|
||||
Reference in New Issue
Block a user