operationalinsights

package
v32.1.1-0...-eb4c4ab Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 15, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package operationalinsights implements the Azure ARM Operationalinsights service API version v1.

Log Analytics Data Plane Client

Index

Constants

View Source
const (
	// DefaultBaseURI is the default URI used for the service Operationalinsights
	DefaultBaseURI = "https://api.loganalytics.io/v1"
)

Variables

This section is empty.

Functions

func UserAgent

func UserAgent() string

UserAgent returns the UserAgent string to use when sending http.Requests.

func Version

func Version() string

Version returns the semantic version (see http://semver.org) of the client.

Types

type BaseClient

type BaseClient struct {
	autorest.Client
	BaseURI string
}

BaseClient is the base client for Operationalinsights.

func New

func New() BaseClient

New creates an instance of the BaseClient client.

func NewWithBaseURI

func NewWithBaseURI(baseURI string) BaseClient

NewWithBaseURI creates an instance of the BaseClient client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).

type Column

type Column struct {
	// Name - The name of this column.
	Name *string `json:"name,omitempty"`
	// Type - The data type of this column.
	Type *string `json:"type,omitempty"`
}

Column a column in a table.

type ErrorDetail

type ErrorDetail struct {
	// Code - The error's code.
	Code *string `json:"code,omitempty"`
	// Message - A human readable error message.
	Message *string `json:"message,omitempty"`
	// Target - Indicates which property in the request is responsible for the error.
	Target *string `json:"target,omitempty"`
	// Value - Indicates which value in 'target' is responsible for the error.
	Value *string `json:"value,omitempty"`
	// Resources - Indicates resources which were responsible for the error.
	Resources *[]string `json:"resources,omitempty"`
	// AdditionalProperties - Additional properties that can be provided on the error details object
	AdditionalProperties interface{} `json:"additionalProperties,omitempty"`
}

ErrorDetail ...

type ErrorInfo

type ErrorInfo struct {
	// Code - A machine readable error code.
	Code *string `json:"code,omitempty"`
	// Message - A human readable error message.
	Message *string `json:"message,omitempty"`
	// Details - error details.
	Details *[]ErrorDetail `json:"details,omitempty"`
	// Innererror - Inner error details if they exist.
	Innererror *ErrorInfo `json:"innererror,omitempty"`
	// AdditionalProperties - Additional properties that can be provided on the error info object
	AdditionalProperties interface{} `json:"additionalProperties,omitempty"`
}

ErrorInfo ...

type ErrorResponse

type ErrorResponse struct {
	// Error - The error details.
	Error *ErrorInfo `json:"error,omitempty"`
}

ErrorResponse contains details when the response code indicates an error.

type MetadataApplication

type MetadataApplication struct {
	// ID - The ID of the Application Insights app.
	ID *string `json:"id,omitempty"`
	// ResourceID - The ARM resource ID of the Application Insights app.
	ResourceID *string `json:"resourceId,omitempty"`
	// Name - The name of the Application Insights app.
	Name *string `json:"name,omitempty"`
	// Region - The Azure region of the Application Insights app.
	Region *string `json:"region,omitempty"`
	// Related - The related metadata items for the Application Insights app.
	Related *MetadataApplicationRelated `json:"related,omitempty"`
}

MetadataApplication application Insights apps that were part of the metadata request and that the user has access to.

type MetadataApplicationRelated

type MetadataApplicationRelated struct {
	// Tables - The related tables for the Application Insights app.
	Tables *[]string `json:"tables,omitempty"`
	// Functions - The related functions for the Application Insights app.
	Functions *[]string `json:"functions,omitempty"`
}

MetadataApplicationRelated the related metadata items for the Application Insights app.

type MetadataCategory

type MetadataCategory struct {
	// ID - The ID of the category
	ID *string `json:"id,omitempty"`
	// DisplayName - The display name of the category
	DisplayName *string `json:"displayName,omitempty"`
	// Description - The description of the category
	Description *string `json:"description,omitempty"`
	// Related - The related metadata items for the category
	Related *MetadataCategoryRelated `json:"related,omitempty"`
}

MetadataCategory categories are used to group other metadata entities.

type MetadataCategoryRelated

type MetadataCategoryRelated struct {
	// Tables - The tables related to the category
	Tables *[]string `json:"tables,omitempty"`
	// Functions - The functions related to the category
	Functions *[]string `json:"functions,omitempty"`
	// ResourceTypes - The resource types related to the category
	ResourceTypes *[]string `json:"resourceTypes,omitempty"`
	// Queries - The saved queries related to the category
	Queries *[]string `json:"queries,omitempty"`
	// Solutions - The Log Analytics solutions related to the category
	Solutions *[]string `json:"solutions,omitempty"`
}

MetadataCategoryRelated the related metadata items for the category

type MetadataClient

type MetadataClient struct {
	BaseClient
}

MetadataClient is the log Analytics Data Plane Client

func NewMetadataClient

func NewMetadataClient() MetadataClient

NewMetadataClient creates an instance of the MetadataClient client.

func NewMetadataClientWithBaseURI

func NewMetadataClientWithBaseURI(baseURI string) MetadataClient

NewMetadataClientWithBaseURI creates an instance of the MetadataClient client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).

func (MetadataClient) Get

func (client MetadataClient) Get(ctx context.Context, workspaceID string) (result MetadataResults, err error)

Get retrieve the metadata information for the workspace, including its schema, functions, workspace info, categories etc. Parameters: workspaceID - ID of the workspace. This is Workspace ID from the Properties blade in the Azure portal.

func (MetadataClient) GetPreparer

func (client MetadataClient) GetPreparer(ctx context.Context, workspaceID string) (*http.Request, error)

GetPreparer prepares the Get request.

func (MetadataClient) GetResponder

func (client MetadataClient) GetResponder(resp *http.Response) (result MetadataResults, err error)

GetResponder handles the response to the Get request. The method always closes the http.Response Body.

func (MetadataClient) GetSender

func (client MetadataClient) GetSender(req *http.Request) (*http.Response, error)

GetSender sends the Get request. The method will close the http.Response Body if it receives an error.

func (MetadataClient) Post

func (client MetadataClient) Post(ctx context.Context, workspaceID string) (result MetadataResults, err error)

Post retrieve the metadata information for the workspace, including its schema, functions, workspace info, categories etc. Parameters: workspaceID - ID of the workspace. This is Workspace ID from the Properties blade in the Azure portal.

func (MetadataClient) PostPreparer

func (client MetadataClient) PostPreparer(ctx context.Context, workspaceID string) (*http.Request, error)

PostPreparer prepares the Post request.

func (MetadataClient) PostResponder

func (client MetadataClient) PostResponder(resp *http.Response) (result MetadataResults, err error)

PostResponder handles the response to the Post request. The method always closes the http.Response Body.

func (MetadataClient) PostSender

func (client MetadataClient) PostSender(req *http.Request) (*http.Response, error)

PostSender sends the Post request. The method will close the http.Response Body if it receives an error.

type MetadataColumnDataType

type MetadataColumnDataType string

MetadataColumnDataType enumerates the values for metadata column data type.

const (
	// Bool ...
	Bool MetadataColumnDataType = "bool"
	// Datetime ...
	Datetime MetadataColumnDataType = "datetime"
	// Dynamic ...
	Dynamic MetadataColumnDataType = "dynamic"
	// Int ...
	Int MetadataColumnDataType = "int"
	// Long ...
	Long MetadataColumnDataType = "long"
	// Real ...
	Real MetadataColumnDataType = "real"
	// String ...
	String MetadataColumnDataType = "string"
)

func PossibleMetadataColumnDataTypeValues

func PossibleMetadataColumnDataTypeValues() []MetadataColumnDataType

PossibleMetadataColumnDataTypeValues returns an array of possible values for the MetadataColumnDataType const type.

type MetadataFunction

