diff --git a/instill/clients/instance.py b/instill/clients/instance.py index e4fa072..79c5950 100644 --- a/instill/clients/instance.py +++ b/instill/clients/instance.py @@ -2,9 +2,9 @@ import grpc -import instill.protogen.core.mgmt.v1alpha.mgmt_public_service_pb2_grpc as mgmt_service +import instill.protogen.core.mgmt.v1beta.mgmt_public_service_pb2_grpc as mgmt_service import instill.protogen.model.model.v1alpha.model_public_service_pb2_grpc as model_service -import instill.protogen.vdp.pipeline.v1alpha.pipeline_public_service_pb2_grpc as pipeline_service +import instill.protogen.vdp.pipeline.v1beta.pipeline_public_service_pb2_grpc as pipeline_service class InstillInstance: diff --git a/instill/clients/mgmt.py b/instill/clients/mgmt.py index 70e235a..2d00b90 100644 --- a/instill/clients/mgmt.py +++ b/instill/clients/mgmt.py @@ -1,14 +1,15 @@ # pylint: disable=no-member,wrong-import-position from typing import Dict -import instill.protogen.common.healthcheck.v1alpha.healthcheck_pb2 as healthcheck +# common +from google.protobuf import field_mask_pb2 -# mgmt -import instill.protogen.core.mgmt.v1alpha.metric_pb2 as metric_interface -import instill.protogen.core.mgmt.v1alpha.mgmt_pb2 as mgmt_interface -import instill.protogen.core.mgmt.v1alpha.mgmt_public_service_pb2_grpc as mgmt_service +import instill.protogen.common.healthcheck.v1beta.healthcheck_pb2 as healthcheck -# common +# mgmt +import instill.protogen.core.mgmt.v1beta.metric_pb2 as metric_interface +import instill.protogen.core.mgmt.v1beta.mgmt_pb2 as mgmt_interface +import instill.protogen.core.mgmt.v1beta.mgmt_public_service_pb2_grpc as mgmt_service from instill.clients.base import Client, RequestFactory from instill.clients.constant import DEFAULT_INSTANCE from instill.clients.instance import InstillInstance @@ -101,6 +102,320 @@ def is_serving(self) -> bool: except Exception: return False + @grpc_handler + def check_namespace( + self, + namespace: str, + async_enabled: bool = False, + ) -> mgmt_interface.CheckNamespaceResponse: + if async_enabled: + return RequestFactory( + method=self.hosts[self.instance].async_client.CheckNamespace, + request=mgmt_interface.CheckNamespaceRequest(id=namespace), + metadata=self.hosts[self.instance].metadata, + ).send_async() + + return RequestFactory( + method=self.hosts[self.instance].client.CheckNamespace, + request=mgmt_interface.CheckNamespaceRequest(id=namespace), + metadata=self.hosts[self.instance].metadata, + ).send_sync() + + @grpc_handler + def list_user_membership( + self, + parent: str, + async_enabled: bool = False, + ) -> mgmt_interface.ListUserMembershipsResponse: + if async_enabled: + return RequestFactory( + method=self.hosts[self.instance].async_client.ListUserMemberships, + request=mgmt_interface.ListUserMembershipsRequest(parent=parent), + metadata=self.hosts[self.instance].metadata, + ).send_async() + return RequestFactory( + method=self.hosts[self.instance].client.ListUserMemberships, + request=mgmt_interface.ListUserMembershipsRequest(parent=parent), + metadata=self.hosts[self.instance].metadata, + ).send_sync() + + @grpc_handler + def get_user_membership( + self, + name: str, + async_enabled: bool = False, + ) -> mgmt_interface.GetUserMembershipResponse: + if async_enabled: + return RequestFactory( + method=self.hosts[self.instance].async_client.GetUserMembership, + request=mgmt_interface.GetUserMembershipRequest( + name=name, + view=mgmt_interface.VIEW_FULL, + ), + metadata=self.hosts[self.instance].metadata, + ).send_async() + return RequestFactory( + method=self.hosts[self.instance].client.GetUserMembership, + request=mgmt_interface.GetUserMembershipRequest( + name=name, + view=mgmt_interface.VIEW_FULL, + ), + metadata=self.hosts[self.instance].metadata, + ).send_sync() + + @grpc_handler + def update_user_membership( + self, + membership: mgmt_interface.UserMembership, + mask: field_mask_pb2.FieldMask, + async_enabled: bool = False, + ) -> mgmt_interface.UpdateUserMembershipResponse: + if async_enabled: + return RequestFactory( + method=self.hosts[self.instance].async_client.UpdateUserMembership, + request=mgmt_interface.UpdateUserMembershipRequest( + membership=membership, + update_mask=mask, + ), + metadata=self.hosts[self.instance].metadata, + ).send_async() + return RequestFactory( + method=self.hosts[self.instance].client.UpdateUserMembership, + request=mgmt_interface.UpdateUserMembershipRequest( + membership=membership, + update_mask=mask, + ), + metadata=self.hosts[self.instance].metadata, + ).send_sync() + + @grpc_handler + def delete_user_membership( + self, + name: str, + async_enabled: bool = False, + ) -> mgmt_interface.DeleteUserMembershipResponse: + if async_enabled: + return RequestFactory( + method=self.hosts[self.instance].async_client.DeleteUserMembership, + request=mgmt_interface.DeleteUserMembershipRequest(name=name), + metadata=self.hosts[self.instance].metadata, + ).send_async() + return RequestFactory( + method=self.hosts[self.instance].client.DeleteUserMembership, + request=mgmt_interface.DeleteUserMembershipRequest(name=name), + metadata=self.hosts[self.instance].metadata, + ).send_sync() + + @grpc_handler + def create_organization( + self, + organization: mgmt_interface.Organization, + async_enabled: bool = False, + ) -> mgmt_interface.CreateOrganizationResponse: + if async_enabled: + return RequestFactory( + method=self.hosts[self.instance].async_client.CreateOrganization, + request=mgmt_interface.CreateOrganizationRequest( + organization=organization + ), + metadata=self.hosts[self.instance].metadata, + ).send_async() + return RequestFactory( + method=self.hosts[self.instance].client.CreateOrganization, + request=mgmt_interface.CreateOrganizationRequest(organization=organization), + metadata=self.hosts[self.instance].metadata, + ).send_sync() + + @grpc_handler + def list_organization( + self, + filer_str: str = "", + next_page_token: str = "", + total_size: int = 100, + async_enabled: bool = False, + ) -> mgmt_interface.ListOrganizationsResponse: + if async_enabled: + return RequestFactory( + method=self.hosts[self.instance].async_client.ListOrganizations, + request=mgmt_interface.ListOrganizationsRequest( + filter=filer_str, + page_size=total_size, + page_token=next_page_token, + view=mgmt_interface.VIEW_FULL, + ), + metadata=self.hosts[self.instance].metadata, + ).send_async() + return RequestFactory( + method=self.hosts[self.instance].client.ListOrganizations, + request=mgmt_interface.ListOrganizationsRequest( + filter=filer_str, + page_size=total_size, + page_token=next_page_token, + view=mgmt_interface.VIEW_FULL, + ), + metadata=self.hosts[self.instance].metadata, + ).send_sync() + + @grpc_handler + def get_organization( + self, + name: str, + async_enabled: bool = False, + ) -> mgmt_interface.GetOrganizationResponse: + if async_enabled: + return RequestFactory( + method=self.hosts[self.instance].async_client.GetOrganization, + request=mgmt_interface.GetOrganizationRequest( + name=name, + view=mgmt_interface.VIEW_FULL, + ), + metadata=self.hosts[self.instance].metadata, + ).send_async() + return RequestFactory( + method=self.hosts[self.instance].client.GetOrganization, + request=mgmt_interface.GetOrganizationRequest( + name=name, + view=mgmt_interface.VIEW_FULL, + ), + metadata=self.hosts[self.instance].metadata, + ).send_sync() + + @grpc_handler + def update_organization( + self, + organization: mgmt_interface.Organization, + mask: field_mask_pb2.FieldMask, + async_enabled: bool = False, + ) -> mgmt_interface.UpdateOrganizationResponse: + if async_enabled: + return RequestFactory( + method=self.hosts[self.instance].async_client.UpdateOrganization, + request=mgmt_interface.UpdateOrganizationRequest( + organization=organization, + update_mask=mask, + ), + metadata=self.hosts[self.instance].metadata, + ).send_async() + return RequestFactory( + method=self.hosts[self.instance].client.UpdateOrganization, + request=mgmt_interface.UpdateOrganizationRequest( + organization=organization, + update_mask=mask, + ), + metadata=self.hosts[self.instance].metadata, + ).send_sync() + + @grpc_handler + def delete_organization( + self, + name: str, + async_enabled: bool = False, + ) -> mgmt_interface.DeleteOrganizationResponse: + if async_enabled: + return RequestFactory( + method=self.hosts[self.instance].async_client.DeleteOrganization, + request=mgmt_interface.DeleteOrganizationRequest(name=name), + metadata=self.hosts[self.instance].metadata, + ).send_async() + return RequestFactory( + method=self.hosts[self.instance].client.DeleteOrganization, + request=mgmt_interface.DeleteOrganizationRequest(name=name), + metadata=self.hosts[self.instance].metadata, + ).send_sync() + + @grpc_handler + def list_organization_memberships( + self, + parent: str, + async_enabled: bool = False, + ) -> mgmt_interface.ListOrganizationMembershipsResponse: + if async_enabled: + return RequestFactory( + method=self.hosts[ + self.instance + ].async_client.ListOrganizationMemberships, + request=mgmt_interface.ListOrganizationMembershipsRequest( + parent=parent + ), + metadata=self.hosts[self.instance].metadata, + ).send_async() + return RequestFactory( + method=self.hosts[self.instance].client.ListOrganizationMemberships, + request=mgmt_interface.ListOrganizationMembershipsRequest(parent=parent), + metadata=self.hosts[self.instance].metadata, + ).send_sync() + + @grpc_handler + def get_organization_membership( + self, + name: str, + async_enabled: bool = False, + ) -> mgmt_interface.GetOrganizationMembershipResponse: + if async_enabled: + return RequestFactory( + method=self.hosts[self.instance].async_client.GetOrganizationMembership, + request=mgmt_interface.GetOrganizationMembershipRequest( + name=name, + view=mgmt_interface.VIEW_FULL, + ), + metadata=self.hosts[self.instance].metadata, + ).send_async() + return RequestFactory( + method=self.hosts[self.instance].client.GetOrganizationMembership, + request=mgmt_interface.GetOrganizationMembershipRequest( + name=name, + view=mgmt_interface.VIEW_FULL, + ), + metadata=self.hosts[self.instance].metadata, + ).send_sync() + + @grpc_handler + def update_organization_membership( + self, + membership: mgmt_interface.OrganizationMembership, + mask: field_mask_pb2.FieldMask, + async_enabled: bool = False, + ) -> mgmt_interface.UpdateOrganizationResponse: + if async_enabled: + return RequestFactory( + method=self.hosts[ + self.instance + ].async_client.UpdateOrganizationMembership, + request=mgmt_interface.UpdateOrganizationMembershipRequest( + membership=membership, + update_mask=mask, + ), + metadata=self.hosts[self.instance].metadata, + ).send_async() + return RequestFactory( + method=self.hosts[self.instance].client.UpdateOrganizationMembership, + request=mgmt_interface.UpdateOrganizationMembershipRequest( + membership=membership, + update_mask=mask, + ), + metadata=self.hosts[self.instance].metadata, + ).send_sync() + + @grpc_handler + def delete_organization_membership( + self, + name: str, + async_enabled: bool = False, + ) -> mgmt_interface.DeleteOrganizationMembershipResponse: + if async_enabled: + return RequestFactory( + method=self.hosts[ + self.instance + ].async_client.DeleteOrganizationMembership, + request=mgmt_interface.DeleteOrganizationMembershipRequest(name=name), + metadata=self.hosts[self.instance].metadata, + ).send_async() + return RequestFactory( + method=self.hosts[self.instance].client.DeleteOrganizationMembership, + request=mgmt_interface.DeleteOrganizationMembershipRequest(name=name), + metadata=self.hosts[self.instance].metadata, + ).send_sync() + @grpc_handler def login( self, @@ -125,6 +440,25 @@ def login( metadata=self.hosts[self.instance].metadata, ).send_sync() + @grpc_handler + def create_token( + self, + token: mgmt_interface.ApiToken, + async_enabled: bool = False, + ) -> mgmt_interface.CreateTokenResponse: + if async_enabled: + return RequestFactory( + method=self.hosts[self.instance].async_client.CreateToken, + request=mgmt_interface.CreateTokenRequest(token=token), + metadata=self.hosts[self.instance].metadata, + ).send_async() + + return RequestFactory( + method=self.hosts[self.instance].client.CreateToken, + request=mgmt_interface.CreateTokenRequest(token=token), + metadata=self.hosts[self.instance].metadata, + ).send_sync() + @grpc_handler def get_token( self, @@ -144,6 +478,69 @@ def get_token( metadata=self.hosts[self.instance].metadata, ).send_sync() + @grpc_handler + def list_tokens( + self, + next_page_token: str = "", + total_size: int = 100, + async_enabled: bool = False, + ) -> mgmt_interface.ListTokensResponse: + if async_enabled: + return RequestFactory( + method=self.hosts[self.instance].async_client.ListTokens, + request=mgmt_interface.ListTokensRequest( + page_size=total_size, + page_token=next_page_token, + ), + metadata=self.hosts[self.instance].metadata, + ).send_async() + + return RequestFactory( + method=self.hosts[self.instance].client.ListTokens, + request=mgmt_interface.ListTokensRequest( + page_size=total_size, + page_token=next_page_token, + ), + metadata=self.hosts[self.instance].metadata, + ).send_sync() + + @grpc_handler + def delete_token( + self, + name: str, + async_enabled: bool = False, + ) -> mgmt_interface.DeleteTokenResponse: + if async_enabled: + return RequestFactory( + method=self.hosts[self.instance].async_client.DeleteToken, + request=mgmt_interface.DeleteTokenRequest(name=name), + metadata=self.hosts[self.instance].metadata, + ).send_async() + + return RequestFactory( + method=self.hosts[self.instance].client.DeleteToken, + request=mgmt_interface.DeleteTokenRequest(name=name), + metadata=self.hosts[self.instance].metadata, + ).send_sync() + + @grpc_handler + def validate_token( + self, + async_enabled: bool = False, + ) -> mgmt_interface.ValidateTokenResponse: + if async_enabled: + return RequestFactory( + method=self.hosts[self.instance].async_client.ValidateToken, + request=mgmt_interface.ValidateTokenRequest(), + metadata=self.hosts[self.instance].metadata, + ).send_async() + + return RequestFactory( + method=self.hosts[self.instance].client.ValidateToken, + request=mgmt_interface.ValidateTokenRequest(), + metadata=self.hosts[self.instance].metadata, + ).send_sync() + @grpc_handler def get_user( self, @@ -162,6 +559,25 @@ def get_user( metadata=self.hosts[self.instance].metadata, ).send_sync() + @grpc_handler + def get_org( + self, + org_name: str, + async_enabled: bool = False, + ) -> mgmt_interface.GetOrganizationResponse: + if async_enabled: + return RequestFactory( + method=self.hosts[self.instance].async_client.GetOrganization, + request=mgmt_interface.GetOrganizationRequest(name=f"orgs/{org_name}"), + metadata=self.hosts[self.instance].metadata, + ).send_async() + + return RequestFactory( + method=self.hosts[self.instance].client.GetOrganization, + request=mgmt_interface.GetOrganizationRequest(name=f"orgs/{org_name}"), + metadata=self.hosts[self.instance].metadata, + ).send_sync() + @grpc_handler def list_pipeline_trigger_records( self, diff --git a/instill/clients/model.py b/instill/clients/model.py index bd27c24..f0d628a 100644 --- a/instill/clients/model.py +++ b/instill/clients/model.py @@ -4,7 +4,7 @@ from google.protobuf import field_mask_pb2 # common -import instill.protogen.common.healthcheck.v1alpha.healthcheck_pb2 as healthcheck +import instill.protogen.common.healthcheck.v1beta.healthcheck_pb2 as healthcheck import instill.protogen.model.model.v1alpha.model_definition_pb2 as model_definition_interface # model diff --git a/instill/clients/pipeline.py b/instill/clients/pipeline.py index 2d80c73..1654d21 100644 --- a/instill/clients/pipeline.py +++ b/instill/clients/pipeline.py @@ -1,16 +1,16 @@ -# pylint: disable=no-member,wrong-import-position +# pylint: disable=no-member,wrong-import-position,too-many-lines from typing import Dict, Union from google.protobuf import field_mask_pb2 # common -import instill.protogen.common.healthcheck.v1alpha.healthcheck_pb2 as healthcheck +import instill.protogen.common.healthcheck.v1beta.healthcheck_pb2 as healthcheck # pipeline -import instill.protogen.vdp.pipeline.v1alpha.connector_pb2 as connector_interface -import instill.protogen.vdp.pipeline.v1alpha.operator_definition_pb2 as operator_interface -import instill.protogen.vdp.pipeline.v1alpha.pipeline_pb2 as pipeline_interface -import instill.protogen.vdp.pipeline.v1alpha.pipeline_public_service_pb2_grpc as pipeline_service +import instill.protogen.vdp.pipeline.v1beta.connector_pb2 as connector_interface +import instill.protogen.vdp.pipeline.v1beta.operator_definition_pb2 as operator_interface +import instill.protogen.vdp.pipeline.v1beta.pipeline_pb2 as pipeline_interface +import instill.protogen.vdp.pipeline.v1beta.pipeline_public_service_pb2_grpc as pipeline_service from instill.clients.base import Client, RequestFactory from instill.clients.constant import DEFAULT_INSTANCE from instill.clients.instance import InstillInstance @@ -21,9 +21,14 @@ class PipelineClient(Client): - def __init__(self, namespace: str, async_enabled: bool) -> None: + def __init__( + self, namespace: str, async_enabled: bool, target_namespace: str = "" + ) -> None: self.hosts: Dict[str, InstillInstance] = {} self.namespace: str = namespace + self.target_namespace: str = ( + namespace if target_namespace == "" else target_namespace + ) if DEFAULT_INSTANCE in global_config.hosts: self.instance = DEFAULT_INSTANCE elif len(global_config.hosts) == 0: @@ -121,7 +126,7 @@ def list_operator_definitions( filter=filter_str, page_size=total_size, page_token=next_page_token, - view=operator_interface.ListOperatorDefinitionsRequest.VIEW_FULL, + view=operator_interface.OperatorDefinition.VIEW_FULL, ), metadata=self.hosts[self.instance].metadata, ).send_async() @@ -132,7 +137,7 @@ def list_operator_definitions( filter=filter_str, page_size=total_size, page_token=next_page_token, - view=operator_interface.ListOperatorDefinitionsRequest.VIEW_FULL, + view=operator_interface.OperatorDefinition.VIEW_FULL, ), metadata=self.hosts[self.instance].metadata, ).send_sync() @@ -146,7 +151,7 @@ def get_operator_definition( method=self.hosts[self.instance].async_client.GetOperatorDefinition, request=operator_interface.GetOperatorDefinitionRequest( name=f"operator-definitions/{name}", - view=operator_interface.GetOperatorDefinitionRequest.VIEW_FULL, + view=operator_interface.OperatorDefinition.VIEW_FULL, ), metadata=self.hosts[self.instance].metadata, ).send_async() @@ -155,7 +160,7 @@ def get_operator_definition( method=self.hosts[self.instance].client.GetOperatorDefinition, request=operator_interface.GetOperatorDefinitionRequest( name=f"operator-definitions/{name}", - view=operator_interface.GetOperatorDefinitionRequest.VIEW_FULL, + view=operator_interface.OperatorDefinition.VIEW_FULL, ), metadata=self.hosts[self.instance].metadata, ).send_sync() @@ -175,7 +180,7 @@ def create_pipeline( return RequestFactory( method=self.hosts[self.instance].async_client.CreateUserPipeline, request=pipeline_interface.CreateUserPipelineRequest( - pipeline=pipeline, parent=self.namespace + pipeline=pipeline, parent=self.target_namespace ), metadata=self.hosts[self.instance].metadata, ).send_async() @@ -183,7 +188,7 @@ def create_pipeline( return RequestFactory( method=self.hosts[self.instance].client.CreateUserPipeline, request=pipeline_interface.CreateUserPipelineRequest( - pipeline=pipeline, parent=self.namespace + pipeline=pipeline, parent=self.target_namespace ), metadata=self.hosts[self.instance].metadata, ).send_sync() @@ -198,7 +203,7 @@ def get_pipeline( return RequestFactory( method=self.hosts[self.instance].async_client.GetUserPipeline, request=pipeline_interface.GetUserPipelineRequest( - name=f"{self.namespace}/pipelines/{name}" + name=f"{self.target_namespace}/pipelines/{name}" ), metadata=self.hosts[self.instance].metadata, ).send_async() @@ -206,7 +211,7 @@ def get_pipeline( return RequestFactory( method=self.hosts[self.instance].client.GetUserPipeline, request=pipeline_interface.GetUserPipelineRequest( - name=f"{self.namespace}/pipelines/{name}" + name=f"{self.target_namespace}/pipelines/{name}" ), metadata=self.hosts[self.instance].metadata, ).send_sync() @@ -222,7 +227,7 @@ def lookup_pipeline( method=self.hosts[self.instance].async_client.LookUpPipeline, request=pipeline_interface.LookUpPipelineRequest( permalink=f"pipelines/{pipeline_uid}", - view=pipeline_interface.LookUpPipelineRequest.VIEW_FULL, + view=pipeline_interface.Pipeline.VIEW_FULL, ), metadata=self.hosts[self.instance].metadata, ).send_async() @@ -231,7 +236,7 @@ def lookup_pipeline( method=self.hosts[self.instance].client.LookUpPipeline, request=pipeline_interface.LookUpPipelineRequest( permalink=f"pipelines/{pipeline_uid}", - view=pipeline_interface.LookUpPipelineRequest.VIEW_FULL, + view=pipeline_interface.Pipeline.VIEW_FULL, ), metadata=self.hosts[self.instance].metadata, ).send_sync() @@ -247,7 +252,7 @@ def rename_pipeline( return RequestFactory( method=self.hosts[self.instance].async_client.RenameUserPipeline, request=pipeline_interface.RenameUserPipelineRequest( - name=f"{self.namespace}/pipelines/{name}", + name=f"{self.target_namespace}/pipelines/{name}", new_pipeline_id=new_name, ), metadata=self.hosts[self.instance].metadata, @@ -256,7 +261,7 @@ def rename_pipeline( return RequestFactory( method=self.hosts[self.instance].client.RenameUserPipeline, request=pipeline_interface.RenameUserPipelineRequest( - name=f"{self.namespace}/pipelines/{name}", + name=f"{self.target_namespace}/pipelines/{name}", new_pipeline_id=new_name, ), metadata=self.hosts[self.instance].metadata, @@ -298,7 +303,7 @@ def validate_pipeline( return RequestFactory( method=self.hosts[self.instance].async_client.ValidateUserPipeline, request=pipeline_interface.ValidateUserPipelineRequest( - name=f"{self.namespace}/pipelines/{name}" + name=f"{self.target_namespace}/pipelines/{name}" ), metadata=self.hosts[self.instance].metadata, ).send_async() @@ -306,7 +311,7 @@ def validate_pipeline( return RequestFactory( method=self.hosts[self.instance].client.ValidateUserPipeline, request=pipeline_interface.ValidateUserPipelineRequest( - name=f"{self.namespace}/pipelines/{name}" + name=f"{self.target_namespace}/pipelines/{name}" ), metadata=self.hosts[self.instance].metadata, ).send_sync() @@ -322,7 +327,7 @@ def trigger_pipeline( return RequestFactory( method=self.hosts[self.instance].async_client.TriggerUserPipeline, request=pipeline_interface.TriggerUserPipelineRequest( - name=f"{self.namespace}/pipelines/{name}", inputs=inputs + name=f"{self.target_namespace}/pipelines/{name}", inputs=inputs ), metadata=self.hosts[self.instance].metadata, ).send_async() @@ -330,7 +335,7 @@ def trigger_pipeline( return RequestFactory( method=self.hosts[self.instance].client.TriggerUserPipeline, request=pipeline_interface.TriggerUserPipelineRequest( - name=f"{self.namespace}/pipelines/{name}", inputs=inputs + name=f"{self.target_namespace}/pipelines/{name}", inputs=inputs ), metadata=self.hosts[self.instance].metadata, ).send_sync() @@ -346,7 +351,7 @@ def trigger_async_pipeline( return RequestFactory( method=self.hosts[self.instance].async_client.TriggerAsyncUserPipeline, request=pipeline_interface.TriggerAsyncUserPipelineRequest( - name=f"{self.namespace}/pipelines/{name}", inputs=inputs + name=f"{self.target_namespace}/pipelines/{name}", inputs=inputs ), metadata=self.hosts[self.instance].metadata, ).send_async() @@ -354,7 +359,7 @@ def trigger_async_pipeline( return RequestFactory( method=self.hosts[self.instance].client.TriggerAsyncUserPipeline, request=pipeline_interface.TriggerAsyncUserPipelineRequest( - name=f"{self.namespace}/pipelines/{name}", inputs=inputs + name=f"{self.target_namespace}/pipelines/{name}", inputs=inputs ), metadata=self.hosts[self.instance].metadata, ).send_sync() @@ -369,7 +374,7 @@ def delete_pipeline( return RequestFactory( method=self.hosts[self.instance].async_client.DeleteUserPipeline, request=pipeline_interface.DeleteUserPipelineRequest( - name=f"{self.namespace}/pipelines/{name}" + name=f"{self.target_namespace}/pipelines/{name}" ), metadata=self.hosts[self.instance].metadata, ).send_async() @@ -377,7 +382,7 @@ def delete_pipeline( return RequestFactory( method=self.hosts[self.instance].client.DeleteUserPipeline, request=pipeline_interface.DeleteUserPipelineRequest( - name=f"{self.namespace}/pipelines/{name}" + name=f"{self.target_namespace}/pipelines/{name}" ), metadata=self.hosts[self.instance].metadata, ).send_sync() @@ -405,7 +410,7 @@ def list_pipelines( page_size=total_size, page_token=next_page_token, show_deleted=show_deleted, - view=pipeline_interface.ListPipelinesRequest.VIEW_FULL, + view=pipeline_interface.Pipeline.VIEW_FULL, ), metadata=self.hosts[self.instance].metadata, ).send_async() @@ -413,12 +418,12 @@ def list_pipelines( return RequestFactory( method=method, request=pipeline_interface.ListUserPipelinesRequest( - parent=self.namespace, + parent=self.target_namespace, filter=filer_str, page_size=total_size, page_token=next_page_token, show_deleted=show_deleted, - view=pipeline_interface.ListUserPipelinesRequest.VIEW_FULL, + view=pipeline_interface.Pipeline.VIEW_FULL, ), metadata=self.hosts[self.instance].metadata, ).send_async() @@ -431,7 +436,7 @@ def list_pipelines( page_size=total_size, page_token=next_page_token, show_deleted=show_deleted, - view=pipeline_interface.ListPipelinesRequest.VIEW_FULL, + view=pipeline_interface.Pipeline.VIEW_FULL, ), metadata=self.hosts[self.instance].metadata, ).send_sync() @@ -439,12 +444,12 @@ def list_pipelines( return RequestFactory( method=method, request=pipeline_interface.ListUserPipelinesRequest( - parent=self.namespace, + parent=self.target_namespace, filter=filer_str, page_size=total_size, page_token=next_page_token, show_deleted=show_deleted, - view=pipeline_interface.ListUserPipelinesRequest.VIEW_FULL, + view=pipeline_interface.Pipeline.VIEW_FULL, ), metadata=self.hosts[self.instance].metadata, ).send_sync() @@ -493,7 +498,7 @@ def create_pipeline_release( return RequestFactory( method=self.hosts[self.instance].async_client.CreateUserPipelineRelease, request=pipeline_interface.CreateUserPipelineReleaseRequest( - release=pipeline_release, parent=self.namespace + release=pipeline_release, parent=self.target_namespace ), metadata=self.hosts[self.instance].metadata, ).send_async() @@ -501,7 +506,7 @@ def create_pipeline_release( return RequestFactory( method=self.hosts[self.instance].client.CreateUserPipelineRelease, request=pipeline_interface.CreateUserPipelineReleaseRequest( - release=pipeline_release, parent=self.namespace + release=pipeline_release, parent=self.target_namespace ), metadata=self.hosts[self.instance].metadata, ).send_sync() @@ -524,8 +529,8 @@ def get_pipeline_release( return RequestFactory( method=self.hosts[self.instance].async_client.GetUserPipelineRelease, request=pipeline_interface.GetUserPipelineReleaseRequest( - name=f"{self.namespace}/pipelines/{name}", - view=pipeline_interface.GetUserPipelineReleaseRequest.VIEW_FULL, + name=f"{self.target_namespace}/pipelines/{name}", + view=pipeline_interface.Pipeline.VIEW_FULL, ), metadata=self.hosts[self.instance].metadata, ).send_async() @@ -533,8 +538,8 @@ def get_pipeline_release( return RequestFactory( method=self.hosts[self.instance].client.GetUserPipelineRelease, request=pipeline_interface.GetUserPipelineReleaseRequest( - name=f"{self.namespace}/pipelines/{name}", - view=pipeline_interface.GetUserPipelineReleaseRequest.VIEW_FULL, + name=f"{self.target_namespace}/pipelines/{name}", + view=pipeline_interface.Pipeline.VIEW_FULL, ), metadata=self.hosts[self.instance].metadata, ).send_sync() @@ -559,7 +564,7 @@ def rename_pipeline_release( return RequestFactory( method=self.hosts[self.instance].async_client.RenameUserPipelineRelease, request=pipeline_interface.RenameUserPipelineReleaseRequest( - name=f"{self.namespace}/pipelines/{name}", + name=f"{self.target_namespace}/pipelines/{name}", new_pipeline_release_id=new_version, ), metadata=self.hosts[self.instance].metadata, @@ -568,7 +573,7 @@ def rename_pipeline_release( return RequestFactory( method=self.hosts[self.instance].client.RenameUserPipelineRelease, request=pipeline_interface.RenameUserPipelineReleaseRequest( - name=f"{self.namespace}/pipelines/{name}", + name=f"{self.target_namespace}/pipelines/{name}", new_pipeline_release_id=new_version, ), metadata=self.hosts[self.instance].metadata, @@ -613,12 +618,12 @@ def list_pipeline_releases( return RequestFactory( method=self.hosts[self.instance].async_client.ListUserPipelineReleases, request=pipeline_interface.ListUserPipelineReleasesRequest( - parent=self.namespace, + parent=self.target_namespace, filter=filer_str, page_size=total_size, page_token=next_page_token, show_deleted=show_deleted, - view=pipeline_interface.ListUserPipelineReleasesRequest.VIEW_FULL, + view=pipeline_interface.Pipeline.VIEW_FULL, ), metadata=self.hosts[self.instance].metadata, ).send_async() @@ -626,12 +631,12 @@ def list_pipeline_releases( return RequestFactory( method=self.hosts[self.instance].client.ListUserPipelineReleases, request=pipeline_interface.ListUserPipelineReleasesRequest( - parent=self.namespace, + parent=self.target_namespace, filter=filer_str, page_size=total_size, page_token=next_page_token, show_deleted=show_deleted, - view=pipeline_interface.ListUserPipelineReleasesRequest.VIEW_FULL, + view=pipeline_interface.Pipeline.VIEW_FULL, ), metadata=self.hosts[self.instance].metadata, ).send_sync() @@ -646,7 +651,7 @@ def delete_pipeline_release( return RequestFactory( method=self.hosts[self.instance].async_client.DeleteUserPipelineRelease, request=pipeline_interface.DeleteUserPipelineReleaseRequest( - name=f"{self.namespace}/pipelines/{name}" + name=f"{self.target_namespace}/pipelines/{name}" ), metadata=self.hosts[self.instance].metadata, ).send_async() @@ -654,32 +659,7 @@ def delete_pipeline_release( return RequestFactory( method=self.hosts[self.instance].client.DeleteUserPipelineRelease, request=pipeline_interface.DeleteUserPipelineReleaseRequest( - name=f"{self.namespace}/pipelines/{name}" - ), - metadata=self.hosts[self.instance].metadata, - ).send_sync() - - @grpc_handler - def set_default_pipeline_release( - self, - name: str, - async_enabled: bool = False, - ) -> pipeline_interface.SetDefaultUserPipelineReleaseResponse: - if async_enabled: - return RequestFactory( - method=self.hosts[ - self.instance - ].async_client.SetDefaultUserPipelineRelease, - request=pipeline_interface.SetDefaultUserPipelineReleaseRequest( - name=f"{self.namespace}/pipelines/{name}", - ), - metadata=self.hosts[self.instance].metadata, - ).send_async() - - return RequestFactory( - method=self.hosts[self.instance].client.SetDefaultUserPipelineRelease, - request=pipeline_interface.SetDefaultUserPipelineReleaseRequest( - name=f"{self.namespace}/pipelines/{name}", + name=f"{self.target_namespace}/pipelines/{name}" ), metadata=self.hosts[self.instance].metadata, ).send_sync() @@ -696,7 +676,7 @@ def restore_pipeline_release( self.instance ].async_client.RestoreUserPipelineRelease, request=pipeline_interface.RestoreUserPipelineReleaseRequest( - name=f"{self.namespace}/pipelines/{name}", + name=f"{self.target_namespace}/pipelines/{name}", ), metadata=self.hosts[self.instance].metadata, ).send_async() @@ -704,7 +684,7 @@ def restore_pipeline_release( return RequestFactory( method=self.hosts[self.instance].client.RestoreUserPipelineRelease, request=pipeline_interface.RestoreUserPipelineReleaseRequest( - name=f"{self.namespace}/pipelines/{name}", + name=f"{self.target_namespace}/pipelines/{name}", ), metadata=self.hosts[self.instance].metadata, ).send_sync() @@ -719,7 +699,7 @@ def watch_pipeline_release( return RequestFactory( method=self.hosts[self.instance].async_client.WatchUserPipelineRelease, request=pipeline_interface.WatchUserPipelineReleaseRequest( - name=f"{self.namespace}/pipelines/{name}", + name=f"{self.target_namespace}/pipelines/{name}", ), metadata=self.hosts[self.instance].metadata, ).send_async() @@ -727,7 +707,7 @@ def watch_pipeline_release( return RequestFactory( method=self.hosts[self.instance].client.WatchUserPipelineRelease, request=pipeline_interface.WatchUserPipelineReleaseRequest( - name=f"{self.namespace}/pipelines/{name}", + name=f"{self.target_namespace}/pipelines/{name}", ), metadata=self.hosts[self.instance].metadata, ).send_sync() @@ -741,17 +721,19 @@ def trigger_pipeline_release( ) -> pipeline_interface.TriggerUserPipelineReleaseResponse: if async_enabled: return RequestFactory( - method=self.hosts[self.instance].async_client.TriggerUserPipelineReleas, + method=self.hosts[ + self.instance + ].async_client.TriggerUserPipelineRelease, request=pipeline_interface.TriggerUserPipelineReleaseRequest( - name=f"{self.namespace}/pipelines/{name}", inputs=inputs + name=f"{self.target_namespace}/pipelines/{name}", inputs=inputs ), metadata=self.hosts[self.instance].metadata, ).send_async() return RequestFactory( - method=self.hosts[self.instance].client.TriggerUserPipelineReleas, + method=self.hosts[self.instance].client.TriggerUserPipelineRelease, request=pipeline_interface.TriggerUserPipelineReleaseRequest( - name=f"{self.namespace}/pipelines/{name}", inputs=inputs + name=f"{self.target_namespace}/pipelines/{name}", inputs=inputs ), metadata=self.hosts[self.instance].metadata, ).send_sync() @@ -769,7 +751,7 @@ def trigger_async_pipeline_release( self.instance ].async_client.TriggerAsyncUserPipelineRelease, request=pipeline_interface.TriggerAsyncUserPipelineReleaseRequest( - name=f"{self.namespace}/pipelines/{name}", inputs=inputs + name=f"{self.target_namespace}/pipelines/{name}", inputs=inputs ), metadata=self.hosts[self.instance].metadata, ).send_async() @@ -777,218 +759,959 @@ def trigger_async_pipeline_release( return RequestFactory( method=self.hosts[self.instance].client.TriggerAsyncUserPipelineRelease, request=pipeline_interface.TriggerAsyncUserPipelineReleaseRequest( - name=f"{self.namespace}/pipelines/{name}", inputs=inputs + name=f"{self.target_namespace}/pipelines/{name}", inputs=inputs ), metadata=self.hosts[self.instance].metadata, ).send_sync() @grpc_handler - def create_connector( + def create_org_pipeline( self, name: str, - definition: str, - configuration: dict, + recipe: pipeline_interface.Recipe, async_enabled: bool = False, - ) -> connector_interface.CreateUserConnectorResponse: - connector = connector_interface.Connector() - connector.id = name - connector.connector_definition_name = definition - connector.configuration.update(configuration) + ) -> pipeline_interface.CreateOrganizationPipelineResponse: + pipeline = pipeline_interface.Pipeline( + id=name, + recipe=recipe, + ) if async_enabled: return RequestFactory( - method=self.hosts[self.instance].async_client.CreateUserConnector, - request=connector_interface.CreateUserConnectorRequest( - connector=connector, parent=self.namespace + method=self.hosts[ + self.instance + ].async_client.CreateOrganizationPipeline, + request=pipeline_interface.CreateOrganizationPipelineRequest( + pipeline=pipeline, parent=self.target_namespace ), metadata=self.hosts[self.instance].metadata, ).send_async() return RequestFactory( - method=self.hosts[self.instance].client.CreateUserConnector, - request=connector_interface.CreateUserConnectorRequest( - connector=connector, parent=self.namespace + method=self.hosts[self.instance].client.CreateOrganizationPipeline, + request=pipeline_interface.CreateOrganizationPipelineRequest( + pipeline=pipeline, parent=self.target_namespace ), metadata=self.hosts[self.instance].metadata, ).send_sync() @grpc_handler - def get_connector( + def get_org_pipeline( self, name: str, async_enabled: bool = False, - ) -> connector_interface.GetUserConnectorResponse: + ) -> pipeline_interface.GetUserPipelineResponse: if async_enabled: return RequestFactory( - method=self.hosts[self.instance].async_client.GetUserConnector, - request=connector_interface.GetUserConnectorRequest( - name=f"{self.namespace}/connectors/{name}", - view=connector_interface.GetUserConnectorRequest.VIEW_FULL, + method=self.hosts[self.instance].async_client.GetUserPipeline, + request=pipeline_interface.GetUserPipelineRequest( + name=f"{self.target_namespace}/pipelines/{name}" ), metadata=self.hosts[self.instance].metadata, ).send_async() return RequestFactory( - method=self.hosts[self.instance].client.GetUserConnector, - request=connector_interface.GetUserConnectorRequest( - name=f"{self.namespace}/connectors/{name}", - view=connector_interface.GetUserConnectorRequest.VIEW_FULL, + method=self.hosts[self.instance].client.GetUserPipeline, + request=pipeline_interface.GetUserPipelineRequest( + name=f"{self.target_namespace}/pipelines/{name}" ), metadata=self.hosts[self.instance].metadata, ).send_sync() @grpc_handler - def test_connector( + def rename_org_pipeline( self, name: str, + new_name: str, async_enabled: bool = False, - ) -> connector_interface.TestUserConnectorResponse: + ) -> pipeline_interface.RenameOrganizationPipelineResponse: if async_enabled: return RequestFactory( - method=self.hosts[self.instance].async_client.TestUserConnector, - request=connector_interface.TestUserConnectorRequest( - name=f"{self.namespace}/connectors/{name}" + method=self.hosts[ + self.instance + ].async_client.RenameOrganizationPipeline, + request=pipeline_interface.RenameOrganizationPipelineRequest( + name=f"{self.target_namespace}/pipelines/{name}", + new_pipeline_id=new_name, ), metadata=self.hosts[self.instance].metadata, ).send_async() return RequestFactory( - method=self.hosts[self.instance].client.TestUserConnector, - request=connector_interface.TestUserConnectorRequest( - name=f"{self.namespace}/connectors/{name}" + method=self.hosts[self.instance].client.RenameOrganizationPipeline, + request=pipeline_interface.RenameOrganizationPipelineRequest( + name=f"{self.target_namespace}/pipelines/{name}", + new_pipeline_id=new_name, ), metadata=self.hosts[self.instance].metadata, ).send_sync() @grpc_handler - def execute_connector( + def update_org_pipeline( + self, + pipeline: pipeline_interface.Pipeline, + mask: field_mask_pb2.FieldMask, + async_enabled: bool = False, + ) -> pipeline_interface.UpdateOrganizationPipelineResponse: + if async_enabled: + return RequestFactory( + method=self.hosts[ + self.instance + ].async_client.UpdateOrganizationPipeline, + request=pipeline_interface.UpdateOrganizationPipelineRequest( + pipeline=pipeline, + update_mask=mask, + ), + metadata=self.hosts[self.instance].metadata, + ).send_async() + + return RequestFactory( + method=self.hosts[self.instance].client.UpdateOrganizationPipeline, + request=pipeline_interface.UpdateOrganizationPipelineRequest( + pipeline=pipeline, + update_mask=mask, + ), + metadata=self.hosts[self.instance].metadata, + ).send_sync() + + @grpc_handler + def validate_org_pipeline( + self, + name: str, + async_enabled: bool = False, + ) -> pipeline_interface.ValidateUserPipelineResponse: + if async_enabled: + return RequestFactory( + method=self.hosts[ + self.instance + ].async_client.ValidateOrganizationPipeline, + request=pipeline_interface.ValidateOrganizationPipelineRequest( + name=f"{self.target_namespace}/pipelines/{name}" + ), + metadata=self.hosts[self.instance].metadata, + ).send_async() + + return RequestFactory( + method=self.hosts[self.instance].client.ValidateOrganizationPipeline, + request=pipeline_interface.ValidateOrganizationPipelineRequest( + name=f"{self.target_namespace}/pipelines/{name}" + ), + metadata=self.hosts[self.instance].metadata, + ).send_sync() + + @grpc_handler + def trigger_org_pipeline( self, name: str, inputs: list, async_enabled: bool = False, - ) -> connector_interface.ExecuteUserConnectorResponse: + ) -> pipeline_interface.TriggerOrganizationPipelineResponse: if async_enabled: return RequestFactory( - method=self.hosts[self.instance].async_client.ExecuteUserConnector, - request=connector_interface.ExecuteUserConnectorRequest( - name=f"{self.namespace}/connectors/{name}", inputs=inputs + method=self.hosts[ + self.instance + ].async_client.TriggerOrganizationPipeline, + request=pipeline_interface.TriggerOrganizationPipelineRequest( + name=f"{self.target_namespace}/pipelines/{name}", inputs=inputs ), metadata=self.hosts[self.instance].metadata, ).send_async() return RequestFactory( - method=self.hosts[self.instance].client.ExecuteUserConnector, - request=connector_interface.ExecuteUserConnectorRequest( - name=f"{self.namespace}/connectors/{name}", inputs=inputs + method=self.hosts[self.instance].client.TriggerOrganizationPipeline, + request=pipeline_interface.TriggerOrganizationPipelineRequest( + name=f"{self.target_namespace}/pipelines/{name}", inputs=inputs ), metadata=self.hosts[self.instance].metadata, ).send_sync() @grpc_handler - def watch_connector( + def trigger_org_async_pipeline( self, name: str, + inputs: list, async_enabled: bool = False, - ) -> connector_interface.WatchUserConnectorResponse: + ) -> pipeline_interface.TriggerAsyncOrganizationPipelineResponse: if async_enabled: return RequestFactory( - method=self.hosts[self.instance].async_client.WatchUserConnector, - request=connector_interface.WatchUserConnectorRequest( - name=f"{self.namespace}/connectors/{name}" + method=self.hosts[ + self.instance + ].async_client.TriggerAsyncOrganizationPipeline, + request=pipeline_interface.TriggerAsyncOrganizationPipelineRequest( + name=f"{self.target_namespace}/pipelines/{name}", inputs=inputs ), metadata=self.hosts[self.instance].metadata, ).send_async() return RequestFactory( - method=self.hosts[self.instance].client.WatchUserConnector, - request=connector_interface.WatchUserConnectorRequest( - name=f"{self.namespace}/connectors/{name}" + method=self.hosts[self.instance].client.TriggerAsyncOrganizationPipeline, + request=pipeline_interface.TriggerAsyncOrganizationPipelineRequest( + name=f"{self.target_namespace}/pipelines/{name}", inputs=inputs ), metadata=self.hosts[self.instance].metadata, ).send_sync() @grpc_handler - def delete_connector( + def delete_org_pipeline( self, name: str, async_enabled: bool = False, - ) -> connector_interface.DeleteUserConnectorResponse: + ) -> pipeline_interface.DeleteOrganizationPipelineResponse: if async_enabled: return RequestFactory( - method=self.hosts[self.instance].async_client.DeleteUserConnector, - request=connector_interface.DeleteUserConnectorRequest( - name=f"{self.namespace}/connectors/{name}" + method=self.hosts[ + self.instance + ].async_client.DeleteOrganizationPipeline, + request=pipeline_interface.DeleteOrganizationPipelineReleaseRequest( + name=f"{self.target_namespace}/pipelines/{name}" ), metadata=self.hosts[self.instance].metadata, ).send_async() return RequestFactory( - method=self.hosts[self.instance].client.DeleteUserConnector, - request=connector_interface.DeleteUserConnectorRequest( - name=f"{self.namespace}/connectors/{name}" + method=self.hosts[self.instance].client.DeleteOrganizationPipeline, + request=pipeline_interface.DeleteOrganizationPipelineReleaseRequest( + name=f"{self.target_namespace}/pipelines/{name}" ), metadata=self.hosts[self.instance].metadata, ).send_sync() @grpc_handler - def list_connectors( + def list_org_pipelines( self, filer_str: str = "", next_page_token: str = "", total_size: int = 100, show_deleted: bool = False, - public=False, async_enabled: bool = False, - ) -> connector_interface.ListUserConnectorsResponse: + ) -> pipeline_interface.ListOrganizationPipelinesResponse: if async_enabled: - if public: - method = self.hosts[self.instance].async_client.ListConnectors - return RequestFactory( - method=method, - request=connector_interface.ListConnectorsRequest( - filter=filer_str, - page_size=total_size, - page_token=next_page_token, - show_deleted=show_deleted, - view=connector_interface.ListConnectorsRequest.VIEW_FULL, - ), - metadata=self.hosts[self.instance].metadata, - ).send_async() - method = self.hosts[self.instance].async_client.ListUserConnectors return RequestFactory( - method=method, - request=connector_interface.ListUserConnectorsRequest( - parent=self.namespace, + method=self.hosts[self.instance].async_client.ListOrganizationPipelines, + request=pipeline_interface.ListOrganizationPipelinesRequest( + parent=self.target_namespace, filter=filer_str, page_size=total_size, page_token=next_page_token, show_deleted=show_deleted, - view=connector_interface.ListUserConnectorsRequest.VIEW_FULL, + view=pipeline_interface.Pipeline.VIEW_FULL, ), metadata=self.hosts[self.instance].metadata, ).send_async() - if public: - method = self.hosts[self.instance].client.ListConnectors + return RequestFactory( + method=self.hosts[self.instance].client.ListOrganizationPipelines, + request=pipeline_interface.ListOrganizationPipelinesRequest( + parent=self.target_namespace, + filter=filer_str, + page_size=total_size, + page_token=next_page_token, + show_deleted=show_deleted, + view=pipeline_interface.Pipeline.VIEW_FULL, + ), + metadata=self.hosts[self.instance].metadata, + ).send_sync() + + @grpc_handler + def create_org_pipeline_release( + self, + version: str, + async_enabled: bool = False, + ) -> pipeline_interface.CreateOrganizationPipelineReleaseResponse: + """Create a release version of a pipeline + + Args: + name (str): Must be a sematic version vX.Y.Z + + Returns: + pipeline_interface.PipelineRelease: Released pipeline + """ + pipeline_release = pipeline_interface.PipelineRelease( + id=version, + ) + if async_enabled: return RequestFactory( - method=method, - request=connector_interface.ListConnectorsRequest( - filter=filer_str, - page_size=total_size, - page_token=next_page_token, - show_deleted=show_deleted, - view=connector_interface.ListConnectorsRequest.VIEW_FULL, + method=self.hosts[ + self.instance + ].async_client.CreateOrganizationPipelineRelease, + request=pipeline_interface.CreateOrganizationPipelineReleaseRequest( + release=pipeline_release, parent=self.target_namespace ), metadata=self.hosts[self.instance].metadata, - ).send_sync() - method = self.hosts[self.instance].client.ListUserConnectors + ).send_async() + return RequestFactory( - method=method, - request=connector_interface.ListUserConnectorsRequest( - parent=self.namespace, + method=self.hosts[self.instance].client.CreateOrganizationPipelineRelease, + request=pipeline_interface.CreateOrganizationPipelineReleaseRequest( + release=pipeline_release, parent=self.target_namespace + ), + metadata=self.hosts[self.instance].metadata, + ).send_sync() + + @grpc_handler + def get_org_pipeline_release( + self, + name: str, + async_enabled: bool = False, + ) -> pipeline_interface.GetOrganizationPipelineReleaseResponse: + """Get a released pipeline + + Args: + name (str): Must have the format of {name}/releases/* + + Returns: + pipeline_interface.Pipeline: Released pipeline + """ + if async_enabled: + return RequestFactory( + method=self.hosts[ + self.instance + ].async_client.GetOrganizationPipelineRelease, + request=pipeline_interface.GetOrganizationPipelineReleaseRequest( + name=f"{self.target_namespace}/pipelines/{name}", + view=pipeline_interface.Pipeline.VIEW_FULL, + ), + metadata=self.hosts[self.instance].metadata, + ).send_async() + + return RequestFactory( + method=self.hosts[self.instance].client.GetOrganizationPipelineRelease, + request=pipeline_interface.GetOrganizationPipelineReleaseRequest( + name=f"{self.target_namespace}/pipelines/{name}", + view=pipeline_interface.Pipeline.VIEW_FULL, + ), + metadata=self.hosts[self.instance].metadata, + ).send_sync() + + @grpc_handler + def rename_org_pipeline_release( + self, + name: str, + new_version: str, + async_enabled: bool = False, + ) -> pipeline_interface.RenameOrganizationPipelineReleaseResponse: + """Rename a released pipeline + + Args: + name (str): Must have the format of {name}/releases/* + new_version (str): New release version, must be a sematic version vX.Y.Z + + Returns: + pipeline_interface.PipelineRelease: released pipeline + """ + if async_enabled: + return RequestFactory( + method=self.hosts[ + self.instance + ].async_client.RenameOrganizationPipelineRelease, + request=pipeline_interface.RenameOrganizationPipelineReleaseRequest( + name=f"{self.target_namespace}/pipelines/{name}", + new_pipeline_release_id=new_version, + ), + metadata=self.hosts[self.instance].metadata, + ).send_async() + + return RequestFactory( + method=self.hosts[self.instance].client.RenameOrganizationPipelineRelease, + request=pipeline_interface.RenameOrganizationPipelineReleaseRequest( + name=f"{self.target_namespace}/pipelines/{name}", + new_pipeline_release_id=new_version, + ), + metadata=self.hosts[self.instance].metadata, + ).send_sync() + + @grpc_handler + def update_org_pipeline_release( + self, + pipeline_release: pipeline_interface.PipelineRelease, + mask: field_mask_pb2.FieldMask, + async_enabled: bool = False, + ) -> pipeline_interface.UpdateOrganizationPipelineReleaseResponse: + if async_enabled: + return RequestFactory( + method=self.hosts[ + self.instance + ].async_client.UpdateOrganizationPipelineRelease, + request=pipeline_interface.UpdateOrganizationPipelineReleaseRequest( + release=pipeline_release, + update_mask=mask, + ), + metadata=self.hosts[self.instance].metadata, + ).send_async() + + return RequestFactory( + method=self.hosts[self.instance].client.UpdateOrganizationPipelineRelease, + request=pipeline_interface.UpdateOrganizationPipelineReleaseRequest( + release=pipeline_release, + update_mask=mask, + ), + metadata=self.hosts[self.instance].metadata, + ).send_sync() + + @grpc_handler + def list_org_pipeline_releases( + self, + filer_str: str = "", + next_page_token: str = "", + total_size: int = 100, + show_deleted: bool = False, + async_enabled: bool = False, + ) -> pipeline_interface.ListOrganizationPipelineReleasesResponse: + if async_enabled: + return RequestFactory( + method=self.hosts[ + self.instance + ].async_client.ListOrganizationPipelineReleases, + request=pipeline_interface.ListOrganizationPipelineReleasesRequest( + parent=self.target_namespace, + filter=filer_str, + page_size=total_size, + page_token=next_page_token, + show_deleted=show_deleted, + view=pipeline_interface.Pipeline.VIEW_FULL, + ), + metadata=self.hosts[self.instance].metadata, + ).send_async() + + return RequestFactory( + method=self.hosts[self.instance].client.ListOrganizationPipelineReleases, + request=pipeline_interface.ListOrganizationPipelineReleasesRequest( + parent=self.target_namespace, + filter=filer_str, + page_size=total_size, + page_token=next_page_token, + show_deleted=show_deleted, + view=pipeline_interface.Pipeline.VIEW_FULL, + ), + metadata=self.hosts[self.instance].metadata, + ).send_sync() + + @grpc_handler + def delete_org_pipeline_release( + self, + name: str, + async_enabled: bool = False, + ) -> pipeline_interface.DeleteOrganizationPipelineReleaseResponse: + if async_enabled: + return RequestFactory( + method=self.hosts[ + self.instance + ].async_client.DeleteOrganizationPipelineRelease, + request=pipeline_interface.DeleteOrganizationPipelineReleaseRequest( + name=f"{self.target_namespace}/pipelines/{name}" + ), + metadata=self.hosts[self.instance].metadata, + ).send_async() + + return RequestFactory( + method=self.hosts[self.instance].client.DeleteOrganizationPipelineRelease, + request=pipeline_interface.DeleteOrganizationPipelineReleaseRequest( + name=f"{self.target_namespace}/pipelines/{name}" + ), + metadata=self.hosts[self.instance].metadata, + ).send_sync() + + @grpc_handler + def restore_org_pipeline_release( + self, + name: str, + async_enabled: bool = False, + ) -> pipeline_interface.RestoreOrganizationPipelineReleaseResponse: + if async_enabled: + return RequestFactory( + method=self.hosts[ + self.instance + ].async_client.RestoreOrganizationPipelineRelease, + request=pipeline_interface.RestoreOrganizationPipelineReleaseRequest( + name=f"{self.target_namespace}/pipelines/{name}", + ), + metadata=self.hosts[self.instance].metadata, + ).send_async() + + return RequestFactory( + method=self.hosts[self.instance].client.RestoreOrganizationPipelineRelease, + request=pipeline_interface.RestoreOrganizationPipelineReleaseRequest( + name=f"{self.target_namespace}/pipelines/{name}", + ), + metadata=self.hosts[self.instance].metadata, + ).send_sync() + + @grpc_handler + def watch_org_pipeline_release( + self, + name: str, + async_enabled: bool = False, + ) -> pipeline_interface.WatchOrganizationPipelineReleaseResponse: + if async_enabled: + return RequestFactory( + method=self.hosts[ + self.instance + ].async_client.WatchOrganizationPipelineRelease, + request=pipeline_interface.WatchOrganizationPipelineReleaseRequest( + name=f"{self.target_namespace}/pipelines/{name}", + ), + metadata=self.hosts[self.instance].metadata, + ).send_async() + + return RequestFactory( + method=self.hosts[self.instance].client.WatchOrganizationPipelineRelease, + request=pipeline_interface.WatchOrganizationPipelineReleaseRequest( + name=f"{self.target_namespace}/pipelines/{name}", + ), + metadata=self.hosts[self.instance].metadata, + ).send_sync() + + @grpc_handler + def trigger_org_pipeline_release( + self, + name: str, + inputs: list, + async_enabled: bool = False, + ) -> pipeline_interface.TriggerOrganizationPipelineReleaseResponse: + if async_enabled: + return RequestFactory( + method=self.hosts[ + self.instance + ].async_client.TriggerOrganizationPipelineRelease, + request=pipeline_interface.TriggerOrganizationPipelineReleaseRequest( + name=f"{self.target_namespace}/pipelines/{name}", inputs=inputs + ), + metadata=self.hosts[self.instance].metadata, + ).send_async() + + return RequestFactory( + method=self.hosts[self.instance].client.TriggerOrganizationPipelineRelease, + request=pipeline_interface.TriggerOrganizationPipelineReleaseRequest( + name=f"{self.target_namespace}/pipelines/{name}", inputs=inputs + ), + metadata=self.hosts[self.instance].metadata, + ).send_sync() + + @grpc_handler + def trigger_async_org_pipeline_release( + self, + name: str, + inputs: list, + async_enabled: bool = False, + ) -> pipeline_interface.TriggerAsyncOrganizationPipelineReleaseResponse: + if async_enabled: + return RequestFactory( + method=self.hosts[ + self.instance + ].async_client.TriggerAsyncOrganizationPipelineRelease, + request=pipeline_interface.TriggerOrganizationPipelineReleaseRequest( + name=f"{self.target_namespace}/pipelines/{name}", inputs=inputs + ), + metadata=self.hosts[self.instance].metadata, + ).send_async() + + return RequestFactory( + method=self.hosts[ + self.instance + ].client.TriggerAsyncOrganizationPipelineRelease, + request=pipeline_interface.TriggerOrganizationPipelineReleaseRequest( + name=f"{self.target_namespace}/pipelines/{name}", inputs=inputs + ), + metadata=self.hosts[self.instance].metadata, + ).send_sync() + + @grpc_handler + def create_connector( + self, + name: str, + definition: str, + configuration: dict, + async_enabled: bool = False, + ) -> connector_interface.CreateUserConnectorResponse: + connector = connector_interface.Connector() + connector.id = name + connector.connector_definition_name = definition + connector.configuration.update(configuration) + if async_enabled: + return RequestFactory( + method=self.hosts[self.instance].async_client.CreateUserConnector, + request=connector_interface.CreateUserConnectorRequest( + connector=connector, parent=self.target_namespace + ), + metadata=self.hosts[self.instance].metadata, + ).send_async() + + return RequestFactory( + method=self.hosts[self.instance].client.CreateUserConnector, + request=connector_interface.CreateUserConnectorRequest( + connector=connector, parent=self.target_namespace + ), + metadata=self.hosts[self.instance].metadata, + ).send_sync() + + @grpc_handler + def get_connector( + self, + name: str, + async_enabled: bool = False, + ) -> connector_interface.GetUserConnectorResponse: + if async_enabled: + return RequestFactory( + method=self.hosts[self.instance].async_client.GetUserConnector, + request=connector_interface.GetUserConnectorRequest( + name=f"{self.target_namespace}/connectors/{name}", + view=connector_interface.Connector.VIEW_FULL, + ), + metadata=self.hosts[self.instance].metadata, + ).send_async() + + return RequestFactory( + method=self.hosts[self.instance].client.GetUserConnector, + request=connector_interface.GetUserConnectorRequest( + name=f"{self.target_namespace}/connectors/{name}", + view=connector_interface.Connector.VIEW_FULL, + ), + metadata=self.hosts[self.instance].metadata, + ).send_sync() + + @grpc_handler + def test_connector( + self, + name: str, + async_enabled: bool = False, + ) -> connector_interface.TestUserConnectorResponse: + if async_enabled: + return RequestFactory( + method=self.hosts[self.instance].async_client.TestUserConnector, + request=connector_interface.TestUserConnectorRequest( + name=f"{self.target_namespace}/connectors/{name}" + ), + metadata=self.hosts[self.instance].metadata, + ).send_async() + + return RequestFactory( + method=self.hosts[self.instance].client.TestUserConnector, + request=connector_interface.TestUserConnectorRequest( + name=f"{self.target_namespace}/connectors/{name}" + ), + metadata=self.hosts[self.instance].metadata, + ).send_sync() + + @grpc_handler + def execute_connector( + self, + name: str, + inputs: list, + async_enabled: bool = False, + ) -> connector_interface.ExecuteUserConnectorResponse: + if async_enabled: + return RequestFactory( + method=self.hosts[self.instance].async_client.ExecuteUserConnector, + request=connector_interface.ExecuteUserConnectorRequest( + name=f"{self.target_namespace}/connectors/{name}", inputs=inputs + ), + metadata=self.hosts[self.instance].metadata, + ).send_async() + + return RequestFactory( + method=self.hosts[self.instance].client.ExecuteUserConnector, + request=connector_interface.ExecuteUserConnectorRequest( + name=f"{self.target_namespace}/connectors/{name}", inputs=inputs + ), + metadata=self.hosts[self.instance].metadata, + ).send_sync() + + @grpc_handler + def watch_connector( + self, + name: str, + async_enabled: bool = False, + ) -> connector_interface.WatchUserConnectorResponse: + if async_enabled: + return RequestFactory( + method=self.hosts[self.instance].async_client.WatchUserConnector, + request=connector_interface.WatchUserConnectorRequest( + name=f"{self.target_namespace}/connectors/{name}" + ), + metadata=self.hosts[self.instance].metadata, + ).send_async() + + return RequestFactory( + method=self.hosts[self.instance].client.WatchUserConnector, + request=connector_interface.WatchUserConnectorRequest( + name=f"{self.target_namespace}/connectors/{name}" + ), + metadata=self.hosts[self.instance].metadata, + ).send_sync() + + @grpc_handler + def delete_connector( + self, + name: str, + async_enabled: bool = False, + ) -> connector_interface.DeleteUserConnectorResponse: + if async_enabled: + return RequestFactory( + method=self.hosts[self.instance].async_client.DeleteUserConnector, + request=connector_interface.DeleteUserConnectorRequest( + name=f"{self.target_namespace}/connectors/{name}" + ), + metadata=self.hosts[self.instance].metadata, + ).send_async() + + return RequestFactory( + method=self.hosts[self.instance].client.DeleteUserConnector, + request=connector_interface.DeleteUserConnectorRequest( + name=f"{self.target_namespace}/connectors/{name}" + ), + metadata=self.hosts[self.instance].metadata, + ).send_sync() + + @grpc_handler + def list_connectors( + self, + filer_str: str = "", + next_page_token: str = "", + total_size: int = 100, + show_deleted: bool = False, + public=False, + async_enabled: bool = False, + ) -> connector_interface.ListUserConnectorsResponse: + if async_enabled: + if public: + method = self.hosts[self.instance].async_client.ListConnectors + return RequestFactory( + method=method, + request=connector_interface.ListConnectorsRequest( + filter=filer_str, + page_size=total_size, + page_token=next_page_token, + show_deleted=show_deleted, + view=connector_interface.Connector.VIEW_FULL, + ), + metadata=self.hosts[self.instance].metadata, + ).send_async() + method = self.hosts[self.instance].async_client.ListUserConnectors + return RequestFactory( + method=method, + request=connector_interface.ListUserConnectorsRequest( + parent=self.target_namespace, + filter=filer_str, + page_size=total_size, + page_token=next_page_token, + show_deleted=show_deleted, + view=connector_interface.Connector.VIEW_FULL, + ), + metadata=self.hosts[self.instance].metadata, + ).send_async() + if public: + method = self.hosts[self.instance].client.ListConnectors + return RequestFactory( + method=method, + request=connector_interface.ListConnectorsRequest( + filter=filer_str, + page_size=total_size, + page_token=next_page_token, + show_deleted=show_deleted, + view=connector_interface.Connector.VIEW_FULL, + ), + metadata=self.hosts[self.instance].metadata, + ).send_sync() + method = self.hosts[self.instance].client.ListUserConnectors + return RequestFactory( + method=method, + request=connector_interface.ListUserConnectorsRequest( + parent=self.target_namespace, + filter=filer_str, + page_size=total_size, + page_token=next_page_token, + show_deleted=show_deleted, + view=connector_interface.Connector.VIEW_FULL, + ), + metadata=self.hosts[self.instance].metadata, + ).send_sync() + + @grpc_handler + def create_org_connector( + self, + name: str, + definition: str, + configuration: dict, + async_enabled: bool = False, + ) -> connector_interface.CreateOrganizationConnectorResponse: + connector = connector_interface.Connector() + connector.id = name + connector.connector_definition_name = definition + connector.configuration.update(configuration) + if async_enabled: + return RequestFactory( + method=self.hosts[ + self.instance + ].async_client.CreateOrganizationConnector, + request=connector_interface.CreateOrganizationConnectorRequest( + connector=connector, parent=self.target_namespace + ), + metadata=self.hosts[self.instance].metadata, + ).send_async() + + return RequestFactory( + method=self.hosts[self.instance].client.CreateOrganizationConnector, + request=connector_interface.CreateOrganizationConnectorRequest( + connector=connector, parent=self.target_namespace + ), + metadata=self.hosts[self.instance].metadata, + ).send_sync() + + @grpc_handler + def get_org_connector( + self, + name: str, + async_enabled: bool = False, + ) -> connector_interface.GetOrganizationConnectorResponse: + if async_enabled: + return RequestFactory( + method=self.hosts[self.instance].async_client.GetOrganizationConnector, + request=connector_interface.GetOrganizationConnectorRequest( + name=f"{self.target_namespace}/connectors/{name}", + view=connector_interface.Connector.VIEW_FULL, + ), + metadata=self.hosts[self.instance].metadata, + ).send_async() + + return RequestFactory( + method=self.hosts[self.instance].client.GetOrganizationConnector, + request=connector_interface.GetOrganizationConnectorRequest( + name=f"{self.target_namespace}/connectors/{name}", + view=connector_interface.Connector.VIEW_FULL, + ), + metadata=self.hosts[self.instance].metadata, + ).send_sync() + + @grpc_handler + def test_org_connector( + self, + name: str, + async_enabled: bool = False, + ) -> connector_interface.TestOrganizationConnectorResponse: + if async_enabled: + return RequestFactory( + method=self.hosts[self.instance].async_client.TestOrganizationConnector, + request=connector_interface.TestOrganizationConnectorRequest( + name=f"{self.target_namespace}/connectors/{name}" + ), + metadata=self.hosts[self.instance].metadata, + ).send_async() + + return RequestFactory( + method=self.hosts[self.instance].client.TestOrganizationConnector, + request=connector_interface.TestOrganizationConnectorRequest( + name=f"{self.target_namespace}/connectors/{name}" + ), + metadata=self.hosts[self.instance].metadata, + ).send_sync() + + @grpc_handler + def execute_org_connector( + self, + name: str, + inputs: list, + async_enabled: bool = False, + ) -> connector_interface.ExecuteOrganizationConnectorResponse: + if async_enabled: + return RequestFactory( + method=self.hosts[ + self.instance + ].async_client.ExecuteOrganizationConnector, + request=connector_interface.ExecuteOrganizationConnectorRequest( + name=f"{self.target_namespace}/connectors/{name}", inputs=inputs + ), + metadata=self.hosts[self.instance].metadata, + ).send_async() + + return RequestFactory( + method=self.hosts[self.instance].client.ExecuteOrganizationConnector, + request=connector_interface.ExecuteOrganizationConnectorRequest( + name=f"{self.target_namespace}/connectors/{name}", inputs=inputs + ), + metadata=self.hosts[self.instance].metadata, + ).send_sync() + + @grpc_handler + def watch_org_connector( + self, + name: str, + async_enabled: bool = False, + ) -> connector_interface.WatchOrganizationConnectorResponse: + if async_enabled: + return RequestFactory( + method=self.hosts[ + self.instance + ].async_client.WatchOrganizationConnector, + request=connector_interface.WatchOrganizationConnectorRequest( + name=f"{self.target_namespace}/connectors/{name}" + ), + metadata=self.hosts[self.instance].metadata, + ).send_async() + + return RequestFactory( + method=self.hosts[self.instance].client.WatchOrganizationConnector, + request=connector_interface.WatchOrganizationConnectorRequest( + name=f"{self.target_namespace}/connectors/{name}" + ), + metadata=self.hosts[self.instance].metadata, + ).send_sync() + + @grpc_handler + def delete_org_connector( + self, + name: str, + async_enabled: bool = False, + ) -> connector_interface.DeleteOrganizationConnectorResponse: + if async_enabled: + return RequestFactory( + method=self.hosts[ + self.instance + ].async_client.DeleteOrganizationConnector, + request=connector_interface.DeleteOrganizationConnectorRequest( + name=f"{self.target_namespace}/connectors/{name}" + ), + metadata=self.hosts[self.instance].metadata, + ).send_async() + + return RequestFactory( + method=self.hosts[self.instance].client.DeleteOrganizationConnector, + request=connector_interface.DeleteOrganizationConnectorRequest( + name=f"{self.target_namespace}/connectors/{name}" + ), + metadata=self.hosts[self.instance].metadata, + ).send_sync() + + @grpc_handler + def list_org_connectors( + self, + filer_str: str = "", + next_page_token: str = "", + total_size: int = 100, + show_deleted: bool = False, + async_enabled: bool = False, + ) -> connector_interface.ListOrganizationConnectorsResponse: + if async_enabled: + return RequestFactory( + method=self.hosts[ + self.instance + ].async_client.ListOrganizationConnectors, + request=connector_interface.ListOrganizationConnectorsRequest( + parent=self.target_namespace, + filter=filer_str, + page_size=total_size, + page_token=next_page_token, + show_deleted=show_deleted, + view=connector_interface.Connector.VIEW_FULL, + ), + metadata=self.hosts[self.instance].metadata, + ).send_async() + return RequestFactory( + method=self.hosts[self.instance].client.ListOrganizationConnectors, + request=connector_interface.ListOrganizationConnectorsRequest( + parent=self.target_namespace, filter=filer_str, page_size=total_size, page_token=next_page_token, show_deleted=show_deleted, - view=connector_interface.ListUserConnectorsRequest.VIEW_FULL, + view=connector_interface.Connector.VIEW_FULL, ), metadata=self.hosts[self.instance].metadata, ).send_sync() diff --git a/instill/protogen b/instill/protogen index 1a79bb4..e528ce4 160000 --- a/instill/protogen +++ b/instill/protogen @@ -1 +1 @@ -Subproject commit 1a79bb456b1e1b3d44d84de9b5cb5fd411a621f5 +Subproject commit e528ce44652f51d1270c064f611a38ebdee0b34b diff --git a/instill/resources/__init__.py b/instill/resources/__init__.py index 99a9d3e..34eaafe 100644 --- a/instill/resources/__init__.py +++ b/instill/resources/__init__.py @@ -6,8 +6,8 @@ import instill.protogen.model.model.v1alpha.task_semantic_segmentation_pb2 as task_semantic_segmentation import instill.protogen.model.model.v1alpha.task_text_generation_pb2 as task_text_generation import instill.protogen.model.model.v1alpha.task_text_to_image_pb2 as task_text_to_image -import instill.protogen.vdp.pipeline.v1alpha.connector_pb2 as connector_pb -import instill.protogen.vdp.pipeline.v1alpha.pipeline_pb2 as pipeline_pb +import instill.protogen.vdp.pipeline.v1beta.connector_pb2 as connector_pb +import instill.protogen.vdp.pipeline.v1beta.pipeline_pb2 as pipeline_pb from instill.resources.connector import Connector from instill.resources.connector_ai import ( InstillModelConnector, diff --git a/instill/resources/connector.py b/instill/resources/connector.py index 34dce3d..b7f9a45 100644 --- a/instill/resources/connector.py +++ b/instill/resources/connector.py @@ -1,7 +1,7 @@ # pylint: disable=no-member,wrong-import-position,no-name-in-module -import instill.protogen.vdp.pipeline.v1alpha.connector_definition_pb2 as connector_definition_interface -import instill.protogen.vdp.pipeline.v1alpha.connector_pb2 as connector_interface -import instill.protogen.vdp.pipeline.v1alpha.pipeline_pb2 as pipeline_interface +import instill.protogen.vdp.pipeline.v1beta.connector_definition_pb2 as connector_definition_interface +import instill.protogen.vdp.pipeline.v1beta.connector_pb2 as connector_interface +import instill.protogen.vdp.pipeline.v1beta.pipeline_pb2 as pipeline_interface from instill.clients import InstillClient from instill.resources.resource import Resource diff --git a/instill/resources/operator.py b/instill/resources/operator.py index 8e6db27..c043c60 100644 --- a/instill/resources/operator.py +++ b/instill/resources/operator.py @@ -1,5 +1,5 @@ # pylint: disable=no-member,wrong-import-position -import instill.protogen.vdp.pipeline.v1alpha.pipeline_pb2 as pipeline_pb +import instill.protogen.vdp.pipeline.v1beta.pipeline_pb2 as pipeline_pb def create_start_operator(config: dict) -> pipeline_pb.Component: diff --git a/instill/resources/pipeline.py b/instill/resources/pipeline.py index cbd9210..d0cbf91 100644 --- a/instill/resources/pipeline.py +++ b/instill/resources/pipeline.py @@ -3,7 +3,7 @@ from google.longrunning import operations_pb2 -import instill.protogen.vdp.pipeline.v1alpha.pipeline_pb2 as pipeline_interface +import instill.protogen.vdp.pipeline.v1beta.pipeline_pb2 as pipeline_interface from instill.clients import InstillClient from instill.resources.resource import Resource diff --git a/instill/resources/recipe.py b/instill/resources/recipe.py index d3503e9..5269b2b 100644 --- a/instill/resources/recipe.py +++ b/instill/resources/recipe.py @@ -1,10 +1,10 @@ # pylint: disable=no-member,wrong-import-position -import instill.protogen.vdp.pipeline.v1alpha.pipeline_pb2 as pipeline_pb +import instill.protogen.vdp.pipeline.v1beta.pipeline_pb2 as pipeline_pb def create_recipe(component: list) -> pipeline_pb.Recipe: recipe = pipeline_pb.Recipe() - recipe.version = "v1alpha" + recipe.version = "v1beta" recipe.components.extend(component) return recipe diff --git a/instill/tests/test_client.py b/instill/tests/test_client.py index b780d46..e6b6639 100644 --- a/instill/tests/test_client.py +++ b/instill/tests/test_client.py @@ -1,8 +1,8 @@ # pylint: disable=redefined-outer-name,unused-variable,expression-not-assigned,no-name-in-module -import instill.protogen.core.mgmt.v1alpha.mgmt_public_service_pb2_grpc as mgmt_service +import instill.protogen.core.mgmt.v1beta.mgmt_public_service_pb2_grpc as mgmt_service import instill.protogen.model.model.v1alpha.model_public_service_pb2_grpc as model_service -import instill.protogen.vdp.pipeline.v1alpha.pipeline_public_service_pb2_grpc as pipeline_service +import instill.protogen.vdp.pipeline.v1beta.pipeline_public_service_pb2_grpc as pipeline_service from instill.clients import MgmtClient, ModelClient, PipelineClient from instill.clients.instance import InstillInstance diff --git a/tests/test_client.py b/tests/test_client.py index b780d46..e6b6639 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -1,8 +1,8 @@ # pylint: disable=redefined-outer-name,unused-variable,expression-not-assigned,no-name-in-module -import instill.protogen.core.mgmt.v1alpha.mgmt_public_service_pb2_grpc as mgmt_service +import instill.protogen.core.mgmt.v1beta.mgmt_public_service_pb2_grpc as mgmt_service import instill.protogen.model.model.v1alpha.model_public_service_pb2_grpc as model_service -import instill.protogen.vdp.pipeline.v1alpha.pipeline_public_service_pb2_grpc as pipeline_service +import instill.protogen.vdp.pipeline.v1beta.pipeline_public_service_pb2_grpc as pipeline_service from instill.clients import MgmtClient, ModelClient, PipelineClient from instill.clients.instance import InstillInstance