Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/http/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ibm cloud 如何通过RESTAPI检索资源组?_Ibm Cloud - Fatal编程技术网

Ibm cloud 如何通过RESTAPI检索资源组?

Ibm cloud 如何通过RESTAPI检索资源组?,ibm-cloud,Ibm Cloud,我正在自动化一些IBM云工作流程。我需要做的一件事是通过restapi检索资源组列表,类似于bx资源组。我可以追踪其余通话: $ IBMCLOUD_TRACE=true bx resource groups Retrieving all resource groups under account Chris Snow's Account as xxxxx... REQUEST: [2018-09-26T06:05:52+01:00] GET /v1/resource_groups?accoun

我正在自动化一些IBM云工作流程。我需要做的一件事是通过restapi检索资源组列表,类似于
bx资源组
。我可以追踪其余通话:

$ IBMCLOUD_TRACE=true bx resource groups
Retrieving all resource groups under account Chris Snow's Account as xxxxx...

REQUEST: [2018-09-26T06:05:52+01:00]
GET /v1/resource_groups?account_id=xxxxxx HTTP/1.1
Host: resource-manager.bluemix.net
Accept: application/json
Accept-Language: en-US
Accept-Language: en
Authorization: [PRIVATE DATA HIDDEN]
Content-Type: application/json
User-Agent: IBM Cloud CLI 0.10.0 / darwin

是否根据地区使用不同的主机?如果是,如何确定将请求发送到哪个主机?我希望在上找到此调用的api文档,但我看不到。

上提供的api文档正在构建中,并且(似乎)添加了越来越多的api。我希望资源控制器API很快就会被添加

关于资源控制器,我检查了以下名称的IP地址,它们都返回相同的基本信息:

  • resource-controller.bluemix.net
  • resource-manager.bluemix.net
  • resource-controller.ng.bluemix.net
  • resource-manager.ng.bluemix.net
  • resource-controller.eu-de.bluemix.net
  • resource-controller.eu-gb.bluemix.net

因为资源组是一个独立于区域的概念,所以我认为使用哪个主机名并不重要,它是同一个数据库(可能是副本)。因此,现在如何对resource-manager.bluemix.net进行硬编码?

当我使用
https://resource-controller.ng.bluemix.net
API调用返回404。我不得不把它改成
https://resource-manager.bluemix.net
要使其正常工作:(