orchestration

package
v0.0.0-...-fb2c256 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2020 License: Apache-2.0, Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// StateParam parameter used in list orchestrations / operations queries to filter by state
	StateParam = "state"
)
View Source
const TargetAll = "all"

TargetAll all SKRs provisioned successfully and not deprovisioning

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	ListOrchestrations(params ListParameters) (StatusResponseList, error)
	GetOrchestration(orchestrationID string) (StatusResponse, error)
	ListOperations(orchestrationID string, params ListParameters) (OperationResponseList, error)
	GetOperation(orchestrationID, operationID string) (OperationDetailResponse, error)
	UpgradeKyma(params Parameters) (UpgradeResponse, error)
}

Client is the interface to interact with the KEB /orchestrations and /upgrade API as an HTTP client using OIDC ID token in JWT format.

func NewClient

func NewClient(ctx context.Context, url string, auth oauth2.TokenSource) Client

NewClient constructs and returns new Client for KEB /runtimes API It takes the following arguments:

  • ctx : context in which the http request will be executed
  • url : base url of all KEB APIs, e.g. https://kyma-env-broker.kyma.local
  • auth : TokenSource object which provides the ID token for the HTTP request

type ListParameters

type ListParameters struct {
	Page     int
	PageSize int
	States   []string
}

ListParameters hold attributes of list orchestrations / operations queries.

type OperationDetailResponse

type OperationDetailResponse struct {
	OperationResponse

	KymaConfig    gqlschema.KymaConfigInput     `json:"kymaConfig"`
	ClusterConfig gqlschema.GardenerConfigInput `json:"clusterConfig"`
}

type OperationResponse

type OperationResponse struct {
	OperationID            string    `json:"operationID"`
	RuntimeID              string    `json:"runtimeID"`
	GlobalAccountID        string    `json:"globalAccountID"`
	SubAccountID           string    `json:"subAccountID"`
	OrchestrationID        string    `json:"orchestrationID"`
	ServicePlanID          string    `json:"servicePlanID"`
	ServicePlanName        string    `json:"servicePlanName"`
	DryRun                 bool      `json:"dryRun"`
	ShootName              string    `json:"shootName"`
	MaintenanceWindowBegin time.Time `json:"maintenanceWindowBegin"`
	MaintenanceWindowEnd   time.Time `json:"maintenanceWindowEnd"`
	State                  string    `json:"state"`
	Description            string    `json:"description"`
}

type OperationResponseList

type OperationResponseList struct {
	Data       []OperationResponse `json:"data"`
	Count      int                 `json:"count"`
	TotalCount int                 `json:"totalCount"`
}

type ParallelStrategySpec

type ParallelStrategySpec struct {
	Workers int `json:"workers"`
}

ParallelStrategySpec defines parameters for the parallel orchestration strategy

type Parameters

type Parameters struct {
	Targets  TargetSpec   `json:"targets"`
	Strategy StrategySpec `json:"strategy,omitempty"`
	DryRun   bool         `json:"dryRun,omitempty"`
}

Parameters hold the attributes of orchestration create (upgrade) requests.

type RuntimeTarget

type RuntimeTarget struct {
	// Valid values: "all"
	Target string `json:"target,omitempty"`
	// Regex pattern to match against the runtime's GlobalAccount field. E.g. CA50125541TID000000000741207136, CA.*
	GlobalAccount string `json:"globalAccount,omitempty"`
	// Regex pattern to match against the runtime's SubAccount field. E.g. 0d20e315-d0b4-48a2-9512-49bc8eb03cd1
	SubAccount string `json:"subAccount,omitempty"`
	// Regex pattern to match against the shoot cluster's Region field (not SCP platform-region). E.g. "europe|eu-"
	Region string `json:"region,omitempty"`
	// RuntimeID is used to indicate a specific runtime
	RuntimeID string `json:"runtimeID,omitempty"`
	// PlanName is used to match runtimes with the same plan
	PlanName string `json:"planName,omitempty"`
}

RuntimeTarget captures a specification of SKR targets to resolve for an orchestration. When a RuntimeTarget defines multiple fields, all should match to any given runtime to be selected (i.e. the terms are AND-ed).

type ScheduleType

type ScheduleType string
const (
	Immediate         ScheduleType = "immediate"
	MaintenanceWindow ScheduleType = "maintenanceWindow"
)

type StatusResponse

type StatusResponse struct {
	OrchestrationID string     `json:"orchestrationID"`
	State           string     `json:"state"`
	Description     string     `json:"description"`
	CreatedAt       time.Time  `json:"createdAt"`
	UpdatedAt       time.Time  `json:"updatedAt"`
	Parameters      Parameters `json:"parameters"`
}

type StatusResponseList

type StatusResponseList struct {
	Data       []StatusResponse `json:"data"`
	Count      int              `json:"count"`
	TotalCount int              `json:"totalCount"`
}

type StrategySpec

type StrategySpec struct {
	Type     StrategyType         `json:"type"`
	Schedule ScheduleType         `json:"schedule,omitempty"`
	Parallel ParallelStrategySpec `json:"parallel,omitempty"`
}

StrategySpec is the strategy part common for all orchestration trigger/status API

type StrategyType

type StrategyType string
const (
	ParallelStrategy StrategyType = "parallel"
)

type TargetSpec

type TargetSpec struct {
	Include []RuntimeTarget `json:"include"`
	Exclude []RuntimeTarget `json:"exclude,omitempty"`
}

TargetSpec is the targets part common for all orchestration trigger/status API

type UpgradeResponse

type UpgradeResponse struct {
	OrchestrationID string `json:"orchestrationID"`
}

Jump to

Keyboard shortcuts

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