apigee / apigeecli

This is a tool to interact with Apigee APIs. The tool lets you manage (create, del, get, list) environments, proxies, etc.
Apache License 2.0
51 stars 28 forks source link

organization import errors #466

Closed kurtkanaskie closed 3 months ago

kurtkanaskie commented 3 months ago

Use export APIGEECLI_DEBUG=true for better debugging info.

ISSUE 1: local fix --help for --folder is incorrect Shows: folder containing API proxy bundles Should be: folder containing organization resources

ISSUE 2: local fix to use org__kvms.json org level KVM export creates file name: $ORGkvms.json import incorrectly builds kvm file name: org_$ORGkvms.json Export uses: $ORG_kvms.json For export - import need to `cp ${EXPORT_ORG}kvms.json ${IMPORT_ORG}kvms.json Or betterorg__kvms.json` for both export and import

For envs we use $ENV__kvms.json

ISSUE 3: local fix except for operations completions Import of environment level KVMs not working due to incorrect file names. When importing envs, need to wait to operations complete before moving on to import env resources. As a work around import environments first and wait.

ISSUE 5: - fixed Cannot import apps belonging to developers with "+" in email: "kurtkanaskie+appdev@google.com" Needed to url.QueryEscape email when deleting auto created key.

For example, during apps import

ERROR: 2024/05/23 07:16:39 apps.go:498: Not found - the server cannot find the requested resource
{
  "error": {
    "code": 404,
    "message": "DeveloperId kurtkanaskie appdev@google.com does not exist in organization {1}",
    "status": "NOT_FOUND",
    "details": [
      {
        "@type": "type.googleapis.com/google.rpc.PreconditionFailure",
        "violations": [
          {
            "type": "developer.service.DeveloperIdDoesNotExist",
            "subject": "[2002:a17:531:970d::]:4399:bccwh16-20020a05615e091000b0026311028bd9:9805:75661:175421027",
            "description": "DeveloperId kurtkanaskie appdev@google.com does not exist in organization {1}"
          }
        ]
      },
      {
        "@type": "type.googleapis.com/google.rpc.RequestInfo",
        "requestId": "5668586840605940302"
      }
    ]
  }
}