semaphoreui-client 0.1.9__tar.gz → 0.1.11__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.9 → semaphoreui_client-0.1.11}/PKG-INFO +1 -1
- semaphoreui_client-0.1.11/semaphoreui_client/__about__.py +1 -0
- {semaphoreui_client-0.1.9 → semaphoreui_client-0.1.11}/semaphoreui_client/client.py +42 -14
- semaphoreui_client-0.1.9/semaphoreui_client/__about__.py +0 -1
- {semaphoreui_client-0.1.9 → semaphoreui_client-0.1.11}/.github/workflows/checks.yml +0 -0
- {semaphoreui_client-0.1.9 → semaphoreui_client-0.1.11}/.github/workflows/pre-release.yml +0 -0
- {semaphoreui_client-0.1.9 → semaphoreui_client-0.1.11}/.github/workflows/release.yml +0 -0
- {semaphoreui_client-0.1.9 → semaphoreui_client-0.1.11}/.gitignore +0 -0
- {semaphoreui_client-0.1.9 → semaphoreui_client-0.1.11}/README.md +0 -0
- {semaphoreui_client-0.1.9 → semaphoreui_client-0.1.11}/pyproject.toml +0 -0
- {semaphoreui_client-0.1.9 → semaphoreui_client-0.1.11}/semaphoreui_client/__init__.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: semaphoreui-client
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.11
|
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.11"
|
@@ -390,7 +390,12 @@ class SemaphoreUIClient:
|
|
390
390
|
def get_project_templates(self, project_id: int) -> typing.List["Template"]:
|
391
391
|
response = self.http.get(f"{self.api_endpoint}/project/{project_id}/templates")
|
392
392
|
assert response.status_code == 200
|
393
|
-
|
393
|
+
templates: typing.List["Template"] = []
|
394
|
+
for template in response.json():
|
395
|
+
if template.last_task is not None:
|
396
|
+
template.last_task = Task(**template.last_task, client=self)
|
397
|
+
template.append(templates)
|
398
|
+
return templates
|
394
399
|
|
395
400
|
def create_project_template(
|
396
401
|
self,
|
@@ -529,12 +534,14 @@ class SemaphoreUIClient:
|
|
529
534
|
)
|
530
535
|
assert response.status_code == 204
|
531
536
|
|
532
|
-
def get_project_task_output(
|
537
|
+
def get_project_task_output(
|
538
|
+
self, project_id: int, id: int
|
539
|
+
) -> typing.List["TaskOutput"]:
|
533
540
|
response = self.http.get(
|
534
541
|
f"{self.api_endpoint}/project/{project_id}/tasks/{id}/output"
|
535
542
|
)
|
536
543
|
assert response.status_code == 200
|
537
|
-
return TaskOutput(**response.json()
|
544
|
+
return [TaskOutput(**data) for data in response.json()]
|
538
545
|
|
539
546
|
|
540
547
|
@dataclass
|
@@ -899,7 +906,7 @@ class Template:
|
|
899
906
|
build_template_id: int
|
900
907
|
autorun: bool
|
901
908
|
vault_key_id: int
|
902
|
-
last_task:
|
909
|
+
last_task: typing.Optional["Task"]
|
903
910
|
tasks: int
|
904
911
|
|
905
912
|
client: SemaphoreUIClient
|
@@ -936,20 +943,37 @@ class Schedule:
|
|
936
943
|
|
937
944
|
@dataclass
|
938
945
|
class Task:
|
939
|
-
|
940
|
-
|
941
|
-
|
946
|
+
arguments: typing.Optional[str]
|
947
|
+
build_task: typing.Optional["Task"]
|
948
|
+
build_task_id: typing.Optional[int]
|
949
|
+
commit_hash: typing.Optional[str]
|
950
|
+
commit_message: str
|
951
|
+
created: str
|
942
952
|
debug: bool
|
943
|
-
|
953
|
+
diff: bool
|
954
|
+
dry_run: bool
|
955
|
+
end: bool
|
944
956
|
environment: str
|
945
|
-
|
957
|
+
id: int
|
958
|
+
integration_id: typing.Optional[int]
|
959
|
+
inventory_id: typing.Optional[int]
|
946
960
|
limit: str
|
947
|
-
git_branch: str
|
948
961
|
message: str
|
949
|
-
|
950
|
-
# Project id isn't included in the api type, but is required
|
951
|
-
# to perform operations.
|
962
|
+
playbook: str
|
952
963
|
project_id: int
|
964
|
+
schedule_id: typing.Optional[int]
|
965
|
+
secret: str
|
966
|
+
start: str
|
967
|
+
status: str
|
968
|
+
template_id: int
|
969
|
+
tpl_alias: str
|
970
|
+
tpl_app: str
|
971
|
+
tpl_playbook: str
|
972
|
+
tpl_type: str
|
973
|
+
user_id: typing.Optional[int]
|
974
|
+
user_name: typing.Optional[str]
|
975
|
+
version: typing.Optional[str]
|
976
|
+
|
953
977
|
client: SemaphoreUIClient
|
954
978
|
|
955
979
|
def stop(self) -> None:
|
@@ -958,12 +982,16 @@ class Task:
|
|
958
982
|
def delete(self) -> None:
|
959
983
|
self.client.delete_project_task(self.project_id, self.id)
|
960
984
|
|
961
|
-
def output(self) -> "TaskOutput":
|
985
|
+
def output(self) -> typing.List["TaskOutput"]:
|
962
986
|
return self.client.get_project_task_output(self.project_id, self.id)
|
963
987
|
|
988
|
+
def normalized_output(self) -> typing.List[str]:
|
989
|
+
return [output.output for output in self.output()]
|
990
|
+
|
964
991
|
|
965
992
|
@dataclass
|
966
993
|
class TaskOutput:
|
967
994
|
task_id: int
|
995
|
+
task: str
|
968
996
|
time: str
|
969
997
|
output: str
|
@@ -1 +0,0 @@
|
|
1
|
-
__version__ = "0.1.9"
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|