アプリ ワークフロー

HERE platform では、アプリを作成して他のアプリで管理できます。

アプリは、 REST API 、 CLI 、またはプラットフォームライブラリのいずれかを介して、プラットフォームのデータまたはパイプラインにアクセスします。

プラットフォームを使用してアプリケーションを簡単かつ安全に認証するには、アプリごとに 2 つの資格情報セットを定義します。

  • アクセスキー
  • API キー (Web ベースのアプリに推奨 )

アプリ管理者は、アプリの有効化または無効化、他のユーザー、アプリ、グループへのアプリ管理者のアクセス権の付与、アプリ資格情報の制御などを行うことができます。

アプリの詳細 については、「アプリの管理」を参照してください。

OLP CLI には、次のようなアプリを管理するためのツールがあります。

詳細については 、「アプリ コマンド」を参照してください。

新しいアプリ を作成します

OLP CLI を使用してアプリを作成および管理するには、まずアプリに新しいアプリの作成を許可します。

  • HERE platform で、 [ アプリ ] セクションに移動し、アプリを選択して [ 詳細 ] をクリックし、 [ アプリ作成を有効にする ] ボタンをクリックします。

次の手順に従って、 2 つのアプリを作成します。

  1. olp app create コマンドを実行して、最初のアプリ を作成します。

    olp app create firstApp
    
  2. の管理者権限を付与する別のアプリを作成 firstAppします。

    olp app create managerApp
    

    アプリが正常に作成されたことを確認するに olp app list は、コマンドを使用します。

    olp app list
    

    コマンドを実行すると、次の結果が表示されます。

    
        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
        

    org は、組織の ID のプレースホルダーです。

    以下を使用するには、これらの HRNS を保存してください。

アプリ に関する情報を表示します

アプリ についての情報を取得するには、を使用 olp app showします。


olp app show hrn:here:account::org:app/manager-app-id

コマンドを実行すると、次の結果が表示されます。


ID                       manager-app-id
name                     managerApp
description
HRN                      hrn:here:account::org:app/manager-app-id
app creation             disabled
trusted domains          disabled
status                   active

以下 ID を使用するには保存してください。

アプリ にマネージャを追加します

managerAppfirstAppの管理を許可するolp app manager addコマンドを実行 します。


olp app manager add hrn:here:account::org:app/first-app-id --app manager-app-id

manager-app-id は、前のステップで保存した ID です。

コマンドを実行すると、次の結果が表示されます。


Granted manager access for the app manager-app-id to the application hrn:here:account::org:app/first-app-id

アプリ にドメインを追加します

ドメインを追加するには olp app domain add 、コマンドを使用します。


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

複数のドメインを追加するに は、olp app domain addコマンドに--domain-listパラメーターを付けて使用します。 このファイル file.csv には、次の情報が含まれています。

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

アプリ ドメイン情報を表示します

olp app domain show コマンドを実行します。


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

アプリ ドメイン情報を一覧表示します

olp app domain list コマンドを実行します。


olp app domain list hrn:here:account::org:app/first-app-id --json


{"trustedDomains": [
"http://example.com",
"anotherexample.com"
]}

アプリ のアクセスキーを作成します

このワークフローでさらに使用されるアプリ のアクセスキーを作成するに olp app access key create は、コマンドを使用します。

Linux
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

アプリ資格情報は app-manager-credentials.properties ファイルに保存されます。

アクセスキーに関する情報を表示します

アクセスキーに関する情報を取得するには olp access key list 、コマンドを使用します。


olp app key access list hrn:here:account::org:app/manager-app-id --json

コマンドを実行すると、次の結果が表示されます。


{"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
}]}

以下 accessKeyHrn を使用するには保存してください。

アクセスキーを使用してアプリ を更新します

アプリの詳細を更新するに app-manager-credentials.properties は、前の章のファイルを指定します。

次のコマンドは、マネージャのアプリを使用してアプリの説明を変更する方法を示しています。 更新内容をただちに確認 --json するには、フラグを使用します。

Linux
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

コマンドを実行すると、次の結果が表示されます。


{
    "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"
}

アクセスキーを削除します

上記で作成したアクセスキーを削除するには olp access key remove 、コマンドを使用します。

Linux
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

hrn:here:account::org:accesskey/access-key-id は、前のステップで保存したアクセスキー HERE リソースネーム です。

コマンドを実行すると、次の結果が表示されます。


Access key hrn:here:account::org:accesskey/access-key-id has been deleted

アプリ マネージャを削除します

アプリ からマネージャを削除するには olp app manager remove 、コマンドを使用します。


olp app manager remove hrn:here:account::org:app/first-app-id --app manager-app-id

コマンドを実行すると、次の結果が表示されます。


App hrn:here:account::org:app/manager-app-id has been removed as a manager

アプリ ドメインを削除します

アプリ からドメインを削除するに は、--domain <domain name>パラメータを指定してolp app domain deleteコマンドを使用します。


olp app domain delete hrn:here:account::org:app/first-app-id --domain http://example.com

コマンドを実行すると、次の結果が表示されます。


Trusted domain 'http://example.com' deleted from app hrn:here:account::org:app/first-app-id

アプリ から多数のドメインを削除するに は、--domain-list <path to file>パラメータを指定してolp app domain deleteコマンドを使用します。


olp app domain delete hrn:here:account::org:app/first-app-id --domain-list path/to/file

コマンドを実行すると、次の結果が表示されます。


Trusted domains deleted from app hrn:here:account::org:app/first-app-id

アプリ を削除します

アプリ を削除するには olp app delete 、コマンドを使用します。


olp app delete hrn:here:account::org:app/manager-app-id
olp app delete hrn:here:account::org:app/first-app-id

コマンドを実行すると、次の結果が表示されます。


Application hrn:here:account::org:app/manager-app-id has been deleted
Application hrn:here:account::org:app/first-app-id has been deleted

使用可能なコマンドの完全なリストを取得するには、を入力 olp app --helpします。

」に一致する結果は 件です

    」に一致する結果はありません