1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package br.com.ingenieux.mojo.beanstalk.env;
18
19 import com.amazonaws.services.elasticbeanstalk.model.RetrieveEnvironmentInfoRequest;
20 import com.amazonaws.services.elasticbeanstalk.model.RetrieveEnvironmentInfoResult;
21
22 import org.apache.maven.plugin.MojoExecutionException;
23 import org.apache.maven.plugin.MojoFailureException;
24 import org.apache.maven.plugins.annotations.Mojo;
25 import org.apache.maven.plugins.annotations.Parameter;
26
27 import br.com.ingenieux.mojo.beanstalk.AbstractNeedsEnvironmentMojo;
28
29
30
31
32
33
34
35
36
37
38 @Mojo(name = "retrieve-environment-info", requiresDirectInvocation = true)
39 public class RetrieveEnvironmentInfoMojo extends AbstractNeedsEnvironmentMojo {
40
41
42
43
44 @Parameter(property = "beanstalk.infoType", defaultValue = "tail", required = true)
45 private String infoType;
46
47 @Override
48 protected Object executeInternal() throws MojoExecutionException, MojoFailureException {
49 RetrieveEnvironmentInfoRequest request =
50 new RetrieveEnvironmentInfoRequest()
51 .withEnvironmentId(curEnv.getEnvironmentId())
52 .withEnvironmentName(curEnv.getEnvironmentName())
53 .withInfoType(infoType);
54
55 RetrieveEnvironmentInfoResult result = getService().retrieveEnvironmentInfo(request);
56
57 return result;
58 }
59 }