commands

package
v0.0.41 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2016 License: Apache-2.0 Imports: 31 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	OutputWriter io.Writer
	LogWriter    io.Writer

	Filter       Filterer
	ErrorHandler errorhandler.ErrorHandler
	Printer      printer.Printer
	RC           RCHandler
	Auth         Authenticator
)
View Source
var ErrShowHelpMessage = errors.New("help command invoked")
View Source
var Init = func(profileRequired bool) error {
	if OutputWriter == nil {
		OutputWriter = os.Stdout
	}

	if LogWriter == nil {
		switch Pivnet.Format {
		case printer.PrintAsJSON, printer.PrintAsYAML:
			LogWriter = os.Stderr
			break
		default:
			LogWriter = os.Stdout
		}
	}

	if ErrorHandler == nil {
		ErrorHandler = errorhandler.NewErrorHandler(Pivnet.Format, OutputWriter, LogWriter)
	}

	if Auth == nil {
		Auth = auth.NewAuthenticator(ErrorHandler)
	}

	if Printer == nil {
		Printer = printer.NewPrinter(OutputWriter)
	}

	if RC == nil {
		rcFileReadWriter := filesystem.NewPivnetRCReadWriter(Pivnet.ConfigFile)
		RC = rc.NewRCHandler(rcFileReadWriter)
	}

	profile, err := RC.ProfileForName(Pivnet.ProfileName)
	if err != nil {
		return ErrorHandler.HandleError(err)
	}

	if profileRequired {
		if profile == nil {
			err := fmt.Errorf("Please login first")
			return ErrorHandler.HandleError(err)
		} else {
			err := profile.Validate()
			if err != nil {
				e := fmt.Errorf("Saved profile is invalid (%s). Please login again", err.Error())
				return ErrorHandler.HandleError(e)
			}
		}
	}

	if profile != nil {
		Pivnet.profile = profile

		sanitizeWriters(profile.APIToken)
	}

	infoLogger := log.New(LogWriter, "", log.LstdFlags)
	debugLogger := log.New(LogWriter, "", log.LstdFlags)

	Pivnet.userAgent = fmt.Sprintf(
		"go-pivnet/%s",
		version.Version,
	)

	Pivnet.Logger = logshim.NewLogShim(infoLogger, debugLogger, Pivnet.Verbose)

	if Filter == nil {
		Filter = filter.NewFilter(
			Pivnet.Logger,
		)
	}

	return nil
}
View Source
var NewCurlClient = func(client curl.PivnetClient) CurlClient {
	return curl.NewCurlClient(
		client,
		ErrorHandler,
		Pivnet.Format,
		OutputWriter,
		Printer,
	)
}
View Source
var NewEULAClient = func(client eula.PivnetClient) EULAClient {
	return eula.NewEULAClient(
		client,
		ErrorHandler,
		Pivnet.Format,
		OutputWriter,
		Printer,
	)
}
View Source
var NewFileGroupClient = func(client filegroup.PivnetClient) FileGroupClient {
	return filegroup.NewFileGroupClient(
		client,
		ErrorHandler,
		Pivnet.Format,
		OutputWriter,
		Printer,
	)
}
View Source
var NewLoginClient = func(client login.PivnetClient) LoginClient {
	return login.NewLoginClient(
		client,
		RC,
		ErrorHandler,
		Pivnet.Format,
		OutputWriter,
		Printer,
	)
}
View Source
var NewLogoutClient = func() LogoutClient {
	return logout.NewLogoutClient(
		RC,
		ErrorHandler,
		Pivnet.Format,
		OutputWriter,
		Printer,
	)
}
View Source
var NewProductClient = func(client product.PivnetClient) ProductClient {
	return product.NewProductClient(
		client,
		ErrorHandler,
		Pivnet.Format,
		OutputWriter,
		Printer,
	)
}
View Source
var NewProductFileClient = func(client productfile.PivnetClient) ProductFileClient {
	return productfile.NewProductFileClient(
		client,
		ErrorHandler,
		Pivnet.Format,
		OutputWriter,
		LogWriter,
		Printer,
		Pivnet.Logger,
		Filter,
	)
}
View Source
var NewReleaseClient = func(client release.PivnetClient) ReleaseClient {
	return release.NewReleaseClient(
		client,
		ErrorHandler,
		Pivnet.Format,
		OutputWriter,
		Printer,
	)
}
View Source
var NewReleaseTypeClient = func(client releasetype.PivnetClient) ReleaseTypeClient {
	return releasetype.NewReleaseTypeClient(
		client,
		ErrorHandler,
		Pivnet.Format,
		OutputWriter,
		Printer,
	)
}
View Source
var NewUserGroupClient = func(client usergroup.PivnetClient) UserGroupClient {
	return usergroup.NewUserGroupClient(
		client,
		ErrorHandler,
		Pivnet.Format,
		OutputWriter,
		Printer,
	)
}

