[](https://pypi.org/project/fabrictestbed/)
# FABRIC TESTBED USER LIBRARY AND CLI
Fabric User CLI for experiments
## Overview
This package supports User facing APIs as well as CLI.
- Tokens: Token management
- Slices: Slice management
- Slivers: Sliver management
- Resources: Resource management
### CLI Commands
Command | SubCommand | Action | Input | Output
:--------|:----:|:----:|:---:|:---:
`tokens` | `issue`| Issue token with projectId and scope | `projectId` Project Id, `scope` Scope | Points user to Credential Manager to generate the tokens
`token` | `refresh`| Refresh token | `projectId` Project Id, `scope` Scope, `refreshtoken` Refresh Token | Returns new identity and refresh tokens
`token` | `revoke` | Revoke token | `refreshtoken` Refresh Token | Success or Failure status
`slices` | `query` | Query user slice(s) | `idtoken` Identity Token, `refreshtoken` Refresh Token, `projectId` Project Id, `scope` Scope, `sliceid` Slice Id | List of Slices or Graph ML representing slice identified by Slice Id
`slices` | `create` | Create user slice | `idtoken` Identity Token, `refreshtoken` Refresh Token, `projectId` Project Id, `scope` Scope, `slicename` Slice Name, `slicegraph` Slice graph | List of Slivers created for the Slice
`slices` | `delete` | Delete user slice | `idtoken` Identity Token, `refreshtoken` Refresh Token, `projectId` Project Id, `scope` Scope, `sliceid` Slice Id | Success or Failure Status
`slivers` | `query` | Query user sliver(s) | `idtoken` Identity Token, `refreshtoken` Refresh Token, `projectId` Project Id, `scope` Scope, `sliceid` Slice Id, `sliverid` Sliver Id | List of Slivers for the slice identified by Slice Id or Sliver identified by Sliver Id
`resources` | `query` | Query resources | `idtoken` Identity Token, `refreshtoken` Refresh Token, `projectId` Project Id, `scope` Scope | Graph ML representing the available resources
### API
`SliceManager` class implements the API supporting the operations listed above. Check example in Usage below.
## Requirements
Python 3.9+
## Installation
Multiple installation options possible. For CF development the recommended method is to install from GitHub MASTER branch:
```
$ mkvirtualenv fabrictestbed
$ workon fabrictestbed
$ pip install git+https://github.com/fabric-testbed/fabric-cli.git
```
For inclusion in tools, etc, use PyPi
```
$ mkvirtualenv fabrictestbed
$ workon fabrictestbed
$ pip install fabrictestbed
```
### Pre-requisites for the install example above
Ensure that following are installed
- `virtualenv`
- `virtualenvwrapper`
NOTE: Any of the virtual environment tools (`venv`, `virtualenv`, or `virtualenvwrapper`) should work.
## Usage (API)
User API supports token and orchestrator commands. Please refer to Jupyter Notebooks [here](https://github.com/fabric-testbed/jupyter-examples/tree/master/fabric_examples/beta_functionality) for examples.
## Usage (CLI)
### Configuration
User CLI expects the user to set following environment variables:
```
export FABRIC_ORCHESTRATOR_HOST=orchestrator.fabric-testbed.net
export FABRIC_CREDMGR_HOST=cm.fabric-testbed.net
export FABRIC_TOKEN_LOCATION=<location of the token file downloaded from the Portal>
export FABRIC_PROJECT_ID=<Project Id of the project for which resources are being provisioned>
```
Alternatively, user can pass these as parameters to the commands.
#### 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.
User CLI supports token and orchestrator commands:
```
(usercli) $ fabric-cli
Usage: fabric-cli [OPTIONS] COMMAND [ARGS]...
Options:
-v, --verbose
--help Show this message and exit.
Commands:
resources Resource management (set $FABRIC_ORCHESTRATOR_HOST to the...
slices Slice management (set $FABRIC_ORCHESTRATOR_HOST to the...
slivers Sliver management (set $FABRIC_ORCHESTRATOR_HOST to the...
tokens Token management (set $FABRIC_CREDMGR_HOST to the Credential...
```
### Token Management Commands
List of the token commands supported can be found below:
```
(usercli) $ fabric-cli tokens
Usage: fabric-cli tokens [OPTIONS] COMMAND [ARGS]...
Token management (set $FABRIC_CREDMGR_HOST to the Credential Manager
Server)
Options:
--help Show this message and exit.
Commands:
issue Issue token with projectId and scope
refresh Refresh token
revoke Revoke token
```
### Resource Management 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 projectId and scope
```
### Slice Management Commands
```
(usercli) $ fabric-cli slices
Usage: fabric-cli slices [OPTIONS] COMMAND [ARGS]...
Slice management (set $FABRIC_ORCHESTRATOR_HOST to the Orchestrator)
Options:
--help Show this message and exit.
Commands:
create Create user slice
delete Delete user slice
query Query user slice(s)
```
### Sliver Management Commands
```
(usercli) $ fabric-cli slivers
Usage: fabric-cli slivers [OPTIONS] COMMAND [ARGS]...
Sliver management (set $FABRIC_ORCHESTRATOR_HOST to the Orchestrator)
Options:
--help Show this message and exit.
Commands:
query Query user slice sliver(s)
```
Raw data
{
"_id": null,
"home_page": null,
"name": "fabrictestbed",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "Swagger, FABRIC Python Client Library with CLI",
"author": null,
"author_email": "Komal Thareja <kthare10@renci.org>",
"download_url": "https://files.pythonhosted.org/packages/4d/f8/1032c211fa51cba956a49dc37d9a2de01702b8595124cd7ec9a7cbdeba19/fabrictestbed-1.8.4.tar.gz",
"platform": null,
"description": "[](https://pypi.org/project/fabrictestbed/)\n\n\n# FABRIC TESTBED USER LIBRARY AND CLI\n\nFabric User CLI for experiments\n\n## Overview\nThis package supports User facing APIs as well as CLI.\n- Tokens: Token management\n- Slices: Slice management\n- Slivers: Sliver management\n- Resources: Resource management\n\n### CLI Commands\nCommand | SubCommand | Action | Input | Output\n:--------|:----:|:----:|:---:|:---:\n`tokens` | `issue`| Issue token with projectId and scope | `projectId` Project Id, `scope` Scope | Points user to Credential Manager to generate the tokens\n`token` | `refresh`| Refresh token | `projectId` Project Id, `scope` Scope, `refreshtoken` Refresh Token | Returns new identity and refresh tokens\n`token` | `revoke` | Revoke token | `refreshtoken` Refresh Token | Success or Failure status\n`slices` | `query` | Query user slice(s) | `idtoken` Identity Token, `refreshtoken` Refresh Token, `projectId` Project Id, `scope` Scope, `sliceid` Slice Id | List of Slices or Graph ML representing slice identified by Slice Id\n`slices` | `create` | Create user slice | `idtoken` Identity Token, `refreshtoken` Refresh Token, `projectId` Project Id, `scope` Scope, `slicename` Slice Name, `slicegraph` Slice graph | List of Slivers created for the Slice\n`slices` | `delete` | Delete user slice | `idtoken` Identity Token, `refreshtoken` Refresh Token, `projectId` Project Id, `scope` Scope, `sliceid` Slice Id | Success or Failure Status\n`slivers` | `query` | Query user sliver(s) | `idtoken` Identity Token, `refreshtoken` Refresh Token, `projectId` Project Id, `scope` Scope, `sliceid` Slice Id, `sliverid` Sliver Id | List of Slivers for the slice identified by Slice Id or Sliver identified by Sliver Id\n`resources` | `query` | Query resources | `idtoken` Identity Token, `refreshtoken` Refresh Token, `projectId` Project Id, `scope` Scope | Graph ML representing the available resources\n\n### API\n`SliceManager` class implements the API supporting the operations listed above. Check example in Usage below.\n\n## Requirements\nPython 3.9+\n\n## Installation\nMultiple installation options possible. For CF development the recommended method is to install from GitHub MASTER branch:\n```\n$ mkvirtualenv fabrictestbed\n$ workon fabrictestbed\n$ pip install git+https://github.com/fabric-testbed/fabric-cli.git\n```\nFor inclusion in tools, etc, use PyPi\n```\n$ mkvirtualenv fabrictestbed\n$ workon fabrictestbed\n$ pip install fabrictestbed\n```\n\n### Pre-requisites for the install example above\nEnsure that following are installed\n- `virtualenv`\n- `virtualenvwrapper`\n\nNOTE: Any of the virtual environment tools (`venv`, `virtualenv`, or `virtualenvwrapper`) should work.\n\n## Usage (API)\nUser API supports token and orchestrator commands. Please refer to Jupyter Notebooks [here](https://github.com/fabric-testbed/jupyter-examples/tree/master/fabric_examples/beta_functionality) for examples.\n\n## Usage (CLI)\n### Configuration\nUser CLI expects the user to set following environment variables:\n```\nexport FABRIC_ORCHESTRATOR_HOST=orchestrator.fabric-testbed.net\nexport FABRIC_CREDMGR_HOST=cm.fabric-testbed.net\nexport FABRIC_TOKEN_LOCATION=<location of the token file downloaded from the Portal>\nexport FABRIC_PROJECT_ID=<Project Id of the project for which resources are being provisioned>\n```\n\nAlternatively, user can pass these as parameters to the commands.\n\n#### To enable CLI auto-completion, add following line to your ~/.bashrc\n```\neval \"$(_FABRIC_CLI_COMPLETE=source_bash fabric-cli)\"\n```\nOpen a new shell to enable completion.\nOr run the eval command directly in your current shell to enable it temporarily.\n\nUser CLI supports token and orchestrator commands:\n```\n(usercli) $ fabric-cli\nUsage: fabric-cli [OPTIONS] COMMAND [ARGS]...\n\nOptions:\n -v, --verbose\n --help Show this message and exit.\n\nCommands:\n resources Resource management (set $FABRIC_ORCHESTRATOR_HOST to the...\n slices Slice management (set $FABRIC_ORCHESTRATOR_HOST to the...\n slivers Sliver management (set $FABRIC_ORCHESTRATOR_HOST to the...\n tokens Token management (set $FABRIC_CREDMGR_HOST to the Credential...\n```\n\n### Token Management Commands\nList of the token commands supported can be found below:\n```\n(usercli) $ fabric-cli tokens\nUsage: fabric-cli tokens [OPTIONS] COMMAND [ARGS]...\n\n Token management (set $FABRIC_CREDMGR_HOST to the Credential Manager\n Server)\n\nOptions:\n --help Show this message and exit.\n\nCommands:\n issue Issue token with projectId and scope\n refresh Refresh token\n revoke Revoke token\n```\n\n### Resource Management Commands\nList of the resource commands supported can be found below:\n```\n$ fabric-cli resources\nUsage: fabric-cli resources [OPTIONS] COMMAND [ARGS]...\n\n Query Resources (set $FABRIC_ORCHESTRATOR_HOST to the Control Framework\n Orchestrator)\n\nOptions:\n --help Show this message and exit.\n\nCommands:\n query issue token with projectId and scope\n```\n### Slice Management Commands\n```\n(usercli) $ fabric-cli slices\nUsage: fabric-cli slices [OPTIONS] COMMAND [ARGS]...\n\n Slice management (set $FABRIC_ORCHESTRATOR_HOST to the Orchestrator)\n\nOptions:\n --help Show this message and exit.\n\nCommands:\n create Create user slice\n delete Delete user slice\n query Query user slice(s)\n```\n### Sliver Management Commands\n```\n(usercli) $ fabric-cli slivers\nUsage: fabric-cli slivers [OPTIONS] COMMAND [ARGS]...\n\n Sliver management (set $FABRIC_ORCHESTRATOR_HOST to the Orchestrator)\n\nOptions:\n --help Show this message and exit.\n\nCommands:\n query Query user slice sliver(s)\n```\n",
"bugtrack_url": null,
"license": null,
"summary": "FABRIC Python Client Library with CLI",
"version": "1.8.4",
"project_urls": {
"Home": "https://fabric-testbed.net/",
"Sources": "https://github.com/fabric-testbed/fabric-cli"
},
"split_keywords": [
"swagger",
" fabric python client library with cli"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "d76ba695068e1f5b21acff93f6d367b842c8b9b39e5e4c2c3869cc08207307f7",
"md5": "a7a21680de4817cb62aa85f4bba604b5",
"sha256": "feeb757cfa8113db8e3f450ef4af1e103ce39dbf36c0cedab59bccf5eb9646c8"
},
"downloads": -1,
"filename": "fabrictestbed-1.8.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "a7a21680de4817cb62aa85f4bba604b5",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 33766,
"upload_time": "2025-03-31T20:06:03",
"upload_time_iso_8601": "2025-03-31T20:06:03.579335Z",
"url": "https://files.pythonhosted.org/packages/d7/6b/a695068e1f5b21acff93f6d367b842c8b9b39e5e4c2c3869cc08207307f7/fabrictestbed-1.8.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "4df81032c211fa51cba956a49dc37d9a2de01702b8595124cd7ec9a7cbdeba19",
"md5": "a889376763cbe2955e82affe2d548c9a",
"sha256": "6209497a746147c236fc0433734d40e6f046c48a69dd55a088b4186980e4d2c3"
},
"downloads": -1,
"filename": "fabrictestbed-1.8.4.tar.gz",
"has_sig": false,
"md5_digest": "a889376763cbe2955e82affe2d548c9a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 25586,
"upload_time": "2025-03-31T20:06:04",
"upload_time_iso_8601": "2025-03-31T20:06:04.832755Z",
"url": "https://files.pythonhosted.org/packages/4d/f8/1032c211fa51cba956a49dc37d9a2de01702b8595124cd7ec9a7cbdeba19/fabrictestbed-1.8.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-03-31 20:06:04",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "fabric-testbed",
"github_project": "fabric-cli",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "fabrictestbed"
}