globalschedules

package
v0.20240527.1094340 Latest Latest
Warning

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

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

README

github.com/hashicorp/go-azure-sdk/resource-manager/devtestlab/2018-09-15/globalschedules Documentation

The globalschedules SDK allows for interaction with the Azure Resource Manager Service devtestlab (API Version 2018-09-15).

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-helpers/resourcemanager/commonids"
import "github.com/hashicorp/go-azure-sdk/resource-manager/devtestlab/2018-09-15/globalschedules"

Client Initialization

client := globalschedules.NewGlobalSchedulesClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: GlobalSchedulesClient.CreateOrUpdate

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

payload := globalschedules.Schedule{
	// ...
}


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: GlobalSchedulesClient.Delete

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

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: GlobalSchedulesClient.Execute

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

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

Example Usage: GlobalSchedulesClient.Get

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

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

Example Usage: GlobalSchedulesClient.ListByResourceGroup

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

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

Example Usage: GlobalSchedulesClient.ListBySubscription

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

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

Example Usage: GlobalSchedulesClient.Retarget

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

payload := globalschedules.RetargetScheduleProperties{
	// ...
}


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

Example Usage: GlobalSchedulesClient.Update

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

payload := globalschedules.UpdateResource{
	// ...
}


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 PossibleValuesForEnableStatus

func PossibleValuesForEnableStatus() []string

func ValidateScheduleID

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

ValidateScheduleID checks that 'input' can be parsed as a Schedule ID

Types

type CreateOrUpdateOperationResponse

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

type DayDetails

type DayDetails struct {
	Time *string `json:"time,omitempty"`
}

type DeleteOperationResponse

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

type EnableStatus

type EnableStatus string
const (
	EnableStatusDisabled EnableStatus = "Disabled"
	EnableStatusEnabled  EnableStatus = "Enabled"
)

func (*EnableStatus) UnmarshalJSON

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

type ExecuteOperationResponse

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

type GetOperationOptions

type GetOperationOptions struct {
	Expand *string
}

func DefaultGetOperationOptions

func DefaultGetOperationOptions() GetOperationOptions

func (GetOperationOptions) ToHeaders

func (o GetOperationOptions) ToHeaders() *client.Headers

func (GetOperationOptions) ToOData

func (o GetOperationOptions) ToOData() *odata.Query

func (GetOperationOptions) ToQuery

func (o GetOperationOptions) ToQuery() *client.QueryParams

type GetOperationResponse

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

type GlobalSchedulesClient

type GlobalSchedulesClient struct {
	Client *resourcemanager.Client
}

func NewGlobalSchedulesClientWithBaseURI

func NewGlobalSchedulesClientWithBaseURI(sdkApi sdkEnv.Api) (*GlobalSchedulesClient, error)

func (GlobalSchedulesClient) CreateOrUpdate

func (c GlobalSchedulesClient) CreateOrUpdate(ctx context.Context, id ScheduleId, input Schedule) (result CreateOrUpdateOperationResponse, err error)

CreateOrUpdate ...

func (GlobalSchedulesClient) Delete

Delete ...

func (GlobalSchedulesClient) Execute

Execute ...

func (GlobalSchedulesClient) ExecuteThenPoll

func (c GlobalSchedulesClient) ExecuteThenPoll(ctx context.Context, id ScheduleId) error

ExecuteThenPoll performs Execute then polls until it's completed

func (GlobalSchedulesClient) Get

Get ...

func (GlobalSchedulesClient) ListByResourceGroup

ListByResourceGroup ...

func (GlobalSchedulesClient) ListByResourceGroupComplete

ListByResourceGroupComplete retrieves all the results into a single object

func (GlobalSchedulesClient) ListByResourceGroupCompleteMatchingPredicate

func (c GlobalSchedulesClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, options ListByResourceGroupOperationOptions, predicate ScheduleOperationPredicate) (result ListByResourceGroupCompleteResult, err error)

ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (GlobalSchedulesClient) ListBySubscription

ListBySubscription ...

func (GlobalSchedulesClient) ListBySubscriptionComplete

ListBySubscriptionComplete retrieves all the results into a single object

func (GlobalSchedulesClient) ListBySubscriptionCompleteMatchingPredicate

func (c GlobalSchedulesClient) ListBySubscriptionCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, options ListBySubscriptionOperationOptions, predicate ScheduleOperationPredicate) (result ListBySubscriptionCompleteResult, err error)

ListBySubscriptionCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (GlobalSchedulesClient) Retarget

Retarget ...

func (GlobalSchedulesClient) RetargetThenPoll

RetargetThenPoll performs Retarget then polls until it's completed

func (GlobalSchedulesClient) Update

Update ...

type HourDetails

type HourDetails struct {
	Minute *int64 `json:"minute,omitempty"`
}

type ListByResourceGroupCompleteResult

type ListByResourceGroupCompleteResult struct {
	LatestHttpResponse *http.Response
	Items              []Schedule
}

type ListByResourceGroupOperationOptions

type ListByResourceGroupOperationOptions struct {
	Expand  *string
	Filter  *string
	Orderby *string
	Top     *int64
}

func DefaultListByResourceGroupOperationOptions

func DefaultListByResourceGroupOperationOptions() ListByResourceGroupOperationOptions

func (ListByResourceGroupOperationOptions) ToHeaders

func (ListByResourceGroupOperationOptions) ToOData

func (ListByResourceGroupOperationOptions) ToQuery

type ListByResourceGroupOperationResponse

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

type ListBySubscriptionCompleteResult

type ListBySubscriptionCompleteResult struct {
	LatestHttpResponse *http.Response
	Items              []Schedule
}

type ListBySubscriptionOperationOptions

type ListBySubscriptionOperationOptions struct {
	Expand  *string
	Filter  *string
	Orderby *string
	Top     *int64
}

func DefaultListBySubscriptionOperationOptions

func DefaultListBySubscriptionOperationOptions() ListBySubscriptionOperationOptions

func (ListBySubscriptionOperationOptions) ToHeaders

func (ListBySubscriptionOperationOptions) ToOData

func (ListBySubscriptionOperationOptions) ToQuery

type ListBySubscriptionOperationResponse

type ListBySubscriptionOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]Schedule
}

type NotificationSettings

type NotificationSettings struct {
	EmailRecipient     *string       `json:"emailRecipient,omitempty"`
	NotificationLocale *string       `json:"notificationLocale,omitempty"`
	Status             *EnableStatus `json:"status,omitempty"`
	TimeInMinutes      *int64        `json:"timeInMinutes,omitempty"`
	WebhookUrl         *string       `json:"webhookUrl,omitempty"`
}

type RetargetOperationResponse

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

type RetargetScheduleProperties

type RetargetScheduleProperties struct {
	CurrentResourceId *string `json:"currentResourceId,omitempty"`
	TargetResourceId  *string `json:"targetResourceId,omitempty"`
}

type Schedule

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

type ScheduleId

type ScheduleId struct {
	SubscriptionId    string
	ResourceGroupName string
	ScheduleName      string
}

ScheduleId is a struct representing the Resource ID for a Schedule

func NewScheduleID

func NewScheduleID(subscriptionId string, resourceGroupName string, scheduleName string) ScheduleId

NewScheduleID returns a new ScheduleId struct

func ParseScheduleID

func ParseScheduleID(input string) (*ScheduleId, error)

ParseScheduleID parses 'input' into a ScheduleId

func ParseScheduleIDInsensitively

func ParseScheduleIDInsensitively(input string) (*ScheduleId, error)

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

func (*ScheduleId) FromParseResult

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

func (ScheduleId) ID

func (id ScheduleId) ID() string

ID returns the formatted Schedule ID

func (ScheduleId) Segments

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

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

func (ScheduleId) String

func (id ScheduleId) String() string

String returns a human-readable description of this Schedule ID

type ScheduleOperationPredicate

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

func (ScheduleOperationPredicate) Matches

func (p ScheduleOperationPredicate) Matches(input Schedule) bool

type ScheduleProperties

type ScheduleProperties struct {
	CreatedDate          *string               `json:"createdDate,omitempty"`
	DailyRecurrence      *DayDetails           `json:"dailyRecurrence,omitempty"`
	HourlyRecurrence     *HourDetails          `json:"hourlyRecurrence,omitempty"`
	NotificationSettings *NotificationSettings `json:"notificationSettings,omitempty"`
	ProvisioningState    *string               `json:"provisioningState,omitempty"`
	Status               *EnableStatus         `json:"status,omitempty"`
	TargetResourceId     *string               `json:"targetResourceId,omitempty"`
	TaskType             *string               `json:"taskType,omitempty"`
	TimeZoneId           *string               `json:"timeZoneId,omitempty"`
	UniqueIdentifier     *string               `json:"uniqueIdentifier,omitempty"`
	WeeklyRecurrence     *WeekDetails          `json:"weeklyRecurrence,omitempty"`
}

func (*ScheduleProperties) GetCreatedDateAsTime

func (o *ScheduleProperties) GetCreatedDateAsTime() (*time.Time, error)

func (*ScheduleProperties) SetCreatedDateAsTime

func (o *ScheduleProperties) SetCreatedDateAsTime(input time.Time)

type UpdateOperationResponse

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

type UpdateResource

type UpdateResource struct {
	Tags *map[string]string `json:"tags,omitempty"`
}

type WeekDetails

type WeekDetails struct {
	Time     *string   `json:"time,omitempty"`
	Weekdays *[]string `json:"weekdays,omitempty"`
}

Jump to

Keyboard shortcuts

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