Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"apigeecli kvms export --org=$ORG" only exports proxy KVMs #540

Closed
kurtkanaskie opened this issue Sep 16, 2024 · 2 comments · Fixed by #541
Closed

"apigeecli kvms export --org=$ORG" only exports proxy KVMs #540

kurtkanaskie opened this issue Sep 16, 2024 · 2 comments · Fixed by #541

Comments

@kurtkanaskie
Copy link
Collaborator

The command implies it exports all KVMs

apigeecli kvms 
Manage Key Value Maps

Usage:
  apigeecli kvms [command]

Available Commands:
  create      Create a KV Map
  delete      Delete a KV map
  entries     Manage Key Value Map Entries
  export      Export all KV Map entries for all KV Maps
  import      Import KVM Entries from a folder containing KVM files
  list        Returns a list of KVMs

Flags:
  -h, --help            help for kvms
  -o, --org string      Apigee organization name
  -r, --region string   Apigee control plane region name; default is https://apigee.googleapis.com

How do I export org level KVMs using apigeecli kvms export?

Work around is to use KVMs list and export for each KVM
kvms entries export --org=$ORG --map=org-config-private

@srinandan
Copy link
Collaborator

You are correct, export only exports a specific scope. You can export all org scoped kvms or proxy kvms for a proxy or env kvms for a specific environment. But nothing to export all KVMs.

@kurtkanaskie
Copy link
Collaborator Author

kurtkanaskie commented Sep 16, 2024

But I'm not able to export all org scoped KVMs.

It's due to:

if env == "" && proxyName == "" {

		// return all kvm entries from all proxies
		if env == "" && proxyName == "" {
			return kvm.ExportAllEntries()
		}

If I remove that block, it exports all org KVMs.

But then there's no way to export all proxy KVMs unless we use something like
kvms export --org=$ORG --proxy=*
and change to use

		// return all kvm entries from all proxies
		if env == "" && proxyName == "*" {
			return kvm.ExportAllEntries()
		}

which works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants