Skip to content

Commit

Permalink
feat: add support to get Cloud Tasks's task info
Browse files Browse the repository at this point in the history
  • Loading branch information
joaodaher committed Apr 28, 2023
1 parent c8973d1 commit 761e3bf
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions gcp_pilot/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,5 +123,18 @@ def get_queue(
queue_path = self._queue_path(queue=queue_name, project_id=project_id)
return self.client.get_queue(name=queue_path)

def get_task(self, queue_name: str, task_name: str, project_id: str | None = None) -> tasks_v2.Task:
task_path = self.client.task_path(
project=project_id or self.project_id,
location=self.location,
queue=queue_name,
task=task_name,
)
request = tasks_v2.GetTaskRequest(
name=task_path,
response_view=tasks_v2.Task.View.FULL,
)
return self.client.get_task(request=request)


__all__ = ("CloudTasks",)
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "gcp-pilot"
version = "1.13.0"
version = "1.14.0"
description = "Google Cloud Platform Friendly Pilot"
authors = ["Joao Daher <[email protected]>"]
repository = "https://github.com/flamingo-run/gcp-pilot"
Expand Down

0 comments on commit 761e3bf

Please sign in to comment.