Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ycai
simbricks
Commits
cec467ae
Unverified
Commit
cec467ae
authored
Jan 22, 2025
by
Antoine Kaufmann
Browse files
symphony/cli: add org management command
parent
d649a21a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
0 deletions
+44
-0
symphony/cli/simbricks/cli/__main__.py
symphony/cli/simbricks/cli/__main__.py
+2
-0
symphony/cli/simbricks/cli/commands/org.py
symphony/cli/simbricks/cli/commands/org.py
+42
-0
No files found.
symphony/cli/simbricks/cli/__main__.py
View file @
cec467ae
...
...
@@ -25,6 +25,7 @@ from typing_extensions import Annotated
from
simbricks.cli.commands
import
(
audit
,
admin
,
org
,
namespaces
,
rg
,
runs
,
...
...
@@ -41,6 +42,7 @@ app.add_typer(namespaces.app, name="ns")
app
.
add_typer
(
runs
.
app
,
name
=
"runs"
)
app
.
add_typer
(
audit
.
app
,
name
=
"audit"
)
app
.
add_typer
(
admin
.
app
,
name
=
"admin"
)
app
.
add_typer
(
org
.
app
,
name
=
"org"
)
app
.
add_typer
(
systems
.
app
,
name
=
"systems"
)
app
.
add_typer
(
simulations
.
app
,
name
=
"sims"
)
app
.
add_typer
(
instantiations
.
app
,
name
=
"insts"
)
...
...
symphony/cli/simbricks/cli/commands/org.py
0 → 100644
View file @
cec467ae
from
typer
import
Typer
,
Option
from
typing
import
Annotated
from
simbricks.client.provider
import
client_provider
from
..utils
import
async_cli
,
print_table_generic
app
=
Typer
(
help
=
"Managing SimBricks organizations."
)
organization
=
''
@
app
.
callback
()
@
async_cli
()
async
def
amain
(
org
:
Annotated
[
str
,
Option
(
help
=
"Organization to operate in."
)]
=
"SimBricks"
,
):
global
organization
organization
=
org
@
app
.
command
()
@
async_cli
()
async
def
members
():
"""List organization members."""
members
=
await
client_provider
.
org_client
.
get_members
(
organization
)
print_table_generic
(
"Members"
,
members
,
"username"
,
"first_name"
,
"last_name"
)
@
app
.
command
()
@
async_cli
()
async
def
invite
(
email
:
str
,
first_name
:
str
,
last_name
:
str
):
"""Invite a new user."""
await
client_provider
.
org_client
.
invite_member
(
organization
,
email
,
first_name
,
last_name
)
@
app
.
command
()
@
async_cli
()
async
def
guest
(
email
:
str
,
first_name
:
str
,
last_name
:
str
):
"""Invite a new user."""
url
=
await
client_provider
.
org_client
.
create_guest
(
organization
,
email
,
first_name
,
last_name
)
print
(
"Guest login link: {url}"
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment