Skip to main content

FABRIC Python Client Library with CLI

Project description

Requirements Status

FABRIC User CLI

Fabric User CLI for experiments

Overview

User CLI supports following kinds commands:

  • Token : Commands to issue, refresh or revoke tokens
  • Orchestrator Commands : Query/Request/Modify/Delete Resources
Command SubCommand Action Input Output
token issue Issue Fabric Tokens projectname Project Name, scope Scope Points user to Credential Manager to generate the tokens
token refresh Refresh Fabric Tokens projectname Project Name, scope Scope, refreshtoken Refresh Token Returns new identity and refresh tokens
token revoke Revoke a Refresh Token refreshtoken Refresh Token Success or Failure status
resources query Query available resources from Orchestrator Graph ML representing the available resources

Requirements

Python 3.7+

Pre-requisites

Ensure that following are installed

  • virtualenv
  • virtualenvwrapper

Installation

Multiple installation options possible. For CF development the recommended method is to install from GitHub MASTER branch:

$ mkvirtualenv cli
$ workon cli
$ pip install git+https://github.com/fabric-testbed/fabric-cli.git

For inclusion in tools, etc, use PyPi

$ mkvirtualenv cli
$ workon cli
$ pip install fabric-cli

Configuration

User CLI expects the user to set FABRIC_ORCHESTRATOR_HOST and FABRIC_CREDMGR_HOST environment variables.

In addition, User is expected to pass either Fabric Identity Token or Fabric Refresh Token to all the orchestrator commands. Alternatively, user is expected to set atleast one of the environment variables FABRIC_ID_TOKEN and FABRIC_REFRESH_TOKEN.

Create config.yml with default content as shown below.

To enable CLI auto-completion, add following line to your ~/.bashrc

eval "$(_FABRIC_CLI_COMPLETE=source_bash fabric-cli)"

Open a new shell to enable completion. Or run the eval command directly in your current shell to enable it temporarily.

Usage

User CLI supports token and resources commands:

$ fabric-cli
Usage: fabric-cli [OPTIONS] COMMAND [ARGS]...

Options:
  -v, --verbose
  --help         Show this message and exit.

Commands:
  resources  Query Resources (set $FABRIC_ORCHESTRATOR_HOST to the Control...
  slice      slice management
  token      issue/get/refresh/revoke FABRIC tokens.

Token Commands

List of the token commands supported can be found below:

$ fabric-cli token
Usage: fabric-cli token [OPTIONS] COMMAND [ARGS]...

  issue/get/refresh/revoke FABRIC tokens. (set $FABRIC_CREDMGR_HOST to the
  Credential Manager Server)

Options:
  --help  Show this message and exit.

Commands:
  issue    issue token with projectname and scope
  refresh  refresh token
  revoke   revoke token

Resources Commands

List of the resource commands supported can be found below:

$ fabric-cli resources
Usage: fabric-cli resources [OPTIONS] COMMAND [ARGS]...

  Query Resources (set $FABRIC_ORCHESTRATOR_HOST to the Control Framework
  Orchestrator)

Options:
  --help  Show this message and exit.

Commands:
  query  issue token with projectname and scope

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fabric-cli-0.4.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fabric_cli-0.4-py3-none-any.whl (12.6 kB view details)

Uploaded Python 3

File details

Details for the file fabric-cli-0.4.tar.gz.

File metadata

  • Download URL: fabric-cli-0.4.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for fabric-cli-0.4.tar.gz
Algorithm Hash digest
SHA256 6423e342fc882d0119a3f98523e0ee0b26d082fcd9a1d45d2ddba7148f400078
MD5 1b65284ee70e8a32a632ba608a8c2888
BLAKE2b-256 1b09d8da54273b5171b2ea8f1318446f7ca822cdbd9e26abf69d89bba89abf77

See more details on using hashes here.

File details

Details for the file fabric_cli-0.4-py3-none-any.whl.

File metadata

  • Download URL: fabric_cli-0.4-py3-none-any.whl
  • Upload date:
  • Size: 12.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for fabric_cli-0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 0612a1f9e5d629031740f321f8ed7043a6f3373aa24327af169fc1494b9ddfc3
MD5 29ec7f245321d56a9e5f0a37e6b579bb
BLAKE2b-256 d526461a6f6c69f838969ff33e448557d56fd8cbdcce57f97c191d81322b18af

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page