Reputation: 21
I'm using ruby API to get the bandwidth summary. I create a client object and try to get currentBandwidthSummary from the Virtual_Guest service:
client.service_named("Virtual_Guest").object_mask('mask[currentBandwidthSummary]').object_with_id(server_id).getObject
But it doesn't return the currentBandwidthSummary object. I've seen that it works for old servers I have, but what I'd like to do is to get currentBandwidthSummar right from the new server just created.
Note that the server is ACTIVE, so it's not in the deploy state or something. The client object is initialized like that:
client = ::SoftLayer::Client.new(username: user, api_key: api_key, endpoint_url: url)
The provisionDate is set:
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"}}
It seems like some filters work pretty well, but some are ignored. What do I miss?
Upvotes: 0
Views: 104
Reputation: 21
Just if someone needs that. I was looking for currentBandwidthSummary.allocationAmount, but it turned out it's the same as bandwidthAllocation. As told above, currentBandwidthSummary is not available for some reason, but bandwidthAllocation is.
My bad that I didn't notice that before asking the question. :)
Upvotes: 1
Reputation: 4386
It is probably because the server is still in provisioning proccess, the ACTIVE status does not mean that the server is ready, you need to check for the "provisionDate" property if this value is empty or null the server is still in provisioning proccess. Take a look to this blog for more information about to check if the new CCI has completed the provisioning.
http://sldn.softlayer.com/blog/phil/simplified-cci-creation
In case that the provisioningDate property has a value, please update your question adding the result that you get from the API.
If you do not see data in the Solftlayer's portal, the API will not display the "currentBandwidthSummary", this property will be created when your server have bandwidth data.
Regards
Upvotes: 0