setversion

package
v0.16.2 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cmd = &cobra.Command{
	Use:          "setversion NAME SPEC_AKITA_URI",
	Short:        "Sets the version name for an API model.",
	SilenceUsage: true,
	Args:         cobra.ExactArgs(2),
	RunE: func(cmd *cobra.Command, args []string) error {

		modelURI, err := akiuri.Parse(args[1])
		if err != nil {
			return errors.Wrapf(err, "%q is not a well-formed AkitaURI", args[1])
		}
		if !modelURI.ObjectType.IsSpec() {
			return errors.New("Must specify an API model. For example, \"akita://serviceName:spec:specName\"")
		}

		setversionArgs := setversion.Args{
			ClientID:    akiflag.GetClientID(),
			Domain:      akiflag.Domain,
			ModelURI:    modelURI,
			VersionName: args[0],
		}

		if err := setversion.Run(setversionArgs); err != nil {
			return cmderr.AkitaErr{Err: err}
		}

		return nil
	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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