Functions

func NewPivnetClient

func NewPivnetClient() *gp.Client

func NewPivnetClientWithToken added in v0.0.38

func NewPivnetClientWithToken(apiToken string, host string) *gp.Client

Types

type AcceptEULACommand

type AcceptEULACommand struct {
	ProductSlug    string `long:"product-slug" short:"p" description:"Product slug e.g. p-mysql" required:"true"`
	ReleaseVersion string `long:"release-version" short:"r" description:"Release version e.g. 0.1.2-rc1" required:"true"`
}

func (*AcceptEULACommand) Execute

func (command *AcceptEULACommand) Execute(args []string) error

type AddFileGroupToReleaseCommand

type AddFileGroupToReleaseCommand struct {
	ProductSlug    string `long:"product-slug" short:"p" description:"Product slug e.g. p-mysql" required:"true"`
	FileGroupID    int    `long:"file-group-id" short:"i" description:"Filegroup ID e.g. 1234" required:"true"`
	ReleaseVersion string `long:"release-version" short:"r" description:"Release version e.g. 0.1.2-rc1" required:"true"`
}

func (*AddFileGroupToReleaseCommand) Execute

func (command *AddFileGroupToReleaseCommand) Execute([]string) error

type AddProductFileCommand

type AddProductFileCommand struct {
	ProductSlug    string  `long:"product-slug" short:"p" description:"Product slug e.g. p-mysql" required:"true"`
	ReleaseVersion *string `long:"release-version" short:"r" description:"Release version e.g. 0.1.2-rc1"`
	ProductFileID  int     `long:"product-file-id" short:"i" description:"Product file ID e.g. 1234" required:"true"`
	FileGroupID    *int    `long:"file-group-id" short:"f" description:"File group ID e.g. 1234"`
}

func (*AddProductFileCommand) Execute

func (command *AddProductFileCommand) Execute([]string) error

type AddReleaseDependencyCommand

type AddReleaseDependencyCommand struct {
	ProductSlug             string `long:"product-slug" short:"p" description:"Product slug e.g. p-mysql" required:"true"`
	ReleaseVersion          string `long:"release-version" short:"r" description:"Release version e.g. 0.1.2-rc1" required:"true"`
	DependentProductSlug    string `long:"dependent-product-slug" short:"s" description:"Dependent product slug e.g. p-mysql" required:"true"`
	DependentReleaseVersion string `long:"dependent-release-version" short:"u" description:"Dependent release version e.g. 0.1.2-rc1" required:"true"`
}

func (*AddReleaseDependencyCommand) Execute

func (command *AddReleaseDependencyCommand) Execute([]string) error

type AddReleaseUpgradePathCommand

type AddReleaseUpgradePathCommand struct {
	ProductSlug            string `long:"product-slug" short:"p" description:"Product slug e.g. p-mysql" required:"true"`
	ReleaseVersion         string `long:"release-version" short:"r" description:"Release version e.g. 0.1.2-rc1" required:"true"`
	PreviousReleaseVersion string `long:"previous-release-version" short:"u" description:"Regex for previous release version e.g. 0.1.*" required:"true"`
}

func (*AddReleaseUpgradePathCommand) Execute

func (command *AddReleaseUpgradePathCommand) Execute([]string) error

type AddUserGroupCommand

type AddUserGroupCommand struct {
	ProductSlug    string `long:"product-slug" short:"p" description:"Product slug e.g. p-mysql" required:"true"`
	ReleaseVersion string `long:"release-version" short:"r" description:"Release version e.g. 0.1.2-rc1" required:"true"`
	UserGroupID    int    `long:"user-group-id" short:"i" description:"User Group ID e.g. 1234" required:"true"`
}

func (*AddUserGroupCommand) Execute

func (command *AddUserGroupCommand) Execute([]string) error

type AddUserGroupMemberCommand

type AddUserGroupMemberCommand struct {
	UserGroupID        int    `long:"user-group-id" short:"i" description:"User group ID e.g. 1234" required:"true"`
	MemberEmailAddress string `long:"member-email" description:"Member email address e.g. 1234" required:"true"`
	Admin              bool   `long:"admin" description:"Whether the user should be an admin"`
}

func (*AddUserGroupMemberCommand) Execute

func (command *AddUserGroupMemberCommand) Execute([]string) error

type Authenticator added in v0.0.38

type Authenticator interface {
	AuthenticateClient(client auth.AuthClient) error
}

type CreateFileGroupCommand

