apps

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 Cmd = &cobra.Command{
	Use:     "apps",
	Aliases: []string{"applications"},
	Short:   "Manage Apigee Developer Applications",
	Long:    "Manage Apigee Developer Applications",
}

Cmd to manage apps

View Source
var CreateCmd = &cobra.Command{
	Use:   "create",
	Short: "Create a Developer App",
	Long:  "Create a Developer App",
	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 = apps.Create(name, email, expires, callback, apiProducts, scopes, attrs)
		return
	},
}

CreateCmd to create app

View Source
var CreateKeyCmd = &cobra.Command{
	Use:   "create",
	Short: "Create a developer app key",
	Long:  "Create a a developer app key",
	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)
			}
		}
		_, err = apps.CreateKey(developerEmail, name, key, secret, apiProducts, scopes, expires, attrs)
		return
	},
}

CreateKeyCmd to create developer keys

View Source
var DelCmd = &cobra.Command{
	Use:   "delete",
	Short: "Deletes a Developer App from an organization",
	Long:  "Deletes a Developer Appfrom an organization",
	Args: func(cmd *cobra.Command, args []string) (err error) {
		return apiclient.SetApigeeOrg(org)
	},
	RunE: func(cmd *cobra.Command, args []string) (err error) {
		_, err = apps.Delete(name, id)
		return
	},
}

DelCmd to delete app

View Source
var DeleteKeyCmd = &cobra.Command{
	Use:   "delete",
	Short: "Delete a developer app key",
	Long:  "Delete a a developer 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 = apps.DeleteKey(developerEmail, name, key)
		return
	},
}

DeleteKeyCmd to manage tracing of apis

View Source
var ExpCmd = &cobra.Command{
	Use:   "export",
	Short: "Export Developer Apps to a file",
	Long:  "Export Developer Apps 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 = "apps.json"
		payload, err := apps.Export(conn)
		if err != nil {
			return err
		}
		return apiclient.WriteArrayByteArrayToFile(exportFileName, false, payload)
	},
}

ExpCmd to export apps

View Source
var GenKeyCmd = &cobra.Command{
	Use:   "genkey",
	Short: "Generate a new developer KeyPair",
	Long:  "Generate a new developer KeyPair",
	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 = apps.GenerateKey(name, devID, apiProducts, callback, expires, scopes)
		return
	},
}

GenKeyCmd to generate key

View Source
var GetCmd = &cobra.Command{
	Use:   "get",
	Short: "Get App in an Organization by App ID",
	Long:  "Returns the app profile for the specified app ID.",
	Args: func(cmd *cobra.Command, args []string) error {
		if appID == "" && name == "" && productName == "" {
			return fmt.Errorf("pass either name or appId or productName")
		}
		if appID != "" && name != "" {
			return fmt.Errorf("name and appId cannot be used together")
		}
		return apiclient.SetApigeeOrg(org)
	},
	RunE: func(cmd *cobra.Command, args []string) (err error) {
		if appID != "" {
			_, err = apps.Get(appID)
			return err
		}

		if name != "" {
			outBytes, err := apps.SearchApp(name)
			if err != nil {
				return err
			}

			return apiclient.PrettyPrint("json", outBytes)
		}

		_, err = apps.ListApps(productName)
		return err
	},
}

GetCmd to get app

View Source
var GetKeyCmd = &cobra.Command{
	Use:   "get",
	Short: "Get a developer app key",
	Long:  "Get a a developer 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 = apps.GetKey(developerEmail, name, key)
		return
	},
}

GetKeyCmd to manage tracing of apis

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

ImpCmd to import apps

View Source
var KeysCmd = &cobra.Command{
	Use:   "keys",
	Short: "Manage developer app keys",
	Long:  "Manage developer app keys",
}

KeysCmd manages developer app keys

View Source
var ListCmd = &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 = apps.List(includeCred, expand, count, status,
			startKey, ids, keyStatus, apiProduct, pageSize, pageToken, filter)
		return
	},
}

ListCmd to list apps

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

ManageCmd to create developer keys

View Source
var ManageKeyCmd = &cobra.Command{
	Use:   "manage",
	Short: "Approve or revoke a developer app key",
	Long:  "Approve or revoke a developer 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 = apps.ManageKey(developerEmail, name, key, action)
		return
	},
}

ManageKeyCmd to create developer keys

View Source
var UpdateCmd = &cobra.Command{
	Use:   "update",
	Short: "Update a Developer App",
	Long:  "Update a Developer App",
	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 = apps.Update(name, email, expires, callback, apiProducts, scopes, attrs)
		return
	},
}

UpdateCmd to update an app

View Source
var UpdateKeyCmd = &cobra.Command{
	Use:   "update",
	Short: "Update a developer app key",
	Long:  "Update a a developer 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 = apps.UpdateKey(developerEmail, name, key, apiProducts, scopes, attrs)
		return
	},
}

UpdateKeyCmd 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