Applications
The following operations are available through the CLI related to application management.
- List your accounts
- Check the account info
- Invite to other users to your account
- Remove users from your account
- Change the role of the users in your account
Deploying an application
To deploy an application from a local file or directory use:
playground apps deploy <path_to_drawio_files>
STATUS INFO
SUCCESS application [<app_name>] deployed
CREATED
core.oam.dev/v1beta1, Kind=Application "<app_name>" created
Listing deployed applications
Obtain a list of running applications in your current environment with:
playground apps
NAME STATUS
app1 RUNNING
app2 WARNING
To retrieve the list of applications that are deployed in all environments you have access to, use:
playground apps --all-environments
ENV NAME STATUS
account2/env1 app1 RUNNING
account2/env1 app2 RUNNING
account1/env1 app3 RUNNING
The listing can be also restricted to a selected account with:
playground apps --account=<selected_account>
ENV NAME STATUS
<selected_account>/<env_name> app1 RUNNING
Inspecting the application
Information about an application can be obtained with the info command:
playground app info <application_name>
Target environment: <account_name>/<environment>
NAME STATUS
<application_name> RUNNING
COMPONENT STATUS SCOPES TRAITS
comp1 RUNNING napptive-ingress
COMPONENT INGRESSES
comp1 <ingress_name>-<your_environment_id>.apps.playground.napptive.dev
Application logs
To retrieve logs from an application use:
playground apps logs <appName>
[comp-1-864b6b49-f47l8] [comp-1] 2021-04-20T19:12:09.401703900Z 2021-04-20 19:12:09+00:00 Sample application log
...
This command will actively stream all the logs coming from the application, use CTRL+C
to stop receiving logs. A detailed guide on application logs is available describing how to obtain application and component logs.
Application endpoints
Applications may expose public endpoints, to navigate to those either request the information using:
playground app info <application_name>
...
COMPONENT INGRESSES
<component_name> <ingress_name>-<your_environment_id>.apps.playground.napptive.dev
And navigate to `
playground app open <application_name>
This will launch the default browser for each of the application endpoints.
Removing an application
The simplest way to remove an application is using the playground command with:
playground apps delete <application_name>
Waiting for an application to start
The CLI offers a method to wait for an application to start. This can be really useful when issuing several commands in a script, or just to wait before opening the application endpoints. The following command waits for the application status to become Ok.
playground apps wait <application_name>
For applications that take time in the internal booting process it is possible to wait for a specific entry in the log to contain a string.
playground apps wait <application_name> --logContains="<string to match>"