smartgroups

package
v0.20240320.1143605 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: 13 Imported by: 1

README

github.com/hashicorp/go-azure-sdk/resource-manager/alertsmanagement/2019-05-05-preview/smartgroups Documentation

The smartgroups SDK allows for interaction with the Azure Resource Manager Service alertsmanagement (API Version 2019-05-05-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-helpers/resourcemanager/commonids"
import "github.com/hashicorp/go-azure-sdk/resource-manager/alertsmanagement/2019-05-05-preview/smartgroups"

Client Initialization

client := smartgroups.NewSmartGroupsClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: SmartGroupsClient.ChangeState

ctx := context.TODO()
id := smartgroups.NewSmartGroupID("12345678-1234-9876-4563-123456789012", "smartGroupIdValue")

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

Example Usage: SmartGroupsClient.GetAll

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

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

Example Usage: SmartGroupsClient.GetById

ctx := context.TODO()
id := smartgroups.NewSmartGroupID("12345678-1234-9876-4563-123456789012", "smartGroupIdValue")

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

Example Usage: SmartGroupsClient.GetHistory

ctx := context.TODO()
id := smartgroups.NewSmartGroupID("12345678-1234-9876-4563-123456789012", "smartGroupIdValue")

read, err := client.GetHistory(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 PossibleValuesForAlertState

func PossibleValuesForAlertState() []string

func PossibleValuesForMonitorCondition

func PossibleValuesForMonitorCondition() []string

func PossibleValuesForMonitorService

func PossibleValuesForMonitorService() []string

func PossibleValuesForSeverity

func PossibleValuesForSeverity() []string

func PossibleValuesForSmartGroupModificationEvent

func PossibleValuesForSmartGroupModificationEvent() []string

func PossibleValuesForSmartGroupsSortByFields

func PossibleValuesForSmartGroupsSortByFields() []string

func PossibleValuesForSortOrder

func PossibleValuesForSortOrder() []string

func PossibleValuesForState

func PossibleValuesForState() []string

func PossibleValuesForTimeRange

func PossibleValuesForTimeRange() []string

func ValidateSmartGroupID

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

ValidateSmartGroupID checks that 'input' can be parsed as a Smart Group ID

Types

type AlertState

type AlertState string
const (
	AlertStateAcknowledged AlertState = "Acknowledged"
	AlertStateClosed       AlertState = "Closed"
	AlertStateNew          AlertState = "New"
)

func (*AlertState) UnmarshalJSON

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

type ChangeStateOperationOptions

type ChangeStateOperationOptions struct {
	NewState *AlertState
}

func DefaultChangeStateOperationOptions

func DefaultChangeStateOperationOptions() ChangeStateOperationOptions

func (ChangeStateOperationOptions) ToHeaders

func (ChangeStateOperationOptions) ToOData

func (ChangeStateOperationOptions) ToQuery

type ChangeStateOperationResponse

type ChangeStateOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *SmartGroup
}

type GetAllCompleteResult

type GetAllCompleteResult struct {
	LatestHttpResponse *http.Response
	Items              []SmartGroup
}

type GetAllOperationOptions

type GetAllOperationOptions struct {
	MonitorCondition    *MonitorCondition
	MonitorService      *MonitorService
	PageCount           *int64
	Severity            *Severity
	SmartGroupState     *AlertState
	SortBy              *SmartGroupsSortByFields
	SortOrder           *SortOrder
	TargetResource      *string
	TargetResourceGroup *string
	TargetResourceType  *string
	TimeRange           *TimeRange
}

func DefaultGetAllOperationOptions

func DefaultGetAllOperationOptions() GetAllOperationOptions

func (GetAllOperationOptions) ToHeaders

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

func (GetAllOperationOptions) ToOData

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

func (GetAllOperationOptions) ToQuery

type GetAllOperationResponse

type GetAllOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]SmartGroup
}

type GetByIdOperationResponse

type GetByIdOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *SmartGroup
}

type GetHistoryOperationResponse

type GetHistoryOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *SmartGroupModification
}

type MonitorCondition

type MonitorCondition string
const (
	MonitorConditionFired    MonitorCondition = "Fired"
	MonitorConditionResolved MonitorCondition = "Resolved"
)

func (*MonitorCondition) UnmarshalJSON

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

type MonitorService