type CreateFileGroupCommand struct {
	ProductSlug string `long:"product-slug" short:"p" description:"Product slug e.g. p-mysql" required:"true"`
	Name        string `long:"name" description:"Name e.g. my_file_group" required:"true"`
}

func (*CreateFileGroupCommand) Execute

func (command *CreateFileGroupCommand) Execute([]string) error

type CreateProductFileCommand

type CreateProductFileCommand struct {
	ProductSlug        string   `long:"product-slug" short:"p" description:"Product slug e.g. 'p-mysql'" required:"true"`
	Name               string   `long:"name" description:"Name e.g. 'p-mysql 1.7.13'" required:"true"`
	AWSObjectKey       string   `long:"aws-object-key" description:"AWS Object Key e.g. 'product_files/P-MySQL/p-mysql-1.7.13.pivotal'" required:"true"`
	FileType           string   `long:"file-type" description:"File Type e.g. 'Software'" required:"true"`
	FileVersion        string   `long:"file-version" description:"File Version e.g. '1.7.13'" required:"true"`
	MD5                string   `long:"md5" description:"MD5 of file" required:"true"`
	Description        string   `long:"description" description:"Description of file"`
	DocsURL            string   `long:"docs-url" description:"URL of docs for file"`
	IncludedFiles      []string `long:"included-file" description:"Name of included file"`
	Platforms          []string `long:"platform" description:"Platform of file"`
	ReleasedAt         string   `long:"released-at" description:"When file is marked for release e.g. '2016/01/16'"`
	SystemRequirements []string `long:"system-requirement" description:"System-requirement of file"`
}

func (*CreateProductFileCommand) Execute

func (command *CreateProductFileCommand) Execute([]string) error

type CreateReleaseCommand

type CreateReleaseCommand struct {
	ProductSlug    string `long:"product-slug" short:"p" description:"Product slug e.g. p-mysql" required:"true"`
	ReleaseVersion string `long:"release-version" short:"r" description:"Release version e.g. 0.1.2-rc1" required:"true"`
	ReleaseType    string `long:"release-type" short:"t" description:"Release type e.g. 'Minor Release'" required:"true"`
	EULASlug       string `long:"eula-slug" short:"e" description:"EULA slug e.g. pivotal_software_eula" required:"true"`
}

func (*CreateReleaseCommand) Execute

func (command *CreateReleaseCommand) Execute([]string) error

type CreateUserGroupCommand

type CreateUserGroupCommand struct {
	Name        string   `long:"name" description:"Name e.g. all_users" required:"true"`
	Description string   `long:"description" description:"Description e.g. 'All users in the world'" required:"true"`
	Members     []string `long:"member" description:"Email addresses of members to be added"`
}

func (*CreateUserGroupCommand) Execute

func (command *CreateUserGroupCommand) Execute([]string) error

type CurlClient

type CurlClient interface {
	MakeRequest(method string, body string, args []string) error
}

type CurlCommand

type CurlCommand struct {
	Method string `long:"request" short:"X" description:"Custom method e.g. PATCH"`
	Data   string `long:"data" short:"d" description:"Request data e.g. '{\"foo\":\"bar\"}'"`
}

func (*CurlCommand) Execute

func (command *CurlCommand) Execute(args []string) error

type DeleteFileGroupCommand

type DeleteFileGroupCommand struct {
	ProductSlug string `long:"product-slug" short:"p" description:"Product slug e.g. p-mysql" required:"true"`
	FileGroupID int    `long:"file-group-id" short:"i" description:"File group ID e.g. 1234" required:"true"`
}

func (*DeleteFileGroupCommand) Execute

func (command *DeleteFileGroupCommand) Execute([]string) error

type DeleteProductFileCommand

type DeleteProductFileCommand struct {
	ProductSlug   string `long:"product-slug" short:"p" description:"Product slug e.g. p-mysql" required:"true"`
	ProductFileID int    `long:"product-file-id" short:"i" description:"Product file ID e.g. 1234" required:"true"`
}

func (*DeleteProductFileCommand) Execute

func (command *DeleteProductFileCommand) Execute([]string) error

type DeleteReleaseCommand

type DeleteReleaseCommand struct {
	ProductSlug    string `long:"product-slug" short:"p" description:"Product slug e.g. p-mysql" required:"true"`
	ReleaseVersion string `long:"release-version" short:"r" description:"Release version e.g. 0.1.2-rc1" required:"true"`
}

func (*DeleteReleaseCommand) Execute

func (command *DeleteReleaseCommand) Execute([]string) error

type DeleteUserGroupCommand

type DeleteUserGroupCommand struct {
	UserGroupID int `long:"user-group-id" short:"i" description:"User group ID e.g. 1234" required:"true"`
}

func (*DeleteUserGroupCommand) Execute

