schema

The OLP CLI supports the following:

schema list

Lists all schemas you can access.

olp schema list [filter] [command options]

Optional parameters:

  • [filter] Freeform text used to filter the schema list. The filter checks if the schema's HRN, name or summary contains the filter string. If the filter string contains an HRN without a realm, OLP CLI will also return schemas that contain the realm in HRN.
  • --limit <max number of schemas> Specifies the maximum number of schemas returned. If not provided, all available schemas are returned.
  • --type <proto|json> Specifies the type of schemas returned. If omitted, all types are returned.
  • --only-layer-schema Indicates if the response should only return a list of layer schemas. If the value is set to false, the response will also include non-layer schemas, the default value is true. For more information about layer schema, see Publish Protobuf schema to the platform.
  • --credentials <path to credentials file> The name of a credentials file to use with the command. Credentials files are downloaded separately from the 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 the schema HRNs, each on a new line.
  • --scope <project HRN> Specifies the project HRN to use as the scope in the request. The value specified with --scope overrides any value for here.token.scope provided in the credentials file used for the command.

Example:

olp schema list "RIB 1.25.0 Topology" --json

Output:

The example below lists all the schemas to which you have access with the term RIB 1.25.0 Topology in the name or the summary field.


{"schemas": [{
    "summary": "Topology provides the representation of a topology network.",
    "hrn": "hrn:here-cn:schema::org:com.here.schema.rib:topology_v1:1.25.0",
    "created": "2018-04-19T05:11:09.523Z",
    "groupId": "com.here.schema.rib",
    "name": "RIB 1.25.0 Topology",
    "artifactId": "topology_v1",
    "updated": "2018-04-19T05:11:54.225Z",
    "version": "1.25.0"
}]}

schema show

Shows the details of the specified schema.

olp schema show <schema HRN> [command options]

Required parameters:

  • <schema HRN> The HRN of the schema.

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 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 the schema name.
  • --scope <project HRN> Specifies the project HRN to use as the scope in the request. The value specified with --scope overrides any value for here.token.scope provided in the credentials file used for the command.

For more information on using credentials and profiles, see Credentials setup.

Example:

The command below displays the details of the Sensor Data Ingestion Interface (SDII) schema in the JSON format.


olp schema show hrn:here-cn:schema::org:com.here.sdii:sdii_common_v3:3.3.8 --json

Output:


{
    "summary": "SDII schemas made available through HERE platform are Open Standard Schema specifications.
    Sensor Data Ingestion Interface (SDII) is a vehicle based, sensor data format for the
    transmission of data between a vehicle and the Cloud. This data format consists of events (for example,
    vehicle position, sign recognition, object detection) where an event might be built from one or
    more attributes (for example, lat/lon and altitude of a vehicle). All events include a time stamp based
    on the actual event time. Each position of a vehicle is also provided with a timestamp. Events
    can be related to positions by corresponding event and position time stamps.\nSDII Schema,
    Common: contains definitions of events and attributes of a message. SDII Schema, Message: is a
    container as a delivery package which consists of SDII Schema, Common. SDII Schema, Message
    List: is a container for multiple individual SDII Schema, Messages enabling you to send
    multiple messages within a single Protobuf container thereby optimizing your data
    transmission.",
    "schemaValidationResults": [{
        "fileExtension": true,
        "module": "proto",
        "packageConsistency": false,
        "backwardsCompatibility": true,
        "googleStyle": false,
        "majorVersionInPackage": true
    }],
    "hrn": "hrn:here-cn:schema::org:com.here.sdii:sdii_common_v3:3.3.8",
    "created": "2019-04-11T18:57:04.828Z",
    "groupId": "com.here.sdii",
    "name": "SDII v3 Schema, Common",
    "artifactId": "sdii_common_v3",
    "type": "proto",
    "updated": "2019-05-06T11:26:17.734Z",
    "version": "3.3.8",
    "variants": [{
        "id": "doc",
        "url": "https://openlocation.here.com/file/2136/download?token=7ZxUMafg"
    }],
    "artifacts": [
        {
            "hrn": "hrn:here:artifact::org:com.here.sdii:sdii_common_v3_java:3.3.8",
            "created": "2019-04-11T18:57:22.204Z",
            "groupId": "com.here.sdii",
            "artifactId": "sdii_common_v3_java",
            "version": "3.3.8",
            "updated": "2019-04-11T18:57:22.204Z"
        },
        {
            "hrn": "hrn:here:artifact::org:com.here.sdii:sdii_common_v3_proto:3.3.8",
            "created": "2019-04-11T18:57:10.456Z",
            "groupId": "com.here.sdii",
            "artifactId": "sdii_common_v3_proto",
            "version": "3.3.8",
            "updated": "2019-04-11T18:57:10.456Z"
        },
        {
            "hrn": "hrn:here:artifact::org:com.here.sdii:sdii_common_v3_scala:3.3.8",
            "created": "2019-04-11T18:58:16.060Z",
            "groupId": "com.here.sdii",
            "artifactId": "sdii_common_v3_scala",
            "version": "3.3.8",
            "updated": "2019-04-11T18:58:16.060Z"
        }
    ]
}

schema delete

Deletes a schema by the schema HRN.

olp schema delete <schema HRN> [command options]

Required parameters:

  • <schema HRN> The HRN of the schema. HRN may be used without a version

Optional parameters:

  • --force Forces the schema to be deleted even if it is linked to a project or forces deletion of all existing versions if no version is specified in HRN
  • --credentials <path to credentials file> The name of a credentials file to use with the command. Credentials files are downloaded separately from the 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.
  • --scope <project HRN> Specifies the project HRN to use as the scope in the request. The value specified with --scope overrides any value for here.token.scope provided in the credentials file used for the command.

Note

Marked Ready for Marketplace

Schemas associated with a catalog marked Ready for Marketplace cannot be deleted.

Example:

The command below deletes a schema with the hrn:here-cn:schema::org:com.here.example:test_schema_v1:1.0.0 HRN from the platform.


olp schema delete hrn:here-cn:schema::org:com.here.example:test_schema_v1:1.0.0

Note that the hrn:here-cn:schema::org:com.here.example:test_schema_v1:1.0.0 schema HRN in the example above serves as a placeholder where you should pass the HRN of your own schema.

schema get

Downloads the specified schema package.

olp schema get <schema HRN> [command options]

Required parameters:

  • <schema HRN> The HRN of the schema.

Optional parameters:

  • --output <path to dir> The output directory to store the downloaded schema ZIP package. If not specified, the current directory is used by default.
  • --credentials <path to credentials file> The name of a credentials file to use with the command. Credentials files are downloaded separately from the 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 the absolute path to the downloaded schema package.
  • --scope <project HRN> Specifies the project HRN to use as the scope in the request. The value specified with --scope overrides any value for here.token.scope provided in the credentials file used for the command.

For more information on using credentials and profiles, see Credentials setup.

Example:

The command below downloads the schema package with the hrn:here-cn:schema::org:com.here.example:test_schema_v1:1.0.0 HRN from the platform.


olp schema get hrn:here-cn:schema::org:com.here.example:test_schema_v1:1.0.0

Note that the hrn:here-cn:schema::org:com.here.example:test_schema_v1:1.0.0 schema HRN in the example above serves as a placeholder where you should pass the HRN of your own schema.

schema permission list

List the permissions of users, apps, and groups across all organizations associated with a schema.

olp schema permission list <schema HRN> [command options]

Required parameters:

  • <schema HRN> The HRN of the schema.

Optional parameters:

  • --type <app|group|user> Specifies the type of entity to list.
  • --limit <max number of entities> Specifies the maximum number of entities to be returned in the result (100 by default).
  • --credentials <path to credentials file> The name of a credentials file to use with the command. Credentials files are downloaded separately from the 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 the entities' HRNs, each on a new line.

For more information on using credentials and profiles, see Credentials setup.

Example:

Linux
Windows
olp schema permission list hrn:here-cn:schema::org:com.here.example:test_schema_v1:* \
--json
olp catalog permission list hrn:here-cn:schema::org:com.here.example:test_schema_v1:* ^
--json

Output:


{"entityGrants": [
{
"entityId": {
"id": "HERE-05966c89-aaf1-4ae2-b0e4-3676b3f8b8c3",
"hrn": "hrn:here-cn:account::org:user/HERE-05966c89-aaf1-4ae2-b0e4-3676b3f8b8c3",
"realmHrn": "hrn:here-cn:account::org:realm/org",
"type": "user"
},
"permissions": [
{
"id": "PERM-7heTYzsR05VR_p3IeyaZKDdlVPb1zJJUmzLI9JUEDcc",
"action": "read",
"effect": "allow",
"resource": "hrn:here-cn:schema::org:com.here.example:test_schema_v1:1.0.0",
"serviceId": "SERVICE-b9acbead-4666-487e-88b0-cfb64ed0ac6a"
},
{
"id": "PERM-7heTYzsR0RV5_p3IeyaZKDdlVPb1zJJUmzLI9JUDEbb",
"action": "write",
"effect": "allow",
"resource": "hrn:here-cn:schema::org:com.here.example:test_schema_v1:1.0.0",
"serviceId": "SERVICE-b9acbead-4666-487e-88b0-cfb64ed0ac6a"
}
]
},
{
"entityId": {
"id": "my-app-1234",
"hrn": "hrn:here-cn:account::org2:app/my-app-1234",
"realmHrn": "hrn:here-cn:account::org2:realm/org2",
"type": "app"
},
"permissions": [
{
"id": "PERM-7heTYzsR05VR_p3IeyaZKDdlVPb1zJJUmzKJ9JUECdd",
"action": "manage",
"effect": "allow",
"resource": "hrn:here-cn:schema::org:com.here.example:test_schema_v1:1.0.0",
"serviceId": "SERVICE-b9acbead-4666-487e-88b0-cfb64ed0ac6a"
}
]
}
]
}

schema permission grant

Grants permission to perform selected actions on a schema.

olp schema permission grant <schema HRN> [command options]

Required parameters:

  • <schema HRN> The HRN of the schema.
  • Either of the following recipients:
    • --group <groupID1 groupID2 ...> The list of group IDs you want to grant schema access to, separated by space.
    • --user <userID1 userID2 ...> The list of user IDs you want to grant schema access to, separated by space. This information can be found in the .here/credentials.properties file, in the user's home directory, or via your profile.
    • --app <appID1 appID2 ...> The list of application IDs you want to grant schema access to, separated by space.
  • Either of the following permissions:
    • --read Grants read access to a schema.
    • --modify Grants modify access to a schema.
    • --share Grants share access to a schema.

Note

You must specify at least one --read, --modify, or --share parameter for a corresponding --group, --user, or --app.

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 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.

Note

The command is only applicable to schemas created outside of a project.

For more information on using credentials and profiles, see Credentials setup.

Example:

Linux
Windows
olp schema permission grant hrn:here-cn:schema::org:com.here.example:test_schema_v1:1.0.0 \
   --group GROUP-example-group-id --read --modify
olp schema permission grant hrn:here-cn:schema::org:com.here.example:test_schema_v1:1.0.0 ^
   --group GROUP-example-group-id --read --modify

Note that the hrn:here-cn:schema::org:com.here.example:test_schema_v1:1.0.0 schema HRN in the example above serves as a placeholder where you should pass the HRN of your own schema.

schema permission revoke

Revokes permissions to perform all actions on a schema.

olp schema permission revoke <schema HRN> [command options]

Required parameters:

  • <schema HRN> The HRN of the schema.
  • Either of the following recipients:
    • --app <appID1 appID2 ...> The list of application IDs you want to revoke schema access from, separated by space.
    • --user <userID1 userID2 ...> The list of user IDs you want to revoke schema access from, separated by space. This information can be found in the .here/credentials.properties file, in the user's home directory, or via your profile.
    • --group <groupID1 groupID2 ...> The list of group IDs you want to revoke schema access from, separated by space.
  • Either of the following permissions:
    • --read Revokes read access to a schema.
    • --modify Revokes modify access to a schema.
    • --share Revokes share access to a schema.

Note

You must specify at least one --read, --modify, or --share parameter for a corresponding --group, --user, or --app.

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 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.

Note

The following command is only applicable to schemas created outside of a project.

For more information on using credentials and profiles, see Credentials setup.

Example:

Linux
Windows
olp schema permission revoke hrn:here-cn:schema::org:com.here.example:test_schema_v1:1.0.0 \
   --group GROUP-example-group-id --read --modify --share
olp schema permission revoke hrn:here-cn:schema::org:com.here.example:test_schema_v1:1.0.0 ^
   --group GROUP-example-group-id --read --modify --share

Response:


Revoked read, modify, share access for a group GROUP-example-group-id to the schema hrn:here-cn:schema::org:com.here.example:test_schema_v1:1.0.0

Note that the hrn:here-cn:schema::org:com.here.example:test_schema_v1:1.0.0 schema HRN in the example above serves as a placeholder where you should pass the HRN of your own schema.

schema generate

Generates a new schema for the Maven project.

olp schema generate <group ID> <artifact ID> [command parameters]

Required parameters:

  • <group ID> The group ID for the schema.
  • <artifact ID> The artifact ID of the root artifact.

Optional parameters:

  • --archetype-version <archetype version> The version of the schema archetype to be used to generate the schema. The latest version is set by default.
  • --description <schema description> Summary description of the schema. Value from the artifact is set by default.
  • --documentation <URL|path to documentation file> The URL to the documentation or path to a Markdown file.
  • --layer-schema <true|false> Set this to false if the schema is meant only for use as a component of other schemas. The default value is true.
  • --major-version <major version> The major version to be used as a suffix for the artifact ID of the schema. If not provided, version 1 is used.
  • --mvn-options <Maven options> Maven options provided as a string. No Maven options are provided by default.
  • --mvn-output The parameter showing whether the redirect of the output from Maven to the console is set up. The default value is false.
  • --name <schema name> The name of the schema. The value from the archetype is set by default.
  • --output <path to output directory> The path to the store with the generated schema source code. The current directory is used by default.
  • --source <path to directory or file> The path to the folder or file with the schema message.
  • --type <proto|json> Specifies the type of schema to generate. The default value is json.
  • --version <version> Specifies the version of schema to generate. The default value is 1.0.0.
  • --credentials <path to credentials file> The name of a credentials file to use. with the command. Credentials files are downloaded separately from the platform portal.
  • --profile <profile name> The name of the credentials profile to use from the olpcli.ini file.
  • --quiet Displays the folder where the schema was generated.

For more information on using credentials and profiles, see Credentials setup.

Example:

The command below generates a schema with the com.here.test group and the test_schema artifact ID.


olp schema generate com.here.test test_schema

Output:


Schema has been successfully generated in /home/user/test_schema

schema package

Validate and builds a generated schema project.

olp schema package [command parameters]

Optional parameters:

  • --input <path to input directory> The path to the storage of the generated schema source code. The current directory is used by default.
  • --mvn-options <Maven options> Maven options provided as a string. No Maven options are provided by default.
  • --mvn-output The parameter showing whether the redirect of the output from Maven to the console is set up. The default value is false.
  • --credentials <path to credentials file> The name of a credentials file to use. with the command. Credentials files are downloaded separately from the 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 build generated schema project located in the ~/Desktop/test_schema/ folder.


olp schema package --input `~/Desktop/test_schema/`

Output:


Schema has been packaged successfully

schema put

Validate and uploads a schema to the platform.

olp schema put [command parameters]

Optional parameters:

  • --input <path to schema directory> The directory of the generated schema. If this parameter is not used, the default directory is set as the current directory.
  • --mvn-options <Maven options> Maven options provided as a string. No Maven options are provided by default.
  • --mvn-output The parameter showing whether the redirect of the output from Maven to the console is set up. The default value is false.
  • --credentials <path to credentials file> The name of a credentials file to use. with the command. Credentials files are downloaded separately from the platform portal.
  • --profile <profile name> The name of the credentials profile to use from the olpcli.ini file.
  • --quiet Displays the folder where the schema was generated.
  • --scope <project HRN> Specifies the project HRN to use as the scope in the request. The value specified with --scope overrides any value for here.token.scope provided in the credentials file used for the command.

For more information on using credentials and profiles, see Credentials setup.

Example:

The command below uploads the schema generated in directory /home/user/test_schema.


olp schema put --input=/home/user/test_schema

Output:


Schema hrn:here-cn:schema::org:com.here.test:test_schema_v1:1.0.0 has been created
For more information, use the 'olp schema show' command

results matching ""

    No results matching ""