type MonitorService string
const (
	MonitorServiceActivityLogAdministrative MonitorService = "ActivityLog Administrative"
	MonitorServiceActivityLogAutoscale      MonitorService = "ActivityLog Autoscale"
	MonitorServiceActivityLogPolicy         MonitorService = "ActivityLog Policy"
	MonitorServiceActivityLogRecommendation MonitorService = "ActivityLog Recommendation"
	MonitorServiceActivityLogSecurity       MonitorService = "ActivityLog Security"
	MonitorServiceApplicationInsights       MonitorService = "Application Insights"
	MonitorServiceLogAnalytics              MonitorService = "Log Analytics"
	MonitorServiceNagios                    MonitorService = "Nagios"
	MonitorServicePlatform                  MonitorService = "Platform"
	MonitorServiceSCOM                      MonitorService = "SCOM"
	MonitorServiceServiceHealth             MonitorService = "ServiceHealth"
	MonitorServiceSmartDetector             MonitorService = "SmartDetector"
	MonitorServiceVMInsights                MonitorService = "VM Insights"
	MonitorServiceZabbix                    MonitorService = "Zabbix"
)

func (*MonitorService) UnmarshalJSON

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

type Severity

type Severity string
const (
	SeveritySevFour  Severity = "Sev4"
	SeveritySevOne   Severity = "Sev1"
	SeveritySevThree Severity = "Sev3"
	SeveritySevTwo   Severity = "Sev2"
	SeveritySevZero  Severity = "Sev0"
)

func (*Severity) UnmarshalJSON

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

type SmartGroup

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

type SmartGroupAggregatedProperty

type SmartGroupAggregatedProperty struct {
	Count *int64  `json:"count,omitempty"`
	Name  *string `json:"name,omitempty"`
}

type SmartGroupId

type SmartGroupId struct {
	SubscriptionId string
	SmartGroupId   string
}

SmartGroupId is a struct representing the Resource ID for a Smart Group

func NewSmartGroupID

func NewSmartGroupID(subscriptionId string, smartGroupId string) SmartGroupId

NewSmartGroupID returns a new SmartGroupId struct

func ParseSmartGroupID

func ParseSmartGroupID(input string) (*SmartGroupId, error)

ParseSmartGroupID parses 'input' into a SmartGroupId

func ParseSmartGroupIDInsensitively

func ParseSmartGroupIDInsensitively(input string) (*SmartGroupId, error)

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

func (*SmartGroupId) FromParseResult

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

func (SmartGroupId) ID

func (id SmartGroupId) ID() string

ID returns the formatted Smart Group ID

func (SmartGroupId) Segments

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

Segments returns a slice of Resource ID Segments which comprise this Smart Group ID

func (SmartGroupId) String

func (id SmartGroupId) String() string

String returns a human-readable description of this Smart Group ID

type SmartGroupModification

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

type SmartGroupModificationEvent

type SmartGroupModificationEvent string
const (
	SmartGroupModificationEventAlertAdded        SmartGroupModificationEvent = "AlertAdded"
	SmartGroupModificationEventAlertRemoved      SmartGroupModificationEvent = "AlertRemoved"
	SmartGroupModificationEventSmartGroupCreated SmartGroupModificationEvent = "SmartGroupCreated"
	SmartGroupModificationEventStateChange       SmartGroupModificationEvent = "StateChange"
)

func (*SmartGroupModificationEvent) UnmarshalJSON

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

type SmartGroupModificationItem

type SmartGroupModificationItem struct {
	Comments          *string                      `json:"comments,omitempty"`
	Description       *string                      `json:"description,omitempty"`
	ModificationEvent *SmartGroupModificationEvent `json:"modificationEvent,omitempty"`
	ModifiedAt        *string                      `json:"modifiedAt,omitempty"`
	ModifiedBy        *string                      `json:"modifiedBy,omitempty"`
	NewValue          *string                      `json:"newValue,omitempty"`
	OldValue          *string                      `json:"oldValue,omitempty"`
}

type SmartGroupModificationProperties

type SmartGroupModificationProperties struct {
	Modifications *[]SmartGroupModificationItem `json:"modifications,omitempty"`
	NextLink      *string                       `json:"nextLink,omitempty"`
	SmartGroupId  *string                       `json:"smartGroupId,omitempty"`
}

type SmartGroupOperationPredicate

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

func (SmartGroupOperationPredicate) Matches

func (p SmartGroupOperationPredicate) Matches(input SmartGroup) bool

type SmartGroupProperties

type SmartGroupProperties struct {
	AlertSeverities      *[]SmartGroupAggregatedProperty `json:"alertSeverities,omitempty"`
	AlertStates          *[]SmartGroupAggregatedProperty `json:"alertStates,omitempty"`
	AlertsCount          *int64                          `json:"alertsCount,omitempty"`
	LastModifiedDateTime *string                         `json:"lastModifiedDateTime,omitempty"`
	LastModifiedUserName *string                         `json:"lastModifiedUserName,omitempty"`
	MonitorConditions    *[]SmartGroupAggregatedProperty `json:"monitorConditions,omitempty"`
	MonitorServices      *[]SmartGroupAggregatedProperty `json:"monitorServices,omitempty"`
	NextLink             *string                         `json:"nextLink,omitempty"`
	ResourceGroups       *[]SmartGroupAggregatedProperty `json:"resourceGroups,omitempty"`
	ResourceTypes        *[]SmartGroupAggregatedProperty `json:"resourceTypes,omitempty"`
	Resources            *[]SmartGroupAggregatedProperty `json:"resources,omitempty"`
	Severity             *Severity                       `json:"severity,omitempty"`
	SmartGroupState      *State                          `json:"smartGroupState,omitempty"`
	StartDateTime        *string                         `json:"startDateTime,omitempty"`
}

func (*SmartGroupProperties) GetLastModifiedDateTimeAsTime

func (o *SmartGroupProperties) GetLastModifiedDateTimeAsTime() (*time.Time, error)

func (*SmartGroupProperties) GetStartDateTimeAsTime

func (o *SmartGroupProperties) GetStartDateTimeAsTime() (*time.Time, error)

func (*SmartGroupProperties) SetLastModifiedDateTimeAsTime

func (o *SmartGroupProperties) SetLastModifiedDateTimeAsTime(input time.Time)

func (*SmartGroupProperties) SetStartDateTimeAsTime

func (o *SmartGroupProperties) SetStartDateTimeAsTime(input time.Time)

type SmartGroupsClient

type SmartGroupsClient struct {
	Client *resourcemanager.Client
}

func NewSmartGroupsClientWithBaseURI

func NewSmartGroupsClientWithBaseURI(sdkApi sdkEnv.Api) (*SmartGroupsClient, error)

func (SmartGroupsClient) ChangeState

ChangeState ...

func (SmartGroupsClient) GetAll

GetAll ...

func (SmartGroupsClient) GetAllComplete

GetAllComplete retrieves all the results into a single object

func (SmartGroupsClient) GetAllCompleteMatchingPredicate

func (c SmartGroupsClient) GetAllCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, options GetAllOperationOptions, predicate SmartGroupOperationPredicate) (result GetAllCompleteResult, err error)

GetAllCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (SmartGroupsClient) GetById

GetById ...

func (SmartGroupsClient) GetHistory

func (c SmartGroupsClient) GetHistory(ctx context.Context, id SmartGroupId) (result GetHistoryOperationResponse, err error)

GetHistory ...

type SmartGroupsSortByFields

type SmartGroupsSortByFields string
const (
	SmartGroupsSortByFieldsAlertsCount          SmartGroupsSortByFields = "alertsCount"
	SmartGroupsSortByFieldsLastModifiedDateTime SmartGroupsSortByFields = "lastModifiedDateTime"
	SmartGroupsSortByFieldsSeverity             SmartGroupsSortByFields = "severity"
	SmartGroupsSortByFieldsStartDateTime        SmartGroupsSortByFields = "startDateTime"
	SmartGroupsSortByFieldsState                SmartGroupsSortByFields = "state"
)

func (*SmartGroupsSortByFields) UnmarshalJSON

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

type SortOrder

type SortOrder string
const (
	SortOrderAsc  SortOrder = "asc"
	SortOrderDesc SortOrder = "desc"
)

func (*SortOrder) UnmarshalJSON

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

type State

type State string
const (
	StateAcknowledged State = "Acknowledged"
	StateClosed       State = "Closed"
	StateNew          State = "New"
)

func (*State) UnmarshalJSON

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

type TimeRange

type TimeRange string
const (
	TimeRangeOned       TimeRange = "1d"
	TimeRangeOneh       TimeRange = "1h"
	TimeRangeSevend     TimeRange = "7d"
	TimeRangeThreeZerod TimeRange = "30d"
)

func (*TimeRange) UnmarshalJSON

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

Jump to

Keyboard shortcuts

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