Skip to content

Commit

Permalink
Merge master into datadog-api-spec/test/sherz/add-case-management-group
Browse files Browse the repository at this point in the history
  • Loading branch information
2 parents 90e1c54 + fe29672 commit a17fa49
Show file tree
Hide file tree
Showing 33 changed files with 618 additions and 48 deletions.
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2024-02-14 10:50:02.144778",
"spec_repo_commit": "9348385b"
"regenerated": "2024-02-20 12:21:56.548581",
"spec_repo_commit": "7e467650"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-02-14 10:50:02.160000",
"spec_repo_commit": "9348385b"
"regenerated": "2024-02-20 12:21:56.563229",
"spec_repo_commit": "7e467650"
}
}
}
14 changes: 14 additions & 0 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3207,6 +3207,18 @@ components:
key.'
example: https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL
type: string
cloud_run_revision_filters:
description: 'Limit the Cloud Run revisions that are pulled into Datadog
by using tags.

Only Cloud Run revision resources that apply to specified filters are
imported into Datadog.'
example:
- $KEY:$VALUE
items:
description: Cloud Run Filters
type: string
type: array
errors:
description: An array of errors.
example:
Expand Down Expand Up @@ -13213,10 +13225,12 @@ components:
only supporting `http`.
enum:
- http
- grpc
example: http
type: string
x-enum-varnames:
- HTTP
- GRPC
SyntheticsAPITest:
description: Object containing details about a Synthetic API test.
properties:
Expand Down
19 changes: 16 additions & 3 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2039,7 +2039,8 @@ components:
type: number
type: object
CIAppAggregateSort:
description: A sort rule.
description: A sort rule. The `aggregation` field is required when `type` is
`measure`.
example:
aggregation: count
order: asc
Expand Down Expand Up @@ -7388,6 +7389,18 @@ components:
description: Your service account email address.
example: datadog-service-account@test-project.iam.gserviceaccount.com
type: string
cloud_run_revision_filters:
description: 'List of filters to limit the Cloud Run revisions that are
pulled into Datadog by using tags.

Only Cloud Run revision resources that apply to specified filters are
imported into Datadog.'
example:
- $KEY:$VALUE
items:
description: Cloud Run Filters
type: string
type: array
host_filters:
description: Your Host Filters.
items:
Expand Down Expand Up @@ -24052,7 +24065,7 @@ paths:
/api/v2/cost_by_tag/active_billing_dimensions:
get:
description: Get active billing dimensions for cost attribution. Cost data for
a given month becomes available no later than the 17th of the following month.
a given month becomes available no later than the 19th of the following month.
operationId: GetActiveBillingDimensions
responses:
'200':
Expand Down Expand Up @@ -24094,7 +24107,7 @@ paths:
get:
description: "Get monthly cost attribution by tag across multi-org and single
root-org accounts.\nCost Attribution data for a given month becomes available
no later than the 17th of the following month.\nThis API endpoint is paginated.
no later than the 19th of the following month.\nThis API endpoint is paginated.
To make sure you receive all records, check if the value of `next_record_id`
is\nset in the response. If it is, make another request and pass `next_record_id`
as a parameter.\nPseudo code example:\n```\nresponse := GetMonthlyCostAttribution(start_month,
Expand Down
2 changes: 2 additions & 0 deletions examples/v1/gcp-integration/CreateGCPIntegration.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
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) {
Expand All @@ -18,6 +19,7 @@ public static void main(String[] args) {
.clientId("163662907116366290710")
.clientX509CertUrl("https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL")
.hostFilters("key:value,filter:example")
.cloudRunRevisionFilters(Collections.singletonList("dr:dre"))
.isCspmEnabled(true)
.isSecurityCommandCenterEnabled(true)
.privateKey("private_key")
Expand Down
42 changes: 42 additions & 0 deletions examples/v1/gcp-integration/UpdateGCPIntegration_3544259255.java
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();
}
}
}
31 changes: 29 additions & 2 deletions examples/v1/synthetics/CreateSyntheticsAPITest_1279271422.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,15 @@
import com.datadog.api.client.v1.model.SyntheticsGlobalVariableParseTestOptionsType;
import com.datadog.api.client.v1.model.SyntheticsGlobalVariableParserType;
import com.datadog.api.client.v1.model.SyntheticsParsingOptions;
import com.datadog.api.client.v1.model.SyntheticsTestCallType;
import com.datadog.api.client.v1.model.SyntheticsTestDetailsSubType;
import com.datadog.api.client.v1.model.SyntheticsTestOptions;
import com.datadog.api.client.v1.model.SyntheticsTestOptionsRetry;
import com.datadog.api.client.v1.model.SyntheticsTestRequest;
import com.datadog.api.client.v1.model.SyntheticsVariableParser;
import java.util.Arrays;
import java.util.Collections;
import java.util.Map;

public class Example {
public static void main(String[] args) {
Expand All @@ -41,7 +44,7 @@ public static void main(String[] args) {
.pattern("content-type")
.type(SyntheticsConfigVariableType.TEXT)))
.steps(
Collections.singletonList(
Arrays.asList(
new SyntheticsAPIStep()
.allowFailure(true)
.assertions(
Expand Down Expand Up @@ -71,7 +74,31 @@ public static void main(String[] args) {
.timeout(10.0)
.url("https://datadoghq.com"))
.retry(new SyntheticsTestOptionsRetry().count(5L).interval(1000.0))
.subtype(SyntheticsAPIStepSubtype.HTTP))))
.subtype(SyntheticsAPIStepSubtype.HTTP),
new SyntheticsAPIStep()
.name("GRPC CALL")
.subtype(SyntheticsAPIStepSubtype.GRPC)
.allowFailure(false)
.isCritical(true)
.retry(new SyntheticsTestOptionsRetry().count(0L).interval(300.0))
.assertions(
Collections.singletonList(
new SyntheticsAssertion(
new SyntheticsAssertionTarget()
.operator(SyntheticsAssertionOperator.LESS_THAN)
.type(SyntheticsAssertionType.RESPONSE_TIME)
.target(1000))))
.request(
new SyntheticsTestRequest()
.host("grpcbin.test.k6.io")
.port(9000L)
.service("grpcbin.GRPCBin")
.method("Index")
.message("{}")
.compressedJsonDescriptor(
"eJy1lU1z2yAQhv+Lzj74I3ETH506bQ7OZOSm1w4Wa4epBARQppqM/3v5koCJJdvtxCdW77vPssCO3zMKUgHOFu/ZXvBiS6hZho/f8qe7pftYgXphWJrlA8XwxywEvNba+6PhkC2yVcVVswYp0R6ykRYlZ1SCV21SDrxsssPIeS9FJKqGfK2rqnmmSBwhWa2XlKgtaQPiDcRGCUDVfwGD2sKUqKEtc1cSoOrsMlaMOec1sySYCCgUYRSVLv2zSva2u+FQkB0pVkIw8bFuIudOOn3pOaKYVT3Iy97Pd0AYhOx5QcMsnxvRHlnuLf8ETDd3CNtrv2nejkDpRnANCmGkkFn/hsYzpBKE7jVbufgnKnV9HRM9zRPDDKPttYT61n0TdWkAAjggk9AhuxIeaXd69CYTcsGw7cBTakLVbNpRzGEgyWjkSOpMbZXkhGL6oX30R49qt3GoHrap7i0XdD41WQ+2icCNm5p1hmFqnHNlcla0riKmDZ183crDxChjbnurtxHPRE784sVhWvDfGP+SsTKibU3o5NtWHuZFGZOxP6P5VXqIOvaOSec4eYohyd7NslHuJbd1bewds85xYrNxkr2d+5IhFWF3NvaO684xjE2S5ulY+tu64Pna0fCPJgzw6vF5/WucLcYjt5xoq19O3UDptOg/OamJQRaCcPPnMTQ2QDFn+uhPvUfnCrMc99upyQY4Ui9Dlc/YoG3R/v4Cs9YE+g==")
.metadata(Map.ofEntries())
.callType(SyntheticsTestCallType.UNARY)))))
.locations(Collections.singletonList("aws:us-east-2"))
.message("BDD test payload: synthetics_api_test_multi_step_payload.json")
.name("Example-Synthetic")
Expand Down
40 changes: 40 additions & 0 deletions examples/v2/gcp-integration/CreateGCPSTSAccount_194782945.java
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 examples/v2/gcp-integration/UpdateGCPSTSAccount_2241994060.java
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();
}
}
}
3 changes: 3 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,9 @@
<exclude>META-INF/*.MF</exclude>
<exclude>META-INF/LICENSE*</exclude>
<exclude>META-INF/NOTICE*</exclude>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
Expand Down
40 changes: 40 additions & 0 deletions src/main/java/com/datadog/api/client/v1/model/GCPAccount.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
GCPAccount.JSON_PROPERTY_CLIENT_EMAIL,
GCPAccount.JSON_PROPERTY_CLIENT_ID,
GCPAccount.JSON_PROPERTY_CLIENT_X509_CERT_URL,
GCPAccount.JSON_PROPERTY_CLOUD_RUN_REVISION_FILTERS,
GCPAccount.JSON_PROPERTY_ERRORS,
GCPAccount.JSON_PROPERTY_HOST_FILTERS,
GCPAccount.JSON_PROPERTY_IS_CSPM_ENABLED,
Expand Down Expand Up @@ -60,6 +61,10 @@ public class GCPAccount {
public static final String JSON_PROPERTY_CLIENT_X509_CERT_URL = "client_x509_cert_url";
private String clientX509CertUrl;

public static final String JSON_PROPERTY_CLOUD_RUN_REVISION_FILTERS =
"cloud_run_revision_filters";
private List<String> cloudRunRevisionFilters = null;

public static final String JSON_PROPERTY_ERRORS = "errors";
private List<String> errors = null;

Expand Down Expand Up @@ -219,6 +224,36 @@ public void setClientX509CertUrl(String clientX509CertUrl) {
this.clientX509CertUrl = clientX509CertUrl;
}

public GCPAccount cloudRunRevisionFilters(List<String> cloudRunRevisionFilters) {
this.cloudRunRevisionFilters = cloudRunRevisionFilters;
return this;
}

public GCPAccount addCloudRunRevisionFiltersItem(String cloudRunRevisionFiltersItem) {
if (this.cloudRunRevisionFilters == null) {
this.cloudRunRevisionFilters = new ArrayList<>();
}
this.cloudRunRevisionFilters.add(cloudRunRevisionFiltersItem);
return this;
}

/**
* Limit the Cloud Run revisions that are pulled into Datadog by using tags. Only Cloud Run
* revision resources that apply to specified filters are imported into Datadog.
*
* @return cloudRunRevisionFilters
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_CLOUD_RUN_REVISION_FILTERS)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public List<String> getCloudRunRevisionFilters() {
return cloudRunRevisionFilters;
}

public void setCloudRunRevisionFilters(List<String> cloudRunRevisionFilters) {
this.cloudRunRevisionFilters = cloudRunRevisionFilters;
}

public GCPAccount errors(List<String> errors) {
this.errors = errors;
return this;
Expand Down Expand Up @@ -502,6 +537,7 @@ public boolean equals(Object o) {
&& Objects.equals(this.clientEmail, gcpAccount.clientEmail)
&& Objects.equals(this.clientId, gcpAccount.clientId)
&& Objects.equals(this.clientX509CertUrl, gcpAccount.clientX509CertUrl)
&& Objects.equals(this.cloudRunRevisionFilters, gcpAccount.cloudRunRevisionFilters)
&& Objects.equals(this.errors, gcpAccount.errors)
&& Objects.equals(this.hostFilters, gcpAccount.hostFilters)
&& Objects.equals(this.isCspmEnabled, gcpAccount.isCspmEnabled)
Expand All @@ -525,6 +561,7 @@ public int hashCode() {
clientEmail,
clientId,
clientX509CertUrl,
cloudRunRevisionFilters,
errors,
hostFilters,
isCspmEnabled,
Expand All @@ -550,6 +587,9 @@ public String toString() {
sb.append(" clientEmail: ").append(toIndentedString(clientEmail)).append("\n");
sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n");
sb.append(" clientX509CertUrl: ").append(toIndentedString(clientX509CertUrl)).append("\n");
sb.append(" cloudRunRevisionFilters: ")
.append(toIndentedString(cloudRunRevisionFilters))
.append("\n");
sb.append(" errors: ").append(toIndentedString(errors)).append("\n");
sb.append(" hostFilters: ").append(toIndentedString(hostFilters)).append("\n");
sb.append(" isCspmEnabled: ").append(toIndentedString(isCspmEnabled)).append("\n");
Expand Down
Loading

0 comments on commit a17fa49

Please sign in to comment.