func (command *DeleteUserGroupCommand) Execute([]string) error

type DownloadProductFilesCommand added in v0.0.35

type DownloadProductFilesCommand struct {
	ProductSlug    string   `long:"product-slug" short:"p" description:"Product slug e.g. p-mysql" required:"true"`
	ReleaseVersion string   `long:"release-version" short:"r" description:"Release version e.g. 0.1.2-rc1" required:"true"`
	ProductFileIDs []int    `long:"product-file-id" short:"i" description:"Product file ID e.g. 1234"`
	Globs          []string `long:"glob" short:"g" description:"Glob to match product name e.g. *aws*"`
	DownloadDir    string   `long:"download-dir" short:"d" default:"." description:"Local directory to download files to e.g. /tmp/my-file/"`
	AcceptEULA     bool     `long:"accept-eula" description:"Automatically accept EULA if necessary"`
}

func (*DownloadProductFilesCommand) Execute added in v0.0.35

func (command *DownloadProductFilesCommand) Execute([]string) error

type EULAClient

type EULAClient interface {
	List() error
	Get(eulaSlug string) error
	AcceptEULA(productSlug string, releaseVersion string) error
}

type EULACommand

type EULACommand struct {
	EULASlug string `long:"eula-slug" description:"EULA slug e.g. pivotal_software_eula" required:"true"`
}

func (*EULACommand) Execute

func (command *EULACommand) Execute(args []string) error

type EULAsCommand

type EULAsCommand struct {
}

func (*EULAsCommand) Execute

func (command *EULAsCommand) Execute(args []string) error

type FileGroupClient

type FileGroupClient interface {
	List(productSlug string, releaseVersion string) error
	Get(productSlug string, productFileID int) error
	Create(productSlug string, name string) error
	Update(productSlug string, productFileID int, name *string) error
	Delete(productSlug string, productFileID int) error
	AddToRelease(productSlug string, productFileID int, releaseVersion string) error
	RemoveFromRelease(productSlug string, productFileID int, releaseVersion string) error
}

type FileGroupCommand

type FileGroupCommand struct {
	ProductSlug string `long:"product-slug" short:"p" description:"Product slug e.g. p-mysql" required:"true"`
	FileGroupID int    `long:"file-group-id" short:"i" description:"Filegroup ID e.g. 1234" required:"true"`
}

func (*FileGroupCommand) Execute

func (command *FileGroupCommand) Execute([]string) error

type FileGroupsCommand

type FileGroupsCommand struct {
	ProductSlug    string `long:"product-slug" short:"p" description:"Product slug e.g. p-mysql" required:"true"`
	ReleaseVersion string `long:"release-version" short:"r" description:"Release version e.g. 0.1.2-rc1"`
}

func (*FileGroupsCommand) Execute

func (command *FileGroupsCommand) Execute([]string) error

type Filterer added in v0.0.33

type Filterer interface {
	ReleasesByVersion(releases []pivnet.Release, version string) ([]pivnet.Release, error)
	ProductFileKeysByGlobs(productFiles []pivnet.ProductFile, globs []string) ([]pivnet.ProductFile, error)
}

type HelpCommand

type HelpCommand struct{}

func (*HelpCommand) Execute

func (command *HelpCommand) Execute(args []string) error

type LoginClient added in v0.0.38

type LoginClient interface {
	Login(name string, apiToken string, host string) error
}

type LoginCommand added in v0.0.38

type LoginCommand struct {
	APIToken string `long:"api-token" description:"Pivnet API Token" required:"true"`
	Host     string `long:"host" description:"Pivnet API Host" default:"https://network.pivotal.io"`
}

func (*LoginCommand) Execute added in v0.0.38

func (command *LoginCommand) Execute([]string) error

type LogoutClient added in v0.0.38

type LogoutClient interface {
	Logout(profileName string) error
}

type LogoutCommand added in v0.0.38

type LogoutCommand struct {
}

func (*LogoutCommand) Execute added in v0.0.38

func (command *LogoutCommand) Execute([]string) error

type PivnetCommand

