resource

package
v0.0.0-...-f7d5a40 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2020 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Query parameters related constants
	ENV            = "env"
	REQUEST_ID_REQ = "requestid"
	REQUEST_ID_RES = "Request-Id"
	UID            = "uid"
	LOCATION       = "loc"
	PLAN_NAME      = "name"

	// environment names
	BX_STAGING  = "bxstaging"    // Bluemix staging: supports STARTER and ENTERPRISE plans
	BX_PROD     = "bxproduction" // Bluemix production: supports STARTER and ENTERPRISE plans
	CM          = "cm"           // cluster manager: supports ENTERPRISE plan only
	DEFAULT_ENV = BX_STAGING

	// Plan names
	STARTER    = "sp" // Starter plan: available in BX_* environments
	ENTERPRISE = "ep" // Enterprise plan: available on BX_* and CM environments

	// Network configurations for cluster manager environment
	// ONLY required for cm environment
	DEFAULT_NUM_OF_ORGS  = 1 // number or organizations per network
	DEFAULT_NUM_OF_PEERS = 2 // number of peers per organization
	NUM_OF_ORGS_KEY      = "numOfOrgs"
	NUM_OF_PEERS_KEY     = "numOfPeers"
	LEDGER_TYPE_KEY      = "ledgerType"
	// See https://github.ibm.com/IBM-Blockchain/manager-v1/blob/49d29b036f9435da489d7b36ad18eeb30dfa8cac/bluemix-fabric-functions.js#L521
	LEVELDB   = "levelDB"
	COUCHDB   = "couch"
	QUEUEID   = "queueid"
	CHARTPATH = "chartpath"

	// certs tar support
	CERT_VERSION_KEY = "certsVersion"
	CERT_V1          = "v1"
	CERT_V2          = "v2"

	CONN_JSON = "connection.json"
	CONN_YAML = "connection.yml"
	IDENTITY  = "identity.json"
	KEYFILES  = "keyfiles"
	SEP       = string(filepath.Separator)
)

Variables

View Source
var (
	// Supported environments and plans
	SUPPORTED_ENV = map[string][]string{
		BX_STAGING: []string{STARTER, ENTERPRISE},
		BX_PROD:    []string{STARTER, ENTERPRISE},
		CM:         []string{ENTERPRISE},
	}
)

Functions

func AddOrgPost

func AddOrgPost(c *gin.Context)

func CertsJobDelete

func CertsJobDelete(c *gin.Context)

func GetAllCertsJob4IBP

func GetAllCertsJob4IBP(c *gin.Context)

func GetAllServices

func GetAllServices(c *gin.Context)

func GetCertsJobByUid

func GetCertsJobByUid(uid string) ([]couch.Job, error)

func GetCertsPendingJobs

func GetCertsPendingJobs(c *gin.Context)

get all pending getting IBP network certs job by user id

func GetJobStatus

func GetJobStatus(c *gin.Context)

func GetList

func GetList(c *gin.Context, suffix string) ([]string, error)

func GetPendingCertsByUid

func GetPendingCertsByUid(uid string) ([]couch.Job, error)

func GetPendingCreate

func GetPendingCreate(c *gin.Context)

get all pending create IBP network job by user id

func GetPendingCreateByUid

func GetPendingCreateByUid(uid string) ([]couch.Job, error)

func IbpCerts

func IbpCerts(c *gin.Context)

func IbpCertsPost

func IbpCertsPost(c *gin.Context)

func IbpUI

func IbpUI(c *gin.Context)

func IcpNetworkDelete

func IcpNetworkDelete(c *gin.Context)

func IcpNetworkGet

func IcpNetworkGet(c *gin.Context)

func IcpNetworkPost

func IcpNetworkPost(c *gin.Context)

func IcpUI

func IcpUI(c *gin.Context)

func MainUI

func MainUI(c *gin.Context)

func ModuleTestDelete

func ModuleTestDelete(c *gin.Context)

func ModuleTestGet

func ModuleTestGet(c *gin.Context)

func ModuleTestPost

func ModuleTestPost(c *gin.Context)

func ModuleTestUI

func ModuleTestUI(c *gin.Context)

func NetworkDelete

func NetworkDelete(c *gin.Context)

func NetworkGet

func NetworkGet(c *gin.Context)

func NetworkPost

func NetworkPost(c *gin.Context)

func NetworkUI

func NetworkUI(c *gin.Context)

func ServiceDeleteByRequestId

func ServiceDeleteByRequestId(c *gin.Context)

func ServiceDeleteByServiceId

func ServiceDeleteByServiceId(c *gin.Context)

func ServiceGetByRequestId

func ServiceGetByRequestId(c *gin.Context)

func ServiceGetByServiceId

func ServiceGetByServiceId(c *gin.Context)

func ServicePost

func ServicePost(c *gin.Context)

func SetJenkins

func SetJenkins(jenkins jenkins.Jenkins)

TODO: This should only be called by testing files...

func SortItems

func SortItems(theList []HFRDItem)

func SortServices

func SortServices(theList []Service)

func TestGet

func TestGet(c *gin.Context)

func TestPost

func TestPost(c *gin.Context)

Types

type HFRDItem

type HFRDItem struct {
	Id        string `json:"id"`
	Name      string `json:"name"`
	Cdate     string `json:"cdate"`
	Queueid   string `json:"queueid"`
	Jobid     string `json:"jobid"`
	Status    string `json:"status"`
	Chartpath string `json:"chartpath,omitempty"`
}

type HFRDItemList

type HFRDItemList struct {
	Items       []HFRDItem `json:"items"`
	Uid         string     `json:"uid"`
	ConsoleBase string     `json:"consolebase"`
	ApacheBase  string     `json:"apachebase"`
}

func GetItems

func GetItems(c *gin.Context, suffix string) (HFRDItemList, error)

type ItemList

type ItemList []HFRDItem

func (ItemList) Len

func (I ItemList) Len() int

func (ItemList) Less

func (I ItemList) Less(i, j int) bool

func (ItemList) Swap

func (I ItemList) Swap(i, j int)

type NetworkConfig

type NetworkConfig struct {
	NumOfOrgs  int    `json:"numOfOrgs"`
	NumOfPeers int    `json: "numOfPeers`
	LedgerType string `json: "ledgerType"`
}

type Plan

type Plan struct {
	Env      string        `json:"env"`    // bxstaging, bxproduction, cm, etc...
	Location string        `json:"loc"`    // Only required for Enterprise Plan
	Name     string        `json:"name"`   // Starter or Enterprise plan, [sp, ep]
	Config   NetworkConfig `json:"config"` // Customized network configuration. Only required for cm environment
}

Plan struct holds metadata of a blockchain network, like environment(bxstaging, bxproduction, cm and more to come) Testers should be able to choose where the blockchain network to be created, like "ZBC01 in POK" for performance testers

type Service

type Service struct {
	NetworkId  string `json:"networkId"`
	ServiceId  string `json:"serviceId"`
	PlanName   string `json:"planName"`
	Env        string `json:"env"`
	CreatedAt  string `json:"createdAt"` // Human readable format
	JobName    string `json:"jobName"`
	JobId      string `json:"jobId"`
	Location   string `json:"location,omitempty"`   // location id of IBP Enterprise Plan
	NumOfOrgs  int    `json:"numOfOrgs,omitempty"`  // number of organizations-- IBP EP
	NumOfPeers int    `json:"numOfPeers,omitempty"` // number of peers per organization-- IBP EP
	LedgerType string `json:"ledgerType,omitempty"` // ledger type: couch/levelDB-- IBP EP
}

a subset of couch.Network

func GetServicesByUid

func GetServicesByUid(uid string) ([]Service, error)

type ServiceList

type ServiceList []Service

func (ServiceList) Len

func (I ServiceList) Len() int

func (ServiceList) Less

func (I ServiceList) Less(i, j int) bool

func (ServiceList) Swap

func (I ServiceList) Swap(i, j int)

type Test

type Test struct {
	Url      string `json:"url"`
	Hash     string `json:"hash"`
	Startcmd string `json:"startcmd"`
	Sslcerts bool   `json:"sslcerts"`
}

Directories

Path Synopsis
jwt

Jump to

Keyboard shortcuts

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