appgroups

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: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AppCmd = &cobra.Command{
	Use:   "apps",
	Short: "Manage apps in an Apigee Application Group",
	Long:  "Manage apps in an Apigee Application Group",
}

AppCmd to manage apps

View Source
var Cmd = &cobra.Command{
	Use:   "appgroups",
	Short: "Manage Apigee Application Groups",
	Long:  "Manage Apigee Application Groups",
}

Cmd to manage appgroups

View Source
var CreateAppCmd = &cobra.Command{
	Use:   "create",
	Short: "Create an App",
	Long:  "Create an App in an AppGroup",
	Args: func(cmd *cobra.Command, args []string) (err error) {
		return apiclient.SetApigeeOrg(org)
	},
	RunE: func(cmd *cobra.Command, args []string) (err error) {
		if expires != "" {
			if _, err = strconv.Atoi(expires); err != nil {
				return fmt.Errorf("expires must be an integer: %v", err)
			}
			expires += "000"
		}
		_, err = appgroups.CreateApp(name, appName, expires, callback, apiProducts, scopes, attrs)
		return
	},
}

CreateAppCmd to create app

View Source
var CreateCmd = &cobra.Command{
	Use:   "create",
	Short: "Create an AppGroup",
	Long:  "Create an AppGroup",
	Args: func(cmd *cobra.Command, args []string) (err error) {
		return apiclient.SetApigeeOrg(org)
	},
	RunE: func(cmd *cobra.Command, args []string) (err error) {
		_, err = appgroups.Create(name, channelURI, channelID, displayName, attrs, devs)
		return
	},
}

CreateCmd to create appgroup

View Source
var CreateKeyCmd = &cobra.Command{
	Use:   "create",
	Short: "Create an app key",
	Long:  "Create an app key",
	Args: func(cmd *cobra.Command, args []string) (err error) {
		if (key != "" && secret == "") || (secret != "" && key == "") {
			return fmt.Errorf("key and secret must both be passed or neither must be sent")
		}
		return apiclient.SetApigeeOrg(org)
	},
	RunE: func(cmd *cobra.Command, args []string) (err error) {
		if expires != "" {
			if _, err = strconv.Atoi(expires); err != nil {
				return fmt.Errorf("expires must be an integer: %v", err)
			}
		}
		_, err = appgroups.CreateKey(name, appName, key, secret, expires, apiProducts, scopes, attrs)
		return
	},
}

CreateKeyCmd to create developer keys

View Source
var DelAppCmd = &cobra.Command{
	Use:   "delete",
	Short: "Delete an App in an AppGroup",
	Long:  "Delete an in an AppGroup",
	Args: func(cmd *cobra.Command, args []string) error {
		return apiclient.SetApigeeOrg(org)
	},
	RunE: func(cmd *cobra.Command, args []string) (err error) {
		_, err = appgroups.DeleteApp(name, appName)
		return err
	},
}

DelAppCmd to get app

View Source
var DelCmd = &cobra.Command{
	Use:   "delete",
	Short: "Delete AppGroup in an Organization by AppGroup Name",
	Long:  "Delete AppGroup in an Organization by AppGroup Name",
	Args: func(cmd *cobra.Command, args []string) error {
		return apiclient.SetApigeeOrg(org)
	},
	RunE: func(cmd *cobra.Command, args []string) (err error) {
		_, err = appgroups.Delete(name)
		return err
	},
}

DelCmd to get appgroup

View Source
var DelKeyCmd = &cobra.Command{
	Use:   "delete",
	Short: "Deletes a consumer key for a AppGroup app",
	Long:  "Deletes a consumer key for a AppGroup app",
	Args: func(cmd *cobra.Command, args []string) (err error) {
		return apiclient.SetApigeeOrg(org)
	},
	RunE: func(cmd *cobra.Command, args []string) (err error) {
		_, err = appgroups.DeleteKey(name, appName, key)
		return
	},
}

DelKeyCmd to delete credential

View Source
var DelProdKeyCmd = &cobra.Command{
	Use:   "delete-product",
	Short: "Deletes a product from an App in an AppGroup app",
	Long:  "Deletes a product from an App in an AppGroup app",
	Args: func(cmd *cobra.Command, args []string) (err error) {
		return apiclient.SetApigeeOrg(org)
	},
	RunE: func(cmd *cobra.Command, args []string) (err error) {
		_, err = appgroups.DeleteKeyProduct(name, appName, key, productName)
		return
	},
}

DelProdKeyCmd to delete credential

