Renamed query function - added 'Azure'

pull/53059/head
yaellec 3 years ago
parent 515673809e
commit a046bcdd7c
  1. 20
      docs/sources/datasources/azuremonitor/template-variables.md
  2. 1
      public/app/plugins/datasource/grafana-azure-monitor-datasource/components/VariableEditor/VariableEditor.test.tsx
  3. 2
      public/app/plugins/datasource/grafana-azure-monitor-datasource/components/VariableEditor/VariableEditor.tsx

@ -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

Loading…
Cancel
Save