Manage License Buckets with JFrog CLI

Acquire, deploy, and release licenses from Mission Control license buckets with JFrog CLI.

Use the JFrog CLI Mission Control (mc) commands to acquire a license key, deploy licenses directly to a registered JFrog Platform Deployment (JPD), or return licenses to a license bucket.

📘

Note

License buckets require a self-managed subscription that includes JFrog Mission Control. For current subscription eligibility, see the Product License Matrix.

Prerequisites

Before you use the license bucket commands, verify that you have:

  • The Mission Control microservice enabled on your JFrog Platform. For instructions, see Mission Control Installation.
  • A license bucket loaded into Mission Control. For instructions, see Manage License Buckets.
  • A Mission Control admin access token.
  • A registered JPD if you plan to deploy licenses directly to it.
  • JFrog CLI installed. For instructions, see Install JFrog CLI.

Configure the Connection

Configure a JFrog Platform connection before you run the license bucket commands. The CLI derives the Mission Control URL from the platform URL:

jf config add my-platform \
  --url=https://jfrog.example.com \
  --access-token=<access-token> \
  --interactive=false

For more configuration options, see Configure the JFrog CLI.

You can also provide connection details with each command. When you use command options, set --url to the Mission Control URL:

jf mc <command> \
  --url=https://jfrog.example.com/mc \
  --access-token=<access-token>
🚧

Warning

Don't expose access tokens in shell history, logs, or source control. Use a secure secret store or an existing JFrog CLI server configuration.

Choose a License Command

The following table explains when to use each license bucket command.

CommandAliasUse it to
jf mc license-acquiremc laReserve a license and return its key without deploying it directly to a registered JPD.
jf mc license-deploymc ldDeploy one or more licenses directly from a bucket to a registered JPD.
jf mc license-releasemc lrReturn a deployed license or an unused acquired license to the bucket from which it was allocated.

Acquiring and deploying are separate operations. You don't need to acquire a license before you deploy one to a JPD.

Acquire a License

Use license-acquire to reserve a license from a bucket and mark it with a custom name. The command returns the license key but doesn't deploy it to a JPD.

jf mc license-acquire [command options] <bucket-id> <name>

For example, acquire a license and return JSON output:

jf mc license-acquire my-bucket temporary-holder --format=json

The following table describes the arguments.

ArgumentDescription
bucket-idThe bucket name or identifier from which to acquire a license.
nameA custom name that marks the license as taken. Use this name to release the license if you don't deploy the license to a registered JPD.

The following table describes the options.

OptionDescription
--urlJFrog Mission Control URL, for example, https://jfrog.example.com/mc.
--access-tokenMission Control admin access token.
--formatOutput format. Supported values are table and json. Default: table.
🚧

Warning

The command output contains the license key. Don't expose this output in logs or share it with unauthorized users.

If you don't use the acquired license, return it to the bucket by passing its custom name to license-release:

jf mc license-release my-bucket temporary-holder

Deploy a License

Use license-deploy to deploy a license from a bucket directly to an existing JPD. For an Artifactory high availability (HA) deployment, use --license-count to deploy multiple licenses.

jf mc license-deploy [command options] <bucket-id> <jpd-id>

For example, deploy one license:

jf mc license-deploy my-bucket my-jpd

To deploy three licenses to an Artifactory HA JPD:

jf mc license-deploy my-bucket my-ha-jpd --license-count=3

The following table describes the arguments.

ArgumentDescription
bucket-idThe bucket name or identifier from which to deploy licenses.
jpd-idThe ID of an existing, registered JPD.

The following table describes the options.

OptionDescription
--urlJFrog Mission Control URL, for example, https://jfrog.example.com/mc.
--access-tokenMission Control admin access token.
--license-countNumber of licenses to deploy. The minimum and default value is 1.
--formatOutput format. Supported values are table and json. Default: json.

Release a License

Use license-release to return a license to the bucket from which it was allocated.

  • For a license deployed to a JPD, pass the JPD ID.
  • For an acquired license that wasn't deployed, pass the custom name used with license-acquire.
jf mc license-release [command options] <bucket-id> <jpd-id>

For example, release a license deployed to a JPD:

jf mc license-release my-bucket my-jpd

To release an unused acquired license:

jf mc license-release my-bucket temporary-holder

The following table describes the arguments.

ArgumentDescription
bucket-idThe bucket name or identifier to which the license is returned.
jpd-idThe JPD ID for a deployed license, or the custom name used to acquire an undeployed license.

The following table describes the options.

OptionDescription
--urlJFrog Mission Control URL, for example, https://jfrog.example.com/mc.
--access-tokenMission Control admin access token.
🚧

Warning

Releasing a license used by a running JPD invalidates that JPD's licensing. Verify that the JPD no longer needs the license before you release it.

Related Topics


Did this page help you?