前のトピック: サーバ URI次のトピック: 単一サーバの取得


すべてのサーバの取得

システムのすべてのサーバに関する情報を取得できます。

GET BFC/servers
引数

なし

結果

成功時には、HTTP リターン コード 200 とサーバ レコードのリストが返されます。 エラーの際には、HTTP エラー コードと、関連するエラー情報が返されます。

説明

システムの現在のグリッドのセットに関する情報をサーバ レコードのリストとして取得します。 BFC API の 1.1 のリリースについては、返すべきサーバ レコードの範囲を指定できません。 代わりに、システムのすべてのサーバに対してレコードが返されます。

Python の例

from httplib import HTTPSConnection
import json
import os
import sys

bfcHost = os.environ["BFC_HOST"]
bfcSession = os.environ["BFC_SESSION"]
conn = HTTPSConnection(bfcHost + ':8443')
conn.connect()
conn.request(method='GET',
             url='/BFC/servers',
             headers={'Content-Type':'application/json',
                      'Authorization':bfcSession})
r1 = conn.getresponse()
print 'HTTP Response Code: {0}'.format(r1.status)
servers = json.loads(r1.read())
print json.dumps(servers, sort_keys=True, indent=4)

JSON ペイロードの例

[{"server":{
"comp_id":1557,
"state":"resource_running_state",
"server_state_info":{
	"server_state_info":{
		"effective_state":
		"resource_running_state",
		"category_code_args":[],
		"category_code":"core/resources.compute_host.category_compute_host_power",
		"category_format":"Compute Host Power Status",
		"code":"core/resources.compute_host.compute_host_normal_powered",
		"format":"Functioning normally.",
		"inventorying":false,
		"applogic_server_name":"srv1",
		"applogic_server_state":"up",
		"applogic_server_enabled":true,
		"has_grid_controller":true,"vmware":false}},
	"grid_name":"gridtest",
		"power_status":"on",
		"description":[],
		"discovery_date":1344988800000,
		"cpu_cores":4,"cpu_speed":3.0,"memory_size":4.0,"disk_count":1,
		"total_disk_space":146.81302272,"force_manual_power":false,
		"network_interfaces":[{
		  "network_interface":{
			"connectivity":
			"backbone",
			"ip_address":"192.168.0.x",
			"is_boot":true,
			"mac_address":"00:01:02:03:04:05",
			"name":"eth0","speed":1000}},{
		  "network_interface":{
			"connectivity":"external",
			"ip_address":"10.10.x.x",
			"is_boot":false,
			"mac_address":"00:01:02:03:04:05",
			"name":"eth1",
			"speed":1000}}],
			"disks": [{
			  "disk":{
				"name":"/dev/sda",
				"size":146.81302272}}],
		  "power_controllers":[{
			"power_controller":{
				"comp_id":1574,
				"ip_address":"10.10.x.x",
				"mac_address":"00:01:02:03:04:05",
				"type":"controlled",
				"username":"PowerAdmin__BFC",
				"password":"*****",
				"credential_set_time":134580.189,
				"power_status":"on"}
			}],
			"tags":["Blue","Green"]}}]%