Migrating company owned apps to Developer Teams

Drupal based developer portals support the concept of companies. It is frequently used as an abstraction for app ownership. Instead of an app being directly owned by a single developer, an app can be owned by a company, and a company administrator can manage membership, adding or removing developers as required.

The Integrated Developer Portal now offers a similar concept, called Developer Teams. The aim is similar: abstract app ownership into an intermediate entity, Developer Teams, which can be self-managed by API consumers.

This and other recently added features, as well as its simplicity and ease of use, make the Integrated Developer Portal an increasingly attractive proposition for Apigee customers, and many are looking into replacing their existing Drupal based portals with the Integrated Developer portal.

This article explains a method for migrating company owned apps into Developer Team owned apps.

Prepare Dev Teams

At this stage there are no APIs to create a Developer Team, so for each Company, a new Developer Team will need to be manually created.

An Apigee administrator can login into the integrated Developer Portal and create a Dev Team for each company. Each Dev Team will have by default the administrator as Team Owner

After adding the existing company members and making sure that at least two of them are designated as Team owners, the Apigee administrator can remove themselves from this newly created developer team.

Make sure to write down the ID for the newly created developer team. An easy way to find it is to navigate in the Apigee UI to Developer Programs -> Teams and select the newly created team. The id will be shown in the URI

Migrate Apps

Once the appropriate Developer Teams can be created all remaining steps can be performed using Apigee APIs, and can therefore be automated via a script.

Here is an outline of what the script should do:

  • Optional: Delete company (https://apidocs.apigee.com/management/apis/delete/organizations/%7Borg_name%7D/companies/%7Bcompany_...)
  • Appendix: Example requests and responses for each step

    Sample Script Input:

     [{“company_id”:”TestCompany”, “dev_team_id”:”d2574ad2-1f5d-466b-a80a-c9a381971ed5”}]

    List Company Apps

    Request: 
    GET /v1/organizations/{org}/companies/TestCompany/apps?expand=true
    
    Response: 
    {
       "app":[
          {
             "appFamily":"default",
             "appId":"efc6a881-3f50-4f43-8137-3cd5d5888171",
             "attributes":[
                {
                   "name":"DisplayName",
                   "value":"CompanyOwnedApp"
                },
                {
                   "name":"Notes",
                   "value":""
                }
             ],
             "callbackUrl":"",
             "companyName":"TestCompany",
             "createdAt":1573776256023,
             "createdBy":"deboraelkin@google.com",
             "credentials":[
                {
                   "apiProducts":[
                      {
                         "apiproduct":"HelloProduct",
                         "status":"approved"
                      }
                   ],
                   "attributes":[
    
    
                   ],
                   "consumerKey":"TaTBf1vbxxxxxxxYFaT3",
                   "consumerSecret":"xxxxxxxxxxxx",
                   "expiresAt":-1,
                   "issuedAt":1588654375914,
                   "scopes":[
    
    
                   ],
                   "status":"approved"
                }
             ],
             "lastModifiedAt":1588654377403,
             "lastModifiedBy":"deboraelkin@google.com",
             "name":"CompanyOwnedApp",
             "scopes":[
    
    
             ],
             "status":"approved"
          }
       ]
    }
    

    Create Dev Team owned App

    Request:
    POST /v1/organizations/{org}/developers/d2574ad2-1f5d-466b-a80a-c9a381971ed5@devteam.apigee.io/apps
    
    Payload:
    {
       "name":"CompanyOwnedApp",
       "apiProducts":[
          "HelloProduct"
       ],
       "attributes":[
          {
             "name":"DisplayName",
             "value":"CompanyOwnedApp"
          },
          {
             "name":"Notes",
             "value":""
          }
       ],
       "keyExpiresIn":-1,
       "scopes":[
    
    
       ],
       "callbackUrl":""
    }
    
    
    Response:
    
    {
       "appId":"6e9e09a2-08ea-4eba-90e8-9f6f4ce889a4",
       "attributes":[
          {
             "name":"DisplayName",
             "value":"CompanyOwnedApp"
          },
          {
             "name":"Notes",
             "value":""
          }
       ],
       "callbackUrl":"",
       "createdAt":1588655469162,
       "createdBy":"deboraelkin@google.com",
       "credentials":[
          {
             "apiProducts":[
                {
                   "apiproduct":"HelloProduct",
                   "status":"approved"
                }
             ],
             "attributes":[
    
    
             ],
             "consumerKey":"fCDNuH7ayyyyyyyBytxyMkGw",
             "consumerSecret":"yyyyyyy",
             "expiresAt":-1,
             "issuedAt":1588655469173,
             "scopes":[
    
    
             ],
             "status":"approved"
          }
       ],
       "developerId":"0b0f2b39-7e7f-44f9-8401-f8c66a29e614",
       "lastModifiedAt":1588655469162,
       "lastModifiedBy":"deboraelkin@google.com",
       "name":"CompanyOwnedApp",
       "scopes":[
    
    
       ],
       "status":"approved"
    }
    

    Delete keys from company App

    Request:
    DELETE /v1/organizations/{org}/companies/TestCompany/apps/CompanyOwnedApp/keys/TaTBf1vbxxxxxxxYFaT3


    Import company app keys into new app

    Request:
    POST /v1/organizations/{org}/developers/d2574ad2-1f5d-466b-a80a-c9a381971ed5@devteam.apigee.io/apps/CompanyOwnedApp/keys/create
    
    Payload:
    
    {
       "consumerKey":"TaTBf1vbxxxxxxxYFaT3",
       "consumerSecret":"xxxxxxxxxxxx"
    }
    
    
    Response:201 Created

    Add Product(s) to API Key

    Request:
    POST /v1/organizations/{org}/developers/d2574ad2-1f5d-466b-a80a-c9a381971ed5@devteam.apigee.io/apps/CompanyOwnedApp/keys/TaTBf1vbxxxxxxxYFaT3
    
    Payload: 
    
    {
       "apiProducts":[
          "HelloProduct"
       ]
    }
    

    Delete API Key generated when creating new App

    Request:
    
    DELETE /v1/organizations/{org}/developers/d2574ad2-1f5d-466b-a80a-c9a381971ed5@devteam.apigee.io/apps/CompanyOwnedApp/keys/fCDNuH7ayyyyyyyBytxyMkGw
    
    
    Comments
    Ramchanderch
    Participant II

    We have a similar requirement but the other way round. Challenge is the downtime, as the App is used heavily customer doesn't want to get the app deleted which would fail the traffic. Is there a way i can do the migration but with out deleting the app/Keys.

    Regards, Ram

    deboraelkin
    Staff

    An app is owned by an entity. Whenever you want to migrate the entity model being used (say from company owned to dev team owned, or vice versa), you need to create a new app under the corresponding entity in the new model.

    If you want to preserve the keys, you need to transfer them from the "old" app to the "new" app. But since app keys are unique amongst an Apigee organization, you need to first delete them from the old app and immediately import them into the new app. This would be the only (short) time where traffic may be potentially impacted.

    prasanthdp26
    Observer

    Hi, 

    We have a scenario where we have to move apps from one company to different company. Is that possible to do so? Can you clarify. 

    Version history
    Last update:
    ‎05-04-2020 11:20 PM
    Updated by: