semaphoreui-client 0.1.15__py3-none-any.whl → 0.1.17__py3-none-any.whl
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/__about__.py +1 -1
- semaphoreui_client/client.py +60 -1
- {semaphoreui_client-0.1.15.dist-info → semaphoreui_client-0.1.17.dist-info}/METADATA +1 -1
- semaphoreui_client-0.1.17.dist-info/RECORD +6 -0
- semaphoreui_client-0.1.15.dist-info/RECORD +0 -6
- {semaphoreui_client-0.1.15.dist-info → semaphoreui_client-0.1.17.dist-info}/WHEEL +0 -0
semaphoreui_client/__about__.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
__version__ = "0.1.
|
1
|
+
__version__ = "0.1.17"
|
semaphoreui_client/client.py
CHANGED
@@ -451,6 +451,37 @@ class SemaphoreUIClient:
|
|
451
451
|
)
|
452
452
|
return Template(**response.json(), client=self)
|
453
453
|
|
454
|
+
def run_template(
|
455
|
+
self,
|
456
|
+
template_id: int,
|
457
|
+
project_id: int,
|
458
|
+
debug: bool,
|
459
|
+
dry_run: bool,
|
460
|
+
diff: bool,
|
461
|
+
message: str,
|
462
|
+
git_branch: str,
|
463
|
+
limit: str,
|
464
|
+
environment: str,
|
465
|
+
playbook: str,
|
466
|
+
) -> "Task":
|
467
|
+
response = self.http.post(
|
468
|
+
f"{self.api_endpoint}/project/{project_id}/tasks",
|
469
|
+
json={
|
470
|
+
"template_id": template_id,
|
471
|
+
"debug": debug,
|
472
|
+
"dry_run": dry_run,
|
473
|
+
"diff": diff,
|
474
|
+
"playbook": playbook,
|
475
|
+
"environment": environment,
|
476
|
+
"limit": limit,
|
477
|
+
"git_branch": git_branch,
|
478
|
+
"message": message,
|
479
|
+
},
|
480
|
+
)
|
481
|
+
assert response.status_code == 201
|
482
|
+
# The response is not quite a full task, so re-fetch it.
|
483
|
+
return self.get_project_task(project_id, response.json()["id"])
|
484
|
+
|
454
485
|
def delete_project_template(self, project_id: int, id: int) -> None:
|
455
486
|
response = self.http.delete(
|
456
487
|
f"{self.api_endpoint}/project/{project_id}/templates/{id}"
|
@@ -526,7 +557,7 @@ class SemaphoreUIClient:
|
|
526
557
|
def get_project_task(self, project_id: int, id: int) -> "Task":
|
527
558
|
response = self.http.get(f"{self.api_endpoint}/project/{project_id}/tasks/{id}")
|
528
559
|
assert response.status_code == 200
|
529
|
-
return Task(**response.json(),
|
560
|
+
return Task(**response.json(), client=self)
|
530
561
|
|
531
562
|
def delete_project_task(self, project_id: int, id: int) -> None:
|
532
563
|
response = self.http.delete(
|
@@ -909,6 +940,34 @@ class Template:
|
|
909
940
|
|
910
941
|
client: SemaphoreUIClient
|
911
942
|
|
943
|
+
def run(
|
944
|
+
self,
|
945
|
+
debug: bool = False,
|
946
|
+
dry_run: bool = False,
|
947
|
+
diff: bool = False,
|
948
|
+
message: str = "",
|
949
|
+
limit: str = "",
|
950
|
+
environment: str = "",
|
951
|
+
) -> "Task":
|
952
|
+
repo = [
|
953
|
+
repo
|
954
|
+
for repo in self.client.get_project_repositories(self.project_id)
|
955
|
+
if repo.id == self.repository_id
|
956
|
+
][0]
|
957
|
+
git_branch = repo.git_branch
|
958
|
+
return self.client.run_template(
|
959
|
+
self.id,
|
960
|
+
self.project_id,
|
961
|
+
debug,
|
962
|
+
dry_run,
|
963
|
+
diff,
|
964
|
+
message,
|
965
|
+
git_branch,
|
966
|
+
limit,
|
967
|
+
environment,
|
968
|
+
self.playbook,
|
969
|
+
)
|
970
|
+
|
912
971
|
def delete(self) -> None:
|
913
972
|
self.client.delete_project_template(self.project_id, self.id)
|
914
973
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: semaphoreui-client
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.17
|
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,6 @@
|
|
1
|
+
semaphoreui_client/__about__.py,sha256=BzIjnki8Bz3evNWo6bjGxxpLhy_tN9MRYhtM0MnDiWs,23
|
2
|
+
semaphoreui_client/__init__.py,sha256=VpeJavEFhs5gyfih7CoRTR4K4IGXGY3UYUkgAWj_f2U,56
|
3
|
+
semaphoreui_client/client.py,sha256=GMtwmXu_PZH0MNKsdRD07rk24iAfvBKuIQ0-g9EPxhQ,32131
|
4
|
+
semaphoreui_client-0.1.17.dist-info/METADATA,sha256=9p4WLt_D7WC1rCiKfijYkmXVsCKfjVYO9L7hKnOuoFc,1633
|
5
|
+
semaphoreui_client-0.1.17.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
6
|
+
semaphoreui_client-0.1.17.dist-info/RECORD,,
|
@@ -1,6 +0,0 @@
|
|
1
|
-
semaphoreui_client/__about__.py,sha256=qb0TalpSt1CbprnFyeLUKqgrqNtmnk9IoQQ7umAoXVY,23
|
2
|
-
semaphoreui_client/__init__.py,sha256=VpeJavEFhs5gyfih7CoRTR4K4IGXGY3UYUkgAWj_f2U,56
|
3
|
-
semaphoreui_client/client.py,sha256=jqIi0klcWz8OPcNIMxSdNeYDdeSxEyP17hFeNFde8BA,30515
|
4
|
-
semaphoreui_client-0.1.15.dist-info/METADATA,sha256=Lm4YCA3i2XjkIS1ObTysWYkpPlmvPw-4zY67_LKdghQ,1633
|
5
|
-
semaphoreui_client-0.1.15.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
6
|
-
semaphoreui_client-0.1.15.dist-info/RECORD,,
|
File without changes
|