manageddatabasequeries

package
v0.20240320.1144505 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: MPL-2.0 Imports: 10 Imported by: 0

README

github.com/hashicorp/go-azure-sdk/resource-manager/sql/2023-02-01-preview/manageddatabasequeries Documentation

The manageddatabasequeries SDK allows for interaction with the Azure Resource Manager Service sql (API Version 2023-02-01-preview).

This readme covers example usages, but further information on using this SDK can be found in the project root.

Import Path

import "github.com/hashicorp/go-azure-sdk/resource-manager/sql/2023-02-01-preview/manageddatabasequeries"

Client Initialization

client := manageddatabasequeries.NewManagedDatabaseQueriesClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: ManagedDatabaseQueriesClient.Get

ctx := context.TODO()
id := manageddatabasequeries.NewQueryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedInstanceValue", "databaseValue", "queryIdValue")

read, err := client.Get(ctx, id)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: ManagedDatabaseQueriesClient.ListByQuery

ctx := context.TODO()
id := manageddatabasequeries.NewQueryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedInstanceValue", "databaseValue", "queryIdValue")

// alternatively `client.ListByQuery(ctx, id, manageddatabasequeries.DefaultListByQueryOperationOptions())` can be used to do batched pagination
items, err := client.ListByQueryComplete(ctx, id, manageddatabasequeries.DefaultListByQueryOperationOptions())
if err != nil {
	// handle the error
}
for _, item := range items {
	// do something
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PossibleValuesForQueryMetricUnitType

func PossibleValuesForQueryMetricUnitType() []string

func PossibleValuesForQueryTimeGrainType

func PossibleValuesForQueryTimeGrainType() []string

func ValidateQueryID

func ValidateQueryID(input interface{}, key string) (warnings []string, errors []error)

ValidateQueryID checks that 'input' can be parsed as a Query ID

Types

type GetOperationResponse

type GetOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *ManagedInstanceQuery
}

type ListByQueryCompleteResult

type ListByQueryCompleteResult struct {
	LatestHttpResponse *http.Response
	Items              []QueryStatistics
}

type ListByQueryOperationOptions

type ListByQueryOperationOptions struct {
	EndTime   *string
	Interval  *QueryTimeGrainType
	StartTime *string
}

func DefaultListByQueryOperationOptions

func DefaultListByQueryOperationOptions() ListByQueryOperationOptions

func (ListByQueryOperationOptions) ToHeaders

func (ListByQueryOperationOptions) ToOData

func (ListByQueryOperationOptions) ToQuery

type ListByQueryOperationResponse

type ListByQueryOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]QueryStatistics
}

type ManagedDatabaseQueriesClient

type ManagedDatabaseQueriesClient struct {
	Client *resourcemanager.Client
}

func NewManagedDatabaseQueriesClientWithBaseURI

func NewManagedDatabaseQueriesClientWithBaseURI(sdkApi sdkEnv.Api) (*ManagedDatabaseQueriesClient, error)

func (ManagedDatabaseQueriesClient) Get

Get ...

func (ManagedDatabaseQueriesClient) ListByQuery

ListByQuery ...

func (ManagedDatabaseQueriesClient) ListByQueryComplete

ListByQueryComplete retrieves all the results into a single object

func (ManagedDatabaseQueriesClient) ListByQueryCompleteMatchingPredicate

func (c ManagedDatabaseQueriesClient) ListByQueryCompleteMatchingPredicate(ctx context.Context, id QueryId, options ListByQueryOperationOptions, predicate QueryStatisticsOperationPredicate) (result ListByQueryCompleteResult, err error)

ListByQueryCompleteMatchingPredicate retrieves all the results and then applies the predicate

type ManagedInstanceQuery

type ManagedInstanceQuery struct {
	Id         *string          `json:"id,omitempty"`
	Name       *string          `json:"name,omitempty"`
	Properties *QueryProperties `json:"properties,omitempty"`
	Type       *string          `json:"type,omitempty"`
}

type QueryId

type QueryId struct {
	SubscriptionId      string
	ResourceGroupName   string
	ManagedInstanceName string
	DatabaseName        string
	QueryId             string
}

