serveradvisors

package
v0.20230622.1085613 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2023 License: MPL-2.0 Imports: 12 Imported by: 0

README

github.com/hashicorp/go-azure-sdk/resource-manager/sql/2021-02-01-preview/serveradvisors Documentation

The serveradvisors SDK allows for interaction with the Azure Resource Manager Service sql (API Version 2021-02-01-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-sdk/resource-manager/sql/2021-02-01-preview/serveradvisors"

Client Initialization

client := serveradvisors.NewServerAdvisorsClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: ServerAdvisorsClient.Get

ctx := context.TODO()
id := serveradvisors.NewAdvisorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverValue", "advisorValue")

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: ServerAdvisorsClient.ListByServer

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

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

Example Usage: ServerAdvisorsClient.Update

ctx := context.TODO()
id := serveradvisors.NewAdvisorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverValue", "advisorValue")

payload := serveradvisors.Advisor{
	// ...
}


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 PossibleValuesForAdvisorStatus

func PossibleValuesForAdvisorStatus() []string

func PossibleValuesForAutoExecuteStatus

func PossibleValuesForAutoExecuteStatus() []string

func PossibleValuesForAutoExecuteStatusInheritedFrom

func PossibleValuesForAutoExecuteStatusInheritedFrom() []string

func PossibleValuesForImplementationMethod

func PossibleValuesForImplementationMethod() []string

func PossibleValuesForIsRetryable

func PossibleValuesForIsRetryable() []string

func PossibleValuesForRecommendedActionCurrentState

func PossibleValuesForRecommendedActionCurrentState() []string

func PossibleValuesForRecommendedActionInitiatedBy

func PossibleValuesForRecommendedActionInitiatedBy() []string

func ValidateAdvisorID

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

ValidateAdvisorID checks that 'input' can be parsed as a Advisor ID

func ValidateServerID

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

ValidateServerID checks that 'input' can be parsed as a Server ID

Types

type Advisor

type Advisor struct {
	Id         *string            `json:"id,omitempty"`
	Kind       *string            `json:"kind,omitempty"`
	Location   *string            `json:"location,omitempty"`
	Name       *string            `json:"name,omitempty"`
	Properties *AdvisorProperties `json:"properties,omitempty"`
	Type       *string            `json:"type,omitempty"`
}

type AdvisorId

type AdvisorId struct {
	SubscriptionId    string
	ResourceGroupName string
	ServerName        string
	AdvisorName       string
}

AdvisorId is a struct representing the Resource ID for a Advisor

func NewAdvisorID

func NewAdvisorID(subscriptionId string, resourceGroupName string, serverName string, advisorName string) AdvisorId

NewAdvisorID returns a new AdvisorId struct

func ParseAdvisorID

func ParseAdvisorID(input string) (*AdvisorId, error)

ParseAdvisorID parses 'input' into a AdvisorId

func ParseAdvisorIDInsensitively

func ParseAdvisorIDInsensitively(input string) (*AdvisorId, error)

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

func (AdvisorId) ID

func (id AdvisorId) ID() string

ID returns the formatted Advisor ID

func (AdvisorId) Segments

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

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

func (AdvisorId) String

func (id AdvisorId) String() string

String returns a human-readable description of this Advisor ID

type AdvisorProperties

type AdvisorProperties struct {
	AdvisorStatus                  *AdvisorStatus                  `json:"advisorStatus,omitempty"`
	AutoExecuteStatus              AutoExecuteStatus               `json:"autoExecuteStatus"`
	AutoExecuteStatusInheritedFrom *AutoExecuteStatusInheritedFrom `json:"autoExecuteStatusInheritedFrom,omitempty"`
	LastChecked                    *string                         `json:"lastChecked,omitempty"`
	RecommendationsStatus          *string                         `json:"recommendationsStatus,omitempty"`
	RecommendedActions             *[]RecommendedAction            `json:"recommendedActions,omitempty"`
}

func (*AdvisorProperties) GetLastCheckedAsTime

func (o *AdvisorProperties) GetLastCheckedAsTime() (*time.Time, error)

func (*AdvisorProperties) SetLastCheckedAsTime

func (o *AdvisorProperties) SetLastCheckedAsTime(input time.Time)

type AdvisorStatus

type AdvisorStatus string
const (
	AdvisorStatusGA                   AdvisorStatus = "GA"
	AdvisorStatusLimitedPublicPreview AdvisorStatus = "LimitedPublicPreview"
	AdvisorStatusPrivatePreview       AdvisorStatus = "PrivatePreview"
	AdvisorStatusPublicPreview        AdvisorStatus = "PublicPreview"
)

func (*AdvisorStatus) UnmarshalJSON

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

type AutoExecuteStatus

type AutoExecuteStatus string
const (
	AutoExecuteStatusDefault  AutoExecuteStatus = "Default"
	AutoExecuteStatusDisabled AutoExecuteStatus = "Disabled"
	AutoExecuteStatusEnabled  AutoExecuteStatus = "Enabled"
)

func (*AutoExecuteStatus) UnmarshalJSON

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

type AutoExecuteStatusInheritedFrom

type AutoExecuteStatusInheritedFrom string
const (
	AutoExecuteStatusInheritedFromDatabase     AutoExecuteStatusInheritedFrom = "Database"
	AutoExecuteStatusInheritedFromDefault      AutoExecuteStatusInheritedFrom = "Default"
	AutoExecuteStatusInheritedFromElasticPool  AutoExecuteStatusInheritedFrom = "ElasticPool"
	AutoExecuteStatusInheritedFromServer       AutoExecuteStatusInheritedFrom = "Server"
	AutoExecuteStatusInheritedFromSubscription AutoExecuteStatusInheritedFrom = "Subscription"
)

func (*AutoExecuteStatusInheritedFrom) UnmarshalJSON

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

type GetOperationResponse

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

type ImplementationMethod

type ImplementationMethod string
const (
	ImplementationMethodAzurePowerShell ImplementationMethod = "AzurePowerShell"
	ImplementationMethodTSql            ImplementationMethod = "TSql"
)

func (*ImplementationMethod) UnmarshalJSON

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

type IsRetryable

type IsRetryable string
const (
	IsRetryableNo  IsRetryable = "No"
	IsRetryableYes IsRetryable = "Yes"
)

func (*IsRetryable) UnmarshalJSON

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

type ListByServerOperationOptions

type ListByServerOperationOptions struct {
	Expand *string
}

func DefaultListByServerOperationOptions

func DefaultListByServerOperationOptions() ListByServerOperationOptions

func (ListByServerOperationOptions) ToHeaders

func (ListByServerOperationOptions) ToOData

func (ListByServerOperationOptions) ToQuery

type ListByServerOperationResponse

type ListByServerOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]Advisor
}

type RecommendedAction

type RecommendedAction struct {
	Id         *string                      `json:"id,omitempty"`
	Kind       *string                      `json:"kind,omitempty"`
	Location   *string                      `json:"location,omitempty"`
	Name       *string                      `json:"name,omitempty"`
	Properties *RecommendedActionProperties `json:"properties,omitempty"`
	Type       *string                      `json:"type,omitempty"`
}

type RecommendedActionCurrentState

type RecommendedActionCurrentState string
const (
	RecommendedActionCurrentStateActive          RecommendedActionCurrentState = "Active"
	RecommendedActionCurrentStateError           RecommendedActionCurrentState = "Error"
	RecommendedActionCurrentStateExecuting       RecommendedActionCurrentState = "Executing"
	RecommendedActionCurrentStateExpired         RecommendedActionCurrentState = "Expired"
	RecommendedActionCurrentStateIgnored         RecommendedActionCurrentState = "Ignored"
	RecommendedActionCurrentStateMonitoring      RecommendedActionCurrentState = "Monitoring"
	RecommendedActionCurrentStatePending         RecommendedActionCurrentState = "Pending"
	RecommendedActionCurrentStatePendingRevert   RecommendedActionCurrentState = "PendingRevert"
	RecommendedActionCurrentStateResolved        RecommendedActionCurrentState = "Resolved"
	RecommendedActionCurrentStateRevertCancelled RecommendedActionCurrentState = "RevertCancelled"
	RecommendedActionCurrentStateReverted        RecommendedActionCurrentState = "Reverted"
	RecommendedActionCurrentStateReverting       RecommendedActionCurrentState = "Reverting"
	RecommendedActionCurrentStateSuccess         RecommendedActionCurrentState = "Success"
	RecommendedActionCurrentStateVerifying       RecommendedActionCurrentState = "Verifying"
)

