project resource

The OLP CLI supports the following:

  • list all resources in a project
  • link a resource to a project
  • unlink a resource from a project

project resource list

Retrieves all resources 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 Display the command's result in JSON format.
  • --quiet Display 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::myrealm:project/my-project-0000 --json

Output:


{
  "resources": [
    {
      "resource": "hrn:here:pipeline:::ae7397ea-38fb-4b96-831c-b89a4ec28bc2",
      "project": "hrn:here:authorization::myrealm:project/my-project-0000",
      "type": "pipeline",
      "relation": "home"
    },
    {
      "resource": "hrn:here:data::myrealm:my-catalog",
      "project": "hrn:here:authorization::myrealm:project/my-project-0000",
      "type": "catalog",
      "relation": "reference",
      "allowedActions": [
        "readResource",
        "writeResource"
      ],
      "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.

Links a resource 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 you want to link this resource to your project with. 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:

  • --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 Display an empty output skipping additional information.

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

Example:

Linux
Windows
olp project resource link hrn:here:authorization::myrealm:project/my-project-0000 \
   hrn:here:data::myrealm:my-catalog --json
olp project resource link hrn:here:authorization::myrealm:project/my-project-0000 ^
   hrn:here:data::myrealm:my-catalog --json

Output:


{
  "resource": "hrn:here:data::myrealm:my-catalog",
  "project": "hrn:here:authorization::myrealm:project/my-project-0000",
  "type": "catalog",
  "relation": "reference"
}

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:

Linux
Windows
olp project resource link hrn:here:authorization::myrealm:project/my-project-0000 \
   hrn:here:data::myrealm:my-catalog \
   --actions readResource writeResource --json
olp project resource link hrn:here:authorization::myrealm:project/my-project-0000 ^
   hrn:here:data::myrealm:my-catalog ^
   --actions readResource writeResource --json

Output:


{
  "resource": "hrn:here:data::myrealm:my-catalog",
  "project": "hrn:here:authorization::myrealm: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:

Linux
Windows
olp project resource link hrn:here:authorization::myrealm/link-test-b hrn:here:pipeline-template::myrealm:<template UUID>
    --actions read
olp project resource link hrn:here:authorization::myrealm/link-test-b hrn:here:pipeline-template::myrealm:<template UUID>
    --actions read

Output:


Project resource hrn:here:pipeline-template::myrealm: has been linked.

Unlinks a resource 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:

  • --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 Display an empty output skipping additional information.

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

Example:

Linux
Windows
olp project resource unlink hrn:here:authorization::myrealm:project/my-project-0000 \
   hrn:here:data::myrealm:my-catalog
olp project resource unlink hrn:here:authorization::myrealm:project/my-project-0000 ^
   hrn:here:data::myrealm:my-catalog

Output:


Resource hrn:here:data::myrealm:my-catalog has been unlinked from project hrn:here:authorization::myrealm:project/my-project-0000.

results matching ""

    No results matching ""