Contents
Resource |
Operation |
Description |
---|---|---|
Authentication |
Log user in. |
|
Refresh a token. |
||
Models |
Get a collection of models. |
|
Upload a new model. |
||
Get a single model. |
||
Update a single model. (Not implemented) |
||
Delete a single model. |
||
Projects |
Get a collection of projects. |
|
Create a new project. |
||
Get a single project. |
||
Update a single project. (Not implemented) |
||
Delete a single project. |
||
Users |
Get a collection of users. |
|
Create a new user. |
||
Get a single user. |
||
Update a single user. (Not implemented) |
||
Delete a single user. |
||
Workspaces |
Get a collection of workspaces. |
|
Create a new workspace. |
||
Get a single workspace. |
||
Update a single workspace. (Not implemented) |
||
Delete a single workspace. |
POST
/api/v1/auth/login/
¶Logs the user in by parsing a POST request containing user credentials and issuing a JWT token.
$ curl http://localhost:5000/api/v1/auth/login/ -X POST \
-d '{"login":"zofiakochutek", "password":"clechay"}'
GET
/api/v1/auth/token/
¶Refreshes an existing JWT by creating a new one that is a copy of the old except that it has a refreshed access expiration.
$ curl http://localhost:5000/api/v1/auth/token/ -X GET \
-H "Authorization: Bearer <your_token>"
GET
/api/v1/models/
¶Lists all models that satisfy certain conditions.
Every parameter can be appended multiple times.
workspace – search for models only in this workspace
project – search for models only in this project
hyperparam – search for models that have this hyperparameter
param – search for models that have this parameter
a list of objects
POST
/api/v1/models/
¶Uploads a model.
name – human-readable name of the model
dataset_name – name used to identify the dataset
dataset_description – description used to provide more context
project_id – id of the project the model belongs to
hyperparameters – a dictionary of hyperparameters
parameters – a dictionary of parameters
metrics – a dictionary of metrics
tags – a list of tags in form of a single string separated by commas
git_active_branch – an active branch of the uploaded model
git_commit_hash – hash of the most recent commit
file – contents of the file selected to upload
private – whether to mark the model as private
a newly uploaded model
GET
/api/v1/models/
(int: id)/
¶Returns data about a requested model.
id – id of a requested model
a single object
PUT
/api/v1/models/
(int: id)/
¶Modifies a selected model.
id – id of the model to update
payload – the data to override the model with
the updated model
DELETE
/api/v1/models/
(int: id)/
¶Removes a selected model.
id – id of a requested model
whether the operation has been successful
GET
/api/v1/projects/
¶Lists all projects.
search – lists only projects that contain the name like search
a list of projects
POST
/api/v1/projects/
¶Creates a new project.
name – a name/title for the project
description – a description of the project and it’s purpose
workspace_id – id of the workspace that contains this project
a newly created project
GET
/api/v1/projects/
(int: id)/
¶Returns data about a requested project.
id – id of a requested project
Authorization – Bearer JWT
200 OK – when project exists
404 Not Found – when requested project does not exist
a single object
PUT
/api/v1/projects/
(int: id)/
¶Modifies a selected project.
id – id of the project to update
payload – the data to override the project with
the updated project
DELETE
/api/v1/projects/
(int: id)/
¶Removes a selected project.
id – id of a requested project
Authorization – Bearer JWT
200 OK – when project exists and was deleted
404 Not Found – when requested project does not exist
whether the operation has been successful
Returns data about a requested tag.
id – id of a requested tag
a single object
Modifies a selected tag.
id – id of the tag to update
payload – the data to override the tag’s with
the updated tag object
Removes a selected tag.
id – id of a requested tag
whether the operation has been successful
GET
/api/v1/users/
¶Lists all users.
a list of users
POST
/api/v1/users/
¶Creates a new user.
login – login for the new user
password – password for the new user
full_name – full name for the new user (optional)
email – an email address for the new user (optional)
a newly created user
GET
/api/v1/users/
(int: id)/
¶Returns data about a requested user.
id – id of a requested user
a single object
PUT
/api/v1/users/
(int: id)/
¶Modifies a selected user.
id – id of the user to update
payload – the data to override the user with
the updated user
DELETE
/api/v1/users/
(int: id)/
¶Removes a selected user.
id – id of a requested user
whether the operation has been successful
GET
/api/v1/workspaces/
¶Lists all workspaces.
search – lists only workspaces that contain the name like search
a list of workspaces
POST
/api/v1/workspaces/
¶Creates a new workspaces.
name – a name/title for the workspace
description – a description of the workspace and it’s purpose
a newly created workspace
GET
/api/v1/workspaces/
(int: id)/
¶Returns data about a requested workspace.
id – id of a requested workspace
a single object
PUT
/api/v1/workspaces/
(int: id)/
¶Modifies a selected workspace.
id – id of the workspace to update
payload – the data to override the workspace with
the updated project
DELETE
/api/v1/workspaces/
(int: id)/
¶Removes a selected workspace.
id – id of a requested workspace
whether the operation has been successful
maisie.resources.models.
Models
(config=None)¶Represents an action for managing models.
download
(id)¶Downloads requested model.
id (int
) – id of the model to download
get
(id)¶Fetches a single model.
id (int
) – id of the model to get
list
requested model
get_all
(query=None, page=None, per_page=None)¶Fetches all models that satisfy some condition.
query – query string
page – number of the page used in pagination
per_page – number of the items to be fetched
a list of returned models
update
(id, data)¶Update selected model.
id (int
) – id of the model to put
data (dict
) – dictionary
upload
(name, filename, hyperparameters, parameters, metrics, private=False, dataset_name='', dataset_description='')¶Posts a single model.
name (str
) – name of model to upload
filename (str
) – path to file with a model
hyperparameters (Union
[str
, dict
]) – dictionary or path to file with hyperparameters
metrics (Union
[str
, dict
]) – dictionary or path to file with metrics
private (bool
) –
dataset_name (str
) –
dataset_description (str
) –
posted model
maisie.resources.projects.
Projects
(config=None)¶create
(name, description, git_url)¶Creates and posts a new project
name (str
) – name of a project to create
desription – description of a project to create
git_url (str
) – path to git repository with the project
created project
delete
(id)¶Deletes selected project.
:type id: int
:param id: id of the project to delete
deleted project
get
(id)¶Fetches a single project
id (int
) – id of the project to get
requested project
get_all
(query=None, page=None, per_page=None)¶Fetches all projects that satisfy some condition.
query – query string
page – number of the page used in pagination
per_page – number of the items to be fetched
a list of returned projects
selected
¶update
(id, data)¶Updates selected project.
:type id: int
:param id: id of project to update
:type data: dict
:param data: dictionary
updated project
maisie.resources.users.
Users
(config=None)¶create
(login, name, email, password)¶Creates and posts a new user
login – login of a user to create
name – name of a user to create
email – email of user to create
password – password of user to create
created user
detele
(id)¶Deletes selected user.
:type id: int
:param id: id of the user to delete
deleted user
get
(id)¶Fetches a single user
id (int
) – id of the user to get
requested user
get_all
(query=None, page=None, per_page=None)¶Fetches all users that satisfy some condition.
query – query string
page – number of the page used in pagination
per_page – number of the items to be fetched
a list of returned users
update
(id, data)¶Updates selected user.
:type id: int
:param id: id of user to update
:type data: dict
:param data: dictionary
updated user
maisie.core.
BaseAction
(config=None)¶Base class for actions exposed both in package and for CLI.
_BaseAction__check_config
(config)¶maisie.core.
Config
(filename=None, dictionary=None)¶Manages and pre-loads configuration from all available sources.
_fetch_from_dict
(dictionary)¶Populates the Config() object with attributes loaded from a given dictionary.
dictionary (dict
) – a structured key-value paired configuration object.
Keys not present in PERMITTED_SETTINGS will be omitted.
None
_fetch_from_env_variables
()¶Populates the Config() object with attributes loaded from the system’s envioronment variables.
None
_fetch_from_file
(filename)¶Populates the Config() object with attributes loaded from a given file.
filename (str
) – path to the configuration file. Use of an absolute
instead of a relative path is recommended.
None
_fetch_scan_directory
()¶Traverses the local directory tree in search of compatible configuration files.
None
_setsource
(key, value)¶auth
¶Authenticates and returns an instance of AuthManager.
fetch
(filename=None, dictionary=None, disable_env=False)¶Populates the Config() object with attributes from multiple sources.
When both filename and dicionary are provided, the configuration file is processed first and then the keys from the dictionary will be evaluated.
filename (Optional
[str
]) – path to the configuration file. Use of an absolute
instead of a relative path is recommended.
dictionary (Optional
[dict
]) – a structured key-value paired configuration object.
Keys not present in PERMITTED_SETTINGS will be omitted.
disable_env (bool
) – whether to disable fetching configuration from
environment variables.
None
getsource
(key)¶headers
¶Returns HTTP Headers present in all requests sent to the specified target url.
maisie.utils.auth.
AuthManager
(api_url, login, password=None, app_token=None, ssh_key=None, enforce_ssh=False)¶_auth_via_app_token
()¶_auth_via_password
()¶_auth_via_ssh_key
()¶logged_in
¶bool
perform_auth
(channels=['ssh_key', 'app_token', 'password'])¶refresh_token
(old_token)¶Refreshes the token using the old one.
old_token (str
) –
str
a refreshed JWT.
retrieve_token
()¶Retrieves the token via available authentication methods.
None
token
¶str
token_active
¶bool
user_id
¶int
maisie.utils.git.
GitProvider
(path=None)¶Provides an interface for interacting with git repositories.
active_branch
¶Returns the name of the active branch.
str
is_dirty
¶Checks whether there are uncommited changes in the repository.
bool
latest_commit
¶Returns the hash of a latest commit in the active branch.
str
remotes
(include_name=True, include_url=True)¶Retrieves a list of remotes defined in the repository.
include_name – whether to include the names of remotes
include_url – whether to include the urls of remotes
list
a list of remotes in a requested schema
repository
¶Returns the GitPython object of a selected repository.
object