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 ¶
- func PossibleValuesForRoutingPreference() []string
- func PossibleValuesForWorkloadMonitorProvisioningState() []string
- func ValidateMonitorID(input interface{}, key string) (warnings []string, errors []error)
- type CreateOperationResponse
- type DeleteOperationResponse
- type Error
- type ErrorAdditionalInfo
- type ErrorDetail
- type ErrorInnerError
- type GetOperationResponse
- type ListByResourceGroupCompleteResult
- type ListByResourceGroupOperationResponse
- type ListCompleteResult
- type ListOperationResponse
- type ManagedRGConfiguration
- type Monitor
- type MonitorId
- type MonitorOperationPredicate
- type MonitorProperties
- type MonitorsClient
- func (c MonitorsClient) Create(ctx context.Context, id MonitorId, input Monitor) (result CreateOperationResponse, err error)
- func (c MonitorsClient) CreateThenPoll(ctx context.Context, id MonitorId, input Monitor) error
- func (c MonitorsClient) Delete(ctx context.Context, id MonitorId) (result DeleteOperationResponse, err error)
- func (c MonitorsClient) DeleteThenPoll(ctx context.Context, id MonitorId) error
- func (c MonitorsClient) Get(ctx context.Context, id MonitorId) (result GetOperationResponse, err error)
- func (c MonitorsClient) List(ctx context.Context, id commonids.SubscriptionId) (result ListOperationResponse, err error)
- func (c MonitorsClient) ListByResourceGroup(ctx context.Context, id commonids.ResourceGroupId) (result ListByResourceGroupOperationResponse, err error)
- func (c MonitorsClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (ListByResourceGroupCompleteResult, error)
- func (c MonitorsClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, ...) (result ListByResourceGroupCompleteResult, err error)
- func (c MonitorsClient) ListComplete(ctx context.Context, id commonids.SubscriptionId) (ListCompleteResult, error)
- func (c MonitorsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, ...) (result ListCompleteResult, err error)
- func (c MonitorsClient) Update(ctx context.Context, id MonitorId, input UpdateMonitorRequest) (result UpdateOperationResponse, err error)
- type OperationStatusResult
- type RoutingPreference
- type UpdateMonitorRequest
- type UpdateOperationResponse
- type WorkloadMonitorProvisioningState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PossibleValuesForRoutingPreference ¶
func PossibleValuesForRoutingPreference() []string
func PossibleValuesForWorkloadMonitorProvisioningState ¶
func PossibleValuesForWorkloadMonitorProvisioningState() []string
func ValidateMonitorID ¶
ValidateMonitorID checks that 'input' can be parsed as a Monitor ID
Types ¶
type CreateOperationResponse ¶
type DeleteOperationResponse ¶
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 ListByResourceGroupCompleteResult ¶
type ListByResourceGroupCompleteResult struct {
Items []Monitor
}
type ListCompleteResult ¶
type ListCompleteResult struct {
Items []Monitor
}
type ListOperationResponse ¶
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 ¶
MonitorId is a struct representing the Resource ID for a Monitor
func NewMonitorID ¶
NewMonitorID returns a new MonitorId struct
func ParseMonitorID ¶
ParseMonitorID parses 'input' into a MonitorId
func ParseMonitorIDInsensitively ¶
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) Segments ¶
func (id MonitorId) Segments() []resourceids.Segment
Segments returns a slice of Resource ID Segments which comprise this Monitor ID
type MonitorOperationPredicate ¶
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(sdkApi sdkEnv.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 ¶
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 ¶
func (c MonitorsClient) List(ctx context.Context, id commonids.SubscriptionId) (result ListOperationResponse, err error)
List ...
func (MonitorsClient) ListByResourceGroup ¶
func (c MonitorsClient) ListByResourceGroup(ctx context.Context, id commonids.ResourceGroupId) (result ListByResourceGroupOperationResponse, err error)
ListByResourceGroup ...
func (MonitorsClient) ListByResourceGroupComplete ¶
func (c MonitorsClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (ListByResourceGroupCompleteResult, error)
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 ¶
func (c MonitorsClient) ListComplete(ctx context.Context, id commonids.SubscriptionId) (ListCompleteResult, error)
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 ¶
func (c MonitorsClient) Update(ctx context.Context, id MonitorId, input UpdateMonitorRequest) (result UpdateOperationResponse, err error)
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 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
Source Files ¶
- client.go
- constants.go
- id_monitor.go
- method_create.go
- method_delete.go
- method_get.go
- method_list.go
- method_listbyresourcegroup.go
- method_update.go
- model_error.go
- model_erroradditionalinfo.go
- model_errordetail.go
- model_errorinnererror.go
- model_managedrgconfiguration.go
- model_monitor.go
- model_monitorproperties.go
- model_operationstatusresult.go
- model_updatemonitorrequest.go
- predicates.go
- version.go