alerts

package
v0.20230823.1052657 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2023 License: MPL-2.0 Imports: 11 Imported by: 1

README

github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2023-03-01/alerts Documentation

The alerts SDK allows for interaction with the Azure Resource Manager Service costmanagement (API Version 2023-03-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/costmanagement/2023-03-01/alerts"

Client Initialization

client := alerts.NewAlertsClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: AlertsClient.Dismiss

ctx := context.TODO()
id := alerts.NewScopedAlertID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "alertIdValue")

payload := alerts.DismissAlertPayload{
	// ...
}


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

Example Usage: AlertsClient.Get

ctx := context.TODO()
id := alerts.NewScopedAlertID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "alertIdValue")

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: AlertsClient.List

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

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

Example Usage: AlertsClient.ListExternal

ctx := context.TODO()
id := alerts.NewExternalCloudProviderTypeID("externalBillingAccounts", "externalCloudProviderIdValue")

read, err := client.ListExternal(ctx, id)
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 PossibleValuesForAlertCategory

func PossibleValuesForAlertCategory() []string

func PossibleValuesForAlertCriteria

func PossibleValuesForAlertCriteria() []string

func PossibleValuesForAlertOperator

func PossibleValuesForAlertOperator() []string

func PossibleValuesForAlertSource

func PossibleValuesForAlertSource() []string

func PossibleValuesForAlertStatus

func PossibleValuesForAlertStatus() []string

func PossibleValuesForAlertTimeGrainType

func PossibleValuesForAlertTimeGrainType() []string

func PossibleValuesForAlertType

func PossibleValuesForAlertType() []string

func PossibleValuesForExternalCloudProviderType

func PossibleValuesForExternalCloudProviderType() []string

func ValidateExternalCloudProviderTypeID

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

ValidateExternalCloudProviderTypeID checks that 'input' can be parsed as a External Cloud Provider Type ID

func ValidateScopedAlertID

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

ValidateScopedAlertID checks that 'input' can be parsed as a Scoped Alert ID

Types

type Alert

type Alert struct {
	ETag       *string          `json:"eTag,omitempty"`
	Id         *string          `json:"id,omitempty"`
	Name       *string          `json:"name,omitempty"`
	Properties *AlertProperties `json:"properties,omitempty"`
	Type       *string          `json:"type,omitempty"`
}

type AlertCategory

type AlertCategory string
const (
	AlertCategoryBilling AlertCategory = "Billing"
	AlertCategoryCost    AlertCategory = "Cost"
	AlertCategorySystem  AlertCategory = "System"
	AlertCategoryUsage   AlertCategory = "Usage"
)

func (*AlertCategory) UnmarshalJSON

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

type AlertCriteria

type AlertCriteria string
const (
	AlertCriteriaCostThresholdExceeded          AlertCriteria = "CostThresholdExceeded"
	AlertCriteriaCreditThresholdApproaching     AlertCriteria = "CreditThresholdApproaching"
	AlertCriteriaCreditThresholdReached         AlertCriteria = "CreditThresholdReached"
	AlertCriteriaCrossCloudCollectionError      AlertCriteria = "CrossCloudCollectionError"
	AlertCriteriaCrossCloudNewDataAvailable     AlertCriteria = "CrossCloudNewDataAvailable"
	AlertCriteriaForecastCostThresholdExceeded  AlertCriteria = "ForecastCostThresholdExceeded"
	AlertCriteriaForecastUsageThresholdExceeded AlertCriteria = "ForecastUsageThresholdExceeded"
	AlertCriteriaGeneralThresholdError          AlertCriteria = "GeneralThresholdError"
	AlertCriteriaInvoiceDueDateApproaching      AlertCriteria = "InvoiceDueDateApproaching"
	AlertCriteriaInvoiceDueDateReached          AlertCriteria = "InvoiceDueDateReached"
	AlertCriteriaMultiCurrency                  AlertCriteria = "MultiCurrency"
	AlertCriteriaQuotaThresholdApproaching      AlertCriteria = "QuotaThresholdApproaching"
	AlertCriteriaQuotaThresholdReached          AlertCriteria = "QuotaThresholdReached"
	AlertCriteriaUsageThresholdExceeded         AlertCriteria = "UsageThresholdExceeded"
)

func (*AlertCriteria) UnmarshalJSON

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

type AlertOperator

