metrics

package
v0.20231213.1172325 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2023 License: MPL-2.0 Imports: 9 Imported by: 1

README

github.com/hashicorp/go-azure-sdk/resource-manager/insights/2023-10-01/metrics Documentation

The metrics SDK allows for interaction with the Azure Resource Manager Service insights (API Version 2023-10-01).

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/insights/2023-10-01/metrics"

Client Initialization

client := metrics.NewMetricsClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: MetricsClient.List

ctx := context.TODO()
id := metrics.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group")

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

Example Usage: MetricsClient.ListAtSubscriptionScope

ctx := context.TODO()
id := metrics.NewSubscriptionID("12345678-1234-9876-4563-123456789012")

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

Example Usage: MetricsClient.ListAtSubscriptionScopePost

ctx := context.TODO()
id := metrics.NewSubscriptionID("12345678-1234-9876-4563-123456789012")

payload := metrics.SubscriptionScopeMetricsRequestBodyParameters{
	// ...
}


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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PossibleValuesForMetricResultType

func PossibleValuesForMetricResultType() []string

func PossibleValuesForMetricUnit

func PossibleValuesForMetricUnit() []string

func PossibleValuesForResultType

func PossibleValuesForResultType() []string

Types

type ListAtSubscriptionScopeOperationOptions

type ListAtSubscriptionScopeOperationOptions struct {
	Aggregation         *string
	AutoAdjustTimegrain *bool
	Filter              *string
	Interval            *string
	Metricnames         *string
	Metricnamespace     *string
	Orderby             *string
	Region              *string
	ResultType          *MetricResultType
	Rollupby            *string
	Timespan            *string
	Top                 *int64
	ValidateDimensions  *bool
}

func DefaultListAtSubscriptionScopeOperationOptions

func DefaultListAtSubscriptionScopeOperationOptions() ListAtSubscriptionScopeOperationOptions

type ListAtSubscriptionScopeOperationResponse

type ListAtSubscriptionScopeOperationResponse struct {
	HttpResponse *http.Response
	Model        *Response
}

type ListAtSubscriptionScopePostOperationOptions

type ListAtSubscriptionScopePostOperationOptions struct {
	Aggregation         *string
	AutoAdjustTimegrain *bool
	Filter              *string
	Interval            *string
	Metricnames         *string
	Metricnamespace     *string
	Orderby             *string
	Region              *string
	ResultType          *MetricResultType
	Rollupby            *string
	Timespan            *string
	Top                 *int64
	ValidateDimensions  *bool
}

func DefaultListAtSubscriptionScopePostOperationOptions

func DefaultListAtSubscriptionScopePostOperationOptions() ListAtSubscriptionScopePostOperationOptions

type ListAtSubscriptionScopePostOperationResponse

type ListAtSubscriptionScopePostOperationResponse struct {
	HttpResponse *http.Response
	Model        *Response
}

type ListOperationOptions

type ListOperationOptions struct {
	Aggregation         *string
	AutoAdjustTimegrain *bool
	Filter              *string
	Interval            *string
	Metricnames         *string
	Metricnamespace     *string
	Orderby             *string
	ResultType          *ResultType
	Rollupby            *string
	Timespan            *string
	Top                 *int64
	ValidateDimensions  *bool
}

func DefaultListOperationOptions

func DefaultListOperationOptions() ListOperationOptions

type ListOperationResponse

type ListOperationResponse struct {
	HttpResponse *http.Response
	Model        *Response
}

type LocalizableString

type LocalizableString struct {
	LocalizedValue *string `json:"localizedValue,omitempty"`
	Value          string  `json:"value"`
}

type MetadataValue

type MetadataValue struct {
	Name  *LocalizableString `json:"name,omitempty"`
	Value *string            `json:"value,omitempty"`
}

type Metric

type Metric struct {
	DisplayDescription *string             `json:"displayDescription,omitempty"`
	ErrorCode          *string             `json:"errorCode,omitempty"`
	ErrorMessage       *string             `json:"errorMessage,omitempty"`
	Id                 string              `json:"id"`
	Name               LocalizableString   `json:"name"`
	Timeseries         []TimeSeriesElement `json:"timeseries"`
	Type               string              `json:"type"`
	Unit               MetricUnit          `json:"unit"`
}

