|
@@ -6,6 +6,8 @@ import com.monitor.awstools.model.M_Instance; |
|
@@ -6,6 +6,8 @@ import com.monitor.awstools.model.M_Instance; |
6
|
import com.monitor.awstools.model.M_SnapShot;
|
6
|
import com.monitor.awstools.model.M_SnapShot;
|
7
|
import com.monitor.awstools.model.M_Volume;
|
7
|
import com.monitor.awstools.model.M_Volume;
|
8
|
import org.apache.commons.lang.StringUtils;
|
8
|
import org.apache.commons.lang.StringUtils;
|
|
|
9
|
+import org.slf4j.Logger;
|
|
|
10
|
+import org.slf4j.LoggerFactory;
|
9
|
import org.springframework.beans.factory.annotation.Autowired;
|
11
|
import org.springframework.beans.factory.annotation.Autowired;
|
10
|
import org.springframework.stereotype.Service;
|
12
|
import org.springframework.stereotype.Service;
|
11
|
|
13
|
|
|
@@ -18,7 +20,7 @@ import java.util.List; |
|
@@ -18,7 +20,7 @@ import java.util.List; |
18
|
*/
|
20
|
*/
|
19
|
@Service
|
21
|
@Service
|
20
|
public class AwsQueryService {
|
22
|
public class AwsQueryService {
|
21
|
-
|
23
|
+ public static final Logger DEBUG = LoggerFactory.getLogger(AwsQueryService.class);
|
22
|
@Autowired
|
24
|
@Autowired
|
23
|
AWSClientComp awsClientComp = new AWSClientComp();
|
25
|
AWSClientComp awsClientComp = new AWSClientComp();
|
24
|
|
26
|
|
|
@@ -153,6 +155,8 @@ public class AwsQueryService { |
|
@@ -153,6 +155,8 @@ public class AwsQueryService { |
153
|
|
155
|
|
154
|
DescribeSnapshotsResult result = awsClientComp.getClient().describeSnapshots(request);
|
156
|
DescribeSnapshotsResult result = awsClientComp.getClient().describeSnapshots(request);
|
155
|
|
157
|
|
|
|
158
|
+ DEBUG.info("Query snapshot result {}", result);
|
|
|
159
|
+
|
156
|
List<Snapshot> snapshotList = result.getSnapshots();
|
160
|
List<Snapshot> snapshotList = result.getSnapshots();
|
157
|
|
161
|
|
158
|
List<M_SnapShot> m_snapShotList = new ArrayList<>();
|
162
|
List<M_SnapShot> m_snapShotList = new ArrayList<>();
|
|
@@ -165,10 +169,10 @@ public class AwsQueryService { |
|
@@ -165,10 +169,10 @@ public class AwsQueryService { |
165
|
return m_snapShotList;
|
169
|
return m_snapShotList;
|
166
|
}
|
170
|
}
|
167
|
|
171
|
|
168
|
- public static void main(String[] args) {
|
172
|
+/* public static void main(String[] args) {
|
169
|
AwsQueryService queryService = new AwsQueryService();
|
173
|
AwsQueryService queryService = new AwsQueryService();
|
170
|
|
174
|
|
171
|
-/* M_Volume m_volume = queryService.queryVolumeInfo("vol-4c808589");
|
175
|
+*//* M_Volume m_volume = queryService.queryVolumeInfo("vol-4c808589");
|
172
|
|
176
|
|
173
|
if (null == m_volume) {
|
177
|
if (null == m_volume) {
|
174
|
return;
|
178
|
return;
|
|
@@ -177,7 +181,7 @@ public class AwsQueryService { |
|
@@ -177,7 +181,7 @@ public class AwsQueryService { |
177
|
M_Instance m_instance = queryService.queryInstanceInfo(m_volume.getInstanceId());
|
181
|
M_Instance m_instance = queryService.queryInstanceInfo(m_volume.getInstanceId());
|
178
|
|
182
|
|
179
|
System.out.println(m_volume);
|
183
|
System.out.println(m_volume);
|
180
|
- System.out.println(m_instance);*/
|
184
|
+ System.out.println(m_instance);*//*
|
181
|
|
185
|
|
182
|
List<M_SnapShot> snapShotList = queryService.querySnapShotList("vol-4c808589");
|
186
|
List<M_SnapShot> snapShotList = queryService.querySnapShotList("vol-4c808589");
|
183
|
|
187
|
|
|
@@ -186,7 +190,7 @@ public class AwsQueryService { |
|
@@ -186,7 +190,7 @@ public class AwsQueryService { |
186
|
}
|
190
|
}
|
187
|
|
191
|
|
188
|
|
192
|
|
189
|
- }
|
193
|
+ }*/
|
190
|
|
194
|
|
191
|
|
195
|
|
192
|
private M_SnapShot convertSnapShot(Snapshot snapshot) {
|
196
|
private M_SnapShot convertSnapShot(Snapshot snapshot) {
|