Skip to content

Commit c9b09e0

Browse files
yubangxiJmcfar
authored andcommitted
add plugin name and version as AWS Java SDK user agent suffix for version distribution tracking
1 parent 0544bf5 commit c9b09e0

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/main/java/com/amazonaws/codedeploy/AWSClients.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,15 @@ public class AWSClients {
4949
* Sample ARN: arn:aws:iam::123456789012:user/David
5050
**/
5151
private static final int ARN_ACCOUNT_ID_INDEX = 4;
52+
53+
/**
54+
* AWS-CodeDeploy-Jenkins-Plugin/<Version>
55+
* This will be used as the SDK user agent suffix
56+
**/
57+
private static final String USER_AGENT_SUFFIX = "AWS-CodeDeploy-Jenkins-Plugin/1.20";
5258

5359
public final AmazonCodeDeployClient codedeploy;
54-
public final AmazonS3Client s3;
60+
public final AmazonS3Client s3;
5561

5662
private final String region;
5763
private final String proxyHost;
@@ -68,6 +74,8 @@ public AWSClients(String region, AWSCredentials credentials, String proxyHost, i
6874
clientCfg.setProxyHost(proxyHost);
6975
clientCfg.setProxyPort(proxyPort);
7076
}
77+
78+
clientCfg.setUserAgentSuffix(USER_AGENT_SUFFIX);
7179

7280
this.s3 = credentials != null ? new AmazonS3Client(credentials, clientCfg) : new AmazonS3Client(clientCfg);
7381
this.codedeploy = credentials != null ? new AmazonCodeDeployClient(credentials, clientCfg) : new AmazonCodeDeployClient(clientCfg);

0 commit comments

Comments
 (0)