Documentation ¶
Index ¶
- type ErrorDetails
- type ErrorResponse
- type ErrorResponseError
- type HealthMonitor
- type HealthMonitorList
- type HealthMonitorProperties
- type HealthMonitorStateChange
- type HealthMonitorStateChangeList
- type HealthMonitorStateChangeProperties
- type HealthMonitorsClient
- func (client *HealthMonitorsClient) Get(ctx context.Context, subscriptionID string, resourceGroupName string, ...) (HealthMonitorsClientGetResponse, error)
- func (client *HealthMonitorsClient) GetStateChange(ctx context.Context, subscriptionID string, resourceGroupName string, ...) (HealthMonitorsClientGetStateChangeResponse, error)
- func (client *HealthMonitorsClient) NewListPager(subscriptionID string, resourceGroupName string, providerName string, ...) *runtime.Pager[HealthMonitorsClientListResponse]
- func (client *HealthMonitorsClient) NewListStateChangesPager(subscriptionID string, resourceGroupName string, providerName string, ...) *runtime.Pager[HealthMonitorsClientListStateChangesResponse]
- type HealthMonitorsClientGetOptions
- type HealthMonitorsClientGetResponse
- type HealthMonitorsClientGetStateChangeOptions
- type HealthMonitorsClientGetStateChangeResponse
- type HealthMonitorsClientListOptions
- type HealthMonitorsClientListResponse
- type HealthMonitorsClientListStateChangesOptions
- type HealthMonitorsClientListStateChangesResponse
- type HealthState
- type Operation
- type OperationDisplay
- type OperationList
- type OperationsClient
- type OperationsClientListOptions
- type OperationsClientListResponse
- type Resource
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrorDetails ¶
type ErrorDetails struct { // Error code identifying the specific error. Code *string `json:"code,omitempty"` // A human-readable error message. Message *string `json:"message,omitempty"` }
ErrorDetails - Error details
type ErrorResponse ¶
type ErrorResponse struct { // Error info. Error *ErrorResponseError `json:"error,omitempty"` }
ErrorResponse - Error response
type ErrorResponseError ¶
type ErrorResponseError struct { // Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response. Code *string `json:"code,omitempty"` // Error details. Details []*ErrorDetails `json:"details,omitempty"` // Human-readable representation of the error. Message *string `json:"message,omitempty"` }
ErrorResponseError - Error info.
type HealthMonitor ¶
type HealthMonitor struct { // Properties of the monitor's health status. Properties *HealthMonitorProperties `json:"properties,omitempty"` // READ-ONLY; The resource Id. ID *string `json:"id,omitempty" azure:"ro"` // READ-ONLY; The resource name. Name *string `json:"name,omitempty" azure:"ro"` // READ-ONLY; The resource type. Type *string `json:"type,omitempty" azure:"ro"` }
HealthMonitor - Information about the monitor’s current health status.
type HealthMonitorList ¶
type HealthMonitorList struct { // Link to next page if the list is too long. NextLink *string `json:"nextLink,omitempty"` // Array of health monitors of the virtual machine. Value []*HealthMonitor `json:"value,omitempty"` }
HealthMonitorList - Information about the current health statuses of the monitors.
type HealthMonitorProperties ¶
type HealthMonitorProperties struct { // Timestamp of the monitor's last health state change. CurrentStateFirstObservedTimestamp *string `json:"currentStateFirstObservedTimestamp,omitempty"` // Timestamp of the monitor's last health evaluation. EvaluationTimestamp *string `json:"evaluationTimestamp,omitempty"` // Evidence validating the monitor's current health state. Evidence interface{} `json:"evidence,omitempty"` // Timestamp of the monitor's last reported health state. LastReportedTimestamp *string `json:"lastReportedTimestamp,omitempty"` // The configuration settings at the time of the monitor's health evaluation. MonitorConfiguration interface{} `json:"monitorConfiguration,omitempty"` // Human-readable name of the monitor. MonitorName *string `json:"monitorName,omitempty"` // Type of the monitor. MonitorType *string `json:"monitorType,omitempty"` // Dynamic monitored object of the monitor. MonitoredObject *string `json:"monitoredObject,omitempty"` // Name of the parent monitor. ParentMonitorName *string `json:"parentMonitorName,omitempty"` // READ-ONLY; Current health state of the monitor. CurrentMonitorState *HealthState `json:"currentMonitorState,omitempty" azure:"ro"` // READ-ONLY; Previous health state of the monitor. PreviousMonitorState *HealthState `json:"previousMonitorState,omitempty" azure:"ro"` }
HealthMonitorProperties - Properties of the monitor.
type HealthMonitorStateChange ¶
type HealthMonitorStateChange struct { // Properties of the monitor's state change. Properties *HealthMonitorStateChangeProperties `json:"properties,omitempty"` // READ-ONLY; The resource Id. ID *string `json:"id,omitempty" azure:"ro"` // READ-ONLY; The resource name. Name *string `json:"name,omitempty" azure:"ro"` // READ-ONLY; The resource type. Type *string `json:"type,omitempty" azure:"ro"` }
HealthMonitorStateChange - Information about the monitor’s health state change at the provided timestamp.
type HealthMonitorStateChangeList ¶
type HealthMonitorStateChangeList struct { // Link to next page if the list is too long. NextLink *string `json:"nextLink,omitempty"` // Array of health state changes within the specified time window. Value []*HealthMonitorStateChange `json:"value,omitempty"` }
HealthMonitorStateChangeList - Information about the health state changes of the monitor within the provided time window.
type HealthMonitorStateChangeProperties ¶
type HealthMonitorStateChangeProperties struct { // Timestamp of the monitor's last health state change. CurrentStateFirstObservedTimestamp *string `json:"currentStateFirstObservedTimestamp,omitempty"` // Timestamp of the monitor's last health evaluation. EvaluationTimestamp *string `json:"evaluationTimestamp,omitempty"` // Evidence validating the monitor's current health state. Evidence interface{} `json:"evidence,omitempty"` // The configuration settings at the time of the monitor's health evaluation. MonitorConfiguration interface{} `json:"monitorConfiguration,omitempty"` // Human-readable name of the monitor. MonitorName *string `json:"monitorName,omitempty"` // Type of the monitor. MonitorType *string `json:"monitorType,omitempty"` // Dynamic monitored object of the monitor. MonitoredObject *string `json:"monitoredObject,omitempty"` // READ-ONLY; Current health state of the monitor. CurrentMonitorState *HealthState `json:"currentMonitorState,omitempty" azure:"ro"` // READ-ONLY; Previous health state of the monitor. PreviousMonitorState *HealthState `json:"previousMonitorState,omitempty" azure:"ro"` }
HealthMonitorStateChangeProperties - Properties of the monitor.
type HealthMonitorsClient ¶
type HealthMonitorsClient struct {
// contains filtered or unexported fields
}
HealthMonitorsClient contains the methods for the HealthMonitors group. Don't use this type directly, use NewHealthMonitorsClient() instead.
func NewHealthMonitorsClient ¶
func NewHealthMonitorsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*HealthMonitorsClient, error)
NewHealthMonitorsClient creates a new instance of HealthMonitorsClient with the specified values. credential - used to authorize requests. Usually a credential from azidentity. options - pass nil to accept the default values.
func (*HealthMonitorsClient) Get ¶
func (client *HealthMonitorsClient) Get(ctx context.Context, subscriptionID string, resourceGroupName string, providerName string, resourceCollectionName string, resourceName string, monitorID string, options *HealthMonitorsClientGetOptions) (HealthMonitorsClientGetResponse, error)
Get - Get the current health status of a monitor of a virtual machine. Optional parameter: $expand (retrieve the monitor's evidence and configuration). If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2020-01-13-preview subscriptionID - The subscription Id of the virtual machine. resourceGroupName - The resource group of the virtual machine. providerName - The provider name (ex: Microsoft.Compute for virtual machines). resourceCollectionName - The resource collection name (ex: virtualMachines for virtual machines). resourceName - The name of the virtual machine. monitorID - The monitor Id of the virtual machine. options - HealthMonitorsClientGetOptions contains the optional parameters for the HealthMonitorsClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloadmonitor/resource-manager/Microsoft.WorkloadMonitor/preview/2020-01-13-preview/examples/Monitor_GetDefault.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/workloadmonitor/armworkloadmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client, err := armworkloadmonitor.NewHealthMonitorsClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := client.Get(ctx, "bc27da3b-3ba2-4e00-a6ec-1fde64aa1e21", "tugamidiAlerts", "Microsoft.Compute", "virtualMachines", "linuxEUS", "logical-disks|C@3A|free-space", &armworkloadmonitor.HealthMonitorsClientGetOptions{Expand: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // TODO: use response item _ = res }
Output:
func (*HealthMonitorsClient) GetStateChange ¶
func (client *HealthMonitorsClient) GetStateChange(ctx context.Context, subscriptionID string, resourceGroupName string, providerName string, resourceCollectionName string, resourceName string, monitorID string, timestampUnix string, options *HealthMonitorsClientGetStateChangeOptions) (HealthMonitorsClientGetStateChangeResponse, error)
GetStateChange - Get the health state change of a monitor of a virtual machine at the provided timestamp. Optional parameter: $expand (retrieve the monitor's evidence and configuration). If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2020-01-13-preview subscriptionID - The subscription Id of the virtual machine. resourceGroupName - The resource group of the virtual machine. providerName - The provider name (ex: Microsoft.Compute for virtual machines). resourceCollectionName - The resource collection name (ex: virtualMachines for virtual machines). resourceName - The name of the virtual machine. monitorID - The monitor Id of the virtual machine. timestampUnix - The timestamp of the state change (unix format). options - HealthMonitorsClientGetStateChangeOptions contains the optional parameters for the HealthMonitorsClient.GetStateChange method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloadmonitor/resource-manager/Microsoft.WorkloadMonitor/preview/2020-01-13-preview/examples/MonitorStateChange_GetDefault.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/workloadmonitor/armworkloadmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client, err := armworkloadmonitor.NewHealthMonitorsClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := client.GetStateChange(ctx, "bc27da3b-3ba2-4e00-a6ec-1fde64aa1e21", "tugamidiAlerts", "Microsoft.Compute", "virtualMachines", "linuxEUS", "logical-disks|C@3A", "1584316800", &armworkloadmonitor.HealthMonitorsClientGetStateChangeOptions{Expand: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // TODO: use response item _ = res }
Output:
func (*HealthMonitorsClient) NewListPager ¶
func (client *HealthMonitorsClient) NewListPager(subscriptionID string, resourceGroupName string, providerName string, resourceCollectionName string, resourceName string, options *HealthMonitorsClientListOptions) *runtime.Pager[HealthMonitorsClientListResponse]
NewListPager - Get the current health status of all monitors of a virtual machine. Optional parameters: $expand (retrieve the monitor's evidence and configuration) and $filter (filter by monitor name). If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2020-01-13-preview subscriptionID - The subscription Id of the virtual machine. resourceGroupName - The resource group of the virtual machine. providerName - The provider name (ex: Microsoft.Compute for virtual machines). resourceCollectionName - The resource collection name (ex: virtualMachines for virtual machines). resourceName - The name of the virtual machine. options - HealthMonitorsClientListOptions contains the optional parameters for the HealthMonitorsClient.List method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloadmonitor/resource-manager/Microsoft.WorkloadMonitor/preview/2020-01-13-preview/examples/MonitorList_GetDefault.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/workloadmonitor/armworkloadmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client, err := armworkloadmonitor.NewHealthMonitorsClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := client.NewListPager("bc27da3b-3ba2-4e00-a6ec-1fde64aa1e21", "tugamidiAlerts", "Microsoft.Compute", "virtualMachines", "linuxEUS", &armworkloadmonitor.HealthMonitorsClientListOptions{Filter: nil, Expand: nil, }) for pager.More() { nextResult, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range nextResult.Value { // TODO: use page item _ = v } } }
Output:
func (*HealthMonitorsClient) NewListStateChangesPager ¶
func (client *HealthMonitorsClient) NewListStateChangesPager(subscriptionID string, resourceGroupName string, providerName string, resourceCollectionName string, resourceName string, monitorID string, options *HealthMonitorsClientListStateChangesOptions) *runtime.Pager[HealthMonitorsClientListStateChangesResponse]
NewListStateChangesPager - Get the health state changes of a monitor of a virtual machine within the provided time window (default is the last 24 hours). Optional parameters: $expand (retrieve the monitor's evidence and configuration) and $filter (filter by heartbeat condition). If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2020-01-13-preview subscriptionID - The subscription Id of the virtual machine. resourceGroupName - The resource group of the virtual machine. providerName - The provider name (ex: Microsoft.Compute for virtual machines). resourceCollectionName - The resource collection name (ex: virtualMachines for virtual machines). resourceName - The name of the virtual machine. monitorID - The monitor Id of the virtual machine. options - HealthMonitorsClientListStateChangesOptions contains the optional parameters for the HealthMonitorsClient.ListStateChanges method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloadmonitor/resource-manager/Microsoft.WorkloadMonitor/preview/2020-01-13-preview/examples/MonitorHistory_GetDefault.json
package main import ( "context" "log" "time" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/workloadmonitor/armworkloadmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client, err := armworkloadmonitor.NewHealthMonitorsClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := client.NewListStateChangesPager("bc27da3b-3ba2-4e00-a6ec-1fde64aa1e21", "tugamidiAlerts", "Microsoft.Compute", "virtualMachines", "linuxEUS", "logical-disks|C@3A", &armworkloadmonitor.HealthMonitorsClientListStateChangesOptions{Filter: nil, Expand: nil, StartTimestampUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-19T19:24:14Z"); return t }()), EndTimestampUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-20T01:24:14Z"); return t }()), }) for pager.More() { nextResult, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range nextResult.Value { // TODO: use page item _ = v } } }
Output:
type HealthMonitorsClientGetOptions ¶
type HealthMonitorsClientGetOptions struct { // Optionally expand the monitor’s evidence and/or configuration. Example: $expand=evidence,configuration. Expand *string }
HealthMonitorsClientGetOptions contains the optional parameters for the HealthMonitorsClient.Get method.
type HealthMonitorsClientGetResponse ¶
type HealthMonitorsClientGetResponse struct {
HealthMonitor
}
HealthMonitorsClientGetResponse contains the response from method HealthMonitorsClient.Get.
type HealthMonitorsClientGetStateChangeOptions ¶
type HealthMonitorsClientGetStateChangeOptions struct { // Optionally expand the monitor’s evidence and/or configuration. Example: $expand=evidence,configuration. Expand *string }
HealthMonitorsClientGetStateChangeOptions contains the optional parameters for the HealthMonitorsClient.GetStateChange method.
type HealthMonitorsClientGetStateChangeResponse ¶
type HealthMonitorsClientGetStateChangeResponse struct {
HealthMonitorStateChange
}
HealthMonitorsClientGetStateChangeResponse contains the response from method HealthMonitorsClient.GetStateChange.
type HealthMonitorsClientListOptions ¶
type HealthMonitorsClientListOptions struct { // Optionally expand the monitor’s evidence and/or configuration. Example: $expand=evidence,configuration. Expand *string // Optionally filter by monitor name. Example: $filter=monitorName eq 'logical-disks|C:|disk-free-space-mb.' Filter *string }
HealthMonitorsClientListOptions contains the optional parameters for the HealthMonitorsClient.List method.
type HealthMonitorsClientListResponse ¶
type HealthMonitorsClientListResponse struct {
HealthMonitorList
}
HealthMonitorsClientListResponse contains the response from method HealthMonitorsClient.List.
type HealthMonitorsClientListStateChangesOptions ¶
type HealthMonitorsClientListStateChangesOptions struct { // The end of the time window. EndTimestampUTC *time.Time // Optionally expand the monitor’s evidence and/or configuration. Example: $expand=evidence,configuration. Expand *string // Optionally filter by heartbeat condition. Example: $filter=isHeartbeat eq false. Filter *string // The start of the time window. StartTimestampUTC *time.Time }
HealthMonitorsClientListStateChangesOptions contains the optional parameters for the HealthMonitorsClient.ListStateChanges method.
type HealthMonitorsClientListStateChangesResponse ¶
type HealthMonitorsClientListStateChangesResponse struct {
HealthMonitorStateChangeList
}
HealthMonitorsClientListStateChangesResponse contains the response from method HealthMonitorsClient.ListStateChanges.
type HealthState ¶
type HealthState string
HealthState - One of health states - healthy, critical, warning, unknown, none, disabled.
const ( HealthStateCritical HealthState = "Critical" HealthStateDisabled HealthState = "Disabled" HealthStateHealthy HealthState = "Healthy" HealthStateNone HealthState = "None" HealthStateUnknown HealthState = "Unknown" HealthStateWarning HealthState = "Warning" )
func PossibleHealthStateValues ¶
func PossibleHealthStateValues() []HealthState
PossibleHealthStateValues returns the possible values for the HealthState const type.
type Operation ¶
type Operation struct { // REQUIRED; The localized display information for this particular operation or action. Display *OperationDisplay `json:"display,omitempty"` // REQUIRED; The name of the operation being performed on this particular object. Name *string `json:"name,omitempty"` // REQUIRED; The intended executor of the operation. Origin *string `json:"origin,omitempty"` }
Operation supported by the resource provider.
type OperationDisplay ¶
type OperationDisplay struct { // REQUIRED; Operation description. Description *string `json:"description,omitempty"` // REQUIRED; Human-readable, friendly name for the operation. Operation *string `json:"operation,omitempty"` // REQUIRED; Operation resource provider name. Provider *string `json:"provider,omitempty"` // REQUIRED; Resource on which the operation is performed. Resource *string `json:"resource,omitempty"` }
OperationDisplay - The localized display information for this particular operation or action.
type OperationList ¶
type OperationList struct { // Link to next page if the list is too long. NextLink *string `json:"nextLink,omitempty"` // Array of available REST API operations. Value []*Operation `json:"value,omitempty"` }
OperationList - List of available REST API operations
type OperationsClient ¶
type OperationsClient struct {
// contains filtered or unexported fields
}
OperationsClient contains the methods for the Operations group. Don't use this type directly, use NewOperationsClient() instead.
func NewOperationsClient ¶
func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error)
NewOperationsClient creates a new instance of OperationsClient with the specified values. credential - used to authorize requests. Usually a credential from azidentity. options - pass nil to accept the default values.
func (*OperationsClient) NewListPager ¶
func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse]
NewListPager - Get a list of all available REST API operations. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2020-01-13-preview options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloadmonitor/resource-manager/Microsoft.WorkloadMonitor/preview/2020-01-13-preview/examples/OperationList_Get.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/workloadmonitor/armworkloadmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client, err := armworkloadmonitor.NewOperationsClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := client.NewListPager(nil) for pager.More() { nextResult, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range nextResult.Value { // TODO: use page item _ = v } } }
Output:
type OperationsClientListOptions ¶
type OperationsClientListOptions struct { }
OperationsClientListOptions contains the optional parameters for the OperationsClient.List method.
type OperationsClientListResponse ¶
type OperationsClientListResponse struct {
OperationList
}
OperationsClientListResponse contains the response from method OperationsClient.List.
type Resource ¶
type Resource struct { // READ-ONLY; The resource Id. ID *string `json:"id,omitempty" azure:"ro"` // READ-ONLY; The resource name. Name *string `json:"name,omitempty" azure:"ro"` // READ-ONLY; The resource type. Type *string `json:"type,omitempty" azure:"ro"` }
Resource - The resource model definition for the ARM proxy resource, 'microsoft.workloadmonitor/monitors'.