2016-04-28 83 views
0

我試圖通過軟件層中的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 

如何知道有效的報價單價格ID。

如果您提供了示例java代碼或API指南,將不勝感激。

謝謝

回答

0

它已經解決了。 複製需要企業對象。下面 是代碼:

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

感謝。