type MetadataFunction struct {
	// ID - The ID of the function.
	ID *string `json:"id,omitempty"`
	// Name - The name of the function, to be used in queries.
	Name *string `json:"name,omitempty"`
	// Parameters - The parameters/arguments of the function, if any.
	Parameters *string `json:"parameters,omitempty"`
	// DisplayName - The display name of the function.
	DisplayName *string `json:"displayName,omitempty"`
	// Description - The description of the function.
	Description *string `json:"description,omitempty"`
	// Body - The KQL body of the function.
	Body *string `json:"body,omitempty"`
	// Tags - The tags associated with the function.
	Tags interface{} `json:"tags,omitempty"`
	// Properties - The properties of the function.
	Properties interface{} `json:"properties,omitempty"`
	// Related - The related metadata items for the function.
	Related *MetadataFunctionRelated `json:"related,omitempty"`
}

MetadataFunction functions are stored Kusto queries that can be specified as part of queries by using their name.

type MetadataFunctionRelated

type MetadataFunctionRelated struct {
	// Tables - The related tables for the function.
	Tables *[]string `json:"tables,omitempty"`
	// Solutions - The related Log Analytics solutions for the function.
	Solutions *[]string `json:"solutions,omitempty"`
	// ResourceTypes - The related resource types for the function.
	ResourceTypes *[]string `json:"resourceTypes,omitempty"`
	// Categories - The related categories for the function.
	Categories *[]string `json:"categories,omitempty"`
	// Workspaces - The related workspaces for the function.
	Workspaces *[]string `json:"workspaces,omitempty"`
}

MetadataFunctionRelated the related metadata items for the function.

type MetadataPermissions

type MetadataPermissions struct {
	// Workspaces - The permission indication for the workspaces on the metadata request.
	Workspaces *[]MetadataPermissionsWorkspacesItem `json:"workspaces,omitempty"`
	// Resources - The permission indication for the Azure resources on the metadata request.
	Resources *[]MetadataPermissionsResourcesItem `json:"resources,omitempty"`
	// Applications - The permission indication for the Application Insights apps on the metadata request.
	Applications *[]MetadataPermissionsApplicationsItem `json:"applications,omitempty"`
}

MetadataPermissions permission information for the metadata call, includes apps/workspaces/resource the user didn't have access to.

type MetadataPermissionsApplicationsItem

type MetadataPermissionsApplicationsItem struct {
	// ResourceID - The resource ID on the permission indication.
	ResourceID *string `json:"resourceId,omitempty"`
}

MetadataPermissionsApplicationsItem ...

type MetadataPermissionsResourcesItem

type MetadataPermissionsResourcesItem struct {
	// ResourceID - The resource ID on the permission indication.
	ResourceID *string `json:"resourceId,omitempty"`
	// DenyTables - The list of tables that were denied access for the resource ID.
	DenyTables *[]string `json:"denyTables,omitempty"`
}

MetadataPermissionsResourcesItem ...

type MetadataPermissionsWorkspacesItem

type MetadataPermissionsWorkspacesItem struct {
	// ResourceID - The resource ID on the permission indication.
	ResourceID *string `json:"resourceId,omitempty"`
	// DenyTables - The list of tables that were denied access for the resource ID.
	DenyTables *[]string `json:"denyTables,omitempty"`
}

MetadataPermissionsWorkspacesItem ...

type MetadataQuery

type MetadataQuery struct {
	// ID - The ID of the query.
	ID *string `json:"id,omitempty"`
	// DisplayName - The display name of the query.
	DisplayName *string `json:"displayName,omitempty"`
	// Description - The description of the query.
	Description *string `json:"description,omitempty"`
	// Body - The KQL body of the query.
	Body *string `json:"body,omitempty"`
	// Labels - The user defined labels associated with the query.
	Labels *[]string `json:"labels,omitempty"`
	// Tags - The tags associated with the query.
	Tags interface{} `json:"tags,omitempty"`
	// Properties - The properties of the query.
	Properties interface{} `json:"properties,omitempty"`
	// Related - The related metadata items for the query.
	Related *MetadataQueryRelated `json:"related,omitempty"`
}

MetadataQuery queries are stored pieces of KQL, along with a list of relevant metadata items.

type MetadataQueryRelated

