Skip to content

Package


title: “package” description: “package Command” lead: "" date: 2023-06-12T13:46:25-06:00 lastmod: 2023-06-12T13:46:25-06:00 draft: false images: [] menu: docs: parent: “cli-api” weight: 312 toc: true

Command Reference

Definition

Provides an interface to call the Trimble Access Management Package APIs.

Terminal window
./tam package

Sub-Commands

register

Registers a policy package with Trimble Access Management.

Arguments

environment (Required) Trimble Access Management environment. Options are Stage, and Prod

consumerKey (Required) The Trimble Cloud Console Client ID for your application.

consumerSecret (Required) The Trimble Cloud Console Client Secret for your application.

packageNamespace (Required) The namespace of the package containing the rule[s] to evaluate. This namespace must start and end with alphanumeric characters and contain alphanumeric and period characters only.

pathToFiles (Required) A path on the local file system to a rego file or directory of rego files.

pathToTestFiles (Required) A path on the local file system to a rego test file or directory of rego test files.

packageDependencies (Optional) A comma separated list of package namespaces that are dependencies of the package.

remoteDataSourceUrls (Optional) A comma separated list of remote data sources associated with the policy.

remoteDataSourceExpirations (Optional) A comma separated list of default cache expirations for remote data sources associated with the policy. Format should be in hh:mm:ss (Ex: ‘00:01:00’ is 1 minute).

remoteDataSourceScopes (Optional) A comma separated list of Trimble Identity scopes needed to operate against the remote data sources associated with the policy.

contactName (Optional) Contact name for the package.

contactEmail (Optional) Contact email for the package.

description (Optional) Quotation surrounded description of the package.

descriptionFile (Optional) File path of a file containing description of the package. If set, file contents will overwrite any input to description.

example (Optional) Quotation surrounded example of the package.

exampleFile (Optional) File path of a file containing example of the package. If set, file contents will overwrite any input to example.

isDiscoverable (Optional) Boolean to set if registered package is publicly discoverable. When registered with true, registered package is publicly discoverable and is not public when registered with false.

Example

Terminal window
./tam package register --environment Stage --consumerKey a79ace58-555a-4558-954f-b922ba342656 --consumerSecret 2282aea627aa4464884d7227d4e38735 --packageNamespace sample.auth --pathToFiles ./file.rego --pathToTestFiles ./file_test.rego --remoteDataSourceUrls https://api.foo.trimble.com --remoteDataSourceExpirations 00:01:00 --remoteDataSourceScopes foo --contactName "Sam Pleman" --description "This package is a sample." --exampleFile ./sample_auth_example.txt

get

Gets a package’s revision and creation date from Trimble Access Management based on a given package namespace and optionally a given package revision. If package metadata exists, it is also retrieved.

Arguments

environment (Required) Trimble Access Management environment. Options are Stage, and Prod

consumerKey (Required) The Trimble Cloud Console Client ID for your application.

consumerSecret (Required) The Trimble Cloud Console Client Secret for your application.

packageNamespace (Required) The namespace of the package from which to retrieve information. A package must have been previously registered with this namespace. Case-sensitive.

packageRevision (Optional) The specific revision of the package from which to retrieve information. If not included, get returns the latest existing, approved, and discoverable package.

Example

Terminal window
./tam package get --environment Stage --consumerKey a79ace58-555a-4558-954f-b922ba342656 --consumerSecret 2282aea627aa4464884d7227d4e38735 --packageNamespace sample.auth --packageRevision 2

getall

Gets the namespaces and revisions of all your approved packages in a paginated return format from Trimble Access Management. If search criteria is specified, only package namespaces containing the search criteria will be included. Package filtering can be achieved with the help of ‘isDiscoverable’ argument.

Arguments

environment (Required) Trimble Access Management environment. Options are Stage, and Prod

consumerKey (Required) The Trimble Cloud Console Client ID for your application.

consumerSecret (Required) The Trimble Cloud Console Client Secret for your application.

isDiscoverable (Optional) This argument accepts a boolean value. It is used to filter packages based on discoverable & non-discoverable criteria. If not specified, both discoverable & non-discoverable packages will be returned. If set to ‘true’, only discoverable packages will be returned. If set to ‘false’, only non-discoverable packages will be returned.

searchCriteria (Optional) The searchCriteria to narrow resulting package namespaces. If specified, results will include only packages with namespaces containing the specified search criteria. If not specified or an empty string, all discoverable and approved packages will be returned. Case-insensitive.

pageIndex (Optional) The page index specifying which page of the paginated results to return. Defaults to 0 if not specified.

pageSize (Optional) The page size specifying how many resulting items are included in each page of the paginated results. Defaults to 100 if not specified.

Example

Terminal window
./tam package getall --environment Stage --consumerKey a79ace58-555a-4558-954f-b922ba342656 --consumerSecret 2282aea627aa4464884d7227d4e38735 --isDiscoverable false --searchCriteria sample.auth --pageIndex 1 --pageSize 50

get-shared

