schema
schema
The OLP CLI supports the following:
- list all visible schemas
- show a schema
- delete a schema
- get a schema package
- list permissions on a schema across all organizations
- grant permissions on a schema
- revoke permissions on a schema
- generate a schema
- package a schema
- put a schema
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 thefilterstring. If thefilterstring 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-schemaIndicates if the response should only return a list of layer schemas. If the value is set tofalse, the response will also include non-layer schemas, the default value istrue. 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 theolpcli.inifile.--jsonDisplays the command result in JSON format.--quietDisplays 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--scopeoverrides any value forhere.token.scopeprovided in the credentials file used for the command.
Example:
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.
olp schema list "RIB 1.25.0 Topology" --jsonOutput:
{"schemas": [{
"summary": "Topology provides the representation of a topology network.",
"hrn": "hrn:here: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 theolpcli.inifile.--jsonDisplays the command result in JSON format.--quietDisplays the schema name.--scope <project HRN>Specifies the project HRN to use as the scope in the request. The value specified with--scopeoverrides any value forhere.token.scopeprovided 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:schema::org:com.here.sdii:sdii_common_v3:3.3.8 --jsonOutput:
{
"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: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:
--forceForces 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 theolpcli.inifile.--quietDisplays 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--scopeoverrides any value forhere.token.scopeprovided in the credentials file used for the command.
Example:
The command below deletes a schema with the
hrn:here:schema::org:com.here.example:test_schema_v1:1.0.0
HRN from the platform.
olp schema delete hrn:here:schema::org:com.here.example:test_schema_v1:1.0.0Output:
Schema hrn:here:schema::org:com.here.example:test_schema_v1:1.0.0 has been removedNote that the hrn:here: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 theolpcli.inifile.--jsonDisplays the command result in JSON format.--quietDisplays 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--scopeoverrides any value forhere.token.scopeprovided 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:schema::org:com.here.example:test_schema_v1:1.0.0
HRN from the platform.
olp schema get hrn:here:schema::org:com.here.example:test_schema_v1:1.0.0Output:
Schema package was successfully downloaded to PATH/TO/CURRENT/DIRECTORY/test_schema_v1_ds-1.0.0.zipNote that the hrn:here: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 theolpcli.inifile.--jsonDisplays the command result in JSON format.--quietDisplays the entities' HRNs, each on a new line.
For more information on using credentials and profiles, see Credentials setup.
Example:
olp schema permission list hrn:here:schema::org:com.here.example:test_schema_v1:* \
--jsonolp catalog permission list hrn:here:schema::org:com.here.example:test_schema_v1:* ^
--jsonOutput:
{
"entityGrants" : [
{
"entityId" : {
"id" : "HERE-05966c89-aaf1-4ae2-b0e4-3676b3f8b8c3",
"hrn" : "hrn:here:account::org:user/HERE-05966c89-aaf1-4ae2-b0e4-3676b3f8b8c3",
"realmHrn" : "hrn:here:account::org:realm/org",
"type" : "user"
},
"permissions" : [
{
"id" : "PERM-7heTYzsR05VR_p3IeyaZKDdlVPb1zJJUmzLI9JUEDcc",
"action" : "read",
"effect" : "allow",
"resource" : "hrn:here: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: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:account::org2:app/my-app-1234",
"realmHrn" : "hrn:here:account::org2:realm/org2",
"type" : "app"
},
"permissions" : [
{
"id" : "PERM-7heTYzsR05VR_p3IeyaZKDdlVPb1zJJUmzKJ9JUECdd",
"action" : "manage",
"effect" : "allow",
"resource" : "hrn:here: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.propertiesfile, 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:
--readGrants read access to a schema.--modifyGrants modify access to a schema.--shareGrants share access to a schema.
NoteYou must specify at least one
--read,--modify, or--shareparameter 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 theolpcli.inifile.--quietDisplays empty output with no additional information.
NoteThe command is only applicable to schemas created outside of a project.
For more information on using credentials and profiles, see Credentials setup.
Example:
olp schema permission grant hrn:here:schema::org:com.here.example:test_schema_v1:1.0.0 \
--group GROUP-221718b7-926f-4a9c-940c-6a4a221002ff --read --modifyolp schema permission grant hrn:here:schema::org:com.here.example:test_schema_v1:1.0.0 ^
--group GROUP-221718b7-926f-4a9c-940c-6a4a221002ff --read --modifyOutput:
Granted read, modify access for a group GROUP-221718b7-926f-4a9c-940c-6a4a221002ff to the schema hrn:here:schema::org:com.here.example:test_schema_v1:1.0.0Note that the hrn:here: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.propertiesfile, 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:
--readRevokes read access to a schema.--modifyRevokes modify access to a schema.--shareRevokes share access to a schema.
NoteYou must specify at least one
--read,--modify, or--shareparameter 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 theolpcli.inifile.--quietDisplays empty output with no additional information.
NoteThe following command is only applicable to schemas created outside of a project.
For more information on using credentials and profiles, see Credentials setup.
Example:
olp schema permission revoke hrn:here:schema::org:com.here.example:test_schema_v1:1.0.0 \
--group GROUP-221718b7-926f-4a9c-940c-6a4a221002ff --read --modify --shareolp schema permission revoke hrn:here:schema::org:com.here.example:test_schema_v1:1.0.0 ^
--group GROUP-221718b7-926f-4a9c-940c-6a4a221002ff --read --modify --shareOutput:
Revoked read, modify, share access for a group GROUP-221718b7-926f-4a9c-940c-6a4a221002ff to the schema hrn:here:schema::org:com.here.example:test_schema_v1:1.0.0Note that the hrn:here: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 tofalseif the schema is meant only for use as a component of other schemas. The default value istrue.--major-version <major version>The major version to be used as a suffix for the artifact ID of the schema. If not provided, version1is used.--mvn-options <Maven options>Mavenoptions provided as a string. NoMavenoptions are provided by default.--mvn-outputThe parameter showing whether the redirect of the output fromMavento the console is set up. The default value isfalse.--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 isjson.--version <version>Specifies the version of schema to generate. The default value is1.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 theolpcli.inifile.--quietDisplays 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_schemaOutput:
Schema has been successfully generated in /home/user/test_schemaschema 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>Mavenoptions provided as a string. NoMavenoptions are provided by default.--mvn-outputThe parameter showing whether the redirect of the output fromMavento the console is set up. The default value isfalse.--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 theolpcli.inifile.--quietDisplays 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 successfullyschema 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>Mavenoptions provided as a string. NoMavenoptions are provided by default.--mvn-outputThe parameter showing whether the redirect of the output fromMavento the console is set up. The default value isfalse.--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 theolpcli.inifile.--quietDisplays 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--scopeoverrides any value forhere.token.scopeprovided 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_schemaOutput:
Schema hrn:here:schema::org:com.here.test:test_schema_v1:1.0.0 has been created
For more information, use the 'olp schema show' commandUpdated 22 days ago