Documentation ¶
Overview ¶
Package budgetadjustment defines BudgetAdjustment object definitions. BudgetAdjustment is under development and not yet available for use.
Index ¶
- type BudgetAdjustment
- func (b BudgetAdjustment) GetKind() manifest.Kind
- func (b BudgetAdjustment) GetManifestSource() string
- func (b BudgetAdjustment) GetName() string
- func (b BudgetAdjustment) GetOrganization() string
- func (b BudgetAdjustment) GetValidator() govy.Validator[BudgetAdjustment]
- func (b BudgetAdjustment) GetVersion() manifest.Version
- func (b BudgetAdjustment) SetManifestSource(src string) manifest.Object
- func (b BudgetAdjustment) SetOrganization(org string) manifest.Object
- func (b BudgetAdjustment) Validate() error
- type Filters
- type Metadata
- type SLORef
- type Spec
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BudgetAdjustment ¶
type BudgetAdjustment struct { APIVersion manifest.Version `json:"apiVersion"` Kind manifest.Kind `json:"kind"` Metadata Metadata `json:"metadata"` Spec Spec `json:"spec"` Organization string `json:"organization,omitempty"` ManifestSource string `json:"manifestSrc,omitempty"` }
BudgetAdjustment represents a object for manipulating budget adjustments.
Example ¶
package main import ( "context" "log" "time" "github.com/nobl9/nobl9-go/internal/examples" "github.com/nobl9/nobl9-go/manifest" "github.com/nobl9/nobl9-go/manifest/v1alpha/budgetadjustment" ) func main() { // Create the object: budgetAdjustment := budgetadjustment.New( budgetadjustment.Metadata{ Name: "budget-adjustment", DisplayName: "My budget adjustment", }, budgetadjustment.Spec{ Description: "Example budget adjustment", FirstEventStart: time.Date(2024, 2, 5, 5, 0, 0, 0, time.UTC), Duration: "1h", Rrule: "FREQ=WEEKLY;INTERVAL=1", Filters: budgetadjustment.Filters{ SLOs: []budgetadjustment.SLORef{ { Name: "slo-name", Project: "default", }, }, }, }, ) // Verify the object: if err := budgetAdjustment.Validate(); err != nil { log.Fatalf("budget adjustment validation failed, err: %v", err) } // Apply the object: client := examples.GetOfflineEchoClient() if err := client.Objects().V1().Apply(context.Background(), []manifest.Object{budgetAdjustment}); err != nil { log.Fatalf("failed to apply alert method, err: %v", err) } }
Output: apiVersion: n9/v1alpha kind: BudgetAdjustment metadata: name: budget-adjustment displayName: My budget adjustment spec: description: Example budget adjustment firstEventStart: 2024-02-05T05:00:00Z duration: 1h rrule: FREQ=WEEKLY;INTERVAL=1 filters: slos: - name: slo-name project: default
func New ¶
func New(metadata Metadata, spec Spec) BudgetAdjustment
func (BudgetAdjustment) GetKind ¶
func (b BudgetAdjustment) GetKind() manifest.Kind
func (BudgetAdjustment) GetManifestSource ¶
func (b BudgetAdjustment) GetManifestSource() string
func (BudgetAdjustment) GetName ¶
func (b BudgetAdjustment) GetName() string
func (BudgetAdjustment) GetOrganization ¶
func (b BudgetAdjustment) GetOrganization() string
func (BudgetAdjustment) GetValidator ¶ added in v0.82.0
func (b BudgetAdjustment) GetValidator() govy.Validator[BudgetAdjustment]
func (BudgetAdjustment) GetVersion ¶
func (b BudgetAdjustment) GetVersion() manifest.Version
func (BudgetAdjustment) SetManifestSource ¶
func (b BudgetAdjustment) SetManifestSource(src string) manifest.Object
func (BudgetAdjustment) SetOrganization ¶
func (b BudgetAdjustment) SetOrganization(org string) manifest.Object
func (BudgetAdjustment) Validate ¶
func (b BudgetAdjustment) Validate() error
Click to show internal directories.
Click to hide internal directories.