From 86d394e97e25a68171c1adde3e739eba34733ade Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Thu, 21 May 2026 16:47:11 +0000 Subject: [PATCH 1/4] Document LLM Observability LLM provider integration endpoints (#3363) Co-authored-by: ci.datadog-api-spec --- .generator/schemas/v2/openapi.yaml | 870 ++++++++++++++++++ .../CreateLLMObsIntegrationInference.rb | 105 +++ .../ListLLMObsIntegrationAccounts.rb | 8 + .../ListLLMObsIntegrationModels.rb | 8 + features/scenarios_model_mapping.rb | 12 + features/v2/llm_observability.feature | 54 ++ features/v2/undo.json | 18 + lib/datadog_api_client/configuration.rb | 3 + lib/datadog_api_client/inflector.rb | 26 + .../v2/api/llm_observability_api.rb | 245 +++++ .../v2/models/llm_obs_anthropic_effort.rb | 29 + .../v2/models/llm_obs_anthropic_metadata.rb | 123 +++ .../llm_obs_anthropic_thinking_config.rb | 141 +++ .../models/llm_obs_anthropic_thinking_type.rb | 28 + .../models/llm_obs_azure_open_ai_metadata.rb | 125 +++ .../v2/models/llm_obs_bedrock_metadata.rb | 105 +++ .../v2/models/llm_obs_inference_code.rb | 165 ++++ .../v2/models/llm_obs_inference_content.rb | 144 +++ .../models/llm_obs_inference_content_value.rb | 125 +++ .../llm_obs_inference_error_response.rb | 144 +++ .../v2/models/llm_obs_inference_function.rb | 154 ++++ .../v2/models/llm_obs_inference_message.rb | 161 ++++ .../v2/models/llm_obs_inference_run_result.rb | 302 ++++++ .../v2/models/llm_obs_inference_tool.rb | 144 +++ .../v2/models/llm_obs_inference_tool_call.rb | 135 +++ .../models/llm_obs_inference_tool_result.rb | 135 +++ .../v2/models/llm_obs_integration_account.rb | 216 +++++ .../llm_obs_integration_inference_request.rb | 303 ++++++ .../llm_obs_integration_inference_response.rb | 334 +++++++ .../v2/models/llm_obs_integration_model.rb | 301 ++++++ .../v2/models/llm_obs_integration_name.rb | 31 + .../v2/models/llm_obs_internal_reasoning.rb | 141 +++ .../v2/models/llm_obs_open_ai_metadata.rb | 124 +++ .../llm_obs_open_ai_reasoning_effort.rb | 30 + .../llm_obs_open_ai_reasoning_summary.rb | 28 + .../v2/models/llm_obs_vertex_ai_metadata.rb | 127 +++ 36 files changed, 5144 insertions(+) create mode 100644 examples/v2/llm-observability/CreateLLMObsIntegrationInference.rb create mode 100644 examples/v2/llm-observability/ListLLMObsIntegrationAccounts.rb create mode 100644 examples/v2/llm-observability/ListLLMObsIntegrationModels.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_anthropic_effort.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_anthropic_metadata.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_anthropic_thinking_config.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_anthropic_thinking_type.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_azure_open_ai_metadata.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_bedrock_metadata.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_inference_code.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_inference_content.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_inference_content_value.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_inference_error_response.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_inference_function.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_inference_message.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_inference_run_result.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_inference_tool.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_inference_tool_call.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_inference_tool_result.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_integration_account.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_integration_inference_request.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_integration_inference_response.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_integration_model.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_integration_name.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_internal_reasoning.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_open_ai_metadata.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_open_ai_reasoning_effort.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_open_ai_reasoning_summary.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_vertex_ai_metadata.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index da1a2769faa4..eccadc473d47 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -813,6 +813,14 @@ components: schema: example: "my-job" type: string + LLMObsAccountIDPathParameter: + description: The ID of the integration account. + example: "account-abc123" + in: path + name: account_id + required: true + schema: + type: string LLMObsAnnotationQueueIDPathParameter: description: The ID of the LLM Observability annotation queue. example: "00000000-0000-0000-0000-000000000001" @@ -845,6 +853,14 @@ components: required: true schema: type: string + LLMObsIntegrationPathParameter: + description: The name of the LLM integration. + example: openai + in: path + name: integration + required: true + schema: + $ref: "#/components/schemas/LLMObsIntegrationName" LLMObsProjectIDPathParameter: description: The ID of the LLM Observability project. example: "a33671aa-24fd-4dcd-9b33-a8ec7dde7751" @@ -41790,6 +41806,80 @@ components: required: - label_schemas type: object + LLMObsAnthropicEffort: + description: The effort level for Anthropic inference. + enum: + - low + - medium + - high + - max + example: medium + nullable: true + type: string + x-enum-varnames: + - LOW + - MEDIUM + - HIGH + - MAX + LLMObsAnthropicMetadata: + description: Anthropic-specific metadata for an inference request. + properties: + effort: + $ref: "#/components/schemas/LLMObsAnthropicEffort" + thinking: + $ref: "#/components/schemas/LLMObsAnthropicThinkingConfig" + nullable: true + type: object + LLMObsAnthropicThinkingConfig: + description: Configuration for Anthropic extended thinking feature. + properties: + budget_tokens: + description: Maximum token budget for extended thinking. Required when type is `enabled`. + example: 1024 + format: int64 + nullable: true + type: integer + type: + $ref: "#/components/schemas/LLMObsAnthropicThinkingType" + required: + - type + type: object + LLMObsAnthropicThinkingType: + description: The thinking mode for Anthropic extended thinking. + enum: + - enabled + - disabled + - adaptive + example: enabled + type: string + x-enum-varnames: + - ENABLED + - DISABLED + - ADAPTIVE + LLMObsAzureOpenAIMetadata: + description: Azure OpenAI-specific metadata for an integration account or inference request. + properties: + deployment_id: + description: The Azure OpenAI deployment ID. + example: "my-gpt4-deployment" + type: string + model_version: + description: The model version deployed in Azure. + example: "0613" + type: string + resource_name: + description: The Azure OpenAI resource name. + example: "my-azure-resource" + type: string + type: object + LLMObsBedrockMetadata: + description: Amazon Bedrock-specific metadata for an inference request. + properties: + region: + description: The AWS region for the Bedrock request. + example: "us-east-1" + type: string + type: object LLMObsContentBlock: description: |- A single content block rendered inside a `display_block` interaction. @@ -44115,6 +44205,536 @@ components: required: - data type: object + LLMObsInferenceCode: + description: A generated code snippet for running an inference request programmatically. + properties: + code: + description: The generated code content. + example: "import openai\nclient = openai.OpenAI()\n..." + type: string + id: + description: Unique identifier for the code snippet. + example: "code-python-001" + type: string + type: + description: The programming language or SDK type of the code snippet. + example: "python" + type: string + required: + - id + - type + - code + type: object + LLMObsInferenceContent: + description: A structured content block within a message. + properties: + type: + description: The content block type. + example: "text" + type: string + value: + $ref: "#/components/schemas/LLMObsInferenceContentValue" + required: + - type + - value + type: object + LLMObsInferenceContentList: + description: List of structured content blocks in a message. + items: + $ref: "#/components/schemas/LLMObsInferenceContent" + type: array + LLMObsInferenceContentValue: + description: The typed value of a message content block. + properties: + text: + description: Plain text content. + example: "Hello, how can I help you?" + type: string + tool_call: + $ref: "#/components/schemas/LLMObsInferenceToolCall" + tool_call_result: + $ref: "#/components/schemas/LLMObsInferenceToolResult" + type: object + LLMObsInferenceErrorResponse: + description: Error details returned when an inference provider returns an error. + properties: + message: + description: A human-readable description of the error. + example: "The model does not exist." + type: string + type: + description: The provider-specific error type. + example: "invalid_request_error" + type: string + required: + - type + - message + type: object + LLMObsInferenceFunction: + description: A function definition for a tool available to the model. + properties: + description: + description: A description of what the function does. + example: "Get the current weather for a location." + type: string + name: + description: The name of the function. + example: "get_weather" + type: string + parameters: + additionalProperties: {} + description: JSON schema describing the function parameters. + example: + properties: + location: + type: string + type: object + type: object + required: + - name + - parameters + type: object + LLMObsInferenceMessage: + description: A single message in an LLM inference conversation. + properties: + content: + description: Plain text content of the message. + example: "What is the capital of France?" + type: string + contents: + $ref: "#/components/schemas/LLMObsInferenceContentList" + id: + description: Unique identifier for the message. + example: "msg_001" + type: string + role: + description: The role of the message author. + example: "user" + type: string + tool_calls: + $ref: "#/components/schemas/LLMObsInferenceToolCallsList" + tool_results: + $ref: "#/components/schemas/LLMObsInferenceToolResultsList" + type: object + LLMObsInferenceMessagesList: + description: List of messages in an inference conversation. + items: + $ref: "#/components/schemas/LLMObsInferenceMessage" + type: array + LLMObsInferenceRunResult: + description: The output of a completed LLM inference call. + properties: + assessment: + description: An optional assessment of the inference output quality. + example: "pass" + nullable: true + type: string + content: + description: The text content of the model response. + example: "The capital of France is Paris." + type: string + finish_reason: + description: The reason the model stopped generating tokens. + example: "stop" + type: string + inference_codes: + $ref: "#/components/schemas/LLMObsIntegrationInferenceCodesResponse" + input_tokens: + description: Number of input tokens consumed. + example: 15 + format: int64 + type: integer + internal_reasoning: + $ref: "#/components/schemas/LLMObsInternalReasoning" + nullable: true + latency: + description: Request latency in milliseconds. + example: 843 + format: int64 + type: integer + output_tokens: + description: Number of output tokens generated. + example: 10 + format: int64 + type: integer + tools: + $ref: "#/components/schemas/LLMObsInferenceToolsList" + total_tokens: + description: Total tokens used (input plus output). + example: 25 + format: int64 + type: integer + required: + - content + - input_tokens + - output_tokens + - total_tokens + - latency + - finish_reason + - inference_codes + - tools + - assessment + type: object + LLMObsInferenceTool: + description: A tool definition available to the model during inference. + properties: + function: + $ref: "#/components/schemas/LLMObsInferenceFunction" + type: + description: The type of tool. + example: "function" + type: string + required: + - type + - function + type: object + LLMObsInferenceToolCall: + description: A tool call made during LLM inference. + properties: + arguments: + additionalProperties: {} + description: The arguments passed to the tool. + example: + location: "San Francisco" + type: object + name: + description: The name of the tool being called. + example: "get_weather" + type: string + tool_id: + description: Unique identifier for the tool call. + example: "call_abc123" + type: string + type: + description: The type of tool call. + example: "function" + type: string + type: object + LLMObsInferenceToolCallsList: + description: List of tool calls in a message. + items: + $ref: "#/components/schemas/LLMObsInferenceToolCall" + type: array + LLMObsInferenceToolResult: + description: The result returned by a tool call during LLM inference. + properties: + name: + description: The name of the tool that produced this result. + example: "get_weather" + type: string + result: + description: The result content returned by the tool. + example: "The weather in San Francisco is 68°F and sunny." + type: string + tool_id: + description: Identifier matching the corresponding tool call. + example: "call_abc123" + type: string + type: + description: The type of tool result. + example: "function" + type: string + type: object + LLMObsInferenceToolResultsList: + description: List of tool results in a message. + items: + $ref: "#/components/schemas/LLMObsInferenceToolResult" + type: array + LLMObsInferenceToolsList: + description: List of tools available to the model. + items: + $ref: "#/components/schemas/LLMObsInferenceTool" + type: array + LLMObsIntegrationAccount: + description: A configured account for an LLM provider integration. + properties: + account_id: + description: Provider-specific account identifier. + example: "org-XYZ123" + type: string + account_name: + description: Human-readable name for the integration account. + example: "Production OpenAI" + type: string + account_region: + description: Provider region associated with the account, if applicable. + example: "us-east-1" + type: string + azure_openai_metadata: + $ref: "#/components/schemas/LLMObsAzureOpenAIMetadata" + id: + description: Unique identifier for the integration account. + example: "account-abc123" + type: string + integration: + description: The name of the LLM provider integration. + example: openai + type: string + vertex_ai_metadata: + $ref: "#/components/schemas/LLMObsVertexAIMetadata" + required: + - id + - account_id + - account_name + - integration + type: object + LLMObsIntegrationInferenceCodesResponse: + description: List of generated code snippets for the inference configuration. + items: + $ref: "#/components/schemas/LLMObsInferenceCode" + type: array + LLMObsIntegrationInferenceRequest: + description: Parameters for an LLM inference request. + properties: + anthropic_metadata: + $ref: "#/components/schemas/LLMObsAnthropicMetadata" + nullable: true + azure_openai_metadata: + $ref: "#/components/schemas/LLMObsAzureOpenAIMetadata" + nullable: true + bedrock_metadata: + $ref: "#/components/schemas/LLMObsBedrockMetadata" + nullable: true + frequency_penalty: + description: Penalty for token frequency to reduce repetition. + example: 0.0 + format: double + nullable: true + type: number + json_schema: + description: JSON schema for structured output, if supported by the model. + example: '{"type":"object","properties":{"answer":{"type":"string"}}}' + nullable: true + type: string + max_completion_tokens: + description: Maximum number of completion tokens to generate (alternative to max_tokens for some providers). + example: 1024 + format: int64 + nullable: true + type: integer + max_tokens: + description: Maximum number of tokens to generate. + example: 1024 + format: int64 + nullable: true + type: integer + messages: + $ref: "#/components/schemas/LLMObsInferenceMessagesList" + model_id: + description: The model identifier to use for inference. + example: "gpt-4o" + type: string + openai_metadata: + $ref: "#/components/schemas/LLMObsOpenAIMetadata" + nullable: true + presence_penalty: + description: Penalty for token presence to encourage topic diversity. + example: 0.0 + format: double + nullable: true + type: number + temperature: + description: Sampling temperature between 0 and 2. Higher values produce more random output. + example: 0.7 + format: double + nullable: true + type: number + tools: + $ref: "#/components/schemas/LLMObsInferenceToolsList" + top_k: + description: Top-K sampling parameter. + example: 50 + format: int64 + nullable: true + type: integer + top_p: + description: Nucleus sampling probability mass. + example: 1.0 + format: double + nullable: true + type: number + vertex_ai_metadata: + $ref: "#/components/schemas/LLMObsVertexAIMetadata" + nullable: true + required: + - model_id + - messages + type: object + LLMObsIntegrationInferenceResponse: + description: The result of an LLM inference request, including input parameters and the model response. + properties: + anthropic_metadata: + $ref: "#/components/schemas/LLMObsAnthropicMetadata" + nullable: true + azure_openai_metadata: + $ref: "#/components/schemas/LLMObsAzureOpenAIMetadata" + nullable: true + bedrock_metadata: + $ref: "#/components/schemas/LLMObsBedrockMetadata" + nullable: true + error_response: + $ref: "#/components/schemas/LLMObsInferenceErrorResponse" + frequency_penalty: + description: Frequency penalty that was applied. + example: 0.0 + format: double + nullable: true + type: number + json_schema: + description: JSON schema that was applied for structured output. + example: '{"type":"object","properties":{"answer":{"type":"string"}}}' + nullable: true + type: string + max_completion_tokens: + description: Maximum number of completion tokens that were configured. + example: 1024 + format: int64 + nullable: true + type: integer + max_tokens: + description: Maximum number of tokens that were configured. + example: 1024 + format: int64 + nullable: true + type: integer + messages: + $ref: "#/components/schemas/LLMObsInferenceMessagesList" + model_id: + description: The model identifier used for inference. + example: "gpt-4o" + type: string + openai_metadata: + $ref: "#/components/schemas/LLMObsOpenAIMetadata" + nullable: true + presence_penalty: + description: Presence penalty that was applied. + example: 0.0 + format: double + nullable: true + type: number + response: + $ref: "#/components/schemas/LLMObsInferenceRunResult" + temperature: + description: Sampling temperature that was used. + example: 0.7 + format: double + nullable: true + type: number + tools: + $ref: "#/components/schemas/LLMObsInferenceToolsList" + top_k: + description: Top-K sampling parameter that was used. + example: 50 + format: int64 + nullable: true + type: integer + top_p: + description: Nucleus sampling parameter that was used. + example: 1.0 + format: double + nullable: true + type: number + vertex_ai_metadata: + $ref: "#/components/schemas/LLMObsVertexAIMetadata" + nullable: true + required: + - model_id + - messages + - response + type: object + LLMObsIntegrationModel: + description: A model available for a given LLM provider integration and account. + properties: + has_access: + description: Whether the account has access to this model. + example: true + type: boolean + id: + description: Unique identifier for the model entry. + example: "gpt-4o" + type: string + integration: + description: The name of the LLM provider integration. + example: "openai" + type: string + integration_display_name: + description: Human-readable name of the LLM provider integration. + example: "OpenAI" + type: string + json_schema: + description: Whether the model supports structured output via JSON schema. + example: true + type: boolean + model_display_name: + description: Human-readable model name. + example: "GPT-4o" + type: string + model_id: + description: Provider-specific model identifier used in inference calls. + example: "gpt-4o" + type: string + provider: + description: The underlying model provider. + example: "openai" + type: string + provider_display_name: + description: Human-readable name of the underlying model provider. + example: "OpenAI" + type: string + region_prefix_overrides: + $ref: "#/components/schemas/LLMObsIntegrationModelRegionPrefixOverrides" + required: + - id + - model_id + - model_display_name + - integration + - integration_display_name + - provider + - provider_display_name + - json_schema + - has_access + type: object + LLMObsIntegrationModelRegionPrefixOverrides: + additionalProperties: + type: string + description: Map of region-specific model ID prefix overrides. + example: + us-east-1: "us." + type: object + LLMObsIntegrationName: + description: The name of a supported LLM provider integration. + enum: + - openai + - amazon_bedrock + - anthropic + - azure_openai + - vertex_ai + - llmproxy + example: openai + type: string + x-enum-varnames: + - OPENAI + - AMAZON_BEDROCK + - ANTHROPIC + - AZURE_OPENAI + - VERTEX_AI + - LLMPROXY + LLMObsInternalReasoning: + description: The model's internal reasoning or thinking output, if available. + properties: + reasoning_tokens: + description: Number of tokens used for internal reasoning. + example: 256 + format: int64 + nullable: true + type: integer + text: + description: The reasoning text produced by the model. + example: "Let me think about this step by step..." + type: string + required: + - text + type: object LLMObsLabelSchema: description: Schema definition for a single label in an annotation queue. properties: @@ -44214,6 +44834,44 @@ components: - CATEGORICAL - BOOLEAN - JSON + LLMObsOpenAIMetadata: + description: OpenAI-specific metadata for an inference request. + properties: + reasoning_effort: + $ref: "#/components/schemas/LLMObsOpenAIReasoningEffort" + reasoning_summary: + $ref: "#/components/schemas/LLMObsOpenAIReasoningSummary" + type: object + LLMObsOpenAIReasoningEffort: + description: The reasoning effort level for OpenAI models that support it. + enum: + - none + - low + - medium + - high + - xhigh + example: medium + nullable: true + type: string + x-enum-varnames: + - NONE + - LOW + - MEDIUM + - HIGH + - XHIGH + LLMObsOpenAIReasoningSummary: + description: The verbosity of the reasoning summary. + enum: + - auto + - concise + - detailed + example: auto + nullable: true + type: string + x-enum-varnames: + - AUTO + - CONCISE + - DETAILED LLMObsProjectDataAttributesRequest: description: Attributes for creating an LLM Observability project. properties: @@ -44841,6 +45499,25 @@ components: - TRACE - EXPERIMENT_TRACE - SESSION + LLMObsVertexAIMetadata: + description: Vertex AI-specific metadata for an integration account or inference request. + properties: + location: + description: The Vertex AI region. + example: "us-central1" + type: string + project: + description: The Google Cloud project ID. + example: "my-gcp-project" + type: string + project_ids: + description: List of Google Cloud project IDs available to the service account. + example: + - "my-gcp-project" + items: + type: string + type: array + type: object Language: description: Programming language enum: @@ -121464,6 +122141,199 @@ paths: x-unstable: |- **Note**: This endpoint is in preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/llm-obs/v1/integrations/{integration}/accounts: + get: + description: Retrieve the list of configured accounts for the specified LLM provider integration. + operationId: ListLLMObsIntegrationAccounts + parameters: + - $ref: "#/components/parameters/LLMObsIntegrationPathParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + - account_id: "org-XYZ123" + account_name: "Production OpenAI" + account_region: "" + id: "account-abc123" + integration: "openai" + schema: + items: + $ref: "#/components/schemas/LLMObsIntegrationAccount" + type: array + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: List LLM integration accounts + tags: + - LLM Observability + x-unstable: |- + **Note**: This endpoint is in Preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/llm-obs/v1/integrations/{integration}/{account_id}/inference: + post: + description: Run an LLM inference request through the specified integration and account, returning the model response and token usage. + operationId: CreateLLMObsIntegrationInference + parameters: + - $ref: "#/components/parameters/LLMObsIntegrationPathParameter" + - $ref: "#/components/parameters/LLMObsAccountIDPathParameter" + requestBody: + content: + application/json: + examples: + default: + value: + max_tokens: 256 + messages: + - content: "What is the capital of France?" + role: "user" + model_id: "gpt-4o" + temperature: 0.7 + schema: + $ref: "#/components/schemas/LLMObsIntegrationInferenceRequest" + description: Inference request parameters. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + max_tokens: 256 + messages: + - content: "What is the capital of France?" + role: "user" + model_id: "gpt-4o" + response: + assessment: "pass" + content: "The capital of France is Paris." + finish_reason: "stop" + inference_codes: [] + input_tokens: 15 + latency: 843 + output_tokens: 9 + tools: [] + total_tokens: 24 + temperature: 0.7 + schema: + $ref: "#/components/schemas/LLMObsIntegrationInferenceResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Run an LLM inference + tags: + - LLM Observability + x-unstable: |- + **Note**: This endpoint is in Preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/llm-obs/v1/integrations/{integration}/{account_id}/models: + get: + description: Retrieve the list of models available for the specified LLM provider integration and account. + operationId: ListLLMObsIntegrationModels + parameters: + - $ref: "#/components/parameters/LLMObsIntegrationPathParameter" + - $ref: "#/components/parameters/LLMObsAccountIDPathParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + - has_access: true + id: "gpt-4o" + integration: "openai" + integration_display_name: "OpenAI" + json_schema: true + model_display_name: "GPT-4o" + model_id: "gpt-4o" + provider: "openai" + provider_display_name: "OpenAI" + schema: + items: + $ref: "#/components/schemas/LLMObsIntegrationModel" + type: array + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: List LLM integration models + tags: + - LLM Observability + x-unstable: |- + **Note**: This endpoint is in Preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/llm-obs/v1/projects: get: description: List all LLM Observability projects sorted by creation date, newest first. diff --git a/examples/v2/llm-observability/CreateLLMObsIntegrationInference.rb b/examples/v2/llm-observability/CreateLLMObsIntegrationInference.rb new file mode 100644 index 000000000000..7a85d0c223e5 --- /dev/null +++ b/examples/v2/llm-observability/CreateLLMObsIntegrationInference.rb @@ -0,0 +1,105 @@ +# Run an LLM inference returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.create_llm_obs_integration_inference".to_sym] = true +end +api_instance = DatadogAPIClient::V2::LLMObservabilityAPI.new + +body = DatadogAPIClient::V2::LLMObsIntegrationInferenceRequest.new({ + anthropic_metadata: DatadogAPIClient::V2::LLMObsAnthropicMetadata.new({ + effort: DatadogAPIClient::V2::LLMObsAnthropicEffort::MEDIUM, + thinking: DatadogAPIClient::V2::LLMObsAnthropicThinkingConfig.new({ + budget_tokens: 1024, + type: DatadogAPIClient::V2::LLMObsAnthropicThinkingType::ENABLED, + }), + }), + azure_openai_metadata: DatadogAPIClient::V2::LLMObsAzureOpenAIMetadata.new({ + deployment_id: "my-gpt4-deployment", + model_version: "0613", + resource_name: "my-azure-resource", + }), + bedrock_metadata: DatadogAPIClient::V2::LLMObsBedrockMetadata.new({ + region: "us-east-1", + }), + frequency_penalty: 0.0, + json_schema: '{"type":"object","properties":{"answer":{"type":"string"}}}', + max_completion_tokens: 1024, + max_tokens: 1024, + messages: [ + DatadogAPIClient::V2::LLMObsInferenceMessage.new({ + content: "What is the capital of France?", + contents: [ + DatadogAPIClient::V2::LLMObsInferenceContent.new({ + type: "text", + value: DatadogAPIClient::V2::LLMObsInferenceContentValue.new({ + text: "Hello, how can I help you?", + tool_call: DatadogAPIClient::V2::LLMObsInferenceToolCall.new({ + arguments: { + "location": "San Francisco", + }, + name: "get_weather", + tool_id: "call_abc123", + type: "function", + }), + tool_call_result: DatadogAPIClient::V2::LLMObsInferenceToolResult.new({ + name: "get_weather", + result: "The weather in San Francisco is 68°F and sunny.", + tool_id: "call_abc123", + type: "function", + }), + }), + }), + ], + id: "msg_001", + role: "user", + tool_calls: [ + DatadogAPIClient::V2::LLMObsInferenceToolCall.new({ + arguments: { + "location": "San Francisco", + }, + name: "get_weather", + tool_id: "call_abc123", + type: "function", + }), + ], + tool_results: [ + DatadogAPIClient::V2::LLMObsInferenceToolResult.new({ + name: "get_weather", + result: "The weather in San Francisco is 68°F and sunny.", + tool_id: "call_abc123", + type: "function", + }), + ], + }), + ], + model_id: "gpt-4o", + openai_metadata: DatadogAPIClient::V2::LLMObsOpenAIMetadata.new({ + reasoning_effort: DatadogAPIClient::V2::LLMObsOpenAIReasoningEffort::MEDIUM, + reasoning_summary: DatadogAPIClient::V2::LLMObsOpenAIReasoningSummary::AUTO, + }), + presence_penalty: 0.0, + temperature: 0.7, + tools: [ + DatadogAPIClient::V2::LLMObsInferenceTool.new({ + function: DatadogAPIClient::V2::LLMObsInferenceFunction.new({ + description: "Get the current weather for a location.", + name: "get_weather", + parameters: { + "properties": "{'location': {'type': 'string'}}", "type": "object", + }, + }), + type: "function", + }), + ], + top_k: 50, + top_p: 1.0, + vertex_ai_metadata: DatadogAPIClient::V2::LLMObsVertexAIMetadata.new({ + location: "us-central1", + project: "my-gcp-project", + project_ids: [ + "my-gcp-project", + ], + }), +}) +p api_instance.create_llm_obs_integration_inference(LLMObsIntegrationName::OPENAI, "account_id", body) diff --git a/examples/v2/llm-observability/ListLLMObsIntegrationAccounts.rb b/examples/v2/llm-observability/ListLLMObsIntegrationAccounts.rb new file mode 100644 index 000000000000..25ac7de60822 --- /dev/null +++ b/examples/v2/llm-observability/ListLLMObsIntegrationAccounts.rb @@ -0,0 +1,8 @@ +# List LLM integration accounts returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_llm_obs_integration_accounts".to_sym] = true +end +api_instance = DatadogAPIClient::V2::LLMObservabilityAPI.new +p api_instance.list_llm_obs_integration_accounts(LLMObsIntegrationName::OPENAI) diff --git a/examples/v2/llm-observability/ListLLMObsIntegrationModels.rb b/examples/v2/llm-observability/ListLLMObsIntegrationModels.rb new file mode 100644 index 000000000000..bd25b614f861 --- /dev/null +++ b/examples/v2/llm-observability/ListLLMObsIntegrationModels.rb @@ -0,0 +1,8 @@ +# List LLM integration models returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_llm_obs_integration_models".to_sym] = true +end +api_instance = DatadogAPIClient::V2::LLMObservabilityAPI.new +p api_instance.list_llm_obs_integration_models(LLMObsIntegrationName::OPENAI, "account_id") diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 9246b6c3a9d0..7612f595f75d 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -984,6 +984,18 @@ "experiment_id" => "String", "body" => "LLMObsExperimentEventsRequest", }, + "v2.ListLLMObsIntegrationAccounts" => { + "integration" => "LLMObsIntegrationName", + }, + "v2.CreateLLMObsIntegrationInference" => { + "integration" => "LLMObsIntegrationName", + "account_id" => "String", + "body" => "LLMObsIntegrationInferenceRequest", + }, + "v2.ListLLMObsIntegrationModels" => { + "integration" => "LLMObsIntegrationName", + "account_id" => "String", + }, "v2.ListLLMObsProjects" => { "filter_id" => "String", "filter_name" => "String", diff --git a/features/v2/llm_observability.feature b/features/v2/llm_observability.feature index ec671390145d..0e1a7e984fa0 100644 --- a/features/v2/llm_observability.feature +++ b/features/v2/llm_observability.feature @@ -588,6 +588,40 @@ Feature: LLM Observability When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/ml-observability + Scenario: List LLM integration accounts returns "Bad Request" response + Given operation "ListLLMObsIntegrationAccounts" enabled + And new "ListLLMObsIntegrationAccounts" request + And request contains "integration" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/ml-observability + Scenario: List LLM integration accounts returns "OK" response + Given operation "ListLLMObsIntegrationAccounts" enabled + And new "ListLLMObsIntegrationAccounts" request + And request contains "integration" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/ml-observability + Scenario: List LLM integration models returns "Bad Request" response + Given operation "ListLLMObsIntegrationModels" enabled + And new "ListLLMObsIntegrationModels" request + And request contains "integration" parameter from "REPLACE.ME" + And request contains "account_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/ml-observability + Scenario: List LLM integration models returns "OK" response + Given operation "ListLLMObsIntegrationModels" enabled + And new "ListLLMObsIntegrationModels" request + And request contains "integration" parameter from "REPLACE.ME" + And request contains "account_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/ml-observability Scenario: List events for an LLM Observability experiment returns "Bad Request" response Given operation "ListLLMObsExperimentEvents" enabled @@ -639,6 +673,26 @@ Feature: LLM Observability When the request is sent Then the response status is 404 Not Found + @generated @skip @team:DataDog/ml-observability + Scenario: Run an LLM inference returns "Bad Request" response + Given operation "CreateLLMObsIntegrationInference" enabled + And new "CreateLLMObsIntegrationInference" request + And request contains "integration" parameter from "REPLACE.ME" + And request contains "account_id" parameter from "REPLACE.ME" + And body with value {"anthropic_metadata": {"effort": "medium", "thinking": {"budget_tokens": 1024, "type": "enabled"}}, "azure_openai_metadata": {"deployment_id": "my-gpt4-deployment", "model_version": "0613", "resource_name": "my-azure-resource"}, "bedrock_metadata": {"region": "us-east-1"}, "frequency_penalty": 0.0, "json_schema": "{\"type\":\"object\",\"properties\":{\"answer\":{\"type\":\"string\"}}}", "max_completion_tokens": 1024, "max_tokens": 1024, "messages": [{"content": "What is the capital of France?", "contents": [{"type": "text", "value": {"text": "Hello, how can I help you?", "tool_call": {"arguments": {"location": "San Francisco"}, "name": "get_weather", "tool_id": "call_abc123", "type": "function"}, "tool_call_result": {"name": "get_weather", "result": "The weather in San Francisco is 68\u00b0F and sunny.", "tool_id": "call_abc123", "type": "function"}}}], "id": "msg_001", "role": "user", "tool_calls": [{"arguments": {"location": "San Francisco"}, "name": "get_weather", "tool_id": "call_abc123", "type": "function"}], "tool_results": [{"name": "get_weather", "result": "The weather in San Francisco is 68\u00b0F and sunny.", "tool_id": "call_abc123", "type": "function"}]}], "model_id": "gpt-4o", "openai_metadata": {"reasoning_effort": "medium", "reasoning_summary": "auto"}, "presence_penalty": 0.0, "temperature": 0.7, "tools": [{"function": {"description": "Get the current weather for a location.", "name": "get_weather", "parameters": {"properties": {"location": {"type": "string"}}, "type": "object"}}, "type": "function"}], "top_k": 50, "top_p": 1.0, "vertex_ai_metadata": {"location": "us-central1", "project": "my-gcp-project", "project_ids": ["my-gcp-project"]}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/ml-observability + Scenario: Run an LLM inference returns "OK" response + Given operation "CreateLLMObsIntegrationInference" enabled + And new "CreateLLMObsIntegrationInference" request + And request contains "integration" parameter from "REPLACE.ME" + And request contains "account_id" parameter from "REPLACE.ME" + And body with value {"anthropic_metadata": {"effort": "medium", "thinking": {"budget_tokens": 1024, "type": "enabled"}}, "azure_openai_metadata": {"deployment_id": "my-gpt4-deployment", "model_version": "0613", "resource_name": "my-azure-resource"}, "bedrock_metadata": {"region": "us-east-1"}, "frequency_penalty": 0.0, "json_schema": "{\"type\":\"object\",\"properties\":{\"answer\":{\"type\":\"string\"}}}", "max_completion_tokens": 1024, "max_tokens": 1024, "messages": [{"content": "What is the capital of France?", "contents": [{"type": "text", "value": {"text": "Hello, how can I help you?", "tool_call": {"arguments": {"location": "San Francisco"}, "name": "get_weather", "tool_id": "call_abc123", "type": "function"}, "tool_call_result": {"name": "get_weather", "result": "The weather in San Francisco is 68\u00b0F and sunny.", "tool_id": "call_abc123", "type": "function"}}}], "id": "msg_001", "role": "user", "tool_calls": [{"arguments": {"location": "San Francisco"}, "name": "get_weather", "tool_id": "call_abc123", "type": "function"}], "tool_results": [{"name": "get_weather", "result": "The weather in San Francisco is 68\u00b0F and sunny.", "tool_id": "call_abc123", "type": "function"}]}], "model_id": "gpt-4o", "openai_metadata": {"reasoning_effort": "medium", "reasoning_summary": "auto"}, "presence_penalty": 0.0, "temperature": 0.7, "tools": [{"function": {"description": "Get the current weather for a location.", "name": "get_weather", "parameters": {"properties": {"location": {"type": "string"}}, "type": "object"}}, "type": "function"}], "top_k": 50, "top_p": 1.0, "vertex_ai_metadata": {"location": "us-central1", "project": "my-gcp-project", "project_ids": ["my-gcp-project"]}} + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/ml-observability Scenario: Search LLM Observability experimentation entities returns "Bad Request" response Given operation "SearchLLMObsExperimentation" enabled diff --git a/features/v2/undo.json b/features/v2/undo.json index 02753f1a80a7..9c1afc7d96bb 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -3797,6 +3797,24 @@ "type": "unsafe" } }, + "ListLLMObsIntegrationAccounts": { + "tag": "LLM Observability", + "undo": { + "type": "safe" + } + }, + "CreateLLMObsIntegrationInference": { + "tag": "LLM Observability", + "undo": { + "type": "safe" + } + }, + "ListLLMObsIntegrationModels": { + "tag": "LLM Observability", + "undo": { + "type": "safe" + } + }, "ListLLMObsProjects": { "tag": "LLM Observability", "undo": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index 0cac7943cea0..b3d8d620f33f 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -214,6 +214,7 @@ def initialize "v2.create_llm_obs_dataset_records": false, "v2.create_llm_obs_experiment": false, "v2.create_llm_obs_experiment_events": false, + "v2.create_llm_obs_integration_inference": false, "v2.create_llm_obs_project": false, "v2.delete_llm_obs_annotation_queue": false, "v2.delete_llm_obs_annotation_queue_interactions": false, @@ -231,6 +232,8 @@ def initialize "v2.list_llm_obs_datasets": false, "v2.list_llm_obs_experiment_events": false, "v2.list_llm_obs_experiments": false, + "v2.list_llm_obs_integration_accounts": false, + "v2.list_llm_obs_integration_models": false, "v2.list_llm_obs_projects": false, "v2.list_llm_obs_spans": false, "v2.search_llm_obs_experimentation": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 9f29fb4ac5cb..84ed5973c691 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -3715,6 +3715,12 @@ def overrides "v2.llm_obs_annotation_queue_update_data_request" => "LLMObsAnnotationQueueUpdateDataRequest", "v2.llm_obs_annotation_queue_update_request" => "LLMObsAnnotationQueueUpdateRequest", "v2.llm_obs_annotation_schema" => "LLMObsAnnotationSchema", + "v2.llm_obs_anthropic_effort" => "LLMObsAnthropicEffort", + "v2.llm_obs_anthropic_metadata" => "LLMObsAnthropicMetadata", + "v2.llm_obs_anthropic_thinking_config" => "LLMObsAnthropicThinkingConfig", + "v2.llm_obs_anthropic_thinking_type" => "LLMObsAnthropicThinkingType", + "v2.llm_obs_azure_open_ai_metadata" => "LLMObsAzureOpenAIMetadata", + "v2.llm_obs_bedrock_metadata" => "LLMObsBedrockMetadata", "v2.llm_obs_content_block" => "LLMObsContentBlock", "v2.llm_obs_content_block_header_level" => "LLMObsContentBlockHeaderLevel", "v2.llm_obs_content_block_llm_obs_trace_interaction_type" => "LLMObsContentBlockLLMObsTraceInteractionType", @@ -3856,10 +3862,29 @@ def overrides "v2.llm_obs_experiment_update_data_attributes_request" => "LLMObsExperimentUpdateDataAttributesRequest", "v2.llm_obs_experiment_update_data_request" => "LLMObsExperimentUpdateDataRequest", "v2.llm_obs_experiment_update_request" => "LLMObsExperimentUpdateRequest", + "v2.llm_obs_inference_code" => "LLMObsInferenceCode", + "v2.llm_obs_inference_content" => "LLMObsInferenceContent", + "v2.llm_obs_inference_content_value" => "LLMObsInferenceContentValue", + "v2.llm_obs_inference_error_response" => "LLMObsInferenceErrorResponse", + "v2.llm_obs_inference_function" => "LLMObsInferenceFunction", + "v2.llm_obs_inference_message" => "LLMObsInferenceMessage", + "v2.llm_obs_inference_run_result" => "LLMObsInferenceRunResult", + "v2.llm_obs_inference_tool" => "LLMObsInferenceTool", + "v2.llm_obs_inference_tool_call" => "LLMObsInferenceToolCall", + "v2.llm_obs_inference_tool_result" => "LLMObsInferenceToolResult", + "v2.llm_obs_integration_account" => "LLMObsIntegrationAccount", + "v2.llm_obs_integration_inference_request" => "LLMObsIntegrationInferenceRequest", + "v2.llm_obs_integration_inference_response" => "LLMObsIntegrationInferenceResponse", + "v2.llm_obs_integration_model" => "LLMObsIntegrationModel", + "v2.llm_obs_integration_name" => "LLMObsIntegrationName", + "v2.llm_obs_internal_reasoning" => "LLMObsInternalReasoning", "v2.llm_obs_label_schema" => "LLMObsLabelSchema", "v2.llm_obs_label_schema_type" => "LLMObsLabelSchemaType", "v2.llm_obs_metric_assessment" => "LLMObsMetricAssessment", "v2.llm_obs_metric_score_type" => "LLMObsMetricScoreType", + "v2.llm_obs_open_ai_metadata" => "LLMObsOpenAIMetadata", + "v2.llm_obs_open_ai_reasoning_effort" => "LLMObsOpenAIReasoningEffort", + "v2.llm_obs_open_ai_reasoning_summary" => "LLMObsOpenAIReasoningSummary", "v2.llm_obs_project_data_attributes_request" => "LLMObsProjectDataAttributesRequest", "v2.llm_obs_project_data_attributes_response" => "LLMObsProjectDataAttributesResponse", "v2.llm_obs_project_data_request" => "LLMObsProjectDataRequest", @@ -3896,6 +3921,7 @@ def overrides "v2.llm_obs_trace_interaction_item" => "LLMObsTraceInteractionItem", "v2.llm_obs_trace_interaction_response_item" => "LLMObsTraceInteractionResponseItem", "v2.llm_obs_trace_interaction_type" => "LLMObsTraceInteractionType", + "v2.llm_obs_vertex_ai_metadata" => "LLMObsVertexAIMetadata", "v2.log" => "Log", "v2.log_attributes" => "LogAttributes", "v2.logs_aggregate_bucket" => "LogsAggregateBucket", diff --git a/lib/datadog_api_client/v2/api/llm_observability_api.rb b/lib/datadog_api_client/v2/api/llm_observability_api.rb index 7eb5a93af50e..4c2039ada331 100644 --- a/lib/datadog_api_client/v2/api/llm_observability_api.rb +++ b/lib/datadog_api_client/v2/api/llm_observability_api.rb @@ -574,6 +574,94 @@ def create_llm_obs_experiment_events_with_http_info(experiment_id, body, opts = return data, status_code, headers end + # Run an LLM inference. + # + # @see #create_llm_obs_integration_inference_with_http_info + def create_llm_obs_integration_inference(integration, account_id, body, opts = {}) + data, _status_code, _headers = create_llm_obs_integration_inference_with_http_info(integration, account_id, body, opts) + data + end + + # Run an LLM inference. + # + # Run an LLM inference request through the specified integration and account, returning the model response and token usage. + # + # @param integration [LLMObsIntegrationName] The name of the LLM integration. + # @param account_id [String] The ID of the integration account. + # @param body [LLMObsIntegrationInferenceRequest] Inference request parameters. + # @param opts [Hash] the optional parameters + # @return [Array<(LLMObsIntegrationInferenceResponse, Integer, Hash)>] LLMObsIntegrationInferenceResponse data, response status code and response headers + def create_llm_obs_integration_inference_with_http_info(integration, account_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_llm_obs_integration_inference".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_llm_obs_integration_inference") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_llm_obs_integration_inference")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: LLMObservabilityAPI.create_llm_obs_integration_inference ...' + end + # verify the required parameter 'integration' is set + if @api_client.config.client_side_validation && integration.nil? + fail ArgumentError, "Missing the required parameter 'integration' when calling LLMObservabilityAPI.create_llm_obs_integration_inference" + end + # verify enum value + allowable_values = ['openai', 'amazon_bedrock', 'anthropic', 'azure_openai', 'vertex_ai', 'llmproxy'] + if @api_client.config.client_side_validation && !allowable_values.include?(integration) + fail ArgumentError, "invalid value for \"integration\", must be one of #{allowable_values}" + end + # verify the required parameter 'account_id' is set + if @api_client.config.client_side_validation && account_id.nil? + fail ArgumentError, "Missing the required parameter 'account_id' when calling LLMObservabilityAPI.create_llm_obs_integration_inference" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling LLMObservabilityAPI.create_llm_obs_integration_inference" + end + # resource path + local_var_path = '/api/v2/llm-obs/v1/integrations/{integration}/{account_id}/inference'.sub('{integration}', CGI.escape(integration.to_s).gsub('%2F', '/')).sub('{account_id}', CGI.escape(account_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'LLMObsIntegrationInferenceResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :create_llm_obs_integration_inference, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: LLMObservabilityAPI#create_llm_obs_integration_inference\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Create an LLM Observability project. # # @see #create_llm_obs_project_with_http_info @@ -1844,6 +1932,163 @@ def list_llm_obs_experiments_with_http_info(opts = {}) return data, status_code, headers end + # List LLM integration accounts. + # + # @see #list_llm_obs_integration_accounts_with_http_info + def list_llm_obs_integration_accounts(integration, opts = {}) + data, _status_code, _headers = list_llm_obs_integration_accounts_with_http_info(integration, opts) + data + end + + # List LLM integration accounts. + # + # Retrieve the list of configured accounts for the specified LLM provider integration. + # + # @param integration [LLMObsIntegrationName] The name of the LLM integration. + # @param opts [Hash] the optional parameters + # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers + def list_llm_obs_integration_accounts_with_http_info(integration, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_llm_obs_integration_accounts".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_llm_obs_integration_accounts") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_llm_obs_integration_accounts")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: LLMObservabilityAPI.list_llm_obs_integration_accounts ...' + end + # verify the required parameter 'integration' is set + if @api_client.config.client_side_validation && integration.nil? + fail ArgumentError, "Missing the required parameter 'integration' when calling LLMObservabilityAPI.list_llm_obs_integration_accounts" + end + # verify enum value + allowable_values = ['openai', 'amazon_bedrock', 'anthropic', 'azure_openai', 'vertex_ai', 'llmproxy'] + if @api_client.config.client_side_validation && !allowable_values.include?(integration) + fail ArgumentError, "invalid value for \"integration\", must be one of #{allowable_values}" + end + # resource path + local_var_path = '/api/v2/llm-obs/v1/integrations/{integration}/accounts'.sub('{integration}', CGI.escape(integration.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'Array' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_llm_obs_integration_accounts, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: LLMObservabilityAPI#list_llm_obs_integration_accounts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List LLM integration models. + # + # @see #list_llm_obs_integration_models_with_http_info + def list_llm_obs_integration_models(integration, account_id, opts = {}) + data, _status_code, _headers = list_llm_obs_integration_models_with_http_info(integration, account_id, opts) + data + end + + # List LLM integration models. + # + # Retrieve the list of models available for the specified LLM provider integration and account. + # + # @param integration [LLMObsIntegrationName] The name of the LLM integration. + # @param account_id [String] The ID of the integration account. + # @param opts [Hash] the optional parameters + # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers + def list_llm_obs_integration_models_with_http_info(integration, account_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_llm_obs_integration_models".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_llm_obs_integration_models") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_llm_obs_integration_models")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: LLMObservabilityAPI.list_llm_obs_integration_models ...' + end + # verify the required parameter 'integration' is set + if @api_client.config.client_side_validation && integration.nil? + fail ArgumentError, "Missing the required parameter 'integration' when calling LLMObservabilityAPI.list_llm_obs_integration_models" + end + # verify enum value + allowable_values = ['openai', 'amazon_bedrock', 'anthropic', 'azure_openai', 'vertex_ai', 'llmproxy'] + if @api_client.config.client_side_validation && !allowable_values.include?(integration) + fail ArgumentError, "invalid value for \"integration\", must be one of #{allowable_values}" + end + # verify the required parameter 'account_id' is set + if @api_client.config.client_side_validation && account_id.nil? + fail ArgumentError, "Missing the required parameter 'account_id' when calling LLMObservabilityAPI.list_llm_obs_integration_models" + end + # resource path + local_var_path = '/api/v2/llm-obs/v1/integrations/{integration}/{account_id}/models'.sub('{integration}', CGI.escape(integration.to_s).gsub('%2F', '/')).sub('{account_id}', CGI.escape(account_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'Array' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_llm_obs_integration_models, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: LLMObservabilityAPI#list_llm_obs_integration_models\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # List LLM Observability projects. # # @see #list_llm_obs_projects_with_http_info diff --git a/lib/datadog_api_client/v2/models/llm_obs_anthropic_effort.rb b/lib/datadog_api_client/v2/models/llm_obs_anthropic_effort.rb new file mode 100644 index 000000000000..81f0cf669668 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_anthropic_effort.rb @@ -0,0 +1,29 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The effort level for Anthropic inference. + class LLMObsAnthropicEffort + include BaseEnumModel + + LOW = "low".freeze + MEDIUM = "medium".freeze + HIGH = "high".freeze + MAX = "max".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_anthropic_metadata.rb b/lib/datadog_api_client/v2/models/llm_obs_anthropic_metadata.rb new file mode 100644 index 000000000000..a9fde770592b --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_anthropic_metadata.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Anthropic-specific metadata for an inference request. + class LLMObsAnthropicMetadata + include BaseGenericModel + + # The effort level for Anthropic inference. + attr_accessor :effort + + # Configuration for Anthropic extended thinking feature. + attr_accessor :thinking + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'effort' => :'effort', + :'thinking' => :'thinking' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'effort' => :'LLMObsAnthropicEffort', + :'thinking' => :'LLMObsAnthropicThinkingConfig' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'effort', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsAnthropicMetadata` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'effort') + self.effort = attributes[:'effort'] + end + + if attributes.key?(:'thinking') + self.thinking = attributes[:'thinking'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + effort == o.effort && + thinking == o.thinking && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [effort, thinking, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_anthropic_thinking_config.rb b/lib/datadog_api_client/v2/models/llm_obs_anthropic_thinking_config.rb new file mode 100644 index 000000000000..aefba0fb730c --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_anthropic_thinking_config.rb @@ -0,0 +1,141 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Configuration for Anthropic extended thinking feature. + class LLMObsAnthropicThinkingConfig + include BaseGenericModel + + # Maximum token budget for extended thinking. Required when type is `enabled`. + attr_accessor :budget_tokens + + # The thinking mode for Anthropic extended thinking. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'budget_tokens' => :'budget_tokens', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'budget_tokens' => :'Integer', + :'type' => :'LLMObsAnthropicThinkingType' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'budget_tokens', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsAnthropicThinkingConfig` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'budget_tokens') + self.budget_tokens = attributes[:'budget_tokens'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + budget_tokens == o.budget_tokens && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [budget_tokens, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_anthropic_thinking_type.rb b/lib/datadog_api_client/v2/models/llm_obs_anthropic_thinking_type.rb new file mode 100644 index 000000000000..d75996f9108c --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_anthropic_thinking_type.rb @@ -0,0 +1,28 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The thinking mode for Anthropic extended thinking. + class LLMObsAnthropicThinkingType + include BaseEnumModel + + ENABLED = "enabled".freeze + DISABLED = "disabled".freeze + ADAPTIVE = "adaptive".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_azure_open_ai_metadata.rb b/lib/datadog_api_client/v2/models/llm_obs_azure_open_ai_metadata.rb new file mode 100644 index 000000000000..c71a0d8f7372 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_azure_open_ai_metadata.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Azure OpenAI-specific metadata for an integration account or inference request. + class LLMObsAzureOpenAIMetadata + include BaseGenericModel + + # The Azure OpenAI deployment ID. + attr_accessor :deployment_id + + # The model version deployed in Azure. + attr_accessor :model_version + + # The Azure OpenAI resource name. + attr_accessor :resource_name + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'deployment_id' => :'deployment_id', + :'model_version' => :'model_version', + :'resource_name' => :'resource_name' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'deployment_id' => :'String', + :'model_version' => :'String', + :'resource_name' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsAzureOpenAIMetadata` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'deployment_id') + self.deployment_id = attributes[:'deployment_id'] + end + + if attributes.key?(:'model_version') + self.model_version = attributes[:'model_version'] + end + + if attributes.key?(:'resource_name') + self.resource_name = attributes[:'resource_name'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + deployment_id == o.deployment_id && + model_version == o.model_version && + resource_name == o.resource_name && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [deployment_id, model_version, resource_name, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_bedrock_metadata.rb b/lib/datadog_api_client/v2/models/llm_obs_bedrock_metadata.rb new file mode 100644 index 000000000000..1a3ba0cbdd7c --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_bedrock_metadata.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Amazon Bedrock-specific metadata for an inference request. + class LLMObsBedrockMetadata + include BaseGenericModel + + # The AWS region for the Bedrock request. + attr_accessor :region + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'region' => :'region' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'region' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsBedrockMetadata` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'region') + self.region = attributes[:'region'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + region == o.region && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [region, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_inference_code.rb b/lib/datadog_api_client/v2/models/llm_obs_inference_code.rb new file mode 100644 index 000000000000..75f99056c6c0 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_inference_code.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A generated code snippet for running an inference request programmatically. + class LLMObsInferenceCode + include BaseGenericModel + + # The generated code content. + attr_reader :code + + # Unique identifier for the code snippet. + attr_reader :id + + # The programming language or SDK type of the code snippet. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'code' => :'code', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'code' => :'String', + :'id' => :'String', + :'type' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsInferenceCode` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'code') + self.code = attributes[:'code'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @code.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param code [Object] Object to be assigned + # @!visibility private + def code=(code) + if code.nil? + fail ArgumentError, 'invalid value for "code", code cannot be nil.' + end + @code = code + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + code == o.code && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [code, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_inference_content.rb b/lib/datadog_api_client/v2/models/llm_obs_inference_content.rb new file mode 100644 index 000000000000..ff1498050857 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_inference_content.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A structured content block within a message. + class LLMObsInferenceContent + include BaseGenericModel + + # The content block type. + attr_reader :type + + # The typed value of a message content block. + attr_reader :value + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'type' => :'type', + :'value' => :'value' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'type' => :'String', + :'value' => :'LLMObsInferenceContentValue' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsInferenceContent` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'value') + self.value = attributes[:'value'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @type.nil? + return false if @value.nil? + true + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Custom attribute writer method with validation + # @param value [Object] Object to be assigned + # @!visibility private + def value=(value) + if value.nil? + fail ArgumentError, 'invalid value for "value", value cannot be nil.' + end + @value = value + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + type == o.type && + value == o.value && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [type, value, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_inference_content_value.rb b/lib/datadog_api_client/v2/models/llm_obs_inference_content_value.rb new file mode 100644 index 000000000000..bad61d48ca4a --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_inference_content_value.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The typed value of a message content block. + class LLMObsInferenceContentValue + include BaseGenericModel + + # Plain text content. + attr_accessor :text + + # A tool call made during LLM inference. + attr_accessor :tool_call + + # The result returned by a tool call during LLM inference. + attr_accessor :tool_call_result + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'text' => :'text', + :'tool_call' => :'tool_call', + :'tool_call_result' => :'tool_call_result' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'text' => :'String', + :'tool_call' => :'LLMObsInferenceToolCall', + :'tool_call_result' => :'LLMObsInferenceToolResult' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsInferenceContentValue` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'text') + self.text = attributes[:'text'] + end + + if attributes.key?(:'tool_call') + self.tool_call = attributes[:'tool_call'] + end + + if attributes.key?(:'tool_call_result') + self.tool_call_result = attributes[:'tool_call_result'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + text == o.text && + tool_call == o.tool_call && + tool_call_result == o.tool_call_result && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [text, tool_call, tool_call_result, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_inference_error_response.rb b/lib/datadog_api_client/v2/models/llm_obs_inference_error_response.rb new file mode 100644 index 000000000000..f0d158843928 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_inference_error_response.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Error details returned when an inference provider returns an error. + class LLMObsInferenceErrorResponse + include BaseGenericModel + + # A human-readable description of the error. + attr_reader :message + + # The provider-specific error type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'message' => :'message', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'message' => :'String', + :'type' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsInferenceErrorResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'message') + self.message = attributes[:'message'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @message.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param message [Object] Object to be assigned + # @!visibility private + def message=(message) + if message.nil? + fail ArgumentError, 'invalid value for "message", message cannot be nil.' + end + @message = message + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + message == o.message && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [message, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_inference_function.rb b/lib/datadog_api_client/v2/models/llm_obs_inference_function.rb new file mode 100644 index 000000000000..7769f1eb88c0 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_inference_function.rb @@ -0,0 +1,154 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A function definition for a tool available to the model. + class LLMObsInferenceFunction + include BaseGenericModel + + # A description of what the function does. + attr_accessor :description + + # The name of the function. + attr_reader :name + + # JSON schema describing the function parameters. + attr_reader :parameters + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'description' => :'description', + :'name' => :'name', + :'parameters' => :'parameters' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'description' => :'String', + :'name' => :'String', + :'parameters' => :'Hash' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsInferenceFunction` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'parameters') + self.parameters = attributes[:'parameters'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @name.nil? + return false if @parameters.nil? + true + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param parameters [Object] Object to be assigned + # @!visibility private + def parameters=(parameters) + if parameters.nil? + fail ArgumentError, 'invalid value for "parameters", parameters cannot be nil.' + end + @parameters = parameters + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + description == o.description && + name == o.name && + parameters == o.parameters && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [description, name, parameters, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_inference_message.rb b/lib/datadog_api_client/v2/models/llm_obs_inference_message.rb new file mode 100644 index 000000000000..74b938e55fbf --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_inference_message.rb @@ -0,0 +1,161 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A single message in an LLM inference conversation. + class LLMObsInferenceMessage + include BaseGenericModel + + # Plain text content of the message. + attr_accessor :content + + # List of structured content blocks in a message. + attr_accessor :contents + + # Unique identifier for the message. + attr_accessor :id + + # The role of the message author. + attr_accessor :role + + # List of tool calls in a message. + attr_accessor :tool_calls + + # List of tool results in a message. + attr_accessor :tool_results + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'content' => :'content', + :'contents' => :'contents', + :'id' => :'id', + :'role' => :'role', + :'tool_calls' => :'tool_calls', + :'tool_results' => :'tool_results' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'content' => :'String', + :'contents' => :'Array', + :'id' => :'String', + :'role' => :'String', + :'tool_calls' => :'Array', + :'tool_results' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsInferenceMessage` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'content') + self.content = attributes[:'content'] + end + + if attributes.key?(:'contents') + if (value = attributes[:'contents']).is_a?(Array) + self.contents = value + end + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'role') + self.role = attributes[:'role'] + end + + if attributes.key?(:'tool_calls') + if (value = attributes[:'tool_calls']).is_a?(Array) + self.tool_calls = value + end + end + + if attributes.key?(:'tool_results') + if (value = attributes[:'tool_results']).is_a?(Array) + self.tool_results = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + content == o.content && + contents == o.contents && + id == o.id && + role == o.role && + tool_calls == o.tool_calls && + tool_results == o.tool_results && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [content, contents, id, role, tool_calls, tool_results, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_inference_run_result.rb b/lib/datadog_api_client/v2/models/llm_obs_inference_run_result.rb new file mode 100644 index 000000000000..8261ca9fbc36 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_inference_run_result.rb @@ -0,0 +1,302 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The output of a completed LLM inference call. + class LLMObsInferenceRunResult + include BaseGenericModel + + # An optional assessment of the inference output quality. + attr_accessor :assessment + + # The text content of the model response. + attr_reader :content + + # The reason the model stopped generating tokens. + attr_reader :finish_reason + + # List of generated code snippets for the inference configuration. + attr_reader :inference_codes + + # Number of input tokens consumed. + attr_reader :input_tokens + + # The model's internal reasoning or thinking output, if available. + attr_accessor :internal_reasoning + + # Request latency in milliseconds. + attr_reader :latency + + # Number of output tokens generated. + attr_reader :output_tokens + + # List of tools available to the model. + attr_reader :tools + + # Total tokens used (input plus output). + attr_reader :total_tokens + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'assessment' => :'assessment', + :'content' => :'content', + :'finish_reason' => :'finish_reason', + :'inference_codes' => :'inference_codes', + :'input_tokens' => :'input_tokens', + :'internal_reasoning' => :'internal_reasoning', + :'latency' => :'latency', + :'output_tokens' => :'output_tokens', + :'tools' => :'tools', + :'total_tokens' => :'total_tokens' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'assessment' => :'String', + :'content' => :'String', + :'finish_reason' => :'String', + :'inference_codes' => :'Array', + :'input_tokens' => :'Integer', + :'internal_reasoning' => :'LLMObsInternalReasoning', + :'latency' => :'Integer', + :'output_tokens' => :'Integer', + :'tools' => :'Array', + :'total_tokens' => :'Integer' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'assessment', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsInferenceRunResult` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'assessment') + self.assessment = attributes[:'assessment'] + end + + if attributes.key?(:'content') + self.content = attributes[:'content'] + end + + if attributes.key?(:'finish_reason') + self.finish_reason = attributes[:'finish_reason'] + end + + if attributes.key?(:'inference_codes') + if (value = attributes[:'inference_codes']).is_a?(Array) + self.inference_codes = value + end + end + + if attributes.key?(:'input_tokens') + self.input_tokens = attributes[:'input_tokens'] + end + + if attributes.key?(:'internal_reasoning') + self.internal_reasoning = attributes[:'internal_reasoning'] + end + + if attributes.key?(:'latency') + self.latency = attributes[:'latency'] + end + + if attributes.key?(:'output_tokens') + self.output_tokens = attributes[:'output_tokens'] + end + + if attributes.key?(:'tools') + if (value = attributes[:'tools']).is_a?(Array) + self.tools = value + end + end + + if attributes.key?(:'total_tokens') + self.total_tokens = attributes[:'total_tokens'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @content.nil? + return false if @finish_reason.nil? + return false if @inference_codes.nil? + return false if @input_tokens.nil? + return false if @latency.nil? + return false if @output_tokens.nil? + return false if @tools.nil? + return false if @total_tokens.nil? + true + end + + # Custom attribute writer method with validation + # @param content [Object] Object to be assigned + # @!visibility private + def content=(content) + if content.nil? + fail ArgumentError, 'invalid value for "content", content cannot be nil.' + end + @content = content + end + + # Custom attribute writer method with validation + # @param finish_reason [Object] Object to be assigned + # @!visibility private + def finish_reason=(finish_reason) + if finish_reason.nil? + fail ArgumentError, 'invalid value for "finish_reason", finish_reason cannot be nil.' + end + @finish_reason = finish_reason + end + + # Custom attribute writer method with validation + # @param inference_codes [Object] Object to be assigned + # @!visibility private + def inference_codes=(inference_codes) + if inference_codes.nil? + fail ArgumentError, 'invalid value for "inference_codes", inference_codes cannot be nil.' + end + @inference_codes = inference_codes + end + + # Custom attribute writer method with validation + # @param input_tokens [Object] Object to be assigned + # @!visibility private + def input_tokens=(input_tokens) + if input_tokens.nil? + fail ArgumentError, 'invalid value for "input_tokens", input_tokens cannot be nil.' + end + @input_tokens = input_tokens + end + + # Custom attribute writer method with validation + # @param latency [Object] Object to be assigned + # @!visibility private + def latency=(latency) + if latency.nil? + fail ArgumentError, 'invalid value for "latency", latency cannot be nil.' + end + @latency = latency + end + + # Custom attribute writer method with validation + # @param output_tokens [Object] Object to be assigned + # @!visibility private + def output_tokens=(output_tokens) + if output_tokens.nil? + fail ArgumentError, 'invalid value for "output_tokens", output_tokens cannot be nil.' + end + @output_tokens = output_tokens + end + + # Custom attribute writer method with validation + # @param tools [Object] Object to be assigned + # @!visibility private + def tools=(tools) + if tools.nil? + fail ArgumentError, 'invalid value for "tools", tools cannot be nil.' + end + @tools = tools + end + + # Custom attribute writer method with validation + # @param total_tokens [Object] Object to be assigned + # @!visibility private + def total_tokens=(total_tokens) + if total_tokens.nil? + fail ArgumentError, 'invalid value for "total_tokens", total_tokens cannot be nil.' + end + @total_tokens = total_tokens + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + assessment == o.assessment && + content == o.content && + finish_reason == o.finish_reason && + inference_codes == o.inference_codes && + input_tokens == o.input_tokens && + internal_reasoning == o.internal_reasoning && + latency == o.latency && + output_tokens == o.output_tokens && + tools == o.tools && + total_tokens == o.total_tokens && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [assessment, content, finish_reason, inference_codes, input_tokens, internal_reasoning, latency, output_tokens, tools, total_tokens, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_inference_tool.rb b/lib/datadog_api_client/v2/models/llm_obs_inference_tool.rb new file mode 100644 index 000000000000..557247f44708 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_inference_tool.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A tool definition available to the model during inference. + class LLMObsInferenceTool + include BaseGenericModel + + # A function definition for a tool available to the model. + attr_reader :function + + # The type of tool. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'function' => :'function', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'function' => :'LLMObsInferenceFunction', + :'type' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsInferenceTool` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'function') + self.function = attributes[:'function'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @function.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param function [Object] Object to be assigned + # @!visibility private + def function=(function) + if function.nil? + fail ArgumentError, 'invalid value for "function", function cannot be nil.' + end + @function = function + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + function == o.function && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [function, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_inference_tool_call.rb b/lib/datadog_api_client/v2/models/llm_obs_inference_tool_call.rb new file mode 100644 index 000000000000..9d4c47933d57 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_inference_tool_call.rb @@ -0,0 +1,135 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A tool call made during LLM inference. + class LLMObsInferenceToolCall + include BaseGenericModel + + # The arguments passed to the tool. + attr_accessor :arguments + + # The name of the tool being called. + attr_accessor :name + + # Unique identifier for the tool call. + attr_accessor :tool_id + + # The type of tool call. + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'arguments' => :'arguments', + :'name' => :'name', + :'tool_id' => :'tool_id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'arguments' => :'Hash', + :'name' => :'String', + :'tool_id' => :'String', + :'type' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsInferenceToolCall` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'arguments') + self.arguments = attributes[:'arguments'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'tool_id') + self.tool_id = attributes[:'tool_id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + arguments == o.arguments && + name == o.name && + tool_id == o.tool_id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [arguments, name, tool_id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_inference_tool_result.rb b/lib/datadog_api_client/v2/models/llm_obs_inference_tool_result.rb new file mode 100644 index 000000000000..2bbfeb6a4c21 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_inference_tool_result.rb @@ -0,0 +1,135 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The result returned by a tool call during LLM inference. + class LLMObsInferenceToolResult + include BaseGenericModel + + # The name of the tool that produced this result. + attr_accessor :name + + # The result content returned by the tool. + attr_accessor :result + + # Identifier matching the corresponding tool call. + attr_accessor :tool_id + + # The type of tool result. + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'name' => :'name', + :'result' => :'result', + :'tool_id' => :'tool_id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'name' => :'String', + :'result' => :'String', + :'tool_id' => :'String', + :'type' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsInferenceToolResult` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'result') + self.result = attributes[:'result'] + end + + if attributes.key?(:'tool_id') + self.tool_id = attributes[:'tool_id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name && + result == o.result && + tool_id == o.tool_id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [name, result, tool_id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_integration_account.rb b/lib/datadog_api_client/v2/models/llm_obs_integration_account.rb new file mode 100644 index 000000000000..7748b6fec15f --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_integration_account.rb @@ -0,0 +1,216 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A configured account for an LLM provider integration. + class LLMObsIntegrationAccount + include BaseGenericModel + + # Provider-specific account identifier. + attr_reader :account_id + + # Human-readable name for the integration account. + attr_reader :account_name + + # Provider region associated with the account, if applicable. + attr_accessor :account_region + + # Azure OpenAI-specific metadata for an integration account or inference request. + attr_accessor :azure_openai_metadata + + # Unique identifier for the integration account. + attr_reader :id + + # The name of the LLM provider integration. + attr_reader :integration + + # Vertex AI-specific metadata for an integration account or inference request. + attr_accessor :vertex_ai_metadata + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'account_id' => :'account_id', + :'account_name' => :'account_name', + :'account_region' => :'account_region', + :'azure_openai_metadata' => :'azure_openai_metadata', + :'id' => :'id', + :'integration' => :'integration', + :'vertex_ai_metadata' => :'vertex_ai_metadata' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'account_id' => :'String', + :'account_name' => :'String', + :'account_region' => :'String', + :'azure_openai_metadata' => :'LLMObsAzureOpenAIMetadata', + :'id' => :'String', + :'integration' => :'String', + :'vertex_ai_metadata' => :'LLMObsVertexAIMetadata' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsIntegrationAccount` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'account_id') + self.account_id = attributes[:'account_id'] + end + + if attributes.key?(:'account_name') + self.account_name = attributes[:'account_name'] + end + + if attributes.key?(:'account_region') + self.account_region = attributes[:'account_region'] + end + + if attributes.key?(:'azure_openai_metadata') + self.azure_openai_metadata = attributes[:'azure_openai_metadata'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'integration') + self.integration = attributes[:'integration'] + end + + if attributes.key?(:'vertex_ai_metadata') + self.vertex_ai_metadata = attributes[:'vertex_ai_metadata'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @account_id.nil? + return false if @account_name.nil? + return false if @id.nil? + return false if @integration.nil? + true + end + + # Custom attribute writer method with validation + # @param account_id [Object] Object to be assigned + # @!visibility private + def account_id=(account_id) + if account_id.nil? + fail ArgumentError, 'invalid value for "account_id", account_id cannot be nil.' + end + @account_id = account_id + end + + # Custom attribute writer method with validation + # @param account_name [Object] Object to be assigned + # @!visibility private + def account_name=(account_name) + if account_name.nil? + fail ArgumentError, 'invalid value for "account_name", account_name cannot be nil.' + end + @account_name = account_name + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param integration [Object] Object to be assigned + # @!visibility private + def integration=(integration) + if integration.nil? + fail ArgumentError, 'invalid value for "integration", integration cannot be nil.' + end + @integration = integration + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + account_id == o.account_id && + account_name == o.account_name && + account_region == o.account_region && + azure_openai_metadata == o.azure_openai_metadata && + id == o.id && + integration == o.integration && + vertex_ai_metadata == o.vertex_ai_metadata && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [account_id, account_name, account_region, azure_openai_metadata, id, integration, vertex_ai_metadata, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_integration_inference_request.rb b/lib/datadog_api_client/v2/models/llm_obs_integration_inference_request.rb new file mode 100644 index 000000000000..10fa0a6914ef --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_integration_inference_request.rb @@ -0,0 +1,303 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Parameters for an LLM inference request. + class LLMObsIntegrationInferenceRequest + include BaseGenericModel + + # Anthropic-specific metadata for an inference request. + attr_accessor :anthropic_metadata + + # Azure OpenAI-specific metadata for an integration account or inference request. + attr_accessor :azure_openai_metadata + + # Amazon Bedrock-specific metadata for an inference request. + attr_accessor :bedrock_metadata + + # Penalty for token frequency to reduce repetition. + attr_accessor :frequency_penalty + + # JSON schema for structured output, if supported by the model. + attr_accessor :json_schema + + # Maximum number of completion tokens to generate (alternative to max_tokens for some providers). + attr_accessor :max_completion_tokens + + # Maximum number of tokens to generate. + attr_accessor :max_tokens + + # List of messages in an inference conversation. + attr_reader :messages + + # The model identifier to use for inference. + attr_reader :model_id + + # OpenAI-specific metadata for an inference request. + attr_accessor :openai_metadata + + # Penalty for token presence to encourage topic diversity. + attr_accessor :presence_penalty + + # Sampling temperature between 0 and 2. Higher values produce more random output. + attr_accessor :temperature + + # List of tools available to the model. + attr_accessor :tools + + # Top-K sampling parameter. + attr_accessor :top_k + + # Nucleus sampling probability mass. + attr_accessor :top_p + + # Vertex AI-specific metadata for an integration account or inference request. + attr_accessor :vertex_ai_metadata + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'anthropic_metadata' => :'anthropic_metadata', + :'azure_openai_metadata' => :'azure_openai_metadata', + :'bedrock_metadata' => :'bedrock_metadata', + :'frequency_penalty' => :'frequency_penalty', + :'json_schema' => :'json_schema', + :'max_completion_tokens' => :'max_completion_tokens', + :'max_tokens' => :'max_tokens', + :'messages' => :'messages', + :'model_id' => :'model_id', + :'openai_metadata' => :'openai_metadata', + :'presence_penalty' => :'presence_penalty', + :'temperature' => :'temperature', + :'tools' => :'tools', + :'top_k' => :'top_k', + :'top_p' => :'top_p', + :'vertex_ai_metadata' => :'vertex_ai_metadata' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'anthropic_metadata' => :'LLMObsAnthropicMetadata', + :'azure_openai_metadata' => :'LLMObsAzureOpenAIMetadata', + :'bedrock_metadata' => :'LLMObsBedrockMetadata', + :'frequency_penalty' => :'Float', + :'json_schema' => :'String', + :'max_completion_tokens' => :'Integer', + :'max_tokens' => :'Integer', + :'messages' => :'Array', + :'model_id' => :'String', + :'openai_metadata' => :'LLMObsOpenAIMetadata', + :'presence_penalty' => :'Float', + :'temperature' => :'Float', + :'tools' => :'Array', + :'top_k' => :'Integer', + :'top_p' => :'Float', + :'vertex_ai_metadata' => :'LLMObsVertexAIMetadata' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'frequency_penalty', + :'json_schema', + :'max_completion_tokens', + :'max_tokens', + :'presence_penalty', + :'temperature', + :'top_k', + :'top_p', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsIntegrationInferenceRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'anthropic_metadata') + self.anthropic_metadata = attributes[:'anthropic_metadata'] + end + + if attributes.key?(:'azure_openai_metadata') + self.azure_openai_metadata = attributes[:'azure_openai_metadata'] + end + + if attributes.key?(:'bedrock_metadata') + self.bedrock_metadata = attributes[:'bedrock_metadata'] + end + + if attributes.key?(:'frequency_penalty') + self.frequency_penalty = attributes[:'frequency_penalty'] + end + + if attributes.key?(:'json_schema') + self.json_schema = attributes[:'json_schema'] + end + + if attributes.key?(:'max_completion_tokens') + self.max_completion_tokens = attributes[:'max_completion_tokens'] + end + + if attributes.key?(:'max_tokens') + self.max_tokens = attributes[:'max_tokens'] + end + + if attributes.key?(:'messages') + if (value = attributes[:'messages']).is_a?(Array) + self.messages = value + end + end + + if attributes.key?(:'model_id') + self.model_id = attributes[:'model_id'] + end + + if attributes.key?(:'openai_metadata') + self.openai_metadata = attributes[:'openai_metadata'] + end + + if attributes.key?(:'presence_penalty') + self.presence_penalty = attributes[:'presence_penalty'] + end + + if attributes.key?(:'temperature') + self.temperature = attributes[:'temperature'] + end + + if attributes.key?(:'tools') + if (value = attributes[:'tools']).is_a?(Array) + self.tools = value + end + end + + if attributes.key?(:'top_k') + self.top_k = attributes[:'top_k'] + end + + if attributes.key?(:'top_p') + self.top_p = attributes[:'top_p'] + end + + if attributes.key?(:'vertex_ai_metadata') + self.vertex_ai_metadata = attributes[:'vertex_ai_metadata'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @messages.nil? + return false if @model_id.nil? + true + end + + # Custom attribute writer method with validation + # @param messages [Object] Object to be assigned + # @!visibility private + def messages=(messages) + if messages.nil? + fail ArgumentError, 'invalid value for "messages", messages cannot be nil.' + end + @messages = messages + end + + # Custom attribute writer method with validation + # @param model_id [Object] Object to be assigned + # @!visibility private + def model_id=(model_id) + if model_id.nil? + fail ArgumentError, 'invalid value for "model_id", model_id cannot be nil.' + end + @model_id = model_id + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + anthropic_metadata == o.anthropic_metadata && + azure_openai_metadata == o.azure_openai_metadata && + bedrock_metadata == o.bedrock_metadata && + frequency_penalty == o.frequency_penalty && + json_schema == o.json_schema && + max_completion_tokens == o.max_completion_tokens && + max_tokens == o.max_tokens && + messages == o.messages && + model_id == o.model_id && + openai_metadata == o.openai_metadata && + presence_penalty == o.presence_penalty && + temperature == o.temperature && + tools == o.tools && + top_k == o.top_k && + top_p == o.top_p && + vertex_ai_metadata == o.vertex_ai_metadata && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [anthropic_metadata, azure_openai_metadata, bedrock_metadata, frequency_penalty, json_schema, max_completion_tokens, max_tokens, messages, model_id, openai_metadata, presence_penalty, temperature, tools, top_k, top_p, vertex_ai_metadata, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_integration_inference_response.rb b/lib/datadog_api_client/v2/models/llm_obs_integration_inference_response.rb new file mode 100644 index 000000000000..090e74675482 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_integration_inference_response.rb @@ -0,0 +1,334 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The result of an LLM inference request, including input parameters and the model response. + class LLMObsIntegrationInferenceResponse + include BaseGenericModel + + # Anthropic-specific metadata for an inference request. + attr_accessor :anthropic_metadata + + # Azure OpenAI-specific metadata for an integration account or inference request. + attr_accessor :azure_openai_metadata + + # Amazon Bedrock-specific metadata for an inference request. + attr_accessor :bedrock_metadata + + # Error details returned when an inference provider returns an error. + attr_accessor :error_response + + # Frequency penalty that was applied. + attr_accessor :frequency_penalty + + # JSON schema that was applied for structured output. + attr_accessor :json_schema + + # Maximum number of completion tokens that were configured. + attr_accessor :max_completion_tokens + + # Maximum number of tokens that were configured. + attr_accessor :max_tokens + + # List of messages in an inference conversation. + attr_reader :messages + + # The model identifier used for inference. + attr_reader :model_id + + # OpenAI-specific metadata for an inference request. + attr_accessor :openai_metadata + + # Presence penalty that was applied. + attr_accessor :presence_penalty + + # The output of a completed LLM inference call. + attr_reader :response + + # Sampling temperature that was used. + attr_accessor :temperature + + # List of tools available to the model. + attr_accessor :tools + + # Top-K sampling parameter that was used. + attr_accessor :top_k + + # Nucleus sampling parameter that was used. + attr_accessor :top_p + + # Vertex AI-specific metadata for an integration account or inference request. + attr_accessor :vertex_ai_metadata + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'anthropic_metadata' => :'anthropic_metadata', + :'azure_openai_metadata' => :'azure_openai_metadata', + :'bedrock_metadata' => :'bedrock_metadata', + :'error_response' => :'error_response', + :'frequency_penalty' => :'frequency_penalty', + :'json_schema' => :'json_schema', + :'max_completion_tokens' => :'max_completion_tokens', + :'max_tokens' => :'max_tokens', + :'messages' => :'messages', + :'model_id' => :'model_id', + :'openai_metadata' => :'openai_metadata', + :'presence_penalty' => :'presence_penalty', + :'response' => :'response', + :'temperature' => :'temperature', + :'tools' => :'tools', + :'top_k' => :'top_k', + :'top_p' => :'top_p', + :'vertex_ai_metadata' => :'vertex_ai_metadata' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'anthropic_metadata' => :'LLMObsAnthropicMetadata', + :'azure_openai_metadata' => :'LLMObsAzureOpenAIMetadata', + :'bedrock_metadata' => :'LLMObsBedrockMetadata', + :'error_response' => :'LLMObsInferenceErrorResponse', + :'frequency_penalty' => :'Float', + :'json_schema' => :'String', + :'max_completion_tokens' => :'Integer', + :'max_tokens' => :'Integer', + :'messages' => :'Array', + :'model_id' => :'String', + :'openai_metadata' => :'LLMObsOpenAIMetadata', + :'presence_penalty' => :'Float', + :'response' => :'LLMObsInferenceRunResult', + :'temperature' => :'Float', + :'tools' => :'Array', + :'top_k' => :'Integer', + :'top_p' => :'Float', + :'vertex_ai_metadata' => :'LLMObsVertexAIMetadata' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'frequency_penalty', + :'json_schema', + :'max_completion_tokens', + :'max_tokens', + :'presence_penalty', + :'temperature', + :'top_k', + :'top_p', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsIntegrationInferenceResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'anthropic_metadata') + self.anthropic_metadata = attributes[:'anthropic_metadata'] + end + + if attributes.key?(:'azure_openai_metadata') + self.azure_openai_metadata = attributes[:'azure_openai_metadata'] + end + + if attributes.key?(:'bedrock_metadata') + self.bedrock_metadata = attributes[:'bedrock_metadata'] + end + + if attributes.key?(:'error_response') + self.error_response = attributes[:'error_response'] + end + + if attributes.key?(:'frequency_penalty') + self.frequency_penalty = attributes[:'frequency_penalty'] + end + + if attributes.key?(:'json_schema') + self.json_schema = attributes[:'json_schema'] + end + + if attributes.key?(:'max_completion_tokens') + self.max_completion_tokens = attributes[:'max_completion_tokens'] + end + + if attributes.key?(:'max_tokens') + self.max_tokens = attributes[:'max_tokens'] + end + + if attributes.key?(:'messages') + if (value = attributes[:'messages']).is_a?(Array) + self.messages = value + end + end + + if attributes.key?(:'model_id') + self.model_id = attributes[:'model_id'] + end + + if attributes.key?(:'openai_metadata') + self.openai_metadata = attributes[:'openai_metadata'] + end + + if attributes.key?(:'presence_penalty') + self.presence_penalty = attributes[:'presence_penalty'] + end + + if attributes.key?(:'response') + self.response = attributes[:'response'] + end + + if attributes.key?(:'temperature') + self.temperature = attributes[:'temperature'] + end + + if attributes.key?(:'tools') + if (value = attributes[:'tools']).is_a?(Array) + self.tools = value + end + end + + if attributes.key?(:'top_k') + self.top_k = attributes[:'top_k'] + end + + if attributes.key?(:'top_p') + self.top_p = attributes[:'top_p'] + end + + if attributes.key?(:'vertex_ai_metadata') + self.vertex_ai_metadata = attributes[:'vertex_ai_metadata'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @messages.nil? + return false if @model_id.nil? + return false if @response.nil? + true + end + + # Custom attribute writer method with validation + # @param messages [Object] Object to be assigned + # @!visibility private + def messages=(messages) + if messages.nil? + fail ArgumentError, 'invalid value for "messages", messages cannot be nil.' + end + @messages = messages + end + + # Custom attribute writer method with validation + # @param model_id [Object] Object to be assigned + # @!visibility private + def model_id=(model_id) + if model_id.nil? + fail ArgumentError, 'invalid value for "model_id", model_id cannot be nil.' + end + @model_id = model_id + end + + # Custom attribute writer method with validation + # @param response [Object] Object to be assigned + # @!visibility private + def response=(response) + if response.nil? + fail ArgumentError, 'invalid value for "response", response cannot be nil.' + end + @response = response + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + anthropic_metadata == o.anthropic_metadata && + azure_openai_metadata == o.azure_openai_metadata && + bedrock_metadata == o.bedrock_metadata && + error_response == o.error_response && + frequency_penalty == o.frequency_penalty && + json_schema == o.json_schema && + max_completion_tokens == o.max_completion_tokens && + max_tokens == o.max_tokens && + messages == o.messages && + model_id == o.model_id && + openai_metadata == o.openai_metadata && + presence_penalty == o.presence_penalty && + response == o.response && + temperature == o.temperature && + tools == o.tools && + top_k == o.top_k && + top_p == o.top_p && + vertex_ai_metadata == o.vertex_ai_metadata && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [anthropic_metadata, azure_openai_metadata, bedrock_metadata, error_response, frequency_penalty, json_schema, max_completion_tokens, max_tokens, messages, model_id, openai_metadata, presence_penalty, response, temperature, tools, top_k, top_p, vertex_ai_metadata, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_integration_model.rb b/lib/datadog_api_client/v2/models/llm_obs_integration_model.rb new file mode 100644 index 000000000000..fbf442446a09 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_integration_model.rb @@ -0,0 +1,301 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A model available for a given LLM provider integration and account. + class LLMObsIntegrationModel + include BaseGenericModel + + # Whether the account has access to this model. + attr_reader :has_access + + # Unique identifier for the model entry. + attr_reader :id + + # The name of the LLM provider integration. + attr_reader :integration + + # Human-readable name of the LLM provider integration. + attr_reader :integration_display_name + + # Whether the model supports structured output via JSON schema. + attr_reader :json_schema + + # Human-readable model name. + attr_reader :model_display_name + + # Provider-specific model identifier used in inference calls. + attr_reader :model_id + + # The underlying model provider. + attr_reader :provider + + # Human-readable name of the underlying model provider. + attr_reader :provider_display_name + + # Map of region-specific model ID prefix overrides. + attr_accessor :region_prefix_overrides + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'has_access' => :'has_access', + :'id' => :'id', + :'integration' => :'integration', + :'integration_display_name' => :'integration_display_name', + :'json_schema' => :'json_schema', + :'model_display_name' => :'model_display_name', + :'model_id' => :'model_id', + :'provider' => :'provider', + :'provider_display_name' => :'provider_display_name', + :'region_prefix_overrides' => :'region_prefix_overrides' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'has_access' => :'Boolean', + :'id' => :'String', + :'integration' => :'String', + :'integration_display_name' => :'String', + :'json_schema' => :'Boolean', + :'model_display_name' => :'String', + :'model_id' => :'String', + :'provider' => :'String', + :'provider_display_name' => :'String', + :'region_prefix_overrides' => :'Hash' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsIntegrationModel` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'has_access') + self.has_access = attributes[:'has_access'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'integration') + self.integration = attributes[:'integration'] + end + + if attributes.key?(:'integration_display_name') + self.integration_display_name = attributes[:'integration_display_name'] + end + + if attributes.key?(:'json_schema') + self.json_schema = attributes[:'json_schema'] + end + + if attributes.key?(:'model_display_name') + self.model_display_name = attributes[:'model_display_name'] + end + + if attributes.key?(:'model_id') + self.model_id = attributes[:'model_id'] + end + + if attributes.key?(:'provider') + self.provider = attributes[:'provider'] + end + + if attributes.key?(:'provider_display_name') + self.provider_display_name = attributes[:'provider_display_name'] + end + + if attributes.key?(:'region_prefix_overrides') + self.region_prefix_overrides = attributes[:'region_prefix_overrides'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @has_access.nil? + return false if @id.nil? + return false if @integration.nil? + return false if @integration_display_name.nil? + return false if @json_schema.nil? + return false if @model_display_name.nil? + return false if @model_id.nil? + return false if @provider.nil? + return false if @provider_display_name.nil? + true + end + + # Custom attribute writer method with validation + # @param has_access [Object] Object to be assigned + # @!visibility private + def has_access=(has_access) + if has_access.nil? + fail ArgumentError, 'invalid value for "has_access", has_access cannot be nil.' + end + @has_access = has_access + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param integration [Object] Object to be assigned + # @!visibility private + def integration=(integration) + if integration.nil? + fail ArgumentError, 'invalid value for "integration", integration cannot be nil.' + end + @integration = integration + end + + # Custom attribute writer method with validation + # @param integration_display_name [Object] Object to be assigned + # @!visibility private + def integration_display_name=(integration_display_name) + if integration_display_name.nil? + fail ArgumentError, 'invalid value for "integration_display_name", integration_display_name cannot be nil.' + end + @integration_display_name = integration_display_name + end + + # Custom attribute writer method with validation + # @param json_schema [Object] Object to be assigned + # @!visibility private + def json_schema=(json_schema) + if json_schema.nil? + fail ArgumentError, 'invalid value for "json_schema", json_schema cannot be nil.' + end + @json_schema = json_schema + end + + # Custom attribute writer method with validation + # @param model_display_name [Object] Object to be assigned + # @!visibility private + def model_display_name=(model_display_name) + if model_display_name.nil? + fail ArgumentError, 'invalid value for "model_display_name", model_display_name cannot be nil.' + end + @model_display_name = model_display_name + end + + # Custom attribute writer method with validation + # @param model_id [Object] Object to be assigned + # @!visibility private + def model_id=(model_id) + if model_id.nil? + fail ArgumentError, 'invalid value for "model_id", model_id cannot be nil.' + end + @model_id = model_id + end + + # Custom attribute writer method with validation + # @param provider [Object] Object to be assigned + # @!visibility private + def provider=(provider) + if provider.nil? + fail ArgumentError, 'invalid value for "provider", provider cannot be nil.' + end + @provider = provider + end + + # Custom attribute writer method with validation + # @param provider_display_name [Object] Object to be assigned + # @!visibility private + def provider_display_name=(provider_display_name) + if provider_display_name.nil? + fail ArgumentError, 'invalid value for "provider_display_name", provider_display_name cannot be nil.' + end + @provider_display_name = provider_display_name + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + has_access == o.has_access && + id == o.id && + integration == o.integration && + integration_display_name == o.integration_display_name && + json_schema == o.json_schema && + model_display_name == o.model_display_name && + model_id == o.model_id && + provider == o.provider && + provider_display_name == o.provider_display_name && + region_prefix_overrides == o.region_prefix_overrides && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [has_access, id, integration, integration_display_name, json_schema, model_display_name, model_id, provider, provider_display_name, region_prefix_overrides, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_integration_name.rb b/lib/datadog_api_client/v2/models/llm_obs_integration_name.rb new file mode 100644 index 000000000000..e46d7bac772e --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_integration_name.rb @@ -0,0 +1,31 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The name of a supported LLM provider integration. + class LLMObsIntegrationName + include BaseEnumModel + + OPENAI = "openai".freeze + AMAZON_BEDROCK = "amazon_bedrock".freeze + ANTHROPIC = "anthropic".freeze + AZURE_OPENAI = "azure_openai".freeze + VERTEX_AI = "vertex_ai".freeze + LLMPROXY = "llmproxy".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_internal_reasoning.rb b/lib/datadog_api_client/v2/models/llm_obs_internal_reasoning.rb new file mode 100644 index 000000000000..98592c4b0d54 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_internal_reasoning.rb @@ -0,0 +1,141 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The model's internal reasoning or thinking output, if available. + class LLMObsInternalReasoning + include BaseGenericModel + + # Number of tokens used for internal reasoning. + attr_accessor :reasoning_tokens + + # The reasoning text produced by the model. + attr_reader :text + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'reasoning_tokens' => :'reasoning_tokens', + :'text' => :'text' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'reasoning_tokens' => :'Integer', + :'text' => :'String' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'reasoning_tokens', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsInternalReasoning` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'reasoning_tokens') + self.reasoning_tokens = attributes[:'reasoning_tokens'] + end + + if attributes.key?(:'text') + self.text = attributes[:'text'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @text.nil? + true + end + + # Custom attribute writer method with validation + # @param text [Object] Object to be assigned + # @!visibility private + def text=(text) + if text.nil? + fail ArgumentError, 'invalid value for "text", text cannot be nil.' + end + @text = text + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + reasoning_tokens == o.reasoning_tokens && + text == o.text && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [reasoning_tokens, text, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_open_ai_metadata.rb b/lib/datadog_api_client/v2/models/llm_obs_open_ai_metadata.rb new file mode 100644 index 000000000000..de5fe1e981d5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_open_ai_metadata.rb @@ -0,0 +1,124 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # OpenAI-specific metadata for an inference request. + class LLMObsOpenAIMetadata + include BaseGenericModel + + # The reasoning effort level for OpenAI models that support it. + attr_accessor :reasoning_effort + + # The verbosity of the reasoning summary. + attr_accessor :reasoning_summary + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'reasoning_effort' => :'reasoning_effort', + :'reasoning_summary' => :'reasoning_summary' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'reasoning_effort' => :'LLMObsOpenAIReasoningEffort', + :'reasoning_summary' => :'LLMObsOpenAIReasoningSummary' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'reasoning_effort', + :'reasoning_summary', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsOpenAIMetadata` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'reasoning_effort') + self.reasoning_effort = attributes[:'reasoning_effort'] + end + + if attributes.key?(:'reasoning_summary') + self.reasoning_summary = attributes[:'reasoning_summary'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + reasoning_effort == o.reasoning_effort && + reasoning_summary == o.reasoning_summary && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [reasoning_effort, reasoning_summary, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_open_ai_reasoning_effort.rb b/lib/datadog_api_client/v2/models/llm_obs_open_ai_reasoning_effort.rb new file mode 100644 index 000000000000..4a63433c213f --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_open_ai_reasoning_effort.rb @@ -0,0 +1,30 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The reasoning effort level for OpenAI models that support it. + class LLMObsOpenAIReasoningEffort + include BaseEnumModel + + NONE = "none".freeze + LOW = "low".freeze + MEDIUM = "medium".freeze + HIGH = "high".freeze + XHIGH = "xhigh".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_open_ai_reasoning_summary.rb b/lib/datadog_api_client/v2/models/llm_obs_open_ai_reasoning_summary.rb new file mode 100644 index 000000000000..8ed6a8a84e3f --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_open_ai_reasoning_summary.rb @@ -0,0 +1,28 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The verbosity of the reasoning summary. + class LLMObsOpenAIReasoningSummary + include BaseEnumModel + + AUTO = "auto".freeze + CONCISE = "concise".freeze + DETAILED = "detailed".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_vertex_ai_metadata.rb b/lib/datadog_api_client/v2/models/llm_obs_vertex_ai_metadata.rb new file mode 100644 index 000000000000..790418cee1f7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_vertex_ai_metadata.rb @@ -0,0 +1,127 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Vertex AI-specific metadata for an integration account or inference request. + class LLMObsVertexAIMetadata + include BaseGenericModel + + # The Vertex AI region. + attr_accessor :location + + # The Google Cloud project ID. + attr_accessor :project + + # List of Google Cloud project IDs available to the service account. + attr_accessor :project_ids + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'location' => :'location', + :'project' => :'project', + :'project_ids' => :'project_ids' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'location' => :'String', + :'project' => :'String', + :'project_ids' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsVertexAIMetadata` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'location') + self.location = attributes[:'location'] + end + + if attributes.key?(:'project') + self.project = attributes[:'project'] + end + + if attributes.key?(:'project_ids') + if (value = attributes[:'project_ids']).is_a?(Array) + self.project_ids = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + location == o.location && + project == o.project && + project_ids == o.project_ids && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [location, project, project_ids, additional_properties].hash + end + end +end From 2ec9cd3b525f4941039b986f334d46e64d6bf490 Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Thu, 21 May 2026 17:36:02 +0000 Subject: [PATCH 2/4] Cloud Cost Recommendations Search API (#3334) Co-authored-by: ci.datadog-api-spec --- .generator/schemas/v2/openapi.yaml | 198 ++++++++++++++++++ .../SearchCostRecommendations.rb | 18 ++ features/scenarios_model_mapping.rb | 5 + features/v2/cloud_cost_management.feature | 8 + features/v2/undo.json | 6 + lib/datadog_api_client/configuration.rb | 1 + lib/datadog_api_client/inflector.rb | 9 + .../v2/api/cloud_cost_management_api.rb | 77 +++++++ .../v2/models/cost_recommendation_array.rb | 135 ++++++++++++ .../v2/models/cost_recommendation_data.rb | 143 +++++++++++++ .../cost_recommendation_data_attributes.rb | 157 ++++++++++++++ ...data_attributes_potential_daily_savings.rb | 115 ++++++++++ .../models/cost_recommendation_data_type.rb | 26 +++ .../models/recommendations_filter_request.rb | 137 ++++++++++++ ...commendations_filter_request_sort_items.rb | 115 ++++++++++ .../v2/models/recommendations_page_meta.rb | 105 ++++++++++ .../models/recommendations_page_meta_page.rb | 157 ++++++++++++++ 17 files changed, 1412 insertions(+) create mode 100644 examples/v2/cloud-cost-management/SearchCostRecommendations.rb create mode 100644 lib/datadog_api_client/v2/models/cost_recommendation_array.rb create mode 100644 lib/datadog_api_client/v2/models/cost_recommendation_data.rb create mode 100644 lib/datadog_api_client/v2/models/cost_recommendation_data_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/cost_recommendation_data_attributes_potential_daily_savings.rb create mode 100644 lib/datadog_api_client/v2/models/cost_recommendation_data_type.rb create mode 100644 lib/datadog_api_client/v2/models/recommendations_filter_request.rb create mode 100644 lib/datadog_api_client/v2/models/recommendations_filter_request_sort_items.rb create mode 100644 lib/datadog_api_client/v2/models/recommendations_page_meta.rb create mode 100644 lib/datadog_api_client/v2/models/recommendations_page_meta_page.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index eccadc473d47..3ea21c2f0dce 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -17847,6 +17847,76 @@ components: required: - data type: object + CostRecommendationArray: + description: A page of cost recommendations with pagination metadata. + properties: + data: + description: The list of cost recommendations on this page. + items: + $ref: "#/components/schemas/CostRecommendationData" + type: array + meta: + $ref: "#/components/schemas/RecommendationsPageMeta" + required: + - data + type: object + CostRecommendationData: + description: A single cost recommendation entry in JSON:API form. + properties: + attributes: + $ref: "#/components/schemas/CostRecommendationDataAttributes" + id: + description: Unique identifier for the recommendation. + type: string + type: + $ref: "#/components/schemas/CostRecommendationDataType" + required: + - type + type: object + CostRecommendationDataAttributes: + description: Attributes describing a single cost recommendation. + properties: + dd_resource_key: + description: Datadog resource key identifying the recommended resource. + type: string + potential_daily_savings: + $ref: "#/components/schemas/CostRecommendationDataAttributesPotentialDailySavings" + recommendation_type: + description: The kind of recommendation (for example, `terminate` or `rightsize`). + type: string + resource_id: + description: Cloud provider identifier of the resource. + type: string + resource_type: + description: Resource type (for example, `aws_ec2_instance`). + type: string + tags: + description: Tags attached to the recommended resource. + items: + description: A single resource tag. + type: string + type: array + type: object + CostRecommendationDataAttributesPotentialDailySavings: + description: Estimated daily savings if the recommendation is applied. + properties: + amount: + description: Numeric amount of the potential daily savings. + format: double + type: number + currency: + description: ISO 4217 currency code for the savings amount. + type: string + type: object + CostRecommendationDataType: + default: recommendation + description: Recommendation resource type. + enum: + - recommendation + example: recommendation + type: string + x-enum-varnames: + - RECOMMENDATION CostTag: description: A Cloud Cost Management tag. properties: @@ -64113,6 +64183,64 @@ components: type: string x-enum-varnames: - RECOMMENDATION + RecommendationsFilterRequest: + description: Request body for filtering cost recommendations. + example: + filter: "@resource_table:aws_ec2_instance" + sort: + - expression: potential_daily_savings.amount + order: DESC + properties: + filter: + description: Filter expression applied to the recommendations. + type: string + scope: + description: Recommendations scope. Defaults to `ccm`; use `experiment` for experimental recommendations or `*` for both. + type: string + sort: + description: Ordered list of sort clauses applied to the result set. + items: + $ref: "#/components/schemas/RecommendationsFilterRequestSortItems" + type: array + view: + description: Active view name (for example, `active`, `dismissed`, `open`, `in-progress`, or `completed`). + type: string + type: object + RecommendationsFilterRequestSortItems: + description: A single sort clause applied to the cost recommendations result set. + properties: + expression: + description: Field to sort by (for example, `potential_daily_savings.amount`). + type: string + order: + description: Sort direction, either `ASC` or `DESC`. + type: string + type: object + RecommendationsPageMeta: + description: Top-level JSON:API meta object for paginated cost recommendation responses. + properties: + page: + $ref: "#/components/schemas/RecommendationsPageMetaPage" + type: object + RecommendationsPageMetaPage: + description: Pagination metadata for a page of cost recommendations. + properties: + filter: + description: The filter expression that was applied to produce this page. + type: string + next_page_token: + description: Opaque token used to fetch the next page; absent on the last page. + type: string + page_size: + description: Number of items returned in this page (1–10000). + format: int32 + maximum: 10000 + minimum: 1 + type: integer + page_token: + description: Pagination token echoed back from the request. + type: string + type: object ReferenceTableCreateSourceType: description: The source type for creating reference table data. Only these source types can be created through this API. enum: @@ -106527,6 +106655,76 @@ paths: operator: OR permissions: - cloud_cost_management_read + /api/v2/cost/recommendations: + post: + description: List cost recommendations matching a filter, with pagination and sorting. + operationId: SearchCostRecommendations + parameters: + - description: Number of results per page (1–10000). + in: query + name: page[size] + schema: + type: string + - description: Pagination token from a previous response. + in: query + name: page[token] + schema: + type: string + requestBody: + content: + application/json: + examples: + default: + value: + filter: "@resource_table:aws_ec2_instance" + sort: + - expression: potential_daily_savings.amount + order: DESC + schema: + $ref: "#/components/schemas/RecommendationsFilterRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + dd_resource_key: "arn:aws:ec2:us-east-1:123456789012:instance/i-1234567890abcdef0" + potential_daily_savings: + amount: 1.23 + currency: USD + recommendation_type: terminate + resource_id: i-1234567890abcdef0 + resource_type: aws_ec2_instance + tags: + - "env:prod" + - "team:ccm" + id: encoded-event-id-1 + type: recommendation + meta: + page: + filter: "@resource_table:aws_ec2_instance" + next_page_token: "" + page_size: 100 + schema: + $ref: "#/components/schemas/CostRecommendationArray" + description: OK + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cloud_cost_management_read + summary: Search cost recommendations + tags: + - Cloud Cost Management + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/cost/tag_descriptions: get: description: List Cloud Cost Management tag key descriptions for the organization. Use `filter[cloud]` to scope the result to a single cloud provider; when omitted, both cross-cloud defaults and cloud-specific descriptions are returned. diff --git a/examples/v2/cloud-cost-management/SearchCostRecommendations.rb b/examples/v2/cloud-cost-management/SearchCostRecommendations.rb new file mode 100644 index 000000000000..221882d70968 --- /dev/null +++ b/examples/v2/cloud-cost-management/SearchCostRecommendations.rb @@ -0,0 +1,18 @@ +# Search cost recommendations returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.search_cost_recommendations".to_sym] = true +end +api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new + +body = DatadogAPIClient::V2::RecommendationsFilterRequest.new({ + filter: "@resource_table:aws_ec2_instance", + sort: [ + DatadogAPIClient::V2::RecommendationsFilterRequestSortItems.new({ + expression: "potential_daily_savings.amount", + order: "DESC", + }), + ], +}) +p api_instance.search_cost_recommendations(body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 7612f595f75d..62850465cc53 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -2478,6 +2478,11 @@ "cloud_account_id" => "Integer", "body" => "GCPUsageCostConfigPatchRequest", }, + "v2.SearchCostRecommendations" => { + "page_size" => "String", + "page_token" => "String", + "body" => "RecommendationsFilterRequest", + }, "v2.ListCostTagDescriptions" => { "filter_cloud" => "String", }, diff --git a/features/v2/cloud_cost_management.feature b/features/v2/cloud_cost_management.feature index 578dbb420012..17779e4599e4 100644 --- a/features/v2/cloud_cost_management.feature +++ b/features/v2/cloud_cost_management.feature @@ -736,6 +736,14 @@ Feature: Cloud Cost Management When the request is sent Then the response status is 204 Successfully reordered rulesets + @generated @skip @team:DataDog/ccm-optimize + Scenario: Search cost recommendations returns "OK" response + Given operation "SearchCostRecommendations" enabled + And new "SearchCostRecommendations" request + And body with value {"filter": "@resource_table:aws_ec2_instance", "sort": [{"expression": "potential_daily_savings.amount", "order": "DESC"}]} + When the request is sent + Then the response status is 200 OK + @team:DataDog/cloud-cost-management Scenario: Update Cloud Cost Management AWS CUR config returns "Not Found" response Given new "UpdateCostAWSCURConfig" request diff --git a/features/v2/undo.json b/features/v2/undo.json index 9c1afc7d96bb..63597d256db6 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -1826,6 +1826,12 @@ "type": "safe" } }, + "SearchCostRecommendations": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, "ListCostTagDescriptions": { "tag": "Cloud Cost Management", "undo": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index b3d8d620f33f..df8f182a83db 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -355,6 +355,7 @@ def initialize "v2.list_cost_tag_metadata": false, "v2.list_cost_tag_metadata_metrics": false, "v2.list_cost_tag_metadata_orchestrators": false, + "v2.search_cost_recommendations": false, "v2.create_dashboard_secure_embed": false, "v2.delete_dashboard_secure_embed": false, "v2.get_dashboard_secure_embed": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 84ed5973c691..c72838967fbb 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -2126,6 +2126,11 @@ def overrides "v2.cost_orchestrator" => "CostOrchestrator", "v2.cost_orchestrators_response" => "CostOrchestratorsResponse", "v2.cost_orchestrator_type" => "CostOrchestratorType", + "v2.cost_recommendation_array" => "CostRecommendationArray", + "v2.cost_recommendation_data" => "CostRecommendationData", + "v2.cost_recommendation_data_attributes" => "CostRecommendationDataAttributes", + "v2.cost_recommendation_data_attributes_potential_daily_savings" => "CostRecommendationDataAttributesPotentialDailySavings", + "v2.cost_recommendation_data_type" => "CostRecommendationDataType", "v2.cost_tag" => "CostTag", "v2.cost_tag_attributes" => "CostTagAttributes", "v2.cost_tag_description" => "CostTagDescription", @@ -5022,6 +5027,10 @@ def overrides "v2.recommendation_attributes" => "RecommendationAttributes", "v2.recommendation_data" => "RecommendationData", "v2.recommendation_document" => "RecommendationDocument", + "v2.recommendations_filter_request" => "RecommendationsFilterRequest", + "v2.recommendations_filter_request_sort_items" => "RecommendationsFilterRequestSortItems", + "v2.recommendations_page_meta" => "RecommendationsPageMeta", + "v2.recommendations_page_meta_page" => "RecommendationsPageMetaPage", "v2.recommendation_type" => "RecommendationType", "v2.reference_table_create_source_type" => "ReferenceTableCreateSourceType", "v2.reference_table_schema_field_type" => "ReferenceTableSchemaFieldType", diff --git a/lib/datadog_api_client/v2/api/cloud_cost_management_api.rb b/lib/datadog_api_client/v2/api/cloud_cost_management_api.rb index bed6e5726f5a..a2e6e2ae335f 100644 --- a/lib/datadog_api_client/v2/api/cloud_cost_management_api.rb +++ b/lib/datadog_api_client/v2/api/cloud_cost_management_api.rb @@ -3640,6 +3640,83 @@ def reorder_tag_pipelines_rulesets_with_http_info(body, opts = {}) return data, status_code, headers end + # Search cost recommendations. + # + # @see #search_cost_recommendations_with_http_info + def search_cost_recommendations(body, opts = {}) + data, _status_code, _headers = search_cost_recommendations_with_http_info(body, opts) + data + end + + # Search cost recommendations. + # + # List cost recommendations matching a filter, with pagination and sorting. + # + # @param body [RecommendationsFilterRequest] + # @param opts [Hash] the optional parameters + # @option opts [String] :page_size Number of results per page (1–10000). + # @option opts [String] :page_token Pagination token from a previous response. + # @return [Array<(CostRecommendationArray, Integer, Hash)>] CostRecommendationArray data, response status code and response headers + def search_cost_recommendations_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.search_cost_recommendations".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.search_cost_recommendations") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.search_cost_recommendations")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.search_cost_recommendations ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling CloudCostManagementAPI.search_cost_recommendations" + end + # resource path + local_var_path = '/api/v2/cost/recommendations' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? + query_params[:'page[token]'] = opts[:'page_token'] if !opts[:'page_token'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'CostRecommendationArray' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :search_cost_recommendations, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CloudCostManagementAPI#search_cost_recommendations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Update Cloud Cost Management AWS CUR config. # # @see #update_cost_awscur_config_with_http_info diff --git a/lib/datadog_api_client/v2/models/cost_recommendation_array.rb b/lib/datadog_api_client/v2/models/cost_recommendation_array.rb new file mode 100644 index 000000000000..930bdfa837e9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/cost_recommendation_array.rb @@ -0,0 +1,135 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A page of cost recommendations with pagination metadata. + class CostRecommendationArray + include BaseGenericModel + + # The list of cost recommendations on this page. + attr_reader :data + + # Top-level JSON:API meta object for paginated cost recommendation responses. + attr_accessor :meta + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'meta' => :'meta' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array', + :'meta' => :'RecommendationsPageMeta' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CostRecommendationArray` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + + if attributes.key?(:'meta') + self.meta = attributes[:'meta'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + meta == o.meta && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, meta, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/cost_recommendation_data.rb b/lib/datadog_api_client/v2/models/cost_recommendation_data.rb new file mode 100644 index 000000000000..8839ea23cfec --- /dev/null +++ b/lib/datadog_api_client/v2/models/cost_recommendation_data.rb @@ -0,0 +1,143 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A single cost recommendation entry in JSON:API form. + class CostRecommendationData + include BaseGenericModel + + # Attributes describing a single cost recommendation. + attr_accessor :attributes + + # Unique identifier for the recommendation. + attr_accessor :id + + # Recommendation resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'CostRecommendationDataAttributes', + :'id' => :'String', + :'type' => :'CostRecommendationDataType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CostRecommendationData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/cost_recommendation_data_attributes.rb b/lib/datadog_api_client/v2/models/cost_recommendation_data_attributes.rb new file mode 100644 index 000000000000..db9c59499a2c --- /dev/null +++ b/lib/datadog_api_client/v2/models/cost_recommendation_data_attributes.rb @@ -0,0 +1,157 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes describing a single cost recommendation. + class CostRecommendationDataAttributes + include BaseGenericModel + + # Datadog resource key identifying the recommended resource. + attr_accessor :dd_resource_key + + # Estimated daily savings if the recommendation is applied. + attr_accessor :potential_daily_savings + + # The kind of recommendation (for example, `terminate` or `rightsize`). + attr_accessor :recommendation_type + + # Cloud provider identifier of the resource. + attr_accessor :resource_id + + # Resource type (for example, `aws_ec2_instance`). + attr_accessor :resource_type + + # Tags attached to the recommended resource. + attr_accessor :tags + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'dd_resource_key' => :'dd_resource_key', + :'potential_daily_savings' => :'potential_daily_savings', + :'recommendation_type' => :'recommendation_type', + :'resource_id' => :'resource_id', + :'resource_type' => :'resource_type', + :'tags' => :'tags' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'dd_resource_key' => :'String', + :'potential_daily_savings' => :'CostRecommendationDataAttributesPotentialDailySavings', + :'recommendation_type' => :'String', + :'resource_id' => :'String', + :'resource_type' => :'String', + :'tags' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CostRecommendationDataAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'dd_resource_key') + self.dd_resource_key = attributes[:'dd_resource_key'] + end + + if attributes.key?(:'potential_daily_savings') + self.potential_daily_savings = attributes[:'potential_daily_savings'] + end + + if attributes.key?(:'recommendation_type') + self.recommendation_type = attributes[:'recommendation_type'] + end + + if attributes.key?(:'resource_id') + self.resource_id = attributes[:'resource_id'] + end + + if attributes.key?(:'resource_type') + self.resource_type = attributes[:'resource_type'] + end + + if attributes.key?(:'tags') + if (value = attributes[:'tags']).is_a?(Array) + self.tags = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + dd_resource_key == o.dd_resource_key && + potential_daily_savings == o.potential_daily_savings && + recommendation_type == o.recommendation_type && + resource_id == o.resource_id && + resource_type == o.resource_type && + tags == o.tags && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [dd_resource_key, potential_daily_savings, recommendation_type, resource_id, resource_type, tags, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/cost_recommendation_data_attributes_potential_daily_savings.rb b/lib/datadog_api_client/v2/models/cost_recommendation_data_attributes_potential_daily_savings.rb new file mode 100644 index 000000000000..d41be84b6a63 --- /dev/null +++ b/lib/datadog_api_client/v2/models/cost_recommendation_data_attributes_potential_daily_savings.rb @@ -0,0 +1,115 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Estimated daily savings if the recommendation is applied. + class CostRecommendationDataAttributesPotentialDailySavings + include BaseGenericModel + + # Numeric amount of the potential daily savings. + attr_accessor :amount + + # ISO 4217 currency code for the savings amount. + attr_accessor :currency + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'amount' => :'amount', + :'currency' => :'currency' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'amount' => :'Float', + :'currency' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CostRecommendationDataAttributesPotentialDailySavings` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'amount') + self.amount = attributes[:'amount'] + end + + if attributes.key?(:'currency') + self.currency = attributes[:'currency'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + amount == o.amount && + currency == o.currency && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [amount, currency, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/cost_recommendation_data_type.rb b/lib/datadog_api_client/v2/models/cost_recommendation_data_type.rb new file mode 100644 index 000000000000..2c409826abbb --- /dev/null +++ b/lib/datadog_api_client/v2/models/cost_recommendation_data_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Recommendation resource type. + class CostRecommendationDataType + include BaseEnumModel + + RECOMMENDATION = "recommendation".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/recommendations_filter_request.rb b/lib/datadog_api_client/v2/models/recommendations_filter_request.rb new file mode 100644 index 000000000000..f46c56cfe498 --- /dev/null +++ b/lib/datadog_api_client/v2/models/recommendations_filter_request.rb @@ -0,0 +1,137 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request body for filtering cost recommendations. + class RecommendationsFilterRequest + include BaseGenericModel + + # Filter expression applied to the recommendations. + attr_accessor :filter + + # Recommendations scope. Defaults to `ccm`; use `experiment` for experimental recommendations or `*` for both. + attr_accessor :scope + + # Ordered list of sort clauses applied to the result set. + attr_accessor :sort + + # Active view name (for example, `active`, `dismissed`, `open`, `in-progress`, or `completed`). + attr_accessor :view + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'filter' => :'filter', + :'scope' => :'scope', + :'sort' => :'sort', + :'view' => :'view' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'filter' => :'String', + :'scope' => :'String', + :'sort' => :'Array', + :'view' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::RecommendationsFilterRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'filter') + self.filter = attributes[:'filter'] + end + + if attributes.key?(:'scope') + self.scope = attributes[:'scope'] + end + + if attributes.key?(:'sort') + if (value = attributes[:'sort']).is_a?(Array) + self.sort = value + end + end + + if attributes.key?(:'view') + self.view = attributes[:'view'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + filter == o.filter && + scope == o.scope && + sort == o.sort && + view == o.view && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [filter, scope, sort, view, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/recommendations_filter_request_sort_items.rb b/lib/datadog_api_client/v2/models/recommendations_filter_request_sort_items.rb new file mode 100644 index 000000000000..0335b7420adf --- /dev/null +++ b/lib/datadog_api_client/v2/models/recommendations_filter_request_sort_items.rb @@ -0,0 +1,115 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A single sort clause applied to the cost recommendations result set. + class RecommendationsFilterRequestSortItems + include BaseGenericModel + + # Field to sort by (for example, `potential_daily_savings.amount`). + attr_accessor :expression + + # Sort direction, either `ASC` or `DESC`. + attr_accessor :order + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'expression' => :'expression', + :'order' => :'order' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'expression' => :'String', + :'order' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::RecommendationsFilterRequestSortItems` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'expression') + self.expression = attributes[:'expression'] + end + + if attributes.key?(:'order') + self.order = attributes[:'order'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + expression == o.expression && + order == o.order && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [expression, order, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/recommendations_page_meta.rb b/lib/datadog_api_client/v2/models/recommendations_page_meta.rb new file mode 100644 index 000000000000..e5ba8c558e5c --- /dev/null +++ b/lib/datadog_api_client/v2/models/recommendations_page_meta.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Top-level JSON:API meta object for paginated cost recommendation responses. + class RecommendationsPageMeta + include BaseGenericModel + + # Pagination metadata for a page of cost recommendations. + attr_accessor :page + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'page' => :'page' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'page' => :'RecommendationsPageMetaPage' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::RecommendationsPageMeta` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'page') + self.page = attributes[:'page'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + page == o.page && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [page, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/recommendations_page_meta_page.rb b/lib/datadog_api_client/v2/models/recommendations_page_meta_page.rb new file mode 100644 index 000000000000..9fe6c1405669 --- /dev/null +++ b/lib/datadog_api_client/v2/models/recommendations_page_meta_page.rb @@ -0,0 +1,157 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Pagination metadata for a page of cost recommendations. + class RecommendationsPageMetaPage + include BaseGenericModel + + # The filter expression that was applied to produce this page. + attr_accessor :filter + + # Opaque token used to fetch the next page; absent on the last page. + attr_accessor :next_page_token + + # Number of items returned in this page (1–10000). + attr_reader :page_size + + # Pagination token echoed back from the request. + attr_accessor :page_token + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'filter' => :'filter', + :'next_page_token' => :'next_page_token', + :'page_size' => :'page_size', + :'page_token' => :'page_token' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'filter' => :'String', + :'next_page_token' => :'String', + :'page_size' => :'Integer', + :'page_token' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::RecommendationsPageMetaPage` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'filter') + self.filter = attributes[:'filter'] + end + + if attributes.key?(:'next_page_token') + self.next_page_token = attributes[:'next_page_token'] + end + + if attributes.key?(:'page_size') + self.page_size = attributes[:'page_size'] + end + + if attributes.key?(:'page_token') + self.page_token = attributes[:'page_token'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if !@page_size.nil? && @page_size > 10000 + return false if !@page_size.nil? && @page_size < 1 + true + end + + # Custom attribute writer method with validation + # @param page_size [Object] Object to be assigned + # @!visibility private + def page_size=(page_size) + if !page_size.nil? && page_size > 10000 + fail ArgumentError, 'invalid value for "page_size", must be smaller than or equal to 10000.' + end + if !page_size.nil? && page_size < 1 + fail ArgumentError, 'invalid value for "page_size", must be greater than or equal to 1.' + end + @page_size = page_size + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + filter == o.filter && + next_page_token == o.next_page_token && + page_size == o.page_size && + page_token == o.page_token && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [filter, next_page_token, page_size, page_token, additional_properties].hash + end + end +end From 02fb3829e841e43ba10af7ad20996bd160fee0b1 Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Thu, 21 May 2026 18:18:58 +0000 Subject: [PATCH 3/4] Add TCP congestion signals to CNM aggregated connections spec (#3341) Co-authored-by: ci.datadog-api-spec --- .generator/schemas/v2/openapi.yaml | 30 +++++++++ ...ted_connection_response_data_attributes.rb | 62 ++++++++++++++++++- 2 files changed, 91 insertions(+), 1 deletion(-) diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 3ea21c2f0dce..c414ce184658 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -76566,10 +76566,16 @@ components: packets_sent_by_server: 20 rtt_micro_seconds: 800 tcp_closed_connections: 30 + tcp_delivered_ce: 12 tcp_established_connections: 40 + tcp_probe0_count: 2 + tcp_rcv_ooo_pack: 15 + tcp_recovery_count: 8 tcp_refusals: 7 + tcp_reord_seen: 4 tcp_resets: 5 tcp_retransmits: 30 + tcp_rto_count: 3 tcp_timeouts: 6 id: client_team:networks, server_service:hucklebuck type: aggregated_connection @@ -76627,14 +76633,34 @@ components: description: The number of TCP connections in a closed state. Measured in connections per second from the client. format: int64 type: integer + tcp_delivered_ce: + description: The number of TCP segments acknowledged with the ECN Congestion Experienced (CE) mark, indicating that an upstream router marked packets as experiencing congestion. + format: int64 + type: integer tcp_established_connections: description: The number of TCP connections in an established state. Measured in connections per second from the client. format: int64 type: integer + tcp_probe0_count: + description: The number of TCP zero-window probes sent. These probes are sent when the receiver advertises a zero receive window, indicating it cannot accept more data. + format: int64 + type: integer + tcp_rcv_ooo_pack: + description: The number of TCP packets received out of order. This indicates network-level packet reordering, which can degrade TCP performance by triggering spurious retransmissions and reducing throughput. + format: int64 + type: integer + tcp_recovery_count: + description: The number of TCP fast recovery events. Fast recovery retransmits lost segments detected through duplicate ACKs or selective acknowledgment (SACK) without waiting for a retransmission timeout. + format: int64 + type: integer tcp_refusals: description: The number of TCP connections that were refused by the server. Typically this indicates an attempt to connect to an IP/port that is not receiving connections, or a firewall/security misconfiguration. format: int64 type: integer + tcp_reord_seen: + description: The number of times reordering of sent packets was detected. Reordering detection adjusts the duplicate ACK threshold, preventing spurious retransmissions caused by out-of-order delivery. + format: int64 + type: integer tcp_resets: description: The number of TCP connections that were reset by the server. format: int64 @@ -76643,6 +76669,10 @@ components: description: TCP Retransmits represent detected failures that are retransmitted to ensure delivery. Measured in count of retransmits from the client. format: int64 type: integer + tcp_rto_count: + description: The number of TCP retransmission timeouts (RTOs). An RTO occurs when an ACK is not received within the estimated round-trip time, forcing the sender to retransmit and halve its congestion window. + format: int64 + type: integer tcp_timeouts: description: The number of TCP connections that timed out from the perspective of the operating system. This can indicate general connectivity and latency issues. format: int64 diff --git a/lib/datadog_api_client/v2/models/single_aggregated_connection_response_data_attributes.rb b/lib/datadog_api_client/v2/models/single_aggregated_connection_response_data_attributes.rb index 28bbcbb09add..0a62b4e7e598 100644 --- a/lib/datadog_api_client/v2/models/single_aggregated_connection_response_data_attributes.rb +++ b/lib/datadog_api_client/v2/models/single_aggregated_connection_response_data_attributes.rb @@ -42,18 +42,36 @@ class SingleAggregatedConnectionResponseDataAttributes # The number of TCP connections in a closed state. Measured in connections per second from the client. attr_accessor :tcp_closed_connections + # The number of TCP segments acknowledged with the ECN Congestion Experienced (CE) mark, indicating that an upstream router marked packets as experiencing congestion. + attr_accessor :tcp_delivered_ce + # The number of TCP connections in an established state. Measured in connections per second from the client. attr_accessor :tcp_established_connections + # The number of TCP zero-window probes sent. These probes are sent when the receiver advertises a zero receive window, indicating it cannot accept more data. + attr_accessor :tcp_probe0_count + + # The number of TCP packets received out of order. This indicates network-level packet reordering, which can degrade TCP performance by triggering spurious retransmissions and reducing throughput. + attr_accessor :tcp_rcv_ooo_pack + + # The number of TCP fast recovery events. Fast recovery retransmits lost segments detected through duplicate ACKs or selective acknowledgment (SACK) without waiting for a retransmission timeout. + attr_accessor :tcp_recovery_count + # The number of TCP connections that were refused by the server. Typically this indicates an attempt to connect to an IP/port that is not receiving connections, or a firewall/security misconfiguration. attr_accessor :tcp_refusals + # The number of times reordering of sent packets was detected. Reordering detection adjusts the duplicate ACK threshold, preventing spurious retransmissions caused by out-of-order delivery. + attr_accessor :tcp_reord_seen + # The number of TCP connections that were reset by the server. attr_accessor :tcp_resets # TCP Retransmits represent detected failures that are retransmitted to ensure delivery. Measured in count of retransmits from the client. attr_accessor :tcp_retransmits + # The number of TCP retransmission timeouts (RTOs). An RTO occurs when an ACK is not received within the estimated round-trip time, forcing the sender to retransmit and halve its congestion window. + attr_accessor :tcp_rto_count + # The number of TCP connections that timed out from the perspective of the operating system. This can indicate general connectivity and latency issues. attr_accessor :tcp_timeouts @@ -70,10 +88,16 @@ def self.attribute_map :'packets_sent_by_server' => :'packets_sent_by_server', :'rtt_micro_seconds' => :'rtt_micro_seconds', :'tcp_closed_connections' => :'tcp_closed_connections', + :'tcp_delivered_ce' => :'tcp_delivered_ce', :'tcp_established_connections' => :'tcp_established_connections', + :'tcp_probe0_count' => :'tcp_probe0_count', + :'tcp_rcv_ooo_pack' => :'tcp_rcv_ooo_pack', + :'tcp_recovery_count' => :'tcp_recovery_count', :'tcp_refusals' => :'tcp_refusals', + :'tcp_reord_seen' => :'tcp_reord_seen', :'tcp_resets' => :'tcp_resets', :'tcp_retransmits' => :'tcp_retransmits', + :'tcp_rto_count' => :'tcp_rto_count', :'tcp_timeouts' => :'tcp_timeouts' } end @@ -89,10 +113,16 @@ def self.openapi_types :'packets_sent_by_server' => :'Integer', :'rtt_micro_seconds' => :'Integer', :'tcp_closed_connections' => :'Integer', + :'tcp_delivered_ce' => :'Integer', :'tcp_established_connections' => :'Integer', + :'tcp_probe0_count' => :'Integer', + :'tcp_rcv_ooo_pack' => :'Integer', + :'tcp_recovery_count' => :'Integer', :'tcp_refusals' => :'Integer', + :'tcp_reord_seen' => :'Integer', :'tcp_resets' => :'Integer', :'tcp_retransmits' => :'Integer', + :'tcp_rto_count' => :'Integer', :'tcp_timeouts' => :'Integer' } end @@ -143,14 +173,34 @@ def initialize(attributes = {}) self.tcp_closed_connections = attributes[:'tcp_closed_connections'] end + if attributes.key?(:'tcp_delivered_ce') + self.tcp_delivered_ce = attributes[:'tcp_delivered_ce'] + end + if attributes.key?(:'tcp_established_connections') self.tcp_established_connections = attributes[:'tcp_established_connections'] end + if attributes.key?(:'tcp_probe0_count') + self.tcp_probe0_count = attributes[:'tcp_probe0_count'] + end + + if attributes.key?(:'tcp_rcv_ooo_pack') + self.tcp_rcv_ooo_pack = attributes[:'tcp_rcv_ooo_pack'] + end + + if attributes.key?(:'tcp_recovery_count') + self.tcp_recovery_count = attributes[:'tcp_recovery_count'] + end + if attributes.key?(:'tcp_refusals') self.tcp_refusals = attributes[:'tcp_refusals'] end + if attributes.key?(:'tcp_reord_seen') + self.tcp_reord_seen = attributes[:'tcp_reord_seen'] + end + if attributes.key?(:'tcp_resets') self.tcp_resets = attributes[:'tcp_resets'] end @@ -159,6 +209,10 @@ def initialize(attributes = {}) self.tcp_retransmits = attributes[:'tcp_retransmits'] end + if attributes.key?(:'tcp_rto_count') + self.tcp_rto_count = attributes[:'tcp_rto_count'] + end + if attributes.key?(:'tcp_timeouts') self.tcp_timeouts = attributes[:'tcp_timeouts'] end @@ -197,10 +251,16 @@ def ==(o) packets_sent_by_server == o.packets_sent_by_server && rtt_micro_seconds == o.rtt_micro_seconds && tcp_closed_connections == o.tcp_closed_connections && + tcp_delivered_ce == o.tcp_delivered_ce && tcp_established_connections == o.tcp_established_connections && + tcp_probe0_count == o.tcp_probe0_count && + tcp_rcv_ooo_pack == o.tcp_rcv_ooo_pack && + tcp_recovery_count == o.tcp_recovery_count && tcp_refusals == o.tcp_refusals && + tcp_reord_seen == o.tcp_reord_seen && tcp_resets == o.tcp_resets && tcp_retransmits == o.tcp_retransmits && + tcp_rto_count == o.tcp_rto_count && tcp_timeouts == o.tcp_timeouts && additional_properties == o.additional_properties end @@ -209,7 +269,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [bytes_sent_by_client, bytes_sent_by_server, group_bys, packets_sent_by_client, packets_sent_by_server, rtt_micro_seconds, tcp_closed_connections, tcp_established_connections, tcp_refusals, tcp_resets, tcp_retransmits, tcp_timeouts, additional_properties].hash + [bytes_sent_by_client, bytes_sent_by_server, group_bys, packets_sent_by_client, packets_sent_by_server, rtt_micro_seconds, tcp_closed_connections, tcp_delivered_ce, tcp_established_connections, tcp_probe0_count, tcp_rcv_ooo_pack, tcp_recovery_count, tcp_refusals, tcp_reord_seen, tcp_resets, tcp_retransmits, tcp_rto_count, tcp_timeouts, additional_properties].hash end end end From d38051e82223387dacdf19eaa75c45e314ec2f4b Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Thu, 21 May 2026 18:54:48 +0000 Subject: [PATCH 4/4] Add OpenAPI specs for app-builder blueprints, tags, and private query endpoints (#3370) Co-authored-by: ci.datadog-api-spec --- .generator/schemas/v2/openapi.yaml | 456 ++++++++++++++++++ ...lueprint-returns-Not-Found-response.frozen | 1 + ...t-Blueprint-returns-Not-Found-response.yml | 22 + ...-Integration-ID-returns-OK-response.frozen | 1 + ...-by-Integration-ID-returns-OK-response.yml | 20 + ...prints-by-Slugs-returns-OK-response.frozen | 1 + ...lueprints-by-Slugs-returns-OK-response.yml | 20 + ...List-Blueprints-returns-OK-response.frozen | 1 + .../List-Blueprints-returns-OK-response.yml | 330 +++++++++++++ .../List-Tags-returns-OK-response.frozen | 1 + .../List-Tags-returns-OK-response.yml | 20 + examples/v2/app-builder/GetBlueprint.rb | 5 + .../GetBlueprintsByIntegrationId.rb | 5 + .../v2/app-builder/GetBlueprintsBySlugs.rb | 5 + examples/v2/app-builder/ListBlueprints.rb | 5 + examples/v2/app-builder/ListTags.rb | 5 + features/scenarios_model_mapping.rb | 13 + features/v2/app_builder.feature | 42 +- features/v2/undo.json | 30 ++ lib/datadog_api_client/inflector.rb | 11 + .../v2/api/app_builder_api.rb | 319 ++++++++++++ .../models/app_builder_list_tags_response.rb | 107 ++++ .../v2/models/blueprint_attributes.rb | 312 ++++++++++++ .../v2/models/blueprint_data.rb | 165 +++++++ .../v2/models/blueprint_data_type.rb | 26 + .../models/blueprint_metadata_attributes.rb | 239 +++++++++ .../v2/models/blueprint_metadata_data.rb | 165 +++++++ .../v2/models/get_blueprint_response.rb | 105 ++++ .../v2/models/get_blueprints_response.rb | 107 ++++ .../v2/models/list_blueprints_response.rb | 107 ++++ lib/datadog_api_client/v2/models/tag_data.rb | 148 ++++++ .../v2/models/tag_data_type.rb | 26 + 32 files changed, 2819 insertions(+), 1 deletion(-) create mode 100644 cassettes/features/v2/app_builder/Get-Blueprint-returns-Not-Found-response.frozen create mode 100644 cassettes/features/v2/app_builder/Get-Blueprint-returns-Not-Found-response.yml create mode 100644 cassettes/features/v2/app_builder/Get-Blueprints-by-Integration-ID-returns-OK-response.frozen create mode 100644 cassettes/features/v2/app_builder/Get-Blueprints-by-Integration-ID-returns-OK-response.yml create mode 100644 cassettes/features/v2/app_builder/Get-Blueprints-by-Slugs-returns-OK-response.frozen create mode 100644 cassettes/features/v2/app_builder/Get-Blueprints-by-Slugs-returns-OK-response.yml create mode 100644 cassettes/features/v2/app_builder/List-Blueprints-returns-OK-response.frozen create mode 100644 cassettes/features/v2/app_builder/List-Blueprints-returns-OK-response.yml create mode 100644 cassettes/features/v2/app_builder/List-Tags-returns-OK-response.frozen create mode 100644 cassettes/features/v2/app_builder/List-Tags-returns-OK-response.yml create mode 100644 examples/v2/app-builder/GetBlueprint.rb create mode 100644 examples/v2/app-builder/GetBlueprintsByIntegrationId.rb create mode 100644 examples/v2/app-builder/GetBlueprintsBySlugs.rb create mode 100644 examples/v2/app-builder/ListBlueprints.rb create mode 100644 examples/v2/app-builder/ListTags.rb create mode 100644 lib/datadog_api_client/v2/models/app_builder_list_tags_response.rb create mode 100644 lib/datadog_api_client/v2/models/blueprint_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/blueprint_data.rb create mode 100644 lib/datadog_api_client/v2/models/blueprint_data_type.rb create mode 100644 lib/datadog_api_client/v2/models/blueprint_metadata_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/blueprint_metadata_data.rb create mode 100644 lib/datadog_api_client/v2/models/get_blueprint_response.rb create mode 100644 lib/datadog_api_client/v2/models/get_blueprints_response.rb create mode 100644 lib/datadog_api_client/v2/models/list_blueprints_response.rb create mode 100644 lib/datadog_api_client/v2/models/tag_data.rb create mode 100644 lib/datadog_api_client/v2/models/tag_data_type.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index c414ce184658..a5ff8270d1db 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -4731,6 +4731,15 @@ components: - OPENURL - DOWNLOADFILE - SETSTATEVARIABLEVALUE + AppBuilderListTagsResponse: + description: The response for listing tags associated with apps. + properties: + data: + description: An array of tags. + items: + $ref: "#/components/schemas/TagData" + type: array + type: object AppDefinitionType: default: appDefinitions description: The app definition type. @@ -9178,6 +9187,161 @@ components: data: $ref: "#/components/schemas/BillingDimensionsMappingBody" type: object + BlueprintAttributes: + description: The attributes of a blueprint resource. + properties: + created_at: + description: The timestamp when the blueprint was created. + example: "" + format: date-time + type: string + definition: + $ref: "#/components/schemas/AppDefinitionType" + description: + description: A description of what the blueprint does. + example: "" + type: string + embedded_datastore_blueprints: + additionalProperties: {} + description: Embedded datastore blueprints. + type: object + embedded_native_actions: + description: Embedded native actions. + items: + $ref: "#/components/schemas/BlueprintNativeAction" + type: array + embedded_workflow_blueprints: + additionalProperties: {} + description: Embedded workflow blueprints. + type: object + integration_id: + description: The integration ID associated with the blueprint. + type: string + mocked_outputs: + additionalProperties: {} + description: Mocked outputs for testing the blueprint. + type: object + name: + description: The human-readable name of the blueprint. + example: AWS Service Manager + type: string + slug: + description: The unique slug identifier of the blueprint. + example: aws-service-manager + type: string + tags: + description: Tags associated with the blueprint. + items: + type: string + type: array + tile_background: + description: The background style of the blueprint tile. + type: string + tile_icon_action_fqn: + description: The fully qualified name of the action used as the tile icon. + type: string + updated_at: + description: The timestamp when the blueprint was last updated. + example: "" + format: date-time + type: string + required: + - slug + - name + - description + - definition + - created_at + - updated_at + type: object + BlueprintData: + description: A blueprint resource. + properties: + attributes: + $ref: "#/components/schemas/BlueprintAttributes" + id: + description: The ID of the blueprint. + example: 65bb1f25-52e1-4510-9f8d-22d1516ed693 + format: uuid + type: string + type: + $ref: "#/components/schemas/BlueprintDataType" + required: + - id + - type + - attributes + type: object + BlueprintDataType: + description: The resource type for a blueprint. + enum: + - blueprint + example: blueprint + type: string + x-enum-varnames: + - BLUEPRINT + BlueprintMetadataAttributes: + description: The attributes of a blueprint metadata resource. + properties: + created_at: + description: The timestamp when the blueprint was created. + example: "" + format: date-time + type: string + description: + description: A description of what the blueprint does. + example: "" + type: string + name: + description: The human-readable name of the blueprint. + example: AWS Service Manager + type: string + slug: + description: The unique slug identifier of the blueprint. + example: aws-service-manager + type: string + tags: + description: Tags associated with the blueprint. + items: + type: string + type: array + tile_background: + description: The background style of the blueprint tile. + type: string + tile_icon_action_fqn: + description: The fully qualified name of the action used as the tile icon. + type: string + updated_at: + description: The timestamp when the blueprint was last updated. + example: "" + format: date-time + type: string + required: + - slug + - name + - description + - created_at + - updated_at + type: object + BlueprintMetadataData: + description: A blueprint metadata resource. + properties: + attributes: + $ref: "#/components/schemas/BlueprintMetadataAttributes" + id: + description: The ID of the blueprint. + example: 65bb1f25-52e1-4510-9f8d-22d1516ed693 + format: uuid + type: string + type: + $ref: "#/components/schemas/BlueprintDataType" + required: + - id + - type + - attributes + type: object + BlueprintNativeAction: + additionalProperties: {} + description: An embedded native action in a blueprint. + type: object BranchCoverageSummaryRequest: description: Request object for getting code coverage summary for a branch. properties: @@ -33834,6 +33998,21 @@ components: type: string type: array type: object + GetBlueprintResponse: + description: The response for retrieving a single blueprint. + properties: + data: + $ref: "#/components/schemas/BlueprintData" + type: object + GetBlueprintsResponse: + description: The response for retrieving multiple blueprints. + properties: + data: + description: An array of blueprints. + items: + $ref: "#/components/schemas/BlueprintData" + type: array + type: object GetCustomFrameworkResponse: description: Response object to get a custom framework. properties: @@ -46102,6 +46281,15 @@ components: required: - data type: object + ListBlueprintsResponse: + description: The response for listing available blueprints. + properties: + data: + description: An array of blueprint metadata. + items: + $ref: "#/components/schemas/BlueprintMetadataData" + type: array + type: object ListCampaignsResponse: description: Response containing a list of campaigns. properties: @@ -83546,6 +83734,28 @@ components: - type - id type: object + TagData: + description: A tag resource associated with an app. + properties: + id: + description: The name of the tag. + example: production + type: string + type: + $ref: "#/components/schemas/TagDataType" + required: + - id + - type + type: object + TagDataType: + description: The resource type for a tag. + enum: + - tag + example: tag + minLength: 3 + type: string + x-enum-varnames: + - TAG TagsEventAttribute: description: Array of tags associated with your event. example: ["team:A"] @@ -96707,6 +96917,252 @@ paths: permissions: - apps_run - connections_read + "/api/v2/app-builder/blueprint/{blueprint_id}": + get: + description: Retrieve an app blueprint by its ID. + operationId: GetBlueprint + parameters: + - description: The ID of the blueprint to retrieve. + example: 65bb1f25-52e1-4510-9f8d-22d1516ed693 + in: path + name: blueprint_id + required: true + schema: + format: uuid + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + created_at: "2024-01-01T00:00:00Z" + definition: {} + description: Manage your AWS services from Datadog. + name: AWS Service Manager + slug: aws-service-manager + updated_at: "2024-01-01T00:00:00Z" + id: 65bb1f25-52e1-4510-9f8d-22d1516ed693 + type: blueprint + schema: + $ref: "#/components/schemas/GetBlueprintResponse" + description: OK + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Get Blueprint + tags: + - App Builder + "x-permission": + operator: OR + permissions: + - apps_run + - apps_write + - connections_read + - connections_write + /api/v2/app-builder/blueprints: + get: + description: List available app blueprints. + operationId: ListBlueprints + parameters: + - description: The number of blueprints to return per page. Defaults to 10. Maximum is 100. + in: query + name: limit + required: false + schema: + format: int64 + type: integer + - description: The page of results to return. Starts at 0. + in: query + name: page + required: false + schema: + format: int64 + type: integer + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + created_at: "2024-01-01T00:00:00Z" + description: Manage your AWS services from Datadog. + name: AWS Service Manager + slug: aws-service-manager + updated_at: "2024-01-01T00:00:00Z" + id: 65bb1f25-52e1-4510-9f8d-22d1516ed693 + type: blueprint + schema: + $ref: "#/components/schemas/ListBlueprintsResponse" + description: OK + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: List Blueprints + tags: + - App Builder + "x-permission": + operator: OR + permissions: + - apps_run + - apps_write + - connections_read + - connections_write + "/api/v2/app-builder/blueprints/integration-id/{integration_id}": + get: + description: List app blueprints associated with a specific integration ID. + operationId: GetBlueprintsByIntegrationId + parameters: + - description: The integration ID to filter blueprints by. + example: aws + in: path + name: integration_id + required: true + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + created_at: "2024-01-01T00:00:00Z" + definition: {} + description: Manage your AWS services from Datadog. + integration_id: aws + name: AWS Service Manager + slug: aws-service-manager + updated_at: "2024-01-01T00:00:00Z" + id: 65bb1f25-52e1-4510-9f8d-22d1516ed693 + type: blueprint + schema: + $ref: "#/components/schemas/GetBlueprintsResponse" + description: OK + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Get Blueprints by Integration ID + tags: + - App Builder + "x-permission": + operator: OR + permissions: + - apps_run + - apps_write + - connections_read + - connections_write + "/api/v2/app-builder/blueprints/slugs/{slugs}": + get: + description: Retrieve app blueprints by their slugs. + operationId: GetBlueprintsBySlugs + parameters: + - description: A comma-separated list of blueprint slugs. + example: aws-service-manager + in: path + name: slugs + required: true + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + created_at: "2024-01-01T00:00:00Z" + definition: {} + description: Manage your AWS services from Datadog. + name: AWS Service Manager + slug: aws-service-manager + updated_at: "2024-01-01T00:00:00Z" + id: 65bb1f25-52e1-4510-9f8d-22d1516ed693 + type: blueprint + schema: + $ref: "#/components/schemas/GetBlueprintsResponse" + description: OK + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Get Blueprints by Slugs + tags: + - App Builder + "x-permission": + operator: OR + permissions: + - apps_run + - apps_write + - connections_read + - connections_write + /api/v2/app-builder/tags: + get: + description: List all tags associated with the authenticated user's apps. + operationId: ListTags + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - id: production + type: tag + schema: + $ref: "#/components/schemas/AppBuilderListTagsResponse" + description: OK + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: List Tags + tags: + - App Builder + "x-permission": + operator: OR + permissions: + - apps_run /api/v2/application_keys: get: description: List all application keys available for your org diff --git a/cassettes/features/v2/app_builder/Get-Blueprint-returns-Not-Found-response.frozen b/cassettes/features/v2/app_builder/Get-Blueprint-returns-Not-Found-response.frozen new file mode 100644 index 000000000000..d0257e0632b5 --- /dev/null +++ b/cassettes/features/v2/app_builder/Get-Blueprint-returns-Not-Found-response.frozen @@ -0,0 +1 @@ +2026-05-18T17:39:16.852Z \ No newline at end of file diff --git a/cassettes/features/v2/app_builder/Get-Blueprint-returns-Not-Found-response.yml b/cassettes/features/v2/app_builder/Get-Blueprint-returns-Not-Found-response.yml new file mode 100644 index 000000000000..9fc5e096b153 --- /dev/null +++ b/cassettes/features/v2/app_builder/Get-Blueprint-returns-Not-Found-response.yml @@ -0,0 +1,22 @@ +http_interactions: +- recorded_at: Mon, 18 May 2026 17:39:16 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/app-builder/blueprint/00000000-0000-0000-0000-000000000001 + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"404","id":"75010b80-a44e-47bd-b903-e38f79efce20","title":"blueprint + not found","detail":"blueprint with id 00000000-0000-0000-0000-000000000001 + not found"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/app_builder/Get-Blueprints-by-Integration-ID-returns-OK-response.frozen b/cassettes/features/v2/app_builder/Get-Blueprints-by-Integration-ID-returns-OK-response.frozen new file mode 100644 index 000000000000..0f3a3af5e16e --- /dev/null +++ b/cassettes/features/v2/app_builder/Get-Blueprints-by-Integration-ID-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-05-18T17:39:17.553Z \ No newline at end of file diff --git a/cassettes/features/v2/app_builder/Get-Blueprints-by-Integration-ID-returns-OK-response.yml b/cassettes/features/v2/app_builder/Get-Blueprints-by-Integration-ID-returns-OK-response.yml new file mode 100644 index 000000000000..afafa8dc0883 --- /dev/null +++ b/cassettes/features/v2/app_builder/Get-Blueprints-by-Integration-ID-returns-OK-response.yml @@ -0,0 +1,20 @@ +http_interactions: +- recorded_at: Mon, 18 May 2026 17:39:17 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/app-builder/blueprints/integration-id/aws + response: + body: + encoding: UTF-8 + string: '{"data":[]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/app_builder/Get-Blueprints-by-Slugs-returns-OK-response.frozen b/cassettes/features/v2/app_builder/Get-Blueprints-by-Slugs-returns-OK-response.frozen new file mode 100644 index 000000000000..4d6bba7034fb --- /dev/null +++ b/cassettes/features/v2/app_builder/Get-Blueprints-by-Slugs-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-05-18T17:39:18.076Z \ No newline at end of file diff --git a/cassettes/features/v2/app_builder/Get-Blueprints-by-Slugs-returns-OK-response.yml b/cassettes/features/v2/app_builder/Get-Blueprints-by-Slugs-returns-OK-response.yml new file mode 100644 index 000000000000..4311fb0d6544 --- /dev/null +++ b/cassettes/features/v2/app_builder/Get-Blueprints-by-Slugs-returns-OK-response.yml @@ -0,0 +1,20 @@ +http_interactions: +- recorded_at: Mon, 18 May 2026 17:39:18 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/app-builder/blueprints/slugs/aws-service-manager + response: + body: + encoding: UTF-8 + string: '{"data":[]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/app_builder/List-Blueprints-returns-OK-response.frozen b/cassettes/features/v2/app_builder/List-Blueprints-returns-OK-response.frozen new file mode 100644 index 000000000000..bf22ce4bbc0b --- /dev/null +++ b/cassettes/features/v2/app_builder/List-Blueprints-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-05-18T17:39:19.135Z \ No newline at end of file diff --git a/cassettes/features/v2/app_builder/List-Blueprints-returns-OK-response.yml b/cassettes/features/v2/app_builder/List-Blueprints-returns-OK-response.yml new file mode 100644 index 000000000000..2bf87696c540 --- /dev/null +++ b/cassettes/features/v2/app_builder/List-Blueprints-returns-OK-response.yml @@ -0,0 +1,330 @@ +http_interactions: +- recorded_at: Mon, 18 May 2026 17:39:19 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/app-builder/blueprints + response: + body: + encoding: UTF-8 + string: "{\"data\":[{\"id\":\"faeef8bc-d9eb-43a1-b829-71782380279d\",\"type\"\ + :\"blueprint\",\"attributes\":{\"created_at\":\"2025-08-18T16:20:42.182618Z\"\ + ,\"description\":\"Manage AWS Services from a single unified interface.\"\ + ,\"name\":\"AWS Service Management Console\",\"slug\":\"aws_service_management_console\"\ + ,\"tags\":[\"aws\"],\"tile_background\":\"one-callout-table\",\"tile_icon_action_fqn\"\ + :\"com.datadoghq.aws.organizations.listAccounts\",\"updated_at\":\"2026-05-18T17:02:03.016145Z\"\ + }},{\"id\":\"b2ba39de-d111-4940-b600-df6bb52661dc\",\"type\":\"blueprint\"\ + ,\"attributes\":{\"created_at\":\"2025-08-15T00:00:19.017104Z\",\"description\"\ + :\"Manage projects, merge requests, commits, pipelines, jobs, branches, and\ + \ deployments all from a unified interface within Datadog.\",\"name\":\"GitLab\ + \ Manager\",\"slug\":\"gitlab_manager\",\"tags\":[\"software_delivery\"],\"\ + tile_background\":\"search-callout-table\",\"tile_icon_action_fqn\":\"com.datadoghq.gitlab.projects.listProjects\"\ + ,\"updated_at\":\"2026-05-18T17:01:20.81581Z\"}},{\"id\":\"398529ec-6c34-4e6d-bccf-5a34be7e6e1c\"\ + ,\"type\":\"blueprint\",\"attributes\":{\"created_at\":\"2025-10-15T19:11:36.098607Z\"\ + ,\"description\":\"Unifying Jira, Confluence, GitHub, and Datadog Incidents\ + \ to highlight team and developer contribution with AI summaries.\",\"name\"\ + :\"Development Insights\",\"slug\":\"development-insights\",\"tags\":[\"datadog\"\ + ,\"uses_ai\"],\"tile_background\":\"search-callout-table\",\"tile_icon_action_fqn\"\ + :\"com.datadoghq.dd.apps_datastore.getDatastoreItem\",\"updated_at\":\"2026-05-18T17:02:03.557012Z\"\ + }},{\"id\":\"1a9239ca-1d11-48c0-ad23-0f8ca00cd321\",\"type\":\"blueprint\"\ + ,\"attributes\":{\"created_at\":\"2025-10-08T17:07:54.77105Z\",\"description\"\ + :\"Unified device visibility. Smarter investigations\",\"name\":\"Asset Investigation\ + \ App\",\"slug\":\"asset-intel-app\",\"tags\":[\"datadog\",\"uses_ai\"],\"\ + tile_background\":\"one-callout-table\",\"tile_icon_action_fqn\":\"com.datadoghq.dd.apps_datastore.listDatastoreItems\"\ + ,\"updated_at\":\"2026-05-18T17:02:03.371529Z\"}},{\"id\":\"d190e5cd-412c-4857-9993-6e98a478a64e\"\ + ,\"type\":\"blueprint\",\"attributes\":{\"created_at\":\"2025-06-30T18:02:02.519433Z\"\ + ,\"description\":\"Manage Okta users, groups, and roles directly from Datadog\ + \ in a secure, unified interface.\",\"name\":\"Manage Okta Users, Groups,\ + \ and Roles\",\"slug\":\"manage-okta-user-groups-roles\",\"tags\":[\"security\"\ + ],\"tile_background\":\"one-callout-table\",\"tile_icon_action_fqn\":\"com.datadoghq.okta.add_user_to_group\"\ + ,\"updated_at\":\"2026-05-18T17:02:15.156458Z\"}},{\"id\":\"11feb11b-85d9-4e89-9f5c-0c96c04da5bc\"\ + ,\"type\":\"blueprint\",\"attributes\":{\"created_at\":\"2025-06-30T18:02:02.176559Z\"\ + ,\"description\":\"Scaffolder app can be used for creating new software components\ + \ from template repositories. It takes inputs from developers and generates\ + \ a new repository or a PR based on the provided data and the template.\"\ + ,\"name\":\"Scaffold New Project in GitHub\",\"slug\":\"scaffold-new-project-in-github\"\ + ,\"tags\":[\"software_delivery\"],\"tile_background\":\"table-with-modal\"\ + ,\"tile_icon_action_fqn\":\"com.datadoghq.github.searchRepositories\",\"updated_at\"\ + :\"2026-05-18T17:02:09.340524Z\"}},{\"id\":\"6c5b24ef-c303-42ec-a305-351f5a1026cf\"\ + ,\"type\":\"blueprint\",\"attributes\":{\"created_at\":\"2025-05-02T20:27:43.381741Z\"\ + ,\"description\":\"Monitor Kubernetes resources, restart deployments, delete\ + \ pods, and create tickets or incidents\",\"name\":\"Manage Kubernetes Deployments\"\ + ,\"slug\":\"manage-kubernetes-deployments\",\"tags\":[\"kubernetes\",\"private_action\"\ + ],\"tile_background\":\"table\",\"tile_icon_action_fqn\":\"com.datadoghq.kubernetes.apps.listDeployment\"\ + ,\"updated_at\":\"2026-05-18T17:01:26.003985Z\"}},{\"id\":\"dd0adb73-dd5f-4cb5-a22d-41946755958e\"\ + ,\"type\":\"blueprint\",\"attributes\":{\"created_at\":\"2025-04-29T18:37:39.261927Z\"\ + ,\"description\":\"Stop RDS clusters \\u0026 instances and reduce your cost\"\ + ,\"name\":\"Manage RDS Clusters \\u0026 Instances\",\"slug\":\"rds_console\"\ + ,\"tags\":[\"aws\"],\"tile_background\":\"table\",\"tile_icon_action_fqn\"\ + :\"com.datadoghq.aws.rds.list_db_instances\",\"updated_at\":\"2026-05-18T17:02:04.353815Z\"\ + }},{\"id\":\"8750a7cb-f076-474f-9f66-8d3f7c02ad3f\",\"type\":\"blueprint\"\ + ,\"attributes\":{\"created_at\":\"2025-04-08T15:16:02.674864Z\",\"description\"\ + :\"Analyze your metrics in Datadog and create threshold alert monitors\",\"\ + name\":\"Explore Metrics \\u0026 Create Monitors\",\"slug\":\"datadog_metrics_and_monitors\"\ + ,\"tags\":[\"datadog\"],\"tile_background\":\"bento-box-table\",\"tile_icon_action_fqn\"\ + :\"com.datadoghq.dd.metrics.listMetrics\",\"updated_at\":\"2026-05-18T17:02:03.452603Z\"\ + }},{\"id\":\"17127e2b-ea85-4c3a-ba3e-0f1dfa0c941a\",\"type\":\"blueprint\"\ + ,\"attributes\":{\"created_at\":\"2025-04-30T21:11:28.731422Z\",\"description\"\ + :\"Fill out the form to generate the terraform for a new S3 bucket in Github\"\ + ,\"name\":\"Create S3 Bucket with a Terraform PR\",\"slug\":\"create-new-s3-bucket-terraform-pr\"\ + ,\"tags\":[\"software_delivery\"],\"tile_background\":\"table-with-modal\"\ + ,\"tile_icon_action_fqn\":\"com.datadoghq.github.searchRepositories\",\"updated_at\"\ + :\"2026-05-18T17:02:09.266218Z\"}},{\"id\":\"dc4075af-5e50-402f-abb2-6041db59d378\"\ + ,\"type\":\"blueprint\",\"attributes\":{\"created_at\":\"2025-04-30T21:11:28.759103Z\"\ + ,\"description\":\"View open pull requests from your team in a table with\ + \ an AI-generated summary of the progress.\",\"name\":\"GitHub PR Summarizer\"\ + ,\"slug\":\"github-pr-summarizer\",\"tags\":[\"uses_ai\"],\"tile_background\"\ + :\"table\",\"tile_icon_action_fqn\":\"com.datadoghq.github.searchRepositories\"\ + ,\"updated_at\":\"2026-05-18T17:02:09.306954Z\"}},{\"id\":\"dc1bcad2-1eb7-456f-a32b-60e8ad7adf71\"\ + ,\"type\":\"blueprint\",\"attributes\":{\"created_at\":\"2025-04-28T21:17:42.010916Z\"\ + ,\"description\":\"Start, stop or reboot your AWS EC2 instances\",\"name\"\ + :\"Manage EC2 Instances\",\"slug\":\"ec2_instance_manager\",\"tags\":[\"aws\"\ + ],\"tile_background\":\"one-callout-table\",\"tile_icon_action_fqn\":\"com.datadoghq.aws.ec2.describe_ec2_instances\"\ + ,\"updated_at\":\"2026-05-18T17:02:03.602628Z\"}},{\"id\":\"8d6b6284-10ba-42d0-829c-800e7c396a3b\"\ + ,\"type\":\"blueprint\",\"attributes\":{\"created_at\":\"2025-04-30T08:38:29.623958Z\"\ + ,\"description\":\"Peek, purge or redrive SQS queues\",\"name\":\"Manage SQS\ + \ Queues\",\"slug\":\"sqs-queue-manager\",\"tags\":[\"aws\"],\"tile_background\"\ + :\"bento-box-table\",\"tile_icon_action_fqn\":\"com.datadoghq.aws.sqs.list_queues_with_attributes\"\ + ,\"updated_at\":\"2026-05-18T17:02:02.47498Z\"}},{\"id\":\"be6d5e27-a5a8-406a-9b0c-b779f6a94728\"\ + ,\"type\":\"blueprint\",\"attributes\":{\"created_at\":\"2025-05-02T20:27:46.237126Z\"\ + ,\"description\":\"Create, view, or toggle on or off LaunchDarkly feature\ + \ flags\",\"name\":\"LaunchDarkly Feature Flag Manager\",\"slug\":\"launchdarkly_feature_flag_manager\"\ + ,\"tags\":[\"software_delivery\"],\"tile_background\":\"bento-box-table\"\ + ,\"tile_icon_action_fqn\":\"com.datadoghq.launchdarkly.listProjects\",\"updated_at\"\ + :\"2026-05-18T17:01:49.464175Z\"}},{\"id\":\"7566d028-b111-47a8-8ee2-b42efbd95edb\"\ + ,\"type\":\"blueprint\",\"attributes\":{\"created_at\":\"2025-05-02T20:27:43.058949Z\"\ + ,\"description\":\"View, retry, or cancel deployments in Gitlab\",\"name\"\ + :\"Manage Gitlab Deployments\",\"slug\":\"gitlab-deployment-manager\",\"tags\"\ + :[\"software_delivery\"],\"tile_background\":\"table\",\"tile_icon_action_fqn\"\ + :\"com.datadoghq.gitlab.getProjectDeployments\",\"updated_at\":\"2026-05-18T17:01:20.761242Z\"\ + }},{\"id\":\"dddf3b1a-47a4-400a-8485-321ad58f2779\",\"type\":\"blueprint\"\ + ,\"attributes\":{\"created_at\":\"2025-04-30T08:38:30.229357Z\",\"description\"\ + :\"Create, view, and manage incidents in ServiceNow\",\"name\":\"Manage ServiceNow\ + \ Incidents\",\"slug\":\"servicenow_incident_manager\",\"tags\":[\"paging\"\ + ],\"tile_background\":\"table\",\"tile_icon_action_fqn\":\"com.datadoghq.servicenow.listIncidents\"\ + ,\"updated_at\":\"2026-05-18T17:02:17.797196Z\"}},{\"id\":\"df97f5ff-0ce8-4def-b1fb-151b427fc82d\"\ + ,\"type\":\"blueprint\",\"attributes\":{\"created_at\":\"2025-04-09T16:50:07.302357Z\"\ + ,\"description\":\"Personalized developer homepage to prioritize tasks across\ + \ tools\",\"name\":\"Developer Homepage\",\"slug\":\"developer-homepage\"\ + ,\"tags\":[\"datadog\",\"uses_ai\"],\"tile_background\":\"one-callout-table\"\ + ,\"tile_icon_action_fqn\":\"com.datadoghq.dd.service_catalog.getServicePagerdutyOncall\"\ + ,\"updated_at\":\"2026-05-18T17:02:03.484343Z\"}},{\"id\":\"f290ac0f-ded8-4143-bb94-3dbe20f883d5\"\ + ,\"type\":\"blueprint\",\"attributes\":{\"created_at\":\"2025-05-05T19:50:19.410003Z\"\ + ,\"description\":\"Explore mobile user sessions, using Luciq's observability\ + \ tools\",\"name\":\"Explore Luciq Sessions\",\"slug\":\"instabug-sessions-explorer\"\ + ,\"tags\":[\"observability\"],\"tile_background\":\"table\",\"tile_icon_action_fqn\"\ + :\"com.datadoghq.http.request\",\"updated_at\":\"2026-05-18T17:01:48.606352Z\"\ + }},{\"id\":\"a7041749-fb41-451b-880f-10eddcdbbe1c\",\"type\":\"blueprint\"\ + ,\"attributes\":{\"created_at\":\"2025-05-02T20:27:48.306432Z\",\"description\"\ + :\"View incidents across pages, update them, follow past updates, and create\ + \ new incidents on Statuspage \u2014 all directly from Datadog.\",\"name\"\ + :\"Manage Statuspage Incidents\",\"slug\":\"manage-statuspage-incidents\"\ + ,\"tags\":[\"software_delivery\"],\"tile_background\":\"search-callout-table\"\ + ,\"tile_icon_action_fqn\":\"com.datadoghq.statuspage.updateComponentStatus\"\ + ,\"updated_at\":\"2026-05-18T17:02:18.402711Z\"}},{\"id\":\"8839570e-1711-43e8-86f2-679f5ae0f8f9\"\ + ,\"type\":\"blueprint\",\"attributes\":{\"created_at\":\"2025-04-30T21:11:28.769943Z\"\ + ,\"description\":\"Complete the form to provision a new EKS Cluster using\ + \ Terraform\",\"name\":\"Provision EKS Cluster\",\"slug\":\"provision-eks-cluster\"\ + ,\"tags\":[\"software_delivery\"],\"tile_background\":\"table-with-modal\"\ + ,\"tile_icon_action_fqn\":\"com.datadoghq.github.createOrUpdateFile\",\"updated_at\"\ + :\"2026-05-18T17:02:09.329157Z\"}},{\"id\":\"7f3fb131-0ff5-48d9-a997-87f99ef8b364\"\ + ,\"type\":\"blueprint\",\"attributes\":{\"created_at\":\"2025-04-30T21:11:28.764126Z\"\ + ,\"description\":\"Select a service and trigger a restart in Github Workflows\"\ + ,\"name\":\"Restart Service With Github Actions\",\"slug\":\"github_actions_restart_service\"\ + ,\"tags\":[\"software_delivery\"],\"tile_background\":\"table\",\"tile_icon_action_fqn\"\ + :\"com.datadoghq.github.actions.triggerWorkflowRun\",\"updated_at\":\"2026-05-18T17:02:09.318622Z\"\ + }},{\"id\":\"39ff9db2-aeed-4552-8080-d6a13fbfad74\",\"type\":\"blueprint\"\ + ,\"attributes\":{\"created_at\":\"2025-04-29T18:37:39.278756Z\",\"description\"\ + :\"Create a new RDS DB instance from a form\",\"name\":\"Provision RDS Instance\"\ + ,\"slug\":\"rds_provision_instance\",\"tags\":[\"aws\"],\"tile_background\"\ + :\"table\",\"tile_icon_action_fqn\":\"com.datadoghq.aws.rds.createRdsDbInstance\"\ + ,\"updated_at\":\"2026-05-18T17:02:04.37742Z\"}},{\"id\":\"0b110831-0834-4898-84dc-292153807df1\"\ + ,\"type\":\"blueprint\",\"attributes\":{\"created_at\":\"2025-04-29T18:37:39.21136Z\"\ + ,\"description\":\"View and manage Jira tickets by board, status, or sprint\"\ + ,\"name\":\"Manage Jira Tickets\",\"slug\":\"jira-ticket-manager\",\"tags\"\ + :[\"software_delivery\"],\"tile_background\":\"table\",\"tile_icon_action_fqn\"\ + :\"com.datadoghq.jira.create_issue\",\"updated_at\":\"2026-05-18T17:02:04.247226Z\"\ + }},{\"id\":\"111cc4d5-1fdf-47aa-8bb1-25cc8ac7dff2\",\"type\":\"blueprint\"\ + ,\"attributes\":{\"created_at\":\"2025-04-29T18:37:39.286928Z\",\"description\"\ + :\"Explore S3 files and view their content\",\"name\":\"Explore S3 Files\"\ + ,\"slug\":\"s3_file_explorer\",\"tags\":[\"aws\"],\"tile_background\":\"bento-box-table\"\ + ,\"tile_icon_action_fqn\":\"com.datadoghq.aws.s3.list_s3_buckets\",\"updated_at\"\ + :\"2026-05-18T17:02:02.170177Z\"}},{\"id\":\"773fce74-eec7-4170-a222-53e24261f812\"\ + ,\"type\":\"blueprint\",\"attributes\":{\"created_at\":\"2025-04-29T18:37:39.307523Z\"\ + ,\"description\":\"Fill out the form to generate the terraform for new monitors\ + \ for a service.\",\"name\":\"Create Monitors for New Service\",\"slug\":\"\ + service-monitor-creation\",\"tags\":[\"datadog\"],\"tile_background\":\"table-with-modal\"\ + ,\"tile_icon_action_fqn\":\"com.datadoghq.dd.service_catalog.listServiceDefinitions\"\ + ,\"updated_at\":\"2026-05-18T17:02:04.388154Z\"}},{\"id\":\"b899cebf-0b56-4e6e-89c8-01afdb19e781\"\ + ,\"type\":\"blueprint\",\"attributes\":{\"created_at\":\"2025-04-30T21:11:28.742329Z\"\ + ,\"description\":\"View opened, closed, and assigned pull requests to a specific\ + \ user\",\"name\":\"Github PR Pipeline\",\"slug\":\"github-pr-dashboard\"\ + ,\"tags\":[\"software_delivery\"],\"tile_background\":\"two-input-table\"\ + ,\"tile_icon_action_fqn\":\"com.datadoghq.github.searchRepositories\",\"updated_at\"\ + :\"2026-05-18T17:02:09.287376Z\"}},{\"id\":\"635fc8c5-0330-40e6-a859-b8fc3d76e331\"\ + ,\"type\":\"blueprint\",\"attributes\":{\"created_at\":\"2025-05-02T20:27:46.466284Z\"\ + ,\"description\":\"Monitor the status of PagerDuty services and trigger incidents\ + \ when needed\",\"name\":\"Manage PagerDuty Services\",\"slug\":\"pagerduty_service_manager\"\ + ,\"tags\":[\"paging\"],\"tile_background\":\"table\",\"tile_icon_action_fqn\"\ + :\"com.datadoghq.pagerduty.listServices\",\"updated_at\":\"2026-05-18T17:02:15.911013Z\"\ + }},{\"id\":\"8ada5164-b533-462e-80db-47e7d0fbed0d\",\"type\":\"blueprint\"\ + ,\"attributes\":{\"created_at\":\"2025-04-28T21:17:42.02843Z\",\"description\"\ + :\"Select from your clusters and services, and easily scale tasks up or down\"\ + ,\"name\":\"Manage ECS Tasks\",\"slug\":\"ecs_task_manager\",\"tags\":[\"\ + aws\"],\"tile_background\":\"three-callout-prompt\",\"tile_icon_action_fqn\"\ + :\"com.datadoghq.aws.ecs.listEcsClusters\",\"updated_at\":\"2026-05-18T17:02:00.300159Z\"\ + }},{\"id\":\"e2f2ff93-709c-4eae-95ab-cbc0f2bc87f0\",\"type\":\"blueprint\"\ + ,\"attributes\":{\"created_at\":\"2025-06-23T19:08:48.624684Z\",\"description\"\ + :\"List, explore details and re-run lambda functions\",\"name\":\"Manage Lambda\ + \ Functions\",\"slug\":\"lambda-function-manager\",\"tags\":[\"aws\"],\"tile_background\"\ + :\"table-with-modal\",\"tile_icon_action_fqn\":\"com.datadoghq.aws.lambda.listAWSLambdaFunction\"\ + ,\"updated_at\":\"2026-05-18T17:02:01.047167Z\"}},{\"id\":\"07f8536d-6342-4f30-8254-0c7b019707f0\"\ + ,\"type\":\"blueprint\",\"attributes\":{\"created_at\":\"2025-04-30T08:38:30.332498Z\"\ + ,\"description\":\"Manage and update Statuspage components across pages.\"\ + ,\"name\":\"Manage Statuspage Components\",\"slug\":\"statuspage-component-manager\"\ + ,\"tags\":[\"software_delivery\"],\"tile_background\":\"one-callout-table\"\ + ,\"tile_icon_action_fqn\":\"com.datadoghq.statuspage.listIncidents\",\"updated_at\"\ + :\"2026-05-18T17:02:18.425899Z\"}},{\"id\":\"53d32e20-034c-4d46-ad54-f71f83ae7850\"\ + ,\"type\":\"blueprint\",\"attributes\":{\"created_at\":\"2025-05-02T20:27:47.563531Z\"\ + ,\"description\":\"Manage, update or delete your AWS EKS clusters\",\"name\"\ + :\"Manage AWS EKS\",\"slug\":\"manage-aws-eks\",\"tags\":[\"aws\"],\"tile_background\"\ + :\"one-callout-table\",\"tile_icon_action_fqn\":\"com.datadoghq.aws.eks.updateClusterConfig\"\ + ,\"updated_at\":\"2026-05-18T17:02:04.264646Z\"}},{\"id\":\"8b8aa818-4ed3-40f5-b6ca-dd891c75f317\"\ + ,\"type\":\"blueprint\",\"attributes\":{\"created_at\":\"2025-05-02T20:27:46.449263Z\"\ + ,\"description\":\"Trigger, acknowledge and resolve incidents from PagerDuty.\"\ + ,\"name\":\"Manage PagerDuty Incidents\",\"slug\":\"pagerduty_incident_manager\"\ + ,\"tags\":[\"paging\"],\"tile_background\":\"one-callout-table\",\"tile_icon_action_fqn\"\ + :\"com.datadoghq.pagerduty.resolve_incident\",\"updated_at\":\"2026-05-18T17:02:15.703635Z\"\ + }},{\"id\":\"d4eac482-3518-412b-8424-31935f6fc1b6\",\"type\":\"blueprint\"\ + ,\"attributes\":{\"created_at\":\"2025-04-29T18:37:39.247502Z\",\"description\"\ + :\"Enter a prompt to find the most likely causes of your regression\",\"name\"\ + :\"Find PR Regressions\",\"slug\":\"pr_regression_finder\",\"tags\":[\"uses_ai\"\ + ],\"tile_background\":\"search-callout-table\",\"tile_icon_action_fqn\":\"\ + com.datadoghq.openai.generateText\",\"updated_at\":\"2026-05-18T17:02:04.329232Z\"\ + }},{\"id\":\"5a617cdf-6d0c-4fc5-a26f-e123e37e1438\",\"type\":\"blueprint\"\ + ,\"attributes\":{\"created_at\":\"2025-05-02T20:27:47.572068Z\",\"description\"\ + :\"List a Datastore in your app and manage its CRUD (Create, Read, Update,\ + \ Delete) operations directly from App Builder.\",\"name\":\"Manage Datastore\"\ + ,\"slug\":\"manage-datastore\",\"tags\":[\"datadog\"],\"tile_background\"\ + :\"search-callout-table\",\"tile_icon_action_fqn\":\"com.datadoghq.dd.apps_datastore.bulkPutDatastoreItem\"\ + ,\"updated_at\":\"2026-05-18T17:02:04.277122Z\"}},{\"id\":\"8caf15ac-f175-4b46-b867-dfbd73f5d1ba\"\ + ,\"type\":\"blueprint\",\"attributes\":{\"created_at\":\"2025-04-29T18:37:39.237759Z\"\ + ,\"description\":\"Track on-call engineers across different teams and services,\ + \ and create incidents in OpsGenie\",\"name\":\"Manage OpsGenie On-call\"\ + ,\"slug\":\"manage-ops-genie-on-call\",\"tags\":[\"paging\"],\"tile_background\"\ + :\"one-callout-table\",\"tile_icon_action_fqn\":\"com.datadoghq.opsgenie.createIncident\"\ + ,\"updated_at\":\"2026-05-18T17:02:04.302057Z\"}},{\"id\":\"88a2c35b-31f4-4420-b6a0-f3da6a1fd740\"\ + ,\"type\":\"blueprint\",\"attributes\":{\"created_at\":\"2025-04-14T02:00:39.687547Z\"\ + ,\"description\":\"Create new S3 buckets directly in AWS.\",\"name\":\"Create\ + \ S3 Bucket\",\"slug\":\"create-new-s3-bucket\",\"tags\":[\"aws\"],\"tile_background\"\ + :\"table\",\"tile_icon_action_fqn\":\"com.datadoghq.aws.s3.create_s3_bucket\"\ + ,\"updated_at\":\"2026-05-18T17:02:02.159767Z\"}},{\"id\":\"eef5812e-45ef-47a4-9570-4c6b7a11bc4f\"\ + ,\"type\":\"blueprint\",\"attributes\":{\"created_at\":\"2025-05-02T20:27:43.692089Z\"\ + ,\"description\":\"Prompt OpenAI and get responses from a text inputs\",\"\ + name\":\"Prompt OpenAI\",\"slug\":\"openai-prompter\",\"tags\":[\"uses_ai\"\ + ],\"tile_background\":\"table\",\"tile_icon_action_fqn\":\"com.datadoghq.openai.generateText\"\ + ,\"updated_at\":\"2026-05-18T17:01:29.850296Z\"}},{\"id\":\"f333c674-1010-4bf6-9b7b-215f6c88f878\"\ + ,\"type\":\"blueprint\",\"attributes\":{\"created_at\":\"2025-05-02T20:27:46.458292Z\"\ + ,\"description\":\"Track on-call engineers across different teams and services\"\ + ,\"name\":\"Manage PagerDuty On-call\",\"slug\":\"pagerduty_oncall_manager\"\ + ,\"tags\":[\"paging\"],\"tile_background\":\"people-modal\",\"tile_icon_action_fqn\"\ + :\"com.datadoghq.pagerduty.listServices\",\"updated_at\":\"2026-05-18T17:02:15.724318Z\"\ + }},{\"id\":\"5761abf4-771d-42e6-9898-5eae6465e94c\",\"type\":\"blueprint\"\ + ,\"attributes\":{\"created_at\":\"2025-04-29T18:37:39.317021Z\",\"description\"\ + :\"Manage, start, restart, and stop your Azure Web Apps\",\"name\":\"Manage\ + \ Azure Web Apps\",\"slug\":\"manage-azure-web-apps\",\"tags\":[\"azure\"\ + ],\"tile_background\":\"one-callout-table\",\"tile_icon_action_fqn\":\"com.datadoghq.azure.apps.restartWebApp\"\ + ,\"updated_at\":\"2026-05-18T17:02:04.40436Z\"}},{\"id\":\"858a49c0-7781-46ef-b4e0-7fc7c96a311b\"\ + ,\"type\":\"blueprint\",\"attributes\":{\"created_at\":\"2025-06-23T19:08:48.677682Z\"\ + ,\"description\":\"View state machines and stop, start or pause their associated\ + \ executions\",\"name\":\"Manage Step Functions\",\"slug\":\"step-functions-console\"\ + ,\"tags\":[\"aws\"],\"tile_background\":\"table-with-modal\",\"tile_icon_action_fqn\"\ + :\"com.datadoghq.aws.stepfunctions.listStateMachines\",\"updated_at\":\"2026-05-18T17:02:02.699196Z\"\ + }},{\"id\":\"4c19fab0-3269-46e4-a2dd-365ba5bb2619\",\"type\":\"blueprint\"\ + ,\"attributes\":{\"created_at\":\"2025-04-28T21:17:42.057615Z\",\"description\"\ + :\"List, start, restart, power off and deallocate your VMs\",\"name\":\"Manage\ + \ Azure Virtual Machines\",\"slug\":\"azure_vms_management_console\",\"tags\"\ + :[\"azure\"],\"tile_background\":\"one-callout-table\",\"tile_icon_action_fqn\"\ + :\"com.datadoghq.azure.vm.listSubscriptionVirtualMachines\",\"updated_at\"\ + :\"2026-05-18T17:02:06.221711Z\"}},{\"id\":\"a276b5f5-c6c0-4329-af64-d630d25593dc\"\ + ,\"type\":\"blueprint\",\"attributes\":{\"created_at\":\"2025-04-28T21:17:42.000627Z\"\ + ,\"description\":\"View DynamoDB table status and perform CRUD operations\"\ + ,\"name\":\"Manage DynamoDB\",\"slug\":\"dynamodb_console\",\"tags\":[\"aws\"\ + ],\"tile_background\":\"bento-box-table\",\"tile_icon_action_fqn\":\"com.datadoghq.aws.dynamodb.describe_table\"\ + ,\"updated_at\":\"2026-05-18T17:02:00.038636Z\"}},{\"id\":\"cc9872f6-9a15-454e-8f02-beec66ce1bde\"\ + ,\"type\":\"blueprint\",\"attributes\":{\"created_at\":\"2025-04-28T21:17:42.039633Z\"\ + ,\"description\":\"Rebuild or restart Elastic Beanstalk applications\",\"\ + name\":\"Manage Elastic Beanstalk Apps\",\"slug\":\"elastic_beanstalk_console\"\ + ,\"tags\":[\"aws\"],\"tile_background\":\"search-callout-table\",\"tile_icon_action_fqn\"\ + :\"com.datadoghq.aws.elasticbeanstalk.listApplications\",\"updated_at\":\"\ + 2026-05-18T17:02:03.613799Z\"}},{\"id\":\"84c7ba6f-d69b-4e7c-aa0b-56ba9022ff50\"\ + ,\"type\":\"blueprint\",\"attributes\":{\"created_at\":\"2025-05-05T19:50:21.700674Z\"\ + ,\"description\":\"List, start or stop your Compute Engine instances\",\"\ + name\":\"Manage Google Cloud Compute\",\"slug\":\"gcp-cloud-compute-management-console\"\ + ,\"tags\":[\"gcp\"],\"tile_background\":\"one-callout-table\",\"tile_icon_action_fqn\"\ + :\"com.datadoghq.gcp.compute.listInstances\",\"updated_at\":\"2026-05-18T17:02:11.166133Z\"\ + }},{\"id\":\"e426403a-5d30-49d2-abed-d2372e8c7744\",\"type\":\"blueprint\"\ + ,\"attributes\":{\"created_at\":\"2025-05-02T20:27:46.472898Z\",\"description\"\ + :\"Select a service \\u0026 trigger an incident\",\"name\":\"Trigger Incident\ + \ in Pagerduty\",\"slug\":\"pagerduty_trigger_incident\",\"tags\":[\"paging\"\ + ,\"datadog\"],\"tile_background\":\"table\",\"tile_icon_action_fqn\":\"com.datadoghq.pagerduty.trigger_incident\"\ + ,\"updated_at\":\"2026-05-18T17:02:15.92158Z\"}},{\"id\":\"e6b74e1f-7f36-49b4-abfe-7c9ebf067ff2\"\ + ,\"type\":\"blueprint\",\"attributes\":{\"created_at\":\"2025-04-08T20:09:58.363312Z\"\ + ,\"description\":\"View autoscaling group capacity and trigger a change\"\ + ,\"name\":\"Manage AWS Autoscaling Groups\",\"slug\":\"aws_autoscaling_groups\"\ + ,\"tags\":[\"aws\"],\"tile_background\":\"three-callout-prompt\",\"tile_icon_action_fqn\"\ + :\"com.datadoghq.aws.autoscaling.describe_auto_scaling_group\",\"updated_at\"\ + :\"2026-05-18T17:02:03.420659Z\"}},{\"id\":\"9913dec9-e949-45e6-908a-587ffb823a0c\"\ + ,\"type\":\"blueprint\",\"attributes\":{\"created_at\":\"2025-05-02T20:27:47.592154Z\"\ + ,\"description\":\"Renew, describe, delete and request private and public\ + \ certificates\",\"name\":\"Manage AWS Certificates\",\"slug\":\"manage-aws-certificates\"\ + ,\"tags\":[\"aws\"],\"tile_background\":\"one-callout-table\",\"tile_icon_action_fqn\"\ + :\"com.datadoghq.aws.acm.requestPublicCertificate\",\"updated_at\":\"2026-05-18T17:02:04.316282Z\"\ + }},{\"id\":\"d837c301-edcd-48fb-8250-a4e9fb9add11\",\"type\":\"blueprint\"\ + ,\"attributes\":{\"created_at\":\"2025-04-29T18:37:39.200777Z\",\"description\"\ + :\"Create new tickets in Jira\",\"name\":\"Create Jira Ticket\",\"slug\":\"\ + jira-ticket-creator\",\"tags\":[\"software_delivery\"],\"tile_background\"\ + :\"table\",\"tile_icon_action_fqn\":\"com.datadoghq.jira.create_issue\",\"\ + updated_at\":\"2026-05-18T17:02:04.229225Z\"}},{\"id\":\"25bc3ad1-724c-4750-9bc2-112a59e76b6a\"\ + ,\"type\":\"blueprint\",\"attributes\":{\"created_at\":\"2025-08-22T01:16:30.733428Z\"\ + ,\"description\":\"Use this form to create a new entity definition YAML in\ + \ Github.\",\"name\":\"Create Catalog Entity Definition\",\"slug\":\"create_catalog_entity_definition\"\ + ,\"tags\":[\"datadog\",\"software_delivery\"],\"tile_background\":\"people-modal\"\ + ,\"tile_icon_action_fqn\":\"com.datadoghq.github.createOrUpdateFile\",\"updated_at\"\ + :\"2026-05-18T17:02:03.431113Z\"}},{\"id\":\"7d2e21d5-1e1f-4abc-aebb-880ef86882f5\"\ + ,\"type\":\"blueprint\",\"attributes\":{\"created_at\":\"2025-07-21T00:43:24.42963Z\"\ + ,\"description\":\"How to add bar charts to apps\",\"name\":\"How To: Bar\ + \ Charts\",\"slug\":\"how_to__bar_charts\",\"tags\":[\"datadog\",\"howTo\"\ + ],\"tile_background\":\"table\",\"tile_icon_action_fqn\":\"com.datadoghq.dd.teams.listTeams\"\ + ,\"updated_at\":\"2026-05-18T17:02:03.801347Z\"}},{\"id\":\"6bf5671b-3195-4ea5-b3fe-eba97d25b26a\"\ + ,\"type\":\"blueprint\",\"attributes\":{\"created_at\":\"2025-07-02T16:43:02.148346Z\"\ + ,\"description\":\"Scaffolder app is used to create new software components\ + \ from template repositories. It takes inputs from developers and generates\ + \ a new repository or a PR based on the provided data and the template.\"\ + ,\"name\":\"Scaffold New Project in GitLab\",\"slug\":\"scaffold-new-project-in-gitlab\"\ + ,\"tags\":[\"software_delivery\"],\"tile_background\":\"table-with-modal\"\ + ,\"tile_icon_action_fqn\":\"com.datadoghq.gitlab.getProjectDeployments\",\"\ + updated_at\":\"2026-05-18T17:01:20.860684Z\"}},{\"id\":\"f5998cda-c054-48d9-9e88-ae37ab1990cb\"\ + ,\"type\":\"blueprint\",\"attributes\":{\"created_at\":\"2025-07-18T16:51:32.667124Z\"\ + ,\"description\":\"See how to make form fields dynamic and dependent on other\ + \ fields.\",\"name\":\"How to: Form With Dynamic Fields\",\"slug\":\"how_to__form_with_dynamic_fields\"\ + ,\"tags\":[\"howTo\"],\"tile_background\":\"people-modal\",\"tile_icon_action_fqn\"\ + :\"com.datadoghq.github.createOrUpdateFile\",\"updated_at\":\"2026-05-18T17:02:03.923635Z\"\ + }},{\"id\":\"6e27f913-7170-4977-b2b1-243015b9fafd\",\"type\":\"blueprint\"\ + ,\"attributes\":{\"created_at\":\"2025-07-17T23:29:17.423877Z\",\"description\"\ + :\"How to persist your app in a datastore using CRUD (Create, Read, Update,\ + \ Delete) operations\",\"name\":\"How To: Persist Data in Datastore\",\"slug\"\ + :\"how_to__persist_data_in_datastore_using_crud\",\"tags\":[\"datadog\",\"\ + howTo\"],\"tile_background\":\"search-callout-table\",\"tile_icon_action_fqn\"\ + :\"com.datadoghq.dd.apps_datastore.listDatastoreItems\",\"updated_at\":\"\ + 2026-05-18T17:02:04.018585Z\"}}]}" + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/app_builder/List-Tags-returns-OK-response.frozen b/cassettes/features/v2/app_builder/List-Tags-returns-OK-response.frozen new file mode 100644 index 000000000000..0b99c48bf67f --- /dev/null +++ b/cassettes/features/v2/app_builder/List-Tags-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-05-18T17:39:19.668Z \ No newline at end of file diff --git a/cassettes/features/v2/app_builder/List-Tags-returns-OK-response.yml b/cassettes/features/v2/app_builder/List-Tags-returns-OK-response.yml new file mode 100644 index 000000000000..208d5a8dfd5e --- /dev/null +++ b/cassettes/features/v2/app_builder/List-Tags-returns-OK-response.yml @@ -0,0 +1,20 @@ +http_interactions: +- recorded_at: Mon, 18 May 2026 17:39:19 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/app-builder/tags + response: + body: + encoding: UTF-8 + string: '{"data":[]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/examples/v2/app-builder/GetBlueprint.rb b/examples/v2/app-builder/GetBlueprint.rb new file mode 100644 index 000000000000..be7e7623680b --- /dev/null +++ b/examples/v2/app-builder/GetBlueprint.rb @@ -0,0 +1,5 @@ +# Get Blueprint returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::AppBuilderAPI.new +p api_instance.get_blueprint("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d") diff --git a/examples/v2/app-builder/GetBlueprintsByIntegrationId.rb b/examples/v2/app-builder/GetBlueprintsByIntegrationId.rb new file mode 100644 index 000000000000..f16883964236 --- /dev/null +++ b/examples/v2/app-builder/GetBlueprintsByIntegrationId.rb @@ -0,0 +1,5 @@ +# Get Blueprints by Integration ID returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::AppBuilderAPI.new +p api_instance.get_blueprints_by_integration_id("aws") diff --git a/examples/v2/app-builder/GetBlueprintsBySlugs.rb b/examples/v2/app-builder/GetBlueprintsBySlugs.rb new file mode 100644 index 000000000000..570ffc972670 --- /dev/null +++ b/examples/v2/app-builder/GetBlueprintsBySlugs.rb @@ -0,0 +1,5 @@ +# Get Blueprints by Slugs returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::AppBuilderAPI.new +p api_instance.get_blueprints_by_slugs("aws-service-manager") diff --git a/examples/v2/app-builder/ListBlueprints.rb b/examples/v2/app-builder/ListBlueprints.rb new file mode 100644 index 000000000000..d5dd18a258ee --- /dev/null +++ b/examples/v2/app-builder/ListBlueprints.rb @@ -0,0 +1,5 @@ +# List Blueprints returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::AppBuilderAPI.new +p api_instance.list_blueprints() diff --git a/examples/v2/app-builder/ListTags.rb b/examples/v2/app-builder/ListTags.rb new file mode 100644 index 000000000000..295663cbb6ab --- /dev/null +++ b/examples/v2/app-builder/ListTags.rb @@ -0,0 +1,5 @@ +# List Tags returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::AppBuilderAPI.new +p api_instance.list_tags() diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 62850465cc53..6c21fb789376 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -1435,6 +1435,19 @@ "limit" => "Integer", "page" => "Integer", }, + "v2.GetBlueprint" => { + "blueprint_id" => "UUID", + }, + "v2.ListBlueprints" => { + "limit" => "Integer", + "page" => "Integer", + }, + "v2.GetBlueprintsByIntegrationId" => { + "integration_id" => "String", + }, + "v2.GetBlueprintsBySlugs" => { + "slugs" => "String", + }, "v2.ListAuditLogs" => { "filter_query" => "String", "filter_from" => "Time", diff --git a/features/v2/app_builder.feature b/features/v2/app_builder.feature index 9f2b3174bc2c..782c77895fb3 100644 --- a/features/v2/app_builder.feature +++ b/features/v2/app_builder.feature @@ -113,7 +113,7 @@ Feature: App Builder When the request is sent Then the response status is 400 Bad Request - @skip-typescript @team:DataDog/app-builder-backend + @skip @team:DataDog/app-builder-backend Scenario: Get App returns "Gone" response Given new "GetApp" request And there is a valid "app" in the system @@ -139,6 +139,34 @@ Feature: App Builder And the response "data.id" has the same value as "app.data.id" And the response "data.type" is equal to "appDefinitions" + @team:DataDog/app-builder-backend + Scenario: Get Blueprint returns "Not Found" response + Given new "GetBlueprint" request + And request contains "blueprint_id" parameter with value "00000000-0000-0000-0000-000000000001" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/app-builder-backend + Scenario: Get Blueprint returns "OK" response + Given new "GetBlueprint" request + And request contains "blueprint_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @team:DataDog/app-builder-backend + Scenario: Get Blueprints by Integration ID returns "OK" response + Given new "GetBlueprintsByIntegrationId" request + And request contains "integration_id" parameter with value "aws" + When the request is sent + Then the response status is 200 OK + + @team:DataDog/app-builder-backend + Scenario: Get Blueprints by Slugs returns "OK" response + Given new "GetBlueprintsBySlugs" request + And request contains "slugs" parameter with value "aws-service-manager" + When the request is sent + Then the response status is 200 OK + @skip @team:DataDog/app-builder-backend Scenario: List App Versions returns "Bad Request" response Given new "ListAppVersions" request @@ -173,6 +201,18 @@ Feature: App Builder When the request is sent Then the response status is 200 OK + @team:DataDog/app-builder-backend + Scenario: List Blueprints returns "OK" response + Given new "ListBlueprints" request + When the request is sent + Then the response status is 200 OK + + @team:DataDog/app-builder-backend + Scenario: List Tags returns "OK" response + Given new "ListTags" request + When the request is sent + Then the response status is 200 OK + @skip @team:DataDog/app-builder-backend Scenario: Name App Version returns "Bad Request" response Given new "UpdateAppVersionName" request diff --git a/features/v2/undo.json b/features/v2/undo.json index 63597d256db6..e676facc99de 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -687,6 +687,36 @@ "type": "safe" } }, + "GetBlueprint": { + "tag": "App Builder", + "undo": { + "type": "safe" + } + }, + "ListBlueprints": { + "tag": "App Builder", + "undo": { + "type": "safe" + } + }, + "GetBlueprintsByIntegrationId": { + "tag": "App Builder", + "undo": { + "type": "safe" + } + }, + "GetBlueprintsBySlugs": { + "tag": "App Builder", + "undo": { + "type": "safe" + } + }, + "ListTags": { + "tag": "App Builder", + "undo": { + "type": "safe" + } + }, "ListApplicationKeys": { "tag": "Key Management", "undo": { diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index c72838967fbb..a4f935a2c436 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -1222,6 +1222,7 @@ def overrides "v2.app_builder_event" => "AppBuilderEvent", "v2.app_builder_event_name" => "AppBuilderEventName", "v2.app_builder_event_type" => "AppBuilderEventType", + "v2.app_builder_list_tags_response" => "AppBuilderListTagsResponse", "v2.app_definition_type" => "AppDefinitionType", "v2.app_deployment_type" => "AppDeploymentType", "v2.app_favorite_type" => "AppFavoriteType", @@ -1588,6 +1589,11 @@ def overrides "v2.billing_dimensions_mapping_body_item_attributes_endpoints_items" => "BillingDimensionsMappingBodyItemAttributesEndpointsItems", "v2.billing_dimensions_mapping_body_item_attributes_endpoints_items_status" => "BillingDimensionsMappingBodyItemAttributesEndpointsItemsStatus", "v2.billing_dimensions_mapping_response" => "BillingDimensionsMappingResponse", + "v2.blueprint_attributes" => "BlueprintAttributes", + "v2.blueprint_data" => "BlueprintData", + "v2.blueprint_data_type" => "BlueprintDataType", + "v2.blueprint_metadata_attributes" => "BlueprintMetadataAttributes", + "v2.blueprint_metadata_data" => "BlueprintMetadataData", "v2.branch_coverage_summary_request" => "BranchCoverageSummaryRequest", "v2.branch_coverage_summary_request_attributes" => "BranchCoverageSummaryRequestAttributes", "v2.branch_coverage_summary_request_data" => "BranchCoverageSummaryRequestData", @@ -3097,6 +3103,8 @@ def overrides "v2.get_app_response" => "GetAppResponse", "v2.get_app_response_data" => "GetAppResponseData", "v2.get_app_response_data_attributes" => "GetAppResponseDataAttributes", + "v2.get_blueprint_response" => "GetBlueprintResponse", + "v2.get_blueprints_response" => "GetBlueprintsResponse", "v2.get_custom_framework_response" => "GetCustomFrameworkResponse", "v2.get_data_deletions_response_body" => "GetDataDeletionsResponseBody", "v2.get_device_attributes" => "GetDeviceAttributes", @@ -3629,6 +3637,7 @@ def overrides "v2.list_apps_response_meta_page" => "ListAppsResponseMetaPage", "v2.list_app_versions_response" => "ListAppVersionsResponse", "v2.list_assets_sbo_ms_response" => "ListAssetsSBOMsResponse", + "v2.list_blueprints_response" => "ListBlueprintsResponse", "v2.list_campaigns_response" => "ListCampaignsResponse", "v2.list_connections_response" => "ListConnectionsResponse", "v2.list_connections_response_data" => "ListConnectionsResponseData", @@ -6268,6 +6277,8 @@ def overrides "v2.table_row_resource_data_attributes" => "TableRowResourceDataAttributes", "v2.table_row_resource_data_type" => "TableRowResourceDataType", "v2.table_row_resource_identifier" => "TableRowResourceIdentifier", + "v2.tag_data" => "TagData", + "v2.tag_data_type" => "TagDataType", "v2.targeting_rule" => "TargetingRule", "v2.targeting_rule_request" => "TargetingRuleRequest", "v2.team" => "Team", diff --git a/lib/datadog_api_client/v2/api/app_builder_api.rb b/lib/datadog_api_client/v2/api/app_builder_api.rb index 00b73ec0b2cb..20826e05435f 100644 --- a/lib/datadog_api_client/v2/api/app_builder_api.rb +++ b/lib/datadog_api_client/v2/api/app_builder_api.rb @@ -361,6 +361,201 @@ def get_app_with_http_info(app_id, opts = {}) return data, status_code, headers end + # Get Blueprint. + # + # @see #get_blueprint_with_http_info + def get_blueprint(blueprint_id, opts = {}) + data, _status_code, _headers = get_blueprint_with_http_info(blueprint_id, opts) + data + end + + # Get Blueprint. + # + # Retrieve an app blueprint by its ID. + # + # @param blueprint_id [UUID] The ID of the blueprint to retrieve. + # @param opts [Hash] the optional parameters + # @return [Array<(GetBlueprintResponse, Integer, Hash)>] GetBlueprintResponse data, response status code and response headers + def get_blueprint_with_http_info(blueprint_id, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AppBuilderAPI.get_blueprint ...' + end + # verify the required parameter 'blueprint_id' is set + if @api_client.config.client_side_validation && blueprint_id.nil? + fail ArgumentError, "Missing the required parameter 'blueprint_id' when calling AppBuilderAPI.get_blueprint" + end + # resource path + local_var_path = '/api/v2/app-builder/blueprint/{blueprint_id}'.sub('{blueprint_id}', CGI.escape(blueprint_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'GetBlueprintResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :get_blueprint, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AppBuilderAPI#get_blueprint\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get Blueprints by Integration ID. + # + # @see #get_blueprints_by_integration_id_with_http_info + def get_blueprints_by_integration_id(integration_id, opts = {}) + data, _status_code, _headers = get_blueprints_by_integration_id_with_http_info(integration_id, opts) + data + end + + # Get Blueprints by Integration ID. + # + # List app blueprints associated with a specific integration ID. + # + # @param integration_id [String] The integration ID to filter blueprints by. + # @param opts [Hash] the optional parameters + # @return [Array<(GetBlueprintsResponse, Integer, Hash)>] GetBlueprintsResponse data, response status code and response headers + def get_blueprints_by_integration_id_with_http_info(integration_id, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AppBuilderAPI.get_blueprints_by_integration_id ...' + end + # verify the required parameter 'integration_id' is set + if @api_client.config.client_side_validation && integration_id.nil? + fail ArgumentError, "Missing the required parameter 'integration_id' when calling AppBuilderAPI.get_blueprints_by_integration_id" + end + # resource path + local_var_path = '/api/v2/app-builder/blueprints/integration-id/{integration_id}'.sub('{integration_id}', CGI.escape(integration_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'GetBlueprintsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :get_blueprints_by_integration_id, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AppBuilderAPI#get_blueprints_by_integration_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get Blueprints by Slugs. + # + # @see #get_blueprints_by_slugs_with_http_info + def get_blueprints_by_slugs(slugs, opts = {}) + data, _status_code, _headers = get_blueprints_by_slugs_with_http_info(slugs, opts) + data + end + + # Get Blueprints by Slugs. + # + # Retrieve app blueprints by their slugs. + # + # @param slugs [String] A comma-separated list of blueprint slugs. + # @param opts [Hash] the optional parameters + # @return [Array<(GetBlueprintsResponse, Integer, Hash)>] GetBlueprintsResponse data, response status code and response headers + def get_blueprints_by_slugs_with_http_info(slugs, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AppBuilderAPI.get_blueprints_by_slugs ...' + end + # verify the required parameter 'slugs' is set + if @api_client.config.client_side_validation && slugs.nil? + fail ArgumentError, "Missing the required parameter 'slugs' when calling AppBuilderAPI.get_blueprints_by_slugs" + end + # resource path + local_var_path = '/api/v2/app-builder/blueprints/slugs/{slugs}'.sub('{slugs}', CGI.escape(slugs.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'GetBlueprintsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :get_blueprints_by_slugs, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AppBuilderAPI#get_blueprints_by_slugs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # List Apps. # # @see #list_apps_with_http_info @@ -512,6 +707,130 @@ def list_app_versions_with_http_info(app_id, opts = {}) return data, status_code, headers end + # List Blueprints. + # + # @see #list_blueprints_with_http_info + def list_blueprints(opts = {}) + data, _status_code, _headers = list_blueprints_with_http_info(opts) + data + end + + # List Blueprints. + # + # List available app blueprints. + # + # @param opts [Hash] the optional parameters + # @option opts [Integer] :limit The number of blueprints to return per page. Defaults to 10. Maximum is 100. + # @option opts [Integer] :page The page of results to return. Starts at 0. + # @return [Array<(ListBlueprintsResponse, Integer, Hash)>] ListBlueprintsResponse data, response status code and response headers + def list_blueprints_with_http_info(opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AppBuilderAPI.list_blueprints ...' + end + # resource path + local_var_path = '/api/v2/app-builder/blueprints' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? + query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'ListBlueprintsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_blueprints, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AppBuilderAPI#list_blueprints\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List Tags. + # + # @see #list_tags_with_http_info + def list_tags(opts = {}) + data, _status_code, _headers = list_tags_with_http_info(opts) + data + end + + # List Tags. + # + # List all tags associated with the authenticated user's apps. + # + # @param opts [Hash] the optional parameters + # @return [Array<(AppBuilderListTagsResponse, Integer, Hash)>] AppBuilderListTagsResponse data, response status code and response headers + def list_tags_with_http_info(opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AppBuilderAPI.list_tags ...' + end + # resource path + local_var_path = '/api/v2/app-builder/tags' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'AppBuilderListTagsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_tags, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AppBuilderAPI#list_tags\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Publish App. # # @see #publish_app_with_http_info diff --git a/lib/datadog_api_client/v2/models/app_builder_list_tags_response.rb b/lib/datadog_api_client/v2/models/app_builder_list_tags_response.rb new file mode 100644 index 000000000000..e26a860ad3ba --- /dev/null +++ b/lib/datadog_api_client/v2/models/app_builder_list_tags_response.rb @@ -0,0 +1,107 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The response for listing tags associated with apps. + class AppBuilderListTagsResponse + include BaseGenericModel + + # An array of tags. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AppBuilderListTagsResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/blueprint_attributes.rb b/lib/datadog_api_client/v2/models/blueprint_attributes.rb new file mode 100644 index 000000000000..3dd576998d3d --- /dev/null +++ b/lib/datadog_api_client/v2/models/blueprint_attributes.rb @@ -0,0 +1,312 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The attributes of a blueprint resource. + class BlueprintAttributes + include BaseGenericModel + + # The timestamp when the blueprint was created. + attr_reader :created_at + + # The app definition type. + attr_reader :definition + + # A description of what the blueprint does. + attr_reader :description + + # Embedded datastore blueprints. + attr_accessor :embedded_datastore_blueprints + + # Embedded native actions. + attr_accessor :embedded_native_actions + + # Embedded workflow blueprints. + attr_accessor :embedded_workflow_blueprints + + # The integration ID associated with the blueprint. + attr_accessor :integration_id + + # Mocked outputs for testing the blueprint. + attr_accessor :mocked_outputs + + # The human-readable name of the blueprint. + attr_reader :name + + # The unique slug identifier of the blueprint. + attr_reader :slug + + # Tags associated with the blueprint. + attr_accessor :tags + + # The background style of the blueprint tile. + attr_accessor :tile_background + + # The fully qualified name of the action used as the tile icon. + attr_accessor :tile_icon_action_fqn + + # The timestamp when the blueprint was last updated. + attr_reader :updated_at + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'created_at' => :'created_at', + :'definition' => :'definition', + :'description' => :'description', + :'embedded_datastore_blueprints' => :'embedded_datastore_blueprints', + :'embedded_native_actions' => :'embedded_native_actions', + :'embedded_workflow_blueprints' => :'embedded_workflow_blueprints', + :'integration_id' => :'integration_id', + :'mocked_outputs' => :'mocked_outputs', + :'name' => :'name', + :'slug' => :'slug', + :'tags' => :'tags', + :'tile_background' => :'tile_background', + :'tile_icon_action_fqn' => :'tile_icon_action_fqn', + :'updated_at' => :'updated_at' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'created_at' => :'Time', + :'definition' => :'AppDefinitionType', + :'description' => :'String', + :'embedded_datastore_blueprints' => :'Hash', + :'embedded_native_actions' => :'Array>', + :'embedded_workflow_blueprints' => :'Hash', + :'integration_id' => :'String', + :'mocked_outputs' => :'Hash', + :'name' => :'String', + :'slug' => :'String', + :'tags' => :'Array', + :'tile_background' => :'String', + :'tile_icon_action_fqn' => :'String', + :'updated_at' => :'Time' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::BlueprintAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'definition') + self.definition = attributes[:'definition'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'embedded_datastore_blueprints') + self.embedded_datastore_blueprints = attributes[:'embedded_datastore_blueprints'] + end + + if attributes.key?(:'embedded_native_actions') + if (value = attributes[:'embedded_native_actions']).is_a?(Array) + self.embedded_native_actions = value + end + end + + if attributes.key?(:'embedded_workflow_blueprints') + self.embedded_workflow_blueprints = attributes[:'embedded_workflow_blueprints'] + end + + if attributes.key?(:'integration_id') + self.integration_id = attributes[:'integration_id'] + end + + if attributes.key?(:'mocked_outputs') + self.mocked_outputs = attributes[:'mocked_outputs'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'slug') + self.slug = attributes[:'slug'] + end + + if attributes.key?(:'tags') + if (value = attributes[:'tags']).is_a?(Array) + self.tags = value + end + end + + if attributes.key?(:'tile_background') + self.tile_background = attributes[:'tile_background'] + end + + if attributes.key?(:'tile_icon_action_fqn') + self.tile_icon_action_fqn = attributes[:'tile_icon_action_fqn'] + end + + if attributes.key?(:'updated_at') + self.updated_at = attributes[:'updated_at'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @created_at.nil? + return false if @definition.nil? + return false if @description.nil? + return false if @name.nil? + return false if @slug.nil? + return false if @updated_at.nil? + true + end + + # Custom attribute writer method with validation + # @param created_at [Object] Object to be assigned + # @!visibility private + def created_at=(created_at) + if created_at.nil? + fail ArgumentError, 'invalid value for "created_at", created_at cannot be nil.' + end + @created_at = created_at + end + + # Custom attribute writer method with validation + # @param definition [Object] Object to be assigned + # @!visibility private + def definition=(definition) + if definition.nil? + fail ArgumentError, 'invalid value for "definition", definition cannot be nil.' + end + @definition = definition + end + + # Custom attribute writer method with validation + # @param description [Object] Object to be assigned + # @!visibility private + def description=(description) + if description.nil? + fail ArgumentError, 'invalid value for "description", description cannot be nil.' + end + @description = description + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param slug [Object] Object to be assigned + # @!visibility private + def slug=(slug) + if slug.nil? + fail ArgumentError, 'invalid value for "slug", slug cannot be nil.' + end + @slug = slug + end + + # Custom attribute writer method with validation + # @param updated_at [Object] Object to be assigned + # @!visibility private + def updated_at=(updated_at) + if updated_at.nil? + fail ArgumentError, 'invalid value for "updated_at", updated_at cannot be nil.' + end + @updated_at = updated_at + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + created_at == o.created_at && + definition == o.definition && + description == o.description && + embedded_datastore_blueprints == o.embedded_datastore_blueprints && + embedded_native_actions == o.embedded_native_actions && + embedded_workflow_blueprints == o.embedded_workflow_blueprints && + integration_id == o.integration_id && + mocked_outputs == o.mocked_outputs && + name == o.name && + slug == o.slug && + tags == o.tags && + tile_background == o.tile_background && + tile_icon_action_fqn == o.tile_icon_action_fqn && + updated_at == o.updated_at && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [created_at, definition, description, embedded_datastore_blueprints, embedded_native_actions, embedded_workflow_blueprints, integration_id, mocked_outputs, name, slug, tags, tile_background, tile_icon_action_fqn, updated_at, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/blueprint_data.rb b/lib/datadog_api_client/v2/models/blueprint_data.rb new file mode 100644 index 000000000000..7d13ca627125 --- /dev/null +++ b/lib/datadog_api_client/v2/models/blueprint_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A blueprint resource. + class BlueprintData + include BaseGenericModel + + # The attributes of a blueprint resource. + attr_reader :attributes + + # The ID of the blueprint. + attr_reader :id + + # The resource type for a blueprint. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'BlueprintAttributes', + :'id' => :'UUID', + :'type' => :'BlueprintDataType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::BlueprintData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/blueprint_data_type.rb b/lib/datadog_api_client/v2/models/blueprint_data_type.rb new file mode 100644 index 000000000000..9f43bfa16762 --- /dev/null +++ b/lib/datadog_api_client/v2/models/blueprint_data_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The resource type for a blueprint. + class BlueprintDataType + include BaseEnumModel + + BLUEPRINT = "blueprint".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/blueprint_metadata_attributes.rb b/lib/datadog_api_client/v2/models/blueprint_metadata_attributes.rb new file mode 100644 index 000000000000..1f499a832f44 --- /dev/null +++ b/lib/datadog_api_client/v2/models/blueprint_metadata_attributes.rb @@ -0,0 +1,239 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The attributes of a blueprint metadata resource. + class BlueprintMetadataAttributes + include BaseGenericModel + + # The timestamp when the blueprint was created. + attr_reader :created_at + + # A description of what the blueprint does. + attr_reader :description + + # The human-readable name of the blueprint. + attr_reader :name + + # The unique slug identifier of the blueprint. + attr_reader :slug + + # Tags associated with the blueprint. + attr_accessor :tags + + # The background style of the blueprint tile. + attr_accessor :tile_background + + # The fully qualified name of the action used as the tile icon. + attr_accessor :tile_icon_action_fqn + + # The timestamp when the blueprint was last updated. + attr_reader :updated_at + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'created_at' => :'created_at', + :'description' => :'description', + :'name' => :'name', + :'slug' => :'slug', + :'tags' => :'tags', + :'tile_background' => :'tile_background', + :'tile_icon_action_fqn' => :'tile_icon_action_fqn', + :'updated_at' => :'updated_at' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'created_at' => :'Time', + :'description' => :'String', + :'name' => :'String', + :'slug' => :'String', + :'tags' => :'Array', + :'tile_background' => :'String', + :'tile_icon_action_fqn' => :'String', + :'updated_at' => :'Time' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::BlueprintMetadataAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'slug') + self.slug = attributes[:'slug'] + end + + if attributes.key?(:'tags') + if (value = attributes[:'tags']).is_a?(Array) + self.tags = value + end + end + + if attributes.key?(:'tile_background') + self.tile_background = attributes[:'tile_background'] + end + + if attributes.key?(:'tile_icon_action_fqn') + self.tile_icon_action_fqn = attributes[:'tile_icon_action_fqn'] + end + + if attributes.key?(:'updated_at') + self.updated_at = attributes[:'updated_at'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @created_at.nil? + return false if @description.nil? + return false if @name.nil? + return false if @slug.nil? + return false if @updated_at.nil? + true + end + + # Custom attribute writer method with validation + # @param created_at [Object] Object to be assigned + # @!visibility private + def created_at=(created_at) + if created_at.nil? + fail ArgumentError, 'invalid value for "created_at", created_at cannot be nil.' + end + @created_at = created_at + end + + # Custom attribute writer method with validation + # @param description [Object] Object to be assigned + # @!visibility private + def description=(description) + if description.nil? + fail ArgumentError, 'invalid value for "description", description cannot be nil.' + end + @description = description + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param slug [Object] Object to be assigned + # @!visibility private + def slug=(slug) + if slug.nil? + fail ArgumentError, 'invalid value for "slug", slug cannot be nil.' + end + @slug = slug + end + + # Custom attribute writer method with validation + # @param updated_at [Object] Object to be assigned + # @!visibility private + def updated_at=(updated_at) + if updated_at.nil? + fail ArgumentError, 'invalid value for "updated_at", updated_at cannot be nil.' + end + @updated_at = updated_at + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + created_at == o.created_at && + description == o.description && + name == o.name && + slug == o.slug && + tags == o.tags && + tile_background == o.tile_background && + tile_icon_action_fqn == o.tile_icon_action_fqn && + updated_at == o.updated_at && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [created_at, description, name, slug, tags, tile_background, tile_icon_action_fqn, updated_at, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/blueprint_metadata_data.rb b/lib/datadog_api_client/v2/models/blueprint_metadata_data.rb new file mode 100644 index 000000000000..d8d7125e6826 --- /dev/null +++ b/lib/datadog_api_client/v2/models/blueprint_metadata_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A blueprint metadata resource. + class BlueprintMetadataData + include BaseGenericModel + + # The attributes of a blueprint metadata resource. + attr_reader :attributes + + # The ID of the blueprint. + attr_reader :id + + # The resource type for a blueprint. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'BlueprintMetadataAttributes', + :'id' => :'UUID', + :'type' => :'BlueprintDataType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::BlueprintMetadataData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/get_blueprint_response.rb b/lib/datadog_api_client/v2/models/get_blueprint_response.rb new file mode 100644 index 000000000000..7bdd2f610731 --- /dev/null +++ b/lib/datadog_api_client/v2/models/get_blueprint_response.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The response for retrieving a single blueprint. + class GetBlueprintResponse + include BaseGenericModel + + # A blueprint resource. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'BlueprintData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::GetBlueprintResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/get_blueprints_response.rb b/lib/datadog_api_client/v2/models/get_blueprints_response.rb new file mode 100644 index 000000000000..1d131aefc908 --- /dev/null +++ b/lib/datadog_api_client/v2/models/get_blueprints_response.rb @@ -0,0 +1,107 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The response for retrieving multiple blueprints. + class GetBlueprintsResponse + include BaseGenericModel + + # An array of blueprints. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::GetBlueprintsResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/list_blueprints_response.rb b/lib/datadog_api_client/v2/models/list_blueprints_response.rb new file mode 100644 index 000000000000..abee20b9d735 --- /dev/null +++ b/lib/datadog_api_client/v2/models/list_blueprints_response.rb @@ -0,0 +1,107 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The response for listing available blueprints. + class ListBlueprintsResponse + include BaseGenericModel + + # An array of blueprint metadata. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ListBlueprintsResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/tag_data.rb b/lib/datadog_api_client/v2/models/tag_data.rb new file mode 100644 index 000000000000..2e2340caf01d --- /dev/null +++ b/lib/datadog_api_client/v2/models/tag_data.rb @@ -0,0 +1,148 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A tag resource associated with an app. + class TagData + include BaseGenericModel + + # The name of the tag. + attr_reader :id + + # The resource type for a tag. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'String', + :'type' => :'TagDataType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TagData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @id.nil? + return false if @type.nil? + return false if @type.to_s.length < 3 + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + if type.to_s.length < 3 + fail ArgumentError, 'invalid value for "type", the character length must be great than or equal to 3.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/tag_data_type.rb b/lib/datadog_api_client/v2/models/tag_data_type.rb new file mode 100644 index 000000000000..d4128b917009 --- /dev/null +++ b/lib/datadog_api_client/v2/models/tag_data_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The resource type for a tag. + class TagDataType + include BaseEnumModel + + TAG = "tag".freeze + end +end