当尝试列出PipelineServiceClient
list_pipeline_jobs
方法的管道时,我得到以下错误:
_InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
status = StatusCode.UNIMPLEMENTED
details = "Received http2 header with status: 404"
...
如何API未实现,我如何解决这个问题?
我们在这里遗漏了两件事:
- 我们需要初始化带有正确端点的客户端选项的PipelineServiceClient。这里给出了端点列表。格式为
endpoint:port
- 我们需要给
list_pipeline_jobs
正确的请求。
示例:对于asia-south1
区域,我们将编写如下调用:
import google.cloud.aiplatform as aip
from google.api_core.client_options import ClientOptions
aip.init(project='<PROJECT_NAME>',
staging_bucket='PROJECT_BUCKET',
location='asia-south1')
options = ClientOptions(
api_endpoint="asia-south1-aiplatform.googleapis.com:443")
cli = aip.gapic.PipelineServiceClient(client_options=options)
parent = cli.common_location_path(project='<PROJECT_NAME>', location='asia-south1')
request = aip.gapic.ListPipelineJobsRequest(
request=request
)
pipeline_jobs_pager = cli.list_pipeline_jobs(parent=parent) # returns a pager object
for page in pipeline_jobs_pager.pages:
for pipeline_job in page.pipeline_jobs:
print(pipeline_job.name)
注意:gapic
可替换为v1
或v1beta1
呼叫