Managing Applications¶
Add Applications in an environment¶
You can add Applications via the Developer Portal. However, WSO2 API Controller (apictl) allows you to create Applications without using the Developer Portal. For more information on adding Applications, see Migrating Apps to Different Environments.
Get Applications in an environment¶
Follow the instructions below to display a list of Applications in an environment using apictl:
- Make sure that the WSO2 API Manager (WSO2 API-M) 4.2.0 version is started and that the 4.2.7 version of apictl is set up.
For more information, see Download and Initialize the apictl. - Log in to the WSO2 API-M in the environment by following the instructions in Login to an Environment.
-
Run the corresponding apictl command below to get (list) Applications in an environment.
-
Command
apictl get apps -e <environment>apictl get apps --environment <environment>apictl get apps --environment <environment> --owner <application owner>Info
Flags:
- Required :
--environmentor-e: Environment to be searched - Optional :
--owneror-o: Owner of the Application
--limitor-l: Maximum number of applications to return (Default 25)
Example
apictl get apps -e devapictl get apps --environment productionapictl get apps --environment production --owner sampleUser --limit 15 - Required :
-
Response
ID NAME OWNER STATUS GROUP ID 29b4fcc6-05a4-42a7-aa64-f1a1b8a7b979 DefaultApplication admin APPROVED 36d51e55-3f1e-4f85-86ee-8fe73b0c8adff SampleApplication sampleUser APPROVED orgATip
When using the
apictl get apps -e devcommand, you can either specify-o(--owner) flag or not.- When someone has invoked the command without specifying the owner flag, it will list all the applications in that environment which belongs to the tenant that the currently logged in user belongs.
- When someone has invoked the command by specifying the owner flag, it will list all the applications belongs to that particular owner in that environment.
Environment registration method affects --owner flag behavior
The behavior of the
--ownerflag depends on how the environment was registered:- Unified endpoint registration (using
--apimflag): The--ownerflag is supported because the command uses the Admin API (/api/am/admin/v4/applications) which allows filtering applications by owner. - Multi-endpoint registration (using
--devportalflag): The--ownerflag has no effect because the command uses the DevPortal API (/api/am/devportal/v3/applications) which only returns applications belonging to the currently logged-in user.
When an environment is registered with the
--devportalflag, theapictl get appscommand will always list only the applications that belong to the currently logged-in user, regardless of the--ownerflag value.Note
Output of the
get appscommand can be formatted with Go Templates. For more information on formatting the get commands, see Formatting the outputs of get commands.Note
apictl list appscommand has been deprecated from apictl 4.0.0 onwards. Instead useapictl get appsas shown above.
-
Delete an Application in an environment¶
- Make sure that the WSO2 API-M 4.2.0 version is started and that the 4.2.7 version of apictl is set up.
For more information, see Download and Initialize the apictl. - Log in to the WSO2 API-M in the environment by following the instructions in Login to an Environment.
-
Run the corresponding apictl command below to get (list) Applications in an environment.
-
Command
apictl delete app -n <application name> -e <environment>apictl delete app -name <application name> --environment <environment>apictl delete app --name <application name> --environment <environment> --owner <application owner>Info
Flags:
- Required :
--environmentor-e: Environment from which the Application should be deleted
--nameor-n: Name of the Application to be deleted - Optional :
--owneror-o: Owner of the Application to be deleted
Example
apictl delete app -n DefaultApplication -e devapictl delete app --name DefaultApplication --environment productionapictl delete app --name DefaultApplication --environment production --owner sampleUser - Required :
-
Response
DefaultApplication Application deleted successfully!
-