schedules

package
v0.20240117.1113630 Latest Latest
Warning

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

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

README

github.com/hashicorp/go-azure-sdk/resource-manager/devcenter/2023-04-01/schedules Documentation

The schedules SDK allows for interaction with the Azure Resource Manager Service devcenter (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/devcenter/2023-04-01/schedules"

Client Initialization

client := schedules.NewSchedulesClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: SchedulesClient.CreateOrUpdate

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

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


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

Example Usage: SchedulesClient.Delete

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

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

Example Usage: SchedulesClient.Get

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

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: SchedulesClient.ListByPool

ctx := context.TODO()
id := schedules.NewPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "projectValue", "poolValue")

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

Example Usage: SchedulesClient.Update

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

payload := schedules.ScheduleUpdate{
	// ...
}


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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PossibleValuesForProvisioningState

func PossibleValuesForProvisioningState() []string

func PossibleValuesForScheduleEnableStatus

func PossibleValuesForScheduleEnableStatus() []string

func PossibleValuesForScheduledFrequency

func PossibleValuesForScheduledFrequency() []string

func PossibleValuesForScheduledType

func PossibleValuesForScheduledType() []string

func ValidatePoolID

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

ValidatePoolID checks that 'input' can be parsed as a Pool ID

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 {
	Poller       pollers.Poller
	HttpResponse *http.Response
	OData        *odata.OData
}

type DeleteOperationResponse

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

type GetOperationResponse

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

type ListByPoolCompleteResult

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

type ListByPoolOperationResponse

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

type PoolId

type PoolId struct {
	SubscriptionId    string
	ResourceGroupName string
	ProjectName       string
	PoolName          string
}

PoolId is a struct representing the Resource ID for a Pool

func NewPoolID

func NewPoolID(subscriptionId string, resourceGroupName string, projectName string, poolName string) PoolId

NewPoolID returns a new PoolId struct

func ParsePoolID

func ParsePoolID(input string) (*PoolId, error)

ParsePoolID parses 'input' into a PoolId

func ParsePoolIDInsensitively

func ParsePoolIDInsensitively(input string) (*PoolId, error)

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

func (*PoolId) FromParseResult added in v0.20231127.1171502

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

func (PoolId) ID

func (id PoolId) ID() string

ID returns the formatted Pool ID

func (PoolId) Segments

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

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

func (PoolId) String

func (id PoolId) String() string

String returns a human-readable description of this Pool ID

type ProvisioningState

type ProvisioningState string
const (
	ProvisioningStateAccepted                  ProvisioningState = "Accepted"
	ProvisioningStateCanceled                  ProvisioningState = "Canceled"
	ProvisioningStateCreated                   ProvisioningState = "Created"
	ProvisioningStateCreating                  ProvisioningState = "Creating"
	ProvisioningStateDeleted                   ProvisioningState = "Deleted"
	ProvisioningStateDeleting                  ProvisioningState = "Deleting"
	ProvisioningStateFailed                    ProvisioningState = "Failed"
	ProvisioningStateMovingResources           ProvisioningState = "MovingResources"
	ProvisioningStateNotSpecified              ProvisioningState = "NotSpecified"
	ProvisioningStateRolloutInProgress         ProvisioningState = "RolloutInProgress"
	ProvisioningStateRunning                   ProvisioningState = "Running"
	ProvisioningStateStorageProvisioningFailed ProvisioningState = "StorageProvisioningFailed"
	ProvisioningStateSucceeded                 ProvisioningState = "Succeeded"
	ProvisioningStateTransientFailure          ProvisioningState = "TransientFailure"
	ProvisioningStateUpdated                   ProvisioningState = "Updated"
	ProvisioningStateUpdating                  ProvisioningState = "Updating"
)

func (*ProvisioningState) UnmarshalJSON

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

type Schedule

type Schedule struct {
	Id         *string                `json:"id,omitempty"`
	Name       *string                `json:"name,omitempty"`
	Properties *ScheduleProperties    `json:"properties,omitempty"`
	SystemData *systemdata.SystemData `json:"systemData,omitempty"`
	Type       *string                `json:"type,omitempty"`
}

type ScheduleEnableStatus

type ScheduleEnableStatus string
const (
	ScheduleEnableStatusDisabled ScheduleEnableStatus = "Disabled"
	ScheduleEnableStatusEnabled  ScheduleEnableStatus = "Enabled"
)

