schedules

package
v0.6.14 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GetResult

type GetResult struct {
	// contains filtered or unexported fields
}

GetResult represents the result of a get operation. Call its Extract method to interpret it as a schedule.

func Get

func Get(c *gcorecloud.ServiceClient, scheduleID string) (r GetResult)

Get retrieves a specific schedule based on its unique ID.

func Update

func Update(c *gcorecloud.ServiceClient, scheduleID string, opts UpdateOptsBuilder) (r GetResult)

Update accepts a UpdateOpts struct and updates an existing schedule using the values provided.

func (GetResult) Extract

func (r GetResult) Extract() (*lifecyclepolicy.RawSchedule, error)

Extract is a function that accepts a result and extracts a schedule resource.

func (GetResult) ExtractInto

func (r GetResult) ExtractInto(v interface{}) error

type UpdateOpts

type UpdateOpts struct {
	Hour                 string                         `json:"hour,omitempty"`
	Month                string                         `json:"month,omitempty"`
	Timezone             string                         `json:"timezone,omitempty"`
	Weeks                int                            `json:"weeks,omitempty"`
	Minute               string                         `json:"minute,omitempty"`
	Day                  string                         `json:"day,omitempty"`
	RetentionTime        lifecyclepolicy.RetentionTimer `json:"retention_time"`
	Time                 string                         `json:"time,omitempty"`
	ResourceNameTemplate string                         `json:"resource_name_template,omitempty"`
	Days                 int                            `json:"days,omitempty"`
	Minutes              int                            `json:"minutes,omitempty"`
	Week                 string                         `json:"week,omitempty"`
	MaxQuantity          int                            `json:"max_quantity" required:"true"`
	DayOfWeek            string                         `json:"day_of_week,omitempty"`
	Hours                int                            `json:"hours,omitempty"`
	Type                 lifecyclepolicy.ScheduleType   `json:"type,omitempty"`
}

UpdateOpts represents options used to update a schedule.

func (UpdateOpts) ToScheduleUpdateMap

func (opts UpdateOpts) ToScheduleUpdateMap() (map[string]interface{}, error)

ToScheduleUpdateMap builds a request body from UpdateOpts.

func (UpdateOpts) Validate

func (opts UpdateOpts) Validate() error

type UpdateOptsBuilder

type UpdateOptsBuilder interface {
	ToScheduleUpdateMap() (map[string]interface{}, error)
}

UpdateOptsBuilder allows extensions to add additional parameters to the Update request.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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