View Source
var ExpAppCmd = &cobra.Command{
	Use:   "export",
	Short: "Export Apps in an AppGroup to a file",
	Long:  "Export Apps in an AppGroup to a file",
	Args: func(cmd *cobra.Command, args []string) (err error) {
		if name == "" && !all {
			return fmt.Errorf("either all must be set to true or a name must be passed")
		}
		return apiclient.SetApigeeOrg(org)
	},
	RunE: func(cmd *cobra.Command, args []string) (err error) {
		exportFileName := name + "_" + "apps.json"

		apiclient.DisableCmdPrintHttpResponse()

		if name != "" {
			payload, err := appgroups.ExportApps(name)
			if err != nil {
				return err
			}
			prettyPayload, err := apiclient.PrettifyJSON(payload)
			if err != nil {
				return err
			}
			return apiclient.WriteByteArrayToFile(exportFileName, false, prettyPayload)
		}

		appGroupsList, err := appgroups.Export()
		if err != nil {
			return err
		}

		payload, err := appgroups.ExportAllApps(appGroupsList, 4)
		if err != nil {
			return err
		}
		return apiclient.WriteArrayByteArrayToFile(exportFileName, false, payload)
	},
}

ExpAppCmd to export apps

View Source
var ExpCmd = &cobra.Command{
	Use:   "export",
	Short: "Export AppGroups to a file",
	Long:  "Export AppGroups to a file",
	Args: func(cmd *cobra.Command, args []string) (err error) {
		return apiclient.SetApigeeOrg(org)
	},
	RunE: func(cmd *cobra.Command, args []string) (err error) {
		const exportFileName = "appgroups.json"
		payload, err := appgroups.Export()
		if err != nil {
			return err
		}

		prettyPayload, err := apiclient.PrettifyJSON(payload)
		if err != nil {
			return err
		}
		return apiclient.WriteByteArrayToFile(exportFileName, false, prettyPayload)
	},
}

ExpCmd to export apps

View Source
var GetAppCmd = &cobra.Command{
	Use:   "get",
	Short: "Get App in an AppGroup",
	Long:  "Get App in an AppGroup",
	Args: func(cmd *cobra.Command, args []string) error {
		return apiclient.SetApigeeOrg(org)
	},
	RunE: func(cmd *cobra.Command, args []string) (err error) {
		_, err = appgroups.GetApp(name, appName)
		return err
	},
}

GetAppCmd to get app

View Source
var GetCmd = &cobra.Command{
	Use:   "get",
	Short: "Get AppGroup in an Organization by AppGroup Name",
	Long:  "Returns the app group details for the specified app group name",
	Args: func(cmd *cobra.Command, args []string) error {
		return apiclient.SetApigeeOrg(org)
	},
	RunE: func(cmd *cobra.Command, args []string) (err error) {
		_, err = appgroups.Get(name)
		return err
	},
}

GetCmd to get appgroup

View Source
var GetKeyCmd = &cobra.Command{
	Use:   "get",
	Short: "Gets details for a consumer key for a AppGroup app",
	Long:  "Gets details for a consumer key for a AppGroup app",
	Args: func(cmd *cobra.Command, args []string) (err error) {
		return apiclient.SetApigeeOrg(org)
	},
	RunE: func(cmd *cobra.Command, args []string) (err error) {
		_, err = appgroups.GetKey(name, appName, key)
		return
	},
}

GetKeyCmd to get credential

View Source
var ImpAppCmd = &cobra.Command{
	Use:   "import",
	Short: "Import a file containing Apps to an AppGroup",
	Long:  "Import a file containing Apps to an AppGroup",
	Args: func(cmd *cobra.Command, args []string) (err error) {
		if name == "" && !all {
			return fmt.Errorf("either all must be set to true or a name must be passed")
		}
		return apiclient.SetApigeeOrg(org)
	},
	RunE: func(cmd *cobra.Command, args []string) error {
		apiclient.DisableCmdPrintHttpResponse()
		if name != "" {
			return appgroups.ImportApps(conn, filePath, name)
		}
		return appgroups.ImportAllApps(conn, filePath)
	},
}

ImpAppCmd to import apps

View Source
var ImpCmd = &cobra.Command{
	Use:   "import",
	Short: "Import a file containing AppGroups",
	Long:  "Import a file containing AppGroups",
	Args: func(cmd *cobra.Command, args []string) (err error) {
		return apiclient.SetApigeeOrg(org)
	},
	RunE: func(cmd *cobra.Command, args []string) error {
		return appgroups.Import(conn, filePath)
	},
}

