How do I Change the Ownership of Multiple Teams?
You can change the owners of multiple teams in a single step. This use case explains how to change the ownership of multiple teams by sending a REST request. You can configure an approval process, if required, for the change of ownership to take effect.
The use case starts when multiple teams require change of owner and ends when you successfully change the ownership of the teams.
To change the ownership of multiple teams
1. Use the following REST request to change the asset ownership to a new user.
POST http://host:port/rest/apigateway/assets/team
Content-Type: application/json
{
"assetType": "*", (API/APPLICATION)
"assetIds": ["*"],
"currentTeams": "team1",
"newTeams": ["team2"]
}
Provide the following information in the REST request:
assetType. Specifies the asset type for which you want to assign new teams. Available values are
API,
APPLICATION, or the wildcard
*. The wildcard
* specifies all the assets, APIs and applications owned by the user specified in
currentTeams.
assetIds. Specifies the ID of the assets specified in
assetType.
Note:
This is optional. assetIds is not required if you specify currentOwner.
currentTeams. Specifies the current teams of the assets specified in the
assetType field.
Note:
If both currentTeams and assetIds are specified, both are validated. For example, consider user1 and user2 are owners of assetID1 and assetID2 respectively. In the request payload, if you include assetID1 and assetID2 in the assetIds field and user1 in the currentTeams field, then only assetID1 ownership changes.
newTeams. Specifies the teams to which you want to assign the specified assets.
Example: If all APIs assigned to the DevTeam must be assigned to two other teams, Team2 and Team3, then send a REST request as follows:
POST http://localhost:5555/rest/apigateway/assets/team
Content-Type: application/json
{
"assetType": "*", (API/APPLICATION)
"currentTeams": "DevTeam",
"newTeams": ["Team2", "Team3"]
}
This request assigns the all APIs of DevTeam to Team2 and Team3.
The change approval process is initiated.
2. An approval request is sent to the approver.
The approval request contains information of all the assets whose ownership needs to change and the new owners' name.
3. The approver approves the request in the Pending Requests section of the API Gateway UI.
The approval notification is sent to the requester.
4. All APIs that are assigned to theDevTeam is assigned to Team2 and Team3.