|
@@ -200,6 +200,10 @@ public class QcloudClientFactory { |
|
@@ -200,6 +200,10 @@ public class QcloudClientFactory { |
200
|
String hostid=jo.getString("InstanceId");
|
200
|
String hostid=jo.getString("InstanceId");
|
201
|
String hostname=jo.getString("InstanceName");
|
201
|
String hostname=jo.getString("InstanceName");
|
202
|
String ip=jo.getJSONArray("PrivateIpAddresses").size()>0?jo.getJSONArray("PrivateIpAddresses").getString(0):"";
|
202
|
String ip=jo.getJSONArray("PrivateIpAddresses").size()>0?jo.getJSONArray("PrivateIpAddresses").getString(0):"";
|
|
|
203
|
+ String restrictState=jo.getString("RestrictState"); ///状态,不要EXPIRED状态的主机,NORMAL表示正常状态的实例 ,EXPIRED:表示过期的实例 ,PROTECTIVELY_ISOLATED:表示被安全隔离的实例。
|
|
|
204
|
+ if("EXPIRED".equalsIgnoreCase(restrictState)){
|
|
|
205
|
+ continue;
|
|
|
206
|
+ }
|
203
|
if(!instanceIDs.contains(hostid)){
|
207
|
if(!instanceIDs.contains(hostid)){
|
204
|
instanceIDs.add(hostid);
|
208
|
instanceIDs.add(hostid);
|
205
|
Host host=new Host(DataCenter.qcloud,hostid, ip, hostname);
|
209
|
Host host=new Host(DataCenter.qcloud,hostid, ip, hostname);
|
|
@@ -229,6 +233,10 @@ public class QcloudClientFactory { |
|
@@ -229,6 +233,10 @@ public class QcloudClientFactory { |
229
|
String hostid=jo.getString("InstanceId");
|
233
|
String hostid=jo.getString("InstanceId");
|
230
|
String hostname=jo.getString("InstanceName");
|
234
|
String hostname=jo.getString("InstanceName");
|
231
|
String ip=jo.getJSONArray("PrivateIpAddresses").size()>0?jo.getJSONArray("PrivateIpAddresses").getString(0):"";
|
235
|
String ip=jo.getJSONArray("PrivateIpAddresses").size()>0?jo.getJSONArray("PrivateIpAddresses").getString(0):"";
|
|
|
236
|
+ String restrictState=jo.getString("RestrictState"); ///状态,不要EXPIRED状态的主机,NORMAL表示正常状态的实例 ,EXPIRED:表示过期的实例 ,PROTECTIVELY_ISOLATED:表示被安全隔离的实例。
|
|
|
237
|
+ if("EXPIRED".equalsIgnoreCase(restrictState)){
|
|
|
238
|
+ continue;
|
|
|
239
|
+ }
|
232
|
if(!instanceIDs.contains(hostid)){
|
240
|
if(!instanceIDs.contains(hostid)){
|
233
|
instanceIDs.add(hostid);
|
241
|
instanceIDs.add(hostid);
|
234
|
Host host=new Host(DataCenter.qcloud,hostid, ip, hostname);
|
242
|
Host host=new Host(DataCenter.qcloud,hostid, ip, hostname);
|