{
  "name": "databaseinsights",
  "title": "Database Insights API",
  "servicePath": "",
  "revision": "20260721",
  "version_module": true,
  "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."
        }
      }
    }
  },
  "fullyEncodeReservedExpansion": true,
  "discoveryVersion": "v1",
  "resources": {
    "projects": {
      "resources": {
        "locations": {
          "resources": {
            "virtualDbxAgent": {
              "methods": {
                "query": {
                  "id": "databaseinsights.projects.locations.virtualDbxAgent.query",
                  "path": "v1beta/{+parent}/virtualDbxAgent:query",
                  "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/virtualDbxAgent:query",
                  "request": {
                    "$ref": "RunAgentRequest"
                  },
                  "scopes": [
                    "https://www.googleapis.com/auth/cloud-platform"
                  ],
                  "parameters": {
                    "parent": {
                      "location": "path",
                      "type": "string",
                      "pattern": "^projects/[^/]+/locations/[^/]+$",
                      "required": true
                    }
                  },
                  "httpMethod": "POST",
                  "description": "RunAgent runs the agent.",
                  "parameterOrder": [
                    "parent"
                  ],
                  "response": {
                    "$ref": "RunAgentResponse"
                  }
                }
              }
            },
            "queryMetrics": {
              "methods": {
                "fetch": {
                  "parameterOrder": [
                    "parent"
                  ],
                  "response": {
                    "$ref": "FetchQueryMetricsResponse"
                  },
                  "parameters": {
                    "parent": {
                      "required": true,
                      "type": "string",
                      "pattern": "^projects/[^/]+/locations/[^/]+$",
                      "description": "Required. The name of the location where we request metrics. Format: `projects/{project}/locations/{location}`",
                      "location": "path"
                    }
                  },
                  "httpMethod": "POST",
                  "description": "FetchQueryMetrics fetches the given database query level metrics.",
                  "id": "databaseinsights.projects.locations.queryMetrics.fetch",
                  "path": "v1beta/{+parent}/queryMetrics:fetch",
                  "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/queryMetrics:fetch",
                  "request": {
                    "$ref": "FetchQueryMetricsRequest"
                  },
                  "scopes": [
                    "https://www.googleapis.com/auth/cloud-platform"
                  ]
                }
              }
            },
            "systemMetrics": {
              "methods": {
                "fetch": {
                  "scopes": [
                    "https://www.googleapis.com/auth/cloud-platform"
                  ],
                  "id": "databaseinsights.projects.locations.systemMetrics.fetch",
                  "path": "v1beta/{+parent}/systemMetrics:fetch",
                  "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/systemMetrics:fetch",
                  "request": {
                    "$ref": "FetchSystemMetricsRequest"
                  },
                  "description": "FetchSystemMetrics fetches the given system level metrics.",
                  "parameters": {
                    "parent": {
                      "type": "string",
                      "required": true,
                      "description": "Required. The name of the location where we request metrics. Format: `projects/{project}/locations/{location}`",
                      "location": "path",
                      "pattern": "^projects/[^/]+/locations/[^/]+$"
                    }
                  },
                  "httpMethod": "POST",
                  "response": {
                    "$ref": "FetchSystemMetricsResponse"
                  },
                  "parameterOrder": [
                    "parent"
                  ]
                }
              }
            }
          }
        }
      }
    }
  },
  "parameters": {
    "access_token": {
      "type": "string",
      "description": "OAuth access token.",
      "location": "query"
    },
    "callback": {
      "type": "string",
      "description": "JSONP",
      "location": "query"
    },
    "prettyPrint": {
      "type": "boolean",
      "description": "Returns response with indentations and line breaks.",
      "default": "true",
      "location": "query"
    },
    "fields": {
      "type": "string",
      "description": "Selector specifying which fields to include in a partial response.",
      "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"
    },
    "uploadType": {
      "type": "string",
      "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").",
      "location": "query"
    },
    "oauth_token": {
      "type": "string",
      "description": "OAuth 2.0 token for the current user.",
      "location": "query"
    },
    "alt": {
      "description": "Data format for response.",
      "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",
      "type": "string",
      "default": "json"
    },
    "upload_protocol": {
      "type": "string",
      "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").",
      "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"
    },
    "$.xgafv": {
      "type": "string",
      "description": "V1 error format.",
      "enum": [
        "1",
        "2"
      ],
      "enumDescriptions": [
        "v1 error format",
        "v2 error format"
      ],
      "location": "query"
    }
  },
  "basePath": "",
  "protocol": "rest",
  "batchPath": "batch",
  "version": "v1beta",
  "rootUrl": "https://databaseinsights.googleapis.com/",
  "canonicalName": "Database Insights",
  "description": "Database Insights API is a regional service that provides deep performance diagnostics and monitoring for Google Cloud databases. It exposes tools like Query insights, which helps you detect, diagnose, and prevent query performance problems, and System insights, which provides comprehensive telemetry and monitoring for system-level instance metrics.",
  "schemas": {
    "DatabaseChatContext": {
      "properties": {
        "taskCompletionRequest": {
          "description": "The task completion request to be used for the database chat.",
          "$ref": "TaskCompletionRequest"
        }
      },
      "id": "DatabaseChatContext",
      "type": "object"
    },
    "FetchQueryMetricsRequest": {
      "id": "FetchQueryMetricsRequest",
      "properties": {
        "resource": {
          "description": "Required. The resource name used for query metrics. It is the project ID in this case.",
          "type": "string"
        },
        "endTime": {
          "description": "Optional. The end_time of the metrics in RFC3339 format.",
          "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"
        }
      },
      "description": "The request of the FetchQueryMetrics RPC.",
      "type": "object"
    },
    "FetchSystemMetricsResponse": {
      "properties": {
        "promqlResult": {
          "description": "The result of the fetch system metrics.",
          "type": "string"
        }
      },
      "id": "FetchSystemMetricsResponse",
      "description": "The response of the FetchSystemMetrics RPC.",
      "type": "object"
    },
    "FetchSystemMetricsRequest": {
      "properties": {
        "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"
        },
        "resource": {
          "description": "Required. The resource name used for system metrics. It is the project ID in this case.",
          "type": "string"
        },
        "endTime": {
          "description": "Optional. The end_time of the metrics in RFC3339 format.",
          "type": "string"
        }
      },
      "id": "FetchSystemMetricsRequest",
      "description": "The request of the FetchSystemMetrics RPC.",
      "type": "object"
    },
    "Part": {
      "description": "A part of the content.",
      "type": "object",
      "id": "Part",
      "properties": {
        "text": {
          "description": "Optional. Text content.",
          "type": "string"
        },
        "inlineData": {
          "$ref": "Blob",
          "description": "Optional. Inline blob content."
        }
      }
    },
    "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"
        }
      },
      "id": "AgentOptions"
    },
    "RunAgentRequest": {
      "properties": {
        "sessionId": {
          "description": "Required. The session id of the user query. This is used to identify the user query and the agent response.",
          "type": "string"
        },
        "databaseChatContext": {
          "description": "Optional. The database chat context to be used for database chat tools.",
          "$ref": "DatabaseChatContext"
        },
        "location": {
          "description": "Optional. The location of the database resource",
          "type": "string"
        },
        "userQuery": {
          "description": "Required. The user query to be used for the agent.",
          "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"
        },
        "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"
        },
        "engineType": {
          "description": "Optional. The engine type of the database. This is a string representation of the engine type.",
          "type": "string"
        }
      },
      "id": "RunAgentRequest",
      "type": "object"
    },
    "TaskCompletionInput": {
      "id": "TaskCompletionInput",
      "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"
          }
        }
      },
      "description": "Natural language messages making up the task completion conversation.",
      "type": "object"
    },
    "FetchQueryMetricsResponse": {
      "id": "FetchQueryMetricsResponse",
      "properties": {
        "promqlResult": {
          "description": "The result of the fetch query metrics.",
          "type": "string"
        }
      },
      "description": "The response of the FetchQueryMetrics RPC.",
      "type": "object"
    },
    "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"
        }
      },
      "id": "Blob"
    },
    "InputDataContext": {
      "description": "Intended to hold customer content over and above what is present in the `input` field.",
      "type": "object",
      "id": "InputDataContext",
      "properties": {
        "additionalContext": {
          "additionalProperties": {
            "type": "any",
            "description": "Properties of the object. Contains field @type with type URL."
          },
          "description": "Optional. Represents additional customer content over the `input` field.",
          "type": "object"
        }
      }
    },
    "Visualization": {
      "description": "Represents a visualization generated by the agent.",
      "type": "object",
      "id": "Visualization",
      "properties": {
        "summary": {
          "description": "A summary or description of the visualization.",
          "type": "string"
        },
        "promqlQuery": {
          "description": "The PromQL query string for a PROMQL_QUERY type visualization. See: https://prometheus.io/docs/prometheus/latest/querying/basics/",
          "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"
          ]
        }
      }
    },
    "TaskCompletionRequest": {
      "properties": {
        "inputDataContext": {
          "description": "Optional. Additional user content not captured in the `input` field above",
          "$ref": "InputDataContext"
        },
        "clientContext": {
          "$ref": "ClientContext",
          "description": "Optional. Client context (e.g. IDE name, version, etc)"
        },
        "contents": {
          "items": {
            "$ref": "TaskCompletionContent"
          },
          "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"
        },
        "experienceContext": {
          "description": "Duet product context -- required",
          "$ref": "ExperienceContext"
        },
        "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"
        },
        "backendResourcesContext": {
          "$ref": "BackendResourcesContext",
          "description": "Optional. The GCP resources that the code generation process needs to reference"
        },
        "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"
        },
        "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"
        },
        "input": {
          "$ref": "TaskCompletionInput",
          "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."
        }
      },
      "id": "TaskCompletionRequest",
      "description": "Input for task completion.",
      "type": "object"
    },
    "SduiRequest": {
      "description": "Client-side request type for GetSdui. See go/cloud-sdui for more details.",
      "type": "object",
      "id": "SduiRequest",
      "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"
        },
        "description": {
          "description": "The description of the SDUI component. To be used for LLM context.",
          "type": "string"
        },
        "payload": {
          "additionalProperties": {
            "type": "any",
            "description": "Properties of the object."
          },
          "description": "Payload to the SDUI component.",
          "type": "object"
        }
      }
    },
    "ExperienceContext": {
      "description": "The specific Duet product and flow a request belongs to. E.g. Appsheet code generation (“/appsheet/generate”).",
      "type": "object",
      "properties": {
        "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"
        },
        "experience": {
          "description": "Required. The Duet experience that this request belongs to.",
          "type": "string"
        }
      },
      "id": "ExperienceContext"
    },
    "TaskCompletionMessage": {
      "id": "TaskCompletionMessage",
      "properties": {
        "content": {
          "description": "Optional. Text content of the task completion/chat message.",
          "type": "string"
        },
        "author": {
          "description": "Optional. Author tag for the turn.",
          "type": "string"
        }
      },
      "description": "Represents a single message.",
      "type": "object"
    },
    "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."
          }
        }
      },
      "id": "ClientContext"
    },
    "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",
      "id": "BackendResourcesContext",
      "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": {
          "additionalProperties": {
            "type": "any",
            "description": "Properties of the object. Contains field @type with type URL."
          },
          "description": "Optional. Represents GCP product-specific backend resources context.",
          "type": "object"
        }
      }
    },
    "RunAgentResponse": {
      "type": "object",
      "id": "RunAgentResponse",
      "properties": {
        "visualizations": {
          "items": {
            "$ref": "Visualization"
          },
          "description": "A list of visualizations generated by the agent.",
          "type": "array"
        },
        "response": {
          "description": "The agent's response to the user query.",
          "type": "string"
        },
        "sduiRequests": {
          "readOnly": true,
          "items": {
            "$ref": "SduiRequest"
          },
          "description": "Output only. The SDUI requests for UI widgets. The number of elements is limited to 100.",
          "type": "array"
        }
      }
    },
    "TaskCompletionContent": {
      "id": "TaskCompletionContent",
      "properties": {
        "role": {
          "description": "Required. Either \"user\" or \"model\".",
          "type": "string"
        },
        "parts": {
          "items": {
            "$ref": "Part"
          },
          "description": "Required. The parts of the content.",
          "type": "array"
        }
      },
      "description": "Content of the task completion/chat input.",
      "type": "object"
    }
  },
  "ownerDomain": "google.com",
  "baseUrl": "https://databaseinsights.googleapis.com/",
  "mtlsRootUrl": "https://databaseinsights.mtls.googleapis.com/",
  "ownerName": "Google",
  "icons": {
    "x16": "http://www.google.com/images/icons/product/search-16.gif",
    "x32": "http://www.google.com/images/icons/product/search-32.gif"
  },
  "documentationLink": "https://cloud.google.com/alloydb/docs/query-insights-overview",
  "kind": "discovery#restDescription",
  "id": "databaseinsights:v1beta"
}
