Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Overview

This page describes how to use JFrog CLI with JFrog Mission Control.

Read more about JFrog CLI here.

Syntax

Code Block
$ jfrog mc command-name arguments global-options command-options

Where:

command-name
The command to execute. Note that you can use either the full command name or its abbreviation.
global-options

A set of global options that may be used for all commands:

--url: (MandatoryOptional) The Mission Control URL.

--user: (Optional) The Mission Control user.--passwordaccess-token: (Optional) The Mission Control passwordadmin access token.

Tip
titleUse the config command

To avoid having to set these for every command, you may set them once using the config command and then omit them for every following command.

command-options
A set of options corresponding to the command
arguments
A set of arguments corresponding to the command


Info
iconfalse
titlePage Contents

Table of Contents
maxLevel4
minLevel2



 

Commands

The following sections describe the commands available in the JFrog CLI for use with JFrog Mission Control.

Tip

We strongly recommend running the config command right after installing the JFrog CLI to avoid having to pass in the Mission Control URL and login credentials for every command.

JFrog Services Actions

Configuration

This command

performs different actions on the JFrog services managed by Mission Control. The specific action is determined by a secondary command and its corresponding arguments and options as described in the following sections. 
The supported services are Artifactory, Artifactory-Edge-Node, Xray and Distribution.
Command name
services
Abbreviation
s

Adding a service

Command name
add
Description
Adds a service in Mission Control
Command arguments
 Service typeThe type of the service to be added in Mission Control. Can be one of the following:

ARTIFACTORY, EDGE, XRAY or DISTRIBUTION

Service name

The name of the service.

Command options
 --service-url

[Mandatory]

Service URL--service-user

[Mandatory]

Service username--service-password

[Mandatory]

Service password--desc

[Optional]

A description for the service.--site-name

[Optional]

 Service site name, e.g. US.

Example

Code Block
jfrog mc s add ARTIFACTORY my-arti --service-url=http://10.100.1.127 --service-user=admin --service-password=password

Removing a service

Command name
remove
Description
Removes a service from Mission Control
Command arguments
 Service nameThe name of the service (as defined in Mission Control) to remove. 
Command options
 

--quiet

[Default: false]
When true, skips the default confirmation message

is used to configure the JFrog CLI with the default Mission Control URL and access token, which should be used in the other commands so that you don't have to pass them in each time. These values are defaults for each command can be overridden per command by passing in alternative values for the Mission Control URL and access token. The values configured are saved in ~/.jfrog/jfrog-cli.conf.

Command name
config
Abbreviation
c
Command options


--url[Optional] The Mission Control URL to be used for the other commands.
--access-token[Optional] The access-token to be used for the other commands.
Command arguments
If no arguments are passed in, the command will configure the Mission Control URL and access token through the command options or through the interactive prompt
show

Shows the stored configuration.

clearClears the stored configuration.


Examples

Example 1

Configure the Mission Control URL and access token using the interactive prompt.

Code Block
$ jfrog mc c
Example 2

Configure the Mission Control URL and access token by passing them in as command options.

Code Block
$ jfrog mc c --url=http://<mission-control-domain> --access-token=access-token-value
Example 3

Show, and then clear the configuration details.

Code Block
$ jfrog mc c show
$ jfrog mc c clear


Adding a JPD 

Command name
jpd-add
Abbreviation
ja
Description
Adds a JPD to Mission Control
Command arguments

Config

Path to a JSON configuration file containing the JPD details.

Command options
The command accepts no options, other than the global options.

Config JSON schema


Code Block
{
  "name" : "jpd-0",
  "url" : "http://jpd:8080/test",
  "token" : "some-token",
  "location" : {
    "city_name" : "San Francisco",
    "country_code" : "US",
    "latitude" : 37.7749,
    "longitude" : 122.4194
  },
  "tags" : [ "tag0", "tag1" ]
}


Example

Code Block
jfrog mc ja path/to/jpd/config.json

Deleting a JPD

Command name
jpd-delete
Abbreviation
jd
Description

Delete a JPD from Mission Control.