type MetricResultType

type MetricResultType string
const (
	MetricResultTypeData     MetricResultType = "Data"
	MetricResultTypeMetadata MetricResultType = "Metadata"
)

type MetricUnit

type MetricUnit string
const (
	MetricUnitBitsPerSecond  MetricUnit = "BitsPerSecond"
	MetricUnitByteSeconds    MetricUnit = "ByteSeconds"
	MetricUnitBytes          MetricUnit = "Bytes"
	MetricUnitBytesPerSecond MetricUnit = "BytesPerSecond"
	MetricUnitCores          MetricUnit = "Cores"
	MetricUnitCount          MetricUnit = "Count"
	MetricUnitCountPerSecond MetricUnit = "CountPerSecond"
	MetricUnitMilliCores     MetricUnit = "MilliCores"
	MetricUnitMilliSeconds   MetricUnit = "MilliSeconds"
	MetricUnitNanoCores      MetricUnit = "NanoCores"
	MetricUnitPercent        MetricUnit = "Percent"
	MetricUnitSeconds        MetricUnit = "Seconds"
	MetricUnitUnspecified    MetricUnit = "Unspecified"
)

type MetricValue

type MetricValue struct {
	Average   *float64 `json:"average,omitempty"`
	Count     *float64 `json:"count,omitempty"`
	Maximum   *float64 `json:"maximum,omitempty"`
	Minimum   *float64 `json:"minimum,omitempty"`
	TimeStamp string   `json:"timeStamp"`
	Total     *float64 `json:"total,omitempty"`
}

func (*MetricValue) GetTimeStampAsTime

func (o *MetricValue) GetTimeStampAsTime() (*time.Time, error)

func (*MetricValue) SetTimeStampAsTime

func (o *MetricValue) SetTimeStampAsTime(input time.Time)

type MetricsClient

type MetricsClient struct {
	Client autorest.Client
	// contains filtered or unexported fields
}

func NewMetricsClientWithBaseURI

func NewMetricsClientWithBaseURI(endpoint string) MetricsClient

func (MetricsClient) List

List ...

func (MetricsClient) ListAtSubscriptionScope

ListAtSubscriptionScope ...

type Response

type Response struct {
	Cost           *float64 `json:"cost,omitempty"`
	Interval       *string  `json:"interval,omitempty"`
	Namespace      *string  `json:"namespace,omitempty"`
	Resourceregion *string  `json:"resourceregion,omitempty"`
	Timespan       string   `json:"timespan"`
	Value          []Metric `json:"value"`
}

type ResultType

type ResultType string
const (
	ResultTypeData     ResultType = "Data"
	ResultTypeMetadata ResultType = "Metadata"
)

type SubscriptionScopeMetricsRequestBodyParameters

type SubscriptionScopeMetricsRequestBodyParameters struct {
	Aggregation         *string           `json:"aggregation,omitempty"`
	AutoAdjustTimegrain *bool             `json:"autoAdjustTimegrain,omitempty"`
	Filter              *string           `json:"filter,omitempty"`
	Interval            *string           `json:"interval,omitempty"`
	MetricNames         *string           `json:"metricNames,omitempty"`
	MetricNamespace     *string           `json:"metricNamespace,omitempty"`
	OrderBy             *string           `json:"orderBy,omitempty"`
	ResultType          *MetricResultType `json:"resultType,omitempty"`
	RollUpBy            *string           `json:"rollUpBy,omitempty"`
	Timespan            *string           `json:"timespan,omitempty"`
	Top                 *int64            `json:"top,omitempty"`
	ValidateDimensions  *bool             `json:"validateDimensions,omitempty"`
}

type TimeSeriesElement

type TimeSeriesElement struct {
	Data           *[]MetricValue   `json:"data,omitempty"`
	Metadatavalues *[]MetadataValue `json:"metadatavalues,omitempty"`
}

Jump to

Keyboard shortcuts

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