type MetadataQueryRelated struct {
	// Categories - The related categories for the query.
	Categories *[]string `json:"categories,omitempty"`
	// Solutions - The related Log Analytics solutions for the query.
	Solutions *[]string `json:"solutions,omitempty"`
	// ResourceTypes - The related resource types for the query.
	ResourceTypes *[]string `json:"resourceTypes,omitempty"`
	// Tables - The related tables for the query.
	Tables *[]string `json:"tables,omitempty"`
}

MetadataQueryRelated the related metadata items for the query.

type MetadataResourceType

type MetadataResourceType struct {
	// ID - The ID of the resource-type
	ID *string `json:"id,omitempty"`
	// Type - The type of the resource-type
	Type *string `json:"type,omitempty"`
	// DisplayName - The display name of the resource-type
	DisplayName *string `json:"displayName,omitempty"`
	// Description - The description of the resource-type
	Description *string `json:"description,omitempty"`
	// Labels - The user-defined labels of the resource-type
	Labels *[]string `json:"labels,omitempty"`
	// Tags - The tags associated with the resource-type
	Tags interface{} `json:"tags,omitempty"`
	// Properties - The properties of the resource-type
	Properties interface{} `json:"properties,omitempty"`
	// Related - The related metadata items for the resource-type
	Related *MetadataResourceTypeRelated `json:"related,omitempty"`
}

MetadataResourceType metadata about types of Azure resources, containing relevant tables, functions, etc.

type MetadataResourceTypeRelated

type MetadataResourceTypeRelated struct {
	// Tables - The tables related to the resource-type
	Tables *[]string `json:"tables,omitempty"`
	// Functions - The functions related to the resource-type
	Functions *[]string `json:"functions,omitempty"`
	// Categories - The categories related to the resource-type
	Categories *[]string `json:"categories,omitempty"`
	// Queries - The queries related to the resource-type
	Queries *[]string `json:"queries,omitempty"`
	// Workspaces - The Log Analytics workspaces related to the resource-type
	Workspaces *[]string `json:"workspaces,omitempty"`
	// Resources - The Azure resources related to the resource-type
	Resources *[]string `json:"resources,omitempty"`
}

MetadataResourceTypeRelated the related metadata items for the resource-type

type MetadataResults

type MetadataResults struct {
	autorest.Response `json:"-"`
	// Categories - The list of categories that are referenced in this metadata response.
	Categories *[]MetadataCategory `json:"categories,omitempty"`
	// ResourceTypes - The list of resource types that are referenced in this metadata response.
	ResourceTypes *[]MetadataResourceType `json:"resourceTypes,omitempty"`
	// Solutions - The list of Log Analytics solutions installed on the workspace.
	Solutions *[]MetadataSolution `json:"solutions,omitempty"`
	// Tables - The list of tables and columns that comprise the schema of the workspace.
	Tables *[]MetadataTable `json:"tables,omitempty"`
	// Functions - The list of functions stored on the workspace, or introduced by solutions etc.
	Functions *[]MetadataFunction `json:"functions,omitempty"`
	// Queries - The list of saved queries stored on the workspace, or introduced by solutions, resource types, etc.
	Queries *[]MetadataQuery `json:"queries,omitempty"`
	// Applications - The list of Application Insights apps that were referenced in the metadata request.
	Applications *[]MetadataApplication `json:"applications,omitempty"`
	// Workspaces - The list of Log Analytics workspaces that were referenced in the metadata request.
	Workspaces *[]MetadataWorkspace `json:"workspaces,omitempty"`
	// Resources - The list of Azure resources that were referenced in the metadata request.
	Resources *[]interface{} `json:"resources,omitempty"`
	// Permissions - The list of permission rules that affected the metadata request.
	Permissions *[]MetadataPermissions `json:"permissions,omitempty"`
}

MetadataResults the metadata response for the app, including available tables, etc.

type MetadataSolution

type MetadataSolution struct {
	// ID - The ID of the Log Analytics solution
	ID *string `json:"id,omitempty"`
	// Name - The name of the Log Analytics solution
	Name *string `json:"name,omitempty"`
	// DisplayName - The display name of the Log Analytics solution
	DisplayName *string `json:"displayName,omitempty"`
	// Description - The description of the Log Analytics solution
	Description *string `json:"description,omitempty"`
	// Tags - The tags that are associated with the Log Analytics solution
	Tags interface{} `json:"tags,omitempty"`
	// Properties - The properties of the Log Analytics solution
	Properties interface{} `json:"properties,omitempty"`
	// Related - The related metadata items for the Log Analytics solution
	Related *MetadataSolutionRelated `json:"related,omitempty"`
}

MetadataSolution solutions can group tables and functions that are associated with a certain Azure Log Analytics offering.

type MetadataSolutionRelated

type MetadataSolutionRelated struct {
	// Tables - The tables related to the Log Analytics solution
	Tables *[]string `json:"tables,omitempty"`
	// Functions - The functions related to the Log Analytics solution
	Functions *[]string `json:"functions,omitempty"`
	// Categories - The categories related to the Log Analytics solution
	Categories *[]string `json:"categories,omitempty"`
	// Queries - The saved queries related to the Log Analytics solution
	Queries *[]string `json:"queries,omitempty"`
	// Workspaces - The Workspaces referenced in the metadata request that are related to the Log Analytics solution
	Workspaces *[]string `json:"workspaces,omitempty"`
}

MetadataSolutionRelated the related metadata items for the Log Analytics solution

type MetadataTable

type MetadataTable struct {
	// ID - The ID of the table
	ID *string `json:"id,omitempty"`
	// Name - The name of the table
	Name *string `json:"name,omitempty"`
	// Description - The description of the table
	Description *string `json:"description,omitempty"`
	// TimespanColumn - The column associated with the timespan query parameter for the table
	TimespanColumn *string `json:"timespanColumn,omitempty"`
	// Labels - The user defined labels of the table
	Labels *[]string `json:"labels,omitempty"`
	// Tags - The tags associated with the table
	Tags interface{} `json:"tags,omitempty"`
	// Properties - The properties of the table
	Properties interface{} `json:"properties,omitempty"`
	// Columns - The list of columns defined on the table
	Columns *[]MetadataTableColumnsItem `json:"columns,omitempty"`
	// Related - The related metadata items for the table
	Related *MetadataTableRelated `json:"related,omitempty"`
}

MetadataTable tables are part of the workspace schema, and contain a list of columns and a reference to other relevant metadata items.

type MetadataTableColumnsItem

type MetadataTableColumnsItem struct {
	// Name - The name of the column
	Name *string `json:"name,omitempty"`
	// Description - The description of the column
	Description *string `json:"description,omitempty"`
	// Type - The data type of the column. Possible values include: 'Bool', 'Datetime', 'Dynamic', 'Int', 'Long', 'Real', 'String'
	Type MetadataColumnDataType `json:"type,omitempty"`
	// IsPreferredFacet - A flag indicating this column is a preferred facet
	IsPreferredFacet *bool `json:"isPreferredFacet,omitempty"`
	// Source - an indication of the source of the column, used only when multiple workspaces have conflicting definition for the column
	Source interface{} `json:"source,omitempty"`
}

MetadataTableColumnsItem ...

type MetadataTableRelated

type MetadataTableRelated struct {
	// Categories - The related categories for the table
	Categories *[]string `json:"categories,omitempty"`
	// Solutions - The related Log Analytics solutions for the table
	Solutions *[]string `json:"solutions,omitempty"`
	// ResourceTypes - The related resource types for the table
	ResourceTypes *[]string `json:"resourceTypes,omitempty"`
	// Workspaces - The related Log Analytics workspaces for the table
	Workspaces *[]string `json:"workspaces,omitempty"`
	// Functions - The related functions for the table
	Functions *[]string `json:"functions,omitempty"`
	// Queries - The related saved queries for the table
	Queries *[]string `json:"queries,omitempty"`
}

MetadataTableRelated the related metadata items for the table

type MetadataWorkspace

type MetadataWorkspace struct {
	// ID - The ID of the Log Analytics workspace.
	ID *string `json:"id,omitempty"`
	// ResourceID - The ARM resource ID of the Log Analytics workspace.
	ResourceID *string `json:"resourceId,omitempty"`
	// Name - The name of the Log Analytics workspace.
	Name *string `json:"name,omitempty"`
	// Region - The Azure region of the Log Analytics workspace.
	Region *string `json:"region,omitempty"`
	// Related - The related metadata items for the Log Analytics workspace.
	Related *MetadataWorkspaceRelated `json:"related,omitempty"`
}

MetadataWorkspace log Analytics workspaces that were part of the metadata request and that the user has access to.

type MetadataWorkspaceRelated

type MetadataWorkspaceRelated struct {
	// Tables - The related tables for the Log Analytics workspace.
	Tables *[]string `json:"tables,omitempty"`
	// Solutions - The related Log Analytics solutions for the Log Analytics workspace.
	Solutions *[]string `json:"solutions,omitempty"`
	// ResourceTypes - The related resource types for the Log Analytics workspace.
	ResourceTypes *[]string `json:"resourceTypes,omitempty"`
	// Functions - The related functions for the Log Analytics workspace.
	Functions *[]string `json:"functions,omitempty"`
	// Resources - The related Azure resources for the Log Analytics workspace.
	Resources *[]string `json:"resources,omitempty"`
}

MetadataWorkspaceRelated the related metadata items for the Log Analytics workspace.

type QueryBody

type QueryBody struct {
	// Query - The query to execute.
	Query *string `json:"query,omitempty"`
	// Timespan - Optional. The timespan over which to query data. This is an ISO8601 time period value.  This timespan is applied in addition to any that are specified in the query expression.
	Timespan *string `json:"timespan,omitempty"`
	// Workspaces - A list of workspaces that are included in the query.
	Workspaces *[]string `json:"workspaces,omitempty"`
}

QueryBody the Analytics query. Learn more about the [Analytics query syntax](https://azure.microsoft.com/documentation/articles/app-insights-analytics-reference/)

type QueryClient

type QueryClient struct {
	BaseClient
}

QueryClient is the log Analytics Data Plane Client

func NewQueryClient

func NewQueryClient() QueryClient

NewQueryClient creates an instance of the QueryClient client.

func NewQueryClientWithBaseURI

func NewQueryClientWithBaseURI(baseURI string) QueryClient

NewQueryClientWithBaseURI creates an instance of the QueryClient client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).

func (QueryClient) Execute

func (client QueryClient) Execute(ctx context.Context, workspaceID string, body QueryBody) (result QueryResults, err error)

Execute executes an Analytics query for data. [Here](https://dev.loganalytics.io/documentation/Using-the-API) is an example for using POST with an Analytics query. Parameters: workspaceID - ID of the workspace. This is Workspace ID from the Properties blade in the Azure portal. body - the Analytics query. Learn more about the [Analytics query syntax](https://azure.microsoft.com/documentation/articles/app-insights-analytics-reference/)

func (QueryClient) ExecutePreparer

func (client QueryClient) ExecutePreparer(ctx context.Context, workspaceID string, body QueryBody) (*http.Request, error)

ExecutePreparer prepares the Execute request.

func (QueryClient) ExecuteResponder

func (client QueryClient) ExecuteResponder(resp *http.Response) (result QueryResults, err error)

ExecuteResponder handles the response to the Execute request. The method always closes the http.Response Body.

func (QueryClient) ExecuteSender

func (client QueryClient) ExecuteSender(req *http.Request) (*http.Response, error)

ExecuteSender sends the Execute request. The method will close the http.Response Body if it receives an error.

type QueryResults

type QueryResults struct {
	autorest.Response `json:"-"`
	// Tables - The list of tables, columns and rows.
	Tables *[]Table `json:"tables,omitempty"`
}

QueryResults contains the tables, columns & rows resulting from a query.

type Table

type Table struct {
	// Name - The name of the table.
	Name *string `json:"name,omitempty"`
	// Columns - The list of columns in this table.
	Columns *[]Column `json:"columns,omitempty"`
	// Rows - The resulting rows from this query.
	Rows *[][]interface{} `json:"rows,omitempty"`
}

Table contains the columns and rows for one table in a query response.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL