env

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ArchiveCmd = &cobra.Command{
	Use:   "archives",
	Short: "Manage archive deployments for the environment",
	Long:  "Manage archive deployments for the environment",
}

ArchiveCmd to deploy apis via archives

View Source
var Cmd = &cobra.Command{
	Use:     "environments",
	Aliases: []string{"envs"},
	Short:   "Manage Apigee environments",
	Long:    "Manage Apigee environments",
}

Cmd to manage envs

View Source
var CreateArchiveCmd = &cobra.Command{
	Use:   "create",
	Short: "Create a new revision of archive in the environment",
	Long:  "Create a new revision of archive in the environment",
	Args: func(cmd *cobra.Command, args []string) (err error) {
		if zipfile != "" && folder != "" {
			return fmt.Errorf("both zipfile and folder path cannot be passed")
		}
		apiclient.SetApigeeEnv(environment)
		return apiclient.SetApigeeOrg(org)
	},
	RunE: func(cmd *cobra.Command, args []string) (err error) {
		if folder != "" {
			zipfile = name + ".zip"
			if err = proxybundle.GenerateArchive(folder, zipfile); err != nil {
				return err
			}
		}

		respBody, err := env.CreateArchive(name, zipfile)
		if wait {
			archiveResponse := op{}
			if err = json.Unmarshal(respBody, &archiveResponse); err != nil {
				return err
			}

			s := strings.Split(archiveResponse.Name, "/")
			operationID := s[len(s)-1]

			clilog.Info.Printf("Deployment operation id is %s\n", operationID)
			clilog.Info.Printf("Checking deployment status in %d seconds\n", interval)

			apiclient.DisableCmdPrintHttpResponse()

			stop := apiclient.Every(interval*time.Second, func(time.Time) bool {
				var respOpsBody []byte
				respMap := op{}
				if respOpsBody, err = operations.Get(operationID); err != nil {
					return true
				}

				if err = json.Unmarshal(respOpsBody, &respMap); err != nil {
					return true
				}

				if respMap.Metadata.State == "IN_PROGRESS" {
					clilog.Info.Printf("Archive deployment status is: %s. Waiting %d seconds.\n", respMap.Metadata.State, interval)
					return true
				} else if respMap.Metadata.State == "FINISHED" {
					if respMap.Error == (operationError{}) {
						clilog.Info.Println("Archive deployment completed with status: ", respMap.Metadata.State)
					} else {
						clilog.Info.Printf("Archive deployment failed with status: %s", respMap.Error.Message)
					}
				} else {
					clilog.Info.Printf("Unknown state %s", respMap.Metadata.State)
				}
				return false
			})

			<-stop

		}
		return err
	},
}

CreateArchiveCmd to create env archive

View Source
var CreateCmd = &cobra.Command{
	Use:   "create",
	Short: "Create a new environment",
	Long:  "Create a new environment",
	Args: func(cmd *cobra.Command, args []string) (err error) {
		_, err = url.Parse(fwdProxyURI)
		if err != nil {
			return fmt.Errorf("invalid URI string for fwdProxyURI: %v", err)
		}
		apiclient.SetApigeeEnv(environment)
		return apiclient.SetApigeeOrg(org)
	},
	RunE: func(cmd *cobra.Command, args []string) (err error) {
		_, err = env.Create(deploymentType, fwdProxyURI)
		return
	},
}

CreateCmd to create env

View Source
var CreateSecActCmd = &cobra.Command{
	Use:   "create",
	Short: "Create a new SecurityAction",
	Long:  "Create a new SecurityAction",
	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) {
		content, err := utils.ReadFile(securityActionFile)
		if err != nil {
			return err
		}
		_, err = env.CreateSecurityAction(name, content)
		return
	},
}

CreateSecActCmd to get a securityaction

View Source
var CrtTraceOverridesCmd = &cobra.Command{
	Use:   "create",
	Short: "Create a new Distributed Trace config override",
	Long:  "Create a new Distributed Trace config override",
	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 = environments.CreateTraceOverrides(apiProxy, exporter, endpoint, sampler, sampleRate)
		return
	},
}

CrtTraceOverridesCmd to manage tracing of apis

View Source
var DebugCmd = &cobra.Command{
	Use:   "debugmask",
	Short: "Manage debugmasks for the environment",
	Long:  "Manage debugmasks for the environment",
}

DebugCmd to manage debug masks

View Source
var DelArchiveCmd = &cobra.Command{
	Use:   "delete",
	Short: "Delete Apigee Archive from the environment",
	Long:  "Delete Apigee Archive from the environment",
	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 = env.DeleteArchive(name)
		return
	},
}

DelArchiveCmd to list envs

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

DelCmd to delete env

