references

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:     "references",
	Aliases: []string{"refs"},
	Short:   "Manage References within an Apigee environment",
	Long:    "Manage References. References must refer to a keystore that also exists in the env.",
}

Cmd to manage references

View Source
var CreateCmd = &cobra.Command{
	Use:   "create",
	Short: "Create a reference in an environment",
	Long:  "Create a reference in an environment",
	Args: func(cmd *cobra.Command, args []string) (err error) {
		if resourceType != "KeyStore" && resourceType != "TrustStore" {
			return fmt.Errorf("resourceType should be KeyStore or TrustStore")
		}
		apiclient.SetApigeeEnv(env)

		return apiclient.SetApigeeOrg(org)
	},
	RunE: func(cmd *cobra.Command, args []string) (err error) {
		_, err = references.Create(name, description, resourceType, refers)
		return
	},
}

CreateCmd to create references

View Source
var DelCmd = &cobra.Command{
	Use:   "delete",
	Short: "Delete a reference in an environment",
	Long:  "Delete a reference in an environment",
	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 = references.Delete(name)
		return
	},
}

DelCmd to delete reference

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

ExpCmd to export references

View Source
var GetCmd = &cobra.Command{
	Use:   "get",
	Short: "Get a reference in an environment",
	Long:  "Get a reference in an environment",
	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 = references.Get(name)
		return
	},
}

GetCmd to get reference

View Source
var ImpCmd = &cobra.Command{
	Use:   "import",
	Short: "Import Environment References",
	Long:  "Import Environment References",
	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 references.Import(conn, filePath)
	},
}

ImpCmd to import references

View Source
var ListCmd = &cobra.Command{
	Use:   "list",
	Short: "List all references in an environment",
	Long:  "List all references in an environment",
	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 = references.List()
		return
	},
}

ListCmd to get reference

View Source
var UpdateCmd = &cobra.Command{
	Use:   "update",
	Short: "Update a reference in an environment",
	Long:  "Update a reference in an environment",
	Args: func(cmd *cobra.Command, args []string) (err error) {
		if resourceType != "KeyStore" && resourceType != "TrustStore" {
			return fmt.Errorf("resourceType should be KeyStore or TrustStore")
		}
		apiclient.SetApigeeEnv(env)
		return apiclient.SetApigeeOrg(org)
	},
	RunE: func(cmd *cobra.Command, args []string) (err error) {
		_, err = references.Update(name, description, resourceType, refers)
		return
	},
}

UpdateCmd to update references

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