...
|
...
|
@@ -6,6 +6,8 @@ import com.monitor.awstools.model.M_Instance; |
|
|
import com.monitor.awstools.model.M_SnapShot;
|
|
|
import com.monitor.awstools.model.M_Volume;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
...
|
...
|
@@ -18,7 +20,7 @@ import java.util.List; |
|
|
*/
|
|
|
@Service
|
|
|
public class AwsQueryService {
|
|
|
|
|
|
public static final Logger DEBUG = LoggerFactory.getLogger(AwsQueryService.class);
|
|
|
@Autowired
|
|
|
AWSClientComp awsClientComp = new AWSClientComp();
|
|
|
|
...
|
...
|
@@ -153,6 +155,8 @@ public class AwsQueryService { |
|
|
|
|
|
DescribeSnapshotsResult result = awsClientComp.getClient().describeSnapshots(request);
|
|
|
|
|
|
DEBUG.info("Query snapshot result {}", result);
|
|
|
|
|
|
List<Snapshot> snapshotList = result.getSnapshots();
|
|
|
|
|
|
List<M_SnapShot> m_snapShotList = new ArrayList<>();
|
...
|
...
|
@@ -165,10 +169,10 @@ public class AwsQueryService { |
|
|
return m_snapShotList;
|
|
|
}
|
|
|
|
|
|
public static void main(String[] args) {
|
|
|
/* public static void main(String[] args) {
|
|
|
AwsQueryService queryService = new AwsQueryService();
|
|
|
|
|
|
/* M_Volume m_volume = queryService.queryVolumeInfo("vol-4c808589");
|
|
|
*//* M_Volume m_volume = queryService.queryVolumeInfo("vol-4c808589");
|
|
|
|
|
|
if (null == m_volume) {
|
|
|
return;
|
...
|
...
|
@@ -177,7 +181,7 @@ public class AwsQueryService { |
|
|
M_Instance m_instance = queryService.queryInstanceInfo(m_volume.getInstanceId());
|
|
|
|
|
|
System.out.println(m_volume);
|
|
|
System.out.println(m_instance);*/
|
|
|
System.out.println(m_instance);*//*
|
|
|
|
|
|
List<M_SnapShot> snapShotList = queryService.querySnapShotList("vol-4c808589");
|
|
|
|
...
|
...
|
@@ -186,7 +190,7 @@ public class AwsQueryService { |
|
|
}
|
|
|
|
|
|
|
|
|
}
|
|
|
}*/
|
|
|
|
|
|
|
|
|
private M_SnapShot convertSnapShot(Snapshot snapshot) {
|
...
|
...
|
|