App workflows
The HERE platform allows creating apps and managing them with other apps.
Apps access platform data or pipelines through the REST API, CLI, or one of the platform libraries.
For simple and secure authentication of your application with the platform, you can define two sets of credentials per app:
- Access keys
- API keys (recommended for web-based apps)
As an app manager, you can enable or disable the app, grant app manager access to other users, apps, and groups, control app credentials, and more.
For more information on apps, see Manage Apps.
The OLP CLI provides tools for managing apps, such as:
For more information, see app commands.
Create a new app
To create and manage apps through the OLP CLI, first allow your app to create new apps:
- Go to the portal's Apps section, select your app, click More, click the Enable app creation button.
Follow the steps below to create two apps.
-
Run the olp app create
command to create first app.
olp app create firstApp
-
Create another app that will be granted manager permissions for the firstApp
.
olp app create managerApp
To verify that the apps have been created successfully, use the olp app list
command.
olp app list
The command displays the following results.
HRN name
hrn:here:account::org:app/manager-app-id managerApp
hrn:here:account::org:app/first-app-id firstApp
Use olp app show <app HRN> to display more information about an app
Note
org
is a placeholder for the ID of your organization.
Save these HRNs to use below.
Show information about the app
To get information about the app, use olp app show
.
olp app show hrn:here:account::org:app/manager-app-id
The command displays the following results.
ID manager-app-id
name managerApp
description
HRN hrn:here:account::org:app/manager-app-id
app creation disabled
trusted domains disabled
status active
Save ID
to use bellow.
Add a manager to the app
Run the olp app manager add
command to allow managerApp
to manage firstApp
.
olp app manager add hrn:here:account::org:app/first-app-id --app manager-app-id
Note
manager-app-id
is the ID we saved in the previous step.
The command displays the following results.
Granted manager access for the app manager-app-id to the application hrn:here:account::org:app/first-app-id
Add a domain to the app
To add a domain, use the olp app domain add
command.
olp app domain add hrn:here:account::org:app/first-app-id --domain http://example.com
Trusted domain http://example.com added to app hrn:here:account::org:app/first-app-id
To add many domains, use the olp app domain add
command with the --domain-list
parameter. The file file.csv
contains the following information:
http://example.com, anotherexample.com
olp app domain add hrn:here:account::org:app/first-app-id --domain-list path/to/file.csv
Trusted domains added to hrn:here:account::org:app/first-app-id
Show app domain information
Run the olp app domain show
command.
olp app domain show hrn:here:account::org:app/first-app-id http://example.com
App hrn:here:account::org:app/first-app-id has trusted domain http://example.com
List app domain information
Run the olp app domain list
command.
olp app domain list hrn:here:account::org:app/first-app-id --json
{"trustedDomains": [
"http://example.com",
"anotherexample.com"
]}
Create an access key for the app
To create an access key for the app that will be used further in this workflow, use the olp app access key create
command.
olp app key access create hrn:here:account::org:app/manager-app-id > app-manager-credentials.properties
olp app key access create hrn:here:account::org:app/manager-app-id 1> app-manager-credentials.properties
The app credentials will be stored in app-manager-credentials.properties
file.
Show information about the access key
To get information about the access key, use the olp access key list
command.
olp app key access list hrn:here:account::org:app/manager-app-id --json
The command displays the following results.
{"keys": [{
"accessKeyId": "access-key-id",
"clientId": "client-id",
"accessKeyHrn": "hrn:here:account::org:accesskey/access-key-id",
"clientHrn": "hrn:here:account::org:app/manager-app-id",
"createdTime": 1595857224199,
"enabled": true
}]}
Save accessKeyHrn
to use bellow.
Update the app using the access key
To update the details of the app, specify the app-manager-credentials.properties
file from the previous chapter.
The command below shows how to change the description of the app through the manager app. To see the update immediately, use the --json
flag.
olp app update hrn:here:account::org:app/first-app-id \
--credentials app-manager-credentials.properties \
--description "Updated description for the first app" \
--json
olp app update hrn:here:account::org:app/first-app-id ^
--credentials app-manager-credentials.properties ^
--description "Updated description for the first app" ^
--json
The command displays the following results.
{
"trustedDomainsEnabled": false,
"appCreationEnabled": false,
"hrn": "hrn:here:account::org:app/first-app-id",
"appId": "first-app-id",
"name": "firstApp",
"description": "Updated description for the first app",
"status": "active"
}
Remove the access key
To remove the access key created above, use the olp access key remove
command.
olp app key access delete hrn:here:account::org:app/manager-app-id \
hrn:here:account::org:accesskey/access-key-id
olp app key access delete hrn:here:account::org:app/manager-app-id ^
hrn:here:account::org:accesskey/access-key-id
Note
hrn:here:account::org:accesskey/access-key-id
is the access key HRN we saved in the previous step.
The command displays the following results.
Access key hrn:here:account::org:accesskey/access-key-id has been deleted
Remove the app manager
To remove the manager from the app, use the olp app manager remove
command.
olp app manager remove hrn:here:account::org:app/first-app-id --app manager-app-id
The command displays the following results.
App hrn:here:account::org:app/manager-app-id has been removed as a manager
Delete an app domain
To remove a domain from the app, use the olp app domain delete
command with the --domain <domain name>
parameter.
olp app domain delete hrn:here:account::org:app/first-app-id --domain http://example.com
The command displays the following results.
Trusted domain 'http://example.com' deleted from app hrn:here:account::org:app/first-app-id
To remove many domains from the app, use the olp app domain delete
command with the --domain-list <path to file>
parameter.
olp app domain delete hrn:here:account::org:app/first-app-id --domain-list path/to/file
The command displays the following results.
Trusted domains deleted from app hrn:here:account::org:app/first-app-id
Delete the app
To delete the app, use the olp app delete
command.
olp app delete hrn:here:account::org:app/manager-app-id
olp app delete hrn:here:account::org:app/first-app-id
The commands display the following results.
Application hrn:here:account::org:app/manager-app-id has been deleted
Application hrn:here:account::org:app/first-app-id has been deleted
To get a full list of available commands, enter olp app --help
.