type PivnetCommand struct {
	VersionFunc func() `short:"v" long:"version" description:"Print the version of this CLI and exit"`

	Format  string `long:"format" description:"Format to print as" default:"table" choice:"table" choice:"json" choice:"yaml"`
	Verbose bool   `long:"verbose" description:"Display verbose output"`

	ProfileName string `long:"profile" description:"Name of profile" default:"default"`
	ConfigFile  string `long:"config" description:"Path to config file"`

	Login  LoginCommand  `command:"login" alias:"l" description:"Log in to Pivotal Network."`
	Logout LogoutCommand `command:"logout" description:"Log out from Pivotal Network."`

	Help    HelpCommand    `command:"help" alias:"h" description:"Print this help message"`
	Version VersionCommand `command:"version" alias:"v" description:"Print the version of this CLI and exit"`

	Curl CurlCommand `command:"curl" alias:"c" description:"Curl an endpoint"`

	ReleaseTypes ReleaseTypesCommand `command:"release-types" alias:"rts" description:"List release types"`

	EULAs      EULAsCommand      `command:"eulas" alias:"es" description:"List EULAs"`
	EULA       EULACommand       `command:"eula" alias:"e" description:"Show EULA"`
	AcceptEULA AcceptEULACommand `command:"accept-eula" alias:"ae" description:"Accept EULA"`

	Products ProductsCommand `command:"products" alias:"ps" description:"List products"`
	Product  ProductCommand  `command:"product" alias:"p" description:"Show product"`

	ProductFiles      ProductFilesCommand      `command:"product-files" alias:"pfs" description:"List product files"`
	ProductFile       ProductFileCommand       `command:"product-file" alias:"pf" description:"Show product file"`
	CreateProductFile CreateProductFileCommand `command:"create-product-file" alias:"cpf" description:"Create product file"`
	UpdateProductFile UpdateProductFileCommand `command:"update-product-file" alias:"upf" description:"Update product file"`
	AddProductFile    AddProductFileCommand    `command:"add-product-file" alias:"apf" description:"Add product file to release"`
	RemoveProductFile RemoveProductFileCommand `command:"remove-product-file" alias:"rpf" description:"Remove product file from release"`
	DeleteProductFile DeleteProductFileCommand `command:"delete-product-file" alias:"dpf" description:"Delete product file"`

	DownloadProductFiles DownloadProductFilesCommand `command:"download-product-files" alias:"dlpf" description:"Download product files"`

	FileGroups                 FileGroupsCommand                 `command:"file-groups" alias:"fgs" description:"List file groups"`
	FileGroup                  FileGroupCommand                  `command:"file-group" alias:"fg" description:"Show file group"`
	CreateFileGroup            CreateFileGroupCommand            `command:"create-file-group" alias:"cfg" description:"Create file group"`
	UpdateFileGroup            UpdateFileGroupCommand            `command:"update-file-group" alias:"ufg" description:"Update file group"`
	DeleteFileGroup            DeleteFileGroupCommand            `command:"delete-file-group" alias:"dfg" description:"Delete file group"`
	AddFileGroupToRelease      AddFileGroupToReleaseCommand      `command:"add-file-group" alias:"afg" description:"Add file group to release"`
	RemoveFileGroupFromRelease RemoveFileGroupFromReleaseCommand `command:"remove-file-group" alias:"rfg" description:"Remove file group from release"`

	Releases      ReleasesCommand      `command:"releases" alias:"rs" description:"List releases"`
	Release       ReleaseCommand       `command:"release" alias:"r" description:"Show release"`
	CreateRelease CreateReleaseCommand `command:"create-release" alias:"cr" description:"Create release"`
	DeleteRelease DeleteReleaseCommand `command:"delete-release" alias:"dr" description:"Delete release"`

	UserGroups      UserGroupsCommand      `command:"user-groups" alias:"ugs" description:"List user groups"`
	UserGroup       UserGroupCommand       `command:"user-group" alias:"ug" description:"Show user group"`
	AddUserGroup    AddUserGroupCommand    `command:"add-user-group" alias:"aug" description:"Add user group to release"`
	RemoveUserGroup RemoveUserGroupCommand `command:"remove-user-group" alias:"rug" description:"Remove user group from release"`
	CreateUserGroup CreateUserGroupCommand `command:"create-user-group" alias:"cug" description:"Create user group"`
	UpdateUserGroup UpdateUserGroupCommand `command:"update-user-group" alias:"uug" description:"Update user group"`
	DeleteUserGroup DeleteUserGroupCommand `command:"delete-user-group" alias:"dug" description:"Delete user group"`

	AddUserGroupMember    AddUserGroupMemberCommand    `command:"add-user-group-member" alias:"augm" description:"Add user group member to group"`
	RemoveUserGroupMember RemoveUserGroupMemberCommand `command:"remove-user-group-member" alias:"rugm" description:"Remove user group member from group"`

	ReleaseDependencies     ReleaseDependenciesCommand     `command:"release-dependencies" alias:"rds" description:"List release dependencies"`
	AddReleaseDependency    AddReleaseDependencyCommand    `command:"add-release-dependency" alias:"ard" description:"Add release dependency"`
	RemoveReleaseDependency RemoveReleaseDependencyCommand `command:"remove-release-dependency" alias:"rrd" description:"Remove release dependency"`

	ReleaseUpgradePaths      ReleaseUpgradePathsCommand      `command:"release-upgrade-paths" alias:"rups" description:"List release upgrade paths"`
	AddReleaseUpgradePath    AddReleaseUpgradePathCommand    `command:"add-release-upgrade-path" alias:"arup" description:"Add release upgrade path"`
	RemoveReleaseUpgradePath RemoveReleaseUpgradePathCommand `command:"remove-release-upgrade-path" alias:"rrup" description:"Remove release upgrade path"`

	Logger logger.Logger
	// contains filtered or unexported fields
}
var Pivnet PivnetCommand

type ProductClient

type ProductClient interface {
	List() error
	Get(productSlug string) error
}

type ProductCommand

type ProductCommand struct {
	ProductSlug string `long:"product-slug" short:"p" description:"Product slug e.g. p-mysql" required:"true"`
}

func (*ProductCommand) Execute

func (command *ProductCommand) Execute([]string) error

type ProductFileClient

type ProductFileClient interface {
	List(productSlug string, releaseVersion string) error
	Get(productSlug string, releaseVersion string, productFileID int) error
	Create(config pivnet.CreateProductFileConfig) error
	Update(
		productFileID int,
		productSlug string,
		name *string,
		fileType *string,
		fileVersion *string,
		md5 *string,
		description *string,
	) error
	AddToRelease(productSlug string, releaseVersion string, productFileID int) error
	RemoveFromRelease(productSlug string, releaseVersion string, productFileID int) error
	AddToFileGroup(productSlug string, fileGroupID int, productFileID int) error
	RemoveFromFileGroup(productSlug string, fileGroupID int, productFileID int) error
	Delete(productSlug string, productFileID int) error
	Download(productSlug string, releaseVersion string, globs []string, productFileIDs []int, downloadDir string, acceptEULA bool, progressWriter io.Writer) error
}

type ProductFileCommand

type ProductFileCommand struct {
	ProductSlug    string `long:"product-slug" short:"p" description:"Product slug e.g. p-mysql" required:"true"`
	ReleaseVersion string `long:"release-version" short:"r" description:"Release version e.g. 0.1.2-rc1"`
	ProductFileID  int    `long:"product-file-id" short:"i" description:"Product file ID e.g. 1234" required:"true"`
}

func (*ProductFileCommand) Execute

func (command *ProductFileCommand) Execute([]string) error

type ProductFilesCommand

type ProductFilesCommand struct {
	ProductSlug    string `long:"product-slug" short:"p" description:"Product slug e.g. p-mysql" required:"true"`
	ReleaseVersion string `long:"release-version" short:"r" description:"Release version e.g. 0.1.2-rc1"`
}

func (*ProductFilesCommand) Execute

func (command *ProductFilesCommand) Execute([]string) error

type ProductsCommand

type ProductsCommand struct {
}

func (*ProductsCommand) Execute

func (command *ProductsCommand) Execute([]string) error

type RCHandler added in v0.0.38

type RCHandler interface {
	SaveProfile(profileName string, apiToken string, host string) error
	ProfileForName(profileName string) (*rc.PivnetProfile, error)
	RemoveProfileWithName(profileName string) error
}

type ReleaseClient

type ReleaseClient interface {
	List(productSlug string) error
	Get(productSlug string, releaseVersion string) error
	Create(productSlug string, releaseVersion string, releaseType string, eulaSlug string) error
	Delete(productSlug string, releaseVersion string) error
}

type ReleaseCommand

type ReleaseCommand struct {
	ProductSlug    string `long:"product-slug" short:"p" description:"Product slug e.g. p-mysql" required:"true"`
	ReleaseVersion string `long:"release-version" short:"r" description:"Release version e.g. 0.1.2-rc1" required:"true"`
}

func (*ReleaseCommand) Execute

func (command *ReleaseCommand) Execute([]string) error

type ReleaseDependenciesCommand

type ReleaseDependenciesCommand struct {
	ProductSlug    string `long:"product-slug" short:"p" description:"Product slug e.g. p-mysql" required:"true"`
	ReleaseVersion string `long:"release-version" short:"r" description:"Release version e.g. 0.1.2-rc1" required:"true"`
}

func (*ReleaseDependenciesCommand) Execute

func (command *ReleaseDependenciesCommand) Execute([]string) error

type ReleaseDependencyClient

type ReleaseDependencyClient interface {
	List(productSlug string, releaseVersion string) error
	Add(productSlug string, releaseVersion string, dependentProductSlug string, dependentReleaseVersion string) error
	Remove(productSlug string, releaseVersion string, dependentProductSlug string, dependentReleaseVersion string) error
}

type ReleaseTypeClient

type ReleaseTypeClient interface {
	List() error
}

type ReleaseTypesCommand

type ReleaseTypesCommand struct {
}

func (*ReleaseTypesCommand) Execute

func (command *ReleaseTypesCommand) Execute(args []string) error

type ReleaseUpgradePathClient

type ReleaseUpgradePathClient interface {
	List(productSlug string, releaseVersion string) error
	Add(productSlug string, releaseVersion string, previousReleaseVersion string) error
	Remove(productSlug string, releaseVersion string, previousReleaseVersion string) error
}

type ReleaseUpgradePathsCommand

type ReleaseUpgradePathsCommand struct {
	ProductSlug    string `long:"product-slug" short:"p" description:"Product slug e.g. p-mysql" required:"true"`
	ReleaseVersion string `long:"release-version" short:"r" description:"Release version e.g. 0.1.2-rc1" required:"true"`
}

func (*ReleaseUpgradePathsCommand) Execute

func (command *ReleaseUpgradePathsCommand) Execute([]string) error

type ReleasesCommand

type ReleasesCommand struct {
	ProductSlug string `long:"product-slug" short:"p" description:"Product slug e.g. p-mysql" required:"true"`
}

func (*ReleasesCommand) Execute

func (command *ReleasesCommand) Execute([]string) error

type RemoveFileGroupFromReleaseCommand

type RemoveFileGroupFromReleaseCommand struct {
	ProductSlug    string `long:"product-slug" short:"p" description:"Product slug e.g. p-mysql" required:"true"`
	FileGroupID    int    `long:"file-group-id" short:"i" description:"Filegroup ID e.g. 1234" required:"true"`
	ReleaseVersion string `long:"release-version" short:"r" description:"Release version e.g. 0.1.2-rc1" required:"true"`
}

func (*RemoveFileGroupFromReleaseCommand) Execute

func (command *RemoveFileGroupFromReleaseCommand) Execute([]string) error

type RemoveProductFileCommand

type RemoveProductFileCommand struct {
	ProductSlug    string  `long:"product-slug" short:"p" description:"Product slug e.g. p-mysql" required:"true"`
	ReleaseVersion *string `long:"release-version" short:"r" description:"Release version e.g. 0.1.2-rc1"`
	ProductFileID  int     `long:"product-file-id" short:"i" description:"Product file ID e.g. 1234" required:"true"`
	FileGroupID    *int    `long:"file-group-id" short:"f" description:"File group ID e.g. 1234"`
}

func (*RemoveProductFileCommand) Execute

func (command *RemoveProductFileCommand) Execute([]string) error

type RemoveReleaseDependencyCommand

type RemoveReleaseDependencyCommand struct {
	ProductSlug             string `long:"product-slug" short:"p" description:"Product slug e.g. p-mysql" required:"true"`
	ReleaseVersion          string `long:"release-version" short:"r" description:"Release version e.g. 0.1.2-rc1" required:"true"`
	DependentProductSlug    string `long:"dependent-product-slug" short:"s" description:"Dependent product slug e.g. p-mysql" required:"true"`
	DependentReleaseVersion string `long:"dependent-release-version" short:"u" description:"Dependent release version e.g. 0.1.2-rc1" required:"true"`
}

func (*RemoveReleaseDependencyCommand) Execute

func (command *RemoveReleaseDependencyCommand) Execute([]string) error

type RemoveReleaseUpgradePathCommand

type RemoveReleaseUpgradePathCommand struct {
	ProductSlug            string `long:"product-slug" short:"p" description:"Product slug e.g. p-mysql" required:"true"`
	ReleaseVersion         string `long:"release-version" short:"r" description:"Release version e.g. 0.1.2-rc1" required:"true"`
	PreviousReleaseVersion string `long:"previous-release-version" short:"u" description:"Regex for previous release version e.g. 0.1.*" required:"true"`
}

func (*RemoveReleaseUpgradePathCommand) Execute

func (command *RemoveReleaseUpgradePathCommand) Execute([]string) error

type RemoveUserGroupCommand

type RemoveUserGroupCommand struct {
	ProductSlug    string `long:"product-slug" short:"p" description:"Product slug e.g. p-mysql" required:"true"`
	ReleaseVersion string `long:"release-version" short:"r" description:"Release version e.g. 0.1.2-rc1" required:"true"`
	UserGroupID    int    `long:"user-group-id" short:"i" description:"User Group ID e.g. 1234" required:"true"`
}

func (*RemoveUserGroupCommand) Execute

func (command *RemoveUserGroupCommand) Execute([]string) error

type RemoveUserGroupMemberCommand

type RemoveUserGroupMemberCommand struct {
	UserGroupID        int    `long:"user-group-id" short:"i" description:"User group ID e.g. 1234" required:"true"`
	MemberEmailAddress string `long:"member-email" description:"Member email address e.g. 1234" required:"true"`
}

func (*RemoveUserGroupMemberCommand) Execute

func (command *RemoveUserGroupMemberCommand) Execute([]string) error

type UpdateFileGroupCommand

type UpdateFileGroupCommand struct {
	ProductSlug string  `long:"product-slug" short:"p" description:"Product slug e.g. p-mysql" required:"true"`
	FileGroupID int     `long:"file-group-id" short:"i" description:"Filegroup ID e.g. 1234" required:"true"`
	Name        *string `long:"name" description:"Name e.g. my_file_group"`
}

func (*UpdateFileGroupCommand) Execute

func (command *UpdateFileGroupCommand) Execute([]string) error

type UpdateProductFileCommand

type UpdateProductFileCommand struct {
	ProductSlug   string  `long:"product-slug" short:"p" description:"Product slug e.g. p-mysql" required:"true"`
	ProductFileID int     `long:"product-file-id" short:"i" description:"Product file ID e.g. 1234" required:"true"`
	Name          *string `long:"name" description:"Name e.g. p-mysql 1.7.13"`
	FileType      *string `long:"file-type" description:"File Type e.g. 'Software'"`
	FileVersion   *string `long:"file-version" description:"File Version e.g. '1.7.13'"`
	MD5           *string `long:"md5" description:"MD5 of file"`
	Description   *string `long:"description" description:"File description e.g. 'This is a file description.'"`
}

func (*UpdateProductFileCommand) Execute

func (command *UpdateProductFileCommand) Execute([]string) error

type UpdateUserGroupCommand

type UpdateUserGroupCommand struct {
	UserGroupID int     `long:"user-group-id" short:"i" description:"User group ID e.g. 1234" required:"true"`
	Name        *string `long:"name" description:"Name e.g. all_users"`
	Description *string `long:"description" description:"Description e.g. 'All users in the world'"`
}

func (*UpdateUserGroupCommand) Execute

func (command *UpdateUserGroupCommand) Execute([]string) error

type UserGroupClient

type UserGroupClient interface {
	List(productSlug string, releaseVersion string) error
	Get(userGroupID int) error
	Create(name string, description string, members []string) error
	Update(userGroupID int, name *string, description *string) error
	AddToRelease(productSlug string, releaseVersion string, userGroupID int) error
	Delete(userGroupID int) error
	RemoveFromRelease(productSlug string, releaseVersion string, userGroupID int) error
	AddUserGroupMember(userGroupID int, memberEmailAddress string, admin bool) error
	RemoveUserGroupMember(userGroupID int, memberEmailAddress string) error
}

type UserGroupCommand

type UserGroupCommand struct {
	UserGroupID int `long:"user-group-id" short:"i" description:"User group ID e.g. 1234" required:"true"`
}

func (*UserGroupCommand) Execute

func (command *UserGroupCommand) Execute([]string) error

type UserGroupsCommand

type UserGroupsCommand struct {
	ProductSlug    string `long:"product-slug" short:"p" description:"Product slug e.g. p-mysql"`
	ReleaseVersion string `long:"release-version" short:"r" description:"Release version e.g. 0.1.2-rc1"`
}

func (*UserGroupsCommand) Execute

func (command *UserGroupsCommand) Execute([]string) error

type VersionCommand

type VersionCommand struct{}

func (*VersionCommand) Execute

func (command *VersionCommand) Execute(args []string) error

Directories

Path Synopsis
This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter
This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter
curlfakes
This file was generated by counterfeiter
This file was generated by counterfeiter
eulafakes
This file was generated by counterfeiter
This file was generated by counterfeiter
filegroupfakes
This file was generated by counterfeiter
This file was generated by counterfeiter
loginfakes
This file was generated by counterfeiter This file was generated by counterfeiter
This file was generated by counterfeiter This file was generated by counterfeiter
logoutfakes
This file was generated by counterfeiter
This file was generated by counterfeiter
productfakes
This file was generated by counterfeiter
This file was generated by counterfeiter
productfilefakes
This file was generated by counterfeiter This file was generated by counterfeiter
This file was generated by counterfeiter This file was generated by counterfeiter
releasefakes
This file was generated by counterfeiter
This file was generated by counterfeiter
releasedependencyfakes
This file was generated by counterfeiter
This file was generated by counterfeiter
releasetypefakes
This file was generated by counterfeiter
This file was generated by counterfeiter
releaseupgradepathfakes
This file was generated by counterfeiter This file was generated by counterfeiter
This file was generated by counterfeiter This file was generated by counterfeiter
usergroupfakes
This file was generated by counterfeiter
This file was generated by counterfeiter

Jump to

Keyboard shortcuts

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