-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
254 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
"""Code for accessing SODAR Server API.""" | ||
|
||
from sodar_cli.api import landingzone # noqa: F403, F401 | ||
from sodar_cli.api import project # noqa: F403, F401 | ||
from sodar_cli.api import samplesheet # noqa: F403, F401 | ||
from sodar_cli.api.models import * # noqa: F403, F401 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,43 @@ | ||
"""Implementation of ``varfish-cli project create``.""" | ||
|
||
import argparse | ||
import json | ||
import sys | ||
|
||
import cattr | ||
from logzero import logger | ||
|
||
# from sodar_cli import api | ||
from sodar_cli import api | ||
from sodar_cli.project.config import ProjectCreateConfig | ||
|
||
|
||
def setup_argparse(parser): | ||
parser.add_argument("--hidden-cmd", dest="project_cmd", default=run, help=argparse.SUPPRESS) | ||
parser.add_argument("--title", default="Project Title", help="Title of the project") | ||
parser.add_argument( | ||
"--type", default="Project Type", help="Type of the project [PROJECT, CATEGORY]" | ||
) | ||
parser.add_argument("--parent-uuid", help="UUID of the parent project, if any") | ||
parser.add_argument("--description", help="Description text, optional") | ||
parser.add_argument("--readme", help="README text, markdown allowed, optional") | ||
|
||
|
||
def run(config, toml_config, args, _parser, _subparser, file=sys.stdout): | ||
def run(config, toml_config, args, _parser, _subparser, file=None): | ||
"""Run landingzone retrieve command.""" | ||
config = ProjectCreateConfig.create(args, config, toml_config) | ||
logger.info("Configuration: %s", config) | ||
logger.info("Creating project") | ||
project = api.Project( | ||
sodar_uuid=None, | ||
title=args.title, | ||
type=args.type, | ||
parent_uuid=args.parent_uuid, | ||
description=args.description, | ||
readme=args.readme, | ||
) | ||
result = api.project.create( | ||
sodar_url=config.project_config.global_config.sodar_server_url, | ||
sodar_api_token=config.project_config.global_config.sodar_api_token, | ||
project=project, | ||
) | ||
print(json.dumps(cattr.unstructure(result)), file=(file or sys.stdout)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,27 @@ | ||
"""Implementation of ``varfish-cli project list``.""" | ||
|
||
import argparse | ||
import json | ||
import sys | ||
|
||
import cattr | ||
from logzero import logger | ||
|
||
# from sodar_cli import api | ||
from sodar_cli import api | ||
from sodar_cli.project.config import ProjectListConfig | ||
|
||
|
||
def setup_argparse(parser): | ||
parser.add_argument("--hidden-cmd", dest="project_cmd", default=run, help=argparse.SUPPRESS) | ||
|
||
|
||
def run(config, toml_config, args, _parser, _subparser, file=sys.stdout): | ||
def run(config, toml_config, args, _parser, _subparser, file=None): | ||
"""Run project list command.""" | ||
config = ProjectListConfig.create(args, config, toml_config) | ||
logger.info("Configuration: %s", config) | ||
logger.info("Listing projects") | ||
result = api.project.list_( | ||
sodar_url=config.project_config.global_config.sodar_server_url, | ||
sodar_api_token=config.project_config.global_config.sodar_api_token, | ||
) | ||
print(json.dumps(cattr.unstructure(result)), file=(file or sys.stdout)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.