func (*RecommendedActionCurrentState) UnmarshalJSON

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

type RecommendedActionErrorInfo

type RecommendedActionErrorInfo struct {
	ErrorCode   *string      `json:"errorCode,omitempty"`
	IsRetryable *IsRetryable `json:"isRetryable,omitempty"`
}

type RecommendedActionImpactRecord

type RecommendedActionImpactRecord struct {
	AbsoluteValue       *float64 `json:"absoluteValue,omitempty"`
	ChangeValueAbsolute *float64 `json:"changeValueAbsolute,omitempty"`
	ChangeValueRelative *float64 `json:"changeValueRelative,omitempty"`
	DimensionName       *string  `json:"dimensionName,omitempty"`
	Unit                *string  `json:"unit,omitempty"`
}

type RecommendedActionImplementationInfo

type RecommendedActionImplementationInfo struct {
	Method *ImplementationMethod `json:"method,omitempty"`
	Script *string               `json:"script,omitempty"`
}

type RecommendedActionInitiatedBy

type RecommendedActionInitiatedBy string
const (
	RecommendedActionInitiatedBySystem RecommendedActionInitiatedBy = "System"
	RecommendedActionInitiatedByUser   RecommendedActionInitiatedBy = "User"
)

func (*RecommendedActionInitiatedBy) UnmarshalJSON

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

type RecommendedActionMetricInfo

type RecommendedActionMetricInfo struct {
	MetricName *string  `json:"metricName,omitempty"`
	StartTime  *string  `json:"startTime,omitempty"`
	TimeGrain  *string  `json:"timeGrain,omitempty"`
	Unit       *string  `json:"unit,omitempty"`
	Value      *float64 `json:"value,omitempty"`
}

func (*RecommendedActionMetricInfo) GetStartTimeAsTime

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

func (*RecommendedActionMetricInfo) SetStartTimeAsTime

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

type RecommendedActionProperties

type RecommendedActionProperties struct {
	Details                    *map[string]interface{}              `json:"details,omitempty"`
	ErrorDetails               *RecommendedActionErrorInfo          `json:"errorDetails,omitempty"`
	EstimatedImpact            *[]RecommendedActionImpactRecord     `json:"estimatedImpact,omitempty"`
	ExecuteActionDuration      *string                              `json:"executeActionDuration,omitempty"`
	ExecuteActionInitiatedBy   *RecommendedActionInitiatedBy        `json:"executeActionInitiatedBy,omitempty"`
	ExecuteActionInitiatedTime *string                              `json:"executeActionInitiatedTime,omitempty"`
	ExecuteActionStartTime     *string                              `json:"executeActionStartTime,omitempty"`
	ImplementationDetails      *RecommendedActionImplementationInfo `json:"implementationDetails,omitempty"`
	IsArchivedAction           *bool                                `json:"isArchivedAction,omitempty"`
	IsExecutableAction         *bool                                `json:"isExecutableAction,omitempty"`
	IsRevertableAction         *bool                                `json:"isRevertableAction,omitempty"`
	LastRefresh                *string                              `json:"lastRefresh,omitempty"`
	LinkedObjects              *[]string                            `json:"linkedObjects,omitempty"`
	ObservedImpact             *[]RecommendedActionImpactRecord     `json:"observedImpact,omitempty"`
	RecommendationReason       *string                              `json:"recommendationReason,omitempty"`
	RevertActionDuration       *string                              `json:"revertActionDuration,omitempty"`
	RevertActionInitiatedBy    *RecommendedActionInitiatedBy        `json:"revertActionInitiatedBy,omitempty"`
	RevertActionInitiatedTime  *string                              `json:"revertActionInitiatedTime,omitempty"`
	RevertActionStartTime      *string                              `json:"revertActionStartTime,omitempty"`
	Score                      *int64                               `json:"score,omitempty"`
	State                      RecommendedActionStateInfo           `json:"state"`
	TimeSeries                 *[]RecommendedActionMetricInfo       `json:"timeSeries,omitempty"`
	ValidSince                 *string                              `json:"validSince,omitempty"`
}

