Softlayer 服务器的带宽摘要
Bandwidth summary for Softlayer server
我正在使用 ruby API 获取带宽摘要。
我创建了一个客户端对象并尝试从 Virtual_Guest 服务获取 currentBandwidthSummary:
client.service_named("Virtual_Guest").object_mask('mask[currentBandwidthSummary]').object_with_id(server_id).getObject
但它没有 return currentBandwidthSummary 对象。我已经看到它适用于我拥有的旧服务器,但我想做的是从刚刚创建的新服务器中获取 currentBandwidthSummar。
请注意,服务器处于活动状态,因此它不处于部署状态或其他状态。
客户端对象初始化如下:
client = ::SoftLayer::Client.new(username: user, api_key: api_key, endpoint_url: url)
provisionDate 已设置:
client.service_named("Virtual_Guest").object_mask('mask[currentBandwidthSummary]').object_with_id(@server.server_id).getObject
=> {"accountId"=>"removed",
"createDate"=>"2016-10-21T08:48:03-05:00",
"dedicatedAccountHostOnlyFlag"=>false,
"domain"=>"please.delete.com",
"fullyQualifiedDomainName"=>"removed",
"hostname"=>"removed",
"id"=>"removed",
"lastPowerStateId"=>"",
"lastVerifiedDate"=>"",
"maxCpu"=>1,
"maxCpuUnits"=>"CORE",
"maxMemory"=>1024,
"metricPollDate"=>"",
"modifyDate"=>"2016-10-21T08:51:19-05:00",
"provisionDate"=>"2016-10-21T08:51:19-05:00",
"startCpus"=>1,
"statusId"=>1001,
"uuid"=>"removed",
"globalIdentifier"=>"removed",
"managedResourceFlag"=>false,
"primaryBackendIpAddress"=>"removed",
"status"=>{"keyName"=>"ACTIVE", "name"=>"Active"}}
似乎有些过滤器工作得很好,但有些被忽略了。
我想念什么?
可能是因为服务器还在provisioning process,ACTIVE状态不代表服务器就绪,需要检查"provisionDate" 属性是否为空或 null 服务器仍在配置过程中。查看此博客,了解有关检查新 CCI 是否已完成配置的更多信息。
http://sldn.softlayer.com/blog/phil/simplified-cci-creation
如果 provisioningDate 属性 有值,请更新您的问题,添加您从 API 获得的结果。
如果您在 Solftlayer 的门户中看不到数据,API 将不会显示 "currentBandwidthSummary",此 属性 将在您的服务器有带宽数据时创建。
此致
就在有人需要的时候。我一直在寻找 currentBandwidthSummary.allocationAmount,但结果发现它与 bandwidthAllocation 相同。如上所述,currentBandwidthSummary 由于某种原因不可用,但 bandwidthAllocation 可用。
很遗憾我在提问之前没有注意到这一点。 :)
我正在使用 ruby API 获取带宽摘要。 我创建了一个客户端对象并尝试从 Virtual_Guest 服务获取 currentBandwidthSummary:
client.service_named("Virtual_Guest").object_mask('mask[currentBandwidthSummary]').object_with_id(server_id).getObject
但它没有 return currentBandwidthSummary 对象。我已经看到它适用于我拥有的旧服务器,但我想做的是从刚刚创建的新服务器中获取 currentBandwidthSummar。
请注意,服务器处于活动状态,因此它不处于部署状态或其他状态。 客户端对象初始化如下:
client = ::SoftLayer::Client.new(username: user, api_key: api_key, endpoint_url: url)
provisionDate 已设置:
client.service_named("Virtual_Guest").object_mask('mask[currentBandwidthSummary]').object_with_id(@server.server_id).getObject
=> {"accountId"=>"removed",
"createDate"=>"2016-10-21T08:48:03-05:00",
"dedicatedAccountHostOnlyFlag"=>false,
"domain"=>"please.delete.com",
"fullyQualifiedDomainName"=>"removed",
"hostname"=>"removed",
"id"=>"removed",
"lastPowerStateId"=>"",
"lastVerifiedDate"=>"",
"maxCpu"=>1,
"maxCpuUnits"=>"CORE",
"maxMemory"=>1024,
"metricPollDate"=>"",
"modifyDate"=>"2016-10-21T08:51:19-05:00",
"provisionDate"=>"2016-10-21T08:51:19-05:00",
"startCpus"=>1,
"statusId"=>1001,
"uuid"=>"removed",
"globalIdentifier"=>"removed",
"managedResourceFlag"=>false,
"primaryBackendIpAddress"=>"removed",
"status"=>{"keyName"=>"ACTIVE", "name"=>"Active"}}
似乎有些过滤器工作得很好,但有些被忽略了。 我想念什么?
可能是因为服务器还在provisioning process,ACTIVE状态不代表服务器就绪,需要检查"provisionDate" 属性是否为空或 null 服务器仍在配置过程中。查看此博客,了解有关检查新 CCI 是否已完成配置的更多信息。
http://sldn.softlayer.com/blog/phil/simplified-cci-creation
如果 provisioningDate 属性 有值,请更新您的问题,添加您从 API 获得的结果。
如果您在 Solftlayer 的门户中看不到数据,API 将不会显示 "currentBandwidthSummary",此 属性 将在您的服务器有带宽数据时创建。
此致
就在有人需要的时候。我一直在寻找 currentBandwidthSummary.allocationAmount,但结果发现它与 bandwidthAllocation 相同。如上所述,currentBandwidthSummary 由于某种原因不可用,但 bandwidthAllocation 可用。
很遗憾我在提问之前没有注意到这一点。 :)