watcher

package
v0.20240524.1090207 Latest Latest
Warning

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

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

README

github.com/hashicorp/go-azure-sdk/resource-manager/automation/2020-01-13-preview/watcher Documentation

The watcher SDK allows for interaction with the Azure Resource Manager Service automation (API Version 2020-01-13-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/automation/2020-01-13-preview/watcher"

Client Initialization

client := watcher.NewWatcherClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: WatcherClient.CreateOrUpdate

ctx := context.TODO()
id := watcher.NewWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountValue", "watcherValue")

payload := watcher.Watcher{
	// ...
}


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

Example Usage: WatcherClient.Delete

ctx := context.TODO()
id := watcher.NewWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountValue", "watcherValue")

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

Example Usage: WatcherClient.Get

ctx := context.TODO()
id := watcher.NewWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountValue", "watcherValue")

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: WatcherClient.ListByAutomationAccount

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

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

Example Usage: WatcherClient.Start

ctx := context.TODO()
id := watcher.NewWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountValue", "watcherValue")

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

Example Usage: WatcherClient.Stop

ctx := context.TODO()
id := watcher.NewWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountValue", "watcherValue")

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

Example Usage: WatcherClient.Update

ctx := context.TODO()
id := watcher.NewWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountValue", "watcherValue")

payload := watcher.WatcherUpdateParameters{
	// ...
}


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 ValidateAutomationAccountID

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

ValidateAutomationAccountID checks that 'input' can be parsed as a Automation Account ID

func ValidateWatcherID

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

ValidateWatcherID checks that 'input' can be parsed as a Watcher ID

Types

type AutomationAccountId

type AutomationAccountId struct {
	SubscriptionId        string
	ResourceGroupName     string
	AutomationAccountName string
}

AutomationAccountId is a struct representing the Resource ID for a Automation Account

func NewAutomationAccountID

func NewAutomationAccountID(subscriptionId string, resourceGroupName string, automationAccountName string) AutomationAccountId

NewAutomationAccountID returns a new AutomationAccountId struct

func ParseAutomationAccountID

func ParseAutomationAccountID(input string) (*AutomationAccountId, error)

ParseAutomationAccountID parses 'input' into a AutomationAccountId

func ParseAutomationAccountIDInsensitively

func ParseAutomationAccountIDInsensitively(input string) (*AutomationAccountId, error)

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

func (*AutomationAccountId) FromParseResult

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

func (AutomationAccountId) ID

func (id AutomationAccountId) ID() string

ID returns the formatted Automation Account ID

func (AutomationAccountId) Segments

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

Segments returns a slice of Resource ID Segments which comprise this Automation Account ID

func (AutomationAccountId) String

func (id AutomationAccountId) String() string

String returns a human-readable description of this Automation Account ID

type CreateOrUpdateOperationResponse

type CreateOrUpdateOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *Watcher
}

type DeleteOperationResponse

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

type GetOperationResponse

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

type ListByAutomationAccountCompleteResult

type ListByAutomationAccountCompleteResult struct {
	LatestHttpResponse *http.Response
	Items              []Watcher
}

type ListByAutomationAccountOperationOptions

type ListByAutomationAccountOperationOptions struct {
	Filter *string
}

func DefaultListByAutomationAccountOperationOptions

func DefaultListByAutomationAccountOperationOptions() ListByAutomationAccountOperationOptions

func (ListByAutomationAccountOperationOptions) ToHeaders added in v0.20240209.1164150

func (ListByAutomationAccountOperationOptions) ToOData added in v0.20240209.1164150

func (ListByAutomationAccountOperationOptions) ToQuery added in v0.20240209.1164150

type ListByAutomationAccountOperationResponse

type ListByAutomationAccountOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]Watcher
}

type StartOperationResponse

type StartOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
}

type StopOperationResponse

type StopOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
}

type UpdateOperationResponse

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

type Watcher

type Watcher struct {
	Etag       *string            `json:"etag,omitempty"`
	Id         *string            `json:"id,omitempty"`
	Location   *string            `json:"location,omitempty"`
	Name       *string            `json:"name,omitempty"`
	Properties *WatcherProperties `json:"properties,omitempty"`
	Tags       *map[string]string `json:"tags,omitempty"`
	Type       *string            `json:"type,omitempty"`
}

type WatcherClient

type WatcherClient struct {
	Client *resourcemanager.Client
}

func NewWatcherClientWithBaseURI

func NewWatcherClientWithBaseURI(sdkApi sdkEnv.Api) (*WatcherClient, error)

