addons

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2021 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RequestOpts = golangsdk.RequestOpts{
	MoreHeaders: map[string]string{"Content-Type": "application/json"},
}

Functions

func CCEServiceURL

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

func WaitForAddonDeleted added in v0.3.1

func WaitForAddonDeleted(client *golangsdk.ServiceClient, id, clusterID string, timeoutSeconds int) error

WaitForAddonDeleted - wait until addon is deleted

func WaitForAddonRunning added in v0.3.1

func WaitForAddonRunning(client *golangsdk.ServiceClient, id, clusterID string, timeoutSeconds int) error

WaitForAddonRunning - wait until addon status is `running`

Types

type Addon

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

type AddonInstance added in v0.4.0

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

type AddonInstanceList added in v0.4.0

type AddonInstanceList struct {
	// API type, fixed value Addon
	Kind string `json:"kind" required:"true"`
	// API version, fixed value v3
	ApiVersion string `json:"apiVersion" required:"true"`
	// Metadata - Basic information about the add-on. A collection of attributes.
	Metadata string `json:"metadata"`
	// Add-on template list
	Items []AddonInstance `json:"items" required:"true"`
}

type AddonInstanceSpec added in v0.4.0

type AddonInstanceSpec struct {
	ClusterID      string                 `json:"clusterID"`
	Version        string                 `json:"version"`
	TemplateName   string                 `json:"addonTemplateName"`
	TemplateType   string                 `json:"addonTemplateType"`
	TemplateLabels []string               `json:"addonTemplateLabels"`
	Descrition     string                 `json:"descrition"`
	Values         map[string]interface{} `json:"values"`
}

type AddonSpec added in v0.2.1

type AddonSpec struct {
	// Template type (helm or static).
	Type string `json:"type" required:"true"`
	// Whether the add-on is installed by default
	Require bool `json:"require" required:"true"`
	// Group to which the template belongs
	Labels []string `json:"labels" required:"true"`
	// URL of the logo image
	LogoURL string `json:"logoURL" required:"true"`
	// URL of the readme file
	ReadmeURL string `json:"readmeURL" required:"true"`
	// Template description
	Description string `json:"description" required:"true"`
	// Template version details
	Versions []Version `json:"versions" required:"true"`
}

type AddonTemplate added in v0.2.1

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

type AddonTemplateList added in v0.2.1

type AddonTemplateList struct {
	// API type, fixed value Addon
	Kind string `json:"kind" required:"true"`
	// API version, fixed value v3
	ApiVersion string `json:"apiVersion" required:"true"`
	// Add-on template list
	Items []AddonTemplate `json:"items" required:"true"`
}

type CreateAnnotations added in v0.2.1

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

type CreateMetadata

type CreateMetadata struct {
	Annotations CreateAnnotations `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, clusterId 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.

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, clusterId string) (r DeleteResult)

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

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, clusterId 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.

type InstanceMetadata added in v0.4.0

type InstanceMetadata struct {
	ID                string            `json:"uid"`
	Name              string            `json:"name"`
	Labels            map[string]string `json:"labels"`
	Annotations       map[string]string `json:"annotations"`
	UpdateTimestamp   string            `json:"updateTimestamp"`
	CreationTimestamp string            `json:"creationTimestamp"`
}

type InstanceStatus added in v0.4.0

type InstanceStatus struct {
	Status         string   `json:"status"`
	Reason         string   `json:"Reason"`
	Message        string   `json:"message"`
	TargetVersions []string `json:"targetVersions"`
	CurrentVersion Versions `json:"currentVersion"`
}

type ListInstanceResult added in v0.4.0

type ListInstanceResult struct {
	golangsdk.Result
}

func ListAddonInstances added in v0.4.0

func ListAddonInstances(c *golangsdk.ServiceClient, clusterID string) (r ListInstanceResult)

func (ListInstanceResult) Extract added in v0.4.0

func (r ListInstanceResult) Extract() (*AddonInstanceList, error)

type ListOpts added in v0.2.1

type ListOpts struct {
	Name string `q:"addon_template_name"`
}

func (ListOpts) ToAddonListQuery added in v0.2.1

func (opts ListOpts) ToAddonListQuery() (string, error)

type ListOptsBuilder added in v0.2.1

type ListOptsBuilder interface {
	ToAddonListQuery() (string, error)
}

type ListTemplateResult added in v0.2.1

type ListTemplateResult struct {
	golangsdk.Result
}

func ListTemplates added in v0.2.1

func ListTemplates(c *golangsdk.ServiceClient, clusterID string, opts ListOptsBuilder) (r ListTemplateResult)

func (ListTemplateResult) Extract added in v0.2.1

func (r ListTemplateResult) Extract() (*AddonTemplateList, error)

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

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" required:"true"`
	// Cluster ID.
	ClusterID string `json:"clusterID" required:"true"`
	// Addon Template Name.
	AddonTemplateName string `json:"addonTemplateName" required:"true"`
	// Addon Template Type.
	AddonTemplateType string `json:"addonTemplateType" required:"true"`
	// Addon Template Labels.
	AddonTemplateLables []string `json:"addonTemplateLables,omitempty"`
	// Addon Description.
	Description string `json:"description" required:"true"`
	// Addon Parameters
	Values Values `json:"values" required:"true"`
}

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"`
}

