mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Renamed query function - added 'Azure'
This commit is contained in:
@@ -25,16 +25,16 @@ types of template variables.
|
|||||||
|
|
||||||
The Azure Monitor data source provides the following queries you can specify in the Query field in the Variable edit view
|
The Azure Monitor data source provides the following queries you can specify in the Query field in the Variable edit view
|
||||||
|
|
||||||
| Name | Description |
|
| Name | Description |
|
||||||
| --------------- | -------------------------------------------------------------------------------------------- |
|
| -------------------- | -------------------------------------------------------------------------------------------- |
|
||||||
| Subscriptions | Returns subscriptions. |
|
| Subscriptions | Returns subscriptions. |
|
||||||
| Resource Groups | Returns resource groups for a specified subscription. |
|
| Resource Groups | Returns resource groups for a specified subscription. |
|
||||||
| Namespaces | Returns metric namespaces for the specified subscription and resource group. |
|
| Namespaces | Returns metric namespaces for the specified subscription and resource group. |
|
||||||
| Resource Names | Returns a list of resource names for a specified subscription, resource group and namespace. |
|
| Resource Names | Returns a list of resource names for a specified subscription, resource group and namespace. |
|
||||||
| Metric Names | Returns a list of metric names for a resource. |
|
| Metric Names | Returns a list of metric names for a resource. |
|
||||||
| Workspaces | Returns a list of workspaces for the specified subscription. |
|
| Workspaces | Returns a list of workspaces for the specified subscription. |
|
||||||
| Logs | Use a KQL query to return values. |
|
| Logs | Use a KQL query to return values. |
|
||||||
| Resource Graph | Use an ARG query to return values. |
|
| Azure Resource Graph | Use an ARG query to return values. |
|
||||||
|
|
||||||
Any Log Analytics KQL query that returns a single list of values can also be used in the Query field. For example:
|
Any Log Analytics KQL query that returns a single list of values can also be used in the Query field. For example:
|
||||||
|
|
||||||
|
|||||||
@@ -104,6 +104,7 @@ describe('VariableEditor:', () => {
|
|||||||
render(<VariableEditor {...ARGqueryProps()} />);
|
render(<VariableEditor {...ARGqueryProps()} />);
|
||||||
await waitFor(() => screen.queryByTestId('mockeditor'));
|
await waitFor(() => screen.queryByTestId('mockeditor'));
|
||||||
expect(screen.queryByLabelText('Subscriptions')).toBeInTheDocument();
|
expect(screen.queryByLabelText('Subscriptions')).toBeInTheDocument();
|
||||||
|
expect(screen.queryByText('Azure Resource Graph')).toBeInTheDocument();
|
||||||
expect(screen.queryByLabelText('Select subscription')).not.toBeInTheDocument();
|
expect(screen.queryByLabelText('Select subscription')).not.toBeInTheDocument();
|
||||||
expect(screen.queryByLabelText('Select query type')).not.toBeInTheDocument();
|
expect(screen.queryByLabelText('Select query type')).not.toBeInTheDocument();
|
||||||
expect(screen.queryByLabelText('Select resource group')).not.toBeInTheDocument();
|
expect(screen.queryByLabelText('Select resource group')).not.toBeInTheDocument();
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ const VariableEditor = (props: Props) => {
|
|||||||
{ label: 'Metric Names', value: AzureQueryType.MetricNamesQuery },
|
{ label: 'Metric Names', value: AzureQueryType.MetricNamesQuery },
|
||||||
{ label: 'Workspaces', value: AzureQueryType.WorkspacesQuery },
|
{ label: 'Workspaces', value: AzureQueryType.WorkspacesQuery },
|
||||||
{ label: 'Logs', value: AzureQueryType.LogAnalytics },
|
{ label: 'Logs', value: AzureQueryType.LogAnalytics },
|
||||||
{ label: 'Resource Graph', value: AzureQueryType.AzureResourceGraph },
|
{ label: 'Azure Resource Graph', value: AzureQueryType.AzureResourceGraph },
|
||||||
];
|
];
|
||||||
if (typeof props.query === 'object' && props.query.queryType === AzureQueryType.GrafanaTemplateVariableFn) {
|
if (typeof props.query === 'object' && props.query.queryType === AzureQueryType.GrafanaTemplateVariableFn) {
|
||||||
// Add the option for the GrafanaTemplateVariableFn only if it's already in use
|
// Add the option for the GrafanaTemplateVariableFn only if it's already in use
|
||||||
|
|||||||
Reference in New Issue
Block a user