在py客户端中重新创建alpha-version gcloud命令

问题描述

TL; DR 我正在尝试重新创建此gcloud alpha command

gcloud alpha services api-keys create

official python api client中。


我了解构造resource与gcloud api进行交互的方法类似于

from googleapiclient import discovery
from oauth2client.client import GoogleCredentials

resource = discovery.build(serviceName='serviceName',version='v1',credentials=GoogleCredentials.get_application_default())

我正在努力确定与serviceName命令相对应的alpha services api-keys是什么。

gcloud alpha services list --available的价格列出服务

...
serviceconsumermanagement.googleapis.com              Service Consumer Management API
servicecontrol.googleapis.com                         Service Control API
servicedirectory.googleapis.com                       Service Directory API
servicemanagement.googleapis.com                      Service Management API
servicenetworking.googleapis.com                      Service Networking API
serviceusage.googleapis.com                           Service Usage API
...

我尝试过servicemanagement(听起来最合理的一种),但是它没有alpha版本,也没有我在其他服务中惯用的v1alpha1

相关问题:是否有一种方法可以跟踪cli执行哪些命令/网络请求,以便对它实际调用的服务/资源进行反向工程?我认为gcloud cli的核心只是一些REST / rpc调用的包装,不是吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)