如何订购复制

时间:2016-04-28 04:17:58

标签: ibm-cloud-infrastructure

我正在尝试通过API在软层中订购存储复制。 我选择了一个新加坡数据中心。

以下是测试代码:

Replication storage = new Replication();
storage.setVolumeId(new Long("10312709"));
storage.setPackageId(new Long("240"));
storage.setLocation("224092");

Price price = new Price();
price.setId(new Long("145321"));
storage.getPrices().add(price);

Order.Service service = Order.service(client);
service.verifyOrder(storage);

但所有价格都无效。

45058  -> Invalid price Endurance Storage (45058) provided on the order container.
45068  -> Invalid price 0.25 IOPS per GB (45068) provided on the order container.
45108  -> Invalid price File Storage (45108) provided on the order container.    
147101 -> Invalid price 20 GB Storage Space (147101) provided on the order container.
144011 -> Invalid price 20 GB Storage Space (144011) provided on the order container.
145321 -> Invalid price 20 GB Storage Space (145321) provided on the order container.    
147099 -> The price for 20 GB Storage Space (#147099) is not valid for location sng01

如何知道有效的priceID以进行复制。

如果您提供示例Java代码或API指南,我们将不胜感激。

谢谢

1 个答案:

答案 0 :(得分:0)

它已经解决了。 企业对象比复制需要。 下面是代码:

Enterprise storage = new Enterprise();
storage.setPackageId(new Long("240"));
storage.setOriginVolumeId(new Long("10312709"));
storage.setOriginVolumeScheduleId(new Long("86285"));
storage.setLocation("SINGAPORE");

感谢。