project resource
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>. For example:catalog,pipeline,pipeline-template,schema,artifact,flow,flow-pattern,service.--relation <home|reference>The relation of resources to the project.homedenotes a resource located within a project whilereferencedenotes 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 theolpcli.inifile.--jsonDisplays the command result in JSON format.--quietDisplays 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 --jsonOutput:
{
"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
}
]
}
]
}
NoteThe 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. Schema HRN may or may not contain a version number which will not affect the command result.--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 theolp project resource availability listcommand 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 theolpcli.inifile.--quietDisplays 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 --jsonolp project resource link hrn:here:authorization::org:project/my-project-0000 ^
hrn:here:data::org:my-catalog --jsonOutput:
{
"resource": "hrn:here:data::org:my-catalog",
"project": "hrn:here:authorization::org:project/my-project-0000",
"type": "catalog",
"relation": "reference"
}Example:
To link a sub-resource list to a project an external ID should be provided.
olp project resource link hrn:here:authorization::org:project/my-project-0000 \
hrn:here:data::org:my-catalog --external-id A-S0001234 --jsonolp project resource link hrn:here:authorization::org:project/my-project-0000 ^
hrn:here:data::org:my-catalog --external-id A-S0001234 --jsonOutput:
{
"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"
]
}Example:
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.
olp project resource link hrn:here:authorization::org:project/my-project-0000 \
hrn:here:data::org:my-catalog \
--actions readResource writeResource --jsonolp project resource link hrn:here:authorization::org:project/my-project-0000 ^
hrn:here:data::org:my-catalog ^
--actions readResource writeResource --jsonOutput:
{
"resource": "hrn:here:data::org:my-catalog",
"project": "hrn:here:authorization::org:project/my-project-0000",
"type": "catalog",
"relation": "reference",
"allowedActions": [
"readResource",
"writeResource"
]
}Example:
The following command is an example for linking a pipeline template to a project.
olp project resource link hrn:here:authorization::org/link-test-b hrn:here:pipeline-template::org:<template UUID>
--actions readolp project resource link hrn:here:authorization::org/link-test-b hrn:here:pipeline-template::org:<template UUID>
--actions readOutput:
Project resource hrn:here:pipeline-template::org:<template UUID> has been linkedproject 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 theolpcli.inifile.--quietDisplays 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-catalogolp project resource unlink hrn:here:authorization::org:project/my-project-0000 ^
hrn:here:data::org:my-catalogOutput:
Resource hrn:here:data::org:my-catalog has been unlinked from project hrn:here:authorization::org:project/my-project-0000Example:
olp project resource unlink hrn:here:authorization::org:project/my-project-0000 \
hrn:here:data::org:my-catalog --external-id A-S0001234olp project resource unlink hrn:here:authorization::org:project/my-project-0000 ^
hrn:here:data::org:my-catalog --external-id A-S0001234Output:
Subresource list A-S0001234 of resource hrn:here:data::org:my-catalog has been unlinked from project hrn:here:authorization::org:project/my-project-0000Updated 21 days ago