app key api
The OLP CLI supports the following functionality for application API key management:
app key api list
Retrieves API keys of an application.
olp app key api list <app HRN> [command options]
Required parameters:
-
<app HRN>
The HRN of the application.
Optional parameters:
-
--enabled <true|false>
If set to true
, filters by enabled API keys. If not specified all keys are returned. -
--credentials <path to credentials file>
The name of a credentials file to use with the command. Credentials files are downloaded separately from the HERE platform portal. -
--profile <profile name>
The name of the credentials profile to use from the olpcli.ini
file. -
--json
Displays the command result in JSON format. -
--quiet
Displays a list of keys with no additional information.
For more information on using credentials and profiles, see Credentials setup.
Example:
The command below lists API keys of the application:
olp app key api list hrn:here:account::org:app/my-app-1234 --json
Output:
{"keys": [{
"apiKey": "hrn:here:account::org:apikey/my-api-key-1234",
"identity": "hrn:here:account::org:app/my-app-1234",
"name": "API key example",
"apiKeyId": "my-api-key-1234",
"createdTime": 1591012921491,
"realm": "hrn:here:account::org:realm/org",
"enabled": true,
"expiresAt": -1
}]}
app key api create
Creates an API key of an application.
olp app key api create <app HRN> <key name> [command options]
Required parameters:
-
<app HRN>
The HRN of the application. -
<key name>
The name of the application API key.
Optional parameters:
-
--expires-at <yyyy-MM-ddTHH:mm:ss>
The expiration date of a key. The timestamp must match the ISO-8601 format yyyy-MM-ddTHH:mm:ss, but only yyyy is mandatory. If not specified, the key doesn't expire. -
--credentials <path to credentials file>
The name of a credentials file to use with the command. Credentials files are downloaded separately from the HERE platform portal. -
--profile <profile name>
The name of the credentials profile to use from the olpcli.ini
file. -
--json
Displays the command result in JSON format. -
--quiet
Displays empty output with no additional information.
For more information on using credentials and profiles, see Credentials setup.
Example:
The command below creates an application API key:
olp app key api create hrn:here:account::org:app/my-app-1234 api-key-name
Output:
API key hrn:here:account::org:apikey/my-apikey-1234 has been created
app key api update
Updates an API key of an application.
olp app key api update <app HRN> <API key HRN> [command options]
Required parameters:
-
<app HRN>
The HRN of the application. -
<API key HRN>
The HRN of the application API key. - Either of the following parameters:
-
--name <key name>
The name of the application API key. -
--expires-at <yyyy-MM-ddTHH:mm:ss>
The expiration date of a key. The timestamp must match the ISO-8601 format yyyy-MM-ddTHH:mm:ss, but only yyyy is mandatory. If none
is specified the key doesn't expire.
Optional parameters:
-
--credentials <path to credentials file>
The name of a credentials file to use with the command. Credentials files are downloaded separately from the HERE platform portal. -
--profile <profile name>
The name of the credentials profile to use from the olpcli.ini
file. -
--json
Displays the command result in JSON format. -
--quiet
Displays empty output with no additional information.
For more information on using credentials and profiles, see Credentials setup.
Example:
The command below updates the name of an application API key:
olp app key api update hrn:here:account::org:app/my-app-1234 hrn:here:account::org:apikey/my-apikey-1234 --name api-key-name
Output:
API key hrn:here:account::org:apikey/my-apikey-1234 has been updated
app key api delete
Deletes an API key of an application.
olp app key api delete <app HRN> <API key HRN> [command options]
Required parameters:
-
<app HRN>
The HRN of the application. -
<API key HRN>
The HRN of the application API key.
Optional parameters:
-
--credentials <path to credentials file>
The name of a credentials file to use with the command. Credentials files are downloaded separately from the HERE platform portal. -
--profile <profile name>
The name of the credentials profile to use from the olpcli.ini
file. -
--quiet
Displays empty output with no additional information.
For more information on using credentials and profiles, see Credentials setup.
Example:
The command below deletes an application API key:
olp app key api delete hrn:here:account::org:app/my-app-1234 hrn:here:account::org:apikey/my-apikey-1234
Output:
API key hrn:here:account::org:apikey/my-apikey-1234 has been deleted
app key api enable
Enables an API key of an application.
olp app key api enable <app HRN> <API key HRN> [command options]
Required parameters:
-
<app HRN>
The HRN of the application. -
<API key HRN>
The HRN of the application API key.
Optional parameters:
-
--credentials <path to credentials file>
The name of a credentials file to use with the command. Credentials files are downloaded separately from the HERE platform portal. -
--profile <profile name>
The name of the credentials profile to use from the olpcli.ini
file. -
--quiet
Displays empty output with no additional information.
For more information on using credentials and profiles, see Credentials setup.
Example:
The command below enables an application API key:
olp app key api enable hrn:here:account::org:app/my-app-1234 hrn:here:account::org:apikey/my-apikey-1234
Output:
API key hrn:here:account::org:apikey/my-apikey-1234 has been enabled
app key api disable
Disables an API key of an application.
olp app key api disable <app HRN> <API key HRN> [command options]
Required parameters:
-
<app HRN>
The HRN of the application. -
<API key HRN>
The HRN of the application API key.
Optional parameters:
-
--credentials <path to credentials file>
The name of a credentials file to use with the command. Credentials files are downloaded separately from the HERE platform portal. -
--profile <profile name>
The name of the credentials profile to use from the olpcli.ini
file. -
--quiet
Displays empty output with no additional information.
For more information on using credentials and profiles, see Credentials setup.
Example:
The command below disables an application API key:
olp app key api disable hrn:here:account::org:app/my-app-1234 hrn:here:account::org:apikey/my-apikey-1234
Output:
API key hrn:here:account::org:apikey/my-apikey-1234 has been disabled