app key api
app key api
The OLP CLI supports the following functionality for application API key management:
- list API keys
- create an API key
- update an API key
- delete an API key
- enable an API key
- disable an API key
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 totrue, 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 theolpcli.inifile.--jsonDisplays the command result in JSON format.--quietDisplays 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 --jsonOutput:
{"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 theolpcli.inifile.--jsonDisplays the command result in JSON format.--quietDisplays 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-nameOutput:
API key hrn:here:account::org:apikey/my-apikey-1234 has been createdapp 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. Ifnoneis 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 theolpcli.inifile.--jsonDisplays the command result in JSON format.--quietDisplays 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-nameOutput:
API key hrn:here:account::org:apikey/my-apikey-1234 has been updatedapp 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 theolpcli.inifile.--quietDisplays 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-1234Output:
API key hrn:here:account::org:apikey/my-apikey-1234 has been deletedapp 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 theolpcli.inifile.--quietDisplays 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-1234Output:
API key hrn:here:account::org:apikey/my-apikey-1234 has been enabledapp 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 theolpcli.inifile.--quietDisplays 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-1234Output:
API key hrn:here:account::org:apikey/my-apikey-1234 has been disabledUpdated 22 days ago