From f86959f3da3ccf24365e4ee4d81203f9cb48a1a4 Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Tue, 25 Oct 2022 11:55:11 +0200 Subject: [PATCH] Regenerate client from commit 18dc2450 of spec repo (#1725) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: ci.datadog-api-spec Co-authored-by: Thomas Hervé --- .apigentools-info | 8 +- .generator/schemas/v2/openapi.yaml | 15776 ++++++++-------- api/datadogV2/api_ci_visibility_pipelines.go | 634 + api/datadogV2/api_ci_visibility_tests.go | 634 + api/datadogV2/doc.go | 6 + .../model_ci_app_aggregate_bucket_value.go | 187 + ...i_app_aggregate_bucket_value_timeseries.go | 51 + ...aggregate_bucket_value_timeseries_point.go | 138 + api/datadogV2/model_ci_app_aggregate_sort.go | 231 + .../model_ci_app_aggregate_sort_type.go | 109 + .../model_ci_app_aggregation_function.go | 129 + api/datadogV2/model_ci_app_compute.go | 229 + api/datadogV2/model_ci_app_compute_type.go | 109 + .../model_ci_app_event_attributes.go | 210 + .../model_ci_app_group_by_histogram.go | 172 + .../model_ci_app_group_by_missing.go | 155 + api/datadogV2/model_ci_app_group_by_total.go | 187 + api/datadogV2/model_ci_app_pipeline_event.go | 183 + .../model_ci_app_pipeline_event_type_name.go | 107 + .../model_ci_app_pipeline_events_request.go | 233 + .../model_ci_app_pipeline_events_response.go | 182 + ...odel_ci_app_pipelines_aggregate_request.go | 260 + ..._pipelines_aggregation_buckets_response.go | 98 + ..._pipelines_analytics_aggregate_response.go | 189 + .../model_ci_app_pipelines_bucket_response.go | 133 + .../model_ci_app_pipelines_group_by.go | 297 + .../model_ci_app_pipelines_query_filter.go | 180 + api/datadogV2/model_ci_app_query_options.go | 138 + .../model_ci_app_query_page_options.go | 137 + api/datadogV2/model_ci_app_response_links.go | 99 + .../model_ci_app_response_metadata.go | 254 + api/datadogV2/model_ci_app_response_page.go | 98 + api/datadogV2/model_ci_app_response_status.go | 109 + api/datadogV2/model_ci_app_sort.go | 109 + api/datadogV2/model_ci_app_sort_order.go | 109 + api/datadogV2/model_ci_app_test_event.go | 183 + .../model_ci_app_test_event_type_name.go | 107 + .../model_ci_app_test_events_request.go | 233 + .../model_ci_app_test_events_response.go | 182 + .../model_ci_app_tests_aggregate_request.go | 260 + ..._app_tests_aggregation_buckets_response.go | 98 + ..._app_tests_analytics_aggregate_response.go | 189 + .../model_ci_app_tests_bucket_response.go | 133 + api/datadogV2/model_ci_app_tests_group_by.go | 297 + .../model_ci_app_tests_query_filter.go | 180 + api/datadogV2/model_ci_app_warning.go | 168 + .../AggregateCIAppPipelineEvents.go | 57 + .../ListCIAppPipelineEvents.go | 30 + .../ListCIAppPipelineEvents_1270618359.go | 31 + .../SearchCIAppPipelineEvents.go | 43 + .../SearchCIAppPipelineEvents_3246135003.go | 43 + .../AggregateCIAppTestEvents.go | 60 + .../ListCIAppTestEvents.go | 30 + .../ListCIAppTestEvents_3852605281.go | 31 + .../SearchCIAppTestEvents.go | 43 + .../SearchCIAppTestEvents_1675695429.go | 41 + tests/scenarios/api_mappings.go | 2 + ...ipelines_events_returns_OK_response.freeze | 1 + ..._pipelines_events_returns_OK_response.yaml | 23 + ...ipelines_events_returns_OK_response.freeze | 1 + ..._pipelines_events_returns_OK_response.yaml | 40 + ...returns_OK_response_with_pagination.freeze | 1 + ...s_returns_OK_response_with_pagination.yaml | 41 + ...ipelines_events_returns_OK_response.freeze | 1 + ..._pipelines_events_returns_OK_response.yaml | 35 + ...returns_OK_response_with_pagination.freeze | 1 + ...s_returns_OK_response_with_pagination.yaml | 53 + ...te_tests_events_returns_OK_response.freeze | 1 + ...gate_tests_events_returns_OK_response.yaml | 23 + ...of_tests_events_returns_OK_response.freeze | 1 + ...t_of_tests_events_returns_OK_response.yaml | 33 + ...returns_OK_response_with_pagination.freeze | 1 + ...s_returns_OK_response_with_pagination.yaml | 45 + ...ch_tests_events_returns_OK_response.freeze | 1 + ...arch_tests_events_returns_OK_response.yaml | 38 + ...returns_OK_response_with_pagination.freeze | 1 + ...s_returns_OK_response_with_pagination.yaml | 60 + .../v2/ci_visibility_pipelines.feature | 70 + .../features/v2/ci_visibility_tests.feature | 70 + tests/scenarios/features/v2/undo.json | 36 + 80 files changed, 17486 insertions(+), 7412 deletions(-) create mode 100644 api/datadogV2/api_ci_visibility_pipelines.go create mode 100644 api/datadogV2/api_ci_visibility_tests.go create mode 100644 api/datadogV2/model_ci_app_aggregate_bucket_value.go create mode 100644 api/datadogV2/model_ci_app_aggregate_bucket_value_timeseries.go create mode 100644 api/datadogV2/model_ci_app_aggregate_bucket_value_timeseries_point.go create mode 100644 api/datadogV2/model_ci_app_aggregate_sort.go create mode 100644 api/datadogV2/model_ci_app_aggregate_sort_type.go create mode 100644 api/datadogV2/model_ci_app_aggregation_function.go create mode 100644 api/datadogV2/model_ci_app_compute.go create mode 100644 api/datadogV2/model_ci_app_compute_type.go create mode 100644 api/datadogV2/model_ci_app_event_attributes.go create mode 100644 api/datadogV2/model_ci_app_group_by_histogram.go create mode 100644 api/datadogV2/model_ci_app_group_by_missing.go create mode 100644 api/datadogV2/model_ci_app_group_by_total.go create mode 100644 api/datadogV2/model_ci_app_pipeline_event.go create mode 100644 api/datadogV2/model_ci_app_pipeline_event_type_name.go create mode 100644 api/datadogV2/model_ci_app_pipeline_events_request.go create mode 100644 api/datadogV2/model_ci_app_pipeline_events_response.go create mode 100644 api/datadogV2/model_ci_app_pipelines_aggregate_request.go create mode 100644 api/datadogV2/model_ci_app_pipelines_aggregation_buckets_response.go create mode 100644 api/datadogV2/model_ci_app_pipelines_analytics_aggregate_response.go create mode 100644 api/datadogV2/model_ci_app_pipelines_bucket_response.go create mode 100644 api/datadogV2/model_ci_app_pipelines_group_by.go create mode 100644 api/datadogV2/model_ci_app_pipelines_query_filter.go create mode 100644 api/datadogV2/model_ci_app_query_options.go create mode 100644 api/datadogV2/model_ci_app_query_page_options.go create mode 100644 api/datadogV2/model_ci_app_response_links.go create mode 100644 api/datadogV2/model_ci_app_response_metadata.go create mode 100644 api/datadogV2/model_ci_app_response_page.go create mode 100644 api/datadogV2/model_ci_app_response_status.go create mode 100644 api/datadogV2/model_ci_app_sort.go create mode 100644 api/datadogV2/model_ci_app_sort_order.go create mode 100644 api/datadogV2/model_ci_app_test_event.go create mode 100644 api/datadogV2/model_ci_app_test_event_type_name.go create mode 100644 api/datadogV2/model_ci_app_test_events_request.go create mode 100644 api/datadogV2/model_ci_app_test_events_response.go create mode 100644 api/datadogV2/model_ci_app_tests_aggregate_request.go create mode 100644 api/datadogV2/model_ci_app_tests_aggregation_buckets_response.go create mode 100644 api/datadogV2/model_ci_app_tests_analytics_aggregate_response.go create mode 100644 api/datadogV2/model_ci_app_tests_bucket_response.go create mode 100644 api/datadogV2/model_ci_app_tests_group_by.go create mode 100644 api/datadogV2/model_ci_app_tests_query_filter.go create mode 100644 api/datadogV2/model_ci_app_warning.go create mode 100644 examples/v2/ci-visibility-pipelines/AggregateCIAppPipelineEvents.go create mode 100644 examples/v2/ci-visibility-pipelines/ListCIAppPipelineEvents.go create mode 100644 examples/v2/ci-visibility-pipelines/ListCIAppPipelineEvents_1270618359.go create mode 100644 examples/v2/ci-visibility-pipelines/SearchCIAppPipelineEvents.go create mode 100644 examples/v2/ci-visibility-pipelines/SearchCIAppPipelineEvents_3246135003.go create mode 100644 examples/v2/ci-visibility-tests/AggregateCIAppTestEvents.go create mode 100644 examples/v2/ci-visibility-tests/ListCIAppTestEvents.go create mode 100644 examples/v2/ci-visibility-tests/ListCIAppTestEvents_3852605281.go create mode 100644 examples/v2/ci-visibility-tests/SearchCIAppTestEvents.go create mode 100644 examples/v2/ci-visibility-tests/SearchCIAppTestEvents_1675695429.go create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Aggregate_pipelines_events_returns_OK_response.freeze create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Aggregate_pipelines_events_returns_OK_response.yaml create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Get_a_list_of_pipelines_events_returns_OK_response.freeze create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Get_a_list_of_pipelines_events_returns_OK_response.yaml create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Get_a_list_of_pipelines_events_returns_OK_response_with_pagination.freeze create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Get_a_list_of_pipelines_events_returns_OK_response_with_pagination.yaml create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Search_pipelines_events_returns_OK_response.freeze create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Search_pipelines_events_returns_OK_response.yaml create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Search_pipelines_events_returns_OK_response_with_pagination.freeze create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Search_pipelines_events_returns_OK_response_with_pagination.yaml create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Tests/Scenario_Aggregate_tests_events_returns_OK_response.freeze create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Tests/Scenario_Aggregate_tests_events_returns_OK_response.yaml create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Tests/Scenario_Get_a_list_of_tests_events_returns_OK_response.freeze create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Tests/Scenario_Get_a_list_of_tests_events_returns_OK_response.yaml create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Tests/Scenario_Get_a_list_of_tests_events_returns_OK_response_with_pagination.freeze create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Tests/Scenario_Get_a_list_of_tests_events_returns_OK_response_with_pagination.yaml create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Tests/Scenario_Search_tests_events_returns_OK_response.freeze create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Tests/Scenario_Search_tests_events_returns_OK_response.yaml create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Tests/Scenario_Search_tests_events_returns_OK_response_with_pagination.freeze create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Tests/Scenario_Search_tests_events_returns_OK_response_with_pagination.yaml create mode 100644 tests/scenarios/features/v2/ci_visibility_pipelines.feature create mode 100644 tests/scenarios/features/v2/ci_visibility_tests.feature diff --git a/.apigentools-info b/.apigentools-info index 54206698e24..054a3a37dbc 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.4", - "regenerated": "2022-10-20 09:07:43.391926", - "spec_repo_commit": "148c906a" + "regenerated": "2022-10-24 13:15:47.319813", + "spec_repo_commit": "18dc2450" }, "v2": { "apigentools_version": "1.6.4", - "regenerated": "2022-10-20 09:07:43.404402", - "spec_repo_commit": "148c906a" + "regenerated": "2022-10-24 13:15:47.335958", + "spec_repo_commit": "18dc2450" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 1e313cd8b59..64613e52441 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -1107,2332 +1107,2231 @@ components: type: string x-enum-varnames: - AUTHN_MAPPINGS - ChargebackBreakdown: - description: Charges breakdown. + CIAppAggregateBucketValue: + description: A bucket value, can either be a timeseries or a single value. + oneOf: + - $ref: '#/components/schemas/CIAppAggregateBucketValueSingleString' + - $ref: '#/components/schemas/CIAppAggregateBucketValueSingleNumber' + - $ref: '#/components/schemas/CIAppAggregateBucketValueTimeseries' + CIAppAggregateBucketValueSingleNumber: + description: A single number value. + format: double + type: number + CIAppAggregateBucketValueSingleString: + description: A single string value. + type: string + CIAppAggregateBucketValueTimeseries: + description: A timeseries array. + items: + $ref: '#/components/schemas/CIAppAggregateBucketValueTimeseriesPoint' + type: array + x-generate-alias-as-model: true + CIAppAggregateBucketValueTimeseriesPoint: + description: A timeseries point. properties: - charge_type: - description: The type of charge for a particular product. - example: on_demand + time: + description: The time value for this point. + example: '2020-06-08T11:55:00.123Z' + format: date-time type: string - cost: - description: The cost for a particular product and charge type during a - given month. + value: + description: The value for this point. + example: 19 format: double type: number - product_name: - description: The product for which cost is being reported. - example: infra_host - type: string type: object - CloudWorkloadSecurityAgentRuleAttributes: - description: A Cloud Workload Security Agent rule returned by the API. + CIAppAggregateSort: + description: A sort rule. + example: + aggregation: count + order: asc properties: - category: - description: The category of the Agent rule. - example: Process Activity - type: string - creationDate: - description: When the Agent rule was created, timestamp in milliseconds. - example: 1624366480320 - format: int64 - type: integer - creator: - $ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleCreatorAttributes' - defaultRule: - description: Whether the rule is included by default. - example: false - type: boolean - description: - description: The description of the Agent rule. - example: My Agent rule - type: string - enabled: - description: Whether the Agent rule is enabled. - example: true - type: boolean - expression: - description: The SECL expression of the Agent rule. - example: exec.file.name == \"sh\" - type: string - name: - description: The name of the Agent rule. - example: my_agent_rule + aggregation: + $ref: '#/components/schemas/CIAppAggregationFunction' + metric: + description: The metric to sort by (only used for `type=measure`). + example: '@duration' type: string - updatedAt: - description: When the Agent rule was last updated, timestamp in milliseconds. - example: 1624366480320 - format: int64 - type: integer - updater: - $ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleUpdaterAttributes' - version: - description: The version of the Agent rule. - example: 23 - format: int64 - type: integer + order: + $ref: '#/components/schemas/CIAppSortOrder' + type: + $ref: '#/components/schemas/CIAppAggregateSortType' type: object - CloudWorkloadSecurityAgentRuleCreateAttributes: - description: Create a new Cloud Workload Security Agent rule. + CIAppAggregateSortType: + default: alphabetical + description: The type of sorting algorithm. + enum: + - alphabetical + - measure + type: string + x-enum-varnames: + - ALPHABETICAL + - MEASURE + CIAppAggregationFunction: + description: An aggregation function. + enum: + - count + - cardinality + - pc75 + - pc90 + - pc95 + - pc98 + - pc99 + - sum + - min + - max + - avg + - median + example: pc90 + type: string + x-enum-varnames: + - COUNT + - CARDINALITY + - PERCENTILE_75 + - PERCENTILE_90 + - PERCENTILE_95 + - PERCENTILE_98 + - PERCENTILE_99 + - SUM + - MIN + - MAX + - AVG + - MEDIAN + CIAppCompute: + description: A compute rule to compute metrics or timeseries. properties: - description: - description: The description of the Agent rule. - example: My Agent rule - type: string - enabled: - description: Whether the Agent rule is enabled. - example: true - type: boolean - expression: - description: The SECL expression of the Agent rule. - example: exec.file.name == \"sh\" + aggregation: + $ref: '#/components/schemas/CIAppAggregationFunction' + interval: + description: 'The time buckets'' size (only used for type=timeseries) + + Defaults to a resolution of 150 points.' + example: 5m type: string - name: - description: The name of the Agent rule. - example: my_agent_rule + metric: + description: The metric to use. + example: '@duration' type: string + type: + $ref: '#/components/schemas/CIAppComputeType' required: - - name - - expression + - aggregation type: object - CloudWorkloadSecurityAgentRuleCreateData: - description: Object for a single Agent rule. + CIAppComputeType: + default: total + description: The type of compute. + enum: + - timeseries + - total + type: string + x-enum-varnames: + - TIMESERIES + - TOTAL + CIAppComputes: + additionalProperties: + $ref: '#/components/schemas/CIAppAggregateBucketValue' + description: A map of the metric name to value for regular compute, or a list + of values for a timeseries. + type: object + CIAppEventAttributes: + description: JSON object containing all event attributes and their associated + values. properties: attributes: - $ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleCreateAttributes' - type: - $ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleType' - required: - - attributes - - type + additionalProperties: {} + description: JSON object of attributes from CI Visibility events. + example: + customAttribute: 123 + duration: 2345 + type: object + service: + description: 'The name of the application or service generating CI Visibility + events. + + It is used to switch from CI Visibility to APM, so make sure you define + the same + + value when you use both products.' + example: web-ui-tests + type: string + tags: + $ref: '#/components/schemas/TagsEventAttribute' + timestamp: + $ref: '#/components/schemas/TimestampEventAttribute' type: object - CloudWorkloadSecurityAgentRuleCreateRequest: - description: Request object that includes the Agent rule to create. + CIAppGroupByHistogram: + description: 'Used to perform a histogram computation (only for measure facets). + + At most, 100 buckets are allowed, the number of buckets is `(max - min)/interval`.' properties: - data: - $ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleCreateData' + interval: + description: The bin size of the histogram buckets. + example: 10 + format: double + type: number + max: + description: 'The maximum value for the measure used in the histogram + + (values greater than this one are filtered out).' + example: 100 + format: double + type: number + min: + description: 'The minimum value for the measure used in the histogram + + (values smaller than this one are filtered out).' + example: 50 + format: double + type: number required: - - data - type: object - CloudWorkloadSecurityAgentRuleCreatorAttributes: - description: The attributes of the user who created the Agent rule. - properties: - handle: - description: The handle of the user. - example: datadog.user@example.com - type: string - name: - description: The name of the user. - example: Datadog User - type: string + - interval + - min + - max type: object - CloudWorkloadSecurityAgentRuleData: - description: Object for a single Agent rule. + CIAppGroupByMissing: + description: The value to use for logs that don't have the facet used to group-by. + oneOf: + - $ref: '#/components/schemas/CIAppGroupByMissingString' + - $ref: '#/components/schemas/CIAppGroupByMissingNumber' + CIAppGroupByMissingNumber: + description: The missing value to use if there is a number valued facet. + format: double + type: number + CIAppGroupByMissingString: + description: The missing value to use if there is a string valued facet. + type: string + CIAppGroupByTotal: + default: false + description: A resulting object to put the given computes in over all the matching + records. + oneOf: + - $ref: '#/components/schemas/CIAppGroupByTotalBoolean' + - $ref: '#/components/schemas/CIAppGroupByTotalString' + - $ref: '#/components/schemas/CIAppGroupByTotalNumber' + CIAppGroupByTotalBoolean: + description: If set to true, creates an additional bucket labeled "$facet_total". + type: boolean + CIAppGroupByTotalNumber: + description: A number to use as the key value for the total bucket. + format: double + type: number + CIAppGroupByTotalString: + description: A string to use as the key value for the total bucket. + type: string + CIAppPipelineEvent: + description: Object description of a pipeline event after being processed and + stored by Datadog. properties: attributes: - $ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleAttributes' + $ref: '#/components/schemas/CIAppEventAttributes' id: - description: The ID of the Agent rule. - example: 3dd-0uc-h1s + description: Unique ID of the event. + example: AAAAAWgN8Xwgr1vKDQAAAABBV2dOOFh3ZzZobm1mWXJFYTR0OA type: string type: - $ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleType' + $ref: '#/components/schemas/CIAppPipelineEventTypeName' type: object - CloudWorkloadSecurityAgentRuleResponse: - description: Response object that includes an Agent rule. - properties: - data: - $ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleData' - type: object - CloudWorkloadSecurityAgentRuleType: - default: agent_rule - description: The type of the resource. The value should always be `agent_rule`. + CIAppPipelineEventTypeName: + description: Type of the event. enum: - - agent_rule - example: agent_rule + - cipipeline + example: cipipeline type: string x-enum-varnames: - - AGENT_RULE - CloudWorkloadSecurityAgentRuleUpdateAttributes: - description: Update an existing Cloud Workload Security Agent rule. - properties: - description: - description: The description of the Agent rule. - example: My Agent rule - type: string - enabled: - description: Whether the Agent rule is enabled. - example: true - type: boolean - expression: - description: The SECL expression of the Agent rule. - example: exec.file.name == \"sh\" - type: string - type: object - CloudWorkloadSecurityAgentRuleUpdateData: - description: Object for a single Agent rule. + - cipipeline + CIAppPipelineEventsRequest: + description: The request for a pipelines search. properties: - attributes: - $ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleUpdateAttributes' - type: - $ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleType' - required: - - attributes - - type + filter: + $ref: '#/components/schemas/CIAppPipelinesQueryFilter' + options: + $ref: '#/components/schemas/CIAppQueryOptions' + page: + $ref: '#/components/schemas/CIAppQueryPageOptions' + sort: + $ref: '#/components/schemas/CIAppSort' type: object - CloudWorkloadSecurityAgentRuleUpdateRequest: - description: Request object that includes the Agent rule with the attributes - to update. + CIAppPipelineEventsResponse: + description: Response object with all pipeline events matching the request and + pagination information. properties: data: - $ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleUpdateData' - required: - - data + description: Array of events matching the request. + items: + $ref: '#/components/schemas/CIAppPipelineEvent' + type: array + links: + $ref: '#/components/schemas/CIAppResponseLinks' + meta: + $ref: '#/components/schemas/CIAppResponseMetadata' type: object - CloudWorkloadSecurityAgentRuleUpdaterAttributes: - description: The attributes of the user who last updated the Agent rule. + CIAppPipelinesAggregateRequest: + description: The object sent with the request to retrieve aggregation buckets + of pipeline events from your organization. properties: - handle: - description: The handle of the user. - example: datadog.user@example.com - type: string - name: - description: The name of the user. - example: Datadog User - type: string + compute: + description: The list of metrics or timeseries to compute for the retrieved + buckets. + items: + $ref: '#/components/schemas/CIAppCompute' + type: array + filter: + $ref: '#/components/schemas/CIAppPipelinesQueryFilter' + group_by: + description: The rules for the group-by. + items: + $ref: '#/components/schemas/CIAppPipelinesGroupBy' + type: array + options: + $ref: '#/components/schemas/CIAppQueryOptions' + page: + $ref: '#/components/schemas/CIAppQueryPageOptions' type: object - CloudWorkloadSecurityAgentRulesListResponse: - description: Response object that includes a list of Agent rule. + CIAppPipelinesAggregationBucketsResponse: + description: The query results. properties: - data: - description: A list of Agent rules objects. + buckets: + description: The list of matching buckets, one item per bucket. items: - $ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleData' + $ref: '#/components/schemas/CIAppPipelinesBucketResponse' type: array type: object - ConfluentAccountCreateRequest: - description: Payload schema when adding a Confluent account. + CIAppPipelinesAnalyticsAggregateResponse: + description: The response object for the pipeline events aggregate API endpoint. properties: data: - $ref: '#/components/schemas/ConfluentAccountCreateRequestData' - required: - - data + $ref: '#/components/schemas/CIAppPipelinesAggregationBucketsResponse' + links: + $ref: '#/components/schemas/CIAppResponseLinks' + meta: + $ref: '#/components/schemas/CIAppResponseMetadata' type: object - ConfluentAccountCreateRequestAttributes: - description: Attributes associated with the account creation request. + CIAppPipelinesBucketResponse: + description: Bucket values. properties: - api_key: - description: The API key associated with your Confluent account. - example: TESTAPIKEY123 - type: string - api_secret: - description: The API secret associated with your Confluent account. - example: test-api-secret-123 - type: string - resources: - description: A list of Confluent resources associated with the Confluent - account. - items: - $ref: '#/components/schemas/ConfluentAccountResourceAttributes' - type: array - tags: - description: A list of strings representing tags. Can be a single key, or - key-value pairs separated by a colon. - example: - - myTag - - myTag2:myValue - items: + by: + additionalProperties: + description: The values for each group-by. type: string - type: array - required: - - api_key - - api_secret + description: The key-value pairs for each group-by. + example: + '@ci.provider.name': gitlab + '@ci.status': success + type: object + computes: + $ref: '#/components/schemas/CIAppComputes' type: object - ConfluentAccountCreateRequestData: - description: The data body for adding a Confluent account. + CIAppPipelinesGroupBy: + description: A group-by rule. properties: - attributes: - $ref: '#/components/schemas/ConfluentAccountCreateRequestAttributes' - type: - $ref: '#/components/schemas/ConfluentAccountType' + facet: + description: The name of the facet to use (required). + example: '@ci.status' + type: string + histogram: + $ref: '#/components/schemas/CIAppGroupByHistogram' + limit: + default: 10 + description: The maximum buckets to return for this group-by. + format: int64 + type: integer + missing: + $ref: '#/components/schemas/CIAppGroupByMissing' + sort: + $ref: '#/components/schemas/CIAppAggregateSort' + total: + $ref: '#/components/schemas/CIAppGroupByTotal' required: - - attributes - - type + - facet type: object - ConfluentAccountResourceAttributes: - description: Attributes object for updating a Confluent resource. + CIAppPipelinesQueryFilter: + description: The search and filter query settings. properties: - id: - description: The ID associated with a Confluent resource. - example: resource-id-123 + from: + default: now-15m + description: The minimum time for the requested events; supports date, math, + and regular timestamps (in milliseconds). + example: now-15m type: string - resource_type: - description: The resource type of the Resource. Can be `kafka`, `connector`, - `ksql`, or `schema_registry`. - example: kafka + query: + default: '*' + description: The search query following the Log search syntax. + example: '@ci.provider.name:github AND @ci.status:error' + type: string + to: + default: now + description: The maximum time for the requested events, supports date, math, + and regular timestamps (in milliseconds). + example: now type: string - tags: - description: A list of strings representing tags. Can be a single key, or - key-value pairs separated by a colon. - example: - - myTag - - myTag2:myValue - items: - type: string - type: array type: object - ConfluentAccountResponse: - description: The expected response schema when getting a Confluent account. + CIAppQueryOptions: + description: 'Global query options that are used during the query. + + Only supply timezone or time offset, not both. Otherwise, the query fails.' properties: - data: - $ref: '#/components/schemas/ConfluentAccountResponseData' + time_offset: + description: The time offset (in seconds) to apply to the query. + format: int64 + type: integer + timezone: + default: UTC + description: 'The timezone can be specified both as an offset, for example: + "UTC+03:00".' + example: GMT + type: string type: object - ConfluentAccountResponseAttributes: - description: The attributes of a Confluent account. + CIAppQueryPageOptions: + description: Paging attributes for listing events. properties: - api_key: - description: The API key associated with your Confluent account. - example: TESTAPIKEY123 + cursor: + description: List following results with a cursor provided in the previous + query. + example: eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ== type: string - resources: - description: A list of Confluent resources associated with the Confluent - account. - items: - $ref: '#/components/schemas/ConfluentResourceResponseAttributes' - type: array - tags: - description: A list of strings representing tags. Can be a single key, or - key-value pairs separated by a colon. - example: - - myTag - - myTag2:myValue - items: - type: string - type: array - required: - - api_key + limit: + default: 10 + description: Maximum number of events in the response. + example: 25 + format: int32 + maximum: 1000 + type: integer type: object - ConfluentAccountResponseData: - description: An API key and API secret pair that represents a Confluent account. + CIAppResponseLinks: + description: Links attributes. properties: - attributes: - $ref: '#/components/schemas/ConfluentAccountResponseAttributes' - id: - description: A randomly generated ID associated with a Confluent account. - example: account_id_abc123 + next: + description: 'Link for the next set of results. The request can also be + made using the + + POST endpoint.' + example: https://app.datadoghq.com/api/v2/ci/tests/events?filter[query]=foo&page[cursor]=eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ== type: string - type: - $ref: '#/components/schemas/ConfluentAccountType' - required: - - attributes - - id - - type type: object - ConfluentAccountType: - default: confluent-cloud-accounts - description: The JSON:API type for this API. Should always be `confluent-cloud-accounts`. - enum: - - confluent-cloud-accounts - example: confluent-cloud-accounts - type: string - x-enum-varnames: - - CONFLUENT_CLOUD_ACCOUNTS - ConfluentAccountUpdateRequest: - description: The JSON:API request for updating a Confluent account. + CIAppResponseMetadata: + description: The metadata associated with a request. properties: - data: - $ref: '#/components/schemas/ConfluentAccountUpdateRequestData' - required: - - data - type: object - ConfluentAccountUpdateRequestAttributes: - description: Attributes object for updating a Confluent account. - properties: - api_key: - description: The API key associated with your Confluent account. - example: TESTAPIKEY123 - type: string - api_secret: - description: The API secret associated with your Confluent account. - example: test-api-secret-123 + elapsed: + description: The time elapsed in milliseconds. + example: 132 + format: int64 + type: integer + page: + $ref: '#/components/schemas/CIAppResponsePage' + request_id: + description: The identifier of the request. + example: MWlFUjVaWGZTTTZPYzM0VXp1OXU2d3xLSVpEMjZKQ0VKUTI0dEYtM3RSOFVR type: string - tags: - description: A list of strings representing tags. Can be a single key, or - key-value pairs separated by a colon. - example: - - myTag - - myTag2:myValue + status: + $ref: '#/components/schemas/CIAppResponseStatus' + warnings: + description: 'A list of warnings (non-fatal errors) encountered. Partial + results may return if + + warnings are present in the response.' items: - type: string + $ref: '#/components/schemas/CIAppWarning' type: array - required: - - api_key - - api_secret type: object - ConfluentAccountUpdateRequestData: - description: Data object for updating a Confluent account. + CIAppResponsePage: + description: Paging attributes. + properties: + after: + description: The cursor to use to get the next results, if any. To make + the next request, use the same parameters with the addition of `page[cursor]`. + example: eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ== + type: string + type: object + CIAppResponseStatus: + description: The status of the response. + enum: + - done + - timeout + example: done + type: string + x-enum-varnames: + - DONE + - TIMEOUT + CIAppSort: + description: Sort parameters when querying events. + enum: + - timestamp + - -timestamp + type: string + x-enum-varnames: + - TIMESTAMP_ASCENDING + - TIMESTAMP_DESCENDING + CIAppSortOrder: + description: The order to use, ascending or descending. + enum: + - asc + - desc + example: asc + type: string + x-enum-varnames: + - ASCENDING + - DESCENDING + CIAppTestEvent: + description: Object description of test event after being processed and stored + by Datadog. properties: attributes: - $ref: '#/components/schemas/ConfluentAccountUpdateRequestAttributes' + $ref: '#/components/schemas/CIAppEventAttributes' + id: + description: Unique ID of the event. + example: AAAAAWgN8Xwgr1vKDQAAAABBV2dOOFh3ZzZobm1mWXJFYTR0OA + type: string type: - $ref: '#/components/schemas/ConfluentAccountType' - required: - - attributes - - type + $ref: '#/components/schemas/CIAppTestEventTypeName' type: object - ConfluentAccountsResponse: - description: Confluent account returned by the API. + CIAppTestEventTypeName: + description: Type of the event. + enum: + - citest + example: citest + type: string + x-enum-varnames: + - citest + CIAppTestEventsRequest: + description: The request for a tests search. properties: - data: - description: The Confluent account. - items: - $ref: '#/components/schemas/ConfluentAccountResponseData' - type: array + filter: + $ref: '#/components/schemas/CIAppTestsQueryFilter' + options: + $ref: '#/components/schemas/CIAppQueryOptions' + page: + $ref: '#/components/schemas/CIAppQueryPageOptions' + sort: + $ref: '#/components/schemas/CIAppSort' type: object - ConfluentResourceRequest: - description: The JSON:API request for updating a Confluent resource. + CIAppTestEventsResponse: + description: Response object with all test events matching the request and pagination + information. properties: data: - $ref: '#/components/schemas/ConfluentResourceRequestData' - required: - - data + description: Array of events matching the request. + items: + $ref: '#/components/schemas/CIAppTestEvent' + type: array + links: + $ref: '#/components/schemas/CIAppResponseLinks' + meta: + $ref: '#/components/schemas/CIAppResponseMetadata' type: object - ConfluentResourceRequestAttributes: - description: Attributes object for updating a Confluent resource. + CIAppTestsAggregateRequest: + description: The object sent with the request to retrieve aggregation buckets + of test events from your organization. properties: - resource_type: - description: The resource type of the Resource. Can be `kafka`, `connector`, - `ksql`, or `schema_registry`. - example: kafka - type: string - tags: - description: A list of strings representing tags. Can be a single key, or - key-value pairs separated by a colon. - example: - - myTag - - myTag2:myValue + compute: + description: The list of metrics or timeseries to compute for the retrieved + buckets. items: - type: string + $ref: '#/components/schemas/CIAppCompute' + type: array + filter: + $ref: '#/components/schemas/CIAppTestsQueryFilter' + group_by: + description: The rules for the group-by. + items: + $ref: '#/components/schemas/CIAppTestsGroupBy' type: array + options: + $ref: '#/components/schemas/CIAppQueryOptions' + page: + $ref: '#/components/schemas/CIAppQueryPageOptions' type: object - ConfluentResourceRequestData: - description: JSON:API request for updating a Confluent resource. + CIAppTestsAggregationBucketsResponse: + description: The query results. properties: - attributes: - $ref: '#/components/schemas/ConfluentResourceRequestAttributes' - id: - description: The ID associated with a Confluent resource. - example: resource-id-123 - type: string - type: - $ref: '#/components/schemas/ConfluentResourceType' - required: - - attributes - - type - - id + buckets: + description: The list of matching buckets, one item per bucket. + items: + $ref: '#/components/schemas/CIAppTestsBucketResponse' + type: array type: object - ConfluentResourceResponse: - description: Response schema when interacting with a Confluent resource. + CIAppTestsAnalyticsAggregateResponse: + description: The response object for the test events aggregate API endpoint. properties: data: - $ref: '#/components/schemas/ConfluentResourceResponseData' + $ref: '#/components/schemas/CIAppTestsAggregationBucketsResponse' + links: + $ref: '#/components/schemas/CIAppResponseLinks' + meta: + $ref: '#/components/schemas/CIAppResponseMetadata' type: object - ConfluentResourceResponseAttributes: - description: Model representation of a Confluent Cloud resource. + CIAppTestsBucketResponse: + description: Bucket values. properties: - resource_type: - description: The resource type of the Resource. Can be `kafka`, `connector`, - `ksql`, or `schema_registry`. - example: kafka - type: string - tags: - description: A list of strings representing tags. Can be a single key, or - key-value pairs separated by a colon. - example: - - myTag - - myTag2:myValue - items: + by: + additionalProperties: + description: The values for each group-by. type: string - type: array - required: - - resource_type + description: The key-value pairs for each group-by. + example: + '@test.service': web-ui-tests + '@test.status': skip + type: object + computes: + $ref: '#/components/schemas/CIAppComputes' type: object - ConfluentResourceResponseData: - description: Confluent Cloud resource data. + CIAppTestsGroupBy: + description: A group-by rule. properties: - attributes: - $ref: '#/components/schemas/ConfluentResourceResponseAttributes' - id: - description: The ID associated with the Confluent resource. - example: resource_id_abc123 + facet: + description: The name of the facet to use (required). + example: '@test.service' type: string - type: - $ref: '#/components/schemas/ConfluentResourceType' + histogram: + $ref: '#/components/schemas/CIAppGroupByHistogram' + limit: + default: 10 + description: The maximum buckets to return for this group-by. + format: int64 + type: integer + missing: + $ref: '#/components/schemas/CIAppGroupByMissing' + sort: + $ref: '#/components/schemas/CIAppAggregateSort' + total: + $ref: '#/components/schemas/CIAppGroupByTotal' required: - - attributes - - type - - id + - facet type: object - ConfluentResourceType: - default: confluent-cloud-resources - description: The JSON:API type for this request. - enum: - - confluent-cloud-resources - example: confluent-cloud-resources - type: string - x-enum-varnames: - - CONFLUENT_CLOUD_RESOURCES - ConfluentResourcesResponse: - description: Response schema when interacting with a list of Confluent resources. + CIAppTestsQueryFilter: + description: The search and filter query settings. properties: - data: - description: The JSON:API data attribute. - items: - $ref: '#/components/schemas/ConfluentResourceResponseData' - type: array + from: + default: now-15m + description: The minimum time for the requested events; supports date, math, + and regular timestamps (in milliseconds). + example: now-15m + type: string + query: + default: '*' + description: The search query following the Log search syntax. + example: '@test.service:web-ui-tests AND @test.status:fail' + type: string + to: + default: now + description: The maximum time for the requested events, supports date, math, + and regular timestamps (in milliseconds). + example: now + type: string type: object - ContentEncoding: - description: HTTP header used to compress the media-type. - enum: - - identity - - gzip - - deflate - type: string - x-enum-varnames: - - IDENTITY - - GZIP - - DEFLATE - CostByOrg: - description: Cost data. + CIAppWarning: + description: A warning message indicating something that went wrong with the + query. properties: - attributes: - $ref: '#/components/schemas/CostByOrgAttributes' - id: - description: Unique ID of the response. + code: + description: A unique code for this type of warning. + example: unknown_index type: string - type: - $ref: '#/components/schemas/CostByOrgType' - type: object - CostByOrgAttributes: - description: Cost attributes data. - properties: - charges: - description: List of charges data reported for the requested month. - items: - $ref: '#/components/schemas/ChargebackBreakdown' - type: array - date: - description: The month requested. - format: date-time + detail: + description: A detailed explanation of this specific warning. + example: 'indexes: foo, bar' type: string - org_name: - description: The organization name. + title: + description: A short human-readable summary of the warning. + example: One or several indexes are missing or invalid, results hold data + from the other indexes type: string - public_id: - description: The organization public ID. + type: object + ChargebackBreakdown: + description: Charges breakdown. + properties: + charge_type: + description: The type of charge for a particular product. + example: on_demand type: string - total_cost: - description: The total cost of products for the month. + cost: + description: The cost for a particular product and charge type during a + given month. format: double type: number + product_name: + description: The product for which cost is being reported. + example: infra_host + type: string type: object - CostByOrgResponse: - description: Chargeback Summary response. - properties: - data: - description: Response containing Chargeback Summary. - items: - $ref: '#/components/schemas/CostByOrg' - type: array - type: object - CostByOrgType: - default: cost_by_org - description: Type of cost data. - enum: - - cost_by_org - example: cost_by_org - type: string - x-enum-varnames: - - COST_BY_ORG - Creator: - description: Creator of the object. + CloudWorkloadSecurityAgentRuleAttributes: + description: A Cloud Workload Security Agent rule returned by the API. properties: - email: - description: Email of the creator. + category: + description: The category of the Agent rule. + example: Process Activity type: string - handle: - description: Handle of the creator. + creationDate: + description: When the Agent rule was created, timestamp in milliseconds. + example: 1624366480320 + format: int64 + type: integer + creator: + $ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleCreatorAttributes' + defaultRule: + description: Whether the rule is included by default. + example: false + type: boolean + description: + description: The description of the Agent rule. + example: My Agent rule + type: string + enabled: + description: Whether the Agent rule is enabled. + example: true + type: boolean + expression: + description: The SECL expression of the Agent rule. + example: exec.file.name == \"sh\" type: string name: - description: Name of the creator. + description: The name of the Agent rule. + example: my_agent_rule type: string + updatedAt: + description: When the Agent rule was last updated, timestamp in milliseconds. + example: 1624366480320 + format: int64 + type: integer + updater: + $ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleUpdaterAttributes' + version: + description: The version of the Agent rule. + example: 23 + format: int64 + type: integer type: object - DashboardListAddItemsRequest: - description: Request containing a list of dashboards to add. - properties: - dashboards: - description: List of dashboards to add the dashboard list. - items: - $ref: '#/components/schemas/DashboardListItemRequest' - type: array - type: object - DashboardListAddItemsResponse: - description: Response containing a list of added dashboards. - properties: - added_dashboards_to_list: - description: List of dashboards added to the dashboard list. - items: - $ref: '#/components/schemas/DashboardListItemResponse' - type: array - type: object - DashboardListDeleteItemsRequest: - description: Request containing a list of dashboards to delete. - properties: - dashboards: - description: List of dashboards to delete from the dashboard list. - items: - $ref: '#/components/schemas/DashboardListItemRequest' - type: array - type: object - DashboardListDeleteItemsResponse: - description: Response containing a list of deleted dashboards. - properties: - deleted_dashboards_from_list: - description: List of dashboards deleted from the dashboard list. - items: - $ref: '#/components/schemas/DashboardListItemResponse' - type: array - type: object - DashboardListItem: - description: A dashboard within a list. + CloudWorkloadSecurityAgentRuleCreateAttributes: + description: Create a new Cloud Workload Security Agent rule. properties: - author: - $ref: '#/components/schemas/Creator' - created: - description: Date of creation of the dashboard. - format: date-time - readOnly: true - type: string - icon: - description: URL to the icon of the dashboard. - readOnly: true - type: string - id: - description: ID of the dashboard. - example: q5j-nti-fv6 + description: + description: The description of the Agent rule. + example: My Agent rule type: string - is_favorite: - description: Whether or not the dashboard is in the favorites. - readOnly: true - type: boolean - is_read_only: - description: Whether or not the dashboard is read only. - readOnly: true - type: boolean - is_shared: - description: Whether the dashboard is publicly shared or not. - readOnly: true + enabled: + description: Whether the Agent rule is enabled. + example: true type: boolean - modified: - description: Date of last edition of the dashboard. - format: date-time - readOnly: true - type: string - popularity: - description: Popularity of the dashboard. - format: int32 - maximum: 5 - readOnly: true - type: integer - title: - description: Title of the dashboard. - readOnly: true + expression: + description: The SECL expression of the Agent rule. + example: exec.file.name == \"sh\" type: string - type: - $ref: '#/components/schemas/DashboardType' - url: - description: URL path to the dashboard. - readOnly: true + name: + description: The name of the Agent rule. + example: my_agent_rule type: string required: - - type - - id + - name + - expression type: object - DashboardListItemRequest: - description: A dashboard within a list. + CloudWorkloadSecurityAgentRuleCreateData: + description: Object for a single Agent rule. properties: - id: - description: ID of the dashboard. - example: q5j-nti-fv6 - type: string + attributes: + $ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleCreateAttributes' type: - $ref: '#/components/schemas/DashboardType' + $ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleType' required: + - attributes - type - - id type: object - DashboardListItemResponse: - description: A dashboard within a list. + CloudWorkloadSecurityAgentRuleCreateRequest: + description: Request object that includes the Agent rule to create. properties: - id: - description: ID of the dashboard. - example: q5j-nti-fv6 - readOnly: true - type: string - type: - $ref: '#/components/schemas/DashboardType' + data: + $ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleCreateData' required: - - type - - id + - data type: object - DashboardListItems: - description: Dashboards within a list. + CloudWorkloadSecurityAgentRuleCreatorAttributes: + description: The attributes of the user who created the Agent rule. properties: - dashboards: - description: List of dashboards in the dashboard list. - example: [] - items: - $ref: '#/components/schemas/DashboardListItem' - type: array - total: - description: Number of dashboards in the dashboard list. - format: int64 - readOnly: true - type: integer - required: - - dashboards + handle: + description: The handle of the user. + example: datadog.user@example.com + type: string + name: + description: The name of the user. + example: Datadog User + type: string type: object - DashboardListUpdateItemsRequest: - description: Request containing the list of dashboards to update to. + CloudWorkloadSecurityAgentRuleData: + description: Object for a single Agent rule. properties: - dashboards: - description: List of dashboards to update the dashboard list to. - items: - $ref: '#/components/schemas/DashboardListItemRequest' - type: array + attributes: + $ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleAttributes' + id: + description: The ID of the Agent rule. + example: 3dd-0uc-h1s + type: string + type: + $ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleType' type: object - DashboardListUpdateItemsResponse: - description: Response containing a list of updated dashboards. + CloudWorkloadSecurityAgentRuleResponse: + description: Response object that includes an Agent rule. properties: - dashboards: - description: List of dashboards in the dashboard list. - items: - $ref: '#/components/schemas/DashboardListItemResponse' - type: array + data: + $ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleData' type: object - DashboardType: - description: The type of the dashboard. + CloudWorkloadSecurityAgentRuleType: + default: agent_rule + description: The type of the resource. The value should always be `agent_rule`. enum: - - custom_timeboard - - custom_screenboard - - integration_screenboard - - integration_timeboard - - host_timeboard - example: host_timeboard + - agent_rule + example: agent_rule type: string x-enum-varnames: - - CUSTOM_TIMEBOARD - - CUSTOM_SCREENBOARD - - INTEGRATION_SCREENBOARD - - INTEGRATION_TIMEBOARD - - HOST_TIMEBOARD - Event: - description: The metadata associated with a request. + - AGENT_RULE + CloudWorkloadSecurityAgentRuleUpdateAttributes: + description: Update an existing Cloud Workload Security Agent rule. properties: - id: - description: Event ID. - example: '6509751066204996294' + description: + description: The description of the Agent rule. + example: My Agent rule type: string - name: - description: The event name. + enabled: + description: Whether the Agent rule is enabled. + example: true + type: boolean + expression: + description: The SECL expression of the Agent rule. + example: exec.file.name == \"sh\" type: string - source_id: - description: Event source ID. - example: 36 - format: int64 - type: integer + type: object + CloudWorkloadSecurityAgentRuleUpdateData: + description: Object for a single Agent rule. + properties: + attributes: + $ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleUpdateAttributes' type: - description: Event type. - example: error_tracking_alert - type: string + $ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleType' + required: + - attributes + - type type: object - EventAttributes: - description: Object description of attributes from your event. + CloudWorkloadSecurityAgentRuleUpdateRequest: + description: Request object that includes the Agent rule with the attributes + to update. properties: - aggregation_key: - description: Aggregation key of the event. - type: string - date_happened: - description: 'POSIX timestamp of the event. Must be sent as an integer (no - quotation marks). - - Limited to events no older than 18 hours.' - format: int64 - type: integer - device_name: - description: A device name. - type: string - duration: - description: The duration between the triggering of the event and its recovery - in nanoseconds. - format: int64 - type: integer - event_object: - description: The event title. - example: Did you hear the news today? + data: + $ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleUpdateData' + required: + - data + type: object + CloudWorkloadSecurityAgentRuleUpdaterAttributes: + description: The attributes of the user who last updated the Agent rule. + properties: + handle: + description: The handle of the user. + example: datadog.user@example.com type: string - evt: - $ref: '#/components/schemas/Event' - hostname: - description: 'Host name to associate with the event. - - Any tags associated with the host are also applied to this event.' + name: + description: The name of the user. + example: Datadog User type: string - monitor: - $ref: '#/components/schemas/MonitorType' - monitor_groups: - description: List of groups referred to in the event. + type: object + CloudWorkloadSecurityAgentRulesListResponse: + description: Response object that includes a list of Agent rule. + properties: + data: + description: A list of Agent rules objects. items: - description: Group referred to in the event. - type: string - nullable: true + $ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleData' type: array - monitor_id: - description: ID of the monitor that triggered the event. When an event isn't - related to a monitor, this field is empty. - format: int64 - nullable: true - type: integer - priority: - $ref: '#/components/schemas/EventPriority' - related_event_id: - description: Related event ID. - format: int64 - type: integer - service: - description: Service that triggered the event. - example: datadog-api - type: string - source_type_name: - description: 'The type of event being posted. - - For example, `nagios`, `hudson`, `jenkins`, `my_apps`, `chef`, `puppet`, - `git` or `bitbucket`. - - The list of standard source attribute values is [available here](https://docs.datadoghq.com/integrations/faq/list-of-api-source-attribute-value).' + type: object + ConfluentAccountCreateRequest: + description: Payload schema when adding a Confluent account. + properties: + data: + $ref: '#/components/schemas/ConfluentAccountCreateRequestData' + required: + - data + type: object + ConfluentAccountCreateRequestAttributes: + description: Attributes associated with the account creation request. + properties: + api_key: + description: The API key associated with your Confluent account. + example: TESTAPIKEY123 type: string - sourcecategory: - description: Identifier for the source of the event, such as a monitor alert, - an externally-submitted event, or an integration. + api_secret: + description: The API secret associated with your Confluent account. + example: test-api-secret-123 type: string - status: - $ref: '#/components/schemas/EventStatusType' + resources: + description: A list of Confluent resources associated with the Confluent + account. + items: + $ref: '#/components/schemas/ConfluentAccountResourceAttributes' + type: array tags: - description: A list of tags to apply to the event. + description: A list of strings representing tags. Can be a single key, or + key-value pairs separated by a colon. example: - - environment:test + - myTag + - myTag2:myValue items: - description: A tag. type: string type: array - timestamp: - description: POSIX timestamp of your event in milliseconds. - example: 1652274265000 - format: int64 - type: integer - title: - description: The event title. - example: Oh boy! - type: string + required: + - api_key + - api_secret type: object - EventPriority: - description: The priority of the event's monitor. For example, `normal` or `low`. - enum: - - normal - - low - example: normal - nullable: true - type: string - x-enum-varnames: - - NORMAL - - LOW - EventResponse: - description: The object description of an event after being processed and stored - by Datadog. + ConfluentAccountCreateRequestData: + description: The data body for adding a Confluent account. properties: attributes: - $ref: '#/components/schemas/EventResponseAttributes' - id: - description: the unique ID of the event. - example: AAAAAWgN8Xwgr1vKDQAAAABBV2dOOFh3ZzZobm1mWXJFYTR0OA - type: string + $ref: '#/components/schemas/ConfluentAccountCreateRequestAttributes' type: - $ref: '#/components/schemas/EventType' + $ref: '#/components/schemas/ConfluentAccountType' + required: + - attributes + - type type: object - EventResponseAttributes: - description: The object description of an event response attribute. + ConfluentAccountResourceAttributes: + description: Attributes object for updating a Confluent resource. properties: - attributes: - $ref: '#/components/schemas/EventAttributes' + id: + description: The ID associated with a Confluent resource. + example: resource-id-123 + type: string + resource_type: + description: The resource type of the Resource. Can be `kafka`, `connector`, + `ksql`, or `schema_registry`. + example: kafka + type: string tags: - description: An array of tags associated with the event. + description: A list of strings representing tags. Can be a single key, or + key-value pairs separated by a colon. example: - - team:A + - myTag + - myTag2:myValue items: - description: The tag associated with the event. type: string type: array - timestamp: - description: The timestamp of the event. - example: '2019-01-02T09:42:36.320Z' - format: date-time - type: string type: object - EventStatusType: - description: 'If an alert event is enabled, its status is one of the following: - - `failure`, `error`, `warning`, `info`, `success`, `user_update`, - - `recommendation`, or `snapshot`.' - enum: - - failure - - error - - warning - - info - - success - - user_update - - recommendation - - snapshot - example: info - type: string - x-enum-varnames: - - FAILURE - - ERROR - - WARNING - - INFO - - SUCCESS - - USER_UPDATE - - RECOMMENDATION - - SNAPSHOT - EventType: - default: event - description: Type of the event. - enum: - - event - example: event - type: string - x-enum-varnames: - - EVENT - EventsListRequest: - description: The object sent with the request to retrieve a list of events from - your organization. + ConfluentAccountResponse: + description: The expected response schema when getting a Confluent account. properties: - filter: - $ref: '#/components/schemas/EventsQueryFilter' - options: - $ref: '#/components/schemas/EventsQueryOptions' - page: - $ref: '#/components/schemas/EventsRequestPage' - sort: - $ref: '#/components/schemas/EventsSort' + data: + $ref: '#/components/schemas/ConfluentAccountResponseData' type: object - EventsListResponse: - description: The response object with all events matching the request and pagination - information. + ConfluentAccountResponseAttributes: + description: The attributes of a Confluent account. properties: - data: - description: An array of events matching the request. + api_key: + description: The API key associated with your Confluent account. + example: TESTAPIKEY123 + type: string + resources: + description: A list of Confluent resources associated with the Confluent + account. items: - $ref: '#/components/schemas/EventResponse' + $ref: '#/components/schemas/ConfluentResourceResponseAttributes' type: array - links: - $ref: '#/components/schemas/EventsListResponseLinks' - meta: - $ref: '#/components/schemas/EventsResponseMetadata' + tags: + description: A list of strings representing tags. Can be a single key, or + key-value pairs separated by a colon. + example: + - myTag + - myTag2:myValue + items: + type: string + type: array + required: + - api_key type: object - EventsListResponseLinks: - description: Links attributes. + ConfluentAccountResponseData: + description: An API key and API secret pair that represents a Confluent account. properties: - next: - description: 'Link for the next set of results. Note that the request can - also be made using the - - POST endpoint.' - example: https://app.datadoghq.com/api/v2/events?filter[query]=foo&page[cursor]=eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ== + attributes: + $ref: '#/components/schemas/ConfluentAccountResponseAttributes' + id: + description: A randomly generated ID associated with a Confluent account. + example: account_id_abc123 type: string + type: + $ref: '#/components/schemas/ConfluentAccountType' + required: + - attributes + - id + - type type: object - EventsQueryFilter: - description: The search and filter query settings. + ConfluentAccountType: + default: confluent-cloud-accounts + description: The JSON:API type for this API. Should always be `confluent-cloud-accounts`. + enum: + - confluent-cloud-accounts + example: confluent-cloud-accounts + type: string + x-enum-varnames: + - CONFLUENT_CLOUD_ACCOUNTS + ConfluentAccountUpdateRequest: + description: The JSON:API request for updating a Confluent account. properties: - from: - default: now-15m - description: The minimum time for the requested events. Supports date math - and regular timestamps in milliseconds. - example: now-15m - type: string - query: - default: '*' - description: The search query following the event search syntax. - example: service:web* AND @http.status_code:[200 TO 299] - type: string - to: - default: now - description: The maximum time for the requested events. Supports date math - and regular timestamps in milliseconds. - example: now - type: string + data: + $ref: '#/components/schemas/ConfluentAccountUpdateRequestData' + required: + - data type: object - EventsQueryOptions: - description: 'The global query options that are used. Either provide a timezone - or a time offset but not both, - - otherwise the query fails.' + ConfluentAccountUpdateRequestAttributes: + description: Attributes object for updating a Confluent account. properties: - timeOffset: - description: The time offset to apply to the query in seconds. - format: int64 - type: integer - timezone: - default: UTC - description: 'The timezone can be specified as an offset, for example: `UTC+03:00`.' - example: GMT + api_key: + description: The API key associated with your Confluent account. + example: TESTAPIKEY123 + type: string + api_secret: + description: The API secret associated with your Confluent account. + example: test-api-secret-123 type: string + tags: + description: A list of strings representing tags. Can be a single key, or + key-value pairs separated by a colon. + example: + - myTag + - myTag2:myValue + items: + type: string + type: array + required: + - api_key + - api_secret type: object - EventsRequestPage: - description: Pagination settings. + ConfluentAccountUpdateRequestData: + description: Data object for updating a Confluent account. properties: - cursor: - description: The returned paging point to use to get the next results. - example: eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ== - type: string - limit: - default: 10 - description: The maximum number of logs in the response. - example: 25 - format: int32 - maximum: 1000 - type: integer + attributes: + $ref: '#/components/schemas/ConfluentAccountUpdateRequestAttributes' + type: + $ref: '#/components/schemas/ConfluentAccountType' + required: + - attributes + - type type: object - EventsResponseMetadata: - description: The metadata associated with a request. + ConfluentAccountsResponse: + description: Confluent account returned by the API. properties: - elapsed: - description: The time elapsed in milliseconds. - example: 132 - format: int64 - type: integer - page: - $ref: '#/components/schemas/EventsResponseMetadataPage' - request_id: - description: The identifier of the request. - example: MWlFUjVaWGZTTTZPYzM0VXp1OXU2d3xLSVpEMjZKQ0VKUTI0dEYtM3RSOFVR - type: string - warnings: - description: 'A list of warnings (non-fatal errors) encountered. Partial - results might be returned if - - warnings are present in the response.' + data: + description: The Confluent account. items: - $ref: '#/components/schemas/EventsWarning' + $ref: '#/components/schemas/ConfluentAccountResponseData' type: array type: object - EventsResponseMetadataPage: - description: Pagination attributes. + ConfluentResourceRequest: + description: The JSON:API request for updating a Confluent resource. properties: - after: - description: 'The cursor to use to get the next results, if any. To make - the next request, use the same - - parameters with the addition of the `page[cursor]`.' - example: eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ== - type: string + data: + $ref: '#/components/schemas/ConfluentResourceRequestData' + required: + - data type: object - EventsSort: - description: The sort parameters when querying events. - enum: - - timestamp - - -timestamp - type: string - x-enum-varnames: - - TIMESTAMP_ASCENDING - - TIMESTAMP_DESCENDING - EventsWarning: - description: A warning message indicating something is wrong with the query. + ConfluentResourceRequestAttributes: + description: Attributes object for updating a Confluent resource. properties: - code: - description: A unique code for this type of warning. - example: unknown_index - type: string - detail: - description: A detailed explanation of this specific warning. - example: 'indexes: foo, bar' - type: string - title: - description: A short human-readable summary of the warning. - example: One or several indexes are missing or invalid. Results hold data - from the other indexes. + resource_type: + description: The resource type of the Resource. Can be `kafka`, `connector`, + `ksql`, or `schema_registry`. + example: kafka type: string + tags: + description: A list of strings representing tags. Can be a single key, or + key-value pairs separated by a colon. + example: + - myTag + - myTag2:myValue + items: + type: string + type: array type: object - FullAPIKey: - description: Datadog API key. + ConfluentResourceRequestData: + description: JSON:API request for updating a Confluent resource. properties: attributes: - $ref: '#/components/schemas/FullAPIKeyAttributes' + $ref: '#/components/schemas/ConfluentResourceRequestAttributes' id: - description: ID of the API key. + description: The ID associated with a Confluent resource. + example: resource-id-123 type: string - relationships: - $ref: '#/components/schemas/APIKeyRelationships' type: - $ref: '#/components/schemas/APIKeysType' + $ref: '#/components/schemas/ConfluentResourceType' + required: + - attributes + - type + - id type: object - FullAPIKeyAttributes: - description: Attributes of a full API key. + ConfluentResourceResponse: + description: Response schema when interacting with a Confluent resource. properties: - created_at: - description: Creation date of the API key. - example: '2020-11-23T10:00:00.000Z' - readOnly: true - type: string - key: - description: The API key. - readOnly: true - type: string - last4: - description: The last four characters of the API key. - example: abcd - maxLength: 4 - minLength: 4 - readOnly: true - type: string - modified_at: - description: Date the API key was last modified. - example: '2020-11-23T10:00:00.000Z' - readOnly: true - type: string - name: - description: Name of the API key. - example: API Key for submitting metrics + data: + $ref: '#/components/schemas/ConfluentResourceResponseData' + type: object + ConfluentResourceResponseAttributes: + description: Model representation of a Confluent Cloud resource. + properties: + resource_type: + description: The resource type of the Resource. Can be `kafka`, `connector`, + `ksql`, or `schema_registry`. + example: kafka type: string + tags: + description: A list of strings representing tags. Can be a single key, or + key-value pairs separated by a colon. + example: + - myTag + - myTag2:myValue + items: + type: string + type: array + required: + - resource_type type: object - FullApplicationKey: - description: Datadog application key. + ConfluentResourceResponseData: + description: Confluent Cloud resource data. properties: attributes: - $ref: '#/components/schemas/FullApplicationKeyAttributes' + $ref: '#/components/schemas/ConfluentResourceResponseAttributes' id: - description: ID of the application key. + description: The ID associated with the Confluent resource. + example: resource_id_abc123 type: string - relationships: - $ref: '#/components/schemas/ApplicationKeyRelationships' type: - $ref: '#/components/schemas/ApplicationKeysType' + $ref: '#/components/schemas/ConfluentResourceType' + required: + - attributes + - type + - id type: object - FullApplicationKeyAttributes: - description: Attributes of a full application key. + ConfluentResourceType: + default: confluent-cloud-resources + description: The JSON:API type for this request. + enum: + - confluent-cloud-resources + example: confluent-cloud-resources + type: string + x-enum-varnames: + - CONFLUENT_CLOUD_RESOURCES + ConfluentResourcesResponse: + description: Response schema when interacting with a list of Confluent resources. properties: - created_at: - description: Creation date of the application key. - example: '2020-11-23T10:00:00.000Z' - readOnly: true + data: + description: The JSON:API data attribute. + items: + $ref: '#/components/schemas/ConfluentResourceResponseData' + type: array + type: object + ContentEncoding: + description: HTTP header used to compress the media-type. + enum: + - identity + - gzip + - deflate + type: string + x-enum-varnames: + - IDENTITY + - GZIP + - DEFLATE + CostByOrg: + description: Cost data. + properties: + attributes: + $ref: '#/components/schemas/CostByOrgAttributes' + id: + description: Unique ID of the response. type: string - key: - description: The application key. - readOnly: true + type: + $ref: '#/components/schemas/CostByOrgType' + type: object + CostByOrgAttributes: + description: Cost attributes data. + properties: + charges: + description: List of charges data reported for the requested month. + items: + $ref: '#/components/schemas/ChargebackBreakdown' + type: array + date: + description: The month requested. + format: date-time type: string - last4: - description: The last four characters of the application key. - example: abcd - maxLength: 4 - minLength: 4 - readOnly: true + org_name: + description: The organization name. type: string - name: - description: Name of the application key. - example: Application Key for managing dashboards + public_id: + description: The organization public ID. type: string - scopes: - description: Array of scopes to grant the application key. This feature - is in private beta, please contact Datadog support to enable scopes for - your application keys. - example: - - dashboards_read - - dashboards_write - - dashboards_public_share + total_cost: + description: The total cost of products for the month. + format: double + type: number + type: object + CostByOrgResponse: + description: Chargeback Summary response. + properties: + data: + description: Response containing Chargeback Summary. items: - description: Name of scope. - type: string - nullable: true + $ref: '#/components/schemas/CostByOrg' type: array type: object - HTTPLog: - description: Structured log message. - items: - $ref: '#/components/schemas/HTTPLogItem' - type: array - HTTPLogError: - description: List of errors. + CostByOrgType: + default: cost_by_org + description: Type of cost data. + enum: + - cost_by_org + example: cost_by_org + type: string + x-enum-varnames: + - COST_BY_ORG + Creator: + description: Creator of the object. properties: - detail: - description: Error message. - example: Malformed payload + email: + description: Email of the creator. type: string - status: - description: Error code. - example: '400' + handle: + description: Handle of the creator. type: string - title: - description: Error title. - example: Bad Request + name: + description: Name of the creator. type: string type: object - HTTPLogErrors: - description: Invalid query performed. + DashboardListAddItemsRequest: + description: Request containing a list of dashboards to add. properties: - errors: - description: Structured errors. + dashboards: + description: List of dashboards to add the dashboard list. items: - $ref: '#/components/schemas/HTTPLogError' + $ref: '#/components/schemas/DashboardListItemRequest' type: array type: object - HTTPLogItem: - additionalProperties: - description: Additional log attributes. - type: string - description: Logs that are sent over HTTP. + DashboardListAddItemsResponse: + description: Response containing a list of added dashboards. properties: - ddsource: - description: 'The integration name associated with your log: the technology - from which the log originated. - - When it matches an integration name, Datadog automatically installs the - corresponding parsers and facets. - - See [reserved attributes](https://docs.datadoghq.com/logs/log_configuration/attributes_naming_convention/#reserved-attributes).' - example: nginx + added_dashboards_to_list: + description: List of dashboards added to the dashboard list. + items: + $ref: '#/components/schemas/DashboardListItemResponse' + type: array + type: object + DashboardListDeleteItemsRequest: + description: Request containing a list of dashboards to delete. + properties: + dashboards: + description: List of dashboards to delete from the dashboard list. + items: + $ref: '#/components/schemas/DashboardListItemRequest' + type: array + type: object + DashboardListDeleteItemsResponse: + description: Response containing a list of deleted dashboards. + properties: + deleted_dashboards_from_list: + description: List of dashboards deleted from the dashboard list. + items: + $ref: '#/components/schemas/DashboardListItemResponse' + type: array + type: object + DashboardListItem: + description: A dashboard within a list. + properties: + author: + $ref: '#/components/schemas/Creator' + created: + description: Date of creation of the dashboard. + format: date-time + readOnly: true type: string - ddtags: - description: Tags associated with your logs. - example: env:staging,version:5.1 + icon: + description: URL to the icon of the dashboard. + readOnly: true type: string - hostname: - description: The name of the originating host of the log. - example: i-012345678 + id: + description: ID of the dashboard. + example: q5j-nti-fv6 type: string - message: - description: 'The message [reserved attribute](https://docs.datadoghq.com/logs/log_configuration/attributes_naming_convention/#reserved-attributes) - - of your log. By default, Datadog ingests the value of the message attribute - as the body of the log entry. - - That value is then highlighted and displayed in the Logstream, where it - is indexed for full text search.' - example: 2019-11-19T14:37:58,995 INFO [process.name][20081] Hello World + is_favorite: + description: Whether or not the dashboard is in the favorites. + readOnly: true + type: boolean + is_read_only: + description: Whether or not the dashboard is read only. + readOnly: true + type: boolean + is_shared: + description: Whether the dashboard is publicly shared or not. + readOnly: true + type: boolean + modified: + description: Date of last edition of the dashboard. + format: date-time + readOnly: true type: string - service: - description: 'The name of the application or service generating the log - events. - - It is used to switch from Logs to APM, so make sure you define the same - value when you use both products. - - See [reserved attributes](https://docs.datadoghq.com/logs/log_configuration/attributes_naming_convention/#reserved-attributes).' - example: payment + popularity: + description: Popularity of the dashboard. + format: int32 + maximum: 5 + readOnly: true + type: integer + title: + description: Title of the dashboard. + readOnly: true + type: string + type: + $ref: '#/components/schemas/DashboardType' + url: + description: URL path to the dashboard. + readOnly: true type: string required: - - message + - type + - id type: object - HourlyUsage: - description: Hourly usage for a product family for an org. + DashboardListItemRequest: + description: A dashboard within a list. properties: - attributes: - $ref: '#/components/schemas/HourlyUsageAttributes' id: - description: Unique ID of the response. + description: ID of the dashboard. + example: q5j-nti-fv6 type: string type: - $ref: '#/components/schemas/UsageTimeSeriesType' + $ref: '#/components/schemas/DashboardType' + required: + - type + - id type: object - HourlyUsageAttributes: - description: Attributes of hourly usage for a product family for an org for - a time period. + DashboardListItemResponse: + description: A dashboard within a list. properties: - measurements: - description: List of the measured usage values for the product family for - the org for the time period. - items: - $ref: '#/components/schemas/HourlyUsageMeasurement' - type: array - org_name: - description: The organization name. - type: string - product_family: - description: The product for which usage is being reported. - type: string - public_id: - description: The organization public ID. - type: string - region: - description: The region of the Datadog instance that the organization belongs - to. - type: string - timestamp: - description: Datetime in ISO-8601 format, UTC. The hour for the usage. - format: date-time + id: + description: ID of the dashboard. + example: q5j-nti-fv6 + readOnly: true type: string + type: + $ref: '#/components/schemas/DashboardType' + required: + - type + - id type: object - HourlyUsageMeasurement: - description: Usage amount for a given usage type. + DashboardListItems: + description: Dashboards within a list. properties: - usage_type: - description: Type of usage. - type: string - value: - description: Contains the number measured for the given usage_type during - the hour. + dashboards: + description: List of dashboards in the dashboard list. + example: [] + items: + $ref: '#/components/schemas/DashboardListItem' + type: array + total: + description: Number of dashboards in the dashboard list. format: int64 - nullable: true + readOnly: true type: integer + required: + - dashboards type: object - HourlyUsageMetadata: - description: The object containing document metadata. - properties: - pagination: - $ref: '#/components/schemas/HourlyUsagePagination' - type: object - HourlyUsagePagination: - description: The metadata for the current pagination. + DashboardListUpdateItemsRequest: + description: Request containing the list of dashboards to update to. properties: - next_record_id: - description: The cursor to get the next results (if any). To make the next - request, use the same parameters and add `next_record_id`. - nullable: true - type: string + dashboards: + description: List of dashboards to update the dashboard list to. + items: + $ref: '#/components/schemas/DashboardListItemRequest' + type: array type: object - HourlyUsageResponse: - description: Hourly usage response. + DashboardListUpdateItemsResponse: + description: Response containing a list of updated dashboards. properties: - data: - description: Response containing hourly usage. + dashboards: + description: List of dashboards in the dashboard list. items: - $ref: '#/components/schemas/HourlyUsage' + $ref: '#/components/schemas/DashboardListItemResponse' type: array - meta: - $ref: '#/components/schemas/HourlyUsageMetadata' type: object - HourlyUsageType: - description: Usage type that is being measured. + DashboardType: + description: The type of the dashboard. enum: - - app_sec_host_count - - observability_pipelines_bytes_processed - - lambda_traced_invocations_count - example: observability_pipelines_bytes_processed + - custom_timeboard + - custom_screenboard + - integration_screenboard + - integration_timeboard + - host_timeboard + example: host_timeboard type: string x-enum-varnames: - - APP_SEC_HOST_COUNT - - OBSERVABILITY_PIPELINES_BYTES_PROCESSSED - - LAMBDA_TRACED_INVOCATIONS_COUNT - IdPMetadataFormData: - description: The form data submitted to upload IdP metadata + - CUSTOM_TIMEBOARD + - CUSTOM_SCREENBOARD + - INTEGRATION_SCREENBOARD + - INTEGRATION_TIMEBOARD + - HOST_TIMEBOARD + Event: + description: The metadata associated with a request. properties: - idp_file: - description: The IdP metadata XML file - format: binary + id: + description: Event ID. + example: '6509751066204996294' type: string - x-mimetype: application/xml - type: object - IncidentAttachmentAttachmentType: - description: The type of the incident attachment attributes. - enum: - - link - - postmortem - example: link - type: string - x-enum-varnames: - - LINK - - POSTMORTEM - IncidentAttachmentAttributes: - description: The attributes object for an attachment. - oneOf: - - $ref: '#/components/schemas/IncidentAttachmentPostmortemAttributes' - - $ref: '#/components/schemas/IncidentAttachmentLinkAttributes' - type: object - IncidentAttachmentData: - description: A single incident attachment. - example: - attributes: - attachment: - documentUrl: '' - title: Postmortem IR-123 - attachment_type: postmortem - id: 00000000-abcd-0002-0000-000000000000 - relationships: - last_modified_by_user: - data: - id: 00000000-0000-0000-cccc-000000000000 - type: users - type: incident_attachments - properties: - attributes: - $ref: '#/components/schemas/IncidentAttachmentAttributes' - id: - description: A unique identifier that represents the incident attachment. - example: 00000000-abcd-0001-0000-000000000000 + name: + description: The event name. type: string - relationships: - $ref: '#/components/schemas/IncidentAttachmentRelationships' + source_id: + description: Event source ID. + example: 36 + format: int64 + type: integer type: - $ref: '#/components/schemas/IncidentAttachmentType' - required: - - type - - attributes - - id - - relationships - type: object - IncidentAttachmentLinkAttachmentType: - default: link - description: The type of link attachment attributes. - enum: - - link - example: link - type: string - x-enum-varnames: - - LINK - IncidentAttachmentLinkAttributes: - description: The attributes object for a link attachment. - properties: - attachment: - $ref: '#/components/schemas/IncidentAttachmentLinkAttributesAttachmentObject' - attachment_type: - $ref: '#/components/schemas/IncidentAttachmentLinkAttachmentType' - required: - - attachment_type - - attachment + description: Event type. + example: error_tracking_alert + type: string type: object - IncidentAttachmentLinkAttributesAttachmentObject: - description: The link attachment. + EventAttributes: + description: Object description of attributes from your event. properties: - documentUrl: - description: The URL of this link attachment. - example: https://www.example.com/webstore-failure-runbook + aggregation_key: + description: Aggregation key of the event. + type: string + date_happened: + description: 'POSIX timestamp of the event. Must be sent as an integer (no + quotation marks). + + Limited to events no older than 18 hours.' + format: int64 + type: integer + device_name: + description: A device name. + type: string + duration: + description: The duration between the triggering of the event and its recovery + in nanoseconds. + format: int64 + type: integer + event_object: + description: The event title. + example: Did you hear the news today? + type: string + evt: + $ref: '#/components/schemas/Event' + hostname: + description: 'Host name to associate with the event. + + Any tags associated with the host are also applied to this event.' + type: string + monitor: + $ref: '#/components/schemas/MonitorType' + monitor_groups: + description: List of groups referred to in the event. + items: + description: Group referred to in the event. + type: string + nullable: true + type: array + monitor_id: + description: ID of the monitor that triggered the event. When an event isn't + related to a monitor, this field is empty. + format: int64 + nullable: true + type: integer + priority: + $ref: '#/components/schemas/EventPriority' + related_event_id: + description: Related event ID. + format: int64 + type: integer + service: + description: Service that triggered the event. + example: datadog-api + type: string + source_type_name: + description: 'The type of event being posted. + + For example, `nagios`, `hudson`, `jenkins`, `my_apps`, `chef`, `puppet`, + `git` or `bitbucket`. + + The list of standard source attribute values is [available here](https://docs.datadoghq.com/integrations/faq/list-of-api-source-attribute-value).' + type: string + sourcecategory: + description: Identifier for the source of the event, such as a monitor alert, + an externally-submitted event, or an integration. type: string + status: + $ref: '#/components/schemas/EventStatusType' + tags: + description: A list of tags to apply to the event. + example: + - environment:test + items: + description: A tag. + type: string + type: array + timestamp: + description: POSIX timestamp of your event in milliseconds. + example: 1652274265000 + format: int64 + type: integer title: - description: The title of this link attachment. - example: Runbook for webstore service failures + description: The event title. + example: Oh boy! type: string - required: - - documentUrl - - title - type: object - IncidentAttachmentPostmortemAttachmentType: - default: postmortem - description: The type of postmortem attachment attributes. - enum: - - postmortem - example: postmortem - type: string - x-enum-varnames: - - POSTMORTEM - IncidentAttachmentPostmortemAttributes: - description: The attributes object for a postmortem attachment. - properties: - attachment: - $ref: '#/components/schemas/IncidentAttachmentsPostmortemAttributesAttachmentObject' - attachment_type: - $ref: '#/components/schemas/IncidentAttachmentPostmortemAttachmentType' - required: - - attachment_type - - attachment - type: object - IncidentAttachmentRelatedObject: - description: The object related to an incident attachment. - enum: - - users - type: string - x-enum-varnames: - - USERS - IncidentAttachmentRelationships: - description: The incident attachment's relationships. - properties: - last_modified_by_user: - $ref: '#/components/schemas/RelationshipToUser' type: object - IncidentAttachmentType: - default: incident_attachments - description: The incident attachment resource type. + EventPriority: + description: The priority of the event's monitor. For example, `normal` or `low`. enum: - - incident_attachments - example: incident_attachments + - normal + - low + example: normal + nullable: true type: string x-enum-varnames: - - INCIDENT_ATTACHMENTS - IncidentAttachmentUpdateAttributes: - description: Incident attachment attributes. - oneOf: - - $ref: '#/components/schemas/IncidentAttachmentPostmortemAttributes' - - $ref: '#/components/schemas/IncidentAttachmentLinkAttributes' - type: object - IncidentAttachmentUpdateData: - description: A single incident attachment. + - NORMAL + - LOW + EventResponse: + description: The object description of an event after being processed and stored + by Datadog. properties: attributes: - $ref: '#/components/schemas/IncidentAttachmentUpdateAttributes' + $ref: '#/components/schemas/EventResponseAttributes' id: - description: A unique identifier that represents the incident attachment. - example: 00000000-abcd-0001-0000-000000000000 + description: the unique ID of the event. + example: AAAAAWgN8Xwgr1vKDQAAAABBV2dOOFh3ZzZobm1mWXJFYTR0OA type: string type: - $ref: '#/components/schemas/IncidentAttachmentType' - required: - - type + $ref: '#/components/schemas/EventType' type: object - IncidentAttachmentUpdateRequest: - description: The update request for an incident's attachments. + EventResponseAttributes: + description: The object description of an event response attribute. properties: - data: - description: 'An array of incident attachments. An attachment object without - an "id" key indicates that you want to - - create that attachment. An attachment object without an "attributes" key - indicates that you want to - - delete that attachment. An attachment object with both the "id" key and - a populated "attributes" object - - indicates that you want to update that attachment.' + attributes: + $ref: '#/components/schemas/EventAttributes' + tags: + description: An array of tags associated with the event. example: - - attributes: - attachment: - documentUrl: https://app.datadoghq.com/notebook/123 - title: Postmortem IR-123 - attachment_type: postmortem - id: 00000000-abcd-0002-0000-000000000000 - type: incident_attachments - - attributes: - attachment: - documentUrl: https://www.example.com/webstore-failure-runbook - title: Runbook for webstore service failures - attachment_type: link - type: incident_attachments - - id: 00000000-abcd-0003-0000-000000000000 - type: incident_attachments + - team:A items: - $ref: '#/components/schemas/IncidentAttachmentUpdateData' + description: The tag associated with the event. + type: string type: array - required: - - data + timestamp: + description: The timestamp of the event. + example: '2019-01-02T09:42:36.320Z' + format: date-time + type: string type: object - IncidentAttachmentUpdateResponse: - description: The response object containing the created or updated incident - attachments. - properties: - data: - description: 'An array of incident attachments. Only the attachments that - were created or updated by the request are + EventStatusType: + description: 'If an alert event is enabled, its status is one of the following: - returned.' - items: - $ref: '#/components/schemas/IncidentAttachmentData' - type: array - included: - description: Included related resources that the user requested. - items: - $ref: '#/components/schemas/IncidentAttachmentsResponseIncludedItem' - type: array - required: - - data - type: object - IncidentAttachmentsPostmortemAttributesAttachmentObject: - description: The postmortem attachment. + `failure`, `error`, `warning`, `info`, `success`, `user_update`, + + `recommendation`, or `snapshot`.' + enum: + - failure + - error + - warning + - info + - success + - user_update + - recommendation + - snapshot + example: info + type: string + x-enum-varnames: + - FAILURE + - ERROR + - WARNING + - INFO + - SUCCESS + - USER_UPDATE + - RECOMMENDATION + - SNAPSHOT + EventType: + default: event + description: Type of the event. + enum: + - event + example: event + type: string + x-enum-varnames: + - EVENT + EventsListRequest: + description: The object sent with the request to retrieve a list of events from + your organization. properties: - documentUrl: - description: The URL of this notebook attachment. - example: https://app.datadoghq.com/notebook/123 - type: string - title: - description: The title of this postmortem attachment. - example: Postmortem IR-123 - type: string - required: - - documentUrl - - title + filter: + $ref: '#/components/schemas/EventsQueryFilter' + options: + $ref: '#/components/schemas/EventsQueryOptions' + page: + $ref: '#/components/schemas/EventsRequestPage' + sort: + $ref: '#/components/schemas/EventsSort' type: object - IncidentAttachmentsResponse: - description: The response object containing an incident's attachments. + EventsListResponse: + description: The response object with all events matching the request and pagination + information. properties: data: - description: An array of incident attachments. - items: - $ref: '#/components/schemas/IncidentAttachmentData' - type: array - included: - description: Included related resources that the user requested. + description: An array of events matching the request. items: - $ref: '#/components/schemas/IncidentAttachmentsResponseIncludedItem' + $ref: '#/components/schemas/EventResponse' type: array - required: - - data - type: object - IncidentAttachmentsResponseIncludedItem: - description: An object related to an attachment that is included in the response. - oneOf: - - $ref: '#/components/schemas/User' + links: + $ref: '#/components/schemas/EventsListResponseLinks' + meta: + $ref: '#/components/schemas/EventsResponseMetadata' type: object - IncidentCreateAttributes: - description: The incident's attributes for a create request. + EventsListResponseLinks: + description: Links attributes. properties: - customer_impacted: - description: A flag indicating whether the incident caused customer impact. - example: false - type: boolean - fields: - additionalProperties: - $ref: '#/components/schemas/IncidentFieldAttributes' - description: A condensed view of the user-defined fields for which to create - initial selections. - example: - severity: - type: dropdown - value: SEV-5 - type: object - initial_cells: - description: An array of initial timeline cells to be placed at the beginning - of the incident timeline. - items: - $ref: '#/components/schemas/IncidentTimelineCellCreateAttributes' - type: array - notification_handles: - description: Notification handles that will be notified of the incident - at creation. - items: - $ref: '#/components/schemas/IncidentNotificationHandle' - type: array - title: - description: The title of the incident, which summarizes what happened. - example: A test incident title + next: + description: 'Link for the next set of results. Note that the request can + also be made using the + + POST endpoint.' + example: https://app.datadoghq.com/api/v2/events?filter[query]=foo&page[cursor]=eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ== type: string - required: - - title - - customer_impacted type: object - IncidentCreateData: - description: Incident data for a create request. + EventsQueryFilter: + description: The search and filter query settings. properties: - attributes: - $ref: '#/components/schemas/IncidentCreateAttributes' - relationships: - $ref: '#/components/schemas/IncidentCreateRelationships' - type: - $ref: '#/components/schemas/IncidentType' - required: - - type - - attributes + from: + default: now-15m + description: The minimum time for the requested events. Supports date math + and regular timestamps in milliseconds. + example: now-15m + type: string + query: + default: '*' + description: The search query following the event search syntax. + example: service:web* AND @http.status_code:[200 TO 299] + type: string + to: + default: now + description: The maximum time for the requested events. Supports date math + and regular timestamps in milliseconds. + example: now + type: string type: object - IncidentCreateRelationships: - description: The relationships the incident will have with other resources once - created. + EventsQueryOptions: + description: 'The global query options that are used. Either provide a timezone + or a time offset but not both, + + otherwise the query fails.' properties: - commander_user: - $ref: '#/components/schemas/NullableRelationshipToUser' - required: - - commander_user + timeOffset: + description: The time offset to apply to the query in seconds. + format: int64 + type: integer + timezone: + default: UTC + description: 'The timezone can be specified as an offset, for example: `UTC+03:00`.' + example: GMT + type: string type: object - IncidentCreateRequest: - description: Create request for an incident. + EventsRequestPage: + description: Pagination settings. properties: - data: - $ref: '#/components/schemas/IncidentCreateData' - required: - - data - type: object - IncidentFieldAttributes: - description: Dynamic fields for which selections can be made, with field names - as keys. - oneOf: - - $ref: '#/components/schemas/IncidentFieldAttributesSingleValue' - - $ref: '#/components/schemas/IncidentFieldAttributesMultipleValue' - required: - - type + cursor: + description: The returned paging point to use to get the next results. + example: eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ== + type: string + limit: + default: 10 + description: The maximum number of logs in the response. + example: 25 + format: int32 + maximum: 1000 + type: integer type: object - IncidentFieldAttributesMultipleValue: - description: A field with potentially multiple values selected. + EventsResponseMetadata: + description: The metadata associated with a request. properties: - type: - $ref: '#/components/schemas/IncidentFieldAttributesValueType' - value: - description: The multiple values selected for this field. - example: - - '1.0' - - '1.1' - items: - description: A value which has been selected for the parent field. - example: '1.1' - type: string - nullable: true + elapsed: + description: The time elapsed in milliseconds. + example: 132 + format: int64 + type: integer + page: + $ref: '#/components/schemas/EventsResponseMetadataPage' + request_id: + description: The identifier of the request. + example: MWlFUjVaWGZTTTZPYzM0VXp1OXU2d3xLSVpEMjZKQ0VKUTI0dEYtM3RSOFVR + type: string + warnings: + description: 'A list of warnings (non-fatal errors) encountered. Partial + results might be returned if + + warnings are present in the response.' + items: + $ref: '#/components/schemas/EventsWarning' type: array type: object - IncidentFieldAttributesSingleValue: - description: A field with a single value selected. + EventsResponseMetadataPage: + description: Pagination attributes. properties: - type: - $ref: '#/components/schemas/IncidentFieldAttributesSingleValueType' - value: - description: The single value selected for this field. - example: SEV-1 - nullable: true + after: + description: 'The cursor to use to get the next results, if any. To make + the next request, use the same + + parameters with the addition of the `page[cursor]`.' + example: eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ== type: string type: object - IncidentFieldAttributesSingleValueType: - default: dropdown - description: Type of the single value field definitions. - enum: - - dropdown - - textbox - example: dropdown - type: string - x-enum-varnames: - - DROPDOWN - - TEXTBOX - IncidentFieldAttributesValueType: - default: multiselect - description: Type of the multiple value field definitions. - enum: - - multiselect - - textarray - - metrictag - - autocomplete - example: multiselect - type: string - x-enum-varnames: - - MULTISELECT - - TEXTARRAY - - METRICTAG - - AUTOCOMPLETE - IncidentIntegrationMetadataType: - default: incident_integrations - description: Integration metadata resource type. + EventsSort: + description: The sort parameters when querying events. enum: - - incident_integrations - example: incident_integrations + - timestamp + - -timestamp type: string x-enum-varnames: - - INCIDENT_INTEGRATIONS - IncidentNotificationHandle: - description: A notification handle that will be notified at incident creation. + - TIMESTAMP_ASCENDING + - TIMESTAMP_DESCENDING + EventsWarning: + description: A warning message indicating something is wrong with the query. properties: - display_name: - description: The name of the notified handle. - example: Jane Doe + code: + description: A unique code for this type of warning. + example: unknown_index type: string - handle: - description: The email address used for the notification. - example: '@test.user@test.com' + detail: + description: A detailed explanation of this specific warning. + example: 'indexes: foo, bar' + type: string + title: + description: A short human-readable summary of the warning. + example: One or several indexes are missing or invalid. Results hold data + from the other indexes. type: string type: object - IncidentPostmortemType: - default: incident_postmortems - description: Incident postmortem resource type. - enum: - - incident_postmortems - example: incident_postmortems - type: string - x-enum-varnames: - - INCIDENT_POSTMORTEMS - IncidentRelatedObject: - description: Object related to an incident. - enum: - - users - - attachments - type: string - x-enum-varnames: - - USERS - - ATTACHMENTS - IncidentResponse: - description: Response with an incident. + FullAPIKey: + description: Datadog API key. properties: - data: - $ref: '#/components/schemas/IncidentResponseData' - included: - description: Included related resources that the user requested. - items: - $ref: '#/components/schemas/IncidentResponseIncludedItem' - readOnly: true - type: array - required: - - data + attributes: + $ref: '#/components/schemas/FullAPIKeyAttributes' + id: + description: ID of the API key. + type: string + relationships: + $ref: '#/components/schemas/APIKeyRelationships' + type: + $ref: '#/components/schemas/APIKeysType' type: object - IncidentResponseAttributes: - description: The incident's attributes from a response. + FullAPIKeyAttributes: + description: Attributes of a full API key. properties: - created: - description: Timestamp when the incident was created. - format: date-time + created_at: + description: Creation date of the API key. + example: '2020-11-23T10:00:00.000Z' readOnly: true type: string - customer_impact_duration: - description: 'Length of the incident''s customer impact in seconds. - - Equals the difference between `customer_impact_start` and `customer_impact_end`.' - format: int64 + key: + description: The API key. readOnly: true - type: integer - customer_impact_end: - description: Timestamp when customers were no longer impacted by the incident. - format: date-time - nullable: true - type: string - customer_impact_scope: - description: A summary of the impact customers experienced during the incident. - example: An example customer impact scope - nullable: true - type: string - customer_impact_start: - description: Timestamp when customers began being impacted by the incident. - format: date-time - nullable: true - type: string - customer_impacted: - description: A flag indicating whether the incident caused customer impact. - example: false - type: boolean - detected: - description: Timestamp when the incident was detected. - format: date-time - nullable: true type: string - fields: - additionalProperties: - $ref: '#/components/schemas/IncidentFieldAttributes' - description: A condensed view of the user-defined fields attached to incidents. - example: - severity: - type: dropdown - value: SEV-5 - type: object - modified: - description: Timestamp when the incident was last modified. - format: date-time + last4: + description: The last four characters of the API key. + example: abcd + maxLength: 4 + minLength: 4 readOnly: true type: string - notification_handles: - description: Notification handles that will be notified of the incident - during update. - items: - $ref: '#/components/schemas/IncidentNotificationHandle' - nullable: true - type: array - public_id: - description: The monotonically increasing integer ID for the incident. - example: 1 - format: int64 - type: integer - resolved: - description: Timestamp when the incident's state was last changed from active - or stable to resolved or completed. - format: date-time - nullable: true - type: string - time_to_detect: - description: 'The amount of time in seconds to detect the incident. - - Equals the difference between `customer_impact_start` and `detected`.' - format: int64 - readOnly: true - type: integer - time_to_internal_response: - description: The amount of time in seconds to call incident after detection. - Equals the difference of `detected` and `created`. - format: int64 - readOnly: true - type: integer - time_to_repair: - description: The amount of time in seconds to resolve customer impact after - detecting the issue. Equals the difference between `customer_impact_end` - and `detected`. - format: int64 - readOnly: true - type: integer - time_to_resolve: - description: The amount of time in seconds to resolve the incident after - it was created. Equals the difference between `created` and `resolved`. - format: int64 + modified_at: + description: Date the API key was last modified. + example: '2020-11-23T10:00:00.000Z' readOnly: true - type: integer - title: - description: The title of the incident, which summarizes what happened. - example: A test incident title type: string - required: - - title + name: + description: Name of the API key. + example: API Key for submitting metrics + type: string type: object - IncidentResponseData: - description: Incident data from a response. + FullApplicationKey: + description: Datadog application key. properties: attributes: - $ref: '#/components/schemas/IncidentResponseAttributes' + $ref: '#/components/schemas/FullApplicationKeyAttributes' id: - description: The incident's ID. - example: 00000000-0000-0000-1234-000000000000 + description: ID of the application key. type: string relationships: - $ref: '#/components/schemas/IncidentResponseRelationships' + $ref: '#/components/schemas/ApplicationKeyRelationships' type: - $ref: '#/components/schemas/IncidentType' - required: - - id - - type - type: object - IncidentResponseIncludedItem: - description: An object related to an incident that is included in the response. - oneOf: - - $ref: '#/components/schemas/User' - - $ref: '#/components/schemas/IncidentAttachmentData' + $ref: '#/components/schemas/ApplicationKeysType' type: object - IncidentResponseMeta: - description: The metadata object containing pagination metadata. + FullApplicationKeyAttributes: + description: Attributes of a full application key. properties: - pagination: - $ref: '#/components/schemas/IncidentResponseMetaPagination' - readOnly: true + created_at: + description: Creation date of the application key. + example: '2020-11-23T10:00:00.000Z' + readOnly: true + type: string + key: + description: The application key. + readOnly: true + type: string + last4: + description: The last four characters of the application key. + example: abcd + maxLength: 4 + minLength: 4 + readOnly: true + type: string + name: + description: Name of the application key. + example: Application Key for managing dashboards + type: string + scopes: + description: Array of scopes to grant the application key. This feature + is in private beta, please contact Datadog support to enable scopes for + your application keys. + example: + - dashboards_read + - dashboards_write + - dashboards_public_share + items: + description: Name of scope. + type: string + nullable: true + type: array type: object - IncidentResponseMetaPagination: - description: Pagination properties. + HTTPLog: + description: Structured log message. + items: + $ref: '#/components/schemas/HTTPLogItem' + type: array + HTTPLogError: + description: List of errors. properties: - next_offset: - description: The index of the first element in the next page of results. - Equal to page size added to the current offset. - example: 1000 - format: int64 - type: integer - offset: - description: The index of the first element in the results. - example: 10 - format: int64 - type: integer - size: - description: Maximum size of pages to return. - example: 1000 - format: int64 - type: integer + detail: + description: Error message. + example: Malformed payload + type: string + status: + description: Error code. + example: '400' + type: string + title: + description: Error title. + example: Bad Request + type: string type: object - IncidentResponseRelationships: - description: The incident's relationships from a response. + HTTPLogErrors: + description: Invalid query performed. properties: - attachments: - $ref: '#/components/schemas/RelationshipToIncidentAttachment' - commander_user: - $ref: '#/components/schemas/NullableRelationshipToUser' - created_by_user: - $ref: '#/components/schemas/RelationshipToUser' - integrations: - $ref: '#/components/schemas/RelationshipToIncidentIntegrationMetadatas' - last_modified_by_user: - $ref: '#/components/schemas/RelationshipToUser' + errors: + description: Structured errors. + items: + $ref: '#/components/schemas/HTTPLogError' + type: array type: object - IncidentServiceCreateAttributes: - description: The incident service's attributes for a create request. + HTTPLogItem: + additionalProperties: + description: Additional log attributes. + type: string + description: Logs that are sent over HTTP. properties: - name: - description: Name of the incident service. - example: an example service name + ddsource: + description: 'The integration name associated with your log: the technology + from which the log originated. + + When it matches an integration name, Datadog automatically installs the + corresponding parsers and facets. + + See [reserved attributes](https://docs.datadoghq.com/logs/log_configuration/attributes_naming_convention/#reserved-attributes).' + example: nginx + type: string + ddtags: + description: Tags associated with your logs. + example: env:staging,version:5.1 + type: string + hostname: + description: The name of the originating host of the log. + example: i-012345678 + type: string + message: + description: 'The message [reserved attribute](https://docs.datadoghq.com/logs/log_configuration/attributes_naming_convention/#reserved-attributes) + + of your log. By default, Datadog ingests the value of the message attribute + as the body of the log entry. + + That value is then highlighted and displayed in the Logstream, where it + is indexed for full text search.' + example: 2019-11-19T14:37:58,995 INFO [process.name][20081] Hello World + type: string + service: + description: 'The name of the application or service generating the log + events. + + It is used to switch from Logs to APM, so make sure you define the same + value when you use both products. + + See [reserved attributes](https://docs.datadoghq.com/logs/log_configuration/attributes_naming_convention/#reserved-attributes).' + example: payment type: string required: - - name + - message type: object - IncidentServiceCreateData: - description: Incident Service payload for create requests. + HourlyUsage: + description: Hourly usage for a product family for an org. properties: attributes: - $ref: '#/components/schemas/IncidentServiceCreateAttributes' - relationships: - $ref: '#/components/schemas/IncidentServiceRelationships' + $ref: '#/components/schemas/HourlyUsageAttributes' + id: + description: Unique ID of the response. + type: string type: - $ref: '#/components/schemas/IncidentServiceType' - required: - - type - type: object - IncidentServiceCreateRequest: - description: Create request with an incident service payload. - properties: - data: - $ref: '#/components/schemas/IncidentServiceCreateData' - required: - - data - type: object - IncidentServiceIncludedItems: - description: An object related to an incident service which is present in the - included payload. - oneOf: - - $ref: '#/components/schemas/User' - type: object - IncidentServiceRelationships: - description: The incident service's relationships. - properties: - created_by: - $ref: '#/components/schemas/RelationshipToUser' - last_modified_by: - $ref: '#/components/schemas/RelationshipToUser' - readOnly: true + $ref: '#/components/schemas/UsageTimeSeriesType' type: object - IncidentServiceResponse: - description: Response with an incident service payload. + HourlyUsageAttributes: + description: Attributes of hourly usage for a product family for an org for + a time period. properties: - data: - $ref: '#/components/schemas/IncidentServiceResponseData' - included: - description: Included objects from relationships. + measurements: + description: List of the measured usage values for the product family for + the org for the time period. items: - $ref: '#/components/schemas/IncidentServiceIncludedItems' - readOnly: true + $ref: '#/components/schemas/HourlyUsageMeasurement' type: array - required: - - data - type: object - IncidentServiceResponseAttributes: - description: The incident service's attributes from a response. - properties: - created: - description: Timestamp of when the incident service was created. - format: date-time - readOnly: true + org_name: + description: The organization name. type: string - modified: - description: Timestamp of when the incident service was modified. - format: date-time - readOnly: true + product_family: + description: The product for which usage is being reported. type: string - name: - description: Name of the incident service. - example: service name + public_id: + description: The organization public ID. + type: string + region: + description: The region of the Datadog instance that the organization belongs + to. + type: string + timestamp: + description: Datetime in ISO-8601 format, UTC. The hour for the usage. + format: date-time type: string type: object - IncidentServiceResponseData: - description: Incident Service data from responses. + HourlyUsageMeasurement: + description: Usage amount for a given usage type. properties: - attributes: - $ref: '#/components/schemas/IncidentServiceResponseAttributes' - id: - description: The incident service's ID. - example: 00000000-0000-0000-0000-000000000000 + usage_type: + description: Type of usage. type: string - relationships: - $ref: '#/components/schemas/IncidentServiceRelationships' - type: - $ref: '#/components/schemas/IncidentServiceType' - required: - - id - - type + value: + description: Contains the number measured for the given usage_type during + the hour. + format: int64 + nullable: true + type: integer type: object - IncidentServiceType: - default: services - description: Incident service resource type. + HourlyUsageMetadata: + description: The object containing document metadata. + properties: + pagination: + $ref: '#/components/schemas/HourlyUsagePagination' + type: object + HourlyUsagePagination: + description: The metadata for the current pagination. + properties: + next_record_id: + description: The cursor to get the next results (if any). To make the next + request, use the same parameters and add `next_record_id`. + nullable: true + type: string + type: object + HourlyUsageResponse: + description: Hourly usage response. + properties: + data: + description: Response containing hourly usage. + items: + $ref: '#/components/schemas/HourlyUsage' + type: array + meta: + $ref: '#/components/schemas/HourlyUsageMetadata' + type: object + HourlyUsageType: + description: Usage type that is being measured. enum: - - services - example: services + - app_sec_host_count + - observability_pipelines_bytes_processed + - lambda_traced_invocations_count + example: observability_pipelines_bytes_processed type: string x-enum-varnames: - - SERVICES - IncidentServiceUpdateAttributes: - description: The incident service's attributes for an update request. + - APP_SEC_HOST_COUNT + - OBSERVABILITY_PIPELINES_BYTES_PROCESSSED + - LAMBDA_TRACED_INVOCATIONS_COUNT + IdPMetadataFormData: + description: The form data submitted to upload IdP metadata properties: - name: - description: Name of the incident service. - example: an example service name + idp_file: + description: The IdP metadata XML file + format: binary type: string - required: - - name + x-mimetype: application/xml type: object - IncidentServiceUpdateData: - description: Incident Service payload for update requests. + IncidentAttachmentAttachmentType: + description: The type of the incident attachment attributes. + enum: + - link + - postmortem + example: link + type: string + x-enum-varnames: + - LINK + - POSTMORTEM + IncidentAttachmentAttributes: + description: The attributes object for an attachment. + oneOf: + - $ref: '#/components/schemas/IncidentAttachmentPostmortemAttributes' + - $ref: '#/components/schemas/IncidentAttachmentLinkAttributes' + type: object + IncidentAttachmentData: + description: A single incident attachment. + example: + attributes: + attachment: + documentUrl: '' + title: Postmortem IR-123 + attachment_type: postmortem + id: 00000000-abcd-0002-0000-000000000000 + relationships: + last_modified_by_user: + data: + id: 00000000-0000-0000-cccc-000000000000 + type: users + type: incident_attachments properties: attributes: - $ref: '#/components/schemas/IncidentServiceUpdateAttributes' + $ref: '#/components/schemas/IncidentAttachmentAttributes' id: - description: The incident service's ID. - example: 00000000-0000-0000-0000-000000000000 + description: A unique identifier that represents the incident attachment. + example: 00000000-abcd-0001-0000-000000000000 type: string relationships: - $ref: '#/components/schemas/IncidentServiceRelationships' + $ref: '#/components/schemas/IncidentAttachmentRelationships' type: - $ref: '#/components/schemas/IncidentServiceType' + $ref: '#/components/schemas/IncidentAttachmentType' required: - type + - attributes + - id + - relationships type: object - IncidentServiceUpdateRequest: - description: Update request with an incident service payload. + IncidentAttachmentLinkAttachmentType: + default: link + description: The type of link attachment attributes. + enum: + - link + example: link + type: string + x-enum-varnames: + - LINK + IncidentAttachmentLinkAttributes: + description: The attributes object for a link attachment. properties: - data: - $ref: '#/components/schemas/IncidentServiceUpdateData' + attachment: + $ref: '#/components/schemas/IncidentAttachmentLinkAttributesAttachmentObject' + attachment_type: + $ref: '#/components/schemas/IncidentAttachmentLinkAttachmentType' required: - - data + - attachment_type + - attachment type: object - IncidentServicesResponse: - description: Response with a list of incident service payloads. + IncidentAttachmentLinkAttributesAttachmentObject: + description: The link attachment. properties: - data: - description: An array of incident services. - example: - - id: 00000000-0000-0000-0000-000000000000 - type: services - items: - $ref: '#/components/schemas/IncidentServiceResponseData' - type: array - included: - description: Included related resources which the user requested. - items: - $ref: '#/components/schemas/IncidentServiceIncludedItems' - readOnly: true - type: array - meta: - $ref: '#/components/schemas/IncidentResponseMeta' + documentUrl: + description: The URL of this link attachment. + example: https://www.example.com/webstore-failure-runbook + type: string + title: + description: The title of this link attachment. + example: Runbook for webstore service failures + type: string required: - - data + - documentUrl + - title type: object - IncidentTeamCreateAttributes: - description: The incident team's attributes for a create request. + IncidentAttachmentPostmortemAttachmentType: + default: postmortem + description: The type of postmortem attachment attributes. + enum: + - postmortem + example: postmortem + type: string + x-enum-varnames: + - POSTMORTEM + IncidentAttachmentPostmortemAttributes: + description: The attributes object for a postmortem attachment. properties: - name: - description: Name of the incident team. - example: team name - type: string + attachment: + $ref: '#/components/schemas/IncidentAttachmentsPostmortemAttributesAttachmentObject' + attachment_type: + $ref: '#/components/schemas/IncidentAttachmentPostmortemAttachmentType' required: - - name + - attachment_type + - attachment type: object - IncidentTeamCreateData: - description: Incident Team data for a create request. + IncidentAttachmentRelatedObject: + description: The object related to an incident attachment. + enum: + - users + type: string + x-enum-varnames: + - USERS + IncidentAttachmentRelationships: + description: The incident attachment's relationships. + properties: + last_modified_by_user: + $ref: '#/components/schemas/RelationshipToUser' + type: object + IncidentAttachmentType: + default: incident_attachments + description: The incident attachment resource type. + enum: + - incident_attachments + example: incident_attachments + type: string + x-enum-varnames: + - INCIDENT_ATTACHMENTS + IncidentAttachmentUpdateAttributes: + description: Incident attachment attributes. + oneOf: + - $ref: '#/components/schemas/IncidentAttachmentPostmortemAttributes' + - $ref: '#/components/schemas/IncidentAttachmentLinkAttributes' + type: object + IncidentAttachmentUpdateData: + description: A single incident attachment. properties: attributes: - $ref: '#/components/schemas/IncidentTeamCreateAttributes' - relationships: - $ref: '#/components/schemas/IncidentTeamRelationships' + $ref: '#/components/schemas/IncidentAttachmentUpdateAttributes' + id: + description: A unique identifier that represents the incident attachment. + example: 00000000-abcd-0001-0000-000000000000 + type: string type: - $ref: '#/components/schemas/IncidentTeamType' + $ref: '#/components/schemas/IncidentAttachmentType' required: - type type: object - IncidentTeamCreateRequest: - description: Create request with an incident team payload. + IncidentAttachmentUpdateRequest: + description: The update request for an incident's attachments. properties: data: - $ref: '#/components/schemas/IncidentTeamCreateData' - required: - - data - type: object - IncidentTeamIncludedItems: - description: An object related to an incident team which is present in the included - payload. - oneOf: - - $ref: '#/components/schemas/User' - type: object - IncidentTeamRelationships: - description: The incident team's relationships. - properties: - created_by: - $ref: '#/components/schemas/RelationshipToUser' - last_modified_by: - $ref: '#/components/schemas/RelationshipToUser' - readOnly: true - type: object - IncidentTeamResponse: - description: Response with an incident team payload. + description: 'An array of incident attachments. An attachment object without + an "id" key indicates that you want to + + create that attachment. An attachment object without an "attributes" key + indicates that you want to + + delete that attachment. An attachment object with both the "id" key and + a populated "attributes" object + + indicates that you want to update that attachment.' + example: + - attributes: + attachment: + documentUrl: https://app.datadoghq.com/notebook/123 + title: Postmortem IR-123 + attachment_type: postmortem + id: 00000000-abcd-0002-0000-000000000000 + type: incident_attachments + - attributes: + attachment: + documentUrl: https://www.example.com/webstore-failure-runbook + title: Runbook for webstore service failures + attachment_type: link + type: incident_attachments + - id: 00000000-abcd-0003-0000-000000000000 + type: incident_attachments + items: + $ref: '#/components/schemas/IncidentAttachmentUpdateData' + type: array + required: + - data + type: object + IncidentAttachmentUpdateResponse: + description: The response object containing the created or updated incident + attachments. properties: data: - $ref: '#/components/schemas/IncidentTeamResponseData' + description: 'An array of incident attachments. Only the attachments that + were created or updated by the request are + + returned.' + items: + $ref: '#/components/schemas/IncidentAttachmentData' + type: array included: - description: Included objects from relationships. + description: Included related resources that the user requested. items: - $ref: '#/components/schemas/IncidentTeamIncludedItems' - readOnly: true + $ref: '#/components/schemas/IncidentAttachmentsResponseIncludedItem' type: array required: - data type: object - IncidentTeamResponseAttributes: - description: The incident team's attributes from a response. - properties: - created: - description: Timestamp of when the incident team was created. - format: date-time - readOnly: true - type: string - modified: - description: Timestamp of when the incident team was modified. - format: date-time - readOnly: true - type: string - name: - description: Name of the incident team. - example: team name - type: string - type: object - IncidentTeamResponseData: - description: Incident Team data from a response. - properties: - attributes: - $ref: '#/components/schemas/IncidentTeamResponseAttributes' - id: - description: The incident team's ID. - example: 00000000-7ea3-0000-000a-000000000000 - type: string - relationships: - $ref: '#/components/schemas/IncidentTeamRelationships' - type: - $ref: '#/components/schemas/IncidentTeamType' - type: object - IncidentTeamType: - default: teams - description: Incident Team resource type. - enum: - - teams - example: teams - type: string - x-enum-varnames: - - TEAMS - IncidentTeamUpdateAttributes: - description: The incident team's attributes for an update request. + IncidentAttachmentsPostmortemAttributesAttachmentObject: + description: The postmortem attachment. properties: - name: - description: Name of the incident team. - example: team name + documentUrl: + description: The URL of this notebook attachment. + example: https://app.datadoghq.com/notebook/123 type: string - required: - - name - type: object - IncidentTeamUpdateData: - description: Incident Team data for an update request. - properties: - attributes: - $ref: '#/components/schemas/IncidentTeamUpdateAttributes' - id: - description: The incident team's ID. - example: 00000000-7ea3-0000-0001-000000000000 + title: + description: The title of this postmortem attachment. + example: Postmortem IR-123 type: string - relationships: - $ref: '#/components/schemas/IncidentTeamRelationships' - type: - $ref: '#/components/schemas/IncidentTeamType' - required: - - type - type: object - IncidentTeamUpdateRequest: - description: Update request with an incident team payload. - properties: - data: - $ref: '#/components/schemas/IncidentTeamUpdateData' required: - - data + - documentUrl + - title type: object - IncidentTeamsResponse: - description: Response with a list of incident team payloads. + IncidentAttachmentsResponse: + description: The response object containing an incident's attachments. properties: data: - description: An array of incident teams. - example: - - attributes: - name: team name - id: 00000000-7ea3-0000-0000-000000000000 - type: teams + description: An array of incident attachments. items: - $ref: '#/components/schemas/IncidentTeamResponseData' + $ref: '#/components/schemas/IncidentAttachmentData' type: array included: - description: Included related resources which the user requested. + description: Included related resources that the user requested. items: - $ref: '#/components/schemas/IncidentTeamIncludedItems' - readOnly: true + $ref: '#/components/schemas/IncidentAttachmentsResponseIncludedItem' type: array - meta: - $ref: '#/components/schemas/IncidentResponseMeta' required: - data type: object - IncidentTimelineCellCreateAttributes: - description: The timeline cell's attributes for a create request. + IncidentAttachmentsResponseIncludedItem: + description: An object related to an attachment that is included in the response. oneOf: - - $ref: '#/components/schemas/IncidentTimelineCellMarkdownCreateAttributes' - type: object - IncidentTimelineCellMarkdownContentType: - default: markdown - description: Type of the Markdown timeline cell. - enum: - - markdown - example: markdown - type: string - x-enum-varnames: - - MARKDOWN - IncidentTimelineCellMarkdownCreateAttributes: - description: Timeline cell data for Markdown timeline cells for a create request. - properties: - cell_type: - $ref: '#/components/schemas/IncidentTimelineCellMarkdownContentType' - content: - $ref: '#/components/schemas/IncidentTimelineCellMarkdownCreateAttributesContent' - important: - default: false - description: A flag indicating whether the timeline cell is important and - should be highlighted. - example: false - type: boolean - required: - - content - - cell_type - type: object - IncidentTimelineCellMarkdownCreateAttributesContent: - description: The Markdown timeline cell contents. - properties: - content: - description: The Markdown content of the cell. - example: An example timeline cell message. - nullable: false - type: string + - $ref: '#/components/schemas/User' type: object - IncidentType: - default: incidents - description: Incident resource type. - enum: - - incidents - example: incidents - type: string - x-enum-varnames: - - INCIDENTS - IncidentUpdateAttributes: - description: The incident's attributes for an update request. + IncidentCreateAttributes: + description: The incident's attributes for a create request. properties: - customer_impact_end: - description: Timestamp when customers were no longer impacted by the incident. - format: date-time - nullable: true - type: string - customer_impact_scope: - description: A summary of the impact customers experienced during the incident. - example: Example customer impact scope - type: string - customer_impact_start: - description: Timestamp when customers began being impacted by the incident. - format: date-time - nullable: true - type: string customer_impacted: description: A flag indicating whether the incident caused customer impact. example: false type: boolean - detected: - description: Timestamp when the incident was detected. - format: date-time - nullable: true - type: string fields: additionalProperties: $ref: '#/components/schemas/IncidentFieldAttributes' - description: A condensed view of the user-defined fields for which to update - selections. + description: A condensed view of the user-defined fields for which to create + initial selections. example: severity: type: dropdown value: SEV-5 type: object + initial_cells: + description: An array of initial timeline cells to be placed at the beginning + of the incident timeline. + items: + $ref: '#/components/schemas/IncidentTimelineCellCreateAttributes' + type: array notification_handles: description: Notification handles that will be notified of the incident - during update. + at creation. items: $ref: '#/components/schemas/IncidentNotificationHandle' type: array @@ -3440,6136 +3339,7150 @@ components: description: The title of the incident, which summarizes what happened. example: A test incident title type: string + required: + - title + - customer_impacted type: object - IncidentUpdateData: - description: Incident data for an update request. + IncidentCreateData: + description: Incident data for a create request. properties: attributes: - $ref: '#/components/schemas/IncidentUpdateAttributes' - id: - description: The team's ID. - example: 00000000-0000-0000-4567-000000000000 - type: string + $ref: '#/components/schemas/IncidentCreateAttributes' relationships: - $ref: '#/components/schemas/IncidentUpdateRelationships' + $ref: '#/components/schemas/IncidentCreateRelationships' type: $ref: '#/components/schemas/IncidentType' required: - - id - type + - attributes type: object - IncidentUpdateRelationships: - description: The incident's relationships for an update request. + IncidentCreateRelationships: + description: The relationships the incident will have with other resources once + created. properties: commander_user: $ref: '#/components/schemas/NullableRelationshipToUser' - integrations: - $ref: '#/components/schemas/RelationshipToIncidentIntegrationMetadatas' - postmortem: - $ref: '#/components/schemas/RelationshipToIncidentPostmortem' + required: + - commander_user type: object - IncidentUpdateRequest: - description: Update request for an incident. + IncidentCreateRequest: + description: Create request for an incident. properties: data: - $ref: '#/components/schemas/IncidentUpdateData' + $ref: '#/components/schemas/IncidentCreateData' required: - data type: object - IncidentsResponse: - description: Response with a list of incidents. - properties: - data: - description: An array of incidents. - example: - - attributes: - created: '2020-04-21T15:34:08.627205+00:00' - creation_idempotency_key: null - customer_impact_duration: 0 - customer_impact_end: null - customer_impact_scope: null - customer_impact_start: null - customer_impacted: false - detected: '2020-04-14T00:00:00+00:00' - modified: '2020-09-17T14:16:58.696424+00:00' - public_id: 1 - resolved: null - severity: SEV-1 - time_to_detect: 0 - time_to_internal_response: 0 - time_to_repair: 0 - time_to_resolve: 0 - title: Example Incident - id: 00000000-aaaa-0000-0000-000000000000 - relationships: - attachments: - data: - - id: 00000000-9999-0000-0000-000000000000 - type: incident_attachments - - id: 00000000-1234-0000-0000-000000000000 - type: incident_attachments - commander_user: - data: - id: 00000000-0000-0000-cccc-000000000000 - type: users - created_by_user: - data: - id: 00000000-0000-0000-cccc-000000000000 - type: users - integrations: - data: - - id: 00000000-0000-0000-4444-000000000000 - type: incident_integrations - - id: 00000000-0000-0000-5555-000000000000 - type: incident_integrations - last_modified_by_user: - data: - id: 00000000-0000-0000-cccc-000000000000 - type: users - type: incidents - - attributes: - created: '2020-04-21T15:34:08.627205+00:00' - creation_idempotency_key: null - customer_impact_duration: 0 - customer_impact_end: null - customer_impact_scope: null - customer_impact_start: null - customer_impacted: false - detected: '2020-04-14T00:00:00+00:00' - modified: '2020-09-17T14:16:58.696424+00:00' - public_id: 2 - resolved: null - severity: SEV-5 - time_to_detect: 0 - time_to_internal_response: 0 - time_to_repair: 0 - time_to_resolve: 0 - title: Example Incident 2 - id: 00000000-1111-0000-0000-000000000000 - relationships: - attachments: - data: - - id: 00000000-9999-0000-0000-000000000000 - type: incident_attachments - commander_user: - data: - id: 00000000-aaaa-0000-0000-000000000000 - type: users - created_by_user: - data: - id: 00000000-aaaa-0000-0000-000000000000 - type: users - integrations: - data: - - id: 00000000-0000-0000-0001-000000000000 - type: incident_integrations - - id: 00000000-0000-0000-0002-000000000000 - type: incident_integrations - last_modified_by_user: - data: - id: 00000000-aaaa-0000-0000-000000000000 - type: users - type: incidents - items: - $ref: '#/components/schemas/IncidentResponseData' - type: array - included: - description: Included related resources that the user requested. - items: - $ref: '#/components/schemas/IncidentResponseIncludedItem' - readOnly: true - type: array - meta: - $ref: '#/components/schemas/IncidentResponseMeta' + IncidentFieldAttributes: + description: Dynamic fields for which selections can be made, with field names + as keys. + oneOf: + - $ref: '#/components/schemas/IncidentFieldAttributesSingleValue' + - $ref: '#/components/schemas/IncidentFieldAttributesMultipleValue' required: - - data + - type type: object - IntakePayloadAccepted: - description: The payload accepted for intake. + IncidentFieldAttributesMultipleValue: + description: A field with potentially multiple values selected. properties: - errors: - description: A list of errors. + type: + $ref: '#/components/schemas/IncidentFieldAttributesValueType' + value: + description: The multiple values selected for this field. + example: + - '1.0' + - '1.1' items: - description: An empty error list. + description: A value which has been selected for the parent field. + example: '1.1' type: string + nullable: true type: array type: object - ListApplicationKeysResponse: - description: Response for a list of application keys. + IncidentFieldAttributesSingleValue: + description: A field with a single value selected. + properties: + type: + $ref: '#/components/schemas/IncidentFieldAttributesSingleValueType' + value: + description: The single value selected for this field. + example: SEV-1 + nullable: true + type: string + type: object + IncidentFieldAttributesSingleValueType: + default: dropdown + description: Type of the single value field definitions. + enum: + - dropdown + - textbox + example: dropdown + type: string + x-enum-varnames: + - DROPDOWN + - TEXTBOX + IncidentFieldAttributesValueType: + default: multiselect + description: Type of the multiple value field definitions. + enum: + - multiselect + - textarray + - metrictag + - autocomplete + example: multiselect + type: string + x-enum-varnames: + - MULTISELECT + - TEXTARRAY + - METRICTAG + - AUTOCOMPLETE + IncidentIntegrationMetadataType: + default: incident_integrations + description: Integration metadata resource type. + enum: + - incident_integrations + example: incident_integrations + type: string + x-enum-varnames: + - INCIDENT_INTEGRATIONS + IncidentNotificationHandle: + description: A notification handle that will be notified at incident creation. + properties: + display_name: + description: The name of the notified handle. + example: Jane Doe + type: string + handle: + description: The email address used for the notification. + example: '@test.user@test.com' + type: string + type: object + IncidentPostmortemType: + default: incident_postmortems + description: Incident postmortem resource type. + enum: + - incident_postmortems + example: incident_postmortems + type: string + x-enum-varnames: + - INCIDENT_POSTMORTEMS + IncidentRelatedObject: + description: Object related to an incident. + enum: + - users + - attachments + type: string + x-enum-varnames: + - USERS + - ATTACHMENTS + IncidentResponse: + description: Response with an incident. properties: data: - description: Array of application keys. - items: - $ref: '#/components/schemas/PartialApplicationKey' - type: array + $ref: '#/components/schemas/IncidentResponseData' included: - description: Array of objects related to the application key. + description: Included related resources that the user requested. items: - $ref: '#/components/schemas/ApplicationKeyResponseIncludedItem' + $ref: '#/components/schemas/IncidentResponseIncludedItem' + readOnly: true type: array + required: + - data type: object - Log: - description: Object description of a log after being processed and stored by - Datadog. + IncidentResponseAttributes: + description: The incident's attributes from a response. properties: - attributes: - $ref: '#/components/schemas/LogAttributes' - id: - description: Unique ID of the Log. - example: AAAAAWgN8Xwgr1vKDQAAAABBV2dOOFh3ZzZobm1mWXJFYTR0OA + created: + description: Timestamp when the incident was created. + format: date-time + readOnly: true type: string - type: - $ref: '#/components/schemas/LogType' - type: object - LogAttributes: - description: JSON object containing all log attributes and their associated - values. - properties: - attributes: - additionalProperties: {} - description: JSON object of attributes from your log. - example: - customAttribute: 123 - duration: 2345 - type: object - host: - description: Name of the machine from where the logs are being sent. - example: i-0123 - type: string - message: - description: 'The message [reserved attribute](https://docs.datadoghq.com/logs/log_collection/#reserved-attributes) - - of your log. By default, Datadog ingests the value of the message attribute - as the body of the log entry. + customer_impact_duration: + description: 'Length of the incident''s customer impact in seconds. - That value is then highlighted and displayed in the Logstream, where it - is indexed for full text search.' - example: Host connected to remote + Equals the difference between `customer_impact_start` and `customer_impact_end`.' + format: int64 + readOnly: true + type: integer + customer_impact_end: + description: Timestamp when customers were no longer impacted by the incident. + format: date-time + nullable: true type: string - service: - description: 'The name of the application or service generating the log - events. - - It is used to switch from Logs to APM, so make sure you define the same - - value when you use both products.' - example: agent + customer_impact_scope: + description: A summary of the impact customers experienced during the incident. + example: An example customer impact scope + nullable: true type: string - status: - description: Status of the message associated with your log. - example: INFO + customer_impact_start: + description: Timestamp when customers began being impacted by the incident. + format: date-time + nullable: true type: string - tags: - description: Array of tags associated with your log. - example: - - team:A - items: - description: Tag associated with your log. - type: string - type: array - timestamp: - description: Timestamp of your log. - example: '2019-01-02T09:42:36.320Z' + customer_impacted: + description: A flag indicating whether the incident caused customer impact. + example: false + type: boolean + detected: + description: Timestamp when the incident was detected. format: date-time + nullable: true type: string - type: object - LogType: - default: log - description: Type of the event. - enum: - - log - example: log - type: string - x-enum-varnames: - - LOG - LogsAggregateBucket: - description: A bucket values - properties: - by: + fields: additionalProperties: - description: The values for each group by - type: string - description: The key, value pairs for each group by + $ref: '#/components/schemas/IncidentFieldAttributes' + description: A condensed view of the user-defined fields attached to incidents. example: - '@state': success - '@version': abc - type: object - computes: - additionalProperties: - $ref: '#/components/schemas/LogsAggregateBucketValue' - description: A map of the metric name -> value for regular compute or list - of values for a timeseries + severity: + type: dropdown + value: SEV-5 type: object - type: object - LogsAggregateBucketValue: - description: A bucket value, can be either a timeseries or a single value - oneOf: - - $ref: '#/components/schemas/LogsAggregateBucketValueSingleString' - - $ref: '#/components/schemas/LogsAggregateBucketValueSingleNumber' - - $ref: '#/components/schemas/LogsAggregateBucketValueTimeseries' - LogsAggregateBucketValueSingleNumber: - description: A single number value - format: double - type: number - LogsAggregateBucketValueSingleString: - description: A single string value - type: string - LogsAggregateBucketValueTimeseries: - description: A timeseries array - items: - $ref: '#/components/schemas/LogsAggregateBucketValueTimeseriesPoint' - type: array - x-generate-alias-as-model: true - LogsAggregateBucketValueTimeseriesPoint: - description: A timeseries point - properties: - time: - description: The time value for this point - example: '2020-06-08T11:55:00Z' + modified: + description: Timestamp when the incident was last modified. + format: date-time + readOnly: true type: string - value: - description: The value for this point - example: 19 - format: double - type: number - type: object - LogsAggregateRequest: - description: The object sent with the request to retrieve a list of logs from - your organization. - properties: - compute: - description: The list of metrics or timeseries to compute for the retrieved - buckets. - items: - $ref: '#/components/schemas/LogsCompute' - type: array - filter: - $ref: '#/components/schemas/LogsQueryFilter' - group_by: - description: The rules for the group by + notification_handles: + description: Notification handles that will be notified of the incident + during update. items: - $ref: '#/components/schemas/LogsGroupBy' + $ref: '#/components/schemas/IncidentNotificationHandle' + nullable: true type: array - options: - $ref: '#/components/schemas/LogsQueryOptions' - page: - $ref: '#/components/schemas/LogsAggregateRequestPage' + public_id: + description: The monotonically increasing integer ID for the incident. + example: 1 + format: int64 + type: integer + resolved: + description: Timestamp when the incident's state was last changed from active + or stable to resolved or completed. + format: date-time + nullable: true + type: string + time_to_detect: + description: 'The amount of time in seconds to detect the incident. + + Equals the difference between `customer_impact_start` and `detected`.' + format: int64 + readOnly: true + type: integer + time_to_internal_response: + description: The amount of time in seconds to call incident after detection. + Equals the difference of `detected` and `created`. + format: int64 + readOnly: true + type: integer + time_to_repair: + description: The amount of time in seconds to resolve customer impact after + detecting the issue. Equals the difference between `customer_impact_end` + and `detected`. + format: int64 + readOnly: true + type: integer + time_to_resolve: + description: The amount of time in seconds to resolve the incident after + it was created. Equals the difference between `created` and `resolved`. + format: int64 + readOnly: true + type: integer + title: + description: The title of the incident, which summarizes what happened. + example: A test incident title + type: string + required: + - title type: object - LogsAggregateRequestPage: - description: Paging settings + IncidentResponseData: + description: Incident data from a response. properties: - cursor: - description: The returned paging point to use to get the next results - example: eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ== + attributes: + $ref: '#/components/schemas/IncidentResponseAttributes' + id: + description: The incident's ID. + example: 00000000-0000-0000-1234-000000000000 type: string + relationships: + $ref: '#/components/schemas/IncidentResponseRelationships' + type: + $ref: '#/components/schemas/IncidentType' + required: + - id + - type type: object - LogsAggregateResponse: - description: The response object for the logs aggregate API endpoint - properties: - data: - $ref: '#/components/schemas/LogsAggregateResponseData' - meta: - $ref: '#/components/schemas/LogsResponseMetadata' + IncidentResponseIncludedItem: + description: An object related to an incident that is included in the response. + oneOf: + - $ref: '#/components/schemas/User' + - $ref: '#/components/schemas/IncidentAttachmentData' type: object - LogsAggregateResponseData: - description: The query results + IncidentResponseMeta: + description: The metadata object containing pagination metadata. properties: - buckets: - description: The list of matching buckets, one item per bucket - items: - $ref: '#/components/schemas/LogsAggregateBucket' - type: array + pagination: + $ref: '#/components/schemas/IncidentResponseMetaPagination' + readOnly: true type: object - LogsAggregateResponseStatus: - description: The status of the response - enum: - - done - - timeout - example: done - type: string - x-enum-varnames: - - DONE - - TIMEOUT - LogsAggregateSort: - description: A sort rule - example: - aggregation: count - order: asc - properties: - aggregation: - $ref: '#/components/schemas/LogsAggregationFunction' - metric: - description: The metric to sort by (only used for `type=measure`) - example: '@duration' - type: string - order: - $ref: '#/components/schemas/LogsSortOrder' - type: - $ref: '#/components/schemas/LogsAggregateSortType' - type: object - LogsAggregateSortType: - default: alphabetical - description: The type of sorting algorithm - enum: - - alphabetical - - measure - type: string - x-enum-varnames: - - ALPHABETICAL - - MEASURE - LogsAggregationFunction: - description: An aggregation function - enum: - - count - - cardinality - - pc75 - - pc90 - - pc95 - - pc98 - - pc99 - - sum - - min - - max - - avg - - median - example: pc90 - type: string - x-enum-varnames: - - COUNT - - CARDINALITY - - PERCENTILE_75 - - PERCENTILE_90 - - PERCENTILE_95 - - PERCENTILE_98 - - PERCENTILE_99 - - SUM - - MIN - - MAX - - AVG - - MEDIAN - LogsArchive: - description: The logs archive. - properties: - data: - $ref: '#/components/schemas/LogsArchiveDefinition' - type: object - LogsArchiveAttributes: - description: The attributes associated with the archive. + IncidentResponseMetaPagination: + description: Pagination properties. properties: - destination: - $ref: '#/components/schemas/LogsArchiveDestination' - include_tags: - default: false - description: 'To store the tags in the archive, set the value "true". - - If it is set to "false", the tags will be deleted when the logs are sent - to the archive.' - example: false - type: boolean - name: - description: The archive name. - example: Nginx Archive - type: string - query: - description: The archive query/filter. Logs matching this query are included - in the archive. - example: source:nginx - type: string - rehydration_max_scan_size_in_gb: - description: Maximum scan size for rehydration from this archive. - example: 100 + next_offset: + description: The index of the first element in the next page of results. + Equal to page size added to the current offset. + example: 1000 + format: int64 + type: integer + offset: + description: The index of the first element in the results. + example: 10 + format: int64 + type: integer + size: + description: Maximum size of pages to return. + example: 1000 format: int64 - nullable: true type: integer - rehydration_tags: - description: An array of tags to add to rehydrated logs from an archive. - example: - - team:intake - - team:app - items: - description: A given tag in the `:` format. - type: string - type: array - state: - $ref: '#/components/schemas/LogsArchiveState' - required: - - name - - query - - destination type: object - LogsArchiveCreateRequest: - description: The logs archive. + IncidentResponseRelationships: + description: The incident's relationships from a response. properties: - data: - $ref: '#/components/schemas/LogsArchiveCreateRequestDefinition' + attachments: + $ref: '#/components/schemas/RelationshipToIncidentAttachment' + commander_user: + $ref: '#/components/schemas/NullableRelationshipToUser' + created_by_user: + $ref: '#/components/schemas/RelationshipToUser' + integrations: + $ref: '#/components/schemas/RelationshipToIncidentIntegrationMetadatas' + last_modified_by_user: + $ref: '#/components/schemas/RelationshipToUser' type: object - LogsArchiveCreateRequestAttributes: - description: The attributes associated with the archive. + IncidentServiceCreateAttributes: + description: The incident service's attributes for a create request. properties: - destination: - $ref: '#/components/schemas/LogsArchiveCreateRequestDestination' - include_tags: - default: false - description: 'To store the tags in the archive, set the value "true". - - If it is set to "false", the tags will be deleted when the logs are sent - to the archive.' - example: false - type: boolean name: - description: The archive name. - example: Nginx Archive - type: string - query: - description: The archive query/filter. Logs matching this query are included - in the archive. - example: source:nginx + description: Name of the incident service. + example: an example service name type: string - rehydration_max_scan_size_in_gb: - description: Maximum scan size for rehydration from this archive. - example: 100 - format: int64 - nullable: true - type: integer - rehydration_tags: - description: An array of tags to add to rehydrated logs from an archive. - example: - - team:intake - - team:app - items: - description: A given tag in the `:` format. - type: string - type: array required: - name - - query - - destination type: object - LogsArchiveCreateRequestDefinition: - description: The definition of an archive. + IncidentServiceCreateData: + description: Incident Service payload for create requests. properties: attributes: - $ref: '#/components/schemas/LogsArchiveCreateRequestAttributes' + $ref: '#/components/schemas/IncidentServiceCreateAttributes' + relationships: + $ref: '#/components/schemas/IncidentServiceRelationships' type: - default: archives - description: The type of the resource. The value should always be archives. - example: archives - type: string + $ref: '#/components/schemas/IncidentServiceType' required: - type type: object - LogsArchiveCreateRequestDestination: - description: An archive's destination. + IncidentServiceCreateRequest: + description: Create request with an incident service payload. + properties: + data: + $ref: '#/components/schemas/IncidentServiceCreateData' + required: + - data + type: object + IncidentServiceIncludedItems: + description: An object related to an incident service which is present in the + included payload. oneOf: - - $ref: '#/components/schemas/LogsArchiveDestinationAzure' - - $ref: '#/components/schemas/LogsArchiveDestinationGCS' - - $ref: '#/components/schemas/LogsArchiveDestinationS3' + - $ref: '#/components/schemas/User' + type: object + IncidentServiceRelationships: + description: The incident service's relationships. + properties: + created_by: + $ref: '#/components/schemas/RelationshipToUser' + last_modified_by: + $ref: '#/components/schemas/RelationshipToUser' + readOnly: true + type: object + IncidentServiceResponse: + description: Response with an incident service payload. + properties: + data: + $ref: '#/components/schemas/IncidentServiceResponseData' + included: + description: Included objects from relationships. + items: + $ref: '#/components/schemas/IncidentServiceIncludedItems' + readOnly: true + type: array required: - - type - - integration + - data type: object - LogsArchiveDefinition: - description: The definition of an archive. + IncidentServiceResponseAttributes: + description: The incident service's attributes from a response. properties: - attributes: - $ref: '#/components/schemas/LogsArchiveAttributes' - id: - description: The archive ID. - example: a2zcMylnM4OCHpYusxIi3g + created: + description: Timestamp of when the incident service was created. + format: date-time readOnly: true type: string - type: - default: archives - description: The type of the resource. The value should always be archives. - example: archives + modified: + description: Timestamp of when the incident service was modified. + format: date-time readOnly: true type: string - required: - - type + name: + description: Name of the incident service. + example: service name + type: string type: object - LogsArchiveDestination: - description: An archive's destination. - nullable: true - oneOf: - - $ref: '#/components/schemas/LogsArchiveDestinationAzure' - - $ref: '#/components/schemas/LogsArchiveDestinationGCS' - - $ref: '#/components/schemas/LogsArchiveDestinationS3' - required: - - type - - integration - type: object - LogsArchiveDestinationAzure: - description: The Azure archive destination. + IncidentServiceResponseData: + description: Incident Service data from responses. properties: - container: - description: The container where the archive will be stored. - example: container-name - type: string - integration: - $ref: '#/components/schemas/LogsArchiveIntegrationAzure' - path: - description: The archive path. - type: string - region: - description: The region where the archive will be stored. - type: string - storage_account: - description: The associated storage account. - example: account-name + attributes: + $ref: '#/components/schemas/IncidentServiceResponseAttributes' + id: + description: The incident service's ID. + example: 00000000-0000-0000-0000-000000000000 type: string + relationships: + $ref: '#/components/schemas/IncidentServiceRelationships' type: - $ref: '#/components/schemas/LogsArchiveDestinationAzureType' + $ref: '#/components/schemas/IncidentServiceType' required: - - storage_account - - container - - integration + - id - type type: object - LogsArchiveDestinationAzureType: - default: azure - description: Type of the Azure archive destination. + IncidentServiceType: + default: services + description: Incident service resource type. enum: - - azure - example: azure + - services + example: services type: string x-enum-varnames: - - AZURE - LogsArchiveDestinationGCS: - description: The GCS archive destination. + - SERVICES + IncidentServiceUpdateAttributes: + description: The incident service's attributes for an update request. properties: - bucket: - description: The bucket where the archive will be stored. - example: bucket-name - type: string - integration: - $ref: '#/components/schemas/LogsArchiveIntegrationGCS' - path: - description: The archive path. + name: + description: Name of the incident service. + example: an example service name type: string - type: - $ref: '#/components/schemas/LogsArchiveDestinationGCSType' required: - - bucket - - integration - - type + - name type: object - LogsArchiveDestinationGCSType: - default: gcs - description: Type of the GCS archive destination. - enum: - - gcs - example: gcs - type: string - x-enum-varnames: - - GCS - LogsArchiveDestinationS3: - description: The S3 archive destination. + IncidentServiceUpdateData: + description: Incident Service payload for update requests. properties: - bucket: - description: The bucket where the archive will be stored. - example: bucket-name - type: string - integration: - $ref: '#/components/schemas/LogsArchiveIntegrationS3' - path: - description: The archive path. + attributes: + $ref: '#/components/schemas/IncidentServiceUpdateAttributes' + id: + description: The incident service's ID. + example: 00000000-0000-0000-0000-000000000000 type: string + relationships: + $ref: '#/components/schemas/IncidentServiceRelationships' type: - $ref: '#/components/schemas/LogsArchiveDestinationS3Type' + $ref: '#/components/schemas/IncidentServiceType' required: - - bucket - - integration - type type: object - LogsArchiveDestinationS3Type: - default: s3 - description: Type of the S3 archive destination. - enum: - - s3 - example: s3 - type: string - x-enum-varnames: - - S3 - LogsArchiveIntegrationAzure: - description: The Azure archive's integration destination. - properties: - client_id: - description: A client ID. - example: aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa - type: string - tenant_id: - description: A tenant ID. - example: aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa - type: string - required: - - tenant_id - - client_id - type: object - LogsArchiveIntegrationGCS: - description: The GCS archive's integration destination. - properties: - client_email: - description: A client email. - example: youremail@example.com - type: string - project_id: - description: A project ID. - example: project-id - type: string - required: - - project_id - - client_email - type: object - LogsArchiveIntegrationS3: - description: The S3 Archive's integration destination. + IncidentServiceUpdateRequest: + description: Update request with an incident service payload. properties: - account_id: - description: The account ID for the integration. - example: '123456789012' - type: string - role_name: - description: The path of the integration. - example: role-name - type: string + data: + $ref: '#/components/schemas/IncidentServiceUpdateData' required: - - role_name - - account_id + - data type: object - LogsArchiveOrder: - description: A ordered list of archive IDs. + IncidentServicesResponse: + description: Response with a list of incident service payloads. properties: data: - $ref: '#/components/schemas/LogsArchiveOrderDefinition' - type: object - LogsArchiveOrderAttributes: - description: The attributes associated with the archive order. - properties: - archive_ids: - description: 'An ordered array of `` strings, the order of archive - IDs in the array - - define the overall archives order for Datadog.' + description: An array of incident services. example: - - a2zcMylnM4OCHpYusxIi1g - - a2zcMylnM4OCHpYusxIi2g - - a2zcMylnM4OCHpYusxIi3g + - id: 00000000-0000-0000-0000-000000000000 + type: services items: - description: A given archive ID. - type: string + $ref: '#/components/schemas/IncidentServiceResponseData' + type: array + included: + description: Included related resources which the user requested. + items: + $ref: '#/components/schemas/IncidentServiceIncludedItems' + readOnly: true type: array + meta: + $ref: '#/components/schemas/IncidentResponseMeta' required: - - archive_ids + - data type: object - LogsArchiveOrderDefinition: - description: The definition of an archive order. + IncidentTeamCreateAttributes: + description: The incident team's attributes for a create request. + properties: + name: + description: Name of the incident team. + example: team name + type: string + required: + - name + type: object + IncidentTeamCreateData: + description: Incident Team data for a create request. properties: attributes: - $ref: '#/components/schemas/LogsArchiveOrderAttributes' + $ref: '#/components/schemas/IncidentTeamCreateAttributes' + relationships: + $ref: '#/components/schemas/IncidentTeamRelationships' type: - $ref: '#/components/schemas/LogsArchiveOrderDefinitionType' + $ref: '#/components/schemas/IncidentTeamType' required: - type - - attributes type: object - LogsArchiveOrderDefinitionType: - default: archive_order - description: Type of the archive order definition. - enum: - - archive_order - example: archive_order - type: string - x-enum-varnames: - - ARCHIVE_ORDER - LogsArchiveState: - description: The state of the archive. - enum: - - UNKNOWN - - WORKING - - FAILING - - WORKING_AUTH_LEGACY - example: WORKING - type: string - x-enum-varnames: - - UNKNOWN - - WORKING - - FAILING - - WORKING_AUTH_LEGACY - LogsArchives: - description: The available archives. + IncidentTeamCreateRequest: + description: Create request with an incident team payload. properties: data: - description: A list of archives. - items: - $ref: '#/components/schemas/LogsArchiveDefinition' - type: array + $ref: '#/components/schemas/IncidentTeamCreateData' + required: + - data type: object - LogsCompute: - description: A compute rule to compute metrics or timeseries + IncidentTeamIncludedItems: + description: An object related to an incident team which is present in the included + payload. + oneOf: + - $ref: '#/components/schemas/User' + type: object + IncidentTeamRelationships: + description: The incident team's relationships. properties: - aggregation: - $ref: '#/components/schemas/LogsAggregationFunction' - interval: - description: 'The time buckets'' size (only used for type=timeseries) - - Defaults to a resolution of 150 points' - example: 5m - type: string - metric: - description: The metric to use - example: '@duration' - type: string - type: - $ref: '#/components/schemas/LogsComputeType' - required: - - aggregation - type: object - LogsComputeType: - default: total - description: The type of compute - enum: - - timeseries - - total - type: string - x-enum-varnames: - - TIMESERIES - - TOTAL - LogsGroupBy: - description: A group by rule - properties: - facet: - description: The name of the facet to use (required) - example: host - type: string - histogram: - $ref: '#/components/schemas/LogsGroupByHistogram' - limit: - default: 10 - description: The maximum buckets to return for this group by - format: int64 - type: integer - missing: - $ref: '#/components/schemas/LogsGroupByMissing' - sort: - $ref: '#/components/schemas/LogsAggregateSort' - total: - $ref: '#/components/schemas/LogsGroupByTotal' - required: - - facet - type: object - LogsGroupByHistogram: - description: 'Used to perform a histogram computation (only for measure facets). - - Note: At most 100 buckets are allowed, the number of buckets is (max - min)/interval.' - properties: - interval: - description: The bin size of the histogram buckets - example: 10 - format: double - type: number - max: - description: 'The maximum value for the measure used in the histogram - - (values greater than this one are filtered out)' - example: 100 - format: double - type: number - min: - description: 'The minimum value for the measure used in the histogram - - (values smaller than this one are filtered out)' - example: 50 - format: double - type: number - required: - - interval - - min - - max - type: object - LogsGroupByMissing: - description: The value to use for logs that don't have the facet used to group - by - oneOf: - - $ref: '#/components/schemas/LogsGroupByMissingString' - - $ref: '#/components/schemas/LogsGroupByMissingNumber' - LogsGroupByMissingNumber: - description: The missing value to use if there is a number valued facet. - format: double - type: number - LogsGroupByMissingString: - description: The missing value to use if there is string valued facet. - type: string - LogsGroupByTotal: - default: false - description: A resulting object to put the given computes in over all the matching - records. - oneOf: - - $ref: '#/components/schemas/LogsGroupByTotalBoolean' - - $ref: '#/components/schemas/LogsGroupByTotalString' - - $ref: '#/components/schemas/LogsGroupByTotalNumber' - LogsGroupByTotalBoolean: - description: If set to true, creates an additional bucket labeled "$facet_total" - type: boolean - LogsGroupByTotalNumber: - description: A number to use as the key value for the total bucket - format: double - type: number - LogsGroupByTotalString: - description: A string to use as the key value for the total bucket - type: string - LogsListRequest: - description: The request for a logs list. - properties: - filter: - $ref: '#/components/schemas/LogsQueryFilter' - options: - $ref: '#/components/schemas/LogsQueryOptions' - page: - $ref: '#/components/schemas/LogsListRequestPage' - sort: - $ref: '#/components/schemas/LogsSort' - type: object - LogsListRequestPage: - description: Paging attributes for listing logs. - properties: - cursor: - description: List following results with a cursor provided in the previous - query. - example: eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ== - type: string - limit: - default: 10 - description: Maximum number of logs in the response. - example: 25 - format: int32 - maximum: 1000 - type: integer + created_by: + $ref: '#/components/schemas/RelationshipToUser' + last_modified_by: + $ref: '#/components/schemas/RelationshipToUser' + readOnly: true type: object - LogsListResponse: - description: Response object with all logs matching the request and pagination - information. + IncidentTeamResponse: + description: Response with an incident team payload. properties: data: - description: Array of logs matching the request. + $ref: '#/components/schemas/IncidentTeamResponseData' + included: + description: Included objects from relationships. items: - $ref: '#/components/schemas/Log' + $ref: '#/components/schemas/IncidentTeamIncludedItems' + readOnly: true type: array - links: - $ref: '#/components/schemas/LogsListResponseLinks' - meta: - $ref: '#/components/schemas/LogsResponseMetadata' + required: + - data type: object - LogsListResponseLinks: - description: Links attributes. + IncidentTeamResponseAttributes: + description: The incident team's attributes from a response. properties: - next: - description: 'Link for the next set of results. Note that the request can - also be made using the - - POST endpoint.' - example: https://app.datadoghq.com/api/v2/logs/event?filter[query]=foo&page[cursor]=eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ== + created: + description: Timestamp of when the incident team was created. + format: date-time + readOnly: true + type: string + modified: + description: Timestamp of when the incident team was modified. + format: date-time + readOnly: true + type: string + name: + description: Name of the incident team. + example: team name type: string type: object - LogsMetricCompute: - description: The compute rule to compute the log-based metric. + IncidentTeamResponseData: + description: Incident Team data from a response. properties: - aggregation_type: - $ref: '#/components/schemas/LogsMetricComputeAggregationType' - path: - description: The path to the value the log-based metric will aggregate on - (only used if the aggregation type is a "distribution"). - example: '@duration' + attributes: + $ref: '#/components/schemas/IncidentTeamResponseAttributes' + id: + description: The incident team's ID. + example: 00000000-7ea3-0000-000a-000000000000 type: string - required: - - aggregation_type + relationships: + $ref: '#/components/schemas/IncidentTeamRelationships' + type: + $ref: '#/components/schemas/IncidentTeamType' type: object - LogsMetricComputeAggregationType: - description: The type of aggregation to use. + IncidentTeamType: + default: teams + description: Incident Team resource type. enum: - - count - - distribution - example: distribution + - teams + example: teams type: string x-enum-varnames: - - COUNT - - DISTRIBUTION - LogsMetricCreateAttributes: - description: The object describing the Datadog log-based metric to create. + - TEAMS + IncidentTeamUpdateAttributes: + description: The incident team's attributes for an update request. properties: - compute: - $ref: '#/components/schemas/LogsMetricCompute' - filter: - $ref: '#/components/schemas/LogsMetricFilter' - group_by: - description: The rules for the group by. - items: - $ref: '#/components/schemas/LogsMetricGroupBy' - type: array + name: + description: Name of the incident team. + example: team name + type: string required: - - compute + - name type: object - LogsMetricCreateData: - description: The new log-based metric properties. + IncidentTeamUpdateData: + description: Incident Team data for an update request. properties: attributes: - $ref: '#/components/schemas/LogsMetricCreateAttributes' + $ref: '#/components/schemas/IncidentTeamUpdateAttributes' id: - $ref: '#/components/schemas/LogsMetricID' + description: The incident team's ID. + example: 00000000-7ea3-0000-0001-000000000000 + type: string + relationships: + $ref: '#/components/schemas/IncidentTeamRelationships' type: - $ref: '#/components/schemas/LogsMetricType' + $ref: '#/components/schemas/IncidentTeamType' required: - - id - type - - attributes type: object - LogsMetricCreateRequest: - description: The new log-based metric body. + IncidentTeamUpdateRequest: + description: Update request with an incident team payload. properties: data: - $ref: '#/components/schemas/LogsMetricCreateData' + $ref: '#/components/schemas/IncidentTeamUpdateData' required: - data type: object - LogsMetricFilter: - description: The log-based metric filter. Logs matching this filter will be - aggregated in this metric. - properties: - query: - default: '*' - description: The search query - following the log search syntax. - example: service:web* AND @http.status_code:[200 TO 299] - type: string - type: object - LogsMetricGroupBy: - description: A group by rule. - properties: - path: - description: The path to the value the log-based metric will be aggregated - over. - example: '@http.status_code' - type: string - tag_name: - description: Eventual name of the tag that gets created. By default, the - path attribute is used as the tag name. - example: status_code - type: string - required: - - path - type: object - LogsMetricID: - description: The name of the log-based metric. - example: logs.page.load.count - type: string - LogsMetricResponse: - description: The log-based metric object. + IncidentTeamsResponse: + description: Response with a list of incident team payloads. properties: data: - $ref: '#/components/schemas/LogsMetricResponseData' - type: object - LogsMetricResponseAttributes: - description: The object describing a Datadog log-based metric. - properties: - compute: - $ref: '#/components/schemas/LogsMetricResponseCompute' - filter: - $ref: '#/components/schemas/LogsMetricResponseFilter' - group_by: - description: The rules for the group by. + description: An array of incident teams. + example: + - attributes: + name: team name + id: 00000000-7ea3-0000-0000-000000000000 + type: teams items: - $ref: '#/components/schemas/LogsMetricResponseGroupBy' + $ref: '#/components/schemas/IncidentTeamResponseData' + type: array + included: + description: Included related resources which the user requested. + items: + $ref: '#/components/schemas/IncidentTeamIncludedItems' + readOnly: true type: array + meta: + $ref: '#/components/schemas/IncidentResponseMeta' + required: + - data type: object - LogsMetricResponseCompute: - description: The compute rule to compute the log-based metric. - properties: - aggregation_type: - $ref: '#/components/schemas/LogsMetricResponseComputeAggregationType' - path: - description: The path to the value the log-based metric will aggregate on - (only used if the aggregation type is a "distribution"). - example: '@duration' - type: string + IncidentTimelineCellCreateAttributes: + description: The timeline cell's attributes for a create request. + oneOf: + - $ref: '#/components/schemas/IncidentTimelineCellMarkdownCreateAttributes' type: object - LogsMetricResponseComputeAggregationType: - description: The type of aggregation to use. + IncidentTimelineCellMarkdownContentType: + default: markdown + description: Type of the Markdown timeline cell. enum: - - count - - distribution - example: distribution + - markdown + example: markdown type: string x-enum-varnames: - - COUNT - - DISTRIBUTION - LogsMetricResponseData: - description: The log-based metric properties. - properties: - attributes: - $ref: '#/components/schemas/LogsMetricResponseAttributes' - id: - $ref: '#/components/schemas/LogsMetricID' - type: - $ref: '#/components/schemas/LogsMetricType' - type: object - LogsMetricResponseFilter: - description: The log-based metric filter. Logs matching this filter will be - aggregated in this metric. + - MARKDOWN + IncidentTimelineCellMarkdownCreateAttributes: + description: Timeline cell data for Markdown timeline cells for a create request. properties: - query: - description: The search query - following the log search syntax. - example: service:web* AND @http.status_code:[200 TO 299] - type: string + cell_type: + $ref: '#/components/schemas/IncidentTimelineCellMarkdownContentType' + content: + $ref: '#/components/schemas/IncidentTimelineCellMarkdownCreateAttributesContent' + important: + default: false + description: A flag indicating whether the timeline cell is important and + should be highlighted. + example: false + type: boolean + required: + - content + - cell_type type: object - LogsMetricResponseGroupBy: - description: A group by rule. + IncidentTimelineCellMarkdownCreateAttributesContent: + description: The Markdown timeline cell contents. properties: - path: - description: The path to the value the log-based metric will be aggregated - over. - example: '@http.status_code' - type: string - tag_name: - description: Eventual name of the tag that gets created. By default, the - path attribute is used as the tag name. - example: status_code + content: + description: The Markdown content of the cell. + example: An example timeline cell message. + nullable: false type: string type: object - LogsMetricType: - default: logs_metrics - description: The type of the resource. The value should always be logs_metrics. + IncidentType: + default: incidents + description: Incident resource type. enum: - - logs_metrics - example: logs_metrics + - incidents + example: incidents type: string x-enum-varnames: - - LOGS_METRICS - LogsMetricUpdateAttributes: - description: The log-based metric properties that will be updated. + - INCIDENTS + IncidentUpdateAttributes: + description: The incident's attributes for an update request. properties: - filter: - $ref: '#/components/schemas/LogsMetricFilter' - group_by: - description: The rules for the group by. + customer_impact_end: + description: Timestamp when customers were no longer impacted by the incident. + format: date-time + nullable: true + type: string + customer_impact_scope: + description: A summary of the impact customers experienced during the incident. + example: Example customer impact scope + type: string + customer_impact_start: + description: Timestamp when customers began being impacted by the incident. + format: date-time + nullable: true + type: string + customer_impacted: + description: A flag indicating whether the incident caused customer impact. + example: false + type: boolean + detected: + description: Timestamp when the incident was detected. + format: date-time + nullable: true + type: string + fields: + additionalProperties: + $ref: '#/components/schemas/IncidentFieldAttributes' + description: A condensed view of the user-defined fields for which to update + selections. + example: + severity: + type: dropdown + value: SEV-5 + type: object + notification_handles: + description: Notification handles that will be notified of the incident + during update. items: - $ref: '#/components/schemas/LogsMetricGroupBy' + $ref: '#/components/schemas/IncidentNotificationHandle' type: array + title: + description: The title of the incident, which summarizes what happened. + example: A test incident title + type: string type: object - LogsMetricUpdateData: - description: The new log-based metric properties. + IncidentUpdateData: + description: Incident data for an update request. properties: attributes: - $ref: '#/components/schemas/LogsMetricUpdateAttributes' + $ref: '#/components/schemas/IncidentUpdateAttributes' + id: + description: The team's ID. + example: 00000000-0000-0000-4567-000000000000 + type: string + relationships: + $ref: '#/components/schemas/IncidentUpdateRelationships' type: - $ref: '#/components/schemas/LogsMetricType' + $ref: '#/components/schemas/IncidentType' required: + - id - type - - attributes type: object - LogsMetricUpdateRequest: - description: The new log-based metric body. + IncidentUpdateRelationships: + description: The incident's relationships for an update request. + properties: + commander_user: + $ref: '#/components/schemas/NullableRelationshipToUser' + integrations: + $ref: '#/components/schemas/RelationshipToIncidentIntegrationMetadatas' + postmortem: + $ref: '#/components/schemas/RelationshipToIncidentPostmortem' + type: object + IncidentUpdateRequest: + description: Update request for an incident. properties: data: - $ref: '#/components/schemas/LogsMetricUpdateData' + $ref: '#/components/schemas/IncidentUpdateData' required: - data type: object - LogsMetricsResponse: - description: All the available log-based metric objects. + IncidentsResponse: + description: Response with a list of incidents. properties: data: - description: A list of log-based metric objects. - items: - $ref: '#/components/schemas/LogsMetricResponseData' - type: array - type: object - LogsQueryFilter: - description: The search and filter query settings - properties: - from: - default: now-15m - description: The minimum time for the requested logs, supports date math - and regular timestamps (milliseconds). - example: now-15m - type: string - indexes: - default: - - '*' - description: For customers with multiple indexes, the indexes to search. - Defaults to ['*'] which means all indexes. + description: An array of incidents. example: - - main - - web + - attributes: + created: '2020-04-21T15:34:08.627205+00:00' + creation_idempotency_key: null + customer_impact_duration: 0 + customer_impact_end: null + customer_impact_scope: null + customer_impact_start: null + customer_impacted: false + detected: '2020-04-14T00:00:00+00:00' + modified: '2020-09-17T14:16:58.696424+00:00' + public_id: 1 + resolved: null + severity: SEV-1 + time_to_detect: 0 + time_to_internal_response: 0 + time_to_repair: 0 + time_to_resolve: 0 + title: Example Incident + id: 00000000-aaaa-0000-0000-000000000000 + relationships: + attachments: + data: + - id: 00000000-9999-0000-0000-000000000000 + type: incident_attachments + - id: 00000000-1234-0000-0000-000000000000 + type: incident_attachments + commander_user: + data: + id: 00000000-0000-0000-cccc-000000000000 + type: users + created_by_user: + data: + id: 00000000-0000-0000-cccc-000000000000 + type: users + integrations: + data: + - id: 00000000-0000-0000-4444-000000000000 + type: incident_integrations + - id: 00000000-0000-0000-5555-000000000000 + type: incident_integrations + last_modified_by_user: + data: + id: 00000000-0000-0000-cccc-000000000000 + type: users + type: incidents + - attributes: + created: '2020-04-21T15:34:08.627205+00:00' + creation_idempotency_key: null + customer_impact_duration: 0 + customer_impact_end: null + customer_impact_scope: null + customer_impact_start: null + customer_impacted: false + detected: '2020-04-14T00:00:00+00:00' + modified: '2020-09-17T14:16:58.696424+00:00' + public_id: 2 + resolved: null + severity: SEV-5 + time_to_detect: 0 + time_to_internal_response: 0 + time_to_repair: 0 + time_to_resolve: 0 + title: Example Incident 2 + id: 00000000-1111-0000-0000-000000000000 + relationships: + attachments: + data: + - id: 00000000-9999-0000-0000-000000000000 + type: incident_attachments + commander_user: + data: + id: 00000000-aaaa-0000-0000-000000000000 + type: users + created_by_user: + data: + id: 00000000-aaaa-0000-0000-000000000000 + type: users + integrations: + data: + - id: 00000000-0000-0000-0001-000000000000 + type: incident_integrations + - id: 00000000-0000-0000-0002-000000000000 + type: incident_integrations + last_modified_by_user: + data: + id: 00000000-aaaa-0000-0000-000000000000 + type: users + type: incidents items: - description: The name of a log index. + $ref: '#/components/schemas/IncidentResponseData' + type: array + included: + description: Included related resources that the user requested. + items: + $ref: '#/components/schemas/IncidentResponseIncludedItem' + readOnly: true + type: array + meta: + $ref: '#/components/schemas/IncidentResponseMeta' + required: + - data + type: object + IntakePayloadAccepted: + description: The payload accepted for intake. + properties: + errors: + description: A list of errors. + items: + description: An empty error list. type: string type: array - query: - default: '*' - description: The search query - following the log search syntax. - example: service:web* AND @http.status_code:[200 TO 299] - type: string - to: - default: now - description: The maximum time for the requested logs, supports date math - and regular timestamps (milliseconds). - example: now - type: string type: object - LogsQueryOptions: - description: 'Global query options that are used during the query. - - Note: You should only supply timezone or time offset but not both otherwise - the query will fail.' + ListApplicationKeysResponse: + description: Response for a list of application keys. properties: - timeOffset: - description: The time offset (in seconds) to apply to the query. - format: int64 - type: integer - timezone: - default: UTC - description: 'The timezone can be specified both as an offset, for example: - "UTC+03:00".' - example: GMT + data: + description: Array of application keys. + items: + $ref: '#/components/schemas/PartialApplicationKey' + type: array + included: + description: Array of objects related to the application key. + items: + $ref: '#/components/schemas/ApplicationKeyResponseIncludedItem' + type: array + type: object + Log: + description: Object description of a log after being processed and stored by + Datadog. + properties: + attributes: + $ref: '#/components/schemas/LogAttributes' + id: + description: Unique ID of the Log. + example: AAAAAWgN8Xwgr1vKDQAAAABBV2dOOFh3ZzZobm1mWXJFYTR0OA type: string + type: + $ref: '#/components/schemas/LogType' type: object - LogsResponseMetadata: - description: The metadata associated with a request + LogAttributes: + description: JSON object containing all log attributes and their associated + values. properties: - elapsed: - description: The time elapsed in milliseconds - example: 132 - format: int64 - type: integer - page: - $ref: '#/components/schemas/LogsResponseMetadataPage' - request_id: - description: The identifier of the request - example: MWlFUjVaWGZTTTZPYzM0VXp1OXU2d3xLSVpEMjZKQ0VKUTI0dEYtM3RSOFVR + attributes: + additionalProperties: {} + description: JSON object of attributes from your log. + example: + customAttribute: 123 + duration: 2345 + type: object + host: + description: Name of the machine from where the logs are being sent. + example: i-0123 type: string - status: - $ref: '#/components/schemas/LogsAggregateResponseStatus' - warnings: - description: 'A list of warnings (non fatal errors) encountered, partial - results might be returned if + message: + description: 'The message [reserved attribute](https://docs.datadoghq.com/logs/log_collection/#reserved-attributes) - warnings are present in the response.' + of your log. By default, Datadog ingests the value of the message attribute + as the body of the log entry. + + That value is then highlighted and displayed in the Logstream, where it + is indexed for full text search.' + example: Host connected to remote + type: string + service: + description: 'The name of the application or service generating the log + events. + + It is used to switch from Logs to APM, so make sure you define the same + + value when you use both products.' + example: agent + type: string + status: + description: Status of the message associated with your log. + example: INFO + type: string + tags: + description: Array of tags associated with your log. + example: + - team:A items: - $ref: '#/components/schemas/LogsWarning' + description: Tag associated with your log. + type: string type: array - type: object - LogsResponseMetadataPage: - description: Paging attributes. - properties: - after: - description: 'The cursor to use to get the next results, if any. To make - the next request, use the same. - - parameters with the addition of the `page[cursor]`.' - example: eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ== + timestamp: + description: Timestamp of your log. + example: '2019-01-02T09:42:36.320Z' + format: date-time type: string type: object - LogsSort: - description: Sort parameters when querying logs. - enum: - - timestamp - - -timestamp - type: string - x-enum-varnames: - - TIMESTAMP_ASCENDING - - TIMESTAMP_DESCENDING - LogsSortOrder: - description: The order to use, ascending or descending + LogType: + default: log + description: Type of the event. enum: - - asc - - desc - example: asc + - log + example: log type: string x-enum-varnames: - - ASCENDING - - DESCENDING - LogsWarning: - description: A warning message indicating something that went wrong with the - query - properties: - code: - description: A unique code for this type of warning - example: unknown_index - type: string - detail: - description: A detailed explanation of this specific warning - example: 'indexes: foo, bar' - type: string - title: - description: A short human-readable summary of the warning - example: One or several indexes are missing or invalid, results hold data - from the other indexes - type: string - type: object - Metric: - description: Object for a single metric tag configuration. - example: - id: metric.foo.bar - type: metrics + - LOG + LogsAggregateBucket: + description: A bucket values properties: - id: - $ref: '#/components/schemas/MetricName' - type: - $ref: '#/components/schemas/MetricType' + by: + additionalProperties: + description: The values for each group by + type: string + description: The key, value pairs for each group by + example: + '@state': success + '@version': abc + type: object + computes: + additionalProperties: + $ref: '#/components/schemas/LogsAggregateBucketValue' + description: A map of the metric name -> value for regular compute or list + of values for a timeseries + type: object type: object - MetricActiveConfigurationType: - default: actively_queried_configurations - description: The metric actively queried configuration resource type. - enum: - - actively_queried_configurations - example: actively_queried_configurations + LogsAggregateBucketValue: + description: A bucket value, can be either a timeseries or a single value + oneOf: + - $ref: '#/components/schemas/LogsAggregateBucketValueSingleString' + - $ref: '#/components/schemas/LogsAggregateBucketValueSingleNumber' + - $ref: '#/components/schemas/LogsAggregateBucketValueTimeseries' + LogsAggregateBucketValueSingleNumber: + description: A single number value + format: double + type: number + LogsAggregateBucketValueSingleString: + description: A single string value type: string - x-enum-varnames: - - ACTIVELY_QUERIED_CONFIGURATIONS - MetricAllTags: - description: Object for a single metric's indexed tags. + LogsAggregateBucketValueTimeseries: + description: A timeseries array + items: + $ref: '#/components/schemas/LogsAggregateBucketValueTimeseriesPoint' + type: array + x-generate-alias-as-model: true + LogsAggregateBucketValueTimeseriesPoint: + description: A timeseries point properties: - attributes: - $ref: '#/components/schemas/MetricAllTagsAttributes' - id: - $ref: '#/components/schemas/MetricName' - type: - $ref: '#/components/schemas/MetricType' + time: + description: The time value for this point + example: '2020-06-08T11:55:00Z' + type: string + value: + description: The value for this point + example: 19 + format: double + type: number type: object - MetricAllTagsAttributes: - description: Object containing the definition of a metric's tags. + LogsAggregateRequest: + description: The object sent with the request to retrieve a list of logs from + your organization. properties: - tags: - description: List of indexed tag value pairs. - example: - - sport:golf - - sport:football - - animal:dog + compute: + description: The list of metrics or timeseries to compute for the retrieved + buckets. items: - description: Tag key-value pairs. - type: string + $ref: '#/components/schemas/LogsCompute' + type: array + filter: + $ref: '#/components/schemas/LogsQueryFilter' + group_by: + description: The rules for the group by + items: + $ref: '#/components/schemas/LogsGroupBy' type: array + options: + $ref: '#/components/schemas/LogsQueryOptions' + page: + $ref: '#/components/schemas/LogsAggregateRequestPage' type: object - MetricAllTagsResponse: - description: Response object that includes a single metric's indexed tags. + LogsAggregateRequestPage: + description: Paging settings + properties: + cursor: + description: The returned paging point to use to get the next results + example: eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ== + type: string + type: object + LogsAggregateResponse: + description: The response object for the logs aggregate API endpoint properties: data: - $ref: '#/components/schemas/MetricAllTags' - readOnly: true + $ref: '#/components/schemas/LogsAggregateResponseData' + meta: + $ref: '#/components/schemas/LogsResponseMetadata' type: object - MetricBulkConfigureTagsType: - default: metric_bulk_configure_tags - description: The metric bulk configure tags resource. + LogsAggregateResponseData: + description: The query results + properties: + buckets: + description: The list of matching buckets, one item per bucket + items: + $ref: '#/components/schemas/LogsAggregateBucket' + type: array + type: object + LogsAggregateResponseStatus: + description: The status of the response enum: - - metric_bulk_configure_tags - example: metric_bulk_configure_tags + - done + - timeout + example: done type: string x-enum-varnames: - - BULK_MANAGE_TAGS - MetricBulkTagConfigCreate: - description: Request object to bulk configure tags for metrics matching the - given prefix. + - DONE + - TIMEOUT + LogsAggregateSort: + description: A sort rule + example: + aggregation: count + order: asc properties: - attributes: - $ref: '#/components/schemas/MetricBulkTagConfigCreateAttributes' - id: - $ref: '#/components/schemas/MetricBulkTagConfigNamePrefix' + aggregation: + $ref: '#/components/schemas/LogsAggregationFunction' + metric: + description: The metric to sort by (only used for `type=measure`) + example: '@duration' + type: string + order: + $ref: '#/components/schemas/LogsSortOrder' type: - $ref: '#/components/schemas/MetricBulkConfigureTagsType' - required: - - id - - type - type: object - MetricBulkTagConfigCreateAttributes: - description: Optional parameters for bulk creating metric tag configurations. - properties: - emails: - $ref: '#/components/schemas/MetricBulkTagConfigEmailList' - tags: - $ref: '#/components/schemas/MetricBulkTagConfigTagNameList' + $ref: '#/components/schemas/LogsAggregateSortType' type: object - MetricBulkTagConfigCreateRequest: - description: Wrapper object for a single bulk tag configuration request. + LogsAggregateSortType: + default: alphabetical + description: The type of sorting algorithm + enum: + - alphabetical + - measure + type: string + x-enum-varnames: + - ALPHABETICAL + - MEASURE + LogsAggregationFunction: + description: An aggregation function + enum: + - count + - cardinality + - pc75 + - pc90 + - pc95 + - pc98 + - pc99 + - sum + - min + - max + - avg + - median + example: pc90 + type: string + x-enum-varnames: + - COUNT + - CARDINALITY + - PERCENTILE_75 + - PERCENTILE_90 + - PERCENTILE_95 + - PERCENTILE_98 + - PERCENTILE_99 + - SUM + - MIN + - MAX + - AVG + - MEDIAN + LogsArchive: + description: The logs archive. properties: data: - $ref: '#/components/schemas/MetricBulkTagConfigCreate' - required: - - data + $ref: '#/components/schemas/LogsArchiveDefinition' type: object - MetricBulkTagConfigDelete: - description: Request object to bulk delete all tag configurations for metrics - matching the given prefix. + LogsArchiveAttributes: + description: The attributes associated with the archive. properties: - attributes: - $ref: '#/components/schemas/MetricBulkTagConfigDeleteAttributes' - id: - $ref: '#/components/schemas/MetricBulkTagConfigNamePrefix' - type: - $ref: '#/components/schemas/MetricBulkConfigureTagsType' - required: - - id - - type - type: object - MetricBulkTagConfigDeleteAttributes: - description: Optional parameters for bulk deleting metric tag configurations. - properties: - emails: - $ref: '#/components/schemas/MetricBulkTagConfigEmailList' + destination: + $ref: '#/components/schemas/LogsArchiveDestination' + include_tags: + default: false + description: 'To store the tags in the archive, set the value "true". + + If it is set to "false", the tags will be deleted when the logs are sent + to the archive.' + example: false + type: boolean + name: + description: The archive name. + example: Nginx Archive + type: string + query: + description: The archive query/filter. Logs matching this query are included + in the archive. + example: source:nginx + type: string + rehydration_max_scan_size_in_gb: + description: Maximum scan size for rehydration from this archive. + example: 100 + format: int64 + nullable: true + type: integer + rehydration_tags: + description: An array of tags to add to rehydrated logs from an archive. + example: + - team:intake + - team:app + items: + description: A given tag in the `:` format. + type: string + type: array + state: + $ref: '#/components/schemas/LogsArchiveState' + required: + - name + - query + - destination type: object - MetricBulkTagConfigDeleteRequest: - description: Wrapper object for a single bulk tag deletion request. + LogsArchiveCreateRequest: + description: The logs archive. properties: data: - $ref: '#/components/schemas/MetricBulkTagConfigDelete' + $ref: '#/components/schemas/LogsArchiveCreateRequestDefinition' + type: object + LogsArchiveCreateRequestAttributes: + description: The attributes associated with the archive. + properties: + destination: + $ref: '#/components/schemas/LogsArchiveCreateRequestDestination' + include_tags: + default: false + description: 'To store the tags in the archive, set the value "true". + + If it is set to "false", the tags will be deleted when the logs are sent + to the archive.' + example: false + type: boolean + name: + description: The archive name. + example: Nginx Archive + type: string + query: + description: The archive query/filter. Logs matching this query are included + in the archive. + example: source:nginx + type: string + rehydration_max_scan_size_in_gb: + description: Maximum scan size for rehydration from this archive. + example: 100 + format: int64 + nullable: true + type: integer + rehydration_tags: + description: An array of tags to add to rehydrated logs from an archive. + example: + - team:intake + - team:app + items: + description: A given tag in the `:` format. + type: string + type: array required: - - data + - name + - query + - destination type: object - MetricBulkTagConfigEmailList: - description: A list of account emails to notify when the configuration is applied. - example: - - sue@example.com - - bob@example.com - items: - description: An email address. - format: email - type: string - type: array - MetricBulkTagConfigNamePrefix: - description: A text prefix to match against metric names. - example: kafka.lag - type: string - MetricBulkTagConfigResponse: - description: Wrapper for a single bulk tag configuration status response. + LogsArchiveCreateRequestDefinition: + description: The definition of an archive. properties: - data: - $ref: '#/components/schemas/MetricBulkTagConfigStatus' + attributes: + $ref: '#/components/schemas/LogsArchiveCreateRequestAttributes' + type: + default: archives + description: The type of the resource. The value should always be archives. + example: archives + type: string + required: + - type type: object - MetricBulkTagConfigStatus: - description: 'The status of a request to bulk configure metric tags. - - It contains the fields from the original request for reference.' + LogsArchiveCreateRequestDestination: + description: An archive's destination. + oneOf: + - $ref: '#/components/schemas/LogsArchiveDestinationAzure' + - $ref: '#/components/schemas/LogsArchiveDestinationGCS' + - $ref: '#/components/schemas/LogsArchiveDestinationS3' + required: + - type + - integration + type: object + LogsArchiveDefinition: + description: The definition of an archive. properties: attributes: - $ref: '#/components/schemas/MetricBulkTagConfigStatusAttributes' + $ref: '#/components/schemas/LogsArchiveAttributes' id: - $ref: '#/components/schemas/MetricBulkTagConfigNamePrefix' + description: The archive ID. + example: a2zcMylnM4OCHpYusxIi3g + readOnly: true + type: string type: - $ref: '#/components/schemas/MetricBulkConfigureTagsType' + default: archives + description: The type of the resource. The value should always be archives. + example: archives + readOnly: true + type: string required: - - id - type type: object - MetricBulkTagConfigStatusAttributes: - description: Optional attributes for the status of a bulk tag configuration - request. + LogsArchiveDestination: + description: An archive's destination. + nullable: true + oneOf: + - $ref: '#/components/schemas/LogsArchiveDestinationAzure' + - $ref: '#/components/schemas/LogsArchiveDestinationGCS' + - $ref: '#/components/schemas/LogsArchiveDestinationS3' + required: + - type + - integration + type: object + LogsArchiveDestinationAzure: + description: The Azure archive destination. properties: - emails: - $ref: '#/components/schemas/MetricBulkTagConfigEmailList' - status: - description: The status of the request. - example: Accepted + container: + description: The container where the archive will be stored. + example: container-name type: string - tags: - $ref: '#/components/schemas/MetricBulkTagConfigTagNameList' + integration: + $ref: '#/components/schemas/LogsArchiveIntegrationAzure' + path: + description: The archive path. + type: string + region: + description: The region where the archive will be stored. + type: string + storage_account: + description: The associated storage account. + example: account-name + type: string + type: + $ref: '#/components/schemas/LogsArchiveDestinationAzureType' + required: + - storage_account + - container + - integration + - type type: object - MetricBulkTagConfigTagNameList: - description: A list of tag names to apply to the configuration. - example: - - host - - pod_name - - is_shadow - items: - description: A metric tag name. - maxLength: 200 - pattern: ^[A-Za-z][A-Za-z0-9\.\-\_:\/]*$ - type: string - type: array - MetricContentEncoding: - default: deflate - description: HTTP header used to compress the media-type. + LogsArchiveDestinationAzureType: + default: azure + description: Type of the Azure archive destination. enum: - - deflate - - zstd1 - - gzip - example: deflate + - azure + example: azure type: string x-enum-varnames: - - DEFLATE - - ZSTD1 - - GZIP - MetricCustomAggregation: - description: A time and space aggregation combination for use in query. - example: - space: sum - time: sum + - AZURE + LogsArchiveDestinationGCS: + description: The GCS archive destination. properties: - space: - $ref: '#/components/schemas/MetricCustomSpaceAggregation' - time: - $ref: '#/components/schemas/MetricCustomTimeAggregation' + bucket: + description: The bucket where the archive will be stored. + example: bucket-name + type: string + integration: + $ref: '#/components/schemas/LogsArchiveIntegrationGCS' + path: + description: The archive path. + type: string + type: + $ref: '#/components/schemas/LogsArchiveDestinationGCSType' required: - - time - - space + - bucket + - integration + - type type: object - MetricCustomAggregations: - description: 'A list of queryable aggregation combinations for a count, rate, - or gauge metric. - - By default, count and rate metrics require the (time: sum, space: sum) aggregation - and - - Gauge metrics require the (time: avg, space: avg) aggregation. - - Additional time & space combinations are also available: - - - - time: avg, space: avg - - - time: avg, space: max - - - time: avg, space: min - - - time: avg, space: sum - - - time: count, space: sum - - - time: max, space: max - - - time: min, space: min - - - time: sum, space: avg - - - time: sum, space: sum - - - Can only be applied to metrics that have a `metric_type` of `count`, `rate`, - or `gauge`.' - example: - - space: sum - time: sum - - space: sum - time: count - items: - $ref: '#/components/schemas/MetricCustomAggregation' - type: array - MetricCustomSpaceAggregation: - description: A space aggregation for use in query. - enum: - - avg - - max - - min - - sum - example: sum - type: string - x-enum-varnames: - - AVG - - MAX - - MIN - - SUM - MetricCustomTimeAggregation: - description: A time aggregation for use in query. + LogsArchiveDestinationGCSType: + default: gcs + description: Type of the GCS archive destination. enum: - - avg - - count - - max - - min - - sum - example: sum + - gcs + example: gcs type: string x-enum-varnames: - - AVG - - COUNT - - MAX - - MIN - - SUM - MetricDistinctVolume: - description: Object for a single metric's distinct volume. + - GCS + LogsArchiveDestinationS3: + description: The S3 archive destination. properties: - attributes: - $ref: '#/components/schemas/MetricDistinctVolumeAttributes' - id: - $ref: '#/components/schemas/MetricName' + bucket: + description: The bucket where the archive will be stored. + example: bucket-name + type: string + integration: + $ref: '#/components/schemas/LogsArchiveIntegrationS3' + path: + description: The archive path. + type: string type: - $ref: '#/components/schemas/MetricDistinctVolumeType' - type: object - MetricDistinctVolumeAttributes: - description: Object containing the definition of a metric's distinct volume. - properties: - distinct_volume: - description: Distinct volume for the given metric. - example: 10 - format: int64 - type: integer + $ref: '#/components/schemas/LogsArchiveDestinationS3Type' + required: + - bucket + - integration + - type type: object - MetricDistinctVolumeType: - default: distinct_metric_volumes - description: The metric distinct volume type. + LogsArchiveDestinationS3Type: + default: s3 + description: Type of the S3 archive destination. enum: - - distinct_metric_volumes - example: distinct_metric_volumes + - s3 + example: s3 type: string x-enum-varnames: - - DISTINCT_METRIC_VOLUMES - MetricEstimate: - description: Object for a metric cardinality estimate. + - S3 + LogsArchiveIntegrationAzure: + description: The Azure archive's integration destination. properties: - attributes: - $ref: '#/components/schemas/MetricEstimateAttributes' - id: - $ref: '#/components/schemas/MetricName' - type: - $ref: '#/components/schemas/MetricEstimateResourceType' + client_id: + description: A client ID. + example: aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa + type: string + tenant_id: + description: A tenant ID. + example: aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa + type: string + required: + - tenant_id + - client_id type: object - MetricEstimateAttributes: - description: Object containing the definition of a metric estimate attribute. + LogsArchiveIntegrationGCS: + description: The GCS archive's integration destination. properties: - estimate_type: - $ref: '#/components/schemas/MetricEstimateType' - estimated_at: - description: Timestamp when the cardinality estimate was requested. - example: '2022-04-27T09:48:37.463835Z' - format: date-time + client_email: + description: A client email. + example: youremail@example.com type: string - estimated_output_series: - description: Estimated cardinality of the metric based on the queried configuration. - example: 50 - format: int64 - type: integer + project_id: + description: A project ID. + example: project-id + type: string + required: + - project_id + - client_email type: object - MetricEstimateResourceType: - default: metric_cardinality_estimate - description: The metric estimate resource type. - enum: - - metric_cardinality_estimate - example: metric_cardinality_estimate - type: string - x-enum-varnames: - - METRIC_CARDINALITY_ESTIMATE - MetricEstimateResponse: - description: Response object that includes metric cardinality estimates. + LogsArchiveIntegrationS3: + description: The S3 Archive's integration destination. + properties: + account_id: + description: The account ID for the integration. + example: '123456789012' + type: string + role_name: + description: The path of the integration. + example: role-name + type: string + required: + - role_name + - account_id + type: object + LogsArchiveOrder: + description: A ordered list of archive IDs. properties: data: - $ref: '#/components/schemas/MetricEstimate' + $ref: '#/components/schemas/LogsArchiveOrderDefinition' type: object - MetricEstimateType: - default: count_or_gauge - description: Estimate type based on the queried configuration. By default, `count_or_gauge` - is returned. `distribution` is returned for distribution metrics without percentiles - enabled. Lastly, `percentile` is returned if `filter[pct]=true` is queried - with a distribution metric. - enum: - - count_or_gauge - - distribution - - percentile - example: distribution - type: string - x-enum-varnames: - - COUNT_OR_GAUGE - - DISTRIBUTION - - PERCENTILE - MetricIngestedIndexedVolume: - description: Object for a single metric's ingested and indexed volume. + LogsArchiveOrderAttributes: + description: The attributes associated with the archive order. properties: - attributes: - $ref: '#/components/schemas/MetricIngestedIndexedVolumeAttributes' - id: - $ref: '#/components/schemas/MetricName' - type: - $ref: '#/components/schemas/MetricIngestedIndexedVolumeType' + archive_ids: + description: 'An ordered array of `` strings, the order of archive + IDs in the array + + define the overall archives order for Datadog.' + example: + - a2zcMylnM4OCHpYusxIi1g + - a2zcMylnM4OCHpYusxIi2g + - a2zcMylnM4OCHpYusxIi3g + items: + description: A given archive ID. + type: string + type: array + required: + - archive_ids type: object - MetricIngestedIndexedVolumeAttributes: - description: Object containing the definition of a metric's ingested and indexed - volume. + LogsArchiveOrderDefinition: + description: The definition of an archive order. properties: - indexed_volume: - description: Indexed volume for the given metric. - example: 10 - format: int64 - type: integer - ingested_volume: - description: Ingested volume for the given metric. - example: 20 - format: int64 - type: integer + attributes: + $ref: '#/components/schemas/LogsArchiveOrderAttributes' + type: + $ref: '#/components/schemas/LogsArchiveOrderDefinitionType' + required: + - type + - attributes type: object - MetricIngestedIndexedVolumeType: - default: metric_volumes - description: The metric ingested and indexed volume type. - enum: - - metric_volumes - example: metric_volumes + LogsArchiveOrderDefinitionType: + default: archive_order + description: Type of the archive order definition. + enum: + - archive_order + example: archive_order type: string x-enum-varnames: - - METRIC_VOLUMES - MetricIntakeType: - description: The type of metric. The available types are `0` (unspecified), - `1` (count), `2` (rate), and `3` (gauge). + - ARCHIVE_ORDER + LogsArchiveState: + description: The state of the archive. enum: - - 0 - - 1 - - 2 - - 3 - format: int32 - type: integer + - UNKNOWN + - WORKING + - FAILING + - WORKING_AUTH_LEGACY + example: WORKING + type: string x-enum-varnames: - - UNSPECIFIED - - COUNT - - RATE - - GAUGE - MetricMetadata: - description: Metadata for the metric. + - UNKNOWN + - WORKING + - FAILING + - WORKING_AUTH_LEGACY + LogsArchives: + description: The available archives. properties: - origin: - $ref: '#/components/schemas/MetricOrigin' + data: + description: A list of archives. + items: + $ref: '#/components/schemas/LogsArchiveDefinition' + type: array type: object - MetricName: - description: The metric name for this resource. - example: test.metric.latency + LogsCompute: + description: A compute rule to compute metrics or timeseries + properties: + aggregation: + $ref: '#/components/schemas/LogsAggregationFunction' + interval: + description: 'The time buckets'' size (only used for type=timeseries) + + Defaults to a resolution of 150 points' + example: 5m + type: string + metric: + description: The metric to use + example: '@duration' + type: string + type: + $ref: '#/components/schemas/LogsComputeType' + required: + - aggregation + type: object + LogsComputeType: + default: total + description: The type of compute + enum: + - timeseries + - total type: string - MetricOrigin: - description: Metric origin information. + x-enum-varnames: + - TIMESERIES + - TOTAL + LogsGroupBy: + description: A group by rule properties: - metric_type: - default: 0 - description: The origin metric type code - format: int32 - maximum: 1000 - type: integer - product: - default: 0 - description: The origin product code - format: int32 - maximum: 1000 + facet: + description: The name of the facet to use (required) + example: host + type: string + histogram: + $ref: '#/components/schemas/LogsGroupByHistogram' + limit: + default: 10 + description: The maximum buckets to return for this group by + format: int64 type: integer - service: - default: 0 - description: The origin service code + missing: + $ref: '#/components/schemas/LogsGroupByMissing' + sort: + $ref: '#/components/schemas/LogsAggregateSort' + total: + $ref: '#/components/schemas/LogsGroupByTotal' + required: + - facet + type: object + LogsGroupByHistogram: + description: 'Used to perform a histogram computation (only for measure facets). + + Note: At most 100 buckets are allowed, the number of buckets is (max - min)/interval.' + properties: + interval: + description: The bin size of the histogram buckets + example: 10 + format: double + type: number + max: + description: 'The maximum value for the measure used in the histogram + + (values greater than this one are filtered out)' + example: 100 + format: double + type: number + min: + description: 'The minimum value for the measure used in the histogram + + (values smaller than this one are filtered out)' + example: 50 + format: double + type: number + required: + - interval + - min + - max + type: object + LogsGroupByMissing: + description: The value to use for logs that don't have the facet used to group + by + oneOf: + - $ref: '#/components/schemas/LogsGroupByMissingString' + - $ref: '#/components/schemas/LogsGroupByMissingNumber' + LogsGroupByMissingNumber: + description: The missing value to use if there is a number valued facet. + format: double + type: number + LogsGroupByMissingString: + description: The missing value to use if there is string valued facet. + type: string + LogsGroupByTotal: + default: false + description: A resulting object to put the given computes in over all the matching + records. + oneOf: + - $ref: '#/components/schemas/LogsGroupByTotalBoolean' + - $ref: '#/components/schemas/LogsGroupByTotalString' + - $ref: '#/components/schemas/LogsGroupByTotalNumber' + LogsGroupByTotalBoolean: + description: If set to true, creates an additional bucket labeled "$facet_total" + type: boolean + LogsGroupByTotalNumber: + description: A number to use as the key value for the total bucket + format: double + type: number + LogsGroupByTotalString: + description: A string to use as the key value for the total bucket + type: string + LogsListRequest: + description: The request for a logs list. + properties: + filter: + $ref: '#/components/schemas/LogsQueryFilter' + options: + $ref: '#/components/schemas/LogsQueryOptions' + page: + $ref: '#/components/schemas/LogsListRequestPage' + sort: + $ref: '#/components/schemas/LogsSort' + type: object + LogsListRequestPage: + description: Paging attributes for listing logs. + properties: + cursor: + description: List following results with a cursor provided in the previous + query. + example: eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ== + type: string + limit: + default: 10 + description: Maximum number of logs in the response. + example: 25 format: int32 maximum: 1000 type: integer type: object - MetricPayload: - description: The metrics' payload. + LogsListResponse: + description: Response object with all logs matching the request and pagination + information. properties: - series: - description: A list of time series to submit to Datadog. - example: - - metric: system.load.1 - points: - - timestamp: 1475317847 - value: 0.7 - resources: - - name: dummyhost - type: host + data: + description: Array of logs matching the request. items: - $ref: '#/components/schemas/MetricSeries' + $ref: '#/components/schemas/Log' type: array - required: - - series + links: + $ref: '#/components/schemas/LogsListResponseLinks' + meta: + $ref: '#/components/schemas/LogsResponseMetadata' type: object - MetricPoint: - description: A point object is of the form `{POSIX_timestamp, numeric_value}`. - example: - timestamp: 1575317847 - value: 0.5 + LogsListResponseLinks: + description: Links attributes. properties: - timestamp: - description: 'The timestamp should be in seconds and current. + next: + description: 'Link for the next set of results. Note that the request can + also be made using the - Current is defined as not more than 10 minutes in the future or more than - 1 hour in the past.' - format: int64 - type: integer - value: - description: The numeric value format should be a 64bit float gauge-type - value. - format: double - type: number + POST endpoint.' + example: https://app.datadoghq.com/api/v2/logs/event?filter[query]=foo&page[cursor]=eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ== + type: string type: object - MetricResource: - description: Metric resource. - example: - name: dummyhost - type: host + LogsMetricCompute: + description: The compute rule to compute the log-based metric. properties: - name: - description: The name of the resource. - type: string - type: - description: The type of the resource. + aggregation_type: + $ref: '#/components/schemas/LogsMetricComputeAggregationType' + path: + description: The path to the value the log-based metric will aggregate on + (only used if the aggregation type is a "distribution"). + example: '@duration' type: string + required: + - aggregation_type type: object - MetricSeries: - description: 'A metric to submit to Datadog. - - See [Datadog metrics](https://docs.datadoghq.com/developers/metrics/#custom-metrics-properties).' + LogsMetricComputeAggregationType: + description: The type of aggregation to use. + enum: + - count + - distribution + example: distribution + type: string + x-enum-varnames: + - COUNT + - DISTRIBUTION + LogsMetricCreateAttributes: + description: The object describing the Datadog log-based metric to create. properties: - interval: - description: If the type of the metric is rate or count, define the corresponding - interval. - example: 20 - format: int64 - type: integer - metadata: - $ref: '#/components/schemas/MetricMetadata' - metric: - description: The name of the timeseries. - example: system.load.1 - type: string - points: - description: Points relating to a metric. All points must be objects with - timestamp and a scalar value (cannot be a string). Timestamps should be - in POSIX time in seconds, and cannot be more than ten minutes in the future - or more than one hour in the past. - items: - $ref: '#/components/schemas/MetricPoint' - type: array - resources: - description: A list of resources to associate with this metric. - items: - $ref: '#/components/schemas/MetricResource' - type: array - source_type_name: - description: The source type name. - example: datadog - type: string - tags: - description: A list of tags associated with the metric. - example: - - environment:test + compute: + $ref: '#/components/schemas/LogsMetricCompute' + filter: + $ref: '#/components/schemas/LogsMetricFilter' + group_by: + description: The rules for the group by. items: - description: Individual tags. - type: string + $ref: '#/components/schemas/LogsMetricGroupBy' type: array - type: - $ref: '#/components/schemas/MetricIntakeType' - unit: - description: The unit of point value. - example: second - type: string required: - - metric - - points + - compute type: object - MetricSuggestedAggregations: - description: List of aggregation combinations that have been actively queried. - example: - - space: sum - time: sum - - space: sum - time: count - items: - $ref: '#/components/schemas/MetricCustomAggregation' - type: array - MetricSuggestedTagsAndAggregations: - description: Object for a single metric's actively queried tags and aggregations. + LogsMetricCreateData: + description: The new log-based metric properties. properties: attributes: - $ref: '#/components/schemas/MetricSuggestedTagsAttributes' + $ref: '#/components/schemas/LogsMetricCreateAttributes' id: - $ref: '#/components/schemas/MetricName' + $ref: '#/components/schemas/LogsMetricID' type: - $ref: '#/components/schemas/MetricActiveConfigurationType' + $ref: '#/components/schemas/LogsMetricType' + required: + - id + - type + - attributes type: object - MetricSuggestedTagsAndAggregationsResponse: - description: Response object that includes a single metric's actively queried - tags and aggregations. + LogsMetricCreateRequest: + description: The new log-based metric body. properties: data: - $ref: '#/components/schemas/MetricSuggestedTagsAndAggregations' - readOnly: true + $ref: '#/components/schemas/LogsMetricCreateData' + required: + - data type: object - MetricSuggestedTagsAttributes: - description: Object containing the definition of a metric's actively queried - tags and aggregations. + LogsMetricFilter: + description: The log-based metric filter. Logs matching this filter will be + aggregated in this metric. properties: - active_aggregations: - $ref: '#/components/schemas/MetricSuggestedAggregations' - active_tags: - description: List of tag keys that have been actively queried. - example: - - app - - datacenter + query: + default: '*' + description: The search query - following the log search syntax. + example: service:web* AND @http.status_code:[200 TO 299] + type: string + type: object + LogsMetricGroupBy: + description: A group by rule. + properties: + path: + description: The path to the value the log-based metric will be aggregated + over. + example: '@http.status_code' + type: string + tag_name: + description: Eventual name of the tag that gets created. By default, the + path attribute is used as the tag name. + example: status_code + type: string + required: + - path + type: object + LogsMetricID: + description: The name of the log-based metric. + example: logs.page.load.count + type: string + LogsMetricResponse: + description: The log-based metric object. + properties: + data: + $ref: '#/components/schemas/LogsMetricResponseData' + type: object + LogsMetricResponseAttributes: + description: The object describing a Datadog log-based metric. + properties: + compute: + $ref: '#/components/schemas/LogsMetricResponseCompute' + filter: + $ref: '#/components/schemas/LogsMetricResponseFilter' + group_by: + description: The rules for the group by. items: - description: Actively queried tag keys. - type: string + $ref: '#/components/schemas/LogsMetricResponseGroupBy' type: array type: object - MetricTagConfiguration: - description: Object for a single metric tag configuration. - example: - attributes: - aggregations: - - space: avg - time: avg - created_at: '2020-03-25T09:48:37.463835Z' - metric_type: gauge - modified_at: '2020-04-25T09:48:37.463835Z' - tags: - - app - - datacenter - id: http.request.latency - type: manage_tags + LogsMetricResponseCompute: + description: The compute rule to compute the log-based metric. + properties: + aggregation_type: + $ref: '#/components/schemas/LogsMetricResponseComputeAggregationType' + path: + description: The path to the value the log-based metric will aggregate on + (only used if the aggregation type is a "distribution"). + example: '@duration' + type: string + type: object + LogsMetricResponseComputeAggregationType: + description: The type of aggregation to use. + enum: + - count + - distribution + example: distribution + type: string + x-enum-varnames: + - COUNT + - DISTRIBUTION + LogsMetricResponseData: + description: The log-based metric properties. properties: attributes: - $ref: '#/components/schemas/MetricTagConfigurationAttributes' + $ref: '#/components/schemas/LogsMetricResponseAttributes' id: - $ref: '#/components/schemas/MetricName' + $ref: '#/components/schemas/LogsMetricID' type: - $ref: '#/components/schemas/MetricTagConfigurationType' + $ref: '#/components/schemas/LogsMetricType' type: object - MetricTagConfigurationAttributes: - description: Object containing the definition of a metric tag configuration - attributes. + LogsMetricResponseFilter: + description: The log-based metric filter. Logs matching this filter will be + aggregated in this metric. properties: - aggregations: - $ref: '#/components/schemas/MetricCustomAggregations' - created_at: - description: Timestamp when the tag configuration was created. - example: '2020-03-25T09:48:37.463835Z' - format: date-time - type: string - include_percentiles: - description: 'Toggle to turn on/off percentile aggregations for distribution - metrics. - - Only present when the `metric_type` is `distribution`.' - example: true - type: boolean - metric_type: - $ref: '#/components/schemas/MetricTagConfigurationMetricTypes' - modified_at: - description: Timestamp when the tag configuration was last modified. - example: '2020-03-25T09:48:37.463835Z' - format: date-time + query: + description: The search query - following the log search syntax. + example: service:web* AND @http.status_code:[200 TO 299] type: string - tags: - description: List of tag keys on which to group. - example: - - app - - datacenter - items: - description: Tag keys to group by. - type: string - type: array type: object - MetricTagConfigurationCreateAttributes: - description: Object containing the definition of a metric tag configuration - to be created. - properties: - aggregations: - $ref: '#/components/schemas/MetricCustomAggregations' - include_percentiles: - description: 'Toggle to include/exclude percentiles for a distribution metric. - - Defaults to false. Can only be applied to metrics that have a `metric_type` - of `distribution`.' - example: true - type: boolean - metric_type: - $ref: '#/components/schemas/MetricTagConfigurationMetricTypes' - tags: - default: [] - description: A list of tag keys that will be queryable for your metric. - example: - - app - - datacenter - items: - description: Tag keys to group by. - type: string - type: array - required: - - tags - - metric_type - type: object - MetricTagConfigurationCreateData: - description: Object for a single metric to be configure tags on. - example: - attributes: - include_percentiles: false - metric_type: distribution - tags: - - app - - datacenter - id: http.endpoint.request - type: manage_tags - properties: - attributes: - $ref: '#/components/schemas/MetricTagConfigurationCreateAttributes' - id: - $ref: '#/components/schemas/MetricName' - type: - $ref: '#/components/schemas/MetricTagConfigurationType' - required: - - id - - type - type: object - MetricTagConfigurationCreateRequest: - description: Request object that includes the metric that you would like to - configure tags for. - properties: - data: - $ref: '#/components/schemas/MetricTagConfigurationCreateData' - required: - - data - type: object - MetricTagConfigurationMetricTypes: - default: gauge - description: The metric's type. - enum: - - gauge - - count - - rate - - distribution - example: count - type: string - x-enum-varnames: - - GAUGE - - COUNT - - RATE - - DISTRIBUTION - MetricTagConfigurationResponse: - description: Response object which includes a single metric's tag configuration. + LogsMetricResponseGroupBy: + description: A group by rule. properties: - data: - $ref: '#/components/schemas/MetricTagConfiguration' - readOnly: true + path: + description: The path to the value the log-based metric will be aggregated + over. + example: '@http.status_code' + type: string + tag_name: + description: Eventual name of the tag that gets created. By default, the + path attribute is used as the tag name. + example: status_code + type: string type: object - MetricTagConfigurationType: - default: manage_tags - description: The metric tag configuration resource type. + LogsMetricType: + default: logs_metrics + description: The type of the resource. The value should always be logs_metrics. enum: - - manage_tags - example: manage_tags + - logs_metrics + example: logs_metrics type: string x-enum-varnames: - - MANAGE_TAGS - MetricTagConfigurationUpdateAttributes: - description: Object containing the definition of a metric tag configuration - to be updated. + - LOGS_METRICS + LogsMetricUpdateAttributes: + description: The log-based metric properties that will be updated. properties: - aggregations: - $ref: '#/components/schemas/MetricCustomAggregations' - include_percentiles: - description: 'Toggle to include/exclude percentiles for a distribution metric. - - Defaults to false. Can only be applied to metrics that have a `metric_type` - of `distribution`.' - example: true - type: boolean - tags: - default: [] - description: A list of tag keys that will be queryable for your metric. - example: - - app - - datacenter + filter: + $ref: '#/components/schemas/LogsMetricFilter' + group_by: + description: The rules for the group by. items: - description: Tag keys to group by. - type: string + $ref: '#/components/schemas/LogsMetricGroupBy' type: array type: object - MetricTagConfigurationUpdateData: - description: Object for a single tag configuration to be edited. - example: - attributes: - group_by: - - app - - datacenter - include_percentiles: false - id: http.endpoint.request - type: manage_tags + LogsMetricUpdateData: + description: The new log-based metric properties. properties: attributes: - $ref: '#/components/schemas/MetricTagConfigurationUpdateAttributes' - id: - $ref: '#/components/schemas/MetricName' + $ref: '#/components/schemas/LogsMetricUpdateAttributes' type: - $ref: '#/components/schemas/MetricTagConfigurationType' + $ref: '#/components/schemas/LogsMetricType' required: - - id - type + - attributes type: object - MetricTagConfigurationUpdateRequest: - description: Request object that includes the metric that you would like to - edit the tag configuration on. + LogsMetricUpdateRequest: + description: The new log-based metric body. properties: data: - $ref: '#/components/schemas/MetricTagConfigurationUpdateData' + $ref: '#/components/schemas/LogsMetricUpdateData' required: - data type: object - MetricType: - default: metrics - description: The metric resource type. - enum: - - metrics - example: metrics - type: string - x-enum-varnames: - - METRICS - MetricVolumes: - description: Possible response objects for a metric's volume. - oneOf: - - $ref: '#/components/schemas/MetricDistinctVolume' - - $ref: '#/components/schemas/MetricIngestedIndexedVolume' - type: object - MetricVolumesResponse: - description: Response object which includes a single metric's volume. - properties: - data: - $ref: '#/components/schemas/MetricVolumes' - readOnly: true - type: object - MetricsAndMetricTagConfigurations: - description: Object for a metrics and metric tag configurations. - oneOf: - - $ref: '#/components/schemas/Metric' - - $ref: '#/components/schemas/MetricTagConfiguration' - type: object - MetricsAndMetricTagConfigurationsResponse: - description: Response object that includes metrics and metric tag configurations. + LogsMetricsResponse: + description: All the available log-based metric objects. properties: data: - description: Array of metrics and metric tag configurations. + description: A list of log-based metric objects. items: - $ref: '#/components/schemas/MetricsAndMetricTagConfigurations' + $ref: '#/components/schemas/LogsMetricResponseData' type: array - readOnly: true type: object - MonitorType: - description: Attributes from the monitor that triggered the event. - nullable: true + LogsQueryFilter: + description: The search and filter query settings properties: - created_at: - description: The POSIX timestamp of the monitor's creation in nanoseconds. - example: 1646318692000 - format: int64 - type: integer - group_status: - description: Monitor group status used when there is no `result_groups`. - format: int32 - maximum: 2147483647 - type: integer - groups: - description: Groups to which the monitor belongs. - items: - description: A group. - type: string - type: array - id: - description: The monitor ID. - format: int64 - type: integer - message: - description: The monitor message. - type: string - modified: - description: The monitor's last-modified timestamp. - format: int64 - type: integer - name: - description: The monitor name. - type: string - query: - description: The query that triggers the alert. + from: + default: now-15m + description: The minimum time for the requested logs, supports date math + and regular timestamps (milliseconds). + example: now-15m type: string - tags: - description: A list of tags attached to the monitor. + indexes: + default: + - '*' + description: For customers with multiple indexes, the indexes to search. + Defaults to ['*'] which means all indexes. example: - - environment:test + - main + - web items: - description: A tag. + description: The name of a log index. type: string type: array - templated_name: - description: The templated name of the monitor before resolving any template - variables. - type: string - type: - description: The monitor type. + query: + default: '*' + description: The search query - following the log search syntax. + example: service:web* AND @http.status_code:[200 TO 299] type: string - type: object - NullableRelationshipToUser: - description: Relationship to user. + to: + default: now + description: The maximum time for the requested logs, supports date math + and regular timestamps (milliseconds). + example: now + type: string + type: object + LogsQueryOptions: + description: 'Global query options that are used during the query. + + Note: You should only supply timezone or time offset but not both otherwise + the query will fail.' properties: - data: - $ref: '#/components/schemas/NullableRelationshipToUserData' - required: - - data + timeOffset: + description: The time offset (in seconds) to apply to the query. + format: int64 + type: integer + timezone: + default: UTC + description: 'The timezone can be specified both as an offset, for example: + "UTC+03:00".' + example: GMT + type: string type: object - NullableRelationshipToUserData: - description: Relationship to user object. - nullable: true + LogsResponseMetadata: + description: The metadata associated with a request properties: - id: - description: A unique identifier that represents the user. - example: 00000000-0000-0000-0000-000000000000 + elapsed: + description: The time elapsed in milliseconds + example: 132 + format: int64 + type: integer + page: + $ref: '#/components/schemas/LogsResponseMetadataPage' + request_id: + description: The identifier of the request + example: MWlFUjVaWGZTTTZPYzM0VXp1OXU2d3xLSVpEMjZKQ0VKUTI0dEYtM3RSOFVR type: string - type: - $ref: '#/components/schemas/UsersType' - required: - - id - - type + status: + $ref: '#/components/schemas/LogsAggregateResponseStatus' + warnings: + description: 'A list of warnings (non fatal errors) encountered, partial + results might be returned if + + warnings are present in the response.' + items: + $ref: '#/components/schemas/LogsWarning' + type: array type: object - OpsgenieServiceCreateAttributes: - description: The Opsgenie service attributes for a create request. + LogsResponseMetadataPage: + description: Paging attributes. properties: - custom_url: - description: The custom URL for a custom region. - example: https://example.com + after: + description: 'The cursor to use to get the next results, if any. To make + the next request, use the same. + + parameters with the addition of the `page[cursor]`.' + example: eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ== type: string - name: - description: The name for the Opsgenie service. - example: fake-opsgenie-service-name + type: object + LogsSort: + description: Sort parameters when querying logs. + enum: + - timestamp + - -timestamp + type: string + x-enum-varnames: + - TIMESTAMP_ASCENDING + - TIMESTAMP_DESCENDING + LogsSortOrder: + description: The order to use, ascending or descending + enum: + - asc + - desc + example: asc + type: string + x-enum-varnames: + - ASCENDING + - DESCENDING + LogsWarning: + description: A warning message indicating something that went wrong with the + query + properties: + code: + description: A unique code for this type of warning + example: unknown_index type: string - opsgenie_api_key: - description: The Opsgenie API key for your Opsgenie service. - example: 00000000-0000-0000-0000-000000000000 + detail: + description: A detailed explanation of this specific warning + example: 'indexes: foo, bar' + type: string + title: + description: A short human-readable summary of the warning + example: One or several indexes are missing or invalid, results hold data + from the other indexes type: string - region: - $ref: '#/components/schemas/OpsgenieServiceRegionType' - required: - - name - - opsgenie_api_key - - region type: object - OpsgenieServiceCreateData: - description: Opsgenie service data for a create request. + Metric: + description: Object for a single metric tag configuration. + example: + id: metric.foo.bar + type: metrics + properties: + id: + $ref: '#/components/schemas/MetricName' + type: + $ref: '#/components/schemas/MetricType' + type: object + MetricActiveConfigurationType: + default: actively_queried_configurations + description: The metric actively queried configuration resource type. + enum: + - actively_queried_configurations + example: actively_queried_configurations + type: string + x-enum-varnames: + - ACTIVELY_QUERIED_CONFIGURATIONS + MetricAllTags: + description: Object for a single metric's indexed tags. properties: attributes: - $ref: '#/components/schemas/OpsgenieServiceCreateAttributes' + $ref: '#/components/schemas/MetricAllTagsAttributes' + id: + $ref: '#/components/schemas/MetricName' type: - $ref: '#/components/schemas/OpsgenieServiceType' - required: - - type - - attributes + $ref: '#/components/schemas/MetricType' type: object - OpsgenieServiceCreateRequest: - description: Create request for an Opsgenie service. + MetricAllTagsAttributes: + description: Object containing the definition of a metric's tags. + properties: + tags: + description: List of indexed tag value pairs. + example: + - sport:golf + - sport:football + - animal:dog + items: + description: Tag key-value pairs. + type: string + type: array + type: object + MetricAllTagsResponse: + description: Response object that includes a single metric's indexed tags. properties: data: - $ref: '#/components/schemas/OpsgenieServiceCreateData' - required: - - data + $ref: '#/components/schemas/MetricAllTags' + readOnly: true type: object - OpsgenieServiceRegionType: - description: The region for the Opsgenie service. + MetricBulkConfigureTagsType: + default: metric_bulk_configure_tags + description: The metric bulk configure tags resource. enum: - - us - - eu - - custom - example: us + - metric_bulk_configure_tags + example: metric_bulk_configure_tags type: string x-enum-varnames: - - US - - EU - - CUSTOM - OpsgenieServiceResponse: - description: Response of an Opsgenie service. + - BULK_MANAGE_TAGS + MetricBulkTagConfigCreate: + description: Request object to bulk configure tags for metrics matching the + given prefix. properties: - data: - $ref: '#/components/schemas/OpsgenieServiceResponseData' + attributes: + $ref: '#/components/schemas/MetricBulkTagConfigCreateAttributes' + id: + $ref: '#/components/schemas/MetricBulkTagConfigNamePrefix' + type: + $ref: '#/components/schemas/MetricBulkConfigureTagsType' required: - - data + - id + - type type: object - OpsgenieServiceResponseAttributes: - description: The attributes from an Opsgenie service response. + MetricBulkTagConfigCreateAttributes: + description: Optional parameters for bulk creating metric tag configurations. properties: - custom_url: - description: The custom URL for a custom region. - example: null - nullable: true - type: string - name: - description: The name for the Opsgenie service. - example: fake-opsgenie-service-name - type: string - region: - $ref: '#/components/schemas/OpsgenieServiceRegionType' + emails: + $ref: '#/components/schemas/MetricBulkTagConfigEmailList' + tags: + $ref: '#/components/schemas/MetricBulkTagConfigTagNameList' type: object - OpsgenieServiceResponseData: - description: Opsgenie service data from a response. + MetricBulkTagConfigCreateRequest: + description: Wrapper object for a single bulk tag configuration request. + properties: + data: + $ref: '#/components/schemas/MetricBulkTagConfigCreate' + required: + - data + type: object + MetricBulkTagConfigDelete: + description: Request object to bulk delete all tag configurations for metrics + matching the given prefix. properties: attributes: - $ref: '#/components/schemas/OpsgenieServiceResponseAttributes' + $ref: '#/components/schemas/MetricBulkTagConfigDeleteAttributes' id: - description: The ID of the Opsgenie service. - example: 596da4af-0563-4097-90ff-07230c3f9db3 - type: string + $ref: '#/components/schemas/MetricBulkTagConfigNamePrefix' type: - $ref: '#/components/schemas/OpsgenieServiceType' + $ref: '#/components/schemas/MetricBulkConfigureTagsType' required: - id - type - - attributes type: object - OpsgenieServiceType: - default: opsgenie-service - description: Opsgenie service resource type. - enum: - - opsgenie-service - example: opsgenie-service - type: string - x-enum-varnames: - - OPSGENIE_SERVICE - OpsgenieServiceUpdateAttributes: - description: The Opsgenie service attributes for an update request. - properties: - custom_url: - description: The custom URL for a custom region. - example: https://example.com - nullable: true - type: string - name: - description: The name for the Opsgenie service. - example: fake-opsgenie-service-name - type: string - opsgenie_api_key: - description: The Opsgenie API key for your Opsgenie service. - example: 00000000-0000-0000-0000-000000000000 - type: string - region: - $ref: '#/components/schemas/OpsgenieServiceRegionType' - type: object - OpsgenieServiceUpdateData: - description: Opsgenie service for an update request. + MetricBulkTagConfigDeleteAttributes: + description: Optional parameters for bulk deleting metric tag configurations. properties: - attributes: - $ref: '#/components/schemas/OpsgenieServiceUpdateAttributes' - id: - description: The ID of the Opsgenie service. - example: 596da4af-0563-4097-90ff-07230c3f9db3 - type: string - type: - $ref: '#/components/schemas/OpsgenieServiceType' - required: - - id - - type - - attributes + emails: + $ref: '#/components/schemas/MetricBulkTagConfigEmailList' type: object - OpsgenieServiceUpdateRequest: - description: Update request for an Opsgenie service. + MetricBulkTagConfigDeleteRequest: + description: Wrapper object for a single bulk tag deletion request. properties: data: - $ref: '#/components/schemas/OpsgenieServiceUpdateData' + $ref: '#/components/schemas/MetricBulkTagConfigDelete' required: - data type: object - OpsgenieServicesResponse: - description: Response with a list of Opsgenie services. + MetricBulkTagConfigEmailList: + description: A list of account emails to notify when the configuration is applied. + example: + - sue@example.com + - bob@example.com + items: + description: An email address. + format: email + type: string + type: array + MetricBulkTagConfigNamePrefix: + description: A text prefix to match against metric names. + example: kafka.lag + type: string + MetricBulkTagConfigResponse: + description: Wrapper for a single bulk tag configuration status response. properties: data: - description: An array of Opsgenie services. - example: - - attributes: - custom_url: null - name: fake-opsgenie-service-name - region: us - id: 596da4af-0563-4097-90ff-07230c3f9db3 - type: opsgenie-service - - attributes: - custom_url: null - name: fake-opsgenie-service-name-2 - region: eu - id: 0d2937f1-b561-44fa-914a-99910f848014 - type: opsgenie-service - items: - $ref: '#/components/schemas/OpsgenieServiceResponseData' - type: array - required: - - data + $ref: '#/components/schemas/MetricBulkTagConfigStatus' type: object - Organization: - description: Organization object. + MetricBulkTagConfigStatus: + description: 'The status of a request to bulk configure metric tags. + + It contains the fields from the original request for reference.' properties: attributes: - $ref: '#/components/schemas/OrganizationAttributes' + $ref: '#/components/schemas/MetricBulkTagConfigStatusAttributes' id: - description: ID of the organization. - type: string + $ref: '#/components/schemas/MetricBulkTagConfigNamePrefix' type: - $ref: '#/components/schemas/OrganizationsType' + $ref: '#/components/schemas/MetricBulkConfigureTagsType' required: + - id - type type: object - OrganizationAttributes: - description: Attributes of the organization. + MetricBulkTagConfigStatusAttributes: + description: Optional attributes for the status of a bulk tag configuration + request. properties: - created_at: - description: Creation time of the organization. - format: date-time - type: string - description: - description: Description of the organization. - type: string - disabled: - description: Whether or not the organization is disabled. - type: boolean - modified_at: - description: Time of last organization modification. - format: date-time - type: string - name: - description: Name of the organization. - type: string - public_id: - description: Public ID of the organization. - type: string - sharing: - description: Sharing type of the organization. - type: string - url: - description: URL of the site that this organization exists at. + emails: + $ref: '#/components/schemas/MetricBulkTagConfigEmailList' + status: + description: The status of the request. + example: Accepted type: string + tags: + $ref: '#/components/schemas/MetricBulkTagConfigTagNameList' type: object - OrganizationsType: - default: orgs - description: Organizations resource type. + MetricBulkTagConfigTagNameList: + description: A list of tag names to apply to the configuration. + example: + - host + - pod_name + - is_shadow + items: + description: A metric tag name. + maxLength: 200 + pattern: ^[A-Za-z][A-Za-z0-9\.\-\_:\/]*$ + type: string + type: array + MetricContentEncoding: + default: deflate + description: HTTP header used to compress the media-type. enum: - - orgs - example: orgs + - deflate + - zstd1 + - gzip + example: deflate type: string x-enum-varnames: - - ORGS - Pagination: - description: Pagination object. - properties: - total_count: - description: Total count. - format: int64 - type: integer - total_filtered_count: - description: Total count of elements matched by the filter. - format: int64 - type: integer - type: object - PartialAPIKey: - description: Partial Datadog API key. - properties: - attributes: - $ref: '#/components/schemas/PartialAPIKeyAttributes' - id: - description: ID of the API key. - type: string - relationships: - $ref: '#/components/schemas/APIKeyRelationships' - type: - $ref: '#/components/schemas/APIKeysType' - type: object - PartialAPIKeyAttributes: - description: Attributes of a partial API key. - properties: - created_at: - description: Creation date of the API key. - example: '2020-11-23T10:00:00.000Z' - readOnly: true - type: string - last4: - description: The last four characters of the API key. - example: abcd - maxLength: 4 - minLength: 4 - readOnly: true - type: string - modified_at: - description: Date the API key was last modified. - example: '2020-11-23T10:00:00.000Z' - readOnly: true - type: string - name: - description: Name of the API key. - example: API Key for submitting metrics - type: string - type: object - PartialApplicationKey: - description: Partial Datadog application key. + - DEFLATE + - ZSTD1 + - GZIP + MetricCustomAggregation: + description: A time and space aggregation combination for use in query. + example: + space: sum + time: sum properties: - attributes: - $ref: '#/components/schemas/PartialApplicationKeyAttributes' - id: - description: ID of the application key. - type: string - relationships: - $ref: '#/components/schemas/ApplicationKeyRelationships' - type: - $ref: '#/components/schemas/ApplicationKeysType' + space: + $ref: '#/components/schemas/MetricCustomSpaceAggregation' + time: + $ref: '#/components/schemas/MetricCustomTimeAggregation' + required: + - time + - space type: object - PartialApplicationKeyAttributes: - description: Attributes of a partial application key. - properties: - created_at: - description: Creation date of the application key. - example: '2020-11-23T10:00:00.000Z' - readOnly: true - type: string - last4: - description: The last four characters of the application key. - example: abcd - maxLength: 4 - minLength: 4 - readOnly: true - type: string - name: - description: Name of the application key. - example: Application Key for managing dashboards - type: string - scopes: - description: Array of scopes to grant the application key. This feature - is in private beta, please contact Datadog support to enable scopes for - your application keys. - example: - - dashboards_read - - dashboards_write - - dashboards_public_share - items: - description: Name of scope. - type: string - nullable: true - type: array - type: object - PartialApplicationKeyResponse: - description: Response for retrieving a partial application key. - properties: - data: - $ref: '#/components/schemas/PartialApplicationKey' - included: - description: Array of objects related to the application key. - items: - $ref: '#/components/schemas/ApplicationKeyResponseIncludedItem' - type: array - type: object - Permission: - description: Permission object. + MetricCustomAggregations: + description: 'A list of queryable aggregation combinations for a count, rate, + or gauge metric. + + By default, count and rate metrics require the (time: sum, space: sum) aggregation + and + + Gauge metrics require the (time: avg, space: avg) aggregation. + + Additional time & space combinations are also available: + + + - time: avg, space: avg + + - time: avg, space: max + + - time: avg, space: min + + - time: avg, space: sum + + - time: count, space: sum + + - time: max, space: max + + - time: min, space: min + + - time: sum, space: avg + + - time: sum, space: sum + + + Can only be applied to metrics that have a `metric_type` of `count`, `rate`, + or `gauge`.' + example: + - space: sum + time: sum + - space: sum + time: count + items: + $ref: '#/components/schemas/MetricCustomAggregation' + type: array + MetricCustomSpaceAggregation: + description: A space aggregation for use in query. + enum: + - avg + - max + - min + - sum + example: sum + type: string + x-enum-varnames: + - AVG + - MAX + - MIN + - SUM + MetricCustomTimeAggregation: + description: A time aggregation for use in query. + enum: + - avg + - count + - max + - min + - sum + example: sum + type: string + x-enum-varnames: + - AVG + - COUNT + - MAX + - MIN + - SUM + MetricDistinctVolume: + description: Object for a single metric's distinct volume. properties: attributes: - $ref: '#/components/schemas/PermissionAttributes' + $ref: '#/components/schemas/MetricDistinctVolumeAttributes' id: - description: ID of the permission. - type: string + $ref: '#/components/schemas/MetricName' type: - $ref: '#/components/schemas/PermissionsType' - required: - - type - type: object - PermissionAttributes: - description: Attributes of a permission. - properties: - created: - description: Creation time of the permission. - format: date-time - type: string - description: - description: Description of the permission. - type: string - display_name: - description: Displayed name for the permission. - type: string - display_type: - description: Display type. - type: string - group_name: - description: Name of the permission group. - type: string - name: - description: Name of the permission. - type: string - restricted: - description: Whether or not the permission is restricted. - type: boolean + $ref: '#/components/schemas/MetricDistinctVolumeType' type: object - PermissionsResponse: - description: Payload with API-returned permissions. + MetricDistinctVolumeAttributes: + description: Object containing the definition of a metric's distinct volume. properties: - data: - description: Array of permissions. - items: - $ref: '#/components/schemas/Permission' - type: array + distinct_volume: + description: Distinct volume for the given metric. + example: 10 + format: int64 + type: integer type: object - PermissionsType: - default: permissions - description: Permissions resource type. + MetricDistinctVolumeType: + default: distinct_metric_volumes + description: The metric distinct volume type. enum: - - permissions - example: permissions + - distinct_metric_volumes + example: distinct_metric_volumes type: string x-enum-varnames: - - PERMISSIONS - ProcessSummariesMeta: - description: Response metadata object. + - DISTINCT_METRIC_VOLUMES + MetricEstimate: + description: Object for a metric cardinality estimate. properties: - page: - $ref: '#/components/schemas/ProcessSummariesMetaPage' + attributes: + $ref: '#/components/schemas/MetricEstimateAttributes' + id: + $ref: '#/components/schemas/MetricName' + type: + $ref: '#/components/schemas/MetricEstimateResourceType' type: object - ProcessSummariesMetaPage: - description: Paging attributes. + MetricEstimateAttributes: + description: Object containing the definition of a metric estimate attribute. properties: - after: - description: 'The cursor used to get the next results, if any. To make the - next request, use the same - - parameters with the addition of the `page[cursor]`.' - example: 911abf1204838d9cdfcb9a96d0b6a1bd03e1b514074f1ce1737c4cbd + estimate_type: + $ref: '#/components/schemas/MetricEstimateType' + estimated_at: + description: Timestamp when the cardinality estimate was requested. + example: '2022-04-27T09:48:37.463835Z' + format: date-time type: string - size: - description: Number of results returned. - format: int32 - maximum: 10000 - minimum: 0 + estimated_output_series: + description: Estimated cardinality of the metric based on the queried configuration. + example: 50 + format: int64 type: integer type: object - ProcessSummariesResponse: - description: List of process summaries. + MetricEstimateResourceType: + default: metric_cardinality_estimate + description: The metric estimate resource type. + enum: + - metric_cardinality_estimate + example: metric_cardinality_estimate + type: string + x-enum-varnames: + - METRIC_CARDINALITY_ESTIMATE + MetricEstimateResponse: + description: Response object that includes metric cardinality estimates. properties: data: - description: Array of process summary objects. - items: - $ref: '#/components/schemas/ProcessSummary' - type: array - meta: - $ref: '#/components/schemas/ProcessSummariesMeta' + $ref: '#/components/schemas/MetricEstimate' type: object - ProcessSummary: - description: Process summary object. + MetricEstimateType: + default: count_or_gauge + description: Estimate type based on the queried configuration. By default, `count_or_gauge` + is returned. `distribution` is returned for distribution metrics without percentiles + enabled. Lastly, `percentile` is returned if `filter[pct]=true` is queried + with a distribution metric. + enum: + - count_or_gauge + - distribution + - percentile + example: distribution + type: string + x-enum-varnames: + - COUNT_OR_GAUGE + - DISTRIBUTION + - PERCENTILE + MetricIngestedIndexedVolume: + description: Object for a single metric's ingested and indexed volume. properties: attributes: - $ref: '#/components/schemas/ProcessSummaryAttributes' + $ref: '#/components/schemas/MetricIngestedIndexedVolumeAttributes' id: - description: Process ID. - type: string + $ref: '#/components/schemas/MetricName' type: - $ref: '#/components/schemas/ProcessSummaryType' + $ref: '#/components/schemas/MetricIngestedIndexedVolumeType' type: object - ProcessSummaryAttributes: - description: Attributes for a process summary. + MetricIngestedIndexedVolumeAttributes: + description: Object containing the definition of a metric's ingested and indexed + volume. properties: - cmdline: - description: Process command line. - type: string - host: - description: Host running the process. - type: string - pid: - description: Process ID. + indexed_volume: + description: Indexed volume for the given metric. + example: 10 format: int64 type: integer - ppid: - description: Parent process ID. + ingested_volume: + description: Ingested volume for the given metric. + example: 20 format: int64 type: integer - start: - description: Time the process was started. - type: string - tags: - description: List of tags associated with the process. - items: - description: A tag associated with the process. - type: string - type: array - timestamp: - description: Time the process was seen. - type: string - user: - description: Process owner. - type: string type: object - ProcessSummaryType: - default: process - description: Type of process summary. + MetricIngestedIndexedVolumeType: + default: metric_volumes + description: The metric ingested and indexed volume type. enum: - - process - example: process + - metric_volumes + example: metric_volumes type: string x-enum-varnames: - - PROCESS - QuerySortOrder: - default: desc - description: Direction of sort. + - METRIC_VOLUMES + MetricIntakeType: + description: The type of metric. The available types are `0` (unspecified), + `1` (count), `2` (rate), and `3` (gauge). enum: - - asc - - desc - type: string + - 0 + - 1 + - 2 + - 3 + format: int32 + type: integer x-enum-varnames: - - ASC - - DESC - RUMAggregateBucketValue: - description: A bucket value, can be either a timeseries or a single value. - oneOf: - - $ref: '#/components/schemas/RUMAggregateBucketValueSingleString' - - $ref: '#/components/schemas/RUMAggregateBucketValueSingleNumber' - - $ref: '#/components/schemas/RUMAggregateBucketValueTimeseries' - RUMAggregateBucketValueSingleNumber: - description: A single number value. - format: double - type: number - RUMAggregateBucketValueSingleString: - description: A single string value. + - UNSPECIFIED + - COUNT + - RATE + - GAUGE + MetricMetadata: + description: Metadata for the metric. + properties: + origin: + $ref: '#/components/schemas/MetricOrigin' + type: object + MetricName: + description: The metric name for this resource. + example: test.metric.latency type: string - RUMAggregateBucketValueTimeseries: - description: A timeseries array. - items: - $ref: '#/components/schemas/RUMAggregateBucketValueTimeseriesPoint' - type: array - x-generate-alias-as-model: true - RUMAggregateBucketValueTimeseriesPoint: - description: A timeseries point. + MetricOrigin: + description: Metric origin information. properties: - time: - description: The time value for this point. - example: '2020-06-08T11:55:00.123Z' - format: date-time - type: string - value: - description: The value for this point. - example: 19 - format: double - type: number + metric_type: + default: 0 + description: The origin metric type code + format: int32 + maximum: 1000 + type: integer + product: + default: 0 + description: The origin product code + format: int32 + maximum: 1000 + type: integer + service: + default: 0 + description: The origin service code + format: int32 + maximum: 1000 + type: integer type: object - RUMAggregateRequest: - description: The object sent with the request to retrieve aggregation buckets - of RUM events from your organization. + MetricPayload: + description: The metrics' payload. properties: - compute: - description: The list of metrics or timeseries to compute for the retrieved - buckets. - items: - $ref: '#/components/schemas/RUMCompute' - type: array - filter: - $ref: '#/components/schemas/RUMQueryFilter' - group_by: - description: The rules for the group by. + series: + description: A list of time series to submit to Datadog. + example: + - metric: system.load.1 + points: + - timestamp: 1475317847 + value: 0.7 + resources: + - name: dummyhost + type: host items: - $ref: '#/components/schemas/RUMGroupBy' + $ref: '#/components/schemas/MetricSeries' type: array - options: - $ref: '#/components/schemas/RUMQueryOptions' - page: - $ref: '#/components/schemas/RUMQueryPageOptions' + required: + - series type: object - RUMAggregateSort: - description: A sort rule. + MetricPoint: + description: A point object is of the form `{POSIX_timestamp, numeric_value}`. example: - aggregation: count - order: asc + timestamp: 1575317847 + value: 0.5 properties: - aggregation: - $ref: '#/components/schemas/RUMAggregationFunction' - metric: - description: The metric to sort by (only used for `type=measure`). - example: '@duration' + timestamp: + description: 'The timestamp should be in seconds and current. + + Current is defined as not more than 10 minutes in the future or more than + 1 hour in the past.' + format: int64 + type: integer + value: + description: The numeric value format should be a 64bit float gauge-type + value. + format: double + type: number + type: object + MetricResource: + description: Metric resource. + example: + name: dummyhost + type: host + properties: + name: + description: The name of the resource. type: string - order: - $ref: '#/components/schemas/RUMSortOrder' type: - $ref: '#/components/schemas/RUMAggregateSortType' + description: The type of the resource. + type: string type: object - RUMAggregateSortType: - default: alphabetical - description: The type of sorting algorithm. - enum: - - alphabetical - - measure - type: string - x-enum-varnames: - - ALPHABETICAL - - MEASURE - RUMAggregationBucketsResponse: - description: The query results. + MetricSeries: + description: 'A metric to submit to Datadog. + + See [Datadog metrics](https://docs.datadoghq.com/developers/metrics/#custom-metrics-properties).' properties: - buckets: - description: The list of matching buckets, one item per bucket. + interval: + description: If the type of the metric is rate or count, define the corresponding + interval. + example: 20 + format: int64 + type: integer + metadata: + $ref: '#/components/schemas/MetricMetadata' + metric: + description: The name of the timeseries. + example: system.load.1 + type: string + points: + description: Points relating to a metric. All points must be objects with + timestamp and a scalar value (cannot be a string). Timestamps should be + in POSIX time in seconds, and cannot be more than ten minutes in the future + or more than one hour in the past. items: - $ref: '#/components/schemas/RUMBucketResponse' + $ref: '#/components/schemas/MetricPoint' type: array + resources: + description: A list of resources to associate with this metric. + items: + $ref: '#/components/schemas/MetricResource' + type: array + source_type_name: + description: The source type name. + example: datadog + type: string + tags: + description: A list of tags associated with the metric. + example: + - environment:test + items: + description: Individual tags. + type: string + type: array + type: + $ref: '#/components/schemas/MetricIntakeType' + unit: + description: The unit of point value. + example: second + type: string + required: + - metric + - points type: object - RUMAggregationFunction: - description: An aggregation function. - enum: - - count - - cardinality - - pc75 - - pc90 - - pc95 - - pc98 - - pc99 - - sum - - min - - max - - avg - - median - example: pc90 - type: string - x-enum-varnames: - - COUNT - - CARDINALITY - - PERCENTILE_75 - - PERCENTILE_90 - - PERCENTILE_95 - - PERCENTILE_98 - - PERCENTILE_99 - - SUM - - MIN - - MAX - - AVG - - MEDIAN - RUMAnalyticsAggregateResponse: - description: The response object for the RUM events aggregate API endpoint. + MetricSuggestedAggregations: + description: List of aggregation combinations that have been actively queried. + example: + - space: sum + time: sum + - space: sum + time: count + items: + $ref: '#/components/schemas/MetricCustomAggregation' + type: array + MetricSuggestedTagsAndAggregations: + description: Object for a single metric's actively queried tags and aggregations. + properties: + attributes: + $ref: '#/components/schemas/MetricSuggestedTagsAttributes' + id: + $ref: '#/components/schemas/MetricName' + type: + $ref: '#/components/schemas/MetricActiveConfigurationType' + type: object + MetricSuggestedTagsAndAggregationsResponse: + description: Response object that includes a single metric's actively queried + tags and aggregations. properties: data: - $ref: '#/components/schemas/RUMAggregationBucketsResponse' - links: - $ref: '#/components/schemas/RUMResponseLinks' - meta: - $ref: '#/components/schemas/RUMResponseMetadata' + $ref: '#/components/schemas/MetricSuggestedTagsAndAggregations' + readOnly: true type: object - RUMApplication: - description: RUM application. + MetricSuggestedTagsAttributes: + description: Object containing the definition of a metric's actively queried + tags and aggregations. + properties: + active_aggregations: + $ref: '#/components/schemas/MetricSuggestedAggregations' + active_tags: + description: List of tag keys that have been actively queried. + example: + - app + - datacenter + items: + description: Actively queried tag keys. + type: string + type: array + type: object + MetricTagConfiguration: + description: Object for a single metric tag configuration. + example: + attributes: + aggregations: + - space: avg + time: avg + created_at: '2020-03-25T09:48:37.463835Z' + metric_type: gauge + modified_at: '2020-04-25T09:48:37.463835Z' + tags: + - app + - datacenter + id: http.request.latency + type: manage_tags properties: attributes: - $ref: '#/components/schemas/RUMApplicationAttributes' + $ref: '#/components/schemas/MetricTagConfigurationAttributes' id: - description: RUM application ID. - example: abcd1234-0000-0000-abcd-1234abcd5678 - type: string + $ref: '#/components/schemas/MetricName' type: - $ref: '#/components/schemas/RUMApplicationType' - required: - - attributes - - id - - type + $ref: '#/components/schemas/MetricTagConfigurationType' type: object - RUMApplicationAttributes: - description: RUM application attributes. + MetricTagConfigurationAttributes: + description: Object containing the definition of a metric tag configuration + attributes. properties: - application_id: - description: ID of the RUM application. - example: abcd1234-0000-0000-abcd-1234abcd5678 - type: string + aggregations: + $ref: '#/components/schemas/MetricCustomAggregations' created_at: - description: Timestamp in ms of the creation date. - example: 1659479836169 - format: int64 - type: integer - created_by_handle: - description: Handle of the creator user. - example: john.doe - type: string - hash: - description: Client token of the RUM application. - example: abcd1234efgh5678ijkl90abcd1234efgh0 - type: string - name: - description: Name of the RUM application. - example: my_rum_application - type: string - org_id: - description: Org ID of the RUM application. - example: 999 - format: int32 - maximum: 2147483647 - type: integer - type: - description: Type of the RUM application. Supported values are `browser`, - `ios`, `android`, `react-native`, `flutter`. - example: browser + description: Timestamp when the tag configuration was created. + example: '2020-03-25T09:48:37.463835Z' + format: date-time type: string - updated_at: - description: Timestamp in ms of the last update date. - example: 1659479836169 - format: int64 - type: integer - updated_by_handle: - description: Handle of the updater user. - example: jane.doe + include_percentiles: + description: 'Toggle to turn on/off percentile aggregations for distribution + metrics. + + Only present when the `metric_type` is `distribution`.' + example: true + type: boolean + metric_type: + $ref: '#/components/schemas/MetricTagConfigurationMetricTypes' + modified_at: + description: Timestamp when the tag configuration was last modified. + example: '2020-03-25T09:48:37.463835Z' + format: date-time type: string - required: - - application_id - - created_at - - created_by_handle - - name - - org_id - - type - - updated_at - - updated_by_handle + tags: + description: List of tag keys on which to group. + example: + - app + - datacenter + items: + description: Tag keys to group by. + type: string + type: array type: object - RUMApplicationCreate: - description: RUM application creation. + MetricTagConfigurationCreateAttributes: + description: Object containing the definition of a metric tag configuration + to be created. properties: - attributes: - $ref: '#/components/schemas/RUMApplicationCreateAttributes' - type: - $ref: '#/components/schemas/RUMApplicationCreateType' + aggregations: + $ref: '#/components/schemas/MetricCustomAggregations' + include_percentiles: + description: 'Toggle to include/exclude percentiles for a distribution metric. + + Defaults to false. Can only be applied to metrics that have a `metric_type` + of `distribution`.' + example: true + type: boolean + metric_type: + $ref: '#/components/schemas/MetricTagConfigurationMetricTypes' + tags: + default: [] + description: A list of tag keys that will be queryable for your metric. + example: + - app + - datacenter + items: + description: Tag keys to group by. + type: string + type: array required: - - attributes - - type + - tags + - metric_type type: object - RUMApplicationCreateAttributes: - description: RUM application creation attributes. + MetricTagConfigurationCreateData: + description: Object for a single metric to be configure tags on. + example: + attributes: + include_percentiles: false + metric_type: distribution + tags: + - app + - datacenter + id: http.endpoint.request + type: manage_tags properties: - name: - description: Name of the RUM application. - example: my_new_rum_application - type: string + attributes: + $ref: '#/components/schemas/MetricTagConfigurationCreateAttributes' + id: + $ref: '#/components/schemas/MetricName' type: - description: Type of the RUM application. Supported values are `browser`, - `ios`, `android`, `react-native`, `flutter`. - example: browser - type: string + $ref: '#/components/schemas/MetricTagConfigurationType' required: - - name + - id + - type type: object - RUMApplicationCreateRequest: - description: RUM application creation request attributes. + MetricTagConfigurationCreateRequest: + description: Request object that includes the metric that you would like to + configure tags for. properties: data: - $ref: '#/components/schemas/RUMApplicationCreate' + $ref: '#/components/schemas/MetricTagConfigurationCreateData' required: - data type: object - RUMApplicationCreateType: - default: rum_application_create - description: RUM application creation type. + MetricTagConfigurationMetricTypes: + default: gauge + description: The metric's type. enum: - - rum_application_create - example: rum_application_create + - gauge + - count + - rate + - distribution + example: count type: string x-enum-varnames: - - RUM_APPLICATION_CREATE - RUMApplicationResponse: - description: RUM application response. + - GAUGE + - COUNT + - RATE + - DISTRIBUTION + MetricTagConfigurationResponse: + description: Response object which includes a single metric's tag configuration. properties: data: - $ref: '#/components/schemas/RUMApplication' + $ref: '#/components/schemas/MetricTagConfiguration' + readOnly: true type: object - RUMApplicationType: - default: rum_application - description: RUM application response type. + MetricTagConfigurationType: + default: manage_tags + description: The metric tag configuration resource type. enum: - - rum_application - example: rum_application + - manage_tags + example: manage_tags type: string x-enum-varnames: - - RUM_APPLICATION - RUMApplicationUpdate: - description: RUM application update. + - MANAGE_TAGS + MetricTagConfigurationUpdateAttributes: + description: Object containing the definition of a metric tag configuration + to be updated. properties: + aggregations: + $ref: '#/components/schemas/MetricCustomAggregations' + include_percentiles: + description: 'Toggle to include/exclude percentiles for a distribution metric. + + Defaults to false. Can only be applied to metrics that have a `metric_type` + of `distribution`.' + example: true + type: boolean + tags: + default: [] + description: A list of tag keys that will be queryable for your metric. + example: + - app + - datacenter + items: + description: Tag keys to group by. + type: string + type: array + type: object + MetricTagConfigurationUpdateData: + description: Object for a single tag configuration to be edited. + example: attributes: - $ref: '#/components/schemas/RUMApplicationUpdateAttributes' + group_by: + - app + - datacenter + include_percentiles: false + id: http.endpoint.request + type: manage_tags + properties: + attributes: + $ref: '#/components/schemas/MetricTagConfigurationUpdateAttributes' id: - description: RUM application ID. - example: abcd1234-0000-0000-abcd-1234abcd5678 - type: string + $ref: '#/components/schemas/MetricName' type: - $ref: '#/components/schemas/RUMApplicationUpdateType' + $ref: '#/components/schemas/MetricTagConfigurationType' required: - id - type type: object - RUMApplicationUpdateAttributes: - description: RUM application update attributes. - properties: - name: - description: Name of the RUM application. - example: updated_name_for_my_existing_rum_application - type: string - type: - description: Type of the RUM application. Supported values are `browser`, - `ios`, `android`, `react-native`, `flutter`. - example: browser - type: string - type: object - RUMApplicationUpdateRequest: - description: RUM application update request. + MetricTagConfigurationUpdateRequest: + description: Request object that includes the metric that you would like to + edit the tag configuration on. properties: data: - $ref: '#/components/schemas/RUMApplicationUpdate' + $ref: '#/components/schemas/MetricTagConfigurationUpdateData' required: - data type: object - RUMApplicationUpdateType: - default: rum_application_update - description: RUM application update type. + MetricType: + default: metrics + description: The metric resource type. enum: - - rum_application_update - example: rum_application_update + - metrics + example: metrics type: string x-enum-varnames: - - RUM_APPLICATION_UPDATE - RUMApplicationsResponse: - description: RUM applications response. + - METRICS + MetricVolumes: + description: Possible response objects for a metric's volume. + oneOf: + - $ref: '#/components/schemas/MetricDistinctVolume' + - $ref: '#/components/schemas/MetricIngestedIndexedVolume' + type: object + MetricVolumesResponse: + description: Response object which includes a single metric's volume. properties: data: - description: RUM applications array response. + $ref: '#/components/schemas/MetricVolumes' + readOnly: true + type: object + MetricsAndMetricTagConfigurations: + description: Object for a metrics and metric tag configurations. + oneOf: + - $ref: '#/components/schemas/Metric' + - $ref: '#/components/schemas/MetricTagConfiguration' + type: object + MetricsAndMetricTagConfigurationsResponse: + description: Response object that includes metrics and metric tag configurations. + properties: + data: + description: Array of metrics and metric tag configurations. items: - $ref: '#/components/schemas/RUMApplication' + $ref: '#/components/schemas/MetricsAndMetricTagConfigurations' type: array + readOnly: true type: object - RUMBucketResponse: - description: Bucket values. + MonitorType: + description: Attributes from the monitor that triggered the event. + nullable: true properties: - by: - additionalProperties: - description: The values for each group-by. + created_at: + description: The POSIX timestamp of the monitor's creation in nanoseconds. + example: 1646318692000 + format: int64 + type: integer + group_status: + description: Monitor group status used when there is no `result_groups`. + format: int32 + maximum: 2147483647 + type: integer + groups: + description: Groups to which the monitor belongs. + items: + description: A group. type: string - description: The key-value pairs for each group-by. - example: - '@session.type': user - '@type': view - type: object - computes: - additionalProperties: - $ref: '#/components/schemas/RUMAggregateBucketValue' - description: A map of the metric name to value for regular compute, or a - list of values for a timeseries. - type: object - type: object - RUMCompute: - description: A compute rule to compute metrics or timeseries. - properties: - aggregation: - $ref: '#/components/schemas/RUMAggregationFunction' - interval: - description: 'The time buckets'' size (only used for type=timeseries) - - Defaults to a resolution of 150 points.' - example: 5m + type: array + id: + description: The monitor ID. + format: int64 + type: integer + message: + description: The monitor message. type: string - metric: - description: The metric to use. - example: '@duration' + modified: + description: The monitor's last-modified timestamp. + format: int64 + type: integer + name: + description: The monitor name. + type: string + query: + description: The query that triggers the alert. + type: string + tags: + description: A list of tags attached to the monitor. + example: + - environment:test + items: + description: A tag. + type: string + type: array + templated_name: + description: The templated name of the monitor before resolving any template + variables. type: string type: - $ref: '#/components/schemas/RUMComputeType' + description: The monitor type. + type: string + type: object + NullableRelationshipToUser: + description: Relationship to user. + properties: + data: + $ref: '#/components/schemas/NullableRelationshipToUserData' required: - - aggregation + - data type: object - RUMComputeType: - default: total - description: The type of compute. - enum: - - timeseries - - total - type: string - x-enum-varnames: - - TIMESERIES - - TOTAL - RUMEvent: - description: Object description of a RUM event after being processed and stored - by Datadog. + NullableRelationshipToUserData: + description: Relationship to user object. + nullable: true properties: - attributes: - $ref: '#/components/schemas/RUMEventAttributes' id: - description: Unique ID of the event. - example: AAAAAWgN8Xwgr1vKDQAAAABBV2dOOFh3ZzZobm1mWXJFYTR0OA + description: A unique identifier that represents the user. + example: 00000000-0000-0000-0000-000000000000 type: string type: - $ref: '#/components/schemas/RUMEventType' + $ref: '#/components/schemas/UsersType' + required: + - id + - type type: object - RUMEventAttributes: - description: JSON object containing all event attributes and their associated - values. + OpsgenieServiceCreateAttributes: + description: The Opsgenie service attributes for a create request. properties: - attributes: - additionalProperties: {} - description: JSON object of attributes from RUM events. - example: - customAttribute: 123 - duration: 2345 - type: object - service: - description: 'The name of the application or service generating RUM events. - - It is used to switch from RUM to APM, so make sure you define the same - - value when you use both products.' - example: web-app + custom_url: + description: The custom URL for a custom region. + example: https://example.com type: string - tags: - description: Array of tags associated with your event. - example: - - team:A - items: - description: Tag associated with your event. - type: string - type: array - timestamp: - description: Timestamp of your event. - example: '2019-01-02T09:42:36.320Z' - format: date-time + name: + description: The name for the Opsgenie service. + example: fake-opsgenie-service-name + type: string + opsgenie_api_key: + description: The Opsgenie API key for your Opsgenie service. + example: 00000000-0000-0000-0000-000000000000 type: string + region: + $ref: '#/components/schemas/OpsgenieServiceRegionType' + required: + - name + - opsgenie_api_key + - region type: object - RUMEventType: - default: rum - description: Type of the event. + OpsgenieServiceCreateData: + description: Opsgenie service data for a create request. + properties: + attributes: + $ref: '#/components/schemas/OpsgenieServiceCreateAttributes' + type: + $ref: '#/components/schemas/OpsgenieServiceType' + required: + - type + - attributes + type: object + OpsgenieServiceCreateRequest: + description: Create request for an Opsgenie service. + properties: + data: + $ref: '#/components/schemas/OpsgenieServiceCreateData' + required: + - data + type: object + OpsgenieServiceRegionType: + description: The region for the Opsgenie service. enum: - - rum - example: rum + - us + - eu + - custom + example: us type: string x-enum-varnames: - - RUM - RUMEventsResponse: - description: Response object with all events matching the request and pagination - information. + - US + - EU + - CUSTOM + OpsgenieServiceResponse: + description: Response of an Opsgenie service. properties: data: - description: Array of events matching the request. - items: - $ref: '#/components/schemas/RUMEvent' - type: array - links: - $ref: '#/components/schemas/RUMResponseLinks' - meta: - $ref: '#/components/schemas/RUMResponseMetadata' + $ref: '#/components/schemas/OpsgenieServiceResponseData' + required: + - data type: object - RUMGroupBy: - description: A group-by rule. + OpsgenieServiceResponseAttributes: + description: The attributes from an Opsgenie service response. properties: - facet: - description: The name of the facet to use (required). - example: '@view.time_spent' + custom_url: + description: The custom URL for a custom region. + example: null + nullable: true type: string - histogram: - $ref: '#/components/schemas/RUMGroupByHistogram' - limit: - default: 10 - description: The maximum buckets to return for this group-by. - format: int64 - type: integer - missing: - $ref: '#/components/schemas/RUMGroupByMissing' - sort: - $ref: '#/components/schemas/RUMAggregateSort' - total: - $ref: '#/components/schemas/RUMGroupByTotal' - required: - - facet + name: + description: The name for the Opsgenie service. + example: fake-opsgenie-service-name + type: string + region: + $ref: '#/components/schemas/OpsgenieServiceRegionType' type: object - RUMGroupByHistogram: - description: 'Used to perform a histogram computation (only for measure facets). - - Note: At most 100 buckets are allowed, the number of buckets is (max - min)/interval.' + OpsgenieServiceResponseData: + description: Opsgenie service data from a response. properties: - interval: - description: The bin size of the histogram buckets. - example: 10 - format: double - type: number - max: - description: 'The maximum value for the measure used in the histogram - - (values greater than this one are filtered out).' - example: 100 - format: double - type: number - min: - description: 'The minimum value for the measure used in the histogram - - (values smaller than this one are filtered out).' - example: 50 - format: double - type: number + attributes: + $ref: '#/components/schemas/OpsgenieServiceResponseAttributes' + id: + description: The ID of the Opsgenie service. + example: 596da4af-0563-4097-90ff-07230c3f9db3 + type: string + type: + $ref: '#/components/schemas/OpsgenieServiceType' required: - - interval - - min - - max + - id + - type + - attributes type: object - RUMGroupByMissing: - description: The value to use for logs that don't have the facet used to group - by. - oneOf: - - $ref: '#/components/schemas/RUMGroupByMissingString' - - $ref: '#/components/schemas/RUMGroupByMissingNumber' - RUMGroupByMissingNumber: - description: The missing value to use if there is a number valued facet. - format: double - type: number - RUMGroupByMissingString: - description: The missing value to use if there is string valued facet. - type: string - RUMGroupByTotal: - default: false - description: A resulting object to put the given computes in over all the matching - records. - oneOf: - - $ref: '#/components/schemas/RUMGroupByTotalBoolean' - - $ref: '#/components/schemas/RUMGroupByTotalString' - - $ref: '#/components/schemas/RUMGroupByTotalNumber' - RUMGroupByTotalBoolean: - description: If set to true, creates an additional bucket labeled "$facet_total". - type: boolean - RUMGroupByTotalNumber: - description: A number to use as the key value for the total bucket. - format: double - type: number - RUMGroupByTotalString: - description: A string to use as the key value for the total bucket. + OpsgenieServiceType: + default: opsgenie-service + description: Opsgenie service resource type. + enum: + - opsgenie-service + example: opsgenie-service type: string - RUMQueryFilter: - description: The search and filter query settings. + x-enum-varnames: + - OPSGENIE_SERVICE + OpsgenieServiceUpdateAttributes: + description: The Opsgenie service attributes for an update request. properties: - from: - default: now-15m - description: The minimum time for the requested events; supports date, math, - and regular timestamps (in milliseconds). - example: now-15m + custom_url: + description: The custom URL for a custom region. + example: https://example.com + nullable: true type: string - query: - default: '*' - description: The search query following the RUM search syntax. - example: '@type:session AND @session.type:user' + name: + description: The name for the Opsgenie service. + example: fake-opsgenie-service-name type: string - to: - default: now - description: The maximum time for the requested events; supports date, math, - and regular timestamps (in milliseconds). - example: now + opsgenie_api_key: + description: The Opsgenie API key for your Opsgenie service. + example: 00000000-0000-0000-0000-000000000000 type: string + region: + $ref: '#/components/schemas/OpsgenieServiceRegionType' type: object - RUMQueryOptions: - description: 'Global query options that are used during the query. - - Note: Only supply timezone or time offset, not both. Otherwise, the query - fails.' + OpsgenieServiceUpdateData: + description: Opsgenie service for an update request. properties: - time_offset: - description: The time offset (in seconds) to apply to the query. - format: int64 - type: integer - timezone: - default: UTC - description: 'The timezone can be specified both as an offset, for example: - "UTC+03:00".' - example: GMT + attributes: + $ref: '#/components/schemas/OpsgenieServiceUpdateAttributes' + id: + description: The ID of the Opsgenie service. + example: 596da4af-0563-4097-90ff-07230c3f9db3 type: string + type: + $ref: '#/components/schemas/OpsgenieServiceType' + required: + - id + - type + - attributes type: object - RUMQueryPageOptions: - description: Paging attributes for listing events. + OpsgenieServiceUpdateRequest: + description: Update request for an Opsgenie service. properties: - cursor: - description: List following results with a cursor provided in the previous - query. - example: eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ== - type: string - limit: - default: 10 - description: Maximum number of events in the response. - example: 25 - format: int32 - maximum: 1000 - type: integer + data: + $ref: '#/components/schemas/OpsgenieServiceUpdateData' + required: + - data type: object - RUMResponseLinks: - description: Links attributes. + OpsgenieServicesResponse: + description: Response with a list of Opsgenie services. properties: - next: - description: 'Link for the next set of results. Note that the request can - also be made using the - - POST endpoint.' - example: https://app.datadoghq.com/api/v2/rum/event?filter[query]=foo&page[cursor]=eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ== - type: string + data: + description: An array of Opsgenie services. + example: + - attributes: + custom_url: null + name: fake-opsgenie-service-name + region: us + id: 596da4af-0563-4097-90ff-07230c3f9db3 + type: opsgenie-service + - attributes: + custom_url: null + name: fake-opsgenie-service-name-2 + region: eu + id: 0d2937f1-b561-44fa-914a-99910f848014 + type: opsgenie-service + items: + $ref: '#/components/schemas/OpsgenieServiceResponseData' + type: array + required: + - data type: object - RUMResponseMetadata: - description: The metadata associated with a request. + Organization: + description: Organization object. properties: - elapsed: - description: The time elapsed in milliseconds. - example: 132 - format: int64 - type: integer - page: - $ref: '#/components/schemas/RUMResponsePage' - request_id: - description: The identifier of the request. - example: MWlFUjVaWGZTTTZPYzM0VXp1OXU2d3xLSVpEMjZKQ0VKUTI0dEYtM3RSOFVR + attributes: + $ref: '#/components/schemas/OrganizationAttributes' + id: + description: ID of the organization. type: string - status: - $ref: '#/components/schemas/RUMResponseStatus' - warnings: - description: 'A list of warnings (non-fatal errors) encountered. Partial - results may return if - - warnings are present in the response.' - items: - $ref: '#/components/schemas/RUMWarning' - type: array + type: + $ref: '#/components/schemas/OrganizationsType' + required: + - type type: object - RUMResponsePage: - description: Paging attributes. + OrganizationAttributes: + description: Attributes of the organization. properties: - after: - description: The cursor to use to get the next results, if any. To make - the next request, use the same parameters with the addition of `page[cursor]`. - example: eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ== + created_at: + description: Creation time of the organization. + format: date-time + type: string + description: + description: Description of the organization. + type: string + disabled: + description: Whether or not the organization is disabled. + type: boolean + modified_at: + description: Time of last organization modification. + format: date-time + type: string + name: + description: Name of the organization. + type: string + public_id: + description: Public ID of the organization. + type: string + sharing: + description: Sharing type of the organization. + type: string + url: + description: URL of the site that this organization exists at. type: string type: object - RUMResponseStatus: - description: The status of the response. + OrganizationsType: + default: orgs + description: Organizations resource type. enum: - - done - - timeout - example: done + - orgs + example: orgs type: string x-enum-varnames: - - DONE - - TIMEOUT - RUMSearchEventsRequest: - description: The request for a RUM events list. + - ORGS + Pagination: + description: Pagination object. properties: - filter: - $ref: '#/components/schemas/RUMQueryFilter' - options: - $ref: '#/components/schemas/RUMQueryOptions' - page: - $ref: '#/components/schemas/RUMQueryPageOptions' - sort: - $ref: '#/components/schemas/RUMSort' + total_count: + description: Total count. + format: int64 + type: integer + total_filtered_count: + description: Total count of elements matched by the filter. + format: int64 + type: integer type: object - RUMSort: - description: Sort parameters when querying events. - enum: - - timestamp - - -timestamp - type: string - x-enum-varnames: - - TIMESTAMP_ASCENDING - - TIMESTAMP_DESCENDING - RUMSortOrder: - description: The order to use, ascending or descending. - enum: - - asc - - desc - example: asc - type: string - x-enum-varnames: - - ASCENDING - - DESCENDING - RUMWarning: - description: A warning message indicating something that went wrong with the - query. + PartialAPIKey: + description: Partial Datadog API key. properties: - code: - description: A unique code for this type of warning. - example: unknown_index - type: string - detail: - description: A detailed explanation of this specific warning. - example: 'indexes: foo, bar' - type: string - title: - description: A short human-readable summary of the warning. - example: One or several indexes are missing or invalid, results hold data - from the other indexes + attributes: + $ref: '#/components/schemas/PartialAPIKeyAttributes' + id: + description: ID of the API key. type: string + relationships: + $ref: '#/components/schemas/APIKeyRelationships' + type: + $ref: '#/components/schemas/APIKeysType' type: object - RelationshipToIncidentAttachment: - description: A relationship reference for attachments. + PartialAPIKeyAttributes: + description: Attributes of a partial API key. properties: - data: - description: An array of incident attachments. - items: - $ref: '#/components/schemas/RelationshipToIncidentAttachmentData' - type: array - required: - - data + created_at: + description: Creation date of the API key. + example: '2020-11-23T10:00:00.000Z' + readOnly: true + type: string + last4: + description: The last four characters of the API key. + example: abcd + maxLength: 4 + minLength: 4 + readOnly: true + type: string + modified_at: + description: Date the API key was last modified. + example: '2020-11-23T10:00:00.000Z' + readOnly: true + type: string + name: + description: Name of the API key. + example: API Key for submitting metrics + type: string type: object - RelationshipToIncidentAttachmentData: - description: The attachment relationship data. + PartialApplicationKey: + description: Partial Datadog application key. properties: + attributes: + $ref: '#/components/schemas/PartialApplicationKeyAttributes' id: - description: A unique identifier that represents the attachment. - example: 00000000-0000-abcd-1000-000000000000 + description: ID of the application key. type: string + relationships: + $ref: '#/components/schemas/ApplicationKeyRelationships' type: - $ref: '#/components/schemas/IncidentAttachmentType' - required: - - id - - type + $ref: '#/components/schemas/ApplicationKeysType' type: object - RelationshipToIncidentIntegrationMetadataData: - description: A relationship reference for an integration metadata object. - example: - id: 00000000-abcd-0002-0000-000000000000 - type: incident_integrations + PartialApplicationKeyAttributes: + description: Attributes of a partial application key. properties: - id: - description: A unique identifier that represents the integration metadata. - example: 00000000-abcd-0001-0000-000000000000 + created_at: + description: Creation date of the application key. + example: '2020-11-23T10:00:00.000Z' + readOnly: true type: string - type: - $ref: '#/components/schemas/IncidentIntegrationMetadataType' - required: - - id - - type - type: object - RelationshipToIncidentIntegrationMetadatas: - description: A relationship reference for multiple integration metadata objects. - example: - data: - - id: 00000000-abcd-0005-0000-000000000000 - type: incident_integrations - - id: 00000000-abcd-0006-0000-000000000000 - type: incident_integrations - properties: - data: - description: The integration metadata relationship array + last4: + description: The last four characters of the application key. + example: abcd + maxLength: 4 + minLength: 4 + readOnly: true + type: string + name: + description: Name of the application key. + example: Application Key for managing dashboards + type: string + scopes: + description: Array of scopes to grant the application key. This feature + is in private beta, please contact Datadog support to enable scopes for + your application keys. example: - - id: 00000000-abcd-0003-0000-000000000000 - type: incident_integrations - - id: 00000000-abcd-0004-0000-000000000000 - type: incident_integrations + - dashboards_read + - dashboards_write + - dashboards_public_share items: - $ref: '#/components/schemas/RelationshipToIncidentIntegrationMetadataData' + description: Name of scope. + type: string + nullable: true type: array - required: - - data type: object - RelationshipToIncidentPostmortem: - description: A relationship reference for postmortems. - example: - data: - id: 00000000-0000-abcd-3000-000000000000 - type: incident_postmortems + PartialApplicationKeyResponse: + description: Response for retrieving a partial application key. properties: data: - $ref: '#/components/schemas/RelationshipToIncidentPostmortemData' - required: - - data + $ref: '#/components/schemas/PartialApplicationKey' + included: + description: Array of objects related to the application key. + items: + $ref: '#/components/schemas/ApplicationKeyResponseIncludedItem' + type: array type: object - RelationshipToIncidentPostmortemData: - description: The postmortem relationship data. - example: - id: 00000000-0000-abcd-2000-000000000000 - type: incident_postmortems + Permission: + description: Permission object. properties: + attributes: + $ref: '#/components/schemas/PermissionAttributes' id: - description: A unique identifier that represents the postmortem. - example: 00000000-0000-abcd-1000-000000000000 + description: ID of the permission. type: string type: - $ref: '#/components/schemas/IncidentPostmortemType' + $ref: '#/components/schemas/PermissionsType' required: - - id - type type: object - RelationshipToOrganization: - description: Relationship to an organization. - properties: - data: - $ref: '#/components/schemas/RelationshipToOrganizationData' - required: - - data - type: object - RelationshipToOrganizationData: - description: Relationship to organization object. + PermissionAttributes: + description: Attributes of a permission. properties: - id: - description: ID of the organization. - example: 00000000-0000-beef-0000-000000000000 + created: + description: Creation time of the permission. + format: date-time type: string - type: - $ref: '#/components/schemas/OrganizationsType' - required: - - id - - type + description: + description: Description of the permission. + type: string + display_name: + description: Displayed name for the permission. + type: string + display_type: + description: Display type. + type: string + group_name: + description: Name of the permission group. + type: string + name: + description: Name of the permission. + type: string + restricted: + description: Whether or not the permission is restricted. + type: boolean type: object - RelationshipToOrganizations: - description: Relationship to organizations. + PermissionsResponse: + description: Payload with API-returned permissions. properties: data: - description: Relationships to organization objects. - example: [] + description: Array of permissions. items: - $ref: '#/components/schemas/RelationshipToOrganizationData' + $ref: '#/components/schemas/Permission' type: array - required: - - data type: object - RelationshipToPermission: - description: Relationship to a permissions object. + PermissionsType: + default: permissions + description: Permissions resource type. + enum: + - permissions + example: permissions + type: string + x-enum-varnames: + - PERMISSIONS + ProcessSummariesMeta: + description: Response metadata object. properties: - data: - $ref: '#/components/schemas/RelationshipToPermissionData' + page: + $ref: '#/components/schemas/ProcessSummariesMetaPage' type: object - RelationshipToPermissionData: - description: Relationship to permission object. + ProcessSummariesMetaPage: + description: Paging attributes. properties: - id: - description: ID of the permission. + after: + description: 'The cursor used to get the next results, if any. To make the + next request, use the same + + parameters with the addition of the `page[cursor]`.' + example: 911abf1204838d9cdfcb9a96d0b6a1bd03e1b514074f1ce1737c4cbd type: string - type: - $ref: '#/components/schemas/PermissionsType' + size: + description: Number of results returned. + format: int32 + maximum: 10000 + minimum: 0 + type: integer type: object - RelationshipToPermissions: - description: Relationship to multiple permissions objects. + ProcessSummariesResponse: + description: List of process summaries. properties: data: - description: Relationships to permission objects. + description: Array of process summary objects. items: - $ref: '#/components/schemas/RelationshipToPermissionData' + $ref: '#/components/schemas/ProcessSummary' type: array + meta: + $ref: '#/components/schemas/ProcessSummariesMeta' type: object - RelationshipToRole: - description: Relationship to role. - properties: - data: - $ref: '#/components/schemas/RelationshipToRoleData' - type: object - RelationshipToRoleData: - description: Relationship to role object. + ProcessSummary: + description: Process summary object. properties: + attributes: + $ref: '#/components/schemas/ProcessSummaryAttributes' id: - description: The unique identifier of the role. - example: 3653d3c6-0c75-11ea-ad28-fb5701eabc7d + description: Process ID. type: string type: - $ref: '#/components/schemas/RolesType' + $ref: '#/components/schemas/ProcessSummaryType' type: object - RelationshipToRoles: - description: Relationship to roles. + ProcessSummaryAttributes: + description: Attributes for a process summary. properties: - data: - description: An array containing type and the unique identifier of a role. + cmdline: + description: Process command line. + type: string + host: + description: Host running the process. + type: string + pid: + description: Process ID. + format: int64 + type: integer + ppid: + description: Parent process ID. + format: int64 + type: integer + start: + description: Time the process was started. + type: string + tags: + description: List of tags associated with the process. items: - $ref: '#/components/schemas/RelationshipToRoleData' + description: A tag associated with the process. + type: string type: array - type: object - RelationshipToSAMLAssertionAttribute: - description: AuthN Mapping relationship to SAML Assertion Attribute. - properties: - data: - $ref: '#/components/schemas/RelationshipToSAMLAssertionAttributeData' - required: - - data - type: object - RelationshipToSAMLAssertionAttributeData: - description: Data of AuthN Mapping relationship to SAML Assertion Attribute. - properties: - id: - description: The ID of the SAML assertion attribute. - example: '0' + timestamp: + description: Time the process was seen. + type: string + user: + description: Process owner. type: string - type: - $ref: '#/components/schemas/SAMLAssertionAttributesType' - required: - - id - - type - type: object - RelationshipToUser: - description: Relationship to user. - properties: - data: - $ref: '#/components/schemas/RelationshipToUserData' - required: - - data type: object - RelationshipToUserData: - description: Relationship to user object. - properties: - id: - description: A unique identifier that represents the user. - example: 00000000-0000-0000-2345-000000000000 + ProcessSummaryType: + default: process + description: Type of process summary. + enum: + - process + example: process + type: string + x-enum-varnames: + - PROCESS + QuerySortOrder: + default: desc + description: Direction of sort. + enum: + - asc + - desc + type: string + x-enum-varnames: + - ASC + - DESC + RUMAggregateBucketValue: + description: A bucket value, can be either a timeseries or a single value. + oneOf: + - $ref: '#/components/schemas/RUMAggregateBucketValueSingleString' + - $ref: '#/components/schemas/RUMAggregateBucketValueSingleNumber' + - $ref: '#/components/schemas/RUMAggregateBucketValueTimeseries' + RUMAggregateBucketValueSingleNumber: + description: A single number value. + format: double + type: number + RUMAggregateBucketValueSingleString: + description: A single string value. + type: string + RUMAggregateBucketValueTimeseries: + description: A timeseries array. + items: + $ref: '#/components/schemas/RUMAggregateBucketValueTimeseriesPoint' + type: array + x-generate-alias-as-model: true + RUMAggregateBucketValueTimeseriesPoint: + description: A timeseries point. + properties: + time: + description: The time value for this point. + example: '2020-06-08T11:55:00.123Z' + format: date-time + type: string + value: + description: The value for this point. + example: 19 + format: double + type: number + type: object + RUMAggregateRequest: + description: The object sent with the request to retrieve aggregation buckets + of RUM events from your organization. + properties: + compute: + description: The list of metrics or timeseries to compute for the retrieved + buckets. + items: + $ref: '#/components/schemas/RUMCompute' + type: array + filter: + $ref: '#/components/schemas/RUMQueryFilter' + group_by: + description: The rules for the group by. + items: + $ref: '#/components/schemas/RUMGroupBy' + type: array + options: + $ref: '#/components/schemas/RUMQueryOptions' + page: + $ref: '#/components/schemas/RUMQueryPageOptions' + type: object + RUMAggregateSort: + description: A sort rule. + example: + aggregation: count + order: asc + properties: + aggregation: + $ref: '#/components/schemas/RUMAggregationFunction' + metric: + description: The metric to sort by (only used for `type=measure`). + example: '@duration' type: string + order: + $ref: '#/components/schemas/RUMSortOrder' type: - $ref: '#/components/schemas/UsersType' - required: - - id - - type + $ref: '#/components/schemas/RUMAggregateSortType' type: object - RelationshipToUsers: - description: Relationship to users. + RUMAggregateSortType: + default: alphabetical + description: The type of sorting algorithm. + enum: + - alphabetical + - measure + type: string + x-enum-varnames: + - ALPHABETICAL + - MEASURE + RUMAggregationBucketsResponse: + description: The query results. properties: - data: - description: Relationships to user objects. - example: [] + buckets: + description: The list of matching buckets, one item per bucket. items: - $ref: '#/components/schemas/RelationshipToUserData' + $ref: '#/components/schemas/RUMBucketResponse' type: array - required: - - data type: object - ResponseMetaAttributes: - description: Object describing meta attributes of response. + RUMAggregationFunction: + description: An aggregation function. + enum: + - count + - cardinality + - pc75 + - pc90 + - pc95 + - pc98 + - pc99 + - sum + - min + - max + - avg + - median + example: pc90 + type: string + x-enum-varnames: + - COUNT + - CARDINALITY + - PERCENTILE_75 + - PERCENTILE_90 + - PERCENTILE_95 + - PERCENTILE_98 + - PERCENTILE_99 + - SUM + - MIN + - MAX + - AVG + - MEDIAN + RUMAnalyticsAggregateResponse: + description: The response object for the RUM events aggregate API endpoint. properties: - page: - $ref: '#/components/schemas/Pagination' + data: + $ref: '#/components/schemas/RUMAggregationBucketsResponse' + links: + $ref: '#/components/schemas/RUMResponseLinks' + meta: + $ref: '#/components/schemas/RUMResponseMetadata' type: object - Role: - description: Role object returned by the API. + RUMApplication: + description: RUM application. properties: attributes: - $ref: '#/components/schemas/RoleAttributes' + $ref: '#/components/schemas/RUMApplicationAttributes' id: - description: The unique identifier of the role. + description: RUM application ID. + example: abcd1234-0000-0000-abcd-1234abcd5678 type: string - relationships: - $ref: '#/components/schemas/RoleResponseRelationships' type: - $ref: '#/components/schemas/RolesType' + $ref: '#/components/schemas/RUMApplicationType' required: + - attributes + - id - type type: object - RoleAttributes: - description: Attributes of the role. + RUMApplicationAttributes: + description: RUM application attributes. properties: + application_id: + description: ID of the RUM application. + example: abcd1234-0000-0000-abcd-1234abcd5678 + type: string created_at: - description: Creation time of the role. - format: date-time - readOnly: true + description: Timestamp in ms of the creation date. + example: 1659479836169 + format: int64 + type: integer + created_by_handle: + description: Handle of the creator user. + example: john.doe type: string - modified_at: - description: Time of last role modification. - format: date-time - readOnly: true + hash: + description: Client token of the RUM application. + example: abcd1234efgh5678ijkl90abcd1234efgh0 type: string name: - description: The name of the role. The name is neither unique nor a stable - identifier of the role. + description: Name of the RUM application. + example: my_rum_application type: string - user_count: - description: Number of users with that role. + org_id: + description: Org ID of the RUM application. + example: 999 + format: int32 + maximum: 2147483647 + type: integer + type: + description: Type of the RUM application. Supported values are `browser`, + `ios`, `android`, `react-native`, `flutter`. + example: browser + type: string + updated_at: + description: Timestamp in ms of the last update date. + example: 1659479836169 format: int64 - readOnly: true type: integer + updated_by_handle: + description: Handle of the updater user. + example: jane.doe + type: string + required: + - application_id + - created_at + - created_by_handle + - name + - org_id + - type + - updated_at + - updated_by_handle type: object - RoleClone: - description: Data for the clone role request. + RUMApplicationCreate: + description: RUM application creation. properties: attributes: - $ref: '#/components/schemas/RoleCloneAttributes' + $ref: '#/components/schemas/RUMApplicationCreateAttributes' type: - $ref: '#/components/schemas/RolesType' + $ref: '#/components/schemas/RUMApplicationCreateType' required: - - type - attributes + - type type: object - RoleCloneAttributes: - description: Attributes required to create a new role by cloning an existing - one. + RUMApplicationCreateAttributes: + description: RUM application creation attributes. properties: name: - description: Name of the new role that is cloned. - example: cloned-role + description: Name of the RUM application. + example: my_new_rum_application type: string - required: - - name - type: object - RoleCloneRequest: - description: Request to create a role by cloning an existing role. - properties: - data: - $ref: '#/components/schemas/RoleClone' - required: - - data - type: object - RoleCreateAttributes: - description: Attributes of the created role. - properties: - created_at: - description: Creation time of the role. - format: date-time - readOnly: true - type: string - modified_at: - description: Time of last role modification. - format: date-time - readOnly: true - type: string - name: - description: Name of the role. - example: developers + type: + description: Type of the RUM application. Supported values are `browser`, + `ios`, `android`, `react-native`, `flutter`. + example: browser type: string required: - name type: object - RoleCreateData: - description: Data related to the creation of a role. - properties: - attributes: - $ref: '#/components/schemas/RoleCreateAttributes' - relationships: - $ref: '#/components/schemas/RoleRelationships' - type: - $ref: '#/components/schemas/RolesType' - required: - - attributes - type: object - RoleCreateRequest: - description: Create a role. + RUMApplicationCreateRequest: + description: RUM application creation request attributes. properties: data: - $ref: '#/components/schemas/RoleCreateData' + $ref: '#/components/schemas/RUMApplicationCreate' required: - data type: object - RoleCreateResponse: - description: Response containing information about a created role. + RUMApplicationCreateType: + default: rum_application_create + description: RUM application creation type. + enum: + - rum_application_create + example: rum_application_create + type: string + x-enum-varnames: + - RUM_APPLICATION_CREATE + RUMApplicationResponse: + description: RUM application response. properties: data: - $ref: '#/components/schemas/RoleCreateResponseData' + $ref: '#/components/schemas/RUMApplication' type: object - RoleCreateResponseData: - description: Role object returned by the API. + RUMApplicationType: + default: rum_application + description: RUM application response type. + enum: + - rum_application + example: rum_application + type: string + x-enum-varnames: + - RUM_APPLICATION + RUMApplicationUpdate: + description: RUM application update. properties: attributes: - $ref: '#/components/schemas/RoleCreateAttributes' + $ref: '#/components/schemas/RUMApplicationUpdateAttributes' id: - description: The unique identifier of the role. + description: RUM application ID. + example: abcd1234-0000-0000-abcd-1234abcd5678 type: string - relationships: - $ref: '#/components/schemas/RoleResponseRelationships' type: - $ref: '#/components/schemas/RolesType' + $ref: '#/components/schemas/RUMApplicationUpdateType' required: + - id - type type: object - RoleRelationships: - description: Relationships of the role object. - properties: - permissions: - $ref: '#/components/schemas/RelationshipToPermissions' - users: - $ref: '#/components/schemas/RelationshipToUsers' - type: object - RoleResponse: - description: Response containing information about a single role. - properties: - data: - $ref: '#/components/schemas/Role' - type: object - RoleResponseRelationships: - description: Relationships of the role object returned by the API. - properties: - permissions: - $ref: '#/components/schemas/RelationshipToPermissions' - type: object - RoleUpdateAttributes: - description: Attributes of the role. + RUMApplicationUpdateAttributes: + description: RUM application update attributes. properties: - created_at: - description: Creation time of the role. - format: date-time - readOnly: true - type: string - modified_at: - description: Time of last role modification. - format: date-time - readOnly: true - type: string name: - description: Name of the role. - type: string - type: object - RoleUpdateData: - description: Data related to the update of a role. - properties: - attributes: - $ref: '#/components/schemas/RoleUpdateAttributes' - id: - description: The unique identifier of the role. - example: 00000000-0000-1111-0000-000000000000 + description: Name of the RUM application. + example: updated_name_for_my_existing_rum_application type: string - relationships: - $ref: '#/components/schemas/RoleRelationships' type: - $ref: '#/components/schemas/RolesType' - required: - - attributes - - type - - id + description: Type of the RUM application. Supported values are `browser`, + `ios`, `android`, `react-native`, `flutter`. + example: browser + type: string type: object - RoleUpdateRequest: - description: Update a role. + RUMApplicationUpdateRequest: + description: RUM application update request. properties: data: - $ref: '#/components/schemas/RoleUpdateData' + $ref: '#/components/schemas/RUMApplicationUpdate' required: - data type: object - RoleUpdateResponse: - description: Response containing information about an updated role. + RUMApplicationUpdateType: + default: rum_application_update + description: RUM application update type. + enum: + - rum_application_update + example: rum_application_update + type: string + x-enum-varnames: + - RUM_APPLICATION_UPDATE + RUMApplicationsResponse: + description: RUM applications response. properties: data: - $ref: '#/components/schemas/RoleUpdateResponseData' + description: RUM applications array response. + items: + $ref: '#/components/schemas/RUMApplication' + type: array type: object - RoleUpdateResponseData: - description: Role object returned by the API. + RUMBucketResponse: + description: Bucket values. properties: - attributes: - $ref: '#/components/schemas/RoleUpdateAttributes' - id: - description: The unique identifier of the role. + by: + additionalProperties: + description: The values for each group-by. + type: string + description: The key-value pairs for each group-by. + example: + '@session.type': user + '@type': view + type: object + computes: + additionalProperties: + $ref: '#/components/schemas/RUMAggregateBucketValue' + description: A map of the metric name to value for regular compute, or a + list of values for a timeseries. + type: object + type: object + RUMCompute: + description: A compute rule to compute metrics or timeseries. + properties: + aggregation: + $ref: '#/components/schemas/RUMAggregationFunction' + interval: + description: 'The time buckets'' size (only used for type=timeseries) + + Defaults to a resolution of 150 points.' + example: 5m + type: string + metric: + description: The metric to use. + example: '@duration' type: string - relationships: - $ref: '#/components/schemas/RoleResponseRelationships' type: - $ref: '#/components/schemas/RolesType' + $ref: '#/components/schemas/RUMComputeType' required: - - type - type: object - RolesResponse: - description: Response containing information about multiple roles. - properties: - data: - description: Array of returned roles. - items: - $ref: '#/components/schemas/Role' - type: array - meta: - $ref: '#/components/schemas/ResponseMetaAttributes' + - aggregation type: object - RolesSort: - default: name - description: Sorting options for roles. - enum: - - name - - -name - - modified_at - - -modified_at - - user_count - - -user_count - type: string - x-enum-varnames: - - NAME_ASCENDING - - NAME_DESCENDING - - MODIFIED_AT_ASCENDING - - MODIFIED_AT_DESCENDING - - USER_COUNT_ASCENDING - - USER_COUNT_DESCENDING - RolesType: - default: roles - description: Roles type. + RUMComputeType: + default: total + description: The type of compute. enum: - - roles - example: roles + - timeseries + - total type: string x-enum-varnames: - - ROLES - SAMLAssertionAttribute: - description: SAML assertion attribute. + - TIMESERIES + - TOTAL + RUMEvent: + description: Object description of a RUM event after being processed and stored + by Datadog. properties: attributes: - $ref: '#/components/schemas/SAMLAssertionAttributeAttributes' + $ref: '#/components/schemas/RUMEventAttributes' id: - description: The ID of the SAML assertion attribute. - example: '0' + description: Unique ID of the event. + example: AAAAAWgN8Xwgr1vKDQAAAABBV2dOOFh3ZzZobm1mWXJFYTR0OA type: string type: - $ref: '#/components/schemas/SAMLAssertionAttributesType' - required: - - id - - type + $ref: '#/components/schemas/RUMEventType' type: object - SAMLAssertionAttributeAttributes: - description: Key/Value pair of attributes used in SAML assertion attributes. + RUMEventAttributes: + description: JSON object containing all event attributes and their associated + values. properties: - attribute_key: - description: Key portion of a key/value pair of the attribute sent from - the Identity Provider. - example: member-of + attributes: + additionalProperties: {} + description: JSON object of attributes from RUM events. + example: + customAttribute: 123 + duration: 2345 + type: object + service: + description: 'The name of the application or service generating RUM events. + + It is used to switch from RUM to APM, so make sure you define the same + + value when you use both products.' + example: web-app type: string - attribute_value: - description: Value portion of a key/value pair of the attribute sent from - the Identity Provider. - example: Development + tags: + description: Array of tags associated with your event. + example: + - team:A + items: + description: Tag associated with your event. + type: string + type: array + timestamp: + description: Timestamp of your event. + example: '2019-01-02T09:42:36.320Z' + format: date-time type: string type: object - SAMLAssertionAttributesType: - default: saml_assertion_attributes - description: SAML assertion attributes resource type. + RUMEventType: + default: rum + description: Type of the event. enum: - - saml_assertion_attributes - example: saml_assertion_attributes + - rum + example: rum type: string x-enum-varnames: - - SAML_ASSERTION_ATTRIBUTES - SecurityFilter: - description: The security filter's properties. - properties: - attributes: - $ref: '#/components/schemas/SecurityFilterAttributes' - id: - $ref: '#/components/schemas/SecurityFilterID' - type: - $ref: '#/components/schemas/SecurityFilterType' - type: object - SecurityFilterAttributes: - description: The object describing a security filter. + - RUM + RUMEventsResponse: + description: Response object with all events matching the request and pagination + information. properties: - exclusion_filters: - description: The list of exclusion filters applied in this security filter. + data: + description: Array of events matching the request. items: - $ref: '#/components/schemas/SecurityFilterExclusionFilterResponse' + $ref: '#/components/schemas/RUMEvent' type: array - filtered_data_type: - $ref: '#/components/schemas/SecurityFilterFilteredDataType' - is_builtin: - description: Whether the security filter is the built-in filter. - example: false - type: boolean - is_enabled: - description: Whether the security filter is enabled. - example: false - type: boolean - name: - description: The security filter name. - example: Custom security filter - type: string - query: - description: The security filter query. Logs accepted by this query will - be accepted by this filter. - example: service:api - type: string - version: - description: The version of the security filter. - example: 1 - format: int32 - maximum: 2147483647 - type: integer + links: + $ref: '#/components/schemas/RUMResponseLinks' + meta: + $ref: '#/components/schemas/RUMResponseMetadata' type: object - SecurityFilterCreateAttributes: - description: Object containing the attributes of the security filter to be created. + RUMGroupBy: + description: A group-by rule. properties: - exclusion_filters: - description: Exclusion filters to exclude some logs from the security filter. - example: - - name: Exclude staging - query: source:staging - items: - $ref: '#/components/schemas/SecurityFilterExclusionFilter' - type: array - filtered_data_type: - $ref: '#/components/schemas/SecurityFilterFilteredDataType' - is_enabled: - description: Whether the security filter is enabled. - example: true - type: boolean - name: - description: The name of the security filter. - example: Custom security filter - type: string - query: - description: The query of the security filter. - example: service:api + facet: + description: The name of the facet to use (required). + example: '@view.time_spent' type: string + histogram: + $ref: '#/components/schemas/RUMGroupByHistogram' + limit: + default: 10 + description: The maximum buckets to return for this group-by. + format: int64 + type: integer + missing: + $ref: '#/components/schemas/RUMGroupByMissing' + sort: + $ref: '#/components/schemas/RUMAggregateSort' + total: + $ref: '#/components/schemas/RUMGroupByTotal' required: - - name - - query - - exclusion_filters - - filtered_data_type - - is_enabled - type: object - SecurityFilterCreateData: - description: Object for a single security filter. - properties: - attributes: - $ref: '#/components/schemas/SecurityFilterCreateAttributes' - type: - $ref: '#/components/schemas/SecurityFilterType' - required: - - type - - attributes + - facet type: object - SecurityFilterCreateRequest: - description: Request object that includes the security filter that you would - like to create. + RUMGroupByHistogram: + description: 'Used to perform a histogram computation (only for measure facets). + + Note: At most 100 buckets are allowed, the number of buckets is (max - min)/interval.' properties: - data: - $ref: '#/components/schemas/SecurityFilterCreateData' + interval: + description: The bin size of the histogram buckets. + example: 10 + format: double + type: number + max: + description: 'The maximum value for the measure used in the histogram + + (values greater than this one are filtered out).' + example: 100 + format: double + type: number + min: + description: 'The minimum value for the measure used in the histogram + + (values smaller than this one are filtered out).' + example: 50 + format: double + type: number required: - - data + - interval + - min + - max type: object - SecurityFilterExclusionFilter: - description: Exclusion filter for the security filter. - example: - name: Exclude staging - query: source:staging + RUMGroupByMissing: + description: The value to use for logs that don't have the facet used to group + by. + oneOf: + - $ref: '#/components/schemas/RUMGroupByMissingString' + - $ref: '#/components/schemas/RUMGroupByMissingNumber' + RUMGroupByMissingNumber: + description: The missing value to use if there is a number valued facet. + format: double + type: number + RUMGroupByMissingString: + description: The missing value to use if there is string valued facet. + type: string + RUMGroupByTotal: + default: false + description: A resulting object to put the given computes in over all the matching + records. + oneOf: + - $ref: '#/components/schemas/RUMGroupByTotalBoolean' + - $ref: '#/components/schemas/RUMGroupByTotalString' + - $ref: '#/components/schemas/RUMGroupByTotalNumber' + RUMGroupByTotalBoolean: + description: If set to true, creates an additional bucket labeled "$facet_total". + type: boolean + RUMGroupByTotalNumber: + description: A number to use as the key value for the total bucket. + format: double + type: number + RUMGroupByTotalString: + description: A string to use as the key value for the total bucket. + type: string + RUMQueryFilter: + description: The search and filter query settings. properties: - name: - description: Exclusion filter name. - example: Exclude staging + from: + default: now-15m + description: The minimum time for the requested events; supports date, math, + and regular timestamps (in milliseconds). + example: now-15m type: string query: - description: Exclusion filter query. Logs that match this query are excluded - from the security filter. - example: source:staging + default: '*' + description: The search query following the RUM search syntax. + example: '@type:session AND @session.type:user' type: string - required: - - name - - query - type: object - SecurityFilterExclusionFilterResponse: - description: A single exclusion filter. - properties: - name: - description: The exclusion filter name. - example: Exclude staging - type: string - query: - description: The exclusion filter query. - example: source:staging + to: + default: now + description: The maximum time for the requested events; supports date, math, + and regular timestamps (in milliseconds). + example: now type: string type: object - SecurityFilterFilteredDataType: - description: The filtered data type. - enum: - - logs - example: logs - type: string - x-enum-varnames: - - LOGS - SecurityFilterID: - description: The ID of the security filter. - example: 3dd-0uc-h1s - type: string - SecurityFilterMeta: - description: Optional metadata associated to the response. + RUMQueryOptions: + description: 'Global query options that are used during the query. + + Note: Only supply timezone or time offset, not both. Otherwise, the query + fails.' properties: - warning: - description: A warning message. - example: All the security filters are disabled. As a result, no logs are - being analyzed. + time_offset: + description: The time offset (in seconds) to apply to the query. + format: int64 + type: integer + timezone: + default: UTC + description: 'The timezone can be specified both as an offset, for example: + "UTC+03:00".' + example: GMT type: string type: object - SecurityFilterResponse: - description: Response object which includes a single security filter. - properties: - data: - $ref: '#/components/schemas/SecurityFilter' - meta: - $ref: '#/components/schemas/SecurityFilterMeta' - type: object - SecurityFilterType: - default: security_filters - description: The type of the resource. The value should always be `security_filters`. - enum: - - security_filters - example: security_filters - type: string - x-enum-varnames: - - SECURITY_FILTERS - SecurityFilterUpdateAttributes: - description: The security filters properties to be updated. + RUMQueryPageOptions: + description: Paging attributes for listing events. properties: - exclusion_filters: - description: Exclusion filters to exclude some logs from the security filter. - example: [] - items: - $ref: '#/components/schemas/SecurityFilterExclusionFilter' - type: array - filtered_data_type: - $ref: '#/components/schemas/SecurityFilterFilteredDataType' - is_enabled: - description: Whether the security filter is enabled. - example: true - type: boolean - name: - description: The name of the security filter. - example: Custom security filter - type: string - query: - description: The query of the security filter. - example: service:api + cursor: + description: List following results with a cursor provided in the previous + query. + example: eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ== type: string - version: - description: The version of the security filter to update. - example: 1 + limit: + default: 10 + description: Maximum number of events in the response. + example: 25 format: int32 - maximum: 2147483647 + maximum: 1000 type: integer type: object - SecurityFilterUpdateData: - description: The new security filter properties. - properties: - attributes: - $ref: '#/components/schemas/SecurityFilterUpdateAttributes' - type: - $ref: '#/components/schemas/SecurityFilterType' - required: - - type - - attributes - type: object - SecurityFilterUpdateRequest: - description: The new security filter body. + RUMResponseLinks: + description: Links attributes. properties: - data: - $ref: '#/components/schemas/SecurityFilterUpdateData' - required: - - data + next: + description: 'Link for the next set of results. Note that the request can + also be made using the + + POST endpoint.' + example: https://app.datadoghq.com/api/v2/rum/event?filter[query]=foo&page[cursor]=eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ== + type: string type: object - SecurityFiltersResponse: - description: All the available security filters objects. + RUMResponseMetadata: + description: The metadata associated with a request. properties: - data: - description: A list of security filters objects. + elapsed: + description: The time elapsed in milliseconds. + example: 132 + format: int64 + type: integer + page: + $ref: '#/components/schemas/RUMResponsePage' + request_id: + description: The identifier of the request. + example: MWlFUjVaWGZTTTZPYzM0VXp1OXU2d3xLSVpEMjZKQ0VKUTI0dEYtM3RSOFVR + type: string + status: + $ref: '#/components/schemas/RUMResponseStatus' + warnings: + description: 'A list of warnings (non-fatal errors) encountered. Partial + results may return if + + warnings are present in the response.' items: - $ref: '#/components/schemas/SecurityFilter' + $ref: '#/components/schemas/RUMWarning' type: array - meta: - $ref: '#/components/schemas/SecurityFilterMeta' type: object - SecurityMonitoringFilter: - description: The rule's suppression filter. + RUMResponsePage: + description: Paging attributes. properties: - action: - $ref: '#/components/schemas/SecurityMonitoringFilterAction' - query: - description: Query for selecting logs to apply the filtering action. + after: + description: The cursor to use to get the next results, if any. To make + the next request, use the same parameters with the addition of `page[cursor]`. + example: eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ== type: string type: object - SecurityMonitoringFilterAction: - description: The type of filtering action. + RUMResponseStatus: + description: The status of the response. enum: - - require - - suppress + - done + - timeout + example: done type: string x-enum-varnames: - - REQUIRE - - SUPPRESS - SecurityMonitoringListRulesResponse: - description: List of rules. + - DONE + - TIMEOUT + RUMSearchEventsRequest: + description: The request for a RUM events list. properties: - data: - description: Array containing the list of rules. - items: - $ref: '#/components/schemas/SecurityMonitoringRuleResponse' - type: array - meta: - $ref: '#/components/schemas/ResponseMetaAttributes' + filter: + $ref: '#/components/schemas/RUMQueryFilter' + options: + $ref: '#/components/schemas/RUMQueryOptions' + page: + $ref: '#/components/schemas/RUMQueryPageOptions' + sort: + $ref: '#/components/schemas/RUMSort' type: object - SecurityMonitoringRuleCase: - description: Case when signal is generated. + RUMSort: + description: Sort parameters when querying events. + enum: + - timestamp + - -timestamp + type: string + x-enum-varnames: + - TIMESTAMP_ASCENDING + - TIMESTAMP_DESCENDING + RUMSortOrder: + description: The order to use, ascending or descending. + enum: + - asc + - desc + example: asc + type: string + x-enum-varnames: + - ASCENDING + - DESCENDING + RUMWarning: + description: A warning message indicating something that went wrong with the + query. properties: - condition: - description: 'A rule case contains logical operations (`>`,`>=`, `&&`, `||`) - to determine if a signal should be generated - - based on the event counts in the previously defined queries.' + code: + description: A unique code for this type of warning. + example: unknown_index type: string - name: - description: Name of the case. + detail: + description: A detailed explanation of this specific warning. + example: 'indexes: foo, bar' + type: string + title: + description: A short human-readable summary of the warning. + example: One or several indexes are missing or invalid, results hold data + from the other indexes type: string - notifications: - description: Notification targets for each rule case. - items: - description: Notification. - type: string - type: array - status: - $ref: '#/components/schemas/SecurityMonitoringRuleSeverity' type: object - SecurityMonitoringRuleCaseCreate: - description: Case when signal is generated. + RelationshipToIncidentAttachment: + description: A relationship reference for attachments. properties: - condition: - description: 'A rule case contains logical operations (`>`,`>=`, `&&`, `||`) - to determine if a signal should be generated - - based on the event counts in the previously defined queries.' + data: + description: An array of incident attachments. + items: + $ref: '#/components/schemas/RelationshipToIncidentAttachmentData' + type: array + required: + - data + type: object + RelationshipToIncidentAttachmentData: + description: The attachment relationship data. + properties: + id: + description: A unique identifier that represents the attachment. + example: 00000000-0000-abcd-1000-000000000000 type: string - name: - description: Name of the case. + type: + $ref: '#/components/schemas/IncidentAttachmentType' + required: + - id + - type + type: object + RelationshipToIncidentIntegrationMetadataData: + description: A relationship reference for an integration metadata object. + example: + id: 00000000-abcd-0002-0000-000000000000 + type: incident_integrations + properties: + id: + description: A unique identifier that represents the integration metadata. + example: 00000000-abcd-0001-0000-000000000000 type: string - notifications: - description: Notification targets for each rule case. + type: + $ref: '#/components/schemas/IncidentIntegrationMetadataType' + required: + - id + - type + type: object + RelationshipToIncidentIntegrationMetadatas: + description: A relationship reference for multiple integration metadata objects. + example: + data: + - id: 00000000-abcd-0005-0000-000000000000 + type: incident_integrations + - id: 00000000-abcd-0006-0000-000000000000 + type: incident_integrations + properties: + data: + description: The integration metadata relationship array + example: + - id: 00000000-abcd-0003-0000-000000000000 + type: incident_integrations + - id: 00000000-abcd-0004-0000-000000000000 + type: incident_integrations items: - description: Notification. - type: string + $ref: '#/components/schemas/RelationshipToIncidentIntegrationMetadataData' type: array - status: - $ref: '#/components/schemas/SecurityMonitoringRuleSeverity' required: - - status + - data type: object - SecurityMonitoringRuleCreatePayload: - description: Create a new rule. - oneOf: - - $ref: '#/components/schemas/SecurityMonitoringStandardRuleCreatePayload' - - $ref: '#/components/schemas/SecurityMonitoringSignalRuleCreatePayload' + RelationshipToIncidentPostmortem: + description: A relationship reference for postmortems. + example: + data: + id: 00000000-0000-abcd-3000-000000000000 + type: incident_postmortems + properties: + data: + $ref: '#/components/schemas/RelationshipToIncidentPostmortemData' + required: + - data type: object - SecurityMonitoringRuleDecreaseCriticalityBasedOnEnv: - description: 'If true, signals in non-production environments have a lower severity - than what is defined by the rule case, which can reduce signal noise. - - The severity is decreased by one level: `CRITICAL` in production becomes `HIGH` - in non-production, `HIGH` becomes `MEDIUM` and so on. `INFO` remains `INFO`. - - The decrement is applied when the environment tag of the signal starts with - `staging`, `test` or `dev`.' - example: false - type: boolean - SecurityMonitoringRuleDetectionMethod: - description: The detection method. - enum: - - threshold - - new_value - - anomaly_detection - - impossible_travel - - hardcoded - type: string - x-enum-varnames: - - THRESHOLD - - NEW_VALUE - - ANOMALY_DETECTION - - IMPOSSIBLE_TRAVEL - - HARDCODED - SecurityMonitoringRuleEvaluationWindow: - description: 'A time window is specified to match when at least one of the cases - matches true. This is a sliding window - - and evaluates in real time.' - enum: - - 0 - - 60 - - 300 - - 600 - - 900 - - 1800 - - 3600 - - 7200 - format: int32 - type: integer - x-enum-varnames: - - ZERO_MINUTES - - ONE_MINUTE - - FIVE_MINUTES - - TEN_MINUTES - - FIFTEEN_MINUTES - - THIRTY_MINUTES - - ONE_HOUR - - TWO_HOURS - SecurityMonitoringRuleHardcodedEvaluatorType: - description: Hardcoded evaluator type. - enum: - - log4shell - type: string - x-enum-varnames: - - LOG4SHELL - SecurityMonitoringRuleImpossibleTravelOptions: - description: Options on impossible travel rules. + RelationshipToIncidentPostmortemData: + description: The postmortem relationship data. + example: + id: 00000000-0000-abcd-2000-000000000000 + type: incident_postmortems properties: - baselineUserLocations: - $ref: '#/components/schemas/SecurityMonitoringRuleImpossibleTravelOptionsBaselineUserLocations' + id: + description: A unique identifier that represents the postmortem. + example: 00000000-0000-abcd-1000-000000000000 + type: string + type: + $ref: '#/components/schemas/IncidentPostmortemType' + required: + - id + - type type: object - SecurityMonitoringRuleImpossibleTravelOptionsBaselineUserLocations: - description: 'If true, signals are suppressed for the first 24 hours. In that - time, Datadog learns the user''s regular - - access locations. This can be helpful to reduce noise and infer VPN usage - or credentialed API access.' - example: true - type: boolean - SecurityMonitoringRuleKeepAlive: - description: "Once a signal is generated, the signal will remain \u201Copen\u201D - if a case is matched at least once within\nthis keep alive window." - enum: - - 0 - - 60 - - 300 - - 600 - - 900 - - 1800 - - 3600 - - 7200 - - 10800 - - 21600 - format: int32 - type: integer - x-enum-varnames: - - ZERO_MINUTES - - ONE_MINUTE - - FIVE_MINUTES - - TEN_MINUTES - - FIFTEEN_MINUTES - - THIRTY_MINUTES - - ONE_HOUR - - TWO_HOURS - - THREE_HOURS - - SIX_HOURS - SecurityMonitoringRuleMaxSignalDuration: - description: "A signal will \u201Cclose\u201D regardless of the query being - matched once the time exceeds the maximum duration.\nThis time is calculated - from the first seen timestamp." - enum: - - 0 - - 60 - - 300 - - 600 - - 900 - - 1800 - - 3600 - - 7200 - - 10800 - - 21600 - - 43200 - - 86400 - format: int32 - type: integer - x-enum-varnames: - - ZERO_MINUTES - - ONE_MINUTE - - FIVE_MINUTES - - TEN_MINUTES - - FIFTEEN_MINUTES - - THIRTY_MINUTES - - ONE_HOUR - - TWO_HOURS - - THREE_HOURS - - SIX_HOURS - - TWELVE_HOURS - - ONE_DAY - SecurityMonitoringRuleNewValueOptions: - description: Options on new value rules. + RelationshipToOrganization: + description: Relationship to an organization. properties: - forgetAfter: - $ref: '#/components/schemas/SecurityMonitoringRuleNewValueOptionsForgetAfter' - learningDuration: - $ref: '#/components/schemas/SecurityMonitoringRuleNewValueOptionsLearningDuration' - learningMethod: - $ref: '#/components/schemas/SecurityMonitoringRuleNewValueOptionsLearningMethod' - learningThreshold: - $ref: '#/components/schemas/SecurityMonitoringRuleNewValueOptionsLearningThreshold' + data: + $ref: '#/components/schemas/RelationshipToOrganizationData' + required: + - data type: object - SecurityMonitoringRuleNewValueOptionsForgetAfter: - description: The duration in days after which a learned value is forgotten. - enum: - - 1 - - 2 - - 7 - - 14 - - 21 - - 28 - format: int32 - type: integer - x-enum-varnames: - - ONE_DAY - - TWO_DAYS - - ONE_WEEK - - TWO_WEEKS - - THREE_WEEKS - - FOUR_WEEKS - SecurityMonitoringRuleNewValueOptionsLearningDuration: - default: 0 - description: 'The duration in days during which values are learned, and after - which signals will be generated for values that - - weren''t learned. If set to 0, a signal will be generated for all new values - after the first value is learned.' - enum: - - 0 - - 1 - - 7 - format: int32 - type: integer - x-enum-varnames: - - ZERO_DAYS - - ONE_DAY - - SEVEN_DAYS - SecurityMonitoringRuleNewValueOptionsLearningMethod: - default: duration - description: The learning method used to determine when signals should be generated - for values that weren't learned. - enum: - - duration - - threshold - type: string - x-enum-varnames: - - DURATION - - THRESHOLD - SecurityMonitoringRuleNewValueOptionsLearningThreshold: - default: 0 - description: A number of occurrences after which signals will be generated for - values that weren't learned. - enum: - - 0 - - 1 - format: int32 - type: integer - x-enum-varnames: - - ZERO_OCCURRENCES - - ONE_OCCURRENCE - SecurityMonitoringRuleOptions: - description: Options on rules. + RelationshipToOrganizationData: + description: Relationship to organization object. properties: - decreaseCriticalityBasedOnEnv: - $ref: '#/components/schemas/SecurityMonitoringRuleDecreaseCriticalityBasedOnEnv' - detectionMethod: - $ref: '#/components/schemas/SecurityMonitoringRuleDetectionMethod' - evaluationWindow: - $ref: '#/components/schemas/SecurityMonitoringRuleEvaluationWindow' - hardcodedEvaluatorType: - $ref: '#/components/schemas/SecurityMonitoringRuleHardcodedEvaluatorType' - impossibleTravelOptions: - $ref: '#/components/schemas/SecurityMonitoringRuleImpossibleTravelOptions' - keepAlive: - $ref: '#/components/schemas/SecurityMonitoringRuleKeepAlive' - maxSignalDuration: - $ref: '#/components/schemas/SecurityMonitoringRuleMaxSignalDuration' - newValueOptions: - $ref: '#/components/schemas/SecurityMonitoringRuleNewValueOptions' - type: object - SecurityMonitoringRuleQuery: - description: Query for matching rule. - oneOf: - - $ref: '#/components/schemas/SecurityMonitoringStandardRuleQuery' - - $ref: '#/components/schemas/SecurityMonitoringSignalRuleQuery' - type: object - SecurityMonitoringRuleQueryAggregation: - description: The aggregation type. - enum: - - count - - cardinality - - sum - - max - - new_value - - geo_data - - event_count - type: string - x-enum-varnames: - - COUNT - - CARDINALITY - - SUM - - MAX - - NEW_VALUE - - GEO_DATA - - EVENT_COUNT - SecurityMonitoringRuleResponse: - description: Create a new rule. - oneOf: - - $ref: '#/components/schemas/SecurityMonitoringStandardRuleResponse' - - $ref: '#/components/schemas/SecurityMonitoringSignalRuleResponse' + id: + description: ID of the organization. + example: 00000000-0000-beef-0000-000000000000 + type: string + type: + $ref: '#/components/schemas/OrganizationsType' + required: + - id + - type type: object - SecurityMonitoringRuleSeverity: - description: Severity of the Security Signal. - enum: - - info - - low - - medium - - high - - critical - example: critical - type: string - x-enum-varnames: - - INFO - - LOW - - MEDIUM - - HIGH - - CRITICAL - SecurityMonitoringRuleTypeCreate: - description: The rule type. - enum: - - log_detection - - workload_security - type: string - x-enum-varnames: - - LOG_DETECTION - - WORKLOAD_SECURITY - SecurityMonitoringRuleTypeRead: - description: The rule type. - enum: - - log_detection - - infrastructure_configuration - - workload_security - - cloud_configuration - type: string - x-enum-varnames: - - LOG_DETECTION - - INFRASTRUCTURE_CONFIGURATION - - WORKLOAD_SECURITY - - CLOUD_CONFIGURATION - SecurityMonitoringRuleUpdatePayload: - description: Update an existing rule. + RelationshipToOrganizations: + description: Relationship to organizations. properties: - cases: - description: Cases for generating signals. - items: - $ref: '#/components/schemas/SecurityMonitoringRuleCase' - type: array - filters: - description: Additional queries to filter matched events before they are - processed. - items: - $ref: '#/components/schemas/SecurityMonitoringFilter' - type: array - hasExtendedTitle: - description: Whether the notifications include the triggering group-by values - in their title. - example: true - type: boolean - isEnabled: - description: Whether the rule is enabled. - type: boolean - message: - description: Message for generated signals. - type: string - name: - description: Name of the rule. - type: string - options: - $ref: '#/components/schemas/SecurityMonitoringRuleOptions' - queries: - description: Queries for selecting logs which are part of the rule. - items: - $ref: '#/components/schemas/SecurityMonitoringRuleQuery' - type: array - tags: - description: Tags for generated signals. + data: + description: Relationships to organization objects. + example: [] items: - description: Tag. - type: string + $ref: '#/components/schemas/RelationshipToOrganizationData' type: array - version: - description: The version of the rule being updated. - example: 1 - format: int32 - maximum: 2147483647 - type: integer + required: + - data type: object - SecurityMonitoringSignal: - description: Object description of a security signal. + RelationshipToPermission: + description: Relationship to a permissions object. + properties: + data: + $ref: '#/components/schemas/RelationshipToPermissionData' + type: object + RelationshipToPermissionData: + description: Relationship to permission object. properties: - attributes: - $ref: '#/components/schemas/SecurityMonitoringSignalAttributes' id: - description: The unique ID of the security signal. - example: AAAAAWgN8Xwgr1vKDQAAAABBV2dOOFh3ZzZobm1mWXJFYTR0OA + description: ID of the permission. type: string type: - $ref: '#/components/schemas/SecurityMonitoringSignalType' + $ref: '#/components/schemas/PermissionsType' type: object - SecurityMonitoringSignalArchiveComment: - description: Optional comment to display on archived signals. - type: string - SecurityMonitoringSignalArchiveReason: - description: Reason a signal is archived. - enum: - - none - - false_positive - - testing_or_maintenance - - other - type: string - x-enum-varnames: - - NONE - - FALSE_POSITIVE - - TESTING_OR_MAINTENANCE - - OTHER - SecurityMonitoringSignalAssigneeUpdateAttributes: - description: Attributes describing the new assignee of a security signal. + RelationshipToPermissions: + description: Relationship to multiple permissions objects. properties: - assignee: - $ref: '#/components/schemas/SecurityMonitoringTriageUser' - version: - $ref: '#/components/schemas/SecurityMonitoringSignalVersion' - required: - - assignee + data: + description: Relationships to permission objects. + items: + $ref: '#/components/schemas/RelationshipToPermissionData' + type: array type: object - SecurityMonitoringSignalAssigneeUpdateData: - description: Data containing the patch for changing the assignee of a signal. + RelationshipToRole: + description: Relationship to role. properties: - attributes: - $ref: '#/components/schemas/SecurityMonitoringSignalAssigneeUpdateAttributes' - required: - - attributes + data: + $ref: '#/components/schemas/RelationshipToRoleData' type: object - SecurityMonitoringSignalAssigneeUpdateRequest: - description: Request body for changing the assignee of a given security monitoring - signal. + RelationshipToRoleData: + description: Relationship to role object. properties: - data: - $ref: '#/components/schemas/SecurityMonitoringSignalAssigneeUpdateData' - required: - - data + id: + description: The unique identifier of the role. + example: 3653d3c6-0c75-11ea-ad28-fb5701eabc7d + type: string + type: + $ref: '#/components/schemas/RolesType' type: object - SecurityMonitoringSignalAttributes: - description: 'The object containing all signal attributes and their - - associated values.' + RelationshipToRoles: + description: Relationship to roles. properties: - attributes: - additionalProperties: {} - description: A JSON object of attributes in the security signal. - example: - workflow: - first_seen: '2020-06-23T14:46:01.000Z' - last_seen: '2020-06-23T14:46:49.000Z' - rule: - id: 0f5-e0c-805 - name: 'Brute Force Attack Grouped By User ' - version: 12 - type: object - message: - description: The message in the security signal defined by the rule that - generated the signal. - example: Detect Account Take Over (ATO) through brute force attempts - type: string - tags: - description: An array of tags associated with the security signal. - example: - - security:attack - - technique:T1110-brute-force + data: + description: An array containing type and the unique identifier of a role. items: - description: The tag associated with the security signal. - type: string + $ref: '#/components/schemas/RelationshipToRoleData' type: array - timestamp: - description: The timestamp of the security signal. - example: '2019-01-02T09:42:36.320Z' - format: date-time + type: object + RelationshipToSAMLAssertionAttribute: + description: AuthN Mapping relationship to SAML Assertion Attribute. + properties: + data: + $ref: '#/components/schemas/RelationshipToSAMLAssertionAttributeData' + required: + - data + type: object + RelationshipToSAMLAssertionAttributeData: + description: Data of AuthN Mapping relationship to SAML Assertion Attribute. + properties: + id: + description: The ID of the SAML assertion attribute. + example: '0' type: string + type: + $ref: '#/components/schemas/SAMLAssertionAttributesType' + required: + - id + - type type: object - SecurityMonitoringSignalIncidentIds: - description: Array of incidents that are associated with this signal. - items: - description: Public ID attribute of the incident that is associated with the - signal. - example: 2066 - format: int64 - type: integer - type: array - SecurityMonitoringSignalIncidentsUpdateAttributes: - description: Attributes describing the new list of related signals for a security - signal. + RelationshipToUser: + description: Relationship to user. properties: - incident_ids: - $ref: '#/components/schemas/SecurityMonitoringSignalIncidentIds' - version: - $ref: '#/components/schemas/SecurityMonitoringSignalVersion' + data: + $ref: '#/components/schemas/RelationshipToUserData' required: - - incident_ids + - data type: object - SecurityMonitoringSignalIncidentsUpdateData: - description: Data containing the patch for changing the related incidents of - a signal. + RelationshipToUserData: + description: Relationship to user object. properties: - attributes: - $ref: '#/components/schemas/SecurityMonitoringSignalIncidentsUpdateAttributes' + id: + description: A unique identifier that represents the user. + example: 00000000-0000-0000-2345-000000000000 + type: string + type: + $ref: '#/components/schemas/UsersType' required: - - attributes + - id + - type type: object - SecurityMonitoringSignalIncidentsUpdateRequest: - description: Request body for changing the related incidents of a given security - monitoring signal. + RelationshipToUsers: + description: Relationship to users. properties: data: - $ref: '#/components/schemas/SecurityMonitoringSignalIncidentsUpdateData' + description: Relationships to user objects. + example: [] + items: + $ref: '#/components/schemas/RelationshipToUserData' + type: array required: - data type: object - SecurityMonitoringSignalListRequest: - description: The request for a security signal list. + ResponseMetaAttributes: + description: Object describing meta attributes of response. properties: - filter: - $ref: '#/components/schemas/SecurityMonitoringSignalListRequestFilter' page: - $ref: '#/components/schemas/SecurityMonitoringSignalListRequestPage' - sort: - $ref: '#/components/schemas/SecurityMonitoringSignalsSort' + $ref: '#/components/schemas/Pagination' type: object - SecurityMonitoringSignalListRequestFilter: - description: Search filters for listing security signals. + Role: + description: Role object returned by the API. properties: - from: - description: The minimum timestamp for requested security signals. - example: '2019-01-02T09:42:36.320Z' - format: date-time + attributes: + $ref: '#/components/schemas/RoleAttributes' + id: + description: The unique identifier of the role. type: string - query: - description: Search query for listing security signals. - example: security:attack status:high + relationships: + $ref: '#/components/schemas/RoleResponseRelationships' + type: + $ref: '#/components/schemas/RolesType' + required: + - type + type: object + RoleAttributes: + description: Attributes of the role. + properties: + created_at: + description: Creation time of the role. + format: date-time + readOnly: true type: string - to: - description: The maximum timestamp for requested security signals. - example: '2019-01-03T09:42:36.320Z' + modified_at: + description: Time of last role modification. format: date-time + readOnly: true type: string - type: object - SecurityMonitoringSignalListRequestPage: - description: The paging attributes for listing security signals. - properties: - cursor: - description: A list of results using the cursor provided in the previous - query. - example: eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ== + name: + description: The name of the role. The name is neither unique nor a stable + identifier of the role. type: string - limit: - default: 10 - description: The maximum number of security signals in the response. - example: 25 - format: int32 - maximum: 1000 + user_count: + description: Number of users with that role. + format: int64 + readOnly: true type: integer type: object - SecurityMonitoringSignalRuleCreatePayload: - description: Create a new signal correlation rule. + RoleClone: + description: Data for the clone role request. + properties: + attributes: + $ref: '#/components/schemas/RoleCloneAttributes' + type: + $ref: '#/components/schemas/RolesType' + required: + - type + - attributes + type: object + RoleCloneAttributes: + description: Attributes required to create a new role by cloning an existing + one. properties: - cases: - description: Cases for generating signals. - example: [] - items: - $ref: '#/components/schemas/SecurityMonitoringRuleCaseCreate' - type: array - filters: - description: Additional queries to filter matched events before they are - processed. - items: - $ref: '#/components/schemas/SecurityMonitoringFilter' - type: array - hasExtendedTitle: - description: Whether the notifications include the triggering group-by values - in their title. - example: true - type: boolean - isEnabled: - description: Whether the rule is enabled. - example: true - type: boolean - message: - description: Message for generated signals. - example: '' - type: string name: - description: The name of the rule. - example: My security monitoring rule. + description: Name of the new role that is cloned. + example: cloned-role type: string - options: - $ref: '#/components/schemas/SecurityMonitoringRuleOptions' - queries: - description: Queries for selecting signals which are part of the rule. - example: [] - items: - $ref: '#/components/schemas/SecurityMonitoringSignalRuleQuery' - type: array - tags: - description: Tags for generated signals. - example: - - env:prod - - team:security - items: - description: Tag. - type: string - type: array - type: - $ref: '#/components/schemas/SecurityMonitoringSignalRuleType' required: - name - - isEnabled - - queries - - options - - cases - - message type: object - SecurityMonitoringSignalRuleQuery: - description: Query for matching rule on signals. + RoleCloneRequest: + description: Request to create a role by cloning an existing role. properties: - aggregation: - $ref: '#/components/schemas/SecurityMonitoringRuleQueryAggregation' - correlatedByFields: - description: Fields to group by. - items: - description: Field. - type: string - type: array - correlatedQueryIndex: - description: Index of the rule query used to retrieve the correlated field. - format: int32 - maximum: 9 - type: integer - metrics: - description: Group of target fields to aggregate over. - items: - description: Field. - type: string - type: array - name: - description: Name of the query. - type: string - ruleId: - description: Rule ID to match on signals. - example: org-ru1-e1d - type: string + data: + $ref: '#/components/schemas/RoleClone' required: - - ruleId + - data type: object - SecurityMonitoringSignalRuleResponse: - description: Rule. + RoleCreateAttributes: + description: Attributes of the created role. properties: - cases: - description: Cases for generating signals. - items: - $ref: '#/components/schemas/SecurityMonitoringRuleCase' - type: array - createdAt: - description: When the rule was created, timestamp in milliseconds. - format: int64 - type: integer - creationAuthorId: - description: User ID of the user who created the rule. - format: int64 - type: integer - filters: - description: Additional queries to filter matched events before they are - processed. - items: - $ref: '#/components/schemas/SecurityMonitoringFilter' - type: array - hasExtendedTitle: - description: Whether the notifications include the triggering group-by values - in their title. - type: boolean - id: - description: The ID of the rule. - type: string - isDefault: - description: Whether the rule is included by default. - type: boolean - isDeleted: - description: Whether the rule has been deleted. - type: boolean - isEnabled: - description: Whether the rule is enabled. - type: boolean - message: - description: Message for generated signals. - type: string - name: - description: The name of the rule. + created_at: + description: Creation time of the role. + format: date-time + readOnly: true type: string - options: - $ref: '#/components/schemas/SecurityMonitoringRuleOptions' - queries: - description: Queries for selecting logs which are part of the rule. - items: - $ref: '#/components/schemas/SecurityMonitoringSignalRuleResponseQuery' - type: array - tags: - description: Tags for generated signals. - items: - description: Tag. - type: string - type: array - type: - $ref: '#/components/schemas/SecurityMonitoringSignalRuleType' - updateAuthorId: - description: User ID of the user who updated the rule. - format: int64 - type: integer - version: - description: The version of the rule. - format: int64 - type: integer - SecurityMonitoringSignalRuleResponseQuery: - description: Query for matching rule on signals. - properties: - aggregation: - $ref: '#/components/schemas/SecurityMonitoringRuleQueryAggregation' - correlatedByFields: - description: Fields to group by. - items: - description: Field. - type: string - type: array - correlatedQueryIndex: - description: Index of the rule query used to retrieve the correlated field. - format: int32 - maximum: 9 - type: integer - defaultRuleId: - description: Default Rule ID to match on signals. - example: d3f-ru1-e1d + modified_at: + description: Time of last role modification. + format: date-time + readOnly: true type: string - metrics: - description: Group of target fields to aggregate over. - items: - description: Field. - type: string - type: array name: - description: Name of the query. - type: string - ruleId: - description: Rule ID to match on signals. - example: org-ru1-e1d + description: Name of the role. + example: developers type: string - type: object - SecurityMonitoringSignalRuleType: - description: The rule type. - enum: - - signal_correlation - type: string - x-enum-varnames: - - SIGNAL_CORRELATION - SecurityMonitoringSignalState: - description: The new triage state of the signal. - enum: - - open - - archived - - under_review - example: open - type: string - x-enum-varnames: - - OPEN - - ARCHIVED - - UNDER_REVIEW - SecurityMonitoringSignalStateUpdateAttributes: - description: Attributes describing the change of state of a security signal. - properties: - archive_comment: - $ref: '#/components/schemas/SecurityMonitoringSignalArchiveComment' - archive_reason: - $ref: '#/components/schemas/SecurityMonitoringSignalArchiveReason' - state: - $ref: '#/components/schemas/SecurityMonitoringSignalState' - version: - $ref: '#/components/schemas/SecurityMonitoringSignalVersion' required: - - state + - name type: object - SecurityMonitoringSignalStateUpdateData: - description: Data containing the patch for changing the state of a signal. + RoleCreateData: + description: Data related to the creation of a role. properties: attributes: - $ref: '#/components/schemas/SecurityMonitoringSignalStateUpdateAttributes' + $ref: '#/components/schemas/RoleCreateAttributes' + relationships: + $ref: '#/components/schemas/RoleRelationships' + type: + $ref: '#/components/schemas/RolesType' required: - attributes type: object - SecurityMonitoringSignalStateUpdateRequest: - description: Request body for changing the state of a given security monitoring - signal. + RoleCreateRequest: + description: Create a role. properties: data: - $ref: '#/components/schemas/SecurityMonitoringSignalStateUpdateData' + $ref: '#/components/schemas/RoleCreateData' required: - data type: object - SecurityMonitoringSignalTriageAttributes: - description: Attributes describing a triage state update operation over a security - signal. + RoleCreateResponse: + description: Response containing information about a created role. properties: - archive_comment: - $ref: '#/components/schemas/SecurityMonitoringSignalArchiveComment' - archive_comment_timestamp: - description: Timestamp of the last edit to the comment. - format: int64 - minimum: 0 - type: integer - archive_comment_user: - $ref: '#/components/schemas/SecurityMonitoringTriageUser' - archive_reason: - $ref: '#/components/schemas/SecurityMonitoringSignalArchiveReason' - assignee: - $ref: '#/components/schemas/SecurityMonitoringTriageUser' - incident_ids: - $ref: '#/components/schemas/SecurityMonitoringSignalIncidentIds' - state: - $ref: '#/components/schemas/SecurityMonitoringSignalState' - state_update_timestamp: - description: Timestamp of the last update to the signal state. - format: int64 - minimum: 0 - type: integer - state_update_user: - $ref: '#/components/schemas/SecurityMonitoringTriageUser' - required: - - assignee - - state - - incident_ids + data: + $ref: '#/components/schemas/RoleCreateResponseData' type: object - SecurityMonitoringSignalTriageUpdateData: - description: Data containing the updated triage attributes of the signal. + RoleCreateResponseData: + description: Role object returned by the API. properties: attributes: - $ref: '#/components/schemas/SecurityMonitoringSignalTriageAttributes' + $ref: '#/components/schemas/RoleCreateAttributes' + id: + description: The unique identifier of the role. + type: string + relationships: + $ref: '#/components/schemas/RoleResponseRelationships' + type: + $ref: '#/components/schemas/RolesType' + required: + - type type: object - SecurityMonitoringSignalTriageUpdateResponse: - description: The response returned after all triage operations, containing the - updated signal triage data. + RoleRelationships: + description: Relationships of the role object. + properties: + permissions: + $ref: '#/components/schemas/RelationshipToPermissions' + users: + $ref: '#/components/schemas/RelationshipToUsers' + type: object + RoleResponse: + description: Response containing information about a single role. properties: data: - $ref: '#/components/schemas/SecurityMonitoringSignalTriageUpdateData' - required: - - data + $ref: '#/components/schemas/Role' type: object - SecurityMonitoringSignalType: - default: signal - description: The type of event. - enum: - - signal - example: signal - type: string - x-enum-varnames: - - SIGNAL - SecurityMonitoringSignalVersion: - description: Version of the updated signal. If server side version is higher, - update will be rejected. - format: int64 - type: integer - SecurityMonitoringSignalsListResponse: - description: 'The response object with all security signals matching the request - - and pagination information.' + RoleResponseRelationships: + description: Relationships of the role object returned by the API. + properties: + permissions: + $ref: '#/components/schemas/RelationshipToPermissions' + type: object + RoleUpdateAttributes: + description: Attributes of the role. + properties: + created_at: + description: Creation time of the role. + format: date-time + readOnly: true + type: string + modified_at: + description: Time of last role modification. + format: date-time + readOnly: true + type: string + name: + description: Name of the role. + type: string + type: object + RoleUpdateData: + description: Data related to the update of a role. + properties: + attributes: + $ref: '#/components/schemas/RoleUpdateAttributes' + id: + description: The unique identifier of the role. + example: 00000000-0000-1111-0000-000000000000 + type: string + relationships: + $ref: '#/components/schemas/RoleRelationships' + type: + $ref: '#/components/schemas/RolesType' + required: + - attributes + - type + - id + type: object + RoleUpdateRequest: + description: Update a role. properties: data: - description: An array of security signals matching the request. + $ref: '#/components/schemas/RoleUpdateData' + required: + - data + type: object + RoleUpdateResponse: + description: Response containing information about an updated role. + properties: + data: + $ref: '#/components/schemas/RoleUpdateResponseData' + type: object + RoleUpdateResponseData: + description: Role object returned by the API. + properties: + attributes: + $ref: '#/components/schemas/RoleUpdateAttributes' + id: + description: The unique identifier of the role. + type: string + relationships: + $ref: '#/components/schemas/RoleResponseRelationships' + type: + $ref: '#/components/schemas/RolesType' + required: + - type + type: object + RolesResponse: + description: Response containing information about multiple roles. + properties: + data: + description: Array of returned roles. items: - $ref: '#/components/schemas/SecurityMonitoringSignal' + $ref: '#/components/schemas/Role' type: array - links: - $ref: '#/components/schemas/SecurityMonitoringSignalsListResponseLinks' meta: - $ref: '#/components/schemas/SecurityMonitoringSignalsListResponseMeta' + $ref: '#/components/schemas/ResponseMetaAttributes' type: object - SecurityMonitoringSignalsListResponseLinks: - description: Links attributes. + RolesSort: + default: name + description: Sorting options for roles. + enum: + - name + - -name + - modified_at + - -modified_at + - user_count + - -user_count + type: string + x-enum-varnames: + - NAME_ASCENDING + - NAME_DESCENDING + - MODIFIED_AT_ASCENDING + - MODIFIED_AT_DESCENDING + - USER_COUNT_ASCENDING + - USER_COUNT_DESCENDING + RolesType: + default: roles + description: Roles type. + enum: + - roles + example: roles + type: string + x-enum-varnames: + - ROLES + SAMLAssertionAttribute: + description: SAML assertion attribute. properties: - next: - description: 'The link for the next set of results. **Note**: The request - can also be made using the - - POST endpoint.' - example: https://app.datadoghq.com/api/v2/security_monitoring/signals?filter[query]=foo&page[cursor]=eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ== + attributes: + $ref: '#/components/schemas/SAMLAssertionAttributeAttributes' + id: + description: The ID of the SAML assertion attribute. + example: '0' type: string + type: + $ref: '#/components/schemas/SAMLAssertionAttributesType' + required: + - id + - type type: object - SecurityMonitoringSignalsListResponseMeta: - description: Meta attributes. - properties: - page: - $ref: '#/components/schemas/SecurityMonitoringSignalsListResponseMetaPage' - type: object - SecurityMonitoringSignalsListResponseMetaPage: - description: Paging attributes. + SAMLAssertionAttributeAttributes: + description: Key/Value pair of attributes used in SAML assertion attributes. properties: - after: - description: 'The cursor used to get the next results, if any. To make the - next request, use the same - - parameters with the addition of the `page[cursor]`.' - example: eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ== + attribute_key: + description: Key portion of a key/value pair of the attribute sent from + the Identity Provider. + example: member-of + type: string + attribute_value: + description: Value portion of a key/value pair of the attribute sent from + the Identity Provider. + example: Development type: string type: object - SecurityMonitoringSignalsSort: - description: The sort parameters used for querying security signals. + SAMLAssertionAttributesType: + default: saml_assertion_attributes + description: SAML assertion attributes resource type. enum: - - timestamp - - -timestamp + - saml_assertion_attributes + example: saml_assertion_attributes type: string x-enum-varnames: - - TIMESTAMP_ASCENDING - - TIMESTAMP_DESCENDING - SecurityMonitoringStandardRuleCreatePayload: - description: Create a new rule. + - SAML_ASSERTION_ATTRIBUTES + SecurityFilter: + description: The security filter's properties. properties: - cases: - description: Cases for generating signals. - example: [] - items: - $ref: '#/components/schemas/SecurityMonitoringRuleCaseCreate' - type: array - filters: - description: Additional queries to filter matched events before they are - processed. + attributes: + $ref: '#/components/schemas/SecurityFilterAttributes' + id: + $ref: '#/components/schemas/SecurityFilterID' + type: + $ref: '#/components/schemas/SecurityFilterType' + type: object + SecurityFilterAttributes: + description: The object describing a security filter. + properties: + exclusion_filters: + description: The list of exclusion filters applied in this security filter. items: - $ref: '#/components/schemas/SecurityMonitoringFilter' + $ref: '#/components/schemas/SecurityFilterExclusionFilterResponse' type: array - hasExtendedTitle: - description: Whether the notifications include the triggering group-by values - in their title. - example: true + filtered_data_type: + $ref: '#/components/schemas/SecurityFilterFilteredDataType' + is_builtin: + description: Whether the security filter is the built-in filter. + example: false type: boolean - isEnabled: - description: Whether the rule is enabled. - example: true + is_enabled: + description: Whether the security filter is enabled. + example: false type: boolean - message: - description: Message for generated signals. - example: '' - type: string name: - description: The name of the rule. - example: My security monitoring rule. + description: The security filter name. + example: Custom security filter type: string - options: - $ref: '#/components/schemas/SecurityMonitoringRuleOptions' - queries: - description: Queries for selecting logs which are part of the rule. - example: [] + query: + description: The security filter query. Logs accepted by this query will + be accepted by this filter. + example: service:api + type: string + version: + description: The version of the security filter. + example: 1 + format: int32 + maximum: 2147483647 + type: integer + type: object + SecurityFilterCreateAttributes: + description: Object containing the attributes of the security filter to be created. + properties: + exclusion_filters: + description: Exclusion filters to exclude some logs from the security filter. + example: + - name: Exclude staging + query: source:staging items: - $ref: '#/components/schemas/SecurityMonitoringStandardRuleQuery' - type: array - tags: - description: Tags for generated signals. - example: - - env:prod - - team:security - items: - description: Tag. - type: string - type: array - type: - $ref: '#/components/schemas/SecurityMonitoringRuleTypeCreate' - required: - - name - - isEnabled - - queries - - options - - cases - - message - type: object - SecurityMonitoringStandardRuleQuery: - description: Query for matching rule. - properties: - aggregation: - $ref: '#/components/schemas/SecurityMonitoringRuleQueryAggregation' - distinctFields: - description: Field for which the cardinality is measured. Sent as an array. - items: - description: Field. - type: string - type: array - groupByFields: - description: Fields to group by. - items: - description: Field. - type: string - type: array - metric: - deprecated: true - description: '(Deprecated) The target field to aggregate over when using - the sum or max - - aggregations. `metrics` field should be used instead.' - type: string - metrics: - description: Group of target fields to aggregate over when using the sum, - max, geo data, or new value aggregations. The sum, max, and geo data aggregations - only accept one value in this list, whereas the new value aggregation - accepts up to five values. - items: - description: Field. - type: string + $ref: '#/components/schemas/SecurityFilterExclusionFilter' type: array + filtered_data_type: + $ref: '#/components/schemas/SecurityFilterFilteredDataType' + is_enabled: + description: Whether the security filter is enabled. + example: true + type: boolean name: - description: Name of the query. + description: The name of the security filter. + example: Custom security filter type: string query: - description: Query to run on logs. - example: a > 3 + description: The query of the security filter. + example: service:api type: string required: + - name - query + - exclusion_filters + - filtered_data_type + - is_enabled type: object - SecurityMonitoringStandardRuleResponse: - description: Rule. + SecurityFilterCreateData: + description: Object for a single security filter. properties: - cases: - description: Cases for generating signals. - items: - $ref: '#/components/schemas/SecurityMonitoringRuleCase' - type: array - createdAt: - description: When the rule was created, timestamp in milliseconds. - format: int64 - type: integer - creationAuthorId: - description: User ID of the user who created the rule. - format: int64 - type: integer - filters: - description: Additional queries to filter matched events before they are - processed. - items: - $ref: '#/components/schemas/SecurityMonitoringFilter' - type: array - hasExtendedTitle: - description: Whether the notifications include the triggering group-by values - in their title. - type: boolean - id: - description: The ID of the rule. - type: string - isDefault: - description: Whether the rule is included by default. - type: boolean - isDeleted: - description: Whether the rule has been deleted. - type: boolean - isEnabled: - description: Whether the rule is enabled. - type: boolean - message: - description: Message for generated signals. - type: string - name: - description: The name of the rule. - type: string - options: - $ref: '#/components/schemas/SecurityMonitoringRuleOptions' - queries: - description: Queries for selecting logs which are part of the rule. - items: - $ref: '#/components/schemas/SecurityMonitoringStandardRuleQuery' - type: array - tags: - description: Tags for generated signals. - items: - description: Tag. - type: string - type: array + attributes: + $ref: '#/components/schemas/SecurityFilterCreateAttributes' type: - $ref: '#/components/schemas/SecurityMonitoringRuleTypeRead' - updateAuthorId: - description: User ID of the user who updated the rule. - format: int64 - type: integer - version: - description: The version of the rule. - format: int64 - type: integer - SecurityMonitoringTriageUser: - description: Object representing a given user entity. + $ref: '#/components/schemas/SecurityFilterType' + required: + - type + - attributes + type: object + SecurityFilterCreateRequest: + description: Request object that includes the security filter that you would + like to create. + properties: + data: + $ref: '#/components/schemas/SecurityFilterCreateData' + required: + - data + type: object + SecurityFilterExclusionFilter: + description: Exclusion filter for the security filter. + example: + name: Exclude staging + query: source:staging properties: - handle: - description: The handle for this user account. - type: string - id: - description: Numerical ID assigned by Datadog to this user account. - format: int64 - type: integer name: - description: The name for this user account. + description: Exclusion filter name. + example: Exclude staging type: string - uuid: - description: UUID assigned by Datadog to this user account. - example: 773b045d-ccf8-4808-bd3b-955ef6a8c940 + query: + description: Exclusion filter query. Logs that match this query are excluded + from the security filter. + example: source:staging type: string required: - - uuid + - name + - query type: object - ServiceAccountCreateAttributes: - description: Attributes of the created user. + SecurityFilterExclusionFilterResponse: + description: A single exclusion filter. properties: - email: - description: The email of the user. - example: jane.doe@example.com - type: string name: - description: The name of the user. + description: The exclusion filter name. + example: Exclude staging type: string - service_account: - description: Whether the user is a service account. Must be true. - example: true - type: boolean - title: - description: The title of the user. + query: + description: The exclusion filter query. + example: source:staging type: string - required: - - email - - service_account type: object - ServiceAccountCreateData: - description: Object to create a service account User. + SecurityFilterFilteredDataType: + description: The filtered data type. + enum: + - logs + example: logs + type: string + x-enum-varnames: + - LOGS + SecurityFilterID: + description: The ID of the security filter. + example: 3dd-0uc-h1s + type: string + SecurityFilterMeta: + description: Optional metadata associated to the response. properties: - attributes: - $ref: '#/components/schemas/ServiceAccountCreateAttributes' - relationships: - $ref: '#/components/schemas/UserRelationships' - type: - $ref: '#/components/schemas/UsersType' - required: - - attributes - - type + warning: + description: A warning message. + example: All the security filters are disabled. As a result, no logs are + being analyzed. + type: string type: object - ServiceAccountCreateRequest: - description: Create a service account. + SecurityFilterResponse: + description: Response object which includes a single security filter. properties: data: - $ref: '#/components/schemas/ServiceAccountCreateData' - required: - - data + $ref: '#/components/schemas/SecurityFilter' + meta: + $ref: '#/components/schemas/SecurityFilterMeta' type: object - ServiceDefinitionCreateResponse: - description: Create service definitions response. + SecurityFilterType: + default: security_filters + description: The type of the resource. The value should always be `security_filters`. + enum: + - security_filters + example: security_filters + type: string + x-enum-varnames: + - SECURITY_FILTERS + SecurityFilterUpdateAttributes: + description: The security filters properties to be updated. properties: - data: - description: Create service definitions response payload. + exclusion_filters: + description: Exclusion filters to exclude some logs from the security filter. + example: [] items: - $ref: '#/components/schemas/ServiceDefinitionData' + $ref: '#/components/schemas/SecurityFilterExclusionFilter' type: array + filtered_data_type: + $ref: '#/components/schemas/SecurityFilterFilteredDataType' + is_enabled: + description: Whether the security filter is enabled. + example: true + type: boolean + name: + description: The name of the security filter. + example: Custom security filter + type: string + query: + description: The query of the security filter. + example: service:api + type: string + version: + description: The version of the security filter to update. + example: 1 + format: int32 + maximum: 2147483647 + type: integer type: object - ServiceDefinitionData: - description: Service definition data. + SecurityFilterUpdateData: + description: The new security filter properties. properties: attributes: - $ref: '#/components/schemas/ServiceDefinitionDataAttributes' + $ref: '#/components/schemas/SecurityFilterUpdateAttributes' type: - description: Service definition type. - type: string + $ref: '#/components/schemas/SecurityFilterType' + required: + - type + - attributes type: object - ServiceDefinitionDataAttributes: - description: Service definition attributes. + SecurityFilterUpdateRequest: + description: The new security filter body. properties: - meta: - $ref: '#/components/schemas/ServiceDefinitionMeta' - schema: - $ref: '#/components/schemas/ServiceDefinitionSchema' + data: + $ref: '#/components/schemas/SecurityFilterUpdateData' + required: + - data type: object - ServiceDefinitionGetResponse: - description: Get service definition response. + SecurityFiltersResponse: + description: All the available security filters objects. properties: data: - $ref: '#/components/schemas/ServiceDefinitionData' + description: A list of security filters objects. + items: + $ref: '#/components/schemas/SecurityFilter' + type: array + meta: + $ref: '#/components/schemas/SecurityFilterMeta' type: object - ServiceDefinitionMeta: - description: Metadata about a service definition. + SecurityMonitoringFilter: + description: The rule's suppression filter. properties: - github-html-url: - description: GitHub HTML URL. - type: string - ingested-schema-version: - description: Ingestion schema version. - type: string - ingestion-source: - description: Ingestion source of the service definition. - type: string - last-modified-time: - description: Last modified time of the service definition. + action: + $ref: '#/components/schemas/SecurityMonitoringFilterAction' + query: + description: Query for selecting logs to apply the filtering action. type: string type: object - ServiceDefinitionRaw: - description: Service Definition in raw JSON/YAML representation. - example: '--- - - schema-version: v2 - - dd-service: my-service - - ' + SecurityMonitoringFilterAction: + description: The type of filtering action. + enum: + - require + - suppress type: string - ServiceDefinitionSchema: - description: Service definition schema. - oneOf: - - $ref: '#/components/schemas/ServiceDefinitionV1' - - $ref: '#/components/schemas/ServiceDefinitionV2' - type: object - ServiceDefinitionV1: - deprecated: true - description: Deprecated - Service definition V1 for providing additional service - metadata and integrations. + x-enum-varnames: + - REQUIRE + - SUPPRESS + SecurityMonitoringListRulesResponse: + description: List of rules. properties: - contact: - $ref: '#/components/schemas/ServiceDefinitionV1Contact' - extensions: - additionalProperties: {} - description: Extensions to V1 schema. - example: - myorg/extension: extensionValue - type: object - external-resources: - description: A list of external links related to the services. - items: - $ref: '#/components/schemas/ServiceDefinitionV1Resource' - type: array - info: - $ref: '#/components/schemas/ServiceDefinitionV1Info' - integrations: - $ref: '#/components/schemas/ServiceDefinitionV1Integrations' - org: - $ref: '#/components/schemas/ServiceDefinitionV1Org' - schema-version: - $ref: '#/components/schemas/ServiceDefinitionV1Version' - tags: - description: A set of custom tags. - example: - - my:tag - - service:tag + data: + description: Array containing the list of rules. items: - type: string + $ref: '#/components/schemas/SecurityMonitoringRuleResponse' type: array - required: - - schema-version - - info + meta: + $ref: '#/components/schemas/ResponseMetaAttributes' type: object - ServiceDefinitionV1Contact: - description: Contact information about the service. - properties: - email: - description: "Service owner\u2019s email." - example: contact@datadoghq.com - format: email - type: string - slack: - description: "Service owner\u2019s Slack channel." - example: https://yourcompany.slack.com/archives/channel123 - type: string - ServiceDefinitionV1Info: - description: Basic information about a service. + SecurityMonitoringRuleCase: + description: Case when signal is generated. properties: - dd-service: - description: Unique identifier of the service. Must be unique across all - services and is used to match with a service in Datadog. - example: myservice - type: string - description: - description: A short description of the service. - example: A shopping cart service - type: string - display-name: - description: A friendly name of the service. - example: My Service + condition: + description: 'A rule case contains logical operations (`>`,`>=`, `&&`, `||`) + to determine if a signal should be generated + + based on the event counts in the previously defined queries.' type: string - service-tier: - description: Service tier. - example: Tier 1 + name: + description: Name of the case. type: string - required: - - dd-service - type: object - ServiceDefinitionV1Integrations: - description: Third party integrations that Datadog supports. - properties: - pagerduty: - $ref: '#/components/schemas/ServiceDefinitionV1Pagerduty' + notifications: + description: Notification targets for each rule case. + items: + description: Notification. + type: string + type: array + status: + $ref: '#/components/schemas/SecurityMonitoringRuleSeverity' type: object - ServiceDefinitionV1Org: - description: Org related information about the service. + SecurityMonitoringRuleCaseCreate: + description: Case when signal is generated. properties: - application: - description: App feature this service supports. - example: E-Commerce - type: string - team: - description: Team that owns the service. - example: my-team + condition: + description: 'A rule case contains logical operations (`>`,`>=`, `&&`, `||`) + to determine if a signal should be generated + + based on the event counts in the previously defined queries.' type: string - type: object - ServiceDefinitionV1Pagerduty: - description: PagerDuty service URL for the service. - example: https://my-org.pagerduty.com/service-directory/PMyService - type: string - ServiceDefinitionV1Resource: - description: Service's external links. - properties: name: - description: Link name. - example: Runbook - type: string - type: - $ref: '#/components/schemas/ServiceDefinitionV1ResourceType' - url: - description: Link URL. - example: https://my-runbook + description: Name of the case. type: string + notifications: + description: Notification targets for each rule case. + items: + description: Notification. + type: string + type: array + status: + $ref: '#/components/schemas/SecurityMonitoringRuleSeverity' required: - - name - - type - - url + - status type: object - ServiceDefinitionV1ResourceType: - description: Link type. - enum: - - doc - - wiki - - runbook - - url - - repo - - dashboard - - oncall - - code - - link - example: runbook - type: string - x-enum-varnames: - - DOC - - WIKI - - RUNBOOK - - URL - - REPO - - DASHBOARD - - ONCALL - - CODE - - LINK - ServiceDefinitionV1Version: - default: v1 - description: Schema version being used. - enum: - - v1 - example: v1 - type: string - x-enum-varnames: - - V1 - ServiceDefinitionV2: - description: Service definition V2 for providing service metadata and integrations. - properties: - contacts: - description: A list of contacts related to the services. - items: - $ref: '#/components/schemas/ServiceDefinitionV2Contact' - type: array - dd-service: - description: Unique identifier of the service. Must be unique across all - services and is used to match with a service in Datadog. - example: my-service - type: string - dd-team: - description: Experimental feature. A Team handle that matches a Team in - the Datadog Teams product. - example: my-team - type: string - docs: - description: A list of documentation related to the services. - items: - $ref: '#/components/schemas/ServiceDefinitionV2Doc' - type: array - extensions: - additionalProperties: {} - description: Extensions to V2 schema. - example: - myorg/extension: extensionValue - type: object - integrations: - $ref: '#/components/schemas/ServiceDefinitionV2Integrations' - links: - description: A list of links related to the services. - items: - $ref: '#/components/schemas/ServiceDefinitionV2Link' - type: array - repos: - description: A list of code repositories related to the services. - items: - $ref: '#/components/schemas/ServiceDefinitionV2Repo' - type: array - schema-version: - $ref: '#/components/schemas/ServiceDefinitionV2Version' - tags: - description: A set of custom tags. - example: - - my:tag - - service:tag - items: - type: string - type: array - team: - description: Team that owns the service. - example: my-team - type: string - required: - - schema-version - - dd-service - type: object - ServiceDefinitionV2Contact: - description: Service owner's contacts information. + SecurityMonitoringRuleCreatePayload: + description: Create a new rule. oneOf: - - $ref: '#/components/schemas/ServiceDefinitionV2Email' - - $ref: '#/components/schemas/ServiceDefinitionV2Slack' - ServiceDefinitionV2Doc: - description: Service documents. - properties: - name: - description: Document name. - example: Architecture - type: string - provider: - description: Document provider. - example: google drive - type: string - url: - description: Document URL. - example: https://gdrive/mydoc - type: string - required: - - name - - url - type: object - ServiceDefinitionV2Email: - description: Service owner's email. - properties: - contact: - description: Contact value. - example: contact@datadoghq.com - format: email - type: string - name: - description: Contact email. - example: Team Email - type: string - type: - $ref: '#/components/schemas/ServiceDefinitionV2EmailType' - required: - - type - - contact + - $ref: '#/components/schemas/SecurityMonitoringStandardRuleCreatePayload' + - $ref: '#/components/schemas/SecurityMonitoringSignalRuleCreatePayload' type: object - ServiceDefinitionV2EmailType: - description: Contact type. + SecurityMonitoringRuleDecreaseCriticalityBasedOnEnv: + description: 'If true, signals in non-production environments have a lower severity + than what is defined by the rule case, which can reduce signal noise. + + The severity is decreased by one level: `CRITICAL` in production becomes `HIGH` + in non-production, `HIGH` becomes `MEDIUM` and so on. `INFO` remains `INFO`. + + The decrement is applied when the environment tag of the signal starts with + `staging`, `test` or `dev`.' + example: false + type: boolean + SecurityMonitoringRuleDetectionMethod: + description: The detection method. enum: - - email - example: email + - threshold + - new_value + - anomaly_detection + - impossible_travel + - hardcoded type: string x-enum-varnames: - - EMAIL - ServiceDefinitionV2Integrations: - description: Third party integrations that Datadog supports. - properties: - opsgenie: - $ref: '#/components/schemas/ServiceDefinitionV2Opsgenie' - pagerduty: - $ref: '#/components/schemas/ServiceDefinitionV2Pagerduty' - type: object - ServiceDefinitionV2Link: - description: Service's external links. - properties: - name: - description: Link name. - example: Runbook - type: string - type: - $ref: '#/components/schemas/ServiceDefinitionV2LinkType' - url: - description: Link URL. - example: https://my-runbook - type: string - required: - - name - - type - - url - type: object - ServiceDefinitionV2LinkType: - description: Link type. + - THRESHOLD + - NEW_VALUE + - ANOMALY_DETECTION + - IMPOSSIBLE_TRAVEL + - HARDCODED + SecurityMonitoringRuleEvaluationWindow: + description: 'A time window is specified to match when at least one of the cases + matches true. This is a sliding window + + and evaluates in real time.' enum: - - doc - - wiki - - runbook - - url - - repo - - dashboard - - oncall - - code - - link - example: runbook - type: string + - 0 + - 60 + - 300 + - 600 + - 900 + - 1800 + - 3600 + - 7200 + format: int32 + type: integer x-enum-varnames: - - DOC - - WIKI - - RUNBOOK - - URL - - REPO - - DASHBOARD - - ONCALL - - CODE - - LINK - ServiceDefinitionV2Opsgenie: - description: Opsgenie integration for the service. - properties: - region: - $ref: '#/components/schemas/ServiceDefinitionV2OpsgenieRegion' - service-id: - description: Opsgenie service id. - example: 123e4567-e89b-12d3-a456-426614174000 - type: string - required: - - service-id - type: object - ServiceDefinitionV2OpsgenieRegion: - description: Opsgenie instance region. + - ZERO_MINUTES + - ONE_MINUTE + - FIVE_MINUTES + - TEN_MINUTES + - FIFTEEN_MINUTES + - THIRTY_MINUTES + - ONE_HOUR + - TWO_HOURS + SecurityMonitoringRuleHardcodedEvaluatorType: + description: Hardcoded evaluator type. enum: - - US - - EU - example: US + - log4shell type: string x-enum-varnames: - - US - - EU - ServiceDefinitionV2Pagerduty: - description: PagerDuty service URL for the service. - example: https://my-org.pagerduty.com/service-directory/PMyService - type: string - ServiceDefinitionV2Repo: - description: Service code repositories. + - LOG4SHELL + SecurityMonitoringRuleImpossibleTravelOptions: + description: Options on impossible travel rules. properties: - name: - description: Repository name. - example: Source Code - type: string - provider: - description: Repository provider. - example: GitHub - type: string - url: - description: Repository URL. - example: https://github.com/DataDog/schema - type: string - required: - - name - - url + baselineUserLocations: + $ref: '#/components/schemas/SecurityMonitoringRuleImpossibleTravelOptionsBaselineUserLocations' type: object - ServiceDefinitionV2Slack: - description: Service owner's Slack channel. + SecurityMonitoringRuleImpossibleTravelOptionsBaselineUserLocations: + description: 'If true, signals are suppressed for the first 24 hours. In that + time, Datadog learns the user''s regular + + access locations. This can be helpful to reduce noise and infer VPN usage + or credentialed API access.' + example: true + type: boolean + SecurityMonitoringRuleKeepAlive: + description: "Once a signal is generated, the signal will remain \u201Copen\u201D + if a case is matched at least once within\nthis keep alive window." + enum: + - 0 + - 60 + - 300 + - 600 + - 900 + - 1800 + - 3600 + - 7200 + - 10800 + - 21600 + format: int32 + type: integer + x-enum-varnames: + - ZERO_MINUTES + - ONE_MINUTE + - FIVE_MINUTES + - TEN_MINUTES + - FIFTEEN_MINUTES + - THIRTY_MINUTES + - ONE_HOUR + - TWO_HOURS + - THREE_HOURS + - SIX_HOURS + SecurityMonitoringRuleMaxSignalDuration: + description: "A signal will \u201Cclose\u201D regardless of the query being + matched once the time exceeds the maximum duration.\nThis time is calculated + from the first seen timestamp." + enum: + - 0 + - 60 + - 300 + - 600 + - 900 + - 1800 + - 3600 + - 7200 + - 10800 + - 21600 + - 43200 + - 86400 + format: int32 + type: integer + x-enum-varnames: + - ZERO_MINUTES + - ONE_MINUTE + - FIVE_MINUTES + - TEN_MINUTES + - FIFTEEN_MINUTES + - THIRTY_MINUTES + - ONE_HOUR + - TWO_HOURS + - THREE_HOURS + - SIX_HOURS + - TWELVE_HOURS + - ONE_DAY + SecurityMonitoringRuleNewValueOptions: + description: Options on new value rules. properties: - contact: - description: Slack Channel. - example: https://yourcompany.slack.com/archives/channel123 - type: string - name: - description: Contact Slack. - example: Team Slack - type: string - type: - $ref: '#/components/schemas/ServiceDefinitionV2SlackType' - required: - - type - - contact + forgetAfter: + $ref: '#/components/schemas/SecurityMonitoringRuleNewValueOptionsForgetAfter' + learningDuration: + $ref: '#/components/schemas/SecurityMonitoringRuleNewValueOptionsLearningDuration' + learningMethod: + $ref: '#/components/schemas/SecurityMonitoringRuleNewValueOptionsLearningMethod' + learningThreshold: + $ref: '#/components/schemas/SecurityMonitoringRuleNewValueOptionsLearningThreshold' type: object - ServiceDefinitionV2SlackType: - description: Contact type. + SecurityMonitoringRuleNewValueOptionsForgetAfter: + description: The duration in days after which a learned value is forgotten. enum: - - slack - example: slack - type: string + - 1 + - 2 + - 7 + - 14 + - 21 + - 28 + format: int32 + type: integer x-enum-varnames: - - SLACK - ServiceDefinitionV2Version: - default: v2 - description: Schema version being used. + - ONE_DAY + - TWO_DAYS + - ONE_WEEK + - TWO_WEEKS + - THREE_WEEKS + - FOUR_WEEKS + SecurityMonitoringRuleNewValueOptionsLearningDuration: + default: 0 + description: 'The duration in days during which values are learned, and after + which signals will be generated for values that + + weren''t learned. If set to 0, a signal will be generated for all new values + after the first value is learned.' enum: - - v2 - example: v2 + - 0 + - 1 + - 7 + format: int32 + type: integer + x-enum-varnames: + - ZERO_DAYS + - ONE_DAY + - SEVEN_DAYS + SecurityMonitoringRuleNewValueOptionsLearningMethod: + default: duration + description: The learning method used to determine when signals should be generated + for values that weren't learned. + enum: + - duration + - threshold type: string x-enum-varnames: - - V2 - ServiceDefinitionsCreateRequest: - description: Create service definitions request. - oneOf: - - $ref: '#/components/schemas/ServiceDefinitionV2' - - $ref: '#/components/schemas/ServiceDefinitionRaw' - ServiceDefinitionsListResponse: - description: Create service definitions response. + - DURATION + - THRESHOLD + SecurityMonitoringRuleNewValueOptionsLearningThreshold: + default: 0 + description: A number of occurrences after which signals will be generated for + values that weren't learned. + enum: + - 0 + - 1 + format: int32 + type: integer + x-enum-varnames: + - ZERO_OCCURRENCES + - ONE_OCCURRENCE + SecurityMonitoringRuleOptions: + description: Options on rules. properties: - data: - description: Data representing service definitions. - items: - $ref: '#/components/schemas/ServiceDefinitionData' - type: array + decreaseCriticalityBasedOnEnv: + $ref: '#/components/schemas/SecurityMonitoringRuleDecreaseCriticalityBasedOnEnv' + detectionMethod: + $ref: '#/components/schemas/SecurityMonitoringRuleDetectionMethod' + evaluationWindow: + $ref: '#/components/schemas/SecurityMonitoringRuleEvaluationWindow' + hardcodedEvaluatorType: + $ref: '#/components/schemas/SecurityMonitoringRuleHardcodedEvaluatorType' + impossibleTravelOptions: + $ref: '#/components/schemas/SecurityMonitoringRuleImpossibleTravelOptions' + keepAlive: + $ref: '#/components/schemas/SecurityMonitoringRuleKeepAlive' + maxSignalDuration: + $ref: '#/components/schemas/SecurityMonitoringRuleMaxSignalDuration' + newValueOptions: + $ref: '#/components/schemas/SecurityMonitoringRuleNewValueOptions' type: object - UsageApplicationSecurityMonitoringResponse: - description: Application Security Monitoring usage response. - properties: - data: - description: Response containing Application Security Monitoring usage. - items: - $ref: '#/components/schemas/UsageDataObject' - type: array + SecurityMonitoringRuleQuery: + description: Query for matching rule. + oneOf: + - $ref: '#/components/schemas/SecurityMonitoringStandardRuleQuery' + - $ref: '#/components/schemas/SecurityMonitoringSignalRuleQuery' type: object - UsageAttributesObject: - description: Usage attributes data. - properties: - org_name: - description: The organization name. - type: string - product_family: - description: The product for which usage is being reported. - type: string - public_id: - description: The organization public ID. - type: string - timeseries: - description: List of usage data reported for each requested hour. - items: - $ref: '#/components/schemas/UsageTimeSeriesObject' - type: array - usage_type: - $ref: '#/components/schemas/HourlyUsageType' + SecurityMonitoringRuleQueryAggregation: + description: The aggregation type. + enum: + - count + - cardinality + - sum + - max + - new_value + - geo_data + - event_count + type: string + x-enum-varnames: + - COUNT + - CARDINALITY + - SUM + - MAX + - NEW_VALUE + - GEO_DATA + - EVENT_COUNT + SecurityMonitoringRuleResponse: + description: Create a new rule. + oneOf: + - $ref: '#/components/schemas/SecurityMonitoringStandardRuleResponse' + - $ref: '#/components/schemas/SecurityMonitoringSignalRuleResponse' type: object - UsageDataObject: - description: Usage data. - properties: - attributes: - $ref: '#/components/schemas/UsageAttributesObject' - id: - description: Unique ID of the response. - type: string - type: - $ref: '#/components/schemas/UsageTimeSeriesType' - type: object - UsageLambdaTracedInvocationsResponse: - description: Lambda Traced Invocations usage response. + SecurityMonitoringRuleSeverity: + description: Severity of the Security Signal. + enum: + - info + - low + - medium + - high + - critical + example: critical + type: string + x-enum-varnames: + - INFO + - LOW + - MEDIUM + - HIGH + - CRITICAL + SecurityMonitoringRuleTypeCreate: + description: The rule type. + enum: + - log_detection + - workload_security + type: string + x-enum-varnames: + - LOG_DETECTION + - WORKLOAD_SECURITY + SecurityMonitoringRuleTypeRead: + description: The rule type. + enum: + - log_detection + - infrastructure_configuration + - workload_security + - cloud_configuration + type: string + x-enum-varnames: + - LOG_DETECTION + - INFRASTRUCTURE_CONFIGURATION + - WORKLOAD_SECURITY + - CLOUD_CONFIGURATION + SecurityMonitoringRuleUpdatePayload: + description: Update an existing rule. properties: - data: - description: Response containing Lambda Traced Invocations usage. + cases: + description: Cases for generating signals. items: - $ref: '#/components/schemas/UsageDataObject' + $ref: '#/components/schemas/SecurityMonitoringRuleCase' type: array - type: object - UsageObservabilityPipelinesResponse: - description: Observability Pipelines usage response. - properties: - data: - description: Response containing Observability Pipelines usage. + filters: + description: Additional queries to filter matched events before they are + processed. items: - $ref: '#/components/schemas/UsageDataObject' + $ref: '#/components/schemas/SecurityMonitoringFilter' type: array - type: object - UsageTimeSeriesObject: - description: Usage timeseries data. - properties: - timestamp: - description: Datetime in ISO-8601 format, UTC. The hour for the usage. - format: date-time + hasExtendedTitle: + description: Whether the notifications include the triggering group-by values + in their title. + example: true + type: boolean + isEnabled: + description: Whether the rule is enabled. + type: boolean + message: + description: Message for generated signals. type: string - value: - description: Contains the number measured for the given usage_type during - the hour. - format: int64 - nullable: true + name: + description: Name of the rule. + type: string + options: + $ref: '#/components/schemas/SecurityMonitoringRuleOptions' + queries: + description: Queries for selecting logs which are part of the rule. + items: + $ref: '#/components/schemas/SecurityMonitoringRuleQuery' + type: array + tags: + description: Tags for generated signals. + items: + description: Tag. + type: string + type: array + version: + description: The version of the rule being updated. + example: 1 + format: int32 + maximum: 2147483647 type: integer type: object - UsageTimeSeriesType: - default: usage_timeseries - description: Type of usage data. - enum: - - usage_timeseries - example: usage_timeseries - type: string - x-enum-varnames: - - USAGE_TIMESERIES - User: - description: User object returned by the API. + SecurityMonitoringSignal: + description: Object description of a security signal. properties: attributes: - $ref: '#/components/schemas/UserAttributes' + $ref: '#/components/schemas/SecurityMonitoringSignalAttributes' id: - description: ID of the user. + description: The unique ID of the security signal. + example: AAAAAWgN8Xwgr1vKDQAAAABBV2dOOFh3ZzZobm1mWXJFYTR0OA type: string - relationships: - $ref: '#/components/schemas/UserResponseRelationships' type: - $ref: '#/components/schemas/UsersType' - type: object - UserAttributes: - description: Attributes of user object returned by the API. - properties: - created_at: - description: Creation time of the user. - format: date-time - type: string - disabled: - description: Whether the user is disabled. - type: boolean - email: - description: Email of the user. - type: string - handle: - description: Handle of the user. - type: string - icon: - description: URL of the user's icon. - type: string - modified_at: - description: Time that the user was last modified. - format: date-time - type: string - name: - description: Name of the user. - nullable: true - type: string - service_account: - description: Whether the user is a service account. - type: boolean - status: - description: Status of the user. - type: string - title: - description: Title of the user. - nullable: true - type: string - verified: - description: Whether the user is verified. - type: boolean + $ref: '#/components/schemas/SecurityMonitoringSignalType' type: object - UserCreateAttributes: - description: Attributes of the created user. + SecurityMonitoringSignalArchiveComment: + description: Optional comment to display on archived signals. + type: string + SecurityMonitoringSignalArchiveReason: + description: Reason a signal is archived. + enum: + - none + - false_positive + - testing_or_maintenance + - other + type: string + x-enum-varnames: + - NONE + - FALSE_POSITIVE + - TESTING_OR_MAINTENANCE + - OTHER + SecurityMonitoringSignalAssigneeUpdateAttributes: + description: Attributes describing the new assignee of a security signal. properties: - email: - description: The email of the user. - example: jane.doe@example.com - type: string - name: - description: The name of the user. - type: string - title: - description: The title of the user. - type: string + assignee: + $ref: '#/components/schemas/SecurityMonitoringTriageUser' + version: + $ref: '#/components/schemas/SecurityMonitoringSignalVersion' required: - - email + - assignee type: object - UserCreateData: - description: Object to create a user. + SecurityMonitoringSignalAssigneeUpdateData: + description: Data containing the patch for changing the assignee of a signal. properties: attributes: - $ref: '#/components/schemas/UserCreateAttributes' - relationships: - $ref: '#/components/schemas/UserRelationships' - type: - $ref: '#/components/schemas/UsersType' + $ref: '#/components/schemas/SecurityMonitoringSignalAssigneeUpdateAttributes' required: - attributes - - type type: object - UserCreateRequest: - description: Create a user. + SecurityMonitoringSignalAssigneeUpdateRequest: + description: Request body for changing the assignee of a given security monitoring + signal. properties: data: - $ref: '#/components/schemas/UserCreateData' + $ref: '#/components/schemas/SecurityMonitoringSignalAssigneeUpdateData' required: - data type: object - UserInvitationData: - description: Object to create a user invitation. - properties: - relationships: - $ref: '#/components/schemas/UserInvitationRelationships' - type: - $ref: '#/components/schemas/UserInvitationsType' - required: - - type - - relationships - type: object - UserInvitationDataAttributes: - description: Attributes of a user invitation. + SecurityMonitoringSignalAttributes: + description: 'The object containing all signal attributes and their + + associated values.' properties: - created_at: - description: Creation time of the user invitation. - format: date-time - type: string - expires_at: - description: Time of invitation expiration. - format: date-time - type: string - invite_type: - description: Type of invitation. + attributes: + additionalProperties: {} + description: A JSON object of attributes in the security signal. + example: + workflow: + first_seen: '2020-06-23T14:46:01.000Z' + last_seen: '2020-06-23T14:46:49.000Z' + rule: + id: 0f5-e0c-805 + name: 'Brute Force Attack Grouped By User ' + version: 12 + type: object + message: + description: The message in the security signal defined by the rule that + generated the signal. + example: Detect Account Take Over (ATO) through brute force attempts type: string - uuid: - description: UUID of the user invitation. + tags: + description: An array of tags associated with the security signal. + example: + - security:attack + - technique:T1110-brute-force + items: + description: The tag associated with the security signal. + type: string + type: array + timestamp: + description: The timestamp of the security signal. + example: '2019-01-02T09:42:36.320Z' + format: date-time type: string type: object - UserInvitationRelationships: - description: Relationships data for user invitation. + SecurityMonitoringSignalIncidentIds: + description: Array of incidents that are associated with this signal. + items: + description: Public ID attribute of the incident that is associated with the + signal. + example: 2066 + format: int64 + type: integer + type: array + SecurityMonitoringSignalIncidentsUpdateAttributes: + description: Attributes describing the new list of related signals for a security + signal. properties: - user: - $ref: '#/components/schemas/RelationshipToUser' + incident_ids: + $ref: '#/components/schemas/SecurityMonitoringSignalIncidentIds' + version: + $ref: '#/components/schemas/SecurityMonitoringSignalVersion' required: - - user - type: object - UserInvitationResponse: - description: User invitation as returned by the API. - properties: - data: - $ref: '#/components/schemas/UserInvitationResponseData' + - incident_ids type: object - UserInvitationResponseData: - description: Object of a user invitation returned by the API. + SecurityMonitoringSignalIncidentsUpdateData: + description: Data containing the patch for changing the related incidents of + a signal. properties: attributes: - $ref: '#/components/schemas/UserInvitationDataAttributes' - id: - description: ID of the user invitation. - type: string - type: - $ref: '#/components/schemas/UserInvitationsType' + $ref: '#/components/schemas/SecurityMonitoringSignalIncidentsUpdateAttributes' + required: + - attributes type: object - UserInvitationsRequest: - description: Object to invite users to join the organization. + SecurityMonitoringSignalIncidentsUpdateRequest: + description: Request body for changing the related incidents of a given security + monitoring signal. properties: data: - description: List of user invitations. - example: [] - items: - $ref: '#/components/schemas/UserInvitationData' - type: array + $ref: '#/components/schemas/SecurityMonitoringSignalIncidentsUpdateData' required: - data type: object - UserInvitationsResponse: - description: User invitations as returned by the API. - properties: - data: - description: Array of user invitations. - items: - $ref: '#/components/schemas/UserInvitationResponseData' - type: array - type: object - UserInvitationsType: - default: user_invitations - description: User invitations type. - enum: - - user_invitations - example: user_invitations - type: string - x-enum-varnames: - - USER_INVITATIONS - UserRelationships: - description: Relationships of the user object. + SecurityMonitoringSignalListRequest: + description: The request for a security signal list. properties: - roles: - $ref: '#/components/schemas/RelationshipToRoles' + filter: + $ref: '#/components/schemas/SecurityMonitoringSignalListRequestFilter' + page: + $ref: '#/components/schemas/SecurityMonitoringSignalListRequestPage' + sort: + $ref: '#/components/schemas/SecurityMonitoringSignalsSort' type: object - UserResponse: - description: Response containing information about a single user. + SecurityMonitoringSignalListRequestFilter: + description: Search filters for listing security signals. properties: - data: - $ref: '#/components/schemas/User' - included: - description: Array of objects related to the user. - items: - $ref: '#/components/schemas/UserResponseIncludedItem' - type: array - type: object - UserResponseIncludedItem: - description: An object related to a user. - oneOf: - - $ref: '#/components/schemas/Organization' - - $ref: '#/components/schemas/Permission' - - $ref: '#/components/schemas/Role' + from: + description: The minimum timestamp for requested security signals. + example: '2019-01-02T09:42:36.320Z' + format: date-time + type: string + query: + description: Search query for listing security signals. + example: security:attack status:high + type: string + to: + description: The maximum timestamp for requested security signals. + example: '2019-01-03T09:42:36.320Z' + format: date-time + type: string type: object - UserResponseRelationships: - description: Relationships of the user object returned by the API. + SecurityMonitoringSignalListRequestPage: + description: The paging attributes for listing security signals. properties: - org: - $ref: '#/components/schemas/RelationshipToOrganization' - other_orgs: - $ref: '#/components/schemas/RelationshipToOrganizations' - other_users: - $ref: '#/components/schemas/RelationshipToUsers' - roles: - $ref: '#/components/schemas/RelationshipToRoles' + cursor: + description: A list of results using the cursor provided in the previous + query. + example: eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ== + type: string + limit: + default: 10 + description: The maximum number of security signals in the response. + example: 25 + format: int32 + maximum: 1000 + type: integer type: object - UserUpdateAttributes: - description: Attributes of the edited user. + SecurityMonitoringSignalRuleCreatePayload: + description: Create a new signal correlation rule. properties: - disabled: - description: If the user is enabled or disabled. + cases: + description: Cases for generating signals. + example: [] + items: + $ref: '#/components/schemas/SecurityMonitoringRuleCaseCreate' + type: array + filters: + description: Additional queries to filter matched events before they are + processed. + items: + $ref: '#/components/schemas/SecurityMonitoringFilter' + type: array + hasExtendedTitle: + description: Whether the notifications include the triggering group-by values + in their title. + example: true type: boolean - email: - description: The email of the user. + isEnabled: + description: Whether the rule is enabled. + example: true + type: boolean + message: + description: Message for generated signals. + example: '' type: string name: - description: The name of the user. - type: string - type: object - UserUpdateData: - description: Object to update a user. - properties: - attributes: - $ref: '#/components/schemas/UserUpdateAttributes' - id: - description: ID of the user. - example: 00000000-0000-feed-0000-000000000000 + description: The name of the rule. + example: My security monitoring rule. type: string - type: - $ref: '#/components/schemas/UsersType' - required: - - attributes - - type - - id - type: object - UserUpdateRequest: - description: Update a user. - properties: - data: - $ref: '#/components/schemas/UserUpdateData' - required: - - data - type: object - UsersResponse: - description: Response containing information about multiple users. - properties: - data: - description: Array of returned users. + options: + $ref: '#/components/schemas/SecurityMonitoringRuleOptions' + queries: + description: Queries for selecting signals which are part of the rule. + example: [] items: - $ref: '#/components/schemas/User' + $ref: '#/components/schemas/SecurityMonitoringSignalRuleQuery' type: array - included: - description: Array of objects related to the users. + tags: + description: Tags for generated signals. + example: + - env:prod + - team:security items: - $ref: '#/components/schemas/UserResponseIncludedItem' + description: Tag. + type: string type: array - meta: - $ref: '#/components/schemas/ResponseMetaAttributes' - readOnly: true - type: object - UsersType: - default: users - description: Users resource type. + type: + $ref: '#/components/schemas/SecurityMonitoringSignalRuleType' + required: + - name + - isEnabled + - queries + - options + - cases + - message + type: object + SecurityMonitoringSignalRuleQuery: + description: Query for matching rule on signals. + properties: + aggregation: + $ref: '#/components/schemas/SecurityMonitoringRuleQueryAggregation' + correlatedByFields: + description: Fields to group by. + items: + description: Field. + type: string + type: array + correlatedQueryIndex: + description: Index of the rule query used to retrieve the correlated field. + format: int32 + maximum: 9 + type: integer + metrics: + description: Group of target fields to aggregate over. + items: + description: Field. + type: string + type: array + name: + description: Name of the query. + type: string + ruleId: + description: Rule ID to match on signals. + example: org-ru1-e1d + type: string + required: + - ruleId + type: object + SecurityMonitoringSignalRuleResponse: + description: Rule. + properties: + cases: + description: Cases for generating signals. + items: + $ref: '#/components/schemas/SecurityMonitoringRuleCase' + type: array + createdAt: + description: When the rule was created, timestamp in milliseconds. + format: int64 + type: integer + creationAuthorId: + description: User ID of the user who created the rule. + format: int64 + type: integer + filters: + description: Additional queries to filter matched events before they are + processed. + items: + $ref: '#/components/schemas/SecurityMonitoringFilter' + type: array + hasExtendedTitle: + description: Whether the notifications include the triggering group-by values + in their title. + type: boolean + id: + description: The ID of the rule. + type: string + isDefault: + description: Whether the rule is included by default. + type: boolean + isDeleted: + description: Whether the rule has been deleted. + type: boolean + isEnabled: + description: Whether the rule is enabled. + type: boolean + message: + description: Message for generated signals. + type: string + name: + description: The name of the rule. + type: string + options: + $ref: '#/components/schemas/SecurityMonitoringRuleOptions' + queries: + description: Queries for selecting logs which are part of the rule. + items: + $ref: '#/components/schemas/SecurityMonitoringSignalRuleResponseQuery' + type: array + tags: + description: Tags for generated signals. + items: + description: Tag. + type: string + type: array + type: + $ref: '#/components/schemas/SecurityMonitoringSignalRuleType' + updateAuthorId: + description: User ID of the user who updated the rule. + format: int64 + type: integer + version: + description: The version of the rule. + format: int64 + type: integer + SecurityMonitoringSignalRuleResponseQuery: + description: Query for matching rule on signals. + properties: + aggregation: + $ref: '#/components/schemas/SecurityMonitoringRuleQueryAggregation' + correlatedByFields: + description: Fields to group by. + items: + description: Field. + type: string + type: array + correlatedQueryIndex: + description: Index of the rule query used to retrieve the correlated field. + format: int32 + maximum: 9 + type: integer + defaultRuleId: + description: Default Rule ID to match on signals. + example: d3f-ru1-e1d + type: string + metrics: + description: Group of target fields to aggregate over. + items: + description: Field. + type: string + type: array + name: + description: Name of the query. + type: string + ruleId: + description: Rule ID to match on signals. + example: org-ru1-e1d + type: string + type: object + SecurityMonitoringSignalRuleType: + description: The rule type. enum: - - users - example: users + - signal_correlation type: string x-enum-varnames: - - USERS - securitySchemes: - AuthZ: - description: This API uses OAuth 2 with the implicit grant flow. - flows: - authorizationCode: - authorizationUrl: /oauth2/v1/authorize - scopes: - dashboards_read: View dashboards. - dashboards_write: Create and change dashboards. - events_read: Read Events data. - incident_read: View incidents in Datadog. - incident_settings_write: Configure Incidents settings. - incident_write: Create, view, and manage incidents in Datadog. - metrics_read: View custom metrics. - monitors_read: View monitors. - security_monitoring_filters_read: Read Security Filters. - security_monitoring_filters_write: Create, edit, and delete Security Filters. - security_monitoring_rules_read: Read Detection Rules. - security_monitoring_rules_write: Create and edit Detection Rules. - security_monitoring_signals_read: View Security Signals. - usage_read: View your organization's usage and usage attribution. - user_access_invite: Invite other users to your organization. - user_access_manage: Disable users, manage user roles, manage SAML-to-role - mappings, and configure logs restriction queries. - tokenUrl: /oauth2/v1/token - type: oauth2 - apiKeyAuth: - description: Your Datadog API Key. - in: header - name: DD-API-KEY - type: apiKey - x-env-name: DD_API_KEY - appKeyAuth: - description: Your Datadog APP Key. - in: header - name: DD-APPLICATION-KEY - type: apiKey - x-env-name: DD_APP_KEY -info: - contact: - email: support@datadoghq.com - name: Datadog Support - url: https://www.datadoghq.com/support/ - description: Collection of all Datadog Public endpoints. - title: Datadog API V2 Collection - version: '1.0' -openapi: 3.0.0 -paths: - /api/v2/api_keys: - get: - description: List all API keys available for your account. - operationId: ListAPIKeys + - SIGNAL_CORRELATION + SecurityMonitoringSignalState: + description: The new triage state of the signal. + enum: + - open + - archived + - under_review + example: open + type: string + x-enum-varnames: + - OPEN + - ARCHIVED + - UNDER_REVIEW + SecurityMonitoringSignalStateUpdateAttributes: + description: Attributes describing the change of state of a security signal. + properties: + archive_comment: + $ref: '#/components/schemas/SecurityMonitoringSignalArchiveComment' + archive_reason: + $ref: '#/components/schemas/SecurityMonitoringSignalArchiveReason' + state: + $ref: '#/components/schemas/SecurityMonitoringSignalState' + version: + $ref: '#/components/schemas/SecurityMonitoringSignalVersion' + required: + - state + type: object + SecurityMonitoringSignalStateUpdateData: + description: Data containing the patch for changing the state of a signal. + properties: + attributes: + $ref: '#/components/schemas/SecurityMonitoringSignalStateUpdateAttributes' + required: + - attributes + type: object + SecurityMonitoringSignalStateUpdateRequest: + description: Request body for changing the state of a given security monitoring + signal. + properties: + data: + $ref: '#/components/schemas/SecurityMonitoringSignalStateUpdateData' + required: + - data + type: object + SecurityMonitoringSignalTriageAttributes: + description: Attributes describing a triage state update operation over a security + signal. + properties: + archive_comment: + $ref: '#/components/schemas/SecurityMonitoringSignalArchiveComment' + archive_comment_timestamp: + description: Timestamp of the last edit to the comment. + format: int64 + minimum: 0 + type: integer + archive_comment_user: + $ref: '#/components/schemas/SecurityMonitoringTriageUser' + archive_reason: + $ref: '#/components/schemas/SecurityMonitoringSignalArchiveReason' + assignee: + $ref: '#/components/schemas/SecurityMonitoringTriageUser' + incident_ids: + $ref: '#/components/schemas/SecurityMonitoringSignalIncidentIds' + state: + $ref: '#/components/schemas/SecurityMonitoringSignalState' + state_update_timestamp: + description: Timestamp of the last update to the signal state. + format: int64 + minimum: 0 + type: integer + state_update_user: + $ref: '#/components/schemas/SecurityMonitoringTriageUser' + required: + - assignee + - state + - incident_ids + type: object + SecurityMonitoringSignalTriageUpdateData: + description: Data containing the updated triage attributes of the signal. + properties: + attributes: + $ref: '#/components/schemas/SecurityMonitoringSignalTriageAttributes' + type: object + SecurityMonitoringSignalTriageUpdateResponse: + description: The response returned after all triage operations, containing the + updated signal triage data. + properties: + data: + $ref: '#/components/schemas/SecurityMonitoringSignalTriageUpdateData' + required: + - data + type: object + SecurityMonitoringSignalType: + default: signal + description: The type of event. + enum: + - signal + example: signal + type: string + x-enum-varnames: + - SIGNAL + SecurityMonitoringSignalVersion: + description: Version of the updated signal. If server side version is higher, + update will be rejected. + format: int64 + type: integer + SecurityMonitoringSignalsListResponse: + description: 'The response object with all security signals matching the request + + and pagination information.' + properties: + data: + description: An array of security signals matching the request. + items: + $ref: '#/components/schemas/SecurityMonitoringSignal' + type: array + links: + $ref: '#/components/schemas/SecurityMonitoringSignalsListResponseLinks' + meta: + $ref: '#/components/schemas/SecurityMonitoringSignalsListResponseMeta' + type: object + SecurityMonitoringSignalsListResponseLinks: + description: Links attributes. + properties: + next: + description: 'The link for the next set of results. **Note**: The request + can also be made using the + + POST endpoint.' + example: https://app.datadoghq.com/api/v2/security_monitoring/signals?filter[query]=foo&page[cursor]=eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ== + type: string + type: object + SecurityMonitoringSignalsListResponseMeta: + description: Meta attributes. + properties: + page: + $ref: '#/components/schemas/SecurityMonitoringSignalsListResponseMetaPage' + type: object + SecurityMonitoringSignalsListResponseMetaPage: + description: Paging attributes. + properties: + after: + description: 'The cursor used to get the next results, if any. To make the + next request, use the same + + parameters with the addition of the `page[cursor]`.' + example: eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ== + type: string + type: object + SecurityMonitoringSignalsSort: + description: The sort parameters used for querying security signals. + enum: + - timestamp + - -timestamp + type: string + x-enum-varnames: + - TIMESTAMP_ASCENDING + - TIMESTAMP_DESCENDING + SecurityMonitoringStandardRuleCreatePayload: + description: Create a new rule. + properties: + cases: + description: Cases for generating signals. + example: [] + items: + $ref: '#/components/schemas/SecurityMonitoringRuleCaseCreate' + type: array + filters: + description: Additional queries to filter matched events before they are + processed. + items: + $ref: '#/components/schemas/SecurityMonitoringFilter' + type: array + hasExtendedTitle: + description: Whether the notifications include the triggering group-by values + in their title. + example: true + type: boolean + isEnabled: + description: Whether the rule is enabled. + example: true + type: boolean + message: + description: Message for generated signals. + example: '' + type: string + name: + description: The name of the rule. + example: My security monitoring rule. + type: string + options: + $ref: '#/components/schemas/SecurityMonitoringRuleOptions' + queries: + description: Queries for selecting logs which are part of the rule. + example: [] + items: + $ref: '#/components/schemas/SecurityMonitoringStandardRuleQuery' + type: array + tags: + description: Tags for generated signals. + example: + - env:prod + - team:security + items: + description: Tag. + type: string + type: array + type: + $ref: '#/components/schemas/SecurityMonitoringRuleTypeCreate' + required: + - name + - isEnabled + - queries + - options + - cases + - message + type: object + SecurityMonitoringStandardRuleQuery: + description: Query for matching rule. + properties: + aggregation: + $ref: '#/components/schemas/SecurityMonitoringRuleQueryAggregation' + distinctFields: + description: Field for which the cardinality is measured. Sent as an array. + items: + description: Field. + type: string + type: array + groupByFields: + description: Fields to group by. + items: + description: Field. + type: string + type: array + metric: + deprecated: true + description: '(Deprecated) The target field to aggregate over when using + the sum or max + + aggregations. `metrics` field should be used instead.' + type: string + metrics: + description: Group of target fields to aggregate over when using the sum, + max, geo data, or new value aggregations. The sum, max, and geo data aggregations + only accept one value in this list, whereas the new value aggregation + accepts up to five values. + items: + description: Field. + type: string + type: array + name: + description: Name of the query. + type: string + query: + description: Query to run on logs. + example: a > 3 + type: string + required: + - query + type: object + SecurityMonitoringStandardRuleResponse: + description: Rule. + properties: + cases: + description: Cases for generating signals. + items: + $ref: '#/components/schemas/SecurityMonitoringRuleCase' + type: array + createdAt: + description: When the rule was created, timestamp in milliseconds. + format: int64 + type: integer + creationAuthorId: + description: User ID of the user who created the rule. + format: int64 + type: integer + filters: + description: Additional queries to filter matched events before they are + processed. + items: + $ref: '#/components/schemas/SecurityMonitoringFilter' + type: array + hasExtendedTitle: + description: Whether the notifications include the triggering group-by values + in their title. + type: boolean + id: + description: The ID of the rule. + type: string + isDefault: + description: Whether the rule is included by default. + type: boolean + isDeleted: + description: Whether the rule has been deleted. + type: boolean + isEnabled: + description: Whether the rule is enabled. + type: boolean + message: + description: Message for generated signals. + type: string + name: + description: The name of the rule. + type: string + options: + $ref: '#/components/schemas/SecurityMonitoringRuleOptions' + queries: + description: Queries for selecting logs which are part of the rule. + items: + $ref: '#/components/schemas/SecurityMonitoringStandardRuleQuery' + type: array + tags: + description: Tags for generated signals. + items: + description: Tag. + type: string + type: array + type: + $ref: '#/components/schemas/SecurityMonitoringRuleTypeRead' + updateAuthorId: + description: User ID of the user who updated the rule. + format: int64 + type: integer + version: + description: The version of the rule. + format: int64 + type: integer + SecurityMonitoringTriageUser: + description: Object representing a given user entity. + properties: + handle: + description: The handle for this user account. + type: string + id: + description: Numerical ID assigned by Datadog to this user account. + format: int64 + type: integer + name: + description: The name for this user account. + type: string + uuid: + description: UUID assigned by Datadog to this user account. + example: 773b045d-ccf8-4808-bd3b-955ef6a8c940 + type: string + required: + - uuid + type: object + ServiceAccountCreateAttributes: + description: Attributes of the created user. + properties: + email: + description: The email of the user. + example: jane.doe@example.com + type: string + name: + description: The name of the user. + type: string + service_account: + description: Whether the user is a service account. Must be true. + example: true + type: boolean + title: + description: The title of the user. + type: string + required: + - email + - service_account + type: object + ServiceAccountCreateData: + description: Object to create a service account User. + properties: + attributes: + $ref: '#/components/schemas/ServiceAccountCreateAttributes' + relationships: + $ref: '#/components/schemas/UserRelationships' + type: + $ref: '#/components/schemas/UsersType' + required: + - attributes + - type + type: object + ServiceAccountCreateRequest: + description: Create a service account. + properties: + data: + $ref: '#/components/schemas/ServiceAccountCreateData' + required: + - data + type: object + ServiceDefinitionCreateResponse: + description: Create service definitions response. + properties: + data: + description: Create service definitions response payload. + items: + $ref: '#/components/schemas/ServiceDefinitionData' + type: array + type: object + ServiceDefinitionData: + description: Service definition data. + properties: + attributes: + $ref: '#/components/schemas/ServiceDefinitionDataAttributes' + type: + description: Service definition type. + type: string + type: object + ServiceDefinitionDataAttributes: + description: Service definition attributes. + properties: + meta: + $ref: '#/components/schemas/ServiceDefinitionMeta' + schema: + $ref: '#/components/schemas/ServiceDefinitionSchema' + type: object + ServiceDefinitionGetResponse: + description: Get service definition response. + properties: + data: + $ref: '#/components/schemas/ServiceDefinitionData' + type: object + ServiceDefinitionMeta: + description: Metadata about a service definition. + properties: + github-html-url: + description: GitHub HTML URL. + type: string + ingested-schema-version: + description: Ingestion schema version. + type: string + ingestion-source: + description: Ingestion source of the service definition. + type: string + last-modified-time: + description: Last modified time of the service definition. + type: string + type: object + ServiceDefinitionRaw: + description: Service Definition in raw JSON/YAML representation. + example: '--- + + schema-version: v2 + + dd-service: my-service + + ' + type: string + ServiceDefinitionSchema: + description: Service definition schema. + oneOf: + - $ref: '#/components/schemas/ServiceDefinitionV1' + - $ref: '#/components/schemas/ServiceDefinitionV2' + type: object + ServiceDefinitionV1: + deprecated: true + description: Deprecated - Service definition V1 for providing additional service + metadata and integrations. + properties: + contact: + $ref: '#/components/schemas/ServiceDefinitionV1Contact' + extensions: + additionalProperties: {} + description: Extensions to V1 schema. + example: + myorg/extension: extensionValue + type: object + external-resources: + description: A list of external links related to the services. + items: + $ref: '#/components/schemas/ServiceDefinitionV1Resource' + type: array + info: + $ref: '#/components/schemas/ServiceDefinitionV1Info' + integrations: + $ref: '#/components/schemas/ServiceDefinitionV1Integrations' + org: + $ref: '#/components/schemas/ServiceDefinitionV1Org' + schema-version: + $ref: '#/components/schemas/ServiceDefinitionV1Version' + tags: + description: A set of custom tags. + example: + - my:tag + - service:tag + items: + type: string + type: array + required: + - schema-version + - info + type: object + ServiceDefinitionV1Contact: + description: Contact information about the service. + properties: + email: + description: "Service owner\u2019s email." + example: contact@datadoghq.com + format: email + type: string + slack: + description: "Service owner\u2019s Slack channel." + example: https://yourcompany.slack.com/archives/channel123 + type: string + ServiceDefinitionV1Info: + description: Basic information about a service. + properties: + dd-service: + description: Unique identifier of the service. Must be unique across all + services and is used to match with a service in Datadog. + example: myservice + type: string + description: + description: A short description of the service. + example: A shopping cart service + type: string + display-name: + description: A friendly name of the service. + example: My Service + type: string + service-tier: + description: Service tier. + example: Tier 1 + type: string + required: + - dd-service + type: object + ServiceDefinitionV1Integrations: + description: Third party integrations that Datadog supports. + properties: + pagerduty: + $ref: '#/components/schemas/ServiceDefinitionV1Pagerduty' + type: object + ServiceDefinitionV1Org: + description: Org related information about the service. + properties: + application: + description: App feature this service supports. + example: E-Commerce + type: string + team: + description: Team that owns the service. + example: my-team + type: string + type: object + ServiceDefinitionV1Pagerduty: + description: PagerDuty service URL for the service. + example: https://my-org.pagerduty.com/service-directory/PMyService + type: string + ServiceDefinitionV1Resource: + description: Service's external links. + properties: + name: + description: Link name. + example: Runbook + type: string + type: + $ref: '#/components/schemas/ServiceDefinitionV1ResourceType' + url: + description: Link URL. + example: https://my-runbook + type: string + required: + - name + - type + - url + type: object + ServiceDefinitionV1ResourceType: + description: Link type. + enum: + - doc + - wiki + - runbook + - url + - repo + - dashboard + - oncall + - code + - link + example: runbook + type: string + x-enum-varnames: + - DOC + - WIKI + - RUNBOOK + - URL + - REPO + - DASHBOARD + - ONCALL + - CODE + - LINK + ServiceDefinitionV1Version: + default: v1 + description: Schema version being used. + enum: + - v1 + example: v1 + type: string + x-enum-varnames: + - V1 + ServiceDefinitionV2: + description: Service definition V2 for providing service metadata and integrations. + properties: + contacts: + description: A list of contacts related to the services. + items: + $ref: '#/components/schemas/ServiceDefinitionV2Contact' + type: array + dd-service: + description: Unique identifier of the service. Must be unique across all + services and is used to match with a service in Datadog. + example: my-service + type: string + dd-team: + description: Experimental feature. A Team handle that matches a Team in + the Datadog Teams product. + example: my-team + type: string + docs: + description: A list of documentation related to the services. + items: + $ref: '#/components/schemas/ServiceDefinitionV2Doc' + type: array + extensions: + additionalProperties: {} + description: Extensions to V2 schema. + example: + myorg/extension: extensionValue + type: object + integrations: + $ref: '#/components/schemas/ServiceDefinitionV2Integrations' + links: + description: A list of links related to the services. + items: + $ref: '#/components/schemas/ServiceDefinitionV2Link' + type: array + repos: + description: A list of code repositories related to the services. + items: + $ref: '#/components/schemas/ServiceDefinitionV2Repo' + type: array + schema-version: + $ref: '#/components/schemas/ServiceDefinitionV2Version' + tags: + description: A set of custom tags. + example: + - my:tag + - service:tag + items: + type: string + type: array + team: + description: Team that owns the service. + example: my-team + type: string + required: + - schema-version + - dd-service + type: object + ServiceDefinitionV2Contact: + description: Service owner's contacts information. + oneOf: + - $ref: '#/components/schemas/ServiceDefinitionV2Email' + - $ref: '#/components/schemas/ServiceDefinitionV2Slack' + ServiceDefinitionV2Doc: + description: Service documents. + properties: + name: + description: Document name. + example: Architecture + type: string + provider: + description: Document provider. + example: google drive + type: string + url: + description: Document URL. + example: https://gdrive/mydoc + type: string + required: + - name + - url + type: object + ServiceDefinitionV2Email: + description: Service owner's email. + properties: + contact: + description: Contact value. + example: contact@datadoghq.com + format: email + type: string + name: + description: Contact email. + example: Team Email + type: string + type: + $ref: '#/components/schemas/ServiceDefinitionV2EmailType' + required: + - type + - contact + type: object + ServiceDefinitionV2EmailType: + description: Contact type. + enum: + - email + example: email + type: string + x-enum-varnames: + - EMAIL + ServiceDefinitionV2Integrations: + description: Third party integrations that Datadog supports. + properties: + opsgenie: + $ref: '#/components/schemas/ServiceDefinitionV2Opsgenie' + pagerduty: + $ref: '#/components/schemas/ServiceDefinitionV2Pagerduty' + type: object + ServiceDefinitionV2Link: + description: Service's external links. + properties: + name: + description: Link name. + example: Runbook + type: string + type: + $ref: '#/components/schemas/ServiceDefinitionV2LinkType' + url: + description: Link URL. + example: https://my-runbook + type: string + required: + - name + - type + - url + type: object + ServiceDefinitionV2LinkType: + description: Link type. + enum: + - doc + - wiki + - runbook + - url + - repo + - dashboard + - oncall + - code + - link + example: runbook + type: string + x-enum-varnames: + - DOC + - WIKI + - RUNBOOK + - URL + - REPO + - DASHBOARD + - ONCALL + - CODE + - LINK + ServiceDefinitionV2Opsgenie: + description: Opsgenie integration for the service. + properties: + region: + $ref: '#/components/schemas/ServiceDefinitionV2OpsgenieRegion' + service-id: + description: Opsgenie service id. + example: 123e4567-e89b-12d3-a456-426614174000 + type: string + required: + - service-id + type: object + ServiceDefinitionV2OpsgenieRegion: + description: Opsgenie instance region. + enum: + - US + - EU + example: US + type: string + x-enum-varnames: + - US + - EU + ServiceDefinitionV2Pagerduty: + description: PagerDuty service URL for the service. + example: https://my-org.pagerduty.com/service-directory/PMyService + type: string + ServiceDefinitionV2Repo: + description: Service code repositories. + properties: + name: + description: Repository name. + example: Source Code + type: string + provider: + description: Repository provider. + example: GitHub + type: string + url: + description: Repository URL. + example: https://github.com/DataDog/schema + type: string + required: + - name + - url + type: object + ServiceDefinitionV2Slack: + description: Service owner's Slack channel. + properties: + contact: + description: Slack Channel. + example: https://yourcompany.slack.com/archives/channel123 + type: string + name: + description: Contact Slack. + example: Team Slack + type: string + type: + $ref: '#/components/schemas/ServiceDefinitionV2SlackType' + required: + - type + - contact + type: object + ServiceDefinitionV2SlackType: + description: Contact type. + enum: + - slack + example: slack + type: string + x-enum-varnames: + - SLACK + ServiceDefinitionV2Version: + default: v2 + description: Schema version being used. + enum: + - v2 + example: v2 + type: string + x-enum-varnames: + - V2 + ServiceDefinitionsCreateRequest: + description: Create service definitions request. + oneOf: + - $ref: '#/components/schemas/ServiceDefinitionV2' + - $ref: '#/components/schemas/ServiceDefinitionRaw' + ServiceDefinitionsListResponse: + description: Create service definitions response. + properties: + data: + description: Data representing service definitions. + items: + $ref: '#/components/schemas/ServiceDefinitionData' + type: array + type: object + TagsEventAttribute: + description: Array of tags associated with your event. + example: + - team:A + items: + description: Tag associated with your event. + type: string + type: array + TimestampEventAttribute: + description: Timestamp of your event. + example: '2019-01-02T09:42:36.320Z' + format: date-time + type: string + UsageApplicationSecurityMonitoringResponse: + description: Application Security Monitoring usage response. + properties: + data: + description: Response containing Application Security Monitoring usage. + items: + $ref: '#/components/schemas/UsageDataObject' + type: array + type: object + UsageAttributesObject: + description: Usage attributes data. + properties: + org_name: + description: The organization name. + type: string + product_family: + description: The product for which usage is being reported. + type: string + public_id: + description: The organization public ID. + type: string + timeseries: + description: List of usage data reported for each requested hour. + items: + $ref: '#/components/schemas/UsageTimeSeriesObject' + type: array + usage_type: + $ref: '#/components/schemas/HourlyUsageType' + type: object + UsageDataObject: + description: Usage data. + properties: + attributes: + $ref: '#/components/schemas/UsageAttributesObject' + id: + description: Unique ID of the response. + type: string + type: + $ref: '#/components/schemas/UsageTimeSeriesType' + type: object + UsageLambdaTracedInvocationsResponse: + description: Lambda Traced Invocations usage response. + properties: + data: + description: Response containing Lambda Traced Invocations usage. + items: + $ref: '#/components/schemas/UsageDataObject' + type: array + type: object + UsageObservabilityPipelinesResponse: + description: Observability Pipelines usage response. + properties: + data: + description: Response containing Observability Pipelines usage. + items: + $ref: '#/components/schemas/UsageDataObject' + type: array + type: object + UsageTimeSeriesObject: + description: Usage timeseries data. + properties: + timestamp: + description: Datetime in ISO-8601 format, UTC. The hour for the usage. + format: date-time + type: string + value: + description: Contains the number measured for the given usage_type during + the hour. + format: int64 + nullable: true + type: integer + type: object + UsageTimeSeriesType: + default: usage_timeseries + description: Type of usage data. + enum: + - usage_timeseries + example: usage_timeseries + type: string + x-enum-varnames: + - USAGE_TIMESERIES + User: + description: User object returned by the API. + properties: + attributes: + $ref: '#/components/schemas/UserAttributes' + id: + description: ID of the user. + type: string + relationships: + $ref: '#/components/schemas/UserResponseRelationships' + type: + $ref: '#/components/schemas/UsersType' + type: object + UserAttributes: + description: Attributes of user object returned by the API. + properties: + created_at: + description: Creation time of the user. + format: date-time + type: string + disabled: + description: Whether the user is disabled. + type: boolean + email: + description: Email of the user. + type: string + handle: + description: Handle of the user. + type: string + icon: + description: URL of the user's icon. + type: string + modified_at: + description: Time that the user was last modified. + format: date-time + type: string + name: + description: Name of the user. + nullable: true + type: string + service_account: + description: Whether the user is a service account. + type: boolean + status: + description: Status of the user. + type: string + title: + description: Title of the user. + nullable: true + type: string + verified: + description: Whether the user is verified. + type: boolean + type: object + UserCreateAttributes: + description: Attributes of the created user. + properties: + email: + description: The email of the user. + example: jane.doe@example.com + type: string + name: + description: The name of the user. + type: string + title: + description: The title of the user. + type: string + required: + - email + type: object + UserCreateData: + description: Object to create a user. + properties: + attributes: + $ref: '#/components/schemas/UserCreateAttributes' + relationships: + $ref: '#/components/schemas/UserRelationships' + type: + $ref: '#/components/schemas/UsersType' + required: + - attributes + - type + type: object + UserCreateRequest: + description: Create a user. + properties: + data: + $ref: '#/components/schemas/UserCreateData' + required: + - data + type: object + UserInvitationData: + description: Object to create a user invitation. + properties: + relationships: + $ref: '#/components/schemas/UserInvitationRelationships' + type: + $ref: '#/components/schemas/UserInvitationsType' + required: + - type + - relationships + type: object + UserInvitationDataAttributes: + description: Attributes of a user invitation. + properties: + created_at: + description: Creation time of the user invitation. + format: date-time + type: string + expires_at: + description: Time of invitation expiration. + format: date-time + type: string + invite_type: + description: Type of invitation. + type: string + uuid: + description: UUID of the user invitation. + type: string + type: object + UserInvitationRelationships: + description: Relationships data for user invitation. + properties: + user: + $ref: '#/components/schemas/RelationshipToUser' + required: + - user + type: object + UserInvitationResponse: + description: User invitation as returned by the API. + properties: + data: + $ref: '#/components/schemas/UserInvitationResponseData' + type: object + UserInvitationResponseData: + description: Object of a user invitation returned by the API. + properties: + attributes: + $ref: '#/components/schemas/UserInvitationDataAttributes' + id: + description: ID of the user invitation. + type: string + type: + $ref: '#/components/schemas/UserInvitationsType' + type: object + UserInvitationsRequest: + description: Object to invite users to join the organization. + properties: + data: + description: List of user invitations. + example: [] + items: + $ref: '#/components/schemas/UserInvitationData' + type: array + required: + - data + type: object + UserInvitationsResponse: + description: User invitations as returned by the API. + properties: + data: + description: Array of user invitations. + items: + $ref: '#/components/schemas/UserInvitationResponseData' + type: array + type: object + UserInvitationsType: + default: user_invitations + description: User invitations type. + enum: + - user_invitations + example: user_invitations + type: string + x-enum-varnames: + - USER_INVITATIONS + UserRelationships: + description: Relationships of the user object. + properties: + roles: + $ref: '#/components/schemas/RelationshipToRoles' + type: object + UserResponse: + description: Response containing information about a single user. + properties: + data: + $ref: '#/components/schemas/User' + included: + description: Array of objects related to the user. + items: + $ref: '#/components/schemas/UserResponseIncludedItem' + type: array + type: object + UserResponseIncludedItem: + description: An object related to a user. + oneOf: + - $ref: '#/components/schemas/Organization' + - $ref: '#/components/schemas/Permission' + - $ref: '#/components/schemas/Role' + type: object + UserResponseRelationships: + description: Relationships of the user object returned by the API. + properties: + org: + $ref: '#/components/schemas/RelationshipToOrganization' + other_orgs: + $ref: '#/components/schemas/RelationshipToOrganizations' + other_users: + $ref: '#/components/schemas/RelationshipToUsers' + roles: + $ref: '#/components/schemas/RelationshipToRoles' + type: object + UserUpdateAttributes: + description: Attributes of the edited user. + properties: + disabled: + description: If the user is enabled or disabled. + type: boolean + email: + description: The email of the user. + type: string + name: + description: The name of the user. + type: string + type: object + UserUpdateData: + description: Object to update a user. + properties: + attributes: + $ref: '#/components/schemas/UserUpdateAttributes' + id: + description: ID of the user. + example: 00000000-0000-feed-0000-000000000000 + type: string + type: + $ref: '#/components/schemas/UsersType' + required: + - attributes + - type + - id + type: object + UserUpdateRequest: + description: Update a user. + properties: + data: + $ref: '#/components/schemas/UserUpdateData' + required: + - data + type: object + UsersResponse: + description: Response containing information about multiple users. + properties: + data: + description: Array of returned users. + items: + $ref: '#/components/schemas/User' + type: array + included: + description: Array of objects related to the users. + items: + $ref: '#/components/schemas/UserResponseIncludedItem' + type: array + meta: + $ref: '#/components/schemas/ResponseMetaAttributes' + readOnly: true + type: object + UsersType: + default: users + description: Users resource type. + enum: + - users + example: users + type: string + x-enum-varnames: + - USERS + securitySchemes: + AuthZ: + description: This API uses OAuth 2 with the implicit grant flow. + flows: + authorizationCode: + authorizationUrl: /oauth2/v1/authorize + scopes: + dashboards_read: View dashboards. + dashboards_write: Create and change dashboards. + events_read: Read Events data. + incident_read: View incidents in Datadog. + incident_settings_write: Configure Incidents settings. + incident_write: Create, view, and manage incidents in Datadog. + metrics_read: View custom metrics. + monitors_read: View monitors. + security_monitoring_filters_read: Read Security Filters. + security_monitoring_filters_write: Create, edit, and delete Security Filters. + security_monitoring_rules_read: Read Detection Rules. + security_monitoring_rules_write: Create and edit Detection Rules. + security_monitoring_signals_read: View Security Signals. + usage_read: View your organization's usage and usage attribution. + user_access_invite: Invite other users to your organization. + user_access_manage: Disable users, manage user roles, manage SAML-to-role + mappings, and configure logs restriction queries. + tokenUrl: /oauth2/v1/token + type: oauth2 + apiKeyAuth: + description: Your Datadog API Key. + in: header + name: DD-API-KEY + type: apiKey + x-env-name: DD_API_KEY + appKeyAuth: + description: Your Datadog APP Key. + in: header + name: DD-APPLICATION-KEY + type: apiKey + x-env-name: DD_APP_KEY +info: + contact: + email: support@datadoghq.com + name: Datadog Support + url: https://www.datadoghq.com/support/ + description: Collection of all Datadog Public endpoints. + title: Datadog API V2 Collection + version: '1.0' +openapi: 3.0.0 +paths: + /api/v2/api_keys: + get: + description: List all API keys available for your account. + operationId: ListAPIKeys + parameters: + - $ref: '#/components/parameters/PageSize' + - $ref: '#/components/parameters/PageNumber' + - $ref: '#/components/parameters/APIKeysSortParameter' + - $ref: '#/components/parameters/APIKeyFilterParameter' + - $ref: '#/components/parameters/APIKeyFilterCreatedAtStartParameter' + - $ref: '#/components/parameters/APIKeyFilterCreatedAtEndParameter' + - $ref: '#/components/parameters/APIKeyFilterModifiedAtStartParameter' + - $ref: '#/components/parameters/APIKeyFilterModifiedAtEndParameter' + - $ref: '#/components/parameters/APIKeyIncludeParameter' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/APIKeysResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Get all API keys + tags: + - Key Management + post: + description: Create an API key. + operationId: CreateAPIKey + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/APIKeyCreateRequest' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/APIKeyResponse' + description: Created + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Create an API key + tags: + - Key Management + x-codegen-request-body-name: body + /api/v2/api_keys/{api_key_id}: + delete: + description: Delete an API key. + operationId: DeleteAPIKey + parameters: + - $ref: '#/components/parameters/APIKeyId' + responses: + '204': + description: No Content + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Delete an API key + tags: + - Key Management + get: + description: Get an API key. + operationId: GetAPIKey + parameters: + - $ref: '#/components/parameters/APIKeyId' + - $ref: '#/components/parameters/APIKeyIncludeParameter' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/APIKeyResponse' + description: OK + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Get API key + tags: + - Key Management + patch: + description: Update an API key. + operationId: UpdateAPIKey + parameters: + - $ref: '#/components/parameters/APIKeyId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/APIKeyUpdateRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/APIKeyResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Edit an API key + tags: + - Key Management + x-codegen-request-body-name: body + /api/v2/application_keys: + get: + description: List all application keys available for your org + operationId: ListApplicationKeys + parameters: + - $ref: '#/components/parameters/PageSize' + - $ref: '#/components/parameters/PageNumber' + - $ref: '#/components/parameters/ApplicationKeysSortParameter' + - $ref: '#/components/parameters/ApplicationKeyFilterParameter' + - $ref: '#/components/parameters/ApplicationKeyFilterCreatedAtStartParameter' + - $ref: '#/components/parameters/ApplicationKeyFilterCreatedAtEndParameter' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ListApplicationKeysResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Get all application keys + tags: + - Key Management + /api/v2/application_keys/{app_key_id}: + delete: + description: Delete an application key + operationId: DeleteApplicationKey + parameters: + - $ref: '#/components/parameters/ApplicationKeyID' + responses: + '204': + description: No Content + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Delete an application key + tags: + - Key Management + x-codegen-request-body-name: body + get: + description: Get an application key for your org. + operationId: GetApplicationKey + parameters: + - $ref: '#/components/parameters/ApplicationKeyID' + - $ref: '#/components/parameters/ApplicationKeyIncludeParameter' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ApplicationKeyResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Get an application key + tags: + - Key Management + patch: + description: Edit an application key + operationId: UpdateApplicationKey parameters: - - $ref: '#/components/parameters/PageSize' - - $ref: '#/components/parameters/PageNumber' - - $ref: '#/components/parameters/APIKeysSortParameter' - - $ref: '#/components/parameters/APIKeyFilterParameter' - - $ref: '#/components/parameters/APIKeyFilterCreatedAtStartParameter' - - $ref: '#/components/parameters/APIKeyFilterCreatedAtEndParameter' - - $ref: '#/components/parameters/APIKeyFilterModifiedAtStartParameter' - - $ref: '#/components/parameters/APIKeyFilterModifiedAtEndParameter' - - $ref: '#/components/parameters/APIKeyIncludeParameter' + - $ref: '#/components/parameters/ApplicationKeyID' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ApplicationKeyUpdateRequest' + required: true responses: '200': content: application/json: schema: - $ref: '#/components/schemas/APIKeysResponse' + $ref: '#/components/schemas/ApplicationKeyResponse' description: OK '400': content: @@ -9583,27 +10496,198 @@ paths: schema: $ref: '#/components/schemas/APIErrorResponse' description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not Found '429': $ref: '#/components/responses/TooManyRequestsResponse' - summary: Get all API keys + summary: Edit an application key tags: - Key Management + x-codegen-request-body-name: body + /api/v2/audit/events: + get: + description: 'List endpoint returns events that match a Audit Logs search query. + + [Results are paginated][1]. + + + Use this endpoint to see your latest Audit Logs events. + + + [1]: https://docs.datadoghq.com/logs/guide/collect-multiple-logs-with-pagination' + operationId: ListAuditLogs + parameters: + - description: Search query following Audit Logs syntax. + example: '@type:session @application_id:xxxx' + in: query + name: filter[query] + required: false + schema: + type: string + - description: Minimum timestamp for requested events. + example: '2019-01-02T09:42:36.320Z' + in: query + name: filter[from] + required: false + schema: + format: date-time + type: string + - description: Maximum timestamp for requested events. + example: '2019-01-03T09:42:36.320Z' + in: query + name: filter[to] + required: false + schema: + format: date-time + type: string + - description: Order of events in results. + in: query + name: sort + required: false + schema: + $ref: '#/components/schemas/AuditLogsSort' + - description: List following results with a cursor provided in the previous + query. + example: eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ== + in: query + name: page[cursor] + required: false + schema: + type: string + - description: Maximum number of events in the response. + example: 25 + in: query + name: page[limit] + required: false + schema: + default: 10 + format: int32 + maximum: 1000 + type: integer + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/AuditLogsEventsResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/NotAuthorizedResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Get a list of Audit Logs events + tags: + - Audit + x-pagination: + cursorParam: page[cursor] + cursorPath: meta.page.after + limitParam: page[limit] + resultsPath: data + /api/v2/audit/events/search: post: - description: Create an API key. - operationId: CreateAPIKey + description: 'List endpoint returns Audit Logs events that match an Audit search + query. + + [Results are paginated][1]. + + + Use this endpoint to build complex Audit Logs events filtering and search. + + + [1]: https://docs.datadoghq.com/logs/guide/collect-multiple-logs-with-pagination' + operationId: SearchAuditLogs requestBody: content: application/json: schema: - $ref: '#/components/schemas/APIKeyCreateRequest' + $ref: '#/components/schemas/AuditLogsSearchEventsRequest' + required: false + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/AuditLogsEventsResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/NotAuthorizedResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Search Audit Logs events + tags: + - Audit + x-codegen-request-body-name: body + x-pagination: + cursorParam: body.page.cursor + cursorPath: meta.page.after + limitParam: body.page.limit + resultsPath: data + /api/v2/authn_mappings: + get: + description: List all AuthN Mappings in the org. + operationId: ListAuthNMappings + parameters: + - $ref: '#/components/parameters/PageSize' + - $ref: '#/components/parameters/PageNumber' + - description: Sort AuthN Mappings depending on the given field. + in: query + name: sort + required: false + schema: + $ref: '#/components/schemas/AuthNMappingsSort' + - description: Filter all mappings by the given string. + in: query + name: filter + required: false + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/AuthNMappingsResponse' + description: OK + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Authentication Error + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: [] + summary: List all AuthN Mappings + tags: + - AuthN Mappings + x-permission: OPEN() + post: + description: Create an AuthN Mapping. + operationId: CreateAuthNMapping + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AuthNMappingCreateRequest' required: true responses: - '201': + '200': content: application/json: schema: - $ref: '#/components/schemas/APIKeyResponse' - description: Created + $ref: '#/components/schemas/AuthNMappingResponse' + description: OK '400': content: application/json: @@ -9615,28 +10699,40 @@ paths: application/json: schema: $ref: '#/components/schemas/APIErrorResponse' - description: Forbidden + description: Authentication Error + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not Found '429': $ref: '#/components/responses/TooManyRequestsResponse' - summary: Create an API key + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - user_access_manage + summary: Create an AuthN Mapping tags: - - Key Management + - AuthN Mappings x-codegen-request-body-name: body - /api/v2/api_keys/{api_key_id}: + x-permission: OR(USER_ACCESS_MANAGE) + /api/v2/authn_mappings/{authn_mapping_id}: delete: - description: Delete an API key. - operationId: DeleteAPIKey + description: Delete an AuthN Mapping specified by AuthN Mapping UUID. + operationId: DeleteAuthNMapping parameters: - - $ref: '#/components/parameters/APIKeyId' + - $ref: '#/components/parameters/AuthNMappingID' responses: '204': - description: No Content + description: OK '403': content: application/json: schema: $ref: '#/components/schemas/APIErrorResponse' - description: Forbidden + description: Authentication Error '404': content: application/json: @@ -9645,28 +10741,33 @@ paths: description: Not Found '429': $ref: '#/components/responses/TooManyRequestsResponse' - summary: Delete an API key + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - user_access_manage + summary: Delete an AuthN Mapping tags: - - Key Management + - AuthN Mappings + x-permission: OR(USER_ACCESS_MANAGE) get: - description: Get an API key. - operationId: GetAPIKey + description: Get an AuthN Mapping specified by the AuthN Mapping UUID. + operationId: GetAuthNMapping parameters: - - $ref: '#/components/parameters/APIKeyId' - - $ref: '#/components/parameters/APIKeyIncludeParameter' + - $ref: '#/components/parameters/AuthNMappingID' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/APIKeyResponse' + $ref: '#/components/schemas/AuthNMappingResponse' description: OK '403': content: application/json: schema: $ref: '#/components/schemas/APIErrorResponse' - description: Forbidden + description: Authentication Error '404': content: application/json: @@ -9675,26 +10776,31 @@ paths: description: Not Found '429': $ref: '#/components/responses/TooManyRequestsResponse' - summary: Get API key + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: [] + summary: Get an AuthN Mapping by UUID tags: - - Key Management + - AuthN Mappings + x-permission: OPEN() patch: - description: Update an API key. - operationId: UpdateAPIKey + description: Edit an AuthN Mapping. + operationId: UpdateAuthNMapping parameters: - - $ref: '#/components/parameters/APIKeyId' + - $ref: '#/components/parameters/AuthNMappingID' requestBody: content: application/json: schema: - $ref: '#/components/schemas/APIKeyUpdateRequest' + $ref: '#/components/schemas/AuthNMappingUpdateRequest' required: true responses: '200': content: application/json: schema: - $ref: '#/components/schemas/APIKeyResponse' + $ref: '#/components/schemas/AuthNMappingResponse' description: OK '400': content: @@ -9707,180 +10813,239 @@ paths: application/json: schema: $ref: '#/components/schemas/APIErrorResponse' - description: Forbidden + description: Authentication Error '404': content: application/json: schema: $ref: '#/components/schemas/APIErrorResponse' description: Not Found - '429': - $ref: '#/components/responses/TooManyRequestsResponse' - summary: Edit an API key - tags: - - Key Management - x-codegen-request-body-name: body - /api/v2/application_keys: - get: - description: List all application keys available for your org - operationId: ListApplicationKeys - parameters: - - $ref: '#/components/parameters/PageSize' - - $ref: '#/components/parameters/PageNumber' - - $ref: '#/components/parameters/ApplicationKeysSortParameter' - - $ref: '#/components/parameters/ApplicationKeyFilterParameter' - - $ref: '#/components/parameters/ApplicationKeyFilterCreatedAtStartParameter' - - $ref: '#/components/parameters/ApplicationKeyFilterCreatedAtEndParameter' - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/ListApplicationKeysResponse' - description: OK - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/APIErrorResponse' - description: Bad Request - '403': + '409': content: application/json: schema: $ref: '#/components/schemas/APIErrorResponse' - description: Forbidden - '404': + description: Conflict + '422': content: application/json: schema: $ref: '#/components/schemas/APIErrorResponse' - description: Not Found + description: Unprocessable Entity '429': $ref: '#/components/responses/TooManyRequestsResponse' - summary: Get all application keys + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - user_access_manage + summary: Edit an AuthN Mapping tags: - - Key Management - /api/v2/application_keys/{app_key_id}: - delete: - description: Delete an application key - operationId: DeleteApplicationKey - parameters: - - $ref: '#/components/parameters/ApplicationKeyID' + - AuthN Mappings + x-codegen-request-body-name: body + x-permission: OR(USER_ACCESS_MANAGE) + /api/v2/ci/pipelines/analytics/aggregate: + post: + description: The API endpoint to aggregate CI Visibility pipeline events into + buckets of computed metrics and timeseries. + operationId: AggregateCIAppPipelineEvents + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CIAppPipelinesAggregateRequest' + required: true responses: - '204': - description: No Content - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/APIErrorResponse' - description: Forbidden - '404': + '200': content: application/json: schema: - $ref: '#/components/schemas/APIErrorResponse' - description: Not Found + $ref: '#/components/schemas/CIAppPipelinesAnalyticsAggregateResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/NotAuthorizedResponse' '429': $ref: '#/components/responses/TooManyRequestsResponse' - summary: Delete an application key + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: [] + summary: Aggregate pipelines events tags: - - Key Management + - CI Visibility Pipelines x-codegen-request-body-name: body + /api/v2/ci/pipelines/events: get: - description: Get an application key for your org. - operationId: GetApplicationKey + description: 'List endpoint returns CI Visibility pipeline events that match + a log search query. + + [Results are paginated similarly to logs](https://docs.datadoghq.com/logs/guide/collect-multiple-logs-with-pagination). + + + Use this endpoint to see your latest pipeline events.' + operationId: ListCIAppPipelineEvents parameters: - - $ref: '#/components/parameters/ApplicationKeyID' - - $ref: '#/components/parameters/ApplicationKeyIncludeParameter' + - description: Search query following log syntax. + example: '@ci.provider.name:github @ci.pipeline.name:Pull Request Labeler' + in: query + name: filter[query] + required: false + schema: + type: string + - description: Minimum timestamp for requested events. + example: '2019-01-02T09:42:36.320Z' + in: query + name: filter[from] + required: false + schema: + format: date-time + type: string + - description: Maximum timestamp for requested events. + example: '2019-01-03T09:42:36.320Z' + in: query + name: filter[to] + required: false + schema: + format: date-time + type: string + - description: Order of events in results. + in: query + name: sort + required: false + schema: + $ref: '#/components/schemas/CIAppSort' + - description: List following results with a cursor provided in the previous + query. + example: eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ== + in: query + name: page[cursor] + required: false + schema: + type: string + - description: Maximum number of events in the response. + example: 25 + in: query + name: page[limit] + required: false + schema: + default: 10 + format: int32 + maximum: 1000 + type: integer responses: '200': content: application/json: schema: - $ref: '#/components/schemas/ApplicationKeyResponse' + $ref: '#/components/schemas/CIAppPipelineEventsResponse' description: OK '400': - content: - application/json: - schema: - $ref: '#/components/schemas/APIErrorResponse' - description: Bad Request + $ref: '#/components/responses/BadRequestResponse' '403': + $ref: '#/components/responses/NotAuthorizedResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: [] + summary: Get a list of pipelines events + tags: + - CI Visibility Pipelines + x-pagination: + cursorParam: page[cursor] + cursorPath: meta.page.after + limitParam: page[limit] + resultsPath: data + /api/v2/ci/pipelines/events/search: + post: + description: 'List endpoint returns CI Visibility pipeline events that match + a log search query. + + [Results are paginated similarly to logs](https://docs.datadoghq.com/logs/guide/collect-multiple-logs-with-pagination). + + + Use this endpoint to build complex events filtering and search.' + operationId: SearchCIAppPipelineEvents + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CIAppPipelineEventsRequest' + required: false + responses: + '200': content: application/json: schema: - $ref: '#/components/schemas/APIErrorResponse' - description: Forbidden - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/APIErrorResponse' - description: Not Found + $ref: '#/components/schemas/CIAppPipelineEventsResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/NotAuthorizedResponse' '429': $ref: '#/components/responses/TooManyRequestsResponse' - summary: Get an application key + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: [] + summary: Search pipelines events tags: - - Key Management - patch: - description: Edit an application key - operationId: UpdateApplicationKey - parameters: - - $ref: '#/components/parameters/ApplicationKeyID' + - CI Visibility Pipelines + x-codegen-request-body-name: body + x-pagination: + cursorParam: body.page.cursor + cursorPath: meta.page.after + limitParam: body.page.limit + resultsPath: data + /api/v2/ci/tests/analytics/aggregate: + post: + description: The API endpoint to aggregate CI Visibility test events into buckets + of computed metrics and timeseries. + operationId: AggregateCIAppTestEvents requestBody: content: application/json: schema: - $ref: '#/components/schemas/ApplicationKeyUpdateRequest' + $ref: '#/components/schemas/CIAppTestsAggregateRequest' required: true responses: '200': content: application/json: schema: - $ref: '#/components/schemas/ApplicationKeyResponse' + $ref: '#/components/schemas/CIAppTestsAnalyticsAggregateResponse' description: OK '400': - content: - application/json: - schema: - $ref: '#/components/schemas/APIErrorResponse' - description: Bad Request + $ref: '#/components/responses/BadRequestResponse' '403': - content: - application/json: - schema: - $ref: '#/components/schemas/APIErrorResponse' - description: Forbidden - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/APIErrorResponse' - description: Not Found + $ref: '#/components/responses/NotAuthorizedResponse' '429': $ref: '#/components/responses/TooManyRequestsResponse' - summary: Edit an application key + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: [] + summary: Aggregate tests events tags: - - Key Management + - CI Visibility Tests x-codegen-request-body-name: body - /api/v2/audit/events: + /api/v2/ci/tests/events: get: - description: 'List endpoint returns events that match a Audit Logs search query. - - [Results are paginated][1]. + description: 'List endpoint returns CI Visibility test events that match a log + search query. - - Use this endpoint to see your latest Audit Logs events. + [Results are paginated similarly to logs](https://docs.datadoghq.com/logs/guide/collect-multiple-logs-with-pagination). - [1]: https://docs.datadoghq.com/logs/guide/collect-multiple-logs-with-pagination' - operationId: ListAuditLogs + Use this endpoint to see your latest test events.' + operationId: ListCIAppTestEvents parameters: - - description: Search query following Audit Logs syntax. - example: '@type:session @application_id:xxxx' + - description: Search query following log syntax. + example: '@test.name:test_foo @test.suite:github.com/DataDog/dd-go/model' in: query name: filter[query] required: false @@ -9907,7 +11072,7 @@ paths: name: sort required: false schema: - $ref: '#/components/schemas/AuditLogsSort' + $ref: '#/components/schemas/CIAppSort' - description: List following results with a cursor provided in the previous query. example: eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ== @@ -9931,7 +11096,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/AuditLogsEventsResponse' + $ref: '#/components/schemas/CIAppTestEventsResponse' description: OK '400': $ref: '#/components/responses/BadRequestResponse' @@ -9939,39 +11104,40 @@ paths: $ref: '#/components/responses/NotAuthorizedResponse' '429': $ref: '#/components/responses/TooManyRequestsResponse' - summary: Get a list of Audit Logs events + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: [] + summary: Get a list of tests events tags: - - Audit + - CI Visibility Tests x-pagination: cursorParam: page[cursor] cursorPath: meta.page.after limitParam: page[limit] resultsPath: data - /api/v2/audit/events/search: + /api/v2/ci/tests/events/search: post: - description: 'List endpoint returns Audit Logs events that match an Audit search - query. - - [Results are paginated][1]. + description: 'List endpoint returns CI Visibility test events that match a log + search query. - - Use this endpoint to build complex Audit Logs events filtering and search. + [Results are paginated similarly to logs](https://docs.datadoghq.com/logs/guide/collect-multiple-logs-with-pagination). - [1]: https://docs.datadoghq.com/logs/guide/collect-multiple-logs-with-pagination' - operationId: SearchAuditLogs + Use this endpoint to build complex events filtering and search.' + operationId: SearchCIAppTestEvents requestBody: content: application/json: schema: - $ref: '#/components/schemas/AuditLogsSearchEventsRequest' + $ref: '#/components/schemas/CIAppTestEventsRequest' required: false responses: '200': content: application/json: schema: - $ref: '#/components/schemas/AuditLogsEventsResponse' + $ref: '#/components/schemas/CIAppTestEventsResponse' description: OK '400': $ref: '#/components/responses/BadRequestResponse' @@ -9979,229 +11145,19 @@ paths: $ref: '#/components/responses/NotAuthorizedResponse' '429': $ref: '#/components/responses/TooManyRequestsResponse' - summary: Search Audit Logs events + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: [] + summary: Search tests events tags: - - Audit + - CI Visibility Tests x-codegen-request-body-name: body x-pagination: cursorParam: body.page.cursor cursorPath: meta.page.after limitParam: body.page.limit resultsPath: data - /api/v2/authn_mappings: - get: - description: List all AuthN Mappings in the org. - operationId: ListAuthNMappings - parameters: - - $ref: '#/components/parameters/PageSize' - - $ref: '#/components/parameters/PageNumber' - - description: Sort AuthN Mappings depending on the given field. - in: query - name: sort - required: false - schema: - $ref: '#/components/schemas/AuthNMappingsSort' - - description: Filter all mappings by the given string. - in: query - name: filter - required: false - schema: - type: string - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/AuthNMappingsResponse' - description: OK - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/APIErrorResponse' - description: Authentication Error - '429': - $ref: '#/components/responses/TooManyRequestsResponse' - security: - - apiKeyAuth: [] - appKeyAuth: [] - - AuthZ: [] - summary: List all AuthN Mappings - tags: - - AuthN Mappings - x-permission: OPEN() - post: - description: Create an AuthN Mapping. - operationId: CreateAuthNMapping - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/AuthNMappingCreateRequest' - required: true - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/AuthNMappingResponse' - description: OK - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/APIErrorResponse' - description: Bad Request - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/APIErrorResponse' - description: Authentication Error - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/APIErrorResponse' - description: Not Found - '429': - $ref: '#/components/responses/TooManyRequestsResponse' - security: - - apiKeyAuth: [] - appKeyAuth: [] - - AuthZ: - - user_access_manage - summary: Create an AuthN Mapping - tags: - - AuthN Mappings - x-codegen-request-body-name: body - x-permission: OR(USER_ACCESS_MANAGE) - /api/v2/authn_mappings/{authn_mapping_id}: - delete: - description: Delete an AuthN Mapping specified by AuthN Mapping UUID. - operationId: DeleteAuthNMapping - parameters: - - $ref: '#/components/parameters/AuthNMappingID' - responses: - '204': - description: OK - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/APIErrorResponse' - description: Authentication Error - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/APIErrorResponse' - description: Not Found - '429': - $ref: '#/components/responses/TooManyRequestsResponse' - security: - - apiKeyAuth: [] - appKeyAuth: [] - - AuthZ: - - user_access_manage - summary: Delete an AuthN Mapping - tags: - - AuthN Mappings - x-permission: OR(USER_ACCESS_MANAGE) - get: - description: Get an AuthN Mapping specified by the AuthN Mapping UUID. - operationId: GetAuthNMapping - parameters: - - $ref: '#/components/parameters/AuthNMappingID' - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/AuthNMappingResponse' - description: OK - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/APIErrorResponse' - description: Authentication Error - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/APIErrorResponse' - description: Not Found - '429': - $ref: '#/components/responses/TooManyRequestsResponse' - security: - - apiKeyAuth: [] - appKeyAuth: [] - - AuthZ: [] - summary: Get an AuthN Mapping by UUID - tags: - - AuthN Mappings - x-permission: OPEN() - patch: - description: Edit an AuthN Mapping. - operationId: UpdateAuthNMapping - parameters: - - $ref: '#/components/parameters/AuthNMappingID' - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/AuthNMappingUpdateRequest' - required: true - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/AuthNMappingResponse' - description: OK - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/APIErrorResponse' - description: Bad Request - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/APIErrorResponse' - description: Authentication Error - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/APIErrorResponse' - description: Not Found - '409': - content: - application/json: - schema: - $ref: '#/components/schemas/APIErrorResponse' - description: Conflict - '422': - content: - application/json: - schema: - $ref: '#/components/schemas/APIErrorResponse' - description: Unprocessable Entity - '429': - $ref: '#/components/responses/TooManyRequestsResponse' - security: - - apiKeyAuth: [] - appKeyAuth: [] - - AuthZ: - - user_access_manage - summary: Edit an AuthN Mapping - tags: - - AuthN Mappings - x-codegen-request-body-name: body - x-permission: OR(USER_ACCESS_MANAGE) /api/v2/current_user/application_keys: get: description: List all application keys available for current user @@ -16327,6 +17283,10 @@ tags: sent from Identity Providers.' name: AuthN Mappings +- description: Search or aggregate your CI Visibility pipeline events over HTTP. + name: CI Visibility Pipelines +- description: Search or aggregate your CI Visibility test events over HTTP. + name: CI Visibility Tests - description: Workload activity security rules for generating events using the Datadog security Agent. name: Cloud Workload Security diff --git a/api/datadogV2/api_ci_visibility_pipelines.go b/api/datadogV2/api_ci_visibility_pipelines.go new file mode 100644 index 00000000000..a6317596646 --- /dev/null +++ b/api/datadogV2/api_ci_visibility_pipelines.go @@ -0,0 +1,634 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "bytes" + _context "context" + _io "io" + _nethttp "net/http" + _neturl "net/url" + "time" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CIVisibilityPipelinesApi service type +type CIVisibilityPipelinesApi datadog.Service + +type apiAggregateCIAppPipelineEventsRequest struct { + ctx _context.Context + body *CIAppPipelinesAggregateRequest +} + +func (a *CIVisibilityPipelinesApi) buildAggregateCIAppPipelineEventsRequest(ctx _context.Context, body CIAppPipelinesAggregateRequest) (apiAggregateCIAppPipelineEventsRequest, error) { + req := apiAggregateCIAppPipelineEventsRequest{ + ctx: ctx, + body: &body, + } + return req, nil +} + +// AggregateCIAppPipelineEvents Aggregate pipelines events. +// The API endpoint to aggregate CI Visibility pipeline events into buckets of computed metrics and timeseries. +func (a *CIVisibilityPipelinesApi) AggregateCIAppPipelineEvents(ctx _context.Context, body CIAppPipelinesAggregateRequest) (CIAppPipelinesAnalyticsAggregateResponse, *_nethttp.Response, error) { + req, err := a.buildAggregateCIAppPipelineEventsRequest(ctx, body) + if err != nil { + var localVarReturnValue CIAppPipelinesAnalyticsAggregateResponse + return localVarReturnValue, nil, err + } + + return a.aggregateCIAppPipelineEventsExecute(req) +} + +// aggregateCIAppPipelineEventsExecute executes the request. +func (a *CIVisibilityPipelinesApi) aggregateCIAppPipelineEventsExecute(r apiAggregateCIAppPipelineEventsRequest) (CIAppPipelinesAnalyticsAggregateResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue CIAppPipelinesAnalyticsAggregateResponse + ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(r.ctx, "v2.CIVisibilityPipelinesApi.AggregateCIAppPipelineEvents") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/ci/pipelines/analytics/aggregate" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if r.body == nil { + return localVarReturnValue, nil, datadog.ReportError("body is required and must be specified") + } + localVarHeaderParams["Content-Type"] = "application/json" + localVarHeaderParams["Accept"] = "application/json" + + // body params + localVarPostBody = r.body + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(datadog.ContextAPIKeys).(map[string]datadog.APIKey); ok { + if apiKey, ok := auth["apiKeyAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["DD-API-KEY"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(datadog.ContextAPIKeys).(map[string]datadog.APIKey); ok { + if apiKey, ok := auth["appKeyAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["DD-APPLICATION-KEY"] = key + } + } + } + req, err := a.Client.PrepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type apiListCIAppPipelineEventsRequest struct { + ctx _context.Context + filterQuery *string + filterFrom *time.Time + filterTo *time.Time + sort *CIAppSort + pageCursor *string + pageLimit *int32 +} + +// ListCIAppPipelineEventsOptionalParameters holds optional parameters for ListCIAppPipelineEvents. +type ListCIAppPipelineEventsOptionalParameters struct { + FilterQuery *string + FilterFrom *time.Time + FilterTo *time.Time + Sort *CIAppSort + PageCursor *string + PageLimit *int32 +} + +// NewListCIAppPipelineEventsOptionalParameters creates an empty struct for parameters. +func NewListCIAppPipelineEventsOptionalParameters() *ListCIAppPipelineEventsOptionalParameters { + this := ListCIAppPipelineEventsOptionalParameters{} + return &this +} + +// WithFilterQuery sets the corresponding parameter name and returns the struct. +func (r *ListCIAppPipelineEventsOptionalParameters) WithFilterQuery(filterQuery string) *ListCIAppPipelineEventsOptionalParameters { + r.FilterQuery = &filterQuery + return r +} + +// WithFilterFrom sets the corresponding parameter name and returns the struct. +func (r *ListCIAppPipelineEventsOptionalParameters) WithFilterFrom(filterFrom time.Time) *ListCIAppPipelineEventsOptionalParameters { + r.FilterFrom = &filterFrom + return r +} + +// WithFilterTo sets the corresponding parameter name and returns the struct. +func (r *ListCIAppPipelineEventsOptionalParameters) WithFilterTo(filterTo time.Time) *ListCIAppPipelineEventsOptionalParameters { + r.FilterTo = &filterTo + return r +} + +// WithSort sets the corresponding parameter name and returns the struct. +func (r *ListCIAppPipelineEventsOptionalParameters) WithSort(sort CIAppSort) *ListCIAppPipelineEventsOptionalParameters { + r.Sort = &sort + return r +} + +// WithPageCursor sets the corresponding parameter name and returns the struct. +func (r *ListCIAppPipelineEventsOptionalParameters) WithPageCursor(pageCursor string) *ListCIAppPipelineEventsOptionalParameters { + r.PageCursor = &pageCursor + return r +} + +// WithPageLimit sets the corresponding parameter name and returns the struct. +func (r *ListCIAppPipelineEventsOptionalParameters) WithPageLimit(pageLimit int32) *ListCIAppPipelineEventsOptionalParameters { + r.PageLimit = &pageLimit + return r +} + +func (a *CIVisibilityPipelinesApi) buildListCIAppPipelineEventsRequest(ctx _context.Context, o ...ListCIAppPipelineEventsOptionalParameters) (apiListCIAppPipelineEventsRequest, error) { + req := apiListCIAppPipelineEventsRequest{ + ctx: ctx, + } + + if len(o) > 1 { + return req, datadog.ReportError("only one argument of type ListCIAppPipelineEventsOptionalParameters is allowed") + } + + if o != nil { + req.filterQuery = o[0].FilterQuery + req.filterFrom = o[0].FilterFrom + req.filterTo = o[0].FilterTo + req.sort = o[0].Sort + req.pageCursor = o[0].PageCursor + req.pageLimit = o[0].PageLimit + } + return req, nil +} + +// ListCIAppPipelineEvents Get a list of pipelines events. +// List endpoint returns CI Visibility pipeline events that match a log search query. +// [Results are paginated similarly to logs](https://docs.datadoghq.com/logs/guide/collect-multiple-logs-with-pagination). +// +// Use this endpoint to see your latest pipeline events. +func (a *CIVisibilityPipelinesApi) ListCIAppPipelineEvents(ctx _context.Context, o ...ListCIAppPipelineEventsOptionalParameters) (CIAppPipelineEventsResponse, *_nethttp.Response, error) { + req, err := a.buildListCIAppPipelineEventsRequest(ctx, o...) + if err != nil { + var localVarReturnValue CIAppPipelineEventsResponse + return localVarReturnValue, nil, err + } + + return a.listCIAppPipelineEventsExecute(req) +} + +// ListCIAppPipelineEventsWithPagination provides a paginated version of ListCIAppPipelineEvents returning a channel with all items. +func (a *CIVisibilityPipelinesApi) ListCIAppPipelineEventsWithPagination(ctx _context.Context, o ...ListCIAppPipelineEventsOptionalParameters) (<-chan CIAppPipelineEvent, func(), error) { + ctx, cancel := _context.WithCancel(ctx) + pageSize_ := int32(10) + if len(o) == 0 { + o = append(o, ListCIAppPipelineEventsOptionalParameters{}) + } + if o[0].PageLimit != nil { + pageSize_ = *o[0].PageLimit + } + o[0].PageLimit = &pageSize_ + + items := make(chan CIAppPipelineEvent, pageSize_) + go func() { + for { + req, err := a.buildListCIAppPipelineEventsRequest(ctx, o...) + if err != nil { + break + } + + resp, _, err := a.listCIAppPipelineEventsExecute(req) + if err != nil { + break + } + respData, ok := resp.GetDataOk() + if !ok { + break + } + results := *respData + + for _, item := range results { + select { + case items <- item: + case <-ctx.Done(): + close(items) + return + } + } + if len(results) < int(pageSize_) { + break + } + cursorMeta, ok := resp.GetMetaOk() + if !ok { + break + } + cursorMetaPage, ok := cursorMeta.GetPageOk() + if !ok { + break + } + cursorMetaPageAfter, ok := cursorMetaPage.GetAfterOk() + if !ok { + break + } + + o[0].PageCursor = cursorMetaPageAfter + } + close(items) + }() + return items, cancel, nil +} + +// listCIAppPipelineEventsExecute executes the request. +func (a *CIVisibilityPipelinesApi) listCIAppPipelineEventsExecute(r apiListCIAppPipelineEventsRequest) (CIAppPipelineEventsResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue CIAppPipelineEventsResponse + ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(r.ctx, "v2.CIVisibilityPipelinesApi.ListCIAppPipelineEvents") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/ci/pipelines/events" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if r.filterQuery != nil { + localVarQueryParams.Add("filter[query]", datadog.ParameterToString(*r.filterQuery, "")) + } + if r.filterFrom != nil { + localVarQueryParams.Add("filter[from]", datadog.ParameterToString(*r.filterFrom, "")) + } + if r.filterTo != nil { + localVarQueryParams.Add("filter[to]", datadog.ParameterToString(*r.filterTo, "")) + } + if r.sort != nil { + localVarQueryParams.Add("sort", datadog.ParameterToString(*r.sort, "")) + } + if r.pageCursor != nil { + localVarQueryParams.Add("page[cursor]", datadog.ParameterToString(*r.pageCursor, "")) + } + if r.pageLimit != nil { + localVarQueryParams.Add("page[limit]", datadog.ParameterToString(*r.pageLimit, "")) + } + localVarHeaderParams["Accept"] = "application/json" + + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(datadog.ContextAPIKeys).(map[string]datadog.APIKey); ok { + if apiKey, ok := auth["apiKeyAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["DD-API-KEY"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(datadog.ContextAPIKeys).(map[string]datadog.APIKey); ok { + if apiKey, ok := auth["appKeyAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["DD-APPLICATION-KEY"] = key + } + } + } + req, err := a.Client.PrepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type apiSearchCIAppPipelineEventsRequest struct { + ctx _context.Context + body *CIAppPipelineEventsRequest +} + +// SearchCIAppPipelineEventsOptionalParameters holds optional parameters for SearchCIAppPipelineEvents. +type SearchCIAppPipelineEventsOptionalParameters struct { + Body *CIAppPipelineEventsRequest +} + +// NewSearchCIAppPipelineEventsOptionalParameters creates an empty struct for parameters. +func NewSearchCIAppPipelineEventsOptionalParameters() *SearchCIAppPipelineEventsOptionalParameters { + this := SearchCIAppPipelineEventsOptionalParameters{} + return &this +} + +// WithBody sets the corresponding parameter name and returns the struct. +func (r *SearchCIAppPipelineEventsOptionalParameters) WithBody(body CIAppPipelineEventsRequest) *SearchCIAppPipelineEventsOptionalParameters { + r.Body = &body + return r +} + +func (a *CIVisibilityPipelinesApi) buildSearchCIAppPipelineEventsRequest(ctx _context.Context, o ...SearchCIAppPipelineEventsOptionalParameters) (apiSearchCIAppPipelineEventsRequest, error) { + req := apiSearchCIAppPipelineEventsRequest{ + ctx: ctx, + } + + if len(o) > 1 { + return req, datadog.ReportError("only one argument of type SearchCIAppPipelineEventsOptionalParameters is allowed") + } + + if o != nil { + req.body = o[0].Body + } + return req, nil +} + +// SearchCIAppPipelineEvents Search pipelines events. +// List endpoint returns CI Visibility pipeline events that match a log search query. +// [Results are paginated similarly to logs](https://docs.datadoghq.com/logs/guide/collect-multiple-logs-with-pagination). +// +// Use this endpoint to build complex events filtering and search. +func (a *CIVisibilityPipelinesApi) SearchCIAppPipelineEvents(ctx _context.Context, o ...SearchCIAppPipelineEventsOptionalParameters) (CIAppPipelineEventsResponse, *_nethttp.Response, error) { + req, err := a.buildSearchCIAppPipelineEventsRequest(ctx, o...) + if err != nil { + var localVarReturnValue CIAppPipelineEventsResponse + return localVarReturnValue, nil, err + } + + return a.searchCIAppPipelineEventsExecute(req) +} + +// SearchCIAppPipelineEventsWithPagination provides a paginated version of SearchCIAppPipelineEvents returning a channel with all items. +func (a *CIVisibilityPipelinesApi) SearchCIAppPipelineEventsWithPagination(ctx _context.Context, o ...SearchCIAppPipelineEventsOptionalParameters) (<-chan CIAppPipelineEvent, func(), error) { + ctx, cancel := _context.WithCancel(ctx) + pageSize_ := int32(10) + if len(o) == 0 { + o = append(o, SearchCIAppPipelineEventsOptionalParameters{}) + } + if o[0].Body == nil { + o[0].Body = NewCIAppPipelineEventsRequest() + } + if o[0].Body.Page == nil { + o[0].Body.Page = NewCIAppQueryPageOptions() + } + if o[0].Body.Page.Limit != nil { + pageSize_ = *o[0].Body.Page.Limit + } + o[0].Body.Page.Limit = &pageSize_ + + items := make(chan CIAppPipelineEvent, pageSize_) + go func() { + for { + req, err := a.buildSearchCIAppPipelineEventsRequest(ctx, o...) + if err != nil { + break + } + + resp, _, err := a.searchCIAppPipelineEventsExecute(req) + if err != nil { + break + } + respData, ok := resp.GetDataOk() + if !ok { + break + } + results := *respData + + for _, item := range results { + select { + case items <- item: + case <-ctx.Done(): + close(items) + return + } + } + if len(results) < int(pageSize_) { + break + } + cursorMeta, ok := resp.GetMetaOk() + if !ok { + break + } + cursorMetaPage, ok := cursorMeta.GetPageOk() + if !ok { + break + } + cursorMetaPageAfter, ok := cursorMetaPage.GetAfterOk() + if !ok { + break + } + + o[0].Body.Page.Cursor = cursorMetaPageAfter + } + close(items) + }() + return items, cancel, nil +} + +// searchCIAppPipelineEventsExecute executes the request. +func (a *CIVisibilityPipelinesApi) searchCIAppPipelineEventsExecute(r apiSearchCIAppPipelineEventsRequest) (CIAppPipelineEventsResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue CIAppPipelineEventsResponse + ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(r.ctx, "v2.CIVisibilityPipelinesApi.SearchCIAppPipelineEvents") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/ci/pipelines/events/search" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Content-Type"] = "application/json" + localVarHeaderParams["Accept"] = "application/json" + + // body params + localVarPostBody = r.body + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(datadog.ContextAPIKeys).(map[string]datadog.APIKey); ok { + if apiKey, ok := auth["apiKeyAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["DD-API-KEY"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(datadog.ContextAPIKeys).(map[string]datadog.APIKey); ok { + if apiKey, ok := auth["appKeyAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["DD-APPLICATION-KEY"] = key + } + } + } + req, err := a.Client.PrepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// NewCIVisibilityPipelinesApi Returns NewCIVisibilityPipelinesApi. +func NewCIVisibilityPipelinesApi(client *datadog.APIClient) *CIVisibilityPipelinesApi { + return &CIVisibilityPipelinesApi{ + Client: client, + } +} diff --git a/api/datadogV2/api_ci_visibility_tests.go b/api/datadogV2/api_ci_visibility_tests.go new file mode 100644 index 00000000000..8959aca43cb --- /dev/null +++ b/api/datadogV2/api_ci_visibility_tests.go @@ -0,0 +1,634 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "bytes" + _context "context" + _io "io" + _nethttp "net/http" + _neturl "net/url" + "time" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CIVisibilityTestsApi service type +type CIVisibilityTestsApi datadog.Service + +type apiAggregateCIAppTestEventsRequest struct { + ctx _context.Context + body *CIAppTestsAggregateRequest +} + +func (a *CIVisibilityTestsApi) buildAggregateCIAppTestEventsRequest(ctx _context.Context, body CIAppTestsAggregateRequest) (apiAggregateCIAppTestEventsRequest, error) { + req := apiAggregateCIAppTestEventsRequest{ + ctx: ctx, + body: &body, + } + return req, nil +} + +// AggregateCIAppTestEvents Aggregate tests events. +// The API endpoint to aggregate CI Visibility test events into buckets of computed metrics and timeseries. +func (a *CIVisibilityTestsApi) AggregateCIAppTestEvents(ctx _context.Context, body CIAppTestsAggregateRequest) (CIAppTestsAnalyticsAggregateResponse, *_nethttp.Response, error) { + req, err := a.buildAggregateCIAppTestEventsRequest(ctx, body) + if err != nil { + var localVarReturnValue CIAppTestsAnalyticsAggregateResponse + return localVarReturnValue, nil, err + } + + return a.aggregateCIAppTestEventsExecute(req) +} + +// aggregateCIAppTestEventsExecute executes the request. +func (a *CIVisibilityTestsApi) aggregateCIAppTestEventsExecute(r apiAggregateCIAppTestEventsRequest) (CIAppTestsAnalyticsAggregateResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue CIAppTestsAnalyticsAggregateResponse + ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(r.ctx, "v2.CIVisibilityTestsApi.AggregateCIAppTestEvents") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/ci/tests/analytics/aggregate" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if r.body == nil { + return localVarReturnValue, nil, datadog.ReportError("body is required and must be specified") + } + localVarHeaderParams["Content-Type"] = "application/json" + localVarHeaderParams["Accept"] = "application/json" + + // body params + localVarPostBody = r.body + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(datadog.ContextAPIKeys).(map[string]datadog.APIKey); ok { + if apiKey, ok := auth["apiKeyAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["DD-API-KEY"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(datadog.ContextAPIKeys).(map[string]datadog.APIKey); ok { + if apiKey, ok := auth["appKeyAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["DD-APPLICATION-KEY"] = key + } + } + } + req, err := a.Client.PrepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type apiListCIAppTestEventsRequest struct { + ctx _context.Context + filterQuery *string + filterFrom *time.Time + filterTo *time.Time + sort *CIAppSort + pageCursor *string + pageLimit *int32 +} + +// ListCIAppTestEventsOptionalParameters holds optional parameters for ListCIAppTestEvents. +type ListCIAppTestEventsOptionalParameters struct { + FilterQuery *string + FilterFrom *time.Time + FilterTo *time.Time + Sort *CIAppSort + PageCursor *string + PageLimit *int32 +} + +// NewListCIAppTestEventsOptionalParameters creates an empty struct for parameters. +func NewListCIAppTestEventsOptionalParameters() *ListCIAppTestEventsOptionalParameters { + this := ListCIAppTestEventsOptionalParameters{} + return &this +} + +// WithFilterQuery sets the corresponding parameter name and returns the struct. +func (r *ListCIAppTestEventsOptionalParameters) WithFilterQuery(filterQuery string) *ListCIAppTestEventsOptionalParameters { + r.FilterQuery = &filterQuery + return r +} + +// WithFilterFrom sets the corresponding parameter name and returns the struct. +func (r *ListCIAppTestEventsOptionalParameters) WithFilterFrom(filterFrom time.Time) *ListCIAppTestEventsOptionalParameters { + r.FilterFrom = &filterFrom + return r +} + +// WithFilterTo sets the corresponding parameter name and returns the struct. +func (r *ListCIAppTestEventsOptionalParameters) WithFilterTo(filterTo time.Time) *ListCIAppTestEventsOptionalParameters { + r.FilterTo = &filterTo + return r +} + +// WithSort sets the corresponding parameter name and returns the struct. +func (r *ListCIAppTestEventsOptionalParameters) WithSort(sort CIAppSort) *ListCIAppTestEventsOptionalParameters { + r.Sort = &sort + return r +} + +// WithPageCursor sets the corresponding parameter name and returns the struct. +func (r *ListCIAppTestEventsOptionalParameters) WithPageCursor(pageCursor string) *ListCIAppTestEventsOptionalParameters { + r.PageCursor = &pageCursor + return r +} + +// WithPageLimit sets the corresponding parameter name and returns the struct. +func (r *ListCIAppTestEventsOptionalParameters) WithPageLimit(pageLimit int32) *ListCIAppTestEventsOptionalParameters { + r.PageLimit = &pageLimit + return r +} + +func (a *CIVisibilityTestsApi) buildListCIAppTestEventsRequest(ctx _context.Context, o ...ListCIAppTestEventsOptionalParameters) (apiListCIAppTestEventsRequest, error) { + req := apiListCIAppTestEventsRequest{ + ctx: ctx, + } + + if len(o) > 1 { + return req, datadog.ReportError("only one argument of type ListCIAppTestEventsOptionalParameters is allowed") + } + + if o != nil { + req.filterQuery = o[0].FilterQuery + req.filterFrom = o[0].FilterFrom + req.filterTo = o[0].FilterTo + req.sort = o[0].Sort + req.pageCursor = o[0].PageCursor + req.pageLimit = o[0].PageLimit + } + return req, nil +} + +// ListCIAppTestEvents Get a list of tests events. +// List endpoint returns CI Visibility test events that match a log search query. +// [Results are paginated similarly to logs](https://docs.datadoghq.com/logs/guide/collect-multiple-logs-with-pagination). +// +// Use this endpoint to see your latest test events. +func (a *CIVisibilityTestsApi) ListCIAppTestEvents(ctx _context.Context, o ...ListCIAppTestEventsOptionalParameters) (CIAppTestEventsResponse, *_nethttp.Response, error) { + req, err := a.buildListCIAppTestEventsRequest(ctx, o...) + if err != nil { + var localVarReturnValue CIAppTestEventsResponse + return localVarReturnValue, nil, err + } + + return a.listCIAppTestEventsExecute(req) +} + +// ListCIAppTestEventsWithPagination provides a paginated version of ListCIAppTestEvents returning a channel with all items. +func (a *CIVisibilityTestsApi) ListCIAppTestEventsWithPagination(ctx _context.Context, o ...ListCIAppTestEventsOptionalParameters) (<-chan CIAppTestEvent, func(), error) { + ctx, cancel := _context.WithCancel(ctx) + pageSize_ := int32(10) + if len(o) == 0 { + o = append(o, ListCIAppTestEventsOptionalParameters{}) + } + if o[0].PageLimit != nil { + pageSize_ = *o[0].PageLimit + } + o[0].PageLimit = &pageSize_ + + items := make(chan CIAppTestEvent, pageSize_) + go func() { + for { + req, err := a.buildListCIAppTestEventsRequest(ctx, o...) + if err != nil { + break + } + + resp, _, err := a.listCIAppTestEventsExecute(req) + if err != nil { + break + } + respData, ok := resp.GetDataOk() + if !ok { + break + } + results := *respData + + for _, item := range results { + select { + case items <- item: + case <-ctx.Done(): + close(items) + return + } + } + if len(results) < int(pageSize_) { + break + } + cursorMeta, ok := resp.GetMetaOk() + if !ok { + break + } + cursorMetaPage, ok := cursorMeta.GetPageOk() + if !ok { + break + } + cursorMetaPageAfter, ok := cursorMetaPage.GetAfterOk() + if !ok { + break + } + + o[0].PageCursor = cursorMetaPageAfter + } + close(items) + }() + return items, cancel, nil +} + +// listCIAppTestEventsExecute executes the request. +func (a *CIVisibilityTestsApi) listCIAppTestEventsExecute(r apiListCIAppTestEventsRequest) (CIAppTestEventsResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue CIAppTestEventsResponse + ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(r.ctx, "v2.CIVisibilityTestsApi.ListCIAppTestEvents") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/ci/tests/events" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if r.filterQuery != nil { + localVarQueryParams.Add("filter[query]", datadog.ParameterToString(*r.filterQuery, "")) + } + if r.filterFrom != nil { + localVarQueryParams.Add("filter[from]", datadog.ParameterToString(*r.filterFrom, "")) + } + if r.filterTo != nil { + localVarQueryParams.Add("filter[to]", datadog.ParameterToString(*r.filterTo, "")) + } + if r.sort != nil { + localVarQueryParams.Add("sort", datadog.ParameterToString(*r.sort, "")) + } + if r.pageCursor != nil { + localVarQueryParams.Add("page[cursor]", datadog.ParameterToString(*r.pageCursor, "")) + } + if r.pageLimit != nil { + localVarQueryParams.Add("page[limit]", datadog.ParameterToString(*r.pageLimit, "")) + } + localVarHeaderParams["Accept"] = "application/json" + + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(datadog.ContextAPIKeys).(map[string]datadog.APIKey); ok { + if apiKey, ok := auth["apiKeyAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["DD-API-KEY"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(datadog.ContextAPIKeys).(map[string]datadog.APIKey); ok { + if apiKey, ok := auth["appKeyAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["DD-APPLICATION-KEY"] = key + } + } + } + req, err := a.Client.PrepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type apiSearchCIAppTestEventsRequest struct { + ctx _context.Context + body *CIAppTestEventsRequest +} + +// SearchCIAppTestEventsOptionalParameters holds optional parameters for SearchCIAppTestEvents. +type SearchCIAppTestEventsOptionalParameters struct { + Body *CIAppTestEventsRequest +} + +// NewSearchCIAppTestEventsOptionalParameters creates an empty struct for parameters. +func NewSearchCIAppTestEventsOptionalParameters() *SearchCIAppTestEventsOptionalParameters { + this := SearchCIAppTestEventsOptionalParameters{} + return &this +} + +// WithBody sets the corresponding parameter name and returns the struct. +func (r *SearchCIAppTestEventsOptionalParameters) WithBody(body CIAppTestEventsRequest) *SearchCIAppTestEventsOptionalParameters { + r.Body = &body + return r +} + +func (a *CIVisibilityTestsApi) buildSearchCIAppTestEventsRequest(ctx _context.Context, o ...SearchCIAppTestEventsOptionalParameters) (apiSearchCIAppTestEventsRequest, error) { + req := apiSearchCIAppTestEventsRequest{ + ctx: ctx, + } + + if len(o) > 1 { + return req, datadog.ReportError("only one argument of type SearchCIAppTestEventsOptionalParameters is allowed") + } + + if o != nil { + req.body = o[0].Body + } + return req, nil +} + +// SearchCIAppTestEvents Search tests events. +// List endpoint returns CI Visibility test events that match a log search query. +// [Results are paginated similarly to logs](https://docs.datadoghq.com/logs/guide/collect-multiple-logs-with-pagination). +// +// Use this endpoint to build complex events filtering and search. +func (a *CIVisibilityTestsApi) SearchCIAppTestEvents(ctx _context.Context, o ...SearchCIAppTestEventsOptionalParameters) (CIAppTestEventsResponse, *_nethttp.Response, error) { + req, err := a.buildSearchCIAppTestEventsRequest(ctx, o...) + if err != nil { + var localVarReturnValue CIAppTestEventsResponse + return localVarReturnValue, nil, err + } + + return a.searchCIAppTestEventsExecute(req) +} + +// SearchCIAppTestEventsWithPagination provides a paginated version of SearchCIAppTestEvents returning a channel with all items. +func (a *CIVisibilityTestsApi) SearchCIAppTestEventsWithPagination(ctx _context.Context, o ...SearchCIAppTestEventsOptionalParameters) (<-chan CIAppTestEvent, func(), error) { + ctx, cancel := _context.WithCancel(ctx) + pageSize_ := int32(10) + if len(o) == 0 { + o = append(o, SearchCIAppTestEventsOptionalParameters{}) + } + if o[0].Body == nil { + o[0].Body = NewCIAppTestEventsRequest() + } + if o[0].Body.Page == nil { + o[0].Body.Page = NewCIAppQueryPageOptions() + } + if o[0].Body.Page.Limit != nil { + pageSize_ = *o[0].Body.Page.Limit + } + o[0].Body.Page.Limit = &pageSize_ + + items := make(chan CIAppTestEvent, pageSize_) + go func() { + for { + req, err := a.buildSearchCIAppTestEventsRequest(ctx, o...) + if err != nil { + break + } + + resp, _, err := a.searchCIAppTestEventsExecute(req) + if err != nil { + break + } + respData, ok := resp.GetDataOk() + if !ok { + break + } + results := *respData + + for _, item := range results { + select { + case items <- item: + case <-ctx.Done(): + close(items) + return + } + } + if len(results) < int(pageSize_) { + break + } + cursorMeta, ok := resp.GetMetaOk() + if !ok { + break + } + cursorMetaPage, ok := cursorMeta.GetPageOk() + if !ok { + break + } + cursorMetaPageAfter, ok := cursorMetaPage.GetAfterOk() + if !ok { + break + } + + o[0].Body.Page.Cursor = cursorMetaPageAfter + } + close(items) + }() + return items, cancel, nil +} + +// searchCIAppTestEventsExecute executes the request. +func (a *CIVisibilityTestsApi) searchCIAppTestEventsExecute(r apiSearchCIAppTestEventsRequest) (CIAppTestEventsResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue CIAppTestEventsResponse + ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(r.ctx, "v2.CIVisibilityTestsApi.SearchCIAppTestEvents") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/ci/tests/events/search" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Content-Type"] = "application/json" + localVarHeaderParams["Accept"] = "application/json" + + // body params + localVarPostBody = r.body + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(datadog.ContextAPIKeys).(map[string]datadog.APIKey); ok { + if apiKey, ok := auth["apiKeyAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["DD-API-KEY"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(datadog.ContextAPIKeys).(map[string]datadog.APIKey); ok { + if apiKey, ok := auth["appKeyAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["DD-APPLICATION-KEY"] = key + } + } + } + req, err := a.Client.PrepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// NewCIVisibilityTestsApi Returns NewCIVisibilityTestsApi. +func NewCIVisibilityTestsApi(client *datadog.APIClient) *CIVisibilityTestsApi { + return &CIVisibilityTestsApi{ + Client: client, + } +} diff --git a/api/datadogV2/doc.go b/api/datadogV2/doc.go index e772164bdb6..bd256fd79b4 100644 --- a/api/datadogV2/doc.go +++ b/api/datadogV2/doc.go @@ -10,6 +10,12 @@ // - [AuthNMappingsApi.GetAuthNMapping] // - [AuthNMappingsApi.ListAuthNMappings] // - [AuthNMappingsApi.UpdateAuthNMapping] +// - [CIVisibilityPipelinesApi.AggregateCIAppPipelineEvents] +// - [CIVisibilityPipelinesApi.ListCIAppPipelineEvents] +// - [CIVisibilityPipelinesApi.SearchCIAppPipelineEvents] +// - [CIVisibilityTestsApi.AggregateCIAppTestEvents] +// - [CIVisibilityTestsApi.ListCIAppTestEvents] +// - [CIVisibilityTestsApi.SearchCIAppTestEvents] // - [CloudWorkloadSecurityApi.CreateCloudWorkloadSecurityAgentRule] // - [CloudWorkloadSecurityApi.DeleteCloudWorkloadSecurityAgentRule] // - [CloudWorkloadSecurityApi.DownloadCloudWorkloadPolicyFile] diff --git a/api/datadogV2/model_ci_app_aggregate_bucket_value.go b/api/datadogV2/model_ci_app_aggregate_bucket_value.go new file mode 100644 index 00000000000..308dd339c76 --- /dev/null +++ b/api/datadogV2/model_ci_app_aggregate_bucket_value.go @@ -0,0 +1,187 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "encoding/json" +) + +// CIAppAggregateBucketValue - A bucket value, can either be a timeseries or a single value. +type CIAppAggregateBucketValue struct { + CIAppAggregateBucketValueSingleString *string + CIAppAggregateBucketValueSingleNumber *float64 + CIAppAggregateBucketValueTimeseries *CIAppAggregateBucketValueTimeseries + + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject interface{} +} + +// CIAppAggregateBucketValueSingleStringAsCIAppAggregateBucketValue is a convenience function that returns string wrapped in CIAppAggregateBucketValue. +func CIAppAggregateBucketValueSingleStringAsCIAppAggregateBucketValue(v *string) CIAppAggregateBucketValue { + return CIAppAggregateBucketValue{CIAppAggregateBucketValueSingleString: v} +} + +// CIAppAggregateBucketValueSingleNumberAsCIAppAggregateBucketValue is a convenience function that returns float64 wrapped in CIAppAggregateBucketValue. +func CIAppAggregateBucketValueSingleNumberAsCIAppAggregateBucketValue(v *float64) CIAppAggregateBucketValue { + return CIAppAggregateBucketValue{CIAppAggregateBucketValueSingleNumber: v} +} + +// CIAppAggregateBucketValueTimeseriesAsCIAppAggregateBucketValue is a convenience function that returns CIAppAggregateBucketValueTimeseries wrapped in CIAppAggregateBucketValue. +func CIAppAggregateBucketValueTimeseriesAsCIAppAggregateBucketValue(v *CIAppAggregateBucketValueTimeseries) CIAppAggregateBucketValue { + return CIAppAggregateBucketValue{CIAppAggregateBucketValueTimeseries: v} +} + +// UnmarshalJSON turns data into one of the pointers in the struct. +func (obj *CIAppAggregateBucketValue) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into CIAppAggregateBucketValueSingleString + err = json.Unmarshal(data, &obj.CIAppAggregateBucketValueSingleString) + if err == nil { + if obj.CIAppAggregateBucketValueSingleString != nil { + jsonCIAppAggregateBucketValueSingleString, _ := json.Marshal(obj.CIAppAggregateBucketValueSingleString) + if string(jsonCIAppAggregateBucketValueSingleString) == "{}" { // empty struct + obj.CIAppAggregateBucketValueSingleString = nil + } else { + match++ + } + } else { + obj.CIAppAggregateBucketValueSingleString = nil + } + } else { + obj.CIAppAggregateBucketValueSingleString = nil + } + + // try to unmarshal data into CIAppAggregateBucketValueSingleNumber + err = json.Unmarshal(data, &obj.CIAppAggregateBucketValueSingleNumber) + if err == nil { + if obj.CIAppAggregateBucketValueSingleNumber != nil { + jsonCIAppAggregateBucketValueSingleNumber, _ := json.Marshal(obj.CIAppAggregateBucketValueSingleNumber) + if string(jsonCIAppAggregateBucketValueSingleNumber) == "{}" { // empty struct + obj.CIAppAggregateBucketValueSingleNumber = nil + } else { + match++ + } + } else { + obj.CIAppAggregateBucketValueSingleNumber = nil + } + } else { + obj.CIAppAggregateBucketValueSingleNumber = nil + } + + // try to unmarshal data into CIAppAggregateBucketValueTimeseries + err = json.Unmarshal(data, &obj.CIAppAggregateBucketValueTimeseries) + if err == nil { + if obj.CIAppAggregateBucketValueTimeseries != nil { + jsonCIAppAggregateBucketValueTimeseries, _ := json.Marshal(obj.CIAppAggregateBucketValueTimeseries) + if string(jsonCIAppAggregateBucketValueTimeseries) == "{}" { // empty struct + obj.CIAppAggregateBucketValueTimeseries = nil + } else { + match++ + } + } else { + obj.CIAppAggregateBucketValueTimeseries = nil + } + } else { + obj.CIAppAggregateBucketValueTimeseries = nil + } + + if match != 1 { // more than 1 match + // reset to nil + obj.CIAppAggregateBucketValueSingleString = nil + obj.CIAppAggregateBucketValueSingleNumber = nil + obj.CIAppAggregateBucketValueTimeseries = nil + return json.Unmarshal(data, &obj.UnparsedObject) + } + return nil // exactly one match +} + +// MarshalJSON turns data from the first non-nil pointers in the struct to JSON. +func (obj CIAppAggregateBucketValue) MarshalJSON() ([]byte, error) { + if obj.CIAppAggregateBucketValueSingleString != nil { + return json.Marshal(&obj.CIAppAggregateBucketValueSingleString) + } + + if obj.CIAppAggregateBucketValueSingleNumber != nil { + return json.Marshal(&obj.CIAppAggregateBucketValueSingleNumber) + } + + if obj.CIAppAggregateBucketValueTimeseries != nil { + return json.Marshal(&obj.CIAppAggregateBucketValueTimeseries) + } + + if obj.UnparsedObject != nil { + return json.Marshal(obj.UnparsedObject) + } + return nil, nil // no data in oneOf schemas +} + +// GetActualInstance returns the actual instance. +func (obj *CIAppAggregateBucketValue) GetActualInstance() interface{} { + if obj.CIAppAggregateBucketValueSingleString != nil { + return obj.CIAppAggregateBucketValueSingleString + } + + if obj.CIAppAggregateBucketValueSingleNumber != nil { + return obj.CIAppAggregateBucketValueSingleNumber + } + + if obj.CIAppAggregateBucketValueTimeseries != nil { + return obj.CIAppAggregateBucketValueTimeseries + } + + // all schemas are nil + return nil +} + +// NullableCIAppAggregateBucketValue handles when a null is used for CIAppAggregateBucketValue. +type NullableCIAppAggregateBucketValue struct { + value *CIAppAggregateBucketValue + isSet bool +} + +// Get returns the associated value. +func (v NullableCIAppAggregateBucketValue) Get() *CIAppAggregateBucketValue { + return v.value +} + +// Set changes the value and indicates it's been called. +func (v *NullableCIAppAggregateBucketValue) Set(val *CIAppAggregateBucketValue) { + v.value = val + v.isSet = true +} + +// IsSet returns whether Set has been called. +func (v NullableCIAppAggregateBucketValue) IsSet() bool { + return v.isSet +} + +// Unset sets the value to nil and resets the set flag/ +func (v *NullableCIAppAggregateBucketValue) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableCIAppAggregateBucketValue initializes the struct as if Set has been called. +func NewNullableCIAppAggregateBucketValue(val *CIAppAggregateBucketValue) *NullableCIAppAggregateBucketValue { + return &NullableCIAppAggregateBucketValue{value: val, isSet: true} +} + +// MarshalJSON serializes the associated value. +func (v NullableCIAppAggregateBucketValue) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// UnmarshalJSON deserializes the payload and sets the flag as if Set has been called. +func (v *NullableCIAppAggregateBucketValue) UnmarshalJSON(src []byte) error { + v.isSet = true + + // this object is nullable so check if the payload is null or empty string + if string(src) == "" || string(src) == "{}" { + return nil + } + + return json.Unmarshal(src, &v.value) +} diff --git a/api/datadogV2/model_ci_app_aggregate_bucket_value_timeseries.go b/api/datadogV2/model_ci_app_aggregate_bucket_value_timeseries.go new file mode 100644 index 00000000000..62808f2be41 --- /dev/null +++ b/api/datadogV2/model_ci_app_aggregate_bucket_value_timeseries.go @@ -0,0 +1,51 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "encoding/json" +) + +// CIAppAggregateBucketValueTimeseries A timeseries array. +type CIAppAggregateBucketValueTimeseries struct { + Items []CIAppAggregateBucketValueTimeseriesPoint + + // UnparsedObject contains the raw value of the array if there was an error when deserializing into the struct + UnparsedObject []interface{} `json:"-"` +} + +// NewCIAppAggregateBucketValueTimeseries instantiates a new CIAppAggregateBucketValueTimeseries object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCIAppAggregateBucketValueTimeseries() *CIAppAggregateBucketValueTimeseries { + this := CIAppAggregateBucketValueTimeseries{} + return &this +} + +// NewCIAppAggregateBucketValueTimeseriesWithDefaults instantiates a new CIAppAggregateBucketValueTimeseries object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCIAppAggregateBucketValueTimeseriesWithDefaults() *CIAppAggregateBucketValueTimeseries { + this := CIAppAggregateBucketValueTimeseries{} + return &this +} + +// MarshalJSON serializes the struct using spec logic. +func (o CIAppAggregateBucketValueTimeseries) MarshalJSON() ([]byte, error) { + toSerialize := make([]interface{}, len(o.Items)) + if o.UnparsedObject != nil { + return json.Marshal(o.UnparsedObject) + } + for i, item := range o.Items { + toSerialize[i] = item + } + return json.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CIAppAggregateBucketValueTimeseries) UnmarshalJSON(bytes []byte) (err error) { + return json.Unmarshal(bytes, &o.Items) +} diff --git a/api/datadogV2/model_ci_app_aggregate_bucket_value_timeseries_point.go b/api/datadogV2/model_ci_app_aggregate_bucket_value_timeseries_point.go new file mode 100644 index 00000000000..05ceaa60ea8 --- /dev/null +++ b/api/datadogV2/model_ci_app_aggregate_bucket_value_timeseries_point.go @@ -0,0 +1,138 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "encoding/json" + "time" +) + +// CIAppAggregateBucketValueTimeseriesPoint A timeseries point. +type CIAppAggregateBucketValueTimeseriesPoint struct { + // The time value for this point. + Time *time.Time `json:"time,omitempty"` + // The value for this point. + Value *float64 `json:"value,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} +} + +// NewCIAppAggregateBucketValueTimeseriesPoint instantiates a new CIAppAggregateBucketValueTimeseriesPoint object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCIAppAggregateBucketValueTimeseriesPoint() *CIAppAggregateBucketValueTimeseriesPoint { + this := CIAppAggregateBucketValueTimeseriesPoint{} + return &this +} + +// NewCIAppAggregateBucketValueTimeseriesPointWithDefaults instantiates a new CIAppAggregateBucketValueTimeseriesPoint object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCIAppAggregateBucketValueTimeseriesPointWithDefaults() *CIAppAggregateBucketValueTimeseriesPoint { + this := CIAppAggregateBucketValueTimeseriesPoint{} + return &this +} + +// GetTime returns the Time field value if set, zero value otherwise. +func (o *CIAppAggregateBucketValueTimeseriesPoint) GetTime() time.Time { + if o == nil || o.Time == nil { + var ret time.Time + return ret + } + return *o.Time +} + +// GetTimeOk returns a tuple with the Time field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppAggregateBucketValueTimeseriesPoint) GetTimeOk() (*time.Time, bool) { + if o == nil || o.Time == nil { + return nil, false + } + return o.Time, true +} + +// HasTime returns a boolean if a field has been set. +func (o *CIAppAggregateBucketValueTimeseriesPoint) HasTime() bool { + return o != nil && o.Time != nil +} + +// SetTime gets a reference to the given time.Time and assigns it to the Time field. +func (o *CIAppAggregateBucketValueTimeseriesPoint) SetTime(v time.Time) { + o.Time = &v +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *CIAppAggregateBucketValueTimeseriesPoint) GetValue() float64 { + if o == nil || o.Value == nil { + var ret float64 + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppAggregateBucketValueTimeseriesPoint) GetValueOk() (*float64, bool) { + if o == nil || o.Value == nil { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *CIAppAggregateBucketValueTimeseriesPoint) HasValue() bool { + return o != nil && o.Value != nil +} + +// SetValue gets a reference to the given float64 and assigns it to the Value field. +func (o *CIAppAggregateBucketValueTimeseriesPoint) SetValue(v float64) { + o.Value = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CIAppAggregateBucketValueTimeseriesPoint) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return json.Marshal(o.UnparsedObject) + } + if o.Time != nil { + if o.Time.Nanosecond() == 0 { + toSerialize["time"] = o.Time.Format("2006-01-02T15:04:05Z07:00") + } else { + toSerialize["time"] = o.Time.Format("2006-01-02T15:04:05.000Z07:00") + } + } + if o.Value != nil { + toSerialize["value"] = o.Value + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CIAppAggregateBucketValueTimeseriesPoint) UnmarshalJSON(bytes []byte) (err error) { + raw := map[string]interface{}{} + all := struct { + Time *time.Time `json:"time,omitempty"` + Value *float64 `json:"value,omitempty"` + }{} + err = json.Unmarshal(bytes, &all) + if err != nil { + err = json.Unmarshal(bytes, &raw) + if err != nil { + return err + } + o.UnparsedObject = raw + return nil + } + o.Time = all.Time + o.Value = all.Value + return nil +} diff --git a/api/datadogV2/model_ci_app_aggregate_sort.go b/api/datadogV2/model_ci_app_aggregate_sort.go new file mode 100644 index 00000000000..df4b0cfa9a7 --- /dev/null +++ b/api/datadogV2/model_ci_app_aggregate_sort.go @@ -0,0 +1,231 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "encoding/json" +) + +// CIAppAggregateSort A sort rule. +type CIAppAggregateSort struct { + // An aggregation function. + Aggregation *CIAppAggregationFunction `json:"aggregation,omitempty"` + // The metric to sort by (only used for `type=measure`). + Metric *string `json:"metric,omitempty"` + // The order to use, ascending or descending. + Order *CIAppSortOrder `json:"order,omitempty"` + // The type of sorting algorithm. + Type *CIAppAggregateSortType `json:"type,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} +} + +// NewCIAppAggregateSort instantiates a new CIAppAggregateSort object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCIAppAggregateSort() *CIAppAggregateSort { + this := CIAppAggregateSort{} + var typeVar CIAppAggregateSortType = CIAPPAGGREGATESORTTYPE_ALPHABETICAL + this.Type = &typeVar + return &this +} + +// NewCIAppAggregateSortWithDefaults instantiates a new CIAppAggregateSort object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCIAppAggregateSortWithDefaults() *CIAppAggregateSort { + this := CIAppAggregateSort{} + var typeVar CIAppAggregateSortType = CIAPPAGGREGATESORTTYPE_ALPHABETICAL + this.Type = &typeVar + return &this +} + +// GetAggregation returns the Aggregation field value if set, zero value otherwise. +func (o *CIAppAggregateSort) GetAggregation() CIAppAggregationFunction { + if o == nil || o.Aggregation == nil { + var ret CIAppAggregationFunction + return ret + } + return *o.Aggregation +} + +// GetAggregationOk returns a tuple with the Aggregation field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppAggregateSort) GetAggregationOk() (*CIAppAggregationFunction, bool) { + if o == nil || o.Aggregation == nil { + return nil, false + } + return o.Aggregation, true +} + +// HasAggregation returns a boolean if a field has been set. +func (o *CIAppAggregateSort) HasAggregation() bool { + return o != nil && o.Aggregation != nil +} + +// SetAggregation gets a reference to the given CIAppAggregationFunction and assigns it to the Aggregation field. +func (o *CIAppAggregateSort) SetAggregation(v CIAppAggregationFunction) { + o.Aggregation = &v +} + +// GetMetric returns the Metric field value if set, zero value otherwise. +func (o *CIAppAggregateSort) GetMetric() string { + if o == nil || o.Metric == nil { + var ret string + return ret + } + return *o.Metric +} + +// GetMetricOk returns a tuple with the Metric field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppAggregateSort) GetMetricOk() (*string, bool) { + if o == nil || o.Metric == nil { + return nil, false + } + return o.Metric, true +} + +// HasMetric returns a boolean if a field has been set. +func (o *CIAppAggregateSort) HasMetric() bool { + return o != nil && o.Metric != nil +} + +// SetMetric gets a reference to the given string and assigns it to the Metric field. +func (o *CIAppAggregateSort) SetMetric(v string) { + o.Metric = &v +} + +// GetOrder returns the Order field value if set, zero value otherwise. +func (o *CIAppAggregateSort) GetOrder() CIAppSortOrder { + if o == nil || o.Order == nil { + var ret CIAppSortOrder + return ret + } + return *o.Order +} + +// GetOrderOk returns a tuple with the Order field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppAggregateSort) GetOrderOk() (*CIAppSortOrder, bool) { + if o == nil || o.Order == nil { + return nil, false + } + return o.Order, true +} + +// HasOrder returns a boolean if a field has been set. +func (o *CIAppAggregateSort) HasOrder() bool { + return o != nil && o.Order != nil +} + +// SetOrder gets a reference to the given CIAppSortOrder and assigns it to the Order field. +func (o *CIAppAggregateSort) SetOrder(v CIAppSortOrder) { + o.Order = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *CIAppAggregateSort) GetType() CIAppAggregateSortType { + if o == nil || o.Type == nil { + var ret CIAppAggregateSortType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppAggregateSort) GetTypeOk() (*CIAppAggregateSortType, bool) { + if o == nil || o.Type == nil { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *CIAppAggregateSort) HasType() bool { + return o != nil && o.Type != nil +} + +// SetType gets a reference to the given CIAppAggregateSortType and assigns it to the Type field. +func (o *CIAppAggregateSort) SetType(v CIAppAggregateSortType) { + o.Type = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CIAppAggregateSort) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return json.Marshal(o.UnparsedObject) + } + if o.Aggregation != nil { + toSerialize["aggregation"] = o.Aggregation + } + if o.Metric != nil { + toSerialize["metric"] = o.Metric + } + if o.Order != nil { + toSerialize["order"] = o.Order + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CIAppAggregateSort) UnmarshalJSON(bytes []byte) (err error) { + raw := map[string]interface{}{} + all := struct { + Aggregation *CIAppAggregationFunction `json:"aggregation,omitempty"` + Metric *string `json:"metric,omitempty"` + Order *CIAppSortOrder `json:"order,omitempty"` + Type *CIAppAggregateSortType `json:"type,omitempty"` + }{} + err = json.Unmarshal(bytes, &all) + if err != nil { + err = json.Unmarshal(bytes, &raw) + if err != nil { + return err + } + o.UnparsedObject = raw + return nil + } + if v := all.Aggregation; v != nil && !v.IsValid() { + err = json.Unmarshal(bytes, &raw) + if err != nil { + return err + } + o.UnparsedObject = raw + return nil + } + if v := all.Order; v != nil && !v.IsValid() { + err = json.Unmarshal(bytes, &raw) + if err != nil { + return err + } + o.UnparsedObject = raw + return nil + } + if v := all.Type; v != nil && !v.IsValid() { + err = json.Unmarshal(bytes, &raw) + if err != nil { + return err + } + o.UnparsedObject = raw + return nil + } + o.Aggregation = all.Aggregation + o.Metric = all.Metric + o.Order = all.Order + o.Type = all.Type + return nil +} diff --git a/api/datadogV2/model_ci_app_aggregate_sort_type.go b/api/datadogV2/model_ci_app_aggregate_sort_type.go new file mode 100644 index 00000000000..379ffa1eede --- /dev/null +++ b/api/datadogV2/model_ci_app_aggregate_sort_type.go @@ -0,0 +1,109 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "encoding/json" + "fmt" +) + +// CIAppAggregateSortType The type of sorting algorithm. +type CIAppAggregateSortType string + +// List of CIAppAggregateSortType. +const ( + CIAPPAGGREGATESORTTYPE_ALPHABETICAL CIAppAggregateSortType = "alphabetical" + CIAPPAGGREGATESORTTYPE_MEASURE CIAppAggregateSortType = "measure" +) + +var allowedCIAppAggregateSortTypeEnumValues = []CIAppAggregateSortType{ + CIAPPAGGREGATESORTTYPE_ALPHABETICAL, + CIAPPAGGREGATESORTTYPE_MEASURE, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *CIAppAggregateSortType) GetAllowedValues() []CIAppAggregateSortType { + return allowedCIAppAggregateSortTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *CIAppAggregateSortType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + *v = CIAppAggregateSortType(value) + return nil +} + +// NewCIAppAggregateSortTypeFromValue returns a pointer to a valid CIAppAggregateSortType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewCIAppAggregateSortTypeFromValue(v string) (*CIAppAggregateSortType, error) { + ev := CIAppAggregateSortType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for CIAppAggregateSortType: valid values are %v", v, allowedCIAppAggregateSortTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v CIAppAggregateSortType) IsValid() bool { + for _, existing := range allowedCIAppAggregateSortTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CIAppAggregateSortType value. +func (v CIAppAggregateSortType) Ptr() *CIAppAggregateSortType { + return &v +} + +// NullableCIAppAggregateSortType handles when a null is used for CIAppAggregateSortType. +type NullableCIAppAggregateSortType struct { + value *CIAppAggregateSortType + isSet bool +} + +// Get returns the associated value. +func (v NullableCIAppAggregateSortType) Get() *CIAppAggregateSortType { + return v.value +} + +// Set changes the value and indicates it's been called. +func (v *NullableCIAppAggregateSortType) Set(val *CIAppAggregateSortType) { + v.value = val + v.isSet = true +} + +// IsSet returns whether Set has been called. +func (v NullableCIAppAggregateSortType) IsSet() bool { + return v.isSet +} + +// Unset sets the value to nil and resets the set flag. +func (v *NullableCIAppAggregateSortType) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableCIAppAggregateSortType initializes the struct as if Set has been called. +func NewNullableCIAppAggregateSortType(val *CIAppAggregateSortType) *NullableCIAppAggregateSortType { + return &NullableCIAppAggregateSortType{value: val, isSet: true} +} + +// MarshalJSON serializes the associated value. +func (v NullableCIAppAggregateSortType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// UnmarshalJSON deserializes the payload and sets the flag as if Set has been called. +func (v *NullableCIAppAggregateSortType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/api/datadogV2/model_ci_app_aggregation_function.go b/api/datadogV2/model_ci_app_aggregation_function.go new file mode 100644 index 00000000000..270fa4321bb --- /dev/null +++ b/api/datadogV2/model_ci_app_aggregation_function.go @@ -0,0 +1,129 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "encoding/json" + "fmt" +) + +// CIAppAggregationFunction An aggregation function. +type CIAppAggregationFunction string + +// List of CIAppAggregationFunction. +const ( + CIAPPAGGREGATIONFUNCTION_COUNT CIAppAggregationFunction = "count" + CIAPPAGGREGATIONFUNCTION_CARDINALITY CIAppAggregationFunction = "cardinality" + CIAPPAGGREGATIONFUNCTION_PERCENTILE_75 CIAppAggregationFunction = "pc75" + CIAPPAGGREGATIONFUNCTION_PERCENTILE_90 CIAppAggregationFunction = "pc90" + CIAPPAGGREGATIONFUNCTION_PERCENTILE_95 CIAppAggregationFunction = "pc95" + CIAPPAGGREGATIONFUNCTION_PERCENTILE_98 CIAppAggregationFunction = "pc98" + CIAPPAGGREGATIONFUNCTION_PERCENTILE_99 CIAppAggregationFunction = "pc99" + CIAPPAGGREGATIONFUNCTION_SUM CIAppAggregationFunction = "sum" + CIAPPAGGREGATIONFUNCTION_MIN CIAppAggregationFunction = "min" + CIAPPAGGREGATIONFUNCTION_MAX CIAppAggregationFunction = "max" + CIAPPAGGREGATIONFUNCTION_AVG CIAppAggregationFunction = "avg" + CIAPPAGGREGATIONFUNCTION_MEDIAN CIAppAggregationFunction = "median" +) + +var allowedCIAppAggregationFunctionEnumValues = []CIAppAggregationFunction{ + CIAPPAGGREGATIONFUNCTION_COUNT, + CIAPPAGGREGATIONFUNCTION_CARDINALITY, + CIAPPAGGREGATIONFUNCTION_PERCENTILE_75, + CIAPPAGGREGATIONFUNCTION_PERCENTILE_90, + CIAPPAGGREGATIONFUNCTION_PERCENTILE_95, + CIAPPAGGREGATIONFUNCTION_PERCENTILE_98, + CIAPPAGGREGATIONFUNCTION_PERCENTILE_99, + CIAPPAGGREGATIONFUNCTION_SUM, + CIAPPAGGREGATIONFUNCTION_MIN, + CIAPPAGGREGATIONFUNCTION_MAX, + CIAPPAGGREGATIONFUNCTION_AVG, + CIAPPAGGREGATIONFUNCTION_MEDIAN, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *CIAppAggregationFunction) GetAllowedValues() []CIAppAggregationFunction { + return allowedCIAppAggregationFunctionEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *CIAppAggregationFunction) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + *v = CIAppAggregationFunction(value) + return nil +} + +// NewCIAppAggregationFunctionFromValue returns a pointer to a valid CIAppAggregationFunction +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewCIAppAggregationFunctionFromValue(v string) (*CIAppAggregationFunction, error) { + ev := CIAppAggregationFunction(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for CIAppAggregationFunction: valid values are %v", v, allowedCIAppAggregationFunctionEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v CIAppAggregationFunction) IsValid() bool { + for _, existing := range allowedCIAppAggregationFunctionEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CIAppAggregationFunction value. +func (v CIAppAggregationFunction) Ptr() *CIAppAggregationFunction { + return &v +} + +// NullableCIAppAggregationFunction handles when a null is used for CIAppAggregationFunction. +type NullableCIAppAggregationFunction struct { + value *CIAppAggregationFunction + isSet bool +} + +// Get returns the associated value. +func (v NullableCIAppAggregationFunction) Get() *CIAppAggregationFunction { + return v.value +} + +// Set changes the value and indicates it's been called. +func (v *NullableCIAppAggregationFunction) Set(val *CIAppAggregationFunction) { + v.value = val + v.isSet = true +} + +// IsSet returns whether Set has been called. +func (v NullableCIAppAggregationFunction) IsSet() bool { + return v.isSet +} + +// Unset sets the value to nil and resets the set flag. +func (v *NullableCIAppAggregationFunction) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableCIAppAggregationFunction initializes the struct as if Set has been called. +func NewNullableCIAppAggregationFunction(val *CIAppAggregationFunction) *NullableCIAppAggregationFunction { + return &NullableCIAppAggregationFunction{value: val, isSet: true} +} + +// MarshalJSON serializes the associated value. +func (v NullableCIAppAggregationFunction) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// UnmarshalJSON deserializes the payload and sets the flag as if Set has been called. +func (v *NullableCIAppAggregationFunction) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/api/datadogV2/model_ci_app_compute.go b/api/datadogV2/model_ci_app_compute.go new file mode 100644 index 00000000000..091c4db00a7 --- /dev/null +++ b/api/datadogV2/model_ci_app_compute.go @@ -0,0 +1,229 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "encoding/json" + "fmt" +) + +// CIAppCompute A compute rule to compute metrics or timeseries. +type CIAppCompute struct { + // An aggregation function. + Aggregation CIAppAggregationFunction `json:"aggregation"` + // The time buckets' size (only used for type=timeseries) + // Defaults to a resolution of 150 points. + Interval *string `json:"interval,omitempty"` + // The metric to use. + Metric *string `json:"metric,omitempty"` + // The type of compute. + Type *CIAppComputeType `json:"type,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} +} + +// NewCIAppCompute instantiates a new CIAppCompute object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCIAppCompute(aggregation CIAppAggregationFunction) *CIAppCompute { + this := CIAppCompute{} + this.Aggregation = aggregation + var typeVar CIAppComputeType = CIAPPCOMPUTETYPE_TOTAL + this.Type = &typeVar + return &this +} + +// NewCIAppComputeWithDefaults instantiates a new CIAppCompute object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCIAppComputeWithDefaults() *CIAppCompute { + this := CIAppCompute{} + var typeVar CIAppComputeType = CIAPPCOMPUTETYPE_TOTAL + this.Type = &typeVar + return &this +} + +// GetAggregation returns the Aggregation field value. +func (o *CIAppCompute) GetAggregation() CIAppAggregationFunction { + if o == nil { + var ret CIAppAggregationFunction + return ret + } + return o.Aggregation +} + +// GetAggregationOk returns a tuple with the Aggregation field value +// and a boolean to check if the value has been set. +func (o *CIAppCompute) GetAggregationOk() (*CIAppAggregationFunction, bool) { + if o == nil { + return nil, false + } + return &o.Aggregation, true +} + +// SetAggregation sets field value. +func (o *CIAppCompute) SetAggregation(v CIAppAggregationFunction) { + o.Aggregation = v +} + +// GetInterval returns the Interval field value if set, zero value otherwise. +func (o *CIAppCompute) GetInterval() string { + if o == nil || o.Interval == nil { + var ret string + return ret + } + return *o.Interval +} + +// GetIntervalOk returns a tuple with the Interval field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppCompute) GetIntervalOk() (*string, bool) { + if o == nil || o.Interval == nil { + return nil, false + } + return o.Interval, true +} + +// HasInterval returns a boolean if a field has been set. +func (o *CIAppCompute) HasInterval() bool { + return o != nil && o.Interval != nil +} + +// SetInterval gets a reference to the given string and assigns it to the Interval field. +func (o *CIAppCompute) SetInterval(v string) { + o.Interval = &v +} + +// GetMetric returns the Metric field value if set, zero value otherwise. +func (o *CIAppCompute) GetMetric() string { + if o == nil || o.Metric == nil { + var ret string + return ret + } + return *o.Metric +} + +// GetMetricOk returns a tuple with the Metric field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppCompute) GetMetricOk() (*string, bool) { + if o == nil || o.Metric == nil { + return nil, false + } + return o.Metric, true +} + +// HasMetric returns a boolean if a field has been set. +func (o *CIAppCompute) HasMetric() bool { + return o != nil && o.Metric != nil +} + +// SetMetric gets a reference to the given string and assigns it to the Metric field. +func (o *CIAppCompute) SetMetric(v string) { + o.Metric = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *CIAppCompute) GetType() CIAppComputeType { + if o == nil || o.Type == nil { + var ret CIAppComputeType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppCompute) GetTypeOk() (*CIAppComputeType, bool) { + if o == nil || o.Type == nil { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *CIAppCompute) HasType() bool { + return o != nil && o.Type != nil +} + +// SetType gets a reference to the given CIAppComputeType and assigns it to the Type field. +func (o *CIAppCompute) SetType(v CIAppComputeType) { + o.Type = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CIAppCompute) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return json.Marshal(o.UnparsedObject) + } + toSerialize["aggregation"] = o.Aggregation + if o.Interval != nil { + toSerialize["interval"] = o.Interval + } + if o.Metric != nil { + toSerialize["metric"] = o.Metric + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CIAppCompute) UnmarshalJSON(bytes []byte) (err error) { + raw := map[string]interface{}{} + required := struct { + Aggregation *CIAppAggregationFunction `json:"aggregation"` + }{} + all := struct { + Aggregation CIAppAggregationFunction `json:"aggregation"` + Interval *string `json:"interval,omitempty"` + Metric *string `json:"metric,omitempty"` + Type *CIAppComputeType `json:"type,omitempty"` + }{} + err = json.Unmarshal(bytes, &required) + if err != nil { + return err + } + if required.Aggregation == nil { + return fmt.Errorf("required field aggregation missing") + } + err = json.Unmarshal(bytes, &all) + if err != nil { + err = json.Unmarshal(bytes, &raw) + if err != nil { + return err + } + o.UnparsedObject = raw + return nil + } + if v := all.Aggregation; !v.IsValid() { + err = json.Unmarshal(bytes, &raw) + if err != nil { + return err + } + o.UnparsedObject = raw + return nil + } + if v := all.Type; v != nil && !v.IsValid() { + err = json.Unmarshal(bytes, &raw) + if err != nil { + return err + } + o.UnparsedObject = raw + return nil + } + o.Aggregation = all.Aggregation + o.Interval = all.Interval + o.Metric = all.Metric + o.Type = all.Type + return nil +} diff --git a/api/datadogV2/model_ci_app_compute_type.go b/api/datadogV2/model_ci_app_compute_type.go new file mode 100644 index 00000000000..e111c266e0f --- /dev/null +++ b/api/datadogV2/model_ci_app_compute_type.go @@ -0,0 +1,109 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "encoding/json" + "fmt" +) + +// CIAppComputeType The type of compute. +type CIAppComputeType string + +// List of CIAppComputeType. +const ( + CIAPPCOMPUTETYPE_TIMESERIES CIAppComputeType = "timeseries" + CIAPPCOMPUTETYPE_TOTAL CIAppComputeType = "total" +) + +var allowedCIAppComputeTypeEnumValues = []CIAppComputeType{ + CIAPPCOMPUTETYPE_TIMESERIES, + CIAPPCOMPUTETYPE_TOTAL, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *CIAppComputeType) GetAllowedValues() []CIAppComputeType { + return allowedCIAppComputeTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *CIAppComputeType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + *v = CIAppComputeType(value) + return nil +} + +// NewCIAppComputeTypeFromValue returns a pointer to a valid CIAppComputeType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewCIAppComputeTypeFromValue(v string) (*CIAppComputeType, error) { + ev := CIAppComputeType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for CIAppComputeType: valid values are %v", v, allowedCIAppComputeTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v CIAppComputeType) IsValid() bool { + for _, existing := range allowedCIAppComputeTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CIAppComputeType value. +func (v CIAppComputeType) Ptr() *CIAppComputeType { + return &v +} + +// NullableCIAppComputeType handles when a null is used for CIAppComputeType. +type NullableCIAppComputeType struct { + value *CIAppComputeType + isSet bool +} + +// Get returns the associated value. +func (v NullableCIAppComputeType) Get() *CIAppComputeType { + return v.value +} + +// Set changes the value and indicates it's been called. +func (v *NullableCIAppComputeType) Set(val *CIAppComputeType) { + v.value = val + v.isSet = true +} + +// IsSet returns whether Set has been called. +func (v NullableCIAppComputeType) IsSet() bool { + return v.isSet +} + +// Unset sets the value to nil and resets the set flag. +func (v *NullableCIAppComputeType) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableCIAppComputeType initializes the struct as if Set has been called. +func NewNullableCIAppComputeType(val *CIAppComputeType) *NullableCIAppComputeType { + return &NullableCIAppComputeType{value: val, isSet: true} +} + +// MarshalJSON serializes the associated value. +func (v NullableCIAppComputeType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// UnmarshalJSON deserializes the payload and sets the flag as if Set has been called. +func (v *NullableCIAppComputeType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/api/datadogV2/model_ci_app_event_attributes.go b/api/datadogV2/model_ci_app_event_attributes.go new file mode 100644 index 00000000000..b9acf6995fa --- /dev/null +++ b/api/datadogV2/model_ci_app_event_attributes.go @@ -0,0 +1,210 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "encoding/json" + "time" +) + +// CIAppEventAttributes JSON object containing all event attributes and their associated values. +type CIAppEventAttributes struct { + // JSON object of attributes from CI Visibility events. + Attributes map[string]interface{} `json:"attributes,omitempty"` + // The name of the application or service generating CI Visibility events. + // It is used to switch from CI Visibility to APM, so make sure you define the same + // value when you use both products. + Service *string `json:"service,omitempty"` + // Array of tags associated with your event. + Tags []string `json:"tags,omitempty"` + // Timestamp of your event. + Timestamp *time.Time `json:"timestamp,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} +} + +// NewCIAppEventAttributes instantiates a new CIAppEventAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCIAppEventAttributes() *CIAppEventAttributes { + this := CIAppEventAttributes{} + return &this +} + +// NewCIAppEventAttributesWithDefaults instantiates a new CIAppEventAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCIAppEventAttributesWithDefaults() *CIAppEventAttributes { + this := CIAppEventAttributes{} + return &this +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *CIAppEventAttributes) GetAttributes() map[string]interface{} { + if o == nil || o.Attributes == nil { + var ret map[string]interface{} + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppEventAttributes) GetAttributesOk() (*map[string]interface{}, bool) { + if o == nil || o.Attributes == nil { + return nil, false + } + return &o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *CIAppEventAttributes) HasAttributes() bool { + return o != nil && o.Attributes != nil +} + +// SetAttributes gets a reference to the given map[string]interface{} and assigns it to the Attributes field. +func (o *CIAppEventAttributes) SetAttributes(v map[string]interface{}) { + o.Attributes = v +} + +// GetService returns the Service field value if set, zero value otherwise. +func (o *CIAppEventAttributes) GetService() string { + if o == nil || o.Service == nil { + var ret string + return ret + } + return *o.Service +} + +// GetServiceOk returns a tuple with the Service field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppEventAttributes) GetServiceOk() (*string, bool) { + if o == nil || o.Service == nil { + return nil, false + } + return o.Service, true +} + +// HasService returns a boolean if a field has been set. +func (o *CIAppEventAttributes) HasService() bool { + return o != nil && o.Service != nil +} + +// SetService gets a reference to the given string and assigns it to the Service field. +func (o *CIAppEventAttributes) SetService(v string) { + o.Service = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *CIAppEventAttributes) GetTags() []string { + if o == nil || o.Tags == nil { + var ret []string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppEventAttributes) GetTagsOk() (*[]string, bool) { + if o == nil || o.Tags == nil { + return nil, false + } + return &o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *CIAppEventAttributes) HasTags() bool { + return o != nil && o.Tags != nil +} + +// SetTags gets a reference to the given []string and assigns it to the Tags field. +func (o *CIAppEventAttributes) SetTags(v []string) { + o.Tags = v +} + +// GetTimestamp returns the Timestamp field value if set, zero value otherwise. +func (o *CIAppEventAttributes) GetTimestamp() time.Time { + if o == nil || o.Timestamp == nil { + var ret time.Time + return ret + } + return *o.Timestamp +} + +// GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppEventAttributes) GetTimestampOk() (*time.Time, bool) { + if o == nil || o.Timestamp == nil { + return nil, false + } + return o.Timestamp, true +} + +// HasTimestamp returns a boolean if a field has been set. +func (o *CIAppEventAttributes) HasTimestamp() bool { + return o != nil && o.Timestamp != nil +} + +// SetTimestamp gets a reference to the given time.Time and assigns it to the Timestamp field. +func (o *CIAppEventAttributes) SetTimestamp(v time.Time) { + o.Timestamp = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CIAppEventAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return json.Marshal(o.UnparsedObject) + } + if o.Attributes != nil { + toSerialize["attributes"] = o.Attributes + } + if o.Service != nil { + toSerialize["service"] = o.Service + } + if o.Tags != nil { + toSerialize["tags"] = o.Tags + } + if o.Timestamp != nil { + if o.Timestamp.Nanosecond() == 0 { + toSerialize["timestamp"] = o.Timestamp.Format("2006-01-02T15:04:05Z07:00") + } else { + toSerialize["timestamp"] = o.Timestamp.Format("2006-01-02T15:04:05.000Z07:00") + } + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CIAppEventAttributes) UnmarshalJSON(bytes []byte) (err error) { + raw := map[string]interface{}{} + all := struct { + Attributes map[string]interface{} `json:"attributes,omitempty"` + Service *string `json:"service,omitempty"` + Tags []string `json:"tags,omitempty"` + Timestamp *time.Time `json:"timestamp,omitempty"` + }{} + err = json.Unmarshal(bytes, &all) + if err != nil { + err = json.Unmarshal(bytes, &raw) + if err != nil { + return err + } + o.UnparsedObject = raw + return nil + } + o.Attributes = all.Attributes + o.Service = all.Service + o.Tags = all.Tags + o.Timestamp = all.Timestamp + return nil +} diff --git a/api/datadogV2/model_ci_app_group_by_histogram.go b/api/datadogV2/model_ci_app_group_by_histogram.go new file mode 100644 index 00000000000..59674deeb3d --- /dev/null +++ b/api/datadogV2/model_ci_app_group_by_histogram.go @@ -0,0 +1,172 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "encoding/json" + "fmt" +) + +// CIAppGroupByHistogram Used to perform a histogram computation (only for measure facets). +// At most, 100 buckets are allowed, the number of buckets is `(max - min)/interval`. +type CIAppGroupByHistogram struct { + // The bin size of the histogram buckets. + Interval float64 `json:"interval"` + // The maximum value for the measure used in the histogram + // (values greater than this one are filtered out). + Max float64 `json:"max"` + // The minimum value for the measure used in the histogram + // (values smaller than this one are filtered out). + Min float64 `json:"min"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} +} + +// NewCIAppGroupByHistogram instantiates a new CIAppGroupByHistogram object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCIAppGroupByHistogram(interval float64, max float64, min float64) *CIAppGroupByHistogram { + this := CIAppGroupByHistogram{} + this.Interval = interval + this.Max = max + this.Min = min + return &this +} + +// NewCIAppGroupByHistogramWithDefaults instantiates a new CIAppGroupByHistogram object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCIAppGroupByHistogramWithDefaults() *CIAppGroupByHistogram { + this := CIAppGroupByHistogram{} + return &this +} + +// GetInterval returns the Interval field value. +func (o *CIAppGroupByHistogram) GetInterval() float64 { + if o == nil { + var ret float64 + return ret + } + return o.Interval +} + +// GetIntervalOk returns a tuple with the Interval field value +// and a boolean to check if the value has been set. +func (o *CIAppGroupByHistogram) GetIntervalOk() (*float64, bool) { + if o == nil { + return nil, false + } + return &o.Interval, true +} + +// SetInterval sets field value. +func (o *CIAppGroupByHistogram) SetInterval(v float64) { + o.Interval = v +} + +// GetMax returns the Max field value. +func (o *CIAppGroupByHistogram) GetMax() float64 { + if o == nil { + var ret float64 + return ret + } + return o.Max +} + +// GetMaxOk returns a tuple with the Max field value +// and a boolean to check if the value has been set. +func (o *CIAppGroupByHistogram) GetMaxOk() (*float64, bool) { + if o == nil { + return nil, false + } + return &o.Max, true +} + +// SetMax sets field value. +func (o *CIAppGroupByHistogram) SetMax(v float64) { + o.Max = v +} + +// GetMin returns the Min field value. +func (o *CIAppGroupByHistogram) GetMin() float64 { + if o == nil { + var ret float64 + return ret + } + return o.Min +} + +// GetMinOk returns a tuple with the Min field value +// and a boolean to check if the value has been set. +func (o *CIAppGroupByHistogram) GetMinOk() (*float64, bool) { + if o == nil { + return nil, false + } + return &o.Min, true +} + +// SetMin sets field value. +func (o *CIAppGroupByHistogram) SetMin(v float64) { + o.Min = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CIAppGroupByHistogram) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return json.Marshal(o.UnparsedObject) + } + toSerialize["interval"] = o.Interval + toSerialize["max"] = o.Max + toSerialize["min"] = o.Min + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CIAppGroupByHistogram) UnmarshalJSON(bytes []byte) (err error) { + raw := map[string]interface{}{} + required := struct { + Interval *float64 `json:"interval"` + Max *float64 `json:"max"` + Min *float64 `json:"min"` + }{} + all := struct { + Interval float64 `json:"interval"` + Max float64 `json:"max"` + Min float64 `json:"min"` + }{} + err = json.Unmarshal(bytes, &required) + if err != nil { + return err + } + if required.Interval == nil { + return fmt.Errorf("required field interval missing") + } + if required.Max == nil { + return fmt.Errorf("required field max missing") + } + if required.Min == nil { + return fmt.Errorf("required field min missing") + } + err = json.Unmarshal(bytes, &all) + if err != nil { + err = json.Unmarshal(bytes, &raw) + if err != nil { + return err + } + o.UnparsedObject = raw + return nil + } + o.Interval = all.Interval + o.Max = all.Max + o.Min = all.Min + return nil +} diff --git a/api/datadogV2/model_ci_app_group_by_missing.go b/api/datadogV2/model_ci_app_group_by_missing.go new file mode 100644 index 00000000000..69dd2ceb5a4 --- /dev/null +++ b/api/datadogV2/model_ci_app_group_by_missing.go @@ -0,0 +1,155 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "encoding/json" +) + +// CIAppGroupByMissing - The value to use for logs that don't have the facet used to group-by. +type CIAppGroupByMissing struct { + CIAppGroupByMissingString *string + CIAppGroupByMissingNumber *float64 + + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject interface{} +} + +// CIAppGroupByMissingStringAsCIAppGroupByMissing is a convenience function that returns string wrapped in CIAppGroupByMissing. +func CIAppGroupByMissingStringAsCIAppGroupByMissing(v *string) CIAppGroupByMissing { + return CIAppGroupByMissing{CIAppGroupByMissingString: v} +} + +// CIAppGroupByMissingNumberAsCIAppGroupByMissing is a convenience function that returns float64 wrapped in CIAppGroupByMissing. +func CIAppGroupByMissingNumberAsCIAppGroupByMissing(v *float64) CIAppGroupByMissing { + return CIAppGroupByMissing{CIAppGroupByMissingNumber: v} +} + +// UnmarshalJSON turns data into one of the pointers in the struct. +func (obj *CIAppGroupByMissing) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into CIAppGroupByMissingString + err = json.Unmarshal(data, &obj.CIAppGroupByMissingString) + if err == nil { + if obj.CIAppGroupByMissingString != nil { + jsonCIAppGroupByMissingString, _ := json.Marshal(obj.CIAppGroupByMissingString) + if string(jsonCIAppGroupByMissingString) == "{}" { // empty struct + obj.CIAppGroupByMissingString = nil + } else { + match++ + } + } else { + obj.CIAppGroupByMissingString = nil + } + } else { + obj.CIAppGroupByMissingString = nil + } + + // try to unmarshal data into CIAppGroupByMissingNumber + err = json.Unmarshal(data, &obj.CIAppGroupByMissingNumber) + if err == nil { + if obj.CIAppGroupByMissingNumber != nil { + jsonCIAppGroupByMissingNumber, _ := json.Marshal(obj.CIAppGroupByMissingNumber) + if string(jsonCIAppGroupByMissingNumber) == "{}" { // empty struct + obj.CIAppGroupByMissingNumber = nil + } else { + match++ + } + } else { + obj.CIAppGroupByMissingNumber = nil + } + } else { + obj.CIAppGroupByMissingNumber = nil + } + + if match != 1 { // more than 1 match + // reset to nil + obj.CIAppGroupByMissingString = nil + obj.CIAppGroupByMissingNumber = nil + return json.Unmarshal(data, &obj.UnparsedObject) + } + return nil // exactly one match +} + +// MarshalJSON turns data from the first non-nil pointers in the struct to JSON. +func (obj CIAppGroupByMissing) MarshalJSON() ([]byte, error) { + if obj.CIAppGroupByMissingString != nil { + return json.Marshal(&obj.CIAppGroupByMissingString) + } + + if obj.CIAppGroupByMissingNumber != nil { + return json.Marshal(&obj.CIAppGroupByMissingNumber) + } + + if obj.UnparsedObject != nil { + return json.Marshal(obj.UnparsedObject) + } + return nil, nil // no data in oneOf schemas +} + +// GetActualInstance returns the actual instance. +func (obj *CIAppGroupByMissing) GetActualInstance() interface{} { + if obj.CIAppGroupByMissingString != nil { + return obj.CIAppGroupByMissingString + } + + if obj.CIAppGroupByMissingNumber != nil { + return obj.CIAppGroupByMissingNumber + } + + // all schemas are nil + return nil +} + +// NullableCIAppGroupByMissing handles when a null is used for CIAppGroupByMissing. +type NullableCIAppGroupByMissing struct { + value *CIAppGroupByMissing + isSet bool +} + +// Get returns the associated value. +func (v NullableCIAppGroupByMissing) Get() *CIAppGroupByMissing { + return v.value +} + +// Set changes the value and indicates it's been called. +func (v *NullableCIAppGroupByMissing) Set(val *CIAppGroupByMissing) { + v.value = val + v.isSet = true +} + +// IsSet returns whether Set has been called. +func (v NullableCIAppGroupByMissing) IsSet() bool { + return v.isSet +} + +// Unset sets the value to nil and resets the set flag/ +func (v *NullableCIAppGroupByMissing) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableCIAppGroupByMissing initializes the struct as if Set has been called. +func NewNullableCIAppGroupByMissing(val *CIAppGroupByMissing) *NullableCIAppGroupByMissing { + return &NullableCIAppGroupByMissing{value: val, isSet: true} +} + +// MarshalJSON serializes the associated value. +func (v NullableCIAppGroupByMissing) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// UnmarshalJSON deserializes the payload and sets the flag as if Set has been called. +func (v *NullableCIAppGroupByMissing) UnmarshalJSON(src []byte) error { + v.isSet = true + + // this object is nullable so check if the payload is null or empty string + if string(src) == "" || string(src) == "{}" { + return nil + } + + return json.Unmarshal(src, &v.value) +} diff --git a/api/datadogV2/model_ci_app_group_by_total.go b/api/datadogV2/model_ci_app_group_by_total.go new file mode 100644 index 00000000000..6a177a944d4 --- /dev/null +++ b/api/datadogV2/model_ci_app_group_by_total.go @@ -0,0 +1,187 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "encoding/json" +) + +// CIAppGroupByTotal - A resulting object to put the given computes in over all the matching records. +type CIAppGroupByTotal struct { + CIAppGroupByTotalBoolean *bool + CIAppGroupByTotalString *string + CIAppGroupByTotalNumber *float64 + + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject interface{} +} + +// CIAppGroupByTotalBooleanAsCIAppGroupByTotal is a convenience function that returns bool wrapped in CIAppGroupByTotal. +func CIAppGroupByTotalBooleanAsCIAppGroupByTotal(v *bool) CIAppGroupByTotal { + return CIAppGroupByTotal{CIAppGroupByTotalBoolean: v} +} + +// CIAppGroupByTotalStringAsCIAppGroupByTotal is a convenience function that returns string wrapped in CIAppGroupByTotal. +func CIAppGroupByTotalStringAsCIAppGroupByTotal(v *string) CIAppGroupByTotal { + return CIAppGroupByTotal{CIAppGroupByTotalString: v} +} + +// CIAppGroupByTotalNumberAsCIAppGroupByTotal is a convenience function that returns float64 wrapped in CIAppGroupByTotal. +func CIAppGroupByTotalNumberAsCIAppGroupByTotal(v *float64) CIAppGroupByTotal { + return CIAppGroupByTotal{CIAppGroupByTotalNumber: v} +} + +// UnmarshalJSON turns data into one of the pointers in the struct. +func (obj *CIAppGroupByTotal) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into CIAppGroupByTotalBoolean + err = json.Unmarshal(data, &obj.CIAppGroupByTotalBoolean) + if err == nil { + if obj.CIAppGroupByTotalBoolean != nil { + jsonCIAppGroupByTotalBoolean, _ := json.Marshal(obj.CIAppGroupByTotalBoolean) + if string(jsonCIAppGroupByTotalBoolean) == "{}" { // empty struct + obj.CIAppGroupByTotalBoolean = nil + } else { + match++ + } + } else { + obj.CIAppGroupByTotalBoolean = nil + } + } else { + obj.CIAppGroupByTotalBoolean = nil + } + + // try to unmarshal data into CIAppGroupByTotalString + err = json.Unmarshal(data, &obj.CIAppGroupByTotalString) + if err == nil { + if obj.CIAppGroupByTotalString != nil { + jsonCIAppGroupByTotalString, _ := json.Marshal(obj.CIAppGroupByTotalString) + if string(jsonCIAppGroupByTotalString) == "{}" { // empty struct + obj.CIAppGroupByTotalString = nil + } else { + match++ + } + } else { + obj.CIAppGroupByTotalString = nil + } + } else { + obj.CIAppGroupByTotalString = nil + } + + // try to unmarshal data into CIAppGroupByTotalNumber + err = json.Unmarshal(data, &obj.CIAppGroupByTotalNumber) + if err == nil { + if obj.CIAppGroupByTotalNumber != nil { + jsonCIAppGroupByTotalNumber, _ := json.Marshal(obj.CIAppGroupByTotalNumber) + if string(jsonCIAppGroupByTotalNumber) == "{}" { // empty struct + obj.CIAppGroupByTotalNumber = nil + } else { + match++ + } + } else { + obj.CIAppGroupByTotalNumber = nil + } + } else { + obj.CIAppGroupByTotalNumber = nil + } + + if match != 1 { // more than 1 match + // reset to nil + obj.CIAppGroupByTotalBoolean = nil + obj.CIAppGroupByTotalString = nil + obj.CIAppGroupByTotalNumber = nil + return json.Unmarshal(data, &obj.UnparsedObject) + } + return nil // exactly one match +} + +// MarshalJSON turns data from the first non-nil pointers in the struct to JSON. +func (obj CIAppGroupByTotal) MarshalJSON() ([]byte, error) { + if obj.CIAppGroupByTotalBoolean != nil { + return json.Marshal(&obj.CIAppGroupByTotalBoolean) + } + + if obj.CIAppGroupByTotalString != nil { + return json.Marshal(&obj.CIAppGroupByTotalString) + } + + if obj.CIAppGroupByTotalNumber != nil { + return json.Marshal(&obj.CIAppGroupByTotalNumber) + } + + if obj.UnparsedObject != nil { + return json.Marshal(obj.UnparsedObject) + } + return nil, nil // no data in oneOf schemas +} + +// GetActualInstance returns the actual instance. +func (obj *CIAppGroupByTotal) GetActualInstance() interface{} { + if obj.CIAppGroupByTotalBoolean != nil { + return obj.CIAppGroupByTotalBoolean + } + + if obj.CIAppGroupByTotalString != nil { + return obj.CIAppGroupByTotalString + } + + if obj.CIAppGroupByTotalNumber != nil { + return obj.CIAppGroupByTotalNumber + } + + // all schemas are nil + return nil +} + +// NullableCIAppGroupByTotal handles when a null is used for CIAppGroupByTotal. +type NullableCIAppGroupByTotal struct { + value *CIAppGroupByTotal + isSet bool +} + +// Get returns the associated value. +func (v NullableCIAppGroupByTotal) Get() *CIAppGroupByTotal { + return v.value +} + +// Set changes the value and indicates it's been called. +func (v *NullableCIAppGroupByTotal) Set(val *CIAppGroupByTotal) { + v.value = val + v.isSet = true +} + +// IsSet returns whether Set has been called. +func (v NullableCIAppGroupByTotal) IsSet() bool { + return v.isSet +} + +// Unset sets the value to nil and resets the set flag/ +func (v *NullableCIAppGroupByTotal) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableCIAppGroupByTotal initializes the struct as if Set has been called. +func NewNullableCIAppGroupByTotal(val *CIAppGroupByTotal) *NullableCIAppGroupByTotal { + return &NullableCIAppGroupByTotal{value: val, isSet: true} +} + +// MarshalJSON serializes the associated value. +func (v NullableCIAppGroupByTotal) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// UnmarshalJSON deserializes the payload and sets the flag as if Set has been called. +func (v *NullableCIAppGroupByTotal) UnmarshalJSON(src []byte) error { + v.isSet = true + + // this object is nullable so check if the payload is null or empty string + if string(src) == "" || string(src) == "{}" { + return nil + } + + return json.Unmarshal(src, &v.value) +} diff --git a/api/datadogV2/model_ci_app_pipeline_event.go b/api/datadogV2/model_ci_app_pipeline_event.go new file mode 100644 index 00000000000..6e3b5396a27 --- /dev/null +++ b/api/datadogV2/model_ci_app_pipeline_event.go @@ -0,0 +1,183 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "encoding/json" +) + +// CIAppPipelineEvent Object description of a pipeline event after being processed and stored by Datadog. +type CIAppPipelineEvent struct { + // JSON object containing all event attributes and their associated values. + Attributes *CIAppEventAttributes `json:"attributes,omitempty"` + // Unique ID of the event. + Id *string `json:"id,omitempty"` + // Type of the event. + Type *CIAppPipelineEventTypeName `json:"type,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} +} + +// NewCIAppPipelineEvent instantiates a new CIAppPipelineEvent object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCIAppPipelineEvent() *CIAppPipelineEvent { + this := CIAppPipelineEvent{} + return &this +} + +// NewCIAppPipelineEventWithDefaults instantiates a new CIAppPipelineEvent object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCIAppPipelineEventWithDefaults() *CIAppPipelineEvent { + this := CIAppPipelineEvent{} + return &this +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *CIAppPipelineEvent) GetAttributes() CIAppEventAttributes { + if o == nil || o.Attributes == nil { + var ret CIAppEventAttributes + return ret + } + return *o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppPipelineEvent) GetAttributesOk() (*CIAppEventAttributes, bool) { + if o == nil || o.Attributes == nil { + return nil, false + } + return o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *CIAppPipelineEvent) HasAttributes() bool { + return o != nil && o.Attributes != nil +} + +// SetAttributes gets a reference to the given CIAppEventAttributes and assigns it to the Attributes field. +func (o *CIAppPipelineEvent) SetAttributes(v CIAppEventAttributes) { + o.Attributes = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *CIAppPipelineEvent) GetId() string { + if o == nil || o.Id == nil { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppPipelineEvent) GetIdOk() (*string, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *CIAppPipelineEvent) HasId() bool { + return o != nil && o.Id != nil +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *CIAppPipelineEvent) SetId(v string) { + o.Id = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *CIAppPipelineEvent) GetType() CIAppPipelineEventTypeName { + if o == nil || o.Type == nil { + var ret CIAppPipelineEventTypeName + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppPipelineEvent) GetTypeOk() (*CIAppPipelineEventTypeName, bool) { + if o == nil || o.Type == nil { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *CIAppPipelineEvent) HasType() bool { + return o != nil && o.Type != nil +} + +// SetType gets a reference to the given CIAppPipelineEventTypeName and assigns it to the Type field. +func (o *CIAppPipelineEvent) SetType(v CIAppPipelineEventTypeName) { + o.Type = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CIAppPipelineEvent) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return json.Marshal(o.UnparsedObject) + } + if o.Attributes != nil { + toSerialize["attributes"] = o.Attributes + } + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CIAppPipelineEvent) UnmarshalJSON(bytes []byte) (err error) { + raw := map[string]interface{}{} + all := struct { + Attributes *CIAppEventAttributes `json:"attributes,omitempty"` + Id *string `json:"id,omitempty"` + Type *CIAppPipelineEventTypeName `json:"type,omitempty"` + }{} + err = json.Unmarshal(bytes, &all) + if err != nil { + err = json.Unmarshal(bytes, &raw) + if err != nil { + return err + } + o.UnparsedObject = raw + return nil + } + if v := all.Type; v != nil && !v.IsValid() { + err = json.Unmarshal(bytes, &raw) + if err != nil { + return err + } + o.UnparsedObject = raw + return nil + } + if all.Attributes != nil && all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + err = json.Unmarshal(bytes, &raw) + if err != nil { + return err + } + o.UnparsedObject = raw + } + o.Attributes = all.Attributes + o.Id = all.Id + o.Type = all.Type + return nil +} diff --git a/api/datadogV2/model_ci_app_pipeline_event_type_name.go b/api/datadogV2/model_ci_app_pipeline_event_type_name.go new file mode 100644 index 00000000000..e9c64bcce31 --- /dev/null +++ b/api/datadogV2/model_ci_app_pipeline_event_type_name.go @@ -0,0 +1,107 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "encoding/json" + "fmt" +) + +// CIAppPipelineEventTypeName Type of the event. +type CIAppPipelineEventTypeName string + +// List of CIAppPipelineEventTypeName. +const ( + CIAPPPIPELINEEVENTTYPENAME_cipipeline CIAppPipelineEventTypeName = "cipipeline" +) + +var allowedCIAppPipelineEventTypeNameEnumValues = []CIAppPipelineEventTypeName{ + CIAPPPIPELINEEVENTTYPENAME_cipipeline, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *CIAppPipelineEventTypeName) GetAllowedValues() []CIAppPipelineEventTypeName { + return allowedCIAppPipelineEventTypeNameEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *CIAppPipelineEventTypeName) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + *v = CIAppPipelineEventTypeName(value) + return nil +} + +// NewCIAppPipelineEventTypeNameFromValue returns a pointer to a valid CIAppPipelineEventTypeName +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewCIAppPipelineEventTypeNameFromValue(v string) (*CIAppPipelineEventTypeName, error) { + ev := CIAppPipelineEventTypeName(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for CIAppPipelineEventTypeName: valid values are %v", v, allowedCIAppPipelineEventTypeNameEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v CIAppPipelineEventTypeName) IsValid() bool { + for _, existing := range allowedCIAppPipelineEventTypeNameEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CIAppPipelineEventTypeName value. +func (v CIAppPipelineEventTypeName) Ptr() *CIAppPipelineEventTypeName { + return &v +} + +// NullableCIAppPipelineEventTypeName handles when a null is used for CIAppPipelineEventTypeName. +type NullableCIAppPipelineEventTypeName struct { + value *CIAppPipelineEventTypeName + isSet bool +} + +// Get returns the associated value. +func (v NullableCIAppPipelineEventTypeName) Get() *CIAppPipelineEventTypeName { + return v.value +} + +// Set changes the value and indicates it's been called. +func (v *NullableCIAppPipelineEventTypeName) Set(val *CIAppPipelineEventTypeName) { + v.value = val + v.isSet = true +} + +// IsSet returns whether Set has been called. +func (v NullableCIAppPipelineEventTypeName) IsSet() bool { + return v.isSet +} + +// Unset sets the value to nil and resets the set flag. +func (v *NullableCIAppPipelineEventTypeName) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableCIAppPipelineEventTypeName initializes the struct as if Set has been called. +func NewNullableCIAppPipelineEventTypeName(val *CIAppPipelineEventTypeName) *NullableCIAppPipelineEventTypeName { + return &NullableCIAppPipelineEventTypeName{value: val, isSet: true} +} + +// MarshalJSON serializes the associated value. +func (v NullableCIAppPipelineEventTypeName) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// UnmarshalJSON deserializes the payload and sets the flag as if Set has been called. +func (v *NullableCIAppPipelineEventTypeName) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/api/datadogV2/model_ci_app_pipeline_events_request.go b/api/datadogV2/model_ci_app_pipeline_events_request.go new file mode 100644 index 00000000000..d5f5d86d655 --- /dev/null +++ b/api/datadogV2/model_ci_app_pipeline_events_request.go @@ -0,0 +1,233 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "encoding/json" +) + +// CIAppPipelineEventsRequest The request for a pipelines search. +type CIAppPipelineEventsRequest struct { + // The search and filter query settings. + Filter *CIAppPipelinesQueryFilter `json:"filter,omitempty"` + // Global query options that are used during the query. + // Only supply timezone or time offset, not both. Otherwise, the query fails. + Options *CIAppQueryOptions `json:"options,omitempty"` + // Paging attributes for listing events. + Page *CIAppQueryPageOptions `json:"page,omitempty"` + // Sort parameters when querying events. + Sort *CIAppSort `json:"sort,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} +} + +// NewCIAppPipelineEventsRequest instantiates a new CIAppPipelineEventsRequest object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCIAppPipelineEventsRequest() *CIAppPipelineEventsRequest { + this := CIAppPipelineEventsRequest{} + return &this +} + +// NewCIAppPipelineEventsRequestWithDefaults instantiates a new CIAppPipelineEventsRequest object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCIAppPipelineEventsRequestWithDefaults() *CIAppPipelineEventsRequest { + this := CIAppPipelineEventsRequest{} + return &this +} + +// GetFilter returns the Filter field value if set, zero value otherwise. +func (o *CIAppPipelineEventsRequest) GetFilter() CIAppPipelinesQueryFilter { + if o == nil || o.Filter == nil { + var ret CIAppPipelinesQueryFilter + return ret + } + return *o.Filter +} + +// GetFilterOk returns a tuple with the Filter field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppPipelineEventsRequest) GetFilterOk() (*CIAppPipelinesQueryFilter, bool) { + if o == nil || o.Filter == nil { + return nil, false + } + return o.Filter, true +} + +// HasFilter returns a boolean if a field has been set. +func (o *CIAppPipelineEventsRequest) HasFilter() bool { + return o != nil && o.Filter != nil +} + +// SetFilter gets a reference to the given CIAppPipelinesQueryFilter and assigns it to the Filter field. +func (o *CIAppPipelineEventsRequest) SetFilter(v CIAppPipelinesQueryFilter) { + o.Filter = &v +} + +// GetOptions returns the Options field value if set, zero value otherwise. +func (o *CIAppPipelineEventsRequest) GetOptions() CIAppQueryOptions { + if o == nil || o.Options == nil { + var ret CIAppQueryOptions + return ret + } + return *o.Options +} + +// GetOptionsOk returns a tuple with the Options field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppPipelineEventsRequest) GetOptionsOk() (*CIAppQueryOptions, bool) { + if o == nil || o.Options == nil { + return nil, false + } + return o.Options, true +} + +// HasOptions returns a boolean if a field has been set. +func (o *CIAppPipelineEventsRequest) HasOptions() bool { + return o != nil && o.Options != nil +} + +// SetOptions gets a reference to the given CIAppQueryOptions and assigns it to the Options field. +func (o *CIAppPipelineEventsRequest) SetOptions(v CIAppQueryOptions) { + o.Options = &v +} + +// GetPage returns the Page field value if set, zero value otherwise. +func (o *CIAppPipelineEventsRequest) GetPage() CIAppQueryPageOptions { + if o == nil || o.Page == nil { + var ret CIAppQueryPageOptions + return ret + } + return *o.Page +} + +// GetPageOk returns a tuple with the Page field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppPipelineEventsRequest) GetPageOk() (*CIAppQueryPageOptions, bool) { + if o == nil || o.Page == nil { + return nil, false + } + return o.Page, true +} + +// HasPage returns a boolean if a field has been set. +func (o *CIAppPipelineEventsRequest) HasPage() bool { + return o != nil && o.Page != nil +} + +// SetPage gets a reference to the given CIAppQueryPageOptions and assigns it to the Page field. +func (o *CIAppPipelineEventsRequest) SetPage(v CIAppQueryPageOptions) { + o.Page = &v +} + +// GetSort returns the Sort field value if set, zero value otherwise. +func (o *CIAppPipelineEventsRequest) GetSort() CIAppSort { + if o == nil || o.Sort == nil { + var ret CIAppSort + return ret + } + return *o.Sort +} + +// GetSortOk returns a tuple with the Sort field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppPipelineEventsRequest) GetSortOk() (*CIAppSort, bool) { + if o == nil || o.Sort == nil { + return nil, false + } + return o.Sort, true +} + +// HasSort returns a boolean if a field has been set. +func (o *CIAppPipelineEventsRequest) HasSort() bool { + return o != nil && o.Sort != nil +} + +// SetSort gets a reference to the given CIAppSort and assigns it to the Sort field. +func (o *CIAppPipelineEventsRequest) SetSort(v CIAppSort) { + o.Sort = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CIAppPipelineEventsRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return json.Marshal(o.UnparsedObject) + } + if o.Filter != nil { + toSerialize["filter"] = o.Filter + } + if o.Options != nil { + toSerialize["options"] = o.Options + } + if o.Page != nil { + toSerialize["page"] = o.Page + } + if o.Sort != nil { + toSerialize["sort"] = o.Sort + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CIAppPipelineEventsRequest) UnmarshalJSON(bytes []byte) (err error) { + raw := map[string]interface{}{} + all := struct { + Filter *CIAppPipelinesQueryFilter `json:"filter,omitempty"` + Options *CIAppQueryOptions `json:"options,omitempty"` + Page *CIAppQueryPageOptions `json:"page,omitempty"` + Sort *CIAppSort `json:"sort,omitempty"` + }{} + err = json.Unmarshal(bytes, &all) + if err != nil { + err = json.Unmarshal(bytes, &raw) + if err != nil { + return err + } + o.UnparsedObject = raw + return nil + } + if v := all.Sort; v != nil && !v.IsValid() { + err = json.Unmarshal(bytes, &raw) + if err != nil { + return err + } + o.UnparsedObject = raw + return nil + } + if all.Filter != nil && all.Filter.UnparsedObject != nil && o.UnparsedObject == nil { + err = json.Unmarshal(bytes, &raw) + if err != nil { + return err + } + o.UnparsedObject = raw + } + o.Filter = all.Filter + if all.Options != nil && all.Options.UnparsedObject != nil && o.UnparsedObject == nil { + err = json.Unmarshal(bytes, &raw) + if err != nil { + return err + } + o.UnparsedObject = raw + } + o.Options = all.Options + if all.Page != nil && all.Page.UnparsedObject != nil && o.UnparsedObject == nil { + err = json.Unmarshal(bytes, &raw) + if err != nil { + return err + } + o.UnparsedObject = raw + } + o.Page = all.Page + o.Sort = all.Sort + return nil +} diff --git a/api/datadogV2/model_ci_app_pipeline_events_response.go b/api/datadogV2/model_ci_app_pipeline_events_response.go new file mode 100644 index 00000000000..a0ff29883ef --- /dev/null +++ b/api/datadogV2/model_ci_app_pipeline_events_response.go @@ -0,0 +1,182 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "encoding/json" +) + +// CIAppPipelineEventsResponse Response object with all pipeline events matching the request and pagination information. +type CIAppPipelineEventsResponse struct { + // Array of events matching the request. + Data []CIAppPipelineEvent `json:"data,omitempty"` + // Links attributes. + Links *CIAppResponseLinks `json:"links,omitempty"` + // The metadata associated with a request. + Meta *CIAppResponseMetadata `json:"meta,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} +} + +// NewCIAppPipelineEventsResponse instantiates a new CIAppPipelineEventsResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCIAppPipelineEventsResponse() *CIAppPipelineEventsResponse { + this := CIAppPipelineEventsResponse{} + return &this +} + +// NewCIAppPipelineEventsResponseWithDefaults instantiates a new CIAppPipelineEventsResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCIAppPipelineEventsResponseWithDefaults() *CIAppPipelineEventsResponse { + this := CIAppPipelineEventsResponse{} + return &this +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *CIAppPipelineEventsResponse) GetData() []CIAppPipelineEvent { + if o == nil || o.Data == nil { + var ret []CIAppPipelineEvent + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppPipelineEventsResponse) GetDataOk() (*[]CIAppPipelineEvent, bool) { + if o == nil || o.Data == nil { + return nil, false + } + return &o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *CIAppPipelineEventsResponse) HasData() bool { + return o != nil && o.Data != nil +} + +// SetData gets a reference to the given []CIAppPipelineEvent and assigns it to the Data field. +func (o *CIAppPipelineEventsResponse) SetData(v []CIAppPipelineEvent) { + o.Data = v +} + +// GetLinks returns the Links field value if set, zero value otherwise. +func (o *CIAppPipelineEventsResponse) GetLinks() CIAppResponseLinks { + if o == nil || o.Links == nil { + var ret CIAppResponseLinks + return ret + } + return *o.Links +} + +// GetLinksOk returns a tuple with the Links field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppPipelineEventsResponse) GetLinksOk() (*CIAppResponseLinks, bool) { + if o == nil || o.Links == nil { + return nil, false + } + return o.Links, true +} + +// HasLinks returns a boolean if a field has been set. +func (o *CIAppPipelineEventsResponse) HasLinks() bool { + return o != nil && o.Links != nil +} + +// SetLinks gets a reference to the given CIAppResponseLinks and assigns it to the Links field. +func (o *CIAppPipelineEventsResponse) SetLinks(v CIAppResponseLinks) { + o.Links = &v +} + +// GetMeta returns the Meta field value if set, zero value otherwise. +func (o *CIAppPipelineEventsResponse) GetMeta() CIAppResponseMetadata { + if o == nil || o.Meta == nil { + var ret CIAppResponseMetadata + return ret + } + return *o.Meta +} + +// GetMetaOk returns a tuple with the Meta field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppPipelineEventsResponse) GetMetaOk() (*CIAppResponseMetadata, bool) { + if o == nil || o.Meta == nil { + return nil, false + } + return o.Meta, true +} + +// HasMeta returns a boolean if a field has been set. +func (o *CIAppPipelineEventsResponse) HasMeta() bool { + return o != nil && o.Meta != nil +} + +// SetMeta gets a reference to the given CIAppResponseMetadata and assigns it to the Meta field. +func (o *CIAppPipelineEventsResponse) SetMeta(v CIAppResponseMetadata) { + o.Meta = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CIAppPipelineEventsResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return json.Marshal(o.UnparsedObject) + } + if o.Data != nil { + toSerialize["data"] = o.Data + } + if o.Links != nil { + toSerialize["links"] = o.Links + } + if o.Meta != nil { + toSerialize["meta"] = o.Meta + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CIAppPipelineEventsResponse) UnmarshalJSON(bytes []byte) (err error) { + raw := map[string]interface{}{} + all := struct { + Data []CIAppPipelineEvent `json:"data,omitempty"` + Links *CIAppResponseLinks `json:"links,omitempty"` + Meta *CIAppResponseMetadata `json:"meta,omitempty"` + }{} + err = json.Unmarshal(bytes, &all) + if err != nil { + err = json.Unmarshal(bytes, &raw) + if err != nil { + return err + } + o.UnparsedObject = raw + return nil + } + o.Data = all.Data + if all.Links != nil && all.Links.UnparsedObject != nil && o.UnparsedObject == nil { + err = json.Unmarshal(bytes, &raw) + if err != nil { + return err + } + o.UnparsedObject = raw + } + o.Links = all.Links + if all.Meta != nil && all.Meta.UnparsedObject != nil && o.UnparsedObject == nil { + err = json.Unmarshal(bytes, &raw) + if err != nil { + return err + } + o.UnparsedObject = raw + } + o.Meta = all.Meta + return nil +} diff --git a/api/datadogV2/model_ci_app_pipelines_aggregate_request.go b/api/datadogV2/model_ci_app_pipelines_aggregate_request.go new file mode 100644 index 00000000000..014aa2cd6b9 --- /dev/null +++ b/api/datadogV2/model_ci_app_pipelines_aggregate_request.go @@ -0,0 +1,260 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "encoding/json" +) + +// CIAppPipelinesAggregateRequest The object sent with the request to retrieve aggregation buckets of pipeline events from your organization. +type CIAppPipelinesAggregateRequest struct { + // The list of metrics or timeseries to compute for the retrieved buckets. + Compute []CIAppCompute `json:"compute,omitempty"` + // The search and filter query settings. + Filter *CIAppPipelinesQueryFilter `json:"filter,omitempty"` + // The rules for the group-by. + GroupBy []CIAppPipelinesGroupBy `json:"group_by,omitempty"` + // Global query options that are used during the query. + // Only supply timezone or time offset, not both. Otherwise, the query fails. + Options *CIAppQueryOptions `json:"options,omitempty"` + // Paging attributes for listing events. + Page *CIAppQueryPageOptions `json:"page,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} +} + +// NewCIAppPipelinesAggregateRequest instantiates a new CIAppPipelinesAggregateRequest object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCIAppPipelinesAggregateRequest() *CIAppPipelinesAggregateRequest { + this := CIAppPipelinesAggregateRequest{} + return &this +} + +// NewCIAppPipelinesAggregateRequestWithDefaults instantiates a new CIAppPipelinesAggregateRequest object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCIAppPipelinesAggregateRequestWithDefaults() *CIAppPipelinesAggregateRequest { + this := CIAppPipelinesAggregateRequest{} + return &this +} + +// GetCompute returns the Compute field value if set, zero value otherwise. +func (o *CIAppPipelinesAggregateRequest) GetCompute() []CIAppCompute { + if o == nil || o.Compute == nil { + var ret []CIAppCompute + return ret + } + return o.Compute +} + +// GetComputeOk returns a tuple with the Compute field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppPipelinesAggregateRequest) GetComputeOk() (*[]CIAppCompute, bool) { + if o == nil || o.Compute == nil { + return nil, false + } + return &o.Compute, true +} + +// HasCompute returns a boolean if a field has been set. +func (o *CIAppPipelinesAggregateRequest) HasCompute() bool { + return o != nil && o.Compute != nil +} + +// SetCompute gets a reference to the given []CIAppCompute and assigns it to the Compute field. +func (o *CIAppPipelinesAggregateRequest) SetCompute(v []CIAppCompute) { + o.Compute = v +} + +// GetFilter returns the Filter field value if set, zero value otherwise. +func (o *CIAppPipelinesAggregateRequest) GetFilter() CIAppPipelinesQueryFilter { + if o == nil || o.Filter == nil { + var ret CIAppPipelinesQueryFilter + return ret + } + return *o.Filter +} + +// GetFilterOk returns a tuple with the Filter field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppPipelinesAggregateRequest) GetFilterOk() (*CIAppPipelinesQueryFilter, bool) { + if o == nil || o.Filter == nil { + return nil, false + } + return o.Filter, true +} + +// HasFilter returns a boolean if a field has been set. +func (o *CIAppPipelinesAggregateRequest) HasFilter() bool { + return o != nil && o.Filter != nil +} + +// SetFilter gets a reference to the given CIAppPipelinesQueryFilter and assigns it to the Filter field. +func (o *CIAppPipelinesAggregateRequest) SetFilter(v CIAppPipelinesQueryFilter) { + o.Filter = &v +} + +// GetGroupBy returns the GroupBy field value if set, zero value otherwise. +func (o *CIAppPipelinesAggregateRequest) GetGroupBy() []CIAppPipelinesGroupBy { + if o == nil || o.GroupBy == nil { + var ret []CIAppPipelinesGroupBy + return ret + } + return o.GroupBy +} + +// GetGroupByOk returns a tuple with the GroupBy field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppPipelinesAggregateRequest) GetGroupByOk() (*[]CIAppPipelinesGroupBy, bool) { + if o == nil || o.GroupBy == nil { + return nil, false + } + return &o.GroupBy, true +} + +// HasGroupBy returns a boolean if a field has been set. +func (o *CIAppPipelinesAggregateRequest) HasGroupBy() bool { + return o != nil && o.GroupBy != nil +} + +// SetGroupBy gets a reference to the given []CIAppPipelinesGroupBy and assigns it to the GroupBy field. +func (o *CIAppPipelinesAggregateRequest) SetGroupBy(v []CIAppPipelinesGroupBy) { + o.GroupBy = v +} + +// GetOptions returns the Options field value if set, zero value otherwise. +func (o *CIAppPipelinesAggregateRequest) GetOptions() CIAppQueryOptions { + if o == nil || o.Options == nil { + var ret CIAppQueryOptions + return ret + } + return *o.Options +} + +// GetOptionsOk returns a tuple with the Options field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppPipelinesAggregateRequest) GetOptionsOk() (*CIAppQueryOptions, bool) { + if o == nil || o.Options == nil { + return nil, false + } + return o.Options, true +} + +// HasOptions returns a boolean if a field has been set. +func (o *CIAppPipelinesAggregateRequest) HasOptions() bool { + return o != nil && o.Options != nil +} + +// SetOptions gets a reference to the given CIAppQueryOptions and assigns it to the Options field. +func (o *CIAppPipelinesAggregateRequest) SetOptions(v CIAppQueryOptions) { + o.Options = &v +} + +// GetPage returns the Page field value if set, zero value otherwise. +func (o *CIAppPipelinesAggregateRequest) GetPage() CIAppQueryPageOptions { + if o == nil || o.Page == nil { + var ret CIAppQueryPageOptions + return ret + } + return *o.Page +} + +// GetPageOk returns a tuple with the Page field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppPipelinesAggregateRequest) GetPageOk() (*CIAppQueryPageOptions, bool) { + if o == nil || o.Page == nil { + return nil, false + } + return o.Page, true +} + +// HasPage returns a boolean if a field has been set. +func (o *CIAppPipelinesAggregateRequest) HasPage() bool { + return o != nil && o.Page != nil +} + +// SetPage gets a reference to the given CIAppQueryPageOptions and assigns it to the Page field. +func (o *CIAppPipelinesAggregateRequest) SetPage(v CIAppQueryPageOptions) { + o.Page = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CIAppPipelinesAggregateRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return json.Marshal(o.UnparsedObject) + } + if o.Compute != nil { + toSerialize["compute"] = o.Compute + } + if o.Filter != nil { + toSerialize["filter"] = o.Filter + } + if o.GroupBy != nil { + toSerialize["group_by"] = o.GroupBy + } + if o.Options != nil { + toSerialize["options"] = o.Options + } + if o.Page != nil { + toSerialize["page"] = o.Page + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CIAppPipelinesAggregateRequest) UnmarshalJSON(bytes []byte) (err error) { + raw := map[string]interface{}{} + all := struct { + Compute []CIAppCompute `json:"compute,omitempty"` + Filter *CIAppPipelinesQueryFilter `json:"filter,omitempty"` + GroupBy []CIAppPipelinesGroupBy `json:"group_by,omitempty"` + Options *CIAppQueryOptions `json:"options,omitempty"` + Page *CIAppQueryPageOptions `json:"page,omitempty"` + }{} + err = json.Unmarshal(bytes, &all) + if err != nil { + err = json.Unmarshal(bytes, &raw) + if err != nil { + return err + } + o.UnparsedObject = raw + return nil + } + o.Compute = all.Compute + if all.Filter != nil && all.Filter.UnparsedObject != nil && o.UnparsedObject == nil { + err = json.Unmarshal(bytes, &raw) + if err != nil { + return err + } + o.UnparsedObject = raw + } + o.Filter = all.Filter + o.GroupBy = all.GroupBy + if all.Options != nil && all.Options.UnparsedObject != nil && o.UnparsedObject == nil { + err = json.Unmarshal(bytes, &raw) + if err != nil { + return err + } + o.UnparsedObject = raw + } + o.Options = all.Options + if all.Page != nil && all.Page.UnparsedObject != nil && o.UnparsedObject == nil { + err = json.Unmarshal(bytes, &raw) + if err != nil { + return err + } + o.UnparsedObject = raw + } + o.Page = all.Page + return nil +} diff --git a/api/datadogV2/model_ci_app_pipelines_aggregation_buckets_response.go b/api/datadogV2/model_ci_app_pipelines_aggregation_buckets_response.go new file mode 100644 index 00000000000..ccf002d7126 --- /dev/null +++ b/api/datadogV2/model_ci_app_pipelines_aggregation_buckets_response.go @@ -0,0 +1,98 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "encoding/json" +) + +// CIAppPipelinesAggregationBucketsResponse The query results. +type CIAppPipelinesAggregationBucketsResponse struct { + // The list of matching buckets, one item per bucket. + Buckets []CIAppPipelinesBucketResponse `json:"buckets,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} +} + +// NewCIAppPipelinesAggregationBucketsResponse instantiates a new CIAppPipelinesAggregationBucketsResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCIAppPipelinesAggregationBucketsResponse() *CIAppPipelinesAggregationBucketsResponse { + this := CIAppPipelinesAggregationBucketsResponse{} + return &this +} + +// NewCIAppPipelinesAggregationBucketsResponseWithDefaults instantiates a new CIAppPipelinesAggregationBucketsResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCIAppPipelinesAggregationBucketsResponseWithDefaults() *CIAppPipelinesAggregationBucketsResponse { + this := CIAppPipelinesAggregationBucketsResponse{} + return &this +} + +// GetBuckets returns the Buckets field value if set, zero value otherwise. +func (o *CIAppPipelinesAggregationBucketsResponse) GetBuckets() []CIAppPipelinesBucketResponse { + if o == nil || o.Buckets == nil { + var ret []CIAppPipelinesBucketResponse + return ret + } + return o.Buckets +} + +// GetBucketsOk returns a tuple with the Buckets field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppPipelinesAggregationBucketsResponse) GetBucketsOk() (*[]CIAppPipelinesBucketResponse, bool) { + if o == nil || o.Buckets == nil { + return nil, false + } + return &o.Buckets, true +} + +// HasBuckets returns a boolean if a field has been set. +func (o *CIAppPipelinesAggregationBucketsResponse) HasBuckets() bool { + return o != nil && o.Buckets != nil +} + +// SetBuckets gets a reference to the given []CIAppPipelinesBucketResponse and assigns it to the Buckets field. +func (o *CIAppPipelinesAggregationBucketsResponse) SetBuckets(v []CIAppPipelinesBucketResponse) { + o.Buckets = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CIAppPipelinesAggregationBucketsResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return json.Marshal(o.UnparsedObject) + } + if o.Buckets != nil { + toSerialize["buckets"] = o.Buckets + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CIAppPipelinesAggregationBucketsResponse) UnmarshalJSON(bytes []byte) (err error) { + raw := map[string]interface{}{} + all := struct { + Buckets []CIAppPipelinesBucketResponse `json:"buckets,omitempty"` + }{} + err = json.Unmarshal(bytes, &all) + if err != nil { + err = json.Unmarshal(bytes, &raw) + if err != nil { + return err + } + o.UnparsedObject = raw + return nil + } + o.Buckets = all.Buckets + return nil +} diff --git a/api/datadogV2/model_ci_app_pipelines_analytics_aggregate_response.go b/api/datadogV2/model_ci_app_pipelines_analytics_aggregate_response.go new file mode 100644 index 00000000000..1600d4cf629 --- /dev/null +++ b/api/datadogV2/model_ci_app_pipelines_analytics_aggregate_response.go @@ -0,0 +1,189 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "encoding/json" +) + +// CIAppPipelinesAnalyticsAggregateResponse The response object for the pipeline events aggregate API endpoint. +type CIAppPipelinesAnalyticsAggregateResponse struct { + // The query results. + Data *CIAppPipelinesAggregationBucketsResponse `json:"data,omitempty"` + // Links attributes. + Links *CIAppResponseLinks `json:"links,omitempty"` + // The metadata associated with a request. + Meta *CIAppResponseMetadata `json:"meta,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} +} + +// NewCIAppPipelinesAnalyticsAggregateResponse instantiates a new CIAppPipelinesAnalyticsAggregateResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCIAppPipelinesAnalyticsAggregateResponse() *CIAppPipelinesAnalyticsAggregateResponse { + this := CIAppPipelinesAnalyticsAggregateResponse{} + return &this +} + +// NewCIAppPipelinesAnalyticsAggregateResponseWithDefaults instantiates a new CIAppPipelinesAnalyticsAggregateResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCIAppPipelinesAnalyticsAggregateResponseWithDefaults() *CIAppPipelinesAnalyticsAggregateResponse { + this := CIAppPipelinesAnalyticsAggregateResponse{} + return &this +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *CIAppPipelinesAnalyticsAggregateResponse) GetData() CIAppPipelinesAggregationBucketsResponse { + if o == nil || o.Data == nil { + var ret CIAppPipelinesAggregationBucketsResponse + return ret + } + return *o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppPipelinesAnalyticsAggregateResponse) GetDataOk() (*CIAppPipelinesAggregationBucketsResponse, bool) { + if o == nil || o.Data == nil { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *CIAppPipelinesAnalyticsAggregateResponse) HasData() bool { + return o != nil && o.Data != nil +} + +// SetData gets a reference to the given CIAppPipelinesAggregationBucketsResponse and assigns it to the Data field. +func (o *CIAppPipelinesAnalyticsAggregateResponse) SetData(v CIAppPipelinesAggregationBucketsResponse) { + o.Data = &v +} + +// GetLinks returns the Links field value if set, zero value otherwise. +func (o *CIAppPipelinesAnalyticsAggregateResponse) GetLinks() CIAppResponseLinks { + if o == nil || o.Links == nil { + var ret CIAppResponseLinks + return ret + } + return *o.Links +} + +// GetLinksOk returns a tuple with the Links field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppPipelinesAnalyticsAggregateResponse) GetLinksOk() (*CIAppResponseLinks, bool) { + if o == nil || o.Links == nil { + return nil, false + } + return o.Links, true +} + +// HasLinks returns a boolean if a field has been set. +func (o *CIAppPipelinesAnalyticsAggregateResponse) HasLinks() bool { + return o != nil && o.Links != nil +} + +// SetLinks gets a reference to the given CIAppResponseLinks and assigns it to the Links field. +func (o *CIAppPipelinesAnalyticsAggregateResponse) SetLinks(v CIAppResponseLinks) { + o.Links = &v +} + +// GetMeta returns the Meta field value if set, zero value otherwise. +func (o *CIAppPipelinesAnalyticsAggregateResponse) GetMeta() CIAppResponseMetadata { + if o == nil || o.Meta == nil { + var ret CIAppResponseMetadata + return ret + } + return *o.Meta +} + +// GetMetaOk returns a tuple with the Meta field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppPipelinesAnalyticsAggregateResponse) GetMetaOk() (*CIAppResponseMetadata, bool) { + if o == nil || o.Meta == nil { + return nil, false + } + return o.Meta, true +} + +// HasMeta returns a boolean if a field has been set. +func (o *CIAppPipelinesAnalyticsAggregateResponse) HasMeta() bool { + return o != nil && o.Meta != nil +} + +// SetMeta gets a reference to the given CIAppResponseMetadata and assigns it to the Meta field. +func (o *CIAppPipelinesAnalyticsAggregateResponse) SetMeta(v CIAppResponseMetadata) { + o.Meta = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CIAppPipelinesAnalyticsAggregateResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return json.Marshal(o.UnparsedObject) + } + if o.Data != nil { + toSerialize["data"] = o.Data + } + if o.Links != nil { + toSerialize["links"] = o.Links + } + if o.Meta != nil { + toSerialize["meta"] = o.Meta + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CIAppPipelinesAnalyticsAggregateResponse) UnmarshalJSON(bytes []byte) (err error) { + raw := map[string]interface{}{} + all := struct { + Data *CIAppPipelinesAggregationBucketsResponse `json:"data,omitempty"` + Links *CIAppResponseLinks `json:"links,omitempty"` + Meta *CIAppResponseMetadata `json:"meta,omitempty"` + }{} + err = json.Unmarshal(bytes, &all) + if err != nil { + err = json.Unmarshal(bytes, &raw) + if err != nil { + return err + } + o.UnparsedObject = raw + return nil + } + if all.Data != nil && all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + err = json.Unmarshal(bytes, &raw) + if err != nil { + return err + } + o.UnparsedObject = raw + } + o.Data = all.Data + if all.Links != nil && all.Links.UnparsedObject != nil && o.UnparsedObject == nil { + err = json.Unmarshal(bytes, &raw) + if err != nil { + return err + } + o.UnparsedObject = raw + } + o.Links = all.Links + if all.Meta != nil && all.Meta.UnparsedObject != nil && o.UnparsedObject == nil { + err = json.Unmarshal(bytes, &raw) + if err != nil { + return err + } + o.UnparsedObject = raw + } + o.Meta = all.Meta + return nil +} diff --git a/api/datadogV2/model_ci_app_pipelines_bucket_response.go b/api/datadogV2/model_ci_app_pipelines_bucket_response.go new file mode 100644 index 00000000000..d9c7281e13c --- /dev/null +++ b/api/datadogV2/model_ci_app_pipelines_bucket_response.go @@ -0,0 +1,133 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "encoding/json" +) + +// CIAppPipelinesBucketResponse Bucket values. +type CIAppPipelinesBucketResponse struct { + // The key-value pairs for each group-by. + By map[string]string `json:"by,omitempty"` + // A map of the metric name to value for regular compute, or a list of values for a timeseries. + Computes map[string]CIAppAggregateBucketValue `json:"computes,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} +} + +// NewCIAppPipelinesBucketResponse instantiates a new CIAppPipelinesBucketResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCIAppPipelinesBucketResponse() *CIAppPipelinesBucketResponse { + this := CIAppPipelinesBucketResponse{} + return &this +} + +// NewCIAppPipelinesBucketResponseWithDefaults instantiates a new CIAppPipelinesBucketResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCIAppPipelinesBucketResponseWithDefaults() *CIAppPipelinesBucketResponse { + this := CIAppPipelinesBucketResponse{} + return &this +} + +// GetBy returns the By field value if set, zero value otherwise. +func (o *CIAppPipelinesBucketResponse) GetBy() map[string]string { + if o == nil || o.By == nil { + var ret map[string]string + return ret + } + return o.By +} + +// GetByOk returns a tuple with the By field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppPipelinesBucketResponse) GetByOk() (*map[string]string, bool) { + if o == nil || o.By == nil { + return nil, false + } + return &o.By, true +} + +// HasBy returns a boolean if a field has been set. +func (o *CIAppPipelinesBucketResponse) HasBy() bool { + return o != nil && o.By != nil +} + +// SetBy gets a reference to the given map[string]string and assigns it to the By field. +func (o *CIAppPipelinesBucketResponse) SetBy(v map[string]string) { + o.By = v +} + +// GetComputes returns the Computes field value if set, zero value otherwise. +func (o *CIAppPipelinesBucketResponse) GetComputes() map[string]CIAppAggregateBucketValue { + if o == nil || o.Computes == nil { + var ret map[string]CIAppAggregateBucketValue + return ret + } + return o.Computes +} + +// GetComputesOk returns a tuple with the Computes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppPipelinesBucketResponse) GetComputesOk() (*map[string]CIAppAggregateBucketValue, bool) { + if o == nil || o.Computes == nil { + return nil, false + } + return &o.Computes, true +} + +// HasComputes returns a boolean if a field has been set. +func (o *CIAppPipelinesBucketResponse) HasComputes() bool { + return o != nil && o.Computes != nil +} + +// SetComputes gets a reference to the given map[string]CIAppAggregateBucketValue and assigns it to the Computes field. +func (o *CIAppPipelinesBucketResponse) SetComputes(v map[string]CIAppAggregateBucketValue) { + o.Computes = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CIAppPipelinesBucketResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return json.Marshal(o.UnparsedObject) + } + if o.By != nil { + toSerialize["by"] = o.By + } + if o.Computes != nil { + toSerialize["computes"] = o.Computes + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CIAppPipelinesBucketResponse) UnmarshalJSON(bytes []byte) (err error) { + raw := map[string]interface{}{} + all := struct { + By map[string]string `json:"by,omitempty"` + Computes map[string]CIAppAggregateBucketValue `json:"computes,omitempty"` + }{} + err = json.Unmarshal(bytes, &all) + if err != nil { + err = json.Unmarshal(bytes, &raw) + if err != nil { + return err + } + o.UnparsedObject = raw + return nil + } + o.By = all.By + o.Computes = all.Computes + return nil +} diff --git a/api/datadogV2/model_ci_app_pipelines_group_by.go b/api/datadogV2/model_ci_app_pipelines_group_by.go new file mode 100644 index 00000000000..b15ab8cc1c5 --- /dev/null +++ b/api/datadogV2/model_ci_app_pipelines_group_by.go @@ -0,0 +1,297 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "encoding/json" + "fmt" +) + +// CIAppPipelinesGroupBy A group-by rule. +type CIAppPipelinesGroupBy struct { + // The name of the facet to use (required). + Facet string `json:"facet"` + // Used to perform a histogram computation (only for measure facets). + // At most, 100 buckets are allowed, the number of buckets is `(max - min)/interval`. + Histogram *CIAppGroupByHistogram `json:"histogram,omitempty"` + // The maximum buckets to return for this group-by. + 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. + Sort *CIAppAggregateSort `json:"sort,omitempty"` + // A resulting object to put the given computes in over all the matching records. + Total *CIAppGroupByTotal `json:"total,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} +} + +// NewCIAppPipelinesGroupBy instantiates a new CIAppPipelinesGroupBy object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCIAppPipelinesGroupBy(facet string) *CIAppPipelinesGroupBy { + this := CIAppPipelinesGroupBy{} + this.Facet = facet + var limit int64 = 10 + this.Limit = &limit + return &this +} + +// NewCIAppPipelinesGroupByWithDefaults instantiates a new CIAppPipelinesGroupBy object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCIAppPipelinesGroupByWithDefaults() *CIAppPipelinesGroupBy { + this := CIAppPipelinesGroupBy{} + var limit int64 = 10 + this.Limit = &limit + return &this +} + +// GetFacet returns the Facet field value. +func (o *CIAppPipelinesGroupBy) GetFacet() string { + if o == nil { + var ret string + return ret + } + return o.Facet +} + +// GetFacetOk returns a tuple with the Facet field value +// and a boolean to check if the value has been set. +func (o *CIAppPipelinesGroupBy) GetFacetOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Facet, true +} + +// SetFacet sets field value. +func (o *CIAppPipelinesGroupBy) SetFacet(v string) { + o.Facet = v +} + +// GetHistogram returns the Histogram field value if set, zero value otherwise. +func (o *CIAppPipelinesGroupBy) GetHistogram() CIAppGroupByHistogram { + if o == nil || o.Histogram == nil { + var ret CIAppGroupByHistogram + return ret + } + return *o.Histogram +} + +// GetHistogramOk returns a tuple with the Histogram field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppPipelinesGroupBy) GetHistogramOk() (*CIAppGroupByHistogram, bool) { + if o == nil || o.Histogram == nil { + return nil, false + } + return o.Histogram, true +} + +// HasHistogram returns a boolean if a field has been set. +func (o *CIAppPipelinesGroupBy) HasHistogram() bool { + return o != nil && o.Histogram != nil +} + +// SetHistogram gets a reference to the given CIAppGroupByHistogram and assigns it to the Histogram field. +func (o *CIAppPipelinesGroupBy) SetHistogram(v CIAppGroupByHistogram) { + o.Histogram = &v +} + +// GetLimit returns the Limit field value if set, zero value otherwise. +func (o *CIAppPipelinesGroupBy) GetLimit() int64 { + if o == nil || o.Limit == nil { + var ret int64 + return ret + } + return *o.Limit +} + +// GetLimitOk returns a tuple with the Limit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppPipelinesGroupBy) GetLimitOk() (*int64, bool) { + if o == nil || o.Limit == nil { + return nil, false + } + return o.Limit, true +} + +// HasLimit returns a boolean if a field has been set. +func (o *CIAppPipelinesGroupBy) HasLimit() bool { + return o != nil && o.Limit != nil +} + +// SetLimit gets a reference to the given int64 and assigns it to the Limit field. +func (o *CIAppPipelinesGroupBy) SetLimit(v int64) { + o.Limit = &v +} + +// GetMissing returns the Missing field value if set, zero value otherwise. +func (o *CIAppPipelinesGroupBy) GetMissing() CIAppGroupByMissing { + if o == nil || o.Missing == nil { + var ret CIAppGroupByMissing + return ret + } + return *o.Missing +} + +// GetMissingOk returns a tuple with the Missing field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppPipelinesGroupBy) GetMissingOk() (*CIAppGroupByMissing, bool) { + if o == nil || o.Missing == nil { + return nil, false + } + return o.Missing, true +} + +// HasMissing returns a boolean if a field has been set. +func (o *CIAppPipelinesGroupBy) HasMissing() bool { + return o != nil && o.Missing != nil +} + +// SetMissing gets a reference to the given CIAppGroupByMissing and assigns it to the Missing field. +func (o *CIAppPipelinesGroupBy) SetMissing(v CIAppGroupByMissing) { + o.Missing = &v +} + +// GetSort returns the Sort field value if set, zero value otherwise. +func (o *CIAppPipelinesGroupBy) GetSort() CIAppAggregateSort { + if o == nil || o.Sort == nil { + var ret CIAppAggregateSort + return ret + } + return *o.Sort +} + +// GetSortOk returns a tuple with the Sort field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppPipelinesGroupBy) GetSortOk() (*CIAppAggregateSort, bool) { + if o == nil || o.Sort == nil { + return nil, false + } + return o.Sort, true +} + +// HasSort returns a boolean if a field has been set. +func (o *CIAppPipelinesGroupBy) HasSort() bool { + return o != nil && o.Sort != nil +} + +// SetSort gets a reference to the given CIAppAggregateSort and assigns it to the Sort field. +func (o *CIAppPipelinesGroupBy) SetSort(v CIAppAggregateSort) { + o.Sort = &v +} + +// GetTotal returns the Total field value if set, zero value otherwise. +func (o *CIAppPipelinesGroupBy) GetTotal() CIAppGroupByTotal { + if o == nil || o.Total == nil { + var ret CIAppGroupByTotal + return ret + } + return *o.Total +} + +// GetTotalOk returns a tuple with the Total field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppPipelinesGroupBy) GetTotalOk() (*CIAppGroupByTotal, bool) { + if o == nil || o.Total == nil { + return nil, false + } + return o.Total, true +} + +// HasTotal returns a boolean if a field has been set. +func (o *CIAppPipelinesGroupBy) HasTotal() bool { + return o != nil && o.Total != nil +} + +// SetTotal gets a reference to the given CIAppGroupByTotal and assigns it to the Total field. +func (o *CIAppPipelinesGroupBy) SetTotal(v CIAppGroupByTotal) { + o.Total = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CIAppPipelinesGroupBy) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return json.Marshal(o.UnparsedObject) + } + toSerialize["facet"] = o.Facet + if o.Histogram != nil { + toSerialize["histogram"] = o.Histogram + } + if o.Limit != nil { + toSerialize["limit"] = o.Limit + } + if o.Missing != nil { + toSerialize["missing"] = o.Missing + } + if o.Sort != nil { + toSerialize["sort"] = o.Sort + } + if o.Total != nil { + toSerialize["total"] = o.Total + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CIAppPipelinesGroupBy) UnmarshalJSON(bytes []byte) (err error) { + raw := map[string]interface{}{} + required := struct { + Facet *string `json:"facet"` + }{} + all := struct { + Facet string `json:"facet"` + Histogram *CIAppGroupByHistogram `json:"histogram,omitempty"` + Limit *int64 `json:"limit,omitempty"` + Missing *CIAppGroupByMissing `json:"missing,omitempty"` + Sort *CIAppAggregateSort `json:"sort,omitempty"` + Total *CIAppGroupByTotal `json:"total,omitempty"` + }{} + err = json.Unmarshal(bytes, &required) + if err != nil { + return err + } + if required.Facet == nil { + return fmt.Errorf("required field facet missing") + } + err = json.Unmarshal(bytes, &all) + if err != nil { + err = json.Unmarshal(bytes, &raw) + if err != nil { + return err + } + o.UnparsedObject = raw + return nil + } + o.Facet = all.Facet + if all.Histogram != nil && all.Histogram.UnparsedObject != nil && o.UnparsedObject == nil { + err = json.Unmarshal(bytes, &raw) + if err != nil { + return err + } + o.UnparsedObject = raw + } + o.Histogram = all.Histogram + o.Limit = all.Limit + o.Missing = all.Missing + if all.Sort != nil && all.Sort.UnparsedObject != nil && o.UnparsedObject == nil { + err = json.Unmarshal(bytes, &raw) + if err != nil { + return err + } + o.UnparsedObject = raw + } + o.Sort = all.Sort + o.Total = all.Total + return nil +} diff --git a/api/datadogV2/model_ci_app_pipelines_query_filter.go b/api/datadogV2/model_ci_app_pipelines_query_filter.go new file mode 100644 index 00000000000..7de27265afb --- /dev/null +++ b/api/datadogV2/model_ci_app_pipelines_query_filter.go @@ -0,0 +1,180 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "encoding/json" +) + +// CIAppPipelinesQueryFilter The search and filter query settings. +type CIAppPipelinesQueryFilter struct { + // The minimum time for the requested events; supports date, math, and regular timestamps (in milliseconds). + From *string `json:"from,omitempty"` + // The search query following the Log search syntax. + Query *string `json:"query,omitempty"` + // The maximum time for the requested events, supports date, math, and regular timestamps (in milliseconds). + To *string `json:"to,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} +} + +// NewCIAppPipelinesQueryFilter instantiates a new CIAppPipelinesQueryFilter object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCIAppPipelinesQueryFilter() *CIAppPipelinesQueryFilter { + this := CIAppPipelinesQueryFilter{} + var from string = "now-15m" + this.From = &from + var query string = "*" + this.Query = &query + var to string = "now" + this.To = &to + return &this +} + +// NewCIAppPipelinesQueryFilterWithDefaults instantiates a new CIAppPipelinesQueryFilter object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCIAppPipelinesQueryFilterWithDefaults() *CIAppPipelinesQueryFilter { + this := CIAppPipelinesQueryFilter{} + var from string = "now-15m" + this.From = &from + var query string = "*" + this.Query = &query + var to string = "now" + this.To = &to + return &this +} + +// GetFrom returns the From field value if set, zero value otherwise. +func (o *CIAppPipelinesQueryFilter) GetFrom() string { + if o == nil || o.From == nil { + var ret string + return ret + } + return *o.From +} + +// GetFromOk returns a tuple with the From field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppPipelinesQueryFilter) GetFromOk() (*string, bool) { + if o == nil || o.From == nil { + return nil, false + } + return o.From, true +} + +// HasFrom returns a boolean if a field has been set. +func (o *CIAppPipelinesQueryFilter) HasFrom() bool { + return o != nil && o.From != nil +} + +// SetFrom gets a reference to the given string and assigns it to the From field. +func (o *CIAppPipelinesQueryFilter) SetFrom(v string) { + o.From = &v +} + +// GetQuery returns the Query field value if set, zero value otherwise. +func (o *CIAppPipelinesQueryFilter) GetQuery() string { + if o == nil || o.Query == nil { + var ret string + return ret + } + return *o.Query +} + +// GetQueryOk returns a tuple with the Query field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppPipelinesQueryFilter) GetQueryOk() (*string, bool) { + if o == nil || o.Query == nil { + return nil, false + } + return o.Query, true +} + +// HasQuery returns a boolean if a field has been set. +func (o *CIAppPipelinesQueryFilter) HasQuery() bool { + return o != nil && o.Query != nil +} + +// SetQuery gets a reference to the given string and assigns it to the Query field. +func (o *CIAppPipelinesQueryFilter) SetQuery(v string) { + o.Query = &v +} + +// GetTo returns the To field value if set, zero value otherwise. +func (o *CIAppPipelinesQueryFilter) GetTo() string { + if o == nil || o.To == nil { + var ret string + return ret + } + return *o.To +} + +// GetToOk returns a tuple with the To field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppPipelinesQueryFilter) GetToOk() (*string, bool) { + if o == nil || o.To == nil { + return nil, false + } + return o.To, true +} + +// HasTo returns a boolean if a field has been set. +func (o *CIAppPipelinesQueryFilter) HasTo() bool { + return o != nil && o.To != nil +} + +// SetTo gets a reference to the given string and assigns it to the To field. +func (o *CIAppPipelinesQueryFilter) SetTo(v string) { + o.To = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CIAppPipelinesQueryFilter) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return json.Marshal(o.UnparsedObject) + } + if o.From != nil { + toSerialize["from"] = o.From + } + if o.Query != nil { + toSerialize["query"] = o.Query + } + if o.To != nil { + toSerialize["to"] = o.To + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CIAppPipelinesQueryFilter) UnmarshalJSON(bytes []byte) (err error) { + raw := map[string]interface{}{} + all := struct { + From *string `json:"from,omitempty"` + Query *string `json:"query,omitempty"` + To *string `json:"to,omitempty"` + }{} + err = json.Unmarshal(bytes, &all) + if err != nil { + err = json.Unmarshal(bytes, &raw) + if err != nil { + return err + } + o.UnparsedObject = raw + return nil + } + o.From = all.From + o.Query = all.Query + o.To = all.To + return nil +} diff --git a/api/datadogV2/model_ci_app_query_options.go b/api/datadogV2/model_ci_app_query_options.go new file mode 100644 index 00000000000..1c4fe2cddf8 --- /dev/null +++ b/api/datadogV2/model_ci_app_query_options.go @@ -0,0 +1,138 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "encoding/json" +) + +// CIAppQueryOptions Global query options that are used during the query. +// Only supply timezone or time offset, not both. Otherwise, the query fails. +type CIAppQueryOptions struct { + // The time offset (in seconds) to apply to the query. + TimeOffset *int64 `json:"time_offset,omitempty"` + // The timezone can be specified both as an offset, for example: "UTC+03:00". + Timezone *string `json:"timezone,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} +} + +// NewCIAppQueryOptions instantiates a new CIAppQueryOptions object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCIAppQueryOptions() *CIAppQueryOptions { + this := CIAppQueryOptions{} + var timezone string = "UTC" + this.Timezone = &timezone + return &this +} + +// NewCIAppQueryOptionsWithDefaults instantiates a new CIAppQueryOptions object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCIAppQueryOptionsWithDefaults() *CIAppQueryOptions { + this := CIAppQueryOptions{} + var timezone string = "UTC" + this.Timezone = &timezone + return &this +} + +// GetTimeOffset returns the TimeOffset field value if set, zero value otherwise. +func (o *CIAppQueryOptions) GetTimeOffset() int64 { + if o == nil || o.TimeOffset == nil { + var ret int64 + return ret + } + return *o.TimeOffset +} + +// GetTimeOffsetOk returns a tuple with the TimeOffset field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppQueryOptions) GetTimeOffsetOk() (*int64, bool) { + if o == nil || o.TimeOffset == nil { + return nil, false + } + return o.TimeOffset, true +} + +// HasTimeOffset returns a boolean if a field has been set. +func (o *CIAppQueryOptions) HasTimeOffset() bool { + return o != nil && o.TimeOffset != nil +} + +// SetTimeOffset gets a reference to the given int64 and assigns it to the TimeOffset field. +func (o *CIAppQueryOptions) SetTimeOffset(v int64) { + o.TimeOffset = &v +} + +// GetTimezone returns the Timezone field value if set, zero value otherwise. +func (o *CIAppQueryOptions) GetTimezone() string { + if o == nil || o.Timezone == nil { + var ret string + return ret + } + return *o.Timezone +} + +// GetTimezoneOk returns a tuple with the Timezone field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppQueryOptions) GetTimezoneOk() (*string, bool) { + if o == nil || o.Timezone == nil { + return nil, false + } + return o.Timezone, true +} + +// HasTimezone returns a boolean if a field has been set. +func (o *CIAppQueryOptions) HasTimezone() bool { + return o != nil && o.Timezone != nil +} + +// SetTimezone gets a reference to the given string and assigns it to the Timezone field. +func (o *CIAppQueryOptions) SetTimezone(v string) { + o.Timezone = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CIAppQueryOptions) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return json.Marshal(o.UnparsedObject) + } + if o.TimeOffset != nil { + toSerialize["time_offset"] = o.TimeOffset + } + if o.Timezone != nil { + toSerialize["timezone"] = o.Timezone + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CIAppQueryOptions) UnmarshalJSON(bytes []byte) (err error) { + raw := map[string]interface{}{} + all := struct { + TimeOffset *int64 `json:"time_offset,omitempty"` + Timezone *string `json:"timezone,omitempty"` + }{} + err = json.Unmarshal(bytes, &all) + if err != nil { + err = json.Unmarshal(bytes, &raw) + if err != nil { + return err + } + o.UnparsedObject = raw + return nil + } + o.TimeOffset = all.TimeOffset + o.Timezone = all.Timezone + return nil +} diff --git a/api/datadogV2/model_ci_app_query_page_options.go b/api/datadogV2/model_ci_app_query_page_options.go new file mode 100644 index 00000000000..7822d8dec02 --- /dev/null +++ b/api/datadogV2/model_ci_app_query_page_options.go @@ -0,0 +1,137 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "encoding/json" +) + +// CIAppQueryPageOptions Paging attributes for listing events. +type CIAppQueryPageOptions struct { + // List following results with a cursor provided in the previous query. + Cursor *string `json:"cursor,omitempty"` + // Maximum number of events in the response. + Limit *int32 `json:"limit,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} +} + +// NewCIAppQueryPageOptions instantiates a new CIAppQueryPageOptions object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCIAppQueryPageOptions() *CIAppQueryPageOptions { + this := CIAppQueryPageOptions{} + var limit int32 = 10 + this.Limit = &limit + return &this +} + +// NewCIAppQueryPageOptionsWithDefaults instantiates a new CIAppQueryPageOptions object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCIAppQueryPageOptionsWithDefaults() *CIAppQueryPageOptions { + this := CIAppQueryPageOptions{} + var limit int32 = 10 + this.Limit = &limit + return &this +} + +// GetCursor returns the Cursor field value if set, zero value otherwise. +func (o *CIAppQueryPageOptions) GetCursor() string { + if o == nil || o.Cursor == nil { + var ret string + return ret + } + return *o.Cursor +} + +// GetCursorOk returns a tuple with the Cursor field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppQueryPageOptions) GetCursorOk() (*string, bool) { + if o == nil || o.Cursor == nil { + return nil, false + } + return o.Cursor, true +} + +// HasCursor returns a boolean if a field has been set. +func (o *CIAppQueryPageOptions) HasCursor() bool { + return o != nil && o.Cursor != nil +} + +// SetCursor gets a reference to the given string and assigns it to the Cursor field. +func (o *CIAppQueryPageOptions) SetCursor(v string) { + o.Cursor = &v +} + +// GetLimit returns the Limit field value if set, zero value otherwise. +func (o *CIAppQueryPageOptions) GetLimit() int32 { + if o == nil || o.Limit == nil { + var ret int32 + return ret + } + return *o.Limit +} + +// GetLimitOk returns a tuple with the Limit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppQueryPageOptions) GetLimitOk() (*int32, bool) { + if o == nil || o.Limit == nil { + return nil, false + } + return o.Limit, true +} + +// HasLimit returns a boolean if a field has been set. +func (o *CIAppQueryPageOptions) HasLimit() bool { + return o != nil && o.Limit != nil +} + +// SetLimit gets a reference to the given int32 and assigns it to the Limit field. +func (o *CIAppQueryPageOptions) SetLimit(v int32) { + o.Limit = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CIAppQueryPageOptions) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return json.Marshal(o.UnparsedObject) + } + if o.Cursor != nil { + toSerialize["cursor"] = o.Cursor + } + if o.Limit != nil { + toSerialize["limit"] = o.Limit + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CIAppQueryPageOptions) UnmarshalJSON(bytes []byte) (err error) { + raw := map[string]interface{}{} + all := struct { + Cursor *string `json:"cursor,omitempty"` + Limit *int32 `json:"limit,omitempty"` + }{} + err = json.Unmarshal(bytes, &all) + if err != nil { + err = json.Unmarshal(bytes, &raw) + if err != nil { + return err + } + o.UnparsedObject = raw + return nil + } + o.Cursor = all.Cursor + o.Limit = all.Limit + return nil +} diff --git a/api/datadogV2/model_ci_app_response_links.go b/api/datadogV2/model_ci_app_response_links.go new file mode 100644 index 00000000000..5f154237bd4 --- /dev/null +++ b/api/datadogV2/model_ci_app_response_links.go @@ -0,0 +1,99 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "encoding/json" +) + +// CIAppResponseLinks Links attributes. +type CIAppResponseLinks struct { + // Link for the next set of results. The request can also be made using the + // POST endpoint. + Next *string `json:"next,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} +} + +// NewCIAppResponseLinks instantiates a new CIAppResponseLinks object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCIAppResponseLinks() *CIAppResponseLinks { + this := CIAppResponseLinks{} + return &this +} + +// NewCIAppResponseLinksWithDefaults instantiates a new CIAppResponseLinks object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCIAppResponseLinksWithDefaults() *CIAppResponseLinks { + this := CIAppResponseLinks{} + return &this +} + +// GetNext returns the Next field value if set, zero value otherwise. +func (o *CIAppResponseLinks) GetNext() string { + if o == nil || o.Next == nil { + var ret string + return ret + } + return *o.Next +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppResponseLinks) GetNextOk() (*string, bool) { + if o == nil || o.Next == nil { + return nil, false + } + return o.Next, true +} + +// HasNext returns a boolean if a field has been set. +func (o *CIAppResponseLinks) HasNext() bool { + return o != nil && o.Next != nil +} + +// SetNext gets a reference to the given string and assigns it to the Next field. +func (o *CIAppResponseLinks) SetNext(v string) { + o.Next = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CIAppResponseLinks) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return json.Marshal(o.UnparsedObject) + } + if o.Next != nil { + toSerialize["next"] = o.Next + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CIAppResponseLinks) UnmarshalJSON(bytes []byte) (err error) { + raw := map[string]interface{}{} + all := struct { + Next *string `json:"next,omitempty"` + }{} + err = json.Unmarshal(bytes, &all) + if err != nil { + err = json.Unmarshal(bytes, &raw) + if err != nil { + return err + } + o.UnparsedObject = raw + return nil + } + o.Next = all.Next + return nil +} diff --git a/api/datadogV2/model_ci_app_response_metadata.go b/api/datadogV2/model_ci_app_response_metadata.go new file mode 100644 index 00000000000..0000c1e29e3 --- /dev/null +++ b/api/datadogV2/model_ci_app_response_metadata.go @@ -0,0 +1,254 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "encoding/json" +) + +// CIAppResponseMetadata The metadata associated with a request. +type CIAppResponseMetadata struct { + // The time elapsed in milliseconds. + Elapsed *int64 `json:"elapsed,omitempty"` + // Paging attributes. + Page *CIAppResponsePage `json:"page,omitempty"` + // The identifier of the request. + RequestId *string `json:"request_id,omitempty"` + // The status of the response. + Status *CIAppResponseStatus `json:"status,omitempty"` + // A list of warnings (non-fatal errors) encountered. Partial results may return if + // warnings are present in the response. + Warnings []CIAppWarning `json:"warnings,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} +} + +// NewCIAppResponseMetadata instantiates a new CIAppResponseMetadata object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCIAppResponseMetadata() *CIAppResponseMetadata { + this := CIAppResponseMetadata{} + return &this +} + +// NewCIAppResponseMetadataWithDefaults instantiates a new CIAppResponseMetadata object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCIAppResponseMetadataWithDefaults() *CIAppResponseMetadata { + this := CIAppResponseMetadata{} + return &this +} + +// GetElapsed returns the Elapsed field value if set, zero value otherwise. +func (o *CIAppResponseMetadata) GetElapsed() int64 { + if o == nil || o.Elapsed == nil { + var ret int64 + return ret + } + return *o.Elapsed +} + +// GetElapsedOk returns a tuple with the Elapsed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppResponseMetadata) GetElapsedOk() (*int64, bool) { + if o == nil || o.Elapsed == nil { + return nil, false + } + return o.Elapsed, true +} + +// HasElapsed returns a boolean if a field has been set. +func (o *CIAppResponseMetadata) HasElapsed() bool { + return o != nil && o.Elapsed != nil +} + +// SetElapsed gets a reference to the given int64 and assigns it to the Elapsed field. +func (o *CIAppResponseMetadata) SetElapsed(v int64) { + o.Elapsed = &v +} + +// GetPage returns the Page field value if set, zero value otherwise. +func (o *CIAppResponseMetadata) GetPage() CIAppResponsePage { + if o == nil || o.Page == nil { + var ret CIAppResponsePage + return ret + } + return *o.Page +} + +// GetPageOk returns a tuple with the Page field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppResponseMetadata) GetPageOk() (*CIAppResponsePage, bool) { + if o == nil || o.Page == nil { + return nil, false + } + return o.Page, true +} + +// HasPage returns a boolean if a field has been set. +func (o *CIAppResponseMetadata) HasPage() bool { + return o != nil && o.Page != nil +} + +// SetPage gets a reference to the given CIAppResponsePage and assigns it to the Page field. +func (o *CIAppResponseMetadata) SetPage(v CIAppResponsePage) { + o.Page = &v +} + +// GetRequestId returns the RequestId field value if set, zero value otherwise. +func (o *CIAppResponseMetadata) GetRequestId() string { + if o == nil || o.RequestId == nil { + var ret string + return ret + } + return *o.RequestId +} + +// GetRequestIdOk returns a tuple with the RequestId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppResponseMetadata) GetRequestIdOk() (*string, bool) { + if o == nil || o.RequestId == nil { + return nil, false + } + return o.RequestId, true +} + +// HasRequestId returns a boolean if a field has been set. +func (o *CIAppResponseMetadata) HasRequestId() bool { + return o != nil && o.RequestId != nil +} + +// SetRequestId gets a reference to the given string and assigns it to the RequestId field. +func (o *CIAppResponseMetadata) SetRequestId(v string) { + o.RequestId = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *CIAppResponseMetadata) GetStatus() CIAppResponseStatus { + if o == nil || o.Status == nil { + var ret CIAppResponseStatus + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppResponseMetadata) GetStatusOk() (*CIAppResponseStatus, bool) { + if o == nil || o.Status == nil { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *CIAppResponseMetadata) HasStatus() bool { + return o != nil && o.Status != nil +} + +// SetStatus gets a reference to the given CIAppResponseStatus and assigns it to the Status field. +func (o *CIAppResponseMetadata) SetStatus(v CIAppResponseStatus) { + o.Status = &v +} + +// GetWarnings returns the Warnings field value if set, zero value otherwise. +func (o *CIAppResponseMetadata) GetWarnings() []CIAppWarning { + if o == nil || o.Warnings == nil { + var ret []CIAppWarning + return ret + } + return o.Warnings +} + +// GetWarningsOk returns a tuple with the Warnings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppResponseMetadata) GetWarningsOk() (*[]CIAppWarning, bool) { + if o == nil || o.Warnings == nil { + return nil, false + } + return &o.Warnings, true +} + +// HasWarnings returns a boolean if a field has been set. +func (o *CIAppResponseMetadata) HasWarnings() bool { + return o != nil && o.Warnings != nil +} + +// SetWarnings gets a reference to the given []CIAppWarning and assigns it to the Warnings field. +func (o *CIAppResponseMetadata) SetWarnings(v []CIAppWarning) { + o.Warnings = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CIAppResponseMetadata) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return json.Marshal(o.UnparsedObject) + } + if o.Elapsed != nil { + toSerialize["elapsed"] = o.Elapsed + } + if o.Page != nil { + toSerialize["page"] = o.Page + } + if o.RequestId != nil { + toSerialize["request_id"] = o.RequestId + } + if o.Status != nil { + toSerialize["status"] = o.Status + } + if o.Warnings != nil { + toSerialize["warnings"] = o.Warnings + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CIAppResponseMetadata) UnmarshalJSON(bytes []byte) (err error) { + raw := map[string]interface{}{} + all := struct { + Elapsed *int64 `json:"elapsed,omitempty"` + Page *CIAppResponsePage `json:"page,omitempty"` + RequestId *string `json:"request_id,omitempty"` + Status *CIAppResponseStatus `json:"status,omitempty"` + Warnings []CIAppWarning `json:"warnings,omitempty"` + }{} + err = json.Unmarshal(bytes, &all) + if err != nil { + err = json.Unmarshal(bytes, &raw) + if err != nil { + return err + } + o.UnparsedObject = raw + return nil + } + if v := all.Status; v != nil && !v.IsValid() { + err = json.Unmarshal(bytes, &raw) + if err != nil { + return err + } + o.UnparsedObject = raw + return nil + } + o.Elapsed = all.Elapsed + if all.Page != nil && all.Page.UnparsedObject != nil && o.UnparsedObject == nil { + err = json.Unmarshal(bytes, &raw) + if err != nil { + return err + } + o.UnparsedObject = raw + } + o.Page = all.Page + o.RequestId = all.RequestId + o.Status = all.Status + o.Warnings = all.Warnings + return nil +} diff --git a/api/datadogV2/model_ci_app_response_page.go b/api/datadogV2/model_ci_app_response_page.go new file mode 100644 index 00000000000..6ad798f4799 --- /dev/null +++ b/api/datadogV2/model_ci_app_response_page.go @@ -0,0 +1,98 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "encoding/json" +) + +// CIAppResponsePage Paging attributes. +type CIAppResponsePage struct { + // The cursor to use to get the next results, if any. To make the next request, use the same parameters with the addition of `page[cursor]`. + After *string `json:"after,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} +} + +// NewCIAppResponsePage instantiates a new CIAppResponsePage object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCIAppResponsePage() *CIAppResponsePage { + this := CIAppResponsePage{} + return &this +} + +// NewCIAppResponsePageWithDefaults instantiates a new CIAppResponsePage object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCIAppResponsePageWithDefaults() *CIAppResponsePage { + this := CIAppResponsePage{} + return &this +} + +// GetAfter returns the After field value if set, zero value otherwise. +func (o *CIAppResponsePage) GetAfter() string { + if o == nil || o.After == nil { + var ret string + return ret + } + return *o.After +} + +// GetAfterOk returns a tuple with the After field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppResponsePage) GetAfterOk() (*string, bool) { + if o == nil || o.After == nil { + return nil, false + } + return o.After, true +} + +// HasAfter returns a boolean if a field has been set. +func (o *CIAppResponsePage) HasAfter() bool { + return o != nil && o.After != nil +} + +// SetAfter gets a reference to the given string and assigns it to the After field. +func (o *CIAppResponsePage) SetAfter(v string) { + o.After = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CIAppResponsePage) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return json.Marshal(o.UnparsedObject) + } + if o.After != nil { + toSerialize["after"] = o.After + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CIAppResponsePage) UnmarshalJSON(bytes []byte) (err error) { + raw := map[string]interface{}{} + all := struct { + After *string `json:"after,omitempty"` + }{} + err = json.Unmarshal(bytes, &all) + if err != nil { + err = json.Unmarshal(bytes, &raw) + if err != nil { + return err + } + o.UnparsedObject = raw + return nil + } + o.After = all.After + return nil +} diff --git a/api/datadogV2/model_ci_app_response_status.go b/api/datadogV2/model_ci_app_response_status.go new file mode 100644 index 00000000000..b6ac14c1f42 --- /dev/null +++ b/api/datadogV2/model_ci_app_response_status.go @@ -0,0 +1,109 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "encoding/json" + "fmt" +) + +// CIAppResponseStatus The status of the response. +type CIAppResponseStatus string + +// List of CIAppResponseStatus. +const ( + CIAPPRESPONSESTATUS_DONE CIAppResponseStatus = "done" + CIAPPRESPONSESTATUS_TIMEOUT CIAppResponseStatus = "timeout" +) + +var allowedCIAppResponseStatusEnumValues = []CIAppResponseStatus{ + CIAPPRESPONSESTATUS_DONE, + CIAPPRESPONSESTATUS_TIMEOUT, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *CIAppResponseStatus) GetAllowedValues() []CIAppResponseStatus { + return allowedCIAppResponseStatusEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *CIAppResponseStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + *v = CIAppResponseStatus(value) + return nil +} + +// NewCIAppResponseStatusFromValue returns a pointer to a valid CIAppResponseStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewCIAppResponseStatusFromValue(v string) (*CIAppResponseStatus, error) { + ev := CIAppResponseStatus(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for CIAppResponseStatus: valid values are %v", v, allowedCIAppResponseStatusEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v CIAppResponseStatus) IsValid() bool { + for _, existing := range allowedCIAppResponseStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CIAppResponseStatus value. +func (v CIAppResponseStatus) Ptr() *CIAppResponseStatus { + return &v +} + +// NullableCIAppResponseStatus handles when a null is used for CIAppResponseStatus. +type NullableCIAppResponseStatus struct { + value *CIAppResponseStatus + isSet bool +} + +// Get returns the associated value. +func (v NullableCIAppResponseStatus) Get() *CIAppResponseStatus { + return v.value +} + +// Set changes the value and indicates it's been called. +func (v *NullableCIAppResponseStatus) Set(val *CIAppResponseStatus) { + v.value = val + v.isSet = true +} + +// IsSet returns whether Set has been called. +func (v NullableCIAppResponseStatus) IsSet() bool { + return v.isSet +} + +// Unset sets the value to nil and resets the set flag. +func (v *NullableCIAppResponseStatus) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableCIAppResponseStatus initializes the struct as if Set has been called. +func NewNullableCIAppResponseStatus(val *CIAppResponseStatus) *NullableCIAppResponseStatus { + return &NullableCIAppResponseStatus{value: val, isSet: true} +} + +// MarshalJSON serializes the associated value. +func (v NullableCIAppResponseStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// UnmarshalJSON deserializes the payload and sets the flag as if Set has been called. +func (v *NullableCIAppResponseStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/api/datadogV2/model_ci_app_sort.go b/api/datadogV2/model_ci_app_sort.go new file mode 100644 index 00000000000..e664c1c481a --- /dev/null +++ b/api/datadogV2/model_ci_app_sort.go @@ -0,0 +1,109 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "encoding/json" + "fmt" +) + +// CIAppSort Sort parameters when querying events. +type CIAppSort string + +// List of CIAppSort. +const ( + CIAPPSORT_TIMESTAMP_ASCENDING CIAppSort = "timestamp" + CIAPPSORT_TIMESTAMP_DESCENDING CIAppSort = "-timestamp" +) + +var allowedCIAppSortEnumValues = []CIAppSort{ + CIAPPSORT_TIMESTAMP_ASCENDING, + CIAPPSORT_TIMESTAMP_DESCENDING, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *CIAppSort) GetAllowedValues() []CIAppSort { + return allowedCIAppSortEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *CIAppSort) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + *v = CIAppSort(value) + return nil +} + +// NewCIAppSortFromValue returns a pointer to a valid CIAppSort +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewCIAppSortFromValue(v string) (*CIAppSort, error) { + ev := CIAppSort(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for CIAppSort: valid values are %v", v, allowedCIAppSortEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v CIAppSort) IsValid() bool { + for _, existing := range allowedCIAppSortEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CIAppSort value. +func (v CIAppSort) Ptr() *CIAppSort { + return &v +} + +// NullableCIAppSort handles when a null is used for CIAppSort. +type NullableCIAppSort struct { + value *CIAppSort + isSet bool +} + +// Get returns the associated value. +func (v NullableCIAppSort) Get() *CIAppSort { + return v.value +} + +// Set changes the value and indicates it's been called. +func (v *NullableCIAppSort) Set(val *CIAppSort) { + v.value = val + v.isSet = true +} + +// IsSet returns whether Set has been called. +func (v NullableCIAppSort) IsSet() bool { + return v.isSet +} + +// Unset sets the value to nil and resets the set flag. +func (v *NullableCIAppSort) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableCIAppSort initializes the struct as if Set has been called. +func NewNullableCIAppSort(val *CIAppSort) *NullableCIAppSort { + return &NullableCIAppSort{value: val, isSet: true} +} + +// MarshalJSON serializes the associated value. +func (v NullableCIAppSort) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// UnmarshalJSON deserializes the payload and sets the flag as if Set has been called. +func (v *NullableCIAppSort) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/api/datadogV2/model_ci_app_sort_order.go b/api/datadogV2/model_ci_app_sort_order.go new file mode 100644 index 00000000000..32ab6142401 --- /dev/null +++ b/api/datadogV2/model_ci_app_sort_order.go @@ -0,0 +1,109 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "encoding/json" + "fmt" +) + +// CIAppSortOrder The order to use, ascending or descending. +type CIAppSortOrder string + +// List of CIAppSortOrder. +const ( + CIAPPSORTORDER_ASCENDING CIAppSortOrder = "asc" + CIAPPSORTORDER_DESCENDING CIAppSortOrder = "desc" +) + +var allowedCIAppSortOrderEnumValues = []CIAppSortOrder{ + CIAPPSORTORDER_ASCENDING, + CIAPPSORTORDER_DESCENDING, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *CIAppSortOrder) GetAllowedValues() []CIAppSortOrder { + return allowedCIAppSortOrderEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *CIAppSortOrder) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + *v = CIAppSortOrder(value) + return nil +} + +// NewCIAppSortOrderFromValue returns a pointer to a valid CIAppSortOrder +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewCIAppSortOrderFromValue(v string) (*CIAppSortOrder, error) { + ev := CIAppSortOrder(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for CIAppSortOrder: valid values are %v", v, allowedCIAppSortOrderEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v CIAppSortOrder) IsValid() bool { + for _, existing := range allowedCIAppSortOrderEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CIAppSortOrder value. +func (v CIAppSortOrder) Ptr() *CIAppSortOrder { + return &v +} + +// NullableCIAppSortOrder handles when a null is used for CIAppSortOrder. +type NullableCIAppSortOrder struct { + value *CIAppSortOrder + isSet bool +} + +// Get returns the associated value. +func (v NullableCIAppSortOrder) Get() *CIAppSortOrder { + return v.value +} + +// Set changes the value and indicates it's been called. +func (v *NullableCIAppSortOrder) Set(val *CIAppSortOrder) { + v.value = val + v.isSet = true +} + +// IsSet returns whether Set has been called. +func (v NullableCIAppSortOrder) IsSet() bool { + return v.isSet +} + +// Unset sets the value to nil and resets the set flag. +func (v *NullableCIAppSortOrder) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableCIAppSortOrder initializes the struct as if Set has been called. +func NewNullableCIAppSortOrder(val *CIAppSortOrder) *NullableCIAppSortOrder { + return &NullableCIAppSortOrder{value: val, isSet: true} +} + +// MarshalJSON serializes the associated value. +func (v NullableCIAppSortOrder) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// UnmarshalJSON deserializes the payload and sets the flag as if Set has been called. +func (v *NullableCIAppSortOrder) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/api/datadogV2/model_ci_app_test_event.go b/api/datadogV2/model_ci_app_test_event.go new file mode 100644 index 00000000000..32ef37781c9 --- /dev/null +++ b/api/datadogV2/model_ci_app_test_event.go @@ -0,0 +1,183 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "encoding/json" +) + +// CIAppTestEvent Object description of test event after being processed and stored by Datadog. +type CIAppTestEvent struct { + // JSON object containing all event attributes and their associated values. + Attributes *CIAppEventAttributes `json:"attributes,omitempty"` + // Unique ID of the event. + Id *string `json:"id,omitempty"` + // Type of the event. + Type *CIAppTestEventTypeName `json:"type,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} +} + +// NewCIAppTestEvent instantiates a new CIAppTestEvent object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCIAppTestEvent() *CIAppTestEvent { + this := CIAppTestEvent{} + return &this +} + +// NewCIAppTestEventWithDefaults instantiates a new CIAppTestEvent object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCIAppTestEventWithDefaults() *CIAppTestEvent { + this := CIAppTestEvent{} + return &this +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *CIAppTestEvent) GetAttributes() CIAppEventAttributes { + if o == nil || o.Attributes == nil { + var ret CIAppEventAttributes + return ret + } + return *o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppTestEvent) GetAttributesOk() (*CIAppEventAttributes, bool) { + if o == nil || o.Attributes == nil { + return nil, false + } + return o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *CIAppTestEvent) HasAttributes() bool { + return o != nil && o.Attributes != nil +} + +// SetAttributes gets a reference to the given CIAppEventAttributes and assigns it to the Attributes field. +func (o *CIAppTestEvent) SetAttributes(v CIAppEventAttributes) { + o.Attributes = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *CIAppTestEvent) GetId() string { + if o == nil || o.Id == nil { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppTestEvent) GetIdOk() (*string, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *CIAppTestEvent) HasId() bool { + return o != nil && o.Id != nil +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *CIAppTestEvent) SetId(v string) { + o.Id = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *CIAppTestEvent) GetType() CIAppTestEventTypeName { + if o == nil || o.Type == nil { + var ret CIAppTestEventTypeName + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppTestEvent) GetTypeOk() (*CIAppTestEventTypeName, bool) { + if o == nil || o.Type == nil { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *CIAppTestEvent) HasType() bool { + return o != nil && o.Type != nil +} + +// SetType gets a reference to the given CIAppTestEventTypeName and assigns it to the Type field. +func (o *CIAppTestEvent) SetType(v CIAppTestEventTypeName) { + o.Type = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CIAppTestEvent) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return json.Marshal(o.UnparsedObject) + } + if o.Attributes != nil { + toSerialize["attributes"] = o.Attributes + } + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CIAppTestEvent) UnmarshalJSON(bytes []byte) (err error) { + raw := map[string]interface{}{} + all := struct { + Attributes *CIAppEventAttributes `json:"attributes,omitempty"` + Id *string `json:"id,omitempty"` + Type *CIAppTestEventTypeName `json:"type,omitempty"` + }{} + err = json.Unmarshal(bytes, &all) + if err != nil { + err = json.Unmarshal(bytes, &raw) + if err != nil { + return err + } + o.UnparsedObject = raw + return nil + } + if v := all.Type; v != nil && !v.IsValid() { + err = json.Unmarshal(bytes, &raw) + if err != nil { + return err + } + o.UnparsedObject = raw + return nil + } + if all.Attributes != nil && all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + err = json.Unmarshal(bytes, &raw) + if err != nil { + return err + } + o.UnparsedObject = raw + } + o.Attributes = all.Attributes + o.Id = all.Id + o.Type = all.Type + return nil +} diff --git a/api/datadogV2/model_ci_app_test_event_type_name.go b/api/datadogV2/model_ci_app_test_event_type_name.go new file mode 100644 index 00000000000..e1b6fa7b12f --- /dev/null +++ b/api/datadogV2/model_ci_app_test_event_type_name.go @@ -0,0 +1,107 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "encoding/json" + "fmt" +) + +// CIAppTestEventTypeName Type of the event. +type CIAppTestEventTypeName string + +// List of CIAppTestEventTypeName. +const ( + CIAPPTESTEVENTTYPENAME_citest CIAppTestEventTypeName = "citest" +) + +var allowedCIAppTestEventTypeNameEnumValues = []CIAppTestEventTypeName{ + CIAPPTESTEVENTTYPENAME_citest, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *CIAppTestEventTypeName) GetAllowedValues() []CIAppTestEventTypeName { + return allowedCIAppTestEventTypeNameEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *CIAppTestEventTypeName) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + *v = CIAppTestEventTypeName(value) + return nil +} + +// NewCIAppTestEventTypeNameFromValue returns a pointer to a valid CIAppTestEventTypeName +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewCIAppTestEventTypeNameFromValue(v string) (*CIAppTestEventTypeName, error) { + ev := CIAppTestEventTypeName(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for CIAppTestEventTypeName: valid values are %v", v, allowedCIAppTestEventTypeNameEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v CIAppTestEventTypeName) IsValid() bool { + for _, existing := range allowedCIAppTestEventTypeNameEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CIAppTestEventTypeName value. +func (v CIAppTestEventTypeName) Ptr() *CIAppTestEventTypeName { + return &v +} + +// NullableCIAppTestEventTypeName handles when a null is used for CIAppTestEventTypeName. +type NullableCIAppTestEventTypeName struct { + value *CIAppTestEventTypeName + isSet bool +} + +// Get returns the associated value. +func (v NullableCIAppTestEventTypeName) Get() *CIAppTestEventTypeName { + return v.value +} + +// Set changes the value and indicates it's been called. +func (v *NullableCIAppTestEventTypeName) Set(val *CIAppTestEventTypeName) { + v.value = val + v.isSet = true +} + +// IsSet returns whether Set has been called. +func (v NullableCIAppTestEventTypeName) IsSet() bool { + return v.isSet +} + +// Unset sets the value to nil and resets the set flag. +func (v *NullableCIAppTestEventTypeName) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableCIAppTestEventTypeName initializes the struct as if Set has been called. +func NewNullableCIAppTestEventTypeName(val *CIAppTestEventTypeName) *NullableCIAppTestEventTypeName { + return &NullableCIAppTestEventTypeName{value: val, isSet: true} +} + +// MarshalJSON serializes the associated value. +func (v NullableCIAppTestEventTypeName) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// UnmarshalJSON deserializes the payload and sets the flag as if Set has been called. +func (v *NullableCIAppTestEventTypeName) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/api/datadogV2/model_ci_app_test_events_request.go b/api/datadogV2/model_ci_app_test_events_request.go new file mode 100644 index 00000000000..2bcb2ec015d --- /dev/null +++ b/api/datadogV2/model_ci_app_test_events_request.go @@ -0,0 +1,233 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "encoding/json" +) + +// CIAppTestEventsRequest The request for a tests search. +type CIAppTestEventsRequest struct { + // The search and filter query settings. + Filter *CIAppTestsQueryFilter `json:"filter,omitempty"` + // Global query options that are used during the query. + // Only supply timezone or time offset, not both. Otherwise, the query fails. + Options *CIAppQueryOptions `json:"options,omitempty"` + // Paging attributes for listing events. + Page *CIAppQueryPageOptions `json:"page,omitempty"` + // Sort parameters when querying events. + Sort *CIAppSort `json:"sort,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} +} + +// NewCIAppTestEventsRequest instantiates a new CIAppTestEventsRequest object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCIAppTestEventsRequest() *CIAppTestEventsRequest { + this := CIAppTestEventsRequest{} + return &this +} + +// NewCIAppTestEventsRequestWithDefaults instantiates a new CIAppTestEventsRequest object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCIAppTestEventsRequestWithDefaults() *CIAppTestEventsRequest { + this := CIAppTestEventsRequest{} + return &this +} + +// GetFilter returns the Filter field value if set, zero value otherwise. +func (o *CIAppTestEventsRequest) GetFilter() CIAppTestsQueryFilter { + if o == nil || o.Filter == nil { + var ret CIAppTestsQueryFilter + return ret + } + return *o.Filter +} + +// GetFilterOk returns a tuple with the Filter field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppTestEventsRequest) GetFilterOk() (*CIAppTestsQueryFilter, bool) { + if o == nil || o.Filter == nil { + return nil, false + } + return o.Filter, true +} + +// HasFilter returns a boolean if a field has been set. +func (o *CIAppTestEventsRequest) HasFilter() bool { + return o != nil && o.Filter != nil +} + +// SetFilter gets a reference to the given CIAppTestsQueryFilter and assigns it to the Filter field. +func (o *CIAppTestEventsRequest) SetFilter(v CIAppTestsQueryFilter) { + o.Filter = &v +} + +// GetOptions returns the Options field value if set, zero value otherwise. +func (o *CIAppTestEventsRequest) GetOptions() CIAppQueryOptions { + if o == nil || o.Options == nil { + var ret CIAppQueryOptions + return ret + } + return *o.Options +} + +// GetOptionsOk returns a tuple with the Options field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppTestEventsRequest) GetOptionsOk() (*CIAppQueryOptions, bool) { + if o == nil || o.Options == nil { + return nil, false + } + return o.Options, true +} + +// HasOptions returns a boolean if a field has been set. +func (o *CIAppTestEventsRequest) HasOptions() bool { + return o != nil && o.Options != nil +} + +// SetOptions gets a reference to the given CIAppQueryOptions and assigns it to the Options field. +func (o *CIAppTestEventsRequest) SetOptions(v CIAppQueryOptions) { + o.Options = &v +} + +// GetPage returns the Page field value if set, zero value otherwise. +func (o *CIAppTestEventsRequest) GetPage() CIAppQueryPageOptions { + if o == nil || o.Page == nil { + var ret CIAppQueryPageOptions + return ret + } + return *o.Page +} + +// GetPageOk returns a tuple with the Page field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppTestEventsRequest) GetPageOk() (*CIAppQueryPageOptions, bool) { + if o == nil || o.Page == nil { + return nil, false + } + return o.Page, true +} + +// HasPage returns a boolean if a field has been set. +func (o *CIAppTestEventsRequest) HasPage() bool { + return o != nil && o.Page != nil +} + +// SetPage gets a reference to the given CIAppQueryPageOptions and assigns it to the Page field. +func (o *CIAppTestEventsRequest) SetPage(v CIAppQueryPageOptions) { + o.Page = &v +} + +// GetSort returns the Sort field value if set, zero value otherwise. +func (o *CIAppTestEventsRequest) GetSort() CIAppSort { + if o == nil || o.Sort == nil { + var ret CIAppSort + return ret + } + return *o.Sort +} + +// GetSortOk returns a tuple with the Sort field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppTestEventsRequest) GetSortOk() (*CIAppSort, bool) { + if o == nil || o.Sort == nil { + return nil, false + } + return o.Sort, true +} + +// HasSort returns a boolean if a field has been set. +func (o *CIAppTestEventsRequest) HasSort() bool { + return o != nil && o.Sort != nil +} + +// SetSort gets a reference to the given CIAppSort and assigns it to the Sort field. +func (o *CIAppTestEventsRequest) SetSort(v CIAppSort) { + o.Sort = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CIAppTestEventsRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return json.Marshal(o.UnparsedObject) + } + if o.Filter != nil { + toSerialize["filter"] = o.Filter + } + if o.Options != nil { + toSerialize["options"] = o.Options + } + if o.Page != nil { + toSerialize["page"] = o.Page + } + if o.Sort != nil { + toSerialize["sort"] = o.Sort + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CIAppTestEventsRequest) UnmarshalJSON(bytes []byte) (err error) { + raw := map[string]interface{}{} + all := struct { + Filter *CIAppTestsQueryFilter `json:"filter,omitempty"` + Options *CIAppQueryOptions `json:"options,omitempty"` + Page *CIAppQueryPageOptions `json:"page,omitempty"` + Sort *CIAppSort `json:"sort,omitempty"` + }{} + err = json.Unmarshal(bytes, &all) + if err != nil { + err = json.Unmarshal(bytes, &raw) + if err != nil { + return err + } + o.UnparsedObject = raw + return nil + } + if v := all.Sort; v != nil && !v.IsValid() { + err = json.Unmarshal(bytes, &raw) + if err != nil { + return err + } + o.UnparsedObject = raw + return nil + } + if all.Filter != nil && all.Filter.UnparsedObject != nil && o.UnparsedObject == nil { + err = json.Unmarshal(bytes, &raw) + if err != nil { + return err + } + o.UnparsedObject = raw + } + o.Filter = all.Filter + if all.Options != nil && all.Options.UnparsedObject != nil && o.UnparsedObject == nil { + err = json.Unmarshal(bytes, &raw) + if err != nil { + return err + } + o.UnparsedObject = raw + } + o.Options = all.Options + if all.Page != nil && all.Page.UnparsedObject != nil && o.UnparsedObject == nil { + err = json.Unmarshal(bytes, &raw) + if err != nil { + return err + } + o.UnparsedObject = raw + } + o.Page = all.Page + o.Sort = all.Sort + return nil +} diff --git a/api/datadogV2/model_ci_app_test_events_response.go b/api/datadogV2/model_ci_app_test_events_response.go new file mode 100644 index 00000000000..fe4761aea9a --- /dev/null +++ b/api/datadogV2/model_ci_app_test_events_response.go @@ -0,0 +1,182 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "encoding/json" +) + +// CIAppTestEventsResponse Response object with all test events matching the request and pagination information. +type CIAppTestEventsResponse struct { + // Array of events matching the request. + Data []CIAppTestEvent `json:"data,omitempty"` + // Links attributes. + Links *CIAppResponseLinks `json:"links,omitempty"` + // The metadata associated with a request. + Meta *CIAppResponseMetadata `json:"meta,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} +} + +// NewCIAppTestEventsResponse instantiates a new CIAppTestEventsResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCIAppTestEventsResponse() *CIAppTestEventsResponse { + this := CIAppTestEventsResponse{} + return &this +} + +// NewCIAppTestEventsResponseWithDefaults instantiates a new CIAppTestEventsResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCIAppTestEventsResponseWithDefaults() *CIAppTestEventsResponse { + this := CIAppTestEventsResponse{} + return &this +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *CIAppTestEventsResponse) GetData() []CIAppTestEvent { + if o == nil || o.Data == nil { + var ret []CIAppTestEvent + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppTestEventsResponse) GetDataOk() (*[]CIAppTestEvent, bool) { + if o == nil || o.Data == nil { + return nil, false + } + return &o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *CIAppTestEventsResponse) HasData() bool { + return o != nil && o.Data != nil +} + +// SetData gets a reference to the given []CIAppTestEvent and assigns it to the Data field. +func (o *CIAppTestEventsResponse) SetData(v []CIAppTestEvent) { + o.Data = v +} + +// GetLinks returns the Links field value if set, zero value otherwise. +func (o *CIAppTestEventsResponse) GetLinks() CIAppResponseLinks { + if o == nil || o.Links == nil { + var ret CIAppResponseLinks + return ret + } + return *o.Links +} + +// GetLinksOk returns a tuple with the Links field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppTestEventsResponse) GetLinksOk() (*CIAppResponseLinks, bool) { + if o == nil || o.Links == nil { + return nil, false + } + return o.Links, true +} + +// HasLinks returns a boolean if a field has been set. +func (o *CIAppTestEventsResponse) HasLinks() bool { + return o != nil && o.Links != nil +} + +// SetLinks gets a reference to the given CIAppResponseLinks and assigns it to the Links field. +func (o *CIAppTestEventsResponse) SetLinks(v CIAppResponseLinks) { + o.Links = &v +} + +// GetMeta returns the Meta field value if set, zero value otherwise. +func (o *CIAppTestEventsResponse) GetMeta() CIAppResponseMetadata { + if o == nil || o.Meta == nil { + var ret CIAppResponseMetadata + return ret + } + return *o.Meta +} + +// GetMetaOk returns a tuple with the Meta field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppTestEventsResponse) GetMetaOk() (*CIAppResponseMetadata, bool) { + if o == nil || o.Meta == nil { + return nil, false + } + return o.Meta, true +} + +// HasMeta returns a boolean if a field has been set. +func (o *CIAppTestEventsResponse) HasMeta() bool { + return o != nil && o.Meta != nil +} + +// SetMeta gets a reference to the given CIAppResponseMetadata and assigns it to the Meta field. +func (o *CIAppTestEventsResponse) SetMeta(v CIAppResponseMetadata) { + o.Meta = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CIAppTestEventsResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return json.Marshal(o.UnparsedObject) + } + if o.Data != nil { + toSerialize["data"] = o.Data + } + if o.Links != nil { + toSerialize["links"] = o.Links + } + if o.Meta != nil { + toSerialize["meta"] = o.Meta + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CIAppTestEventsResponse) UnmarshalJSON(bytes []byte) (err error) { + raw := map[string]interface{}{} + all := struct { + Data []CIAppTestEvent `json:"data,omitempty"` + Links *CIAppResponseLinks `json:"links,omitempty"` + Meta *CIAppResponseMetadata `json:"meta,omitempty"` + }{} + err = json.Unmarshal(bytes, &all) + if err != nil { + err = json.Unmarshal(bytes, &raw) + if err != nil { + return err + } + o.UnparsedObject = raw + return nil + } + o.Data = all.Data + if all.Links != nil && all.Links.UnparsedObject != nil && o.UnparsedObject == nil { + err = json.Unmarshal(bytes, &raw) + if err != nil { + return err + } + o.UnparsedObject = raw + } + o.Links = all.Links + if all.Meta != nil && all.Meta.UnparsedObject != nil && o.UnparsedObject == nil { + err = json.Unmarshal(bytes, &raw) + if err != nil { + return err + } + o.UnparsedObject = raw + } + o.Meta = all.Meta + return nil +} diff --git a/api/datadogV2/model_ci_app_tests_aggregate_request.go b/api/datadogV2/model_ci_app_tests_aggregate_request.go new file mode 100644 index 00000000000..2c17c573523 --- /dev/null +++ b/api/datadogV2/model_ci_app_tests_aggregate_request.go @@ -0,0 +1,260 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "encoding/json" +) + +// CIAppTestsAggregateRequest The object sent with the request to retrieve aggregation buckets of test events from your organization. +type CIAppTestsAggregateRequest struct { + // The list of metrics or timeseries to compute for the retrieved buckets. + Compute []CIAppCompute `json:"compute,omitempty"` + // The search and filter query settings. + Filter *CIAppTestsQueryFilter `json:"filter,omitempty"` + // The rules for the group-by. + GroupBy []CIAppTestsGroupBy `json:"group_by,omitempty"` + // Global query options that are used during the query. + // Only supply timezone or time offset, not both. Otherwise, the query fails. + Options *CIAppQueryOptions `json:"options,omitempty"` + // Paging attributes for listing events. + Page *CIAppQueryPageOptions `json:"page,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} +} + +// NewCIAppTestsAggregateRequest instantiates a new CIAppTestsAggregateRequest object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCIAppTestsAggregateRequest() *CIAppTestsAggregateRequest { + this := CIAppTestsAggregateRequest{} + return &this +} + +// NewCIAppTestsAggregateRequestWithDefaults instantiates a new CIAppTestsAggregateRequest object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCIAppTestsAggregateRequestWithDefaults() *CIAppTestsAggregateRequest { + this := CIAppTestsAggregateRequest{} + return &this +} + +// GetCompute returns the Compute field value if set, zero value otherwise. +func (o *CIAppTestsAggregateRequest) GetCompute() []CIAppCompute { + if o == nil || o.Compute == nil { + var ret []CIAppCompute + return ret + } + return o.Compute +} + +// GetComputeOk returns a tuple with the Compute field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppTestsAggregateRequest) GetComputeOk() (*[]CIAppCompute, bool) { + if o == nil || o.Compute == nil { + return nil, false + } + return &o.Compute, true +} + +// HasCompute returns a boolean if a field has been set. +func (o *CIAppTestsAggregateRequest) HasCompute() bool { + return o != nil && o.Compute != nil +} + +// SetCompute gets a reference to the given []CIAppCompute and assigns it to the Compute field. +func (o *CIAppTestsAggregateRequest) SetCompute(v []CIAppCompute) { + o.Compute = v +} + +// GetFilter returns the Filter field value if set, zero value otherwise. +func (o *CIAppTestsAggregateRequest) GetFilter() CIAppTestsQueryFilter { + if o == nil || o.Filter == nil { + var ret CIAppTestsQueryFilter + return ret + } + return *o.Filter +} + +// GetFilterOk returns a tuple with the Filter field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppTestsAggregateRequest) GetFilterOk() (*CIAppTestsQueryFilter, bool) { + if o == nil || o.Filter == nil { + return nil, false + } + return o.Filter, true +} + +// HasFilter returns a boolean if a field has been set. +func (o *CIAppTestsAggregateRequest) HasFilter() bool { + return o != nil && o.Filter != nil +} + +// SetFilter gets a reference to the given CIAppTestsQueryFilter and assigns it to the Filter field. +func (o *CIAppTestsAggregateRequest) SetFilter(v CIAppTestsQueryFilter) { + o.Filter = &v +} + +// GetGroupBy returns the GroupBy field value if set, zero value otherwise. +func (o *CIAppTestsAggregateRequest) GetGroupBy() []CIAppTestsGroupBy { + if o == nil || o.GroupBy == nil { + var ret []CIAppTestsGroupBy + return ret + } + return o.GroupBy +} + +// GetGroupByOk returns a tuple with the GroupBy field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppTestsAggregateRequest) GetGroupByOk() (*[]CIAppTestsGroupBy, bool) { + if o == nil || o.GroupBy == nil { + return nil, false + } + return &o.GroupBy, true +} + +// HasGroupBy returns a boolean if a field has been set. +func (o *CIAppTestsAggregateRequest) HasGroupBy() bool { + return o != nil && o.GroupBy != nil +} + +// SetGroupBy gets a reference to the given []CIAppTestsGroupBy and assigns it to the GroupBy field. +func (o *CIAppTestsAggregateRequest) SetGroupBy(v []CIAppTestsGroupBy) { + o.GroupBy = v +} + +// GetOptions returns the Options field value if set, zero value otherwise. +func (o *CIAppTestsAggregateRequest) GetOptions() CIAppQueryOptions { + if o == nil || o.Options == nil { + var ret CIAppQueryOptions + return ret + } + return *o.Options +} + +// GetOptionsOk returns a tuple with the Options field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppTestsAggregateRequest) GetOptionsOk() (*CIAppQueryOptions, bool) { + if o == nil || o.Options == nil { + return nil, false + } + return o.Options, true +} + +// HasOptions returns a boolean if a field has been set. +func (o *CIAppTestsAggregateRequest) HasOptions() bool { + return o != nil && o.Options != nil +} + +// SetOptions gets a reference to the given CIAppQueryOptions and assigns it to the Options field. +func (o *CIAppTestsAggregateRequest) SetOptions(v CIAppQueryOptions) { + o.Options = &v +} + +// GetPage returns the Page field value if set, zero value otherwise. +func (o *CIAppTestsAggregateRequest) GetPage() CIAppQueryPageOptions { + if o == nil || o.Page == nil { + var ret CIAppQueryPageOptions + return ret + } + return *o.Page +} + +// GetPageOk returns a tuple with the Page field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppTestsAggregateRequest) GetPageOk() (*CIAppQueryPageOptions, bool) { + if o == nil || o.Page == nil { + return nil, false + } + return o.Page, true +} + +// HasPage returns a boolean if a field has been set. +func (o *CIAppTestsAggregateRequest) HasPage() bool { + return o != nil && o.Page != nil +} + +// SetPage gets a reference to the given CIAppQueryPageOptions and assigns it to the Page field. +func (o *CIAppTestsAggregateRequest) SetPage(v CIAppQueryPageOptions) { + o.Page = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CIAppTestsAggregateRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return json.Marshal(o.UnparsedObject) + } + if o.Compute != nil { + toSerialize["compute"] = o.Compute + } + if o.Filter != nil { + toSerialize["filter"] = o.Filter + } + if o.GroupBy != nil { + toSerialize["group_by"] = o.GroupBy + } + if o.Options != nil { + toSerialize["options"] = o.Options + } + if o.Page != nil { + toSerialize["page"] = o.Page + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CIAppTestsAggregateRequest) UnmarshalJSON(bytes []byte) (err error) { + raw := map[string]interface{}{} + all := struct { + Compute []CIAppCompute `json:"compute,omitempty"` + Filter *CIAppTestsQueryFilter `json:"filter,omitempty"` + GroupBy []CIAppTestsGroupBy `json:"group_by,omitempty"` + Options *CIAppQueryOptions `json:"options,omitempty"` + Page *CIAppQueryPageOptions `json:"page,omitempty"` + }{} + err = json.Unmarshal(bytes, &all) + if err != nil { + err = json.Unmarshal(bytes, &raw) + if err != nil { + return err + } + o.UnparsedObject = raw + return nil + } + o.Compute = all.Compute + if all.Filter != nil && all.Filter.UnparsedObject != nil && o.UnparsedObject == nil { + err = json.Unmarshal(bytes, &raw) + if err != nil { + return err + } + o.UnparsedObject = raw + } + o.Filter = all.Filter + o.GroupBy = all.GroupBy + if all.Options != nil && all.Options.UnparsedObject != nil && o.UnparsedObject == nil { + err = json.Unmarshal(bytes, &raw) + if err != nil { + return err + } + o.UnparsedObject = raw + } + o.Options = all.Options + if all.Page != nil && all.Page.UnparsedObject != nil && o.UnparsedObject == nil { + err = json.Unmarshal(bytes, &raw) + if err != nil { + return err + } + o.UnparsedObject = raw + } + o.Page = all.Page + return nil +} diff --git a/api/datadogV2/model_ci_app_tests_aggregation_buckets_response.go b/api/datadogV2/model_ci_app_tests_aggregation_buckets_response.go new file mode 100644 index 00000000000..5bf8078858b --- /dev/null +++ b/api/datadogV2/model_ci_app_tests_aggregation_buckets_response.go @@ -0,0 +1,98 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "encoding/json" +) + +// CIAppTestsAggregationBucketsResponse The query results. +type CIAppTestsAggregationBucketsResponse struct { + // The list of matching buckets, one item per bucket. + Buckets []CIAppTestsBucketResponse `json:"buckets,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} +} + +// NewCIAppTestsAggregationBucketsResponse instantiates a new CIAppTestsAggregationBucketsResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCIAppTestsAggregationBucketsResponse() *CIAppTestsAggregationBucketsResponse { + this := CIAppTestsAggregationBucketsResponse{} + return &this +} + +// NewCIAppTestsAggregationBucketsResponseWithDefaults instantiates a new CIAppTestsAggregationBucketsResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCIAppTestsAggregationBucketsResponseWithDefaults() *CIAppTestsAggregationBucketsResponse { + this := CIAppTestsAggregationBucketsResponse{} + return &this +} + +// GetBuckets returns the Buckets field value if set, zero value otherwise. +func (o *CIAppTestsAggregationBucketsResponse) GetBuckets() []CIAppTestsBucketResponse { + if o == nil || o.Buckets == nil { + var ret []CIAppTestsBucketResponse + return ret + } + return o.Buckets +} + +// GetBucketsOk returns a tuple with the Buckets field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppTestsAggregationBucketsResponse) GetBucketsOk() (*[]CIAppTestsBucketResponse, bool) { + if o == nil || o.Buckets == nil { + return nil, false + } + return &o.Buckets, true +} + +// HasBuckets returns a boolean if a field has been set. +func (o *CIAppTestsAggregationBucketsResponse) HasBuckets() bool { + return o != nil && o.Buckets != nil +} + +// SetBuckets gets a reference to the given []CIAppTestsBucketResponse and assigns it to the Buckets field. +func (o *CIAppTestsAggregationBucketsResponse) SetBuckets(v []CIAppTestsBucketResponse) { + o.Buckets = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CIAppTestsAggregationBucketsResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return json.Marshal(o.UnparsedObject) + } + if o.Buckets != nil { + toSerialize["buckets"] = o.Buckets + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CIAppTestsAggregationBucketsResponse) UnmarshalJSON(bytes []byte) (err error) { + raw := map[string]interface{}{} + all := struct { + Buckets []CIAppTestsBucketResponse `json:"buckets,omitempty"` + }{} + err = json.Unmarshal(bytes, &all) + if err != nil { + err = json.Unmarshal(bytes, &raw) + if err != nil { + return err + } + o.UnparsedObject = raw + return nil + } + o.Buckets = all.Buckets + return nil +} diff --git a/api/datadogV2/model_ci_app_tests_analytics_aggregate_response.go b/api/datadogV2/model_ci_app_tests_analytics_aggregate_response.go new file mode 100644 index 00000000000..e8b50d5bfbd --- /dev/null +++ b/api/datadogV2/model_ci_app_tests_analytics_aggregate_response.go @@ -0,0 +1,189 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "encoding/json" +) + +// CIAppTestsAnalyticsAggregateResponse The response object for the test events aggregate API endpoint. +type CIAppTestsAnalyticsAggregateResponse struct { + // The query results. + Data *CIAppTestsAggregationBucketsResponse `json:"data,omitempty"` + // Links attributes. + Links *CIAppResponseLinks `json:"links,omitempty"` + // The metadata associated with a request. + Meta *CIAppResponseMetadata `json:"meta,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} +} + +// NewCIAppTestsAnalyticsAggregateResponse instantiates a new CIAppTestsAnalyticsAggregateResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCIAppTestsAnalyticsAggregateResponse() *CIAppTestsAnalyticsAggregateResponse { + this := CIAppTestsAnalyticsAggregateResponse{} + return &this +} + +// NewCIAppTestsAnalyticsAggregateResponseWithDefaults instantiates a new CIAppTestsAnalyticsAggregateResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCIAppTestsAnalyticsAggregateResponseWithDefaults() *CIAppTestsAnalyticsAggregateResponse { + this := CIAppTestsAnalyticsAggregateResponse{} + return &this +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *CIAppTestsAnalyticsAggregateResponse) GetData() CIAppTestsAggregationBucketsResponse { + if o == nil || o.Data == nil { + var ret CIAppTestsAggregationBucketsResponse + return ret + } + return *o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppTestsAnalyticsAggregateResponse) GetDataOk() (*CIAppTestsAggregationBucketsResponse, bool) { + if o == nil || o.Data == nil { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *CIAppTestsAnalyticsAggregateResponse) HasData() bool { + return o != nil && o.Data != nil +} + +// SetData gets a reference to the given CIAppTestsAggregationBucketsResponse and assigns it to the Data field. +func (o *CIAppTestsAnalyticsAggregateResponse) SetData(v CIAppTestsAggregationBucketsResponse) { + o.Data = &v +} + +// GetLinks returns the Links field value if set, zero value otherwise. +func (o *CIAppTestsAnalyticsAggregateResponse) GetLinks() CIAppResponseLinks { + if o == nil || o.Links == nil { + var ret CIAppResponseLinks + return ret + } + return *o.Links +} + +// GetLinksOk returns a tuple with the Links field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppTestsAnalyticsAggregateResponse) GetLinksOk() (*CIAppResponseLinks, bool) { + if o == nil || o.Links == nil { + return nil, false + } + return o.Links, true +} + +// HasLinks returns a boolean if a field has been set. +func (o *CIAppTestsAnalyticsAggregateResponse) HasLinks() bool { + return o != nil && o.Links != nil +} + +// SetLinks gets a reference to the given CIAppResponseLinks and assigns it to the Links field. +func (o *CIAppTestsAnalyticsAggregateResponse) SetLinks(v CIAppResponseLinks) { + o.Links = &v +} + +// GetMeta returns the Meta field value if set, zero value otherwise. +func (o *CIAppTestsAnalyticsAggregateResponse) GetMeta() CIAppResponseMetadata { + if o == nil || o.Meta == nil { + var ret CIAppResponseMetadata + return ret + } + return *o.Meta +} + +// GetMetaOk returns a tuple with the Meta field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppTestsAnalyticsAggregateResponse) GetMetaOk() (*CIAppResponseMetadata, bool) { + if o == nil || o.Meta == nil { + return nil, false + } + return o.Meta, true +} + +// HasMeta returns a boolean if a field has been set. +func (o *CIAppTestsAnalyticsAggregateResponse) HasMeta() bool { + return o != nil && o.Meta != nil +} + +// SetMeta gets a reference to the given CIAppResponseMetadata and assigns it to the Meta field. +func (o *CIAppTestsAnalyticsAggregateResponse) SetMeta(v CIAppResponseMetadata) { + o.Meta = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CIAppTestsAnalyticsAggregateResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return json.Marshal(o.UnparsedObject) + } + if o.Data != nil { + toSerialize["data"] = o.Data + } + if o.Links != nil { + toSerialize["links"] = o.Links + } + if o.Meta != nil { + toSerialize["meta"] = o.Meta + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CIAppTestsAnalyticsAggregateResponse) UnmarshalJSON(bytes []byte) (err error) { + raw := map[string]interface{}{} + all := struct { + Data *CIAppTestsAggregationBucketsResponse `json:"data,omitempty"` + Links *CIAppResponseLinks `json:"links,omitempty"` + Meta *CIAppResponseMetadata `json:"meta,omitempty"` + }{} + err = json.Unmarshal(bytes, &all) + if err != nil { + err = json.Unmarshal(bytes, &raw) + if err != nil { + return err + } + o.UnparsedObject = raw + return nil + } + if all.Data != nil && all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + err = json.Unmarshal(bytes, &raw) + if err != nil { + return err + } + o.UnparsedObject = raw + } + o.Data = all.Data + if all.Links != nil && all.Links.UnparsedObject != nil && o.UnparsedObject == nil { + err = json.Unmarshal(bytes, &raw) + if err != nil { + return err + } + o.UnparsedObject = raw + } + o.Links = all.Links + if all.Meta != nil && all.Meta.UnparsedObject != nil && o.UnparsedObject == nil { + err = json.Unmarshal(bytes, &raw) + if err != nil { + return err + } + o.UnparsedObject = raw + } + o.Meta = all.Meta + return nil +} diff --git a/api/datadogV2/model_ci_app_tests_bucket_response.go b/api/datadogV2/model_ci_app_tests_bucket_response.go new file mode 100644 index 00000000000..044bb374717 --- /dev/null +++ b/api/datadogV2/model_ci_app_tests_bucket_response.go @@ -0,0 +1,133 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "encoding/json" +) + +// CIAppTestsBucketResponse Bucket values. +type CIAppTestsBucketResponse struct { + // The key-value pairs for each group-by. + By map[string]string `json:"by,omitempty"` + // A map of the metric name to value for regular compute, or a list of values for a timeseries. + Computes map[string]CIAppAggregateBucketValue `json:"computes,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} +} + +// NewCIAppTestsBucketResponse instantiates a new CIAppTestsBucketResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCIAppTestsBucketResponse() *CIAppTestsBucketResponse { + this := CIAppTestsBucketResponse{} + return &this +} + +// NewCIAppTestsBucketResponseWithDefaults instantiates a new CIAppTestsBucketResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCIAppTestsBucketResponseWithDefaults() *CIAppTestsBucketResponse { + this := CIAppTestsBucketResponse{} + return &this +} + +// GetBy returns the By field value if set, zero value otherwise. +func (o *CIAppTestsBucketResponse) GetBy() map[string]string { + if o == nil || o.By == nil { + var ret map[string]string + return ret + } + return o.By +} + +// GetByOk returns a tuple with the By field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppTestsBucketResponse) GetByOk() (*map[string]string, bool) { + if o == nil || o.By == nil { + return nil, false + } + return &o.By, true +} + +// HasBy returns a boolean if a field has been set. +func (o *CIAppTestsBucketResponse) HasBy() bool { + return o != nil && o.By != nil +} + +// SetBy gets a reference to the given map[string]string and assigns it to the By field. +func (o *CIAppTestsBucketResponse) SetBy(v map[string]string) { + o.By = v +} + +// GetComputes returns the Computes field value if set, zero value otherwise. +func (o *CIAppTestsBucketResponse) GetComputes() map[string]CIAppAggregateBucketValue { + if o == nil || o.Computes == nil { + var ret map[string]CIAppAggregateBucketValue + return ret + } + return o.Computes +} + +// GetComputesOk returns a tuple with the Computes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppTestsBucketResponse) GetComputesOk() (*map[string]CIAppAggregateBucketValue, bool) { + if o == nil || o.Computes == nil { + return nil, false + } + return &o.Computes, true +} + +// HasComputes returns a boolean if a field has been set. +func (o *CIAppTestsBucketResponse) HasComputes() bool { + return o != nil && o.Computes != nil +} + +// SetComputes gets a reference to the given map[string]CIAppAggregateBucketValue and assigns it to the Computes field. +func (o *CIAppTestsBucketResponse) SetComputes(v map[string]CIAppAggregateBucketValue) { + o.Computes = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CIAppTestsBucketResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return json.Marshal(o.UnparsedObject) + } + if o.By != nil { + toSerialize["by"] = o.By + } + if o.Computes != nil { + toSerialize["computes"] = o.Computes + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CIAppTestsBucketResponse) UnmarshalJSON(bytes []byte) (err error) { + raw := map[string]interface{}{} + all := struct { + By map[string]string `json:"by,omitempty"` + Computes map[string]CIAppAggregateBucketValue `json:"computes,omitempty"` + }{} + err = json.Unmarshal(bytes, &all) + if err != nil { + err = json.Unmarshal(bytes, &raw) + if err != nil { + return err + } + o.UnparsedObject = raw + return nil + } + o.By = all.By + o.Computes = all.Computes + return nil +} diff --git a/api/datadogV2/model_ci_app_tests_group_by.go b/api/datadogV2/model_ci_app_tests_group_by.go new file mode 100644 index 00000000000..e4f06cd492f --- /dev/null +++ b/api/datadogV2/model_ci_app_tests_group_by.go @@ -0,0 +1,297 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "encoding/json" + "fmt" +) + +// CIAppTestsGroupBy A group-by rule. +type CIAppTestsGroupBy struct { + // The name of the facet to use (required). + Facet string `json:"facet"` + // Used to perform a histogram computation (only for measure facets). + // At most, 100 buckets are allowed, the number of buckets is `(max - min)/interval`. + Histogram *CIAppGroupByHistogram `json:"histogram,omitempty"` + // The maximum buckets to return for this group-by. + 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. + Sort *CIAppAggregateSort `json:"sort,omitempty"` + // A resulting object to put the given computes in over all the matching records. + Total *CIAppGroupByTotal `json:"total,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} +} + +// NewCIAppTestsGroupBy instantiates a new CIAppTestsGroupBy object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCIAppTestsGroupBy(facet string) *CIAppTestsGroupBy { + this := CIAppTestsGroupBy{} + this.Facet = facet + var limit int64 = 10 + this.Limit = &limit + return &this +} + +// NewCIAppTestsGroupByWithDefaults instantiates a new CIAppTestsGroupBy object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCIAppTestsGroupByWithDefaults() *CIAppTestsGroupBy { + this := CIAppTestsGroupBy{} + var limit int64 = 10 + this.Limit = &limit + return &this +} + +// GetFacet returns the Facet field value. +func (o *CIAppTestsGroupBy) GetFacet() string { + if o == nil { + var ret string + return ret + } + return o.Facet +} + +// GetFacetOk returns a tuple with the Facet field value +// and a boolean to check if the value has been set. +func (o *CIAppTestsGroupBy) GetFacetOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Facet, true +} + +// SetFacet sets field value. +func (o *CIAppTestsGroupBy) SetFacet(v string) { + o.Facet = v +} + +// GetHistogram returns the Histogram field value if set, zero value otherwise. +func (o *CIAppTestsGroupBy) GetHistogram() CIAppGroupByHistogram { + if o == nil || o.Histogram == nil { + var ret CIAppGroupByHistogram + return ret + } + return *o.Histogram +} + +// GetHistogramOk returns a tuple with the Histogram field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppTestsGroupBy) GetHistogramOk() (*CIAppGroupByHistogram, bool) { + if o == nil || o.Histogram == nil { + return nil, false + } + return o.Histogram, true +} + +// HasHistogram returns a boolean if a field has been set. +func (o *CIAppTestsGroupBy) HasHistogram() bool { + return o != nil && o.Histogram != nil +} + +// SetHistogram gets a reference to the given CIAppGroupByHistogram and assigns it to the Histogram field. +func (o *CIAppTestsGroupBy) SetHistogram(v CIAppGroupByHistogram) { + o.Histogram = &v +} + +// GetLimit returns the Limit field value if set, zero value otherwise. +func (o *CIAppTestsGroupBy) GetLimit() int64 { + if o == nil || o.Limit == nil { + var ret int64 + return ret + } + return *o.Limit +} + +// GetLimitOk returns a tuple with the Limit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppTestsGroupBy) GetLimitOk() (*int64, bool) { + if o == nil || o.Limit == nil { + return nil, false + } + return o.Limit, true +} + +// HasLimit returns a boolean if a field has been set. +func (o *CIAppTestsGroupBy) HasLimit() bool { + return o != nil && o.Limit != nil +} + +// SetLimit gets a reference to the given int64 and assigns it to the Limit field. +func (o *CIAppTestsGroupBy) SetLimit(v int64) { + o.Limit = &v +} + +// GetMissing returns the Missing field value if set, zero value otherwise. +func (o *CIAppTestsGroupBy) GetMissing() CIAppGroupByMissing { + if o == nil || o.Missing == nil { + var ret CIAppGroupByMissing + return ret + } + return *o.Missing +} + +// GetMissingOk returns a tuple with the Missing field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppTestsGroupBy) GetMissingOk() (*CIAppGroupByMissing, bool) { + if o == nil || o.Missing == nil { + return nil, false + } + return o.Missing, true +} + +// HasMissing returns a boolean if a field has been set. +func (o *CIAppTestsGroupBy) HasMissing() bool { + return o != nil && o.Missing != nil +} + +// SetMissing gets a reference to the given CIAppGroupByMissing and assigns it to the Missing field. +func (o *CIAppTestsGroupBy) SetMissing(v CIAppGroupByMissing) { + o.Missing = &v +} + +// GetSort returns the Sort field value if set, zero value otherwise. +func (o *CIAppTestsGroupBy) GetSort() CIAppAggregateSort { + if o == nil || o.Sort == nil { + var ret CIAppAggregateSort + return ret + } + return *o.Sort +} + +// GetSortOk returns a tuple with the Sort field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppTestsGroupBy) GetSortOk() (*CIAppAggregateSort, bool) { + if o == nil || o.Sort == nil { + return nil, false + } + return o.Sort, true +} + +// HasSort returns a boolean if a field has been set. +func (o *CIAppTestsGroupBy) HasSort() bool { + return o != nil && o.Sort != nil +} + +// SetSort gets a reference to the given CIAppAggregateSort and assigns it to the Sort field. +func (o *CIAppTestsGroupBy) SetSort(v CIAppAggregateSort) { + o.Sort = &v +} + +// GetTotal returns the Total field value if set, zero value otherwise. +func (o *CIAppTestsGroupBy) GetTotal() CIAppGroupByTotal { + if o == nil || o.Total == nil { + var ret CIAppGroupByTotal + return ret + } + return *o.Total +} + +// GetTotalOk returns a tuple with the Total field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppTestsGroupBy) GetTotalOk() (*CIAppGroupByTotal, bool) { + if o == nil || o.Total == nil { + return nil, false + } + return o.Total, true +} + +// HasTotal returns a boolean if a field has been set. +func (o *CIAppTestsGroupBy) HasTotal() bool { + return o != nil && o.Total != nil +} + +// SetTotal gets a reference to the given CIAppGroupByTotal and assigns it to the Total field. +func (o *CIAppTestsGroupBy) SetTotal(v CIAppGroupByTotal) { + o.Total = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CIAppTestsGroupBy) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return json.Marshal(o.UnparsedObject) + } + toSerialize["facet"] = o.Facet + if o.Histogram != nil { + toSerialize["histogram"] = o.Histogram + } + if o.Limit != nil { + toSerialize["limit"] = o.Limit + } + if o.Missing != nil { + toSerialize["missing"] = o.Missing + } + if o.Sort != nil { + toSerialize["sort"] = o.Sort + } + if o.Total != nil { + toSerialize["total"] = o.Total + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CIAppTestsGroupBy) UnmarshalJSON(bytes []byte) (err error) { + raw := map[string]interface{}{} + required := struct { + Facet *string `json:"facet"` + }{} + all := struct { + Facet string `json:"facet"` + Histogram *CIAppGroupByHistogram `json:"histogram,omitempty"` + Limit *int64 `json:"limit,omitempty"` + Missing *CIAppGroupByMissing `json:"missing,omitempty"` + Sort *CIAppAggregateSort `json:"sort,omitempty"` + Total *CIAppGroupByTotal `json:"total,omitempty"` + }{} + err = json.Unmarshal(bytes, &required) + if err != nil { + return err + } + if required.Facet == nil { + return fmt.Errorf("required field facet missing") + } + err = json.Unmarshal(bytes, &all) + if err != nil { + err = json.Unmarshal(bytes, &raw) + if err != nil { + return err + } + o.UnparsedObject = raw + return nil + } + o.Facet = all.Facet + if all.Histogram != nil && all.Histogram.UnparsedObject != nil && o.UnparsedObject == nil { + err = json.Unmarshal(bytes, &raw) + if err != nil { + return err + } + o.UnparsedObject = raw + } + o.Histogram = all.Histogram + o.Limit = all.Limit + o.Missing = all.Missing + if all.Sort != nil && all.Sort.UnparsedObject != nil && o.UnparsedObject == nil { + err = json.Unmarshal(bytes, &raw) + if err != nil { + return err + } + o.UnparsedObject = raw + } + o.Sort = all.Sort + o.Total = all.Total + return nil +} diff --git a/api/datadogV2/model_ci_app_tests_query_filter.go b/api/datadogV2/model_ci_app_tests_query_filter.go new file mode 100644 index 00000000000..dc8dd8b01ff --- /dev/null +++ b/api/datadogV2/model_ci_app_tests_query_filter.go @@ -0,0 +1,180 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "encoding/json" +) + +// CIAppTestsQueryFilter The search and filter query settings. +type CIAppTestsQueryFilter struct { + // The minimum time for the requested events; supports date, math, and regular timestamps (in milliseconds). + From *string `json:"from,omitempty"` + // The search query following the Log search syntax. + Query *string `json:"query,omitempty"` + // The maximum time for the requested events, supports date, math, and regular timestamps (in milliseconds). + To *string `json:"to,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} +} + +// NewCIAppTestsQueryFilter instantiates a new CIAppTestsQueryFilter object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCIAppTestsQueryFilter() *CIAppTestsQueryFilter { + this := CIAppTestsQueryFilter{} + var from string = "now-15m" + this.From = &from + var query string = "*" + this.Query = &query + var to string = "now" + this.To = &to + return &this +} + +// NewCIAppTestsQueryFilterWithDefaults instantiates a new CIAppTestsQueryFilter object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCIAppTestsQueryFilterWithDefaults() *CIAppTestsQueryFilter { + this := CIAppTestsQueryFilter{} + var from string = "now-15m" + this.From = &from + var query string = "*" + this.Query = &query + var to string = "now" + this.To = &to + return &this +} + +// GetFrom returns the From field value if set, zero value otherwise. +func (o *CIAppTestsQueryFilter) GetFrom() string { + if o == nil || o.From == nil { + var ret string + return ret + } + return *o.From +} + +// GetFromOk returns a tuple with the From field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppTestsQueryFilter) GetFromOk() (*string, bool) { + if o == nil || o.From == nil { + return nil, false + } + return o.From, true +} + +// HasFrom returns a boolean if a field has been set. +func (o *CIAppTestsQueryFilter) HasFrom() bool { + return o != nil && o.From != nil +} + +// SetFrom gets a reference to the given string and assigns it to the From field. +func (o *CIAppTestsQueryFilter) SetFrom(v string) { + o.From = &v +} + +// GetQuery returns the Query field value if set, zero value otherwise. +func (o *CIAppTestsQueryFilter) GetQuery() string { + if o == nil || o.Query == nil { + var ret string + return ret + } + return *o.Query +} + +// GetQueryOk returns a tuple with the Query field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppTestsQueryFilter) GetQueryOk() (*string, bool) { + if o == nil || o.Query == nil { + return nil, false + } + return o.Query, true +} + +// HasQuery returns a boolean if a field has been set. +func (o *CIAppTestsQueryFilter) HasQuery() bool { + return o != nil && o.Query != nil +} + +// SetQuery gets a reference to the given string and assigns it to the Query field. +func (o *CIAppTestsQueryFilter) SetQuery(v string) { + o.Query = &v +} + +// GetTo returns the To field value if set, zero value otherwise. +func (o *CIAppTestsQueryFilter) GetTo() string { + if o == nil || o.To == nil { + var ret string + return ret + } + return *o.To +} + +// GetToOk returns a tuple with the To field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppTestsQueryFilter) GetToOk() (*string, bool) { + if o == nil || o.To == nil { + return nil, false + } + return o.To, true +} + +// HasTo returns a boolean if a field has been set. +func (o *CIAppTestsQueryFilter) HasTo() bool { + return o != nil && o.To != nil +} + +// SetTo gets a reference to the given string and assigns it to the To field. +func (o *CIAppTestsQueryFilter) SetTo(v string) { + o.To = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CIAppTestsQueryFilter) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return json.Marshal(o.UnparsedObject) + } + if o.From != nil { + toSerialize["from"] = o.From + } + if o.Query != nil { + toSerialize["query"] = o.Query + } + if o.To != nil { + toSerialize["to"] = o.To + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CIAppTestsQueryFilter) UnmarshalJSON(bytes []byte) (err error) { + raw := map[string]interface{}{} + all := struct { + From *string `json:"from,omitempty"` + Query *string `json:"query,omitempty"` + To *string `json:"to,omitempty"` + }{} + err = json.Unmarshal(bytes, &all) + if err != nil { + err = json.Unmarshal(bytes, &raw) + if err != nil { + return err + } + o.UnparsedObject = raw + return nil + } + o.From = all.From + o.Query = all.Query + o.To = all.To + return nil +} diff --git a/api/datadogV2/model_ci_app_warning.go b/api/datadogV2/model_ci_app_warning.go new file mode 100644 index 00000000000..9a6425e5527 --- /dev/null +++ b/api/datadogV2/model_ci_app_warning.go @@ -0,0 +1,168 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "encoding/json" +) + +// CIAppWarning A warning message indicating something that went wrong with the query. +type CIAppWarning struct { + // A unique code for this type of warning. + Code *string `json:"code,omitempty"` + // A detailed explanation of this specific warning. + Detail *string `json:"detail,omitempty"` + // A short human-readable summary of the warning. + Title *string `json:"title,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} +} + +// NewCIAppWarning instantiates a new CIAppWarning object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCIAppWarning() *CIAppWarning { + this := CIAppWarning{} + return &this +} + +// NewCIAppWarningWithDefaults instantiates a new CIAppWarning object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCIAppWarningWithDefaults() *CIAppWarning { + this := CIAppWarning{} + return &this +} + +// GetCode returns the Code field value if set, zero value otherwise. +func (o *CIAppWarning) GetCode() string { + if o == nil || o.Code == nil { + var ret string + return ret + } + return *o.Code +} + +// GetCodeOk returns a tuple with the Code field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppWarning) GetCodeOk() (*string, bool) { + if o == nil || o.Code == nil { + return nil, false + } + return o.Code, true +} + +// HasCode returns a boolean if a field has been set. +func (o *CIAppWarning) HasCode() bool { + return o != nil && o.Code != nil +} + +// SetCode gets a reference to the given string and assigns it to the Code field. +func (o *CIAppWarning) SetCode(v string) { + o.Code = &v +} + +// GetDetail returns the Detail field value if set, zero value otherwise. +func (o *CIAppWarning) GetDetail() string { + if o == nil || o.Detail == nil { + var ret string + return ret + } + return *o.Detail +} + +// GetDetailOk returns a tuple with the Detail field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppWarning) GetDetailOk() (*string, bool) { + if o == nil || o.Detail == nil { + return nil, false + } + return o.Detail, true +} + +// HasDetail returns a boolean if a field has been set. +func (o *CIAppWarning) HasDetail() bool { + return o != nil && o.Detail != nil +} + +// SetDetail gets a reference to the given string and assigns it to the Detail field. +func (o *CIAppWarning) SetDetail(v string) { + o.Detail = &v +} + +// GetTitle returns the Title field value if set, zero value otherwise. +func (o *CIAppWarning) GetTitle() string { + if o == nil || o.Title == nil { + var ret string + return ret + } + return *o.Title +} + +// GetTitleOk returns a tuple with the Title field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppWarning) GetTitleOk() (*string, bool) { + if o == nil || o.Title == nil { + return nil, false + } + return o.Title, true +} + +// HasTitle returns a boolean if a field has been set. +func (o *CIAppWarning) HasTitle() bool { + return o != nil && o.Title != nil +} + +// SetTitle gets a reference to the given string and assigns it to the Title field. +func (o *CIAppWarning) SetTitle(v string) { + o.Title = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CIAppWarning) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return json.Marshal(o.UnparsedObject) + } + if o.Code != nil { + toSerialize["code"] = o.Code + } + if o.Detail != nil { + toSerialize["detail"] = o.Detail + } + if o.Title != nil { + toSerialize["title"] = o.Title + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CIAppWarning) UnmarshalJSON(bytes []byte) (err error) { + raw := map[string]interface{}{} + all := struct { + Code *string `json:"code,omitempty"` + Detail *string `json:"detail,omitempty"` + Title *string `json:"title,omitempty"` + }{} + err = json.Unmarshal(bytes, &all) + if err != nil { + err = json.Unmarshal(bytes, &raw) + if err != nil { + return err + } + o.UnparsedObject = raw + return nil + } + o.Code = all.Code + o.Detail = all.Detail + o.Title = all.Title + return nil +} diff --git a/examples/v2/ci-visibility-pipelines/AggregateCIAppPipelineEvents.go b/examples/v2/ci-visibility-pipelines/AggregateCIAppPipelineEvents.go new file mode 100644 index 00000000000..a94faed68e7 --- /dev/null +++ b/examples/v2/ci-visibility-pipelines/AggregateCIAppPipelineEvents.go @@ -0,0 +1,57 @@ +// Aggregate pipelines events 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.CIAppPipelinesAggregateRequest{ + Compute: []datadogV2.CIAppCompute{ + { + Aggregation: datadogV2.CIAPPAGGREGATIONFUNCTION_PERCENTILE_90, + Metric: datadog.PtrString("@duration"), + Type: datadogV2.CIAPPCOMPUTETYPE_TOTAL.Ptr(), + }, + }, + Filter: &datadogV2.CIAppPipelinesQueryFilter{ + From: datadog.PtrString("now-15m"), + Query: datadog.PtrString("@ci.provider.name:github AND @ci.provider.instance:github-actions"), + To: datadog.PtrString("now"), + }, + GroupBy: []datadogV2.CIAppPipelinesGroupBy{ + { + Facet: "@ci.status", + Limit: datadog.PtrInt64(10), + Total: &datadogV2.CIAppGroupByTotal{ + CIAppGroupByTotalBoolean: datadog.PtrBool(false)}, + }, + }, + Options: &datadogV2.CIAppQueryOptions{ + Timezone: datadog.PtrString("GMT"), + }, + Page: &datadogV2.CIAppQueryPageOptions{ + Limit: datadog.PtrInt32(25), + }, + } + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewCIVisibilityPipelinesApi(apiClient) + resp, r, err := api.AggregateCIAppPipelineEvents(ctx, body) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CIVisibilityPipelinesApi.AggregateCIAppPipelineEvents`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `CIVisibilityPipelinesApi.AggregateCIAppPipelineEvents`:\n%s\n", responseContent) +} diff --git a/examples/v2/ci-visibility-pipelines/ListCIAppPipelineEvents.go b/examples/v2/ci-visibility-pipelines/ListCIAppPipelineEvents.go new file mode 100644 index 00000000000..634e6e8cdf0 --- /dev/null +++ b/examples/v2/ci-visibility-pipelines/ListCIAppPipelineEvents.go @@ -0,0 +1,30 @@ +// Get a list of pipelines events returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + "time" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewCIVisibilityPipelinesApi(apiClient) + resp, r, err := api.ListCIAppPipelineEvents(ctx, *datadogV2.NewListCIAppPipelineEventsOptionalParameters().WithFilterQuery("@ci.provider.instance:circleci").WithFilterFrom(time.Now().Add(time.Minute * -30)).WithFilterTo(time.Now()).WithPageLimit(5)) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CIVisibilityPipelinesApi.ListCIAppPipelineEvents`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `CIVisibilityPipelinesApi.ListCIAppPipelineEvents`:\n%s\n", responseContent) +} diff --git a/examples/v2/ci-visibility-pipelines/ListCIAppPipelineEvents_1270618359.go b/examples/v2/ci-visibility-pipelines/ListCIAppPipelineEvents_1270618359.go new file mode 100644 index 00000000000..a6e4eeed139 --- /dev/null +++ b/examples/v2/ci-visibility-pipelines/ListCIAppPipelineEvents_1270618359.go @@ -0,0 +1,31 @@ +// Get a list of pipelines events returns "OK" response with pagination + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + "time" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewCIVisibilityPipelinesApi(apiClient) + resp, _, err := api.ListCIAppPipelineEventsWithPagination(ctx, *datadogV2.NewListCIAppPipelineEventsOptionalParameters().WithFilterFrom(time.Now().Add(time.Second * -30)).WithFilterTo(time.Now()).WithPageLimit(2)) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CIVisibilityPipelinesApi.ListCIAppPipelineEvents`: %v\n", err) + } + + for item := range resp { + responseContent, _ := json.MarshalIndent(item, "", " ") + fmt.Fprintf(os.Stdout, "%s\n", responseContent) + } +} diff --git a/examples/v2/ci-visibility-pipelines/SearchCIAppPipelineEvents.go b/examples/v2/ci-visibility-pipelines/SearchCIAppPipelineEvents.go new file mode 100644 index 00000000000..92992a48385 --- /dev/null +++ b/examples/v2/ci-visibility-pipelines/SearchCIAppPipelineEvents.go @@ -0,0 +1,43 @@ +// Search pipelines events 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.CIAppPipelineEventsRequest{ + Filter: &datadogV2.CIAppPipelinesQueryFilter{ + From: datadog.PtrString("now-15m"), + Query: datadog.PtrString("@ci.provider.name:github AND @ci.status:error"), + To: datadog.PtrString("now"), + }, + Options: &datadogV2.CIAppQueryOptions{ + Timezone: datadog.PtrString("GMT"), + }, + Page: &datadogV2.CIAppQueryPageOptions{ + Limit: datadog.PtrInt32(5), + }, + Sort: datadogV2.CIAPPSORT_TIMESTAMP_ASCENDING.Ptr(), + } + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewCIVisibilityPipelinesApi(apiClient) + resp, r, err := api.SearchCIAppPipelineEvents(ctx, *datadogV2.NewSearchCIAppPipelineEventsOptionalParameters().WithBody(body)) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CIVisibilityPipelinesApi.SearchCIAppPipelineEvents`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `CIVisibilityPipelinesApi.SearchCIAppPipelineEvents`:\n%s\n", responseContent) +} diff --git a/examples/v2/ci-visibility-pipelines/SearchCIAppPipelineEvents_3246135003.go b/examples/v2/ci-visibility-pipelines/SearchCIAppPipelineEvents_3246135003.go new file mode 100644 index 00000000000..7b31cc10053 --- /dev/null +++ b/examples/v2/ci-visibility-pipelines/SearchCIAppPipelineEvents_3246135003.go @@ -0,0 +1,43 @@ +// Search pipelines events returns "OK" response with pagination + +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.CIAppPipelineEventsRequest{ + Filter: &datadogV2.CIAppPipelinesQueryFilter{ + From: datadog.PtrString("now-30s"), + To: datadog.PtrString("now"), + }, + Options: &datadogV2.CIAppQueryOptions{ + Timezone: datadog.PtrString("GMT"), + }, + Page: &datadogV2.CIAppQueryPageOptions{ + Limit: datadog.PtrInt32(2), + }, + Sort: datadogV2.CIAPPSORT_TIMESTAMP_ASCENDING.Ptr(), + } + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewCIVisibilityPipelinesApi(apiClient) + resp, _, err := api.SearchCIAppPipelineEventsWithPagination(ctx, *datadogV2.NewSearchCIAppPipelineEventsOptionalParameters().WithBody(body)) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CIVisibilityPipelinesApi.SearchCIAppPipelineEvents`: %v\n", err) + } + + for item := range resp { + responseContent, _ := json.MarshalIndent(item, "", " ") + fmt.Fprintf(os.Stdout, "%s\n", responseContent) + } +} diff --git a/examples/v2/ci-visibility-tests/AggregateCIAppTestEvents.go b/examples/v2/ci-visibility-tests/AggregateCIAppTestEvents.go new file mode 100644 index 00000000000..eea0d548140 --- /dev/null +++ b/examples/v2/ci-visibility-tests/AggregateCIAppTestEvents.go @@ -0,0 +1,60 @@ +// Aggregate tests events 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.CIAppTestsAggregateRequest{ + Compute: []datadogV2.CIAppCompute{ + { + Aggregation: datadogV2.CIAPPAGGREGATIONFUNCTION_COUNT, + Metric: datadog.PtrString("@test.is_flaky"), + Type: datadogV2.CIAPPCOMPUTETYPE_TOTAL.Ptr(), + }, + }, + Filter: &datadogV2.CIAppTestsQueryFilter{ + From: datadog.PtrString("now-15m"), + Query: datadog.PtrString("@language:(python OR go)"), + To: datadog.PtrString("now"), + }, + GroupBy: []datadogV2.CIAppTestsGroupBy{ + { + Facet: "@git.branch", + Limit: datadog.PtrInt64(10), + Sort: &datadogV2.CIAppAggregateSort{ + Order: datadogV2.CIAPPSORTORDER_ASCENDING.Ptr(), + }, + Total: &datadogV2.CIAppGroupByTotal{ + CIAppGroupByTotalBoolean: datadog.PtrBool(false)}, + }, + }, + Options: &datadogV2.CIAppQueryOptions{ + Timezone: datadog.PtrString("GMT"), + }, + Page: &datadogV2.CIAppQueryPageOptions{ + Limit: datadog.PtrInt32(25), + }, + } + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewCIVisibilityTestsApi(apiClient) + resp, r, err := api.AggregateCIAppTestEvents(ctx, body) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CIVisibilityTestsApi.AggregateCIAppTestEvents`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `CIVisibilityTestsApi.AggregateCIAppTestEvents`:\n%s\n", responseContent) +} diff --git a/examples/v2/ci-visibility-tests/ListCIAppTestEvents.go b/examples/v2/ci-visibility-tests/ListCIAppTestEvents.go new file mode 100644 index 00000000000..44a1cf841d7 --- /dev/null +++ b/examples/v2/ci-visibility-tests/ListCIAppTestEvents.go @@ -0,0 +1,30 @@ +// Get a list of tests events returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + "time" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewCIVisibilityTestsApi(apiClient) + resp, r, err := api.ListCIAppTestEvents(ctx, *datadogV2.NewListCIAppTestEventsOptionalParameters().WithFilterQuery("@test.service:web-ui-tests").WithFilterFrom(time.Now().Add(time.Second * -30)).WithFilterTo(time.Now()).WithPageLimit(5)) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CIVisibilityTestsApi.ListCIAppTestEvents`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `CIVisibilityTestsApi.ListCIAppTestEvents`:\n%s\n", responseContent) +} diff --git a/examples/v2/ci-visibility-tests/ListCIAppTestEvents_3852605281.go b/examples/v2/ci-visibility-tests/ListCIAppTestEvents_3852605281.go new file mode 100644 index 00000000000..14ba5e1b66d --- /dev/null +++ b/examples/v2/ci-visibility-tests/ListCIAppTestEvents_3852605281.go @@ -0,0 +1,31 @@ +// Get a list of tests events returns "OK" response with pagination + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + "time" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewCIVisibilityTestsApi(apiClient) + resp, _, err := api.ListCIAppTestEventsWithPagination(ctx, *datadogV2.NewListCIAppTestEventsOptionalParameters().WithFilterFrom(time.Now().Add(time.Second * -30)).WithFilterTo(time.Now()).WithPageLimit(2)) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CIVisibilityTestsApi.ListCIAppTestEvents`: %v\n", err) + } + + for item := range resp { + responseContent, _ := json.MarshalIndent(item, "", " ") + fmt.Fprintf(os.Stdout, "%s\n", responseContent) + } +} diff --git a/examples/v2/ci-visibility-tests/SearchCIAppTestEvents.go b/examples/v2/ci-visibility-tests/SearchCIAppTestEvents.go new file mode 100644 index 00000000000..77b854b0533 --- /dev/null +++ b/examples/v2/ci-visibility-tests/SearchCIAppTestEvents.go @@ -0,0 +1,43 @@ +// Search tests events 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.CIAppTestEventsRequest{ + Filter: &datadogV2.CIAppTestsQueryFilter{ + From: datadog.PtrString("now-15m"), + Query: datadog.PtrString("@test.service:web-ui-tests AND @test.status:skip"), + To: datadog.PtrString("now"), + }, + Options: &datadogV2.CIAppQueryOptions{ + Timezone: datadog.PtrString("GMT"), + }, + Page: &datadogV2.CIAppQueryPageOptions{ + Limit: datadog.PtrInt32(25), + }, + Sort: datadogV2.CIAPPSORT_TIMESTAMP_ASCENDING.Ptr(), + } + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewCIVisibilityTestsApi(apiClient) + resp, r, err := api.SearchCIAppTestEvents(ctx, *datadogV2.NewSearchCIAppTestEventsOptionalParameters().WithBody(body)) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CIVisibilityTestsApi.SearchCIAppTestEvents`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `CIVisibilityTestsApi.SearchCIAppTestEvents`:\n%s\n", responseContent) +} diff --git a/examples/v2/ci-visibility-tests/SearchCIAppTestEvents_1675695429.go b/examples/v2/ci-visibility-tests/SearchCIAppTestEvents_1675695429.go new file mode 100644 index 00000000000..3684d2328b1 --- /dev/null +++ b/examples/v2/ci-visibility-tests/SearchCIAppTestEvents_1675695429.go @@ -0,0 +1,41 @@ +// Search tests events returns "OK" response with pagination + +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.CIAppTestEventsRequest{ + Filter: &datadogV2.CIAppTestsQueryFilter{ + From: datadog.PtrString("now-15m"), + Query: datadog.PtrString("@test.status:pass AND -@language:python"), + To: datadog.PtrString("now"), + }, + Page: &datadogV2.CIAppQueryPageOptions{ + Limit: datadog.PtrInt32(2), + }, + Sort: datadogV2.CIAPPSORT_TIMESTAMP_ASCENDING.Ptr(), + } + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewCIVisibilityTestsApi(apiClient) + resp, _, err := api.SearchCIAppTestEventsWithPagination(ctx, *datadogV2.NewSearchCIAppTestEventsOptionalParameters().WithBody(body)) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CIVisibilityTestsApi.SearchCIAppTestEvents`: %v\n", err) + } + + for item := range resp { + responseContent, _ := json.MarshalIndent(item, "", " ") + fmt.Fprintf(os.Stdout, "%s\n", responseContent) + } +} diff --git a/tests/scenarios/api_mappings.go b/tests/scenarios/api_mappings.go index 21e59d03f57..f8fe3345d87 100644 --- a/tests/scenarios/api_mappings.go +++ b/tests/scenarios/api_mappings.go @@ -47,6 +47,8 @@ var apiMappings = map[string]map[string]reflect.Value{ "KeyManagementApi": reflect.ValueOf(datadogV2.NewKeyManagementApi), "AuditApi": reflect.ValueOf(datadogV2.NewAuditApi), "AuthNMappingsApi": reflect.ValueOf(datadogV2.NewAuthNMappingsApi), + "CIVisibilityPipelinesApi": reflect.ValueOf(datadogV2.NewCIVisibilityPipelinesApi), + "CIVisibilityTestsApi": reflect.ValueOf(datadogV2.NewCIVisibilityTestsApi), "DashboardListsApi": reflect.ValueOf(datadogV2.NewDashboardListsApi), "EventsApi": reflect.ValueOf(datadogV2.NewEventsApi), "IncidentsApi": reflect.ValueOf(datadogV2.NewIncidentsApi), diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Aggregate_pipelines_events_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Aggregate_pipelines_events_returns_OK_response.freeze new file mode 100644 index 00000000000..a52b00f26c4 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Aggregate_pipelines_events_returns_OK_response.freeze @@ -0,0 +1 @@ +2022-10-21T09:04:03.789Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Aggregate_pipelines_events_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Aggregate_pipelines_events_returns_OK_response.yaml new file mode 100644 index 00000000000..f4ac424fa25 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Aggregate_pipelines_events_returns_OK_response.yaml @@ -0,0 +1,23 @@ +interactions: +- request: + body: | + {"compute":[{"aggregation":"pc90","metric":"@duration","type":"total"}],"filter":{"from":"now-15m","query":"@ci.provider.name:github AND @ci.provider.instance:github-actions","to":"now"},"group_by":[{"facet":"@ci.status","limit":10,"total":false}],"options":{"timezone":"GMT"},"page":{"limit":25}} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + url: https://api.datadoghq.com/api/v2/ci/pipelines/analytics/aggregate + response: + body: '{"meta":{"elapsed":113,"request_id":"pddv1ChYwUEN0YnZ5dFNrdVZEbHhuSTliVEpnIiwKHGMtY3c8ixDp3d4CWjg8UkGmZ1-bi7LFmSWOebUSDClmkByOFEin86vlJg","status":"done"},"data":{"buckets":[{"by":{"@ci.status":"canceled"},"computes":{"c0":149536704640.0603}},{"by":{"@ci.status":"error"},"computes":{"c0":423086456660.7128}},{"by":{"@ci.status":"skipped"},"computes":{"c0":0.0}},{"by":{"@ci.status":"success"},"computes":{"c0":190099929600.14703}}]}} + + ' + code: 200 + duration: '' + headers: + Content-Type: + - application/json + status: 200 OK +version: 1 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Get_a_list_of_pipelines_events_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Get_a_list_of_pipelines_events_returns_OK_response.freeze new file mode 100644 index 00000000000..db8394631a8 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Get_a_list_of_pipelines_events_returns_OK_response.freeze @@ -0,0 +1 @@ +2022-10-21T09:03:14.191Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Get_a_list_of_pipelines_events_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Get_a_list_of_pipelines_events_returns_OK_response.yaml new file mode 100644 index 00000000000..03948cdf3ad --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Get_a_list_of_pipelines_events_returns_OK_response.yaml @@ -0,0 +1,40 @@ +interactions: +- request: + body: '' + form: {} + headers: + Accept: + - application/json + method: GET + url: https://api.datadoghq.com/api/v2/ci/pipelines/events?filter%5Bquery%5D=%40ci.provider.instance%3Acircleci&filter%5Bfrom%5D=2022-10-21T08%3A33%3A14.191Z&filter%5Bto%5D=2022-10-21T09%3A03%3A14.191Z&page%5Blimit%5D=5 + response: + body: '{"data":[{"id":"AgAAAYP5xykf8-SC-QAAAAAAAAAYAAAAAEFZUDV4eWtmQUFCUks3bmxVT3JlZDMyLQAAACQAAAAAMDE4M2Y5YzctMzZiMC00MTA3LWFlNWUtMjY5YmIyNWNjMjU1","type":"cipipeline","attributes":{"attributes":{"duration":168245000000,"git":{"commit":{"committer":{"date":"2022-10-21T08:53:37Z","name":"GitHub","email":"noreply@github.com","date_timestamp":1666342417000},"author":{"date":"2022-10-21T08:53:37Z","name":"dependabot[bot]","email":"49699333+dependabot[bot]@users.noreply.github.com","date_timestamp":1666342417000},"message":"Bump + sigs.k8s.io/custom-metrics-apiserver from 1.23.0 to 1.24.0\nBumps [sigs.k8s.io/custom-metrics-apiserver](https://github.com/kubernetes-sigs/custom-metrics-apiserver) + from 1.23.0 to 1.24.0.\n- [Release notes](https://github.com/kubernetes-sigs/custom-metrics-apiserver/releases)\n- + [Changelog](https://github.com/kubernetes-sigs/custom-metrics-apiserver/blob/master/RELEASE.md)\n- + [Commits](https://github.com/kubernetes-sigs/custom-metrics-apiserver/compare/v1.23.0...v1.24.0)\n\n---\nupdated-dependencies:\n- + dependency-name: sigs.k8s.io/custom-metrics-apiserver\n dependency-type: direct:production\n update-type: + version-update:semver-minor\n...\n\nSigned-off-by: dependabot[bot] ","sha":"ae8f4633aeeffe565f65b51d835c1d16194bae84"},"repository_url":"https://github.com/DataDog/repo","repository":{"path":"/DataDog/repo","scheme":"https","name":"DataDog/repo","host":"github.com","id":"github.com/DataDog/repo"},"branch":"dependabot/go_modules/sigs.k8s.io/custom-metrics-apiserver-1.24.0"},"ci":{"pipeline":{"name":"test_and_build","id":"49e7fd76-3f02-4713-920a-9fe5815acb69","url":"https://app.circleci.com/pipelines/workflows/49e7fd76-3f02-4713-920a-9fe5815acb69"},"provider":{"instance":"circleci","name":"circleci"},"job":{"name":"integration_tests","id":"63fe0e47-c104-4084-a885-90a5efe48fc0","url":"https://app.circleci.com/jobs/gh/DataDog/repo/747606"},"status":"error"},"circleci":{"result":"failed"},"start":1666342754282000000},"ci_level":"job","tags":["source:apm","source:apm"]}},{"id":"AgAAAYP5xqkdMVh9SQAAAAAAAAAYAAAAAEFZUDV4cWtkQUFCTVgxb2RLVG05X1gyLQAAACQAAAAAMDE4M2Y5YzYtY2QzOC00YmU5LTllMjctYTZkYWY0ODU1NTM2","type":"cipipeline","attributes":{"attributes":{"duration":135912000000,"git":{"commit":{"committer":{"date":"2022-10-21T08:53:37Z","name":"GitHub","email":"noreply@github.com","date_timestamp":1666342417000},"author":{"date":"2022-10-21T08:53:37Z","name":"dependabot[bot]","email":"49699333+dependabot[bot]@users.noreply.github.com","date_timestamp":1666342417000},"message":"Bump + sigs.k8s.io/custom-metrics-apiserver from 1.23.0 to 1.24.0\nBumps [sigs.k8s.io/custom-metrics-apiserver](https://github.com/kubernetes-sigs/custom-metrics-apiserver) + from 1.23.0 to 1.24.0.\n- [Release notes](https://github.com/kubernetes-sigs/custom-metrics-apiserver/releases)\n- + [Changelog](https://github.com/kubernetes-sigs/custom-metrics-apiserver/blob/master/RELEASE.md)\n- + [Commits](https://github.com/kubernetes-sigs/custom-metrics-apiserver/compare/v1.23.0...v1.24.0)\n\n---\nupdated-dependencies:\n- + dependency-name: sigs.k8s.io/custom-metrics-apiserver\n dependency-type: direct:production\n update-type: + version-update:semver-minor\n...\n\nSigned-off-by: dependabot[bot] ","sha":"ae8f4633aeeffe565f65b51d835c1d16194bae84"},"repository_url":"https://github.com/DataDog/repo","repository":{"path":"/DataDog/repo","scheme":"https","name":"DataDog/repo","host":"github.com","id":"github.com/DataDog/repo"},"branch":"dependabot/go_modules/sigs.k8s.io/custom-metrics-apiserver-1.24.0"},"ci":{"pipeline":{"name":"test_and_build","id":"49e7fd76-3f02-4713-920a-9fe5815acb69","url":"https://app.circleci.com/pipelines/workflows/49e7fd76-3f02-4713-920a-9fe5815acb69"},"provider":{"instance":"circleci","name":"circleci"},"job":{"name":"docker_tests","id":"fe1c7d1e-fa06-4f78-a770-2124d9df6450","url":"https://app.circleci.com/jobs/gh/DataDog/repo/747605"},"status":"success"},"circleci":{"result":"success"},"start":1666342753845000000},"ci_level":"job","tags":["source:apm","source:apm"]}},{"id":"AgAAAYP5xpmz5QcY9gAAAAAAAAAYAAAAAEFZUDV4cG16QUFDUzJrMkpfUWdXS0l4SQAAACQAAAAAMDE4M2Y5YzYtOWE3MC00NjRkLTk0ZGEtMzJhMTU3NWM4N2Y1","type":"cipipeline","attributes":{"attributes":{"duration":127003000000,"git":{"commit":{"committer":{"date":"2022-10-21T08:29:12Z","name":"Joe","email":"support@datadoghq.com","date_timestamp":1666340952000},"author":{"date":"2022-10-21T08:29:12Z","name":"Joe","email":"support@datadoghq.com","date_timestamp":1666340952000},"message":"[CWS] + pre-alloc in `bitmaskCombinations`","sha":"77413ba45e45cf69704bcb98cd90363453545c0b"},"repository_url":"https://github.com/DataDog/repo","repository":{"path":"/DataDog/repo","scheme":"https","name":"DataDog/repo","host":"github.com","id":"github.com/DataDog/repo"},"branch":"paulcacheux/pre-alloc-v2"},"ci":{"pipeline":{"name":"test_and_build","id":"6600c0f6-5457-4a1a-92a5-7930156ec18f","url":"https://app.circleci.com/pipelines/workflows/6600c0f6-5457-4a1a-92a5-7930156ec18f"},"provider":{"instance":"circleci","name":"circleci"},"job":{"name":"docker_tests","id":"cf9b9254-ece7-4e94-aefe-d6365cbc0c33","url":"https://app.circleci.com/jobs/gh/DataDog/repo/747597"},"status":"success"},"circleci":{"result":"success"},"start":1666342758808000000},"ci_level":"job","tags":["source:apm","source:apm"]}},{"id":"AgAAAYP5xfKQbBhYyAAAAAAAAAAYAAAAAEFZUDV4ZktRQUFDUklKUjJKZDlQdTMyLQAAACQAAAAAMDE4M2Y5YzYtMjE1OC00NTlkLThlNDMtNGE4ZjVmNGM2ZTM4","type":"cipipeline","attributes":{"attributes":{"duration":91076000000,"git":{"commit":{"committer":{"date":"2022-10-21T08:53:37Z","name":"GitHub","email":"noreply@github.com","date_timestamp":1666342417000},"author":{"date":"2022-10-21T08:53:37Z","name":"dependabot[bot]","email":"49699333+dependabot[bot]@users.noreply.github.com","date_timestamp":1666342417000},"message":"Bump + sigs.k8s.io/custom-metrics-apiserver from 1.23.0 to 1.24.0\nBumps [sigs.k8s.io/custom-metrics-apiserver](https://github.com/kubernetes-sigs/custom-metrics-apiserver) + from 1.23.0 to 1.24.0.\n- [Release notes](https://github.com/kubernetes-sigs/custom-metrics-apiserver/releases)\n- + [Changelog](https://github.com/kubernetes-sigs/custom-metrics-apiserver/blob/master/RELEASE.md)\n- + [Commits](https://github.com/kubernetes-sigs/custom-metrics-apiserver/compare/v1.23.0...v1.24.0)\n\n---\nupdated-dependencies:\n- + dependency-name: sigs.k8s.io/custom-metrics-apiserver\n dependency-type: direct:production\n update-type: + version-update:semver-minor\n...\n\nSigned-off-by: dependabot[bot] ","sha":"ae8f4633aeeffe565f65b51d835c1d16194bae84"},"repository_url":"https://github.com/DataDog/repo","repository":{"path":"/DataDog/repo","scheme":"https","name":"DataDog/repo","host":"github.com","id":"github.com/DataDog/repo"},"branch":"dependabot/go_modules/sigs.k8s.io/custom-metrics-apiserver-1.24.0"},"ci":{"pipeline":{"name":"test_and_build","id":"49e7fd76-3f02-4713-920a-9fe5815acb69","url":"https://app.circleci.com/pipelines/workflows/49e7fd76-3f02-4713-920a-9fe5815acb69"},"provider":{"instance":"circleci","name":"circleci"},"job":{"name":"licenses_linting","id":"f72c6c96-c726-4af6-bc76-6177b23465a4","url":"https://app.circleci.com/jobs/gh/DataDog/repo/747593"},"status":"error"},"circleci":{"result":"failed"},"start":1666342751948000000},"ci_level":"job","tags":["source:apm","source:apm"]}},{"id":"AgAAAYP5xcd7ZGdYyAAAAAAAAAAYAAAAAEFZUDV4Y2Q3QUFCSXFuNnhnMTZwMTR4SQAAACQAAAAAMDE4M2Y5YzUtZGIwOC00YTBhLWFmZWEtM2VjZDA3ZTU4N2My","type":"cipipeline","attributes":{"attributes":{"duration":78632000000,"git":{"commit":{"committer":{"date":"2022-10-21T08:29:12Z","name":"Joe","email":"support@datadoghq.com","date_timestamp":1666340952000},"author":{"date":"2022-10-21T08:29:12Z","name":"Joe","email":"support@datadoghq.com","date_timestamp":1666340952000},"message":"[CWS] + pre-alloc in `bitmaskCombinations`","sha":"77413ba45e45cf69704bcb98cd90363453545c0b"},"repository_url":"https://github.com/DataDog/repo","repository":{"path":"/DataDog/repo","scheme":"https","name":"DataDog/repo","host":"github.com","id":"github.com/DataDog/repo"},"branch":"paulcacheux/pre-alloc-v2"},"ci":{"pipeline":{"name":"test_and_build","id":"6600c0f6-5457-4a1a-92a5-7930156ec18f","url":"https://app.circleci.com/pipelines/workflows/6600c0f6-5457-4a1a-92a5-7930156ec18f"},"provider":{"instance":"circleci","name":"circleci"},"job":{"name":"licenses_linting","id":"dd9dadb2-d371-41de-9ccb-5c3eda84d7b6","url":"https://app.circleci.com/jobs/gh/DataDog/repo/747601"},"status":"success"},"circleci":{"result":"success"},"start":1666342753363000000},"ci_level":"job","tags":["source:apm","source:apm"]}}],"meta":{"page":{"after":"eyJhZnRlciI6IkFnQUFBWVA1eGNkN1pHZFl5QUFBQUFBQUFBQVlBQUFBQUVGWlVEVjRZMlEzUVVGQ1NYRnVObmhuTVRad01UUjRTUUFBQUNRQUFBQUFNREU0TTJZNVl6VXRaR0l3T0MwMFlUQmhMV0ZtWldFdE0yVmpaREEzWlRVNE4yTXkifQ"}},"links":{"next":"https://api.datadoghq.com/api/v2/ci/pipelines/events?filter%5Bfrom%5D=2022-10-21T08%3A33%3A14.191Z&filter%5Bquery%5D=%40ci.provider.instance%3Acircleci&filter%5Bto%5D=2022-10-21T09%3A03%3A14.191Z&page%5Bcursor%5D=eyJhZnRlciI6IkFnQUFBWVA1eGNkN1pHZFl5QUFBQUFBQUFBQVlBQUFBQUVGWlVEVjRZMlEzUVVGQ1NYRnVObmhuTVRad01UUjRTUUFBQUNRQUFBQUFNREU0TTJZNVl6VXRaR0l3T0MwMFlUQmhMV0ZtWldFdE0yVmpaREEzWlRVNE4yTXkifQ&page%5Blimit%5D=5"}} + + ' + code: 200 + duration: '' + headers: + Content-Type: + - application/json + status: 200 OK +version: 1 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Get_a_list_of_pipelines_events_returns_OK_response_with_pagination.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Get_a_list_of_pipelines_events_returns_OK_response_with_pagination.freeze new file mode 100644 index 00000000000..a231c03cbd0 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Get_a_list_of_pipelines_events_returns_OK_response_with_pagination.freeze @@ -0,0 +1 @@ +2022-10-21T08:45:13.365Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Get_a_list_of_pipelines_events_returns_OK_response_with_pagination.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Get_a_list_of_pipelines_events_returns_OK_response_with_pagination.yaml new file mode 100644 index 00000000000..cfd13b60a46 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Get_a_list_of_pipelines_events_returns_OK_response_with_pagination.yaml @@ -0,0 +1,41 @@ +interactions: +- request: + body: '' + form: {} + headers: + Accept: + - application/json + method: GET + url: https://api.datadoghq.com/api/v2/ci/pipelines/events?filter%5Bfrom%5D=2022-10-21T08%3A44%3A43.365Z&filter%5Bto%5D=2022-10-21T08%3A45%3A13.365Z&page%5Blimit%5D=2 + response: + body: '{"data":[{"id":"AgAAAYP5t3tYR3aQMAAAAAAAAAAYAAAAAEFZUDV0M3RZQUFBanF1YktfS2dXdjlOWQAAACQAAAAAMDE4M2Y5YjctN2I1OC00YjQwLWFmNjEtNjllYTUwYjA1YmI3","type":"cipipeline","attributes":{"attributes":{"duration":4000000000,"github":{"conclusion":"success","node_group":"GitHub + Actions","html_url":"https://github.com/DataDog/repo8s-resources","run_attempt":"1","app_id":"128890"},"git":{"commit":{"sha":"ac96ab878db8812762c13c4364ec5aa0b14158ce"},"default_branch":"master","repository_url":"https://github.com/DataDog/repo8s-resources.git","repository":{"path":"/DataDog/repo8s-resources.git","scheme":"https","name":"DataDog/repo8s-resources","host":"github.com","id":"github.com/DataDog/repo8s-resources"},"branch":"EDGEBE-4_dummy_test_env"},"ci":{"pipeline":{"name":"Labeler","id":"3296044030-1"},"node":{"labels":["ubuntu-latest"]},"provider":{"instance":"github-actions","name":"github"},"job":{"name":"label","id":"9025708592","url":"https://github.com/DataDog/repo8s-resources/actions/runs/3296044030/jobs/5435245138"},"status":"success"},"start":1666341891000000000},"ci_level":"job","tags":["source:apm","source:apm"]}},{"id":"AgAAAYP5t3dwEybABgAAAAAAAAAYAAAAAEFZUDV0M2R3QUFBbUM3YndwWmRTSnBQWAAAACQAAAAAMDE4M2Y5YjctN2I1OC00YjQwLWFmNjEtNjllYTUwYjA1YmI3","type":"cipipeline","attributes":{"attributes":{"duration":2445000000000,"github":{"conclusion":"success","html_url":"https://github.com/DataDog/repo","run_attempt":"1","event":"workflow_dispatch","app_id":"128890"},"git":{"commit":{"committer":{"date":"2022-10-07T13:30:54Z","name":"GitHub","email":"noreply@github.com","date_timestamp":1665149454000},"author":{"name":"Joe","email":"support@datadoghq.com"},"message":"Upgrade + to go1.18.7 (#113)","sha":"12dd44ae0c03bed08f7b790ff10e6cba0b887cd7"},"default_branch":"master","repository_url":"https://github.com/DataDog/repo.git","repository":{"path":"/DataDog/repo.git","scheme":"https","name":"DataDog/repo","host":"github.com","id":"github.com/DataDog/repo"},"branch":"master"},"ci":{"pipeline":{"number":20646,"name":"MacOS + Agent tests","id":"3295791228-1","url":"https://github.com/DataDog/repo/actions/runs/3295791228/attempts/1"},"provider":{"instance":"github-actions","name":"github"},"status":"success"},"_top_level":1,"start":1666339449000000000},"ci_level":"pipeline","tags":["source:apm","source:apm"]}}],"meta":{"page":{"after":"eyJhZnRlciI6IkFnQUFBWVA1dDNkd0V5YkFCZ0FBQUFBQUFBQVlBQUFBQUVGWlVEVjBNMlIzUVVGQmJVTTNZbmR3V21SVFNuQlFXQUFBQUNRQUFBQUFNREU0TTJZNVlqY3ROMkkxT0MwMFlqUXdMV0ZtTmpFdE5qbGxZVFV3WWpBMVltSTMifQ"}},"links":{"next":"https://api.datadoghq.com/api/v2/ci/pipelines/events?filter%5Bfrom%5D=2022-10-21T08%3A44%3A43.365Z&filter%5Bto%5D=2022-10-21T08%3A45%3A13.365Z&page%5Bcursor%5D=eyJhZnRlciI6IkFnQUFBWVA1dDNkd0V5YkFCZ0FBQUFBQUFBQVlBQUFBQUVGWlVEVjBNMlIzUVVGQmJVTTNZbmR3V21SVFNuQlFXQUFBQUNRQUFBQUFNREU0TTJZNVlqY3ROMkkxT0MwMFlqUXdMV0ZtTmpFdE5qbGxZVFV3WWpBMVltSTMifQ&page%5Blimit%5D=2"}} + + ' + code: 200 + duration: '' + headers: + Content-Type: + - application/json + status: 200 OK +- request: + body: '' + form: {} + headers: + Accept: + - application/json + method: GET + url: https://api.datadoghq.com/api/v2/ci/pipelines/events?filter%5Bfrom%5D=2022-10-21T08%3A44%3A43.365Z&filter%5Bto%5D=2022-10-21T08%3A45%3A13.365Z&page%5Blimit%5D=2&page%5Bcursor%5D=eyJhZnRlciI6IkFnQUFBWVA1dDNkd0V5YkFCZ0FBQUFBQUFBQVlBQUFBQUVGWlVEVjBNMlIzUVVGQmJVTTNZbmR3V21SVFNuQlFXQUFBQUNRQUFBQUFNREU0TTJZNVlqY3ROMkkxT0MwMFlqUXdMV0ZtTmpFdE5qbGxZVFV3WWpBMVltSTMifQ + response: + body: '{"data":[],"meta":{"page":{"after":"eyJhZnRlciI6IkFnQUFBWVA1dDNPSVIzYVFMZ0FBQUFBQUFBQVlBQUFBQUVGWlVEVjBNMDlKUVVGRVpGcEJWVEpEWjNZNU4yUk9XUUFBQUNRQUFBQUFNREU0TTJZNVlqY3ROMkkxT0MwMFlqUXdMV0ZtTmpFdE5qbGxZVFV3WWpBMVltSTMifQ"}},"links":{"next":"https://api.datadoghq.com/api/v2/ci/pipelines/events?filter%5Bfrom%5D=2022-10-21T08%3A44%3A43.365Z&filter%5Bto%5D=2022-10-21T08%3A45%3A13.365Z&page%5Bcursor%5D=eyJhZnRlciI6IkFnQUFBWVA1dDNPSVIzYVFMZ0FBQUFBQUFBQVlBQUFBQUVGWlVEVjBNMDlKUVVGRVpGcEJWVEpEWjNZNU4yUk9XUUFBQUNRQUFBQUFNREU0TTJZNVlqY3ROMkkxT0MwMFlqUXdMV0ZtTmpFdE5qbGxZVFV3WWpBMVltSTMifQ&page%5Blimit%5D=2"}} + + ' + code: 200 + duration: '' + headers: + Content-Type: + - application/json + status: 200 OK +version: 1 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Search_pipelines_events_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Search_pipelines_events_returns_OK_response.freeze new file mode 100644 index 00000000000..7fa75869614 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Search_pipelines_events_returns_OK_response.freeze @@ -0,0 +1 @@ +2022-10-21T09:09:41.747Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Search_pipelines_events_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Search_pipelines_events_returns_OK_response.yaml new file mode 100644 index 00000000000..0df51840585 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Search_pipelines_events_returns_OK_response.yaml @@ -0,0 +1,35 @@ +interactions: +- request: + body: | + {"filter":{"from":"now-15m","query":"@ci.provider.name:github AND @ci.status:error","to":"now"},"options":{"timezone":"GMT"},"page":{"limit":5},"sort":"timestamp"} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + url: https://api.datadoghq.com/api/v2/ci/pipelines/events/search + response: + body: '{"data":[{"id":"AgAAAYP5wIfA7N1YyAAAAAAAAAAYAAAAAEFZUDV3SWZBQUFBZGs5R2kyd25pbjdNMQAAACQAAAAAMDE4M2Y5YzUtYWUwZi00MzFhLWI0MWItOGU2MDg1NDM3MzAx","type":"cipipeline","attributes":{"attributes":{"duration":0,"github":{"conclusion":"failure","node_group":"","html_url":"https://github.com/DataDog/repo","run_attempt":"1","app_id":"128890"},"git":{"commit":{"sha":"95094daa15b4281c41780073ab8b77bc7c8d63d6"},"default_branch":"prod","repository_url":"https://github.com/DataDog/repo.git","repository":{"path":"/DataDog/repo.git","scheme":"https","name":"DataDog/repo","host":"github.com","id":"github.com/DataDog/repo"},"branch":"erkang.zhang/SYM-390/cache-test-spec"},"ci":{"pipeline":{"name":"Request + Schema diff","id":"3296065344-1"},"node":{"labels":[]},"provider":{"instance":"github-actions","name":"github"},"job":{"name":"Annotate + PR","id":"9025881221","url":"https://github.com/DataDog/repo/runs/9025881221"},"status":"error"},"start":1666342488000000000},"ci_level":"job","tags":["source:apm","source:apm"]}},{"id":"AgAAAYP5wZVIw5--1wAAAAAAAAAYAAAAAEFZUDV3WlZJQUFCakl1V1FZUE1TdHlxYgAAACQAAAAAMDE4M2Y5YzUtYWUwZi00MzFhLWI0MWItOGU2MDg1NDM3MzAx","type":"cipipeline","attributes":{"attributes":{"duration":247000000000,"github":{"conclusion":"failure","node_group":"GitHub + Actions","html_url":"https://github.com/DataDog/repo","run_attempt":"1","app_id":"128890"},"git":{"commit":{"sha":"51aec3962c7b3be87b2d656b22042ee5e2c89a3f"},"repository_url":"https://github.com/DataDog/repo.git","repository":{"path":"/DataDog/repo.git","scheme":"https","name":"DataDog/repo","host":"github.com","id":"github.com/DataDog/repo"},"branch":"master"},"ci":{"pipeline":{"name":"Staging + Build Deploy and Test","id":"3296065853-1"},"provider":{"instance":"github-actions","name":"github"},"step":{"name":"Run + Datadog Synthetic test"},"job":{"name":"test-checkouts","id":"9025825907"},"status":"error"},"start":1666342310000000000},"ci_level":"step","tags":["source:apm","source:apm"]}},{"id":"AgAAAYP5wZkww5--2gAAAAAAAAAYAAAAAEFZUDV3Wmt3QUFBN1R2bTVRRkxzaENxYgAAACQAAAAAMDE4M2Y5YzUtYWUwZi00MzFhLWI0MWItOGU2MDg1NDM3MzAx","type":"cipipeline","attributes":{"attributes":{"duration":251000000000,"github":{"conclusion":"failure","node_group":"GitHub + Actions","html_url":"https://github.com/DataDog/repo","run_attempt":"1","app_id":"128890"},"git":{"commit":{"sha":"51aec3962c7b3be87b2d656b22042ee5e2c89a3f"},"default_branch":"master","repository_url":"https://github.com/DataDog/repo.git","repository":{"path":"/DataDog/repo.git","scheme":"https","name":"DataDog/repo","host":"github.com","id":"github.com/DataDog/repo"},"branch":"master"},"ci":{"pipeline":{"name":"Staging + Build Deploy and Test","id":"3296065853-1"},"node":{"labels":["ubuntu-latest"]},"provider":{"instance":"github-actions","name":"github"},"job":{"name":"test-checkouts","id":"9025825907","url":"https://github.com/DataDog/repo/actions/runs/3296065853/jobs/5435334930"},"status":"error"},"start":1666342307000000000},"ci_level":"job","tags":["source:apm","source:apm"]}},{"id":"AgAAAYP5wmg4dbfjZwAAAAAAAAAYAAAAAEFZUDV3bWc0QUFBX0RBNlJkS1RqWkNLSAAAACQAAAAAMDE4M2Y5YzUtYWUwZi00MzFhLWI0MWItOGU2MDg1NDM3MzAx","type":"cipipeline","attributes":{"attributes":{"duration":29000000000,"github":{"conclusion":"failure","node_group":"GitHub + Actions","html_url":"https://github.com/DataDog/repo","run_attempt":"1","app_id":"128890"},"git":{"commit":{"sha":"62bd7b957a4db5b6926ca570b087b3cfdb9f05a7"},"repository_url":"https://github.com/DataDog/repo.git","repository":{"path":"/DataDog/repo.git","scheme":"https","name":"DataDog/repo","host":"github.com","id":"github.com/DataDog/repo"},"branch":"juanjux/APPSEC-6399-only-report-actorip-on-attack-part2"},"ci":{"pipeline":{"name":"Framework + tests","id":"3296098174-1"},"provider":{"instance":"github-actions","name":"github"},"step":{"name":"Run + tests"},"job":{"name":"starlette-testsuite-0_17_1","id":"9025869107"},"status":"error"},"start":1666342582000000000},"ci_level":"step","tags":["source:apm","source:apm"]}},{"id":"AgAAAYP5wnAIdbfjbAAAAAAAAAAYAAAAAEFZUDV3bkFJQUFENkpheXhlTXJfS3lLSAAAACQAAAAAMDE4M2Y5YzUtYWUwZi00MzFhLWI0MWItOGU2MDg1NDM3MzAx","type":"cipipeline","attributes":{"attributes":{"duration":164000000000,"github":{"conclusion":"failure","node_group":"GitHub + Actions","html_url":"https://github.com/DataDog/repo","run_attempt":"1","app_id":"128890"},"git":{"commit":{"sha":"62bd7b957a4db5b6926ca570b087b3cfdb9f05a7"},"default_branch":"1.x","repository_url":"https://github.com/DataDog/repo.git","repository":{"path":"/DataDog/repo.git","scheme":"https","name":"DataDog/repo","host":"github.com","id":"github.com/DataDog/repo"},"branch":"juanjux/APPSEC-6399-only-report-actorip-on-attack-part2"},"ci":{"pipeline":{"name":"Framework + tests","id":"3296098174-1"},"node":{"labels":["ubuntu-latest"]},"provider":{"instance":"github-actions","name":"github"},"job":{"name":"starlette-testsuite-0_17_1","id":"9025869107","url":"https://github.com/DataDog/repo/actions/runs/3296098174/jobs/5435368427"},"status":"error"},"start":1666342449000000000},"ci_level":"job","tags":["source:apm","source:apm"]}}],"meta":{"page":{"after":"eyJhZnRlciI6IkFnQUFBWVA1d25BSWRiZmpiQUFBQUFBQUFBQVlBQUFBQUVGWlVEVjNia0ZKUVVGRU5rcGhlWGhsVFhKZlMzbExTQUFBQUNRQUFBQUFNREU0TTJZNVl6VXRZV1V3WmkwME16RmhMV0kwTVdJdE9HVTJNRGcxTkRNM016QXgifQ"}},"links":{"next":"https://api.datadoghq.com/api/v2/ci/pipelines/events?filter%5Bfrom%5D=now-15m&filter%5Bquery%5D=%40ci.provider.name%3Agithub+AND+%40ci.status%3Aerror&filter%5Bto%5D=now&page%5Bcursor%5D=eyJhZnRlciI6IkFnQUFBWVA1d25BSWRiZmpiQUFBQUFBQUFBQVlBQUFBQUVGWlVEVjNia0ZKUVVGRU5rcGhlWGhsVFhKZlMzbExTQUFBQUNRQUFBQUFNREU0TTJZNVl6VXRZV1V3WmkwME16RmhMV0kwTVdJdE9HVTJNRGcxTkRNM016QXgifQ&page%5Blimit%5D=5&sort=timestamp"}} + + ' + code: 200 + duration: '' + headers: + Content-Type: + - application/json + status: 200 OK +version: 1 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Search_pipelines_events_returns_OK_response_with_pagination.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Search_pipelines_events_returns_OK_response_with_pagination.freeze new file mode 100644 index 00000000000..3e3d130a4da --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Search_pipelines_events_returns_OK_response_with_pagination.freeze @@ -0,0 +1 @@ +2022-10-21T09:06:23.153Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Search_pipelines_events_returns_OK_response_with_pagination.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Search_pipelines_events_returns_OK_response_with_pagination.yaml new file mode 100644 index 00000000000..504f8578337 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Search_pipelines_events_returns_OK_response_with_pagination.yaml @@ -0,0 +1,53 @@ +interactions: +- request: + body: | + {"filter":{"from":"now-30s","to":"now"},"options":{"timezone":"GMT"},"page":{"limit":2},"sort":"timestamp"} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + url: https://api.datadoghq.com/api/v2/ci/pipelines/events/search + response: + body: '{"data":[{"id":"AgAAAYP5yrFQ-0eDTAAAAAAAAAAYAAAAAEFZUDV5ckZRQUFBLWxUZzA0Mm9yVVJJUwAAACQAAAAAMDE4M2Y5Y2EtYzhjMC00ZTVlLTk3ODktZTVlY2E0MzIyNmI3","type":"cipipeline","attributes":{"attributes":{"duration":399000000000,"github":{"conclusion":"success","html_url":"https://github.com/DataDog/repo","run_attempt":"1","event":"pull_request","app_id":"128890"},"git":{"commit":{"committer":{"date":"2022-10-21T08:58:59Z","name":"Joe","email":"support@datadoghq.com","date_timestamp":1666342739000},"author":{"name":"Joe","email":"support@datadoghq.com"},"message":"init","sha":"811f4ca3a6dcfe7b232dd3868ec405e9e492bb66"},"default_branch":"prod","repository_url":"https://github.com/DataDog/repo.git","repository":{"path":"/DataDog/repo.git","scheme":"https","name":"DataDog/repo","host":"github.com","id":"github.com/DataDog/repo"},"branch":"erkang.zhang/SYM-390/cache-test-spec"},"ci":{"pipeline":{"number":4218,"name":"ESLint","id":"3296133341-1","url":"https://github.com/DataDog/repo/actions/runs/3296133341/attempts/1"},"provider":{"instance":"github-actions","name":"github"},"status":"success"},"_top_level":1,"start":1666342755000000000},"ci_level":"pipeline","tags":["source:apm","source:apm"]}},{"id":"AgAAAYP5yr0I0OC-XAAAAAAAAAAYAAAAAEFZUDV5cjBJQUFEekl2RnhRMGRpbFYyUwAAACQAAAAAMDE4M2Y5Y2EtYzhjMC00ZTVlLTk3ODktZTVlY2E0MzIyNmI3","type":"cipipeline","attributes":{"attributes":{"duration":166000000000,"git":{"commit":{"committer":{"date":"2022-10-21T10:57:28+02:00","date_timestamp":1666342648000},"author":{"name":"Joe","email":"support@datadoghq.com"},"message":"Merge + pull request #39486 from DataDog/repo/output-using-sketches\n\n[RUM] Output + using sketches","sha":"07cb4950a3a0250e0808516108a04e432a3dcec7"},"default_branch":"cireliability/do-not-change-default-branch","repository_url":"https://gitlab.site.io/DataDog/repo.git","repository":{"path":"/DataDog/repo.git","scheme":"https","name":"DataDog/repo","host":"gitlab.site.io","id":"gitlab.site.io/DataDog/repo"},"branch":"prod"},"ci":{"pipeline":{"name":"DataDog/repo","downstream":true,"id":"10623021","url":"https://gitlab.site.io/DataDog/repo/pipelines/10623021"},"provider":{"instance":"gitlab-ci","name":"gitlab"},"is_manual":false,"parameters":["BASE_IMAGE_REPO:registry.site.io/logs-backend-base","BASE_VERSION:71","BAZEL_CI_IMAGE:registry.site.io/bazel:5@sha256:ec15d3a9e2131605d5e0fe486b9af09770b27c94a0671e5bc81a0052efc7eaac","BUILD_ECR_ID:486234852809","BUILD_IMAGE:486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/logs-backend/java-builder","BUILD_IMAGE_TAG:48","CURRENT_STAGING:staging-42","DD_AGENT_HOST:","DD_ENV_TESTS:ci","DD_INTEGRATION_JUNIT_ENABLED:true","DD_INTEGRATION_MONGO_ENABLED:false","DD_INTEGRATION_OPENTRACING_ENABLED:true","DD_POSTGRES_URL:jdbc:postgresql://postgres/dogdata","DD_SERVICE:logs-backend-tests","DD_TRACING_ENABLED:true","DOCKER_IMAGE_VERSION:20.10.3","DRE_BAZEL_RULE:","DYNAMIC_BUILD_IMAGE_VERSION:dynamicbuilder-v3319810-6f683f57","ENABLE_SNAPSHOTTED_CHARTS:true","FDB_DEB_URL:https://github.com/apple/foundationdb/releases/download/6.2.30/foundationdb-clients_6.2.30-1_amd64.deb","GIT_BASE_BRANCH:prod","GIT_DEPTH:96","GO_VERSION:1.15","JAVA_VERSION:azul-17-34-19","KUBERNETES_SERVICE_ACCOUNT_OVERWRITE:logs-backend","MAVEN_CLI_OPTS:--settings + .ci/settings.xml --batch-mode --errors --no-transfer-progress --show-version + -DisCI=true -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn + -Dorg.slf4j.simpleLogger.showDateTime=true -Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss + -Dsurefire.rerunFailingTestsCount=2","MAVEN_ENV:-XX:MaxRAMPercentage=50 -Djava.awt.headless=true + -Djava.net.preferIPv4Stack=true","MAVEN_OPTS:-Dmaven.repo.local=/.m2 -XX:MaxRAMPercentage=50 + -Djava.awt.headless=true -Djava.net.preferIPv4Stack=true","S3_BUCKET:s3://dd-ci-artefacts-build-stable/logs-backend","S3_BUCKET_PIPELINE_PATH:s3://dd-ci-artefacts-build-stable/logs-backend/10623014","S3_DDBUILD_MIRROR:s3://binaries.site.io/logs-backend/mirror","S3_DDBUILD_RELEASE:s3://binaries.site.io/logs-backend/release","S3_OPTS:--region + us-east-1 --sse AES256 --acl bucket-owner-full-control --only-show-errors","SLACK_NOTIFIER_IMAGE:486234852809.dkr.ecr.us-east-1.amazonaws.com/slack-notifier@sha256:d35e229b35ee0c6cedcb79a908dbca6c964f8a7eeaf82f4367d7e77eb93b9b44","TRACER_URL:https://repo1.maven.org/maven2/com/datadoghq/dd-java-agent/0.108.1/dd-java-agent-0.108.1.jar","TRACER_VERSION:0.108.1"],"status":"success"},"_top_level":1,"start":1666342991000000000,"gitlab":{"pipeline_source":"parent_pipeline","result":"passed"},"env":"prod","user":{"name":"halil.sener"}},"ci_level":"pipeline","tags":["source:apm","source:apm"]}}],"meta":{"page":{"after":"eyJhZnRlciI6IkFnQUFBWVA1eXIwSTBPQy1YQUFBQUFBQUFBQVlBQUFBQUVGWlVEVjVjakJKUVVGRWVrbDJSbmhSTUdScGJGWXlVd0FBQUNRQUFBQUFNREU0TTJZNVkyRXRZemhqTUMwMFpUVmxMVGszT0RrdFpUVmxZMkUwTXpJeU5tSTMifQ"}},"links":{"next":"https://api.datadoghq.com/api/v2/ci/pipelines/events?filter%5Bfrom%5D=now-30s&filter%5Bto%5D=now&page%5Bcursor%5D=eyJhZnRlciI6IkFnQUFBWVA1eXIwSTBPQy1YQUFBQUFBQUFBQVlBQUFBQUVGWlVEVjVjakJKUVVGRWVrbDJSbmhSTUdScGJGWXlVd0FBQUNRQUFBQUFNREU0TTJZNVkyRXRZemhqTUMwMFpUVmxMVGszT0RrdFpUVmxZMkUwTXpJeU5tSTMifQ&page%5Blimit%5D=2&sort=timestamp"}} + + ' + code: 200 + duration: '' + headers: + Content-Type: + - application/json + status: 200 OK +- request: + body: | + {"filter":{"from":"now-30s","to":"now"},"options":{"timezone":"GMT"},"page":{"cursor":"eyJhZnRlciI6IkFnQUFBWVA1eXIwSTBPQy1YQUFBQUFBQUFBQVlBQUFBQUVGWlVEVjVjakJKUVVGRWVrbDJSbmhSTUdScGJGWXlVd0FBQUNRQUFBQUFNREU0TTJZNVkyRXRZemhqTUMwMFpUVmxMVGszT0RrdFpUVmxZMkUwTXpJeU5tSTMifQ","limit":2},"sort":"timestamp"} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + url: https://api.datadoghq.com/api/v2/ci/pipelines/events/search + response: + body: '{"data":[],"meta":{"page":{"after":"eyJhZnRlciI6IkFnQUFBWVA1eXIwSTBPQy1YZ0FBQUFBQUFBQVlBQUFBQUVGWlVEVjVjakJKUVVGRVN6aHhYekY1VVVSVGFXd3lVd0FBQUNRQUFBQUFNREU0TTJZNVkyRXRZemhqTUMwMFpUVmxMVGszT0RrdFpUVmxZMkUwTXpJeU5tSTMifQ"}},"links":{"next":"https://api.datadoghq.com/api/v2/ci/pipelines/events?filter%5Bfrom%5D=now-30s&filter%5Bto%5D=now&page%5Bcursor%5D=eyJhZnRlciI6IkFnQUFBWVA1eXIwSTBPQy1YZ0FBQUFBQUFBQVlBQUFBQUVGWlVEVjVjakJKUVVGRVN6aHhYekY1VVVSVGFXd3lVd0FBQUNRQUFBQUFNREU0TTJZNVkyRXRZemhqTUMwMFpUVmxMVGszT0RrdFpUVmxZMkUwTXpJeU5tSTMifQ&page%5Blimit%5D=2&sort=timestamp"}} + + ' + code: 200 + duration: '' + headers: + Content-Type: + - application/json + status: 200 OK +version: 1 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Tests/Scenario_Aggregate_tests_events_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Tests/Scenario_Aggregate_tests_events_returns_OK_response.freeze new file mode 100644 index 00000000000..97202ca57d3 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Tests/Scenario_Aggregate_tests_events_returns_OK_response.freeze @@ -0,0 +1 @@ +2022-10-21T14:50:52.443Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Tests/Scenario_Aggregate_tests_events_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Tests/Scenario_Aggregate_tests_events_returns_OK_response.yaml new file mode 100644 index 00000000000..7c8f763b668 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Tests/Scenario_Aggregate_tests_events_returns_OK_response.yaml @@ -0,0 +1,23 @@ +interactions: +- request: + body: | + {"compute":[{"aggregation":"count","metric":"@test.is_flaky","type":"total"}],"filter":{"from":"now-15m","query":"@language:(python OR go)","to":"now"},"group_by":[{"facet":"@git.branch","limit":10,"sort":{"order":"asc"},"total":false}],"options":{"timezone":"GMT"},"page":{"limit":25}} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + url: https://api.datadoghq.com/api/v2/ci/tests/analytics/aggregate + response: + body: '{"meta":{"page":{"after":"eyJhZnRlciI6eyJAZ2l0LmJyYW5jaCI6WyJDTElQLTM4MSIsImFsZWphbmRyby50b3JyZXMvbWlncmF0ZS10by1uZXctaG1zLWVuZHBvaW50IiwiYW1vbmdpbC9hZGQtcmF0ZS1saW1pdC1uYW1lLW1ldGFkYXRhLXRvLWFwaXZpZXdlciIsImFzYWQxMTIzL3Jlc3BvbmRlci10eXBlcy1xYS1maXhlcyIsImF3L2RleHN0ci10YWdzLWZvci1rZXkiLCJjcmVhdGVfaW52aXRlX29yZ19hcGkiLCJkYXZlLmhhbmR5L2ZpeC1uby1yZXNvdXJjZWlkIiwiZWRyZXZvL2dpdGRiLW1lbW9yeS1sZWFrIiwiZmlzaGVyL2FkZC1rOHMtbmFtZXNwYWNlcyIsImZsb3JlbnRjbGFycmV0L215cHktZXhjbHVkZSJdfX0"},"elapsed":43,"request_id":"pddv1ChZoVGp4aTdKV1FYQ1ZoM19LUF90eGx3IiwKHB0cQpJ-X_9gd5n7p8wRMAoRGyyFQlDJbjpK5SkSDEclibMc2UXCLboJqw","status":"done"},"data":{"buckets":[{"by":{"@git.branch":"branch1"},"computes":{"c0":345}},{"by":{"@git.branch":"branch2"},"computes":{"c0":309}},{"by":{"@git.branch":"branch2"},"computes":{"c0":30597}},{"by":{"@git.branch":"branch3"},"computes":{"c0":43457}},{"by":{"@git.branch":"branch3"},"computes":{"c0":96}},{"by":{"@git.branch":"branch4"},"computes":{"c0":382}},{"by":{"@git.branch":"branch5"},"computes":{"c0":16891}},{"by":{"@git.branch":"branch6"},"computes":{"c0":93}},{"by":{"@git.branch":"branch7"},"computes":{"c0":46490}},{"by":{"@git.branch":"branch8"},"computes":{"c0":370}}]}} + + ' + code: 200 + duration: '' + headers: + Content-Type: + - application/json + status: 200 OK +version: 1 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Tests/Scenario_Get_a_list_of_tests_events_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Tests/Scenario_Get_a_list_of_tests_events_returns_OK_response.freeze new file mode 100644 index 00000000000..7334ba1ff6c --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Tests/Scenario_Get_a_list_of_tests_events_returns_OK_response.freeze @@ -0,0 +1 @@ +2022-10-21T14:59:21.171Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Tests/Scenario_Get_a_list_of_tests_events_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Tests/Scenario_Get_a_list_of_tests_events_returns_OK_response.yaml new file mode 100644 index 00000000000..bd46b503fdf --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Tests/Scenario_Get_a_list_of_tests_events_returns_OK_response.yaml @@ -0,0 +1,33 @@ +interactions: +- request: + body: '' + form: {} + headers: + Accept: + - application/json + method: GET + url: https://api.datadoghq.com/api/v2/ci/tests/events?filter%5Bquery%5D=%40test.service%3Aweb-ui-tests&filter%5Bfrom%5D=2022-10-21T14%3A58%3A51.171Z&filter%5Bto%5D=2022-10-21T14%3A59%3A21.171Z&page%5Blimit%5D=5 + response: + body: '{"data":[{"id":"AQAAAYP7DjkT1jtY0AAAAABBWVA3RGprVEFBQXFjVllsa2kwWm1LZGU","type":"citest","attributes":{"test_level":"test","attributes":{"test_suite":{"fingerprint":"863929e666e072fd"},"test":{"framework_version":"0.0.2","codeowners":["@DataDog/repo"],"source":{"file":"javascript/datadog/organization-settings/components/sensitive-data-scanner/sensitive-data-scanner-validation.unit.ts"},"type":"test","has_parameters":false,"jest":{"test_runner":"jest-circus"},"command":"jest + --config jest.coverage.config.js --color --ci --silent --maxWorkers=7","framework":"jest","suite":"javascript/datadog/organization-settings/components/sensitive-data-scanner/sensitive-data-scanner-validation.unit.ts","full_name":"javascript/datadog/organization-settings/components/sensitive-data-scanner/sensitive-data-scanner-validation.unit.ts.shouldDisplaySensitiveDataWarning + it should not display a warning for an empty string: \"\"","service":"web-ui-tests","name":"shouldDisplaySensitiveDataWarning + it should not display a warning for an empty string: \"\"","fingerprint":"59d10d35bcee973b","status":"pass"},"os":{"version":"5.15.0-1017-aws","platform":"linux","architecture":"x64"},"ci":{"pipeline":{"number":479980,"name":"DataDog/repo","id":"10631816","url":"https://gitlab.site.io/DataDog/repo/pipelines/10631816"},"workspace_path":"/go/src/github.com/DataDog/repo","stage":{"name":"optional-jobs"},"provider":{"name":"gitlab"},"job":{"name":"unit-test-coverage","url":"https://gitlab.site.io/DataDog/repo/-/jobs/184832404"}},"sampling":{"priority":1},"start":1666364356883000320,"runtime":{"name":"node","version":"v16.3.0"},"language":"javascript","env":"ci","version":"0.0.2","duration":401123,"test_session":{"fingerprint":"d0266bed689fa60c"},"library_version":"3.4.0","git":{"commit":{"committer":{"date":"2022-10-21T14:49:17+00:00","name":"GitHub","email":"noreply@github.com","date_timestamp":1666363757000},"author":{"date":"2022-10-21T14:49:17+00:00","name":"Joe","email":"support@datadoghq.com","date_timestamp":1666363757000},"message":"Remove + suppression modal typo (#70411)\n\nCo-authored-by: r@datadoghq.com","sha":"d04246da2ddbf9ceb599e7f4b5b5cbbca315bc0a"},"repository_url":"https://gitlab.site.io/DataDog/repo.git","repository":{"path":"/DataDog/repo.git","scheme":"https","name":"DataDog/repo","host":"gitlab.site.io","id":"gitlab.site.io/DataDog/repo"},"branch":"preprod"},"service":"web-ui-tests","runtime-id":"8d4be021-f2f7-4e63-b3c3-93d62ba0d1fa"},"tags":["source:apm","source:apm"]}},{"id":"AQAAAYP7DjhlyuNS-QAAAABBWVA3RGpobEFBRHoyX3Nfd21QQktySkE","type":"citest","attributes":{"test_level":"test","attributes":{"test_suite":{"fingerprint":"b50f2adbaf2118cd"},"test":{"framework_version":"0.0.2","codeowners":["@DataDog/repo"],"source":{"file":"javascript/datadog/workflow-automation/lib/shared/validation.unit.ts"},"type":"test","has_parameters":true,"jest":{"test_runner":"jest-circus"},"command":"jest + --config jest.browser.config.js --color --ci --silent --maxWorkers=7","framework":"jest","suite":"javascript/datadog/workflow-automation/lib/shared/validation.unit.ts","full_name":"javascript/datadog/workflow-automation/lib/shared/validation.unit.ts.Validate + XML Should identifies good and bad XML","service":"web-ui-tests","name":"Validate + XML Should identifies good and bad XML","fingerprint":"fe78dde37925d00d","parameters":"{\"arguments\":[\"foo\",false],\"metadata\":{}}","status":"pass"},"os":{"version":"5.15.0-1017-aws","platform":"linux","architecture":"x64"},"ci":{"pipeline":{"number":479973,"name":"DataDog/repo","id":"10631599","url":"https://gitlab.site.io/DataDog/repo/pipelines/10631599"},"workspace_path":"/go/src/github.com/DataDog/repo","stage":{"name":"test"},"provider":{"name":"gitlab"},"job":{"name":"unit-test","url":"https://gitlab.site.io/DataDog/repo/-/jobs/184829344"}},"sampling":{"priority":1},"start":1666364356707000320,"runtime":{"name":"node","version":"v16.3.0"},"language":"javascript","env":"ci","version":"0.0.2","duration":2591797,"test_session":{"fingerprint":"6bf54b12dc4341b8"},"library_version":"3.4.0","git":{"commit":{"committer":{"date":"2022-10-21T23:44:50+09:00","name":"GitHub","email":"noreply@github.com","date_timestamp":1666363490000},"author":{"date":"2022-10-21T23:44:50+09:00","name":"Joe","email":"support@datadoghq.com","date_timestamp":1666363490000},"message":"Merge + branch ''preprod'' into babbins/core-app-docs-landing-page","sha":"dbd090f623d681a7b6a65acb826ccf3968bb5d91"},"repository_url":"https://gitlab.site.io/DataDog/repo.git","repository":{"path":"/DataDog/repo.git","scheme":"https","name":"DataDog/repo","host":"gitlab.site.io","id":"gitlab.site.io/DataDog/repo"},"branch":"babbins/core-app-docs-landing-page"},"service":"web-ui-tests","runtime-id":"7020ff7c-a7f9-466d-9124-84720cdfd15c"},"tags":["source:apm","source:apm"]}},{"id":"AQAAAYP7DjhfyuNS4wAAAABBWVA3RGpoZkFBQXVhaUhDM2JqdXJrY1c","type":"citest","attributes":{"test_level":"test","attributes":{"test_suite":{"fingerprint":"ea677b198d03d0f1"},"test":{"framework_version":"0.0.2","codeowners":["@DataDog/repo"],"source":{"file":"internal-apps/sdp/src/components/jira-template/TeamBoardCreator/__test__/TeamBoardCreator.unit.jsx"},"type":"test","has_parameters":false,"jest":{"test_runner":"jest-circus"},"command":"jest + --config jest.browser.config.js --color --testNamePattern=\\[flaky\\] --ci --silent + --maxWorkers=7","framework":"jest","suite":"internal-apps/sdp/src/components/jira-template/TeamBoardCreator/__test__/TeamBoardCreator.unit.jsx","full_name":"internal-apps/sdp/src/components/jira-template/TeamBoardCreator/__test__/TeamBoardCreator.unit.jsx.TeamBoardCreator + Show Error Message for Bad Mutation found in Errors","service":"web-ui-tests","name":"TeamBoardCreator + Show Error Message for Bad Mutation found in Errors","fingerprint":"65589132d12f5a9","status":"skip"},"os":{"version":"5.15.0-1017-aws","platform":"linux","architecture":"x64"},"ci":{"pipeline":{"number":479992,"name":"DataDog/repo","id":"10632081","url":"https://gitlab.site.io/DataDog/repo/pipelines/10632081"},"workspace_path":"/go/src/github.com/DataDog/repo","stage":{"name":"optional-jobs"},"provider":{"name":"gitlab"},"job":{"name":"unit-test-flaky","url":"https://gitlab.site.io/DataDog/repo/-/jobs/184836749"}},"sampling":{"priority":1},"start":1666364356703001344,"runtime":{"name":"node","version":"v16.3.0"},"language":"javascript","env":"ci","version":"0.0.2","duration":14160,"test_session":{"fingerprint":"6957ad04dea312d6"},"library_version":"3.4.0","git":{"commit":{"committer":{"date":"2022-10-21T10:55:42-04:00","name":"GitHub","email":"noreply@github.com","date_timestamp":1666364142000},"author":{"date":"2022-10-21T10:55:42-04:00","name":"alpinet","email":"46504578+alpinet@users.noreply.github.com","date_timestamp":1666364142000},"message":"Merge + branch ''preprod'' into alpinet/stripe_tile","sha":"00c36e494ce1db0ef34245024904ae09f995a382"},"repository_url":"https://gitlab.site.io/DataDog/repo.git","repository":{"path":"/DataDog/repo.git","scheme":"https","name":"DataDog/repo","host":"gitlab.site.io","id":"gitlab.site.io/DataDog/repo"},"branch":"alpinet/stripe_tile"},"service":"web-ui-tests","runtime-id":"6e821bb2-2f25-4b80-9f0e-168ce1dc57e5"},"tags":["source:apm","source:apm"]}}],"meta":{"page":{"after":"eyJhZnRlciI6IkFRQUFBWVA3RGpoYWdVb3luQUFBQUFCQldWQTNSR3BvWVVGQlFVaFJSamR3TWtKRlRXWklOVEkifQ"}},"links":{"next":"https://api.datadoghq.com/api/v2/ci/tests/events?filter%5Bfrom%5D=2022-10-21T14%3A58%3A51.171Z&filter%5Bquery%5D=%40test.service%3Aweb-ui-tests&filter%5Bto%5D=2022-10-21T14%3A59%3A21.171Z&page%5Bcursor%5D=eyJhZnRlciI6IkFRQUFBWVA3RGpoYWdVb3luQUFBQUFCQldWQTNSR3BvWVVGQlFVaFJSamR3TWtKRlRXWklOVEkifQ&page%5Blimit%5D=5"}} + + ' + code: 200 + duration: '' + headers: + Content-Type: + - application/json + status: 200 OK +version: 1 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Tests/Scenario_Get_a_list_of_tests_events_returns_OK_response_with_pagination.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Tests/Scenario_Get_a_list_of_tests_events_returns_OK_response_with_pagination.freeze new file mode 100644 index 00000000000..fd415c02d43 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Tests/Scenario_Get_a_list_of_tests_events_returns_OK_response_with_pagination.freeze @@ -0,0 +1 @@ +2022-10-21T14:44:11.511Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Tests/Scenario_Get_a_list_of_tests_events_returns_OK_response_with_pagination.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Tests/Scenario_Get_a_list_of_tests_events_returns_OK_response_with_pagination.yaml new file mode 100644 index 00000000000..a31d21caea4 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Tests/Scenario_Get_a_list_of_tests_events_returns_OK_response_with_pagination.yaml @@ -0,0 +1,45 @@ +interactions: +- request: + body: '' + form: {} + headers: + Accept: + - application/json + method: GET + url: https://api.datadoghq.com/api/v2/ci/tests/events?filter%5Bfrom%5D=2022-10-21T14%3A43%3A41.511Z&filter%5Bto%5D=2022-10-21T14%3A44%3A11.511Z&page%5Blimit%5D=2 + response: + body: '{"data":[{"id":"AQAAAYP7AGGfo7r-agAAAABBWVA3QUdHZkFBQlRMSUtLNkdvWHZNSUs","type":"citest","attributes":{"test_level":"test","attributes":{"test_suite":{"fingerprint":"6c8995a36c21161e"},"test":{"framework_version":"0.0.2","codeowners":["@DataDog/repo"],"source":{"file":"javascript/datadog/dashboard/components/widgets/AlertGraph/alert-graph.utils.unit.ts"},"type":"test","has_parameters":false,"jest":{"test_runner":"jest-circus"},"command":"jest + --config jest.browser.config.js --color --ci --silent --maxWorkers=7","framework":"jest","suite":"javascript/datadog/dashboard/components/widgets/AlertGraph/alert-graph.utils.unit.ts","full_name":"javascript/datadog/dashboard/components/widgets/AlertGraph/alert-graph.utils.unit.ts.Alert + Graph utils getAlertPeriod should return the alert period","service":"web-ui-tests","name":"Alert + Graph utils getAlertPeriod should return the alert period","fingerprint":"cf1b658113e4fe46","status":"pass"},"os":{"version":"5.15.0-1017-aws","platform":"linux","architecture":"x64"},"ci":{"pipeline":{"number":479961,"name":"DataDog/repo","id":"10631454","url":"https://gitlab.site.io/DataDog/repo/pipelines/10631454"},"workspace_path":"/go/src/github.com/DataDog/repo","stage":{"name":"test"},"provider":{"name":"gitlab"},"job":{"name":"unit-test","url":"https://gitlab.site.io/DataDog/repo/-/jobs/184825583"}},"sampling":{"priority":1},"start":1666363449758001664,"runtime":{"name":"node","version":"v16.3.0"},"language":"javascript","env":"ci","version":"0.0.2","duration":1797119,"test_session":{"fingerprint":"6bf54b12dc4341b8"},"library_version":"3.4.0","git":{"commit":{"committer":{"date":"2022-10-21T10:39:58-04:00","name":"GitHub","email":"noreply@github.com","date_timestamp":1666363198000},"author":{"date":"2022-10-21T10:39:58-04:00","name":"Joe","email":"support@datadoghq.com","date_timestamp":1666363198000},"message":"Merge + branch ''preprod'' into zach.anderson/sendgrid_last_login","sha":"ddc2d8cf8a68ca7c67553ea12d41b0df5d069bf7"},"repository_url":"https://gitlab.site.io/DataDog/repo.git","repository":{"path":"/DataDog/repo.git","scheme":"https","name":"DataDog/repo","host":"gitlab.site.io","id":"gitlab.site.io/DataDog/repo"},"branch":"zach.anderson/sendgrid_last_login"},"service":"web-ui-tests","runtime-id":"d3f4759f-5bda-4dab-a494-0736b2671798"},"tags":["source:apm","source:apm"]}},{"id":"AQAAAYP7AGE4o7r-XAAAAABBWVA3QUdFNEFBQ20wc3BXLWNYUDB5Z1M","type":"citest","attributes":{"test_level":"test","attributes":{"test_suite":{"fingerprint":"18538434d1355cce"},"test":{"framework_version":"0.0.2","codeowners":["@DataDog/repo"],"source":{"file":"javascript/datadog/logs/components/UnifiedExplorer/export-csv.helpers.unit.ts"},"type":"test","has_parameters":false,"jest":{"test_runner":"jest-circus"},"command":"jest + --config jest.browser.config.js --color --ci --silent --maxWorkers=7","framework":"jest","suite":"javascript/datadog/logs/components/UnifiedExplorer/export-csv.helpers.unit.ts","full_name":"javascript/datadog/logs/components/UnifiedExplorer/export-csv.helpers.unit.ts.sanitizeCell + should add a single-quote at the beginning if necessary (cell='''')","service":"web-ui-tests","name":"sanitizeCell + should add a single-quote at the beginning if necessary (cell='''')","fingerprint":"e1234fc553a164","status":"pass"},"os":{"version":"5.15.0-1017-aws","platform":"linux","architecture":"x64"},"ci":{"pipeline":{"number":479954,"name":"DataDog/repo","id":"10631295","url":"https://gitlab.site.io/DataDog/repo/pipelines/10631295"},"workspace_path":"/go/src/github.com/DataDog/repo","stage":{"name":"test"},"provider":{"name":"gitlab"},"job":{"name":"unit-test","url":"https://gitlab.site.io/DataDog/repo/-/jobs/184822096"}},"sampling":{"priority":1},"start":1666363449656001024,"runtime":{"name":"node","version":"v16.3.0"},"language":"javascript","env":"ci","version":"0.0.2","duration":961670,"test_session":{"fingerprint":"6bf54b12dc4341b8"},"library_version":"3.4.0","git":{"commit":{"committer":{"date":"2022-10-21T14:33:58+00:00","name":"GitHub","email":"noreply@github.com","date_timestamp":1666362838000},"author":{"date":"2022-10-21T14:33:58+00:00","name":"temporal-github-worker-1[bot]","email":"83676731+temporal-github-worker-1[bot]@users.noreply.github.com","date_timestamp":1666362838000},"message":"{\"base_commit\":\"000e36971943d45210e6c019e1ed6f5fb3f182c5\",\"head_commit\":\"87bfaa65b1d93acae749a437b4265d1535e0bcdb\"}\n","sha":"0756e4459a560f921c497b5054e7406e812fba70"},"repository_url":"https://gitlab.site.io/DataDog/repo.git","repository":{"path":"/DataDog/repo.git","scheme":"https","name":"DataDog/repo","host":"gitlab.site.io","id":"gitlab.site.io/DataDog/repo"},"branch":"mq-working-branch-6edc20d"},"service":"web-ui-tests","runtime-id":"9878210e-f42c-4786-b3e3-b2203dd4bfc1"},"tags":["source:apm","source:apm"]}}],"meta":{"page":{"after":"eyJhZnRlciI6IkFRQUFBWVA3QUdFNG83ci1YQUFBQUFCQldWQTNRVWRGTkVGQlEyMHdjM0JYTFdOWVVEQjVaMU0ifQ"}},"links":{"next":"https://api.datadoghq.com/api/v2/ci/tests/events?filter%5Bfrom%5D=2022-10-21T14%3A43%3A41.511Z&filter%5Bto%5D=2022-10-21T14%3A44%3A11.511Z&page%5Bcursor%5D=eyJhZnRlciI6IkFRQUFBWVA3QUdFNG83ci1YQUFBQUFCQldWQTNRVWRGTkVGQlEyMHdjM0JYTFdOWVVEQjVaMU0ifQ&page%5Blimit%5D=2"}} + + ' + code: 200 + duration: '' + headers: + Content-Type: + - application/json + status: 200 OK +- request: + body: '' + form: {} + headers: + Accept: + - application/json + method: GET + url: https://api.datadoghq.com/api/v2/ci/tests/events?filter%5Bfrom%5D=2022-10-21T14%3A43%3A41.511Z&filter%5Bto%5D=2022-10-21T14%3A44%3A11.511Z&page%5Blimit%5D=2&page%5Bcursor%5D=eyJhZnRlciI6IkFRQUFBWVA3QUdFNG83ci1YQUFBQUFCQldWQTNRVWRGTkVGQlEyMHdjM0JYTFdOWVVEQjVaMU0ifQ + response: + body: '{"data":[],"meta":{"page":{"after":"eyJhZnRlciI6IkFRQUFBWVA3QUdCdmxSc1pDd0FBQUFCQldWQTNRVWRDZGtGQlFtUlViV0ZTVVhKZmFFVXpiMWcifQ"}},"links":{"next":"https://api.datadoghq.com/api/v2/ci/tests/events?filter%5Bfrom%5D=2022-10-21T14%3A43%3A41.511Z&filter%5Bto%5D=2022-10-21T14%3A44%3A11.511Z&page%5Bcursor%5D=eyJhZnRlciI6IkFRQUFBWVA3QUdCdmxSc1pDd0FBQUFCQldWQTNRVWRDZGtGQlFtUlViV0ZTVVhKZmFFVXpiMWcifQ&page%5Blimit%5D=2"}} + + ' + code: 200 + duration: '' + headers: + Content-Type: + - application/json + status: 200 OK +version: 1 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Tests/Scenario_Search_tests_events_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Tests/Scenario_Search_tests_events_returns_OK_response.freeze new file mode 100644 index 00000000000..ea2643c6e84 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Tests/Scenario_Search_tests_events_returns_OK_response.freeze @@ -0,0 +1 @@ +2022-10-21T15:04:00.502Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Tests/Scenario_Search_tests_events_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Tests/Scenario_Search_tests_events_returns_OK_response.yaml new file mode 100644 index 00000000000..945385968bc --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Tests/Scenario_Search_tests_events_returns_OK_response.yaml @@ -0,0 +1,38 @@ +interactions: +- request: + body: | + {"filter":{"from":"now-15m","query":"@test.service:web-ui-tests AND @test.status:skip","to":"now"},"options":{"timezone":"GMT"},"page":{"limit":25},"sort":"timestamp"} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + url: https://api.datadoghq.com/api/v2/ci/tests/events/search + response: + body: '{"data":[{"id":"AQAAAYP7BNMIuIAxxAAAAABBWVA3Qk5NSUFBQ3dKNTJFSjhrZXlTZ0s","type":"citest","attributes":{"test_level":"test","attributes":{"test_suite":{"fingerprint":"821da1fe0511456d"},"test":{"framework_version":"0.0.2","codeowners":["@DataDog/repo"],"source":{"file":"javascript/datadog/apps-sdk/internal/lib/managers/app-manager-with-controller/controller-manager.unit.ts"},"type":"test","has_parameters":false,"jest":{"test_runner":"jest-circus"},"command":"jest + --config jest.browser.config.js --color --testNamePattern=\\[flaky\\] --ci --silent + --maxWorkers=7","framework":"jest","suite":"javascript/datadog/apps-sdk/internal/lib/managers/app-manager-with-controller/controller-manager.unit.ts","full_name":"javascript/datadog/apps-sdk/internal/lib/managers/app-manager-with-controller/controller-manager.unit.ts.request() + delegates to the main iframe controller request method","service":"web-ui-tests","name":"request() + delegates to the main iframe controller request method","fingerprint":"3dbce8739d2972f9","status":"skip"},"os":{"version":"5.15.0-1017-aws","platform":"linux","architecture":"x64"},"ci":{"pipeline":{"number":479973,"name":"DataDog/repo","id":"10631599","url":"https://gitlab.site.io/DataDog/repo/pipelines/10631599"},"workspace_path":"/go/src/github.com/DataDog/repo","stage":{"name":"optional-jobs"},"provider":{"name":"gitlab"},"job":{"name":"unit-test-flaky","url":"https://gitlab.site.io/DataDog/repo/-/jobs/184829407"}},"sampling":{"priority":1},"start":1666363740936000512,"runtime":{"name":"node","version":"v16.3.0"},"language":"javascript","env":"ci","version":"0.0.2","duration":18799,"test_session":{"fingerprint":"6957ad04dea312d6"},"library_version":"3.4.0","git":{"commit":{"committer":{"date":"2022-10-21T23:44:50+09:00","name":"GitHub","email":"noreply@github.com","date_timestamp":1666363490000},"author":{"date":"2022-10-21T23:44:50+09:00","name":"Joe","email":"support@datadoghq.com","date_timestamp":1666363490000},"message":"Merge + branch ''preprod'' into babbins/core-app-docs-landing-page","sha":"dbd090f623d681a7b6a65acb826ccf3968bb5d91"},"repository_url":"https://gitlab.site.io/DataDog/repo.git","repository":{"path":"/DataDog/repo.git","scheme":"https","name":"DataDog/repo","host":"gitlab.site.io","id":"gitlab.site.io/DataDog/repo"},"branch":"babbins/core-app-docs-landing-page"},"service":"web-ui-tests","runtime-id":"1f3e8a86-145c-4856-9e13-5228bed9a30e"},"tags":["source:apm","source:apm"]}},{"id":"AQAAAYP7BNMIR5G-XgAAAABBWVA3Qk5NSUFBQ3BDUTR2ZlFfMDRQQUo","type":"citest","attributes":{"test_level":"test","attributes":{"test_suite":{"fingerprint":"b3887a56ac7dce6b"},"test":{"framework_version":"0.0.2","codeowners":["@DataDog/repo"],"source":{"file":"javascript/datadog/trace/components/trace/SpanNetworks/span-networks.unit.tsx"},"type":"test","has_parameters":false,"jest":{"test_runner":"jest-circus"},"command":"jest + --config jest.browser.config.js --color --testNamePattern=\\[flaky\\] --ci --silent + --maxWorkers=7","framework":"jest","suite":"javascript/datadog/trace/components/trace/SpanNetworks/span-networks.unit.tsx","full_name":"javascript/datadog/trace/components/trace/SpanNetworks/span-networks.unit.tsx.getDefaultFilter() + should return a container filter","service":"web-ui-tests","name":"getDefaultFilter() + should return a container filter","fingerprint":"133b6d44468c6022","status":"skip"},"os":{"version":"5.15.0-1017-aws","platform":"linux","architecture":"x64"},"ci":{"pipeline":{"number":479966,"name":"DataDog/repo","id":"10631485","url":"https://gitlab.site.io/DataDog/repo/pipelines/10631485"},"workspace_path":"/go/src/github.com/DataDog/repo","stage":{"name":"optional-jobs"},"provider":{"name":"gitlab"},"job":{"name":"unit-test-flaky","url":"https://gitlab.site.io/DataDog/repo/-/jobs/184826196"}},"sampling":{"priority":1},"start":1666363740936000768,"runtime":{"name":"node","version":"v16.3.0"},"language":"javascript","env":"ci","version":"0.0.2","duration":19287,"test_session":{"fingerprint":"6957ad04dea312d6"},"library_version":"3.4.0","git":{"commit":{"committer":{"date":"2022-10-21T10:40:38-04:00","name":"GitHub","email":"noreply@github.com","date_timestamp":1666363238000},"author":{"date":"2022-10-21T10:40:38-04:00","name":"Joe","email":"support@datadoghq.com","date_timestamp":1666363238000},"message":"Merge + branch ''preprod'' into alpinet/github_api_endpoint_ticket","sha":"c22e7de6ca6bcc4d58b960fce095ebdbc4fc693a"},"repository_url":"https://gitlab.site.io/DataDog/repo.git","repository":{"path":"/DataDog/repo.git","scheme":"https","name":"DataDog/repo","host":"gitlab.site.io","id":"gitlab.site.io/DataDog/repo"},"branch":"alpinet/github_api_endpoint_ticket"},"service":"web-ui-tests","runtime-id":"afa6f593-d5f0-4627-97c9-8753e83fc1e9"},"tags":["source:apm","source:apm"]}},{"id":"AQAAAYP7BNMJzoQeRQAAAABBWVA3Qk5NSkFBQV9kTGg3U1RCSWpTY1Q","type":"citest","attributes":{"test_level":"test","attributes":{"test_suite":{"fingerprint":"44abf7116df30562"},"test":{"framework_version":"0.0.2","codeowners":["@DataDog/repo"],"source":{"file":"javascript/datadog/dataviz/lib/stats/FrameTimer.unit.ts"},"type":"test","has_parameters":false,"jest":{"test_runner":"jest-circus"},"command":"jest + --config jest.browser.config.js --color --testNamePattern=\\[flaky\\] --ci --silent + --maxWorkers=7","framework":"jest","suite":"javascript/datadog/dataviz/lib/stats/FrameTimer.unit.ts","full_name":"javascript/datadog/dataviz/lib/stats/FrameTimer.unit.ts.FrameTimer + should capture timings with a GPU timer","service":"web-ui-tests","name":"FrameTimer + should capture timings with a GPU timer","fingerprint":"99424c8cd4b1362b","status":"skip"},"os":{"version":"5.15.0-1017-aws","platform":"linux","architecture":"x64"},"ci":{"pipeline":{"number":479961,"name":"DataDog/repo","id":"10631454","url":"https://gitlab.site.io/DataDog/repo/pipelines/10631454"},"workspace_path":"/go/src/github.com/DataDog/repo","stage":{"name":"optional-jobs"},"provider":{"name":"gitlab"},"job":{"name":"unit-test-flaky","url":"https://gitlab.site.io/DataDog/repo/-/jobs/184825642"}},"sampling":{"priority":1},"start":1666363740937000448,"runtime":{"name":"node","version":"v16.3.0"},"language":"javascript","env":"ci","version":"0.0.2","duration":18799,"test_session":{"fingerprint":"6957ad04dea312d6"},"library_version":"3.4.0","git":{"commit":{"committer":{"date":"2022-10-21T10:39:58-04:00","name":"GitHub","email":"noreply@github.com","date_timestamp":1666363198000},"author":{"date":"2022-10-21T10:39:58-04:00","name":"Joe","email":"support@datadoghq.com","date_timestamp":1666363198000},"message":"Merge + branch ''preprod'' into zach.anderson/sendgrid_last_login","sha":"ddc2d8cf8a68ca7c67553ea12d41b0df5d069bf7"},"repository_url":"https://gitlab.site.io/DataDog/repo.git","repository":{"path":"/DataDog/repo.git","scheme":"https","name":"DataDog/repo","host":"gitlab.site.io","id":"gitlab.site.io/DataDog/repo"},"branch":"zach.anderson/sendgrid_last_login"},"service":"web-ui-tests","runtime-id":"7efabaf6-197f-4fcc-9a4d-6ca6c85d3ae4"},"tags":["source:apm","source:apm"]}}],"meta":{"page":{"after":"eyJhZnRlciI6IkFRQUFBWVA3Qk5OWGUtNGVVQUFBQUFCQldWQTNRazVPV0VGQlJGUnBVbkkxZVU5MWJXSnpiM2MifQ"}},"links":{"next":"https://api.datadoghq.com/api/v2/ci/tests/events?filter%5Bfrom%5D=now-15m&filter%5Bquery%5D=%40test.service%3Aweb-ui-tests+AND+%40test.status%3Askip&filter%5Bto%5D=now&page%5Bcursor%5D=eyJhZnRlciI6IkFRQUFBWVA3Qk5OWGUtNGVVQUFBQUFCQldWQTNRazVPV0VGQlJGUnBVbkkxZVU5MWJXSnpiM2MifQ&page%5Blimit%5D=25&sort=timestamp"}} + + ' + code: 200 + duration: '' + headers: + Content-Type: + - application/json + status: 200 OK +version: 1 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Tests/Scenario_Search_tests_events_returns_OK_response_with_pagination.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Tests/Scenario_Search_tests_events_returns_OK_response_with_pagination.freeze new file mode 100644 index 00000000000..bc985f77bc0 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Tests/Scenario_Search_tests_events_returns_OK_response_with_pagination.freeze @@ -0,0 +1 @@ +2022-10-21T14:47:17.126Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Tests/Scenario_Search_tests_events_returns_OK_response_with_pagination.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Tests/Scenario_Search_tests_events_returns_OK_response_with_pagination.yaml new file mode 100644 index 00000000000..108c9d9bf0b --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Tests/Scenario_Search_tests_events_returns_OK_response_with_pagination.yaml @@ -0,0 +1,60 @@ +interactions: +- request: + body: | + {"filter":{"from":"now-15m","query":"@test.status:pass AND -@language:python","to":"now"},"page":{"limit":2},"sort":"timestamp"} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + url: https://api.datadoghq.com/api/v2/ci/tests/events/search + response: + body: '{"data":[{"id":"AQAAAYP69YODhSYeRgAAAABBWVA2OVlPREFBQjB3THBpOVlKQXRhMEg","type":"citest","attributes":{"test_level":"test","attributes":{"test_suite":{"fingerprint":"355d882863b0e6d8"},"test":{"suite":"github.com/DataDog/repo/apps/rocky/internal/catalog","full_name":"github.com/DataDog/repo/apps/rocky/internal/catalog.TestOverscan","codeowners":["@DataDog/repo"],"service":"dd-go-metrics-retrieval","name":"TestOverscan","fingerprint":"f156dcaa592eb047","type":"test","has_parameters":false,"status":"pass"},"os":{"version":"bionic"},"ci":{"pipeline":{"number":1669072,"name":"DataDog/repo","id":"10630527","url":"https://gitlab.site.io/DataDog/repo/pipelines/10630527"},"workspace_path":"/go/src/github.com/DataDog/repo","stage":{"name":"stage-1"},"provider":{"name":"gitlab"},"job":{"name":"test:go:race-bionic + 1/2","url":"https://gitlab.site.io/DataDog/repo/-/jobs/184817229"}},"start":1666362737539000000,"runtime":{"name":"go","version":"1.19.2"},"language":"go","env":"test","duration":0,"git":{"commit":{"committer":{"date":"2022-10-21T14:24:33+00:00","name":"ci.dd-go","email":"support@datadoghq.com","date_timestamp":1666362273000},"author":{"date":"2022-10-21T14:24:33+00:00","name":"ci.dd-go","email":"support@datadoghq.com","date_timestamp":1666362273000},"message":"Gitlab + merged prod (c5fd9a72b75448ff60ba078960fe0ba5e23d7050) to staging-43\n\nGitlab + merged prod (07bd1d762138e4b5bebc0f792cd26ef078c0d872) to staging-43\n\nGitlab + merged prod (4ac1ba5d2b28caccc0640182d90e2d99a5234584) to staging-43\n\nGitlab + merged prod (1c27b214276d2e70d502fdc7c840200faa3d80cf) to staging-43\n\nMerge + branch ''ting.tu/scheduling'' (06242fc) into staging-43\n\n pm_trace_id: 10629269\n + feature_branch_pipeline_id: 10629269\n source: to-staging\n\n* commit ''06242fcf113290ca0f273e23942d86f2fc803a6b'':\n update + nits\n Allow partial schedule\n","sha":"c34a29db1311b6945aaa644302a77f9bc30e2d7d"},"repository_url":"https://gitlab.site.io/DataDog/repo.git","repository":{"path":"/DataDog/repo.git","scheme":"https","name":"DataDog/repo","host":"gitlab.site.io","id":"gitlab.site.io/DataDog/repo"},"branch":"staging-43"},"service":"dd-go-metrics-retrieval"},"tags":["source:apm","source:apm"]}},{"id":"AQAAAYP69YODhSYeRwAAAABBWVA2OVlPREFBQmptZ3JJdUtpRmM0S3U","type":"citest","attributes":{"test_level":"test","attributes":{"test_suite":{"fingerprint":"355d882863b0e6d8"},"test":{"suite":"github.com/DataDog/repo/apps/rocky/internal/catalog","full_name":"github.com/DataDog/repo/apps/rocky/internal/catalog.TestHdqDebug","codeowners":["@DataDog/repo"],"service":"dd-go-metrics-retrieval","name":"TestHdqDebug","fingerprint":"7baf20ec99e08277","type":"test","has_parameters":false,"status":"pass"},"os":{"version":"bionic"},"ci":{"pipeline":{"number":1669072,"name":"DataDog/repo","id":"10630527","url":"https://gitlab.site.io/DataDog/repo/pipelines/10630527"},"workspace_path":"/go/src/github.com/DataDog/repo","stage":{"name":"stage-1"},"provider":{"name":"gitlab"},"job":{"name":"test:go:race-bionic + 1/2","url":"https://gitlab.site.io/DataDog/repo/-/jobs/184817229"}},"start":1666362737539000000,"runtime":{"name":"go","version":"1.19.2"},"language":"go","env":"test","duration":0,"git":{"commit":{"committer":{"date":"2022-10-21T14:24:33+00:00","name":"ci.dd-go","email":"support@datadoghq.com","date_timestamp":1666362273000},"author":{"date":"2022-10-21T14:24:33+00:00","name":"ci.dd-go","email":"support@datadoghq.com","date_timestamp":1666362273000},"message":"Gitlab + merged prod (c5fd9a72b75448ff60ba078960fe0ba5e23d7050) to staging-43\n\nGitlab + merged prod (07bd1d762138e4b5bebc0f792cd26ef078c0d872) to staging-43\n\nGitlab + merged prod (4ac1ba5d2b28caccc0640182d90e2d99a5234584) to staging-43\n\nGitlab + merged prod (1c27b214276d2e70d502fdc7c840200faa3d80cf) to staging-43\n\nMerge + branch ''ting.tu/scheduling'' (06242fc) into staging-43\n\n pm_trace_id: 10629269\n + feature_branch_pipeline_id: 10629269\n source: to-staging\n\n* commit ''06242fcf113290ca0f273e23942d86f2fc803a6b'':\n update + nits\n Allow partial schedule\n","sha":"c34a29db1311b6945aaa644302a77f9bc30e2d7d"},"repository_url":"https://gitlab.site.io/DataDog/repo.git","repository":{"path":"/DataDog/repo.git","scheme":"https","name":"DataDog/repo","host":"gitlab.site.io","id":"gitlab.site.io/DataDog/repo"},"branch":"staging-43"},"service":"dd-go-metrics-retrieval"},"tags":["source:apm","source:apm"]}}],"meta":{"page":{"after":"eyJhZnRlciI6IkFRQUFBWVA2OVlPRGhTWWVSd0FBQUFCQldWQTJPVmxQUkVGQlFtcHRaM0pKZFV0cFJtTTBTM1UifQ"}},"links":{"next":"https://api.datadoghq.com/api/v2/ci/tests/events?filter%5Bfrom%5D=now-15m&filter%5Bquery%5D=%40test.status%3Apass+AND+-%40language%3Apython&filter%5Bto%5D=now&page%5Bcursor%5D=eyJhZnRlciI6IkFRQUFBWVA2OVlPRGhTWWVSd0FBQUFCQldWQTJPVmxQUkVGQlFtcHRaM0pKZFV0cFJtTTBTM1UifQ&page%5Blimit%5D=2&sort=timestamp"}} + + ' + code: 200 + duration: '' + headers: + Content-Type: + - application/json + status: 200 OK +- request: + body: | + {"filter":{"from":"now-15m","query":"@test.status:pass AND -@language:python","to":"now"},"page":{"cursor":"eyJhZnRlciI6IkFRQUFBWVA2OVlPRGhTWWVSd0FBQUFCQldWQTJPVmxQUkVGQlFtcHRaM0pKZFV0cFJtTTBTM1UifQ","limit":2},"sort":"timestamp"} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + url: https://api.datadoghq.com/api/v2/ci/tests/events/search + response: + body: '{"data":[],"meta":{"page":{"after":"eyJhZnRlciI6IkFRQUFBWVA2OVlVbW5sUEFhd0FBQUFCQldWQTJPVmxWYlVGQlJGWkNWbGw1VTJWdVFWaHZNRm8ifQ"}},"links":{"next":"https://api.datadoghq.com/api/v2/ci/tests/events?filter%5Bfrom%5D=now-15m&filter%5Bquery%5D=%40test.status%3Apass+AND+-%40language%3Apython&filter%5Bto%5D=now&page%5Bcursor%5D=eyJhZnRlciI6IkFRQUFBWVA2OVlVbW5sUEFhd0FBQUFCQldWQTJPVmxWYlVGQlJGWkNWbGw1VTJWdVFWaHZNRm8ifQ&page%5Blimit%5D=2&sort=timestamp"}} + + ' + code: 200 + duration: '' + headers: + Content-Type: + - application/json + status: 200 OK +version: 1 diff --git a/tests/scenarios/features/v2/ci_visibility_pipelines.feature b/tests/scenarios/features/v2/ci_visibility_pipelines.feature new file mode 100644 index 00000000000..43ce76cb520 --- /dev/null +++ b/tests/scenarios/features/v2/ci_visibility_pipelines.feature @@ -0,0 +1,70 @@ +@endpoint(ci-visibility-pipelines) @endpoint(ci-visibility-pipelines-v2) +Feature: CI Visibility Pipelines + Search or aggregate your CI Visibility pipeline events over HTTP. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "CIVisibilityPipelines" API + + @generated @skip @team:Datadog/ci-app-backend @team:Datadog/integrations-tools-and-libraries + Scenario: Aggregate pipelines events returns "Bad Request" response + Given new "AggregateCIAppPipelineEvents" request + And body with value {"compute": [{"aggregation": "pc90", "interval": "5m", "metric": "@duration", "type": "total"}], "filter": {"from": "now-15m", "query": "@ci.provider.name:github AND @ci.status:error", "to": "now"}, "group_by": [{"facet": "@ci.status", "histogram": {"interval": 10, "max": 100, "min": 50}, "limit": 10, "sort": {"aggregation": "count", "order": "asc"}, "total": false}], "options": {"timezone": "GMT"}, "page": {"cursor": "eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==", "limit": 25}} + When the request is sent + Then the response status is 400 Bad Request + + @team:Datadog/ci-app-backend @team:Datadog/integrations-tools-and-libraries + Scenario: Aggregate pipelines events returns "OK" response + Given new "AggregateCIAppPipelineEvents" request + And body with value {"compute": [{"aggregation": "pc90", "metric": "@duration", "type": "total"}], "filter": {"from": "now-15m", "query": "@ci.provider.name:github AND @ci.provider.instance:github-actions", "to": "now"}, "group_by": [{ "facet": "@ci.status", "limit": 10, "total": false}], "options": {"timezone": "GMT"}, "page": {"limit": 25}} + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:Datadog/ci-app-backend @team:Datadog/integrations-tools-and-libraries + Scenario: Get a list of pipelines events returns "Bad Request" response + Given new "ListCIAppPipelineEvents" request + When the request is sent + Then the response status is 400 Bad Request + + @team:Datadog/ci-app-backend @team:Datadog/integrations-tools-and-libraries + Scenario: Get a list of pipelines events returns "OK" response + Given new "ListCIAppPipelineEvents" request + And request contains "filter[query]" parameter with value "@ci.provider.instance:circleci" + And request contains "filter[from]" parameter with value "{{ timeISO('now - 30m') }}" + And request contains "filter[to]" parameter with value "{{ timeISO('now') }}" + And request contains "page[limit]" parameter with value 5 + When the request is sent + Then the response status is 200 OK + + @replay-only @team:Datadog/ci-app-backend @team:Datadog/integrations-tools-and-libraries @with-pagination + Scenario: Get a list of pipelines events returns "OK" response with pagination + Given new "ListCIAppPipelineEvents" request + And request contains "filter[from]" parameter with value "{{ timeISO('now - 30s') }}" + And request contains "filter[to]" parameter with value "{{ timeISO('now') }}" + And request contains "page[limit]" parameter with value 2 + When the request with pagination is sent + Then the response status is 200 OK + And the response has 2 items + + @generated @skip @team:Datadog/ci-app-backend @team:Datadog/integrations-tools-and-libraries + Scenario: Search pipelines events returns "Bad Request" response + Given new "SearchCIAppPipelineEvents" request + And body with value {"filter": {"from": "now-15m", "query": "@ci.provider.name:github AND @ci.status:error", "to": "now"}, "options": {"timezone": "GMT"}, "page": {"cursor": "eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==", "limit": 25}, "sort": "timestamp"} + When the request is sent + Then the response status is 400 Bad Request + + @team:Datadog/ci-app-backend @team:Datadog/integrations-tools-and-libraries + Scenario: Search pipelines events returns "OK" response + Given new "SearchCIAppPipelineEvents" request + And body with value {"filter": {"from": "now-15m", "query": "@ci.provider.name:github AND @ci.status:error", "to": "now"}, "options": {"timezone": "GMT"}, "page": {"limit": 5}, "sort": "timestamp"} + When the request is sent + Then the response status is 200 OK + + @replay-only @team:Datadog/ci-app-backend @team:Datadog/integrations-tools-and-libraries @with-pagination + Scenario: Search pipelines events returns "OK" response with pagination + Given new "SearchCIAppPipelineEvents" request + And body with value {"filter": {"from": "now-30s", "to": "now"}, "options": {"timezone": "GMT"}, "page": {"limit": 2}, "sort": "timestamp"} + When the request with pagination is sent + Then the response status is 200 OK + And the response has 2 items diff --git a/tests/scenarios/features/v2/ci_visibility_tests.feature b/tests/scenarios/features/v2/ci_visibility_tests.feature new file mode 100644 index 00000000000..32b90279fe1 --- /dev/null +++ b/tests/scenarios/features/v2/ci_visibility_tests.feature @@ -0,0 +1,70 @@ +@endpoint(ci-visibility-tests) @endpoint(ci-visibility-tests-v2) +Feature: CI Visibility Tests + Search or aggregate your CI Visibility test events over HTTP. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "CIVisibilityTests" API + + @generated @skip @team:Datadog/ci-app-backend @team:Datadog/integrations-tools-and-libraries + Scenario: Aggregate tests events returns "Bad Request" response + Given new "AggregateCIAppTestEvents" request + And body with value {"compute": [{"aggregation": "pc90", "interval": "5m", "metric": "@duration", "type": "total"}], "filter": {"from": "now-15m", "query": "@test.service:web-ui-tests AND @test.status:fail", "to": "now"}, "group_by": [{"facet": "@test.service", "histogram": {"interval": 10, "max": 100, "min": 50}, "limit": 10, "sort": {"aggregation": "count", "order": "asc"}, "total": false}], "options": {"timezone": "GMT"}, "page": {"cursor": "eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==", "limit": 25}} + When the request is sent + Then the response status is 400 Bad Request + + @team:Datadog/ci-app-backend @team:Datadog/integrations-tools-and-libraries + Scenario: Aggregate tests events returns "OK" response + Given new "AggregateCIAppTestEvents" request + And body with value {"compute": [{"aggregation": "count", "metric": "@test.is_flaky", "type": "total"}], "filter": {"from": "now-15m", "query": "@language:(python OR go)", "to": "now"}, "group_by": [{"facet": "@git.branch", "limit": 10, "sort": {"order": "asc"}, "total": false}], "options": {"timezone": "GMT"}, "page": {"limit": 25}} + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:Datadog/ci-app-backend @team:Datadog/integrations-tools-and-libraries + Scenario: Get a list of tests events returns "Bad Request" response + Given new "ListCIAppTestEvents" request + When the request is sent + Then the response status is 400 Bad Request + + @team:Datadog/ci-app-backend @team:Datadog/integrations-tools-and-libraries + Scenario: Get a list of tests events returns "OK" response + Given new "ListCIAppTestEvents" request + And request contains "filter[query]" parameter with value "@test.service:web-ui-tests" + And request contains "filter[from]" parameter with value "{{ timeISO('now - 30s') }}" + And request contains "filter[to]" parameter with value "{{ timeISO('now') }}" + And request contains "page[limit]" parameter with value 5 + When the request is sent + Then the response status is 200 OK + + @replay-only @team:Datadog/ci-app-backend @team:Datadog/integrations-tools-and-libraries @with-pagination + Scenario: Get a list of tests events returns "OK" response with pagination + Given new "ListCIAppTestEvents" request + And request contains "filter[from]" parameter with value "{{ timeISO('now - 30s') }}" + And request contains "filter[to]" parameter with value "{{ timeISO('now') }}" + And request contains "page[limit]" parameter with value 2 + When the request with pagination is sent + Then the response status is 200 OK + And the response has 2 items + + @generated @skip @team:Datadog/ci-app-backend @team:Datadog/integrations-tools-and-libraries + Scenario: Search tests events returns "Bad Request" response + Given new "SearchCIAppTestEvents" request + And body with value {"filter": {"from": "now-15m", "query": "@test.service:web-ui-tests AND @test.status:fail", "to": "now"}, "options": {"timezone": "GMT"}, "page": {"cursor": "eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==", "limit": 25}, "sort": "timestamp"} + When the request is sent + Then the response status is 400 Bad Request + + @team:Datadog/ci-app-backend @team:Datadog/integrations-tools-and-libraries + Scenario: Search tests events returns "OK" response + Given new "SearchCIAppTestEvents" request + And body with value {"filter": {"from": "now-15m", "query": "@test.service:web-ui-tests AND @test.status:skip", "to": "now"}, "options": {"timezone": "GMT"}, "page": {"limit": 25}, "sort": "timestamp"} + When the request is sent + Then the response status is 200 OK + + @replay-only @team:Datadog/ci-app-backend @team:Datadog/integrations-tools-and-libraries @with-pagination + Scenario: Search tests events returns "OK" response with pagination + Given new "SearchCIAppTestEvents" request + And body with value {"filter": {"from": "now-15m", "query": "@test.status:pass AND -@language:python", "to": "now"}, "page": {"limit": 2}, "sort": "timestamp"} + When the request with pagination is sent + Then the response status is 200 OK + And the response has 2 items diff --git a/tests/scenarios/features/v2/undo.json b/tests/scenarios/features/v2/undo.json index 37892143031..e7297924776 100644 --- a/tests/scenarios/features/v2/undo.json +++ b/tests/scenarios/features/v2/undo.json @@ -109,6 +109,42 @@ "type": "idempotent" } }, + "AggregateCIAppPipelineEvents": { + "tag": "CI Visibility Pipelines", + "undo": { + "type": "safe" + } + }, + "ListCIAppPipelineEvents": { + "tag": "CI Visibility Pipelines", + "undo": { + "type": "safe" + } + }, + "SearchCIAppPipelineEvents": { + "tag": "CI Visibility Pipelines", + "undo": { + "type": "safe" + } + }, + "AggregateCIAppTestEvents": { + "tag": "CI Visibility Tests", + "undo": { + "type": "safe" + } + }, + "ListCIAppTestEvents": { + "tag": "CI Visibility Tests", + "undo": { + "type": "safe" + } + }, + "SearchCIAppTestEvents": { + "tag": "CI Visibility Tests", + "undo": { + "type": "safe" + } + }, "ListCurrentUserApplicationKeys": { "tag": "Key Management", "undo": {