Chethana
Chethana

Reputation: 21

Can I change an app ownership from one developer to another on Apigee Edge?

If I have to change the app owner from one developer to another, is it possible? If yes, how do I do it?

Upvotes: 0

Views: 903

Answers (4)

Shekhar Menon
Shekhar Menon

Reputation: 23

Editing to add more details:

Step 1: Get app details

curl -u <user> -p <password> "https://api.enterprise.apigee.com/v1/o/<org>/developers/<dev1>/apps/<appname>"

Use output of this to set createapp_post_data - remove app id. store key/secret, and API Product somewhere safe. delete the key/secrets from app createapp_post_data

Step 2: Create app

export createapp_post_data='{
"accessType":"read", 
"appFamily":"default",
"attributes":[
  {
     "name":"Language",
     "value":"java"
  }
],
"callbackUrl":"www.apigee.com",
"createdAt":1391521426103,
"createdBy":"<someone>",
"lastModifiedAt":1391521426103,
"lastModifiedBy":"<someone>",
"name":"<appname>",
"scopes":[
]
}'

curl -XPOST -H "Content-Type: application/json" -u <user> -p <password>  "https://api.enterprise.apigee.com/v1/o/<org>/developers/<dev2>/apps" -d "${createapp_post_data}"

Step 3: Push desired API Key to the app

export setapikey_post_data='<CredentialRequest><ConsumerKey>keyextractedfromstep1</ConsumerKey><ConsumerSecret>secretextractedfromstep1</ConsumerSecret><Attributes><Attribute><Name>CreatedBy</Name><Value>Shekhar</Value></Attribute></Attributes></CredentialRequest>'

curl -XPOST -H "Content-Type: application/xml" -u <user> -p <password> "https://api.enterprise.apigee.com/v1/o/<org>/developers/<dev2>/apps/<appname>/keys/create" -d "${setapikey_post_data}"

Step 4: Associate the key (just created) with desired API Product

export add_apiproduct_post_data='{"apiProducts":["<apiproductfromstep1>"],"attributes":[{"name":"CreatedBy","value":"<someone>"}]}'

curl -XPOST -H "Content-Type: application/json" -u <user> -p <password> "https://api.enterprise.apigee.com/v1/o/<org>/developers/<dev2>/apps/<appname>/keys/<keysavedfromstep1>" -d "${add_apiproduct_post_data}"

Upvotes: 2

Jagjyot
Jagjyot

Reputation: 19

The code does not allow to do it.

It will give following error if we try to associate another developer for an app:

The property has a getter \"public java.lang.String com.apigee.organizations.keymanagement.App.getDeveloperId()\" but no setter. For unmarshalling, please define setters. (Or if this is a collection property, make sure that the getter returns a collection instance

Upvotes: 0

Srikanth
Srikanth

Reputation: 1025

Suggestion, delete the developer app and create a new with the new developer app with required developer.

Take a look at the Developer APP API it can help you capture the current attributes of the app, delete it and replay the same with against the new developer e-mail.

Upvotes: 0

Santanu Dey
Santanu Dey

Reputation: 2978

AFAIK, not possible from UI or from public APIs.

As a workaround you can first delete the app and then re-create it with same name and with the same metadata for the new developer.

Upvotes: 0

Related Questions