@@ -37,19 +37,15 @@ import com.datadog.api.v1.client.api.AwsIntegrationApi;
37
37
public class Example {
38
38
public static void main (String [] args ) {
39
39
ApiClient defaultClient = Configuration . getDefaultApiClient();
40
- defaultClient. setBasePath(" https://api.datadoghq.com" );
41
-
42
- // Configure API key authorization: apiKeyAuth
43
- ApiKeyAuth apiKeyAuth = (ApiKeyAuth ) defaultClient. getAuthentication(" apiKeyAuth" );
44
- apiKeyAuth. setApiKey(" YOUR API KEY" );
45
- // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
46
- // apiKeyAuth.setApiKeyPrefix("Token");
47
-
48
- // Configure API key authorization: appKeyAuth
49
- ApiKeyAuth appKeyAuth = (ApiKeyAuth ) defaultClient. getAuthentication(" appKeyAuth" );
50
- appKeyAuth. setApiKey(" YOUR API KEY" );
51
- // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
52
- // appKeyAuth.setApiKeyPrefix("Token");
40
+ // Configure the Datadog site to send API calls to
41
+ HashMap<String , String > serverVariables = new HashMap<String , String > ();
42
+ String site = System . getenv(" DD_SITE" );
43
+ if (site != null ) { serverVariables. put(" site" , site); }
44
+ // Configure API key authorization:
45
+ HashMap<String , String > secrets = new HashMap<String , String > ();
46
+ secrets. put(" apiKeyAuth" , System . getenv(" DD_CLIENT_API_KEY" ));
47
+ secrets. put(" appKeyAuth" , System . getenv(" DD_CLIENT_APP_KEY" ));
48
+ defaultClient. configureApiKeys(secrets);
53
49
54
50
AwsIntegrationApi apiInstance = new AwsIntegrationApi (defaultClient);
55
51
AWSAccount body = new AWSAccount (); // AWSAccount | AWS Request Object
@@ -119,19 +115,15 @@ import com.datadog.api.v1.client.api.AwsIntegrationApi;
119
115
public class Example {
120
116
public static void main (String [] args ) {
121
117
ApiClient defaultClient = Configuration . getDefaultApiClient();
122
- defaultClient. setBasePath(" https://api.datadoghq.com" );
123
-
124
- // Configure API key authorization: apiKeyAuth
125
- ApiKeyAuth apiKeyAuth = (ApiKeyAuth ) defaultClient. getAuthentication(" apiKeyAuth" );
126
- apiKeyAuth. setApiKey(" YOUR API KEY" );
127
- // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
128
- // apiKeyAuth.setApiKeyPrefix("Token");
129
-
130
- // Configure API key authorization: appKeyAuth
131
- ApiKeyAuth appKeyAuth = (ApiKeyAuth ) defaultClient. getAuthentication(" appKeyAuth" );
132
- appKeyAuth. setApiKey(" YOUR API KEY" );
133
- // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
134
- // appKeyAuth.setApiKeyPrefix("Token");
118
+ // Configure the Datadog site to send API calls to
119
+ HashMap<String , String > serverVariables = new HashMap<String , String > ();
120
+ String site = System . getenv(" DD_SITE" );
121
+ if (site != null ) { serverVariables. put(" site" , site); }
122
+ // Configure API key authorization:
123
+ HashMap<String , String > secrets = new HashMap<String , String > ();
124
+ secrets. put(" apiKeyAuth" , System . getenv(" DD_CLIENT_API_KEY" ));
125
+ secrets. put(" appKeyAuth" , System . getenv(" DD_CLIENT_APP_KEY" ));
126
+ defaultClient. configureApiKeys(secrets);
135
127
136
128
AwsIntegrationApi apiInstance = new AwsIntegrationApi (defaultClient);
137
129
AWSAccount body = new AWSAccount (); // AWSAccount | Your Datadog role delegation name. For more information about your AWS account Role name, see the [Datadog AWS integration configuration info](https://github.com/DataDog/documentation/blob/master/integrations/amazon_web_services/#installation).
@@ -201,19 +193,15 @@ import com.datadog.api.v1.client.api.AwsIntegrationApi;
201
193
public class Example {
202
194
public static void main (String [] args ) {
203
195
ApiClient defaultClient = Configuration . getDefaultApiClient();
204
- defaultClient. setBasePath(" https://api.datadoghq.com" );
205
-
206
- // Configure API key authorization: apiKeyAuth
207
- ApiKeyAuth apiKeyAuth = (ApiKeyAuth ) defaultClient. getAuthentication(" apiKeyAuth" );
208
- apiKeyAuth. setApiKey(" YOUR API KEY" );
209
- // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
210
- // apiKeyAuth.setApiKeyPrefix("Token");
211
-
212
- // Configure API key authorization: appKeyAuth
213
- ApiKeyAuth appKeyAuth = (ApiKeyAuth ) defaultClient. getAuthentication(" appKeyAuth" );
214
- appKeyAuth. setApiKey(" YOUR API KEY" );
215
- // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
216
- // appKeyAuth.setApiKeyPrefix("Token");
196
+ // Configure the Datadog site to send API calls to
197
+ HashMap<String , String > serverVariables = new HashMap<String , String > ();
198
+ String site = System . getenv(" DD_SITE" );
199
+ if (site != null ) { serverVariables. put(" site" , site); }
200
+ // Configure API key authorization:
201
+ HashMap<String , String > secrets = new HashMap<String , String > ();
202
+ secrets. put(" apiKeyAuth" , System . getenv(" DD_CLIENT_API_KEY" ));
203
+ secrets. put(" appKeyAuth" , System . getenv(" DD_CLIENT_APP_KEY" ));
204
+ defaultClient. configureApiKeys(secrets);
217
205
218
206
AwsIntegrationApi apiInstance = new AwsIntegrationApi (defaultClient);
219
207
AWSAccount body = new AWSAccount (); // AWSAccount | AWS request object
@@ -283,19 +271,15 @@ import com.datadog.api.v1.client.api.AwsIntegrationApi;
283
271
public class Example {
284
272
public static void main (String [] args ) {
285
273
ApiClient defaultClient = Configuration . getDefaultApiClient();
286
- defaultClient. setBasePath(" https://api.datadoghq.com" );
287
-
288
- // Configure API key authorization: apiKeyAuth
289
- ApiKeyAuth apiKeyAuth = (ApiKeyAuth ) defaultClient. getAuthentication(" apiKeyAuth" );
290
- apiKeyAuth. setApiKey(" YOUR API KEY" );
291
- // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
292
- // apiKeyAuth.setApiKeyPrefix("Token");
293
-
294
- // Configure API key authorization: appKeyAuth
295
- ApiKeyAuth appKeyAuth = (ApiKeyAuth ) defaultClient. getAuthentication(" appKeyAuth" );
296
- appKeyAuth. setApiKey(" YOUR API KEY" );
297
- // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
298
- // appKeyAuth.setApiKeyPrefix("Token");
274
+ // Configure the Datadog site to send API calls to
275
+ HashMap<String , String > serverVariables = new HashMap<String , String > ();
276
+ String site = System . getenv(" DD_SITE" );
277
+ if (site != null ) { serverVariables. put(" site" , site); }
278
+ // Configure API key authorization:
279
+ HashMap<String , String > secrets = new HashMap<String , String > ();
280
+ secrets. put(" apiKeyAuth" , System . getenv(" DD_CLIENT_API_KEY" ));
281
+ secrets. put(" appKeyAuth" , System . getenv(" DD_CLIENT_APP_KEY" ));
282
+ defaultClient. configureApiKeys(secrets);
299
283
300
284
AwsIntegrationApi apiInstance = new AwsIntegrationApi (defaultClient);
301
285
String accountId = " accountId_example" ; // String | Only return AWS accounts that matches this account_id.
@@ -371,19 +355,15 @@ import com.datadog.api.v1.client.api.AwsIntegrationApi;
371
355
public class Example {
372
356
public static void main (String [] args ) {
373
357
ApiClient defaultClient = Configuration . getDefaultApiClient();
374
- defaultClient. setBasePath(" https://api.datadoghq.com" );
375
-
376
- // Configure API key authorization: apiKeyAuth
377
- ApiKeyAuth apiKeyAuth = (ApiKeyAuth ) defaultClient. getAuthentication(" apiKeyAuth" );
378
- apiKeyAuth. setApiKey(" YOUR API KEY" );
379
- // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
380
- // apiKeyAuth.setApiKeyPrefix("Token");
381
-
382
- // Configure API key authorization: appKeyAuth
383
- ApiKeyAuth appKeyAuth = (ApiKeyAuth ) defaultClient. getAuthentication(" appKeyAuth" );
384
- appKeyAuth. setApiKey(" YOUR API KEY" );
385
- // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
386
- // appKeyAuth.setApiKeyPrefix("Token");
358
+ // Configure the Datadog site to send API calls to
359
+ HashMap<String , String > serverVariables = new HashMap<String , String > ();
360
+ String site = System . getenv(" DD_SITE" );
361
+ if (site != null ) { serverVariables. put(" site" , site); }
362
+ // Configure API key authorization:
363
+ HashMap<String , String > secrets = new HashMap<String , String > ();
364
+ secrets. put(" apiKeyAuth" , System . getenv(" DD_CLIENT_API_KEY" ));
365
+ secrets. put(" appKeyAuth" , System . getenv(" DD_CLIENT_APP_KEY" ));
366
+ defaultClient. configureApiKeys(secrets);
387
367
388
368
AwsIntegrationApi apiInstance = new AwsIntegrationApi (defaultClient);
389
369
try {
@@ -447,19 +427,15 @@ import com.datadog.api.v1.client.api.AwsIntegrationApi;
447
427
public class Example {
448
428
public static void main (String [] args ) {
449
429
ApiClient defaultClient = Configuration . getDefaultApiClient();
450
- defaultClient. setBasePath(" https://api.datadoghq.com" );
451
-
452
- // Configure API key authorization: apiKeyAuth
453
- ApiKeyAuth apiKeyAuth = (ApiKeyAuth ) defaultClient. getAuthentication(" apiKeyAuth" );
454
- apiKeyAuth. setApiKey(" YOUR API KEY" );
455
- // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
456
- // apiKeyAuth.setApiKeyPrefix("Token");
457
-
458
- // Configure API key authorization: appKeyAuth
459
- ApiKeyAuth appKeyAuth = (ApiKeyAuth ) defaultClient. getAuthentication(" appKeyAuth" );
460
- appKeyAuth. setApiKey(" YOUR API KEY" );
461
- // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
462
- // appKeyAuth.setApiKeyPrefix("Token");
430
+ // Configure the Datadog site to send API calls to
431
+ HashMap<String , String > serverVariables = new HashMap<String , String > ();
432
+ String site = System . getenv(" DD_SITE" );
433
+ if (site != null ) { serverVariables. put(" site" , site); }
434
+ // Configure API key authorization:
435
+ HashMap<String , String > secrets = new HashMap<String , String > ();
436
+ secrets. put(" apiKeyAuth" , System . getenv(" DD_CLIENT_API_KEY" ));
437
+ secrets. put(" appKeyAuth" , System . getenv(" DD_CLIENT_APP_KEY" ));
438
+ defaultClient. configureApiKeys(secrets);
463
439
464
440
AwsIntegrationApi apiInstance = new AwsIntegrationApi (defaultClient);
465
441
AWSAccount body = new AWSAccount (); // AWSAccount | AWS request object
0 commit comments