type AlertOperator string
const (
	AlertOperatorEqualTo              AlertOperator = "EqualTo"
	AlertOperatorGreaterThan          AlertOperator = "GreaterThan"
	AlertOperatorGreaterThanOrEqualTo AlertOperator = "GreaterThanOrEqualTo"
	AlertOperatorLessThan             AlertOperator = "LessThan"
	AlertOperatorLessThanOrEqualTo    AlertOperator = "LessThanOrEqualTo"
	AlertOperatorNone                 AlertOperator = "None"
)

func (*AlertOperator) UnmarshalJSON

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

type AlertProperties

type AlertProperties struct {
	CloseTime                  *string                    `json:"closeTime,omitempty"`
	CostEntityId               *string                    `json:"costEntityId,omitempty"`
	CreationTime               *string                    `json:"creationTime,omitempty"`
	Definition                 *AlertPropertiesDefinition `json:"definition,omitempty"`
	Description                *string                    `json:"description,omitempty"`
	Details                    *AlertPropertiesDetails    `json:"details,omitempty"`
	ModificationTime           *string                    `json:"modificationTime,omitempty"`
	Source                     *AlertSource               `json:"source,omitempty"`
	Status                     *AlertStatus               `json:"status,omitempty"`
	StatusModificationTime     *string                    `json:"statusModificationTime,omitempty"`
	StatusModificationUserName *string                    `json:"statusModificationUserName,omitempty"`
}

type AlertPropertiesDefinition

type AlertPropertiesDefinition struct {
	Category *AlertCategory `json:"category,omitempty"`
	Criteria *AlertCriteria `json:"criteria,omitempty"`
	Type     *AlertType     `json:"type,omitempty"`
}

type AlertPropertiesDetails

type AlertPropertiesDetails struct {
	Amount              *float64            `json:"amount,omitempty"`
	CompanyName         *string             `json:"companyName,omitempty"`
	ContactEmails       *[]string           `json:"contactEmails,omitempty"`
	ContactGroups       *[]string           `json:"contactGroups,omitempty"`
	ContactRoles        *[]string           `json:"contactRoles,omitempty"`
	CurrentSpend        *float64            `json:"currentSpend,omitempty"`
	DepartmentName      *string             `json:"departmentName,omitempty"`
	EnrollmentEndDate   *string             `json:"enrollmentEndDate,omitempty"`
	EnrollmentNumber    *string             `json:"enrollmentNumber,omitempty"`
	EnrollmentStartDate *string             `json:"enrollmentStartDate,omitempty"`
	InvoicingThreshold  *float64            `json:"invoicingThreshold,omitempty"`
	MeterFilter         *[]interface{}      `json:"meterFilter,omitempty"`
	Operator            *AlertOperator      `json:"operator,omitempty"`
	OverridingAlert     *string             `json:"overridingAlert,omitempty"`
	PeriodStartDate     *string             `json:"periodStartDate,omitempty"`
	ResourceFilter      *[]interface{}      `json:"resourceFilter,omitempty"`
	ResourceGroupFilter *[]interface{}      `json:"resourceGroupFilter,omitempty"`
	TagFilter           *interface{}        `json:"tagFilter,omitempty"`
	Threshold           *float64            `json:"threshold,omitempty"`
	TimeGrainType       *AlertTimeGrainType `json:"timeGrainType,omitempty"`
	TriggeredBy         *string             `json:"triggeredBy,omitempty"`
	Unit                *string             `json:"unit,omitempty"`
}

type AlertSource

type AlertSource string
const (
	AlertSourcePreset AlertSource = "Preset"
	AlertSourceUser   AlertSource = "User"
)

func (*AlertSource) UnmarshalJSON

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

type AlertStatus

type AlertStatus string
const (
	AlertStatusActive     AlertStatus = "Active"
	AlertStatusDismissed  AlertStatus = "Dismissed"
	AlertStatusNone       AlertStatus = "None"
	AlertStatusOverridden AlertStatus = "Overridden"
	AlertStatusResolved   AlertStatus = "Resolved"
)

func (*AlertStatus) UnmarshalJSON

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

type AlertTimeGrainType

type AlertTimeGrainType string
const (
	AlertTimeGrainTypeAnnually       AlertTimeGrainType = "Annually"
	AlertTimeGrainTypeBillingAnnual  AlertTimeGrainType = "BillingAnnual"
	AlertTimeGrainTypeBillingMonth   AlertTimeGrainType = "BillingMonth"
	AlertTimeGrainTypeBillingQuarter AlertTimeGrainType = "BillingQuarter"
	AlertTimeGrainTypeMonthly        AlertTimeGrainType = "Monthly"
	AlertTimeGrainTypeNone           AlertTimeGrainType = "None"
	AlertTimeGrainTypeQuarterly      AlertTimeGrainType = "Quarterly"
)

