App workflows
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:
- Create a new app
- Show information about the app
- Add a manager to the app
- App domain add to the app
- Show if a trusted domain is associated with an app
- List all app domains
- Create an access key for the app
- Show information about the access key
- Update the app using the access key
- Remove the access key for the app
- Remove the manager for the app
- Remove the domain from the app
- Delete the app
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:
- On the HERE platform, navigate to the 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 createcommand to create first app.
olp app create firstApp- Create another app that will be granted manager permissions for the
firstApp.
olp app create managerAppTo verify that the apps have been created successfully, use the
olp app list command.
olp app listThe 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
orgis 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-idThe 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 activeSave 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-idis 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-idAdd 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.comTrusted domain http://example.com added to app hrn:here:account::org:app/first-app-idTo add many domains, use the olp app domain add command with the --domain-list <path to file> 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.csvTrusted domains added to hrn:here:account::org:app/first-app-idShow app domain information
Run the olp app domain show command.
olp app domain show hrn:here:account::org:app/first-app-id http://example.comApp hrn:here:account::org:app/first-app-id has trusted domain http://example.comList 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.propertiesolp app key access create hrn:here:account::org:app/manager-app-id 1> app-manager-credentials.propertiesThe 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 --jsonThe 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" \
--jsonolp app update hrn:here:account::org:app/first-app-id ^
--credentials app-manager-credentials.properties ^
--description "Updated description for the first app" ^
--jsonThe 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-idolp 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-idis 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 deletedRemove 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-idThe command displays the following results.
App hrn:here:account::org:app/manager-app-id has been removed as a managerDelete 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.comThe command displays the following results.
Trusted domain 'http://example.com' deleted from app hrn:here:account::org:app/first-app-idTo 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/fileThe command displays the following results.
Trusted domains deleted from app hrn:here:account::org:app/first-app-idDelete 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-idThe 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 deletedTo get a full list of available commands, enter olp app --help.
Updated 22 days ago