module

package
v0.0.0-...-bb2f907 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2023 License: Apache-2.0 Imports: 31 Imported by: 9

Documentation

Index

Constants

View Source
const (
	StatusCreated      = "Created"
	StatusProcessing   = "Processing"
	StatusInstantiated = "Instantiated"
	StatusTerminated   = "Terminated"
	StatusFailed       = "Failed"

	StatusReady    = "Ready"
	StatusNotReady = "NotReady"

	ActionCreated       serviceActionValue = "Created"
	ActionInstantiating serviceActionValue = "Instantiating"
	ActionTerminating   serviceActionValue = "Terminating"
)
View Source
const ControllerTypeAction string = "action"

ControllerTypeAction denotes "action" Controller Type

View Source
const ControllerTypePlacement string = "placement"

ControllerTypePlacement denotes "placement" Controller Type

View Source
const GenericPlacementIntentName = "genericPlacementIntent"

GenericPlacementIntentName denotes the generic placement intent name

View Source
const ManifestFileName = "manifest.yaml"

ManifestFileName is the name given to the manifest file in the profile package

View Source
const SEPARATOR = "+"

SEPARATOR used while creating clusternames to store in etcd

Variables

This section is empty.

Functions

func GetSortedTemplateForApp

func GetSortedTemplateForApp(ctx context.Context, appName, p, ca, v, rName, cp, namespace string, overrideValues []OverrideValues) ([]helm.KubernetesResourceTemplate, []*helm.Hook, error)

GetSortedTemplateForApp returns the sorted templates. It takes in arguments - appName, project, compositeAppName, releaseName, compositeProfileName, array of override values

func ValidateDigIds

func ValidateDigIds(digIds []string) error

Types

type AdMetaData

type AdMetaData struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	UserData1   string `json:"userData1"`
	UserData2   string `json:"userData2"`
}

AppDependencyMetaData contains the parameters for creating a AppDependency

type AdSpecData

type AdSpecData struct {
	AppName string `json:"app,omitempty"`
	// Ready/Deployed
	OpStatus string `json:"opStatus,omitempty"`
	// Wait time in seconds
	Wait int `json:"wait,omitempty"`
}

SpecData consists of appName dependent

type App

type App struct {
	Metadata AppMetaData `json:"metadata"`
}

App contains metadata for Apps

type AppClient

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

AppClient implements the AppManager It will also be used to maintain some localized state

func NewAppClient

func NewAppClient() *AppClient

NewAppClient returns an instance of the AppClient which implements the AppManager

func (*AppClient) CreateApp

func (v *AppClient) CreateApp(ctx context.Context, a App, ac AppContent, p string, cN string, cV string, exists bool) (App, error)

CreateApp creates a new collection based on the App

func (*AppClient) DeleteApp

func (v *AppClient) DeleteApp(ctx context.Context, name string, p string, cN string, cV string) error

DeleteApp deletes the App from database

func (*AppClient) GetApp

func (v *AppClient) GetApp(ctx context.Context, name string, p string, cN string, cV string) (App, error)

GetApp returns the App for corresponding name

func (*AppClient) GetAppContent

func (v *AppClient) GetAppContent(ctx context.Context, name string, p string, cN string, cV string) (AppContent, error)

GetAppContent returns content for corresponding app

func (*AppClient) GetApps

func (v *AppClient) GetApps(ctx context.Context, project, compositeApp, compositeAppVersion string) ([]App, error)

GetApps returns all Apps for given composite App

type AppClusterInfo

type AppClusterInfo struct {
	Name       string       `json:"name"`
	AllOfArray []gpic.AllOf `json:"allOf,omitempty"`
	AnyOfArray []gpic.AnyOf `json:"anyOf,omitempty"`
}

AppClusterInfo is a type linking the app and the clusters on which they need to be installed.

type AppContent

type AppContent struct {
	FileContent string
}

AppContent contains fileContent

type AppDependency

type AppDependency struct {
	MetaData AdMetaData `json:"metadata"`
	Spec     AdSpecData `json:"spec,omitempty"`
}

AppDependency contains the metaData for AppDependency

func (AppDependency) String

func (pk AppDependency) String() string

We will use json marshalling to convert to string to preserve the underlying structure.

type AppDependencyClient

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

AppDependencyClient implements the AppDependencyManager It will also be used to maintain some localized state

func NewAppDependencyClient

func NewAppDependencyClient() *AppDependencyClient

NewAppDependencyClient returns an instance of the AppDependencyClient which implements the AppDependencyManager

func (*AppDependencyClient) CreateAppDependency

func (d *AppDependencyClient) CreateAppDependency(ctx context.Context, dep AppDependency, p string, ca string, v string, app string, exists bool) (AppDependency, error)

CreateAppDependency a new collection based on the AppDependency

func (*AppDependencyClient) DeleteAppDependency

func (d *AppDependencyClient) DeleteAppDependency(ctx context.Context, name string, p string, ca string, v string, app string) error

DeleteAppDependency the AppDependency from database

func (*AppDependencyClient) GetAllAppDependency

func (d *AppDependencyClient) GetAllAppDependency(ctx context.Context, p string, ca string, v string, app string) ([]AppDependency, error)

GetAllAppDependency returns all the AppDependencys

func (*AppDependencyClient) GetAllSpecAppDependency

func (d *AppDependencyClient) GetAllSpecAppDependency(ctx context.Context, p string, ca string, v string, app string) ([]AdSpecData, error)

GetAllAppDependency returns all the AppDependencys

func (*AppDependencyClient) GetAppDependency

func (d *AppDependencyClient) GetAppDependency(ctx context.Context, dep string, p string, ca string, v string, app string) (AppDependency, error)

GetAppDependency returns the AppDependency for corresponding name

type AppDependencyKey

type AppDependencyKey struct {
	Name         string `json:"appDependency"`
	AppName      string `json:"app"`
	Project      string `json:"project"`
	CompositeApp string `json:"compositeApp"`
	Version      string `json:"compositeAppVersion"`
}

AppDependencyKey is the key structure that is used in the database

type AppDependencyManager

type AppDependencyManager interface {
	CreateAppDependency(ctx context.Context, dep AppDependency, p string, ca string, v string, app string, exists bool) (AppDependency, error)
	GetAppDependency(ctx context.Context, dep string, p string, ca string, v string, app string) (AppDependency, error)
	DeleteAppDependency(ctx context.Context, dep string, p string, ca string, v string, app string) error
	GetAllAppDependency(ctx context.Context, p string, ca string, v string, app string) ([]AppDependency, error)
}

AppDependencyManager is an interface exposes the AppDependency functionality

type AppHandler

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

type AppIntent

type AppIntent struct {
	MetaData MetaData `json:"metadata,omitempty"`
	Spec     SpecData `json:"spec,omitempty"`
}

AppIntent has two components - metadata, spec

type AppIntentClient

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

AppIntentClient implements the AppIntentManager interface

func NewAppIntentClient

func NewAppIntentClient() *AppIntentClient

NewAppIntentClient returns an instance of AppIntentClient

func (*AppIntentClient) CloneAppIntents

func (c *AppIntentClient) CloneAppIntents(ctx context.Context, p string, ca string, v string, i string, di string, tDi string) ([]AppIntent, error)

func (*AppIntentClient) CreateAppIntent

func (c *AppIntentClient) CreateAppIntent(ctx context.Context, a AppIntent, p string, ca string, v string, i string, digName string, failIfExists bool) (AppIntent, bool, error)

CreateAppIntent creates an entry for AppIntent in the db. Other input parameters for it - projectName, compositeAppName, version, intentName and deploymentIntentGroupName. failIfExists - indicates the request is POST=true or PUT=false

func (*AppIntentClient) DeleteAppIntent

func (c *AppIntentClient) DeleteAppIntent(ctx context.Context, ai string, p string, ca string, v string, i string, digName string) error

DeleteAppIntent delete an AppIntent

func (*AppIntentClient) GetAllAppIntents

func (c *AppIntentClient) GetAllAppIntents(ctx context.Context, p, ca, v, i, digName string) ([]AppIntent, error)

GetAllAppIntents takes in paramaters ProjectName, CompositeAppName, CompositeNameVersion and GenericPlacementIntentName,DeploymentIntentGroupName. Returns an array of AppIntents

func (*AppIntentClient) GetAllIntentsByApp

func (c *AppIntentClient) GetAllIntentsByApp(ctx context.Context, aN, p, ca, v, i, digName string) (SpecData, error)

GetAllIntentsByApp queries intent by AppName, it takes in parameters AppName, CompositeAppName, CompositeNameVersion, GenericPlacementIntentName & DeploymentIntentGroupName. Returns SpecData which contains all the intents for the app.

func (*AppIntentClient) GetAppIntent

func (c *AppIntentClient) GetAppIntent(ctx context.Context, ai string, p string, ca string, v string, i string, digName string) (AppIntent, error)

GetAppIntent shall take arguments - name of the app intent, name of the project, name of the composite app, version of the composite app,intent name and deploymentIntentGroupName. It shall return the AppIntent

type AppIntentFindByAppKey

type AppIntentFindByAppKey struct {
	Project                   string `json:"project"`
	CompositeApp              string `json:"compositeApp"`
	CompositeAppVersion       string `json:"compositeAppVersion"`
	Intent                    string `json:"genericPlacementIntent"`
	DeploymentIntentGroupName string `json:"deploymentIntentGroup"`
	AppName                   string `json:"app"`
}

AppIntentFindByAppKey required for query

func (AppIntentFindByAppKey) String

func (ai AppIntentFindByAppKey) String() string

We will use json marshalling to convert to string to preserve the underlying structure.

type AppIntentKey

type AppIntentKey struct {
	Name                      string `json:"genericAppPlacementIntent"`
	Project                   string `json:"project"`
	CompositeApp              string `json:"compositeApp"`
	Version                   string `json:"compositeAppVersion"`
	Intent                    string `json:"genericPlacementIntent"`
	DeploymentIntentGroupName string `json:"deploymentIntentGroup"`
}

AppIntentKey is used as primary key

func (AppIntentKey) String

func (ak AppIntentKey) String() string

We will use json marshalling to convert to string to preserve the underlying structure.

type AppIntentManager

type AppIntentManager interface {
	CreateAppIntent(ctx context.Context, a AppIntent, p string, ca string, v string, i string, digName string, failIfExists bool) (AppIntent, bool, error)
	GetAppIntent(ctx context.Context, ai string, p string, ca string, v string, i string, digName string) (AppIntent, error)
	GetAllIntentsByApp(ctx context.Context, aN, p, ca, v, i, digName string) (SpecData, error)
	GetAllAppIntents(ctx context.Context, p, ca, v, i, digName string) ([]AppIntent, error)
	DeleteAppIntent(ctx context.Context, ai string, p string, ca string, v string, i string, digName string) error
}

AppIntentManager is an interface which exposes the AppIntentManager functionalities

type AppIntentQueryKey

type AppIntentQueryKey struct {
	AppName string `json:"app"`
}

AppIntentQueryKey required for query

type AppKey

type AppKey struct {
	App                 string `json:"app"`
	Project             string `json:"project"`
	CompositeApp        string `json:"compositeApp"`
	CompositeAppVersion string `json:"compositeAppVersion"`
}

AppKey is the key structure that is used in the database

func (AppKey) String

func (aK AppKey) String() string

We will use json marshalling to convert to string to preserve the underlying structure.

type AppManager

type AppManager interface {
	CreateApp(ctx context.Context, a App, ac AppContent, p string, cN string, cV string, exists bool) (App, error)
	GetApp(ctx context.Context, name string, p string, cN string, cV string) (App, error)
	GetAppContent(ctx context.Context, name string, p string, cN string, cV string) (AppContent, error)
	GetApps(ctx context.Context, p string, cN string, cV string) ([]App, error)
	DeleteApp(ctx context.Context, name string, p string, cN string, cV string) error
}

AppManager is an interface exposes the App functionality

type AppMetaData

type AppMetaData struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	UserData1   string `json:"userData1"`
	UserData2   string `json:"userData2"`
}

AppMetaData contains the parameters needed for Apps

type AppProfile

type AppProfile struct {
	Metadata AppProfileMetadata `json:"metadata"`
	Spec     AppProfileSpec     `json:"spec"`
}

AppProfile contains the parameters needed for AppProfiles It implements the interface for managing the AppProfiles

type AppProfileClient

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

AppProfileClient implements the Manager It will also be used to maintain some localized state

func NewAppProfileClient

func NewAppProfileClient() *AppProfileClient

NewAppProfileClient returns an instance of the AppProfileClient which implements the Manager

func (*AppProfileClient) CreateAppProfile

func (c *AppProfileClient) CreateAppProfile(ctx context.Context, project, compositeApp, compositeAppVersion, compositeProfile string, ap AppProfile, ac AppProfileContent, exists bool) (AppProfile, error)

CreateAppProfile creates an entry for AppProfile in the database.

func (*AppProfileClient) DeleteAppProfile

func (c *AppProfileClient) DeleteAppProfile(ctx context.Context, project, compositeApp, compositeAppVersion, compositeProfile, profile string) error

Delete AppProfile from the database

func (*AppProfileClient) GetAppProfile

func (c *AppProfileClient) GetAppProfile(ctx context.Context, project, compositeApp, compositeAppVersion, compositeProfile, profile string) (AppProfile, error)

GetAppProfile - return specified App Profile

func (*AppProfileClient) GetAppProfileByApp

func (c *AppProfileClient) GetAppProfileByApp(ctx context.Context, project, compositeApp, compositeAppVersion, compositeProfile, appName string) (AppProfile, error)

GetAppProfileByApp - return all App Profiles for given composite profile

func (*AppProfileClient) GetAppProfileContent

func (c *AppProfileClient) GetAppProfileContent(ctx context.Context, project, compositeApp, compositeAppVersion, compositeProfile, profile string) (AppProfileContent, error)

func (*AppProfileClient) GetAppProfileContentByApp

func (c *AppProfileClient) GetAppProfileContentByApp(ctx context.Context, project, compositeApp, compositeAppVersion, compositeProfile, appName string) (AppProfileContent, error)

func (*AppProfileClient) GetAppProfiles

func (c *AppProfileClient) GetAppProfiles(ctx context.Context, project, compositeApp, compositeAppVersion, compositeProfile string) ([]AppProfile, error)

GetAppProfile - return all App Profiles for given composite profile

type AppProfileContent

type AppProfileContent struct {
	Profile string `json:"profile"`
}

type AppProfileFindByAppKey

type AppProfileFindByAppKey struct {
	Project             string `json:"project"`
	CompositeApp        string `json:"compositeApp"`
	CompositeAppVersion string `json:"compositeAppVersion"`
	CompositeProfile    string `json:"compositeProfile"`
	AppName             string `json:"app"`
}

type AppProfileKey

type AppProfileKey struct {
	Project             string `json:"project"`
	CompositeApp        string `json:"compositeApp"`
	CompositeAppVersion string `json:"compositeAppVersion"`
	CompositeProfile    string `json:"compositeProfile"`
	Profile             string `json:"appProfile"`
}

AppProfileKey is the key structure that is used in the database

type AppProfileManager

type AppProfileManager interface {
	CreateAppProfile(ctx context.Context, provider, compositeApp, compositeAppVersion, compositeProfile string, ap AppProfile, ac AppProfileContent, exists bool) (AppProfile, error)
	GetAppProfile(ctx context.Context, project, compositeApp, compositeAppVersion, compositeProfile, profile string) (AppProfile, error)
	GetAppProfiles(ctx context.Context, project, compositeApp, compositeAppVersion, compositeProfile string) ([]AppProfile, error)
	GetAppProfileByApp(ctx context.Context, project, compositeApp, compositeAppVersion, compositeProfile, appName string) (AppProfile, error)
	GetAppProfileContent(ctx context.Context, project, compositeApp, compositeAppVersion, compositeProfile, profile string) (AppProfileContent, error)
	GetAppProfileContentByApp(ctx context.Context, project, compositeApp, compositeAppVersion, compositeProfile, appName string) (AppProfileContent, error)
	DeleteAppProfile(ctx context.Context, project, compositeApp, compositeAppVersion, compositeProfile, profile string) error
}

AppProfileManager exposes the AppProfile functionality

type AppProfileMetadata

type AppProfileMetadata struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	UserData1   string `json:"userData1"`
	UserData2   string `json:"userData2"`
}

AppProfileMetadata contains the metadata for AppProfiles

type AppProfileQueryKey

type AppProfileQueryKey struct {
	AppName string `json:"app"`
}

type AppProfileSpec

type AppProfileSpec struct {
	AppName string `json:"app"`
}

AppProfileSpec contains the Spec for AppProfiles

type ApplicationsAndClusterInfo

type ApplicationsAndClusterInfo struct {
	ArrayOfAppClusterInfo []AppClusterInfo `json:"applications"`
}

ApplicationsAndClusterInfo type represents the list of

type Client

type Client struct {
	Project                *ProjectClient
	CompositeApp           *CompositeAppClient
	App                    *AppClient
	Controller             *controller.ControllerClient
	GenericPlacementIntent *GenericPlacementIntentClient
	AppIntent              *AppIntentClient
	DeploymentIntentGroup  *DeploymentIntentGroupClient
	Intent                 *IntentClient
	CompositeProfile       *CompositeProfileClient
	AppProfile             *AppProfileClient
	AppDependency          *AppDependencyClient
	Service                ServiceManager
	// Add Clients for API's here
	Instantiation *InstantiationClient
}

Client for using the services in the orchestrator

func NewClient

func NewClient() *Client

NewClient creates a new client for using the services

type CloneJson

type CloneJson struct {
	CloneDigNamePrefix string `json:"cloneDigNamePrefix"`
	NumberOfClones     int    `json:"numberOfClones"`
	StartNumber        int    `json:"startNumber"`
}

CloneJson contains spec for clone API

type ClusterClient

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

func NewClusterClient

func NewClusterClient() *ClusterClient

func (*ClusterClient) GetAllClusters

func (v *ClusterClient) GetAllClusters(ctx context.Context, project, logicalCloud string) ([]common.Cluster, error)

NOTE: this method is a duplicate of the identically-named one in dcm/pkg/module/cluster.go due to current cross-reference (cyclic dependency) issue between DCM and Orchestrator

type CompositeApp

type CompositeApp struct {
	Metadata CompositeAppMetaData `json:"metadata"`
	Spec     CompositeAppSpec     `json:"spec"`
}

CompositeApp contains metadata and spec for CompositeApps

type CompositeAppClient

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

CompositeAppClient implements the CompositeAppManager It will also be used to maintain some localized state

func NewCompositeAppClient

func NewCompositeAppClient() *CompositeAppClient

NewCompositeAppClient returns an instance of the CompositeAppClient which implements the CompositeAppManager

func (*CompositeAppClient) CreateCompositeApp

func (v *CompositeAppClient) CreateCompositeApp(ctx context.Context, c CompositeApp, p string, exists bool) (CompositeApp, error)

CreateCompositeApp creates a new collection based on the CompositeApp

func (*CompositeAppClient) DeleteCompositeApp

func (v *CompositeAppClient) DeleteCompositeApp(ctx context.Context, name string, version string, p string) error

DeleteCompositeApp deletes the CompositeApp from database

func (*CompositeAppClient) GetAllCompositeApps

func (v *CompositeAppClient) GetAllCompositeApps(ctx context.Context, p string) ([]CompositeApp, error)

GetAllCompositeApps returns all the compositeApp for a given project

func (*CompositeAppClient) GetCompositeApp

func (v *CompositeAppClient) GetCompositeApp(ctx context.Context, name string, version string, p string) (CompositeApp, error)

GetCompositeApp returns the CompositeApp for corresponding name

type CompositeAppKey

type CompositeAppKey struct {
	CompositeAppName string `json:"compositeApp"`
	Version          string `json:"compositeAppVersion"`
	Project          string `json:"project"`
}

CompositeAppKey is the key structure that is used in the database

func (CompositeAppKey) String

func (cK CompositeAppKey) String() string

We will use json marshalling to convert to string to preserve the underlying structure.

type CompositeAppManager

type CompositeAppManager interface {
	CreateCompositeApp(ctx context.Context, c CompositeApp, p string, exists bool) (CompositeApp, error)
	GetCompositeApp(ctx context.Context, name string, version string, p string) (CompositeApp, error)
	GetAllCompositeApps(ctx context.Context, p string) ([]CompositeApp, error)
	DeleteCompositeApp(ctx context.Context, name string, version string, p string) error
}

CompositeAppManager is an interface exposes the CompositeApp functionality

type CompositeAppMetaData

type CompositeAppMetaData struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	UserData1   string `json:"userData1"`
	UserData2   string `json:"userData2"`
}

CompositeAppMetaData contains the parameters needed for CompositeApps

type CompositeAppSpec

type CompositeAppSpec struct {
	Version string `json:"compositeAppVersion"`
	Id      string `json:"id"`
}

CompositeAppSpec contains the Version of the CompositeApp

type CompositeProfile

type CompositeProfile struct {
	Metadata CompositeProfileMetadata `json:"metadata"`
}

CompositeProfile contains the parameters needed for CompositeProfiles It implements the interface for managing the CompositeProfiles

type CompositeProfileClient

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

CompositeProfileClient implements the Manager It will also be used to maintain some localized state

func NewCompositeProfileClient

func NewCompositeProfileClient() *CompositeProfileClient

NewCompositeProfileClient returns an instance of the CompositeProfileClient which implements the Manager

func (*CompositeProfileClient) CreateCompositeProfile

func (c *CompositeProfileClient) CreateCompositeProfile(ctx context.Context, cpf CompositeProfile, p string, ca string,
	v string, exists bool) (CompositeProfile, error)

