sharedflows

package
v1.112.0-beta Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CleanCmd = &cobra.Command{
	Use:   "clean",
	Short: "Deletes undeployed/unused reivisions of a Sharedflow",
	Long:  "Deletes undeployed/unused reivisions of a Sharedflow",
	Args: func(cmd *cobra.Command, args []string) (err error) {
		return apiclient.SetApigeeOrg(org)
	},
	RunE: func(cmd *cobra.Command, args []string) (err error) {
		return sharedflows.Clean(name, reportOnly)
	},
}

CleanCmd to delete sf

View Source
var Cmd = &cobra.Command{
	Use:   "sharedflows",
	Short: "Manage Apigee shared flows in an org",
	Long:  "Manage Apigee shared flows in an org",
}

Cmd to manage shared flows

View Source
var CreateCmd = &cobra.Command{
	Use:   "create",
	Short: "Creates a sharedflow in an Apigee Org",
	Long:  "Creates a sharedflow in an Apigee Org",
	Args: func(cmd *cobra.Command, args []string) (err error) {
		apiclient.SetApigeeEnv(env)
		return apiclient.SetApigeeOrg(org)
	},
	RunE: func(cmd *cobra.Command, args []string) (err error) {
		_, err = sharedflows.Create(name, proxy)
		return
	},
}

Cmd to create shared flow

View Source
var DelCmd = &cobra.Command{
	Use:   "delete",
	Short: "Deletes a shared flow",
	Long: "Deletes a shared flow and all associated policies, resources, and revisions." +
		"The flow must be undeployed first.",
	Args: func(cmd *cobra.Command, args []string) (err error) {
		apiclient.SetApigeeEnv(env)
		return apiclient.SetApigeeOrg(org)
	},
	RunE: func(cmd *cobra.Command, args []string) (err error) {
		_, err = sharedflows.Delete(name, revision)
		return
	},
}

Cmd to delete shared flow

View Source
var DepCmd = &cobra.Command{
	Use:   "deploy",
	Short: "Deploys a revision of an existing Sharedflow",
	Long:  "Deploys a revision of an existing Sharedflow to an environment in an organization",
	Args: func(cmd *cobra.Command, args []string) (err error) {
		apiclient.SetApigeeEnv(env)
		return apiclient.SetApigeeOrg(org)
	},
	RunE: func(cmd *cobra.Command, args []string) (err error) {
		if revision == -1 {
			if revision, err = sharedflows.GetHighestSfRevision(name); err != nil {
				return
			}
		}
		_, err = sharedflows.Deploy(name, revision, overrides, serviceAccountName)
		return
	},
}

Cmd to deploy shared flow

View Source
var ExpCmd = &cobra.Command{
	Use:   "export",
	Short: "export Sharedflow bundles from an org",
	Long:  "export Sharedflow bundles from an org",
	Args: func(cmd *cobra.Command, args []string) (err error) {
		apiclient.SetApigeeEnv(env)
		return apiclient.SetApigeeOrg(org)
	},
	RunE: func(cmd *cobra.Command, args []string) (err error) {
		if err = apiclient.FolderExists(folder); err != nil {
			return err
		}
		return sharedflows.Export(conn, folder, allRevisions)
	},
}

Cmd to export shared flows

View Source
var FetCmd = &cobra.Command{
	Use:   "fetch",
	Short: "Returns a zip-formatted shared flow bundle ",
	Long:  "Returns a zip-formatted shared flow bundle of code and config files",
	Args: func(cmd *cobra.Command, args []string) (err error) {
		apiclient.SetApigeeEnv(env)
		return apiclient.SetApigeeOrg(org)
	},
	RunE: func(cmd *cobra.Command, args []string) (err error) {
		if revision == -1 {
			if revision, err = sharedflows.GetHighestSfRevision(name); err != nil {
				return
			}
		}
		return sharedflows.Fetch(name, revision)
	},
}

Cmd to download shared flow

View Source
var GetCmd = &cobra.Command{
	Use:   "get",
	Short: "Gets a shared flow by name",
	Long:  "Gets a shared flow by name, including a list of its revisions.",
	Args: func(cmd *cobra.Command, args []string) (err error) {
		apiclient.SetApigeeEnv(env)
		return apiclient.SetApigeeOrg(org)
	},
	RunE: func(cmd *cobra.Command, args []string) (err error) {
		_, err = sharedflows.Get(name, revision)
		return
	},
}

Cmd to get shared flow

View Source
var ImpCmd = &cobra.Command{
	Use:   "import",
	Short: "Import a folder containing sharedflow bundles",
	Long:  "Import a folder containing sharedflow bundles",
	Args: func(cmd *cobra.Command, args []string) (err error) {
		apiclient.SetApigeeEnv(env)
		return apiclient.SetApigeeOrg(org)
	},
	RunE: func(cmd *cobra.Command, args []string) (err error) {
		return sharedflows.Import(conn, folder)
	},
}

Cmd to import shared flow

View Source
var ListCmd = &cobra.Command{
	Use:   "list",
	Short: "Lists all shared flows in the organization.",
	Long:  "Lists all shared flows in the organization.",
	Args: func(cmd *cobra.Command, args []string) (err error) {
		apiclient.SetApigeeEnv(env)
		return apiclient.SetApigeeOrg(org)
	},
	RunE: func(cmd *cobra.Command, args []string) (err error) {
		_, err = sharedflows.List(includeRevisions)
		return
	},
}

Cmd to list shared flow

View Source
var ListDepCmd = &cobra.Command{
	Use:   "listdeploy",
	Short: "Lists all deployments of a Sharedflow",
	Long:  "Lists all deployments of a Sharedflow",
	Args: func(cmd *cobra.Command, args []string) error {

		apiclient.SetApigeeEnv(env)
		if apiclient.GetApigeeEnv() == "" && name == "" {
			return fmt.Errorf("sharedflow name or environment must be supplied")
		}
		if revision != -1 && name == "" {
			return fmt.Errorf("sharedflow name must be supplied with revision")
		}
		if name != "" && revision == -1 && apiclient.GetApigeeEnv() != "" {
			return fmt.Errorf("revision must be supplied with sharedflow name and env")
		}
		return apiclient.SetApigeeOrg(org)
	},
	RunE: func(cmd *cobra.Command, args []string) (err error) {
		if apiclient.GetApigeeEnv() != "" {
			if revision != -1 {
				_, err = sharedflows.ListRevisionDeployments(name, revision)
			} else {
				_, err = sharedflows.ListEnvDeployments()
			}
		} else {
			_, err = sharedflows.ListDeployments(name)
		}
		return
	},
}

ListDepCmd to list deployed api

View Source
var UndepCmd = &cobra.Command{
	Use:   "undeploy",
	Short: "Undeploys a revision of an existing API proxy",
	Long:  "Undeploys a revision of an existing API proxy to an environment in an organization",
	Args: func(cmd *cobra.Command, args []string) (err error) {
		apiclient.SetApigeeEnv(env)
		return apiclient.SetApigeeOrg(org)
	},
	RunE: func(cmd *cobra.Command, args []string) (err error) {
		_, err = sharedflows.Undeploy(name, revision)
		return
	},
}

Cmd to undeploy shared flow

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