rancher2_api

package
v0.0.43 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AutoscalingRequest

type AutoscalingRequest struct {
	ApiVersion string                     `json:"apiVersion,omitempty"`
	Kind       string                     `json:"kind,omitempty"`
	Metadata   AutoscalingRequestMetadata `json:"metadata,omitempty"`
	Spec       AutoscalingRequestSpec     `json:"spec,omitempty"`
}

type AutoscalingRequestMetadata

type AutoscalingRequestMetadata struct {
	Name      string `json:"name,omitempty"`
	Namespace string `json:"namespace,omitempty"`
}

type AutoscalingRequestSpec

type AutoscalingRequestSpec struct {
	TargetRef      AutoscalingRequestTargetRef    `json:"targetRef,omitempty"`
	UpdatePolicy   AutoscalingRequestUpdatePolicy `json:"updatePolicy,omitempty"`
	ResourcePolicy ResourcePolicy                 `json:"resourcePolicy,omitempty"`
}

type AutoscalingRequestTargetRef

type AutoscalingRequestTargetRef struct {
	ApiVersion string `json:"apiVersion,omitempty"`
	Kind       string `json:"kind,omitempty"`
	Name       string `json:"name,omitempty"`
}

type AutoscalingRequestUpdatePolicy

type AutoscalingRequestUpdatePolicy struct {
	UpdateMode string `json:"updateMode,omitempty"`
}

type Container

type Container struct {
	Image           string             `json:"image,omitempty"`
	Name            string             `json:"name,omitempty"`
	Env             []Env              `json:"env,omitempty"`
	ImagePullPolicy string             `json:"imagePullPolicy,omitempty"`
	Command         []string           `json:"command,omitempty"`
	Labels          map[string]string  `json:"labels,omitempty"`
	VolumeMounts    []VolumeMount      `json:"volumeMounts,omitempty"`
	Resources       ContainerResources `json:"resources,omitempty"`
	Ports           []ContainerPort    `json:"ports,omitempty"`
}

type ContainerPolicy added in v0.0.2

type ContainerPolicy struct {
	ContainerName string     `json:"containerName,omitempty"`
	MaxAllowed    MaxAllowed `json:"maxAllowed,omitempty"`
}

type ContainerPort added in v0.0.6

type ContainerPort struct {
	Name          string `json:"name,omitempty"`
	ContainerPort int    `json:"containerPort,omitempty"`
}

type ContainerResources

type ContainerResources struct {
	Limits   map[string]string `json:"limits,omitempty"`
	Requests map[string]string `json:"requests,omitempty"`
}

type DeploymentMetaData added in v0.0.5

type DeploymentMetaData struct {
	Name              string
	Namespace         string
	CreationTimestamp string `json:"creationTimestamp"`
	State             DeploymentMetaDataState
}

type DeploymentMetaDataState added in v0.0.5

type DeploymentMetaDataState struct {
	Error         bool
	Message       string
	Name          string
	Transitioning bool
}

type DeploymentResponse added in v0.0.5

type DeploymentResponse struct {
	Id       string
	APIType  string `json:"type"`
	Metadata DeploymentMetaData
}

type DeploymentStatus added in v0.0.5

type DeploymentStatus struct {
	Replicas          int
	ReadyReplicas     int
	UpdatedReplicas   int
	AvailableReplicas int
}

type DeploymentsResponse added in v0.0.24

type DeploymentsResponse struct {
	Data []DeploymentResponse `json:"data"`
}

type Env

type Env struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type ErrorBody added in v0.0.23

type ErrorBody struct {
	BaseType string `json:"baseType"`
	Code     string `json:"code"`
	Status   int    `json:"status"`
	Message  string `json:"message"`
	Type     string `json:"type"`
}

type MaxAllowed added in v0.0.2

type MaxAllowed struct {
	CPU    int64  `json:"cpu,omitempty"`
	Memory string `json:"memory,omitempty"`
}

type Node

type Node struct {
	RequireAll []string `json:"requireAll,omitempty"`
}

type PersistentVolumeClaim

type PersistentVolumeClaim struct {
	PersistentVolumeClaimId string `json:"persistentVolumeClaimId,omitempty"`
}

type Rancher2

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

func NewRancher2

func NewRancher2(url string, accessKey string, secretKey string, stackId string, zookeeper string) *Rancher2
<<<<<<<<<<<<<<  ✨ Windsurf Command ⭐ >>>>>>>>>>>>>>>>

NewRancher2 creates a new Rancher2 object, that can be used to interact with the Rancher2 API. It takes the Rancher2 API URL, the access key, the secret key, the stackId and the zookeeper URL as parameters.

The kubeUrl is constructed by removing the "/v3/" path from the url and appending "/k8s/clusters/" and the first part of the RANCHER2_PROJECT_ID environment variable (before the ":").

<<<<<<<<<<  8c5839d1-759d-41a4-b2a8-94451ae17fc1  >>>>>>>>>>>

func (*Rancher2) CreateOperators

func (r *Rancher2) CreateOperators(pipelineId string, inputs []lib.Operator, pipeConfig lib.PipelineConfig) (err error)

func (*Rancher2) DeleteOperator

func (r *Rancher2) DeleteOperator(pipelineId string, operator lib.Operator) (err error)

func (*Rancher2) DeleteOperators added in v0.0.40

func (r *Rancher2) DeleteOperators(pipelineId string, operators []lib.Operator) (err error)

func (*Rancher2) GetPipelineStatus added in v0.0.5

func (r *Rancher2) GetPipelineStatus(pipelineId string) (status lib.PipelineStatus, err error)

func (*Rancher2) GetPipelinesStatus added in v0.0.24

func (r *Rancher2) GetPipelinesStatus() (status []lib.PipelineStatus, err error)

type ResourcePolicy added in v0.0.2

type ResourcePolicy struct {
	ContainerPolicies []ContainerPolicy `json:"containerPolicies,omitempty"`
}

type Resources

type Resources struct {
	Requests map[string]string `json:"requests,omitempty"`
}

type Scheduling

type Scheduling struct {
	Node      Node   `json:"node,omitempty"`
	Scheduler string `json:"scheduler,omitempty"`
}

type Selector

type Selector struct {
	MatchLabels map[string]string `json:"matchLabels,omitempty"`
}

type Volume

type Volume struct {
	Name                  string                `json:"name,omitempty"`
	PersistentVolumeClaim PersistentVolumeClaim `json:"persistentVolumeClaim,omitempty"`
}

type VolumeClaimRequest

type VolumeClaimRequest struct {
	Name           string    `json:"name,omitempty"`
	NamespaceId    string    `json:"namespaceId,omitempty"`
	AccessModes    []string  `json:"accessModes,omitempty"`
	StorageClassId string    `json:"storageClassId,omitempty"`
	Resources      Resources `json:"resources,omitempty"`
}

type VolumeMount

type VolumeMount struct {
	Name      string `json:"name,omitempty"`
	MountPath string `json:"mountPath,omitempty"`
}

type WorkloadRequest

type WorkloadRequest struct {
	Name        string            `json:"name,omitempty"`
	NamespaceId string            `json:"namespaceId,omitempty"`
	Containers  []Container       `json:"containers,omitempty"`
	Labels      map[string]string `json:"labels,omitempty"`
	Selector    Selector          `json:"selector,omitempty"`
	Scheduling  Scheduling        `json:"scheduling,omitempty"`
	Volumes     []Volume          `json:"volumes,omitempty"`
}

Jump to

Keyboard shortcuts

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