instances

package
v1.113.6-beta Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ActivateNatCmd = &cobra.Command{
	Use:   "activate",
	Short: "Activate NAT IP for an Apigee instance",
	Long:  "Activate NAT IP for an Apigee instance",
	Args: func(cmd *cobra.Command, args []string) (err error) {
		apiclient.SetApigeeEnv(environment)
		return apiclient.SetApigeeOrg(org)
	},
	RunE: func(cmd *cobra.Command, args []string) (err error) {
		_, err = instances.ActivateNatIP(name, natid)
		return
	},
}

ActivateNatCmd activates NAT for an Apigee instance

View Source
var AttachCmd = &cobra.Command{
	Use:   "attachments",
	Short: "Manage environments to instances",
	Long:  "Manage environments to instances",
}

AttachCmd to manage instances

View Source
var Cmd = &cobra.Command{
	Use:   "instances",
	Short: "Manage Apigee runtime instances",
	Long:  "Manage Apigee runtime instances",
}

Cmd to manage instances

View Source
var CreateAttachCmd = &cobra.Command{
	Use:   "attach",
	Short: "Attach an environment to an instance",
	Long:  "Attach an environment to an instance",
	Args: func(cmd *cobra.Command, args []string) (err error) {
		apiclient.SetApigeeEnv(environment)
		return apiclient.SetApigeeOrg(org)
	},
	RunE: func(cmd *cobra.Command, args []string) (err error) {
		_, err = instances.Attach(name, environment)
		return
	},
}

Cmd to create a new instance

View Source
var CreateCmd = &cobra.Command{
	Use:   "create",
	Short: "Create an Instance",
	Long:  "Create an Instance",
	Args: func(cmd *cobra.Command, args []string) (err error) {
		return apiclient.SetApigeeOrg(org)
	},
	RunE: func(cmd *cobra.Command, args []string) (err error) {

		if billingType, err = orgs.GetOrgField("billingType"); err != nil {
			return err
		}

		if billingType != "EVALUATION" {
			re := regexp.MustCompile(`projects\/([a-zA-Z0-9_-]+)\/locations\/([a-zA-Z0-9_-]+)\/keyRings\/([a-zA-Z0-9_-]+)\/cryptoKeys\/([a-zA-Z0-9_-]+)`)
			ok := re.Match([]byte(diskEncryptionKeyName))
			if !ok {
				return fmt.Errorf("disk encryption key must be of the format projects/{project-id}/locations/{location}/keyRings/{test}/cryptoKeys/{cryptoKey}")
			}
		}

		if ipRange != "" {
			re := regexp.MustCompile(`^([0-9]{1,3}\.){3}[0-9]{1,3}($|\/(22))$`)
			ok := re.Match([]byte(ipRange))
			if !ok {
				return fmt.Errorf("ipRange must be a valid CIDR of range /22")
			}
		}

		_, err = instances.Create(name, location, diskEncryptionKeyName, ipRange)

		return
	},
}

Cmd to create a new instance

View Source
var DeleteAttachCmd = &cobra.Command{
	Use:   "detach",
	Short: "Detach an environment from an instance",
	Long:  "Detach an environment from an instance",
	Args: func(cmd *cobra.Command, args []string) (err error) {
		apiclient.SetApigeeEnv(environment)
		return apiclient.SetApigeeOrg(org)
	},
	RunE: func(cmd *cobra.Command, args []string) (err error) {
		_, err = instances.DetachEnv(name)
		return
	},
}

Cmd to create a new instance

View Source
var DeleteCmd = &cobra.Command{
	Use:   "delete",
	Short: "Delete an Instance",
	Long:  "Delete an Instance",
	Args: func(cmd *cobra.Command, args []string) (err error) {
		return apiclient.SetApigeeOrg(org)
	},
	RunE: func(cmd *cobra.Command, args []string) (err error) {
		_, err = instances.Delete(name)
		return
	},
}

DeleteCmd to get instance

View Source
var DeleteNatCmd = &cobra.Command{
	Use:   "delete",
	Short: "Delete a NAT IP for an Apigee instance",
	Long:  "Delete a NAT IP for an Apigee instance",
	Args: func(cmd *cobra.Command, args []string) (err error) {
		apiclient.SetApigeeEnv(environment)
		return apiclient.SetApigeeOrg(org)
	},
	RunE: func(cmd *cobra.Command, args []string) (err error) {
		_, err = instances.DeleteNatIP(name, natid)
		return
	},
}

DeleteNatCmd activates NAT for an Apigee instance

View Source
var GetAttachCmd = &cobra.Command{
	Use:   "get",
	Short: "Get attachment details for an instance",
	Long:  "Get attachment details for an instance",
	Args: func(cmd *cobra.Command, args []string) (err error) {
		apiclient.SetApigeeEnv(environment)
		return apiclient.SetApigeeOrg(org)
	},
	RunE: func(cmd *cobra.Command, args []string) (err error) {
		_, err = instances.GetEnv(name)
		return
	},
}

Cmd to create a new instance

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

GetCmd to get instance

View Source
var ListAttachCmd = &cobra.Command{
	Use:   "list",
	Short: "List attachment details for an instance",
	Long:  "List attachment details for an instance",
	Args: func(cmd *cobra.Command, args []string) (err error) {
		apiclient.SetApigeeEnv(environment)
		return apiclient.SetApigeeOrg(org)
	},
	RunE: func(cmd *cobra.Command, args []string) (err error) {
		_, err = instances.ListAttach(name)
		return
	},
}

Cmd to create a new instance

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

	},
}

Cmd to list products

View Source
var ListNatCmd = &cobra.Command{
	Use:   "list",
	Short: "List NAT IPs for an Apigee instance",
	Long:  "List NAT IPs for an Apigee instance",
	Args: func(cmd *cobra.Command, args []string) (err error) {
		apiclient.SetApigeeEnv(environment)
		return apiclient.SetApigeeOrg(org)
	},
	RunE: func(cmd *cobra.Command, args []string) (err error) {
		_, err = instances.ListNatIPs(name)
		return
	},
}

ListNatCmd activates NAT for an Apigee instance

View Source
var NatCmd = &cobra.Command{
	Use:   "nat",
	Short: "Manage NAT IPs for Apigee instances",
	Long:  "Manage NAT IPs for Apigee instances",
}

NatCmd to manage instances

View Source
var ReserveNatCmd = &cobra.Command{
	Use:   "reserve",
	Short: "Reserve a NAT IP for an Apigeee instance",
	Long:  "Reserve a NAT IP for an Apigeee instance",
	Args: func(cmd *cobra.Command, args []string) (err error) {
		apiclient.SetApigeeEnv(environment)
		return apiclient.SetApigeeOrg(org)
	},
	RunE: func(cmd *cobra.Command, args []string) (err error) {
		_, err = instances.ReserveNatIP(name, natid)
		return
	},
}

ReserveNatCmd activates NAT for an Apigee instance

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