Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion instill/clients/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from instill.utils.logger import Logger

_mgmt_client = None
_connector_client = None
_pipeline_client = None
_model_client = None
_client = None
Expand Down
2 changes: 1 addition & 1 deletion instill/clients/mgmt.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def get_user(self) -> mgmt_interface.User:
resp: mgmt_interface.GetUserResponse = self.hosts[self.instance][
"client"
].GetUser(
request=mgmt_interface.GetUserRequest(),
request=mgmt_interface.GetUserRequest(name="users/me"),
metadata=self.hosts[self.instance]["metadata"],
)
return resp.user
Expand Down
2 changes: 1 addition & 1 deletion instill/clients/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ def trigger_async_pipeline(
) -> operations_pb2.Operation:
resp: pipeline_interface.TriggerAsyncUserPipelineResponse = self.hosts[
self.instance
]["client"].TriggerUserPipeline(
]["client"].TriggerAsyncUserPipeline(
request=pipeline_interface.TriggerAsyncUserPipelineRequest(
name=f"{self.namespace}/pipelines/{name}", inputs=inputs
),
Expand Down
10 changes: 10 additions & 0 deletions instill/resources/pipeline.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# pylint: disable=no-member,wrong-import-position,no-name-in-module
from typing import Tuple, Union

from google.longrunning import operations_pb2

import instill.protogen.vdp.pipeline.v1alpha.pipeline_pb2 as pipeline_interface
from instill.clients import InstillClient
from instill.resources.resource import Resource
Expand Down Expand Up @@ -49,6 +51,14 @@ def resource(self, resource: pipeline_interface.Pipeline):
def _update(self):
self.resource = self.client.pipeline_service.get_pipeline(name=self.resource.id)

def get_operation(self, operation: operations_pb2.Operation):
return self.client.pipeline_service.get_operation(operation.name)

def trigger_async(self, task_inputs: list) -> operations_pb2.Operation:
return self.client.pipeline_service.trigger_async_pipeline(
self.resource.id, task_inputs
)

def get_recipe(self) -> str:
return self.resource.recipe

Expand Down