func (*ScheduleEnableStatus) UnmarshalJSON

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

type ScheduleId

type ScheduleId struct {
	SubscriptionId    string
	ResourceGroupName string
	ProjectName       string
	PoolName          string
	ScheduleName      string
}

ScheduleId is a struct representing the Resource ID for a Schedule

func NewScheduleID

func NewScheduleID(subscriptionId string, resourceGroupName string, projectName string, poolName 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 added in v0.20231127.1171502

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
	Name *string
	Type *string
}

func (ScheduleOperationPredicate) Matches

func (p ScheduleOperationPredicate) Matches(input Schedule) bool

type ScheduleProperties

type ScheduleProperties struct {
	Frequency         ScheduledFrequency    `json:"frequency"`
	ProvisioningState *ProvisioningState    `json:"provisioningState,omitempty"`
	State             *ScheduleEnableStatus `json:"state,omitempty"`
	Time              string                `json:"time"`
	TimeZone          string                `json:"timeZone"`
	Type              ScheduledType         `json:"type"`
}

type ScheduleUpdate

type ScheduleUpdate struct {
	Location   *string                   `json:"location,omitempty"`
	Properties *ScheduleUpdateProperties `json:"properties,omitempty"`
	Tags       *map[string]string        `json:"tags,omitempty"`
}

type ScheduleUpdateProperties

type ScheduleUpdateProperties struct {
	Frequency *ScheduledFrequency   `json:"frequency,omitempty"`
	State     *ScheduleEnableStatus `json:"state,omitempty"`
	Time      *string               `json:"time,omitempty"`
	TimeZone  *string               `json:"timeZone,omitempty"`
	Type      *ScheduledType        `json:"type,omitempty"`
}

type ScheduledFrequency

type ScheduledFrequency string
const (
	ScheduledFrequencyDaily ScheduledFrequency = "Daily"
)

func (*ScheduledFrequency) UnmarshalJSON

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

type ScheduledType

type ScheduledType string
const (
	ScheduledTypeStopDevBox ScheduledType = "StopDevBox"
)

func (*ScheduledType) UnmarshalJSON

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

type SchedulesClient

type SchedulesClient struct {
	Client *resourcemanager.Client
}

func NewSchedulesClientWithBaseURI

func NewSchedulesClientWithBaseURI(sdkApi sdkEnv.Api) (*SchedulesClient, error)

func (SchedulesClient) CreateOrUpdate

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

CreateOrUpdate ...

func (SchedulesClient) CreateOrUpdateThenPoll

func (c SchedulesClient) CreateOrUpdateThenPoll(ctx context.Context, id ScheduleId, input Schedule) error

CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed

func (SchedulesClient) Delete

func (c SchedulesClient) Delete(ctx context.Context, id ScheduleId) (result DeleteOperationResponse, err error)

Delete ...

func (SchedulesClient) DeleteThenPoll

func (c SchedulesClient) DeleteThenPoll(ctx context.Context, id ScheduleId) error

DeleteThenPoll performs Delete then polls until it's completed

func (SchedulesClient) Get

func (c SchedulesClient) Get(ctx context.Context, id ScheduleId) (result GetOperationResponse, err error)

Get ...

func (SchedulesClient) ListByPool

func (c SchedulesClient) ListByPool(ctx context.Context, id PoolId) (result ListByPoolOperationResponse, err error)

ListByPool ...

func (SchedulesClient) ListByPoolComplete

func (c SchedulesClient) ListByPoolComplete(ctx context.Context, id PoolId) (ListByPoolCompleteResult, error)

ListByPoolComplete retrieves all the results into a single object

func (SchedulesClient) ListByPoolCompleteMatchingPredicate

func (c SchedulesClient) ListByPoolCompleteMatchingPredicate(ctx context.Context, id PoolId, predicate ScheduleOperationPredicate) (result ListByPoolCompleteResult, err error)

ListByPoolCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (SchedulesClient) Update

func (c SchedulesClient) Update(ctx context.Context, id ScheduleId, input ScheduleUpdate) (result UpdateOperationResponse, err error)

Update ...

func (SchedulesClient) UpdateThenPoll

func (c SchedulesClient) UpdateThenPoll(ctx context.Context, id ScheduleId, input ScheduleUpdate) error

UpdateThenPoll performs Update then polls until it's completed

type UpdateOperationResponse

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

Jump to

Keyboard shortcuts

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