Gets the namespaces and revisions of all(publicly available) approved and discoverable packages in a paginated return format from Trimble Access Management. If search criteria is specified, only package namespaces containing the search criteria will be included.

Arguments

environment (Required) Trimble Access Management environment. Options are Stage, and Prod

consumerKey (Required) The Trimble Cloud Console Client ID for your application.

consumerSecret (Required) The Trimble Cloud Console Client Secret for your application.

searchCriteria (Optional) The searchCriteria to narrow resulting package namespaces. If specified, results will include only packages with namespaces containing the specified search criteria. If not specified or an empty string, all discoverable and approved packages will be returned. Case-insensitive.

pageIndex (Optional) The page index specifying which page of the paginated results to return. Defaults to 0 if not specified.

pageSize (Optional) The page size specifying how many resulting items are included in each page of the paginated results. Defaults to 100 if not specified.

Example

Terminal window
./tam package get-shared --environment Stage --consumerKey a79ace58-555a-4558-954f-b922ba342656 --consumerSecret 2282aea627aa4464884d7227d4e38735 --searchCriteria sample.auth --pageIndex 1 --pageSize 50

update

Update the Metadata of a specific version of a package.

Arguments

environment (Required) Trimble Access Management environment. Options are Stage, and Prod

consumerKey (Required) The Trimble Cloud Console Client ID for your application.

consumerSecret (Required) The Trimble Cloud Console Client Secret for your application.

packageNamespace (Required) The namespace of the package from which to retrieve information. A package must have been previously registered with this namespace. Case-sensitive.

packageRevision (Required) The specific revision of the package from which to retrieve information. If not included, get returns the latest existing, approved, and discoverable package.

contactName (Optional) Contact name for the package.

contactEmail (Optional) Contact email for the package.

description (Optional) Quotation surrounded description of the package.

descriptionFile (Optional) File path of a file containing description of the package. If set, file contents will overwrite any input to description.

example (Optional) Quotation surrounded example of the package.

exampleFile (Optional) File path of a file containing example of the package. If set, file contents will overwrite any input to example.

isDiscoverable (Optional) Boolean to set if registered package is publicly discoverable. When registered with true, registered package is publicly discoverable and is not public when registered with false.

Example

Terminal window
./tam package update --environment Stage --consumerKey a79ace58-555a-4558-954f-b922ba342656 --consumerSecret 2282aea627aa4464884d7227d4e38735 --packageNamespace sample.auth --contactName "Sam Pleman" --description "This package is a sample."

update-data

Update the data.json file for a specific/latest revision of a package

Arguments

environment (Required) Trimble Access Management environment. Options are Stage, and Prod

consumerKey (Required) The Trimble Cloud Console Client ID for your application.

consumerSecret (Required) The Trimble Cloud Console Client Secret for your application.

newFilePath (Required) Path to the new data.json file.

packageNamespace (Required) The namespace of the package from which to retrieve information. A package must have been previously registered with this namespace. Case-sensitive.

packageRevision (optional) The specific revision of the package from which to retrieve information. If not included, get returns the latest existing, approved, and discoverable package.

existingFilePath (Optional) Relative path of the existing data.json(in case of multiple data.json files for a single package).

Example

Terminal window
./tam package update-data --environment Stage --consumerKey a79ace58-555a-4558-954f-b922ba342656 --consumerSecret 2282aea627aa4464884d7227d4e38735 --packageNamespace sample.auth --packageRevision 6 --newFilePath rego/data

delete

Deletes a package’s revision from Trimble Access Management based on a given package namespace and package revision. Warning: This action is irreversible. Once a package revision is deleted, it cannot be recovered.

Arguments

environment (Required) Trimble Access Management environment. Options are Stage, and Prod

consumerKey (Required) The Trimble Cloud Console Client ID for your application.

consumerSecret (Required) The Trimble Cloud Console Client Secret for your application.

packageNamespace (Required) The namespace of the package to delete information. A package must have been previously registered with this namespace. Case-sensitive.

packageRevision (Required) The specific revision of the package to delete information.

Example

Terminal window
./tam package delete --environment Stage --consumerKey a79ace58-555a-4558-954f-b922ba342656 --consumerSecret 2282aea627aa4464884d7227d4e38735 --packageNamespace sample.auth --packageRevision 2

delete-all

Deletes the namespaces and all of its revisions of all packages from Trimble Access Management. Warning: This action is irreversible. Once a package is deleted, it cannot be recovered. This action will delete all revisions of the package and all metadata associated with the package.

Arguments

environment (Required) Trimble Access Management environment. Options are Stage, and Prod

consumerKey (Required) The Trimble Cloud Console Client ID for your application.

consumerSecret (Required) The Trimble Cloud Console Client Secret for your application.

packageNamespace (Required) The namespace of the package to delete information. A package must have been previously registered with this namespace. Case-sensitive.

Example

Terminal window
./tam package delete-all --environment Stage --consumerKey a79ace58-555a-4558-954f-b922ba342656 --consumerSecret 2282aea627aa4464884d7227d4e38735 --packageNamespace sample.auth