软层中带宽的投影数据 [英] Projected Data for Bandwidth in Softlayer

查看:42
本文介绍了软层中带宽的投影数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在制定带宽的预计值,但找不到私有网络的预计值.这是我的代码获取公共投影数据,但是与"Control.softlayer.com"相比,它返回​​不同的值.

I am developing a projected value for bandwidth, but I can't find a projected value for private network. This is my code getting public projected data, but it returns defferent value compared to "Control.softlayer.com".

这是我的问题的摘要.1.如何获取专用网络的预计数据.2. API获得吞吐量和使用率的预计值.3.如何设置日期以获取特定时间段的预计值.

This is a summary of my questions. 1. How to get a projected data for Private Network. 2. API getting a projected value for Throughput and Usage. 3. How to set a date to get a projected value for a specific period.

private void getVMProjectedData(){
    Guest.Service vsiService = Guest.service(client, 22075687l);
    vsiService.withMask().id().projectedPublicBandwidthUsage();
    Guest guest = vsiService.getObject();

    double usage = guest.getProjectedPublicBandwidthUsage().doubleValue();

    System.out.println("VM public Projected Usage : " + usage);

}

private void getBMProjectedData(){
    Server.Service bmService = Server.service(client, 168805l);
    bmService.withMask().projectedPublicBandwidthUsage();
    Server hd = bmService.getObjectForServer();

    System.out.println("BM public Projected Usage : " + hd.getProjectedPublicBandwidthUsage().doubleValue());

}

推荐答案

没有一种API方法可以检索 Projected 值,也没有一种可以在特定时间段内生成它的值.

There’s no an API method that retrieves the Projected value, neither one that generates it based on a specific period of time.

通过计算当前使用量,将其除以自计费周期开始以来的当前经过时间(由最近的数据点确定,而不是当前时间确定),然后乘以时间即可计算得出整个计费期的时间.

The Projected value is calculated by taking the current usage, dividing it by the current elapsed time (as determined by the most recent data point, not the current time) since the start of the billing period, and multiplying it by the time of the complete billing period.

为了检索用于此过程/计算的数据,可以使用下一个掩码:

In order to retrieve the data used for this process/calculations, you could use the next mask:

https://$username:$apiKey@api.softlayer.com/rest/v3.1/SoftLayer_Hardware_Server/$HardwareServerId/getObject.json?objectMask=mask[id,bandwidthAllocation,averageDailyBandwidthUsage,averageDailyPrivateBandwidthUsage,averageDailyPublicBandwidthUsage,bandwidthAllotmentDetail,billingCycleBandwidthUsage[trackingObject],billingCycleBandwidthUsageCount,billingCyclePrivateBandwidthUsage,billingCyclePublicBandwidthUsage,currentBandwidthSummary,currentBillableBandwidthUsage,projectedOverBandwidthAllocationFlag,projectedPublicBandwidthUsage,outboundBandwidthUsage,outboundPrivateBandwidthUsage,outboundPublicBandwidthUsage,inboundBandwidthUsage]

我希望这些信息可以为您提供帮助.

I hope this information could help you.

这篇关于软层中带宽的投影数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