metrics

package
v0.20240606.1065251 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2024 License: MPL-2.0 Imports: 12 Imported by: 0

README

github.com/hashicorp/go-azure-sdk/resource-manager/insights/2024-02-01/metrics Documentation

The metrics SDK allows for interaction with the Azure Resource Manager Service insights (API Version 2024-02-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-helpers/resourcemanager/commonids"
import "github.com/hashicorp/go-azure-sdk/resource-manager/insights/2024-02-01/metrics"

Client Initialization

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

Example Usage: MetricsClient.List

ctx := context.TODO()
id := commonids.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 := commonids.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 := commonids.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

func (ListAtSubscriptionScopeOperationOptions) ToHeaders

func (ListAtSubscriptionScopeOperationOptions) ToOData

func (ListAtSubscriptionScopeOperationOptions) ToQuery

type ListAtSubscriptionScopeOperationResponse

type ListAtSubscriptionScopeOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	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

func (ListAtSubscriptionScopePostOperationOptions) ToHeaders

func (ListAtSubscriptionScopePostOperationOptions) ToOData

func (ListAtSubscriptionScopePostOperationOptions) ToQuery

type ListAtSubscriptionScopePostOperationResponse

type ListAtSubscriptionScopePostOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	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

func (ListOperationOptions) ToHeaders

func (o ListOperationOptions) ToHeaders() *client.Headers

func (ListOperationOptions) ToOData

func (o ListOperationOptions) ToOData() *odata.Query

func (ListOperationOptions) ToQuery

type ListOperationResponse

type ListOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	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"
)

func (*MetricResultType) UnmarshalJSON

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

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"
)

func (*MetricUnit) UnmarshalJSON

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

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 *resourcemanager.Client
}

func NewMetricsClientWithBaseURI

func NewMetricsClientWithBaseURI(sdkApi sdkEnv.Api) (*MetricsClient, error)

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"
)

func (*ResultType) UnmarshalJSON

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

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