schedulingrule

package
v0.46.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: Apache-2.0 Imports: 4 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package schedulingrule provides access to the Dynatrace Automation Scheduling Rules API.

Index

Constants

View Source
const (
	RuleTypeRecurrence     = "rrule"
	RuleTypeGrouping       = "grouping"
	RuleTypeFixedOffset    = "fixed_offset"
	RuleTypeRelativeOffset = "relative_offset"
)

Rule type values accepted by the API's ruleType field.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

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

Handler handles scheduling rule resources.

func NewHandler

func NewHandler(c *httpclient.Client) *Handler

NewHandler creates a new scheduling rule handler.

func (*Handler) Create

func (h *Handler) Create(ctx context.Context, data []byte) (*SchedulingRule, error)

Create creates a new scheduling rule.

func (*Handler) Delete

func (h *Handler) Delete(ctx context.Context, id string) error

Delete deletes a scheduling rule.

func (*Handler) Get

func (h *Handler) Get(ctx context.Context, id string) (*SchedulingRule, error)

Get retrieves a specific scheduling rule.

func (*Handler) List

func (h *Handler) List(ctx context.Context, chunkSize, limit int64) (*SchedulingRuleList, error)

List retrieves scheduling rules. chunkSize controls page size; 0 returns only the first page. limit caps the total number of results; 0 means unlimited.

The Automation API applies a default page size when no limit is sent, so a single unpaginated GET would silently truncate large environments.

func (*Handler) Update

func (h *Handler) Update(ctx context.Context, id string, data []byte) (*SchedulingRule, error)

Update updates an existing scheduling rule.

type ModificationInfo

type ModificationInfo struct {
	CreatedBy        string `json:"createdBy,omitempty"`
	CreatedTime      string `json:"createdTime,omitempty"`
	LastModifiedBy   string `json:"lastModifiedBy,omitempty"`
	LastModifiedTime string `json:"lastModifiedTime,omitempty"`
}

ModificationInfo records who created and last changed a scheduling rule. The API declares it read-only.

type SchedulingRule

type SchedulingRule struct {
	ID                 string                 `json:"id,omitempty"`
	Version            int                    `json:"version,omitempty"`
	Title              string                 `json:"title"`
	Description        string                 `json:"description,omitempty"`
	RuleType           string                 `json:"ruleType"`
	RRule              map[string]interface{} `json:"rrule,omitempty"`
	GroupingRule       map[string]interface{} `json:"groupingRule,omitempty"`
	FixedOffsetRule    map[string]interface{} `json:"fixedOffsetRule,omitempty"`
	RelativeOffsetRule map[string]interface{} `json:"relativeOffsetRule,omitempty"`
	BusinessCalendar   string                 `json:"businessCalendar,omitempty"`
	Labels             map[string]string      `json:"labels,omitempty"`
	ModificationInfo   *ModificationInfo      `json:"modificationInfo,omitempty"`
}

SchedulingRule represents a scheduling rule resource.

Exactly one of RRule, GroupingRule, FixedOffsetRule or RelativeOffsetRule is populated, selected by RuleType. Those bodies stay untyped maps so an apply round-trip preserves them verbatim: the API spec types several recurrence fields as "integer or array of integers", which no single Go type models without loss.

type SchedulingRuleList

type SchedulingRuleList struct {
	Count   int              `json:"count"`
	Results []SchedulingRule `json:"results"`
}

SchedulingRuleList represents a list of scheduling rules.

Jump to

Keyboard shortcuts

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