type SupportVersion added in v0.2.1

type SupportVersion struct {
	// Cluster type that supports the add-on template
	ClusterType string `json:"clusterType"`
	// Cluster versions that support the add-on template,
	// the parameter value is a regular expression
	ClusterVersion []string `json:"clusterVersion"`
}

type UpdateAnnotations added in v0.2.1

type UpdateAnnotations struct {
	AddonUpdateType string `json:"addon.upgrade/type" required:"true"`
}

type UpdateMetadata added in v0.2.1

type UpdateMetadata struct {
	// Add-on annotations in the format of key-value pairs.
	// For add-on upgrade, the value is fixed at {"addon.upgrade/type":"upgrade"}.
	Annotations UpdateAnnotations `json:"annotations" required:"true"`
	// Add-on labels in the format of key-value pairs.
	Labels map[string]string `json:"metadata,omitempty"`
}

type UpdateOpts added in v0.2.1

type UpdateOpts 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 UpdateMetadata `json:"metadata" required:"true"`
	// specifications to create an addon
	Spec RequestSpec `json:"spec" required:"true"`
}

func (UpdateOpts) ToAddonUpdateMap added in v0.2.1

func (opts UpdateOpts) ToAddonUpdateMap() (map[string]interface{}, error)

type UpdateOptsBuilder added in v0.2.1

type UpdateOptsBuilder interface {
	ToAddonUpdateMap() (map[string]interface{}, error)
}

UpdateOptsBuilder allows extensions to add additional parameters to the Update request.

type UpdateResult added in v0.2.1

type UpdateResult 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 Update added in v0.2.1

func Update(c *golangsdk.ServiceClient, id, clusterId string, opts UpdateOpts) (r UpdateResult)

func (UpdateResult) Extract added in v0.2.1

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

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

type Values

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

type Version added in v0.2.1

type Version struct {
	// Add-on version
	Version string `json:"version"`
	// Add-on installation parameters
	Input map[string]interface{} `json:"input"`
	// Whether the add-on version is a stable release
	Stable bool `json:"stable"`
	// Cluster versions that support the add-on template
	SupportVersions []SupportVersion `json:"supportVersions"`
	// Creation time of the add-on instance
	CreationTimestamp string `json:"creationTimestamp"`
	// Time when the add-on instance was updated
	UpdateTimestamp string `json:"updateTimestamp"`
}

type Versions added in v0.4.0

type Versions struct {
	Version           string                 `json:"version"`
	Input             map[string]interface{} `json:"input"`
	Stable            bool                   `json:"stable"`
	Translate         map[string]interface{} `json:"translate"`
	UpdateTimestamp   string                 `json:"updateTimestamp"`
	CreationTimestamp string                 `json:"creationTimestamp"`
}

Jump to

Keyboard shortcuts

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