marketplaces

package
v0.0.0-...-b52e348 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2017 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

** Copyright [2013-2017] [Megam Systems] ** ** Licensed under the Apache License, Version 2.0 (the "License"); ** you may not use this file except in compliance with the License. ** You may obtain a copy of the License at ** ** http://www.apache.org/licenses/LICENSE-2.0 ** ** Unless required by applicable law or agreed to in writing, software ** distributed under the License is distributed on an "AS IS" BASIS, ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ** See the License for the specific language governing permissions and ** limitations under the License.

Index

Constants

View Source
const (
	APIMARKETPLACES = "/marketplaces"
	UPDATE          = "/update"
)
View Source
const (
	//actions available for rawimage.
	RAW_ISO_CREATE = "rawimage.iso.create"

	// actions available for marketplaces
	MARKETPLACE_INITIALIZE   = "marketplaces.initialize"
	MARKETPLACE_ISO_FINISHED = "marketplaces.iso.finished" // made backup of vm (save changes to Datablock)
	MARKETPLACE_IMAGE_ADD    = "marketplaces.image.add"
)
View Source
const (
	APIRAWIMAGES        = "/rawimages"
	APIRAWIMAGES_UPDATE = "/rawimages/update"
)

Variables

View Source
var (
	// categories of marketplaces queue process
	RAWIMAGE     = "marketplaces.rawimages"
	MARKETPLACES = "localsite.marketplaces"
)

Global provisioners set by the subd daemons.

Functions

func NewArgs

func NewArgs(email, org string) api.ApiArgs

Types

type MarketplaceInterface

type MarketplaceInterface interface {
	Process(action string) error
	String() string
}

type Marketplaces

type Marketplaces struct {
	Id          string          `json:"id"`
	AccountId   string          `json:"account_id"`
	ProvidedBy  string          `json:"provided_by"`
	Inputs      pairs.JsonPairs `json:"inputs"`
	Outputs     pairs.JsonPairs `json:"outputs"`
	Envs        pairs.JsonPairs `json:"envs"`
	Options     pairs.JsonPairs `json:"options"`
	AclPolicies pairs.JsonPairs `json:"acl_policies"`
	CatType     string          `json:"cattype"`
	Flavor      string          `json:"flavor"`
	Image       string          `json:"image"`
	CatOrder    string          `json:"catorder"`
	Plans       pairs.JsonPairs `json:"plans"`
	Status      string          `json:"status"`
	Url         string          `json:"url"`
	JsonClaz    string          `json:"json_claz"`
	CreatedAt   string          `json:"created_at"`
	UpdatedAt   string          `json:"updated_at"`
}

struct for marketplaces and rawimages

func GetMarketplace

func GetMarketplace(email, id string) (*Marketplaces, error)

func (*Marketplaces) Get

func (m *Marketplaces) Get() (*Marketplaces, error)

func (*Marketplaces) GetVMCpuCost

func (m *Marketplaces) GetVMCpuCost() string

func (*Marketplaces) GetVMHDDCost

func (m *Marketplaces) GetVMHDDCost() string

func (*Marketplaces) GetVMMemoryCost

func (m *Marketplaces) GetVMMemoryCost() string

func (*Marketplaces) ImageId

func (s *Marketplaces) ImageId() string

func (*Marketplaces) ImageName

func (s *Marketplaces) ImageName() string

func (*Marketplaces) NukeAndSetOutputs

func (m *Marketplaces) NukeAndSetOutputs(out map[string][]string) error

func (*Marketplaces) NukeKeysOutputs

func (m *Marketplaces) NukeKeysOutputs(k string) error

func (*Marketplaces) Process

func (m *Marketplaces) Process(action string) error

process trigger based on acction

func (*Marketplaces) RawImageId

func (s *Marketplaces) RawImageId() string

func (*Marketplaces) Region

func (s *Marketplaces) Region() string

func (*Marketplaces) RemoveVM

func (s *Marketplaces) RemoveVM() string

func (*Marketplaces) String

func (s *Marketplaces) String() string

marketplaces json string

func (*Marketplaces) Trigger_event

func (m *Marketplaces) Trigger_event(status utils.Status) error

func (*Marketplaces) Update

func (m *Marketplaces) Update() error

func (*Marketplaces) UpdateError

func (m *Marketplaces) UpdateError(status utils.Status, cause error) error

func (*Marketplaces) UpdateStatus

func (m *Marketplaces) UpdateStatus(status utils.Status) error

type ParseError

type ParseError struct {
	Found    string
	Expected []string
}

ParseError represents an error that occurred during parsing.

func (*ParseError) Error

func (e *ParseError) Error() string

Error returns the string representation of the error.

type RawImages

type RawImages struct {
	Id         string          `json:"id"`
	Name       string          `json:"name"`
	AccountId  string          `json:"account_id"`
	OrgId      string          `json:"org_id"`
	Inputs     pairs.JsonPairs `json:"inputs"`
	Outputs    pairs.JsonPairs `json:"outputs"`
	Repository string          `json:"repos"`
	Repo       *Repo           `json:"-"`
	Status     string          `json:"status"`
	JsonClaz   string          `json:"json_claz"`
	CreatedAt  string          `json:"created_at"`
	UpdatedAt  string          `json:"updated_at"`
}

func (*RawImages) Get

func (r *RawImages) Get() (*RawImages, error)

func (*RawImages) ImageId

func (a *RawImages) ImageId() string

func (*RawImages) Process

func (s *RawImages) Process(action string) error

process trigger based on acction

func (*RawImages) Region

func (s *RawImages) Region() string

func (*RawImages) String

func (s *RawImages) String() string

marketplaces json string

func (*RawImages) Update

func (r *RawImages) Update() error

type Repo

type Repo struct {
	Source    string `json:"source"`
	PublicUrl string `json:"public_url"`
}

type ReqOpts

type ReqOpts struct {
	AccountId string `json:"account_id" cql:"account_id"`
	CatId     string `json:"cat_id" cql:"cat_id"`
	Action    string `json:"action" cql:"action"`
	Category  string `json:"category" cql:"category"`
}

func NewRequestOpt

func NewRequestOpt(acc, cat_id, category, action string) *ReqOpts

func (*ReqOpts) ParseRequest

func (r *ReqOpts) ParseRequest() (MarketplaceInterface, error)

func (*ReqOpts) String

func (r *ReqOpts) String() string

Jump to

Keyboard shortcuts

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