blob: 1178a5c03acd2a3718487134ae4336012630d698 [file] [edit]
<html><body>
<style>
body, h1, h2, h3, div, span, p, pre, a {
margin: 0;
padding: 0;
border: 0;
font-weight: inherit;
font-style: inherit;
font-size: 100%;
font-family: inherit;
vertical-align: baseline;
}
body {
font-size: 13px;
padding: 1em;
}
h1 {
font-size: 26px;
margin-bottom: 1em;
}
h2 {
font-size: 24px;
margin-bottom: 1em;
}
h3 {
font-size: 20px;
margin-bottom: 1em;
margin-top: 1em;
}
pre, code {
line-height: 1.5;
font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
}
pre {
margin-top: 0.5em;
}
h1, h2, h3, p {
font-family: Arial, sans serif;
}
h1, h2, h3 {
border-bottom: solid #CCC 1px;
}
.toc_element {
margin-top: 0.5em;
}
.firstline {
margin-left: 2 em;
}
.method {
margin-top: 1em;
border: solid 1px #CCC;
padding: 1em;
background: #EEE;
}
.details {
font-weight: bold;
font-size: 14px;
}
</style>
<h1><a href="databasecenter_v1beta.html">Database Center API</a> . <a href="databasecenter_v1beta.projects.html">projects</a></h1>
<h2>Instance Methods</h2>
<p class="toc_element">
<code><a href="#aggregateQueryStats">aggregateQueryStats(parent, body=None, x__xgafv=None)</a></code></p>
<p class="firstline">AggregateQueryStats provides database resource query execution statistics.</p>
<p class="toc_element">
<code><a href="#aggregateQueryStats_next">aggregateQueryStats_next()</a></code></p>
<p class="firstline">Retrieves the next page of results.</p>
<p class="toc_element">
<code><a href="#close">close()</a></code></p>
<p class="firstline">Close httplib2 connections.</p>
<h3>Method Details</h3>
<div class="method">
<code class="details" id="aggregateQueryStats">aggregateQueryStats(parent, body=None, x__xgafv=None)</code>
<pre>AggregateQueryStats provides database resource query execution statistics.
Args:
parent: string, Required. Parent can be a project, a folder, or an organization. The search is limited to the resources within the `parent`. The allowed values are: * projects/{PROJECT_ID} (e.g., &quot;projects/foo-bar&quot;) * projects/{PROJECT_NUMBER} (e.g., &quot;projects/12345678&quot;) * folders/{FOLDER_NUMBER} (e.g., &quot;folders/1234567&quot;) * organizations/{ORGANIZATION_NUMBER} (e.g., &quot;organizations/123456&quot;) (required)
body: object, The request body.
The object takes the form of:
{ # AggregateQueryStatsRequest represents the input to the AggregateQueryStats method.
&quot;filter&quot;: &quot;A String&quot;, # Optional. The expression to filter resources. Supported fields are: `full_resource_name`, `resource_type`, `container`, `product.type`, `product.engine`, `product.version`, `location`, `labels`, `issues`, fields of availability_info, data_protection_info,&#x27;resource_name&#x27;, etc. The expression is a list of zero or more restrictions combined via logical operators `AND` and `OR`. When `AND` and `OR` are both used in the expression, parentheses must be appropriately used to group the combinations. Example: `location=&quot;us-east1&quot;` Example: `container=&quot;projects/123&quot; OR container=&quot;projects/456&quot;` Example: `(container=&quot;projects/123&quot; OR container=&quot;projects/456&quot;) AND location=&quot;us-east1&quot;` Additional specific fields for query stats are: `metric_window`, `query_hash`, `normalized_query`. Example: `metric_window=&quot;LAST_ONE_DAY&quot;` (Possible values for `metric_window` are: `LAST_ONE_DAY`, `LAST_ONE_WEEK`, `LAST_TWO_WEEKS`) Example: `query_hash=&quot;12345678&quot;` Example: `normalized_query=&quot;SELECT * FROM table&quot;`
&quot;orderBy&quot;: &quot;A String&quot;, # Optional. The expression to order the results by. Example: `order_by=&quot;execution_count&quot;` Example: `order_by=&quot;execution_count desc&quot;` Supported order by fields are `execution_count`, `rows_processed`, `total_cpu_time`, `avg_cpu_time`.
&quot;pageSize&quot;: 42, # Optional. If unspecified, at most 100 query stats will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.
&quot;pageToken&quot;: &quot;A String&quot;, # Optional. A page token, received from a previous `AggregateQueryStatsRequest` call. Provide this to retrieve the subsequent page. All parameters except page_token should match the parameters in the call that provided the page token.
}
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # The response message containing relevant query stats for database resources.
&quot;nextPageToken&quot;: &quot;A String&quot;, # A token that can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.
&quot;queryStats&quot;: [ # List of query stats where each group contains stats for resources having a particular combination of relevant query stats.
{ # QueryStatsInfo contains the aggregated and detailed query stats for a particular combination of relevant query stats for queries having same normalized query.
&quot;aggregatedQueryStats&quot;: { # QueryStats contains the stats for a particular combination of query_hash, query_string and resource_type. # Aggregated query stats for the resources for same normalized query.
&quot;inefficientQueryInfo&quot;: { # Metadata about inefficient query signal info for a database resource. # Information about inefficient query.
&quot;database&quot;: &quot;A String&quot;, # Name of the database where index is required. For example, &quot;db1&quot;, which is the name of the database present in the instance.
&quot;impactedQueriesCount&quot;: &quot;A String&quot;, # Count of queries to be impacted if index is applied
&quot;sqlIndexStatement&quot;: &quot;A String&quot;, # SQL statement of the index. Based on the ddl type, this will be either CREATE INDEX or DROP INDEX.
&quot;storageCostBytes&quot;: &quot;A String&quot;, # Cost of additional disk usage in bytes
&quot;table&quot;: &quot;A String&quot;, # Name of the table where index is required
},
&quot;normalizedQuery&quot;: &quot;A String&quot;, # The query string is normalized query without any PII data.
&quot;queryHash&quot;: &quot;A String&quot;, # The query hash of the query.
&quot;queryMetrics&quot;: { # QueryMetrics contains the metrics related to the query execution. # Metrics related to the query performance.
&quot;avgCpuTime&quot;: &quot;A String&quot;, # The average execution period of the query across all runs.
&quot;executionCount&quot;: &quot;A String&quot;, # The number of times the query was executed.
&quot;metricsWindow&quot;: &quot;A String&quot;, # The window over which the metrics are aggregated.
&quot;rowsProcessed&quot;: &quot;A String&quot;, # The average number of rows processed by the query across all runs.
&quot;totalCpuTime&quot;: &quot;A String&quot;, # The total CPU time consumed by the query across all runs.
},
&quot;resourceIds&quot;: [ # The resource ids for which the query stats are collected.
{ # ResourceId contains the identifier for a database resource, including the full resource name, resource type, and product.
&quot;fullResourceName&quot;: &quot;A String&quot;, # The full resource name of the resource.
&quot;product&quot;: { # Product specification for databasecenter resources. # The product of the resource, including the type, engine, and version.
&quot;engine&quot;: &quot;A String&quot;, # Optional. The specific engine that the underlying database is running.
&quot;minorVersion&quot;: &quot;A String&quot;, # Optional. Minor version of the underlying database engine. Example values: For MySQL, it could be &quot;8.0.35&quot;, &quot;5.7.25&quot; etc. For PostgreSQL, it could be &quot;14.4&quot;, &quot;15.5&quot; etc.
&quot;type&quot;: &quot;A String&quot;, # Optional. Type of specific database product. It could be CloudSQL, AlloyDB etc..
&quot;version&quot;: &quot;A String&quot;, # Optional. Version of the underlying database engine. Example values: For MySQL, it could be &quot;8.0&quot;, &quot;5.7&quot; etc. For Postgres, it could be &quot;14&quot;, &quot;15&quot; etc.
},
&quot;resourceType&quot;: &quot;A String&quot;, # The type of the resource. sqladmin.googleapis.com/Instance alloydb.googleapis.com/Cluster alloydb.googleapis.com/Instance
},
],
&quot;resourceType&quot;: &quot;A String&quot;, # The type of the resource. sqladmin.googleapis.com/Instance alloydb.googleapis.com/Cluster alloydb.googleapis.com/Instance
},
&quot;queryStats&quot;: [ # List of query stats for the resources in the group. This stats is stats at resource level for the resources having same normalized query.
{ # QueryStats contains the stats for a particular combination of query_hash, query_string and resource_type.
&quot;inefficientQueryInfo&quot;: { # Metadata about inefficient query signal info for a database resource. # Information about inefficient query.
&quot;database&quot;: &quot;A String&quot;, # Name of the database where index is required. For example, &quot;db1&quot;, which is the name of the database present in the instance.
&quot;impactedQueriesCount&quot;: &quot;A String&quot;, # Count of queries to be impacted if index is applied
&quot;sqlIndexStatement&quot;: &quot;A String&quot;, # SQL statement of the index. Based on the ddl type, this will be either CREATE INDEX or DROP INDEX.
&quot;storageCostBytes&quot;: &quot;A String&quot;, # Cost of additional disk usage in bytes
&quot;table&quot;: &quot;A String&quot;, # Name of the table where index is required
},
&quot;normalizedQuery&quot;: &quot;A String&quot;, # The query string is normalized query without any PII data.
&quot;queryHash&quot;: &quot;A String&quot;, # The query hash of the query.
&quot;queryMetrics&quot;: { # QueryMetrics contains the metrics related to the query execution. # Metrics related to the query performance.
&quot;avgCpuTime&quot;: &quot;A String&quot;, # The average execution period of the query across all runs.
&quot;executionCount&quot;: &quot;A String&quot;, # The number of times the query was executed.
&quot;metricsWindow&quot;: &quot;A String&quot;, # The window over which the metrics are aggregated.
&quot;rowsProcessed&quot;: &quot;A String&quot;, # The average number of rows processed by the query across all runs.
&quot;totalCpuTime&quot;: &quot;A String&quot;, # The total CPU time consumed by the query across all runs.
},
&quot;resourceIds&quot;: [ # The resource ids for which the query stats are collected.
{ # ResourceId contains the identifier for a database resource, including the full resource name, resource type, and product.
&quot;fullResourceName&quot;: &quot;A String&quot;, # The full resource name of the resource.
&quot;product&quot;: { # Product specification for databasecenter resources. # The product of the resource, including the type, engine, and version.
&quot;engine&quot;: &quot;A String&quot;, # Optional. The specific engine that the underlying database is running.
&quot;minorVersion&quot;: &quot;A String&quot;, # Optional. Minor version of the underlying database engine. Example values: For MySQL, it could be &quot;8.0.35&quot;, &quot;5.7.25&quot; etc. For PostgreSQL, it could be &quot;14.4&quot;, &quot;15.5&quot; etc.
&quot;type&quot;: &quot;A String&quot;, # Optional. Type of specific database product. It could be CloudSQL, AlloyDB etc..
&quot;version&quot;: &quot;A String&quot;, # Optional. Version of the underlying database engine. Example values: For MySQL, it could be &quot;8.0&quot;, &quot;5.7&quot; etc. For Postgres, it could be &quot;14&quot;, &quot;15&quot; etc.
},
&quot;resourceType&quot;: &quot;A String&quot;, # The type of the resource. sqladmin.googleapis.com/Instance alloydb.googleapis.com/Cluster alloydb.googleapis.com/Instance
},
],
&quot;resourceType&quot;: &quot;A String&quot;, # The type of the resource. sqladmin.googleapis.com/Instance alloydb.googleapis.com/Cluster alloydb.googleapis.com/Instance
},
],
},
],
&quot;unreachable&quot;: [ # Unordered list. List of unreachable regions from where data could not be retrieved.
&quot;A String&quot;,
],
}</pre>
</div>
<div class="method">
<code class="details" id="aggregateQueryStats_next">aggregateQueryStats_next()</code>
<pre>Retrieves the next page of results.
Args:
previous_request: The request for the previous page. (required)
previous_response: The response from the request for the previous page. (required)
Returns:
A request object that you can call &#x27;execute()&#x27; on to request the next
page. Returns None if there are no more items in the collection.
</pre>
</div>
<div class="method">
<code class="details" id="close">close()</code>
<pre>Close httplib2 connections.</pre>
</div>
</body></html>