-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge master into datadog-api-spec/test/sherz/add-case-management-group
- Loading branch information
Showing
33 changed files
with
618 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
examples/v1/gcp-integration/UpdateGCPIntegration_3544259255.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// Update a GCP integration cloud run revision filters returns "OK" response | ||
|
||
import com.datadog.api.client.ApiClient; | ||
import com.datadog.api.client.ApiException; | ||
import com.datadog.api.client.v1.api.GcpIntegrationApi; | ||
import com.datadog.api.client.v1.model.GCPAccount; | ||
import java.util.Collections; | ||
|
||
public class Example { | ||
public static void main(String[] args) { | ||
ApiClient defaultClient = ApiClient.getDefaultApiClient(); | ||
GcpIntegrationApi apiInstance = new GcpIntegrationApi(defaultClient); | ||
|
||
GCPAccount body = | ||
new GCPAccount() | ||
.authProviderX509CertUrl("https://www.googleapis.com/oauth2/v1/certs") | ||
.authUri("https://accounts.google.com/o/oauth2/auth") | ||
.clientEmail("252bf553ef04b351@example.com") | ||
.clientId("163662907116366290710") | ||
.clientX509CertUrl("https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL") | ||
.hostFilters("key:value,filter:example") | ||
.cloudRunRevisionFilters(Collections.singletonList("merp:derp")) | ||
.isCspmEnabled(true) | ||
.isSecurityCommandCenterEnabled(true) | ||
.privateKey("private_key") | ||
.privateKeyId("123456789abcdefghi123456789abcdefghijklm") | ||
.projectId("datadog-apitest") | ||
.resourceCollectionEnabled(true) | ||
.tokenUri("https://accounts.google.com/o/oauth2/token") | ||
.type("service_account"); | ||
|
||
try { | ||
apiInstance.updateGCPIntegration(body); | ||
} catch (ApiException e) { | ||
System.err.println("Exception when calling GcpIntegrationApi#updateGCPIntegration"); | ||
System.err.println("Status code: " + e.getCode()); | ||
System.err.println("Reason: " + e.getResponseBody()); | ||
System.err.println("Response headers: " + e.getResponseHeaders()); | ||
e.printStackTrace(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
examples/v2/gcp-integration/CreateGCPSTSAccount_194782945.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// Create a new entry for your service account with cloud run revision filters enabled returns "OK" | ||
// response | ||
|
||
import com.datadog.api.client.ApiClient; | ||
import com.datadog.api.client.ApiException; | ||
import com.datadog.api.client.v2.api.GcpIntegrationApi; | ||
import com.datadog.api.client.v2.model.GCPSTSServiceAccountAttributes; | ||
import com.datadog.api.client.v2.model.GCPSTSServiceAccountCreateRequest; | ||
import com.datadog.api.client.v2.model.GCPSTSServiceAccountData; | ||
import com.datadog.api.client.v2.model.GCPSTSServiceAccountResponse; | ||
import com.datadog.api.client.v2.model.GCPServiceAccountType; | ||
import java.util.Collections; | ||
|
||
public class Example { | ||
public static void main(String[] args) { | ||
ApiClient defaultClient = ApiClient.getDefaultApiClient(); | ||
GcpIntegrationApi apiInstance = new GcpIntegrationApi(defaultClient); | ||
|
||
GCPSTSServiceAccountCreateRequest body = | ||
new GCPSTSServiceAccountCreateRequest() | ||
.data( | ||
new GCPSTSServiceAccountData() | ||
.attributes( | ||
new GCPSTSServiceAccountAttributes() | ||
.cloudRunRevisionFilters(Collections.singletonList("meh:bleh")) | ||
.clientEmail("252bf553ef04b351@test-project.iam.gserviceaccount.com")) | ||
.type(GCPServiceAccountType.GCP_SERVICE_ACCOUNT)); | ||
|
||
try { | ||
GCPSTSServiceAccountResponse result = apiInstance.createGCPSTSAccount(body); | ||
System.out.println(result); | ||
} catch (ApiException e) { | ||
System.err.println("Exception when calling GcpIntegrationApi#createGCPSTSAccount"); | ||
System.err.println("Status code: " + e.getCode()); | ||
System.err.println("Reason: " + e.getResponseBody()); | ||
System.err.println("Response headers: " + e.getResponseHeaders()); | ||
e.printStackTrace(); | ||
} | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
examples/v2/gcp-integration/UpdateGCPSTSAccount_2241994060.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// Update STS Service Account returns "OK" response with cloud run revision filters | ||
|
||
import com.datadog.api.client.ApiClient; | ||
import com.datadog.api.client.ApiException; | ||
import com.datadog.api.client.v2.api.GcpIntegrationApi; | ||
import com.datadog.api.client.v2.model.GCPSTSServiceAccountAttributes; | ||
import com.datadog.api.client.v2.model.GCPSTSServiceAccountResponse; | ||
import com.datadog.api.client.v2.model.GCPSTSServiceAccountUpdateRequest; | ||
import com.datadog.api.client.v2.model.GCPSTSServiceAccountUpdateRequestData; | ||
import com.datadog.api.client.v2.model.GCPServiceAccountType; | ||
import java.util.Collections; | ||
|
||
public class Example { | ||
public static void main(String[] args) { | ||
ApiClient defaultClient = ApiClient.getDefaultApiClient(); | ||
GcpIntegrationApi apiInstance = new GcpIntegrationApi(defaultClient); | ||
|
||
// there is a valid "gcp_sts_account" in the system | ||
String GCP_STS_ACCOUNT_DATA_ID = System.getenv("GCP_STS_ACCOUNT_DATA_ID"); | ||
|
||
GCPSTSServiceAccountUpdateRequest body = | ||
new GCPSTSServiceAccountUpdateRequest() | ||
.data( | ||
new GCPSTSServiceAccountUpdateRequestData() | ||
.attributes( | ||
new GCPSTSServiceAccountAttributes() | ||
.clientEmail("252bf553ef04b351@example.com") | ||
.cloudRunRevisionFilters(Collections.singletonList("merp:derp"))) | ||
.id(GCP_STS_ACCOUNT_DATA_ID) | ||
.type(GCPServiceAccountType.GCP_SERVICE_ACCOUNT)); | ||
|
||
try { | ||
GCPSTSServiceAccountResponse result = | ||
apiInstance.updateGCPSTSAccount(GCP_STS_ACCOUNT_DATA_ID, body); | ||
System.out.println(result); | ||
} catch (ApiException e) { | ||
System.err.println("Exception when calling GcpIntegrationApi#updateGCPSTSAccount"); | ||
System.err.println("Status code: " + e.getCode()); | ||
System.err.println("Reason: " + e.getResponseBody()); | ||
System.err.println("Response headers: " + e.getResponseHeaders()); | ||
e.printStackTrace(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.