Skip to main content

Python CLI for managing template library.

Project description

Introduction

Usage

Before you begin using xopera-template-library tool you have to configure the endpoint (setup) and login with your account.

If you are logging in with a keycloak user credentials, add --keycloak.

Optional arguments are usually not optional. If there is missing data, you will be prompted with input.

You don't have to type password directly - leave it out and enter it on getpass() prompt.

Examples:

$ xopera-template-library setup

$ xopera-template-library login --username "username1" --password "password1"
$ xopera-template-library login --username "username1" --password "password1" --keycloak
$ xopera-template-library login --username "username1"
Password:

At any point the -h (help) flag is available to display proceeding options.

Example:

$ xopera-template-library service-template -h
usage: xopera-template-library service-template [-h]
                            {create,save,get,list,version,list-groups}
                            ...

positional arguments:
  {create,save,get,list,version,list-groups}
    create              Initialize a blueprint directory and files.
    save                Save a template to database.
    get                 Get a template from database.
    list                List templates from database.
    version             List versions of a template from database.
    list-groups         List template groups the template is in.

optional arguments:
  -h, --help            show this help message and exit

Next you can use option list to display available templates. The templates will list in a table with templates' information. Option version displays a list of template's published versions.

Examples:

$ xopera-template-library service-template list
$ xopera-template-library entity-template list
$ xopera-template-library entity-template list --name AwsLambda
$ xopera-template-library entity-template version --name AwsLambda

To download a template you have to provide a path to where you want the template to be saved and the name of the template to download. By default, the last version is downloaded. With argument --version you can download other versions.

Example:

$ xopera-template-library service-template get --name DemoBlueprintOpenFaaS --path example/
$ xopera-template-library service-template get --name DemoBlueprintOpenFaaS --path example/ --version 0.0.1

If the desired template does not exist you can create and upload your own. You can start by generating a basic file structure by using create option. You will be asked for your template name and type (for entity template).

Possible types are data, artifact, capability, requirement, relationship, interface, node, group, policy and other. Service templates are always of type csar.

Examples:

$ xopera-template-library create-model
Model name: Test
Model type: artifact

After the basic files are generated you can edit them and upload your template to the library. By default templates are private. For publishing your template publicly, add --public.

Examples:

$ xopera-template-library entity-template save --name AwsLambda --path example/AwsLambdaFunction --public --version 0.0.1
Particle to upload structure
|-- Folder
       |-- files
           |-- create.yml
           |-- delete.yml
       |-- NodeType.tosca
       |-- README.md
Template groups

Templates can be ordered in template groups. User can create a template group, list existing groups and get a list of templates in a template group. Template group owners can add and remove templates.

Examples:

$ xopera-template-library template-group create --group_name AwsGroup --group_description "A group of AWS related templates"
$ xopera-template-library template-group list
$ xopera-template-library template-group get --group_name AwsGroup
$ xopera-template-library template-group add-template --group_name AwsGroup --template_name AwsBucket
$ xopera-template-library template-group remove-template --group_name AwsGroup --template_name AwsBucket
User groups

Users can be members of user groups. User groups can be granted access to groups of templates. User can create a user group, list existing groups, get a list of users in a given user group and get a list of template groups a user group is granted access to.

User group owners can add and remove users and access to template groups.

Examples:

$ xopera-template-library user-group create --group_name RadonGroup --group_description "Members of Radon project"
$ xopera-template-library user-group list
$ xopera-template-library user-group get-users --group_name RadonGroup
$ xopera-template-library user-group template-groups --group_name RadonGroup
$ xopera-template-library user-group add-user --group_name RadonGroup --username johny
$ xopera-template-library user-group remove-user --group_name RadonGroup --username johny
$ xopera-template-library user-group add-templates --user_group RadonGroup --template_group AwsGroup
$ xopera-template-library user-group remove-templates --user_group RadonGroup --template_group AwsGroup
Users

Users can look up their info, list user groups they are members of and list template groups they have access to.

Examples:

$ xopera-template-library user info
$ xopera-template-library user user-groups
$ xopera-template-library user template-groups

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

xopera-template-library-0.2.0.tar.gz (18.0 kB view details)

Uploaded Source

Built Distribution

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

xopera_template_library-0.2.0-py3-none-any.whl (17.5 kB view details)

Uploaded Python 3

File details

Details for the file xopera-template-library-0.2.0.tar.gz.

File metadata

  • Download URL: xopera-template-library-0.2.0.tar.gz
  • Upload date:
  • Size: 18.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.7.3

File hashes

Hashes for xopera-template-library-0.2.0.tar.gz
Algorithm Hash digest
SHA256 84e8b6d5632d43397ce5bb8ac31245eaeb84fbd2fc42f730338a5165ce528923
MD5 9d7a1139b32e6047783a4854d535dcb1
BLAKE2b-256 e88e8d71c1f353bd389cf3ff83a6a9c1bdb7b9efb6bc18fd2579b333fe1ee616

See more details on using hashes here.

File details

Details for the file xopera_template_library-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: xopera_template_library-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 17.5 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/41.0.1 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.7.3

File hashes

Hashes for xopera_template_library-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 85132b867269bd131115fc1736fead34dbabe6dc67f013150ca289a36379fd0e
MD5 1d21300bcb2628e2e57b655bf6311503
BLAKE2b-256 2abd05194b67a277fd350aca63be913890a8735f360a6b4d47527e1f1e4c6243

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