Command arguments

JPD ID

The ID of the JPD to be removed from Mission Control.


Command options
The command accepts no options, other than the global options.

Example

Code Block
jfrog mc sjd remove my-arti --quiet=true
Attaching
jpd-id

Acquiring a License

Command name
attach

license-

lic

acquire

Abbreviation
la
Description
Attaches (and optionally installs)

Acquire a license

to

from the specified

service

bucket and

removes

mark it

from the specified license-bucket

as taken by the provided name.

Command arguments
 

Bucket ID

Artifactory service nameThe name of the service to which the license should be attached. 
Command options
 

--bucket-id

[Mandatory]
The id or name of the bucket from which the license should be provisioned.

--license-path

[Optional]

Specifies the full path to the license file. If not specified, the license is printed to standard output.--override

[Default: false]

When true, overrides any license file currently existing in the path specified in the --license-path parameter.--deploy

[Default: false]

When true, installs the license in the Artifactory service

Example

Bucket name or identifier to acquire license from.

Name

A custom name used to mark the license as taken. Can be a JPD ID or a temporary name. If the license does not end up being used by a JPD, this is the name that should be used to release the license.


Command options
The command accepts no options, other than the global options.

Examples

Example 1

Assign a license from the specified bucket to the specified Artifactory service (my-arti). The license is displayed on standard output. my-bucket-id and mark it as taken by my-unique-name.

Code Block
jfrog mc sla attachmy-licbucket-id my-arti --bucket-id=abcdefg
Detaching
unique-name

Deploying a License

Command name
detach

license-

lic

deploy

Abbreviation
ld
Description
Detaches a license from the specified service and returns it to the specified license-bucket

pecified bucket to an existing JPD. You may also deploy a number of licenses to an Artifactory HA.

Command arguments
 

Bucket ID
Service nameThe name of the service from which the license should be detached 
Command options
 

--bucket-id

[Mandatory]
The id of the license-bucket from which the license should be provisioned.

Example

Bucket name or identifier to deploy licenses from.

JPD ID

An existing JPD's ID.


Command options

--license-count

[Default: 1]

The number of licenses to deploy. Minimum value is 1.

Example

Deploy a single license from my-bucket-id on my-jpd-id.

Code Block
jfrog mc sld detach-lic my-arti --bucket-id=license my-bucketjpd-1id

Configuration

This command is used to configure the JFrog CLI with the default Mission Control URL and login credentials which should be used in the other commands so that you don't have to pass them in each time. These values are defaults for each command and can be overridden per command by passing in alternative values for the Mission Control URL and login credentials. The values configured are saved in ~/.jfrog/jfrog-cli.conf.

Command name
config
Abbreviation
c
Command options

 

--url[Optional] The default Mission Control URL to be used for the other commands.--user[Optional] The default user to be used for the other commands.--password

[Optional] The default password to be used for the other commands.

Command arguments
If no arguments are passed in, the command will configure the Mission Control URL, user and password through the command options or through the interactive promptshow

Shows the stored configuration.

clearClears the stored configuration.

 

Examples

Example 1

Configure the Mission Control URL, user and password using the interactive prompt.

Code Block
$ jfrog mc c
Example 2

Configure the Mission Control URL, user and password by passing them in as command options.

Code Block
$ jfrog mc c --url=http://<mission-control-domain> --user=admin --password=password
Example 3

Show, and then clear the configuration details.

Code Block
$ jfrog mc c show
$ jfrog mc c clear

 

 

 

 

 

 

Releasing a License

Command name

license-release

Abbreviation
lr
Description

Release all licenses of a JPD and return them to the specified bucket.

Command arguments

Bucket ID

Bucket name or identifier to release all of its licenses.

JPD ID

If the license is used by a JPD, pass the JPD's ID. If the license was only acquired but is not used, pass the name it was acquired with.


Command options
The command accepts no options, other than the global options.

Example

Releases all licenses of my-jpd-id to to my-bucket-id.

Code Block
jfrog mc lr my-bucket-id my-jpd-id