Documentation
¶
Overview ¶
Package schedulingrule provides access to the Dynatrace Automation Scheduling Rules API.
Index ¶
- Constants
- type Handler
- func (h *Handler) Create(ctx context.Context, data []byte) (*SchedulingRule, error)
- func (h *Handler) Delete(ctx context.Context, id string) error
- func (h *Handler) Get(ctx context.Context, id string) (*SchedulingRule, error)
- func (h *Handler) List(ctx context.Context, chunkSize, limit int64) (*SchedulingRuleList, error)
- func (h *Handler) Update(ctx context.Context, id string, data []byte) (*SchedulingRule, error)
- type ModificationInfo
- type SchedulingRule
- type SchedulingRuleList
Constants ¶
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) List ¶
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.
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.