func (*AlertTimeGrainType) UnmarshalJSON

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

type AlertType

type AlertType string
const (
	AlertTypeBudget         AlertType = "Budget"
	AlertTypeBudgetForecast AlertType = "BudgetForecast"
	AlertTypeCredit         AlertType = "Credit"
	AlertTypeGeneral        AlertType = "General"
	AlertTypeInvoice        AlertType = "Invoice"
	AlertTypeQuota          AlertType = "Quota"
	AlertTypeXCloud         AlertType = "xCloud"
)

func (*AlertType) UnmarshalJSON

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

type AlertsClient

type AlertsClient struct {
	Client *resourcemanager.Client
}

func NewAlertsClientWithBaseURI

func NewAlertsClientWithBaseURI(sdkApi sdkEnv.Api) (*AlertsClient, error)

func (AlertsClient) Dismiss

Dismiss ...

func (AlertsClient) Get

func (c AlertsClient) Get(ctx context.Context, id ScopedAlertId) (result GetOperationResponse, err error)

Get ...

func (AlertsClient) List

List ...

func (AlertsClient) ListExternal

ListExternal ...

type AlertsResult

type AlertsResult struct {
	NextLink *string  `json:"nextLink,omitempty"`
	Value    *[]Alert `json:"value,omitempty"`
}

type DismissAlertPayload

type DismissAlertPayload struct {
	Properties *AlertProperties `json:"properties,omitempty"`
}

type DismissOperationResponse

type DismissOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *Alert
}

type ExternalCloudProviderType

type ExternalCloudProviderType string
const (
	ExternalCloudProviderTypeExternalBillingAccounts ExternalCloudProviderType = "externalBillingAccounts"
	ExternalCloudProviderTypeExternalSubscriptions   ExternalCloudProviderType = "externalSubscriptions"
)

func (*ExternalCloudProviderType) UnmarshalJSON

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

type ExternalCloudProviderTypeId

type ExternalCloudProviderTypeId struct {
	ExternalCloudProviderType ExternalCloudProviderType
	ExternalCloudProviderId   string
}

ExternalCloudProviderTypeId is a struct representing the Resource ID for a External Cloud Provider Type

func NewExternalCloudProviderTypeID

func NewExternalCloudProviderTypeID(externalCloudProviderType ExternalCloudProviderType, externalCloudProviderId string) ExternalCloudProviderTypeId

NewExternalCloudProviderTypeID returns a new ExternalCloudProviderTypeId struct

func ParseExternalCloudProviderTypeID

func ParseExternalCloudProviderTypeID(input string) (*ExternalCloudProviderTypeId, error)

ParseExternalCloudProviderTypeID parses 'input' into a ExternalCloudProviderTypeId

func ParseExternalCloudProviderTypeIDInsensitively

func ParseExternalCloudProviderTypeIDInsensitively(input string) (*ExternalCloudProviderTypeId, error)

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

func (ExternalCloudProviderTypeId) ID

ID returns the formatted External Cloud Provider Type ID

func (ExternalCloudProviderTypeId) Segments

Segments returns a slice of Resource ID Segments which comprise this External Cloud Provider Type ID

func (ExternalCloudProviderTypeId) String

func (id ExternalCloudProviderTypeId) String() string

String returns a human-readable description of this External Cloud Provider Type ID

type GetOperationResponse

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

type ListExternalOperationResponse

type ListExternalOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *AlertsResult
}

type ListOperationResponse

type ListOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *AlertsResult
}

type ScopedAlertId

type ScopedAlertId struct {
	Scope   string
	AlertId string
}

ScopedAlertId is a struct representing the Resource ID for a Scoped Alert

func NewScopedAlertID

func NewScopedAlertID(scope string, alertId string) ScopedAlertId

NewScopedAlertID returns a new ScopedAlertId struct

func ParseScopedAlertID

func ParseScopedAlertID(input string) (*ScopedAlertId, error)

ParseScopedAlertID parses 'input' into a ScopedAlertId

func ParseScopedAlertIDInsensitively

func ParseScopedAlertIDInsensitively(input string) (*ScopedAlertId, error)

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

func (ScopedAlertId) ID

func (id ScopedAlertId) ID() string

ID returns the formatted Scoped Alert ID

func (ScopedAlertId) Segments

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

Segments returns a slice of Resource ID Segments which comprise this Scoped Alert ID

func (ScopedAlertId) String

func (id ScopedAlertId) String() string

String returns a human-readable description of this Scoped Alert ID

Jump to

Keyboard shortcuts

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