monitors

package
v0.20230524.1231843 Latest Latest
Warning

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

Go to latest
Published: May 24, 2023 License: MPL-2.0 Imports: 16 Imported by: 1

README

github.com/hashicorp/go-azure-sdk/resource-manager/workloads/2023-04-01/monitors Documentation

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

Client Initialization

client := monitors.NewMonitorsClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: MonitorsClient.Create

ctx := context.TODO()
id := monitors.NewMonitorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorValue")

payload := monitors.Monitor{
	// ...
}


if err := client.CreateThenPoll(ctx, id, payload); err != nil {
	// handle the error
}

Example Usage: MonitorsClient.Delete

ctx := context.TODO()
id := monitors.NewMonitorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorValue")

if err := client.DeleteThenPoll(ctx, id); err != nil {
	// handle the error
}

Example Usage: MonitorsClient.Get

ctx := context.TODO()
id := monitors.NewMonitorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorValue")

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

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

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

Example Usage: MonitorsClient.ListByResourceGroup

ctx := context.TODO()
id := monitors.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group")

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

Example Usage: MonitorsClient.Update

ctx := context.TODO()
id := monitors.NewMonitorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorValue")

payload := monitors.UpdateMonitorRequest{
	// ...
}


read, err := client.Update(ctx, id, payload)
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 PossibleValuesForRoutingPreference

func PossibleValuesForRoutingPreference() []string

func PossibleValuesForWorkloadMonitorProvisioningState

func PossibleValuesForWorkloadMonitorProvisioningState() []string

func ValidateMonitorID

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

ValidateMonitorID checks that 'input' can be parsed as a Monitor ID

Types

type CreateOperationResponse

type CreateOperationResponse struct {
	Poller       pollers.Poller
	HttpResponse *http.Response
	OData        *odata.OData
}

type DeleteOperationResponse

type DeleteOperationResponse struct {
	Poller       pollers.Poller
	HttpResponse *http.Response
	OData        *odata.OData
}

type Error

type Error struct {
	Code       *string          `json:"code,omitempty"`
	Details    *[]Error         `json:"details,omitempty"`
	InnerError *ErrorInnerError `json:"innerError,omitempty"`
	Message    *string          `json:"message,omitempty"`
	Target     *string          `json:"target,omitempty"`
}

type ErrorAdditionalInfo

type ErrorAdditionalInfo struct {
	Info *interface{} `json:"info,omitempty"`
	Type *string      `json:"type,omitempty"`
}

type ErrorDetail

type ErrorDetail struct {
	AdditionalInfo *[]ErrorAdditionalInfo `json:"additionalInfo,omitempty"`
	Code           *string                `json:"code,omitempty"`
	Details        *[]ErrorDetail         `json:"details,omitempty"`
	Message        *string                `json:"message,omitempty"`
	Target         *string                `json:"target,omitempty"`
}

type ErrorInnerError

type ErrorInnerError struct {
	InnerError *Error `json:"innerError,omitempty"`
}

type GetOperationResponse

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

type ListByResourceGroupCompleteResult

type ListByResourceGroupCompleteResult struct {
	Items []Monitor
}

type ListByResourceGroupOperationResponse

type ListByResourceGroupOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]Monitor
}

type ListCompleteResult

type ListCompleteResult struct {
	Items []Monitor
}

type ListOperationResponse

type ListOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]Monitor
}

type ManagedRGConfiguration

type ManagedRGConfiguration struct {
	Name *string `json:"name,omitempty"`
}

type Monitor

type Monitor struct {
	Id         *string                   `json:"id,omitempty"`
	Identity   *identity.UserAssignedMap `json:"identity,omitempty"`
	Location   string                    `json:"location"`
	Name       *string                   `json:"name,omitempty"`
	Properties *MonitorProperties        `json:"properties,omitempty"`
	SystemData *systemdata.SystemData    `json:"systemData,omitempty"`
	Tags       *map[string]string        `json:"tags,omitempty"`
	Type       *string                   `json:"type,omitempty"`
}

type MonitorId

type MonitorId struct {
	SubscriptionId    string
	ResourceGroupName string
	MonitorName       string
}

MonitorId is a struct representing the Resource ID for a Monitor

func NewMonitorID

func NewMonitorID(subscriptionId string, resourceGroupName string, monitorName string) MonitorId

NewMonitorID returns a new MonitorId struct

func ParseMonitorID

func ParseMonitorID(input string) (*MonitorId, error)

ParseMonitorID parses 'input' into a MonitorId

func ParseMonitorIDInsensitively

func ParseMonitorIDInsensitively(input string) (*MonitorId, error)

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

func (MonitorId) ID

func (id MonitorId) ID() string

ID returns the formatted Monitor ID

func (MonitorId) Segments

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

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

func (MonitorId) String

func (id MonitorId) String() string

String returns a human-readable description of this Monitor ID

type MonitorOperationPredicate

type MonitorOperationPredicate struct {
	Id       *string
	Location *string
	Name     *string
	Type     *string
}

func (MonitorOperationPredicate) Matches

func (p MonitorOperationPredicate) Matches(input Monitor) bool

type MonitorProperties

type MonitorProperties struct {
	AppLocation                       *string                           `json:"appLocation,omitempty"`
	Errors                            *Error                            `json:"errors,omitempty"`
	LogAnalyticsWorkspaceArmId        *string                           `json:"logAnalyticsWorkspaceArmId,omitempty"`
	ManagedResourceGroupConfiguration *ManagedRGConfiguration           `json:"managedResourceGroupConfiguration,omitempty"`
	MonitorSubnet                     *string                           `json:"monitorSubnet,omitempty"`
	MsiArmId                          *string                           `json:"msiArmId,omitempty"`
	ProvisioningState                 *WorkloadMonitorProvisioningState `json:"provisioningState,omitempty"`
	RoutingPreference                 *RoutingPreference                `json:"routingPreference,omitempty"`
	StorageAccountArmId               *string                           `json:"storageAccountArmId,omitempty"`
	ZoneRedundancyPreference          *string                           `json:"zoneRedundancyPreference,omitempty"`
}

type MonitorsClient

type MonitorsClient struct {
	Client *resourcemanager.Client
}

func NewMonitorsClientWithBaseURI

func NewMonitorsClientWithBaseURI(api environments.Api) (*MonitorsClient, error)

func (MonitorsClient) Create

func (c MonitorsClient) Create(ctx context.Context, id MonitorId, input Monitor) (result CreateOperationResponse, err error)

Create ...

func (MonitorsClient) CreateThenPoll

func (c MonitorsClient) CreateThenPoll(ctx context.Context, id MonitorId, input Monitor) error

CreateThenPoll performs Create then polls until it's completed

func (MonitorsClient) Delete

func (c MonitorsClient) Delete(ctx context.Context, id MonitorId) (result DeleteOperationResponse, err error)

Delete ...

func (MonitorsClient) DeleteThenPoll

func (c MonitorsClient) DeleteThenPoll(ctx context.Context, id MonitorId) error

DeleteThenPoll performs Delete then polls until it's completed

func (MonitorsClient) Get

func (c MonitorsClient) Get(ctx context.Context, id MonitorId) (result GetOperationResponse, err error)

Get ...

func (MonitorsClient) List

List ...

func (MonitorsClient) ListByResourceGroup

ListByResourceGroup ...

func (MonitorsClient) ListByResourceGroupComplete

ListByResourceGroupComplete retrieves all the results into a single object

func (MonitorsClient) ListByResourceGroupCompleteMatchingPredicate

func (c MonitorsClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate MonitorOperationPredicate) (result ListByResourceGroupCompleteResult, err error)

ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (MonitorsClient) ListComplete

ListComplete retrieves all the results into a single object

func (MonitorsClient) ListCompleteMatchingPredicate

func (c MonitorsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate MonitorOperationPredicate) (result ListCompleteResult, err error)

ListCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (MonitorsClient) Update

Update ...

type OperationStatusResult

type OperationStatusResult struct {
	EndTime         *string                  `json:"endTime,omitempty"`
	Error           *ErrorDetail             `json:"error,omitempty"`
	Id              *string                  `json:"id,omitempty"`
	Name            *string                  `json:"name,omitempty"`
	Operations      *[]OperationStatusResult `json:"operations,omitempty"`
	PercentComplete *float64                 `json:"percentComplete,omitempty"`
	StartTime       *string                  `json:"startTime,omitempty"`
	Status          string                   `json:"status"`
}

func (*OperationStatusResult) GetEndTimeAsTime

func (o *OperationStatusResult) GetEndTimeAsTime() (*time.Time, error)

func (*OperationStatusResult) GetStartTimeAsTime

func (o *OperationStatusResult) GetStartTimeAsTime() (*time.Time, error)

func (*OperationStatusResult) SetEndTimeAsTime

func (o *OperationStatusResult) SetEndTimeAsTime(input time.Time)

func (*OperationStatusResult) SetStartTimeAsTime

func (o *OperationStatusResult) SetStartTimeAsTime(input time.Time)

type RoutingPreference

type RoutingPreference string
const (
	RoutingPreferenceDefault  RoutingPreference = "Default"
	RoutingPreferenceRouteAll RoutingPreference = "RouteAll"
)

func (*RoutingPreference) UnmarshalJSON added in v0.20230406.1124617

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

type UpdateMonitorRequest

type UpdateMonitorRequest struct {
	Identity *identity.UserAssignedMap `json:"identity,omitempty"`
	Tags     *map[string]string        `json:"tags,omitempty"`
}

type UpdateOperationResponse

type UpdateOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *Monitor
}

type WorkloadMonitorProvisioningState

type WorkloadMonitorProvisioningState string
const (
	WorkloadMonitorProvisioningStateAccepted  WorkloadMonitorProvisioningState = "Accepted"
	WorkloadMonitorProvisioningStateCreating  WorkloadMonitorProvisioningState = "Creating"
	WorkloadMonitorProvisioningStateDeleting  WorkloadMonitorProvisioningState = "Deleting"
	WorkloadMonitorProvisioningStateFailed    WorkloadMonitorProvisioningState = "Failed"
	WorkloadMonitorProvisioningStateMigrating WorkloadMonitorProvisioningState = "Migrating"
	WorkloadMonitorProvisioningStateSucceeded WorkloadMonitorProvisioningState = "Succeeded"
	WorkloadMonitorProvisioningStateUpdating  WorkloadMonitorProvisioningState = "Updating"
)

func (*WorkloadMonitorProvisioningState) UnmarshalJSON added in v0.20230406.1124617

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

Jump to

Keyboard shortcuts

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