View Source
var DeployCmd = &cobra.Command{
	Use:   "deployments",
	Short: "Manage deployments for the environment",
	Long:  "Manage deployments for the environment",
}

DeployCmd to manage api deployments for an environment

View Source
var DisableSecActCfgCmd = &cobra.Command{
	Use:   "disable",
	Short: "Disables SecurityActions on the environment",
	Long:  "Disables SecurityActions on the environment",
	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 = environments.UpdateSecurityActionsConfig(false)
		return
	},
}

DisableSecActCfgCmd to manage tracing of apis

View Source
var DisableSecActCmd = &cobra.Command{
	Use:   "disable",
	Short: "Disable a SecurityAction",
	Long:  "Disable a SecurityAction",
	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 = environments.DisableSecurityAction(name)
		return
	},
}

DisableSecActCmd to manage tracing of apis

View Source
var DisableTraceConfigCmd = &cobra.Command{
	Use:   "disable",
	Short: "Disable Distributed Trace config for the environment",
	Long:  "Disable Distributed Trace config for the environment",
	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 = environments.DisableTraceConfig()
		return
	},
}

DisableTraceConfigCmd to manage tracing of apis

View Source
var EnableSecActCfgCmd = &cobra.Command{
	Use:   "enable",
	Short: "Enables SecurityActions on the environment",
	Long:  "Enables SecurityActions on the environment",
	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 = environments.UpdateSecurityActionsConfig(true)
		return
	},
}

EnableSecActCfgCmd to manage tracing of apis

View Source
var EnableSecActCmd = &cobra.Command{
	Use:   "enable",
	Short: "Enable a SecurityAction",
	Long:  "Enable a SecurityAction",
	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 = environments.EnableSecurityAction(name)
		return
	},
}

EnableSecActCmd to manage tracing of apis

View Source
var GetArchiveCmd = &cobra.Command{
	Use:   "get",
	Short: "Get archive details",
	Long:  "Get archive details",
	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 = env.GetArchive(name)
		return
	},
}

GetArchiveCmd to list envs

View Source
var GetCmd = &cobra.Command{
	Use:   "get",
	Short: "Get properties of an environment",
	Long:  "Get properties of an environment",
	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 = env.Get(config)
		return
	},
}

GetCmd to get env details

View Source
var GetConfigCmd = &cobra.Command{
	Use:   "config",
	Short: "Get deployment configuration for an Environment",
	Long:  "Get deployment configuration for an Environment",
	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 = environments.GetDeployedConfig()
		return
	},
}

GetConfigCmd to get deployed apis in an env

View Source
var GetDebugCmd = &cobra.Command{
	Use:   "get",
	Short: "Get debugmasks for an Environment",
	Long:  "Get debugmasks for an Environment",
	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 = environments.GetDebug()
		return
	},
}

GetDebugCmd to get debug masks

View Source
var GetDeployCmd = &cobra.Command{
	Use:   "get",
	Short: "Get deployments for an Environment",
	Long:  "Get deployments for an Environment",
	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) {
		if all {
			_, err = environments.GetAllDeployments()
		} else {
			_, err = environments.GetDeployments(sharedflows)
		}
		return err
	},
}

GetDeployCmd to get deployed apis in an env

View Source
var GetIamCmd = &cobra.Command{
	Use:   "get",
	Short: "Gets the IAM policy on an Environment",
	Long:  "Gets the IAM policy on an Environment",
	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 = environments.GetIAM()
		return
	},
}

GetIamCmd to get env iam details

View Source
var GetSecActCfgCmd = &cobra.Command{
	Use:   "get",
	Short: "Returns the current SecurityActions configuration",
	Long:  "Returns the current SecurityActions configuration",
	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 = environments.GetSecurityActionsConfig()
		return
	},
}

GetSecActCfgCmd to manage tracing of apis

View Source
var GetSecActCmd = &cobra.Command{
	Use:   "get",
	Short: "Get a SecurityAction by name",
	Long:  "Get a SecurityAction by name",
	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 = env.GetSecurityAction(name)
		return
	},
}

GetSecActCmd to get a securityaction

View Source
var GetSecInCmd = &cobra.Command{
	Use:   "get",
	Short: "Returns a security incidents by name",
	Long:  "Returns a security incidents by name",
	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 = env.GetSecurityIncident(name)
		return
	},
}

GetSecInCmd returns security incidents

View Source
var GetSecReportCmd = &cobra.Command{
	Use:   "get",
	Short: "Returns a security reports by name",
	Long:  "Returns a security reports by name",
	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 = env.GetSecurityReport(name)
		return
	},
}

GetSecReportCmd returns security incidents

View Source
var GetTraceConfigCmd = &cobra.Command{
	Use:   "get",
	Short: "Get Distributed Trace config for the environment",
	Long:  "Get Distributed Trace config for the environment",
	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 = environments.GetTraceConfig()
		return
	},
}

GetTraceConfigCmd to manage tracing of apis

View Source
var GetTraceOverridesCmd = &cobra.Command{
	Use:   "get",
	Short: "Get Distributed Trace config overrides",
	Long:  "Get Distributed Trace config overrides",
	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 = environments.GetTraceOverrides(configName)
		return
	},
}

GetTraceOverridesCmd to manage tracing of apis

View Source
var IamCmd = &cobra.Command{
	Use:   "iam",
	Short: "Manage IAM permissions for the environment",
	Long:  "Manage IAM permissions for the environment",
}

IamCmd to manage manage env iam permissions

View Source
var ListArchiveCmd = &cobra.Command{
	Use:   "list",
	Short: "List archives deployed to the environment",
	Long:  "List archives deployed to the environment",
	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 = env.ListArchives()
		return
	},
}

ListArchiveCmd to list archives in env

View Source
var ListCmd = &cobra.Command{
	Use:   "list",
	Short: "List environments in an Apigee Org",
	Long:  "List environments in an Apigee Org",
	Args: func(cmd *cobra.Command, args []string) (err error) {
		return apiclient.SetApigeeOrg(org)
	},
	RunE: func(cmd *cobra.Command, args []string) (err error) {
		_, err = env.List()
		return
	},
}

ListCmd to list envs

View Source
var ListSecActCmd = &cobra.Command{
	Use:   "list",
	Short: "Returns security actions in the environment",
	Long:  "Returns security actions in the environment",
	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 = env.ListSecurityActions(pageSize, pageToken, filter)
		return
	},
}

ListSecActCmd to list catalog items

View Source
var ListSecInCmd = &cobra.Command{
	Use:   "list",
	Short: "Returns security incidents in the environment",
	Long:  "Returns security incidents in the environment",
	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 = env.ListSecurityIncidents(pageSize, pageToken, filter)
		return
	},
}

ListSecInCmd to list catalog items

View Source
var ListSecReportCmd = &cobra.Command{
	Use:   "get",
	Short: "Returns a security reports by name",
	Long:  "Returns a security reports by name",
	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 = env.ListSecurityReports(pageSize, pageToken, dataset, to,
			from, status, submittedBy)
		return
	},
}

ListSecReportCmd returns security incidents

View Source
var ListTraceOverridesCmd = &cobra.Command{
	Use:   "list",
	Short: "List Distributed Trace config overrides",
	Long:  "List Distributed Trace config overrides",
	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 = environments.ListTraceOverrides()
		return
	},
}

ListTraceOverridesCmd to manage tracing of apis

View Source
var ObCmd = &cobra.Command{
	Use:   "ax-obfuscation",
	Short: "Obfuscate analytics fields",
	Long:  "Obfuscate analytics fields before sending to control plane",
	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) {
		return env.SetEnvProperty("features.analytics.data.obfuscation.enabled", strconv.FormatBool(enable))
	},
}

ObCmd to enable AX obfuscation

View Source
var PropCmd = &cobra.Command{
	Use:   "set",
	Short: "Set environment property",
	Long:  "Set environment property",
	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) {
		return env.SetEnvProperty(propName, propValue)
	},
}

PropCmd to set env prop

View Source
var RemoveRoleCmd = &cobra.Command{
	Use:   "removerole",
	Short: "Remove a member or SA from a role for an environment",
	Long:  "Remove a member or SA from a role for an environment",
	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 = environments.RemoveIAM(memberName, role)
		if err != nil {
			return err
		}
		clilog.Info.Printf("Member %s removed access to role %s\n", memberName, role)
		return nil
	},
}

RemoveRoleCmd to a member from a role

View Source
var SecActCfgCmd = &cobra.Command{
	Use:   "secactionscfg",
	Short: "Manage SecurityActionsConfig for Apigee Advanced Security",
	Long:  "Manage SecurityActionsConfig for Apigee Advanced Security",
}

SecActCfgCmd to manage security incidents

View Source
var SecActCmd = &cobra.Command{
	Use:   "secactions",
	Short: "Manage SecurityActions for Apigee Advanced Security",
	Long:  "Manage SecurityActions for Apigee Advanced Security",
}

SecActCmd to manage security incidents

View Source
var SecInCmd = &cobra.Command{
	Use:   "secincidents",
	Short: "View SecurityIncidents from Apigee Advanced Security",
	Long:  "View SecurityIncidents from Apigee Advanced Security",
}

SecInCmd to manage security incidents

View Source
var SecReportCmd = &cobra.Command{
	Use:   "secreports",
	Short: "Manage SecurityReports for Apigee Advanced Security",
	Long:  "View SecurityReports for Apigee Advanced Security",
}

SecReportCmd to manage security reports

View Source
var SetAdminCmd = &cobra.Command{
	Use:   "setadmin",
	Short: "Set Environment Admin role for a member on an environment",
	Long:  "Set Environment Admin role for a member an Environment",
	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 = environments.SetIAM(memberName, "admin", memberType)
		if err != nil {
			return err
		}
		clilog.Info.Printf("Member %s granted access to environment admin role\n", memberName)
		return nil
	},
}

SetAdminCmd to set role on env

View Source
var SetAxCmd = &cobra.Command{
	Use:   "setax",
	Short: "Set Analytics Agent role for a member on an environment",
	Long:  "Set Analytics Agent role for a member an Environment",
	Args: func(cmd *cobra.Command, args []string) (err error) {
		if role != "analyticsAgent" && role != "analyticsViewer" {
			return fmt.Errorf("invalid memberRole. Member role must be analyticsViewer or analyticsAgent")
		}
		apiclient.SetApigeeEnv(environment)
		return apiclient.SetApigeeOrg(org)
	},
	RunE: func(cmd *cobra.Command, args []string) (err error) {
		err = environments.SetIAM(memberName, role, memberType)
		if err != nil {
			return err
		}
		clilog.Info.Printf("Member %s granted access to %s role\n", memberName, role)
		return nil
	},
}

SetAxCmd to set role on env

View Source
var SetCustCmd = &cobra.Command{
	Use:   "setcustom",
	Short: "Set a custom role for a member on an environment",
	Long:  "Set a custom role for a member on an environment",
	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) {
		re := regexp.MustCompile(`projects\/([a-zA-Z0-9_-]+)\/roles\/([a-zA-Z0-9_-]+)`)
		result := re.FindString(role)
		if result == "" {
			return fmt.Errorf("custom role must be of the format projects/{project-id}/roles/{role-name}")
		}
		err = environments.SetIAM(memberName, role, memberType)
		if err != nil {
			return err
		}
		clilog.Info.Printf("Member %s, granted access to %s\n", memberName, role)
		return nil
	},
}

SetCustCmd to manage custom roles for an env

View Source
var SetDebugCmd = &cobra.Command{
	Use:   "set",
	Short: "Set debugmasks for an Environment",
	Long:  "Set debugmasks for an Environment",
	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 = environments.SetDebug(payload)
		return
	},
}

SetDebugCmd to set debug mas on env

View Source
var SetDepCmd = &cobra.Command{
	Use:   "setdeploy",
	Short: "Set Apigee Deployer role for a member on an environment",
	Long:  "Set Apigee Deployer role for a member on an environment",
	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 = environments.SetIAM(memberName, "deploy", memberType)
		if err != nil {
			return err
		}
		clilog.Info.Printf("Member %s granted access to Apigee Deployer role\n", memberName)
		return nil
	},
}

SetDepCmd to set deployer role on env

View Source
var SetSyncCmd = &cobra.Command{
	Use:   "setsync",
	Short: "Set Synchronization Manager role for a member on an environment",
	Long:  "Set Synchronization Manager role for a member on an environment",
	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 = environments.SetIAM(memberName, "sync", memberType)
		if err != nil {
			return err
		}
		clilog.Info.Printf("Member %s granted access to Apigee Synchronizer Manager role\n", memberName)
		return nil
	},
}

SetSyncCmd to manage tracing of apis

View Source
var TestIamCmd = &cobra.Command{
	Use:   "test",
	Short: "Test IAM policy for an Environment",
	Long:  "Test IAM policy for an Environment",
	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 = environments.TestIAM(resource, verb)
		return
	},
}

TestIamCmd to manage tracing of apis

View Source
var TraceConfigCmd = &cobra.Command{
	Use:   "traceconfig",
	Short: "Manage Distributed Trace config for the environment",
	Long:  "Manage Distributed Trace config for the environment",
}

TraceConfigCmd to manage tracing of apis

View Source
var TraceOverridesCmd = &cobra.Command{
	Use:   "overrides",
	Short: "Manage Distributed Trace config overrides for the environment",
	Long:  "Manage Distributed Trace config overrides for the environment",
}

TraceOverridesCmd to manage tracing of apis

View Source
var UpdateTraceConfigCmd = &cobra.Command{
	Use:   "update",
	Short: "Update Distributed Trace config for the environment",
	Long:  "Update Distributed Trace config for the environment",
	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 = environments.UpdateTraceConfig(exporter, endpoint, sampler, sampleRate)
		return
	},
}

UpdateTraceConfigCmd to manage tracing of apis

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