diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 7a9926c3d3..583d0d86f5 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -11380,6 +11380,7 @@ components: description: Maximum priced spend per rolling minute, in microcents of 1e-8 USD each, shared by all matching traffic, or per counter for a template rate limit. Null when this rule does not limit cost. example: 100000000 format: int64 + maximum: 10000000000000 minimum: 1 nullable: true type: integer @@ -11482,12 +11483,6 @@ components: format: uuid nullable: true type: string - window_limits: - description: Limits over rolling windows longer than a minute. Each limit counts the rule's matching traffic, or each counter of a template rate limit, over its window. Per-minute limits are in the `*_per_minute` fields. This list is empty when the rule has no window limits. - items: - $ref: "#/components/schemas/AiGatewayRateLimitWindowLimit" - maxItems: 4 - type: array required: - scope_restricted - name @@ -11506,9 +11501,10 @@ components: description: Attributes used to create an AI Gateway rate limit. properties: cost_microcents_per_minute: - description: Maximum priced spend per rolling minute, in microcents of 1e-8 USD each. In `ENFORCE` mode, the gateway rejects requests to models with no pricing because their cost can't be counted. + description: Maximum priced spend per rolling minute, in microcents of 1e-8 USD each. At most 10000000000000, that is $100,000. In `ENFORCE` mode, requests to a model with no pricing are rejected, because their cost can't be counted. example: 100000000 format: int64 + maximum: 10000000000000 minimum: 1 nullable: true type: integer @@ -11533,7 +11529,7 @@ components: nullable: true type: integer requests_per_minute: - description: Maximum requests per rolling minute. At least one of `requests_per_minute`, `input_tokens_per_minute`, `output_tokens_per_minute`, `cost_microcents_per_minute`, or a non-empty `window_limits` is required. + description: Maximum requests per rolling minute. At least one of `requests_per_minute`, `input_tokens_per_minute`, `output_tokens_per_minute`, and `cost_microcents_per_minute` is required. example: 600 format: int64 maximum: 10000000 @@ -11557,12 +11553,6 @@ components: example: 00000000-0000-4000-8000-000000000001 format: uuid type: string - window_limits: - description: Limits over rolling windows longer than a minute, such as $20 of spend per 24 hours. This field is available only to organizations with the feature enabled. Other organizations receive a 400 Bad Request response for a non-empty list. Each limit counts the rule's matching traffic, or each counter of a template rate limit, over its window. Set per-minute limits in the `*_per_minute` fields. A rule can have at most four limits in total, including any per-minute limits that are set. Each metric and window pair can appear only once, and for the same metric, a longer window must have a larger amount. In `ENFORCE` mode, the gateway rejects a request that exceeds any limit with HTTP 429 and a `Retry-After` header. If the list includes a `cost` limit, the gateway also rejects requests to models with no pricing because their cost can't be counted. - items: - $ref: "#/components/schemas/AiGatewayRateLimitWindowLimit" - maxItems: 4 - type: array required: - name type: object @@ -11589,12 +11579,12 @@ components: description: One counter of a template rate limit and its live usage. properties: cost_microcents: - description: Priced spend, in microcents, counted in the rolling one-minute window. The value is 0 when the rate limit doesn't limit cost. + description: Priced spend, in microcents, counted in the rolling one-minute window. 0 when the rate limit doesn't limit cost. example: 25000000 format: int64 type: integer cost_microcents_per_minute: - description: The rate limit's per-counter spend limit, in microcents. Null when the rate limit doesn't limit cost. + description: The rate limit's per-counter spend limit, in microcents. Null when it doesn't limit cost. example: 100000000 format: int64 nullable: true @@ -11620,7 +11610,7 @@ components: example: "v1|7:user_id=36:11111111-1111-1111-1111-111111111111" type: string last_seen: - description: When the gateway last recorded this counter as hot, meaning it was at 80% or more of a limit, or it limited or would have limited a request. This value can lag live traffic by a few minutes. + description: When the gateway last saw this counter hot, that is near or at a limit or limiting; up to a few minutes behind live traffic. example: "2026-10-28T10:05:00Z" format: date-time type: string @@ -11743,7 +11733,7 @@ components: description: Aggregate of a template rate limit's counters. properties: instance_count: - description: Number of counters that were at 80% or more of a limit, or that limited or would have limited a request, in the last hour. Other counters aren't recorded. + description: Number of counters that were near or at a limit, or limited a request, in the last hour. Counters with room to spare aren't recorded. example: 14 format: int64 type: integer @@ -11925,8 +11915,9 @@ components: description: Attributes used to update an AI Gateway rate limit. Only sent fields are changed. properties: cost_microcents_per_minute: - description: Spend limit in microcents per rolling minute. Set to 0 to remove the cost limit. Null is ignored. At least one limit, per-minute or in `window_limits`, must remain. + description: Spend limit in microcents per rolling minute. Set to 0 to remove the cost limit. Null is ignored. At least one limit must remain. format: int64 + maximum: 10000000000000 minimum: 0 nullable: true type: integer @@ -11934,7 +11925,7 @@ components: description: Whether this rate limit is active. type: boolean input_tokens_per_minute: - description: Set to 0 to remove the input token limit. Null is ignored. At least one limit, per-minute or in `window_limits`, must remain. + description: Set to 0 to remove the request limit. Null is ignored. At least one limit must remain. format: int64 maximum: 100000000000 minimum: 0 @@ -11946,14 +11937,14 @@ components: description: Rate limit name. type: string output_tokens_per_minute: - description: Set to 0 to remove the output token limit. Null is ignored. At least one limit, per-minute or in `window_limits`, must remain. + description: Set to 0 to remove the request limit. Null is ignored. At least one limit must remain. format: int64 maximum: 100000000000 minimum: 0 nullable: true type: integer requests_per_minute: - description: Set to 0 to remove the request limit. Null is ignored. At least one limit, per-minute or in `window_limits`, must remain. + description: Set to 0 to remove the request limit. Null is ignored. At least one limit must remain. format: int64 maximum: 10000000 minimum: 0 @@ -11973,13 +11964,6 @@ components: description: Replaces the user scope. An empty string clears it. Null is ignored. nullable: true type: string - window_limits: - description: Replaces all limits over rolling windows longer than a minute. If `window_limits` is null or omitted, the existing limits are unchanged. An empty array removes them all. This field is available only to organizations with the feature enabled. Other organizations receive a 400 Bad Request response for a non-empty list. The same rules as on create apply. A rule can have at most four limits in total, including any per-minute limits that are set. Each metric and window pair can appear only once, and for the same metric, a longer window must have a larger amount. In `ENFORCE` mode, if the list includes a `cost` limit, the gateway rejects requests to models with no pricing because their cost can't be counted. - items: - $ref: "#/components/schemas/AiGatewayRateLimitWindowLimit" - maxItems: 4 - nullable: true - type: array type: object AiGatewayRateLimitUpdateData: description: Data used to update an AI Gateway rate limit. @@ -12010,7 +11994,7 @@ components: description: Live consumption of one AI Gateway rate limit. properties: cost_microcents: - description: Priced spend, in microcents, counted in the rolling one-minute window. Only rules with a cost limit count spend, so the value is 0 for other rules and for the untracked and total entries. + description: Priced spend, in microcents, counted in the rolling one-minute window. Only rules with a cost limit count it, so it is 0 for other rules and for the untracked and total entries. example: 25000000 format: int64 type: integer @@ -12081,60 +12065,6 @@ components: type: string x-enum-varnames: - RATE_LIMIT_USAGE - AiGatewayRateLimitWindowLimit: - description: A limit on one metric over a rolling window longer than a minute. - properties: - amount: - description: Maximum amount of the metric over the window. For `cost`, the amount is priced spend in microcents of 1e-8 USD each, as in `cost_microcents_per_minute`. For the same metric, a longer window must have a larger amount. - example: 2000000000 - format: int64 - minimum: 1 - type: integer - metric: - $ref: "#/components/schemas/AiGatewayRateLimitWindowLimitMetric" - window: - $ref: "#/components/schemas/AiGatewayRateLimitWindowLimitWindow" - required: - - metric - - window - - amount - type: object - AiGatewayRateLimitWindowLimitMetric: - description: The metric that a window limit counts. `cost` counts priced spend in microcents. - enum: - - requests - - input_tokens - - output_tokens - - cost - example: cost - type: string - x-enum-varnames: - - REQUESTS - - INPUT_TOKENS - - OUTPUT_TOKENS - - COST - AiGatewayRateLimitWindowLimitWindow: - description: The rolling window that a limit applies to. For per-minute limits, use the `*_per_minute` fields instead. - enum: - - 5m - - 15m - - 30m - - 1h - - 3h - - 6h - - 12h - - 24h - example: 24h - type: string - x-enum-varnames: - - FIVE_MINUTES - - FIFTEEN_MINUTES - - THIRTY_MINUTES - - ONE_HOUR - - THREE_HOURS - - SIX_HOURS - - TWELVE_HOURS - - TWENTY_FOUR_HOURS AiGatewayRestrictedDetailsMeta: description: Visibility information for identifying instance details. properties: @@ -231910,7 +231840,7 @@ paths: If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/rate-limits/instances/summary: get: - description: Aggregate the counters of every template rate limit in the organization in one call. The response has one summary per template, in the same order as the rate limit list. Each summary matches the response of the single-template counter summary endpoint without split_dim, including scope_restricted and truncated. Rate limits with one shared allowance aren't included. Summaries are cached for up to 15 seconds. + description: Aggregate the counters of every template rate limit in the organization in one call, with one summary per template in the order the rate limit list returns them. Each summary is the one the single-template counter summary endpoint returns without split_dim, including scope_restricted and truncated. Rate limits with one shared allowance are left out. Summaries are cached for up to 15 seconds. operationId: ListAiGatewayRateLimitInstancesSummaries responses: "200": @@ -232167,7 +232097,7 @@ paths: If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/rate-limits/{id}/instances: get: - description: List the hot counters of a template rate limit, one per matched user, Team, or value, with their live usage. The list includes only counters that, in the last hour, reached 80% or more of a limit or limited or would have limited a request. A counter appears within a few minutes of becoming hot. Usage is read for at most 200 counters per request; past that, rows carry usage_known false. Counters for a provider or model the caller can't see are left out, and when the caller can't see the template's selector, the list is empty. A rate limit with one shared allowance, including one whose selector has no per_value entry, returns an empty list. Returns 503 when counter usage can't be read. + description: List the hot counters of a template rate limit, one per matched user, Team, or value, with their live usage. Only counters at 80% or more of a limit, or that limited or would have limited a request, in the last hour are listed. A counter appears within a few minutes of becoming hot. Usage is read for at most 200 counters per request; past that, rows carry usage_known false. Counters for a provider or model the caller can't see are left out, and when the caller can't see the template's selector, the list is empty. A rate limit with one shared allowance, including one whose selector has no per_value entry, returns an empty list. Returns 503 when counter usage can't be read. operationId: ListAiGatewayRateLimitInstances parameters: - $ref: "#/components/parameters/AiGatewayRateLimitID" @@ -232228,7 +232158,7 @@ paths: If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/rate-limits/{id}/instances/summary: get: - description: Aggregate a template rate limit's hot counters, including how many there are, how many are near or at their limit, and the fullest counter's utilization. Hot counters are those that reached 80% or more of a limit, or that limited or would have limited a request, in the last hour. Use split_dim to aggregate only counters that match every given dimension value. When the caller can't see the template's selector, every count is zero and scope_restricted is true. Summaries are cached for up to 15 seconds. Returns 503 when counter usage can't be read. + description: Aggregate a template rate limit's hot counters (those near or at a limit, or limiting, in the last hour), including how many there are, how many are near or at their limit, and the fullest counter's utilization. Use split_dim to aggregate only counters that match every given dimension value. When the caller can't see the template's selector, every count is zero and scope_restricted is true. Summaries are cached for up to 15 seconds. Returns 503 when counter usage can't be read. operationId: GetAiGatewayRateLimitInstancesSummary parameters: - $ref: "#/components/parameters/AiGatewayRateLimitID" diff --git a/examples/v1/events/CreateEvent_3293844778.py b/examples/v1/events/CreateEvent_3293844778.py new file mode 100644 index 0000000000..3787481153 --- /dev/null +++ b/examples/v1/events/CreateEvent_3293844778.py @@ -0,0 +1,22 @@ +""" +Post an event returns "OK" response with an int64 ID above 2^53 +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v1.api.events_api import EventsApi +from datadog_api_client.v1.model.event_create_request import EventCreateRequest + +body = EventCreateRequest( + title="Example-Event", + text="An event whose ID exceeds Number.MAX_SAFE_INTEGER.", + tags=[ + "test:ExampleEvent", + ], +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = EventsApi(api_client) + response = api_instance.create_event(body=body) + + print(response) diff --git a/examples/v2/ai-gateway/CreateAiGatewayRateLimit.py b/examples/v2/ai-gateway/CreateAiGatewayRateLimit.py index 729139fcaf..54fd16891f 100644 --- a/examples/v2/ai-gateway/CreateAiGatewayRateLimit.py +++ b/examples/v2/ai-gateway/CreateAiGatewayRateLimit.py @@ -11,9 +11,6 @@ from datadog_api_client.v2.model.ai_gateway_rate_limit_mode import AiGatewayRateLimitMode from datadog_api_client.v2.model.ai_gateway_rate_limit_selector_entry import AiGatewayRateLimitSelectorEntry from datadog_api_client.v2.model.ai_gateway_rate_limit_type import AiGatewayRateLimitType -from datadog_api_client.v2.model.ai_gateway_rate_limit_window_limit import AiGatewayRateLimitWindowLimit -from datadog_api_client.v2.model.ai_gateway_rate_limit_window_limit_metric import AiGatewayRateLimitWindowLimitMetric -from datadog_api_client.v2.model.ai_gateway_rate_limit_window_limit_window import AiGatewayRateLimitWindowLimitWindow from uuid import UUID body = AiGatewayRateLimitCreateRequest( @@ -36,13 +33,6 @@ ], team_id=UUID("00000000-0000-4000-8000-000000000002"), user_id=UUID("00000000-0000-4000-8000-000000000001"), - window_limits=[ - AiGatewayRateLimitWindowLimit( - amount=2000000000, - metric=AiGatewayRateLimitWindowLimitMetric.COST, - window=AiGatewayRateLimitWindowLimitWindow.TWENTY_FOUR_HOURS, - ), - ], ), type=AiGatewayRateLimitType.RATE_LIMITS, ), diff --git a/examples/v2/ai-gateway/UpdateAiGatewayRateLimit.py b/examples/v2/ai-gateway/UpdateAiGatewayRateLimit.py index fd118c5f42..8bea2ae767 100644 --- a/examples/v2/ai-gateway/UpdateAiGatewayRateLimit.py +++ b/examples/v2/ai-gateway/UpdateAiGatewayRateLimit.py @@ -10,9 +10,6 @@ from datadog_api_client.v2.model.ai_gateway_rate_limit_update_attributes import AiGatewayRateLimitUpdateAttributes from datadog_api_client.v2.model.ai_gateway_rate_limit_update_data import AiGatewayRateLimitUpdateData from datadog_api_client.v2.model.ai_gateway_rate_limit_update_request import AiGatewayRateLimitUpdateRequest -from datadog_api_client.v2.model.ai_gateway_rate_limit_window_limit import AiGatewayRateLimitWindowLimit -from datadog_api_client.v2.model.ai_gateway_rate_limit_window_limit_metric import AiGatewayRateLimitWindowLimitMetric -from datadog_api_client.v2.model.ai_gateway_rate_limit_window_limit_window import AiGatewayRateLimitWindowLimitWindow from uuid import UUID body = AiGatewayRateLimitUpdateRequest( @@ -26,13 +23,6 @@ tags=None, team_id=None, user_id=None, - window_limits=[ - AiGatewayRateLimitWindowLimit( - amount=2000000000, - metric=AiGatewayRateLimitWindowLimitMetric.COST, - window=AiGatewayRateLimitWindowLimitWindow.TWENTY_FOUR_HOURS, - ), - ], ), id=UUID("11111111-1111-1111-1111-111111111111"), type=AiGatewayRateLimitType.RATE_LIMITS, diff --git a/src/datadog_api_client/v2/api/ai_gateway_api.py b/src/datadog_api_client/v2/api/ai_gateway_api.py index 216d0d48e2..3534f21310 100644 --- a/src/datadog_api_client/v2/api/ai_gateway_api.py +++ b/src/datadog_api_client/v2/api/ai_gateway_api.py @@ -2104,7 +2104,7 @@ def get_ai_gateway_rate_limit_instances_summary( ) -> AiGatewayRateLimitInstancesSummaryResponse: """Get an AI Gateway rate limit counter summary. - Aggregate a template rate limit's hot counters, including how many there are, how many are near or at their limit, and the fullest counter's utilization. Hot counters are those that reached 80% or more of a limit, or that limited or would have limited a request, in the last hour. Use split_dim to aggregate only counters that match every given dimension value. When the caller can't see the template's selector, every count is zero and scope_restricted is true. Summaries are cached for up to 15 seconds. Returns 503 when counter usage can't be read. + Aggregate a template rate limit's hot counters (those near or at a limit, or limiting, in the last hour), including how many there are, how many are near or at their limit, and the fullest counter's utilization. Use split_dim to aggregate only counters that match every given dimension value. When the caller can't see the template's selector, every count is zero and scope_restricted is true. Summaries are cached for up to 15 seconds. Returns 503 when counter usage can't be read. :param id: Rate limit UUID. :type id: UUID @@ -2393,7 +2393,7 @@ def list_ai_gateway_rate_limit_instances( ) -> AiGatewayRateLimitInstanceListResponse: """List AI Gateway rate limit counters. - List the hot counters of a template rate limit, one per matched user, Team, or value, with their live usage. The list includes only counters that, in the last hour, reached 80% or more of a limit or limited or would have limited a request. A counter appears within a few minutes of becoming hot. Usage is read for at most 200 counters per request; past that, rows carry usage_known false. Counters for a provider or model the caller can't see are left out, and when the caller can't see the template's selector, the list is empty. A rate limit with one shared allowance, including one whose selector has no per_value entry, returns an empty list. Returns 503 when counter usage can't be read. + List the hot counters of a template rate limit, one per matched user, Team, or value, with their live usage. Only counters at 80% or more of a limit, or that limited or would have limited a request, in the last hour are listed. A counter appears within a few minutes of becoming hot. Usage is read for at most 200 counters per request; past that, rows carry usage_known false. Counters for a provider or model the caller can't see are left out, and when the caller can't see the template's selector, the list is empty. A rate limit with one shared allowance, including one whose selector has no per_value entry, returns an empty list. Returns 503 when counter usage can't be read. :param id: Rate limit UUID. :type id: UUID @@ -2429,7 +2429,7 @@ def list_ai_gateway_rate_limit_instances_summaries( ) -> AiGatewayRateLimitInstancesSummaryListResponse: """List AI Gateway rate limit counter summaries. - Aggregate the counters of every template rate limit in the organization in one call. The response has one summary per template, in the same order as the rate limit list. Each summary matches the response of the single-template counter summary endpoint without split_dim, including scope_restricted and truncated. Rate limits with one shared allowance aren't included. Summaries are cached for up to 15 seconds. + Aggregate the counters of every template rate limit in the organization in one call, with one summary per template in the order the rate limit list returns them. Each summary is the one the single-template counter summary endpoint returns without split_dim, including scope_restricted and truncated. Rate limits with one shared allowance are left out. Summaries are cached for up to 15 seconds. :rtype: AiGatewayRateLimitInstancesSummaryListResponse """ diff --git a/src/datadog_api_client/v2/model/ai_gateway_rate_limit_attributes.py b/src/datadog_api_client/v2/model/ai_gateway_rate_limit_attributes.py index 91e3757892..ca6afd5c15 100644 --- a/src/datadog_api_client/v2/model/ai_gateway_rate_limit_attributes.py +++ b/src/datadog_api_client/v2/model/ai_gateway_rate_limit_attributes.py @@ -19,12 +19,12 @@ if TYPE_CHECKING: from datadog_api_client.v2.model.ai_gateway_rate_limit_mode import AiGatewayRateLimitMode from datadog_api_client.v2.model.ai_gateway_rate_limit_selector_entry import AiGatewayRateLimitSelectorEntry - from datadog_api_client.v2.model.ai_gateway_rate_limit_window_limit import AiGatewayRateLimitWindowLimit class AiGatewayRateLimitAttributes(ModelNormal): validations = { "cost_microcents_per_minute": { + "inclusive_maximum": 10000000000000, "inclusive_minimum": 1, }, "input_tokens_per_minute": { @@ -39,16 +39,12 @@ class AiGatewayRateLimitAttributes(ModelNormal): "inclusive_maximum": 10000000, "inclusive_minimum": 1, }, - "window_limits": { - "max_items": 4, - }, } @cached_property def openapi_types(_): from datadog_api_client.v2.model.ai_gateway_rate_limit_mode import AiGatewayRateLimitMode from datadog_api_client.v2.model.ai_gateway_rate_limit_selector_entry import AiGatewayRateLimitSelectorEntry - from datadog_api_client.v2.model.ai_gateway_rate_limit_window_limit import AiGatewayRateLimitWindowLimit return { "cost_microcents_per_minute": (int, none_type), @@ -71,7 +67,6 @@ def openapi_types(_): "updated_at": (datetime,), "updated_by": (str,), "user_id": (UUID, none_type), - "window_limits": ([AiGatewayRateLimitWindowLimit],), } attribute_map = { @@ -95,7 +90,6 @@ def openapi_types(_): "updated_at": "updated_at", "updated_by": "updated_by", "user_id": "user_id", - "window_limits": "window_limits", } def __init__( @@ -120,7 +114,6 @@ def __init__( selector: Union[List[AiGatewayRateLimitSelectorEntry], none_type, UnsetType] = unset, team_id: Union[UUID, none_type, UnsetType] = unset, user_id: Union[UUID, none_type, UnsetType] = unset, - window_limits: Union[List[AiGatewayRateLimitWindowLimit], UnsetType] = unset, **kwargs, ): """ @@ -185,9 +178,6 @@ def __init__( :param user_id: Optional user UUID. Count only this user's requests. :type user_id: UUID, none_type, optional - - :param window_limits: Limits over rolling windows longer than a minute. Each limit counts the rule's matching traffic, or each counter of a template rate limit, over its window. Per-minute limits are in the ``*_per_minute`` fields. This list is empty when the rule has no window limits. - :type window_limits: [AiGatewayRateLimitWindowLimit], optional """ if cost_microcents_per_minute is not unset: kwargs["cost_microcents_per_minute"] = cost_microcents_per_minute @@ -205,8 +195,6 @@ def __init__( kwargs["team_id"] = team_id if user_id is not unset: kwargs["user_id"] = user_id - if window_limits is not unset: - kwargs["window_limits"] = window_limits super().__init__(kwargs) self_.created_at = created_at diff --git a/src/datadog_api_client/v2/model/ai_gateway_rate_limit_create_attributes.py b/src/datadog_api_client/v2/model/ai_gateway_rate_limit_create_attributes.py index 5120114f10..e5c1f86f3d 100644 --- a/src/datadog_api_client/v2/model/ai_gateway_rate_limit_create_attributes.py +++ b/src/datadog_api_client/v2/model/ai_gateway_rate_limit_create_attributes.py @@ -18,12 +18,12 @@ if TYPE_CHECKING: from datadog_api_client.v2.model.ai_gateway_rate_limit_mode import AiGatewayRateLimitMode from datadog_api_client.v2.model.ai_gateway_rate_limit_selector_entry import AiGatewayRateLimitSelectorEntry - from datadog_api_client.v2.model.ai_gateway_rate_limit_window_limit import AiGatewayRateLimitWindowLimit class AiGatewayRateLimitCreateAttributes(ModelNormal): validations = { "cost_microcents_per_minute": { + "inclusive_maximum": 10000000000000, "inclusive_minimum": 1, }, "input_tokens_per_minute": { @@ -38,16 +38,12 @@ class AiGatewayRateLimitCreateAttributes(ModelNormal): "inclusive_maximum": 10000000, "inclusive_minimum": 1, }, - "window_limits": { - "max_items": 4, - }, } @cached_property def openapi_types(_): from datadog_api_client.v2.model.ai_gateway_rate_limit_mode import AiGatewayRateLimitMode from datadog_api_client.v2.model.ai_gateway_rate_limit_selector_entry import AiGatewayRateLimitSelectorEntry - from datadog_api_client.v2.model.ai_gateway_rate_limit_window_limit import AiGatewayRateLimitWindowLimit return { "cost_microcents_per_minute": (int, none_type), @@ -60,7 +56,6 @@ def openapi_types(_): "tags": ({str: (str,)},), "team_id": (UUID,), "user_id": (UUID,), - "window_limits": ([AiGatewayRateLimitWindowLimit],), } attribute_map = { @@ -74,7 +69,6 @@ def openapi_types(_): "tags": "tags", "team_id": "team_id", "user_id": "user_id", - "window_limits": "window_limits", } def __init__( @@ -89,13 +83,12 @@ def __init__( tags: Union[Dict[str, str], UnsetType] = unset, team_id: Union[UUID, UnsetType] = unset, user_id: Union[UUID, UnsetType] = unset, - window_limits: Union[List[AiGatewayRateLimitWindowLimit], UnsetType] = unset, **kwargs, ): """ Attributes used to create an AI Gateway rate limit. - :param cost_microcents_per_minute: Maximum priced spend per rolling minute, in microcents of 1e-8 USD each. In ``ENFORCE`` mode, the gateway rejects requests to models with no pricing because their cost can't be counted. + :param cost_microcents_per_minute: Maximum priced spend per rolling minute, in microcents of 1e-8 USD each. At most 10000000000000, that is $100,000. In ``ENFORCE`` mode, requests to a model with no pricing are rejected, because their cost can't be counted. :type cost_microcents_per_minute: int, none_type, optional :param input_tokens_per_minute: Maximum input tokens per rolling minute. @@ -110,7 +103,7 @@ def __init__( :param output_tokens_per_minute: Maximum output tokens per rolling minute. :type output_tokens_per_minute: int, none_type, optional - :param requests_per_minute: Maximum requests per rolling minute. At least one of ``requests_per_minute`` , ``input_tokens_per_minute`` , ``output_tokens_per_minute`` , ``cost_microcents_per_minute`` , or a non-empty ``window_limits`` is required. + :param requests_per_minute: Maximum requests per rolling minute. At least one of ``requests_per_minute`` , ``input_tokens_per_minute`` , ``output_tokens_per_minute`` , and ``cost_microcents_per_minute`` is required. :type requests_per_minute: int, none_type, optional :param selector: Dimension rules for a template rate limit, which gives each matched user, Team, or value its own allowance with the rule's limits. Can't be combined with user_id, team_id, or tags, and can't be changed after creation. Omit for a rule with one shared allowance. @@ -124,9 +117,6 @@ def __init__( :param user_id: Optional UUID. Count only this user's requests. :type user_id: UUID, optional - - :param window_limits: Limits over rolling windows longer than a minute, such as $20 of spend per 24 hours. This field is available only to organizations with the feature enabled. Other organizations receive a 400 Bad Request response for a non-empty list. Each limit counts the rule's matching traffic, or each counter of a template rate limit, over its window. Set per-minute limits in the ``*_per_minute`` fields. A rule can have at most four limits in total, including any per-minute limits that are set. Each metric and window pair can appear only once, and for the same metric, a longer window must have a larger amount. In ``ENFORCE`` mode, the gateway rejects a request that exceeds any limit with HTTP 429 and a ``Retry-After`` header. If the list includes a ``cost`` limit, the gateway also rejects requests to models with no pricing because their cost can't be counted. - :type window_limits: [AiGatewayRateLimitWindowLimit], optional """ if cost_microcents_per_minute is not unset: kwargs["cost_microcents_per_minute"] = cost_microcents_per_minute @@ -146,8 +136,6 @@ def __init__( kwargs["team_id"] = team_id if user_id is not unset: kwargs["user_id"] = user_id - if window_limits is not unset: - kwargs["window_limits"] = window_limits super().__init__(kwargs) self_.name = name diff --git a/src/datadog_api_client/v2/model/ai_gateway_rate_limit_instance_attributes.py b/src/datadog_api_client/v2/model/ai_gateway_rate_limit_instance_attributes.py index 2038ac5ba5..3aa2d07b61 100644 --- a/src/datadog_api_client/v2/model/ai_gateway_rate_limit_instance_attributes.py +++ b/src/datadog_api_client/v2/model/ai_gateway_rate_limit_instance_attributes.py @@ -83,10 +83,10 @@ def __init__( """ One counter of a template rate limit and its live usage. - :param cost_microcents: Priced spend, in microcents, counted in the rolling one-minute window. The value is 0 when the rate limit doesn't limit cost. + :param cost_microcents: Priced spend, in microcents, counted in the rolling one-minute window. 0 when the rate limit doesn't limit cost. :type cost_microcents: int, optional - :param cost_microcents_per_minute: The rate limit's per-counter spend limit, in microcents. Null when the rate limit doesn't limit cost. + :param cost_microcents_per_minute: The rate limit's per-counter spend limit, in microcents. Null when it doesn't limit cost. :type cost_microcents_per_minute: int, none_type, optional :param first_seen: When the gateway first recorded a request for this counter. @@ -101,7 +101,7 @@ def __init__( :param instance_key: Opaque canonical key identifying the counter. :type instance_key: str - :param last_seen: When the gateway last recorded this counter as hot, meaning it was at 80% or more of a limit, or it limited or would have limited a request. This value can lag live traffic by a few minutes. + :param last_seen: When the gateway last saw this counter hot, that is near or at a limit or limiting; up to a few minutes behind live traffic. :type last_seen: datetime :param limited_requests: Requests this counter rejected in the last 15 minutes (ENFORCE). diff --git a/src/datadog_api_client/v2/model/ai_gateway_rate_limit_instances_summary_attributes.py b/src/datadog_api_client/v2/model/ai_gateway_rate_limit_instances_summary_attributes.py index d35335ef7a..b1329ec42f 100644 --- a/src/datadog_api_client/v2/model/ai_gateway_rate_limit_instances_summary_attributes.py +++ b/src/datadog_api_client/v2/model/ai_gateway_rate_limit_instances_summary_attributes.py @@ -57,7 +57,7 @@ def __init__( """ Aggregate of a template rate limit's counters. - :param instance_count: Number of counters that were at 80% or more of a limit, or that limited or would have limited a request, in the last hour. Other counters aren't recorded. + :param instance_count: Number of counters that were near or at a limit, or limited a request, in the last hour. Counters with room to spare aren't recorded. :type instance_count: int :param limited_requests: Requests the counters rejected in the last 15 minutes (ENFORCE), totaled over the counters whose usage was read. diff --git a/src/datadog_api_client/v2/model/ai_gateway_rate_limit_update_attributes.py b/src/datadog_api_client/v2/model/ai_gateway_rate_limit_update_attributes.py index 9daa06ce03..1867be2075 100644 --- a/src/datadog_api_client/v2/model/ai_gateway_rate_limit_update_attributes.py +++ b/src/datadog_api_client/v2/model/ai_gateway_rate_limit_update_attributes.py @@ -3,7 +3,7 @@ # Copyright 2019-Present Datadog, Inc. from __future__ import annotations -from typing import Dict, List, Union, TYPE_CHECKING +from typing import Dict, Union, TYPE_CHECKING from datadog_api_client.model_utils import ( ModelNormal, @@ -16,12 +16,12 @@ if TYPE_CHECKING: from datadog_api_client.v2.model.ai_gateway_rate_limit_mode import AiGatewayRateLimitMode - from datadog_api_client.v2.model.ai_gateway_rate_limit_window_limit import AiGatewayRateLimitWindowLimit class AiGatewayRateLimitUpdateAttributes(ModelNormal): validations = { "cost_microcents_per_minute": { + "inclusive_maximum": 10000000000000, "inclusive_minimum": 0, }, "input_tokens_per_minute": { @@ -36,15 +36,11 @@ class AiGatewayRateLimitUpdateAttributes(ModelNormal): "inclusive_maximum": 10000000, "inclusive_minimum": 0, }, - "window_limits": { - "max_items": 4, - }, } @cached_property def openapi_types(_): from datadog_api_client.v2.model.ai_gateway_rate_limit_mode import AiGatewayRateLimitMode - from datadog_api_client.v2.model.ai_gateway_rate_limit_window_limit import AiGatewayRateLimitWindowLimit return { "cost_microcents_per_minute": (int, none_type), @@ -57,7 +53,6 @@ def openapi_types(_): "tags": ({str: (str,)}, none_type), "team_id": (str, none_type), "user_id": (str, none_type), - "window_limits": ([AiGatewayRateLimitWindowLimit], none_type), } attribute_map = { @@ -71,7 +66,6 @@ def openapi_types(_): "tags": "tags", "team_id": "team_id", "user_id": "user_id", - "window_limits": "window_limits", } def __init__( @@ -86,19 +80,18 @@ def __init__( tags: Union[Dict[str, str], none_type, UnsetType] = unset, team_id: Union[str, none_type, UnsetType] = unset, user_id: Union[str, none_type, UnsetType] = unset, - window_limits: Union[List[AiGatewayRateLimitWindowLimit], none_type, UnsetType] = unset, **kwargs, ): """ Attributes used to update an AI Gateway rate limit. Only sent fields are changed. - :param cost_microcents_per_minute: Spend limit in microcents per rolling minute. Set to 0 to remove the cost limit. Null is ignored. At least one limit, per-minute or in ``window_limits`` , must remain. + :param cost_microcents_per_minute: Spend limit in microcents per rolling minute. Set to 0 to remove the cost limit. Null is ignored. At least one limit must remain. :type cost_microcents_per_minute: int, none_type, optional :param enabled: Whether this rate limit is active. :type enabled: bool, optional - :param input_tokens_per_minute: Set to 0 to remove the input token limit. Null is ignored. At least one limit, per-minute or in ``window_limits`` , must remain. + :param input_tokens_per_minute: Set to 0 to remove the request limit. Null is ignored. At least one limit must remain. :type input_tokens_per_minute: int, none_type, optional :param mode: Action taken when request rate exceeds the limit. @@ -107,10 +100,10 @@ def __init__( :param name: Rate limit name. :type name: str, optional - :param output_tokens_per_minute: Set to 0 to remove the output token limit. Null is ignored. At least one limit, per-minute or in ``window_limits`` , must remain. + :param output_tokens_per_minute: Set to 0 to remove the request limit. Null is ignored. At least one limit must remain. :type output_tokens_per_minute: int, none_type, optional - :param requests_per_minute: Set to 0 to remove the request limit. Null is ignored. At least one limit, per-minute or in ``window_limits`` , must remain. + :param requests_per_minute: Set to 0 to remove the request limit. Null is ignored. At least one limit must remain. :type requests_per_minute: int, none_type, optional :param tags: Replaces all scope tags. An empty object clears them. Null is ignored. @@ -121,9 +114,6 @@ def __init__( :param user_id: Replaces the user scope. An empty string clears it. Null is ignored. :type user_id: str, none_type, optional - - :param window_limits: Replaces all limits over rolling windows longer than a minute. If ``window_limits`` is null or omitted, the existing limits are unchanged. An empty array removes them all. This field is available only to organizations with the feature enabled. Other organizations receive a 400 Bad Request response for a non-empty list. The same rules as on create apply. A rule can have at most four limits in total, including any per-minute limits that are set. Each metric and window pair can appear only once, and for the same metric, a longer window must have a larger amount. In ``ENFORCE`` mode, if the list includes a ``cost`` limit, the gateway rejects requests to models with no pricing because their cost can't be counted. - :type window_limits: [AiGatewayRateLimitWindowLimit], none_type, optional """ if cost_microcents_per_minute is not unset: kwargs["cost_microcents_per_minute"] = cost_microcents_per_minute @@ -145,6 +135,4 @@ def __init__( kwargs["team_id"] = team_id if user_id is not unset: kwargs["user_id"] = user_id - if window_limits is not unset: - kwargs["window_limits"] = window_limits super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/ai_gateway_rate_limit_usage_attributes.py b/src/datadog_api_client/v2/model/ai_gateway_rate_limit_usage_attributes.py index dbcc89d323..63ac2a4bb0 100644 --- a/src/datadog_api_client/v2/model/ai_gateway_rate_limit_usage_attributes.py +++ b/src/datadog_api_client/v2/model/ai_gateway_rate_limit_usage_attributes.py @@ -47,7 +47,7 @@ def __init__( """ Live consumption of one AI Gateway rate limit. - :param cost_microcents: Priced spend, in microcents, counted in the rolling one-minute window. Only rules with a cost limit count spend, so the value is 0 for other rules and for the untracked and total entries. + :param cost_microcents: Priced spend, in microcents, counted in the rolling one-minute window. Only rules with a cost limit count it, so it is 0 for other rules and for the untracked and total entries. :type cost_microcents: int, optional :param input_tokens: Input tokens counted in the rolling one-minute window. diff --git a/src/datadog_api_client/v2/model/ai_gateway_rate_limit_window_limit.py b/src/datadog_api_client/v2/model/ai_gateway_rate_limit_window_limit.py deleted file mode 100644 index 9674be3138..0000000000 --- a/src/datadog_api_client/v2/model/ai_gateway_rate_limit_window_limit.py +++ /dev/null @@ -1,74 +0,0 @@ -# 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. -from __future__ import annotations - -from typing import TYPE_CHECKING - -from datadog_api_client.model_utils import ( - ModelNormal, - cached_property, -) - - -if TYPE_CHECKING: - from datadog_api_client.v2.model.ai_gateway_rate_limit_window_limit_metric import ( - AiGatewayRateLimitWindowLimitMetric, - ) - from datadog_api_client.v2.model.ai_gateway_rate_limit_window_limit_window import ( - AiGatewayRateLimitWindowLimitWindow, - ) - - -class AiGatewayRateLimitWindowLimit(ModelNormal): - validations = { - "amount": { - "inclusive_minimum": 1, - }, - } - - @cached_property - def openapi_types(_): - from datadog_api_client.v2.model.ai_gateway_rate_limit_window_limit_metric import ( - AiGatewayRateLimitWindowLimitMetric, - ) - from datadog_api_client.v2.model.ai_gateway_rate_limit_window_limit_window import ( - AiGatewayRateLimitWindowLimitWindow, - ) - - return { - "amount": (int,), - "metric": (AiGatewayRateLimitWindowLimitMetric,), - "window": (AiGatewayRateLimitWindowLimitWindow,), - } - - attribute_map = { - "amount": "amount", - "metric": "metric", - "window": "window", - } - - def __init__( - self_, - amount: int, - metric: AiGatewayRateLimitWindowLimitMetric, - window: AiGatewayRateLimitWindowLimitWindow, - **kwargs, - ): - """ - A limit on one metric over a rolling window longer than a minute. - - :param amount: Maximum amount of the metric over the window. For ``cost`` , the amount is priced spend in microcents of 1e-8 USD each, as in ``cost_microcents_per_minute``. For the same metric, a longer window must have a larger amount. - :type amount: int - - :param metric: The metric that a window limit counts. ``cost`` counts priced spend in microcents. - :type metric: AiGatewayRateLimitWindowLimitMetric - - :param window: The rolling window that a limit applies to. For per-minute limits, use the ``*_per_minute`` fields instead. - :type window: AiGatewayRateLimitWindowLimitWindow - """ - super().__init__(kwargs) - - self_.amount = amount - self_.metric = metric - self_.window = window diff --git a/src/datadog_api_client/v2/model/ai_gateway_rate_limit_window_limit_metric.py b/src/datadog_api_client/v2/model/ai_gateway_rate_limit_window_limit_metric.py deleted file mode 100644 index 9ccf02b583..0000000000 --- a/src/datadog_api_client/v2/model/ai_gateway_rate_limit_window_limit_metric.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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. -from __future__ import annotations - - -from datadog_api_client.model_utils import ( - ModelSimple, - cached_property, -) - -from typing import ClassVar - - -class AiGatewayRateLimitWindowLimitMetric(ModelSimple): - """ - The metric that a window limit counts. `cost` counts priced spend in microcents. - - :param value: Must be one of ["requests", "input_tokens", "output_tokens", "cost"]. - :type value: str - """ - - allowed_values = { - "requests", - "input_tokens", - "output_tokens", - "cost", - } - REQUESTS: ClassVar["AiGatewayRateLimitWindowLimitMetric"] - INPUT_TOKENS: ClassVar["AiGatewayRateLimitWindowLimitMetric"] - OUTPUT_TOKENS: ClassVar["AiGatewayRateLimitWindowLimitMetric"] - COST: ClassVar["AiGatewayRateLimitWindowLimitMetric"] - - @cached_property - def openapi_types(_): - return { - "value": (str,), - } - - -AiGatewayRateLimitWindowLimitMetric.REQUESTS = AiGatewayRateLimitWindowLimitMetric("requests") -AiGatewayRateLimitWindowLimitMetric.INPUT_TOKENS = AiGatewayRateLimitWindowLimitMetric("input_tokens") -AiGatewayRateLimitWindowLimitMetric.OUTPUT_TOKENS = AiGatewayRateLimitWindowLimitMetric("output_tokens") -AiGatewayRateLimitWindowLimitMetric.COST = AiGatewayRateLimitWindowLimitMetric("cost") diff --git a/src/datadog_api_client/v2/model/ai_gateway_rate_limit_window_limit_window.py b/src/datadog_api_client/v2/model/ai_gateway_rate_limit_window_limit_window.py deleted file mode 100644 index 695fc20abe..0000000000 --- a/src/datadog_api_client/v2/model/ai_gateway_rate_limit_window_limit_window.py +++ /dev/null @@ -1,56 +0,0 @@ -# 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. -from __future__ import annotations - - -from datadog_api_client.model_utils import ( - ModelSimple, - cached_property, -) - -from typing import ClassVar - - -class AiGatewayRateLimitWindowLimitWindow(ModelSimple): - """ - The rolling window that a limit applies to. For per-minute limits, use the `*_per_minute` fields instead. - - :param value: Must be one of ["5m", "15m", "30m", "1h", "3h", "6h", "12h", "24h"]. - :type value: str - """ - - allowed_values = { - "5m", - "15m", - "30m", - "1h", - "3h", - "6h", - "12h", - "24h", - } - FIVE_MINUTES: ClassVar["AiGatewayRateLimitWindowLimitWindow"] - FIFTEEN_MINUTES: ClassVar["AiGatewayRateLimitWindowLimitWindow"] - THIRTY_MINUTES: ClassVar["AiGatewayRateLimitWindowLimitWindow"] - ONE_HOUR: ClassVar["AiGatewayRateLimitWindowLimitWindow"] - THREE_HOURS: ClassVar["AiGatewayRateLimitWindowLimitWindow"] - SIX_HOURS: ClassVar["AiGatewayRateLimitWindowLimitWindow"] - TWELVE_HOURS: ClassVar["AiGatewayRateLimitWindowLimitWindow"] - TWENTY_FOUR_HOURS: ClassVar["AiGatewayRateLimitWindowLimitWindow"] - - @cached_property - def openapi_types(_): - return { - "value": (str,), - } - - -AiGatewayRateLimitWindowLimitWindow.FIVE_MINUTES = AiGatewayRateLimitWindowLimitWindow("5m") -AiGatewayRateLimitWindowLimitWindow.FIFTEEN_MINUTES = AiGatewayRateLimitWindowLimitWindow("15m") -AiGatewayRateLimitWindowLimitWindow.THIRTY_MINUTES = AiGatewayRateLimitWindowLimitWindow("30m") -AiGatewayRateLimitWindowLimitWindow.ONE_HOUR = AiGatewayRateLimitWindowLimitWindow("1h") -AiGatewayRateLimitWindowLimitWindow.THREE_HOURS = AiGatewayRateLimitWindowLimitWindow("3h") -AiGatewayRateLimitWindowLimitWindow.SIX_HOURS = AiGatewayRateLimitWindowLimitWindow("6h") -AiGatewayRateLimitWindowLimitWindow.TWELVE_HOURS = AiGatewayRateLimitWindowLimitWindow("12h") -AiGatewayRateLimitWindowLimitWindow.TWENTY_FOUR_HOURS = AiGatewayRateLimitWindowLimitWindow("24h") diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 24dc39251c..f64e232c78 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -652,9 +652,6 @@ from datadog_api_client.v2.model.ai_gateway_rate_limit_usage_list_response import AiGatewayRateLimitUsageListResponse from datadog_api_client.v2.model.ai_gateway_rate_limit_usage_resource import AiGatewayRateLimitUsageResource from datadog_api_client.v2.model.ai_gateway_rate_limit_usage_type import AiGatewayRateLimitUsageType -from datadog_api_client.v2.model.ai_gateway_rate_limit_window_limit import AiGatewayRateLimitWindowLimit -from datadog_api_client.v2.model.ai_gateway_rate_limit_window_limit_metric import AiGatewayRateLimitWindowLimitMetric -from datadog_api_client.v2.model.ai_gateway_rate_limit_window_limit_window import AiGatewayRateLimitWindowLimitWindow from datadog_api_client.v2.model.ai_gateway_restricted_details_meta import AiGatewayRestrictedDetailsMeta from datadog_api_client.v2.model.ai_gateway_routing_classifier import AiGatewayRoutingClassifier from datadog_api_client.v2.model.ai_gateway_routing_classifier_request import AiGatewayRoutingClassifierRequest @@ -14523,9 +14520,6 @@ "AiGatewayRateLimitUsageListResponse", "AiGatewayRateLimitUsageResource", "AiGatewayRateLimitUsageType", - "AiGatewayRateLimitWindowLimit", - "AiGatewayRateLimitWindowLimitMetric", - "AiGatewayRateLimitWindowLimitWindow", "AiGatewayRestrictedDetailsMeta", "AiGatewayRoutingClassifier", "AiGatewayRoutingClassifierRequest", diff --git a/tests/generated-test/test-runner-data/manifest.json b/tests/generated-test/test-runner-data/manifest.json index ba786504bf..b91b970e14 100644 --- a/tests/generated-test/test-runner-data/manifest.json +++ b/tests/generated-test/test-runner-data/manifest.json @@ -1190,6 +1190,13 @@ "scenario": "Post an event returns \"OK\" response", "version": "v1" }, + { + "feature": "Events", + "feature_file": "../../v1/features/events.feature", + "file": "v1/events/post-an-event-returns-ok-response-with-an-int64-id-above-2-53.json", + "scenario": "Post an event returns \"OK\" response with an int64 ID above 2^53", + "version": "v1" + }, { "feature": "Events", "feature_file": "../../v1/features/events.feature", diff --git a/tests/generated-test/test-runner-data/v1/events/post-an-event-returns-ok-response-with-an-int64-id-above-2-53.json b/tests/generated-test/test-runner-data/v1/events/post-an-event-returns-ok-response-with-an-int64-id-above-2-53.json new file mode 100644 index 0000000000..361fd715a3 --- /dev/null +++ b/tests/generated-test/test-runner-data/v1/events/post-an-event-returns-ok-response-with-an-int64-id-above-2-53.json @@ -0,0 +1,32 @@ +{ + "api": "Events", + "expected_status": 202, + "feature": "Events", + "id": "v1/Events/Post an event returns \"OK\" response with an int64 ID above 2^53", + "operation_id": "CreateEvent", + "request": { + "body": { + "schema": { + "format": null, + "ref": "EventCreateRequest", + "type": "object" + }, + "source": "inline", + "value": { + "tags": [ + "test:{{ unique_alnum }}" + ], + "text": "An event whose ID exceeds Number.MAX_SAFE_INTEGER.", + "title": "{{ unique }}" + } + }, + "content_type": "application/json", + "method": "POST", + "pagination": false, + "parameters": [], + "path": "/api/v1/events" + }, + "scenario": "Post an event returns \"OK\" response with an int64 ID above 2^53", + "schema_version": 1, + "version": "v1" +} diff --git a/tests/generated-test/test-server-data/v1/events.json b/tests/generated-test/test-server-data/v1/events.json index 4b1bbabb3b..00ead3505c 100644 --- a/tests/generated-test/test-server-data/v1/events.json +++ b/tests/generated-test/test-server-data/v1/events.json @@ -76,6 +76,43 @@ "scenario": "Post an event returns \"OK\" response", "version": "v1" }, + { + "feature": "Events", + "frozen_at": "2022-01-06T00:50:51.866Z", + "interactions": [ + { + "request": { + "body": { + "type": "json", + "value": { + "tags": [ + "test:TestPostaneventreturnsOKresponsewithanint64IDabove2531641430251" + ], + "text": "An event whose ID exceeds Number.MAX_SAFE_INTEGER.", + "title": "Test-Post_an_event_returns_OK_response_with_an_int64_ID_above_2_53-1641430251" + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v1/events", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"status\":\"ok\",\"event\":{\"id\":6327818702635911000,\"id_str\":\"6327818702635911562\",\"title\":\"Test-Post_an_event_returns_OK_response_with_an_int64_ID_above_2_53-1641430251\",\"text\":\"An event whose ID exceeds Number.MAX_SAFE_INTEGER.\",\"date_happened\":1641430251,\"handle\":null,\"priority\":null,\"related_event_id\":null,\"tags\":[\"test:TestPostaneventreturnsOKresponsewithanint64IDabove2531641430251\"],\"url\":\"https://app.datadoghq.com/event/event?id=6327818702635911562\"}}" + }, + "headers": { + "content-type": "application/json" + }, + "reason": "Accepted", + "status": 202 + } + } + ], + "scenario": "Post an event returns \"OK\" response with an int64 ID above 2^53", + "version": "v1" + }, { "feature": "Events", "frozen_at": "2022-01-06T00:50:51.994Z", diff --git a/tests/v1/features/events.feature b/tests/v1/features/events.feature index da4bfca067..4911f639e8 100644 --- a/tests/v1/features/events.feature +++ b/tests/v1/features/events.feature @@ -72,6 +72,15 @@ Feature: Events Then the response status is 202 OK And the response "event.text" is equal to "A text message." + @team:ddoghq/monitors-evaluation + Scenario: Post an event returns "OK" response with an int64 ID above 2^53 + Given new "CreateEvent" request + And body with value {"title": "{{ unique }}", "text": "An event whose ID exceeds Number.MAX_SAFE_INTEGER.", "tags": ["test:{{ unique_alnum }}"]} + When the request is sent + Then the response status is 202 OK + And the response "event" has field "id" + And the response "event" has field "id_str" + @team:ddoghq/monitors-evaluation Scenario: Post an event with a long title returns "OK" response Given new "CreateEvent" request diff --git a/tests/v2/features/ai_gateway.feature b/tests/v2/features/ai_gateway.feature index c829d11282..b9312a5721 100644 --- a/tests/v2/features/ai_gateway.feature +++ b/tests/v2/features/ai_gateway.feature @@ -184,7 +184,7 @@ Feature: AI Gateway Scenario: Create an AI Gateway rate limit returns "Bad Request" response Given operation "CreateAiGatewayRateLimit" enabled And new "CreateAiGatewayRateLimit" request - And body with value {"data": {"attributes": {"cost_microcents_per_minute": 100000000, "input_tokens_per_minute": null, "mode": "ALERT", "name": "Default rate limit", "output_tokens_per_minute": null, "requests_per_minute": 600, "selector": [{"dim": "user_id", "per_value": true, "values": ["11111111-1111-1111-1111-111111111111"]}], "team_id": "00000000-0000-4000-8000-000000000002", "user_id": "00000000-0000-4000-8000-000000000001", "window_limits": [{"amount": 2000000000, "metric": "cost", "window": "24h"}]}, "type": "rate-limits"}} + And body with value {"data": {"attributes": {"cost_microcents_per_minute": 100000000, "input_tokens_per_minute": null, "mode": "ALERT", "name": "Default rate limit", "output_tokens_per_minute": null, "requests_per_minute": 600, "selector": [{"dim": "user_id", "per_value": true, "values": ["11111111-1111-1111-1111-111111111111"]}], "team_id": "00000000-0000-4000-8000-000000000002", "user_id": "00000000-0000-4000-8000-000000000001"}, "type": "rate-limits"}} When the request is sent Then the response status is 400 Bad Request @@ -192,7 +192,7 @@ Feature: AI Gateway Scenario: Create an AI Gateway rate limit returns "Conflict" response Given operation "CreateAiGatewayRateLimit" enabled And new "CreateAiGatewayRateLimit" request - And body with value {"data": {"attributes": {"cost_microcents_per_minute": 100000000, "input_tokens_per_minute": null, "mode": "ALERT", "name": "Default rate limit", "output_tokens_per_minute": null, "requests_per_minute": 600, "selector": [{"dim": "user_id", "per_value": true, "values": ["11111111-1111-1111-1111-111111111111"]}], "team_id": "00000000-0000-4000-8000-000000000002", "user_id": "00000000-0000-4000-8000-000000000001", "window_limits": [{"amount": 2000000000, "metric": "cost", "window": "24h"}]}, "type": "rate-limits"}} + And body with value {"data": {"attributes": {"cost_microcents_per_minute": 100000000, "input_tokens_per_minute": null, "mode": "ALERT", "name": "Default rate limit", "output_tokens_per_minute": null, "requests_per_minute": 600, "selector": [{"dim": "user_id", "per_value": true, "values": ["11111111-1111-1111-1111-111111111111"]}], "team_id": "00000000-0000-4000-8000-000000000002", "user_id": "00000000-0000-4000-8000-000000000001"}, "type": "rate-limits"}} When the request is sent Then the response status is 409 Conflict @@ -200,7 +200,7 @@ Feature: AI Gateway Scenario: Create an AI Gateway rate limit returns "Created" response Given operation "CreateAiGatewayRateLimit" enabled And new "CreateAiGatewayRateLimit" request - And body with value {"data": {"attributes": {"cost_microcents_per_minute": 100000000, "input_tokens_per_minute": null, "mode": "ALERT", "name": "Default rate limit", "output_tokens_per_minute": null, "requests_per_minute": 600, "selector": [{"dim": "user_id", "per_value": true, "values": ["11111111-1111-1111-1111-111111111111"]}], "team_id": "00000000-0000-4000-8000-000000000002", "user_id": "00000000-0000-4000-8000-000000000001", "window_limits": [{"amount": 2000000000, "metric": "cost", "window": "24h"}]}, "type": "rate-limits"}} + And body with value {"data": {"attributes": {"cost_microcents_per_minute": 100000000, "input_tokens_per_minute": null, "mode": "ALERT", "name": "Default rate limit", "output_tokens_per_minute": null, "requests_per_minute": 600, "selector": [{"dim": "user_id", "per_value": true, "values": ["11111111-1111-1111-1111-111111111111"]}], "team_id": "00000000-0000-4000-8000-000000000002", "user_id": "00000000-0000-4000-8000-000000000001"}, "type": "rate-limits"}} When the request is sent Then the response status is 201 Created @@ -1068,7 +1068,7 @@ Feature: AI Gateway Given operation "UpdateAiGatewayRateLimit" enabled And new "UpdateAiGatewayRateLimit" request And request contains "id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"cost_microcents_per_minute": null, "input_tokens_per_minute": null, "mode": "ALERT", "output_tokens_per_minute": null, "requests_per_minute": null, "tags": null, "team_id": null, "user_id": null, "window_limits": [{"amount": 2000000000, "metric": "cost", "window": "24h"}]}, "id": "11111111-1111-1111-1111-111111111111", "type": "rate-limits"}} + And body with value {"data": {"attributes": {"cost_microcents_per_minute": null, "input_tokens_per_minute": null, "mode": "ALERT", "output_tokens_per_minute": null, "requests_per_minute": null, "tags": null, "team_id": null, "user_id": null}, "id": "11111111-1111-1111-1111-111111111111", "type": "rate-limits"}} When the request is sent Then the response status is 400 Bad Request @@ -1077,7 +1077,7 @@ Feature: AI Gateway Given operation "UpdateAiGatewayRateLimit" enabled And new "UpdateAiGatewayRateLimit" request And request contains "id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"cost_microcents_per_minute": null, "input_tokens_per_minute": null, "mode": "ALERT", "output_tokens_per_minute": null, "requests_per_minute": null, "tags": null, "team_id": null, "user_id": null, "window_limits": [{"amount": 2000000000, "metric": "cost", "window": "24h"}]}, "id": "11111111-1111-1111-1111-111111111111", "type": "rate-limits"}} + And body with value {"data": {"attributes": {"cost_microcents_per_minute": null, "input_tokens_per_minute": null, "mode": "ALERT", "output_tokens_per_minute": null, "requests_per_minute": null, "tags": null, "team_id": null, "user_id": null}, "id": "11111111-1111-1111-1111-111111111111", "type": "rate-limits"}} When the request is sent Then the response status is 409 Conflict @@ -1086,7 +1086,7 @@ Feature: AI Gateway Given operation "UpdateAiGatewayRateLimit" enabled And new "UpdateAiGatewayRateLimit" request And request contains "id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"cost_microcents_per_minute": null, "input_tokens_per_minute": null, "mode": "ALERT", "output_tokens_per_minute": null, "requests_per_minute": null, "tags": null, "team_id": null, "user_id": null, "window_limits": [{"amount": 2000000000, "metric": "cost", "window": "24h"}]}, "id": "11111111-1111-1111-1111-111111111111", "type": "rate-limits"}} + And body with value {"data": {"attributes": {"cost_microcents_per_minute": null, "input_tokens_per_minute": null, "mode": "ALERT", "output_tokens_per_minute": null, "requests_per_minute": null, "tags": null, "team_id": null, "user_id": null}, "id": "11111111-1111-1111-1111-111111111111", "type": "rate-limits"}} When the request is sent Then the response status is 404 Not Found @@ -1095,7 +1095,7 @@ Feature: AI Gateway Given operation "UpdateAiGatewayRateLimit" enabled And new "UpdateAiGatewayRateLimit" request And request contains "id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"cost_microcents_per_minute": null, "input_tokens_per_minute": null, "mode": "ALERT", "output_tokens_per_minute": null, "requests_per_minute": null, "tags": null, "team_id": null, "user_id": null, "window_limits": [{"amount": 2000000000, "metric": "cost", "window": "24h"}]}, "id": "11111111-1111-1111-1111-111111111111", "type": "rate-limits"}} + And body with value {"data": {"attributes": {"cost_microcents_per_minute": null, "input_tokens_per_minute": null, "mode": "ALERT", "output_tokens_per_minute": null, "requests_per_minute": null, "tags": null, "team_id": null, "user_id": null}, "id": "11111111-1111-1111-1111-111111111111", "type": "rate-limits"}} When the request is sent Then the response status is 200 OK