setversion

package
v0.21.8 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cmd = &cobra.Command{
	Deprecated:   "API models are now created automatically by time range.",
	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 {

		version := args[0]

		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://projectName:spec:specName\"")
		}

		if version_names.IsReservedVersionName(version) {
			return errors.Errorf("'%s' is an Akita-reserved version", version)
		}

		setversionArgs := setversion.Args{
			ClientID:    akiflag.GetClientID(),
			Domain:      akiflag.Domain,
			ModelURI:    modelURI,
			VersionName: version,
		}

		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