diff --git a/.apigentools-info b/.apigentools-info index 8a6764c0849..3e0d2ebecde 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2024-02-14 10:50:03.602357", - "spec_repo_commit": "9348385b" + "regenerated": "2024-02-20 12:21:52.216044", + "spec_repo_commit": "7e467650" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2024-02-14 10:50:03.618501", - "spec_repo_commit": "9348385b" + "regenerated": "2024-02-20 12:21:52.235691", + "spec_repo_commit": "7e467650" } } } \ No newline at end of file diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 99631ba18dc..89e57a83cb6 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -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: @@ -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: diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 3a7820429e6..5d118d9175c 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -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 @@ -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: @@ -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': @@ -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, diff --git a/api/datadogV1/model_gcp_account.go b/api/datadogV1/model_gcp_account.go index 9b941e37f00..25daa34fba8 100644 --- a/api/datadogV1/model_gcp_account.go +++ b/api/datadogV1/model_gcp_account.go @@ -23,6 +23,9 @@ type GCPAccount struct { // Should be `https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL` // where `$CLIENT_EMAIL` is the email found in your JSON service account key. ClientX509CertUrl *string `json:"client_x509_cert_url,omitempty"` + // 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. + CloudRunRevisionFilters []string `json:"cloud_run_revision_filters,omitempty"` // An array of errors. Errors []string `json:"errors,omitempty"` // Limit the GCE instances that are pulled into Datadog by using tags. @@ -238,6 +241,34 @@ func (o *GCPAccount) SetClientX509CertUrl(v string) { o.ClientX509CertUrl = &v } +// GetCloudRunRevisionFilters returns the CloudRunRevisionFilters field value if set, zero value otherwise. +func (o *GCPAccount) GetCloudRunRevisionFilters() []string { + if o == nil || o.CloudRunRevisionFilters == nil { + var ret []string + return ret + } + return o.CloudRunRevisionFilters +} + +// GetCloudRunRevisionFiltersOk returns a tuple with the CloudRunRevisionFilters field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GCPAccount) GetCloudRunRevisionFiltersOk() (*[]string, bool) { + if o == nil || o.CloudRunRevisionFilters == nil { + return nil, false + } + return &o.CloudRunRevisionFilters, true +} + +// HasCloudRunRevisionFilters returns a boolean if a field has been set. +func (o *GCPAccount) HasCloudRunRevisionFilters() bool { + return o != nil && o.CloudRunRevisionFilters != nil +} + +// SetCloudRunRevisionFilters gets a reference to the given []string and assigns it to the CloudRunRevisionFilters field. +func (o *GCPAccount) SetCloudRunRevisionFilters(v []string) { + o.CloudRunRevisionFilters = v +} + // GetErrors returns the Errors field value if set, zero value otherwise. func (o *GCPAccount) GetErrors() []string { if o == nil || o.Errors == nil { @@ -542,6 +573,9 @@ func (o GCPAccount) MarshalJSON() ([]byte, error) { if o.ClientX509CertUrl != nil { toSerialize["client_x509_cert_url"] = o.ClientX509CertUrl } + if o.CloudRunRevisionFilters != nil { + toSerialize["cloud_run_revision_filters"] = o.CloudRunRevisionFilters + } if o.Errors != nil { toSerialize["errors"] = o.Errors } @@ -588,6 +622,7 @@ func (o *GCPAccount) UnmarshalJSON(bytes []byte) (err error) { ClientEmail *string `json:"client_email,omitempty"` ClientId *string `json:"client_id,omitempty"` ClientX509CertUrl *string `json:"client_x509_cert_url,omitempty"` + CloudRunRevisionFilters []string `json:"cloud_run_revision_filters,omitempty"` Errors []string `json:"errors,omitempty"` HostFilters *string `json:"host_filters,omitempty"` IsCspmEnabled *bool `json:"is_cspm_enabled,omitempty"` @@ -604,7 +639,7 @@ func (o *GCPAccount) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"auth_provider_x509_cert_url", "auth_uri", "automute", "client_email", "client_id", "client_x509_cert_url", "errors", "host_filters", "is_cspm_enabled", "is_security_command_center_enabled", "private_key", "private_key_id", "project_id", "resource_collection_enabled", "token_uri", "type"}) + datadog.DeleteKeys(additionalProperties, &[]string{"auth_provider_x509_cert_url", "auth_uri", "automute", "client_email", "client_id", "client_x509_cert_url", "cloud_run_revision_filters", "errors", "host_filters", "is_cspm_enabled", "is_security_command_center_enabled", "private_key", "private_key_id", "project_id", "resource_collection_enabled", "token_uri", "type"}) } else { return err } @@ -614,6 +649,7 @@ func (o *GCPAccount) UnmarshalJSON(bytes []byte) (err error) { o.ClientEmail = all.ClientEmail o.ClientId = all.ClientId o.ClientX509CertUrl = all.ClientX509CertUrl + o.CloudRunRevisionFilters = all.CloudRunRevisionFilters o.Errors = all.Errors o.HostFilters = all.HostFilters o.IsCspmEnabled = all.IsCspmEnabled diff --git a/api/datadogV1/model_synthetics_api_step_subtype.go b/api/datadogV1/model_synthetics_api_step_subtype.go index ee837514f34..3d8bbe32101 100644 --- a/api/datadogV1/model_synthetics_api_step_subtype.go +++ b/api/datadogV1/model_synthetics_api_step_subtype.go @@ -16,10 +16,12 @@ type SyntheticsAPIStepSubtype string // List of SyntheticsAPIStepSubtype. const ( SYNTHETICSAPISTEPSUBTYPE_HTTP SyntheticsAPIStepSubtype = "http" + SYNTHETICSAPISTEPSUBTYPE_GRPC SyntheticsAPIStepSubtype = "grpc" ) var allowedSyntheticsAPIStepSubtypeEnumValues = []SyntheticsAPIStepSubtype{ SYNTHETICSAPISTEPSUBTYPE_HTTP, + SYNTHETICSAPISTEPSUBTYPE_GRPC, } // GetAllowedValues reeturns the list of possible values. diff --git a/api/datadogV2/api_usage_metering.go b/api/datadogV2/api_usage_metering.go index d96fae7d0fc..15f5935223e 100644 --- a/api/datadogV2/api_usage_metering.go +++ b/api/datadogV2/api_usage_metering.go @@ -19,7 +19,7 @@ import ( type UsageMeteringApi datadog.Service // GetActiveBillingDimensions Get active billing dimensions for cost attribution. -// Get active billing dimensions for cost attribution. Cost data for a given month becomes available no later than the 17th of the following month. +// Get active billing dimensions for cost attribution. Cost data for a given month becomes available no later than the 19th of the following month. func (a *UsageMeteringApi) GetActiveBillingDimensions(ctx _context.Context) (ActiveBillingDimensionsResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet @@ -648,7 +648,7 @@ func (r *GetMonthlyCostAttributionOptionalParameters) WithIncludeDescendants(inc // GetMonthlyCostAttribution Get Monthly Cost Attribution. // Get monthly cost attribution by tag across multi-org and single root-org accounts. -// Cost Attribution data for a given month becomes available no later than the 17th of the following month. +// Cost Attribution data for a given month becomes available no later than the 19th of the following month. // This API endpoint is paginated. To make sure you receive all records, check if the value of `next_record_id` is // set in the response. If it is, make another request and pass `next_record_id` as a parameter. // Pseudo code example: diff --git a/api/datadogV2/model_ci_app_aggregate_sort.go b/api/datadogV2/model_ci_app_aggregate_sort.go index 2dfce3d06fd..689806ed36c 100644 --- a/api/datadogV2/model_ci_app_aggregate_sort.go +++ b/api/datadogV2/model_ci_app_aggregate_sort.go @@ -8,7 +8,7 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// CIAppAggregateSort A sort rule. +// CIAppAggregateSort A sort rule. The `aggregation` field is required when `type` is `measure`. type CIAppAggregateSort struct { // An aggregation function. Aggregation *CIAppAggregationFunction `json:"aggregation,omitempty"` diff --git a/api/datadogV2/model_ci_app_pipelines_group_by.go b/api/datadogV2/model_ci_app_pipelines_group_by.go index b73d0a97dfe..4af9427ea4e 100644 --- a/api/datadogV2/model_ci_app_pipelines_group_by.go +++ b/api/datadogV2/model_ci_app_pipelines_group_by.go @@ -21,7 +21,7 @@ type CIAppPipelinesGroupBy struct { Limit *int64 `json:"limit,omitempty"` // The value to use for logs that don't have the facet used to group-by. Missing *CIAppGroupByMissing `json:"missing,omitempty"` - // A sort rule. + // A sort rule. The `aggregation` field is required when `type` is `measure`. Sort *CIAppAggregateSort `json:"sort,omitempty"` // A resulting object to put the given computes in over all the matching records. Total *CIAppGroupByTotal `json:"total,omitempty"` diff --git a/api/datadogV2/model_ci_app_tests_group_by.go b/api/datadogV2/model_ci_app_tests_group_by.go index fe8b3532d2d..69c76f55c58 100644 --- a/api/datadogV2/model_ci_app_tests_group_by.go +++ b/api/datadogV2/model_ci_app_tests_group_by.go @@ -21,7 +21,7 @@ type CIAppTestsGroupBy struct { Limit *int64 `json:"limit,omitempty"` // The value to use for logs that don't have the facet used to group-by. Missing *CIAppGroupByMissing `json:"missing,omitempty"` - // A sort rule. + // A sort rule. The `aggregation` field is required when `type` is `measure`. Sort *CIAppAggregateSort `json:"sort,omitempty"` // A resulting object to put the given computes in over all the matching records. Total *CIAppGroupByTotal `json:"total,omitempty"` diff --git a/api/datadogV2/model_gcpsts_service_account_attributes.go b/api/datadogV2/model_gcpsts_service_account_attributes.go index adc7357b555..d24a4f5ff83 100644 --- a/api/datadogV2/model_gcpsts_service_account_attributes.go +++ b/api/datadogV2/model_gcpsts_service_account_attributes.go @@ -16,6 +16,9 @@ type GCPSTSServiceAccountAttributes struct { Automute *bool `json:"automute,omitempty"` // Your service account email address. ClientEmail *string `json:"client_email,omitempty"` + // 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. + CloudRunRevisionFilters []string `json:"cloud_run_revision_filters,omitempty"` // Your Host Filters. HostFilters []string `json:"host_filters,omitempty"` // When enabled, Datadog will activate the Cloud Security Monitoring product for this service account. Note: This requires resource_collection_enabled to be set to true. @@ -134,6 +137,34 @@ func (o *GCPSTSServiceAccountAttributes) SetClientEmail(v string) { o.ClientEmail = &v } +// GetCloudRunRevisionFilters returns the CloudRunRevisionFilters field value if set, zero value otherwise. +func (o *GCPSTSServiceAccountAttributes) GetCloudRunRevisionFilters() []string { + if o == nil || o.CloudRunRevisionFilters == nil { + var ret []string + return ret + } + return o.CloudRunRevisionFilters +} + +// GetCloudRunRevisionFiltersOk returns a tuple with the CloudRunRevisionFilters field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GCPSTSServiceAccountAttributes) GetCloudRunRevisionFiltersOk() (*[]string, bool) { + if o == nil || o.CloudRunRevisionFilters == nil { + return nil, false + } + return &o.CloudRunRevisionFilters, true +} + +// HasCloudRunRevisionFilters returns a boolean if a field has been set. +func (o *GCPSTSServiceAccountAttributes) HasCloudRunRevisionFilters() bool { + return o != nil && o.CloudRunRevisionFilters != nil +} + +// SetCloudRunRevisionFilters gets a reference to the given []string and assigns it to the CloudRunRevisionFilters field. +func (o *GCPSTSServiceAccountAttributes) SetCloudRunRevisionFilters(v []string) { + o.CloudRunRevisionFilters = v +} + // GetHostFilters returns the HostFilters field value if set, zero value otherwise. func (o *GCPSTSServiceAccountAttributes) GetHostFilters() []string { if o == nil || o.HostFilters == nil { @@ -261,6 +292,9 @@ func (o GCPSTSServiceAccountAttributes) MarshalJSON() ([]byte, error) { if o.ClientEmail != nil { toSerialize["client_email"] = o.ClientEmail } + if o.CloudRunRevisionFilters != nil { + toSerialize["cloud_run_revision_filters"] = o.CloudRunRevisionFilters + } if o.HostFilters != nil { toSerialize["host_filters"] = o.HostFilters } @@ -286,6 +320,7 @@ func (o *GCPSTSServiceAccountAttributes) UnmarshalJSON(bytes []byte) (err error) AccountTags []string `json:"account_tags,omitempty"` Automute *bool `json:"automute,omitempty"` ClientEmail *string `json:"client_email,omitempty"` + CloudRunRevisionFilters []string `json:"cloud_run_revision_filters,omitempty"` HostFilters []string `json:"host_filters,omitempty"` IsCspmEnabled *bool `json:"is_cspm_enabled,omitempty"` IsSecurityCommandCenterEnabled *bool `json:"is_security_command_center_enabled,omitempty"` @@ -296,13 +331,14 @@ func (o *GCPSTSServiceAccountAttributes) UnmarshalJSON(bytes []byte) (err error) } additionalProperties := make(map[string]interface{}) if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"account_tags", "automute", "client_email", "host_filters", "is_cspm_enabled", "is_security_command_center_enabled", "resource_collection_enabled"}) + datadog.DeleteKeys(additionalProperties, &[]string{"account_tags", "automute", "client_email", "cloud_run_revision_filters", "host_filters", "is_cspm_enabled", "is_security_command_center_enabled", "resource_collection_enabled"}) } else { return err } o.AccountTags = all.AccountTags o.Automute = all.Automute o.ClientEmail = all.ClientEmail + o.CloudRunRevisionFilters = all.CloudRunRevisionFilters o.HostFilters = all.HostFilters o.IsCspmEnabled = all.IsCspmEnabled o.IsSecurityCommandCenterEnabled = all.IsSecurityCommandCenterEnabled diff --git a/examples/v1/gcp-integration/CreateGCPIntegration.go b/examples/v1/gcp-integration/CreateGCPIntegration.go index fb22eb53e69..24d97410367 100644 --- a/examples/v1/gcp-integration/CreateGCPIntegration.go +++ b/examples/v1/gcp-integration/CreateGCPIntegration.go @@ -14,12 +14,15 @@ import ( func main() { body := datadogV1.GCPAccount{ - AuthProviderX509CertUrl: datadog.PtrString("https://www.googleapis.com/oauth2/v1/certs"), - AuthUri: datadog.PtrString("https://accounts.google.com/o/oauth2/auth"), - ClientEmail: datadog.PtrString("252bf553ef04b351@example.com"), - ClientId: datadog.PtrString("163662907116366290710"), - ClientX509CertUrl: datadog.PtrString("https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL"), - HostFilters: datadog.PtrString("key:value,filter:example"), + AuthProviderX509CertUrl: datadog.PtrString("https://www.googleapis.com/oauth2/v1/certs"), + AuthUri: datadog.PtrString("https://accounts.google.com/o/oauth2/auth"), + ClientEmail: datadog.PtrString("252bf553ef04b351@example.com"), + ClientId: datadog.PtrString("163662907116366290710"), + ClientX509CertUrl: datadog.PtrString("https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL"), + HostFilters: datadog.PtrString("key:value,filter:example"), + CloudRunRevisionFilters: []string{ + "dr:dre", + }, IsCspmEnabled: datadog.PtrBool(true), IsSecurityCommandCenterEnabled: datadog.PtrBool(true), PrivateKey: datadog.PtrString("private_key"), diff --git a/examples/v1/gcp-integration/UpdateGCPIntegration_3544259255.go b/examples/v1/gcp-integration/UpdateGCPIntegration_3544259255.go new file mode 100644 index 00000000000..a75447ba3bd --- /dev/null +++ b/examples/v1/gcp-integration/UpdateGCPIntegration_3544259255.go @@ -0,0 +1,48 @@ +// Update a GCP integration cloud run revision filters returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV1" +) + +func main() { + body := datadogV1.GCPAccount{ + AuthProviderX509CertUrl: datadog.PtrString("https://www.googleapis.com/oauth2/v1/certs"), + AuthUri: datadog.PtrString("https://accounts.google.com/o/oauth2/auth"), + ClientEmail: datadog.PtrString("252bf553ef04b351@example.com"), + ClientId: datadog.PtrString("163662907116366290710"), + ClientX509CertUrl: datadog.PtrString("https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL"), + HostFilters: datadog.PtrString("key:value,filter:example"), + CloudRunRevisionFilters: []string{ + "merp:derp", + }, + IsCspmEnabled: datadog.PtrBool(true), + IsSecurityCommandCenterEnabled: datadog.PtrBool(true), + PrivateKey: datadog.PtrString("private_key"), + PrivateKeyId: datadog.PtrString("123456789abcdefghi123456789abcdefghijklm"), + ProjectId: datadog.PtrString("datadog-apitest"), + ResourceCollectionEnabled: datadog.PtrBool(true), + TokenUri: datadog.PtrString("https://accounts.google.com/o/oauth2/token"), + Type: datadog.PtrString("service_account"), + } + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + apiClient := datadog.NewAPIClient(configuration) + api := datadogV1.NewGCPIntegrationApi(apiClient) + resp, r, err := api.UpdateGCPIntegration(ctx, body) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `GCPIntegrationApi.UpdateGCPIntegration`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `GCPIntegrationApi.UpdateGCPIntegration`:\n%s\n", responseContent) +} diff --git a/examples/v1/synthetics/CreateSyntheticsAPITest_1279271422.go b/examples/v1/synthetics/CreateSyntheticsAPITest_1279271422.go index 9a99321e48a..dc76b5e26f9 100644 --- a/examples/v1/synthetics/CreateSyntheticsAPITest_1279271422.go +++ b/examples/v1/synthetics/CreateSyntheticsAPITest_1279271422.go @@ -58,6 +58,35 @@ func main() { }, Subtype: datadogV1.SYNTHETICSAPISTEPSUBTYPE_HTTP, }, + { + Name: "GRPC CALL", + Subtype: datadogV1.SYNTHETICSAPISTEPSUBTYPE_GRPC, + ExtractedValues: []datadogV1.SyntheticsParsingOptions{}, + AllowFailure: datadog.PtrBool(false), + IsCritical: datadog.PtrBool(true), + Retry: &datadogV1.SyntheticsTestOptionsRetry{ + Count: datadog.PtrInt64(0), + Interval: datadog.PtrFloat64(300), + }, + Assertions: []datadogV1.SyntheticsAssertion{ + datadogV1.SyntheticsAssertion{ + SyntheticsAssertionTarget: &datadogV1.SyntheticsAssertionTarget{ + Operator: datadogV1.SYNTHETICSASSERTIONOPERATOR_LESS_THAN, + Type: datadogV1.SYNTHETICSASSERTIONTYPE_RESPONSE_TIME, + Target: 1000, + }}, + }, + Request: datadogV1.SyntheticsTestRequest{ + Host: datadog.PtrString("grpcbin.test.k6.io"), + Port: datadog.PtrInt64(9000), + Service: datadog.PtrString("grpcbin.GRPCBin"), + Method: datadog.PtrString("Index"), + Message: datadog.PtrString("{}"), + CompressedJsonDescriptor: datadog.PtrString("eJy1lU1z2yAQhv+Lzj74I3ETH506bQ7OZOSm1w4Wa4epBARQppqM/3v5koCJJdvtxCdW77vPssCO3zMKUgHOFu/ZXvBiS6hZho/f8qe7pftYgXphWJrlA8XwxywEvNba+6PhkC2yVcVVswYp0R6ykRYlZ1SCV21SDrxsssPIeS9FJKqGfK2rqnmmSBwhWa2XlKgtaQPiDcRGCUDVfwGD2sKUqKEtc1cSoOrsMlaMOec1sySYCCgUYRSVLv2zSva2u+FQkB0pVkIw8bFuIudOOn3pOaKYVT3Iy97Pd0AYhOx5QcMsnxvRHlnuLf8ETDd3CNtrv2nejkDpRnANCmGkkFn/hsYzpBKE7jVbufgnKnV9HRM9zRPDDKPttYT61n0TdWkAAjggk9AhuxIeaXd69CYTcsGw7cBTakLVbNpRzGEgyWjkSOpMbZXkhGL6oX30R49qt3GoHrap7i0XdD41WQ+2icCNm5p1hmFqnHNlcla0riKmDZ183crDxChjbnurtxHPRE784sVhWvDfGP+SsTKibU3o5NtWHuZFGZOxP6P5VXqIOvaOSec4eYohyd7NslHuJbd1bewds85xYrNxkr2d+5IhFWF3NvaO684xjE2S5ulY+tu64Pna0fCPJgzw6vF5/WucLcYjt5xoq19O3UDptOg/OamJQRaCcPPnMTQ2QDFn+uhPvUfnCrMc99upyQY4Ui9Dlc/YoG3R/v4Cs9YE+g=="), + Metadata: map[string]string{}, + CallType: datadogV1.SYNTHETICSTESTCALLTYPE_UNARY.Ptr(), + }, + }, }, }, Locations: []string{ diff --git a/examples/v2/gcp-integration/CreateGCPSTSAccount_194782945.go b/examples/v2/gcp-integration/CreateGCPSTSAccount_194782945.go new file mode 100644 index 00000000000..f376f43c287 --- /dev/null +++ b/examples/v2/gcp-integration/CreateGCPSTSAccount_194782945.go @@ -0,0 +1,41 @@ +// Create a new entry for your service account with cloud run revision filters enabled returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + body := datadogV2.GCPSTSServiceAccountCreateRequest{ + Data: &datadogV2.GCPSTSServiceAccountData{ + Attributes: &datadogV2.GCPSTSServiceAccountAttributes{ + CloudRunRevisionFilters: []string{ + "meh:bleh", + }, + ClientEmail: datadog.PtrString("252bf553ef04b351@test-project.iam.gserviceaccount.com"), + HostFilters: []string{}, + }, + Type: datadogV2.GCPSERVICEACCOUNTTYPE_GCP_SERVICE_ACCOUNT.Ptr(), + }, + } + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewGCPIntegrationApi(apiClient) + resp, r, err := api.CreateGCPSTSAccount(ctx, body) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `GCPIntegrationApi.CreateGCPSTSAccount`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `GCPIntegrationApi.CreateGCPSTSAccount`:\n%s\n", responseContent) +} diff --git a/examples/v2/gcp-integration/UpdateGCPSTSAccount_2241994060.go b/examples/v2/gcp-integration/UpdateGCPSTSAccount_2241994060.go new file mode 100644 index 00000000000..bcfcb18cb74 --- /dev/null +++ b/examples/v2/gcp-integration/UpdateGCPSTSAccount_2241994060.go @@ -0,0 +1,44 @@ +// Update STS Service Account returns "OK" response with cloud run revision filters + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + // there is a valid "gcp_sts_account" in the system + GcpStsAccountDataID := os.Getenv("GCP_STS_ACCOUNT_DATA_ID") + + body := datadogV2.GCPSTSServiceAccountUpdateRequest{ + Data: &datadogV2.GCPSTSServiceAccountUpdateRequestData{ + Attributes: &datadogV2.GCPSTSServiceAccountAttributes{ + ClientEmail: datadog.PtrString("252bf553ef04b351@example.com"), + CloudRunRevisionFilters: []string{ + "merp:derp", + }, + }, + Id: datadog.PtrString(GcpStsAccountDataID), + Type: datadogV2.GCPSERVICEACCOUNTTYPE_GCP_SERVICE_ACCOUNT.Ptr(), + }, + } + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewGCPIntegrationApi(apiClient) + resp, r, err := api.UpdateGCPSTSAccount(ctx, GcpStsAccountDataID, body) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `GCPIntegrationApi.UpdateGCPSTSAccount`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `GCPIntegrationApi.UpdateGCPSTSAccount`:\n%s\n", responseContent) +} diff --git a/tests/scenarios/cassettes/TestScenarios/v1/Feature_GCP_Integration/Scenario_Create_a_GCP_integration_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v1/Feature_GCP_Integration/Scenario_Create_a_GCP_integration_returns_OK_response.freeze index 3677f3cb1d1..3898833e13c 100644 --- a/tests/scenarios/cassettes/TestScenarios/v1/Feature_GCP_Integration/Scenario_Create_a_GCP_integration_returns_OK_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v1/Feature_GCP_Integration/Scenario_Create_a_GCP_integration_returns_OK_response.freeze @@ -1 +1 @@ -2023-12-20T13:18:07.717Z \ No newline at end of file +2024-01-31T21:16:03.254Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v1/Feature_GCP_Integration/Scenario_Create_a_GCP_integration_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v1/Feature_GCP_Integration/Scenario_Create_a_GCP_integration_returns_OK_response.yaml index 612f2d25ec9..deaa8e381ec 100644 --- a/tests/scenarios/cassettes/TestScenarios/v1/Feature_GCP_Integration/Scenario_Create_a_GCP_integration_returns_OK_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v1/Feature_GCP_Integration/Scenario_Create_a_GCP_integration_returns_OK_response.yaml @@ -1,7 +1,7 @@ interactions: - request: body: | - {"auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs","auth_uri":"https://accounts.google.com/o/oauth2/auth","client_email":"e5bbc86fb86ab202@example.com","client_id":"170307828717030782870","client_x509_cert_url":"https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL","host_filters":"key:value,filter:example","is_cspm_enabled":true,"is_security_command_center_enabled":true,"private_key":"private_key","private_key_id":"123456789abcdefghi123456789abcdefghijklm","project_id":"datadog-apitest","resource_collection_enabled":true,"token_uri":"https://accounts.google.com/o/oauth2/token","type":"service_account"} + {"auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs","auth_uri":"https://accounts.google.com/o/oauth2/auth","client_email":"3af93b0f1c973838@example.com","client_id":"170673576317067357630","client_x509_cert_url":"https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL","cloud_run_revision_filters":["dr:dre"],"host_filters":"key:value,filter:example","is_cspm_enabled":true,"is_security_command_center_enabled":true,"private_key":"private_key","private_key_id":"123456789abcdefghi123456789abcdefghijklm","project_id":"datadog-apitest","resource_collection_enabled":true,"token_uri":"https://accounts.google.com/o/oauth2/token","type":"service_account"} form: {} headers: Accept: @@ -23,7 +23,7 @@ interactions: status: 200 OK - request: body: | - {"client_email":"e5bbc86fb86ab202@example.com","client_id":"170307828717030782870","project_id":"datadog-apitest"} + {"client_email":"3af93b0f1c973838@example.com","client_id":"170673576317067357630","project_id":"datadog-apitest"} form: {} headers: Accept: diff --git a/tests/scenarios/cassettes/TestScenarios/v1/Feature_GCP_Integration/Scenario_Update_a_GCP_integration_cloud_run_revision_filters_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v1/Feature_GCP_Integration/Scenario_Update_a_GCP_integration_cloud_run_revision_filters_returns_OK_response.freeze new file mode 100644 index 00000000000..6f951f6ba55 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v1/Feature_GCP_Integration/Scenario_Update_a_GCP_integration_cloud_run_revision_filters_returns_OK_response.freeze @@ -0,0 +1 @@ +2024-01-31T21:16:03.829Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v1/Feature_GCP_Integration/Scenario_Update_a_GCP_integration_cloud_run_revision_filters_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v1/Feature_GCP_Integration/Scenario_Update_a_GCP_integration_cloud_run_revision_filters_returns_OK_response.yaml new file mode 100644 index 00000000000..28d936b7cf0 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v1/Feature_GCP_Integration/Scenario_Update_a_GCP_integration_cloud_run_revision_filters_returns_OK_response.yaml @@ -0,0 +1,68 @@ +interactions: +- request: + body: | + {"auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs","auth_uri":"https://accounts.google.com/o/oauth2/auth","client_email":"edcdf6542ac6e6b6@example.com","client_id":"170673576317067357630","client_x509_cert_url":"https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL","host_filters":"key:value,filter:example","is_cspm_enabled":true,"is_security_command_center_enabled":true,"private_key":"private_key","private_key_id":"123456789abcdefghi123456789abcdefghijklm","project_id":"datadog-apitest","resource_collection_enabled":true,"token_uri":"https://accounts.google.com/o/oauth2/token","type":"service_account"} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + id: 0 + method: POST + url: https://api.datadoghq.com/api/v1/integration/gcp + response: + body: '{} + + ' + code: 200 + duration: 0ms + headers: + Content-Type: + - application/json + status: 200 OK +- request: + body: | + {"auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs","auth_uri":"https://accounts.google.com/o/oauth2/auth","client_email":"edcdf6542ac6e6b6@example.com","client_id":"170673576317067357630","client_x509_cert_url":"https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL","cloud_run_revision_filters":["merp:derp"],"host_filters":"key:value,filter:example","is_cspm_enabled":true,"is_security_command_center_enabled":true,"private_key":"private_key","private_key_id":"123456789abcdefghi123456789abcdefghijklm","project_id":"datadog-apitest","resource_collection_enabled":true,"token_uri":"https://accounts.google.com/o/oauth2/token","type":"service_account"} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + id: 1 + method: PUT + url: https://api.datadoghq.com/api/v1/integration/gcp + response: + body: '{} + + ' + code: 200 + duration: 0ms + headers: + Content-Type: + - application/json + status: 200 OK +- request: + body: | + {"client_email":"edcdf6542ac6e6b6@example.com","client_id":"170673576317067357630","project_id":"datadog-apitest"} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + id: 2 + method: DELETE + url: https://api.datadoghq.com/api/v1/integration/gcp + response: + body: '{} + + ' + code: 200 + duration: 0ms + headers: + Content-Type: + - application/json + status: 200 OK +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v1/Feature_Synthetics/Scenario_Create_a_global_variable_from_test_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v1/Feature_Synthetics/Scenario_Create_a_global_variable_from_test_returns_OK_response.freeze index d9857f82457..5a6248b6359 100644 --- a/tests/scenarios/cassettes/TestScenarios/v1/Feature_Synthetics/Scenario_Create_a_global_variable_from_test_returns_OK_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v1/Feature_Synthetics/Scenario_Create_a_global_variable_from_test_returns_OK_response.freeze @@ -1 +1 @@ -2024-01-26T10:20:27.109Z \ No newline at end of file +2024-02-14T09:56:55.385Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v1/Feature_Synthetics/Scenario_Create_a_global_variable_from_test_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v1/Feature_Synthetics/Scenario_Create_a_global_variable_from_test_returns_OK_response.yaml index eee26e0a7f8..ac1fb127aa7 100644 --- a/tests/scenarios/cassettes/TestScenarios/v1/Feature_Synthetics/Scenario_Create_a_global_variable_from_test_returns_OK_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v1/Feature_Synthetics/Scenario_Create_a_global_variable_from_test_returns_OK_response.yaml @@ -1,7 +1,7 @@ interactions: - request: body: | - {"config":{"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"steps":[{"allowFailure":true,"assertions":[{"operator":"is","target":200,"type":"statusCode"}],"extractedValues":[{"field":"server","name":"EXTRACTED_VALUE","parser":{"type":"raw"},"secure":true,"type":"http_header"}],"isCritical":true,"name":"request is sent","request":{"method":"GET","timeout":10,"url":"https://datadoghq.com"},"retry":{"count":5,"interval":1000},"subtype":"http"}]},"locations":["aws:us-east-2"],"message":"BDD test payload: synthetics_api_test_multi_step_payload.json","name":"Test-Create_a_global_variable_from_test_returns_OK_response-1706264427","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Create_a_global_variable_from_test_returns_OK_response-1706264427","monitor_priority":5,"retry":{"count":3,"interval":1000},"tick_every":60},"subtype":"multi","tags":["testing:api"],"type":"api"} + {"config":{"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"steps":[{"allowFailure":true,"assertions":[{"operator":"is","target":200,"type":"statusCode"}],"extractedValues":[{"field":"server","name":"EXTRACTED_VALUE","parser":{"type":"raw"},"secure":true,"type":"http_header"}],"isCritical":true,"name":"request is sent","request":{"method":"GET","timeout":10,"url":"https://datadoghq.com"},"retry":{"count":5,"interval":1000},"subtype":"http"},{"allowFailure":false,"assertions":[{"operator":"lessThan","target":1000,"type":"responseTime"}],"extractedValues":[],"isCritical":true,"name":"GRPC CALL","request":{"callType":"unary","compressedJsonDescriptor":"eJy1lU1z2yAQhv+Lzj74I3ETH506bQ7OZOSm1w4Wa4epBARQppqM/3v5koCJJdvtxCdW77vPssCO3zMKUgHOFu/ZXvBiS6hZho/f8qe7pftYgXphWJrlA8XwxywEvNba+6PhkC2yVcVVswYp0R6ykRYlZ1SCV21SDrxsssPIeS9FJKqGfK2rqnmmSBwhWa2XlKgtaQPiDcRGCUDVfwGD2sKUqKEtc1cSoOrsMlaMOec1sySYCCgUYRSVLv2zSva2u+FQkB0pVkIw8bFuIudOOn3pOaKYVT3Iy97Pd0AYhOx5QcMsnxvRHlnuLf8ETDd3CNtrv2nejkDpRnANCmGkkFn/hsYzpBKE7jVbufgnKnV9HRM9zRPDDKPttYT61n0TdWkAAjggk9AhuxIeaXd69CYTcsGw7cBTakLVbNpRzGEgyWjkSOpMbZXkhGL6oX30R49qt3GoHrap7i0XdD41WQ+2icCNm5p1hmFqnHNlcla0riKmDZ183crDxChjbnurtxHPRE784sVhWvDfGP+SsTKibU3o5NtWHuZFGZOxP6P5VXqIOvaOSec4eYohyd7NslHuJbd1bewds85xYrNxkr2d+5IhFWF3NvaO684xjE2S5ulY+tu64Pna0fCPJgzw6vF5/WucLcYjt5xoq19O3UDptOg/OamJQRaCcPPnMTQ2QDFn+uhPvUfnCrMc99upyQY4Ui9Dlc/YoG3R/v4Cs9YE+g==","host":"grpcbin.test.k6.io","message":"{}","metadata":{},"method":"Index","port":9000,"service":"grpcbin.GRPCBin"},"retry":{"count":0,"interval":300},"subtype":"grpc"}]},"locations":["aws:us-east-2"],"message":"BDD test payload: synthetics_api_test_multi_step_payload.json","name":"Test-Create_a_global_variable_from_test_returns_OK_response-1707904615","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Create_a_global_variable_from_test_returns_OK_response-1707904615","monitor_priority":5,"retry":{"count":3,"interval":1000},"tick_every":60},"subtype":"multi","tags":["testing:api"],"type":"api"} form: {} headers: Accept: @@ -12,9 +12,12 @@ interactions: method: POST url: https://api.datadoghq.com/api/v1/synthetics/tests/api response: - body: '{"public_id":"izb-9gc-92w","name":"Test-Create_a_global_variable_from_test_returns_OK_response-1706264427","status":"live","type":"api","tags":["testing:api"],"created_at":"2024-01-26T10:20:27.717659+00:00","modified_at":"2024-01-26T10:20:27.717659+00:00","config":{"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"steps":[{"allowFailure":true,"assertions":[{"operator":"is","target":200,"type":"statusCode"}],"extractedValues":[{"field":"server","name":"EXTRACTED_VALUE","parser":{"type":"raw"},"secure":true,"type":"http_header"}],"isCritical":true,"name":"request - is sent","request":{"method":"GET","timeout":10,"url":"https://datadoghq.com"},"retry":{"count":5,"interval":1000},"subtype":"http","id":"79d-ysr-wwj"}]},"message":"BDD - test payload: synthetics_api_test_multi_step_payload.json","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Create_a_global_variable_from_test_returns_OK_response-1706264427","monitor_priority":5,"retry":{"count":3,"interval":1000},"tick_every":60},"locations":["aws:us-east-2"],"subtype":"multi","created_by":{"name":"Frog","handle":"frog@datadoghq.com","email":"frog@datadoghq.com"},"deleted_at":null,"monitor_id":138446065,"org_id":569509,"modified_by":{"name":"Frog","handle":"frog@datadoghq.com","email":"frog@datadoghq.com"}}' + body: '{"public_id":"6td-hmb-t6f","name":"Test-Create_a_global_variable_from_test_returns_OK_response-1707904615","status":"live","type":"api","tags":["testing:api"],"created_at":"2024-02-14T09:56:55.729504+00:00","modified_at":"2024-02-14T09:56:55.729504+00:00","config":{"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"steps":[{"allowFailure":true,"assertions":[{"operator":"is","target":200,"type":"statusCode"}],"extractedValues":[{"field":"server","name":"EXTRACTED_VALUE","parser":{"type":"raw"},"secure":true,"type":"http_header"}],"isCritical":true,"name":"request + is sent","request":{"method":"GET","timeout":10,"url":"https://datadoghq.com"},"retry":{"count":5,"interval":1000},"subtype":"http","id":"7g9-x3d-mid"},{"allowFailure":false,"assertions":[{"operator":"lessThan","target":1000,"type":"responseTime"}],"extractedValues":[],"isCritical":true,"name":"GRPC + CALL","request":{"callType":"unary","compressedJsonDescriptor":"eJy1lU1z2yAQhv+Lzj74I3ETH506bQ7OZOSm1w4Wa4epBARQppqM/3v5koCJJdvtxCdW77vPssCO3zMKUgHOFu/ZXvBiS6hZho/f8qe7pftYgXphWJrlA8XwxywEvNba+6PhkC2yVcVVswYp0R6ykRYlZ1SCV21SDrxsssPIeS9FJKqGfK2rqnmmSBwhWa2XlKgtaQPiDcRGCUDVfwGD2sKUqKEtc1cSoOrsMlaMOec1sySYCCgUYRSVLv2zSva2u+FQkB0pVkIw8bFuIudOOn3pOaKYVT3Iy97Pd0AYhOx5QcMsnxvRHlnuLf8ETDd3CNtrv2nejkDpRnANCmGkkFn/hsYzpBKE7jVbufgnKnV9HRM9zRPDDKPttYT61n0TdWkAAjggk9AhuxIeaXd69CYTcsGw7cBTakLVbNpRzGEgyWjkSOpMbZXkhGL6oX30R49qt3GoHrap7i0XdD41WQ+2icCNm5p1hmFqnHNlcla0riKmDZ183crDxChjbnurtxHPRE784sVhWvDfGP+SsTKibU3o5NtWHuZFGZOxP6P5VXqIOvaOSec4eYohyd7NslHuJbd1bewds85xYrNxkr2d+5IhFWF3NvaO684xjE2S5ulY+tu64Pna0fCPJgzw6vF5/WucLcYjt5xoq19O3UDptOg/OamJQRaCcPPnMTQ2QDFn+uhPvUfnCrMc99upyQY4Ui9Dlc/YoG3R/v4Cs9YE+g==","host":"grpcbin.test.k6.io","message":"{}","metadata":{},"method":"Index","port":9000,"service":"grpcbin.GRPCBin"},"retry":{"count":0,"interval":300},"subtype":"grpc","id":"xnr-5zr-293"}]},"message":"BDD + test payload: synthetics_api_test_multi_step_payload.json","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Create_a_global_variable_from_test_returns_OK_response-1707904615","monitor_priority":5,"retry":{"count":3,"interval":1000},"tick_every":60},"locations":["aws:us-east-2"],"subtype":"multi","created_by":{"name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","email":"team-intg-tools-libs-spam@datadoghq.com"},"deleted_at":null,"monitor_id":139518955,"org_id":321813,"modified_by":{"name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","email":"team-intg-tools-libs-spam@datadoghq.com"}}' code: 200 duration: 0ms headers: @@ -23,7 +26,7 @@ interactions: status: 200 OK - request: body: | - {"description":"","name":"GLOBAL_VARIABLE_PAYLOAD_TESTCREATEAGLOBALVARIABLEFROMTESTRETURNSOKRESPONSE1706264427","parse_test_options":{"localVariableName":"EXTRACTED_VALUE","type":"local_variable"},"parse_test_public_id":"izb-9gc-92w","tags":[],"value":{"options":{"totp_parameters":{"digits":6,"refresh_interval":30}},"secure":false,"value":""}} + {"description":"","name":"GLOBAL_VARIABLE_PAYLOAD_TESTCREATEAGLOBALVARIABLEFROMTESTRETURNSOKRESPONSE1707904615","parse_test_options":{"localVariableName":"EXTRACTED_VALUE","type":"local_variable"},"parse_test_public_id":"6td-hmb-t6f","tags":[],"value":{"options":{"totp_parameters":{"digits":6,"refresh_interval":30}},"secure":false,"value":""}} form: {} headers: Accept: @@ -34,7 +37,7 @@ interactions: method: POST url: https://api.datadoghq.com/api/v1/synthetics/variables response: - body: '{"id":"a586a64d-cd9f-4983-8d00-81dcefb919ac","name":"GLOBAL_VARIABLE_PAYLOAD_TESTCREATEAGLOBALVARIABLEFROMTESTRETURNSOKRESPONSE1706264427","description":"","type":"variable","tags":[],"parse_test_public_id":"izb-9gc-92w","parse_test_name":null,"parse_test_options":{"localVariableName":"EXTRACTED_VALUE","type":"local_variable"},"parse_test_extracted_at":null,"is_totp":null,"is_fido":null,"last_error":null,"value":{"options":{"totp_parameters":{"digits":6,"refresh_interval":30}},"secure":false,"value":""}} + body: '{"id":"b8daafc5-09e1-4f63-9f44-c973b2ec57dc","name":"GLOBAL_VARIABLE_PAYLOAD_TESTCREATEAGLOBALVARIABLEFROMTESTRETURNSOKRESPONSE1707904615","description":"","type":"variable","tags":[],"parse_test_public_id":"6td-hmb-t6f","parse_test_name":null,"parse_test_options":{"localVariableName":"EXTRACTED_VALUE","type":"local_variable"},"parse_test_extracted_at":null,"is_totp":null,"is_fido":null,"last_error":null,"value":{"options":{"totp_parameters":{"digits":6,"refresh_interval":30}},"secure":false,"value":""}} ' code: 200 @@ -51,7 +54,7 @@ interactions: - '*/*' id: 2 method: DELETE - url: https://api.datadoghq.com/api/v1/synthetics/variables/a586a64d-cd9f-4983-8d00-81dcefb919ac + url: https://api.datadoghq.com/api/v1/synthetics/variables/b8daafc5-09e1-4f63-9f44-c973b2ec57dc response: body: '' code: 200 @@ -62,7 +65,7 @@ interactions: status: 200 OK - request: body: | - {"public_ids":["izb-9gc-92w"]} + {"public_ids":["6td-hmb-t6f"]} form: {} headers: Accept: @@ -73,7 +76,7 @@ interactions: method: POST url: https://api.datadoghq.com/api/v1/synthetics/tests/delete response: - body: '{"deleted_tests":[{"public_id":"izb-9gc-92w","deleted_at":"2024-01-26T10:20:29.374347+00:00"}]} + body: '{"deleted_tests":[{"public_id":"6td-hmb-t6f","deleted_at":"2024-02-14T09:56:56.985642+00:00"}]} ' code: 200 diff --git a/tests/scenarios/cassettes/TestScenarios/v1/Feature_Synthetics/Scenario_Create_an_API_test_with_multi_subtype_returns_OK_-_Returns_the_created_test_details._response.freeze b/tests/scenarios/cassettes/TestScenarios/v1/Feature_Synthetics/Scenario_Create_an_API_test_with_multi_subtype_returns_OK_-_Returns_the_created_test_details._response.freeze index 8113d86f364..5786b386acd 100644 --- a/tests/scenarios/cassettes/TestScenarios/v1/Feature_Synthetics/Scenario_Create_an_API_test_with_multi_subtype_returns_OK_-_Returns_the_created_test_details._response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v1/Feature_Synthetics/Scenario_Create_an_API_test_with_multi_subtype_returns_OK_-_Returns_the_created_test_details._response.freeze @@ -1 +1 @@ -2024-01-26T10:20:47.505Z \ No newline at end of file +2024-02-14T09:52:43.647Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v1/Feature_Synthetics/Scenario_Create_an_API_test_with_multi_subtype_returns_OK_-_Returns_the_created_test_details._response.yaml b/tests/scenarios/cassettes/TestScenarios/v1/Feature_Synthetics/Scenario_Create_an_API_test_with_multi_subtype_returns_OK_-_Returns_the_created_test_details._response.yaml index dae690e3500..78c3ef537ee 100644 --- a/tests/scenarios/cassettes/TestScenarios/v1/Feature_Synthetics/Scenario_Create_an_API_test_with_multi_subtype_returns_OK_-_Returns_the_created_test_details._response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v1/Feature_Synthetics/Scenario_Create_an_API_test_with_multi_subtype_returns_OK_-_Returns_the_created_test_details._response.yaml @@ -1,7 +1,7 @@ interactions: - request: body: | - {"config":{"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"steps":[{"allowFailure":true,"assertions":[{"operator":"is","target":200,"type":"statusCode"}],"extractedValues":[{"field":"server","name":"EXTRACTED_VALUE","parser":{"type":"raw"},"secure":true,"type":"http_header"}],"isCritical":true,"name":"request is sent","request":{"method":"GET","timeout":10,"url":"https://datadoghq.com"},"retry":{"count":5,"interval":1000},"subtype":"http"}]},"locations":["aws:us-east-2"],"message":"BDD test payload: synthetics_api_test_multi_step_payload.json","name":"Test-Create_an_API_test_with_multi_subtype_returns_OK_Returns_the_created_test_details_response-1706264447","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Create_an_API_test_with_multi_subtype_returns_OK_Returns_the_created_test_details_response-1706264447","monitor_priority":5,"retry":{"count":3,"interval":1000},"tick_every":60},"subtype":"multi","tags":["testing:api"],"type":"api"} + {"config":{"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"steps":[{"allowFailure":true,"assertions":[{"operator":"is","target":200,"type":"statusCode"}],"extractedValues":[{"field":"server","name":"EXTRACTED_VALUE","parser":{"type":"raw"},"secure":true,"type":"http_header"}],"isCritical":true,"name":"request is sent","request":{"method":"GET","timeout":10,"url":"https://datadoghq.com"},"retry":{"count":5,"interval":1000},"subtype":"http"},{"allowFailure":false,"assertions":[{"operator":"lessThan","target":1000,"type":"responseTime"}],"extractedValues":[],"isCritical":true,"name":"GRPC CALL","request":{"callType":"unary","compressedJsonDescriptor":"eJy1lU1z2yAQhv+Lzj74I3ETH506bQ7OZOSm1w4Wa4epBARQppqM/3v5koCJJdvtxCdW77vPssCO3zMKUgHOFu/ZXvBiS6hZho/f8qe7pftYgXphWJrlA8XwxywEvNba+6PhkC2yVcVVswYp0R6ykRYlZ1SCV21SDrxsssPIeS9FJKqGfK2rqnmmSBwhWa2XlKgtaQPiDcRGCUDVfwGD2sKUqKEtc1cSoOrsMlaMOec1sySYCCgUYRSVLv2zSva2u+FQkB0pVkIw8bFuIudOOn3pOaKYVT3Iy97Pd0AYhOx5QcMsnxvRHlnuLf8ETDd3CNtrv2nejkDpRnANCmGkkFn/hsYzpBKE7jVbufgnKnV9HRM9zRPDDKPttYT61n0TdWkAAjggk9AhuxIeaXd69CYTcsGw7cBTakLVbNpRzGEgyWjkSOpMbZXkhGL6oX30R49qt3GoHrap7i0XdD41WQ+2icCNm5p1hmFqnHNlcla0riKmDZ183crDxChjbnurtxHPRE784sVhWvDfGP+SsTKibU3o5NtWHuZFGZOxP6P5VXqIOvaOSec4eYohyd7NslHuJbd1bewds85xYrNxkr2d+5IhFWF3NvaO684xjE2S5ulY+tu64Pna0fCPJgzw6vF5/WucLcYjt5xoq19O3UDptOg/OamJQRaCcPPnMTQ2QDFn+uhPvUfnCrMc99upyQY4Ui9Dlc/YoG3R/v4Cs9YE+g==","host":"grpcbin.test.k6.io","message":"{}","metadata":{},"method":"Index","port":9000,"service":"grpcbin.GRPCBin"},"retry":{"count":0,"interval":300},"subtype":"grpc"}]},"locations":["aws:us-east-2"],"message":"BDD test payload: synthetics_api_test_multi_step_payload.json","name":"Test-Create_an_API_test_with_multi_subtype_returns_OK_Returns_the_created_test_details_response-1707904363","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Create_an_API_test_with_multi_subtype_returns_OK_Returns_the_created_test_details_response-1707904363","monitor_priority":5,"retry":{"count":3,"interval":1000},"tick_every":60},"subtype":"multi","tags":["testing:api"],"type":"api"} form: {} headers: Accept: @@ -12,9 +12,10 @@ interactions: method: POST url: https://api.datadoghq.com/api/v1/synthetics/tests/api response: - body: '{"public_id":"gvd-8ek-8j4","name":"Test-Create_an_API_test_with_multi_subtype_returns_OK_Returns_the_created_test_details_response-1706264447","status":"live","type":"api","tags":["testing:api"],"created_at":"2024-01-26T10:20:47.990304+00:00","modified_at":"2024-01-26T10:20:47.990304+00:00","config":{"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"steps":[{"allowFailure":true,"assertions":[{"operator":"is","target":200,"type":"statusCode"}],"extractedValues":[{"field":"server","name":"EXTRACTED_VALUE","parser":{"type":"raw"},"secure":true,"type":"http_header"}],"isCritical":true,"name":"request - is sent","request":{"method":"GET","timeout":10,"url":"https://datadoghq.com"},"retry":{"count":5,"interval":1000},"subtype":"http","id":"tj8-64v-kmn"}]},"message":"BDD - test payload: synthetics_api_test_multi_step_payload.json","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Create_an_API_test_with_multi_subtype_returns_OK_Returns_the_created_test_details_response-1706264447","monitor_priority":5,"retry":{"count":3,"interval":1000},"tick_every":60},"locations":["aws:us-east-2"],"subtype":"multi","created_by":{"name":"Frog","handle":"frog@datadoghq.com","email":"frog@datadoghq.com"},"deleted_at":null,"monitor_id":138446072,"org_id":569509,"modified_by":{"name":"Frog","handle":"frog@datadoghq.com","email":"frog@datadoghq.com"}}' + body: '{"public_id":"49h-gaa-dte","name":"Test-Create_an_API_test_with_multi_subtype_returns_OK_Returns_the_created_test_details_response-1707904363","status":"live","type":"api","tags":["testing:api"],"created_at":"2024-02-14T09:52:44.302597+00:00","modified_at":"2024-02-14T09:52:44.302597+00:00","config":{"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"steps":[{"allowFailure":true,"assertions":[{"operator":"is","target":200,"type":"statusCode"}],"extractedValues":[{"field":"server","name":"EXTRACTED_VALUE","parser":{"type":"raw"},"secure":true,"type":"http_header"}],"isCritical":true,"name":"request + is sent","request":{"method":"GET","timeout":10,"url":"https://datadoghq.com"},"retry":{"count":5,"interval":1000},"subtype":"http","id":"nt6-mfm-kis"},{"allowFailure":false,"assertions":[{"operator":"lessThan","target":1000,"type":"responseTime"}],"extractedValues":[],"isCritical":true,"name":"GRPC + CALL","request":{"callType":"unary","compressedJsonDescriptor":"eJy1lU1z2yAQhv+Lzj74I3ETH506bQ7OZOSm1w4Wa4epBARQppqM/3v5koCJJdvtxCdW77vPssCO3zMKUgHOFu/ZXvBiS6hZho/f8qe7pftYgXphWJrlA8XwxywEvNba+6PhkC2yVcVVswYp0R6ykRYlZ1SCV21SDrxsssPIeS9FJKqGfK2rqnmmSBwhWa2XlKgtaQPiDcRGCUDVfwGD2sKUqKEtc1cSoOrsMlaMOec1sySYCCgUYRSVLv2zSva2u+FQkB0pVkIw8bFuIudOOn3pOaKYVT3Iy97Pd0AYhOx5QcMsnxvRHlnuLf8ETDd3CNtrv2nejkDpRnANCmGkkFn/hsYzpBKE7jVbufgnKnV9HRM9zRPDDKPttYT61n0TdWkAAjggk9AhuxIeaXd69CYTcsGw7cBTakLVbNpRzGEgyWjkSOpMbZXkhGL6oX30R49qt3GoHrap7i0XdD41WQ+2icCNm5p1hmFqnHNlcla0riKmDZ183crDxChjbnurtxHPRE784sVhWvDfGP+SsTKibU3o5NtWHuZFGZOxP6P5VXqIOvaOSec4eYohyd7NslHuJbd1bewds85xYrNxkr2d+5IhFWF3NvaO684xjE2S5ulY+tu64Pna0fCPJgzw6vF5/WucLcYjt5xoq19O3UDptOg/OamJQRaCcPPnMTQ2QDFn+uhPvUfnCrMc99upyQY4Ui9Dlc/YoG3R/v4Cs9YE+g==","host":"grpcbin.test.k6.io","message":"{}","metadata":{},"method":"Index","port":9000,"service":"grpcbin.GRPCBin"},"retry":{"count":0,"interval":300},"subtype":"grpc","id":"ksz-bri-vu5"}]},"message":"BDD + test payload: synthetics_api_test_multi_step_payload.json","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Create_an_API_test_with_multi_subtype_returns_OK_Returns_the_created_test_details_response-1707904363","monitor_priority":5,"retry":{"count":3,"interval":1000},"tick_every":60},"locations":["aws:us-east-2"],"subtype":"multi","created_by":{"name":"Frog","handle":"frog@datadoghq.com","email":"frog@datadoghq.com"},"deleted_at":null,"monitor_id":139518783,"org_id":569509,"modified_by":{"name":"Frog","handle":"frog@datadoghq.com","email":"frog@datadoghq.com"}}' code: 200 duration: 0ms headers: @@ -23,7 +24,7 @@ interactions: status: 200 OK - request: body: | - {"public_ids":["gvd-8ek-8j4"]} + {"public_ids":["49h-gaa-dte"]} form: {} headers: Accept: @@ -34,7 +35,7 @@ interactions: method: POST url: https://api.datadoghq.com/api/v1/synthetics/tests/delete response: - body: '{"deleted_tests":[{"public_id":"gvd-8ek-8j4","deleted_at":"2024-01-26T10:20:48.529333+00:00"}]} + body: '{"deleted_tests":[{"public_id":"49h-gaa-dte","deleted_at":"2024-02-14T09:52:44.978031+00:00"}]} ' code: 200 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_GCP_Integration/Scenario_Create_a_new_entry_for_your_service_account_with_cloud_run_revision_filters_enabled_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_GCP_Integration/Scenario_Create_a_new_entry_for_your_service_account_with_cloud_run_revision_filters_enabled_returns_OK_response.freeze new file mode 100644 index 00000000000..5078f78fe6d --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_GCP_Integration/Scenario_Create_a_new_entry_for_your_service_account_with_cloud_run_revision_filters_enabled_returns_OK_response.freeze @@ -0,0 +1 @@ +2024-01-31T21:16:04.924Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_GCP_Integration/Scenario_Create_a_new_entry_for_your_service_account_with_cloud_run_revision_filters_enabled_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_GCP_Integration/Scenario_Create_a_new_entry_for_your_service_account_with_cloud_run_revision_filters_enabled_returns_OK_response.yaml new file mode 100644 index 00000000000..ef851ad9670 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_GCP_Integration/Scenario_Create_a_new_entry_for_your_service_account_with_cloud_run_revision_filters_enabled_returns_OK_response.yaml @@ -0,0 +1,41 @@ +interactions: +- request: + body: | + {"data":{"attributes":{"client_email":"feb37f50ee7be467@test-project.iam.gserviceaccount.com","cloud_run_revision_filters":["meh:bleh"],"host_filters":[]},"type":"gcp_service_account"}} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + id: 0 + method: POST + url: https://api.datadoghq.com/api/v2/integration/gcp/accounts + response: + body: '{"data":{"type":"gcp_service_account","attributes":{"cloud_run_revision_filters":["meh:bleh"],"resource_collection_enabled":false,"host_filters":[],"automute":false,"is_cspm_enabled":false,"account_tags":[],"client_email":"feb37f50ee7be467@test-project.iam.gserviceaccount.com","is_security_command_center_enabled":false},"id":"e1157377-8d5c-4a94-9730-10c3fa9d6ff5"}} + + ' + code: 201 + duration: 0ms + headers: + Content-Type: + - application/json + status: 201 Created +- request: + body: '' + form: {} + headers: + Accept: + - '*/*' + id: 1 + method: DELETE + url: https://api.datadoghq.com/api/v2/integration/gcp/accounts/e1157377-8d5c-4a94-9730-10c3fa9d6ff5 + response: + body: '' + code: 204 + duration: 0ms + headers: + Content-Type: + - text/html; charset=utf-8 + status: 204 No Content +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_GCP_Integration/Scenario_Update_STS_Service_Account_returns_OK_response_with_cloud_run_revision_filters.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_GCP_Integration/Scenario_Update_STS_Service_Account_returns_OK_response_with_cloud_run_revision_filters.freeze new file mode 100644 index 00000000000..92757ea39aa --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_GCP_Integration/Scenario_Update_STS_Service_Account_returns_OK_response_with_cloud_run_revision_filters.freeze @@ -0,0 +1 @@ +2024-01-31T21:16:05.705Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_GCP_Integration/Scenario_Update_STS_Service_Account_returns_OK_response_with_cloud_run_revision_filters.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_GCP_Integration/Scenario_Update_STS_Service_Account_returns_OK_response_with_cloud_run_revision_filters.yaml new file mode 100644 index 00000000000..ea3561eeef3 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_GCP_Integration/Scenario_Update_STS_Service_Account_returns_OK_response_with_cloud_run_revision_filters.yaml @@ -0,0 +1,63 @@ +interactions: +- request: + body: | + {"data":{"attributes":{"client_email":"a8e08a7fa29a1adb@example.com","host_filters":[]},"type":"gcp_service_account"}} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + id: 0 + method: POST + url: https://api.datadoghq.com/api/v2/integration/gcp/accounts + response: + body: '{"data":{"type":"gcp_service_account","id":"3e6ad31b-2da5-4ad4-878a-4d290520173b","attributes":{"account_tags":[],"resource_collection_enabled":false,"is_cspm_enabled":false,"automute":false,"host_filters":[],"is_security_command_center_enabled":false,"cloud_run_revision_filters":[],"client_email":"a8e08a7fa29a1adb@example.com"}}} + + ' + code: 201 + duration: 0ms + headers: + Content-Type: + - application/json + status: 201 Created +- request: + body: | + {"data":{"attributes":{"client_email":"a8e08a7fa29a1adb@example.com","cloud_run_revision_filters":["merp:derp"]},"id":"3e6ad31b-2da5-4ad4-878a-4d290520173b","type":"gcp_service_account"}} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + id: 1 + method: PATCH + url: https://api.datadoghq.com/api/v2/integration/gcp/accounts/3e6ad31b-2da5-4ad4-878a-4d290520173b + response: + body: '{"data":{"type":"gcp_service_account","id":"3e6ad31b-2da5-4ad4-878a-4d290520173b","attributes":{"cloud_run_revision_filters":["merp:derp"],"host_filters":[],"automute":false,"is_security_command_center_enabled":false,"account_tags":[],"client_email":"a8e08a7fa29a1adb@example.com","is_cspm_enabled":false,"resource_collection_enabled":false}}} + + ' + code: 201 + duration: 0ms + headers: + Content-Type: + - application/json + status: 201 Created +- request: + body: '' + form: {} + headers: + Accept: + - '*/*' + id: 2 + method: DELETE + url: https://api.datadoghq.com/api/v2/integration/gcp/accounts/3e6ad31b-2da5-4ad4-878a-4d290520173b + response: + body: '' + code: 204 + duration: 0ms + headers: + Content-Type: + - text/html; charset=utf-8 + status: 204 No Content +version: 2 diff --git a/tests/scenarios/features/v1/gcp_integration.feature b/tests/scenarios/features/v1/gcp_integration.feature index cc078be2f03..2b656ab2023 100644 --- a/tests/scenarios/features/v1/gcp_integration.feature +++ b/tests/scenarios/features/v1/gcp_integration.feature @@ -13,21 +13,21 @@ Feature: GCP Integration @generated @skip @team:DataDog/gcp-integrations Scenario: Create a GCP integration returns "Bad Request" response Given new "CreateGCPIntegration" request - And body with value {"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", "auth_uri": "https://accounts.google.com/o/oauth2/auth", "client_email": "api-dev@datadog-sandbox.iam.gserviceaccount.com", "client_id": "123456712345671234567", "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL", "errors": ["*"], "host_filters": "key:value,filter:example", "is_cspm_enabled": true, "is_security_command_center_enabled": true, "private_key": "private_key", "private_key_id": "123456789abcdefghi123456789abcdefghijklm", "project_id": "datadog-apitest", "resource_collection_enabled": true, "token_uri": "https://accounts.google.com/o/oauth2/token", "type": "service_account"} + And body with value {"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", "auth_uri": "https://accounts.google.com/o/oauth2/auth", "client_email": "api-dev@datadog-sandbox.iam.gserviceaccount.com", "client_id": "123456712345671234567", "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL", "cloud_run_revision_filters": ["$KEY:$VALUE"], "errors": ["*"], "host_filters": "key:value,filter:example", "is_cspm_enabled": true, "is_security_command_center_enabled": true, "private_key": "private_key", "private_key_id": "123456789abcdefghi123456789abcdefghijklm", "project_id": "datadog-apitest", "resource_collection_enabled": true, "token_uri": "https://accounts.google.com/o/oauth2/token", "type": "service_account"} When the request is sent Then the response status is 400 Bad Request @team:DataDog/gcp-integrations Scenario: Create a GCP integration returns "OK" response Given new "CreateGCPIntegration" request - And body with value {"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", "auth_uri": "https://accounts.google.com/o/oauth2/auth", "client_email": "{{unique_hash}}@example.com", "client_id": "{{ timestamp("now") }}{{ timestamp("now") }}0", "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL", "host_filters": "key:value,filter:example", "is_cspm_enabled": true, "is_security_command_center_enabled": true, "private_key": "private_key", "private_key_id": "123456789abcdefghi123456789abcdefghijklm", "project_id": "datadog-apitest", "resource_collection_enabled": true, "token_uri": "https://accounts.google.com/o/oauth2/token", "type": "service_account"} + And body with value {"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", "auth_uri": "https://accounts.google.com/o/oauth2/auth", "client_email": "{{unique_hash}}@example.com", "client_id": "{{ timestamp("now") }}{{ timestamp("now") }}0", "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL", "host_filters": "key:value,filter:example", "cloud_run_revision_filters": ["dr:dre"], "is_cspm_enabled": true, "is_security_command_center_enabled": true, "private_key": "private_key", "private_key_id": "123456789abcdefghi123456789abcdefghijklm", "project_id": "datadog-apitest", "resource_collection_enabled": true, "token_uri": "https://accounts.google.com/o/oauth2/token", "type": "service_account"} When the request is sent Then the response status is 200 OK @generated @skip @team:DataDog/gcp-integrations Scenario: Delete a GCP integration returns "Bad Request" response Given new "DeleteGCPIntegration" request - And body with value {"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", "auth_uri": "https://accounts.google.com/o/oauth2/auth", "client_email": "api-dev@datadog-sandbox.iam.gserviceaccount.com", "client_id": "123456712345671234567", "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL", "errors": ["*"], "host_filters": "key:value,filter:example", "is_cspm_enabled": true, "is_security_command_center_enabled": true, "private_key": "private_key", "private_key_id": "123456789abcdefghi123456789abcdefghijklm", "project_id": "datadog-apitest", "resource_collection_enabled": true, "token_uri": "https://accounts.google.com/o/oauth2/token", "type": "service_account"} + And body with value {"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", "auth_uri": "https://accounts.google.com/o/oauth2/auth", "client_email": "api-dev@datadog-sandbox.iam.gserviceaccount.com", "client_id": "123456712345671234567", "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL", "cloud_run_revision_filters": ["$KEY:$VALUE"], "errors": ["*"], "host_filters": "key:value,filter:example", "is_cspm_enabled": true, "is_security_command_center_enabled": true, "private_key": "private_key", "private_key_id": "123456789abcdefghi123456789abcdefghijklm", "project_id": "datadog-apitest", "resource_collection_enabled": true, "token_uri": "https://accounts.google.com/o/oauth2/token", "type": "service_account"} When the request is sent Then the response status is 400 Bad Request @@ -51,10 +51,18 @@ Feature: GCP Integration When the request is sent Then the response status is 200 OK + @team:DataDog/gcp-integrations + Scenario: Update a GCP integration cloud run revision filters returns "OK" response + Given there is a valid "gcp_account" in the system + And new "UpdateGCPIntegration" request + And body with value {"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", "auth_uri": "https://accounts.google.com/o/oauth2/auth", "client_email": "{{unique_hash}}@example.com", "client_id": "{{ timestamp("now") }}{{ timestamp("now") }}0", "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL", "host_filters": "key:value,filter:example", "cloud_run_revision_filters": ["merp:derp"], "is_cspm_enabled": true, "is_security_command_center_enabled": true, "private_key": "private_key", "private_key_id": "123456789abcdefghi123456789abcdefghijklm", "project_id": "datadog-apitest", "resource_collection_enabled": true, "token_uri": "https://accounts.google.com/o/oauth2/token", "type": "service_account"} + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/gcp-integrations Scenario: Update a GCP integration returns "Bad Request" response Given new "UpdateGCPIntegration" request - And body with value {"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", "auth_uri": "https://accounts.google.com/o/oauth2/auth", "client_email": "api-dev@datadog-sandbox.iam.gserviceaccount.com", "client_id": "123456712345671234567", "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL", "errors": ["*"], "host_filters": "key:value,filter:example", "is_cspm_enabled": true, "is_security_command_center_enabled": true, "private_key": "private_key", "private_key_id": "123456789abcdefghi123456789abcdefghijklm", "project_id": "datadog-apitest", "resource_collection_enabled": true, "token_uri": "https://accounts.google.com/o/oauth2/token", "type": "service_account"} + And body with value {"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", "auth_uri": "https://accounts.google.com/o/oauth2/auth", "client_email": "api-dev@datadog-sandbox.iam.gserviceaccount.com", "client_id": "123456712345671234567", "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL", "cloud_run_revision_filters": ["$KEY:$VALUE"], "errors": ["*"], "host_filters": "key:value,filter:example", "is_cspm_enabled": true, "is_security_command_center_enabled": true, "private_key": "private_key", "private_key_id": "123456789abcdefghi123456789abcdefghijklm", "project_id": "datadog-apitest", "resource_collection_enabled": true, "token_uri": "https://accounts.google.com/o/oauth2/token", "type": "service_account"} When the request is sent Then the response status is 400 Bad Request diff --git a/tests/scenarios/features/v1/given.json b/tests/scenarios/features/v1/given.json index 205b1ecb2f1..6ba2f4e62d0 100644 --- a/tests/scenarios/features/v1/given.json +++ b/tests/scenarios/features/v1/given.json @@ -250,7 +250,7 @@ "parameters": [ { "name": "body", - "value": "{\n \"config\": {\n \"configVariables\": [\n {\n \"example\": \"content-type\",\n \"name\": \"PROPERTY\",\n \"pattern\": \"content-type\",\n \"type\": \"text\"\n }\n ],\n \"steps\": [\n {\n \"allowFailure\": true,\n \"assertions\": [\n {\n \"operator\": \"is\",\n \"type\": \"statusCode\",\n \"target\": 200\n }\n ],\n \"extractedValues\": [\n {\n \"field\": \"server\",\n \"name\": \"EXTRACTED_VALUE\",\n \"parser\": {\n \"type\": \"raw\"\n },\n \"type\": \"http_header\",\n \"secure\": true\n }\n ],\n \"isCritical\": true,\n \"name\": \"request is sent\",\n \"request\": {\n \"method\": \"GET\",\n \"timeout\": 10,\n \"url\": \"https://datadoghq.com\"\n },\n \"retry\": {\n \"count\": 5,\n \"interval\": 1000\n },\n \"subtype\": \"http\"\n }\n ]\n },\n \"locations\": [\"aws:us-east-2\"],\n \"message\": \"BDD test payload: synthetics_api_test_multi_step_payload.json\",\n \"name\": \"{{ unique }}\",\n \"options\": {\n \"accept_self_signed\": false,\n \"allow_insecure\": true,\n \"follow_redirects\": true,\n \"min_failure_duration\": 10,\n \"min_location_failed\": 1,\n \"monitor_name\": \"{{ unique }}\",\n \"monitor_priority\": 5,\n \"retry\": { \"count\": 3, \"interval\": 1000 },\n \"tick_every\": 60\n },\n \"subtype\": \"multi\",\n \"tags\": [\"testing:api\"],\n \"type\": \"api\"\n}\n" + "value": "{\n \"config\": {\n \"configVariables\": [\n {\n \"example\": \"content-type\",\n \"name\": \"PROPERTY\",\n \"pattern\": \"content-type\",\n \"type\": \"text\"\n }\n ],\n \"steps\": [\n {\n \"allowFailure\": true,\n \"assertions\": [\n {\n \"operator\": \"is\",\n \"type\": \"statusCode\",\n \"target\": 200\n }\n ],\n \"extractedValues\": [\n {\n \"field\": \"server\",\n \"name\": \"EXTRACTED_VALUE\",\n \"parser\": {\n \"type\": \"raw\"\n },\n \"type\": \"http_header\",\n \"secure\": true\n }\n ],\n \"isCritical\": true,\n \"name\": \"request is sent\",\n \"request\": {\n \"method\": \"GET\",\n \"timeout\": 10,\n \"url\": \"https://datadoghq.com\"\n },\n \"retry\": {\n \"count\": 5,\n \"interval\": 1000\n },\n \"subtype\": \"http\"\n },\n {\n \"name\": \"GRPC CALL\",\n \"subtype\": \"grpc\",\n \"extractedValues\": [],\n \"allowFailure\": false,\n \"isCritical\": true,\n \"retry\": {\n \"count\": 0,\n \"interval\": 300\n },\n \"assertions\": [\n {\n \"operator\": \"lessThan\",\n \"type\": \"responseTime\",\n \"target\": 1000\n }\n ],\n \"request\": {\n \"host\": \"grpcbin.test.k6.io\",\n \"port\": 9000,\n \"service\": \"grpcbin.GRPCBin\",\n \"method\": \"Index\",\n \"message\": \"{}\",\n \"compressedJsonDescriptor\": \"eJy1lU1z2yAQhv+Lzj74I3ETH506bQ7OZOSm1w4Wa4epBARQppqM/3v5koCJJdvtxCdW77vPssCO3zMKUgHOFu/ZXvBiS6hZho/f8qe7pftYgXphWJrlA8XwxywEvNba+6PhkC2yVcVVswYp0R6ykRYlZ1SCV21SDrxsssPIeS9FJKqGfK2rqnmmSBwhWa2XlKgtaQPiDcRGCUDVfwGD2sKUqKEtc1cSoOrsMlaMOec1sySYCCgUYRSVLv2zSva2u+FQkB0pVkIw8bFuIudOOn3pOaKYVT3Iy97Pd0AYhOx5QcMsnxvRHlnuLf8ETDd3CNtrv2nejkDpRnANCmGkkFn/hsYzpBKE7jVbufgnKnV9HRM9zRPDDKPttYT61n0TdWkAAjggk9AhuxIeaXd69CYTcsGw7cBTakLVbNpRzGEgyWjkSOpMbZXkhGL6oX30R49qt3GoHrap7i0XdD41WQ+2icCNm5p1hmFqnHNlcla0riKmDZ183crDxChjbnurtxHPRE784sVhWvDfGP+SsTKibU3o5NtWHuZFGZOxP6P5VXqIOvaOSec4eYohyd7NslHuJbd1bewds85xYrNxkr2d+5IhFWF3NvaO684xjE2S5ulY+tu64Pna0fCPJgzw6vF5/WucLcYjt5xoq19O3UDptOg/OamJQRaCcPPnMTQ2QDFn+uhPvUfnCrMc99upyQY4Ui9Dlc/YoG3R/v4Cs9YE+g==\",\n \"metadata\": {},\n \"callType\": \"unary\"\n }\n }\n ]\n },\n \"locations\": [\"aws:us-east-2\"],\n \"message\": \"BDD test payload: synthetics_api_test_multi_step_payload.json\",\n \"name\": \"{{ unique }}\",\n \"options\": {\n \"accept_self_signed\": false,\n \"allow_insecure\": true,\n \"follow_redirects\": true,\n \"min_failure_duration\": 10,\n \"min_location_failed\": 1,\n \"monitor_name\": \"{{ unique }}\",\n \"monitor_priority\": 5,\n \"retry\": { \"count\": 3, \"interval\": 1000 },\n \"tick_every\": 60\n },\n \"subtype\": \"multi\",\n \"tags\": [\"testing:api\"],\n \"type\": \"api\"\n}\n" } ], "step": "there is a valid \"synthetics_api_test_multi_step\" in the system", diff --git a/tests/scenarios/features/v1/synthetics.feature b/tests/scenarios/features/v1/synthetics.feature index 9b9722550cc..36f74743154 100644 --- a/tests/scenarios/features/v1/synthetics.feature +++ b/tests/scenarios/features/v1/synthetics.feature @@ -203,6 +203,7 @@ Feature: Synthetics And the response "config.steps[0].retry.count" is equal to 5 And the response "config.steps[0].retry.interval" is equal to 1000 And the response "config.steps[0].extractedValues[0].secure" is equal to true + And the response "config.steps[1].request.host" is equal to "grpcbin.test.k6.io" @generated @skip @team:DataDog/synthetics-app Scenario: Delete a global variable returns "JSON format is wrong" response diff --git a/tests/scenarios/features/v1/synthetics_api_test_multi_step_payload.json b/tests/scenarios/features/v1/synthetics_api_test_multi_step_payload.json index f514958caa2..28778436156 100644 --- a/tests/scenarios/features/v1/synthetics_api_test_multi_step_payload.json +++ b/tests/scenarios/features/v1/synthetics_api_test_multi_step_payload.json @@ -41,6 +41,34 @@ "interval": 1000 }, "subtype": "http" + }, + { + "name": "GRPC CALL", + "subtype": "grpc", + "extractedValues": [], + "allowFailure": false, + "isCritical": true, + "retry": { + "count": 0, + "interval": 300 + }, + "assertions": [ + { + "operator": "lessThan", + "type": "responseTime", + "target": 1000 + } + ], + "request": { + "host": "grpcbin.test.k6.io", + "port": 9000, + "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": {}, + "callType": "unary" + } } ] }, diff --git a/tests/scenarios/features/v2/gcp_integration.feature b/tests/scenarios/features/v2/gcp_integration.feature index e18714ba2e8..6085d6ed2f8 100644 --- a/tests/scenarios/features/v2/gcp_integration.feature +++ b/tests/scenarios/features/v2/gcp_integration.feature @@ -34,14 +34,14 @@ Feature: GCP Integration @generated @skip @team:DataDog/gcp-integrations Scenario: Create a new entry for your service account returns "Bad Request" response Given new "CreateGCPSTSAccount" request - And body with value {"data": {"attributes": {"account_tags": [], "client_email": "datadog-service-account@test-project.iam.gserviceaccount.com", "host_filters": [], "is_security_command_center_enabled": true}, "type": "gcp_service_account"}} + And body with value {"data": {"attributes": {"account_tags": [], "client_email": "datadog-service-account@test-project.iam.gserviceaccount.com", "cloud_run_revision_filters": ["$KEY:$VALUE"], "host_filters": [], "is_security_command_center_enabled": true}, "type": "gcp_service_account"}} When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/gcp-integrations Scenario: Create a new entry for your service account returns "Conflict" response Given new "CreateGCPSTSAccount" request - And body with value {"data": {"attributes": {"account_tags": [], "client_email": "datadog-service-account@test-project.iam.gserviceaccount.com", "host_filters": [], "is_security_command_center_enabled": true}, "type": "gcp_service_account"}} + And body with value {"data": {"attributes": {"account_tags": [], "client_email": "datadog-service-account@test-project.iam.gserviceaccount.com", "cloud_run_revision_filters": ["$KEY:$VALUE"], "host_filters": [], "is_security_command_center_enabled": true}, "type": "gcp_service_account"}} When the request is sent Then the response status is 409 Conflict @@ -64,6 +64,16 @@ Feature: GCP Integration And the response "data.attributes.client_email" is equal to "{{ unique_hash }}@test-project.iam.gserviceaccount.com" And the response "data.attributes.account_tags" is equal to ["lorem", "ipsum"] + @team:DataDog/gcp-integrations + Scenario: Create a new entry for your service account with cloud run revision filters enabled returns "OK" response + Given new "CreateGCPSTSAccount" request + And body with value {"data": {"attributes": {"cloud_run_revision_filters": ["meh:bleh"], "client_email": "{{ unique_hash }}@test-project.iam.gserviceaccount.com", "host_filters": []}, "type": "gcp_service_account"}} + When the request is sent + Then the response status is 201 OK + And the response "data.type" is equal to "gcp_service_account" + And the response "data.attributes.client_email" is equal to "{{ unique_hash }}@test-project.iam.gserviceaccount.com" + And the response "data.attributes.cloud_run_revision_filters" is equal to ["meh:bleh"] + @team:DataDog/gcp-integrations Scenario: Create a new entry for your service account with cspm enabled returns "OK" response Given new "CreateGCPSTSAccount" request @@ -140,7 +150,7 @@ Feature: GCP Integration Scenario: Update STS Service Account returns "Bad Request" response Given new "UpdateGCPSTSAccount" request And request contains "account_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"account_tags": [], "client_email": "datadog-service-account@test-project.iam.gserviceaccount.com", "host_filters": [], "is_security_command_center_enabled": true}, "id": "d291291f-12c2-22g4-j290-123456678897", "type": "gcp_service_account"}} + And body with value {"data": {"attributes": {"account_tags": [], "client_email": "datadog-service-account@test-project.iam.gserviceaccount.com", "cloud_run_revision_filters": ["$KEY:$VALUE"], "host_filters": [], "is_security_command_center_enabled": true}, "id": "d291291f-12c2-22g4-j290-123456678897", "type": "gcp_service_account"}} When the request is sent Then the response status is 400 Bad Request @@ -148,7 +158,7 @@ Feature: GCP Integration Scenario: Update STS Service Account returns "Not Found" response Given new "UpdateGCPSTSAccount" request And request contains "account_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"account_tags": [], "client_email": "datadog-service-account@test-project.iam.gserviceaccount.com", "host_filters": [], "is_security_command_center_enabled": true}, "id": "d291291f-12c2-22g4-j290-123456678897", "type": "gcp_service_account"}} + And body with value {"data": {"attributes": {"account_tags": [], "client_email": "datadog-service-account@test-project.iam.gserviceaccount.com", "cloud_run_revision_filters": ["$KEY:$VALUE"], "host_filters": [], "is_security_command_center_enabled": true}, "id": "d291291f-12c2-22g4-j290-123456678897", "type": "gcp_service_account"}} When the request is sent Then the response status is 404 Not Found @@ -161,6 +171,15 @@ Feature: GCP Integration When the request is sent Then the response status is 201 OK + @team:DataDog/gcp-integrations + Scenario: Update STS Service Account returns "OK" response with cloud run revision filters + Given there is a valid "gcp_sts_account" in the system + And new "UpdateGCPSTSAccount" request + And request contains "account_id" parameter from "gcp_sts_account.data.id" + And body with value {"data": {"attributes": {"client_email": "{{ unique_hash }}@example.com", "cloud_run_revision_filters": ["merp:derp"]}, "id": "{{ gcp_sts_account.data.id }}", "type": "gcp_service_account"}} + When the request is sent + Then the response status is 201 OK + @team:DataDog/gcp-integrations Scenario: Update STS Service Account returns "OK" response with enable resource collection turned on Given there is a valid "gcp_sts_account" in the system