func (WatcherClient) CreateOrUpdate

func (c WatcherClient) CreateOrUpdate(ctx context.Context, id WatcherId, input Watcher) (result CreateOrUpdateOperationResponse, err error)

CreateOrUpdate ...

func (WatcherClient) Delete

func (c WatcherClient) Delete(ctx context.Context, id WatcherId) (result DeleteOperationResponse, err error)

Delete ...

func (WatcherClient) Get

func (c WatcherClient) Get(ctx context.Context, id WatcherId) (result GetOperationResponse, err error)

Get ...

func (WatcherClient) ListByAutomationAccount

ListByAutomationAccount ...

func (WatcherClient) ListByAutomationAccountComplete

ListByAutomationAccountComplete retrieves all the results into a single object

func (WatcherClient) ListByAutomationAccountCompleteMatchingPredicate

func (c WatcherClient) ListByAutomationAccountCompleteMatchingPredicate(ctx context.Context, id AutomationAccountId, options ListByAutomationAccountOperationOptions, predicate WatcherOperationPredicate) (result ListByAutomationAccountCompleteResult, err error)

ListByAutomationAccountCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (WatcherClient) Start

func (c WatcherClient) Start(ctx context.Context, id WatcherId) (result StartOperationResponse, err error)

Start ...

func (WatcherClient) Stop

func (c WatcherClient) Stop(ctx context.Context, id WatcherId) (result StopOperationResponse, err error)

Stop ...

func (WatcherClient) Update

Update ...

type WatcherId

type WatcherId struct {
	SubscriptionId        string
	ResourceGroupName     string
	AutomationAccountName string
	WatcherName           string
}

WatcherId is a struct representing the Resource ID for a Watcher

func NewWatcherID

func NewWatcherID(subscriptionId string, resourceGroupName string, automationAccountName string, watcherName string) WatcherId

NewWatcherID returns a new WatcherId struct

func ParseWatcherID

func ParseWatcherID(input string) (*WatcherId, error)

ParseWatcherID parses 'input' into a WatcherId

func ParseWatcherIDInsensitively

func ParseWatcherIDInsensitively(input string) (*WatcherId, error)

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

func (*WatcherId) FromParseResult

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

func (WatcherId) ID

func (id WatcherId) ID() string

ID returns the formatted Watcher ID

func (WatcherId) Segments

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

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

func (WatcherId) String

func (id WatcherId) String() string

String returns a human-readable description of this Watcher ID

type WatcherOperationPredicate

type WatcherOperationPredicate struct {
	Etag     *string
	Id       *string
	Location *string
	Name     *string
	Type     *string
}

func (WatcherOperationPredicate) Matches

func (p WatcherOperationPredicate) Matches(input Watcher) bool

type WatcherProperties

type WatcherProperties struct {
	CreationTime                *string            `json:"creationTime,omitempty"`
	Description                 *string            `json:"description,omitempty"`
	ExecutionFrequencyInSeconds *int64             `json:"executionFrequencyInSeconds,omitempty"`
	LastModifiedBy              *string            `json:"lastModifiedBy,omitempty"`
	LastModifiedTime            *string            `json:"lastModifiedTime,omitempty"`
	ScriptName                  *string            `json:"scriptName,omitempty"`
	ScriptParameters            *map[string]string `json:"scriptParameters,omitempty"`
	ScriptRunOn                 *string            `json:"scriptRunOn,omitempty"`
	Status                      *string            `json:"status,omitempty"`
}

func (*WatcherProperties) GetCreationTimeAsTime

func (o *WatcherProperties) GetCreationTimeAsTime() (*time.Time, error)

func (*WatcherProperties) GetLastModifiedTimeAsTime

func (o *WatcherProperties) GetLastModifiedTimeAsTime() (*time.Time, error)

func (*WatcherProperties) SetCreationTimeAsTime

func (o *WatcherProperties) SetCreationTimeAsTime(input time.Time)

func (*WatcherProperties) SetLastModifiedTimeAsTime

func (o *WatcherProperties) SetLastModifiedTimeAsTime(input time.Time)

type WatcherUpdateParameters

type WatcherUpdateParameters struct {
	Name       *string                  `json:"name,omitempty"`
	Properties *WatcherUpdateProperties `json:"properties,omitempty"`
}

type WatcherUpdateProperties

type WatcherUpdateProperties struct {
	ExecutionFrequencyInSeconds *int64 `json:"executionFrequencyInSeconds,omitempty"`
}

Jump to

Keyboard shortcuts

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