{
  "mtlsRootUrl": "https://databaseinsights.mtls.googleapis.com/",
  "kind": "discovery#restDescription",
  "baseUrl": "https://databaseinsights.googleapis.com/",
  "revision": "20260529",
  "fullyEncodeReservedExpansion": true,
  "parameters": {
    "access_token": {
      "type": "string",
      "description": "OAuth access token.",
      "location": "query"
    },
    "alt": {
      "type": "string",
      "description": "Data format for response.",
      "default": "json",
      "enum": [
        "json",
        "media",
        "proto"
      ],
      "enumDescriptions": [
        "Responses with Content-Type of application/json",
        "Media download with context-dependent Content-Type",
        "Responses with Content-Type of application/x-protobuf"
      ],
      "location": "query"
    },
    "callback": {
      "type": "string",
      "description": "JSONP",
      "location": "query"
    },
    "fields": {
      "type": "string",
      "description": "Selector specifying which fields to include in a partial response.",
      "location": "query"
    },
    "key": {
      "type": "string",
      "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.",
      "location": "query"
    },
    "oauth_token": {
      "type": "string",
      "description": "OAuth 2.0 token for the current user.",
      "location": "query"
    },
    "prettyPrint": {
      "type": "boolean",
      "description": "Returns response with indentations and line breaks.",
      "default": "true",
      "location": "query"
    },
    "quotaUser": {
      "type": "string",
      "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.",
      "location": "query"
    },
    "upload_protocol": {
      "type": "string",
      "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").",
      "location": "query"
    },
    "uploadType": {
      "type": "string",
      "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").",
      "location": "query"
    },
    "$.xgafv": {
      "type": "string",
      "description": "V1 error format.",
      "enum": [
        "1",
        "2"
      ],
      "enumDescriptions": [
        "v1 error format",
        "v2 error format"
      ],
      "location": "query"
    }
  },
  "servicePath": "",
  "version_module": true,
  "resources": {
    "projects": {
      "resources": {
        "locations": {
          "resources": {
            "queryMetrics": {
              "methods": {
                "fetch": {
                  "id": "databaseinsights.projects.locations.queryMetrics.fetch",
                  "path": "v1beta/{+parent}/queryMetrics:fetch",
                  "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/queryMetrics:fetch",
                  "httpMethod": "POST",
                  "parameters": {
                    "parent": {
                      "description": "Required. The name of the location where we request metrics. Format: `projects/{project}/locations/{location}`",
                      "pattern": "^projects/[^/]+/locations/[^/]+$",
                      "location": "path",
                      "required": true,
                      "type": "string"
                    }
                  },
                  "parameterOrder": [
                    "parent"
                  ],
                  "request": {
                    "$ref": "FetchQueryMetricsRequest"
                  },
                  "response": {
                    "$ref": "FetchQueryMetricsResponse"
                  },
                  "scopes": [
                    "https://www.googleapis.com/auth/cloud-platform"
                  ],
                  "description": "FetchQueryMetrics fetches the given database query level metrics."
                }
              }
            },
            "systemMetrics": {
              "methods": {
                "fetch": {
                  "id": "databaseinsights.projects.locations.systemMetrics.fetch",
                  "path": "v1beta/{+parent}/systemMetrics:fetch",
                  "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/systemMetrics:fetch",
                  "httpMethod": "POST",
                  "parameters": {
                    "parent": {
                      "description": "Required. The name of the location where we request metrics. Format: `projects/{project}/locations/{location}`",
                      "pattern": "^projects/[^/]+/locations/[^/]+$",
                      "location": "path",
                      "required": true,
                      "type": "string"
                    }
                  },
                  "parameterOrder": [
                    "parent"
                  ],
                  "request": {
                    "$ref": "FetchSystemMetricsRequest"
                  },
                  "response": {
                    "$ref": "FetchSystemMetricsResponse"
                  },
                  "scopes": [
                    "https://www.googleapis.com/auth/cloud-platform"
                  ],
                  "description": "FetchSystemMetrics fetches the given system level metrics."
                }
              }
            },
            "virtualDbxAgent": {
              "methods": {
                "query": {
                  "id": "databaseinsights.projects.locations.virtualDbxAgent.query",
                  "path": "v1beta/{+parent}/virtualDbxAgent:query",
                  "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/virtualDbxAgent:query",
                  "httpMethod": "POST",
                  "parameters": {
                    "parent": {
                      "pattern": "^projects/[^/]+/locations/[^/]+$",
                      "location": "path",
                      "required": true,
                      "type": "string"
                    }
                  },
                  "parameterOrder": [
                    "parent"
                  ],
                  "request": {
                    "$ref": "RunAgentRequest"
                  },
                  "response": {
                    "$ref": "RunAgentResponse"
                  },
                  "scopes": [
                    "https://www.googleapis.com/auth/cloud-platform"
                  ],
                  "description": "RunAgent runs the agent."
                }
              }
            }
          }
        }
      }
    }
  },
  "protocol": "rest",
  "canonicalName": "Database Insights",
  "description": "Database Insights is a platform to monitor the performance of your cloud databases. It provides information on how well the database is running, finding query performance issues, execution plans, correlate between application level tags with queries as well integrated with OpenTelemetry to provide end to end trace.",
  "icons": {
    "x16": "http://www.google.com/images/icons/product/search-16.gif",
    "x32": "http://www.google.com/images/icons/product/search-32.gif"
  },
  "id": "databaseinsights:v1beta",
  "documentationLink": "https://cloud.google.com/alloydb/docs/query-insights-overview",
  "schemas": {
    "FetchQueryMetricsRequest": {
      "id": "FetchQueryMetricsRequest",
      "description": "The request of the FetchQueryMetrics RPC.",
      "type": "object",
      "properties": {
        "resource": {
          "description": "Required. The resource name used for query metrics. It is the project ID in this case.",
          "type": "string"
        },
        "promqlQuery": {
          "description": "Required. The promql_query to fetch the query metrics.",
          "type": "string"
        },
        "startTime": {
          "description": "Optional. The start_time of the metrics in RFC3339 format.",
          "type": "string"
        },
        "endTime": {
          "description": "Optional. The end_time of the metrics in RFC3339 format.",
          "type": "string"
        }
      }
    },
    "FetchQueryMetricsResponse": {
      "id": "FetchQueryMetricsResponse",
      "description": "The response of the FetchQueryMetrics RPC.",
      "type": "object",
      "properties": {
        "promqlResult": {
          "description": "The result of the fetch query metrics.",
          "type": "string"
        }
      }
    },
    "FetchSystemMetricsRequest": {
      "id": "FetchSystemMetricsRequest",
      "description": "The request of the FetchSystemMetrics RPC.",
      "type": "object",
      "properties": {
        "resource": {
          "description": "Required. The resource name used for system metrics. It is the project ID in this case.",
          "type": "string"
        },
        "promqlQuery": {
          "description": "Required. The promql_query to fetch the system metrics.",
          "type": "string"
        },
        "startTime": {
          "description": "Optional. The start_time of the metrics in RFC3339 format.",
          "type": "string"
        },
        "endTime": {
          "description": "Optional. The end_time of the metrics in RFC3339 format.",
          "type": "string"
        }
      }
    },
    "FetchSystemMetricsResponse": {
      "id": "FetchSystemMetricsResponse",
      "description": "The response of the FetchSystemMetrics RPC.",
      "type": "object",
      "properties": {
        "promqlResult": {
          "description": "The result of the fetch system metrics.",
          "type": "string"
        }
      }
    },
    "RunAgentRequest": {
      "id": "RunAgentRequest",
      "type": "object",
      "properties": {
        "userQuery": {
          "description": "Required. The user query to be used for the agent.",
          "type": "string"
        },
        "sessionId": {
          "description": "Required. The session id of the user query. This is used to identify the user query and the agent response.",
          "type": "string"
        },
        "projectId": {
          "description": "Optional. The project id of the database.",
          "type": "string"
        },
        "productType": {
          "description": "Optional. The product type of the database. This is a string representation of the product type",
          "type": "string"
        },
        "engineType": {
          "description": "Optional. The engine type of the database. This is a string representation of the engine type.",
          "type": "string"
        },
        "location": {
          "description": "Optional. The location of the database resource",
          "type": "string"
        },
        "databaseChatContext": {
          "description": "Optional. The database chat context to be used for database chat tools.",
          "$ref": "DatabaseChatContext"
        },
        "additionalContext": {
          "description": "Optional. The additional context to be used for the agent.",
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "agentOptions": {
          "description": "Optional. The options for processing the request on the agent.",
          "$ref": "AgentOptions"
        }
      }
    },
    "DatabaseChatContext": {
      "id": "DatabaseChatContext",
      "type": "object",
      "properties": {
        "taskCompletionRequest": {
          "description": "The task completion request to be used for the database chat.",
          "$ref": "TaskCompletionRequest"
        }
      }
    },
    "TaskCompletionRequest": {
      "id": "TaskCompletionRequest",
      "description": "Input for task completion.",
      "type": "object",
      "properties": {
        "instance": {
          "description": "Required. The full name of the Instance resource for this generation request. Format: `projects/{project}/locations/{location}/instances/{instance}` Use the special 'default' name to refer to the default instance.",
          "type": "string"
        },
        "messageId": {
          "description": "Optional. An ID for this TaskCompletionRequest, used for persistence and for correlating it with the TaskCompletionResponse received from the Agent (the response carries the id of the TaskCompletionRequests it consumed). - If the 'topic' field is set, a Message object wrapping this TaskCompletionRequest is created under the specified Topic and persisted with this ID (if it's not set, the ID will be generated server-side). The persisted Message objects in a Topic can be retrieved using the MessageService API. - If the 'topic' field is not set, this TaskCompletionRequest is not persisted and message_id is a no-op. To update a previously persisted message, set the 'topic' field and the 'message_id' field to the same value, while changing the contents. Only the last request to the Agent in the Topic can be updated. Updating the request will cause all its responses to be recreated.",
          "type": "string"
        },
        "topic": {
          "description": "Optional. The topic to file this message under. Format: projects/*/locations/*/topics/{topic_id} Setting this field implies an intent to persist messages. The entire request fails if this field is set but the user doesn't have the IAM permissions to persist messages. The value of this field is ignored if the 'instance' resource associated with the API call does not have storage option set.",
          "type": "string"
        },
        "input": {
          "description": "Optional. Represents the raw input for inference. It will be modified as part of prompt engineering and other transforms before it is consumed by the LLM. Deprecated. Use `contents` field instead for multimodal input.",
          "$ref": "TaskCompletionInput"
        },
        "contents": {
          "description": "Optional. Content of the task completion/chat input. This field is used to replace the `input` field above. It is repeated because it can contain the history of the conversation. Most recent content is the last element of the list.",
          "type": "array",
          "items": {
            "$ref": "TaskCompletionContent"
          }
        },
        "experienceContext": {
          "description": "Duet product context -- required",
          "$ref": "ExperienceContext"
        },
        "inputDataContext": {
          "description": "Optional. Additional user content not captured in the `input` field above",
          "$ref": "InputDataContext"
        },
        "clientContext": {
          "description": "Optional. Client context (e.g. IDE name, version, etc)",
          "$ref": "ClientContext"
        },
        "backendResourcesContext": {
          "description": "Optional. The GCP resources that the code generation process needs to reference",
          "$ref": "BackendResourcesContext"
        }
      }
    },
    "TaskCompletionInput": {
      "id": "TaskCompletionInput",
      "description": "Natural language messages making up the task completion conversation.",
      "type": "object",
      "properties": {
        "preamble": {
          "description": "Optional. Preamble for the task completion conversation.",
          "type": "string"
        },
        "messages": {
          "description": "Optional. Last few messages of the conversation. The most recent message is the last element in the list.",
          "type": "array",
          "items": {
            "$ref": "TaskCompletionMessage"
          }
        }
      }
    },
    "TaskCompletionMessage": {
      "id": "TaskCompletionMessage",
      "description": "Represents a single message.",
      "type": "object",
      "properties": {
        "content": {
          "description": "Optional. Text content of the task completion/chat message.",
          "type": "string"
        },
        "author": {
          "description": "Optional. Author tag for the turn.",
          "type": "string"
        }
      }
    },
    "TaskCompletionContent": {
      "id": "TaskCompletionContent",
      "description": "Content of the task completion/chat input.",
      "type": "object",
      "properties": {
        "role": {
          "description": "Required. Either \"user\" or \"model\".",
          "type": "string"
        },
        "parts": {
          "description": "Required. The parts of the content.",
          "type": "array",
          "items": {
            "$ref": "Part"
          }
        }
      }
    },
    "Part": {
      "id": "Part",
      "description": "A part of the content.",
      "type": "object",
      "properties": {
        "text": {
          "description": "Optional. Text content.",
          "type": "string"
        },
        "inlineData": {
          "description": "Optional. Inline blob content.",
          "$ref": "Blob"
        }
      }
    },
    "Blob": {
      "id": "Blob",
      "description": "Content blob.",
      "type": "object",
      "properties": {
        "mimeType": {
          "description": "Required. The MIME type of the blob.",
          "type": "string"
        },
        "data": {
          "description": "Required. The raw bytes of the blob.",
          "type": "string",
          "format": "byte"
        }
      }
    },
    "ExperienceContext": {
      "id": "ExperienceContext",
      "description": "The specific Duet product and flow a request belongs to. E.g. Appsheet code generation (“/appsheet/generate”).",
      "type": "object",
      "properties": {
        "experience": {
          "description": "Required. The Duet experience that this request belongs to.",
          "type": "string"
        },
        "agent": {
          "description": "Optional. The Backend Agent to route this request to (if known).",
          "type": "string"
        },
        "task": {
          "description": "Optional. The backend Task(s) this request maps to (if known).",
          "type": "string"
        }
      }
    },
    "InputDataContext": {
      "id": "InputDataContext",
      "description": "Intended to hold customer content over and above what is present in the `input` field.",
      "type": "object",
      "properties": {
        "additionalContext": {
          "description": "Optional. Represents additional customer content over the `input` field.",
          "type": "object",
          "additionalProperties": {
            "type": "any",
            "description": "Properties of the object. Contains field @type with type URL."
          }
        }
      }
    },
    "ClientContext": {
      "id": "ClientContext",
      "description": "Represents context about the UI client. Must NOT contain customer content.",
      "type": "object",
      "properties": {
        "name": {
          "description": "Optional. Name of the Duet plugin/UI running in the client space",
          "type": "string"
        },
        "version": {
          "description": "Optional. Duet plugin/UI version",
          "type": "string"
        },
        "additionalContext": {
          "description": "Optional. Represents GCP product-specific UI/client context.",
          "type": "object",
          "additionalProperties": {
            "type": "any",
            "description": "Properties of the object. Contains field @type with type URL."
          }
        }
      }
    },
    "BackendResourcesContext": {
      "id": "BackendResourcesContext",
      "description": "Represents ids of resources that the operation needs to reference or target. E.g. for BigQuery SQL generation, this could reference the Dataset or Table names (go/backend-resources-context-eg).",
      "type": "object",
      "properties": {
        "fullResourceNames": {
          "description": "The full resource names (https://cloud.google.com/apis/design/resource_names) of the GCP resources that are referenced or relevant to the Duet query. For example, a BigQuery SQL generation in the context of a particular BigQuery table would set this to: `//bigquery.googleapis.com/bigquery/v2/projects/{projectId}/datasets/{datasetId}/tables/{tableId}`",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "additionalContext": {
          "description": "Optional. Represents GCP product-specific backend resources context.",
          "type": "object",
          "additionalProperties": {
            "type": "any",
            "description": "Properties of the object. Contains field @type with type URL."
          }
        }
      }
    },
    "AgentOptions": {
      "id": "AgentOptions",
      "description": "Options for processing the request on the agent.",
      "type": "object",
      "properties": {
        "visualizationDisabled": {
          "description": "Optional. If true, visualizations are disabled in the agent response.",
          "type": "boolean"
        }
      }
    },
    "RunAgentResponse": {
      "id": "RunAgentResponse",
      "type": "object",
      "properties": {
        "response": {
          "description": "The agent's response to the user query.",
          "type": "string"
        },
        "visualizations": {
          "description": "A list of visualizations generated by the agent.",
          "type": "array",
          "items": {
            "$ref": "Visualization"
          }
        },
        "sduiRequests": {
          "description": "Output only. The SDUI requests for UI widgets. The number of elements is limited to 100.",
          "readOnly": true,
          "type": "array",
          "items": {
            "$ref": "SduiRequest"
          }
        }
      }
    },
    "Visualization": {
      "id": "Visualization",
      "description": "Represents a visualization generated by the agent.",
      "type": "object",
      "properties": {
        "promqlQuery": {
          "description": "The PromQL query string for a PROMQL_QUERY type visualization. See: https://prometheus.io/docs/prometheus/latest/querying/basics/",
          "type": "string"
        },
        "summary": {
          "description": "A summary or description of the visualization.",
          "type": "string"
        },
        "visualizationType": {
          "description": "The type of the visualization.",
          "type": "string",
          "enumDescriptions": [
            "The default value. This value is unused.",
            "The visualization is a PromQL query."
          ],
          "enum": [
            "VISUALIZATION_TYPE_UNSPECIFIED",
            "PROMQL_QUERY"
          ]
        }
      }
    },
    "SduiRequest": {
      "id": "SduiRequest",
      "description": "Client-side request type for GetSdui. See go/cloud-sdui for more details.",
      "type": "object",
      "properties": {
        "componentId": {
          "description": "Required unique identifier for the SDUI component.",
          "type": "string"
        },
        "sduiService": {
          "description": "The name of the SduiService to send the request to.",
          "type": "string"
        },
        "payload": {
          "description": "Payload to the SDUI component.",
          "type": "object",
          "additionalProperties": {
            "type": "any",
            "description": "Properties of the object."
          }
        },
        "description": {
          "description": "The description of the SDUI component. To be used for LLM context.",
          "type": "string"
        }
      }
    }
  },
  "rootUrl": "https://databaseinsights.googleapis.com/",
  "version": "v1beta",
  "ownerDomain": "google.com",
  "batchPath": "batch",
  "ownerName": "Google",
  "basePath": "",
  "name": "databaseinsights",
  "title": "Database Insights API",
  "auth": {
    "oauth2": {
      "scopes": {
        "https://www.googleapis.com/auth/cloud-platform": {
          "description": "See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account."
        }
      }
    }
  },
  "discoveryVersion": "v1"
}
