application

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2020 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateOrUpdateAppConfig

func CreateOrUpdateAppConfig(ctx context.Context, client client.Client, appConfig *v1alpha2.ApplicationConfiguration) error

CreateOrUpdateAppConfig will create if not exist and update if exists.

func CreateOrUpdateComponent

func CreateOrUpdateComponent(ctx context.Context, client client.Client, comp *v1alpha2.Component) error

CreateOrUpdateComponent will create if not exist and update if exists.

func CreateScopes

func CreateScopes(ctx context.Context, client client.Client, scopes []oam.Object) error

CreateScopes will create all scopes

func Delete

func Delete(envName, appName string) error

Delete will delete an app along with it's appfile.

func GetAppConfig added in v0.1.1

GetAppConfig will get AppConfig from K8s cluster.

func IsNotFound added in v0.2.2

func IsNotFound(appName string, err error) bool

IsNotFound is application not found error

Types

type Application

type Application struct {
	*appfile.AppFile `json:",inline"`
	// contains filtered or unexported fields
}

Application is an implementation level object for Appfile, all vela commands will access AppFile from Appliction struct here.

func List

func List(envName string) ([]*Application, error)

List will list all apps

func Load

func Load(envName, appName string) (*Application, error)

Load will load application with env and name from default vela home dir.

func LoadFromFile

func LoadFromFile(fileName string) (*Application, error)

LoadFromFile will load application from file

func MatchAppByComp

func MatchAppByComp(envName, compName string) (*Application, error)

MatchAppByComp will get application with componentName without AppName.

func NewEmptyApplication added in v0.2.2

func NewEmptyApplication() (*Application, error)

NewEmptyApplication new empty application, only set tm

func (*Application) BuildRun added in v0.0.9

func (app *Application) BuildRun(ctx context.Context, client client.Client, env *types.EnvMeta, io cmdutil.IOStreams) error

BuildRun will build OAM and deploy from Appfile

func (*Application) GetComponents

func (app *Application) GetComponents() []string

GetComponents will get oam components from Appfile.

func (*Application) GetServiceConfig added in v0.0.8

func (app *Application) GetServiceConfig(componentName string) (string, map[string]interface{})

GetServiceConfig will get service type and it's configuration

func (*Application) GetTraitNames

func (app *Application) GetTraitNames(componentName string) ([]string, error)

GetTraitNames will list all traits attached to the specified component.

func (*Application) GetTraits

func (app *Application) GetTraits(componentName string) (map[string]map[string]interface{}, error)

GetTraits will list all traits and it's configurations attached to the specified component.

func (*Application) GetTraitsByType

func (app *Application) GetTraitsByType(componentName, traitType string) (map[string]interface{}, error)

GetTraitsByType will get trait configuration with specified component and trait type, we assume one type of trait can only attach to a component once.

func (*Application) GetWorkload

func (app *Application) GetWorkload(componentName string) (string, map[string]interface{})

GetWorkload will get workload type and it's configuration

func (*Application) OAM

OAM will convert an AppFile to OAM objects TODO(wonderflow) add scope support here

func (*Application) RemoveComponent

func (app *Application) RemoveComponent(componentName string) error

RemoveComponent will remove component from Appfile

func (*Application) RemoveTrait

func (app *Application) RemoveTrait(componentName, traitType string) error

RemoveTrait will remove a trait from Appfile

func (*Application) Run

func (app *Application) Run(ctx context.Context, client client.Client,
	ac *v1alpha2.ApplicationConfiguration, comps []*v1alpha2.Component, scopes []oam.Object) error

Run will deploy OAM objects.

func (*Application) Save

func (app *Application) Save(envName string) error

Save will save appfile into default dir.

func (*Application) SetTrait

func (app *Application) SetTrait(componentName, traitType string, traitData map[string]interface{}) error

SetTrait will set user trait for Appfile

func (*Application) SetWorkload

func (app *Application) SetWorkload(componentName, workloadType string, workloadData map[string]interface{}) error

SetWorkload will set user workload for Appfile

func (*Application) Validate

func (app *Application) Validate() error

Validate will validate whether an Appfile is valid.

Jump to

Keyboard shortcuts

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