ImpCmd to import apps

View Source
var KeyCmd = &cobra.Command{
	Use:   "keys",
	Short: "Manage keys in an App within an AppGroup",
	Long:  "Manage keys in an App within an AppGroup",
}

KeyCmd to manage keys in an app

View Source
var ListAppCmd = &cobra.Command{
	Use:   "list",
	Short: "Returns a list of Developer Applications",
	Long:  "Returns a list of app IDs within an organization based on app status",
	Args: func(cmd *cobra.Command, args []string) (err error) {
		return apiclient.SetApigeeOrg(org)
	},
	RunE: func(cmd *cobra.Command, args []string) (err error) {
		_, err = appgroups.ListApps(name, pageSize, pageToken)
		return
	},
}

ListAppCmd to list apps

View Source
var ListCmd = &cobra.Command{
	Use:   "list",
	Short: "Returns a list of AppGroups",
	Long:  "Returns a list of AppGroups",
	Args: func(cmd *cobra.Command, args []string) (err error) {
		return apiclient.SetApigeeOrg(org)
	},
	RunE: func(cmd *cobra.Command, args []string) (err error) {
		_, err = appgroups.List(pageSize, pageToken, filter)
		return
	},
}

ListCmd to list apps

View Source
var ManageAppCmd = &cobra.Command{
	Use:   "manage",
	Short: "Approve or revoke an app",
	Long:  "Approve or revoke an app",
	Args: func(cmd *cobra.Command, args []string) (err error) {
		return apiclient.SetApigeeOrg(org)
	},
	RunE: func(cmd *cobra.Command, args []string) (err error) {
		_, err = appgroups.ManageApp(name, appName, action)
		return
	},
}

ManageAppCmd to create developer keys

View Source
var ManageCmd = &cobra.Command{
	Use:   "manage",
	Short: "Approve or revoke an AppGroup",
	Long:  "Approve or revoke an AppGroup",
	Args: func(cmd *cobra.Command, args []string) (err error) {
		return apiclient.SetApigeeOrg(org)
	},
	RunE: func(cmd *cobra.Command, args []string) (err error) {
		_, err = appgroups.Manage(name, action)
		return
	},
}

ManageCmd to appgroups

View Source
var ManageKeyCmd = &cobra.Command{
	Use:   "manage",
	Short: "Approve or revoke an app key",
	Long:  "Approve or revoke an app key",
	Args: func(cmd *cobra.Command, args []string) (err error) {
		return apiclient.SetApigeeOrg(org)
	},
	RunE: func(cmd *cobra.Command, args []string) (err error) {
		_, err = appgroups.ManageKey(name, appName, key, action)
		return
	},
}

ManageKeyCmd to create developer keys

View Source
var UpdateAppCmd = &cobra.Command{
	Use:   "update",
	Short: "Update an App in an AppGroup",
	Long:  "Update an App in an AppGroup",
	Args: func(cmd *cobra.Command, args []string) (err error) {
		return apiclient.SetApigeeOrg(org)
	},
	RunE: func(cmd *cobra.Command, args []string) (err error) {
		if expires != "" {
			if _, err = strconv.Atoi(expires); err != nil {
				return fmt.Errorf("expires must be an integer: %v", err)
			}
			expires += "000"
		}
		_, err = appgroups.UpdateApp(name, appName, expires, callback, apiProducts, scopes, attrs)
		return
	},
}

UpdateAppCmd to create app

View Source
var UpdateCmd = &cobra.Command{
	Use:   "update",
	Short: "Update an AppGroup",
	Long:  "Update an AppGroup",
	Args: func(cmd *cobra.Command, args []string) (err error) {
		return apiclient.SetApigeeOrg(org)
	},
	RunE: func(cmd *cobra.Command, args []string) (err error) {
		_, err = appgroups.Update(name, channelURI, channelID, displayName, attrs, devs)
		return
	},
}

UpdateCmd to create appgroup

View Source
var UpdateKeyProdCmd = &cobra.Command{
	Use:   "update-prod",
	Short: "Update products in an app key contained in an AppGroup",
	Long:  "Update products in an app key contained in an AppGroup",
	Args: func(cmd *cobra.Command, args []string) (err error) {
		return apiclient.SetApigeeOrg(org)
	},
	RunE: func(cmd *cobra.Command, args []string) (err error) {
		_, err = appgroups.UpdateKeyProducts(name, appName, key, apiProducts)
		return
	},
}

UpdateKeyProdCmd to create developer keys

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