MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / wait

Method wait

misc/python/materialize/redpanda_cloud.py:69–84  ·  view source on GitHub ↗
(self, result: dict[str, Any])

Source from the content-addressed store, hash-verified

67 return {"Authorization": f"Bearer {self.token}"}
68
69 def wait(self, result: dict[str, Any]) -> dict[str, Any]:
70 operation_id = result["operation"]["id"]
71 while True:
72 time.sleep(10)
73 result = get_result(
74 requests.get(
75 f"{self.controlplane_api_url}/v1beta2/operations/{operation_id}",
76 headers=self.headers(),
77 )
78 )
79 if result["operation"]["state"] == "STATE_COMPLETED":
80 return result["operation"]
81 if result["operation"]["state"] == "STATE_FAILED":
82 raise ValueError(result)
83 if result["operation"]["state"] != "STATE_IN_PROGRESS":
84 raise ValueError(result)
85
86 def create(self, object: str, content: dict[str, Any] | None) -> dict[str, Any]:
87 return get_result(

Callers

nothing calls this directly

Calls 5

headersMethod · 0.95
get_resultFunction · 0.85
ValueErrorClass · 0.85
sleepMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected