project resource
The OLP CLI supports the following:
- list all resources and subresources in a project
- link a resource or a subresource list to a project
- unlink a resource or a subresource list from a project
project resource list
Retrieves all resources and subresources that are in a project.
olp project resource list <project HRN> [command options]
Required parameters:
-
<project HRN>
The HRN of the project.
Optional parameters:
-
--type <resource type>
Type of resource to be listed for the specified <project HRN>
. Acceptable values: catalog
,pipeline
,pipeline-template
,schema
,artifact
,flow
,flow-pattern
,service
. -
--relation <home|reference>
The relation of resources to the project. home
denotes a resource located within a project while reference
denotes a resource linked to the project. -
--limit <max number of entities>
Specifies the maximum number of entities returned in the result (500 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 resources' HRNs, each on a new line.
For more information on using credentials and profiles, see Credentials setup.
Example:
olp project resource list hrn:here:authorization::org:project/my-project-0000 --json
Output:
{
"resources": [
{
"resource": "hrn:here:pipeline::org:ae7397ea-38fb-4b96-831c-b89a4ec28bc2",
"project": "hrn:here:authorization::org:project/my-project-0000",
"type": "pipeline",
"relation": "home"
},
{
"resource": "hrn:here:data::org:my-catalog",
"project": "hrn:here:authorization::org:project/my-project-0000",
"type": "catalog",
"relation": "reference",
"allowedActions": [
"readResource",
"writeResource"
],
"active": true,
"linkedOptions": [
{
"allowedActions": [
"readResource"
"writeResource"
],
"active": true
},
{
"externalId": "A-S0001234",
"allowedActions": [
"readResource"
],
"subresources": [
"USA-IL-CHICAGO",
"DEU"
],
"active": true
}
]
}
]
}
Note
The parameter “active” indicates whether or not the link to the resource in that project is active or not. A resource in a project where active is “true” is one that can be used in the project. A resource in a project where active is “false” means that a link to this resource was created in the project at some point but is no longer active, for example, because the subscription that included access to that resource has been cancelled. In this example, the resource is reactivated automatically if your organization renews or subscribes to a different plan that includes this same resource and you wish to use it in this project.
project resource link
Links a resource or a subresource to a project.
olp project resource link <project HRN> <resource HRN> --actions <list> [command options]
Required parameters:
-
<project HRN>
The HRN of the project. -
<resource HRN>
The HRN of the resource, where the resource is either a schema, catalog, pipeline template or service. -
--actions <list>
A space-separated list of allowed actions with which you want to link this resource to your project. Note: this command is optional for HERE-provided catalogs and services. Use the olp project resource availability list
command for your specified resource type to find out allowed actions for the resource you are linking.
Optional parameters:
-
--external-id <external identifier>
The external identifier of a subresource list, typically, a subscription identifier. -
--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:
olp project resource link hrn:here:authorization::org:project/my-project-0000 \
hrn:here:data::org:my-catalog --json
olp project resource link hrn:here:authorization::org:project/my-project-0000 ^
hrn:here:data::org:my-catalog --json
Output:
{
"resource": "hrn:here:data::org:my-catalog",
"project": "hrn:here:authorization::org:project/my-project-0000",
"type": "catalog",
"relation": "reference"
}
To link a sub-resource list to a project an external ID should be provided.
Example:
olp project resource link hrn:here:authorization::org:project/my-project-0000 \
hrn:here:data::org:my-catalog --external-id A-S0001234 --json
olp project resource link hrn:here:authorization::org:project/my-project-0000 ^
hrn:here:data::org:my-catalog --external-id A-S0001234 --json
Output:
{
"resource": "hrn:here:data::org:my-catalog",
"project": "hrn:here:authorization::org:project/my-project-0000",
"type": "catalog",
"relation": "reference"
"externalId": "A-S0001234",
"subresources": [
"USA-IL-CHICAGO",
"DEU"
]
}
For using --actions
, the resource must be made available for linking first. When a resource is made available for linking, actions are also specified while making it available for linking. --actions
specified here has to be one or all of the actions available for the resource which has been made available for linking.
For more information on using link availability, see the olp project resource availability list
command.
Example:
olp project resource link hrn:here:authorization::org:project/my-project-0000 \
hrn:here:data::org:my-catalog \
--actions readResource writeResource --json
olp project resource link hrn:here:authorization::org:project/my-project-0000 ^
hrn:here:data::org:my-catalog ^
--actions readResource writeResource --json
Output:
{
"resource": "hrn:here:data::org:my-catalog",
"project": "hrn:here:authorization::org:project/my-project-0000",
"type": "catalog",
"relation": "reference",
"allowedActions": [
"readResource",
"writeResource"
]
}
The following is an example for linking a pipeline template to a project
Example:
olp project resource link hrn:here:authorization::org/link-test-b hrn:here:pipeline-template::org:<template UUID>
--actions read
olp project resource link hrn:here:authorization::org/link-test-b hrn:here:pipeline-template::org:<template UUID>
--actions read
Output:
Project resource hrn:here:pipeline-template::org: has been linked
project resource unlink
Unlinks a resource or a subresource list from a project.
olp project resource unlink <project HRN> <resource HRN> [command options]
Required parameters:
-
<project HRN>
The HRN of the project. -
<resource HRN>
The HRN of the resource.
Optional parameters:
-
--external-id <external identifier>
The external identifier of a subresource list, typically, a subscription identifier. -
--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:
olp project resource unlink hrn:here:authorization::org:project/my-project-0000 \
hrn:here:data::org:my-catalog
olp project resource unlink hrn:here:authorization::org:project/my-project-0000 ^
hrn:here:data::org:my-catalog
Output:
Resource hrn:here:data::org:my-catalog has been unlinked from project hrn:here:authorization::org:project/my-project-0000
Example:
olp project resource unlink hrn:here:authorization::org:project/my-project-0000 \
hrn:here:data::org:my-catalog --external-id A-S0001234
olp project resource unlink hrn:here:authorization::org:project/my-project-0000 ^
hrn:here:data::org:my-catalog --external-id A-S0001234
Output:
Subresource list A-S0001234 of resource hrn:here:data::org:my-catalog has been unlinked from project hrn:here:authorization::org:project/my-project-0000