addons

package
v0.0.0-...-d823fe1 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2021 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CCEServiceURL

func CCEServiceURL(client *golangsdk.ServiceClient, cluster_id string, parts ...string) string

func GetStructNestedField

func GetStructNestedField(v *Addon, field string, structDriller []string) string

Types

type Addon

type Addon struct {
	// API type, fixed value Addon
	Kind string `json:"kind"`
	// API version, fixed value v3
	ApiVersion string `json:"apiVersion"`
	// Metadata of an Addon
	Metadata MetaData `json:"metadata"`
	// Specifications of an Addon
	Spec Spec `json:"spec"`
	// Status of an Addon
	Status Status `json:"status"`
}

func FilterAddons

func FilterAddons(addons []Addon, opts ListOpts) []Addon

func List

func List(client *golangsdk.ServiceClient, clusterID string, opts ListOpts) ([]Addon, error)

List returns collection of addons.

type Annotations

type Annotations struct {
	AddonInstallType string `json:"addon.install/type" required:"true"`
}

type CreateMetadata

type CreateMetadata struct {
	Anno Annotations `json:"annotations" required:"true"`
}

type CreateOpts

type CreateOpts struct {
	// API type, fixed value Addon
	Kind string `json:"kind" required:"true"`
	// API version, fixed value v3
	ApiVersion string `json:"apiVersion" required:"true"`
	// Metadata required to create an addon
	Metadata CreateMetadata `json:"metadata" required:"true"`
	// specifications to create an addon
	Spec RequestSpec `json:"spec" required:"true"`
}

CreateOpts contains all the values needed to create a new addon

func (CreateOpts) ToAddonCreateMap

func (opts CreateOpts) ToAddonCreateMap() (map[string]interface{}, error)

ToAddonCreateMap builds a create request body from CreateOpts.

type CreateOptsBuilder

type CreateOptsBuilder interface {
	ToAddonCreateMap() (map[string]interface{}, error)
}

CreateOptsBuilder allows extensions to add additional parameters to the Create request.

type CreateResult

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

CreateResult represents the result of a create operation. Call its Extract method to interpret it as an Addon.

func Create

func Create(c *golangsdk.ServiceClient, opts CreateOptsBuilder, cluster_id string) (r CreateResult)

Create accepts a CreateOpts struct and uses the values to create a new addon.

func (CreateResult) Extract

func (r CreateResult) Extract() (*Addon, error)

Extract is a function that accepts a result and extracts an Addon.

func (CreateResult) ExtractAddon

func (r CreateResult) ExtractAddon() ([]Addon, error)

ExtractAddon is a function that accepts a ListOpts struct, which allows you to filter and sort the returned collection for greater efficiency.

type DeleteResult

type DeleteResult struct {
	golangsdk.ErrResult
}

DeleteResult represents the result of a delete operation. Call its ExtractErr method to determine if the request succeeded or failed.

func Delete

func Delete(c *golangsdk.ServiceClient, id, cluster_id string) (r DeleteResult)

Delete will permanently delete a particular addon based on its unique ID.

type FilterStruct

type FilterStruct struct {
	Value   string
	Driller []string
}

type GetResult

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

GetResult represents the result of a get operation. Call its Extract method to interpret it as an Addon.

func Get

func Get(c *golangsdk.ServiceClient, id, cluster_id string) (r GetResult)

Get retrieves a particular addon based on its unique ID.

func (GetResult) Extract

func (r GetResult) Extract() (*Addon, error)

Extract is a function that accepts a result and extracts an Addon.

func (GetResult) ExtractAddon

func (r GetResult) ExtractAddon() ([]Addon, error)

ExtractAddon is a function that accepts a ListOpts struct, which allows you to filter and sort the returned collection for greater efficiency.

type ListAddon

