semaphoreui-client 0.1.7__tar.gz → 0.1.9__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.
- {semaphoreui_client-0.1.7 → semaphoreui_client-0.1.9}/.github/workflows/checks.yml +5 -1
- {semaphoreui_client-0.1.7 → semaphoreui_client-0.1.9}/PKG-INFO +1 -1
- semaphoreui_client-0.1.9/semaphoreui_client/__about__.py +1 -0
- {semaphoreui_client-0.1.7 → semaphoreui_client-0.1.9}/semaphoreui_client/client.py +70 -0
- semaphoreui_client-0.1.7/semaphoreui_client/__about__.py +0 -1
- {semaphoreui_client-0.1.7 → semaphoreui_client-0.1.9}/.github/workflows/pre-release.yml +0 -0
- {semaphoreui_client-0.1.7 → semaphoreui_client-0.1.9}/.github/workflows/release.yml +0 -0
- {semaphoreui_client-0.1.7 → semaphoreui_client-0.1.9}/.gitignore +0 -0
- {semaphoreui_client-0.1.7 → semaphoreui_client-0.1.9}/README.md +0 -0
- {semaphoreui_client-0.1.7 → semaphoreui_client-0.1.9}/pyproject.toml +0 -0
- {semaphoreui_client-0.1.7 → semaphoreui_client-0.1.9}/semaphoreui_client/__init__.py +0 -0
@@ -45,7 +45,11 @@ jobs:
|
|
45
45
|
needs: ["check-types", "check-format", "check-lint"]
|
46
46
|
steps:
|
47
47
|
- uses: actions/checkout@v4
|
48
|
-
-
|
48
|
+
- uses: actions/setup-python@v5
|
49
|
+
with:
|
50
|
+
python-version: "3.13"
|
51
|
+
- run: pip install hatch
|
52
|
+
- run: gh workflow run release.yml --ref `hatch version`
|
49
53
|
env:
|
50
54
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
51
55
|
if: startsWith( github.ref, 'refs/tags/')
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: semaphoreui-client
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.9
|
4
4
|
Summary: An api client for interacting with Semaphore UI
|
5
5
|
Project-URL: Documentation, https://github.com/rockstar/semaphoreui-client#readme
|
6
6
|
Project-URL: Issues, https://github.com/rockstar/semaphoreui-client/issues
|
@@ -0,0 +1 @@
|
|
1
|
+
__version__ = "0.1.9"
|
@@ -507,6 +507,35 @@ class SemaphoreUIClient:
|
|
507
507
|
)
|
508
508
|
assert response.status_code == 204
|
509
509
|
|
510
|
+
def get_project_tasks(self, project_id: int) -> typing.List["Task"]:
|
511
|
+
response = self.http.get(f"{self.api_endpoint}/project/{project_id}/tasks")
|
512
|
+
assert response.status_code == 200
|
513
|
+
return [Task(**task, client=self) for task in response.json()]
|
514
|
+
|
515
|
+
def stop_project_task(self, project_id: int, id: int) -> None:
|
516
|
+
response = self.http.post(
|
517
|
+
f"{self.api_endpoint}/project/{project_id}/tasks/{id}/stop"
|
518
|
+
)
|
519
|
+
assert response.status_code == 204
|
520
|
+
|
521
|
+
def get_project_task(self, project_id: int, id: int) -> "Task":
|
522
|
+
response = self.http.get(f"{self.api_endpoint}/project/{project_id}/tasks/{id}")
|
523
|
+
assert response.status_code == 200
|
524
|
+
return Task(**response.json(), project_id=project_id, client=self)
|
525
|
+
|
526
|
+
def delete_project_task(self, project_id: int, id: int) -> None:
|
527
|
+
response = self.http.delete(
|
528
|
+
f"{self.api_endpoint}/project/{project_id}/tasks/{id}"
|
529
|
+
)
|
530
|
+
assert response.status_code == 204
|
531
|
+
|
532
|
+
def get_project_task_output(self, project_id: int, id: int) -> "TaskOutput":
|
533
|
+
response = self.http.get(
|
534
|
+
f"{self.api_endpoint}/project/{project_id}/tasks/{id}/output"
|
535
|
+
)
|
536
|
+
assert response.status_code == 200
|
537
|
+
return TaskOutput(**response.json())
|
538
|
+
|
510
539
|
|
511
540
|
@dataclass
|
512
541
|
class Integration:
|
@@ -711,6 +740,12 @@ class Project:
|
|
711
740
|
self.id, template_id, name, cron_format, active
|
712
741
|
)
|
713
742
|
|
743
|
+
def tasks(self) -> typing.List["Task"]:
|
744
|
+
return self.client.get_project_tasks(self.id)
|
745
|
+
|
746
|
+
def get_task(self, task_id: int) -> "Task":
|
747
|
+
return self.client.get_project_task(self.id, task_id)
|
748
|
+
|
714
749
|
|
715
750
|
@dataclass
|
716
751
|
class Permissions:
|
@@ -897,3 +932,38 @@ class Schedule:
|
|
897
932
|
|
898
933
|
def delete(self) -> None:
|
899
934
|
self.client.delete_project_schedule(self.project_id, self.id)
|
935
|
+
|
936
|
+
|
937
|
+
@dataclass
|
938
|
+
class Task:
|
939
|
+
id: int
|
940
|
+
template_id: int
|
941
|
+
status: str
|
942
|
+
debug: bool
|
943
|
+
playbook: str
|
944
|
+
environment: str
|
945
|
+
secret: str
|
946
|
+
limit: str
|
947
|
+
git_branch: str
|
948
|
+
message: str
|
949
|
+
|
950
|
+
# Project id isn't included in the api type, but is required
|
951
|
+
# to perform operations.
|
952
|
+
project_id: int
|
953
|
+
client: SemaphoreUIClient
|
954
|
+
|
955
|
+
def stop(self) -> None:
|
956
|
+
self.client.stop_project_task(self.project_id, self.id)
|
957
|
+
|
958
|
+
def delete(self) -> None:
|
959
|
+
self.client.delete_project_task(self.project_id, self.id)
|
960
|
+
|
961
|
+
def output(self) -> "TaskOutput":
|
962
|
+
return self.client.get_project_task_output(self.project_id, self.id)
|
963
|
+
|
964
|
+
|
965
|
+
@dataclass
|
966
|
+
class TaskOutput:
|
967
|
+
task_id: int
|
968
|
+
time: str
|
969
|
+
output: str
|
@@ -1 +0,0 @@
|
|
1
|
-
__version__ = "0.1.7"
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|