ops

package
v1.125.2 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cmd = &cobra.Command{
	Use:     "operations",
	Aliases: []string{"ops"},
	Short:   "View Apigee Operations",
	Long:    "View Apigee Operations",
}

Cmd to manage ops

View Source
var GetCmd = &cobra.Command{
	Use:   "get",
	Short: "Get operation of an org",
	Long:  "Get operation of an org",
	Args: func(cmd *cobra.Command, args []string) (err error) {
		return apiclient.SetApigeeOrg(org)
	},
	RunE: func(cmd *cobra.Command, args []string) (err error) {
		_, err = operations.Get(name)
		return
	},
}

GetCmd to get ops details

View Source
var ListCmd = &cobra.Command{
	Use:   "list",
	Short: "List operations in an Apigee Org",
	Long:  "List operations in an Apigee Org",
	Args: func(cmd *cobra.Command, args []string) (err error) {
		if state == "" && completeState != "" {
			return fmt.Errorf("both state and completeState must be passed")
		}
		if completeState != "Success" && completeState != "Failed" && completeState != "Both" && completeState != "" {
			return fmt.Errorf("completeState must be oneOf: Success, Failed, Both or empty")
		}
		if state != "IN_PROGRESS" && state != "FINISHED" && state != "ERROR" {
			return fmt.Errorf("state must be oneOf IN_PROGRESS, FINISHED or ERROR")
		}
		return apiclient.SetApigeeOrg(org)
	},
	RunE: func(cmd *cobra.Command, args []string) (err error) {
		if completeState == "Success" {
			_, err = operations.List(state, operations.Success)
		} else if completeState == "Failed" {
			_, err = operations.List(state, operations.Failed)
		} else {
			_, err = operations.List(state, operations.Both)
		}
		return err
	},
}

ListCmd to list envs

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