openrelik-api-client 0.2.4__tar.gz → 0.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: openrelik-api-client
3
- Version: 0.2.4
3
+ Version: 0.3.0
4
4
  Summary: API client that automatically handles token refresh
5
5
  Author: Johan Berggren
6
6
  Author-email: jberggren@gmail.com
@@ -72,6 +72,25 @@ class WorkflowsAPI:
72
72
  if response.status_code == 200:
73
73
  return response.json()
74
74
 
75
+ def get_workflow_status(self, folder_id: int, workflow_id: int) -> dict[str, Any]:
76
+ """Retrieves a workflow status by ID.
77
+
78
+ Args:
79
+ folder_id: The ID of the folder where the workflow exists.
80
+ workflow_id: The ID of the workflow to retrieve.
81
+
82
+ Returns:
83
+ The workflow status data.
84
+
85
+ Raises:
86
+ HTTPError: If the API request failed.
87
+ """
88
+ endpoint = f"{self.folders_url}/{folder_id}/workflows/{workflow_id}/status"
89
+ response = self.api_client.session.get(endpoint)
90
+ response.raise_for_status()
91
+ if response.status_code == 200:
92
+ return response.json()
93
+
75
94
  def update_workflow(
76
95
  self, folder_id: int, workflow_id: int, workflow_data: dict
77
96
  ) -> dict[str, Any] | None:
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "openrelik-api-client"
3
- version = "0.2.4"
3
+ version = "0.3.0"
4
4
  description = "API client that automatically handles token refresh"
5
5
  authors = ["Johan Berggren <jberggren@gmail.com>"]
6
6
  readme = "README.md"