func (*RecommendedActionProperties) GetExecuteActionInitiatedTimeAsTime

func (o *RecommendedActionProperties) GetExecuteActionInitiatedTimeAsTime() (*time.Time, error)

func (*RecommendedActionProperties) GetExecuteActionStartTimeAsTime

func (o *RecommendedActionProperties) GetExecuteActionStartTimeAsTime() (*time.Time, error)

func (*RecommendedActionProperties) GetLastRefreshAsTime

func (o *RecommendedActionProperties) GetLastRefreshAsTime() (*time.Time, error)

func (*RecommendedActionProperties) GetRevertActionInitiatedTimeAsTime

func (o *RecommendedActionProperties) GetRevertActionInitiatedTimeAsTime() (*time.Time, error)

func (*RecommendedActionProperties) GetRevertActionStartTimeAsTime

func (o *RecommendedActionProperties) GetRevertActionStartTimeAsTime() (*time.Time, error)

func (*RecommendedActionProperties) GetValidSinceAsTime

func (o *RecommendedActionProperties) GetValidSinceAsTime() (*time.Time, error)

func (*RecommendedActionProperties) SetExecuteActionInitiatedTimeAsTime

func (o *RecommendedActionProperties) SetExecuteActionInitiatedTimeAsTime(input time.Time)

func (*RecommendedActionProperties) SetExecuteActionStartTimeAsTime

func (o *RecommendedActionProperties) SetExecuteActionStartTimeAsTime(input time.Time)

func (*RecommendedActionProperties) SetLastRefreshAsTime

func (o *RecommendedActionProperties) SetLastRefreshAsTime(input time.Time)

func (*RecommendedActionProperties) SetRevertActionInitiatedTimeAsTime

func (o *RecommendedActionProperties) SetRevertActionInitiatedTimeAsTime(input time.Time)

func (*RecommendedActionProperties) SetRevertActionStartTimeAsTime

func (o *RecommendedActionProperties) SetRevertActionStartTimeAsTime(input time.Time)

func (*RecommendedActionProperties) SetValidSinceAsTime

func (o *RecommendedActionProperties) SetValidSinceAsTime(input time.Time)

type RecommendedActionStateInfo

type RecommendedActionStateInfo struct {
	ActionInitiatedBy *RecommendedActionInitiatedBy `json:"actionInitiatedBy,omitempty"`
	CurrentValue      RecommendedActionCurrentState `json:"currentValue"`
	LastModified      *string                       `json:"lastModified,omitempty"`
}

func (*RecommendedActionStateInfo) GetLastModifiedAsTime

func (o *RecommendedActionStateInfo) GetLastModifiedAsTime() (*time.Time, error)

func (*RecommendedActionStateInfo) SetLastModifiedAsTime

func (o *RecommendedActionStateInfo) SetLastModifiedAsTime(input time.Time)

type ServerAdvisorsClient

type ServerAdvisorsClient struct {
	Client *resourcemanager.Client
}

func NewServerAdvisorsClientWithBaseURI

func NewServerAdvisorsClientWithBaseURI(api environments.Api) (*ServerAdvisorsClient, error)

func (ServerAdvisorsClient) Get

Get ...

func (ServerAdvisorsClient) ListByServer

ListByServer ...

func (ServerAdvisorsClient) Update

func (c ServerAdvisorsClient) Update(ctx context.Context, id AdvisorId, input Advisor) (result UpdateOperationResponse, err error)

Update ...

type ServerId

type ServerId struct {
	SubscriptionId    string
	ResourceGroupName string
	ServerName        string
}

ServerId is a struct representing the Resource ID for a Server

func NewServerID

func NewServerID(subscriptionId string, resourceGroupName string, serverName string) ServerId

NewServerID returns a new ServerId struct

func ParseServerID

func ParseServerID(input string) (*ServerId, error)

ParseServerID parses 'input' into a ServerId

func ParseServerIDInsensitively

func ParseServerIDInsensitively(input string) (*ServerId, error)

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

func (ServerId) ID

func (id ServerId) ID() string

ID returns the formatted Server ID

func (ServerId) Segments

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

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

func (ServerId) String

func (id ServerId) String() string

String returns a human-readable description of this Server ID

type UpdateOperationResponse

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

Jump to

Keyboard shortcuts

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