CreateCompositeProfile creates an entry for CompositeProfile in the database. Other Input parameters for it - projectName, compositeAppName, version

func (*CompositeProfileClient) DeleteCompositeProfile

func (c *CompositeProfileClient) DeleteCompositeProfile(ctx context.Context, cpf string, p string, ca string, v string) error

DeleteCompositeProfile deletes the compsiteApp profile from the database

func (*CompositeProfileClient) GetCompositeProfile

func (c *CompositeProfileClient) GetCompositeProfile(ctx context.Context, cpf string, p string, ca string, v string) (CompositeProfile, error)

GetCompositeProfile shall take arguments - name of the composite profile, name of the project, name of the composite app and version of the composite app. It shall return the CompositeProfile if its present.

func (*CompositeProfileClient) GetCompositeProfiles

func (c *CompositeProfileClient) GetCompositeProfiles(ctx context.Context, p string, ca string, v string) ([]CompositeProfile, error)

GetCompositeProfiles shall take arguments - name of the project, name of the composite profile and version of the composite app. It shall return an array of CompositeProfile.

type CompositeProfileKey

type CompositeProfileKey struct {
	Name         string `json:"compositeProfile"`
	Project      string `json:"project"`
	CompositeApp string `json:"compositeApp"`
	Version      string `json:"compositeAppVersion"`
}

CompositeProfileKey is the key structure that is used in the database

func (CompositeProfileKey) String

func (cpk CompositeProfileKey) String() string

We will use json marshalling to convert to string to preserve the underlying structure.

type CompositeProfileManager

type CompositeProfileManager interface {
	CreateCompositeProfile(ctx context.Context, cpf CompositeProfile, p string, ca string,
		v string, exists bool) (CompositeProfile, error)
	GetCompositeProfile(ctx context.Context, compositeProfileName string, projectName string,
		compositeAppName string, version string) (CompositeProfile, error)
	GetCompositeProfiles(ctx context.Context, projectName string, compositeAppName string,
		version string) ([]CompositeProfile, error)
	DeleteCompositeProfile(ctx context.Context, compositeProfileName string, projectName string,
		compositeAppName string, version string) error
}

CompositeProfileManager exposes the CompositeProfile functionality

type CompositeProfileMetadata

type CompositeProfileMetadata struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	UserData1   string `json:"userData1"`
	UserData2   string `json:"userData2"`
}

CompositeProfileMetadata contains the metadata for CompositeProfiles

type ControllerElement

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

ControllerElement consists of controller and an internal field - index

type DepMetaData

type DepMetaData struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	UserData1   string `json:"userData1"`
	UserData2   string `json:"userData2"`
}

DepMetaData has Name, description, userdata1, userdata2

type DepSpecData

type DepSpecData struct {
	Id                   string                 `json:"id"`
	Profile              string                 `json:"compositeProfile"`
	Version              string                 `json:"version"`
	OverrideValuesObj    []OverrideValues       `json:"overrideValues"`
	LogicalCloud         string                 `json:"logicalCloud"`
	Services             map[string]interface{} `json:"services"`
	InstantiatedServices map[string]interface{} `json:"instantiatedServices"`
	Action               string                 `json:"action"`
}

DepSpecData has profile, version, OverrideValuesObj

type DeploymentAppsListStatus

type DeploymentAppsListStatus struct {
	Project               string `json:"project,omitempty"`
	CompositeAppName      string `json:"compositeApp,omitempty"`
	CompositeAppVersion   string `json:"compositeAppVersion,omitempty"`
	CompositeProfileName  string `json:"compositeProfile,omitempty"`
	status.AppsListResult `json:",inline"`
}

DeploymentAppsListStatus is the structure used to return the list of Apps that have been/were deployed for the DeploymentIntentGroup

type DeploymentClustersByAppStatus

type DeploymentClustersByAppStatus struct {
	Project                    string `json:"project,omitempty"`
	CompositeAppName           string `json:"compositeApp,omitempty"`
	CompositeAppVersion        string `json:"compositeAppVersion,omitempty"`
	CompositeProfileName       string `json:"compositeProfile,omitempty"`
	status.ClustersByAppResult `json:",inline"`
}

DeploymentClustersByAppStatus is the structure used to return the list of Apps that have been/were deployed for the DeploymentIntentGroup

type DeploymentIntentGroup

type DeploymentIntentGroup struct {
	MetaData DepMetaData `json:"metadata"`
	Spec     DepSpecData `json:"spec"`
}

DeploymentIntentGroup shall have 2 fields - MetaData and Spec

type DeploymentIntentGroupClient

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

DeploymentIntentGroupClient implements the DeploymentIntentGroupManager interface

func NewDeploymentIntentGroupClient

func NewDeploymentIntentGroupClient() *DeploymentIntentGroupClient

NewDeploymentIntentGroupClient return an instance of DeploymentIntentGroupClient which implements DeploymentIntentGroupManager

func (*DeploymentIntentGroupClient) CreateDeploymentIntentGroup

func (c *DeploymentIntentGroupClient) CreateDeploymentIntentGroup(ctx context.Context, d DeploymentIntentGroup, p string, ca string, v string, failIfExists bool) (DeploymentIntentGroup, bool, error)

CreateDeploymentIntentGroup creates an entry for a given DeploymentIntentGroup in the database. Other Input parameters for it - projectName, compositeAppName, version

func (*DeploymentIntentGroupClient) DeleteDeploymentIntentGroup

func (c *DeploymentIntentGroupClient) DeleteDeploymentIntentGroup(ctx context.Context, di string, p string, ca string, v string) error

DeleteDeploymentIntentGroup deletes a DeploymentIntentGroup

func (*DeploymentIntentGroupClient) GetAllDeploymentIntentGroups

func (c *DeploymentIntentGroupClient) GetAllDeploymentIntentGroups(ctx context.Context, p string, ca string, v string) ([]DeploymentIntentGroup, error)

GetAllDeploymentIntentGroups returns all the deploymentIntentGroups under a specific project, compositeApp and version

func (*DeploymentIntentGroupClient) GetDeploymentIntentGroup

func (c *DeploymentIntentGroupClient) GetDeploymentIntentGroup(ctx context.Context, di string, p string, ca string, v string) (DeploymentIntentGroup, error)

GetDeploymentIntentGroup returns the DeploymentIntentGroup with a given name, project, compositeApp and version of compositeApp

func (*DeploymentIntentGroupClient) GetDeploymentIntentGroupState

func (c *DeploymentIntentGroupClient) GetDeploymentIntentGroupState(ctx context.Context, di string, p string, ca string, v string) (state.StateInfo, error)

GetDeploymentIntentGroupState returns the DIG-StateInfo with a given DeploymentIntentname, project, compositeAppName and version of compositeApp

type DeploymentIntentGroupKey

type DeploymentIntentGroupKey struct {
	Name         string `json:"deploymentIntentGroup"`
	Project      string `json:"project"`
	CompositeApp string `json:"compositeApp"`
	Version      string `json:"compositeAppVersion"`
}

DeploymentIntentGroupKey consists of Name of the deployment group, project name, CompositeApp name, CompositeApp version

func DeploymentIntentGroupKeyFromDigId

func DeploymentIntentGroupKeyFromDigId(id string) (*DeploymentIntentGroupKey, error)

DeploymentIntentGroupKeyFromDigId receives ID in format of "<project>.<ca>.<version>.<name>"

func (DeploymentIntentGroupKey) String

func (dk DeploymentIntentGroupKey) String() string

We will use json marshalling to convert to string to preserve the underlying structure.

type DeploymentIntentGroupManager

type DeploymentIntentGroupManager interface {
	CreateDeploymentIntentGroup(ctx context.Context, d DeploymentIntentGroup, p string, ca string, v string, failIfExists bool) (DeploymentIntentGroup, bool, error)
	GetDeploymentIntentGroup(ctx context.Context, di string, p string, ca string, v string) (DeploymentIntentGroup, error)
	GetDeploymentIntentGroupState(ctx context.Context, di string, p string, ca string, v string) (state.StateInfo, error)
	DeleteDeploymentIntentGroup(ctx context.Context, di string, p string, ca string, v string) error
	GetAllDeploymentIntentGroups(ctx context.Context, p string, ca string, v string) ([]DeploymentIntentGroup, error)
}

DeploymentIntentGroupManager is an interface which exposes the DeploymentIntentGroupManager functionality

type DeploymentResourcesByAppStatus

type DeploymentResourcesByAppStatus struct {
	Project                     string `json:"project,omitempty"`
	CompositeAppName            string `json:"compositeApp,omitempty"`
	CompositeAppVersion         string `json:"compositeAppVersion,omitempty"`
	CompositeProfileName        string `json:"compositeProfile,omitempty"`
	status.ResourcesByAppResult `json:",inline"`
}

DeploymentResourcesByAppStatus is the structure used to return the list of Apps that have been/were deployed for the DeploymentIntentGroup

type DeploymentStatus

type DeploymentStatus struct {
	DigId                string `json:"digId",omitempty`
	Project              string `json:"project,omitempty"`
	CompositeAppName     string `json:"compositeApp,omitempty"`
	CompositeAppVersion  string `json:"compositeAppVersion,omitempty"`
	CompositeProfileName string `json:"compositeProfile,omitempty"`
	status.StatusResult  `json:",inline"`
}

DeploymentStatus is the structure used to return general status results for the Deployment Intent Group

type GenIntentMetaData

type GenIntentMetaData struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	UserData1   string `json:"userData1"`
	UserData2   string `json:"userData2"`
}

GenIntentMetaData has name, description, userdata1, userdata2

type GenericPlacementIntent

type GenericPlacementIntent struct {
	MetaData GenIntentMetaData `json:"metadata"`
}

GenericPlacementIntent shall have 2 fields - metadata and spec

type GenericPlacementIntentClient

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

GenericPlacementIntentClient implements the GenericPlacementIntentManager interface

func NewGenericPlacementIntentClient

func NewGenericPlacementIntentClient() *GenericPlacementIntentClient

NewGenericPlacementIntentClient return an instance of GenericPlacementIntentClient which implements GenericPlacementIntentManager

func (*GenericPlacementIntentClient) CloneGenericPlacementIntents

func (c *GenericPlacementIntentClient) CloneGenericPlacementIntents(ctx context.Context, p, ca, v, di, tDi string) ([]GenericPlacementIntent, error)

CloneGenericPlacementIntents clone the intents from the database

func (*GenericPlacementIntentClient) CreateGenericPlacementIntent

func (c *GenericPlacementIntentClient) CreateGenericPlacementIntent(ctx context.Context, g GenericPlacementIntent, p string, ca string, v string, digName string, failIfExists bool) (GenericPlacementIntent, bool, error)

CreateGenericPlacementIntent creates an entry for GenericPlacementIntent in the database. Other Input parameters for it - projectName, compositeAppName, version and deploymentIntentGroupName failIfExists - indicates the request is POST=true or PUT=false

func (*GenericPlacementIntentClient) DeleteGenericPlacementIntent

func (c *GenericPlacementIntentClient) DeleteGenericPlacementIntent(ctx context.Context, i string, p string, ca string, v string, digName string) error

DeleteGenericPlacementIntent the intent from the database

func (*GenericPlacementIntentClient) GetAllGenericPlacementIntents

func (c *GenericPlacementIntentClient) GetAllGenericPlacementIntents(ctx context.Context, p string, ca string, v string, digName string) ([]GenericPlacementIntent, error)

GetAllGenericPlacementIntents returns all the generic placement intents for a given compsoite app name, composite app version, project and deploymentIntentGroupName

func (*GenericPlacementIntentClient) GetGenericPlacementIntent

func (c *GenericPlacementIntentClient) GetGenericPlacementIntent(ctx context.Context, i string, p string, ca string, v string, digName string) (GenericPlacementIntent, error)

GetGenericPlacementIntent shall take arguments - name of the intent, name of the project, name of the composite app, version of the composite app and deploymentIntentGroupName. It shall return the genericPlacementIntent if its present.

type GenericPlacementIntentKey

type GenericPlacementIntentKey struct {
	Name         string `json:"genericPlacementIntent"`
	Project      string `json:"project"`
	CompositeApp string `json:"compositeApp"`
	Version      string `json:"compositeAppVersion"`
	DigName      string `json:"deploymentIntentGroup"`
}

GenericPlacementIntentKey is used as the primary key

func (GenericPlacementIntentKey) String

func (gk GenericPlacementIntentKey) String() string

We will use json marshalling to convert to string to preserve the underlying structure.

type GenericPlacementIntentManager

type GenericPlacementIntentManager interface {
	CreateGenericPlacementIntent(ctx context.Context, g GenericPlacementIntent, p string, ca string, v string, digName string, failIfExists bool) (GenericPlacementIntent, bool, error)
	GetGenericPlacementIntent(ctx context.Context, intentName string, projectName string,
		compositeAppName string, version string, digName string) (GenericPlacementIntent, error)
	DeleteGenericPlacementIntent(ctx context.Context, intentName string, projectName string,
		compositeAppName string, version string, digName string) error

	GetAllGenericPlacementIntents(ctx context.Context, p string, ca string, v string, digName string) ([]GenericPlacementIntent, error)
}

GenericPlacementIntentManager is an interface which exposes the GenericPlacementIntentManager functionality

type InstantiationClient

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

InstantiationClient implements the InstantiationManager

func NewInstantiationClient

func NewInstantiationClient() *InstantiationClient

NewInstantiationClient returns an instance of InstantiationClient

func (InstantiationClient) Approve

func (c InstantiationClient) Approve(ctx context.Context, p string, ca string, v string, di string) error

Approve approves an instantiation

func (InstantiationClient) CleanDIGAppContext

func (c InstantiationClient) CleanDIGAppContext(contextId string) error

func (InstantiationClient) CloneDig

func (c InstantiationClient) CloneDig(ctx context.Context, p, ca, v, di string, cloneSpec *CloneJson) ([]DeploymentIntentGroup, error)

func (InstantiationClient) GenericStatus

func (c InstantiationClient) GenericStatus(ctx context.Context, p, ca, v, di, qStatusInstance, qType, qOutput string, fApps, fClusters, fResources []string) (status.StatusResult, error)

GenericStatus takes in projectName, compositeAppName, compositeAppVersion, DeploymentIntentName. This method is responsible obtaining the status of the deployment, which is made available in the appcontext.

func (InstantiationClient) Instantiate

func (c InstantiationClient) Instantiate(ctx context.Context, p string, ca string, v string, di string) error

Instantiate methods takes in projectName, compositeAppName, compositeAppVersion, DeploymentIntentName. This method is responsible for template resolution, intent resolution, creation and saving of context for saving into etcd.

func (InstantiationClient) Migrate

func (c InstantiationClient) Migrate(ctx context.Context, p string, ca string, v string, tCav string, di string, tDi string) error

Migrate methods takes in projectName, compositeAppName, compositeAppVersion, DeploymentIntentName, targetCompositeAppVersion and targetDeploymentIntentName. This method is responsible for creation and saving of context for saving into etcd and ensuring sourceDeploymentIntent gets migrated to targetDeploymentIntent.

func (InstantiationClient) Rollback

func (c InstantiationClient) Rollback(ctx context.Context, p string, ca string, v string, di string, rbRev string) error

Rollback methods takes in projectName, compositeAppName, compositeAppVersion, DeploymentIntentName and revision. This method is responsible for creation and saving of context for saving into etcd and ensuring DeploymentIntentGroup is rollback to given revision.

func (InstantiationClient) Status

func (c InstantiationClient) Status(ctx context.Context, p, ca, v, di, qInstance, qType, qOutput string, fApps, fClusters, fResources []string) (DeploymentStatus, error)

Status takes in projectName, compositeAppName, compositeAppVersion, DeploymentIntentName. This method is responsible obtaining the status of the deployment, which is made available in the appcontext.

func (InstantiationClient) StatusAppsList

func (c InstantiationClient) StatusAppsList(ctx context.Context, p, ca, v, di, qInstance string) (DeploymentAppsListStatus, error)

StatusAppsList takes in projectName, compositeAppName, compositeAppVersion, DeploymentIntentName. This method returns the list of apps in use for the given instance of appcontext of this deployment intent group.

func (InstantiationClient) StatusClustersByApp

func (c InstantiationClient) StatusClustersByApp(ctx context.Context, p, ca, v, di, qInstance string, fApps []string) (DeploymentClustersByAppStatus, error)

StatusClustersByApp takes in projectName, compositeAppName, compositeAppVersion, DeploymentIntentName. This method returns the list of apps in use for the given instance of appcontext of this deployment intent group.

func (InstantiationClient) StatusResourcesByApp

func (c InstantiationClient) StatusResourcesByApp(ctx context.Context, p, ca, v, di, qInstance, qType string, fApps, fClusters []string) (DeploymentResourcesByAppStatus, error)

StatusResourcesByApp takes in projectName, compositeAppName, compositeAppVersion, DeploymentIntentName. This method returns the list of apps in use for the given instance of appcontext of this deployment intent group.

func (InstantiationClient) Stop

func (c InstantiationClient) Stop(ctx context.Context, p string, ca string, v string, di string) error

Stop takes in projectName, compositeAppName, compositeAppVersion, DeploymentIntentName and sets the stopFlag in the associated appContext.

func (InstantiationClient) Terminate

func (c InstantiationClient) Terminate(ctx context.Context, p string, ca string, v string, di string) error

Terminate takes in projectName, compositeAppName, compositeAppVersion, DeploymentIntentName and calls rsync to terminate.

func (InstantiationClient) Update

func (c InstantiationClient) Update(ctx context.Context, p string, ca string, v string, di string) (int64, error)

Update methods takes in projectName, compositeAppName, compositeAppVersion, DeploymentIntentName. This method is responsible for creation and saving of context into etcd and ensuring new intents are applied on DeploymentIntentGroup.

func (InstantiationClient) UpdateInstantiated

func (c InstantiationClient) UpdateInstantiated(ctx context.Context, p string, ca string, v string, di string) error

type InstantiationClientDbInfo

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

InstantiationClientDbInfo consists of storeName and tagState

type InstantiationKey

type InstantiationKey struct {
	Project               string
	CompositeApp          string
	Version               string
	DeploymentIntentGroup string
}

InstantiationKey used in storing the contextid in the momgodb It consists of ProjectName, CompositeAppName, CompositeAppVersion, DeploymentIntentGroup

type InstantiationManager

type InstantiationManager interface {
	Approve(ctx context.Context, p string, ca string, v string, di string) error
	Instantiate(ctx context.Context, p string, ca string, v string, di string) error
	Status(ctx context.Context, p, ca, v, di, qInstance, qType, qOutput string, fApps, fClusters, fResources []string) (DeploymentStatus, error)
	GenericStatus(ctx context.Context, p, ca, v, di, qInstance, qType, qOutput string, fApps, fClusters, fResources []string) (status.StatusResult, error)
	StatusAppsList(ctx context.Context, p, ca, v, di, qInstance string) (DeploymentAppsListStatus, error)
	StatusClustersByApp(ctx context.Context, p, ca, v, di, qInstance string, fApps []string) (DeploymentClustersByAppStatus, error)
	StatusResourcesByApp(ctx context.Context, p, ca, v, di, qInstance, qType string, fApps, fClusters []string) (DeploymentResourcesByAppStatus, error)
	Terminate(ctx context.Context, p string, ca string, v string, di string) error
	Stop(ctx context.Context, p string, ca string, v string, di string) error
	Migrate(ctx context.Context, p string, ca string, v string, tCav string, di string, tDi string) error
	Update(ctx context.Context, p string, ca string, v string, di string) (int64, error)
	Rollback(ctx context.Context, p string, ca string, v string, di string, rbRev string) error
	CloneDig(ctx context.Context, p, ca, v, di string, cloneSpec *CloneJson) ([]DeploymentIntentGroup, error)
}

InstantiationManager is an interface which exposes the InstantiationManager functionalities

type Instantiator

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

func (*Instantiator) MakeAppContext

func (i *Instantiator) MakeAppContext(ctx context.Context) (contextForCompositeApp, error)

MakeAppContext shall make an app context and store the app context into etcd. This shall return contextForCompositeApp

type Intent

type Intent struct {
	MetaData IntentMetaData `json:"metadata"`
	Spec     IntentSpecData `json:"spec"`
}

Intent shall have 2 fields - MetaData and Spec

type IntentClient

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

IntentClient implements the AddIntentManager interface

func NewIntentClient

func NewIntentClient() *IntentClient

NewIntentClient returns an instance of AddIntentClient

func (*IntentClient) AddIntent

func (c *IntentClient) AddIntent(ctx context.Context, a Intent, p string, ca string, v string, di string, failIfExists bool) (Intent, bool, error)

AddIntent adds a given intent to the deployment-intent-group and stores in the db. Other input parameters for it - projectName, compositeAppName, version, DeploymentIntentgroupName

func (IntentClient) CloneIntents

func (c IntentClient) CloneIntents(ctx context.Context, p, ca, v, di, tDi string) ([]*Intent, error)

func (IntentClient) DeleteIntent

func (c IntentClient) DeleteIntent(ctx context.Context, i string, p string, ca string, v string, di string) error

DeleteIntent deletes a given intent tied to project, composite app and deployment intent group

func (IntentClient) GetAllIntents

func (c IntentClient) GetAllIntents(ctx context.Context, p string, ca string, v string, di string) (ListOfIntents, error)

GetAllIntents takes in projectName, CompositeAppName, CompositeAppVersion, DeploymentIntentName . It returns ListOfIntents.

func (*IntentClient) GetIntent

func (c *IntentClient) GetIntent(ctx context.Context, i string, p string, ca string, v string, di string) (Intent, error)

GetIntent takes in an IntentName, ProjectName, CompositeAppName, Version and DeploymentIntentGroup. It returns the Intent.

func (IntentClient) GetIntentByName

func (c IntentClient) GetIntentByName(ctx context.Context, i string, p string, ca string, v string, di string) (IntentSpecData, error)

GetIntentByName takes in IntentName, projectName, CompositeAppName, CompositeAppVersion and deploymentIntentGroupName returns the list of intents under the IntentName.

type IntentKey

type IntentKey struct {
	Name                  string `json:"groupIntent"`
	Project               string `json:"project"`
	CompositeApp          string `json:"compositeApp"`
	Version               string `json:"compositeAppVersion"`
	DeploymentIntentGroup string `json:"deploymentIntentGroup"`
}

IntentKey consists of Name if the intent, Project name, CompositeApp name, CompositeApp version

func (IntentKey) String

func (ik IntentKey) String() string

We will use json marshalling to convert to string to preserve the underlying structure.

type IntentManager

type IntentManager interface {
	AddIntent(ctx context.Context, a Intent, p string, ca string, v string, di string, failIfExists bool) (Intent, bool, error)
	GetIntent(ctx context.Context, i string, p string, ca string, v string, di string) (Intent, error)
	GetAllIntents(ctx context.Context, p, ca, v, di string) (ListOfIntents, error)
	GetIntentByName(ctx context.Context, i, p, ca, v, di string) (IntentSpecData, error)
	DeleteIntent(ctx context.Context, i string, p string, ca string, v string, di string) error
}

IntentManager is an interface which exposes the IntentManager functionality

type IntentMetaData

type IntentMetaData struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	UserData1   string `json:"userData1"`
	UserData2   string `json:"userData2"`
}

IntentMetaData has Name, Description, userdata1, userdata2

type IntentSelectorHandler

type IntentSelectorHandler interface {
	Handle(ctx context.Context, appIntent *AppIntent, digName, project, contextApp, version string) error
}

func NewIntentSelectorHandler

func NewIntentSelectorHandler() IntentSelectorHandler

type IntentSpecData

type IntentSpecData struct {
	Intent map[string]string `json:"intent"`
}

IntentSpecData has Intent

type K8sResource

type K8sResource struct {
	Metadata MetadataList `yaml:"metadata"`
}

TODO move into a better place or reuse existing struct

type ListOfIntents

type ListOfIntents struct {
	ListOfIntents []map[string]string `json:"intent"`
}

ListOfIntents is a list of intents

type LogicalCloudClient

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

func NewLogicalCloudClient

func NewLogicalCloudClient() *LogicalCloudClient

func (*LogicalCloudClient) Get

func (v *LogicalCloudClient) Get(ctx context.Context, project, logicalCloudName string) (common.LogicalCloud, error)

NOTE: this method is a duplicate of the identically-named one in dcm/pkg/module/logicalcloud.go due to current cross-reference (cyclic dependency) issue between DCM and Orchestrator

func (*LogicalCloudClient) GetState

func (v *LogicalCloudClient) GetState(ctx context.Context, p string, lc string) (state.StateInfo, error)

NOTE: this method is a duplicate of the identically-named one in dcm/pkg/module/logicalcloud.go due to current cross-reference (cyclic dependency) issue between DCM and Orchestrator

type MetaData

type MetaData struct {
	Name        string `json:"name,omitempty"`
	Description string `json:"description,omitempty"`
	UserData1   string `json:"userData1,omitempty"`
	UserData2   string `json:"userData2,omitempty"`
}

MetaData has - name, description, userdata1, userdata2

type MetadataList

type MetadataList struct {
	Namespace string `yaml:"namespace"`
}

TODO move into a better place or reuse existing struct

type MigrateJson

type MigrateJson struct {
	MetaData UpdateMetadata `json:"metadata,omitempty"`
	Spec     MigrateSpec    `json:"spec"`
}

MigrateJson contains metadata and spec for migrate API

type MigrateSpec

type MigrateSpec struct {
	TargetCompositeAppVersion string `json:"targetCompositeAppVersion"`
	TargetDigName             string `json:"targetDeploymentIntentGroup"`
}

type OverrideValues

type OverrideValues struct {
	AppName   string            `json:"app"`
	ValuesObj map[string]string `json:"values"`
}

OverrideValues has appName and ValuesObj

type PrioritizedControlList

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

PrioritizedControlList contains PrioritizedList of PlacementControllers and ActionControllers

type PriorityQueue

type PriorityQueue []*ControllerElement

PriorityQueue is the heapArray to store the Controllers

func (PriorityQueue) Len

func (pq PriorityQueue) Len() int

func (PriorityQueue) Less

func (pq PriorityQueue) Less(i, j int) bool

func (*PriorityQueue) Pop

func (pq *PriorityQueue) Pop() interface{}

Pop method returns the controller with the highest priority

func (*PriorityQueue) Push

func (pq *PriorityQueue) Push(c interface{})

Push method add a controller into the heapArray

func (PriorityQueue) Swap

func (pq PriorityQueue) Swap(i, j int)

type Project

type Project struct {
	MetaData ProjectMetaData `json:"metadata"`
}

Project contains the metaData for Projects

type ProjectClient

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

ProjectClient implements the ProjectManager It will also be used to maintain some localized state

func NewProjectClient

func NewProjectClient() *ProjectClient

NewProjectClient returns an instance of the ProjectClient which implements the ProjectManager

func (*ProjectClient) CreateProject

func (v *ProjectClient) CreateProject(ctx context.Context, p Project, exists bool) (Project, error)

CreateProject a new collection based on the project

func (*ProjectClient) DeleteProject

func (v *ProjectClient) DeleteProject(ctx context.Context, name string) error

DeleteProject the Project from database

func (*ProjectClient) GetAllProjects

func (v *ProjectClient) GetAllProjects(ctx context.Context) ([]Project, error)

GetAllProjects returns all the projects

func (*ProjectClient) GetProject

func (v *ProjectClient) GetProject(ctx context.Context, name string) (Project, error)

GetProject returns the Project for corresponding name

type ProjectKey

type ProjectKey struct {
	ProjectName string `json:"project"`
}

ProjectKey is the key structure that is used in the database

func (ProjectKey) String

func (pk ProjectKey) String() string

We will use json marshalling to convert to string to preserve the underlying structure.

type ProjectManager

type ProjectManager interface {
	CreateProject(ctx context.Context, pr Project, exists bool) (Project, error)
	GetProject(ctx context.Context, name string) (Project, error)
	DeleteProject(ctx context.Context, name string) error
	GetAllProjects(ctx context.Context) ([]Project, error)
}

ProjectManager is an interface exposes the Project functionality

type ProjectMetaData

type ProjectMetaData struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	UserData1   string `json:"userData1"`
	UserData2   string `json:"userData2"`
}

ProjectMetaData contains the parameters for creating a project

type RollbackJson

type RollbackJson struct {
	MetaData UpdateMetadata `json:"metadata,omitempty"`
	Spec     RollbackSpec   `json:"spec"`
}

RollbackJson contains metadata and spec for rollback API

type RollbackSpec

type RollbackSpec struct {
	Revison string `json:"revision"`
}

type Service

type Service struct {
	MetaData ServiceMetaData `json:"metadata"`
	Spec     ServiceSpec     `json:"spec"`
}

Service represents a logical group of DIGs

type ServiceAction

type ServiceAction struct {
	State     serviceActionValue `json:"state"`
	TimeStamp time.Time          `json:"time"`
}

type ServiceClient

type ServiceClient struct {
	InstantiationClient *InstantiationClient
	// contains filtered or unexported fields
}

ServiceClient implements the ServiceManager interface

func (*ServiceClient) CreateService

func (sc *ServiceClient) CreateService(ctx context.Context, service *Service) error

CreateService creates a Service in the database

func (*ServiceClient) DeleteService

func (sc *ServiceClient) DeleteService(ctx context.Context, key *ServiceKey) error

DeleteService deletes a Service

func (*ServiceClient) GetAllServices

func (sc *ServiceClient) GetAllServices(ctx context.Context, project string) ([]*Service, error)

GetAllServices returns all the Services

func (*ServiceClient) GetService

func (sc *ServiceClient) GetService(ctx context.Context, key *ServiceKey) (*Service, error)

GetService returns the Service with a given service key

func (*ServiceClient) GetServiceState

func (sc *ServiceClient) GetServiceState(ctx context.Context, key *ServiceKey) (*ServiceState, error)

GetServiceState returns the ServiceState records

func (*ServiceClient) InstantiateService

func (sc *ServiceClient) InstantiateService(ctx context.Context, key *ServiceKey, sda *ServiceDigsAction) error

InstantiateService instantiates a Service

func (*ServiceClient) InstantiateServiceDIGs

func (sc *ServiceClient) InstantiateServiceDIGs(ctx context.Context, key *ServiceKey, sda *ServiceDigsAction) error

InstantiateServiceDIGs instantiates DIGs of a Service

func (*ServiceClient) IsServiceExists

func (sc *ServiceClient) IsServiceExists(ctx context.Context, key *ServiceKey) (bool, error)

IsServiceExists checks if a Service with a given service key exits

func (*ServiceClient) ServiceStatus

func (sc *ServiceClient) ServiceStatus(ctx context.Context, key *ServiceKey) (*ServiceStatusInfo, error)

func (*ServiceClient) TerminateService

func (sc *ServiceClient) TerminateService(ctx context.Context, key *ServiceKey, sda *ServiceDigsAction) error

TerminateService terminates a Service

func (*ServiceClient) TerminateServiceDIGs

func (sc *ServiceClient) TerminateServiceDIGs(ctx context.Context, key *ServiceKey, sda *ServiceDigsAction) error

TerminateServiceDIGs terminates DIGs of a Service

func (*ServiceClient) UpdateService

func (sc *ServiceClient) UpdateService(ctx context.Context, newService *Service) error

UpdateService updates existing Service

func (*ServiceClient) UpdateServiceDigs

func (sc *ServiceClient) UpdateServiceDigs(ctx context.Context, key *ServiceKey, sdu *ServiceDigsUpdate) (*Service, error)

type ServiceDigsAction

type ServiceDigsAction struct {
	Digs  []string `json:"digs"`
	Force bool     `json:"force"`
}

type ServiceDigsUpdate

type ServiceDigsUpdate struct {
	Add    []string `json:"add"`
	Remove []string `json:"remove"`
}

ServiceDigsUpdate contains update info for adding/removing digs to/from Service

func (*ServiceDigsUpdate) Validate

func (sdu *ServiceDigsUpdate) Validate() error

Validate verify that same dig not appearing in "add" and "remove" and DIGs Ids are valid

type ServiceKey

type ServiceKey struct {
	Name    string `json:"service"`
	Project string `json:"project"`
}

ServiceKey is the key structure that is used in the database

func (ServiceKey) String

func (sk ServiceKey) String() string

Json marshalling to convert to string to preserve the underlying structure.

type ServiceManager

type ServiceManager interface {
	CreateService(ctx context.Context, service *Service) error
	UpdateService(ctx context.Context, service *Service) error
	GetAllServices(ctx context.Context, project string) ([]*Service, error)
	GetService(ctx context.Context, key *ServiceKey) (*Service, error)
	IsServiceExists(ctx context.Context, key *ServiceKey) (bool, error)
	UpdateServiceDigs(ctx context.Context, key *ServiceKey, sdu *ServiceDigsUpdate) (*Service, error)
	DeleteService(ctx context.Context, key *ServiceKey) error
	InstantiateService(ctx context.Context, key *ServiceKey, sda *ServiceDigsAction) error
	TerminateService(ctx context.Context, key *ServiceKey, sda *ServiceDigsAction) error
	InstantiateServiceDIGs(ctx context.Context, key *ServiceKey, sda *ServiceDigsAction) error
	TerminateServiceDIGs(ctx context.Context, key *ServiceKey, sda *ServiceDigsAction) error
	ServiceStatus(ctx context.Context, key *ServiceKey) (*ServiceStatusInfo, error)
}

ServiceManager is an interface which exposes the ServiceManager functionality

func NewServiceClient

func NewServiceClient() ServiceManager

NewServiceClient return an instance of ServiceClient which implements ServiceManager

type ServiceMetaData

type ServiceMetaData struct {
	Name        string `json:"name"`
	Id          string `json:"id"`
	Project     string `json:"project"`
	Description string `json:"description"`
}

ServiceMetaData metadata of the Service

type ServiceRequest

type ServiceRequest struct {
	MetaData ServiceRequestMetaData `json:"metadata"`
	Spec     ServiceSpec            `json:"spec"`
}

ServiceRequest Rest request struct

func (*ServiceRequest) ToService

func (r *ServiceRequest) ToService() *Service

type ServiceRequestMetaData

type ServiceRequestMetaData struct {
	Name        string `json:"name"`
	Description string `json:"description"`
}

ServiceRequestMetaData metadata of the request Service

type ServiceSpec

type ServiceSpec struct {
	Digs []string `json:"digs"`
}

ServiceSpec Spec info of the service

type ServiceState

type ServiceState struct {
	ServiceActions     []ServiceAction `json:"serviceActions"`
	ToInstantiatedDIGs map[string]bool `json:"toInstantiatedDIGs"`
}

ServiceState represents the service action records

func (*ServiceState) AddState

func (s *ServiceState) AddState(action serviceActionValue)

func (*ServiceState) AddToInstantiateDIGs

func (s *ServiceState) AddToInstantiateDIGs(digIds []string)

func (*ServiceState) ClearToInstantiateDIG

func (s *ServiceState) ClearToInstantiateDIG()

func (*ServiceState) IsToInstantiateDIG

func (s *ServiceState) IsToInstantiateDIG(digId string) bool

func (*ServiceState) LastState

func (s *ServiceState) LastState() *ServiceAction

func (*ServiceState) RemoveToInstantiateDIGs

func (s *ServiceState) RemoveToInstantiateDIGs(digIds []string)

type ServiceStatusInfo

type ServiceStatusInfo struct {
	DeployedStatus string                      `json:"deployedStatus"`
	ReadyStatus    string                      `json:"readyStatus"`
	DigsStatus     map[string]DeploymentStatus `json:"digsStatus"`
}

ServiceStatusInfo status of the service and DIGs

type SpecData

type SpecData struct {
	AppName string           `json:"app,omitempty"`
	Intent  gpic.IntentStruc `json:"intent,omitempty"`
}

SpecData consists of appName and intent

type UpdateMetadata

type UpdateMetadata struct {
	Description string `json:"description"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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