Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@clean_outputs
def bookmark(ctx):
"""Bookmark project.
Uses [Caching](/references/polyaxon-cli/#caching)
"""
owner, project_name = get_project_or_local(ctx.obj.get("project"))
try:
polyaxon_client = PolyaxonClient()
polyaxon_client.projects_v1.bookmark_project(owner, project_name)
except (ApiException, HTTPError) as e:
handle_cli_error(
e, message="Could not bookmark project `{}/{}`.".format(owner, project_name)
)
sys.exit(1)
@clean_outputs
def login(token, username, password):
"""Login to Polyaxon."""
polyaxon_client = PolyaxonClient()
if username:
# Use user or email / password login
if not password:
password = click.prompt(
"Please enter your password", type=str, hide_input=True
)
password = password.strip()
if not password:
logger.info(
"You entered an empty string. "
"Please make sure you enter your password correctly."
)
sys.exit(1)
@clean_outputs
def unbookmark(ctx):
"""Unbookmark project.
Uses [Caching](/references/polyaxon-cli/#caching)
"""
owner, project_name = get_project_or_local(ctx.obj.get("project"))
try:
polyaxon_client = PolyaxonClient()
polyaxon_client.projects_v1.unbookmark_project(owner, project_name)
except (ApiException, HTTPError) as e:
handle_cli_error(
e,
message="Could not unbookmark project `{}/{}`.".format(owner, project_name),
)
sys.exit(1)
@clean_outputs
def ci(ctx, enable, disable): # pylint:disable=assign-to-new-keyword
"""Enable/Disable CI on this project.
Uses [Caching](/references/polyaxon-cli/#caching)
Example:
\b
```bash
$ polyaxon project ci --enable
```
\b
```bash
$ polyaxon project ci --disable
```
@clean_outputs
def update(ctx, name, description, private):
"""Update project.
Uses [Caching](/references/polyaxon-cli/#caching)
Example:
\b
```bash
$ polyaxon update foobar --description="Image Classification with DL using TensorFlow"
```
\b
```bash
$ polyaxon update mike1/foobar --description="Image Classification with DL using TensorFlow"
```
@clean_outputs
def logout():
"""Logout of Polyaxon."""
AuthConfigManager.purge()
CliConfigManager.purge()
Printer.print_success("You are logged out")
@clean_outputs
def ls(ctx, io, query, sort, limit, offset):
"""List runs for this project.
Uses [Caching](/references/polyaxon-cli/#caching)
Examples:
Get all runs:
\b
```bash
$ polyaxon project runs
```
Get all runs with with status {created or running}, and
creation date between 2018-01-01 and 2018-01-02, and params activation equal to sigmoid
@clean_outputs
def deploy(file, manager_path, check, upgrade): # pylint:disable=redefined-builtin
if upgrade:
Printer.print_warning(
"The command `polyaxon deploy [-f] --upgrade` is deprecated, "
"please use `polyaxon admin upgrade [-f]`."
)
elif check:
Printer.print_warning(
"The command `polyaxon deploy [-f] --check` is deprecated, "
"please use `polyaxon admin deploy [-f] --check`."
)
else:
Printer.print_warning(
"The command `polyaxon deploy [-f]` is deprecated, "
"please use `polyaxon admin deploy [-f]`."
@clean_outputs
def projects(ctx, limit, offset):
"""List bookmarked projects for user.
Uses [Caching](/references/polyaxon-cli/#caching)
Examples:
\b
```bash
$ polyaxon bookmark projects
```
\b
```bash
$ polyaxon bookmark -u adam projects
```
@clean_outputs
def update(ctx, name, description, tags):
"""Update run.
Uses [Caching](/references/polyaxon-cli/#caching)
Examples:
\b
```bash
$ polyaxon runs --uid=8aac02e3a62a4f0aaa257c59da5eab80 update
--description="new description for my runs"
```
\b
```bash
$ polyaxon runs --project=cats-vs-dogs -id 8aac02e3a62a4f0aaa257c59da5eab80 update