Tag: ibm cloud infrastructure

检索有关已配置的SoftLayer服务器的用户元数据将返回null

我正在尝试一致地检索每台机器的用户元信息,但我发现我的大多数机器都缺少这些数据。 我想更好地了解这些用户数据需要什么。 我很好奇是否可以在不需要用户信息的情况下请求和配置服务器(例如,订购服务器的API调用并且没有给出用户数据)。 或者我是否遗漏了如何检索此信息的内容。 这是我正在运行的基本ruby程序: user = ### api_key = ### client = SoftLayer::Client.new(:username => user, :api_key => api_key, :timeout => 999999) list_of_virtual_machines = client[‘Account’].result_limit(i*50,50).object_mask(“mask[id, billingItem[recurringFee, associatedChildren[recurringFee], orderItem[description, order[userRecord[username], id]]], userData]”).getVirtualGuests for x in 0..list_of_virtual_machines.length – 1 pp list_of_virtual_machines[i][‘userData’] if list_of_virtual_machines[i][‘billingItem’] && list_of_virtual_machines[i][‘billingItem’][‘orderItem’] && list_of_virtual_machines[i][‘billingItem’][‘orderItem’][‘order’] && list_of_virtual_machines[i][‘billingItem’][‘orderItem’][‘order’][‘userRecord’] pp list_of_virtual_machines[i][‘billingItem’][‘orderItem’][‘order’][‘userRecord’] end end 我的打印一直显示为空。 这个问题与我不久前问过的类似问题有关(但问题的焦点转向了提供日期): 如何使用Ruby获取所有SoftLayer机器的订单用户名和provisionDate?

每台服务器的带宽摘要

我正在尝试获取我帐户下所有软件层服务器的带宽数据。 感谢account_servers.rb我能够获得所有服务器的服务器ID。 现在我想获得服务器在特定时间范围内使用的带宽。 我感兴趣的数据是 http://sldn.softlayer.com/reference/datatypes/SoftLayer_Metric_Tracking_Object_Bandwidth_Summary 。 我试图使用softlayer_client.service_named(“Metric_Tracking_Object_Bandwidth_Summary”)获取信息。 不幸的是我无法获得详细信息。 我找到了一个java代码,但我对ruby代码很感兴趣。 有人可以指导我获取服务器带宽摘要吗? 在SL中获取bandWidth数据

如何使用Ruby获取所有SoftLayer机器的订单用户名和provisionDate?

使用Ruby我正在打电话: client = SoftLayer::Client.new(:username => user, :api_key => api_key, :timeout => 999999) client[‘Account’].object_mask(“mask[id, hostname, fullyQualifiedDomainName, provisionDate, datacenter[name], billingItem[recurringFee, associatedChildren[recurringFee], orderItem[description, order[userRecord[username], id]]], tagReferences[tagId, tag[name]], primaryIpAddress, primaryBackendIpAddress]”).getHardware 但只有一些机器返回provisionDate,只有一些返回orderItem信息。 如何为每台机器始终获取此信息? 什么会导致一台机器返回此数据而另一台机器不返回? 输出示例: {“fullyQualifiedDomainName”=>””, “hostname”=>””, “id”=>167719, “provisionDate”=>””, “primaryBackendIpAddress”=>””, “primaryIpAddress”=>””, “billingItem”=> {“recurringFee”=>”506.78”, “associatedChildren”=> []}, “datacenter”=>{“name”=>”dal09”}, “tagReferences”=> [{“tagId”=>139415, “tag”=>{“name”=>””}}, {“tagId”=>139417, “tag”=>{“name”=>””}}, {“tagId”=>140549, “tag”=>{“name”=>””}}]} 要清楚,大多数机器都返回这些数据,所以我试图理解为什么有些人没有。