type ListAddon struct {
	// API type, fixed value "List"
	Kind string `json:"kind"`
	// API version, fixed value "v3"
	Apiversion string `json:"apiVersion"`
	// all Node Pools
	Addons []Addon `json:"items"`
}

type ListOpts

type ListOpts struct {
	AddonTemplateName string `json:"addonTemplateName"`
	Uid               string `json:"uid"`
	Version           string `json:"version"`
	Status            string `json:"status"`
}

ListOpts allows the filtering of list data using given parameters.

type ListResult

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

ListResult represents the result of a list operation. Call its ExtractAddon method to interpret it as a Addon.

func (ListResult) Extract

func (r ListResult) Extract() (*Addon, error)

Extract is a function that accepts a result and extracts an Addon.

func (ListResult) ExtractAddon

func (r ListResult) ExtractAddon() ([]Addon, error)

ExtractAddon is a function that accepts a ListOpts struct, which allows you to filter and sort the returned collection for greater efficiency.

type MetaData

type MetaData struct {
	// Addon unique name
	Name string `json:"name"`
	// Addon unique Id
	Id string `json:"uid"`
	// Addon tag, key/value pair format
	Labels map[string]string `json:"lables"`
	// Addon annotation, key/value pair format
	Annotations map[string]string `json:"annotaions"`
}

Metadata required to create an addon

type RequestSpec

type RequestSpec struct {
	// For the addon version.
	Version string `json:"version" required:"true"`
	// Cluster ID.
	ClusterID string `json:"clusterID" required:"true"`
	// Addon Template Name.
	AddonTemplateName string `json:"addonTemplateName" required:"true"`
	// Addon Parameters
	Values Values `json:"values" required:"true"`
}

Specifications to create an addon

type Spec

type Spec struct {
	// For the addon version.
	Version string `json:"version"`
	// Cluster ID.
	ClusterID string `json:"clusterID"`
	// Addon Template Name.
	AddonTemplateName string `json:"addonTemplateName"`
	// Addon Template Type.
	AddonTemplateType string `json:"addonTemplateType"`
	// Addon Template Labels.
	AddonTemplateLables []string `json:"addonTemplateLables"`
	// Addon Description.
	Description string `json:"description"`
	// Addon Parameters
	Values Values `json:"values"`
}

Specifications to create an addon

type Status

type Status struct {
	//The state of the addon
	Status string `json:"status"`
	//Reasons for the addon to become current
	Reason string `json:"reason"`
	//Error Message
	Message string `json:"message"`
	//The target versions of the addon
	TargetVersions []string `json:"targetVersions"`
	//Current version of the addon
	CurrentVersion Versions `json:"currentVersion"`
}

type SupportVersions

type SupportVersions struct {
	ClusterType    string   `json:"clusterType"`
	ClusterVersion []string `json:"clusterVersion"`
}

type UpdataResult

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

UpdateResult represents the result of an update operation. Call its Extract method to interpret it as an Addon.

func (UpdataResult) Extract

func (r UpdataResult) Extract() (*Addon, error)

Extract is a function that accepts a result and extracts an Addon.

func (UpdataResult) ExtractAddon

func (r UpdataResult) ExtractAddon() ([]Addon, error)

ExtractAddon is a function that accepts a ListOpts struct, which allows you to filter and sort the returned collection for greater efficiency.

type Values

type Values struct {
	Basic  map[string]interface{} `json:"basic" required:"true"`
	Custom map[string]interface{} `json:"custom,omitempty"`
	Flavor map[string]interface{} `json:"flavor,omitempty"`
}

type Versions

type Versions struct {
	// Version of the addon
	Version string `json:"version"`
	// The installing param of the addon
	Input map[string]interface{} `json:"input"`
	// Wether it is a stable version
	Stable bool `json:"stable"`
	// Translate information
	Translate map[string]interface{} `json:"translate"`
	// Supported versions
	SupportVersions []SupportVersions `json:"supportVersions"`
}

Jump to

Keyboard shortcuts

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