예제 #1
0
    def get_template_client(self, region: Optional[str] = None) -> WorkflowTemplateServiceClient:
        """Returns WorkflowTemplateServiceClient."""
        client_options = None
        if region and region != 'global':
            client_options = ClientOptions(api_endpoint=f'{region}-dataproc.googleapis.com:443')

        return WorkflowTemplateServiceClient(
            credentials=self._get_credentials(), client_info=CLIENT_INFO, client_options=client_options
        )
예제 #2
0
    def get_template_client(
        self, region: Optional[str] = None, location: Optional[str] = None
    ) -> WorkflowTemplateServiceClient:
        """Returns WorkflowTemplateServiceClient."""
        if location is not None:
            warnings.warn(
                "Parameter `location` will be deprecated. "
                "Please provide value through `region` parameter instead.",
                DeprecationWarning,
                stacklevel=2,
            )
            region = location
        client_options = None
        if region and region != 'global':
            client_options = {'api_endpoint': f'{region}-dataproc.googleapis.com:443'}

        return WorkflowTemplateServiceClient(
            credentials=self._get_credentials(), client_info=self.client_info, client_options=client_options
        )