MCPcopy Create free account
hub / github.com/StackStorm/st2 / from_model

Method from_model

st2common/st2common/models/api/inquiry.py:106–123  ·  view source on GitHub ↗
(cls, model, mask_secrets=False)

Source from the content-addressed store, hash-verified

104
105 @classmethod
106 def from_model(cls, model, mask_secrets=False):
107 doc = cls._from_model(model, mask_secrets=mask_secrets)
108
109 doc["result"] = ActionExecutionDB.result.parse_field_value(doc["result"])
110
111 newdoc = {
112 "id": doc["id"],
113 "runner": doc.get("runner", None),
114 "status": doc.get("status", None),
115 "liveaction": doc.get("liveaction", None),
116 "parent": doc.get("parent", None),
117 "result": doc.get("result", None),
118 }
119
120 for field in ["route", "ttl", "users", "roles", "schema"]:
121 newdoc[field] = doc["result"].get(field, None)
122
123 return cls(**newdoc)
124
125
126class InquiryResponseAPI(BaseAPI):

Callers

nothing calls this directly

Calls 3

_from_modelMethod · 0.80
parse_field_valueMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected