{ Community }
  • Academy
  • Docs
  • Developers
  • Resources
    • Community Articles
    • Apigee on GitHub
    • Code Samples
    • Videos & eBooks
    • Accelerator Methodology
  • Support
  • Ask a Question
  • Spaces
    • Product Announcements
    • General
    • Edge/API Management
    • Developer Portal (Drupal-based)
    • Developer Portal (Integrated)
    • API Design
    • APIM on Istio
    • Extensions
    • Business of APIs
    • Academy/Certification
    • Adapter for Envoy
    • Analytics
    • Events
    • Hybrid
    • Integration (AWS, PCF, Etc.)
    • Microgateway
    • Monetization
    • Private Cloud Deployment
    • 日本語コミュニティ
    • Insights
    • IoT Apigee Link
    • BaaS/Usergrid
    • BaaS Transition/Migration
    • Apigee-127
    • New Customers
    • Topics
    • Questions
    • Articles
    • Ideas
    • Leaderboard
    • Badges
  • Log in
  • Sign up

Get answers, ideas, and support from the Apigee Community

  • Home /
  • Developer Portal (Integrated) /
avatar image
1

Migrating company owned apps to Developer Teams  

  • Export to PDF
deboraelkin   created · May 05, 2020 at 06:20 AM · 182 Views · gkoli123 edited · May 06, 2020 at 03:34 AM

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:

  • Input: List of company ids, associated dev team id
    • For example: [{“company_id”:”TestCompany”, “dev_team_id”:”d2574ad2-1f5d-466b-a80a-c9a381971ed5”}
  • For each company,
    • list company apps (https://apidocs.apigee.com/management/apis/get/organizations/%7Borg_name%7D/companies/%7Bcompany_name%7D/apps-0), using expand=true, to retrieve all required details for every app in one request, and storing the key/secret and associated products for each app.
    • for each app,
      1. create new developer app owned by the dev team corresponding to this company (https://apidocs.apigee.com/management/apis/post/organizations/%7Borg_name%7D/developers/%7Bdeveloper_email_or_id%7D/apps). Note that a dev team is internally represented as a developer, identified by dev_team_id@devteam.apigee.io. This is the developer Id to be used when invoking this API
      2. Delete key for company app, so that keys can be associated with new app (https://apidocs.apigee.com/management/apis/delete/organizations/%7Borg_name%7D/companies/%7Bcompany_name%7D/apps/%7Bapp_name%7D/keys/%7Bconsumer_key%7D)
      3. Import company app keys into new app (https://apidocs.apigee.com/management/apis/post/organizations/%7Borg_name%7D/developers/%7Bdeveloper_email_or_id%7D/apps/%7Bapp_name%7D/keys/create)
      4. Add product(s) to API Key: (https://apidocs.apigee.com/management/apis/post/organizations/%7Borg_name%7D/developers/%7Bdeveloper_email_or_id%7D/apps/%7Bapp_name%7D/keys/%7Bconsumer_key%7D)
      5. Delete api key created when creating new app (https://apidocs.apigee.com/management/apis/delete/organizations/%7Borg_name%7D/developers/%7Bdeveloper_email_or_id%7D/apps/%7Bapp_name%7D/keys/%7Bconsumer_key%7D)
  • Optional: Delete company (https://apidocs.apigee.com/management/apis/delete/organizations/%7Borg_name%7D/companies/%7Bcompany_name%7D)
  • 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
    
    
    thub.nodes.view.add-new-comment
    company appDeveloper Teams
    Add comment Show 2
    10 |5000 characters needed characters left characters exceeded
    ▼
    • Viewable by all users
    • Viewable by Apigeeks only
    • Viewable by the original poster
    • Viewable by moderators
    • Viewable by moderators and the original poster
    • Advanced visibility
    Viewable by all users
    avatar image Ram C · May 20, 2020 at 10:11 PM 0
    Link

    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

    avatar image deboraelkin ♦ Ram C   · May 20, 2020 at 11:45 PM 0
    Link

    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.

    Article

    Contributors

    avatar image avatar image

    Follow this article

    46 People are following this .

    avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

    Navigation

    Migrating company owned apps to Developer Teams

    Related Articles

    • Products
      • Edge - APIs
      • Insights - Big Data
      • Plans
    • Developers
      • Overview
      • Documentation
    • Resources
      • Overview
      • Blog
      • Apigee Institute
      • Academy
      • Documentation
    • Company
      • Overview
      • Press
      • Customers
      • Partners
      • Team
      • Events
      • Careers
      • Contact Us
    • Support
      • Support Overview
      • Documentation
      • Status
      • Edge Support Portal
      • Privacy Policy
      • Terms & Conditions
    © 2021 Apigee Corp. All rights reserved. - Apigee Community Terms of Use - Powered by AnswerHub
    • Anonymous
    • Sign in
    • Create
    • Ask a question
    • Create an article
    • Post an idea
    • Spaces
    • Product Announcements
    • General
    • Edge/API Management
    • Developer Portal (Drupal-based)
    • Developer Portal (Integrated)
    • API Design
    • APIM on Istio
    • Extensions
    • Business of APIs
    • Academy/Certification
    • Adapter for Envoy
    • Analytics
    • Events
    • Hybrid
    • Integration (AWS, PCF, Etc.)
    • Microgateway
    • Monetization
    • Private Cloud Deployment
    • 日本語コミュニティ
    • Insights
    • IoT Apigee Link
    • BaaS/Usergrid
    • BaaS Transition/Migration
    • Apigee-127
    • New Customers
    • Explore
    • Topics
    • Questions
    • Articles
    • Ideas
    • Badges