QueryId is a struct representing the Resource ID for a Query

func NewQueryID

func NewQueryID(subscriptionId string, resourceGroupName string, managedInstanceName string, databaseName string, queryId string) QueryId

NewQueryID returns a new QueryId struct

func ParseQueryID

func ParseQueryID(input string) (*QueryId, error)

ParseQueryID parses 'input' into a QueryId

func ParseQueryIDInsensitively

func ParseQueryIDInsensitively(input string) (*QueryId, error)

ParseQueryIDInsensitively parses 'input' case-insensitively into a QueryId note: this method should only be used for API response data and not user input

func (*QueryId) FromParseResult

func (id *QueryId) FromParseResult(input resourceids.ParseResult) error

func (QueryId) ID

func (id QueryId) ID() string

ID returns the formatted Query ID

func (QueryId) Segments

func (id QueryId) Segments() []resourceids.Segment

Segments returns a slice of Resource ID Segments which comprise this Query ID

func (QueryId) String

func (id QueryId) String() string

String returns a human-readable description of this Query ID

type QueryMetricInterval

type QueryMetricInterval struct {
	ExecutionCount    *int64                   `json:"executionCount,omitempty"`
	IntervalStartTime *string                  `json:"intervalStartTime,omitempty"`
	IntervalType      *QueryTimeGrainType      `json:"intervalType,omitempty"`
	Metrics           *[]QueryMetricProperties `json:"metrics,omitempty"`
}

type QueryMetricProperties

type QueryMetricProperties struct {
	Avg         *float64             `json:"avg,omitempty"`
	DisplayName *string              `json:"displayName,omitempty"`
	Max         *float64             `json:"max,omitempty"`
	Min         *float64             `json:"min,omitempty"`
	Name        *string              `json:"name,omitempty"`
	Stdev       *float64             `json:"stdev,omitempty"`
	Sum         *float64             `json:"sum,omitempty"`
	Unit        *QueryMetricUnitType `json:"unit,omitempty"`
	Value       *float64             `json:"value,omitempty"`
}

type QueryMetricUnitType

type QueryMetricUnitType string
const (
	QueryMetricUnitTypeCount        QueryMetricUnitType = "count"
	QueryMetricUnitTypeKB           QueryMetricUnitType = "KB"
	QueryMetricUnitTypeMicroseconds QueryMetricUnitType = "microseconds"
	QueryMetricUnitTypePercentage   QueryMetricUnitType = "percentage"
)

func (*QueryMetricUnitType) UnmarshalJSON

func (s *QueryMetricUnitType) UnmarshalJSON(bytes []byte) error

type QueryProperties

type QueryProperties struct {
	QueryText *string `json:"queryText,omitempty"`
}

type QueryStatistics

type QueryStatistics struct {
	Id         *string                    `json:"id,omitempty"`
	Name       *string                    `json:"name,omitempty"`
	Properties *QueryStatisticsProperties `json:"properties,omitempty"`
	Type       *string                    `json:"type,omitempty"`
}

type QueryStatisticsOperationPredicate

type QueryStatisticsOperationPredicate struct {
	Id   *string
	Name *string
	Type *string
}

func (QueryStatisticsOperationPredicate) Matches

type QueryStatisticsProperties

type QueryStatisticsProperties struct {
	DatabaseName *string                `json:"databaseName,omitempty"`
	EndTime      *string                `json:"endTime,omitempty"`
	Intervals    *[]QueryMetricInterval `json:"intervals,omitempty"`
	QueryId      *string                `json:"queryId,omitempty"`
	StartTime    *string                `json:"startTime,omitempty"`
}

type QueryTimeGrainType

type QueryTimeGrainType string
const (
	QueryTimeGrainTypePOneD  QueryTimeGrainType = "P1D"
	QueryTimeGrainTypePTOneH QueryTimeGrainType = "PT1H"
)

func (*QueryTimeGrainType) UnmarshalJSON

func (s *QueryTimeGrainType) UnmarshalJSON(bytes []byte) error

Jump to

Keyboard shortcuts

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