我使用ruby API獲取帶寬摘要。 我創建一個客戶端對象,並嘗試從Virtual_Guest服務得到currentBandwidthSummary:Softlayer服務器的帶寬摘要
client.service_named("Virtual_Guest").object_mask('mask[currentBandwidthSummary]').object_with_id(server_id).getObject
但它不返回currentBandwidthSummary對象。我已經看到它適用於我有的舊服務器,但我想要做的是從剛剛創建的新服務器上獲取currentBandwidthSummar。
請注意,服務器處於ACTIVE狀態,因此它不處於部署狀態或其他狀態。 客戶對象初始化這樣的:
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"}}
好像一些過濾器工作得很好,但有些被忽略。 我錯過了什麼?
我不知道有關provisionDate,但它在那裏,所以必須是不同的 –
你有什麼結果?是空的 ?是一個錯誤消息? –
請檢查問題,我試圖獲得總結帶寬時添加了結果。看來currentBandwidthSummary屬性不會再次返回。沒有錯誤,只是沒有 –