From 5354c7f3ea35ba2b379b192d8a91a7f5a557b2ba Mon Sep 17 00:00:00 2001 From: Pedro Crespo-Valero <32402063+pcrespov@users.noreply.github.com> Date: Wed, 19 Oct 2022 13:38:48 +0200 Subject: [PATCH] v0.5.0 (beta): adds get_job_output_logfile and updates doc (#27) API version 0.4.0 --- .env-template | 6 +- .github/PULL_REQUEST_TEMPLATE.md | 35 +- .github/workflows/build-n-publish.yml | 52 + .github/workflows/deploy.yml | 38 - .github/workflows/test.yml | 36 +- .pylintrc | 604 ++++++++ Makefile | 128 +- NOTES.md | 25 + README.md | 37 +- api/openapi.json | 127 +- docs/README.md | 39 +- docs/md/BodyUploadFileV0FilesContentPut.md | 8 +- docs/md/File.md | 16 +- docs/md/FilesApi.md | 107 +- docs/md/Groups.md | 12 +- docs/md/HTTPValidationError.md | 8 +- docs/md/Job.md | 22 +- docs/md/JobInputs.md | 8 +- docs/md/JobOutputs.md | 10 +- docs/md/JobStatus.md | 20 +- docs/md/Meta.md | 18 +- docs/md/MetaApi.md | 19 +- docs/md/Profile.md | 20 +- docs/md/ProfileUpdate.md | 10 +- docs/md/Solver.md | 20 +- docs/md/SolversApi.md | 420 ++--- docs/md/TaskStates.md | 6 +- docs/md/UserRoleEnum.md | 6 +- docs/md/UsersApi.md | 44 +- docs/md/UsersGroup.md | 12 +- docs/md/ValidationError.md | 12 +- docs/md/code_samples/FilesApi.ipynb | 123 +- docs/md/code_samples/MetaApi.ipynb | 24 +- docs/md/code_samples/SolversApi.ipynb | 1046 +++++++++++++ docs/md/code_samples/UsersApi.ipynb | 77 +- .../tutorials/BasicTutorial.ipynb | 492 ++++++ docs/md/tutorials/BasicTutorial.md | 64 +- noxfile.py | 2 +- osparc/__init__.py | 10 +- osparc/api/files_api.py | 232 +-- osparc/api/meta_api.py | 44 +- osparc/api/solvers_api.py | 1347 +++++++++++------ osparc/api/users_api.py | 112 +- osparc/api_client.py | 419 ++--- osparc/configuration.py | 76 +- osparc/exceptions.py | 14 +- osparc/models/__init__.py | 6 +- osparc/models/_any_of.py | 4 +- .../body_upload_file_v0_files_content_put.py | 38 +- osparc/models/file.py | 59 +- osparc/models/groups.py | 50 +- osparc/models/http_validation_error.py | 30 +- osparc/models/job.py | 216 ++- osparc/models/job_inputs.py | 42 +- osparc/models/job_outputs.py | 55 +- osparc/models/job_status.py | 104 +- osparc/models/meta.py | 126 +- osparc/models/profile.py | 84 +- osparc/models/profile_update.py | 36 +- osparc/models/solver.py | 140 +- osparc/models/task_states.py | 40 +- osparc/models/user_role_enum.py | 31 +- osparc/models/users_group.py | 58 +- osparc/models/validation_error.py | 66 +- osparc/rest.py | 295 ++-- ...irements-tools.txt => requirements-dev.txt | 6 +- requirements-tests.txt | 5 +- scripts/openapi-generator-cli.bash | 38 + setup.cfg | 4 +- setup.py | 4 +- test/conftest.py | 6 +- ...t_body_upload_file_v0_files_content_put.py | 23 +- test/test_file.py | 25 +- test/test_files_api.py | 2 +- test/test_groups.py | 62 +- test/test_http_validation_error.py | 29 +- test/test_job.py | 51 +- test/test_job_inputs.py | 23 +- test/test_job_outputs.py | 26 +- test/test_job_status.py | 41 +- test/test_meta_api.py | 3 +- test/test_profile.py | 61 +- test/test_profile_update.py | 21 +- test/test_solvers_api.py | 2 +- test/test_task_states.py | 19 +- test/test_user_role_enum.py | 19 +- test/test_users_api.py | 2 +- test/test_users_group.py | 23 +- test/test_validation_error.py | 29 +- 89 files changed, 5741 insertions(+), 2270 deletions(-) create mode 100644 .github/workflows/build-n-publish.yml delete mode 100644 .github/workflows/deploy.yml create mode 100644 .pylintrc create mode 100644 NOTES.md create mode 100644 docs/md/code_samples/SolversApi.ipynb create mode 100644 docs/md/code_samples/tutorials/BasicTutorial.ipynb rename requirements-tools.txt => requirements-dev.txt (73%) create mode 100755 scripts/openapi-generator-cli.bash diff --git a/.env-template b/.env-template index ab182ce7..b12b2b29 100644 --- a/.env-template +++ b/.env-template @@ -3,6 +3,6 @@ # - To expose: export $(grep -v '^#' .env | xargs -0) # -#OSPARC_API_URL=http://127.0.0.1:8000 -#OSPARC_API_KEY=replace-with-api-key -#OSPARC_API_SECRET=replace-with-secret-key \ No newline at end of file +OSPARC_API_URL=http://127.0.0.1:8000 +OSPARC_API_KEY=replace-with-api-key +OSPARC_API_SECRET=replace-with-secret-key \ No newline at end of file diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 4a17b609..1dfbbde7 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,10 +1,20 @@ ## What do these changes do? @@ -31,17 +41,12 @@ e.g. ## Checklist -- [ ] ``test/test_workflows.py`` runs against fake server -- [ ] Is [``api/openapi.json``](./api/openapi.json) up-to-date -- [ ] Auto-doc generated -- [ ] Links to notebooks modified +- [ ] Update [``api/openapi.json``](./api/openapi.json) +- [ ] Update code +- [ ] Update doc +- [ ] Follow NOTES.md](./NOTES.md) diff --git a/.github/workflows/build-n-publish.yml b/.github/workflows/build-n-publish.yml new file mode 100644 index 00000000..a1924bf5 --- /dev/null +++ b/.github/workflows/build-n-publish.yml @@ -0,0 +1,52 @@ +# +# SEE https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/ +# +name: build-n-publish + +on: + push: + tags: + - v[0-9]+.[0-9]+.[0-9]+ + - staging_[a-zA-Z]+[0-9]+ + +jobs: + build-n-publish: + name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up latest Python 3 + uses: actions/setup-python@v4 + with: + python-version: "3.x" + - name: Upgrade package tools + run: >- + python -m pip install -U + pip + setuptools + wheel + - name: Install pypa/build + run: >- + python -m + pip install + build + - name: Build a binary wheel and a source tarball + run: >- + python -m + build + --sdist + --wheel + --outdir dist/ + . + - name: Publish distribution 📦 to *Test* PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.TEST_PYPI_TOKEN }} + repository_url: https://test.pypi.org/legacy/ + verbose: true + - name: Publish distribution 📦 to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.PYPI_TOKEN }} diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml deleted file mode 100644 index e053d447..00000000 --- a/.github/workflows/deploy.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: deploy - -on: - push: - tags: - - v[0-9]+.[0-9]+.[0-9]+ - - staging_[a-zA-Z]+[0-9]+ - -jobs: - deploy: - name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Set up latest Python 3 - uses: actions/setup-python@v2 - with: - python-version: '3.x' - - name: Upgrade package tools - run: >- - python -m pip install -U - pip - setuptools - wheel - - name: Build a binary wheel and a source tarball - run: python setup.py sdist bdist_wheel - - name: Publish distribution 📦 to *Test* PyPI - uses: pypa/gh-action-pypi-publish@release/v1 - with: - user: __token__ - password: ${{ secrets.TEST_PYPI_TOKEN }} - repository_url: https://test.pypi.org/legacy/ - verbose: true - - name: Publish distribution 📦 to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 - with: - user: __token__ - password: ${{ secrets.PYPI_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f4994f9e..3d9bcdd8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,6 +1,6 @@ name: test -on: +on: push: paths-ignore: - "*.md" @@ -23,24 +23,24 @@ jobs: strategy: max-parallel: 4 matrix: - python-version: [3.6, 3.7, 3.8] + python-version: [3.6, 3.7, 3.8, 3.9] steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - name: Pip cache - uses: actions/cache@v2 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-{{ matrix.python-version }} - restore-keys: | - ${{ runner.os }}-pip - - name: Install and Test - run: | - pip install --upgrade nox - nox -s test-${{ matrix.python-version }} + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Pip cache + uses: actions/cache@v3 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-{{ matrix.python-version }} + restore-keys: | + ${{ runner.os }}-pip + - name: Install and Test + run: | + pip install --upgrade nox + nox -s test-${{ matrix.python-version }} # TODO: add coverage # - name: Upload coverage report # uses: codecov/codecov-action@v1 diff --git a/.pylintrc b/.pylintrc new file mode 100644 index 00000000..732f7209 --- /dev/null +++ b/.pylintrc @@ -0,0 +1,604 @@ +[MAIN] + +# Analyse import fallback blocks. This can be used to support both Python 2 and +# 3 compatible code, which means that the block might have code that exists +# only in one or another interpreter, leading to false positives when analysed. +analyse-fallback-blocks=no + +# Load and enable all available extensions. Use --list-extensions to see a list +# all available extensions. +#enable-all-extensions= + +# In error mode, messages with a category besides ERROR or FATAL are +# suppressed, and no reports are done by default. Error mode is compatible with +# disabling specific errors. +#errors-only= + +# Always return a 0 (non-error) status code, even if lint errors are found. +# This is primarily useful in continuous integration scripts. +#exit-zero= + +# A comma-separated list of package or module names from where C extensions may +# be loaded. Extensions are loading into the active Python interpreter and may +# run arbitrary code. +extension-pkg-allow-list= + +# A comma-separated list of package or module names from where C extensions may +# be loaded. Extensions are loading into the active Python interpreter and may +# run arbitrary code. (This is an alternative name to extension-pkg-allow-list +# for backward compatibility.) +extension-pkg-whitelist=pydantic, + orjson, + ujson + +# Return non-zero exit code if any of these messages/categories are detected, +# even if score is above --fail-under value. Syntax same as enable. Messages +# specified are enabled, while categories only check already-enabled messages. +fail-on= + +# Specify a score threshold to be exceeded before program exits with error. +fail-under=10 + +# Interpret the stdin as a python script, whose filename needs to be passed as +# the module_or_package argument. +#from-stdin= + +# Files or directories to be skipped. They should be base names, not paths. +ignore=CVS, + migration + +# Add files or directories matching the regex patterns to the ignore-list. The +# regex matches against paths and can be in Posix or Windows format. +ignore-paths=^.*\\generated_models\\.*$|^.*/generated_models/.*$ + +# Files or directories matching the regex patterns are skipped. The regex +# matches against base names, not paths. The default value ignores Emacs file +# locks +ignore-patterns= + +# List of module names for which member attributes should not be checked +# (useful for modules/projects where namespaces are manipulated during runtime +# and thus existing member attributes cannot be deduced by static analysis). It +# supports qualified module names, as well as Unix pattern matching. +ignored-modules=psycopg2.errors + +# Python code to execute, usually for sys.path manipulation such as +# pygtk.require(). +#init-hook= + +# Use multiple processes to speed up Pylint. Specifying 0 will auto-detect the +# number of processors available to use, and will cap the count on Windows to +# avoid hangs. +jobs=0 + +# Control the amount of potential inferred values when inferring a single +# object. This can help the performance when dealing with large functions or +# complex, nested conditions. +limit-inference-results=100 + +# List of plugins (as comma separated values of python module names) to load, +# usually to register additional checkers. +load-plugins=pylint.extensions.no_self_use + +# Pickle collected data for later comparisons. +persistent=yes + +# Minimum Python version to use for version dependent checks. Will default to +# the version used to run pylint. +py-version=3.9 + +# Discover python modules and packages in the file system subtree. +recursive=no + +# When enabled, pylint would attempt to guess common misconfiguration and emit +# user-friendly hints instead of false-positive error messages. +suggestion-mode=yes + +# Allow loading of arbitrary C extensions. Extensions are imported into the +# active Python interpreter and may run arbitrary code. +unsafe-load-any-extension=no + +# In verbose mode, extra non-checker-related info will be displayed. +#verbose= + + +[REPORTS] + +# Python expression which should return a score less than or equal to 10. You +# have access to the variables 'fatal', 'error', 'warning', 'refactor', +# 'convention', and 'info' which contain the number of messages in each +# category, as well as 'statement' which is the total number of statements +# analyzed. This score is used by the global evaluation report (RP0004). +evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10) + +# Template used to display messages. This is a python new-style format string +# used to format the message information. See doc for all details. +msg-template= + +# Set the output format. Available formats are text, parseable, colorized, json +# and msvs (visual studio). You can also give a reporter class, e.g. +# mypackage.mymodule.MyReporterClass. +#output-format= + +# Tells whether to display a full report or only the messages. +reports=no + +# Activate the evaluation score. +score=yes + + +[MESSAGES CONTROL] + +# Only show warnings with the listed confidence levels. Leave empty to show +# all. Valid levels: HIGH, CONTROL_FLOW, INFERENCE, INFERENCE_FAILURE, +# UNDEFINED. +confidence=HIGH, + CONTROL_FLOW, + INFERENCE, + INFERENCE_FAILURE, + UNDEFINED + +# Disable the message, report, category or checker with the given id(s). You +# can either give multiple identifiers separated by comma (,) or put this +# option multiple times (only on the command line, not in the configuration +# file where it should appear only once). You can also use "--disable=all" to +# disable everything first and then re-enable specific checks. For example, if +# you want to run only the similarities checker, you can use "--disable=all +# --enable=similarities". If you want to run only the classes checker, but have +# no Warning level messages displayed, use "--disable=all --enable=classes +# --disable=W". +disable=R,C,W + +# Enable the message, report, category or checker with the given id(s). You can +# either give multiple identifier separated by comma (,) or put this option +# multiple time (only on the command line, not in the configuration file where +# it should appear only once). See also the "--disable" option for examples. +enable=E + + +[LOGGING] + +# The type of string formatting that logging methods do. `old` means using % +# formatting, `new` is for `{}` formatting. +logging-format-style=old + +# Logging modules to check that the string format arguments are in logging +# function parameter format. +logging-modules=logging + + +[TYPECHECK] + +# List of decorators that produce context managers, such as +# contextlib.contextmanager. Add to this list to register other decorators that +# produce valid context managers. +contextmanager-decorators=contextlib.contextmanager + +# List of members which are set dynamically and missed by pylint inference +# system, and so shouldn't trigger E1101 when accessed. Python regular +# expressions are accepted. +generated-members= + +# Tells whether to warn about missing members when the owner of the attribute +# is inferred to be None. +ignore-none=yes + +# This flag controls whether pylint should warn about no-member and similar +# checks whenever an opaque object is returned when inferring. The inference +# can return multiple potential results while evaluating a Python object, but +# some branches might not be evaluated, which results in partial inference. In +# that case, it might be useful to still emit no-member and other checks for +# the rest of the inferred objects. +ignore-on-opaque-inference=yes + +# List of symbolic message names to ignore for Mixin members. +ignored-checks-for-mixins=no-member, + not-async-context-manager, + not-context-manager, + attribute-defined-outside-init + +# List of class names for which member attributes should not be checked (useful +# for classes with dynamically set attributes). This supports the use of +# qualified names. +ignored-classes=optparse.Values,thread._local,_thread._local + +# Show a hint with possible names when a member name was not found. The aspect +# of finding the hint is based on edit distance. +missing-member-hint=yes + +# The minimum edit distance a name should have in order to be considered a +# similar match for a missing member name. +missing-member-hint-distance=1 + +# The total number of similar names that should be taken in consideration when +# showing a hint for a missing member. +missing-member-max-choices=1 + +# Regex pattern to define which classes are considered mixins. +mixin-class-rgx=.*[Mm]ixin + +# List of decorators that change the signature of a decorated function. +signature-mutators= + + +[REFACTORING] + +# Maximum number of nested blocks for function / method body +max-nested-blocks=5 + +# Complete name of functions that never returns. When checking for +# inconsistent-return-statements if a never returning function is called then +# it will be considered as an explicit return statement and no message will be +# printed. +never-returning-functions=optparse.Values,sys.exit + + +[SIMILARITIES] + +# Comments are removed from the similarity computation +ignore-comments=yes + +# Docstrings are removed from the similarity computation +ignore-docstrings=yes + +# Imports are removed from the similarity computation +ignore-imports=no + +# Signatures are removed from the similarity computation +ignore-signatures=yes + +# Minimum lines number of a similarity. +min-similarity-lines=4 + + +[SPELLING] + +# Limits count of emitted suggestions for spelling mistakes. +max-spelling-suggestions=4 + +# Spelling dictionary name. Available dictionaries: none. To make it work, +# install the 'python-enchant' package. +spelling-dict= + +# List of comma separated words that should be considered directives if they +# appear at the beginning of a comment and should not be checked. +spelling-ignore-comment-directives=fmt: on,fmt: off,noqa:,noqa,nosec,isort:skip,mypy: + +# List of comma separated words that should not be checked. +spelling-ignore-words= + +# A path to a file that contains the private dictionary; one word per line. +spelling-private-dict-file= + +# Tells whether to store unknown words to the private dictionary (see the +# --spelling-private-dict-file option) instead of raising a message. +spelling-store-unknown-words=no + + +[FORMAT] + +# Expected format of line ending, e.g. empty (any line ending), LF or CRLF. +expected-line-ending-format= + +# Regexp for a line that is allowed to be longer than the limit. +ignore-long-lines=^\s*(# )??$ + +# Number of spaces of indent required inside a hanging or continued line. +indent-after-paren=4 + +# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 +# tab). +indent-string=' ' + +# Maximum number of characters on a single line. +max-line-length=150 + +# Maximum number of lines in a module. +max-module-lines=1000 + +# Allow the body of a class to be on the same line as the declaration if body +# contains single statement. +single-line-class-stmt=no + +# Allow the body of an if to be on the same line as the test if there is no +# else. +single-line-if-stmt=no + + +[STRING] + +# This flag controls whether inconsistent-quotes generates a warning when the +# character used as a quote delimiter is used inconsistently within a module. +check-quote-consistency=no + +# This flag controls whether the implicit-str-concat should generate a warning +# on implicit string concatenation in sequences defined over several lines. +check-str-concat-over-line-jumps=no + + +[MISCELLANEOUS] + +# List of note tags to take in consideration, separated by a comma. +notes=FIXME, + XXX, + TODO + +# Regular expression of note tags to take in consideration. +notes-rgx= + + +[VARIABLES] + +# List of additional names supposed to be defined in builtins. Remember that +# you should avoid defining new builtins when possible. +additional-builtins= + +# Tells whether unused global variables should be treated as a violation. +allow-global-unused-variables=yes + +# List of names allowed to shadow builtins +allowed-redefined-builtins= + +# List of strings which can identify a callback function by name. A callback +# name must start or end with one of those strings. +callbacks=cb_, + _cb + +# A regular expression matching the name of dummy variables (i.e. expected to +# not be used). +dummy-variables-rgx=_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_ + +# Argument names that match this expression will be ignored. Default to name +# with leading underscore. +ignored-argument-names=_.*|^ignored_|^unused_ + +# Tells whether we should check for unused import in __init__ files. +init-import=no + +# List of qualified module names which can have objects that can redefine +# builtins. +redefining-builtins-modules=six.moves,past.builtins,future.builtins + + +[DESIGN] + +# List of regular expressions of class ancestor names to ignore when counting +# public methods (see R0903) +exclude-too-few-public-methods= + +# List of qualified class names to ignore when counting class parents (see +# R0901) +ignored-parents= + +# Maximum number of arguments for function / method. +max-args=10 + +# Maximum number of attributes for a class (see R0902). +max-attributes=9 + +# Maximum number of boolean expressions in an if statement (see R0916). +max-bool-expr=5 + +# Maximum number of branch for function / method body. +max-branches=13 + +# Maximum number of locals for function / method body. +max-locals=15 + +# Maximum number of parents for a class (see R0901). +max-parents=7 + +# Maximum number of public methods for a class (see R0904). +max-public-methods=20 + +# Maximum number of return / yield for function / method body. +max-returns=6 + +# Maximum number of statements in function / method body. +max-statements=50 + +# Minimum number of public methods for a class (see R0903). +min-public-methods=2 + + +[EXCEPTIONS] + +# Exceptions that will emit a warning when caught. +overgeneral-exceptions=Exception + + +[IMPORTS] + +# List of modules that can be imported at any level, not just the top level +# one. +allow-any-import-level= + +# Allow wildcard imports from modules that define __all__. +allow-wildcard-with-all=no + +# Deprecated modules which should not be used, separated by a comma. +deprecated-modules=optparse,tkinter.tix + +# Output a graph (.gv or any supported image format) of external dependencies +# to the given file (report RP0402 must not be disabled). +ext-import-graph= + +# Output a graph (.gv or any supported image format) of all (i.e. internal and +# external) dependencies to the given file (report RP0402 must not be +# disabled). +import-graph= + +# Output a graph (.gv or any supported image format) of internal dependencies +# to the given file (report RP0402 must not be disabled). +int-import-graph= + +# Force import order to recognize a module as part of the standard +# compatibility libraries. +known-standard-library= + +# Force import order to recognize a module as part of a third party library. +known-third-party=enchant + +# Couples of modules and preferred modules, separated by a comma. +preferred-modules= + + +[BASIC] + +# Naming style matching correct argument names. +argument-naming-style=snake_case + +# Regular expression matching correct argument names. Overrides argument- +# naming-style. If left empty, argument names will be checked with the set +# naming style. +#argument-rgx= + +# Naming style matching correct attribute names. +attr-naming-style=snake_case + +# Regular expression matching correct attribute names. Overrides attr-naming- +# style. If left empty, attribute names will be checked with the set naming +# style. +#attr-rgx= + +# Bad variable names which should always be refused, separated by a comma. +bad-names=foo, + bar, + baz, + toto, + tutu, + tata + +# Bad variable names regexes, separated by a comma. If names match any regex, +# they will always be refused +bad-names-rgxs= + +# Naming style matching correct class attribute names. +class-attribute-naming-style=any + +# Regular expression matching correct class attribute names. Overrides class- +# attribute-naming-style. If left empty, class attribute names will be checked +# with the set naming style. +#class-attribute-rgx= + +# Naming style matching correct class constant names. +class-const-naming-style=UPPER_CASE + +# Regular expression matching correct class constant names. Overrides class- +# const-naming-style. If left empty, class constant names will be checked with +# the set naming style. +#class-const-rgx= + +# Naming style matching correct class names. +class-naming-style=PascalCase + +# Regular expression matching correct class names. Overrides class-naming- +# style. If left empty, class names will be checked with the set naming style. +#class-rgx= + +# Naming style matching correct constant names. +const-naming-style=UPPER_CASE + +# Regular expression matching correct constant names. Overrides const-naming- +# style. If left empty, constant names will be checked with the set naming +# style. +#const-rgx= + +# Minimum line length for functions/classes that require docstrings, shorter +# ones are exempt. +docstring-min-length=-1 + +# Naming style matching correct function names. +function-naming-style=snake_case + +# Regular expression matching correct function names. Overrides function- +# naming-style. If left empty, function names will be checked with the set +# naming style. +#function-rgx= + +# Good variable names which should always be accepted, separated by a comma. +good-names=i, + j, + k, + ex, + Run, + _ + +# Good variable names regexes, separated by a comma. If names match any regex, +# they will always be accepted +good-names-rgxs= + +# Include a hint for the correct naming format with invalid-name. +include-naming-hint=no + +# Naming style matching correct inline iteration names. +inlinevar-naming-style=any + +# Regular expression matching correct inline iteration names. Overrides +# inlinevar-naming-style. If left empty, inline iteration names will be checked +# with the set naming style. +#inlinevar-rgx= + +# Naming style matching correct method names. +method-naming-style=snake_case + +# Regular expression matching correct method names. Overrides method-naming- +# style. If left empty, method names will be checked with the set naming style. +#method-rgx= + +# Naming style matching correct module names. +module-naming-style=snake_case + +# Regular expression matching correct module names. Overrides module-naming- +# style. If left empty, module names will be checked with the set naming style. +#module-rgx= + +# Colon-delimited sets of names that determine each other's naming style when +# the name regexes allow several styles. +name-group= + +# Regular expression which should only match function or class names that do +# not require a docstring. +no-docstring-rgx=^_ + +# List of decorators that produce properties, such as abc.abstractproperty. Add +# to this list to register other decorators that produce valid properties. +# These decorators are taken in consideration only for invalid-name. +property-classes=abc.abstractproperty + +# Regular expression matching correct type variable names. If left empty, type +# variable names will be checked with the set naming style. +#typevar-rgx= + +# Naming style matching correct variable names. +variable-naming-style=snake_case + +# Regular expression matching correct variable names. Overrides variable- +# naming-style. If left empty, variable names will be checked with the set +# naming style. +#variable-rgx= + + +[CLASSES] + +# Warn about protected attribute access inside special methods +check-protected-access-in-special-methods=no + +# List of method names used to declare (i.e. assign) instance attributes. +defining-attr-methods=__init__, + __new__, + setUp + +# List of member names, which should be excluded from the protected access +# warning. +exclude-protected=_asdict, + _fields, + _replace, + _source, + _make + +# List of valid names for the first argument in a class method. +valid-classmethod-first-arg=cls + +# List of valid names for the first argument in a metaclass class method. +valid-metaclass-classmethod-first-arg=mcs diff --git a/Makefile b/Makefile index e826f9a5..c277aed3 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,13 @@ -.DEFAULT_GOAL := info +.DEFAULT_GOAL := help SHELL := /bin/bash VCS_URL := $(shell git config --get remote.origin.url) VCS_REF := $(shell git rev-parse --short HEAD) NOW_TIMESTAMP := $(shell date -u +"%Y-%m-%dT%H:%M:%SZ") -APP_NAME = $(notdir $(CURDIR)) -APP_VERSION = $(shell python setup.py --version) +APP_NAME := $(notdir $(CURDIR)) +APP_VERSION := $(shell python setup.py --version) + +REPO_BASE_DIR := $(shell git rev-parse --show-toplevel) +SCRIPTS_DIR := $(abspath $(REPO_BASE_DIR)/scripts) help: ## help on rule's targets @@ -12,7 +15,7 @@ help: ## help on rule's targets .PHONY: info -info: +info: ## general informatino # system @echo ' CURDIR : ${CURDIR}' @echo ' NOW_TIMESTAMP : ${NOW_TIMESTAMP}' @@ -24,6 +27,9 @@ info: # package -@echo ' name : ' $(shell python ${CURDIR}/setup.py --name) -@echo ' version : ' $(shell python ${CURDIR}/setup.py --version) + # API + @echo ' title : ' $(shell jq ".info.title" ${CURDIR}/api/openapi.json) + @echo ' version : ' $(shell jq ".info.version" ${CURDIR}/api/openapi.json) # nox @echo nox --list-session @@ -42,6 +48,7 @@ _check_venv_active: # checking whether virtual environment was activated @python3 -c "import sys; assert sys.base_prefix!=sys.prefix" + devenv: .venv .venv: .env # creating virtual-env in $@ @@ -56,13 +63,18 @@ devenv: .venv .PHONY: install-dev -install-dev: _check_venv_active - pip install -r requirements-tests.txt +install-dev: _check_venv_active ## install package for development + pip install -r requirements-dev.txt pip install -e . +.PHONY: pylint +pylint: _check_venv_active ## runs linter (only to check errors. SEE .pylintrc enabled) + pylint --rcfile "$(CURDIR)/.pylintrc" "$(CURDIR)/osparc" + + .PHONY: test-dev -test-dev: _check_venv_active +test-dev: _check_venv_active ## runs tests during development # runs tests for development (e.g w/ pdb) pytest -vv --exitfirst --failed-first --durations=10 --pdb $(CURDIR) @@ -70,34 +82,28 @@ test-dev: _check_venv_active ## NOTEBOOKS ----------------------------------------------------------------------------- .PHONY: notebooks -markdowns:=$(wildcard docs/md/*Api.md) +markdowns = $(wildcard docs/md/*Api.md) +markdowns += $(wildcard docs/md/tutorials/*.md) outputs:=$(subst docs/md,docs/md/code_samples,$(markdowns:.md=.ipynb)) +notebooks: $(outputs) ## converts selected markdowns into notebooks -notebooks: $(outputs) - -# FIXME: should add a link in mds and REMOVE them from notebooks docs/md/code_samples/%.ipynb:docs/md/%.md + # Removing link in markdown + @sed -i "/\b$(notdir $@)\b/d" $< notedown $< >$@ + # Appending link to markdown + @echo "[Download as $(notdir $@)]($(subst docs/,,$@) ':ignore')" >> $< + ## DOCUMENTATION ------------------------------------------------------------------------ -.PHONY: serve-doc -serve-doc: # serves doc +.PHONY: http-doc +http-doc: ## serves doc # starting doc website - cd docs && python3 -m http.server 50001 - - -# TODO: -# - update README.md -# - from ## Documentation for API Endpoints to ## Author ) -# - all paths docs/ -> docs/md/ -# - copy to docs and replaces all docs/ -> md/ -# - move all to docs/md -# - replace :\n`` -> :\n\n`` -# - replace http://localhost https://api.osparc.io + cd docs && python3 -m http.server 50001 --bind 127.0.0.1 ## RELEASE ------------------------------------------------------------------------------- @@ -117,13 +123,17 @@ endef .PHONY: clean -clean: +clean: ## cleans git clean -dxf -e .vscode -.PHONY: build -build: - python setup.py sdist bdist_wheel +.PHONY: dist +dist: ## builds distribution wheel + # installs pypa/build + python -m pip install build + # Build a binary wheel and a source tarball + python -m build --sdist --wheel --outdir dist/ $(CURDIR) + #.PHONY: release @@ -136,16 +146,16 @@ build: .PHONY: build -image: +image: ## builds image $(APP_NAME):$(APP_VERSION) docker build -f Dockerfile -t $(APP_NAME):$(APP_VERSION) $(CURDIR) .PHONY: shell -shell: +shell: ## runs container and opens bash shell docker run -it $(APP_NAME):latest /bin/bash -# RELEASE -------------------------------------------------------------------------------------------------------------------------------------------- +# RELEASE ------------------------------------------------------------------------------- staging_prefix := staging_ prod_prefix := v @@ -189,3 +199,59 @@ release-hotfix: ## Helper to create a hotfix release in Github (usage: make rele @git pull --tags @echo -e "\e[33mOpen the following link to create the $(if $(findstring -staging, $@),staging,production) release:"; @echo -e "\e[32mhttps://github.com/$(_git_get_repo_orga_name)/releases/new?prerelease=$(if $(findstring -staging, $@),1,0)&target=$(_url_encoded_target)&tag=$(_url_encoded_tag)&title=$(_url_encoded_title)&body=$(_url_encoded_logs)"; + + + + +# GENERATION python client ----------------------------------------------------------------------------- +.PHONY: python-client generator-help + +# SEE https://openapi-generator.tech/docs/usage#generate +# SEE https://openapi-generator.tech/docs/generators/python +# +# TODO: put instead to additional-props.yaml and --config=openapi-generator/python-config.yaml +# TODO: copy this code to https://github.com/ITISFoundation/osparc-simcore-python-client/blob/master/Makefile +# +# NOTE: assumes this repo exists +GIT_USER_ID := ITISFoundation +GIT_REPO_ID := osparc-simcore-python-client + +GENERATOR_NAME := python + +ADDITIONAL_PROPS := \ + generateSourceCodeOnly=false\ + hideGenerationTimestamp=true\ + library=urllib3\ + packageName=osparc\ + packageUrl=https://github.com/$(GIT_USER_ID)/${GIT_REPO_ID}.git\ + packageVersion=$(APP_VERSION)\ + projectName=osparc-simcore-python-api +ADDITIONAL_PROPS := $(foreach prop,$(ADDITIONAL_PROPS),$(strip $(prop))) + +null := +space := $(null) # +comma := , + + +python-client: api/openapi.json ## auto-generates client from api/openapi.json specs + # generates + $(SCRIPTS_DIR)/openapi-generator-cli.bash generate \ + --generator-name=$(GENERATOR_NAME) \ + --git-user-id=$(GIT_USER_ID)\ + --git-repo-id=$(GIT_REPO_ID)\ + --http-user-agent="osparc-api/$(APP_VERSION)/python"\ + --input-spec=/local/$< \ + --output=/local \ + --additional-properties=$(subst $(space),$(comma),$(strip $(ADDITIONAL_PROPS)))\ + --package-name=osparc\ + --release-note="Updated to $(APP_VERSION)" + + # formatting code + @black osparc + + +generator-help: ## help on client-api generator + # generate help + @$(SCRIPTS_DIR)/openapi-generator-cli.bash help generate + # generator config help + @$(SCRIPTS_DIR)/openapi-generator-cli.bash config-help -g $(GENERATOR_NAME) diff --git a/NOTES.md b/NOTES.md new file mode 100644 index 00000000..4a52037c --- /dev/null +++ b/NOTES.md @@ -0,0 +1,25 @@ +# NOTES + +For the moment, we have to apply some changes manually until we use [templates](https://openapi-generator.tech/docs/templating) or [customization](https://openapi-generator.tech/docs/customization) + +### Workflow + +- update OAS -> ``api/openapi.json`` +- generate client ``make python-client`` +- Apply patches to the code (SEE ``PATCH ---`` marks in code) +- md doc files + - format all md? + - replace 'YOUR_USERNAME' by 'YOUR_API_KEY_HERE' + - replace 'YOUR_PASSWORD' by 'YOUR_API_SECRET_HERE' + - replace 'http://localhost' by 'https://api.osparc.io' + - replace ``:\n`` -> ``:\n\n`` after titles. Otherwise it docsify fails to render it correctly + - move all to docs/md + - update README.md + - remove generator entry (since some custom changes) + - from '## Documentation for API Endpoints' to '## Author' + - ``Documentation for API Classes`` instead of ``Documentation for API Endpoints`` + - ``Back to API list`` to ``Back to API Classes`` + - ``## Author`` also is different in md/README.md + - remove ```# Defining host is optional and default to https://api.osparc.io +configuration.host = "https://api.osparc.io"``` + - Updates notebooks: ``make notebooks`` \ No newline at end of file diff --git a/README.md b/README.md index 76468f82..53867281 100644 --- a/README.md +++ b/README.md @@ -13,8 +13,8 @@ TODO: activate when service is up and running in production Python client for osparc-simcore public web API -- API version: 0.3.0 -- Package version: 0.4.3 +- API version: 0.4.0 +- Package version: 0.5.0 - Build package: org.openapitools.codegen.languages.PythonClientCodegen ## Requirements @@ -86,31 +86,14 @@ with osparc.ApiClient(cfg) as api_client: ``` -## Documentation for API Endpoints - -All URIs are relative to *http://localhost* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*FilesApi* | [**download_file**](docs/md/FilesApi.md#download_file) | **GET** /v0/files/{file_id}/content | Download File -*FilesApi* | [**get_file**](docs/md/FilesApi.md#get_file) | **GET** /v0/files/{file_id} | Get File -*FilesApi* | [**list_files**](docs/md/FilesApi.md#list_files) | **GET** /v0/files | List Files -*FilesApi* | [**upload_file**](docs/md/md/FilesApi.md#upload_file) | **PUT** /v0/files/content | Upload File -*MetaApi* | [**get_service_metadata**](docs/md/md/MetaApi.md#get_service_metadata) | **GET** /v0/meta | Get Service Metadata -*SolversApi* | [**create_job**](docs/md/SolversApi.md#create_job) | **POST** /v0/solvers/{solver_key}/releases/{version}/jobs | Create Job -*SolversApi* | [**get_job**](docs/md/SolversApi.md#get_job) | **GET** /v0/solvers/{solver_key}/releases/{version}/jobs/{job_id} | Get Job -*SolversApi* | [**get_job_outputs**](docs/md/SolversApi.md#get_job_outputs) | **GET** /v0/solvers/{solver_key}/releases/{version}/jobs/{job_id}/outputs | Get Job Outputs -*SolversApi* | [**get_solver**](docs/md/SolversApi.md#get_solver) | **GET** /v0/solvers/{solver_key}/latest | Get Latest Release of a Solver -*SolversApi* | [**get_solver_release**](docs/md/SolversApi.md#get_solver_release) | **GET** /v0/solvers/{solver_key}/releases/{version} | Get Solver Release -*SolversApi* | [**inspect_job**](docs/md/SolversApi.md#inspect_job) | **POST** /v0/solvers/{solver_key}/releases/{version}/jobs/{job_id}:inspect | Inspect Job -*SolversApi* | [**list_jobs**](docs/md/SolversApi.md#list_jobs) | **GET** /v0/solvers/{solver_key}/releases/{version}/jobs | List Jobs -*SolversApi* | [**list_solver_releases**](docs/md/SolversApi.md#list_solver_releases) | **GET** /v0/solvers/{solver_key}/releases | List Solver Releases -*SolversApi* | [**list_solvers**](docs/md/SolversApi.md#list_solvers) | **GET** /v0/solvers | List Solvers -*SolversApi* | [**list_solvers_releases**](docs/md/SolversApi.md#list_solvers_releases) | **GET** /v0/solvers/releases | Lists All Releases -*SolversApi* | [**start_job**](docs/md/SolversApi.md#start_job) | **POST** /v0/solvers/{solver_key}/releases/{version}/jobs/{job_id}:start | Start Job -*SolversApi* | [**stop_job**](docs/md/SolversApi.md#stop_job) | **POST** /v0/solvers/{solver_key}/releases/{version}/jobs/{job_id}:stop | Stop Job -*UsersApi* | [**get_my_profile**](docs/md/UsersApi.md#get_my_profile) | **GET** /v0/me | Get My Profile -*UsersApi* | [**update_my_profile**](docs/md/UsersApi.md#update_my_profile) | **PUT** /v0/me | Update My Profile +## Documentation for API Classes + +All URIs are relative to *https://api.osparc.io* + +- [MetaApi](docs/md/MetaApi.md) +- [FilesApi](docs/md/FilesApi.md) +- [SolversApi](docs/md/SolversApi.md) +- [UsersApi](docs/md/UsersApi.md) ## Documentation For Models diff --git a/api/openapi.json b/api/openapi.json index 36ab9d54..862b62a4 100644 --- a/api/openapi.json +++ b/api/openapi.json @@ -3,7 +3,7 @@ "info": { "title": "osparc.io web API", "description": "osparc-simcore public web API specifications", - "version": "0.3.0", + "version": "0.4.0", "x-logo": { "url": "https://raw.githubusercontent.com/ITISFoundation/osparc-manual/b809d93619512eb60c827b7e769c6145758378d0/_media/osparc-logo.svg", "altText": "osparc-simcore logo" @@ -107,7 +107,7 @@ "files" ], "summary": "List Files", - "description": "Lists all files stored in the system ", + "description": "Lists all files stored in the system", "operationId": "list_files", "responses": { "200": { @@ -196,7 +196,7 @@ "files" ], "summary": "Get File", - "description": "Gets metadata for a given file resource ", + "description": "Gets metadata for a given file resource", "operationId": "get_file", "parameters": [ { @@ -262,6 +262,12 @@ } ], "responses": { + "307": { + "description": "Successful Response" + }, + "404": { + "description": "File not found" + }, "200": { "description": "Returns a arbitrary binary data", "content": { @@ -278,9 +284,6 @@ } } }, - "404": { - "description": "File not found" - }, "422": { "description": "Validation Error", "content": { @@ -305,7 +308,7 @@ "solvers" ], "summary": "List Solvers", - "description": "Lists all available solvers (latest version) ", + "description": "Lists all available solvers (latest version)", "operationId": "list_solvers", "responses": { "200": { @@ -336,7 +339,7 @@ "solvers" ], "summary": "Lists All Releases", - "description": "Lists all released solvers (all released versions) ", + "description": "Lists all released solvers (all released versions)", "operationId": "list_solvers_releases", "responses": { "200": { @@ -367,7 +370,7 @@ "solvers" ], "summary": "Get Latest Release of a Solver", - "description": "Gets latest release of a solver ", + "description": "Gets latest release of a solver", "operationId": "get_solver", "parameters": [ { @@ -416,7 +419,7 @@ "solvers" ], "summary": "List Solver Releases", - "description": "Lists all releases of a given solver ", + "description": "Lists all releases of a given solver", "operationId": "list_solver_releases", "parameters": [ { @@ -469,7 +472,7 @@ "solvers" ], "summary": "Get Solver Release", - "description": "Gets a specific release of a solver ", + "description": "Gets a specific release of a solver", "operationId": "get_solver_release", "parameters": [ { @@ -990,6 +993,93 @@ } ] } + }, + "/v0/solvers/{solver_key}/releases/{version}/jobs/{job_id}/outputs/logfile": { + "get": { + "tags": [ + "solvers" + ], + "summary": "Get Job Output Logfile", + "description": "Special extra output with persistent logs file for the solver run.\n\nNOTE: this is not a log stream but a predefined output that is only\navailable after the job is done.", + "operationId": "get_job_output_logfile", + "parameters": [ + { + "required": true, + "schema": { + "title": "Solver Key", + "pattern": "^(simcore)/(services)/comp(/[\\w/-]+)+$", + "type": "string" + }, + "name": "solver_key", + "in": "path" + }, + { + "required": true, + "schema": { + "title": "Version", + "pattern": "^(0|[1-9]\\d*)(\\.(0|[1-9]\\d*)){2}(-(0|[1-9]\\d*|\\d*[-a-zA-Z][-\\da-zA-Z]*)(\\.(0|[1-9]\\d*|\\d*[-a-zA-Z][-\\da-zA-Z]*))*)?(\\+[-\\da-zA-Z]+(\\.[-\\da-zA-Z-]+)*)?$", + "type": "string" + }, + "name": "version", + "in": "path" + }, + { + "required": true, + "schema": { + "title": "Job Id", + "type": "string", + "format": "uuid" + }, + "name": "job_id", + "in": "path" + } + ], + "responses": { + "307": { + "description": "Successful Response" + }, + "200": { + "description": "Returns a log file", + "content": { + "application/octet-stream": { + "schema": { + "type": "string", + "format": "binary" + } + }, + "application/zip": { + "schema": { + "type": "string", + "format": "binary" + } + }, + "text/plain": { + "schema": { + "type": "string" + } + } + } + }, + "404": { + "description": "Log not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + }, + "security": [ + { + "HTTPBasic": [] + } + ] + } } }, "components": { @@ -1175,6 +1265,9 @@ { "type": "integer" }, + { + "type": "boolean" + }, { "type": "string" } @@ -1224,6 +1317,9 @@ { "type": "integer" }, + { + "type": "boolean" + }, { "type": "string" } @@ -1317,8 +1413,8 @@ "title": "Released", "type": "object", "additionalProperties": { - "type": "string", - "pattern": "^(0|[1-9]\\d*)(\\.(0|[1-9]\\d*)){2}(-(0|[1-9]\\d*|\\d*[-a-zA-Z][-\\da-zA-Z]*)(\\.(0|[1-9]\\d*|\\d*[-a-zA-Z][-\\da-zA-Z]*))*)?(\\+[-\\da-zA-Z]+(\\.[-\\da-zA-Z-]+)*)?$" + "pattern": "^(0|[1-9]\\d*)(\\.(0|[1-9]\\d*)){2}(-(0|[1-9]\\d*|\\d*[-a-zA-Z][-\\da-zA-Z]*)(\\.(0|[1-9]\\d*|\\d*[-a-zA-Z][-\\da-zA-Z]*))*)?(\\+[-\\da-zA-Z]+(\\.[-\\da-zA-Z-]+)*)?$", + "type": "string" }, "description": "Maps every route's path tag with a released version" }, @@ -1468,7 +1564,7 @@ "format": "uri" } }, - "description": "A released solver with a specific version ", + "description": "A released solver with a specific version", "example": { "id": "simcore/services/comp/isolve", "version": "2.1.1", @@ -1500,7 +1596,8 @@ "ANONYMOUS", "GUEST", "USER", - "TESTER" + "TESTER", + "ADMIN" ], "type": "string", "description": "An enumeration." diff --git a/docs/README.md b/docs/README.md index 4844f82d..5c8929a8 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,4 +1,3 @@ - ![test](https://github.com/ITISFoundation/osparc-simcore-python-client/workflows/test/badge.svg) [![PyPI](https://img.shields.io/pypi/v/osparc)](https://pypi.org/project/osparc/) [![](https://img.shields.io/pypi/status/osparc)](https://pypi.org/project/osparc/) @@ -7,9 +6,8 @@ Python client for osparc-simcore public web API -- API version: 0.3.0 -- Package version: 0.4.3 -- Build package: org.openapitools.codegen.languages.PythonClientCodegen +- API version: 0.4.0 +- Package version: 0.5.0 ## Requirements @@ -35,7 +33,7 @@ import osparc ## Getting Started -Please follow the installation procedure above and then run the following: +Please follow the installation procedure above, create an API key and secret in *https:/osparc.io*, add them as environment variables ``MY_API_KEY``, ``MY_API_SECRET`` and then run the following: ```python import os @@ -46,12 +44,13 @@ from osparc.models import File, Solver, Job, JobStatus, JobInputs, JobOutputs from osparc.api import FilesApi, SolversApi cfg = osparc.Configuration( - host=os.environ.get("OSPARC_API_URL", "http://127.0.0.1:8006"), username=os.environ.get("MY_API_KEY"), password=os.environ.get("MY_API_SECRET"), ) with osparc.ApiClient(cfg) as api_client: + users_api = osparc.UsersApi(api_client) + print(users_api.get_my_profile()) files_api = FilesApi(api_client) input_file: File = files_api.upload_file(file="path/to/input-file.h5") @@ -85,36 +84,18 @@ with osparc.ApiClient(cfg) as api_client: - [Basic tutorial](md/tutorials/BasicTutorial.md) -## Documentation for API Endpoints +## Documentation for API Classes All URIs are relative to *https://api.osparc.io* -Class | Method | HTTP request | Description --------------|-----------------------------------------------------------------------|----------------------------------------------------------------------------|------------------------------- -*FilesApi* | [**download_file**](md/FilesApi.md#download_file) | **GET** /v0/files/{file_id}/content | Download File -*FilesApi* | [**get_file**](md/FilesApi.md#get_file) | **GET** /v0/files/{file_id} | Get File -*FilesApi* | [**list_files**](md/FilesApi.md#list_files) | **GET** /v0/files | List Files -*FilesApi* | [**upload_file**](md/FilesApi.md#upload_file) | **PUT** /v0/files/content | Upload File -*MetaApi* | [**get_service_metadata**](md/MetaApi.md#get_service_metadata) | **GET** /v0/meta | Get Service Metadata -*SolversApi* | [**create_job**](md/SolversApi.md#create_job) | **POST** /v0/solvers/{solver_key}/releases/{version}/jobs | Create Job -*SolversApi* | [**get_job**](md/SolversApi.md#get_job) | **GET** /v0/solvers/{solver_key}/releases/{version}/jobs/{job_id} | Get Job -*SolversApi* | [**get_job_outputs**](md/SolversApi.md#get_job_outputs) | **GET** /v0/solvers/{solver_key}/releases/{version}/jobs/{job_id}/outputs | Get Job Outputs -*SolversApi* | [**get_solver**](md/SolversApi.md#get_solver) | **GET** /v0/solvers/{solver_key}/latest | Get Latest Release of a Solver -*SolversApi* | [**get_solver_release**](md/SolversApi.md#get_solver_release) | **GET** /v0/solvers/{solver_key}/releases/{version} | Get Solver Release -*SolversApi* | [**inspect_job**](md/SolversApi.md#inspect_job) | **POST** /v0/solvers/{solver_key}/releases/{version}/jobs/{job_id}:inspect | Inspect Job -*SolversApi* | [**list_jobs**](md/SolversApi.md#list_jobs) | **GET** /v0/solvers/{solver_key}/releases/{version}/jobs | List Jobs -*SolversApi* | [**list_solver_releases**](md/SolversApi.md#list_solver_releases) | **GET** /v0/solvers/{solver_key}/releases | List Solver Releases -*SolversApi* | [**list_solvers**](md/SolversApi.md#list_solvers) | **GET** /v0/solvers | List Solvers -*SolversApi* | [**list_solvers_releases**](md/SolversApi.md#list_solvers_releases) | **GET** /v0/solvers/releases | Lists All Releases -*SolversApi* | [**start_job**](md/SolversApi.md#start_job) | **POST** /v0/solvers/{solver_key}/releases/{version}/jobs/{job_id}:start | Start Job -*SolversApi* | [**stop_job**](md/SolversApi.md#stop_job) | **POST** /v0/solvers/{solver_key}/releases/{version}/jobs/{job_id}:stop | Stop Job -*UsersApi* | [**get_my_profile**](md/UsersApi.md#get_my_profile) | **GET** /v0/me | Get My Profile -*UsersApi* | [**update_my_profile**](md/UsersApi.md#update_my_profile) | **PUT** /v0/me | Update My Profile +- [MetaApi](md/MetaApi.md) +- [FilesApi](md/FilesApi.md) +- [SolversApi](md/SolversApi.md) +- [UsersApi](md/UsersApi.md) ## Documentation For Models - - [BodyUploadFileV0FilesContentPut](md/BodyUploadFileV0FilesContentPut.md) - [File](md/File.md) - [Groups](md/Groups.md) - [HTTPValidationError](md/HTTPValidationError.md) diff --git a/docs/md/BodyUploadFileV0FilesContentPut.md b/docs/md/BodyUploadFileV0FilesContentPut.md index ac427266..3e071e5b 100644 --- a/docs/md/BodyUploadFileV0FilesContentPut.md +++ b/docs/md/BodyUploadFileV0FilesContentPut.md @@ -1,10 +1,10 @@ # BodyUploadFileV0FilesContentPut ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**file** | **file** | | +| Name | Type | Description | Notes | +| -------- | -------- | ----------- | ----- | +| **file** | **file** | | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API Classes]](../README.md#documentation-for-api-classes) [[Back to README]](../README.md) diff --git a/docs/md/File.md b/docs/md/File.md index 9acb7632..c487bd22 100644 --- a/docs/md/File.md +++ b/docs/md/File.md @@ -2,13 +2,13 @@ Represents a file stored on the server side i.e. a unique reference to a file in the cloud. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **str** | Resource identifier | -**filename** | **str** | Name of the file with extension | -**content_type** | **str** | Guess of type content [EXPERIMENTAL] | [optional] -**checksum** | **str** | MD5 hash of the file's content [EXPERIMENTAL] | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +| Name | Type | Description | Notes | +| ---------------- | ------- | ------------------------------------------------- | ---------- | +| **id** | **str** | Resource identifier | +| **filename** | **str** | Name of the file with extension | +| **content_type** | **str** | Guess of type content [EXPERIMENTAL] | [optional] | +| **checksum** | **str** | MD5 hash of the file's content [EXPERIMENTAL] | [optional] | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API Classes]](../README.md#documentation-for-api-classes) [[Back to README]](../README.md) diff --git a/docs/md/FilesApi.md b/docs/md/FilesApi.md index 2834a8a0..6ffacbd8 100644 --- a/docs/md/FilesApi.md +++ b/docs/md/FilesApi.md @@ -2,12 +2,12 @@ All URIs are relative to *https://api.osparc.io* -Method | HTTP request | Description -------------- | ------------- | ------------- -[**download_file**](FilesApi.md#download_file) | **GET** /v0/files/{file_id}/content | Download File -[**get_file**](FilesApi.md#get_file) | **GET** /v0/files/{file_id} | Get File -[**list_files**](FilesApi.md#list_files) | **GET** /v0/files | List Files -[**upload_file**](FilesApi.md#upload_file) | **PUT** /v0/files/content | Upload File +| Method | HTTP request | Description | +| ---------------------------------------------- | ----------------------------------- | ------------- | +| [**download_file**](FilesApi.md#download_file) | **GET** /v0/files/{file_id}/content | Download File | +| [**get_file**](FilesApi.md#get_file) | **GET** /v0/files/{file_id} | Get File | +| [**list_files**](FilesApi.md#list_files) | **GET** /v0/files | List Files | +| [**upload_file**](FilesApi.md#upload_file) | **PUT** /v0/files/content | Upload File | # **download_file** @@ -31,13 +31,12 @@ configuration = osparc.Configuration() configuration.username = 'YOUR_API_KEY_HERE' configuration.password = 'YOUR_API_SECRET_HERE' -# Defining host is optional and default to https://api.osparc.io -configuration.host = "https://api.osparc.io" + # Enter a context with an instance of the API client with osparc.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = osparc.FilesApi(api_client) - file_id = 'file_id_example' # str | + file_id = '2c04bbb2-a549-4764-9466-1c6c93e3882c' # str | try: # Download File @@ -46,12 +45,11 @@ with osparc.ApiClient(configuration) as api_client: except ApiException as e: print("Exception when calling FilesApi->download_file: %s\n" % e) ``` - ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **file_id** | [**str**](.md)| | +| Name | Type | Description | Notes | +| ----------- | -------------- | ----------- | ----- | +| **file_id** | [**str**](.md) | | ### Return type @@ -67,13 +65,15 @@ Name | Type | Description | Notes - **Accept**: application/octet-stream, text/plain, application/json ### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Returns a arbitrary binary data | - | -**404** | File not found | - | -**422** | Validation Error | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +| Status code | Description | Response headers | +| ----------- | ------------------------------- | ---------------- | +| **307** | Successful Response | - | +| **404** | File not found | - | +| **200** | Returns a arbitrary binary data | - | +| **422** | Validation Error | - | + +[[Back to top]](#) [[Back to API Classes]](../README.md#documentation-for-api-classes) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **get_file** @@ -81,7 +81,7 @@ Name | Type | Description | Notes Get File -Gets metadata for a given file resource +Gets metadata for a given file resource ### Example @@ -98,13 +98,12 @@ configuration = osparc.Configuration() configuration.username = 'YOUR_API_KEY_HERE' configuration.password = 'YOUR_API_SECRET_HERE' -# Defining host is optional and default to https://api.osparc.io -configuration.host = "https://api.osparc.io" + # Enter a context with an instance of the API client with osparc.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = osparc.FilesApi(api_client) - file_id = 'file_id_example' # str | + file_id = '2c04bbb2-a549-4764-9466-1c6c93e3882c' # str | try: # Get File @@ -116,9 +115,9 @@ with osparc.ApiClient(configuration) as api_client: ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **file_id** | [**str**](.md)| | +| Name | Type | Description | Notes | +| ----------- | -------------- | ----------- | ----- | +| **file_id** | [**str**](.md) | | ### Return type @@ -134,13 +133,14 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Successful Response | - | -**404** | File not found | - | -**422** | Validation Error | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +| Status code | Description | Response headers | +| ----------- | ------------------- | ---------------- | +| **200** | Successful Response | - | +| **404** | File not found | - | +| **422** | Validation Error | - | + +[[Back to top]](#) [[Back to API Classes]](../README.md#documentation-for-api-classes) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **list_files** @@ -148,7 +148,7 @@ Name | Type | Description | Notes List Files -Lists all files stored in the system +Lists all files stored in the system ### Example @@ -165,13 +165,12 @@ configuration = osparc.Configuration() configuration.username = 'YOUR_API_KEY_HERE' configuration.password = 'YOUR_API_SECRET_HERE' -# Defining host is optional and default to https://api.osparc.io -configuration.host = "https://api.osparc.io" + # Enter a context with an instance of the API client with osparc.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = osparc.FilesApi(api_client) - + try: # List Files api_response = api_instance.list_files() @@ -197,14 +196,14 @@ This endpoint does not need any parameter. - **Accept**: application/json ### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Successful Response | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +| Status code | Description | Response headers | +| ----------- | ------------------- | ---------------- | +| **200** | Successful Response | - | -# **upload_file** +[[Back to top]](#) [[Back to API Classes]](../README.md#documentation-for-api-classes) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **upload_file** > File upload_file(file, content_length=content_length) Upload File @@ -226,14 +225,13 @@ configuration = osparc.Configuration() configuration.username = 'YOUR_API_KEY_HERE' configuration.password = 'YOUR_API_SECRET_HERE' -# Defining host is optional and default to https://api.osparc.io -configuration.host = "https://api.osparc.io" + # Enter a context with an instance of the API client with osparc.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = osparc.FilesApi(api_client) - file = '/path/to/file' # file | -content_length = 'content_length_example' # str | (optional) + file = '/path/to/file' # file | + content_length = 'content_length_example' # str | (optional) try: # Upload File @@ -245,10 +243,10 @@ content_length = 'content_length_example' # str | (optional) ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **file** | **file**| | - **content_length** | **str**| | [optional] +| Name | Type | Description | Notes | +| ------------------ | -------- | ----------- | ---------- | +| **file** | **file** | | +| **content_length** | **str** | | [optional] | ### Return type @@ -264,10 +262,11 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Successful Response | - | -**422** | Validation Error | - | +| Status code | Description | Response headers | +| ----------- | ------------------- | ---------------- | +| **200** | Successful Response | - | +| **422** | Validation Error | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API Classes]](../README.md#documentation-for-api-classes) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[Download as FilesApi.ipynb](md/code_samples/FilesApi.ipynb ':ignore') diff --git a/docs/md/Groups.md b/docs/md/Groups.md index 93fa0370..6f22cc36 100644 --- a/docs/md/Groups.md +++ b/docs/md/Groups.md @@ -1,12 +1,12 @@ # Groups ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**me** | [**UsersGroup**](UsersGroup.md) | | -**organizations** | [**list[UsersGroup]**](UsersGroup.md) | | [optional] [default to []] -**all** | [**UsersGroup**](UsersGroup.md) | | +| Name | Type | Description | Notes | +| ----------------- | ------------------------------------- | ----------- | -------------------------- | +| **me** | [**UsersGroup**](UsersGroup.md) | | +| **organizations** | [**list[UsersGroup]**](UsersGroup.md) | | [optional] [default to []] | +| **all** | [**UsersGroup**](UsersGroup.md) | | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API Classes]](../README.md#documentation-for-api-classes) [[Back to README]](../README.md) diff --git a/docs/md/HTTPValidationError.md b/docs/md/HTTPValidationError.md index 3a09658d..af19fd27 100644 --- a/docs/md/HTTPValidationError.md +++ b/docs/md/HTTPValidationError.md @@ -1,10 +1,10 @@ # HTTPValidationError ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**errors** | [**list[ValidationError]**](ValidationError.md) | | [optional] +| Name | Type | Description | Notes | +| ---------- | ----------------------------------------------- | ----------- | ---------- | +| **errors** | [**list[ValidationError]**](ValidationError.md) | | [optional] | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API Classes]](../README.md#documentation-for-api-classes) [[Back to README]](../README.md) diff --git a/docs/md/Job.md b/docs/md/Job.md index f1fb6a1a..1b78126f 100644 --- a/docs/md/Job.md +++ b/docs/md/Job.md @@ -1,17 +1,17 @@ # Job ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **str** | | -**name** | **str** | | -**inputs_checksum** | **str** | Input's checksum | -**created_at** | **datetime** | Job creation timestamp | -**runner_name** | **str** | Runner that executes job | -**url** | **str** | Link to get this resource (self) | -**runner_url** | **str** | Link to the solver's job (parent collection) | -**outputs_url** | **str** | Link to the job outputs (sub-collection | +| Name | Type | Description | Notes | +| ------------------- | ------------ | ------------------------------------------------ | ----- | +| **id** | **str** | | +| **name** | **str** | | +| **inputs_checksum** | **str** | Input's checksum | +| **created_at** | **datetime** | Job creation timestamp | +| **runner_name** | **str** | Runner that executes job | +| **url** | **str** | Link to get this resource (self) | +| **runner_url** | **str** | Link to the solver's job (parent collection) | +| **outputs_url** | **str** | Link to the job outputs (sub-collection | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API Classes]](../README.md#documentation-for-api-classes) [[Back to README]](../README.md) diff --git a/docs/md/JobInputs.md b/docs/md/JobInputs.md index 03279182..13fce482 100644 --- a/docs/md/JobInputs.md +++ b/docs/md/JobInputs.md @@ -1,10 +1,10 @@ # JobInputs ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**values** | [**dict(str, AnyOfFilenumberintegerstring)**](AnyOfFilenumberintegerstring.md) | | +| Name | Type | Description | Notes | +| ---------- | -------------------------------------------------------------------------------------------- | ----------- | ----- | +| **values** | [**dict(str, AnyOfFilenumberintegerbooleanstring)**](AnyOfFilenumberintegerbooleanstring.md) | | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API Classes]](../README.md#documentation-for-api-classes) [[Back to README]](../README.md) diff --git a/docs/md/JobOutputs.md b/docs/md/JobOutputs.md index 570299cd..7c977bcd 100644 --- a/docs/md/JobOutputs.md +++ b/docs/md/JobOutputs.md @@ -1,11 +1,11 @@ # JobOutputs ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**job_id** | **str** | Job that produced this output | -**results** | [**dict(str, AnyOfFilenumberintegerstring)**](AnyOfFilenumberintegerstring.md) | | +| Name | Type | Description | Notes | +| ----------- | -------------------------------------------------------------------------------------------- | ----------------------------- | ----- | +| **job_id** | **str** | Job that produced this output | +| **results** | [**dict(str, AnyOfFilenumberintegerbooleanstring)**](AnyOfFilenumberintegerbooleanstring.md) | | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API Classes]](../README.md#documentation-for-api-classes) [[Back to README]](../README.md) diff --git a/docs/md/JobStatus.md b/docs/md/JobStatus.md index aa53e56c..174ed01b 100644 --- a/docs/md/JobStatus.md +++ b/docs/md/JobStatus.md @@ -1,15 +1,15 @@ # JobStatus ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**job_id** | **str** | | -**state** | [**TaskStates**](TaskStates.md) | | -**progress** | **int** | | [optional] [default to 0] -**submitted_at** | **datetime** | | -**started_at** | **datetime** | Timestamp that indicate the moment the solver starts execution or None if the event did not occur | [optional] -**stopped_at** | **datetime** | Timestamp at which the solver finished or killed execution or None if the event did not occur | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +| Name | Type | Description | Notes | +| ---------------- | ------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------- | +| **job_id** | **str** | | +| **state** | [**TaskStates**](TaskStates.md) | | +| **progress** | **int** | | [optional] [default to 0] | +| **submitted_at** | **datetime** | | +| **started_at** | **datetime** | Timestamp that indicate the moment the solver starts execution or None if the event did not occur | [optional] | +| **stopped_at** | **datetime** | Timestamp at which the solver finished or killed execution or None if the event did not occur | [optional] | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API Classes]](../README.md#documentation-for-api-classes) [[Back to README]](../README.md) diff --git a/docs/md/Meta.md b/docs/md/Meta.md index ad3c211d..5e03724f 100644 --- a/docs/md/Meta.md +++ b/docs/md/Meta.md @@ -1,14 +1,14 @@ # Meta ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | | -**version** | **str** | | -**released** | **dict(str, str)** | Maps every route's path tag with a released version | [optional] -**docs_url** | **str** | | [optional] [default to 'https://docs.osparc.io'] -**docs_dev_url** | **str** | | [optional] [default to 'https://api.osparc.io/dev/docs'] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +| Name | Type | Description | Notes | +| ---------------- | ------------------ | ------------------------------------------------------- | -------------------------------------------------------- | +| **name** | **str** | | +| **version** | **str** | | +| **released** | **dict(str, str)** | Maps every route's path tag with a released version | [optional] | +| **docs_url** | **str** | | [optional] [default to 'https://docs.osparc.io'] | +| **docs_dev_url** | **str** | | [optional] [default to 'https://api.osparc.io/dev/docs'] | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API Classes]](../README.md#documentation-for-api-classes) [[Back to README]](../README.md) diff --git a/docs/md/MetaApi.md b/docs/md/MetaApi.md index 9b3e8cb8..a98c6558 100644 --- a/docs/md/MetaApi.md +++ b/docs/md/MetaApi.md @@ -2,13 +2,12 @@ All URIs are relative to *https://api.osparc.io* -Method | HTTP request | Description -------------- | ------------- | ------------- -[**get_service_metadata**](MetaApi.md#get_service_metadata) | **GET** /v0/meta | Get Service Metadata +| Method | HTTP request | Description | +| ----------------------------------------------------------- | ---------------- | -------------------- | +| [**get_service_metadata**](MetaApi.md#get_service_metadata) | **GET** /v0/meta | Get Service Metadata | # **get_service_metadata** - > Meta get_service_metadata() Get Service Metadata @@ -26,7 +25,7 @@ from pprint import pprint with osparc.ApiClient() as api_client: # Create an instance of the API class api_instance = osparc.MetaApi(api_client) - + try: # Get Service Metadata api_response = api_instance.get_service_metadata() @@ -52,9 +51,11 @@ No authorization required - **Accept**: application/json ### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Successful Response | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +| Status code | Description | Response headers | +| ----------- | ------------------- | ---------------- | +| **200** | Successful Response | - | + +[[Back to top]](#) [[Back to API Classes]](../README.md#documentation-for-api-classes) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[Download as MetaApi.ipynb](md/code_samples/MetaApi.ipynb ':ignore') diff --git a/docs/md/Profile.md b/docs/md/Profile.md index 46cb0aa2..2a9691f4 100644 --- a/docs/md/Profile.md +++ b/docs/md/Profile.md @@ -1,15 +1,15 @@ # Profile ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**first_name** | **str** | | [optional] -**last_name** | **str** | | [optional] -**login** | **str** | | -**role** | [**UserRoleEnum**](UserRoleEnum.md) | | -**groups** | [**Groups**](Groups.md) | | [optional] -**gravatar_id** | **str** | md5 hash value of email to retrieve an avatar image from https://www.gravatar.com | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +| Name | Type | Description | Notes | +| --------------- | ----------------------------------- | --------------------------------------------------------------------------------- | ---------- | +| **first_name** | **str** | | [optional] | +| **last_name** | **str** | | [optional] | +| **login** | **str** | | +| **role** | [**UserRoleEnum**](UserRoleEnum.md) | | +| **groups** | [**Groups**](Groups.md) | | [optional] | +| **gravatar_id** | **str** | md5 hash value of email to retrieve an avatar image from https://www.gravatar.com | [optional] | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API Classes]](../README.md#documentation-for-api-classes) [[Back to README]](../README.md) diff --git a/docs/md/ProfileUpdate.md b/docs/md/ProfileUpdate.md index 6eeb80f8..770ef105 100644 --- a/docs/md/ProfileUpdate.md +++ b/docs/md/ProfileUpdate.md @@ -1,11 +1,11 @@ # ProfileUpdate ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**first_name** | **str** | | [optional] -**last_name** | **str** | | [optional] +| Name | Type | Description | Notes | +| -------------- | ------- | ----------- | ---------- | +| **first_name** | **str** | | [optional] | +| **last_name** | **str** | | [optional] | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API Classes]](../README.md#documentation-for-api-classes) [[Back to README]](../README.md) diff --git a/docs/md/Solver.md b/docs/md/Solver.md index 904c3b98..24e96703 100644 --- a/docs/md/Solver.md +++ b/docs/md/Solver.md @@ -1,16 +1,16 @@ # Solver -A released solver with a specific version +A released solver with a specific version ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **str** | Solver identifier | -**version** | **str** | semantic version number of the node | -**title** | **str** | Human readable name | -**description** | **str** | | [optional] -**maintainer** | **str** | | -**url** | **str** | Link to get this resource | +| Name | Type | Description | Notes | +| --------------- | ------- | ----------------------------------- | ---------- | +| **id** | **str** | Solver identifier | +| **version** | **str** | semantic version number of the node | +| **title** | **str** | Human readable name | +| **description** | **str** | | [optional] | +| **maintainer** | **str** | | +| **url** | **str** | Link to get this resource | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API Classes]](../README.md#documentation-for-api-classes) [[Back to README]](../README.md) diff --git a/docs/md/SolversApi.md b/docs/md/SolversApi.md index 466ff3b4..becaf7b6 100644 --- a/docs/md/SolversApi.md +++ b/docs/md/SolversApi.md @@ -2,20 +2,21 @@ All URIs are relative to *https://api.osparc.io* -Method | HTTP request | Description -------------- | ------------- | ------------- -[**create_job**](SolversApi.md#create_job) | **POST** /v0/solvers/{solver_key}/releases/{version}/jobs | Create Job -[**get_job**](SolversApi.md#get_job) | **GET** /v0/solvers/{solver_key}/releases/{version}/jobs/{job_id} | Get Job -[**get_job_outputs**](SolversApi.md#get_job_outputs) | **GET** /v0/solvers/{solver_key}/releases/{version}/jobs/{job_id}/outputs | Get Job Outputs -[**get_solver**](SolversApi.md#get_solver) | **GET** /v0/solvers/{solver_key}/latest | Get Latest Release of a Solver -[**get_solver_release**](SolversApi.md#get_solver_release) | **GET** /v0/solvers/{solver_key}/releases/{version} | Get Solver Release -[**inspect_job**](SolversApi.md#inspect_job) | **POST** /v0/solvers/{solver_key}/releases/{version}/jobs/{job_id}:inspect | Inspect Job -[**list_jobs**](SolversApi.md#list_jobs) | **GET** /v0/solvers/{solver_key}/releases/{version}/jobs | List Jobs -[**list_solver_releases**](SolversApi.md#list_solver_releases) | **GET** /v0/solvers/{solver_key}/releases | List Solver Releases -[**list_solvers**](SolversApi.md#list_solvers) | **GET** /v0/solvers | List Solvers -[**list_solvers_releases**](SolversApi.md#list_solvers_releases) | **GET** /v0/solvers/releases | Lists All Releases -[**start_job**](SolversApi.md#start_job) | **POST** /v0/solvers/{solver_key}/releases/{version}/jobs/{job_id}:start | Start Job -[**stop_job**](SolversApi.md#stop_job) | **POST** /v0/solvers/{solver_key}/releases/{version}/jobs/{job_id}:stop | Stop Job +| Method | HTTP request | Description | +| ------------------------------------------------------------------ | --------------------------------------------------------------------------------- | ------------------------------ | +| [**create_job**](SolversApi.md#create_job) | **POST** /v0/solvers/{solver_key}/releases/{version}/jobs | Create Job | +| [**get_job**](SolversApi.md#get_job) | **GET** /v0/solvers/{solver_key}/releases/{version}/jobs/{job_id} | Get Job | +| [**get_job_output_logfile**](SolversApi.md#get_job_output_logfile) | **GET** /v0/solvers/{solver_key}/releases/{version}/jobs/{job_id}/outputs/logfile | Get Job Output Logfile | +| [**get_job_outputs**](SolversApi.md#get_job_outputs) | **GET** /v0/solvers/{solver_key}/releases/{version}/jobs/{job_id}/outputs | Get Job Outputs | +| [**get_solver**](SolversApi.md#get_solver) | **GET** /v0/solvers/{solver_key}/latest | Get Latest Release of a Solver | +| [**get_solver_release**](SolversApi.md#get_solver_release) | **GET** /v0/solvers/{solver_key}/releases/{version} | Get Solver Release | +| [**inspect_job**](SolversApi.md#inspect_job) | **POST** /v0/solvers/{solver_key}/releases/{version}/jobs/{job_id}:inspect | Inspect Job | +| [**list_jobs**](SolversApi.md#list_jobs) | **GET** /v0/solvers/{solver_key}/releases/{version}/jobs | List Jobs | +| [**list_solver_releases**](SolversApi.md#list_solver_releases) | **GET** /v0/solvers/{solver_key}/releases | List Solver Releases | +| [**list_solvers**](SolversApi.md#list_solvers) | **GET** /v0/solvers | List Solvers | +| [**list_solvers_releases**](SolversApi.md#list_solvers_releases) | **GET** /v0/solvers/releases | Lists All Releases | +| [**start_job**](SolversApi.md#start_job) | **POST** /v0/solvers/{solver_key}/releases/{version}/jobs/{job_id}:start | Start Job | +| [**stop_job**](SolversApi.md#stop_job) | **POST** /v0/solvers/{solver_key}/releases/{version}/jobs/{job_id}:stop | Stop Job | # **create_job** @@ -41,15 +42,14 @@ configuration = osparc.Configuration() configuration.username = 'YOUR_API_KEY_HERE' configuration.password = 'YOUR_API_SECRET_HERE' -# Defining host is optional and default to https://api.osparc.io -configuration.host = "https://api.osparc.io" + # Enter a context with an instance of the API client with osparc.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = osparc.SolversApi(api_client) - solver_key = 'simcore/services/comp/isolve' # str | - version = '1.2.3' # str | - job_inputs = osparc.JobInputs() # JobInputs | + solver_key = 'simcore/services/comp/isolve' # str | + version = '1.2.3' # str | + job_inputs = osparc.JobInputs() # JobInputs | try: # Create Job @@ -61,11 +61,11 @@ with osparc.ApiClient(configuration) as api_client: ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **solver_key** | **str**| | - **version** | **str**| | - **job_inputs** | [**JobInputs**](JobInputs.md)| | +| Name | Type | Description | Notes | +| -------------- | ----------------------------- | ----------- | ----- | +| **solver_key** | **str** | | +| **version** | **str** | | +| **job_inputs** | [**JobInputs**](JobInputs.md) | | ### Return type @@ -81,12 +81,13 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Successful Response | - | -**422** | Validation Error | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +| Status code | Description | Response headers | +| ----------- | ------------------- | ---------------- | +| **200** | Successful Response | - | +| **422** | Validation Error | - | + +[[Back to top]](#) [[Back to API Classes]](../README.md#documentation-for-api-classes) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **get_job** @@ -94,7 +95,7 @@ Name | Type | Description | Notes Get Job -Gets job of a given solver +Gets job of a given solver ### Example @@ -112,15 +113,14 @@ configuration = osparc.Configuration() configuration.username = 'YOUR_API_KEY_HERE' configuration.password = 'YOUR_API_SECRET_HERE' -# Defining host is optional and default to https://api.osparc.io -configuration.host = "https://api.osparc.io" + # Enter a context with an instance of the API client with osparc.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = osparc.SolversApi(api_client) - solver_key = 'simcore/services/comp/isolve' # str | - version = '1.2.3' # str | - job_id = '6d43f058-cb99-4720-833a-be367b766a73' # str | + solver_key = 'simcore/services/comp/isolve' # str | + version = '1.2.3' # str | + job_id = '6d43f058-cb99-4720-833a-be367b766a73' # str | try: # Get Job @@ -132,11 +132,11 @@ with osparc.ApiClient(configuration) as api_client: ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **solver_key** | **str**| | - **version** | **str**| | - **job_id** | [**str**](.md)| | +| Name | Type | Description | Notes | +| -------------- | -------------- | ----------- | ----- | +| **solver_key** | **str** | | +| **version** | **str** | | +| **job_id** | [**str**](.md) | | ### Return type @@ -152,12 +152,85 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Successful Response | - | -**422** | Validation Error | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +| Status code | Description | Response headers | +| ----------- | ------------------- | ---------------- | +| **200** | Successful Response | - | +| **422** | Validation Error | - | + +[[Back to top]](#) [[Back to API Classes]](../README.md#documentation-for-api-classes) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_job_output_logfile** + +> file get_job_output_logfile(solver_key, version, job_id) + +Get Job Output Logfile + +Special extra output with persistent logs file for the solver run. NOTE: this is not a log stream but a predefined output that is only available after the job is done. + +### Example + +* Basic Authentication (HTTPBasic): + +```python +from __future__ import print_function +import time +import osparc +from osparc.rest import ApiException +from pprint import pprint +configuration = osparc.Configuration() +# Configure HTTP basic authorization: HTTPBasic +configuration.username = 'YOUR_API_KEY_HERE' +configuration.password = 'YOUR_API_SECRET_HERE' + + +# Enter a context with an instance of the API client +with osparc.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = osparc.SolversApi(api_client) + solver_key = 'simcore/services/comp/isolve' # str | + version = '1.2.3' # str | + job_id = '6d43f058-cb99-4720-833a-be367b766a73' # str | + + try: + # Get Job Output Logfile + api_response = api_instance.get_job_output_logfile(solver_key, version, job_id) + pprint(api_response) + except ApiException as e: + print("Exception when calling SolversApi->get_job_output_logfile: %s\n" % e) +``` + +### Parameters + +| Name | Type | Description | Notes | +| -------------- | -------------- | ----------- | ----- | +| **solver_key** | **str** | | +| **version** | **str** | | +| **job_id** | [**str**](.md) | | + +### Return type + +**file** + +### Authorization + +[HTTPBasic](../README.md#HTTPBasic) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/octet-stream, application/zip, text/plain, application/json + +### HTTP response details + +| Status code | Description | Response headers | +| ----------- | ------------------- | ---------------- | +| **307** | Successful Response | - | +| **200** | Returns a log file | - | +| **404** | Log not found | - | +| **422** | Validation Error | - | + +[[Back to top]](#) [[Back to API Classes]](../README.md#documentation-for-api-classes) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **get_job_outputs** @@ -175,21 +248,19 @@ import time import osparc from osparc.rest import ApiException from pprint import pprint - configuration = osparc.Configuration() # Configure HTTP basic authorization: HTTPBasic configuration.username = 'YOUR_API_KEY_HERE' configuration.password = 'YOUR_API_SECRET_HERE' -# Defining host is optional and default to https://api.osparc.io -configuration.host = "https://api.osparc.io" + # Enter a context with an instance of the API client with osparc.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = osparc.SolversApi(api_client) - solver_key = 'simcore/services/comp/isolve' # str | - version = '1.2.3' # str | - job_id = '6d43f058-cb99-4720-833a-be367b766a73' # str | + solver_key = 'simcore/services/comp/isolve' # str | + version = '1.2.3' # str | + job_id = '6d43f058-cb99-4720-833a-be367b766a73' # str | try: # Get Job Outputs @@ -201,11 +272,11 @@ with osparc.ApiClient(configuration) as api_client: ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **solver_key** | **str**| | - **version** | **str**| | - **job_id** | [**str**](.md)| | +| Name | Type | Description | Notes | +| -------------- | -------------- | ----------- | ----- | +| **solver_key** | **str** | | +| **version** | **str** | | +| **job_id** | [**str**](.md) | | ### Return type @@ -221,20 +292,19 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Successful Response | - | -**422** | Validation Error | - | +| Status code | Description | Response headers | +| ----------- | ------------------- | ---------------- | +| **200** | Successful Response | - | +| **422** | Validation Error | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API Classes]](../README.md#documentation-for-api-classes) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **get_solver** - > Solver get_solver(solver_key) Get Latest Release of a Solver -Gets latest release of a solver +Gets latest release of a solver ### Example @@ -251,13 +321,12 @@ configuration = osparc.Configuration() configuration.username = 'YOUR_API_KEY_HERE' configuration.password = 'YOUR_API_SECRET_HERE' -# Defining host is optional and default to https://api.osparc.io -configuration.host = "https://api.osparc.io" + # Enter a context with an instance of the API client with osparc.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = osparc.SolversApi(api_client) - solver_key = 'simcore/services/comp/isolve' # str | + solver_key = 'simcore/services/comp/isolve' # str | try: # Get Latest Release of a Solver @@ -269,9 +338,9 @@ with osparc.ApiClient(configuration) as api_client: ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **solver_key** | **str**| | +| Name | Type | Description | Notes | +| -------------- | ------- | ----------- | ----- | +| **solver_key** | **str** | | ### Return type @@ -287,20 +356,19 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Successful Response | - | -**422** | Validation Error | - | +| Status code | Description | Response headers | +| ----------- | ------------------- | ---------------- | +| **200** | Successful Response | - | +| **422** | Validation Error | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API Classes]](../README.md#documentation-for-api-classes) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **get_solver_release** - > Solver get_solver_release(solver_key, version) Get Solver Release -Gets a specific release of a solver +Gets a specific release of a solver ### Example @@ -317,14 +385,13 @@ configuration = osparc.Configuration() configuration.username = 'YOUR_API_KEY_HERE' configuration.password = 'YOUR_API_SECRET_HERE' -# Defining host is optional and default to https://api.osparc.io -configuration.host = "https://api.osparc.io" + # Enter a context with an instance of the API client with osparc.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = osparc.SolversApi(api_client) - solver_key = 'simcore/services/comp/isolve' # str | - version = '1.2.3' # str | + solver_key = 'simcore/services/comp/isolve' # str | + version = '1.2.3' # str | try: # Get Solver Release @@ -336,10 +403,10 @@ with osparc.ApiClient(configuration) as api_client: ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **solver_key** | **str**| | - **version** | **str**| | +| Name | Type | Description | Notes | +| -------------- | ------- | ----------- | ----- | +| **solver_key** | **str** | | +| **version** | **str** | | ### Return type @@ -355,12 +422,12 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Successful Response | - | -**422** | Validation Error | - | +| Status code | Description | Response headers | +| ----------- | ------------------- | ---------------- | +| **200** | Successful Response | - | +| **422** | Validation Error | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API Classes]](../README.md#documentation-for-api-classes) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **inspect_job** > JobStatus inspect_job(solver_key, version, job_id) @@ -377,21 +444,19 @@ import time import osparc from osparc.rest import ApiException from pprint import pprint - configuration = osparc.Configuration() # Configure HTTP basic authorization: HTTPBasic configuration.username = 'YOUR_API_KEY_HERE' configuration.password = 'YOUR_API_SECRET_HERE' -# Defining host is optional and default to https://api.osparc.io -configuration.host = "https://api.osparc.io" + # Enter a context with an instance of the API client with osparc.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = osparc.SolversApi(api_client) - solver_key = 'simcore/services/comp/isolve' # str | - version = '1.2.3' # str | - job_id = '6d43f058-cb99-4720-833a-be367b766a73' # str | + solver_key = 'simcore/services/comp/isolve' # str | + version = '1.2.3' # str | + job_id = '6d43f058-cb99-4720-833a-be367b766a73' # str | try: # Inspect Job @@ -403,11 +468,11 @@ with osparc.ApiClient(configuration) as api_client: ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **solver_key** | **str**| | - **version** | **str**| | - **job_id** | [**str**](.md)| | +| Name | Type | Description | Notes | +| -------------- | -------------- | ----------- | ----- | +| **solver_key** | **str** | | +| **version** | **str** | | +| **job_id** | [**str**](.md) | | ### Return type @@ -423,19 +488,19 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Successful Response | - | -**422** | Validation Error | - | +| Status code | Description | Response headers | +| ----------- | ------------------- | ---------------- | +| **200** | Successful Response | - | +| **422** | Validation Error | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API Classes]](../README.md#documentation-for-api-classes) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **list_jobs** > list[Job] list_jobs(solver_key, version) List Jobs -List of all jobs in a specific released solver +List of all jobs in a specific released solver ### Example @@ -452,14 +517,13 @@ configuration = osparc.Configuration() configuration.username = 'YOUR_API_KEY_HERE' configuration.password = 'YOUR_API_SECRET_HERE' -# Defining host is optional and default to https://api.osparc.io -configuration.host = "https://api.osparc.io" + # Enter a context with an instance of the API client with osparc.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = osparc.SolversApi(api_client) - solver_key = 'simcore/services/comp/isolve' # str | - version = '1.2.3' # str | + solver_key = 'simcore/services/comp/isolve' # str | + version = '1.2.3' # str | try: # List Jobs @@ -471,10 +535,10 @@ with osparc.ApiClient(configuration) as api_client: ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **solver_key** | **str**| | - **version** | **str**| | +| Name | Type | Description | Notes | +| -------------- | ------- | ----------- | ----- | +| **solver_key** | **str** | | +| **version** | **str** | | ### Return type @@ -490,19 +554,19 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Successful Response | - | -**422** | Validation Error | - | +| Status code | Description | Response headers | +| ----------- | ------------------- | ---------------- | +| **200** | Successful Response | - | +| **422** | Validation Error | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API Classes]](../README.md#documentation-for-api-classes) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **list_solver_releases** > list[Solver] list_solver_releases(solver_key) List Solver Releases -Lists all releases of a given solver +Lists all releases of a given solver ### Example @@ -519,13 +583,12 @@ configuration = osparc.Configuration() configuration.username = 'YOUR_API_KEY_HERE' configuration.password = 'YOUR_API_SECRET_HERE' -# Defining host is optional and default to https://api.osparc.io -configuration.host = "https://api.osparc.io" + # Enter a context with an instance of the API client with osparc.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = osparc.SolversApi(api_client) - solver_key = 'simcore/services/comp/isolve' # str | + solver_key = 'simcore/services/comp/isolve' # str | try: # List Solver Releases @@ -537,9 +600,9 @@ with osparc.ApiClient(configuration) as api_client: ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **solver_key** | **str**| | +| Name | Type | Description | Notes | +| -------------- | ------- | ----------- | ----- | +| **solver_key** | **str** | | ### Return type @@ -555,20 +618,19 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Successful Response | - | -**422** | Validation Error | - | +| Status code | Description | Response headers | +| ----------- | ------------------- | ---------------- | +| **200** | Successful Response | - | +| **422** | Validation Error | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API Classes]](../README.md#documentation-for-api-classes) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **list_solvers** - > list[Solver] list_solvers() List Solvers -Lists all available solvers (latest version) +Lists all available solvers (latest version) ### Example @@ -585,13 +647,12 @@ configuration = osparc.Configuration() configuration.username = 'YOUR_API_KEY_HERE' configuration.password = 'YOUR_API_SECRET_HERE' -# Defining host is optional and default to https://api.osparc.io -configuration.host = "https://api.osparc.io" + # Enter a context with an instance of the API client with osparc.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = osparc.SolversApi(api_client) - + try: # List Solvers api_response = api_instance.list_solvers() @@ -617,19 +678,18 @@ This endpoint does not need any parameter. - **Accept**: application/json ### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Successful Response | - | +| Status code | Description | Response headers | +| ----------- | ------------------- | ---------------- | +| **200** | Successful Response | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API Classes]](../README.md#documentation-for-api-classes) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **list_solvers_releases** - > list[Solver] list_solvers_releases() Lists All Releases -Lists all released solvers (all released versions) +Lists all released solvers (all released versions) ### Example @@ -646,13 +706,12 @@ configuration = osparc.Configuration() configuration.username = 'YOUR_API_KEY_HERE' configuration.password = 'YOUR_API_SECRET_HERE' -# Defining host is optional and default to https://api.osparc.io -configuration.host = "https://api.osparc.io" + # Enter a context with an instance of the API client with osparc.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = osparc.SolversApi(api_client) - + try: # Lists All Releases api_response = api_instance.list_solvers_releases() @@ -678,14 +737,13 @@ This endpoint does not need any parameter. - **Accept**: application/json ### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Successful Response | - | +| Status code | Description | Response headers | +| ----------- | ------------------- | ---------------- | +| **200** | Successful Response | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API Classes]](../README.md#documentation-for-api-classes) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **start_job** - > JobStatus start_job(solver_key, version, job_id) Start Job @@ -700,21 +758,19 @@ import time import osparc from osparc.rest import ApiException from pprint import pprint - configuration = osparc.Configuration() # Configure HTTP basic authorization: HTTPBasic configuration.username = 'YOUR_API_KEY_HERE' configuration.password = 'YOUR_API_SECRET_HERE' -# Defining host is optional and default to https://api.osparc.io -configuration.host = "https://api.osparc.io" + # Enter a context with an instance of the API client with osparc.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = osparc.SolversApi(api_client) - solver_key = 'simcore/services/comp/isolve' # str | - version = '1.2.3' # str | - job_id = '6d43f058-cb99-4720-833a-be367b766a73' # str | + solver_key = 'simcore/services/comp/isolve' # str | + version = '1.2.3' # str | + job_id = '6d43f058-cb99-4720-833a-be367b766a73' # str | try: # Start Job @@ -726,11 +782,11 @@ with osparc.ApiClient(configuration) as api_client: ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **solver_key** | **str**| | - **version** | **str**| | - **job_id** | [**str**](.md)| | +| Name | Type | Description | Notes | +| -------------- | -------------- | ----------- | ----- | +| **solver_key** | **str** | | +| **version** | **str** | | +| **job_id** | [**str**](.md) | | ### Return type @@ -746,15 +802,14 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Successful Response | - | -**422** | Validation Error | - | +| Status code | Description | Response headers | +| ----------- | ------------------- | ---------------- | +| **200** | Successful Response | - | +| **422** | Validation Error | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API Classes]](../README.md#documentation-for-api-classes) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **stop_job** - > Job stop_job(solver_key, version, job_id) Stop Job @@ -769,21 +824,19 @@ import time import osparc from osparc.rest import ApiException from pprint import pprint - configuration = osparc.Configuration() # Configure HTTP basic authorization: HTTPBasic configuration.username = 'YOUR_API_KEY_HERE' configuration.password = 'YOUR_API_SECRET_HERE' -# Defining host is optional and default to https://api.osparc.io -configuration.host = "https://api.osparc.io" + # Enter a context with an instance of the API client with osparc.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = osparc.SolversApi(api_client) - solver_key = 'simcore/services/comp/isolve' # str | - version = '1.2.3' # str | - job_id = '6d43f058-cb99-4720-833a-be367b766a73' # str | + solver_key = 'simcore/services/comp/isolve' # str | + version = '1.2.3' # str | + job_id = '6d43f058-cb99-4720-833a-be367b766a73' # str | try: # Stop Job @@ -795,11 +848,11 @@ with osparc.ApiClient(configuration) as api_client: ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **solver_key** | **str**| | - **version** | **str**| | - **job_id** | [**str**](.md)| | +| Name | Type | Description | Notes | +| -------------- | -------------- | ----------- | ----- | +| **solver_key** | **str** | | +| **version** | **str** | | +| **job_id** | [**str**](.md) | | ### Return type @@ -815,10 +868,11 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Successful Response | - | -**422** | Validation Error | - | +| Status code | Description | Response headers | +| ----------- | ------------------- | ---------------- | +| **200** | Successful Response | - | +| **422** | Validation Error | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API Classes]](../README.md#documentation-for-api-classes) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[Download as SolversApi.ipynb](md/code_samples/SolversApi.ipynb ':ignore') diff --git a/docs/md/TaskStates.md b/docs/md/TaskStates.md index 97cfcfc6..4194d7cf 100644 --- a/docs/md/TaskStates.md +++ b/docs/md/TaskStates.md @@ -2,9 +2,9 @@ An enumeration. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API Classes]](../README.md#documentation-for-api-classes) [[Back to README]](../README.md) diff --git a/docs/md/UserRoleEnum.md b/docs/md/UserRoleEnum.md index aee4ed16..38c8897e 100644 --- a/docs/md/UserRoleEnum.md +++ b/docs/md/UserRoleEnum.md @@ -2,9 +2,9 @@ An enumeration. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API Classes]](../README.md#documentation-for-api-classes) [[Back to README]](../README.md) diff --git a/docs/md/UsersApi.md b/docs/md/UsersApi.md index 73fd0ef2..83fb99b3 100644 --- a/docs/md/UsersApi.md +++ b/docs/md/UsersApi.md @@ -2,10 +2,10 @@ All URIs are relative to *https://api.osparc.io* -Method | HTTP request | Description -------------- | ------------- | ------------- -[**get_my_profile**](UsersApi.md#get_my_profile) | **GET** /v0/me | Get My Profile -[**update_my_profile**](UsersApi.md#update_my_profile) | **PUT** /v0/me | Update My Profile +| Method | HTTP request | Description | +| ------------------------------------------------------ | -------------- | ----------------- | +| [**get_my_profile**](UsersApi.md#get_my_profile) | **GET** /v0/me | Get My Profile | +| [**update_my_profile**](UsersApi.md#update_my_profile) | **PUT** /v0/me | Update My Profile | # **get_my_profile** @@ -29,13 +29,12 @@ configuration = osparc.Configuration() configuration.username = 'YOUR_API_KEY_HERE' configuration.password = 'YOUR_API_SECRET_HERE' -# Defining host is optional and default to https://api.osparc.io -configuration.host = "https://api.osparc.io" + # Enter a context with an instance of the API client with osparc.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = osparc.UsersApi(api_client) - + try: # Get My Profile api_response = api_instance.get_my_profile() @@ -61,14 +60,13 @@ This endpoint does not need any parameter. - **Accept**: application/json ### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Successful Response | - | +| Status code | Description | Response headers | +| ----------- | ------------------- | ---------------- | +| **200** | Successful Response | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API Classes]](../README.md#documentation-for-api-classes) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **update_my_profile** - > Profile update_my_profile(profile_update) Update My Profile @@ -88,13 +86,12 @@ configuration = osparc.Configuration() configuration.username = 'YOUR_API_KEY_HERE' configuration.password = 'YOUR_API_SECRET_HERE' -# Defining host is optional and default to https://api.osparc.io -configuration.host = "https://api.osparc.io" + # Enter a context with an instance of the API client with osparc.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = osparc.UsersApi(api_client) - profile_update = osparc.ProfileUpdate() # ProfileUpdate | + profile_update = osparc.ProfileUpdate() # ProfileUpdate | try: # Update My Profile @@ -106,9 +103,9 @@ with osparc.ApiClient(configuration) as api_client: ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **profile_update** | [**ProfileUpdate**](ProfileUpdate.md)| | +| Name | Type | Description | Notes | +| ------------------ | ------------------------------------- | ----------- | ----- | +| **profile_update** | [**ProfileUpdate**](ProfileUpdate.md) | | ### Return type @@ -124,10 +121,11 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Successful Response | - | -**422** | Validation Error | - | +| Status code | Description | Response headers | +| ----------- | ------------------- | ---------------- | +| **200** | Successful Response | - | +| **422** | Validation Error | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API Classes]](../README.md#documentation-for-api-classes) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[Download as UsersApi.ipynb](md/code_samples/UsersApi.ipynb ':ignore') diff --git a/docs/md/UsersGroup.md b/docs/md/UsersGroup.md index 4ad7cf6b..6e6e1431 100644 --- a/docs/md/UsersGroup.md +++ b/docs/md/UsersGroup.md @@ -1,12 +1,12 @@ # UsersGroup ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**gid** | **str** | | -**label** | **str** | | -**description** | **str** | | [optional] +| Name | Type | Description | Notes | +| --------------- | ------- | ----------- | ---------- | +| **gid** | **str** | | +| **label** | **str** | | +| **description** | **str** | | [optional] | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API Classes]](../README.md#documentation-for-api-classes) [[Back to README]](../README.md) diff --git a/docs/md/ValidationError.md b/docs/md/ValidationError.md index 37dcf840..eab12634 100644 --- a/docs/md/ValidationError.md +++ b/docs/md/ValidationError.md @@ -1,12 +1,12 @@ # ValidationError ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**loc** | **list[str]** | | -**msg** | **str** | | -**type** | **str** | | +| Name | Type | Description | Notes | +| -------- | ------------- | ----------- | ----- | +| **loc** | **list[str]** | | +| **msg** | **str** | | +| **type** | **str** | | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API Classes]](../README.md#documentation-for-api-classes) [[Back to README]](../README.md) diff --git a/docs/md/code_samples/FilesApi.ipynb b/docs/md/code_samples/FilesApi.ipynb index 17cc3fff..ad77e437 100644 --- a/docs/md/code_samples/FilesApi.ipynb +++ b/docs/md/code_samples/FilesApi.ipynb @@ -2,19 +2,19 @@ "cells": [ { "cell_type": "markdown", - "id": "conditional-cornell", + "id": "50cff3d2", "metadata": {}, "source": [ "# osparc.FilesApi\n", "\n", "All URIs are relative to *https://api.osparc.io*\n", "\n", - "Method | HTTP request | Description\n", - "------------- | ------------- | -------------\n", - "[**download_file**](FilesApi.md#download_file) | **GET** /v0/files/{file_id}/content | Download File\n", - "[**get_file**](FilesApi.md#get_file) | **GET** /v0/files/{file_id} | Get File\n", - "[**list_files**](FilesApi.md#list_files) | **GET** /v0/files | List Files\n", - "[**upload_file**](FilesApi.md#upload_file) | **PUT** /v0/files/content | Upload File\n", + "| Method | HTTP request | Description |\n", + "| ---------------------------------------------- | ----------------------------------- | ------------- |\n", + "| [**download_file**](FilesApi.md#download_file) | **GET** /v0/files/{file_id}/content | Download File |\n", + "| [**get_file**](FilesApi.md#get_file) | **GET** /v0/files/{file_id} | Get File |\n", + "| [**list_files**](FilesApi.md#list_files) | **GET** /v0/files | List Files |\n", + "| [**upload_file**](FilesApi.md#upload_file) | **PUT** /v0/files/content | Upload File |\n", "\n", "\n", "# **download_file**\n", @@ -31,7 +31,7 @@ { "cell_type": "code", "execution_count": null, - "id": "seasonal-physics", + "id": "0da6c96a", "metadata": {}, "outputs": [], "source": [ @@ -45,13 +45,12 @@ "configuration.username = 'YOUR_API_KEY_HERE'\n", "configuration.password = 'YOUR_API_SECRET_HERE'\n", "\n", - "# Defining host is optional and default to https://api.osparc.io\n", - "configuration.host = \"https://api.osparc.io\"\n", + "\n", "# Enter a context with an instance of the API client\n", "with osparc.ApiClient(configuration) as api_client:\n", " # Create an instance of the API class\n", " api_instance = osparc.FilesApi(api_client)\n", - " file_id = 'file_id_example' # str | \n", + " file_id = '2c04bbb2-a549-4764-9466-1c6c93e3882c' # str |\n", "\n", " try:\n", " # Download File\n", @@ -63,14 +62,14 @@ }, { "cell_type": "markdown", - "id": "alert-functionality", + "id": "a36a2289", "metadata": {}, "source": [ "### Parameters\n", "\n", - "Name | Type | Description | Notes\n", - "------------- | ------------- | ------------- | -------------\n", - " **file_id** | [**str**](.md)| | \n", + "| Name | Type | Description | Notes |\n", + "| ----------- | -------------- | ----------- | ----- |\n", + "| **file_id** | [**str**](.md) | |\n", "\n", "### Return type\n", "\n", @@ -86,13 +85,15 @@ " - **Accept**: application/octet-stream, text/plain, application/json\n", "\n", "### HTTP response details\n", - "| Status code | Description | Response headers |\n", - "|-------------|-------------|------------------|\n", - "**200** | Returns a arbitrary binary data | - |\n", - "**404** | File not found | - |\n", - "**422** | Validation Error | - |\n", "\n", - "[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)\n", + "| Status code | Description | Response headers |\n", + "| ----------- | ------------------------------- | ---------------- |\n", + "| **307** | Successful Response | - |\n", + "| **404** | File not found | - |\n", + "| **200** | Returns a arbitrary binary data | - |\n", + "| **422** | Validation Error | - |\n", + "\n", + "[[Back to top]](#) [[Back to API Classes]](../README.md#documentation-for-api-classes) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)\n", "\n", "# **get_file**\n", "\n", @@ -100,7 +101,7 @@ "\n", "Get File\n", "\n", - "Gets metadata for a given file resource \n", + "Gets metadata for a given file resource\n", "\n", "### Example\n", "\n", @@ -110,7 +111,7 @@ { "cell_type": "code", "execution_count": null, - "id": "proud-underground", + "id": "2e4ea82b", "metadata": {}, "outputs": [], "source": [ @@ -124,13 +125,12 @@ "configuration.username = 'YOUR_API_KEY_HERE'\n", "configuration.password = 'YOUR_API_SECRET_HERE'\n", "\n", - "# Defining host is optional and default to https://api.osparc.io\n", - "configuration.host = \"https://api.osparc.io\"\n", + "\n", "# Enter a context with an instance of the API client\n", "with osparc.ApiClient(configuration) as api_client:\n", " # Create an instance of the API class\n", " api_instance = osparc.FilesApi(api_client)\n", - " file_id = 'file_id_example' # str | \n", + " file_id = '2c04bbb2-a549-4764-9466-1c6c93e3882c' # str |\n", "\n", " try:\n", " # Get File\n", @@ -142,14 +142,14 @@ }, { "cell_type": "markdown", - "id": "diagnostic-protection", + "id": "17bea9a5", "metadata": {}, "source": [ "### Parameters\n", "\n", - "Name | Type | Description | Notes\n", - "------------- | ------------- | ------------- | -------------\n", - " **file_id** | [**str**](.md)| | \n", + "| Name | Type | Description | Notes |\n", + "| ----------- | -------------- | ----------- | ----- |\n", + "| **file_id** | [**str**](.md) | |\n", "\n", "### Return type\n", "\n", @@ -165,13 +165,14 @@ " - **Accept**: application/json\n", "\n", "### HTTP response details\n", - "| Status code | Description | Response headers |\n", - "|-------------|-------------|------------------|\n", - "**200** | Successful Response | - |\n", - "**404** | File not found | - |\n", - "**422** | Validation Error | - |\n", "\n", - "[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)\n", + "| Status code | Description | Response headers |\n", + "| ----------- | ------------------- | ---------------- |\n", + "| **200** | Successful Response | - |\n", + "| **404** | File not found | - |\n", + "| **422** | Validation Error | - |\n", + "\n", + "[[Back to top]](#) [[Back to API Classes]](../README.md#documentation-for-api-classes) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)\n", "\n", "# **list_files**\n", "\n", @@ -179,7 +180,7 @@ "\n", "List Files\n", "\n", - "Lists all files stored in the system \n", + "Lists all files stored in the system\n", "\n", "### Example\n", "\n", @@ -189,7 +190,7 @@ { "cell_type": "code", "execution_count": null, - "id": "suburban-bulgarian", + "id": "e62c1dfb", "metadata": {}, "outputs": [], "source": [ @@ -203,13 +204,12 @@ "configuration.username = 'YOUR_API_KEY_HERE'\n", "configuration.password = 'YOUR_API_SECRET_HERE'\n", "\n", - "# Defining host is optional and default to https://api.osparc.io\n", - "configuration.host = \"https://api.osparc.io\"\n", + "\n", "# Enter a context with an instance of the API client\n", "with osparc.ApiClient(configuration) as api_client:\n", " # Create an instance of the API class\n", " api_instance = osparc.FilesApi(api_client)\n", - " \n", + "\n", " try:\n", " # List Files\n", " api_response = api_instance.list_files()\n", @@ -220,7 +220,7 @@ }, { "cell_type": "markdown", - "id": "alpha-invitation", + "id": "a28c6756", "metadata": {}, "source": [ "### Parameters\n", @@ -240,14 +240,14 @@ " - **Accept**: application/json\n", "\n", "### HTTP response details\n", - "| Status code | Description | Response headers |\n", - "|-------------|-------------|------------------|\n", - "**200** | Successful Response | - |\n", "\n", - "[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)\n", + "| Status code | Description | Response headers |\n", + "| ----------- | ------------------- | ---------------- |\n", + "| **200** | Successful Response | - |\n", "\n", - "# **upload_file**\n", + "[[Back to top]](#) [[Back to API Classes]](../README.md#documentation-for-api-classes) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)\n", "\n", + "# **upload_file**\n", "> File upload_file(file, content_length=content_length)\n", "\n", "Upload File\n", @@ -262,7 +262,7 @@ { "cell_type": "code", "execution_count": null, - "id": "supposed-capture", + "id": "7d0e1bb2", "metadata": {}, "outputs": [], "source": [ @@ -276,14 +276,13 @@ "configuration.username = 'YOUR_API_KEY_HERE'\n", "configuration.password = 'YOUR_API_SECRET_HERE'\n", "\n", - "# Defining host is optional and default to https://api.osparc.io\n", - "configuration.host = \"https://api.osparc.io\"\n", + "\n", "# Enter a context with an instance of the API client\n", "with osparc.ApiClient(configuration) as api_client:\n", " # Create an instance of the API class\n", " api_instance = osparc.FilesApi(api_client)\n", - " file = '/path/to/file' # file | \n", - "content_length = 'content_length_example' # str | (optional)\n", + " file = '/path/to/file' # file |\n", + " content_length = 'content_length_example' # str | (optional)\n", "\n", " try:\n", " # Upload File\n", @@ -295,15 +294,15 @@ }, { "cell_type": "markdown", - "id": "swedish-joyce", + "id": "6ed27c47", "metadata": {}, "source": [ "### Parameters\n", "\n", - "Name | Type | Description | Notes\n", - "------------- | ------------- | ------------- | -------------\n", - " **file** | **file**| | \n", - " **content_length** | **str**| | [optional] \n", + "| Name | Type | Description | Notes |\n", + "| ------------------ | -------- | ----------- | ---------- |\n", + "| **file** | **file** | |\n", + "| **content_length** | **str** | | [optional] |\n", "\n", "### Return type\n", "\n", @@ -319,12 +318,12 @@ " - **Accept**: application/json\n", "\n", "### HTTP response details\n", - "| Status code | Description | Response headers |\n", - "|-------------|-------------|------------------|\n", - "**200** | Successful Response | - |\n", - "**422** | Validation Error | - |\n", + "| Status code | Description | Response headers |\n", + "| ----------- | ------------------- | ---------------- |\n", + "| **200** | Successful Response | - |\n", + "| **422** | Validation Error | - |\n", "\n", - "[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)" + "[[Back to top]](#) [[Back to API Classes]](../README.md#documentation-for-api-classes) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)" ] } ], diff --git a/docs/md/code_samples/MetaApi.ipynb b/docs/md/code_samples/MetaApi.ipynb index 89e05415..65208ef5 100644 --- a/docs/md/code_samples/MetaApi.ipynb +++ b/docs/md/code_samples/MetaApi.ipynb @@ -2,20 +2,19 @@ "cells": [ { "cell_type": "markdown", - "id": "tender-knock", + "id": "ab9a5e1c", "metadata": {}, "source": [ "# osparc.MetaApi\n", "\n", "All URIs are relative to *https://api.osparc.io*\n", "\n", - "Method | HTTP request | Description\n", - "------------- | ------------- | -------------\n", - "[**get_service_metadata**](MetaApi.md#get_service_metadata) | **GET** /v0/meta | Get Service Metadata\n", + "| Method | HTTP request | Description |\n", + "| ----------------------------------------------------------- | ---------------- | -------------------- |\n", + "| [**get_service_metadata**](MetaApi.md#get_service_metadata) | **GET** /v0/meta | Get Service Metadata |\n", "\n", "\n", "# **get_service_metadata**\n", - "\n", "> Meta get_service_metadata()\n", "\n", "Get Service Metadata\n", @@ -26,7 +25,7 @@ { "cell_type": "code", "execution_count": null, - "id": "integral-desktop", + "id": "48f787f6", "metadata": {}, "outputs": [], "source": [ @@ -40,7 +39,7 @@ "with osparc.ApiClient() as api_client:\n", " # Create an instance of the API class\n", " api_instance = osparc.MetaApi(api_client)\n", - " \n", + "\n", " try:\n", " # Get Service Metadata\n", " api_response = api_instance.get_service_metadata()\n", @@ -51,7 +50,7 @@ }, { "cell_type": "markdown", - "id": "collaborative-celtic", + "id": "4811986b", "metadata": {}, "source": [ "### Parameters\n", @@ -71,11 +70,12 @@ " - **Accept**: application/json\n", "\n", "### HTTP response details\n", - "| Status code | Description | Response headers |\n", - "|-------------|-------------|------------------|\n", - "**200** | Successful Response | - |\n", "\n", - "[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)" + "| Status code | Description | Response headers |\n", + "| ----------- | ------------------- | ---------------- |\n", + "| **200** | Successful Response | - |\n", + "\n", + "[[Back to top]](#) [[Back to API Classes]](../README.md#documentation-for-api-classes) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)" ] } ], diff --git a/docs/md/code_samples/SolversApi.ipynb b/docs/md/code_samples/SolversApi.ipynb new file mode 100644 index 00000000..046cb41e --- /dev/null +++ b/docs/md/code_samples/SolversApi.ipynb @@ -0,0 +1,1046 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "a2bb0048", + "metadata": {}, + "source": [ + "# osparc.SolversApi\n", + "\n", + "All URIs are relative to *https://api.osparc.io*\n", + "\n", + "| Method | HTTP request | Description |\n", + "| ------------------------------------------------------------------ | --------------------------------------------------------------------------------- | ------------------------------ |\n", + "| [**create_job**](SolversApi.md#create_job) | **POST** /v0/solvers/{solver_key}/releases/{version}/jobs | Create Job |\n", + "| [**get_job**](SolversApi.md#get_job) | **GET** /v0/solvers/{solver_key}/releases/{version}/jobs/{job_id} | Get Job |\n", + "| [**get_job_output_logfile**](SolversApi.md#get_job_output_logfile) | **GET** /v0/solvers/{solver_key}/releases/{version}/jobs/{job_id}/outputs/logfile | Get Job Output Logfile |\n", + "| [**get_job_outputs**](SolversApi.md#get_job_outputs) | **GET** /v0/solvers/{solver_key}/releases/{version}/jobs/{job_id}/outputs | Get Job Outputs |\n", + "| [**get_solver**](SolversApi.md#get_solver) | **GET** /v0/solvers/{solver_key}/latest | Get Latest Release of a Solver |\n", + "| [**get_solver_release**](SolversApi.md#get_solver_release) | **GET** /v0/solvers/{solver_key}/releases/{version} | Get Solver Release |\n", + "| [**inspect_job**](SolversApi.md#inspect_job) | **POST** /v0/solvers/{solver_key}/releases/{version}/jobs/{job_id}:inspect | Inspect Job |\n", + "| [**list_jobs**](SolversApi.md#list_jobs) | **GET** /v0/solvers/{solver_key}/releases/{version}/jobs | List Jobs |\n", + "| [**list_solver_releases**](SolversApi.md#list_solver_releases) | **GET** /v0/solvers/{solver_key}/releases | List Solver Releases |\n", + "| [**list_solvers**](SolversApi.md#list_solvers) | **GET** /v0/solvers | List Solvers |\n", + "| [**list_solvers_releases**](SolversApi.md#list_solvers_releases) | **GET** /v0/solvers/releases | Lists All Releases |\n", + "| [**start_job**](SolversApi.md#start_job) | **POST** /v0/solvers/{solver_key}/releases/{version}/jobs/{job_id}:start | Start Job |\n", + "| [**stop_job**](SolversApi.md#stop_job) | **POST** /v0/solvers/{solver_key}/releases/{version}/jobs/{job_id}:stop | Stop Job |\n", + "\n", + "\n", + "# **create_job**\n", + "\n", + "> Job create_job(solver_key, version, job_inputs)\n", + "\n", + "Create Job\n", + "\n", + "Creates a job in a specific release with given inputs. NOTE: This operation does **not** start the job\n", + "\n", + "### Example\n", + "\n", + "* Basic Authentication (HTTPBasic):" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "ec38ebf8", + "metadata": {}, + "outputs": [], + "source": [ + "from __future__ import print_function\n", + "import time\n", + "import osparc\n", + "from osparc.rest import ApiException\n", + "from pprint import pprint\n", + "configuration = osparc.Configuration()\n", + "# Configure HTTP basic authorization: HTTPBasic\n", + "configuration.username = 'YOUR_API_KEY_HERE'\n", + "configuration.password = 'YOUR_API_SECRET_HERE'\n", + "\n", + "\n", + "# Enter a context with an instance of the API client\n", + "with osparc.ApiClient(configuration) as api_client:\n", + " # Create an instance of the API class\n", + " api_instance = osparc.SolversApi(api_client)\n", + " solver_key = 'simcore/services/comp/isolve' # str |\n", + " version = '1.2.3' # str |\n", + " job_inputs = osparc.JobInputs() # JobInputs |\n", + "\n", + " try:\n", + " # Create Job\n", + " api_response = api_instance.create_job(solver_key, version, job_inputs)\n", + " pprint(api_response)\n", + " except ApiException as e:\n", + " print(\"Exception when calling SolversApi->create_job: %s\\n\" % e)" + ] + }, + { + "cell_type": "markdown", + "id": "88e70c07", + "metadata": {}, + "source": [ + "### Parameters\n", + "\n", + "| Name | Type | Description | Notes |\n", + "| -------------- | ----------------------------- | ----------- | ----- |\n", + "| **solver_key** | **str** | |\n", + "| **version** | **str** | |\n", + "| **job_inputs** | [**JobInputs**](JobInputs.md) | |\n", + "\n", + "### Return type\n", + "\n", + "[**Job**](Job.md)\n", + "\n", + "### Authorization\n", + "\n", + "[HTTPBasic](../README.md#HTTPBasic)\n", + "\n", + "### HTTP request headers\n", + "\n", + " - **Content-Type**: application/json\n", + " - **Accept**: application/json\n", + "\n", + "### HTTP response details\n", + "\n", + "| Status code | Description | Response headers |\n", + "| ----------- | ------------------- | ---------------- |\n", + "| **200** | Successful Response | - |\n", + "| **422** | Validation Error | - |\n", + "\n", + "[[Back to top]](#) [[Back to API Classes]](../README.md#documentation-for-api-classes) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)\n", + "\n", + "# **get_job**\n", + "\n", + "> Job get_job(solver_key, version, job_id)\n", + "\n", + "Get Job\n", + "\n", + "Gets job of a given solver\n", + "\n", + "### Example\n", + "\n", + "* Basic Authentication (HTTPBasic):" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "57dd127f", + "metadata": {}, + "outputs": [], + "source": [ + "from __future__ import print_function\n", + "import time\n", + "import osparc\n", + "from osparc.rest import ApiException\n", + "from pprint import pprint\n", + "\n", + "configuration = osparc.Configuration()\n", + "# Configure HTTP basic authorization: HTTPBasic\n", + "configuration.username = 'YOUR_API_KEY_HERE'\n", + "configuration.password = 'YOUR_API_SECRET_HERE'\n", + "\n", + "\n", + "# Enter a context with an instance of the API client\n", + "with osparc.ApiClient(configuration) as api_client:\n", + " # Create an instance of the API class\n", + " api_instance = osparc.SolversApi(api_client)\n", + " solver_key = 'simcore/services/comp/isolve' # str |\n", + " version = '1.2.3' # str |\n", + " job_id = '6d43f058-cb99-4720-833a-be367b766a73' # str |\n", + "\n", + " try:\n", + " # Get Job\n", + " api_response = api_instance.get_job(solver_key, version, job_id)\n", + " pprint(api_response)\n", + " except ApiException as e:\n", + " print(\"Exception when calling SolversApi->get_job: %s\\n\" % e)" + ] + }, + { + "cell_type": "markdown", + "id": "fb29b6d4", + "metadata": {}, + "source": [ + "### Parameters\n", + "\n", + "| Name | Type | Description | Notes |\n", + "| -------------- | -------------- | ----------- | ----- |\n", + "| **solver_key** | **str** | |\n", + "| **version** | **str** | |\n", + "| **job_id** | [**str**](.md) | |\n", + "\n", + "### Return type\n", + "\n", + "[**Job**](Job.md)\n", + "\n", + "### Authorization\n", + "\n", + "[HTTPBasic](../README.md#HTTPBasic)\n", + "\n", + "### HTTP request headers\n", + "\n", + " - **Content-Type**: Not defined\n", + " - **Accept**: application/json\n", + "\n", + "### HTTP response details\n", + "\n", + "| Status code | Description | Response headers |\n", + "| ----------- | ------------------- | ---------------- |\n", + "| **200** | Successful Response | - |\n", + "| **422** | Validation Error | - |\n", + "\n", + "[[Back to top]](#) [[Back to API Classes]](../README.md#documentation-for-api-classes) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)\n", + "\n", + "# **get_job_output_logfile**\n", + "\n", + "> file get_job_output_logfile(solver_key, version, job_id)\n", + "\n", + "Get Job Output Logfile\n", + "\n", + "Special extra output with persistent logs file for the solver run. NOTE: this is not a log stream but a predefined output that is only available after the job is done.\n", + "\n", + "### Example\n", + "\n", + "* Basic Authentication (HTTPBasic):" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "95d02d93", + "metadata": {}, + "outputs": [], + "source": [ + "from __future__ import print_function\n", + "import time\n", + "import osparc\n", + "from osparc.rest import ApiException\n", + "from pprint import pprint\n", + "configuration = osparc.Configuration()\n", + "# Configure HTTP basic authorization: HTTPBasic\n", + "configuration.username = 'YOUR_API_KEY_HERE'\n", + "configuration.password = 'YOUR_API_SECRET_HERE'\n", + "\n", + "\n", + "# Enter a context with an instance of the API client\n", + "with osparc.ApiClient(configuration) as api_client:\n", + " # Create an instance of the API class\n", + " api_instance = osparc.SolversApi(api_client)\n", + " solver_key = 'simcore/services/comp/isolve' # str |\n", + " version = '1.2.3' # str |\n", + " job_id = '6d43f058-cb99-4720-833a-be367b766a73' # str |\n", + "\n", + " try:\n", + " # Get Job Output Logfile\n", + " api_response = api_instance.get_job_output_logfile(solver_key, version, job_id)\n", + " pprint(api_response)\n", + " except ApiException as e:\n", + " print(\"Exception when calling SolversApi->get_job_output_logfile: %s\\n\" % e)" + ] + }, + { + "cell_type": "markdown", + "id": "d91c90fc", + "metadata": {}, + "source": [ + "### Parameters\n", + "\n", + "| Name | Type | Description | Notes |\n", + "| -------------- | -------------- | ----------- | ----- |\n", + "| **solver_key** | **str** | |\n", + "| **version** | **str** | |\n", + "| **job_id** | [**str**](.md) | |\n", + "\n", + "### Return type\n", + "\n", + "**file**\n", + "\n", + "### Authorization\n", + "\n", + "[HTTPBasic](../README.md#HTTPBasic)\n", + "\n", + "### HTTP request headers\n", + "\n", + " - **Content-Type**: Not defined\n", + " - **Accept**: application/octet-stream, application/zip, text/plain, application/json\n", + "\n", + "### HTTP response details\n", + "\n", + "| Status code | Description | Response headers |\n", + "| ----------- | ------------------- | ---------------- |\n", + "| **307** | Successful Response | - |\n", + "| **200** | Returns a log file | - |\n", + "| **404** | Log not found | - |\n", + "| **422** | Validation Error | - |\n", + "\n", + "[[Back to top]](#) [[Back to API Classes]](../README.md#documentation-for-api-classes) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)\n", + "\n", + "# **get_job_outputs**\n", + "\n", + "> JobOutputs get_job_outputs(solver_key, version, job_id)\n", + "\n", + "Get Job Outputs\n", + "\n", + "### Example\n", + "\n", + "* Basic Authentication (HTTPBasic):" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "bd1c98ae", + "metadata": {}, + "outputs": [], + "source": [ + "from __future__ import print_function\n", + "import time\n", + "import osparc\n", + "from osparc.rest import ApiException\n", + "from pprint import pprint\n", + "configuration = osparc.Configuration()\n", + "# Configure HTTP basic authorization: HTTPBasic\n", + "configuration.username = 'YOUR_API_KEY_HERE'\n", + "configuration.password = 'YOUR_API_SECRET_HERE'\n", + "\n", + "\n", + "# Enter a context with an instance of the API client\n", + "with osparc.ApiClient(configuration) as api_client:\n", + " # Create an instance of the API class\n", + " api_instance = osparc.SolversApi(api_client)\n", + " solver_key = 'simcore/services/comp/isolve' # str |\n", + " version = '1.2.3' # str |\n", + " job_id = '6d43f058-cb99-4720-833a-be367b766a73' # str |\n", + "\n", + " try:\n", + " # Get Job Outputs\n", + " api_response = api_instance.get_job_outputs(solver_key, version, job_id)\n", + " pprint(api_response)\n", + " except ApiException as e:\n", + " print(\"Exception when calling SolversApi->get_job_outputs: %s\\n\" % e)" + ] + }, + { + "cell_type": "markdown", + "id": "41d76b2a", + "metadata": {}, + "source": [ + "### Parameters\n", + "\n", + "| Name | Type | Description | Notes |\n", + "| -------------- | -------------- | ----------- | ----- |\n", + "| **solver_key** | **str** | |\n", + "| **version** | **str** | |\n", + "| **job_id** | [**str**](.md) | |\n", + "\n", + "### Return type\n", + "\n", + "[**JobOutputs**](JobOutputs.md)\n", + "\n", + "### Authorization\n", + "\n", + "[HTTPBasic](../README.md#HTTPBasic)\n", + "\n", + "### HTTP request headers\n", + "\n", + " - **Content-Type**: Not defined\n", + " - **Accept**: application/json\n", + "\n", + "### HTTP response details\n", + "| Status code | Description | Response headers |\n", + "| ----------- | ------------------- | ---------------- |\n", + "| **200** | Successful Response | - |\n", + "| **422** | Validation Error | - |\n", + "\n", + "[[Back to top]](#) [[Back to API Classes]](../README.md#documentation-for-api-classes) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)\n", + "\n", + "# **get_solver**\n", + "> Solver get_solver(solver_key)\n", + "\n", + "Get Latest Release of a Solver\n", + "\n", + "Gets latest release of a solver\n", + "\n", + "### Example\n", + "\n", + "* Basic Authentication (HTTPBasic):" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "f2881695", + "metadata": {}, + "outputs": [], + "source": [ + "from __future__ import print_function\n", + "import time\n", + "import osparc\n", + "from osparc.rest import ApiException\n", + "from pprint import pprint\n", + "configuration = osparc.Configuration()\n", + "# Configure HTTP basic authorization: HTTPBasic\n", + "configuration.username = 'YOUR_API_KEY_HERE'\n", + "configuration.password = 'YOUR_API_SECRET_HERE'\n", + "\n", + "\n", + "# Enter a context with an instance of the API client\n", + "with osparc.ApiClient(configuration) as api_client:\n", + " # Create an instance of the API class\n", + " api_instance = osparc.SolversApi(api_client)\n", + " solver_key = 'simcore/services/comp/isolve' # str |\n", + "\n", + " try:\n", + " # Get Latest Release of a Solver\n", + " api_response = api_instance.get_solver(solver_key)\n", + " pprint(api_response)\n", + " except ApiException as e:\n", + " print(\"Exception when calling SolversApi->get_solver: %s\\n\" % e)" + ] + }, + { + "cell_type": "markdown", + "id": "116f8f6d", + "metadata": {}, + "source": [ + "### Parameters\n", + "\n", + "| Name | Type | Description | Notes |\n", + "| -------------- | ------- | ----------- | ----- |\n", + "| **solver_key** | **str** | |\n", + "\n", + "### Return type\n", + "\n", + "[**Solver**](Solver.md)\n", + "\n", + "### Authorization\n", + "\n", + "[HTTPBasic](../README.md#HTTPBasic)\n", + "\n", + "### HTTP request headers\n", + "\n", + " - **Content-Type**: Not defined\n", + " - **Accept**: application/json\n", + "\n", + "### HTTP response details\n", + "| Status code | Description | Response headers |\n", + "| ----------- | ------------------- | ---------------- |\n", + "| **200** | Successful Response | - |\n", + "| **422** | Validation Error | - |\n", + "\n", + "[[Back to top]](#) [[Back to API Classes]](../README.md#documentation-for-api-classes) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)\n", + "\n", + "# **get_solver_release**\n", + "> Solver get_solver_release(solver_key, version)\n", + "\n", + "Get Solver Release\n", + "\n", + "Gets a specific release of a solver\n", + "\n", + "### Example\n", + "\n", + "* Basic Authentication (HTTPBasic):" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "7ca4a85f", + "metadata": {}, + "outputs": [], + "source": [ + "from __future__ import print_function\n", + "import time\n", + "import osparc\n", + "from osparc.rest import ApiException\n", + "from pprint import pprint\n", + "configuration = osparc.Configuration()\n", + "# Configure HTTP basic authorization: HTTPBasic\n", + "configuration.username = 'YOUR_API_KEY_HERE'\n", + "configuration.password = 'YOUR_API_SECRET_HERE'\n", + "\n", + "\n", + "# Enter a context with an instance of the API client\n", + "with osparc.ApiClient(configuration) as api_client:\n", + " # Create an instance of the API class\n", + " api_instance = osparc.SolversApi(api_client)\n", + " solver_key = 'simcore/services/comp/isolve' # str |\n", + " version = '1.2.3' # str |\n", + "\n", + " try:\n", + " # Get Solver Release\n", + " api_response = api_instance.get_solver_release(solver_key, version)\n", + " pprint(api_response)\n", + " except ApiException as e:\n", + " print(\"Exception when calling SolversApi->get_solver_release: %s\\n\" % e)" + ] + }, + { + "cell_type": "markdown", + "id": "7315afc8", + "metadata": {}, + "source": [ + "### Parameters\n", + "\n", + "| Name | Type | Description | Notes |\n", + "| -------------- | ------- | ----------- | ----- |\n", + "| **solver_key** | **str** | |\n", + "| **version** | **str** | |\n", + "\n", + "### Return type\n", + "\n", + "[**Solver**](Solver.md)\n", + "\n", + "### Authorization\n", + "\n", + "[HTTPBasic](../README.md#HTTPBasic)\n", + "\n", + "### HTTP request headers\n", + "\n", + " - **Content-Type**: Not defined\n", + " - **Accept**: application/json\n", + "\n", + "### HTTP response details\n", + "| Status code | Description | Response headers |\n", + "| ----------- | ------------------- | ---------------- |\n", + "| **200** | Successful Response | - |\n", + "| **422** | Validation Error | - |\n", + "\n", + "[[Back to top]](#) [[Back to API Classes]](../README.md#documentation-for-api-classes) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)\n", + "\n", + "# **inspect_job**\n", + "> JobStatus inspect_job(solver_key, version, job_id)\n", + "\n", + "Inspect Job\n", + "\n", + "### Example\n", + "\n", + "* Basic Authentication (HTTPBasic):" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "198adab8", + "metadata": {}, + "outputs": [], + "source": [ + "from __future__ import print_function\n", + "import time\n", + "import osparc\n", + "from osparc.rest import ApiException\n", + "from pprint import pprint\n", + "configuration = osparc.Configuration()\n", + "# Configure HTTP basic authorization: HTTPBasic\n", + "configuration.username = 'YOUR_API_KEY_HERE'\n", + "configuration.password = 'YOUR_API_SECRET_HERE'\n", + "\n", + "\n", + "# Enter a context with an instance of the API client\n", + "with osparc.ApiClient(configuration) as api_client:\n", + " # Create an instance of the API class\n", + " api_instance = osparc.SolversApi(api_client)\n", + " solver_key = 'simcore/services/comp/isolve' # str |\n", + " version = '1.2.3' # str |\n", + " job_id = '6d43f058-cb99-4720-833a-be367b766a73' # str |\n", + "\n", + " try:\n", + " # Inspect Job\n", + " api_response = api_instance.inspect_job(solver_key, version, job_id)\n", + " pprint(api_response)\n", + " except ApiException as e:\n", + " print(\"Exception when calling SolversApi->inspect_job: %s\\n\" % e)" + ] + }, + { + "cell_type": "markdown", + "id": "8469b027", + "metadata": {}, + "source": [ + "### Parameters\n", + "\n", + "| Name | Type | Description | Notes |\n", + "| -------------- | -------------- | ----------- | ----- |\n", + "| **solver_key** | **str** | |\n", + "| **version** | **str** | |\n", + "| **job_id** | [**str**](.md) | |\n", + "\n", + "### Return type\n", + "\n", + "[**JobStatus**](JobStatus.md)\n", + "\n", + "### Authorization\n", + "\n", + "[HTTPBasic](../README.md#HTTPBasic)\n", + "\n", + "### HTTP request headers\n", + "\n", + " - **Content-Type**: Not defined\n", + " - **Accept**: application/json\n", + "\n", + "### HTTP response details\n", + "| Status code | Description | Response headers |\n", + "| ----------- | ------------------- | ---------------- |\n", + "| **200** | Successful Response | - |\n", + "| **422** | Validation Error | - |\n", + "\n", + "[[Back to top]](#) [[Back to API Classes]](../README.md#documentation-for-api-classes) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)\n", + "\n", + "# **list_jobs**\n", + "> list[Job] list_jobs(solver_key, version)\n", + "\n", + "List Jobs\n", + "\n", + "List of all jobs in a specific released solver\n", + "\n", + "### Example\n", + "\n", + "* Basic Authentication (HTTPBasic):" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "7f24e3f8", + "metadata": {}, + "outputs": [], + "source": [ + "from __future__ import print_function\n", + "import time\n", + "import osparc\n", + "from osparc.rest import ApiException\n", + "from pprint import pprint\n", + "configuration = osparc.Configuration()\n", + "# Configure HTTP basic authorization: HTTPBasic\n", + "configuration.username = 'YOUR_API_KEY_HERE'\n", + "configuration.password = 'YOUR_API_SECRET_HERE'\n", + "\n", + "\n", + "# Enter a context with an instance of the API client\n", + "with osparc.ApiClient(configuration) as api_client:\n", + " # Create an instance of the API class\n", + " api_instance = osparc.SolversApi(api_client)\n", + " solver_key = 'simcore/services/comp/isolve' # str |\n", + " version = '1.2.3' # str |\n", + "\n", + " try:\n", + " # List Jobs\n", + " api_response = api_instance.list_jobs(solver_key, version)\n", + " pprint(api_response)\n", + " except ApiException as e:\n", + " print(\"Exception when calling SolversApi->list_jobs: %s\\n\" % e)" + ] + }, + { + "cell_type": "markdown", + "id": "6d45dd82", + "metadata": {}, + "source": [ + "### Parameters\n", + "\n", + "| Name | Type | Description | Notes |\n", + "| -------------- | ------- | ----------- | ----- |\n", + "| **solver_key** | **str** | |\n", + "| **version** | **str** | |\n", + "\n", + "### Return type\n", + "\n", + "[**list[Job]**](Job.md)\n", + "\n", + "### Authorization\n", + "\n", + "[HTTPBasic](../README.md#HTTPBasic)\n", + "\n", + "### HTTP request headers\n", + "\n", + " - **Content-Type**: Not defined\n", + " - **Accept**: application/json\n", + "\n", + "### HTTP response details\n", + "| Status code | Description | Response headers |\n", + "| ----------- | ------------------- | ---------------- |\n", + "| **200** | Successful Response | - |\n", + "| **422** | Validation Error | - |\n", + "\n", + "[[Back to top]](#) [[Back to API Classes]](../README.md#documentation-for-api-classes) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)\n", + "\n", + "# **list_solver_releases**\n", + "> list[Solver] list_solver_releases(solver_key)\n", + "\n", + "List Solver Releases\n", + "\n", + "Lists all releases of a given solver\n", + "\n", + "### Example\n", + "\n", + "* Basic Authentication (HTTPBasic):" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "cc52f041", + "metadata": {}, + "outputs": [], + "source": [ + "from __future__ import print_function\n", + "import time\n", + "import osparc\n", + "from osparc.rest import ApiException\n", + "from pprint import pprint\n", + "configuration = osparc.Configuration()\n", + "# Configure HTTP basic authorization: HTTPBasic\n", + "configuration.username = 'YOUR_API_KEY_HERE'\n", + "configuration.password = 'YOUR_API_SECRET_HERE'\n", + "\n", + "\n", + "# Enter a context with an instance of the API client\n", + "with osparc.ApiClient(configuration) as api_client:\n", + " # Create an instance of the API class\n", + " api_instance = osparc.SolversApi(api_client)\n", + " solver_key = 'simcore/services/comp/isolve' # str |\n", + "\n", + " try:\n", + " # List Solver Releases\n", + " api_response = api_instance.list_solver_releases(solver_key)\n", + " pprint(api_response)\n", + " except ApiException as e:\n", + " print(\"Exception when calling SolversApi->list_solver_releases: %s\\n\" % e)" + ] + }, + { + "cell_type": "markdown", + "id": "54567420", + "metadata": {}, + "source": [ + "### Parameters\n", + "\n", + "| Name | Type | Description | Notes |\n", + "| -------------- | ------- | ----------- | ----- |\n", + "| **solver_key** | **str** | |\n", + "\n", + "### Return type\n", + "\n", + "[**list[Solver]**](Solver.md)\n", + "\n", + "### Authorization\n", + "\n", + "[HTTPBasic](../README.md#HTTPBasic)\n", + "\n", + "### HTTP request headers\n", + "\n", + " - **Content-Type**: Not defined\n", + " - **Accept**: application/json\n", + "\n", + "### HTTP response details\n", + "| Status code | Description | Response headers |\n", + "| ----------- | ------------------- | ---------------- |\n", + "| **200** | Successful Response | - |\n", + "| **422** | Validation Error | - |\n", + "\n", + "[[Back to top]](#) [[Back to API Classes]](../README.md#documentation-for-api-classes) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)\n", + "\n", + "# **list_solvers**\n", + "> list[Solver] list_solvers()\n", + "\n", + "List Solvers\n", + "\n", + "Lists all available solvers (latest version)\n", + "\n", + "### Example\n", + "\n", + "* Basic Authentication (HTTPBasic):" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "50e03864", + "metadata": {}, + "outputs": [], + "source": [ + "from __future__ import print_function\n", + "import time\n", + "import osparc\n", + "from osparc.rest import ApiException\n", + "from pprint import pprint\n", + "configuration = osparc.Configuration()\n", + "# Configure HTTP basic authorization: HTTPBasic\n", + "configuration.username = 'YOUR_API_KEY_HERE'\n", + "configuration.password = 'YOUR_API_SECRET_HERE'\n", + "\n", + "\n", + "# Enter a context with an instance of the API client\n", + "with osparc.ApiClient(configuration) as api_client:\n", + " # Create an instance of the API class\n", + " api_instance = osparc.SolversApi(api_client)\n", + "\n", + " try:\n", + " # List Solvers\n", + " api_response = api_instance.list_solvers()\n", + " pprint(api_response)\n", + " except ApiException as e:\n", + " print(\"Exception when calling SolversApi->list_solvers: %s\\n\" % e)" + ] + }, + { + "cell_type": "markdown", + "id": "b7e82591", + "metadata": {}, + "source": [ + "### Parameters\n", + "This endpoint does not need any parameter.\n", + "\n", + "### Return type\n", + "\n", + "[**list[Solver]**](Solver.md)\n", + "\n", + "### Authorization\n", + "\n", + "[HTTPBasic](../README.md#HTTPBasic)\n", + "\n", + "### HTTP request headers\n", + "\n", + " - **Content-Type**: Not defined\n", + " - **Accept**: application/json\n", + "\n", + "### HTTP response details\n", + "| Status code | Description | Response headers |\n", + "| ----------- | ------------------- | ---------------- |\n", + "| **200** | Successful Response | - |\n", + "\n", + "[[Back to top]](#) [[Back to API Classes]](../README.md#documentation-for-api-classes) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)\n", + "\n", + "# **list_solvers_releases**\n", + "> list[Solver] list_solvers_releases()\n", + "\n", + "Lists All Releases\n", + "\n", + "Lists all released solvers (all released versions)\n", + "\n", + "### Example\n", + "\n", + "* Basic Authentication (HTTPBasic):" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "5f8ac126", + "metadata": {}, + "outputs": [], + "source": [ + "from __future__ import print_function\n", + "import time\n", + "import osparc\n", + "from osparc.rest import ApiException\n", + "from pprint import pprint\n", + "configuration = osparc.Configuration()\n", + "# Configure HTTP basic authorization: HTTPBasic\n", + "configuration.username = 'YOUR_API_KEY_HERE'\n", + "configuration.password = 'YOUR_API_SECRET_HERE'\n", + "\n", + "\n", + "# Enter a context with an instance of the API client\n", + "with osparc.ApiClient(configuration) as api_client:\n", + " # Create an instance of the API class\n", + " api_instance = osparc.SolversApi(api_client)\n", + "\n", + " try:\n", + " # Lists All Releases\n", + " api_response = api_instance.list_solvers_releases()\n", + " pprint(api_response)\n", + " except ApiException as e:\n", + " print(\"Exception when calling SolversApi->list_solvers_releases: %s\\n\" % e)" + ] + }, + { + "cell_type": "markdown", + "id": "d13967da", + "metadata": {}, + "source": [ + "### Parameters\n", + "This endpoint does not need any parameter.\n", + "\n", + "### Return type\n", + "\n", + "[**list[Solver]**](Solver.md)\n", + "\n", + "### Authorization\n", + "\n", + "[HTTPBasic](../README.md#HTTPBasic)\n", + "\n", + "### HTTP request headers\n", + "\n", + " - **Content-Type**: Not defined\n", + " - **Accept**: application/json\n", + "\n", + "### HTTP response details\n", + "| Status code | Description | Response headers |\n", + "| ----------- | ------------------- | ---------------- |\n", + "| **200** | Successful Response | - |\n", + "\n", + "[[Back to top]](#) [[Back to API Classes]](../README.md#documentation-for-api-classes) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)\n", + "\n", + "# **start_job**\n", + "> JobStatus start_job(solver_key, version, job_id)\n", + "\n", + "Start Job\n", + "\n", + "### Example\n", + "\n", + "* Basic Authentication (HTTPBasic):" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "9a8d9967", + "metadata": {}, + "outputs": [], + "source": [ + "from __future__ import print_function\n", + "import time\n", + "import osparc\n", + "from osparc.rest import ApiException\n", + "from pprint import pprint\n", + "configuration = osparc.Configuration()\n", + "# Configure HTTP basic authorization: HTTPBasic\n", + "configuration.username = 'YOUR_API_KEY_HERE'\n", + "configuration.password = 'YOUR_API_SECRET_HERE'\n", + "\n", + "\n", + "# Enter a context with an instance of the API client\n", + "with osparc.ApiClient(configuration) as api_client:\n", + " # Create an instance of the API class\n", + " api_instance = osparc.SolversApi(api_client)\n", + " solver_key = 'simcore/services/comp/isolve' # str |\n", + " version = '1.2.3' # str |\n", + " job_id = '6d43f058-cb99-4720-833a-be367b766a73' # str |\n", + "\n", + " try:\n", + " # Start Job\n", + " api_response = api_instance.start_job(solver_key, version, job_id)\n", + " pprint(api_response)\n", + " except ApiException as e:\n", + " print(\"Exception when calling SolversApi->start_job: %s\\n\" % e)" + ] + }, + { + "cell_type": "markdown", + "id": "fdc88ddf", + "metadata": {}, + "source": [ + "### Parameters\n", + "\n", + "| Name | Type | Description | Notes |\n", + "| -------------- | -------------- | ----------- | ----- |\n", + "| **solver_key** | **str** | |\n", + "| **version** | **str** | |\n", + "| **job_id** | [**str**](.md) | |\n", + "\n", + "### Return type\n", + "\n", + "[**JobStatus**](JobStatus.md)\n", + "\n", + "### Authorization\n", + "\n", + "[HTTPBasic](../README.md#HTTPBasic)\n", + "\n", + "### HTTP request headers\n", + "\n", + " - **Content-Type**: Not defined\n", + " - **Accept**: application/json\n", + "\n", + "### HTTP response details\n", + "| Status code | Description | Response headers |\n", + "| ----------- | ------------------- | ---------------- |\n", + "| **200** | Successful Response | - |\n", + "| **422** | Validation Error | - |\n", + "\n", + "[[Back to top]](#) [[Back to API Classes]](../README.md#documentation-for-api-classes) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)\n", + "\n", + "# **stop_job**\n", + "> Job stop_job(solver_key, version, job_id)\n", + "\n", + "Stop Job\n", + "\n", + "### Example\n", + "\n", + "* Basic Authentication (HTTPBasic):" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "d51ee91f", + "metadata": {}, + "outputs": [], + "source": [ + "from __future__ import print_function\n", + "import time\n", + "import osparc\n", + "from osparc.rest import ApiException\n", + "from pprint import pprint\n", + "configuration = osparc.Configuration()\n", + "# Configure HTTP basic authorization: HTTPBasic\n", + "configuration.username = 'YOUR_API_KEY_HERE'\n", + "configuration.password = 'YOUR_API_SECRET_HERE'\n", + "\n", + "\n", + "# Enter a context with an instance of the API client\n", + "with osparc.ApiClient(configuration) as api_client:\n", + " # Create an instance of the API class\n", + " api_instance = osparc.SolversApi(api_client)\n", + " solver_key = 'simcore/services/comp/isolve' # str |\n", + " version = '1.2.3' # str |\n", + " job_id = '6d43f058-cb99-4720-833a-be367b766a73' # str |\n", + "\n", + " try:\n", + " # Stop Job\n", + " api_response = api_instance.stop_job(solver_key, version, job_id)\n", + " pprint(api_response)\n", + " except ApiException as e:\n", + " print(\"Exception when calling SolversApi->stop_job: %s\\n\" % e)" + ] + }, + { + "cell_type": "markdown", + "id": "a2193133", + "metadata": {}, + "source": [ + "### Parameters\n", + "\n", + "| Name | Type | Description | Notes |\n", + "| -------------- | -------------- | ----------- | ----- |\n", + "| **solver_key** | **str** | |\n", + "| **version** | **str** | |\n", + "| **job_id** | [**str**](.md) | |\n", + "\n", + "### Return type\n", + "\n", + "[**Job**](Job.md)\n", + "\n", + "### Authorization\n", + "\n", + "[HTTPBasic](../README.md#HTTPBasic)\n", + "\n", + "### HTTP request headers\n", + "\n", + " - **Content-Type**: Not defined\n", + " - **Accept**: application/json\n", + "\n", + "### HTTP response details\n", + "| Status code | Description | Response headers |\n", + "| ----------- | ------------------- | ---------------- |\n", + "| **200** | Successful Response | - |\n", + "| **422** | Validation Error | - |\n", + "\n", + "[[Back to top]](#) [[Back to API Classes]](../README.md#documentation-for-api-classes) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)" + ] + } + ], + "metadata": {}, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/docs/md/code_samples/UsersApi.ipynb b/docs/md/code_samples/UsersApi.ipynb index eb796aaf..d0321508 100644 --- a/docs/md/code_samples/UsersApi.ipynb +++ b/docs/md/code_samples/UsersApi.ipynb @@ -2,19 +2,21 @@ "cells": [ { "cell_type": "markdown", + "id": "23fc827c", "metadata": {}, "source": [ "# osparc.UsersApi\n", "\n", "All URIs are relative to *https://api.osparc.io*\n", "\n", - "Method | HTTP request | Description\n", - "------------- | ------------- | -------------\n", - "[**get_my_profile**](UsersApi.md#get_my_profile) | **GET** /v0/me | Get My Profile\n", - "[**update_my_profile**](UsersApi.md#update_my_profile) | **PUT** /v0/me | Update My Profile\n", + "| Method | HTTP request | Description |\n", + "| ------------------------------------------------------ | -------------- | ----------------- |\n", + "| [**get_my_profile**](UsersApi.md#get_my_profile) | **GET** /v0/me | Get My Profile |\n", + "| [**update_my_profile**](UsersApi.md#update_my_profile) | **PUT** /v0/me | Update My Profile |\n", "\n", "\n", "# **get_my_profile**\n", + "\n", "> Profile get_my_profile()\n", "\n", "Get My Profile\n", @@ -27,15 +29,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "!pip install osparc" - ] - }, - { - "cell_type": "code", - "execution_count": null, + "id": "3a1d2c4b", "metadata": {}, "outputs": [], "source": [ @@ -44,26 +38,17 @@ "import osparc\n", "from osparc.rest import ApiException\n", "from pprint import pprint\n", - "\n", - "\n", "configuration = osparc.Configuration()\n", - "# Configure HTTP basic authorization: HTTPBasic \n", - "#\n", - "# WARNING: this is ONLY for demo purposes. \n", - "#\n", - "configuration.username = 'YOUR API KEY_HERE'\n", - "configuration.password = 'YOUR_API_SECRET'\n", - "\n", - "# Defining host is optional and default to https://api.osparc.io\n", - "configuration.host = \"https://api.osparc.io\"\n", - "\n", + "# Configure HTTP basic authorization: HTTPBasic\n", + "configuration.username = 'YOUR_API_KEY_HERE'\n", + "configuration.password = 'YOUR_API_SECRET_HERE'\n", "\n", "\n", "# Enter a context with an instance of the API client\n", "with osparc.ApiClient(configuration) as api_client:\n", " # Create an instance of the API class\n", " api_instance = osparc.UsersApi(api_client)\n", - " \n", + "\n", " try:\n", " # Get My Profile\n", " api_response = api_instance.get_my_profile()\n", @@ -74,6 +59,7 @@ }, { "cell_type": "markdown", + "id": "afca925c", "metadata": {}, "source": [ "### Parameters\n", @@ -93,11 +79,11 @@ " - **Accept**: application/json\n", "\n", "### HTTP response details\n", - "| Status code | Description | Response headers |\n", - "|-------------|-------------|------------------|\n", - "**200** | Successful Response | - |\n", + "| Status code | Description | Response headers |\n", + "| ----------- | ------------------- | ---------------- |\n", + "| **200** | Successful Response | - |\n", "\n", - "[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)\n", + "[[Back to top]](#) [[Back to API Classes]](../README.md#documentation-for-api-classes) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)\n", "\n", "# **update_my_profile**\n", "> Profile update_my_profile(profile_update)\n", @@ -112,6 +98,7 @@ { "cell_type": "code", "execution_count": null, + "id": "aca097bb", "metadata": {}, "outputs": [], "source": [ @@ -122,18 +109,15 @@ "from pprint import pprint\n", "configuration = osparc.Configuration()\n", "# Configure HTTP basic authorization: HTTPBasic\n", - "configuration.username = 'YOUR_USERNAME'\n", - "configuration.password = 'YOUR_PASSWORD'\n", + "configuration.username = 'YOUR_API_KEY_HERE'\n", + "configuration.password = 'YOUR_API_SECRET_HERE'\n", + "\n", "\n", - "# Defining host is optional and default to https://api.osparc.io\n", - "configuration.host = \"https://api.osparc.io\"\n", "# Enter a context with an instance of the API client\n", "with osparc.ApiClient(configuration) as api_client:\n", " # Create an instance of the API class\n", " api_instance = osparc.UsersApi(api_client)\n", - " profile_update = osparc.ProfileUpdate() # ProfileUpdate | \n", - " profile_update.first_name = \"Richard\"\n", - " profile_update.last_name = \"Feynmann\"\n", + " profile_update = osparc.ProfileUpdate() # ProfileUpdate |\n", "\n", " try:\n", " # Update My Profile\n", @@ -145,13 +129,14 @@ }, { "cell_type": "markdown", + "id": "ec9b2a50", "metadata": {}, "source": [ "### Parameters\n", "\n", - "Name | Type | Description | Notes\n", - "------------- | ------------- | ------------- | -------------\n", - " **profile_update** | [**ProfileUpdate**](ProfileUpdate.md)| |\n", + "| Name | Type | Description | Notes |\n", + "| ------------------ | ------------------------------------- | ----------- | ----- |\n", + "| **profile_update** | [**ProfileUpdate**](ProfileUpdate.md) | |\n", "\n", "### Return type\n", "\n", @@ -167,16 +152,16 @@ " - **Accept**: application/json\n", "\n", "### HTTP response details\n", - "| Status code | Description | Response headers |\n", - "|-------------|-------------|------------------|\n", - "**200** | Successful Response | - |\n", - "**422** | Validation Error | - |\n", + "| Status code | Description | Response headers |\n", + "| ----------- | ------------------- | ---------------- |\n", + "| **200** | Successful Response | - |\n", + "| **422** | Validation Error | - |\n", "\n", - "[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)" + "[[Back to top]](#) [[Back to API Classes]](../README.md#documentation-for-api-classes) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)" ] } ], "metadata": {}, "nbformat": 4, - "nbformat_minor": 4 + "nbformat_minor": 5 } diff --git a/docs/md/code_samples/tutorials/BasicTutorial.ipynb b/docs/md/code_samples/tutorials/BasicTutorial.ipynb new file mode 100644 index 00000000..bb216521 --- /dev/null +++ b/docs/md/code_samples/tutorials/BasicTutorial.ipynb @@ -0,0 +1,492 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "f15de720", + "metadata": {}, + "source": [ + "# Basic Tutorial\n", + "\n", + "\n", + "\n", + "## Installation\n", + "Install the python client and check the installation as follows:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "09653e21", + "metadata": { + "attributes": { + "classes": [ + "command" + ], + "id": "" + } + }, + "outputs": [], + "source": [ + "$ pip install osparc\n", + "$ python -c \"import osparc; print(osparc.__version__)\"" + ] + }, + { + "cell_type": "markdown", + "id": "34c8833d", + "metadata": {}, + "source": [ + "## Setup\n", + "\n", + "To setup the client, we need to provide a username and password to the configuration. These can be obtained in the UI under [Preferences > API Settings > API Keys](http://docs.osparc.io/#/docs/platform_introduction/main_window_and_navigation/user_setup/profile?id=preferences). Use the *API key* as username and the *API secret* as password. For security reasons, you should not write these values in your script but instead set them up via environment variables or read them from a separate file. In this example, we use environment variables which will be referred to as \"OSPARC_API_KEY\" and \"OSPARC_API_SECRET\" for the rest of the tutorial." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "85ac5228", + "metadata": {}, + "outputs": [], + "source": [ + "\n", + "import os\n", + "import osparc\n", + "\n", + "cfg = osparc.Configuration(\n", + " username=os.environ[\"OSPARC_API_KEY\"],\n", + " password=os.environ[\"OSPARC_API_SECRET\"],\n", + ")\n", + "print(cfg.host)\n" + ] + }, + { + "cell_type": "markdown", + "id": "630c5926", + "metadata": {}, + "source": [ + "The configuration can now be used to create an instance of the API client. The API client is responsible of the communication with the osparc platform\n", + "\n", + "\n", + "The functions in the [osparc API] are grouped into sections such as *meta*, *users*, *files* or *solvers*. Each section address a different resource of the platform.\n", + "\n", + "\n", + "\n", + "For example, the *users* section includes functions about the user (i.e. you) and can be accessed initializing a ``UsersApi``:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "29337833", + "metadata": {}, + "outputs": [], + "source": [ + "import osparc\n", + "from osparc.api import UsersApi\n", + "\n", + "with osparc.ApiClient(cfg) as api_client:\n", + "\n", + " users_api = UsersApi(api_client)\n", + "\n", + " profile = users_api.get_my_profile()\n", + " print(profile)\n", + "\n", + " #\n", + " # {'first_name': 'foo',\n", + " # 'gravatar_id': 'aa33fssec77ea434c2ea4fb92d0fd379e',\n", + " # 'groups': {'all': {'description': 'all users',\n", + " # 'gid': '1',\n", + " # 'label': 'Everyone'},\n", + " # 'me': {'description': 'primary group',\n", + " # 'gid': '2',\n", + " # 'label': 'foo'},\n", + " # 'organizations': []},\n", + " # 'last_name': '',\n", + " # 'login': 'foo@itis.swiss',\n", + " # 'role': 'USER'}\n", + " #" + ] + }, + { + "cell_type": "markdown", + "id": "6912889e", + "metadata": {}, + "source": [ + "## Solvers Workflow\n", + "\n", + "The osparc API can be used to execute any computational service published in the platform. This means that any computational service listed in the UI under the [Discover Tab](http://docs.osparc.io/#/docs/platform_introduction/core_elements/Discover?id=discover-tab) is accessible from the API. Note that computational services are denoted as *solvers* in the API for convenience, but they refer to the same concept.\n", + "\n", + "\n", + "Let's use the sleepers computational service to illustrate a typical workflow. The sleepers computational service is a very basic service that simply waits (i.e. *sleeps*) a given time before producing some outputs. It takes as input one natural number, an optional text file input that contains another natural number and a boolean in the form of a checkbox. It also provides two outputs: one natural number and a file containing a single natural number." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "398bcd09", + "metadata": {}, + "outputs": [], + "source": [ + "import time\n", + "from pathlib import Path\n", + "from zipfile import ZipFile\n", + "\n", + "import osparc\n", + "from osparc.api import FilesApi, SolversApi\n", + "from osparc.models import File, Job, JobInputs, JobOutputs, JobStatus, Solver\n", + "\n", + "CLIENT_VERSION = tuple(map(int, osparc.__version__.split(\".\")))\n", + "assert CLIENT_VERSION >= (0, 4, 3)\n", + "\n", + "Path(\"file_with_number.txt\").write_text(\"3\")\n", + "\n", + "with osparc.ApiClient(cfg) as api_client:\n", + "\n", + " files_api = FilesApi(api_client)\n", + " input_file: File = files_api.upload_file(file=\"file_with_number.txt\")\n", + "\n", + " solvers_api = SolversApi(api_client)\n", + " solver: Solver = solvers_api.get_solver_release(\n", + " \"simcore/services/comp/itis/sleeper\", \"2.0.2\"\n", + " )\n", + "\n", + " job: Job = solvers_api.create_job(\n", + " solver.id,\n", + " solver.version,\n", + " JobInputs(\n", + " {\n", + " \"input_3\": 0,\n", + " \"input_2\": 3.0,\n", + " \"input_1\": input_file,\n", + " }\n", + " ),\n", + " )\n", + "\n", + " status: JobStatus = solvers_api.start_job(solver.id, solver.version, job.id)\n", + " while not status.stopped_at:\n", + " time.sleep(3)\n", + " status = solvers_api.inspect_job(solver.id, solver.version, job.id)\n", + " print(\"Solver progress\", f\"{status.progress}/100\", flush=True)\n", + " #\n", + " # Solver progress 0/100\n", + " # Solver progress 100/100\n", + "\n", + " outputs: JobOutputs = solvers_api.get_job_outputs(solver.id, solver.version, job.id)\n", + "\n", + " print(f\"Job {outputs.job_id} got these results:\")\n", + " for output_name, result in outputs.results.items():\n", + " print(output_name, \"=\", result)\n", + "\n", + " #\n", + " # Job 19fc28f7-46fb-4e96-9129-5e924801f088 got these results:\n", + " #\n", + " # output_1 = {'checksum': '859fda0cb82fc4acb4686510a172d9a9-1',\n", + " # 'content_type': 'text/plain',\n", + " # 'filename': 'single_number.txt',\n", + " # 'id': '9fb4f70e-3589-3e9e-991e-3059086c3aae'}\n", + " # output_2 = 4.0\n", + "\n", + " if CLIENT_VERSION >= (0, 5, 0):\n", + " logfile_path: str = solvers_api.get_job_output_logfile(\n", + " solver.id, solver.version, job.id\n", + " )\n", + " zip_path = Path(logfile_path)\n", + "\n", + " extract_dir = Path(\"./extracted\")\n", + " extract_dir.mkdir()\n", + "\n", + " with ZipFile(f\"{zip_path}\") as fzip:\n", + " fzip.extractall(f\"{extract_dir}\")\n", + "\n", + " logfiles = list(extract_dir.glob(\"*.log*\"))\n", + " print(\"Unzipped\", logfiles[0], \"contains:\\n\", logfiles[0].read_text())\n", + " #\n", + " # Unzipped extracted/sleeper_2.0.2.logs contains:\n", + " # 2022-06-01T18:15:00.405035847+02:00 Entrypoint for stage production ...\n", + " # 2022-06-01T18:15:00.421279969+02:00 User : uid=0(root) gid=0(root) groups=0(root)\n", + " # 2022-06-01T18:15:00.421560331+02:00 Workdir : /home/scu\n", + " # ...\n", + " # 2022-06-01T18:15:00.864550043+02:00 \n", + " # 2022-06-01T18:15:03.923876794+02:00 Will sleep for 3 seconds\n", + " # 2022-06-01T18:15:03.924473521+02:00 [PROGRESS] 1/3...\n", + " # 2022-06-01T18:15:03.925021846+02:00 Remaining sleep time 0.9999995231628418\n", + " # 2022-06-01T18:15:03.925558026+02:00 [PROGRESS] 2/3...\n", + " # 2022-06-01T18:15:03.926103062+02:00 Remaining sleep time 0.9999985694885254\n", + " # 2022-06-01T18:15:03.926643184+02:00 [PROGRESS] 3/3...\n", + " # 2022-06-01T18:15:03.933544384+02:00 Remaining sleep time 0.9999983310699463\n", + "\n", + " download_path: str = files_api.download_file(file_id=outputs.results[\"output_1\"].id)\n", + " print(Path(download_path).read_text())\n", + " #\n", + " # 7\n" + ] + }, + { + "cell_type": "markdown", + "id": "c0092d84", + "metadata": {}, + "source": [ + "The script above\n", + "\n", + "1. Uploads a file ``file_with_number.txt``\n", + "2. Selects version ``2.0.2`` of the ``sleeper``\n", + "3. Runs the ``sleeper`` and provides a reference to the uploaded file and other values as input parameters\n", + "4. Monitors the status of the solver while it is running in the platform\n", + "5. When the execution completes, it checks the outputs\n", + "6. The logs are downloaded, unzipped and saved to a new ```extracted``` directory\n", + "7. One of the outputs is a file and it is downloaded\n", + "\n", + "\n", + "#### Files\n", + "\n", + "Files used as input to solvers or produced by solvers in the platform are accessible in the **files** section and specifically with the ``FilesApi`` class.\n", + "In order to use a file as input, it has to be uploaded first and the reference used in the corresponding solver's input." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "d6d2dfdb", + "metadata": {}, + "outputs": [], + "source": [ + "files_api = FilesApi(api_client)\n", + "input_file: File = files_api.upload_file(file=\"file_with_number.txt\")\n", + "\n", + "\n", + "# ...\n", + "\n", + "\n", + "outputs: JobOutputs = solvers_api.get_job_outputs(solver.id, solver.version, job.id)\n", + "results_file: File = outputs.results[\"output_1\"]\n", + "download_path: str = files_api.download_file(file_id=results_file.id)\n" + ] + }, + { + "cell_type": "markdown", + "id": "e40ad2a5", + "metadata": {}, + "source": [ + "In the snippet above, ``input_file`` is a ``File`` reference to the uploaded file and that is passed as input to the solver. Analogously, ``results_file`` is a ``File`` produced by the solver and that can also be downloaded.\n", + "\n", + "\n", + "#### Solvers, Inputs and Outputs\n", + "\n", + "The inputs and outputs are specific for every solver. Every input/output has a name and an associated type that can be as simple as booleans, numbers, strings ... or more complex as files. You can find this information in the UI under Discover Tab, selecting the service card > More Info > raw metadata. For instance, the ``sleeper`` version ``2.0.2`` has the following ``raw-metadata``:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "f5262250", + "metadata": { + "attributes": { + "classes": [ + "json" + ], + "id": "" + } + }, + "outputs": [], + "source": [ + "{\n", + " inputs: {\n", + " 'input_1': {'description': 'Pick a file containing only one '\n", + " 'integer',\n", + " 'displayOrder': 1,\n", + " 'fileToKeyMap': {'single_number.txt': 'input_1'},\n", + " 'label': 'File with int number',\n", + " 'type': 'data:text/plain'},\n", + " 'input_2': {'defaultValue': 2,\n", + " 'description': 'Choose an amount of time to sleep',\n", + " 'displayOrder': 2,\n", + " 'label': 'Sleep interval',\n", + " 'type': 'integer',\n", + " 'unit': 'second'},\n", + " 'input_3': {'defaultValue': False,\n", + " 'description': 'If set to true will cause service to '\n", + " 'fail after it sleeps',\n", + " 'displayOrder': 3,\n", + " 'label': 'Fail after sleep',\n", + " 'type': 'boolean'},\n", + " }\n", + "}" + ] + }, + { + "cell_type": "markdown", + "id": "1584bf07", + "metadata": {}, + "source": [ + "So, the inputs can be set as follows" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "5337fcae", + "metadata": {}, + "outputs": [], + "source": [ + "# ...\n", + "job = solvers_api.create_job(\n", + " solver.id,\n", + " solver.version,\n", + " job_inputs=JobInputs(\n", + " {\n", + " \"input_1\": uploaded_input_file,\n", + " \"input_2\": 3 * n, # sleep time in secs\n", + " \"input_3\": bool(n % 2), # fail after sleep?\n", + " }\n", + " ),\n", + " )\n" + ] + }, + { + "cell_type": "markdown", + "id": "8dfa35ad", + "metadata": {}, + "source": [ + "And the metadata for the outputs are" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "d4222e74", + "metadata": { + "attributes": { + "classes": [ + "json" + ], + "id": "" + } + }, + "outputs": [], + "source": [ + "{\n", + " 'outputs': {'output_1': {'description': 'Integer is generated in range [1-9]',\n", + " 'displayOrder': 1,\n", + " 'fileToKeyMap': {'single_number.txt': 'output_1'},\n", + " 'label': 'File containing one random integer',\n", + " 'type': 'data:text/plain'},\n", + " 'output_2': {'description': 'Interval is generated in range '\n", + " '[1-9]',\n", + " 'displayOrder': 2,\n", + " 'label': 'Random sleep interval',\n", + " 'type': 'integer',\n", + " 'unit': 'second'}},\n", + "}" + ] + }, + { + "cell_type": "markdown", + "id": "97e73630", + "metadata": {}, + "source": [ + "so this information determines which output corresponds to a number or a file in the following snippet" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "36e8f03b", + "metadata": {}, + "outputs": [], + "source": [ + "# ...\n", + "\n", + "outputs: JobOutputs = solvers_api.get_job_outputs(solver.id, solver.version, job.id)\n", + "\n", + "output_file = outputs.results[\"output_1\"]\n", + "number = outputs.results[\"output_2\"]\n", + "\n", + "assert status.state == \"SUCCESS\"\n", + "\n", + "\n", + "assert isinstance(output_file, File)\n", + "assert isinstance(number, float)\n", + "\n", + "# output file exists\n", + "assert files_api.get_file(output_file.id) == output_file\n", + "\n", + "# can download and open\n", + "download_path: str = files_api.download_file(file_id=output_file.id)\n", + "assert float(Path(download_path).read_text()), \"contains a random number\"" + ] + }, + { + "cell_type": "markdown", + "id": "a58035b0", + "metadata": {}, + "source": [ + "#### Job Status\n", + "\n", + "Once the client script triggers the solver, the solver runs in the platform and the script is freed. Sometimes, it is convenient to monitor the status of the run to see e.g. the progress of the execution or if the run was completed.\n", + "\n", + "A solver runs in a plaforma starts a ``Job``. Using the ``solvers_api``, allows us to inspect the ``Job`` and get a ``JobStatus`` with information about its status. For instance" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "93817d1e", + "metadata": {}, + "outputs": [], + "source": [ + " status: JobStatus = solvers_api.start_job(solver.id, solver.version, job.id)\n", + " while not status.stopped_at:\n", + " time.sleep(3)\n", + " status = solvers_api.inspect_job(solver.id, solver.version, job.id)\n", + " print(\"Solver progress\", f\"{status.progress}/100\", flush=True)" + ] + }, + { + "cell_type": "markdown", + "id": "5180b589", + "metadata": {}, + "source": [ + "#### Logs\n", + "\n", + "When a solver runs, it will generate logs during execution which are then saved as .log files. Starting from the osparc Python Client version 0.5.0, The ``solvers_api`` also allows us to obtain the ``logfile_path`` associated with a particular ``Job``. This is a zip file that can then be extracted and saved. For instance" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "417d4663", + "metadata": {}, + "outputs": [], + "source": [ + "logfile_path: str = solvers_api.get_job_output_logfile(\n", + " solver.id, solver.version, job.id\n", + ")\n", + "zip_path = Path(logfile_path)\n", + "\n", + "extract_dir = Path(\"./extracted\")\n", + "extract_dir.mkdir()\n", + "\n", + "with ZipFile(f\"{zip_path}\") as fzip:\n", + " fzip.extractall(f\"{extract_dir}\")" + ] + }, + { + "cell_type": "markdown", + "id": "72d60050", + "metadata": {}, + "source": [ + "## References\n", + "\n", + "- [osparc API python client] documentation\n", + "- [osparc API] documentation\n", + "- A full script with this tutorial: [``sleeper.py``](https://github.com/ITISFoundation/osparc-simcore/blob/master/tests/public-api/examples/sleeper.py)\n", + "\n", + "[osparc API python client]:https://itisfoundation.github.io/osparc-simcore-python-client\n", + "[osparc API]:https://api.osparc.io/doc" + ] + } + ], + "metadata": {}, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/docs/md/tutorials/BasicTutorial.md b/docs/md/tutorials/BasicTutorial.md index d44b4149..83092ca3 100644 --- a/docs/md/tutorials/BasicTutorial.md +++ b/docs/md/tutorials/BasicTutorial.md @@ -17,6 +17,7 @@ To setup the client, we need to provide a username and password to the configura ```python +import os import osparc cfg = osparc.Configuration( @@ -73,11 +74,18 @@ Let's use the sleepers computational service to illustrate a typical workflow. T ```python -import osparc +import time +from pathlib import Path +from zipfile import ZipFile +import osparc from osparc.api import FilesApi, SolversApi from osparc.models import File, Job, JobInputs, JobOutputs, JobStatus, Solver +CLIENT_VERSION = tuple(map(int, osparc.__version__.split("."))) +assert CLIENT_VERSION >= (0, 4, 3) + +Path("file_with_number.txt").write_text("3") with osparc.ApiClient(cfg) as api_client: @@ -125,9 +133,36 @@ with osparc.ApiClient(cfg) as api_client: # 'id': '9fb4f70e-3589-3e9e-991e-3059086c3aae'} # output_2 = 4.0 + if CLIENT_VERSION >= (0, 5, 0): + logfile_path: str = solvers_api.get_job_output_logfile( + solver.id, solver.version, job.id + ) + zip_path = Path(logfile_path) + + extract_dir = Path("./extracted") + extract_dir.mkdir() + + with ZipFile(f"{zip_path}") as fzip: + fzip.extractall(f"{extract_dir}") - results_file: File = outputs.results["output_1"] - download_path: str = files_api.download_file(file_id=results_file.id) + logfiles = list(extract_dir.glob("*.log*")) + print("Unzipped", logfiles[0], "contains:\n", logfiles[0].read_text()) + # + # Unzipped extracted/sleeper_2.0.2.logs contains: + # 2022-06-01T18:15:00.405035847+02:00 Entrypoint for stage production ... + # 2022-06-01T18:15:00.421279969+02:00 User : uid=0(root) gid=0(root) groups=0(root) + # 2022-06-01T18:15:00.421560331+02:00 Workdir : /home/scu + # ... + # 2022-06-01T18:15:00.864550043+02:00 + # 2022-06-01T18:15:03.923876794+02:00 Will sleep for 3 seconds + # 2022-06-01T18:15:03.924473521+02:00 [PROGRESS] 1/3... + # 2022-06-01T18:15:03.925021846+02:00 Remaining sleep time 0.9999995231628418 + # 2022-06-01T18:15:03.925558026+02:00 [PROGRESS] 2/3... + # 2022-06-01T18:15:03.926103062+02:00 Remaining sleep time 0.9999985694885254 + # 2022-06-01T18:15:03.926643184+02:00 [PROGRESS] 3/3... + # 2022-06-01T18:15:03.933544384+02:00 Remaining sleep time 0.9999983310699463 + + download_path: str = files_api.download_file(file_id=outputs.results["output_1"].id) print(Path(download_path).read_text()) # # 7 @@ -141,7 +176,8 @@ The script above 3. Runs the ``sleeper`` and provides a reference to the uploaded file and other values as input parameters 4. Monitors the status of the solver while it is running in the platform 5. When the execution completes, it checks the outputs -6. One of the outputs is a file and it is downloaded +6. The logs are downloaded, unzipped and saved to a new ```extracted``` directory +7. One of the outputs is a file and it is downloaded #### Files @@ -267,6 +303,23 @@ A solver runs in a plaforma starts a ``Job``. Using the ``solvers_api``, allows print("Solver progress", f"{status.progress}/100", flush=True) ``` +#### Logs + +When a solver runs, it will generate logs during execution which are then saved as .log files. Starting from the osparc Python Client version 0.5.0, The ``solvers_api`` also allows us to obtain the ``logfile_path`` associated with a particular ``Job``. This is a zip file that can then be extracted and saved. For instance + +```python +logfile_path: str = solvers_api.get_job_output_logfile( + solver.id, solver.version, job.id +) +zip_path = Path(logfile_path) + +extract_dir = Path("./extracted") +extract_dir.mkdir() + +with ZipFile(f"{zip_path}") as fzip: + fzip.extractall(f"{extract_dir}") +``` + ## References - [osparc API python client] documentation @@ -274,4 +327,5 @@ A solver runs in a plaforma starts a ``Job``. Using the ``solvers_api``, allows - A full script with this tutorial: [``sleeper.py``](https://github.com/ITISFoundation/osparc-simcore/blob/master/tests/public-api/examples/sleeper.py) [osparc API python client]:https://itisfoundation.github.io/osparc-simcore-python-client -[osparc API]:https://api.staging.osparc.io/doc +[osparc API]:https://api.osparc.io/doc +[Download as BasicTutorial.ipynb](md/code_samples/tutorials/BasicTutorial.ipynb ':ignore') diff --git a/noxfile.py b/noxfile.py index 254f4748..b41d85d5 100644 --- a/noxfile.py +++ b/noxfile.py @@ -6,7 +6,7 @@ source_files = ("osparc", "test", "setup.py", "noxfile.py") -@nox.session(python=["3.6", "3.7", "3.8"]) +@nox.session(python=["3.6", "3.7", "3.8", "3.9"]) def test(session): session.install("-r", "requirements-tests.txt") session.install("-e", ".") diff --git a/osparc/__init__.py b/osparc/__init__.py index 0b6afc83..f732c936 100644 --- a/osparc/__init__.py +++ b/osparc/__init__.py @@ -7,14 +7,14 @@ osparc-simcore public web API specifications # noqa: E501 - The version of the OpenAPI document: 0.3.0 + The version of the OpenAPI document: 0.4.0 Generated by: https://openapi-generator.tech """ from __future__ import absolute_import -__version__ = "0.4.3" +__version__ = "0.5.0" # import apis into sdk package from osparc.api.files_api import FilesApi @@ -30,8 +30,11 @@ from osparc.exceptions import ApiValueError from osparc.exceptions import ApiKeyError from osparc.exceptions import ApiException + # import models into sdk package -from osparc.models.body_upload_file_v0_files_content_put import BodyUploadFileV0FilesContentPut +from osparc.models.body_upload_file_v0_files_content_put import ( + BodyUploadFileV0FilesContentPut, +) from osparc.models.file import File from osparc.models.groups import Groups from osparc.models.http_validation_error import HTTPValidationError @@ -47,4 +50,3 @@ from osparc.models.user_role_enum import UserRoleEnum from osparc.models.users_group import UsersGroup from osparc.models.validation_error import ValidationError - diff --git a/osparc/api/files_api.py b/osparc/api/files_api.py index 6dbbab08..5ab57da0 100644 --- a/osparc/api/files_api.py +++ b/osparc/api/files_api.py @@ -5,7 +5,7 @@ osparc-simcore public web API specifications # noqa: E501 - The version of the OpenAPI document: 0.3.0 + The version of the OpenAPI document: 0.4.0 Generated by: https://openapi-generator.tech """ @@ -18,10 +18,7 @@ import six from osparc.api_client import ApiClient -from osparc.exceptions import ( - ApiTypeError, - ApiValueError -) +from osparc.exceptions import ApiTypeError, ApiValueError class FilesApi(object): @@ -57,7 +54,7 @@ def download_file(self, file_id, **kwargs): # noqa: E501 If the method is called asynchronously, returns the request thread. """ - kwargs['_return_http_data_only'] = True + kwargs["_return_http_data_only"] = True return self.download_file_with_http_info(file_id, **kwargs) # noqa: E501 def download_file_with_http_info(self, file_id, **kwargs): # noqa: E501 @@ -86,30 +83,34 @@ def download_file_with_http_info(self, file_id, **kwargs): # noqa: E501 local_var_params = locals() - all_params = ['file_id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params = ["file_id"] # noqa: E501 + all_params.append("async_req") + all_params.append("_return_http_data_only") + all_params.append("_preload_content") + all_params.append("_request_timeout") - for key, val in six.iteritems(local_var_params['kwargs']): + for key, val in six.iteritems(local_var_params["kwargs"]): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method download_file" % key ) local_var_params[key] = val - del local_var_params['kwargs'] + del local_var_params["kwargs"] # verify the required parameter 'file_id' is set - if self.api_client.client_side_validation and ('file_id' not in local_var_params or # noqa: E501 - local_var_params['file_id'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `file_id` when calling `download_file`") # noqa: E501 + if self.api_client.client_side_validation and ( + "file_id" not in local_var_params + or local_var_params["file_id"] is None # noqa: E501 + ): # noqa: E501 + raise ApiValueError( + "Missing the required parameter `file_id` when calling `download_file`" + ) # noqa: E501 collection_formats = {} path_params = {} - if 'file_id' in local_var_params: - path_params['file_id'] = local_var_params['file_id'] # noqa: E501 + if "file_id" in local_var_params: + path_params["file_id"] = local_var_params["file_id"] # noqa: E501 query_params = [] @@ -120,32 +121,37 @@ def download_file_with_http_info(self, file_id, **kwargs): # noqa: E501 body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/octet-stream', 'text/plain', 'application/json']) # noqa: E501 + header_params["Accept"] = self.api_client.select_header_accept( + ["application/octet-stream", "text/plain", "application/json"] + ) # noqa: E501 # Authentication setting - auth_settings = ['HTTPBasic'] # noqa: E501 + auth_settings = ["HTTPBasic"] # noqa: E501 return self.api_client.call_api( - '/v0/files/{file_id}/content', 'GET', + "/v0/files/{file_id}/content", + "GET", path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='file', # noqa: E501 + response_type="file", # noqa: E501 auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + async_req=local_var_params.get("async_req"), + _return_http_data_only=local_var_params.get( + "_return_http_data_only" + ), # noqa: E501 + _preload_content=local_var_params.get("_preload_content", True), + _request_timeout=local_var_params.get("_request_timeout"), + collection_formats=collection_formats, + ) def get_file(self, file_id, **kwargs): # noqa: E501 """Get File # noqa: E501 - Gets metadata for a given file resource # noqa: E501 + Gets metadata for a given file resource # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_file(file_id, async_req=True) @@ -164,13 +170,13 @@ def get_file(self, file_id, **kwargs): # noqa: E501 If the method is called asynchronously, returns the request thread. """ - kwargs['_return_http_data_only'] = True + kwargs["_return_http_data_only"] = True return self.get_file_with_http_info(file_id, **kwargs) # noqa: E501 def get_file_with_http_info(self, file_id, **kwargs): # noqa: E501 """Get File # noqa: E501 - Gets metadata for a given file resource # noqa: E501 + Gets metadata for a given file resource # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_file_with_http_info(file_id, async_req=True) @@ -194,30 +200,34 @@ def get_file_with_http_info(self, file_id, **kwargs): # noqa: E501 local_var_params = locals() - all_params = ['file_id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params = ["file_id"] # noqa: E501 + all_params.append("async_req") + all_params.append("_return_http_data_only") + all_params.append("_preload_content") + all_params.append("_request_timeout") - for key, val in six.iteritems(local_var_params['kwargs']): + for key, val in six.iteritems(local_var_params["kwargs"]): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method get_file" % key ) local_var_params[key] = val - del local_var_params['kwargs'] + del local_var_params["kwargs"] # verify the required parameter 'file_id' is set - if self.api_client.client_side_validation and ('file_id' not in local_var_params or # noqa: E501 - local_var_params['file_id'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `file_id` when calling `get_file`") # noqa: E501 + if self.api_client.client_side_validation and ( + "file_id" not in local_var_params + or local_var_params["file_id"] is None # noqa: E501 + ): # noqa: E501 + raise ApiValueError( + "Missing the required parameter `file_id` when calling `get_file`" + ) # noqa: E501 collection_formats = {} path_params = {} - if 'file_id' in local_var_params: - path_params['file_id'] = local_var_params['file_id'] # noqa: E501 + if "file_id" in local_var_params: + path_params["file_id"] = local_var_params["file_id"] # noqa: E501 query_params = [] @@ -228,32 +238,37 @@ def get_file_with_http_info(self, file_id, **kwargs): # noqa: E501 body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # noqa: E501 # Authentication setting - auth_settings = ['HTTPBasic'] # noqa: E501 + auth_settings = ["HTTPBasic"] # noqa: E501 return self.api_client.call_api( - '/v0/files/{file_id}', 'GET', + "/v0/files/{file_id}", + "GET", path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='File', # noqa: E501 + response_type="File", # noqa: E501 auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + async_req=local_var_params.get("async_req"), + _return_http_data_only=local_var_params.get( + "_return_http_data_only" + ), # noqa: E501 + _preload_content=local_var_params.get("_preload_content", True), + _request_timeout=local_var_params.get("_request_timeout"), + collection_formats=collection_formats, + ) def list_files(self, **kwargs): # noqa: E501 """List Files # noqa: E501 - Lists all files stored in the system # noqa: E501 + Lists all files stored in the system # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_files(async_req=True) @@ -271,13 +286,13 @@ def list_files(self, **kwargs): # noqa: E501 If the method is called asynchronously, returns the request thread. """ - kwargs['_return_http_data_only'] = True + kwargs["_return_http_data_only"] = True return self.list_files_with_http_info(**kwargs) # noqa: E501 def list_files_with_http_info(self, **kwargs): # noqa: E501 """List Files # noqa: E501 - Lists all files stored in the system # noqa: E501 + Lists all files stored in the system # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_files_with_http_info(async_req=True) @@ -301,19 +316,19 @@ def list_files_with_http_info(self, **kwargs): # noqa: E501 local_var_params = locals() all_params = [] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params.append("async_req") + all_params.append("_return_http_data_only") + all_params.append("_preload_content") + all_params.append("_request_timeout") - for key, val in six.iteritems(local_var_params['kwargs']): + for key, val in six.iteritems(local_var_params["kwargs"]): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method list_files" % key ) local_var_params[key] = val - del local_var_params['kwargs'] + del local_var_params["kwargs"] collection_formats = {} @@ -328,27 +343,32 @@ def list_files_with_http_info(self, **kwargs): # noqa: E501 body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # noqa: E501 # Authentication setting - auth_settings = ['HTTPBasic'] # noqa: E501 + auth_settings = ["HTTPBasic"] # noqa: E501 return self.api_client.call_api( - '/v0/files', 'GET', + "/v0/files", + "GET", path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[File]', # noqa: E501 + response_type="list[File]", # noqa: E501 auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + async_req=local_var_params.get("async_req"), + _return_http_data_only=local_var_params.get( + "_return_http_data_only" + ), # noqa: E501 + _preload_content=local_var_params.get("_preload_content", True), + _request_timeout=local_var_params.get("_request_timeout"), + collection_formats=collection_formats, + ) def upload_file(self, file, **kwargs): # noqa: E501 """Upload File # noqa: E501 @@ -373,7 +393,7 @@ def upload_file(self, file, **kwargs): # noqa: E501 If the method is called asynchronously, returns the request thread. """ - kwargs['_return_http_data_only'] = True + kwargs["_return_http_data_only"] = True return self.upload_file_with_http_info(file, **kwargs) # noqa: E501 def upload_file_with_http_info(self, file, **kwargs): # noqa: E501 @@ -404,24 +424,28 @@ def upload_file_with_http_info(self, file, **kwargs): # noqa: E501 local_var_params = locals() - all_params = ['file', 'content_length'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params = ["file", "content_length"] # noqa: E501 + all_params.append("async_req") + all_params.append("_return_http_data_only") + all_params.append("_preload_content") + all_params.append("_request_timeout") - for key, val in six.iteritems(local_var_params['kwargs']): + for key, val in six.iteritems(local_var_params["kwargs"]): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method upload_file" % key ) local_var_params[key] = val - del local_var_params['kwargs'] + del local_var_params["kwargs"] # verify the required parameter 'file' is set - if self.api_client.client_side_validation and ('file' not in local_var_params or # noqa: E501 - local_var_params['file'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `file` when calling `upload_file`") # noqa: E501 + if self.api_client.client_side_validation and ( + "file" not in local_var_params + or local_var_params["file"] is None # noqa: E501 + ): # noqa: E501 + raise ApiValueError( + "Missing the required parameter `file` when calling `upload_file`" + ) # noqa: E501 collection_formats = {} @@ -430,38 +454,48 @@ def upload_file_with_http_info(self, file, **kwargs): # noqa: E501 query_params = [] header_params = {} - if 'content_length' in local_var_params: - header_params['content-length'] = local_var_params['content_length'] # noqa: E501 + if "content_length" in local_var_params: + header_params["content-length"] = local_var_params[ + "content_length" + ] # noqa: E501 form_params = [] local_var_files = {} - if 'file' in local_var_params: - local_var_files['file'] = local_var_params['file'] # noqa: E501 + if "file" in local_var_params: + local_var_files["file"] = local_var_params["file"] # noqa: E501 body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # noqa: E501 # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['multipart/form-data']) # noqa: E501 + header_params[ + "Content-Type" + ] = self.api_client.select_header_content_type( # noqa: E501 + ["multipart/form-data"] + ) # noqa: E501 # Authentication setting - auth_settings = ['HTTPBasic'] # noqa: E501 + auth_settings = ["HTTPBasic"] # noqa: E501 return self.api_client.call_api( - '/v0/files/content', 'PUT', + "/v0/files/content", + "PUT", path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='File', # noqa: E501 + response_type="File", # noqa: E501 auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + async_req=local_var_params.get("async_req"), + _return_http_data_only=local_var_params.get( + "_return_http_data_only" + ), # noqa: E501 + _preload_content=local_var_params.get("_preload_content", True), + _request_timeout=local_var_params.get("_request_timeout"), + collection_formats=collection_formats, + ) diff --git a/osparc/api/meta_api.py b/osparc/api/meta_api.py index 81f63dfc..66d6a9b5 100644 --- a/osparc/api/meta_api.py +++ b/osparc/api/meta_api.py @@ -5,7 +5,7 @@ osparc-simcore public web API specifications # noqa: E501 - The version of the OpenAPI document: 0.3.0 + The version of the OpenAPI document: 0.4.0 Generated by: https://openapi-generator.tech """ @@ -18,10 +18,7 @@ import six from osparc.api_client import ApiClient -from osparc.exceptions import ( - ApiTypeError, - ApiValueError -) +from osparc.exceptions import ApiTypeError, ApiValueError class MetaApi(object): @@ -56,7 +53,7 @@ def get_service_metadata(self, **kwargs): # noqa: E501 If the method is called asynchronously, returns the request thread. """ - kwargs['_return_http_data_only'] = True + kwargs["_return_http_data_only"] = True return self.get_service_metadata_with_http_info(**kwargs) # noqa: E501 def get_service_metadata_with_http_info(self, **kwargs): # noqa: E501 @@ -85,19 +82,19 @@ def get_service_metadata_with_http_info(self, **kwargs): # noqa: E501 local_var_params = locals() all_params = [] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params.append("async_req") + all_params.append("_return_http_data_only") + all_params.append("_preload_content") + all_params.append("_request_timeout") - for key, val in six.iteritems(local_var_params['kwargs']): + for key, val in six.iteritems(local_var_params["kwargs"]): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method get_service_metadata" % key ) local_var_params[key] = val - del local_var_params['kwargs'] + del local_var_params["kwargs"] collection_formats = {} @@ -112,24 +109,29 @@ def get_service_metadata_with_http_info(self, **kwargs): # noqa: E501 body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # noqa: E501 # Authentication setting auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/v0/meta', 'GET', + "/v0/meta", + "GET", path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='Meta', # noqa: E501 + response_type="Meta", # noqa: E501 auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + async_req=local_var_params.get("async_req"), + _return_http_data_only=local_var_params.get( + "_return_http_data_only" + ), # noqa: E501 + _preload_content=local_var_params.get("_preload_content", True), + _request_timeout=local_var_params.get("_request_timeout"), + collection_formats=collection_formats, + ) diff --git a/osparc/api/solvers_api.py b/osparc/api/solvers_api.py index f6915926..353231a2 100644 --- a/osparc/api/solvers_api.py +++ b/osparc/api/solvers_api.py @@ -5,7 +5,7 @@ osparc-simcore public web API specifications # noqa: E501 - The version of the OpenAPI document: 0.3.0 + The version of the OpenAPI document: 0.4.0 Generated by: https://openapi-generator.tech """ @@ -18,10 +18,7 @@ import six from osparc.api_client import ApiClient -from osparc.exceptions import ( - ApiTypeError, - ApiValueError -) +from osparc.exceptions import ApiTypeError, ApiValueError class SolversApi(object): @@ -60,10 +57,14 @@ def create_job(self, solver_key, version, job_inputs, **kwargs): # noqa: E501 If the method is called asynchronously, returns the request thread. """ - kwargs['_return_http_data_only'] = True - return self.create_job_with_http_info(solver_key, version, job_inputs, **kwargs) # noqa: E501 - - def create_job_with_http_info(self, solver_key, version, job_inputs, **kwargs): # noqa: E501 + kwargs["_return_http_data_only"] = True + return self.create_job_with_http_info( + solver_key, version, job_inputs, **kwargs + ) # noqa: E501 + + def create_job_with_http_info( + self, solver_key, version, job_inputs, **kwargs + ): # noqa: E501 """Create Job # noqa: E501 Creates a job in a specific release with given inputs. NOTE: This operation does **not** start the job # noqa: E501 @@ -92,42 +93,63 @@ def create_job_with_http_info(self, solver_key, version, job_inputs, **kwargs): local_var_params = locals() - all_params = ['solver_key', 'version', 'job_inputs'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params = ["solver_key", "version", "job_inputs"] # noqa: E501 + all_params.append("async_req") + all_params.append("_return_http_data_only") + all_params.append("_preload_content") + all_params.append("_request_timeout") - for key, val in six.iteritems(local_var_params['kwargs']): + for key, val in six.iteritems(local_var_params["kwargs"]): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method create_job" % key ) local_var_params[key] = val - del local_var_params['kwargs'] + del local_var_params["kwargs"] # verify the required parameter 'solver_key' is set - if self.api_client.client_side_validation and ('solver_key' not in local_var_params or # noqa: E501 - local_var_params['solver_key'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `solver_key` when calling `create_job`") # noqa: E501 + if self.api_client.client_side_validation and ( + "solver_key" not in local_var_params + or local_var_params["solver_key"] is None # noqa: E501 + ): # noqa: E501 + raise ApiValueError( + "Missing the required parameter `solver_key` when calling `create_job`" + ) # noqa: E501 # verify the required parameter 'version' is set - if self.api_client.client_side_validation and ('version' not in local_var_params or # noqa: E501 - local_var_params['version'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `version` when calling `create_job`") # noqa: E501 + if self.api_client.client_side_validation and ( + "version" not in local_var_params + or local_var_params["version"] is None # noqa: E501 + ): # noqa: E501 + raise ApiValueError( + "Missing the required parameter `version` when calling `create_job`" + ) # noqa: E501 # verify the required parameter 'job_inputs' is set - if self.api_client.client_side_validation and ('job_inputs' not in local_var_params or # noqa: E501 - local_var_params['job_inputs'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `job_inputs` when calling `create_job`") # noqa: E501 - - if self.api_client.client_side_validation and 'solver_key' in local_var_params and not re.search(r'^(simcore)\/(services)\/comp(\/[\w\/-]+)+$', local_var_params['solver_key']): # noqa: E501 - raise ApiValueError("Invalid value for parameter `solver_key` when calling `create_job`, must conform to the pattern `/^(simcore)\/(services)\/comp(\/[\w\/-]+)+$/`") # noqa: E501 + if self.api_client.client_side_validation and ( + "job_inputs" not in local_var_params + or local_var_params["job_inputs"] is None # noqa: E501 + ): # noqa: E501 + raise ApiValueError( + "Missing the required parameter `job_inputs` when calling `create_job`" + ) # noqa: E501 + + if ( + self.api_client.client_side_validation + and "solver_key" in local_var_params + and not re.search( + r"^(simcore)\/(services)\/comp(\/[\w\/-]+)+$", + local_var_params["solver_key"], + ) + ): # noqa: E501 + raise ApiValueError( + "Invalid value for parameter `solver_key` when calling `create_job`, must conform to the pattern `/^(simcore)\/(services)\/comp(\/[\w\/-]+)+$/`" + ) # noqa: E501 collection_formats = {} path_params = {} - if 'solver_key' in local_var_params: - path_params['solver_key'] = local_var_params['solver_key'] # noqa: E501 - if 'version' in local_var_params: - path_params['version'] = local_var_params['version'] # noqa: E501 + if "solver_key" in local_var_params: + path_params["solver_key"] = local_var_params["solver_key"] # noqa: E501 + if "version" in local_var_params: + path_params["version"] = local_var_params["version"] # noqa: E501 query_params = [] @@ -137,39 +159,47 @@ def create_job_with_http_info(self, solver_key, version, job_inputs, **kwargs): local_var_files = {} body_params = None - if 'job_inputs' in local_var_params: - body_params = local_var_params['job_inputs'] + if "job_inputs" in local_var_params: + body_params = local_var_params["job_inputs"] # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # noqa: E501 # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 + header_params[ + "Content-Type" + ] = self.api_client.select_header_content_type( # noqa: E501 + ["application/json"] + ) # noqa: E501 # Authentication setting - auth_settings = ['HTTPBasic'] # noqa: E501 + auth_settings = ["HTTPBasic"] # noqa: E501 return self.api_client.call_api( - '/v0/solvers/{solver_key}/releases/{version}/jobs', 'POST', + "/v0/solvers/{solver_key}/releases/{version}/jobs", + "POST", path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='Job', # noqa: E501 + response_type="Job", # noqa: E501 auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + async_req=local_var_params.get("async_req"), + _return_http_data_only=local_var_params.get( + "_return_http_data_only" + ), # noqa: E501 + _preload_content=local_var_params.get("_preload_content", True), + _request_timeout=local_var_params.get("_request_timeout"), + collection_formats=collection_formats, + ) def get_job(self, solver_key, version, job_id, **kwargs): # noqa: E501 """Get Job # noqa: E501 - Gets job of a given solver # noqa: E501 + Gets job of a given solver # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_job(solver_key, version, job_id, async_req=True) @@ -190,13 +220,17 @@ def get_job(self, solver_key, version, job_id, **kwargs): # noqa: E501 If the method is called asynchronously, returns the request thread. """ - kwargs['_return_http_data_only'] = True - return self.get_job_with_http_info(solver_key, version, job_id, **kwargs) # noqa: E501 - - def get_job_with_http_info(self, solver_key, version, job_id, **kwargs): # noqa: E501 + kwargs["_return_http_data_only"] = True + return self.get_job_with_http_info( + solver_key, version, job_id, **kwargs + ) # noqa: E501 + + def get_job_with_http_info( + self, solver_key, version, job_id, **kwargs + ): # noqa: E501 """Get Job # noqa: E501 - Gets job of a given solver # noqa: E501 + Gets job of a given solver # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_job_with_http_info(solver_key, version, job_id, async_req=True) @@ -222,46 +256,244 @@ def get_job_with_http_info(self, solver_key, version, job_id, **kwargs): # noqa local_var_params = locals() - all_params = ['solver_key', 'version', 'job_id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params = ["solver_key", "version", "job_id"] # noqa: E501 + all_params.append("async_req") + all_params.append("_return_http_data_only") + all_params.append("_preload_content") + all_params.append("_request_timeout") + + for key, val in six.iteritems(local_var_params["kwargs"]): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" " to method get_job" % key + ) + local_var_params[key] = val + del local_var_params["kwargs"] + # verify the required parameter 'solver_key' is set + if self.api_client.client_side_validation and ( + "solver_key" not in local_var_params + or local_var_params["solver_key"] is None # noqa: E501 + ): # noqa: E501 + raise ApiValueError( + "Missing the required parameter `solver_key` when calling `get_job`" + ) # noqa: E501 + # verify the required parameter 'version' is set + if self.api_client.client_side_validation and ( + "version" not in local_var_params + or local_var_params["version"] is None # noqa: E501 + ): # noqa: E501 + raise ApiValueError( + "Missing the required parameter `version` when calling `get_job`" + ) # noqa: E501 + # verify the required parameter 'job_id' is set + if self.api_client.client_side_validation and ( + "job_id" not in local_var_params + or local_var_params["job_id"] is None # noqa: E501 + ): # noqa: E501 + raise ApiValueError( + "Missing the required parameter `job_id` when calling `get_job`" + ) # noqa: E501 + + if ( + self.api_client.client_side_validation + and "solver_key" in local_var_params + and not re.search( + r"^(simcore)\/(services)\/comp(\/[\w\/-]+)+$", + local_var_params["solver_key"], + ) + ): # noqa: E501 + raise ApiValueError( + "Invalid value for parameter `solver_key` when calling `get_job`, must conform to the pattern `/^(simcore)\/(services)\/comp(\/[\w\/-]+)+$/`" + ) # noqa: E501 + if ( + self.api_client.client_side_validation + and "version" in local_var_params + and not re.search( + r"^(0|[1-9]\d*)(\.(0|[1-9]\d*)){2}(-(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*)(\.(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*))*)?(\+[-\da-zA-Z]+(\.[-\da-zA-Z-]+)*)?$", + local_var_params["version"], + ) + ): # noqa: E501 + raise ApiValueError( + "Invalid value for parameter `version` when calling `get_job`, must conform to the pattern `/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){2}(-(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*)(\.(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*))*)?(\+[-\da-zA-Z]+(\.[-\da-zA-Z-]+)*)?$/`" + ) # noqa: E501 + collection_formats = {} + + path_params = {} + if "solver_key" in local_var_params: + path_params["solver_key"] = local_var_params["solver_key"] # noqa: E501 + if "version" in local_var_params: + path_params["version"] = local_var_params["version"] # noqa: E501 + if "job_id" in local_var_params: + path_params["job_id"] = local_var_params["job_id"] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # noqa: E501 + + # Authentication setting + auth_settings = ["HTTPBasic"] # noqa: E501 + + return self.api_client.call_api( + "/v0/solvers/{solver_key}/releases/{version}/jobs/{job_id}", + "GET", + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type="Job", # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get("async_req"), + _return_http_data_only=local_var_params.get( + "_return_http_data_only" + ), # noqa: E501 + _preload_content=local_var_params.get("_preload_content", True), + _request_timeout=local_var_params.get("_request_timeout"), + collection_formats=collection_formats, + ) + + def get_job_output_logfile( + self, solver_key, version, job_id, **kwargs + ): # noqa: E501 + """Get Job Output Logfile # noqa: E501 + + Special extra output with persistent logs file for the solver run. NOTE: this is not a log stream but a predefined output that is only available after the job is done. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_job_output_logfile(solver_key, version, job_id, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param str solver_key: (required) + :param str version: (required) + :param str job_id: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: file + If the method is called asynchronously, + returns the request thread. + """ + kwargs["_return_http_data_only"] = True + return self.get_job_output_logfile_with_http_info( + solver_key, version, job_id, **kwargs + ) # noqa: E501 + + def get_job_output_logfile_with_http_info( + self, solver_key, version, job_id, **kwargs + ): # noqa: E501 + """Get Job Output Logfile # noqa: E501 + + Special extra output with persistent logs file for the solver run. NOTE: this is not a log stream but a predefined output that is only available after the job is done. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_job_output_logfile_with_http_info(solver_key, version, job_id, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param str solver_key: (required) + :param str version: (required) + :param str job_id: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: tuple(file, status_code(int), headers(HTTPHeaderDict)) + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ["solver_key", "version", "job_id"] # noqa: E501 + all_params.append("async_req") + all_params.append("_return_http_data_only") + all_params.append("_preload_content") + all_params.append("_request_timeout") - for key, val in six.iteritems(local_var_params['kwargs']): + for key, val in six.iteritems(local_var_params["kwargs"]): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" - " to method get_job" % key + " to method get_job_output_logfile" % key ) local_var_params[key] = val - del local_var_params['kwargs'] + del local_var_params["kwargs"] # verify the required parameter 'solver_key' is set - if self.api_client.client_side_validation and ('solver_key' not in local_var_params or # noqa: E501 - local_var_params['solver_key'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `solver_key` when calling `get_job`") # noqa: E501 + if self.api_client.client_side_validation and ( + "solver_key" not in local_var_params + or local_var_params["solver_key"] is None # noqa: E501 + ): # noqa: E501 + raise ApiValueError( + "Missing the required parameter `solver_key` when calling `get_job_output_logfile`" + ) # noqa: E501 # verify the required parameter 'version' is set - if self.api_client.client_side_validation and ('version' not in local_var_params or # noqa: E501 - local_var_params['version'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `version` when calling `get_job`") # noqa: E501 + if self.api_client.client_side_validation and ( + "version" not in local_var_params + or local_var_params["version"] is None # noqa: E501 + ): # noqa: E501 + raise ApiValueError( + "Missing the required parameter `version` when calling `get_job_output_logfile`" + ) # noqa: E501 # verify the required parameter 'job_id' is set - if self.api_client.client_side_validation and ('job_id' not in local_var_params or # noqa: E501 - local_var_params['job_id'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `job_id` when calling `get_job`") # noqa: E501 - - if self.api_client.client_side_validation and 'solver_key' in local_var_params and not re.search(r'^(simcore)\/(services)\/comp(\/[\w\/-]+)+$', local_var_params['solver_key']): # noqa: E501 - raise ApiValueError("Invalid value for parameter `solver_key` when calling `get_job`, must conform to the pattern `/^(simcore)\/(services)\/comp(\/[\w\/-]+)+$/`") # noqa: E501 - if self.api_client.client_side_validation and 'version' in local_var_params and not re.search(r'^(0|[1-9]\d*)(\.(0|[1-9]\d*)){2}(-(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*)(\.(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*))*)?(\+[-\da-zA-Z]+(\.[-\da-zA-Z-]+)*)?$', local_var_params['version']): # noqa: E501 - raise ApiValueError("Invalid value for parameter `version` when calling `get_job`, must conform to the pattern `/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){2}(-(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*)(\.(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*))*)?(\+[-\da-zA-Z]+(\.[-\da-zA-Z-]+)*)?$/`") # noqa: E501 + if self.api_client.client_side_validation and ( + "job_id" not in local_var_params + or local_var_params["job_id"] is None # noqa: E501 + ): # noqa: E501 + raise ApiValueError( + "Missing the required parameter `job_id` when calling `get_job_output_logfile`" + ) # noqa: E501 + + if ( + self.api_client.client_side_validation + and "solver_key" in local_var_params + and not re.search( + r"^(simcore)\/(services)\/comp(\/[\w\/-]+)+$", + local_var_params["solver_key"], + ) + ): # noqa: E501 + raise ApiValueError( + "Invalid value for parameter `solver_key` when calling `get_job_output_logfile`, must conform to the pattern `/^(simcore)\/(services)\/comp(\/[\w\/-]+)+$/`" + ) # noqa: E501 + if ( + self.api_client.client_side_validation + and "version" in local_var_params + and not re.search( + r"^(0|[1-9]\d*)(\.(0|[1-9]\d*)){2}(-(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*)(\.(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*))*)?(\+[-\da-zA-Z]+(\.[-\da-zA-Z-]+)*)?$", + local_var_params["version"], + ) + ): # noqa: E501 + raise ApiValueError( + "Invalid value for parameter `version` when calling `get_job_output_logfile`, must conform to the pattern `/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){2}(-(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*)(\.(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*))*)?(\+[-\da-zA-Z]+(\.[-\da-zA-Z-]+)*)?$/`" + ) # noqa: E501 collection_formats = {} path_params = {} - if 'solver_key' in local_var_params: - path_params['solver_key'] = local_var_params['solver_key'] # noqa: E501 - if 'version' in local_var_params: - path_params['version'] = local_var_params['version'] # noqa: E501 - if 'job_id' in local_var_params: - path_params['job_id'] = local_var_params['job_id'] # noqa: E501 + if "solver_key" in local_var_params: + path_params["solver_key"] = local_var_params["solver_key"] # noqa: E501 + if "version" in local_var_params: + path_params["version"] = local_var_params["version"] # noqa: E501 + if "job_id" in local_var_params: + path_params["job_id"] = local_var_params["job_id"] # noqa: E501 query_params = [] @@ -272,27 +504,37 @@ def get_job_with_http_info(self, solver_key, version, job_id, **kwargs): # noqa body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + header_params["Accept"] = self.api_client.select_header_accept( + [ + "application/octet-stream", + "application/zip", + "text/plain", + "application/json", + ] + ) # noqa: E501 # Authentication setting - auth_settings = ['HTTPBasic'] # noqa: E501 + auth_settings = ["HTTPBasic"] # noqa: E501 return self.api_client.call_api( - '/v0/solvers/{solver_key}/releases/{version}/jobs/{job_id}', 'GET', + "/v0/solvers/{solver_key}/releases/{version}/jobs/{job_id}/outputs/logfile", + "GET", path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='Job', # noqa: E501 + response_type="file", # noqa: E501 auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + async_req=local_var_params.get("async_req"), + _return_http_data_only=local_var_params.get( + "_return_http_data_only" + ), # noqa: E501 + _preload_content=local_var_params.get("_preload_content", True), + _request_timeout=local_var_params.get("_request_timeout"), + collection_formats=collection_formats, + ) def get_job_outputs(self, solver_key, version, job_id, **kwargs): # noqa: E501 """Get Job Outputs # noqa: E501 @@ -317,10 +559,14 @@ def get_job_outputs(self, solver_key, version, job_id, **kwargs): # noqa: E501 If the method is called asynchronously, returns the request thread. """ - kwargs['_return_http_data_only'] = True - return self.get_job_outputs_with_http_info(solver_key, version, job_id, **kwargs) # noqa: E501 - - def get_job_outputs_with_http_info(self, solver_key, version, job_id, **kwargs): # noqa: E501 + kwargs["_return_http_data_only"] = True + return self.get_job_outputs_with_http_info( + solver_key, version, job_id, **kwargs + ) # noqa: E501 + + def get_job_outputs_with_http_info( + self, solver_key, version, job_id, **kwargs + ): # noqa: E501 """Get Job Outputs # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -348,46 +594,76 @@ def get_job_outputs_with_http_info(self, solver_key, version, job_id, **kwargs): local_var_params = locals() - all_params = ['solver_key', 'version', 'job_id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params = ["solver_key", "version", "job_id"] # noqa: E501 + all_params.append("async_req") + all_params.append("_return_http_data_only") + all_params.append("_preload_content") + all_params.append("_request_timeout") - for key, val in six.iteritems(local_var_params['kwargs']): + for key, val in six.iteritems(local_var_params["kwargs"]): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method get_job_outputs" % key ) local_var_params[key] = val - del local_var_params['kwargs'] + del local_var_params["kwargs"] # verify the required parameter 'solver_key' is set - if self.api_client.client_side_validation and ('solver_key' not in local_var_params or # noqa: E501 - local_var_params['solver_key'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `solver_key` when calling `get_job_outputs`") # noqa: E501 + if self.api_client.client_side_validation and ( + "solver_key" not in local_var_params + or local_var_params["solver_key"] is None # noqa: E501 + ): # noqa: E501 + raise ApiValueError( + "Missing the required parameter `solver_key` when calling `get_job_outputs`" + ) # noqa: E501 # verify the required parameter 'version' is set - if self.api_client.client_side_validation and ('version' not in local_var_params or # noqa: E501 - local_var_params['version'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `version` when calling `get_job_outputs`") # noqa: E501 + if self.api_client.client_side_validation and ( + "version" not in local_var_params + or local_var_params["version"] is None # noqa: E501 + ): # noqa: E501 + raise ApiValueError( + "Missing the required parameter `version` when calling `get_job_outputs`" + ) # noqa: E501 # verify the required parameter 'job_id' is set - if self.api_client.client_side_validation and ('job_id' not in local_var_params or # noqa: E501 - local_var_params['job_id'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `job_id` when calling `get_job_outputs`") # noqa: E501 - - if self.api_client.client_side_validation and 'solver_key' in local_var_params and not re.search(r'^(simcore)\/(services)\/comp(\/[\w\/-]+)+$', local_var_params['solver_key']): # noqa: E501 - raise ApiValueError("Invalid value for parameter `solver_key` when calling `get_job_outputs`, must conform to the pattern `/^(simcore)\/(services)\/comp(\/[\w\/-]+)+$/`") # noqa: E501 - if self.api_client.client_side_validation and 'version' in local_var_params and not re.search(r'^(0|[1-9]\d*)(\.(0|[1-9]\d*)){2}(-(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*)(\.(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*))*)?(\+[-\da-zA-Z]+(\.[-\da-zA-Z-]+)*)?$', local_var_params['version']): # noqa: E501 - raise ApiValueError("Invalid value for parameter `version` when calling `get_job_outputs`, must conform to the pattern `/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){2}(-(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*)(\.(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*))*)?(\+[-\da-zA-Z]+(\.[-\da-zA-Z-]+)*)?$/`") # noqa: E501 + if self.api_client.client_side_validation and ( + "job_id" not in local_var_params + or local_var_params["job_id"] is None # noqa: E501 + ): # noqa: E501 + raise ApiValueError( + "Missing the required parameter `job_id` when calling `get_job_outputs`" + ) # noqa: E501 + + if ( + self.api_client.client_side_validation + and "solver_key" in local_var_params + and not re.search( + r"^(simcore)\/(services)\/comp(\/[\w\/-]+)+$", + local_var_params["solver_key"], + ) + ): # noqa: E501 + raise ApiValueError( + "Invalid value for parameter `solver_key` when calling `get_job_outputs`, must conform to the pattern `/^(simcore)\/(services)\/comp(\/[\w\/-]+)+$/`" + ) # noqa: E501 + if ( + self.api_client.client_side_validation + and "version" in local_var_params + and not re.search( + r"^(0|[1-9]\d*)(\.(0|[1-9]\d*)){2}(-(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*)(\.(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*))*)?(\+[-\da-zA-Z]+(\.[-\da-zA-Z-]+)*)?$", + local_var_params["version"], + ) + ): # noqa: E501 + raise ApiValueError( + "Invalid value for parameter `version` when calling `get_job_outputs`, must conform to the pattern `/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){2}(-(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*)(\.(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*))*)?(\+[-\da-zA-Z]+(\.[-\da-zA-Z-]+)*)?$/`" + ) # noqa: E501 collection_formats = {} path_params = {} - if 'solver_key' in local_var_params: - path_params['solver_key'] = local_var_params['solver_key'] # noqa: E501 - if 'version' in local_var_params: - path_params['version'] = local_var_params['version'] # noqa: E501 - if 'job_id' in local_var_params: - path_params['job_id'] = local_var_params['job_id'] # noqa: E501 + if "solver_key" in local_var_params: + path_params["solver_key"] = local_var_params["solver_key"] # noqa: E501 + if "version" in local_var_params: + path_params["version"] = local_var_params["version"] # noqa: E501 + if "job_id" in local_var_params: + path_params["job_id"] = local_var_params["job_id"] # noqa: E501 query_params = [] @@ -398,32 +674,37 @@ def get_job_outputs_with_http_info(self, solver_key, version, job_id, **kwargs): body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # noqa: E501 # Authentication setting - auth_settings = ['HTTPBasic'] # noqa: E501 + auth_settings = ["HTTPBasic"] # noqa: E501 return self.api_client.call_api( - '/v0/solvers/{solver_key}/releases/{version}/jobs/{job_id}/outputs', 'GET', + "/v0/solvers/{solver_key}/releases/{version}/jobs/{job_id}/outputs", + "GET", path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='JobOutputs', # noqa: E501 + response_type="JobOutputs", # noqa: E501 auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + async_req=local_var_params.get("async_req"), + _return_http_data_only=local_var_params.get( + "_return_http_data_only" + ), # noqa: E501 + _preload_content=local_var_params.get("_preload_content", True), + _request_timeout=local_var_params.get("_request_timeout"), + collection_formats=collection_formats, + ) def get_solver(self, solver_key, **kwargs): # noqa: E501 """Get Latest Release of a Solver # noqa: E501 - Gets latest release of a solver # noqa: E501 + Gets latest release of a solver # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_solver(solver_key, async_req=True) @@ -442,13 +723,13 @@ def get_solver(self, solver_key, **kwargs): # noqa: E501 If the method is called asynchronously, returns the request thread. """ - kwargs['_return_http_data_only'] = True + kwargs["_return_http_data_only"] = True return self.get_solver_with_http_info(solver_key, **kwargs) # noqa: E501 def get_solver_with_http_info(self, solver_key, **kwargs): # noqa: E501 """Get Latest Release of a Solver # noqa: E501 - Gets latest release of a solver # noqa: E501 + Gets latest release of a solver # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_solver_with_http_info(solver_key, async_req=True) @@ -472,32 +753,45 @@ def get_solver_with_http_info(self, solver_key, **kwargs): # noqa: E501 local_var_params = locals() - all_params = ['solver_key'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params = ["solver_key"] # noqa: E501 + all_params.append("async_req") + all_params.append("_return_http_data_only") + all_params.append("_preload_content") + all_params.append("_request_timeout") - for key, val in six.iteritems(local_var_params['kwargs']): + for key, val in six.iteritems(local_var_params["kwargs"]): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method get_solver" % key ) local_var_params[key] = val - del local_var_params['kwargs'] + del local_var_params["kwargs"] # verify the required parameter 'solver_key' is set - if self.api_client.client_side_validation and ('solver_key' not in local_var_params or # noqa: E501 - local_var_params['solver_key'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `solver_key` when calling `get_solver`") # noqa: E501 - - if self.api_client.client_side_validation and 'solver_key' in local_var_params and not re.search(r'^(simcore)\/(services)\/comp(\/[\w\/-]+)+$', local_var_params['solver_key']): # noqa: E501 - raise ApiValueError("Invalid value for parameter `solver_key` when calling `get_solver`, must conform to the pattern `/^(simcore)\/(services)\/comp(\/[\w\/-]+)+$/`") # noqa: E501 + if self.api_client.client_side_validation and ( + "solver_key" not in local_var_params + or local_var_params["solver_key"] is None # noqa: E501 + ): # noqa: E501 + raise ApiValueError( + "Missing the required parameter `solver_key` when calling `get_solver`" + ) # noqa: E501 + + if ( + self.api_client.client_side_validation + and "solver_key" in local_var_params + and not re.search( + r"^(simcore)\/(services)\/comp(\/[\w\/-]+)+$", + local_var_params["solver_key"], + ) + ): # noqa: E501 + raise ApiValueError( + "Invalid value for parameter `solver_key` when calling `get_solver`, must conform to the pattern `/^(simcore)\/(services)\/comp(\/[\w\/-]+)+$/`" + ) # noqa: E501 collection_formats = {} path_params = {} - if 'solver_key' in local_var_params: - path_params['solver_key'] = local_var_params['solver_key'] # noqa: E501 + if "solver_key" in local_var_params: + path_params["solver_key"] = local_var_params["solver_key"] # noqa: E501 query_params = [] @@ -508,32 +802,37 @@ def get_solver_with_http_info(self, solver_key, **kwargs): # noqa: E501 body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # noqa: E501 # Authentication setting - auth_settings = ['HTTPBasic'] # noqa: E501 + auth_settings = ["HTTPBasic"] # noqa: E501 return self.api_client.call_api( - '/v0/solvers/{solver_key}/latest', 'GET', + "/v0/solvers/{solver_key}/latest", + "GET", path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='Solver', # noqa: E501 + response_type="Solver", # noqa: E501 auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + async_req=local_var_params.get("async_req"), + _return_http_data_only=local_var_params.get( + "_return_http_data_only" + ), # noqa: E501 + _preload_content=local_var_params.get("_preload_content", True), + _request_timeout=local_var_params.get("_request_timeout"), + collection_formats=collection_formats, + ) def get_solver_release(self, solver_key, version, **kwargs): # noqa: E501 """Get Solver Release # noqa: E501 - Gets a specific release of a solver # noqa: E501 + Gets a specific release of a solver # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_solver_release(solver_key, version, async_req=True) @@ -553,13 +852,17 @@ def get_solver_release(self, solver_key, version, **kwargs): # noqa: E501 If the method is called asynchronously, returns the request thread. """ - kwargs['_return_http_data_only'] = True - return self.get_solver_release_with_http_info(solver_key, version, **kwargs) # noqa: E501 - - def get_solver_release_with_http_info(self, solver_key, version, **kwargs): # noqa: E501 + kwargs["_return_http_data_only"] = True + return self.get_solver_release_with_http_info( + solver_key, version, **kwargs + ) # noqa: E501 + + def get_solver_release_with_http_info( + self, solver_key, version, **kwargs + ): # noqa: E501 """Get Solver Release # noqa: E501 - Gets a specific release of a solver # noqa: E501 + Gets a specific release of a solver # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_solver_release_with_http_info(solver_key, version, async_req=True) @@ -584,40 +887,66 @@ def get_solver_release_with_http_info(self, solver_key, version, **kwargs): # n local_var_params = locals() - all_params = ['solver_key', 'version'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params = ["solver_key", "version"] # noqa: E501 + all_params.append("async_req") + all_params.append("_return_http_data_only") + all_params.append("_preload_content") + all_params.append("_request_timeout") - for key, val in six.iteritems(local_var_params['kwargs']): + for key, val in six.iteritems(local_var_params["kwargs"]): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method get_solver_release" % key ) local_var_params[key] = val - del local_var_params['kwargs'] + del local_var_params["kwargs"] # verify the required parameter 'solver_key' is set - if self.api_client.client_side_validation and ('solver_key' not in local_var_params or # noqa: E501 - local_var_params['solver_key'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `solver_key` when calling `get_solver_release`") # noqa: E501 + if self.api_client.client_side_validation and ( + "solver_key" not in local_var_params + or local_var_params["solver_key"] is None # noqa: E501 + ): # noqa: E501 + raise ApiValueError( + "Missing the required parameter `solver_key` when calling `get_solver_release`" + ) # noqa: E501 # verify the required parameter 'version' is set - if self.api_client.client_side_validation and ('version' not in local_var_params or # noqa: E501 - local_var_params['version'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `version` when calling `get_solver_release`") # noqa: E501 - - if self.api_client.client_side_validation and 'solver_key' in local_var_params and not re.search(r'^(simcore)\/(services)\/comp(\/[\w\/-]+)+$', local_var_params['solver_key']): # noqa: E501 - raise ApiValueError("Invalid value for parameter `solver_key` when calling `get_solver_release`, must conform to the pattern `/^(simcore)\/(services)\/comp(\/[\w\/-]+)+$/`") # noqa: E501 - if self.api_client.client_side_validation and 'version' in local_var_params and not re.search(r'^(0|[1-9]\d*)(\.(0|[1-9]\d*)){2}(-(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*)(\.(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*))*)?(\+[-\da-zA-Z]+(\.[-\da-zA-Z-]+)*)?$', local_var_params['version']): # noqa: E501 - raise ApiValueError("Invalid value for parameter `version` when calling `get_solver_release`, must conform to the pattern `/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){2}(-(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*)(\.(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*))*)?(\+[-\da-zA-Z]+(\.[-\da-zA-Z-]+)*)?$/`") # noqa: E501 + if self.api_client.client_side_validation and ( + "version" not in local_var_params + or local_var_params["version"] is None # noqa: E501 + ): # noqa: E501 + raise ApiValueError( + "Missing the required parameter `version` when calling `get_solver_release`" + ) # noqa: E501 + + if ( + self.api_client.client_side_validation + and "solver_key" in local_var_params + and not re.search( + r"^(simcore)\/(services)\/comp(\/[\w\/-]+)+$", + local_var_params["solver_key"], + ) + ): # noqa: E501 + raise ApiValueError( + "Invalid value for parameter `solver_key` when calling `get_solver_release`, must conform to the pattern `/^(simcore)\/(services)\/comp(\/[\w\/-]+)+$/`" + ) # noqa: E501 + if ( + self.api_client.client_side_validation + and "version" in local_var_params + and not re.search( + r"^(0|[1-9]\d*)(\.(0|[1-9]\d*)){2}(-(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*)(\.(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*))*)?(\+[-\da-zA-Z]+(\.[-\da-zA-Z-]+)*)?$", + local_var_params["version"], + ) + ): # noqa: E501 + raise ApiValueError( + "Invalid value for parameter `version` when calling `get_solver_release`, must conform to the pattern `/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){2}(-(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*)(\.(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*))*)?(\+[-\da-zA-Z]+(\.[-\da-zA-Z-]+)*)?$/`" + ) # noqa: E501 collection_formats = {} path_params = {} - if 'solver_key' in local_var_params: - path_params['solver_key'] = local_var_params['solver_key'] # noqa: E501 - if 'version' in local_var_params: - path_params['version'] = local_var_params['version'] # noqa: E501 + if "solver_key" in local_var_params: + path_params["solver_key"] = local_var_params["solver_key"] # noqa: E501 + if "version" in local_var_params: + path_params["version"] = local_var_params["version"] # noqa: E501 query_params = [] @@ -628,27 +957,32 @@ def get_solver_release_with_http_info(self, solver_key, version, **kwargs): # n body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # noqa: E501 # Authentication setting - auth_settings = ['HTTPBasic'] # noqa: E501 + auth_settings = ["HTTPBasic"] # noqa: E501 return self.api_client.call_api( - '/v0/solvers/{solver_key}/releases/{version}', 'GET', + "/v0/solvers/{solver_key}/releases/{version}", + "GET", path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='Solver', # noqa: E501 + response_type="Solver", # noqa: E501 auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + async_req=local_var_params.get("async_req"), + _return_http_data_only=local_var_params.get( + "_return_http_data_only" + ), # noqa: E501 + _preload_content=local_var_params.get("_preload_content", True), + _request_timeout=local_var_params.get("_request_timeout"), + collection_formats=collection_formats, + ) def inspect_job(self, solver_key, version, job_id, **kwargs): # noqa: E501 """Inspect Job # noqa: E501 @@ -673,10 +1007,14 @@ def inspect_job(self, solver_key, version, job_id, **kwargs): # noqa: E501 If the method is called asynchronously, returns the request thread. """ - kwargs['_return_http_data_only'] = True - return self.inspect_job_with_http_info(solver_key, version, job_id, **kwargs) # noqa: E501 - - def inspect_job_with_http_info(self, solver_key, version, job_id, **kwargs): # noqa: E501 + kwargs["_return_http_data_only"] = True + return self.inspect_job_with_http_info( + solver_key, version, job_id, **kwargs + ) # noqa: E501 + + def inspect_job_with_http_info( + self, solver_key, version, job_id, **kwargs + ): # noqa: E501 """Inspect Job # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -704,46 +1042,76 @@ def inspect_job_with_http_info(self, solver_key, version, job_id, **kwargs): # local_var_params = locals() - all_params = ['solver_key', 'version', 'job_id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params = ["solver_key", "version", "job_id"] # noqa: E501 + all_params.append("async_req") + all_params.append("_return_http_data_only") + all_params.append("_preload_content") + all_params.append("_request_timeout") - for key, val in six.iteritems(local_var_params['kwargs']): + for key, val in six.iteritems(local_var_params["kwargs"]): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method inspect_job" % key ) local_var_params[key] = val - del local_var_params['kwargs'] + del local_var_params["kwargs"] # verify the required parameter 'solver_key' is set - if self.api_client.client_side_validation and ('solver_key' not in local_var_params or # noqa: E501 - local_var_params['solver_key'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `solver_key` when calling `inspect_job`") # noqa: E501 + if self.api_client.client_side_validation and ( + "solver_key" not in local_var_params + or local_var_params["solver_key"] is None # noqa: E501 + ): # noqa: E501 + raise ApiValueError( + "Missing the required parameter `solver_key` when calling `inspect_job`" + ) # noqa: E501 # verify the required parameter 'version' is set - if self.api_client.client_side_validation and ('version' not in local_var_params or # noqa: E501 - local_var_params['version'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `version` when calling `inspect_job`") # noqa: E501 + if self.api_client.client_side_validation and ( + "version" not in local_var_params + or local_var_params["version"] is None # noqa: E501 + ): # noqa: E501 + raise ApiValueError( + "Missing the required parameter `version` when calling `inspect_job`" + ) # noqa: E501 # verify the required parameter 'job_id' is set - if self.api_client.client_side_validation and ('job_id' not in local_var_params or # noqa: E501 - local_var_params['job_id'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `job_id` when calling `inspect_job`") # noqa: E501 - - if self.api_client.client_side_validation and 'solver_key' in local_var_params and not re.search(r'^(simcore)\/(services)\/comp(\/[\w\/-]+)+$', local_var_params['solver_key']): # noqa: E501 - raise ApiValueError("Invalid value for parameter `solver_key` when calling `inspect_job`, must conform to the pattern `/^(simcore)\/(services)\/comp(\/[\w\/-]+)+$/`") # noqa: E501 - if self.api_client.client_side_validation and 'version' in local_var_params and not re.search(r'^(0|[1-9]\d*)(\.(0|[1-9]\d*)){2}(-(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*)(\.(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*))*)?(\+[-\da-zA-Z]+(\.[-\da-zA-Z-]+)*)?$', local_var_params['version']): # noqa: E501 - raise ApiValueError("Invalid value for parameter `version` when calling `inspect_job`, must conform to the pattern `/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){2}(-(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*)(\.(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*))*)?(\+[-\da-zA-Z]+(\.[-\da-zA-Z-]+)*)?$/`") # noqa: E501 + if self.api_client.client_side_validation and ( + "job_id" not in local_var_params + or local_var_params["job_id"] is None # noqa: E501 + ): # noqa: E501 + raise ApiValueError( + "Missing the required parameter `job_id` when calling `inspect_job`" + ) # noqa: E501 + + if ( + self.api_client.client_side_validation + and "solver_key" in local_var_params + and not re.search( + r"^(simcore)\/(services)\/comp(\/[\w\/-]+)+$", + local_var_params["solver_key"], + ) + ): # noqa: E501 + raise ApiValueError( + "Invalid value for parameter `solver_key` when calling `inspect_job`, must conform to the pattern `/^(simcore)\/(services)\/comp(\/[\w\/-]+)+$/`" + ) # noqa: E501 + if ( + self.api_client.client_side_validation + and "version" in local_var_params + and not re.search( + r"^(0|[1-9]\d*)(\.(0|[1-9]\d*)){2}(-(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*)(\.(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*))*)?(\+[-\da-zA-Z]+(\.[-\da-zA-Z-]+)*)?$", + local_var_params["version"], + ) + ): # noqa: E501 + raise ApiValueError( + "Invalid value for parameter `version` when calling `inspect_job`, must conform to the pattern `/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){2}(-(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*)(\.(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*))*)?(\+[-\da-zA-Z]+(\.[-\da-zA-Z-]+)*)?$/`" + ) # noqa: E501 collection_formats = {} path_params = {} - if 'solver_key' in local_var_params: - path_params['solver_key'] = local_var_params['solver_key'] # noqa: E501 - if 'version' in local_var_params: - path_params['version'] = local_var_params['version'] # noqa: E501 - if 'job_id' in local_var_params: - path_params['job_id'] = local_var_params['job_id'] # noqa: E501 + if "solver_key" in local_var_params: + path_params["solver_key"] = local_var_params["solver_key"] # noqa: E501 + if "version" in local_var_params: + path_params["version"] = local_var_params["version"] # noqa: E501 + if "job_id" in local_var_params: + path_params["job_id"] = local_var_params["job_id"] # noqa: E501 query_params = [] @@ -754,32 +1122,37 @@ def inspect_job_with_http_info(self, solver_key, version, job_id, **kwargs): # body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # noqa: E501 # Authentication setting - auth_settings = ['HTTPBasic'] # noqa: E501 + auth_settings = ["HTTPBasic"] # noqa: E501 return self.api_client.call_api( - '/v0/solvers/{solver_key}/releases/{version}/jobs/{job_id}:inspect', 'POST', + "/v0/solvers/{solver_key}/releases/{version}/jobs/{job_id}:inspect", + "POST", path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='JobStatus', # noqa: E501 + response_type="JobStatus", # noqa: E501 auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + async_req=local_var_params.get("async_req"), + _return_http_data_only=local_var_params.get( + "_return_http_data_only" + ), # noqa: E501 + _preload_content=local_var_params.get("_preload_content", True), + _request_timeout=local_var_params.get("_request_timeout"), + collection_formats=collection_formats, + ) def list_jobs(self, solver_key, version, **kwargs): # noqa: E501 """List Jobs # noqa: E501 - List of all jobs in a specific released solver # noqa: E501 + List of all jobs in a specific released solver # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_jobs(solver_key, version, async_req=True) @@ -799,13 +1172,15 @@ def list_jobs(self, solver_key, version, **kwargs): # noqa: E501 If the method is called asynchronously, returns the request thread. """ - kwargs['_return_http_data_only'] = True - return self.list_jobs_with_http_info(solver_key, version, **kwargs) # noqa: E501 + kwargs["_return_http_data_only"] = True + return self.list_jobs_with_http_info( + solver_key, version, **kwargs + ) # noqa: E501 def list_jobs_with_http_info(self, solver_key, version, **kwargs): # noqa: E501 """List Jobs # noqa: E501 - List of all jobs in a specific released solver # noqa: E501 + List of all jobs in a specific released solver # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_jobs_with_http_info(solver_key, version, async_req=True) @@ -830,38 +1205,55 @@ def list_jobs_with_http_info(self, solver_key, version, **kwargs): # noqa: E501 local_var_params = locals() - all_params = ['solver_key', 'version'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params = ["solver_key", "version"] # noqa: E501 + all_params.append("async_req") + all_params.append("_return_http_data_only") + all_params.append("_preload_content") + all_params.append("_request_timeout") - for key, val in six.iteritems(local_var_params['kwargs']): + for key, val in six.iteritems(local_var_params["kwargs"]): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method list_jobs" % key ) local_var_params[key] = val - del local_var_params['kwargs'] + del local_var_params["kwargs"] # verify the required parameter 'solver_key' is set - if self.api_client.client_side_validation and ('solver_key' not in local_var_params or # noqa: E501 - local_var_params['solver_key'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `solver_key` when calling `list_jobs`") # noqa: E501 + if self.api_client.client_side_validation and ( + "solver_key" not in local_var_params + or local_var_params["solver_key"] is None # noqa: E501 + ): # noqa: E501 + raise ApiValueError( + "Missing the required parameter `solver_key` when calling `list_jobs`" + ) # noqa: E501 # verify the required parameter 'version' is set - if self.api_client.client_side_validation and ('version' not in local_var_params or # noqa: E501 - local_var_params['version'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `version` when calling `list_jobs`") # noqa: E501 - - if self.api_client.client_side_validation and 'solver_key' in local_var_params and not re.search(r'^(simcore)\/(services)\/comp(\/[\w\/-]+)+$', local_var_params['solver_key']): # noqa: E501 - raise ApiValueError("Invalid value for parameter `solver_key` when calling `list_jobs`, must conform to the pattern `/^(simcore)\/(services)\/comp(\/[\w\/-]+)+$/`") # noqa: E501 + if self.api_client.client_side_validation and ( + "version" not in local_var_params + or local_var_params["version"] is None # noqa: E501 + ): # noqa: E501 + raise ApiValueError( + "Missing the required parameter `version` when calling `list_jobs`" + ) # noqa: E501 + + if ( + self.api_client.client_side_validation + and "solver_key" in local_var_params + and not re.search( + r"^(simcore)\/(services)\/comp(\/[\w\/-]+)+$", + local_var_params["solver_key"], + ) + ): # noqa: E501 + raise ApiValueError( + "Invalid value for parameter `solver_key` when calling `list_jobs`, must conform to the pattern `/^(simcore)\/(services)\/comp(\/[\w\/-]+)+$/`" + ) # noqa: E501 collection_formats = {} path_params = {} - if 'solver_key' in local_var_params: - path_params['solver_key'] = local_var_params['solver_key'] # noqa: E501 - if 'version' in local_var_params: - path_params['version'] = local_var_params['version'] # noqa: E501 + if "solver_key" in local_var_params: + path_params["solver_key"] = local_var_params["solver_key"] # noqa: E501 + if "version" in local_var_params: + path_params["version"] = local_var_params["version"] # noqa: E501 query_params = [] @@ -872,32 +1264,37 @@ def list_jobs_with_http_info(self, solver_key, version, **kwargs): # noqa: E501 body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # noqa: E501 # Authentication setting - auth_settings = ['HTTPBasic'] # noqa: E501 + auth_settings = ["HTTPBasic"] # noqa: E501 return self.api_client.call_api( - '/v0/solvers/{solver_key}/releases/{version}/jobs', 'GET', + "/v0/solvers/{solver_key}/releases/{version}/jobs", + "GET", path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[Job]', # noqa: E501 + response_type="list[Job]", # noqa: E501 auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + async_req=local_var_params.get("async_req"), + _return_http_data_only=local_var_params.get( + "_return_http_data_only" + ), # noqa: E501 + _preload_content=local_var_params.get("_preload_content", True), + _request_timeout=local_var_params.get("_request_timeout"), + collection_formats=collection_formats, + ) def list_solver_releases(self, solver_key, **kwargs): # noqa: E501 """List Solver Releases # noqa: E501 - Lists all releases of a given solver # noqa: E501 + Lists all releases of a given solver # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_solver_releases(solver_key, async_req=True) @@ -916,13 +1313,15 @@ def list_solver_releases(self, solver_key, **kwargs): # noqa: E501 If the method is called asynchronously, returns the request thread. """ - kwargs['_return_http_data_only'] = True - return self.list_solver_releases_with_http_info(solver_key, **kwargs) # noqa: E501 + kwargs["_return_http_data_only"] = True + return self.list_solver_releases_with_http_info( + solver_key, **kwargs + ) # noqa: E501 def list_solver_releases_with_http_info(self, solver_key, **kwargs): # noqa: E501 """List Solver Releases # noqa: E501 - Lists all releases of a given solver # noqa: E501 + Lists all releases of a given solver # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_solver_releases_with_http_info(solver_key, async_req=True) @@ -946,32 +1345,45 @@ def list_solver_releases_with_http_info(self, solver_key, **kwargs): # noqa: E5 local_var_params = locals() - all_params = ['solver_key'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params = ["solver_key"] # noqa: E501 + all_params.append("async_req") + all_params.append("_return_http_data_only") + all_params.append("_preload_content") + all_params.append("_request_timeout") - for key, val in six.iteritems(local_var_params['kwargs']): + for key, val in six.iteritems(local_var_params["kwargs"]): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method list_solver_releases" % key ) local_var_params[key] = val - del local_var_params['kwargs'] + del local_var_params["kwargs"] # verify the required parameter 'solver_key' is set - if self.api_client.client_side_validation and ('solver_key' not in local_var_params or # noqa: E501 - local_var_params['solver_key'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `solver_key` when calling `list_solver_releases`") # noqa: E501 - - if self.api_client.client_side_validation and 'solver_key' in local_var_params and not re.search(r'^(simcore)\/(services)\/comp(\/[\w\/-]+)+$', local_var_params['solver_key']): # noqa: E501 - raise ApiValueError("Invalid value for parameter `solver_key` when calling `list_solver_releases`, must conform to the pattern `/^(simcore)\/(services)\/comp(\/[\w\/-]+)+$/`") # noqa: E501 + if self.api_client.client_side_validation and ( + "solver_key" not in local_var_params + or local_var_params["solver_key"] is None # noqa: E501 + ): # noqa: E501 + raise ApiValueError( + "Missing the required parameter `solver_key` when calling `list_solver_releases`" + ) # noqa: E501 + + if ( + self.api_client.client_side_validation + and "solver_key" in local_var_params + and not re.search( + r"^(simcore)\/(services)\/comp(\/[\w\/-]+)+$", + local_var_params["solver_key"], + ) + ): # noqa: E501 + raise ApiValueError( + "Invalid value for parameter `solver_key` when calling `list_solver_releases`, must conform to the pattern `/^(simcore)\/(services)\/comp(\/[\w\/-]+)+$/`" + ) # noqa: E501 collection_formats = {} path_params = {} - if 'solver_key' in local_var_params: - path_params['solver_key'] = local_var_params['solver_key'] # noqa: E501 + if "solver_key" in local_var_params: + path_params["solver_key"] = local_var_params["solver_key"] # noqa: E501 query_params = [] @@ -982,32 +1394,37 @@ def list_solver_releases_with_http_info(self, solver_key, **kwargs): # noqa: E5 body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # noqa: E501 # Authentication setting - auth_settings = ['HTTPBasic'] # noqa: E501 + auth_settings = ["HTTPBasic"] # noqa: E501 return self.api_client.call_api( - '/v0/solvers/{solver_key}/releases', 'GET', + "/v0/solvers/{solver_key}/releases", + "GET", path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[Solver]', # noqa: E501 + response_type="list[Solver]", # noqa: E501 auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + async_req=local_var_params.get("async_req"), + _return_http_data_only=local_var_params.get( + "_return_http_data_only" + ), # noqa: E501 + _preload_content=local_var_params.get("_preload_content", True), + _request_timeout=local_var_params.get("_request_timeout"), + collection_formats=collection_formats, + ) def list_solvers(self, **kwargs): # noqa: E501 """List Solvers # noqa: E501 - Lists all available solvers (latest version) # noqa: E501 + Lists all available solvers (latest version) # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_solvers(async_req=True) @@ -1025,13 +1442,13 @@ def list_solvers(self, **kwargs): # noqa: E501 If the method is called asynchronously, returns the request thread. """ - kwargs['_return_http_data_only'] = True + kwargs["_return_http_data_only"] = True return self.list_solvers_with_http_info(**kwargs) # noqa: E501 def list_solvers_with_http_info(self, **kwargs): # noqa: E501 """List Solvers # noqa: E501 - Lists all available solvers (latest version) # noqa: E501 + Lists all available solvers (latest version) # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_solvers_with_http_info(async_req=True) @@ -1055,19 +1472,19 @@ def list_solvers_with_http_info(self, **kwargs): # noqa: E501 local_var_params = locals() all_params = [] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params.append("async_req") + all_params.append("_return_http_data_only") + all_params.append("_preload_content") + all_params.append("_request_timeout") - for key, val in six.iteritems(local_var_params['kwargs']): + for key, val in six.iteritems(local_var_params["kwargs"]): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method list_solvers" % key ) local_var_params[key] = val - del local_var_params['kwargs'] + del local_var_params["kwargs"] collection_formats = {} @@ -1082,32 +1499,37 @@ def list_solvers_with_http_info(self, **kwargs): # noqa: E501 body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # noqa: E501 # Authentication setting - auth_settings = ['HTTPBasic'] # noqa: E501 + auth_settings = ["HTTPBasic"] # noqa: E501 return self.api_client.call_api( - '/v0/solvers', 'GET', + "/v0/solvers", + "GET", path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[Solver]', # noqa: E501 + response_type="list[Solver]", # noqa: E501 auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + async_req=local_var_params.get("async_req"), + _return_http_data_only=local_var_params.get( + "_return_http_data_only" + ), # noqa: E501 + _preload_content=local_var_params.get("_preload_content", True), + _request_timeout=local_var_params.get("_request_timeout"), + collection_formats=collection_formats, + ) def list_solvers_releases(self, **kwargs): # noqa: E501 """Lists All Releases # noqa: E501 - Lists all released solvers (all released versions) # noqa: E501 + Lists all released solvers (all released versions) # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_solvers_releases(async_req=True) @@ -1125,13 +1547,13 @@ def list_solvers_releases(self, **kwargs): # noqa: E501 If the method is called asynchronously, returns the request thread. """ - kwargs['_return_http_data_only'] = True + kwargs["_return_http_data_only"] = True return self.list_solvers_releases_with_http_info(**kwargs) # noqa: E501 def list_solvers_releases_with_http_info(self, **kwargs): # noqa: E501 """Lists All Releases # noqa: E501 - Lists all released solvers (all released versions) # noqa: E501 + Lists all released solvers (all released versions) # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_solvers_releases_with_http_info(async_req=True) @@ -1155,19 +1577,19 @@ def list_solvers_releases_with_http_info(self, **kwargs): # noqa: E501 local_var_params = locals() all_params = [] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params.append("async_req") + all_params.append("_return_http_data_only") + all_params.append("_preload_content") + all_params.append("_request_timeout") - for key, val in six.iteritems(local_var_params['kwargs']): + for key, val in six.iteritems(local_var_params["kwargs"]): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method list_solvers_releases" % key ) local_var_params[key] = val - del local_var_params['kwargs'] + del local_var_params["kwargs"] collection_formats = {} @@ -1182,27 +1604,32 @@ def list_solvers_releases_with_http_info(self, **kwargs): # noqa: E501 body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # noqa: E501 # Authentication setting - auth_settings = ['HTTPBasic'] # noqa: E501 + auth_settings = ["HTTPBasic"] # noqa: E501 return self.api_client.call_api( - '/v0/solvers/releases', 'GET', + "/v0/solvers/releases", + "GET", path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[Solver]', # noqa: E501 + response_type="list[Solver]", # noqa: E501 auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + async_req=local_var_params.get("async_req"), + _return_http_data_only=local_var_params.get( + "_return_http_data_only" + ), # noqa: E501 + _preload_content=local_var_params.get("_preload_content", True), + _request_timeout=local_var_params.get("_request_timeout"), + collection_formats=collection_formats, + ) def start_job(self, solver_key, version, job_id, **kwargs): # noqa: E501 """Start Job # noqa: E501 @@ -1227,10 +1654,14 @@ def start_job(self, solver_key, version, job_id, **kwargs): # noqa: E501 If the method is called asynchronously, returns the request thread. """ - kwargs['_return_http_data_only'] = True - return self.start_job_with_http_info(solver_key, version, job_id, **kwargs) # noqa: E501 - - def start_job_with_http_info(self, solver_key, version, job_id, **kwargs): # noqa: E501 + kwargs["_return_http_data_only"] = True + return self.start_job_with_http_info( + solver_key, version, job_id, **kwargs + ) # noqa: E501 + + def start_job_with_http_info( + self, solver_key, version, job_id, **kwargs + ): # noqa: E501 """Start Job # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -1258,46 +1689,76 @@ def start_job_with_http_info(self, solver_key, version, job_id, **kwargs): # no local_var_params = locals() - all_params = ['solver_key', 'version', 'job_id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params = ["solver_key", "version", "job_id"] # noqa: E501 + all_params.append("async_req") + all_params.append("_return_http_data_only") + all_params.append("_preload_content") + all_params.append("_request_timeout") - for key, val in six.iteritems(local_var_params['kwargs']): + for key, val in six.iteritems(local_var_params["kwargs"]): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method start_job" % key ) local_var_params[key] = val - del local_var_params['kwargs'] + del local_var_params["kwargs"] # verify the required parameter 'solver_key' is set - if self.api_client.client_side_validation and ('solver_key' not in local_var_params or # noqa: E501 - local_var_params['solver_key'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `solver_key` when calling `start_job`") # noqa: E501 + if self.api_client.client_side_validation and ( + "solver_key" not in local_var_params + or local_var_params["solver_key"] is None # noqa: E501 + ): # noqa: E501 + raise ApiValueError( + "Missing the required parameter `solver_key` when calling `start_job`" + ) # noqa: E501 # verify the required parameter 'version' is set - if self.api_client.client_side_validation and ('version' not in local_var_params or # noqa: E501 - local_var_params['version'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `version` when calling `start_job`") # noqa: E501 + if self.api_client.client_side_validation and ( + "version" not in local_var_params + or local_var_params["version"] is None # noqa: E501 + ): # noqa: E501 + raise ApiValueError( + "Missing the required parameter `version` when calling `start_job`" + ) # noqa: E501 # verify the required parameter 'job_id' is set - if self.api_client.client_side_validation and ('job_id' not in local_var_params or # noqa: E501 - local_var_params['job_id'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `job_id` when calling `start_job`") # noqa: E501 - - if self.api_client.client_side_validation and 'solver_key' in local_var_params and not re.search(r'^(simcore)\/(services)\/comp(\/[\w\/-]+)+$', local_var_params['solver_key']): # noqa: E501 - raise ApiValueError("Invalid value for parameter `solver_key` when calling `start_job`, must conform to the pattern `/^(simcore)\/(services)\/comp(\/[\w\/-]+)+$/`") # noqa: E501 - if self.api_client.client_side_validation and 'version' in local_var_params and not re.search(r'^(0|[1-9]\d*)(\.(0|[1-9]\d*)){2}(-(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*)(\.(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*))*)?(\+[-\da-zA-Z]+(\.[-\da-zA-Z-]+)*)?$', local_var_params['version']): # noqa: E501 - raise ApiValueError("Invalid value for parameter `version` when calling `start_job`, must conform to the pattern `/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){2}(-(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*)(\.(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*))*)?(\+[-\da-zA-Z]+(\.[-\da-zA-Z-]+)*)?$/`") # noqa: E501 + if self.api_client.client_side_validation and ( + "job_id" not in local_var_params + or local_var_params["job_id"] is None # noqa: E501 + ): # noqa: E501 + raise ApiValueError( + "Missing the required parameter `job_id` when calling `start_job`" + ) # noqa: E501 + + if ( + self.api_client.client_side_validation + and "solver_key" in local_var_params + and not re.search( + r"^(simcore)\/(services)\/comp(\/[\w\/-]+)+$", + local_var_params["solver_key"], + ) + ): # noqa: E501 + raise ApiValueError( + "Invalid value for parameter `solver_key` when calling `start_job`, must conform to the pattern `/^(simcore)\/(services)\/comp(\/[\w\/-]+)+$/`" + ) # noqa: E501 + if ( + self.api_client.client_side_validation + and "version" in local_var_params + and not re.search( + r"^(0|[1-9]\d*)(\.(0|[1-9]\d*)){2}(-(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*)(\.(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*))*)?(\+[-\da-zA-Z]+(\.[-\da-zA-Z-]+)*)?$", + local_var_params["version"], + ) + ): # noqa: E501 + raise ApiValueError( + "Invalid value for parameter `version` when calling `start_job`, must conform to the pattern `/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){2}(-(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*)(\.(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*))*)?(\+[-\da-zA-Z]+(\.[-\da-zA-Z-]+)*)?$/`" + ) # noqa: E501 collection_formats = {} path_params = {} - if 'solver_key' in local_var_params: - path_params['solver_key'] = local_var_params['solver_key'] # noqa: E501 - if 'version' in local_var_params: - path_params['version'] = local_var_params['version'] # noqa: E501 - if 'job_id' in local_var_params: - path_params['job_id'] = local_var_params['job_id'] # noqa: E501 + if "solver_key" in local_var_params: + path_params["solver_key"] = local_var_params["solver_key"] # noqa: E501 + if "version" in local_var_params: + path_params["version"] = local_var_params["version"] # noqa: E501 + if "job_id" in local_var_params: + path_params["job_id"] = local_var_params["job_id"] # noqa: E501 query_params = [] @@ -1308,27 +1769,32 @@ def start_job_with_http_info(self, solver_key, version, job_id, **kwargs): # no body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # noqa: E501 # Authentication setting - auth_settings = ['HTTPBasic'] # noqa: E501 + auth_settings = ["HTTPBasic"] # noqa: E501 return self.api_client.call_api( - '/v0/solvers/{solver_key}/releases/{version}/jobs/{job_id}:start', 'POST', + "/v0/solvers/{solver_key}/releases/{version}/jobs/{job_id}:start", + "POST", path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='JobStatus', # noqa: E501 + response_type="JobStatus", # noqa: E501 auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + async_req=local_var_params.get("async_req"), + _return_http_data_only=local_var_params.get( + "_return_http_data_only" + ), # noqa: E501 + _preload_content=local_var_params.get("_preload_content", True), + _request_timeout=local_var_params.get("_request_timeout"), + collection_formats=collection_formats, + ) def stop_job(self, solver_key, version, job_id, **kwargs): # noqa: E501 """Stop Job # noqa: E501 @@ -1353,10 +1819,14 @@ def stop_job(self, solver_key, version, job_id, **kwargs): # noqa: E501 If the method is called asynchronously, returns the request thread. """ - kwargs['_return_http_data_only'] = True - return self.stop_job_with_http_info(solver_key, version, job_id, **kwargs) # noqa: E501 - - def stop_job_with_http_info(self, solver_key, version, job_id, **kwargs): # noqa: E501 + kwargs["_return_http_data_only"] = True + return self.stop_job_with_http_info( + solver_key, version, job_id, **kwargs + ) # noqa: E501 + + def stop_job_with_http_info( + self, solver_key, version, job_id, **kwargs + ): # noqa: E501 """Stop Job # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -1384,46 +1854,76 @@ def stop_job_with_http_info(self, solver_key, version, job_id, **kwargs): # noq local_var_params = locals() - all_params = ['solver_key', 'version', 'job_id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params = ["solver_key", "version", "job_id"] # noqa: E501 + all_params.append("async_req") + all_params.append("_return_http_data_only") + all_params.append("_preload_content") + all_params.append("_request_timeout") - for key, val in six.iteritems(local_var_params['kwargs']): + for key, val in six.iteritems(local_var_params["kwargs"]): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method stop_job" % key ) local_var_params[key] = val - del local_var_params['kwargs'] + del local_var_params["kwargs"] # verify the required parameter 'solver_key' is set - if self.api_client.client_side_validation and ('solver_key' not in local_var_params or # noqa: E501 - local_var_params['solver_key'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `solver_key` when calling `stop_job`") # noqa: E501 + if self.api_client.client_side_validation and ( + "solver_key" not in local_var_params + or local_var_params["solver_key"] is None # noqa: E501 + ): # noqa: E501 + raise ApiValueError( + "Missing the required parameter `solver_key` when calling `stop_job`" + ) # noqa: E501 # verify the required parameter 'version' is set - if self.api_client.client_side_validation and ('version' not in local_var_params or # noqa: E501 - local_var_params['version'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `version` when calling `stop_job`") # noqa: E501 + if self.api_client.client_side_validation and ( + "version" not in local_var_params + or local_var_params["version"] is None # noqa: E501 + ): # noqa: E501 + raise ApiValueError( + "Missing the required parameter `version` when calling `stop_job`" + ) # noqa: E501 # verify the required parameter 'job_id' is set - if self.api_client.client_side_validation and ('job_id' not in local_var_params or # noqa: E501 - local_var_params['job_id'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `job_id` when calling `stop_job`") # noqa: E501 - - if self.api_client.client_side_validation and 'solver_key' in local_var_params and not re.search(r'^(simcore)\/(services)\/comp(\/[\w\/-]+)+$', local_var_params['solver_key']): # noqa: E501 - raise ApiValueError("Invalid value for parameter `solver_key` when calling `stop_job`, must conform to the pattern `/^(simcore)\/(services)\/comp(\/[\w\/-]+)+$/`") # noqa: E501 - if self.api_client.client_side_validation and 'version' in local_var_params and not re.search(r'^(0|[1-9]\d*)(\.(0|[1-9]\d*)){2}(-(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*)(\.(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*))*)?(\+[-\da-zA-Z]+(\.[-\da-zA-Z-]+)*)?$', local_var_params['version']): # noqa: E501 - raise ApiValueError("Invalid value for parameter `version` when calling `stop_job`, must conform to the pattern `/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){2}(-(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*)(\.(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*))*)?(\+[-\da-zA-Z]+(\.[-\da-zA-Z-]+)*)?$/`") # noqa: E501 + if self.api_client.client_side_validation and ( + "job_id" not in local_var_params + or local_var_params["job_id"] is None # noqa: E501 + ): # noqa: E501 + raise ApiValueError( + "Missing the required parameter `job_id` when calling `stop_job`" + ) # noqa: E501 + + if ( + self.api_client.client_side_validation + and "solver_key" in local_var_params + and not re.search( + r"^(simcore)\/(services)\/comp(\/[\w\/-]+)+$", + local_var_params["solver_key"], + ) + ): # noqa: E501 + raise ApiValueError( + "Invalid value for parameter `solver_key` when calling `stop_job`, must conform to the pattern `/^(simcore)\/(services)\/comp(\/[\w\/-]+)+$/`" + ) # noqa: E501 + if ( + self.api_client.client_side_validation + and "version" in local_var_params + and not re.search( + r"^(0|[1-9]\d*)(\.(0|[1-9]\d*)){2}(-(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*)(\.(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*))*)?(\+[-\da-zA-Z]+(\.[-\da-zA-Z-]+)*)?$", + local_var_params["version"], + ) + ): # noqa: E501 + raise ApiValueError( + "Invalid value for parameter `version` when calling `stop_job`, must conform to the pattern `/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){2}(-(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*)(\.(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*))*)?(\+[-\da-zA-Z]+(\.[-\da-zA-Z-]+)*)?$/`" + ) # noqa: E501 collection_formats = {} path_params = {} - if 'solver_key' in local_var_params: - path_params['solver_key'] = local_var_params['solver_key'] # noqa: E501 - if 'version' in local_var_params: - path_params['version'] = local_var_params['version'] # noqa: E501 - if 'job_id' in local_var_params: - path_params['job_id'] = local_var_params['job_id'] # noqa: E501 + if "solver_key" in local_var_params: + path_params["solver_key"] = local_var_params["solver_key"] # noqa: E501 + if "version" in local_var_params: + path_params["version"] = local_var_params["version"] # noqa: E501 + if "job_id" in local_var_params: + path_params["job_id"] = local_var_params["job_id"] # noqa: E501 query_params = [] @@ -1434,24 +1934,29 @@ def stop_job_with_http_info(self, solver_key, version, job_id, **kwargs): # noq body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # noqa: E501 # Authentication setting - auth_settings = ['HTTPBasic'] # noqa: E501 + auth_settings = ["HTTPBasic"] # noqa: E501 return self.api_client.call_api( - '/v0/solvers/{solver_key}/releases/{version}/jobs/{job_id}:stop', 'POST', + "/v0/solvers/{solver_key}/releases/{version}/jobs/{job_id}:stop", + "POST", path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='Job', # noqa: E501 + response_type="Job", # noqa: E501 auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + async_req=local_var_params.get("async_req"), + _return_http_data_only=local_var_params.get( + "_return_http_data_only" + ), # noqa: E501 + _preload_content=local_var_params.get("_preload_content", True), + _request_timeout=local_var_params.get("_request_timeout"), + collection_formats=collection_formats, + ) diff --git a/osparc/api/users_api.py b/osparc/api/users_api.py index 5bccc9c3..0bb8c0de 100644 --- a/osparc/api/users_api.py +++ b/osparc/api/users_api.py @@ -5,7 +5,7 @@ osparc-simcore public web API specifications # noqa: E501 - The version of the OpenAPI document: 0.3.0 + The version of the OpenAPI document: 0.4.0 Generated by: https://openapi-generator.tech """ @@ -18,10 +18,7 @@ import six from osparc.api_client import ApiClient -from osparc.exceptions import ( - ApiTypeError, - ApiValueError -) +from osparc.exceptions import ApiTypeError, ApiValueError class UsersApi(object): @@ -56,7 +53,7 @@ def get_my_profile(self, **kwargs): # noqa: E501 If the method is called asynchronously, returns the request thread. """ - kwargs['_return_http_data_only'] = True + kwargs["_return_http_data_only"] = True return self.get_my_profile_with_http_info(**kwargs) # noqa: E501 def get_my_profile_with_http_info(self, **kwargs): # noqa: E501 @@ -85,19 +82,19 @@ def get_my_profile_with_http_info(self, **kwargs): # noqa: E501 local_var_params = locals() all_params = [] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params.append("async_req") + all_params.append("_return_http_data_only") + all_params.append("_preload_content") + all_params.append("_request_timeout") - for key, val in six.iteritems(local_var_params['kwargs']): + for key, val in six.iteritems(local_var_params["kwargs"]): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method get_my_profile" % key ) local_var_params[key] = val - del local_var_params['kwargs'] + del local_var_params["kwargs"] collection_formats = {} @@ -112,27 +109,32 @@ def get_my_profile_with_http_info(self, **kwargs): # noqa: E501 body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # noqa: E501 # Authentication setting - auth_settings = ['HTTPBasic'] # noqa: E501 + auth_settings = ["HTTPBasic"] # noqa: E501 return self.api_client.call_api( - '/v0/me', 'GET', + "/v0/me", + "GET", path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='Profile', # noqa: E501 + response_type="Profile", # noqa: E501 auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + async_req=local_var_params.get("async_req"), + _return_http_data_only=local_var_params.get( + "_return_http_data_only" + ), # noqa: E501 + _preload_content=local_var_params.get("_preload_content", True), + _request_timeout=local_var_params.get("_request_timeout"), + collection_formats=collection_formats, + ) def update_my_profile(self, profile_update, **kwargs): # noqa: E501 """Update My Profile # noqa: E501 @@ -155,8 +157,10 @@ def update_my_profile(self, profile_update, **kwargs): # noqa: E501 If the method is called asynchronously, returns the request thread. """ - kwargs['_return_http_data_only'] = True - return self.update_my_profile_with_http_info(profile_update, **kwargs) # noqa: E501 + kwargs["_return_http_data_only"] = True + return self.update_my_profile_with_http_info( + profile_update, **kwargs + ) # noqa: E501 def update_my_profile_with_http_info(self, profile_update, **kwargs): # noqa: E501 """Update My Profile # noqa: E501 @@ -184,24 +188,28 @@ def update_my_profile_with_http_info(self, profile_update, **kwargs): # noqa: E local_var_params = locals() - all_params = ['profile_update'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + all_params = ["profile_update"] # noqa: E501 + all_params.append("async_req") + all_params.append("_return_http_data_only") + all_params.append("_preload_content") + all_params.append("_request_timeout") - for key, val in six.iteritems(local_var_params['kwargs']): + for key, val in six.iteritems(local_var_params["kwargs"]): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method update_my_profile" % key ) local_var_params[key] = val - del local_var_params['kwargs'] + del local_var_params["kwargs"] # verify the required parameter 'profile_update' is set - if self.api_client.client_side_validation and ('profile_update' not in local_var_params or # noqa: E501 - local_var_params['profile_update'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `profile_update` when calling `update_my_profile`") # noqa: E501 + if self.api_client.client_side_validation and ( + "profile_update" not in local_var_params + or local_var_params["profile_update"] is None # noqa: E501 + ): # noqa: E501 + raise ApiValueError( + "Missing the required parameter `profile_update` when calling `update_my_profile`" + ) # noqa: E501 collection_formats = {} @@ -215,31 +223,39 @@ def update_my_profile_with_http_info(self, profile_update, **kwargs): # noqa: E local_var_files = {} body_params = None - if 'profile_update' in local_var_params: - body_params = local_var_params['profile_update'] + if "profile_update" in local_var_params: + body_params = local_var_params["profile_update"] # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # noqa: E501 # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 + header_params[ + "Content-Type" + ] = self.api_client.select_header_content_type( # noqa: E501 + ["application/json"] + ) # noqa: E501 # Authentication setting - auth_settings = ['HTTPBasic'] # noqa: E501 + auth_settings = ["HTTPBasic"] # noqa: E501 return self.api_client.call_api( - '/v0/me', 'PUT', + "/v0/me", + "PUT", path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='Profile', # noqa: E501 + response_type="Profile", # noqa: E501 auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + async_req=local_var_params.get("async_req"), + _return_http_data_only=local_var_params.get( + "_return_http_data_only" + ), # noqa: E501 + _preload_content=local_var_params.get("_preload_content", True), + _request_timeout=local_var_params.get("_request_timeout"), + collection_formats=collection_formats, + ) diff --git a/osparc/api_client.py b/osparc/api_client.py index 3cfd98e5..020e2f07 100644 --- a/osparc/api_client.py +++ b/osparc/api_client.py @@ -4,7 +4,7 @@ osparc-simcore public web API specifications # noqa: E501 - The version of the OpenAPI document: 0.3.0 + The version of the OpenAPI document: 0.4.0 Generated by: https://openapi-generator.tech """ @@ -12,21 +12,21 @@ import atexit import datetime -from dateutil.parser import parse import json import mimetypes -from multiprocessing.pool import ThreadPool import os import re import tempfile +from multiprocessing.pool import ThreadPool # python 2 and python 3 compatibility library import six +from dateutil.parser import parse from six.moves.urllib.parse import quote -from osparc.configuration import Configuration import osparc.models from osparc import rest +from osparc.configuration import Configuration from osparc.exceptions import ApiValueError @@ -54,19 +54,25 @@ class ApiClient(object): PRIMITIVE_TYPES = (float, bool, bytes, six.text_type) + six.integer_types NATIVE_TYPES_MAPPING = { - 'int': int, - 'long': int if six.PY3 else long, # noqa: F821 - 'float': float, - 'str': str, - 'bool': bool, - 'date': datetime.date, - 'datetime': datetime.datetime, - 'object': object, + "int": int, + "long": int if six.PY3 else long, # noqa: F821 + "float": float, + "str": str, + "bool": bool, + "date": datetime.date, + "datetime": datetime.datetime, + "object": object, } _pool = None - def __init__(self, configuration=None, header_name=None, header_value=None, - cookie=None, pool_threads=1): + def __init__( + self, + configuration=None, + header_name=None, + header_value=None, + cookie=None, + pool_threads=1, + ): if configuration is None: configuration = Configuration() self.configuration = configuration @@ -78,7 +84,7 @@ def __init__(self, configuration=None, header_name=None, header_value=None, self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'osparc-api/0.3.0/python' + self.user_agent = "osparc-api/0.5.0/python" self.client_side_validation = configuration.client_side_validation def __enter__(self): @@ -92,13 +98,13 @@ def close(self): self._pool.close() self._pool.join() self._pool = None - if hasattr(atexit, 'unregister'): + if hasattr(atexit, "unregister"): atexit.unregister(self.close) @property def pool(self): """Create thread pool on first request - avoids instantiating unused threadpool for blocking clients. + avoids instantiating unused threadpool for blocking clients. """ if self._pool is None: atexit.register(self.close) @@ -108,21 +114,33 @@ def pool(self): @property def user_agent(self): """User agent for this API client""" - return self.default_headers['User-Agent'] + return self.default_headers["User-Agent"] @user_agent.setter def user_agent(self, value): - self.default_headers['User-Agent'] = value + self.default_headers["User-Agent"] = value def set_default_header(self, header_name, header_value): self.default_headers[header_name] = header_value def __call_api( - self, resource_path, method, path_params=None, - query_params=None, header_params=None, body=None, post_params=None, - files=None, response_type=None, auth_settings=None, - _return_http_data_only=None, collection_formats=None, - _preload_content=True, _request_timeout=None, _host=None): + self, + resource_path, + method, + path_params=None, + query_params=None, + header_params=None, + body=None, + post_params=None, + files=None, + response_type=None, + auth_settings=None, + _return_http_data_only=None, + collection_formats=None, + _preload_content=True, + _request_timeout=None, + _host=None, + ): config = self.configuration @@ -130,36 +148,33 @@ def __call_api( header_params = header_params or {} header_params.update(self.default_headers) if self.cookie: - header_params['Cookie'] = self.cookie + header_params["Cookie"] = self.cookie if header_params: header_params = self.sanitize_for_serialization(header_params) - header_params = dict(self.parameters_to_tuples(header_params, - collection_formats)) + header_params = dict( + self.parameters_to_tuples(header_params, collection_formats) + ) # path parameters if path_params: path_params = self.sanitize_for_serialization(path_params) - path_params = self.parameters_to_tuples(path_params, - collection_formats) + path_params = self.parameters_to_tuples(path_params, collection_formats) for k, v in path_params: # specified safe chars, encode everything resource_path = resource_path.replace( - '{%s}' % k, - quote(str(v), safe=config.safe_chars_for_path_param) + "{%s}" % k, quote(str(v), safe=config.safe_chars_for_path_param) ) # query parameters if query_params: query_params = self.sanitize_for_serialization(query_params) - query_params = self.parameters_to_tuples(query_params, - collection_formats) + query_params = self.parameters_to_tuples(query_params, collection_formats) # post parameters if post_params or files: post_params = post_params if post_params else [] post_params = self.sanitize_for_serialization(post_params) - post_params = self.parameters_to_tuples(post_params, - collection_formats) + post_params = self.parameters_to_tuples(post_params, collection_formats) post_params.extend(self.files_parameters(files)) # auth setting @@ -178,10 +193,15 @@ def __call_api( # perform request and return response response_data = self.request( - method, url, query_params=query_params, headers=header_params, - post_params=post_params, body=body, + method, + url, + query_params=query_params, + headers=header_params, + post_params=post_params, + body=body, _preload_content=_preload_content, - _request_timeout=_request_timeout) + _request_timeout=_request_timeout, + ) self.last_response = response_data @@ -194,10 +214,9 @@ def __call_api( return_data = None if _return_http_data_only: - return (return_data) + return return_data else: - return (return_data, response_data.status, - response_data.getheaders()) + return (return_data, response_data.status, response_data.getheaders()) def sanitize_for_serialization(self, obj): """Builds a JSON POST object. @@ -218,11 +237,9 @@ def sanitize_for_serialization(self, obj): elif isinstance(obj, self.PRIMITIVE_TYPES): return obj elif isinstance(obj, list): - return [self.sanitize_for_serialization(sub_obj) - for sub_obj in obj] + return [self.sanitize_for_serialization(sub_obj) for sub_obj in obj] elif isinstance(obj, tuple): - return tuple(self.sanitize_for_serialization(sub_obj) - for sub_obj in obj) + return tuple(self.sanitize_for_serialization(sub_obj) for sub_obj in obj) elif isinstance(obj, (datetime.datetime, datetime.date)): return obj.isoformat() @@ -234,12 +251,16 @@ def sanitize_for_serialization(self, obj): # and attributes which value is not None. # Convert attribute name to json key in # model definition for request. - obj_dict = {obj.attribute_map[attr]: getattr(obj, attr) - for attr, _ in six.iteritems(obj.openapi_types) - if getattr(obj, attr) is not None} + obj_dict = { + obj.attribute_map[attr]: getattr(obj, attr) + for attr, _ in six.iteritems(obj.openapi_types) + if getattr(obj, attr) is not None + } - return {key: self.sanitize_for_serialization(val) - for key, val in six.iteritems(obj_dict)} + return { + key: self.sanitize_for_serialization(val) + for key, val in six.iteritems(obj_dict) + } def deserialize(self, response, response_type): """Deserializes response into an object. @@ -275,15 +296,15 @@ def __deserialize(self, data, klass): return None if type(klass) == str: - if klass.startswith('list['): - sub_kls = re.match(r'list\[(.*)\]', klass).group(1) - return [self.__deserialize(sub_data, sub_kls) - for sub_data in data] + if klass.startswith("list["): + sub_kls = re.match(r"list\[(.*)\]", klass).group(1) + return [self.__deserialize(sub_data, sub_kls) for sub_data in data] - if klass.startswith('dict('): - sub_kls = re.match(r'dict\(([^,]*), (.*)\)', klass).group(2) - return {k: self.__deserialize(v, sub_kls) - for k, v in six.iteritems(data)} + if klass.startswith("dict("): + sub_kls = re.match(r"dict\(([^,]*), (.*)\)", klass).group(2) + return { + k: self.__deserialize(v, sub_kls) for k, v in six.iteritems(data) + } # convert str to class if klass in self.NATIVE_TYPES_MAPPING: @@ -307,12 +328,25 @@ def __deserialize(self, data, klass): else: return self.__deserialize_model(data, klass) - def call_api(self, resource_path, method, - path_params=None, query_params=None, header_params=None, - body=None, post_params=None, files=None, - response_type=None, auth_settings=None, async_req=None, - _return_http_data_only=None, collection_formats=None, - _preload_content=True, _request_timeout=None, _host=None): + def call_api( + self, + resource_path, + method, + path_params=None, + query_params=None, + header_params=None, + body=None, + post_params=None, + files=None, + response_type=None, + auth_settings=None, + async_req=None, + _return_http_data_only=None, + collection_formats=None, + _preload_content=True, + _request_timeout=None, + _host=None, + ): """Makes the HTTP request (synchronous) and returns deserialized data. To make an async_req request, set the async_req parameter. @@ -350,79 +384,120 @@ def call_api(self, resource_path, method, then the method will return the response directly. """ if not async_req: - return self.__call_api(resource_path, method, - path_params, query_params, header_params, - body, post_params, files, - response_type, auth_settings, - _return_http_data_only, collection_formats, - _preload_content, _request_timeout, _host) - - return self.pool.apply_async(self.__call_api, (resource_path, - method, path_params, - query_params, - header_params, body, - post_params, files, - response_type, - auth_settings, - _return_http_data_only, - collection_formats, - _preload_content, - _request_timeout, - _host)) - - def request(self, method, url, query_params=None, headers=None, - post_params=None, body=None, _preload_content=True, - _request_timeout=None): + return self.__call_api( + resource_path, + method, + path_params, + query_params, + header_params, + body, + post_params, + files, + response_type, + auth_settings, + _return_http_data_only, + collection_formats, + _preload_content, + _request_timeout, + _host, + ) + + return self.pool.apply_async( + self.__call_api, + ( + resource_path, + method, + path_params, + query_params, + header_params, + body, + post_params, + files, + response_type, + auth_settings, + _return_http_data_only, + collection_formats, + _preload_content, + _request_timeout, + _host, + ), + ) + + def request( + self, + method, + url, + query_params=None, + headers=None, + post_params=None, + body=None, + _preload_content=True, + _request_timeout=None, + ): """Makes the HTTP request using RESTClient.""" if method == "GET": - return self.rest_client.GET(url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - headers=headers) + return self.rest_client.GET( + url, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + headers=headers, + ) elif method == "HEAD": - return self.rest_client.HEAD(url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - headers=headers) + return self.rest_client.HEAD( + url, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + headers=headers, + ) elif method == "OPTIONS": - return self.rest_client.OPTIONS(url, - query_params=query_params, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout) + return self.rest_client.OPTIONS( + url, + query_params=query_params, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + ) elif method == "POST": - return self.rest_client.POST(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) + return self.rest_client.POST( + url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body, + ) elif method == "PUT": - return self.rest_client.PUT(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) + return self.rest_client.PUT( + url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body, + ) elif method == "PATCH": - return self.rest_client.PATCH(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) + return self.rest_client.PATCH( + url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body, + ) elif method == "DELETE": - return self.rest_client.DELETE(url, - query_params=query_params, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) + return self.rest_client.DELETE( + url, + query_params=query_params, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body, + ) else: raise ApiValueError( "http method must be `GET`, `HEAD`, `OPTIONS`," @@ -439,22 +514,23 @@ def parameters_to_tuples(self, params, collection_formats): new_params = [] if collection_formats is None: collection_formats = {} - for k, v in six.iteritems(params) if isinstance(params, dict) else params: # noqa: E501 + for k, v in ( + six.iteritems(params) if isinstance(params, dict) else params + ): # noqa: E501 if k in collection_formats: collection_format = collection_formats[k] - if collection_format == 'multi': + if collection_format == "multi": new_params.extend((k, value) for value in v) else: - if collection_format == 'ssv': - delimiter = ' ' - elif collection_format == 'tsv': - delimiter = '\t' - elif collection_format == 'pipes': - delimiter = '|' + if collection_format == "ssv": + delimiter = " " + elif collection_format == "tsv": + delimiter = "\t" + elif collection_format == "pipes": + delimiter = "|" else: # csv is the default - delimiter = ',' - new_params.append( - (k, delimiter.join(str(value) for value in v))) + delimiter = "," + new_params.append((k, delimiter.join(str(value) for value in v))) else: new_params.append((k, v)) return new_params @@ -473,13 +549,14 @@ def files_parameters(self, files=None): continue file_names = v if type(v) is list else [v] for n in file_names: - with open(n, 'rb') as f: + with open(n, "rb") as f: filename = os.path.basename(f.name) filedata = f.read() - mimetype = (mimetypes.guess_type(filename)[0] or - 'application/octet-stream') - params.append( - tuple([k, tuple([filename, filedata, mimetype])])) + mimetype = ( + mimetypes.guess_type(filename)[0] + or "application/octet-stream" + ) + params.append(tuple([k, tuple([filename, filedata, mimetype])])) return params @@ -494,10 +571,10 @@ def select_header_accept(self, accepts): accepts = [x.lower() for x in accepts] - if 'application/json' in accepts: - return 'application/json' + if "application/json" in accepts: + return "application/json" else: - return ', '.join(accepts) + return ", ".join(accepts) def select_header_content_type(self, content_types): """Returns `Content-Type` based on an array of content_types provided. @@ -506,12 +583,12 @@ def select_header_content_type(self, content_types): :return: Content-Type (e.g. application/json). """ if not content_types: - return 'application/json' + return "application/json" content_types = [x.lower() for x in content_types] - if 'application/json' in content_types or '*/*' in content_types: - return 'application/json' + if "application/json" in content_types or "*/*" in content_types: + return "application/json" else: return content_types[0] @@ -528,15 +605,15 @@ def update_params_for_auth(self, headers, querys, auth_settings): for auth in auth_settings: auth_setting = self.configuration.auth_settings().get(auth) if auth_setting: - if auth_setting['in'] == 'cookie': - headers['Cookie'] = auth_setting['value'] - elif auth_setting['in'] == 'header': - headers[auth_setting['key']] = auth_setting['value'] - elif auth_setting['in'] == 'query': - querys.append((auth_setting['key'], auth_setting['value'])) + if auth_setting["in"] == "cookie": + headers["Cookie"] = auth_setting["value"] + elif auth_setting["in"] == "header": + headers[auth_setting["key"]] = auth_setting["value"] + elif auth_setting["in"] == "query": + querys.append((auth_setting["key"], auth_setting["value"])) else: raise ApiValueError( - 'Authentication token must be in `query` or `header`' + "Authentication token must be in `query` or `header`" ) def __deserialize_file(self, response): @@ -554,8 +631,9 @@ def __deserialize_file(self, response): content_disposition = response.getheader("Content-Disposition") if content_disposition: - filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', - content_disposition).group(1) + filename = re.search( + r'filename=[\'"]?([^\'"\s]+)[\'"]?', content_disposition + ).group(1) path = os.path.join(os.path.dirname(path), filename) # PATCH ----------------- try: @@ -601,8 +679,7 @@ def __deserialize_date(self, string): return string except ValueError: raise rest.ApiException( - status=0, - reason="Failed to parse `{0}` as date object".format(string) + status=0, reason="Failed to parse `{0}` as date object".format(string) ) def __deserialize_datetime(self, string): @@ -620,10 +697,7 @@ def __deserialize_datetime(self, string): except ValueError: raise rest.ApiException( status=0, - reason=( - "Failed to parse `{0}` as datetime object" - .format(string) - ) + reason=("Failed to parse `{0}` as datetime object".format(string)), ) def __deserialize_model(self, data, klass): @@ -634,14 +708,15 @@ def __deserialize_model(self, data, klass): :return: model object. """ - if not klass.openapi_types and not hasattr(klass, - 'get_real_child_model'): + if not klass.openapi_types and not hasattr(klass, "get_real_child_model"): return data kwargs = {} - if (data is not None and - klass.openapi_types is not None and - isinstance(data, (list, dict))): + if ( + data is not None + and klass.openapi_types is not None + and isinstance(data, (list, dict)) + ): for attr, attr_type in six.iteritems(klass.openapi_types): if klass.attribute_map[attr] in data: value = data[klass.attribute_map[attr]] @@ -649,7 +724,7 @@ def __deserialize_model(self, data, klass): instance = klass(**kwargs) - if hasattr(instance, 'get_real_child_model'): + if hasattr(instance, "get_real_child_model"): klass_name = instance.get_real_child_model(data) if klass_name: instance = self.__deserialize(data, klass_name) diff --git a/osparc/configuration.py b/osparc/configuration.py index 0519e456..4942da2f 100644 --- a/osparc/configuration.py +++ b/osparc/configuration.py @@ -5,7 +5,7 @@ osparc-simcore public web API specifications # noqa: E501 - The version of the OpenAPI document: 0.3.0 + The version of the OpenAPI document: 0.4.0 Generated by: https://openapi-generator.tech """ @@ -96,14 +96,19 @@ class Configuration(object): ) ) """ + # PATCH ---------- - def __init__(self, host="https://api.osparc.io", - api_key=None, api_key_prefix=None, - username=None, password=None, - signing_info=None): - # PATCH ---------- - """Constructor - """ + def __init__( + self, + host="https://api.osparc.io", + api_key=None, + api_key_prefix=None, + username=None, + password=None, + signing_info=None, + ): + # PATCH ---------- + """Constructor""" self.host = host """Default Base url """ @@ -140,7 +145,7 @@ def __init__(self, host="https://api.osparc.io", """ self.logger["package_logger"] = logging.getLogger("osparc") self.logger["urllib3_logger"] = logging.getLogger("urllib3") - self.logger_format = '%(asctime)s %(levelname)s %(message)s' + self.logger_format = "%(asctime)s %(levelname)s %(message)s" """Log format """ self.logger_stream_handler = None @@ -188,7 +193,7 @@ def __init__(self, host="https://api.osparc.io", self.proxy_headers = None """Proxy headers """ - self.safe_chars_for_path_param = '' + self.safe_chars_for_path_param = "" """Safe chars for path_param """ self.retries = None @@ -309,9 +314,9 @@ def get_basic_auth_token(self): password = "" if self.password is not None: password = self.password - return urllib3.util.make_headers( - basic_auth=username + ':' + password - ).get('authorization') + return urllib3.util.make_headers(basic_auth=username + ":" + password).get( + "authorization" + ) def auth_settings(self): """Gets Auth Settings dict for api client. @@ -320,11 +325,11 @@ def auth_settings(self): """ auth = {} if self.username is not None and self.password is not None: - auth['HTTPBasic'] = { - 'type': 'basic', - 'in': 'header', - 'key': 'Authorization', - 'value': self.get_basic_auth_token() + auth["HTTPBasic"] = { + "type": "basic", + "in": "header", + "key": "Authorization", + "value": self.get_basic_auth_token(), } return auth @@ -333,12 +338,13 @@ def to_debug_report(self): :return: The report for debugging. """ - return "Python SDK Debug Report:\n"\ - "OS: {env}\n"\ - "Python Version: {pyversion}\n"\ - "Version of the API: 0.3.0\n"\ - "SDK Package Version: 0.4.3".\ - format(env=sys.platform, pyversion=sys.version) + return ( + "Python SDK Debug Report:\n" + "OS: {env}\n" + "Python Version: {pyversion}\n" + "Version of the API: 0.4.0\n" + "SDK Package Version: 0.5.0".format(env=sys.platform, pyversion=sys.version) + ) def get_host_settings(self): """Gets an array of host settings @@ -347,8 +353,8 @@ def get_host_settings(self): """ return [ { - 'url': "/", - 'description': "No description provided", + "url": "/", + "description": "No description provided", } ] @@ -366,22 +372,22 @@ def get_host_from_settings(self, index, variables=None): except IndexError: raise ValueError( "Invalid index {0} when selecting the host settings. " - "Must be less than {1}".format(index, len(servers))) + "Must be less than {1}".format(index, len(servers)) + ) - url = server['url'] + url = server["url"] # go through variables and replace placeholders - for variable_name, variable in server['variables'].items(): - used_value = variables.get( - variable_name, variable['default_value']) + for variable_name, variable in server["variables"].items(): + used_value = variables.get(variable_name, variable["default_value"]) - if 'enum_values' in variable \ - and used_value not in variable['enum_values']: + if "enum_values" in variable and used_value not in variable["enum_values"]: raise ValueError( "The variable `{0}` in the host URL has invalid value " "{1}. Must be {2}.".format( - variable_name, variables[variable_name], - variable['enum_values'])) + variable_name, variables[variable_name], variable["enum_values"] + ) + ) url = url.replace("{" + variable_name + "}", used_value) diff --git a/osparc/exceptions.py b/osparc/exceptions.py index e9f217b0..e7e5b7a3 100644 --- a/osparc/exceptions.py +++ b/osparc/exceptions.py @@ -5,7 +5,7 @@ osparc-simcore public web API specifications # noqa: E501 - The version of the OpenAPI document: 0.3.0 + The version of the OpenAPI document: 0.4.0 Generated by: https://openapi-generator.tech """ @@ -18,9 +18,8 @@ class OpenApiException(Exception): class ApiTypeError(OpenApiException, TypeError): - def __init__(self, msg, path_to_item=None, valid_classes=None, - key_type=None): - """ Raises an exception for TypeErrors + def __init__(self, msg, path_to_item=None, valid_classes=None, key_type=None): + """Raises an exception for TypeErrors Args: msg (str): the exception message @@ -82,7 +81,6 @@ def __init__(self, msg, path_to_item=None): class ApiException(OpenApiException): - def __init__(self, status=None, reason=None, http_resp=None): if http_resp: self.status = http_resp.status @@ -97,11 +95,9 @@ def __init__(self, status=None, reason=None, http_resp=None): def __str__(self): """Custom error messages for exception""" - error_message = "({0})\n"\ - "Reason: {1}\n".format(self.status, self.reason) + error_message = "({0})\n" "Reason: {1}\n".format(self.status, self.reason) if self.headers: - error_message += "HTTP response headers: {0}\n".format( - self.headers) + error_message += "HTTP response headers: {0}\n".format(self.headers) if self.body: error_message += "HTTP response body: {0}\n".format(self.body) diff --git a/osparc/models/__init__.py b/osparc/models/__init__.py index 9201e653..345516b3 100644 --- a/osparc/models/__init__.py +++ b/osparc/models/__init__.py @@ -6,7 +6,7 @@ osparc-simcore public web API specifications # noqa: E501 - The version of the OpenAPI document: 0.3.0 + The version of the OpenAPI document: 0.4.0 Generated by: https://openapi-generator.tech """ @@ -14,7 +14,9 @@ from __future__ import absolute_import # import models into model package -from osparc.models.body_upload_file_v0_files_content_put import BodyUploadFileV0FilesContentPut +from osparc.models.body_upload_file_v0_files_content_put import ( + BodyUploadFileV0FilesContentPut, +) from osparc.models.file import File from osparc.models.groups import Groups from osparc.models.http_validation_error import HTTPValidationError diff --git a/osparc/models/_any_of.py b/osparc/models/_any_of.py index 6528cbb0..386b5750 100644 --- a/osparc/models/_any_of.py +++ b/osparc/models/_any_of.py @@ -1,10 +1,12 @@ +# PATCH file from contextlib import suppress -from typing import Any, Callable, List, Union +from typing import Any, Callable, Union from .file import File AnyOfFilenumberintegerbooleanstring = Union[File, float, int, bool, str] + def deserialize_any_of( data: Any, deserialize_func: Callable, diff --git a/osparc/models/body_upload_file_v0_files_content_put.py b/osparc/models/body_upload_file_v0_files_content_put.py index 605613cc..c0d15bbb 100644 --- a/osparc/models/body_upload_file_v0_files_content_put.py +++ b/osparc/models/body_upload_file_v0_files_content_put.py @@ -5,7 +5,7 @@ osparc-simcore public web API specifications # noqa: E501 - The version of the OpenAPI document: 0.3.0 + The version of the OpenAPI document: 0.4.0 Generated by: https://openapi-generator.tech """ @@ -32,13 +32,9 @@ class BodyUploadFileV0FilesContentPut(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = { - 'file': 'file' - } + openapi_types = {"file": "file"} - attribute_map = { - 'file': 'file' - } + attribute_map = {"file": "file"} def __init__(self, file=None, local_vars_configuration=None): # noqa: E501 """BodyUploadFileV0FilesContentPut - a model defined in OpenAPI""" # noqa: E501 @@ -69,8 +65,12 @@ def file(self, file): :param file: The file of this BodyUploadFileV0FilesContentPut. # noqa: E501 :type: file """ - if self.local_vars_configuration.client_side_validation and file is None: # noqa: E501 - raise ValueError("Invalid value for `file`, must not be `None`") # noqa: E501 + if ( + self.local_vars_configuration.client_side_validation and file is None + ): # noqa: E501 + raise ValueError( + "Invalid value for `file`, must not be `None`" + ) # noqa: E501 self._file = file @@ -81,18 +81,20 @@ def to_dict(self): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) + result[attr] = list( + map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value) + ) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) + result[attr] = dict( + map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") + else item, + value.items(), + ) + ) else: result[attr] = value diff --git a/osparc/models/file.py b/osparc/models/file.py index e4987f10..62b6096f 100644 --- a/osparc/models/file.py +++ b/osparc/models/file.py @@ -5,7 +5,7 @@ osparc-simcore public web API specifications # noqa: E501 - The version of the OpenAPI document: 0.3.0 + The version of the OpenAPI document: 0.4.0 Generated by: https://openapi-generator.tech """ @@ -33,20 +33,27 @@ class File(object): and the value is json key in definition. """ openapi_types = { - 'id': 'str', - 'filename': 'str', - 'content_type': 'str', - 'checksum': 'str' + "id": "str", + "filename": "str", + "content_type": "str", + "checksum": "str", } attribute_map = { - 'id': 'id', - 'filename': 'filename', - 'content_type': 'content_type', - 'checksum': 'checksum' + "id": "id", + "filename": "filename", + "content_type": "content_type", + "checksum": "checksum", } - def __init__(self, id=None, filename=None, content_type=None, checksum=None, local_vars_configuration=None): # noqa: E501 + def __init__( + self, + id=None, + filename=None, + content_type=None, + checksum=None, + local_vars_configuration=None, + ): # noqa: E501 """File - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -85,7 +92,9 @@ def id(self, id): :param id: The id of this File. # noqa: E501 :type: str """ - if self.local_vars_configuration.client_side_validation and id is None: # noqa: E501 + if ( + self.local_vars_configuration.client_side_validation and id is None + ): # noqa: E501 raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 self._id = id @@ -110,8 +119,12 @@ def filename(self, filename): :param filename: The filename of this File. # noqa: E501 :type: str """ - if self.local_vars_configuration.client_side_validation and filename is None: # noqa: E501 - raise ValueError("Invalid value for `filename`, must not be `None`") # noqa: E501 + if ( + self.local_vars_configuration.client_side_validation and filename is None + ): # noqa: E501 + raise ValueError( + "Invalid value for `filename`, must not be `None`" + ) # noqa: E501 self._filename = filename @@ -168,18 +181,20 @@ def to_dict(self): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) + result[attr] = list( + map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value) + ) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) + result[attr] = dict( + map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") + else item, + value.items(), + ) + ) else: result[attr] = value diff --git a/osparc/models/groups.py b/osparc/models/groups.py index a0486f0b..98467aa7 100644 --- a/osparc/models/groups.py +++ b/osparc/models/groups.py @@ -5,7 +5,7 @@ osparc-simcore public web API specifications # noqa: E501 - The version of the OpenAPI document: 0.3.0 + The version of the OpenAPI document: 0.4.0 Generated by: https://openapi-generator.tech """ @@ -33,18 +33,16 @@ class Groups(object): and the value is json key in definition. """ openapi_types = { - 'me': 'UsersGroup', - 'organizations': 'list[UsersGroup]', - 'all': 'UsersGroup' + "me": "UsersGroup", + "organizations": "list[UsersGroup]", + "all": "UsersGroup", } - attribute_map = { - 'me': 'me', - 'organizations': 'organizations', - 'all': 'all' - } + attribute_map = {"me": "me", "organizations": "organizations", "all": "all"} - def __init__(self, me=None, organizations=[], all=None, local_vars_configuration=None): # noqa: E501 + def __init__( + self, me=None, organizations=[], all=None, local_vars_configuration=None + ): # noqa: E501 """Groups - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -78,7 +76,9 @@ def me(self, me): :param me: The me of this Groups. # noqa: E501 :type: UsersGroup """ - if self.local_vars_configuration.client_side_validation and me is None: # noqa: E501 + if ( + self.local_vars_configuration.client_side_validation and me is None + ): # noqa: E501 raise ValueError("Invalid value for `me`, must not be `None`") # noqa: E501 self._me = me @@ -122,8 +122,12 @@ def all(self, all): :param all: The all of this Groups. # noqa: E501 :type: UsersGroup """ - if self.local_vars_configuration.client_side_validation and all is None: # noqa: E501 - raise ValueError("Invalid value for `all`, must not be `None`") # noqa: E501 + if ( + self.local_vars_configuration.client_side_validation and all is None + ): # noqa: E501 + raise ValueError( + "Invalid value for `all`, must not be `None`" + ) # noqa: E501 self._all = all @@ -134,18 +138,20 @@ def to_dict(self): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) + result[attr] = list( + map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value) + ) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) + result[attr] = dict( + map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") + else item, + value.items(), + ) + ) else: result[attr] = value diff --git a/osparc/models/http_validation_error.py b/osparc/models/http_validation_error.py index 229c4136..620a18ec 100644 --- a/osparc/models/http_validation_error.py +++ b/osparc/models/http_validation_error.py @@ -5,7 +5,7 @@ osparc-simcore public web API specifications # noqa: E501 - The version of the OpenAPI document: 0.3.0 + The version of the OpenAPI document: 0.4.0 Generated by: https://openapi-generator.tech """ @@ -32,13 +32,9 @@ class HTTPValidationError(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = { - 'errors': 'list[ValidationError]' - } + openapi_types = {"errors": "list[ValidationError]"} - attribute_map = { - 'errors': 'errors' - } + attribute_map = {"errors": "errors"} def __init__(self, errors=None, local_vars_configuration=None): # noqa: E501 """HTTPValidationError - a model defined in OpenAPI""" # noqa: E501 @@ -80,18 +76,20 @@ def to_dict(self): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) + result[attr] = list( + map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value) + ) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) + result[attr] = dict( + map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") + else item, + value.items(), + ) + ) else: result[attr] = value diff --git a/osparc/models/job.py b/osparc/models/job.py index b9790c7f..fd529c9e 100644 --- a/osparc/models/job.py +++ b/osparc/models/job.py @@ -5,7 +5,7 @@ osparc-simcore public web API specifications # noqa: E501 - The version of the OpenAPI document: 0.3.0 + The version of the OpenAPI document: 0.4.0 Generated by: https://openapi-generator.tech """ @@ -33,28 +33,39 @@ class Job(object): and the value is json key in definition. """ openapi_types = { - 'id': 'str', - 'name': 'str', - 'inputs_checksum': 'str', - 'created_at': 'datetime', - 'runner_name': 'str', - 'url': 'str', - 'runner_url': 'str', - 'outputs_url': 'str' + "id": "str", + "name": "str", + "inputs_checksum": "str", + "created_at": "datetime", + "runner_name": "str", + "url": "str", + "runner_url": "str", + "outputs_url": "str", } attribute_map = { - 'id': 'id', - 'name': 'name', - 'inputs_checksum': 'inputs_checksum', - 'created_at': 'created_at', - 'runner_name': 'runner_name', - 'url': 'url', - 'runner_url': 'runner_url', - 'outputs_url': 'outputs_url' + "id": "id", + "name": "name", + "inputs_checksum": "inputs_checksum", + "created_at": "created_at", + "runner_name": "runner_name", + "url": "url", + "runner_url": "runner_url", + "outputs_url": "outputs_url", } - def __init__(self, id=None, name=None, inputs_checksum=None, created_at=None, runner_name=None, url=None, runner_url=None, outputs_url=None, local_vars_configuration=None): # noqa: E501 + def __init__( + self, + id=None, + name=None, + inputs_checksum=None, + created_at=None, + runner_name=None, + url=None, + runner_url=None, + outputs_url=None, + local_vars_configuration=None, + ): # noqa: E501 """Job - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -97,7 +108,9 @@ def id(self, id): :param id: The id of this Job. # noqa: E501 :type: str """ - if self.local_vars_configuration.client_side_validation and id is None: # noqa: E501 + if ( + self.local_vars_configuration.client_side_validation and id is None + ): # noqa: E501 raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 self._id = id @@ -120,11 +133,20 @@ def name(self, name): :param name: The name of this Job. # noqa: E501 :type: str """ - if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501 - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - if (self.local_vars_configuration.client_side_validation and - name is not None and not re.search(r'^([^\s\/]+\/?)+$', name)): # noqa: E501 - raise ValueError(r"Invalid value for `name`, must be a follow pattern or equal to `/^([^\s\/]+\/?)+$/`") # noqa: E501 + if ( + self.local_vars_configuration.client_side_validation and name is None + ): # noqa: E501 + raise ValueError( + "Invalid value for `name`, must not be `None`" + ) # noqa: E501 + if ( + self.local_vars_configuration.client_side_validation + and name is not None + and not re.search(r"^([^\s\/]+\/?)+$", name) + ): # noqa: E501 + raise ValueError( + r"Invalid value for `name`, must be a follow pattern or equal to `/^([^\s\/]+\/?)+$/`" + ) # noqa: E501 self._name = name @@ -148,8 +170,13 @@ def inputs_checksum(self, inputs_checksum): :param inputs_checksum: The inputs_checksum of this Job. # noqa: E501 :type: str """ - if self.local_vars_configuration.client_side_validation and inputs_checksum is None: # noqa: E501 - raise ValueError("Invalid value for `inputs_checksum`, must not be `None`") # noqa: E501 + if ( + self.local_vars_configuration.client_side_validation + and inputs_checksum is None + ): # noqa: E501 + raise ValueError( + "Invalid value for `inputs_checksum`, must not be `None`" + ) # noqa: E501 self._inputs_checksum = inputs_checksum @@ -173,8 +200,12 @@ def created_at(self, created_at): :param created_at: The created_at of this Job. # noqa: E501 :type: datetime """ - if self.local_vars_configuration.client_side_validation and created_at is None: # noqa: E501 - raise ValueError("Invalid value for `created_at`, must not be `None`") # noqa: E501 + if ( + self.local_vars_configuration.client_side_validation and created_at is None + ): # noqa: E501 + raise ValueError( + "Invalid value for `created_at`, must not be `None`" + ) # noqa: E501 self._created_at = created_at @@ -198,11 +229,20 @@ def runner_name(self, runner_name): :param runner_name: The runner_name of this Job. # noqa: E501 :type: str """ - if self.local_vars_configuration.client_side_validation and runner_name is None: # noqa: E501 - raise ValueError("Invalid value for `runner_name`, must not be `None`") # noqa: E501 - if (self.local_vars_configuration.client_side_validation and - runner_name is not None and not re.search(r'^([^\s\/]+\/?)+$', runner_name)): # noqa: E501 - raise ValueError(r"Invalid value for `runner_name`, must be a follow pattern or equal to `/^([^\s\/]+\/?)+$/`") # noqa: E501 + if ( + self.local_vars_configuration.client_side_validation and runner_name is None + ): # noqa: E501 + raise ValueError( + "Invalid value for `runner_name`, must not be `None`" + ) # noqa: E501 + if ( + self.local_vars_configuration.client_side_validation + and runner_name is not None + and not re.search(r"^([^\s\/]+\/?)+$", runner_name) + ): # noqa: E501 + raise ValueError( + r"Invalid value for `runner_name`, must be a follow pattern or equal to `/^([^\s\/]+\/?)+$/`" + ) # noqa: E501 self._runner_name = runner_name @@ -226,14 +266,28 @@ def url(self, url): :param url: The url of this Job. # noqa: E501 :type: str """ - if self.local_vars_configuration.client_side_validation and url is None: # noqa: E501 - raise ValueError("Invalid value for `url`, must not be `None`") # noqa: E501 - if (self.local_vars_configuration.client_side_validation and - url is not None and len(url) > 2083): - raise ValueError("Invalid value for `url`, length must be less than or equal to `2083`") # noqa: E501 - if (self.local_vars_configuration.client_side_validation and - url is not None and len(url) < 1): - raise ValueError("Invalid value for `url`, length must be greater than or equal to `1`") # noqa: E501 + if ( + self.local_vars_configuration.client_side_validation and url is None + ): # noqa: E501 + raise ValueError( + "Invalid value for `url`, must not be `None`" + ) # noqa: E501 + if ( + self.local_vars_configuration.client_side_validation + and url is not None + and len(url) > 2083 + ): + raise ValueError( + "Invalid value for `url`, length must be less than or equal to `2083`" + ) # noqa: E501 + if ( + self.local_vars_configuration.client_side_validation + and url is not None + and len(url) < 1 + ): + raise ValueError( + "Invalid value for `url`, length must be greater than or equal to `1`" + ) # noqa: E501 self._url = url @@ -257,14 +311,28 @@ def runner_url(self, runner_url): :param runner_url: The runner_url of this Job. # noqa: E501 :type: str """ - if self.local_vars_configuration.client_side_validation and runner_url is None: # noqa: E501 - raise ValueError("Invalid value for `runner_url`, must not be `None`") # noqa: E501 - if (self.local_vars_configuration.client_side_validation and - runner_url is not None and len(runner_url) > 2083): - raise ValueError("Invalid value for `runner_url`, length must be less than or equal to `2083`") # noqa: E501 - if (self.local_vars_configuration.client_side_validation and - runner_url is not None and len(runner_url) < 1): - raise ValueError("Invalid value for `runner_url`, length must be greater than or equal to `1`") # noqa: E501 + if ( + self.local_vars_configuration.client_side_validation and runner_url is None + ): # noqa: E501 + raise ValueError( + "Invalid value for `runner_url`, must not be `None`" + ) # noqa: E501 + if ( + self.local_vars_configuration.client_side_validation + and runner_url is not None + and len(runner_url) > 2083 + ): + raise ValueError( + "Invalid value for `runner_url`, length must be less than or equal to `2083`" + ) # noqa: E501 + if ( + self.local_vars_configuration.client_side_validation + and runner_url is not None + and len(runner_url) < 1 + ): + raise ValueError( + "Invalid value for `runner_url`, length must be greater than or equal to `1`" + ) # noqa: E501 self._runner_url = runner_url @@ -288,14 +356,28 @@ def outputs_url(self, outputs_url): :param outputs_url: The outputs_url of this Job. # noqa: E501 :type: str """ - if self.local_vars_configuration.client_side_validation and outputs_url is None: # noqa: E501 - raise ValueError("Invalid value for `outputs_url`, must not be `None`") # noqa: E501 - if (self.local_vars_configuration.client_side_validation and - outputs_url is not None and len(outputs_url) > 2083): - raise ValueError("Invalid value for `outputs_url`, length must be less than or equal to `2083`") # noqa: E501 - if (self.local_vars_configuration.client_side_validation and - outputs_url is not None and len(outputs_url) < 1): - raise ValueError("Invalid value for `outputs_url`, length must be greater than or equal to `1`") # noqa: E501 + if ( + self.local_vars_configuration.client_side_validation and outputs_url is None + ): # noqa: E501 + raise ValueError( + "Invalid value for `outputs_url`, must not be `None`" + ) # noqa: E501 + if ( + self.local_vars_configuration.client_side_validation + and outputs_url is not None + and len(outputs_url) > 2083 + ): + raise ValueError( + "Invalid value for `outputs_url`, length must be less than or equal to `2083`" + ) # noqa: E501 + if ( + self.local_vars_configuration.client_side_validation + and outputs_url is not None + and len(outputs_url) < 1 + ): + raise ValueError( + "Invalid value for `outputs_url`, length must be greater than or equal to `1`" + ) # noqa: E501 self._outputs_url = outputs_url @@ -306,18 +388,20 @@ def to_dict(self): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) + result[attr] = list( + map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value) + ) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) + result[attr] = dict( + map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") + else item, + value.items(), + ) + ) else: result[attr] = value diff --git a/osparc/models/job_inputs.py b/osparc/models/job_inputs.py index 64baf1f5..317d6e9e 100644 --- a/osparc/models/job_inputs.py +++ b/osparc/models/job_inputs.py @@ -5,7 +5,7 @@ osparc-simcore public web API specifications # noqa: E501 - The version of the OpenAPI document: 0.3.0 + The version of the OpenAPI document: 0.4.0 Generated by: https://openapi-generator.tech """ @@ -32,13 +32,9 @@ class JobInputs(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = { - 'values': 'dict(str, AnyOfFilenumberintegerstring)' - } + openapi_types = {"values": "dict(str, AnyOfFilenumberintegerbooleanstring)"} - attribute_map = { - 'values': 'values' - } + attribute_map = {"values": "values"} def __init__(self, values=None, local_vars_configuration=None): # noqa: E501 """JobInputs - a model defined in OpenAPI""" # noqa: E501 @@ -57,7 +53,7 @@ def values(self): :return: The values of this JobInputs. # noqa: E501 - :rtype: dict(str, AnyOfFilenumberintegerstring) + :rtype: dict(str, AnyOfFilenumberintegerbooleanstring) """ return self._values @@ -67,10 +63,14 @@ def values(self, values): :param values: The values of this JobInputs. # noqa: E501 - :type: dict(str, AnyOfFilenumberintegerstring) + :type: dict(str, AnyOfFilenumberintegerbooleanstring) """ - if self.local_vars_configuration.client_side_validation and values is None: # noqa: E501 - raise ValueError("Invalid value for `values`, must not be `None`") # noqa: E501 + if ( + self.local_vars_configuration.client_side_validation and values is None + ): # noqa: E501 + raise ValueError( + "Invalid value for `values`, must not be `None`" + ) # noqa: E501 self._values = values @@ -81,18 +81,20 @@ def to_dict(self): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) + result[attr] = list( + map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value) + ) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) + result[attr] = dict( + map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") + else item, + value.items(), + ) + ) else: result[attr] = value diff --git a/osparc/models/job_outputs.py b/osparc/models/job_outputs.py index 97619dfd..3d4797c0 100644 --- a/osparc/models/job_outputs.py +++ b/osparc/models/job_outputs.py @@ -5,7 +5,7 @@ osparc-simcore public web API specifications # noqa: E501 - The version of the OpenAPI document: 0.3.0 + The version of the OpenAPI document: 0.4.0 Generated by: https://openapi-generator.tech """ @@ -33,16 +33,15 @@ class JobOutputs(object): and the value is json key in definition. """ openapi_types = { - 'job_id': 'str', - 'results': 'dict(str, AnyOfFilenumberintegerstring)' + "job_id": "str", + "results": "dict(str, AnyOfFilenumberintegerbooleanstring)", } - attribute_map = { - 'job_id': 'job_id', - 'results': 'results' - } + attribute_map = {"job_id": "job_id", "results": "results"} - def __init__(self, job_id=None, results=None, local_vars_configuration=None): # noqa: E501 + def __init__( + self, job_id=None, results=None, local_vars_configuration=None + ): # noqa: E501 """JobOutputs - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -75,8 +74,12 @@ def job_id(self, job_id): :param job_id: The job_id of this JobOutputs. # noqa: E501 :type: str """ - if self.local_vars_configuration.client_side_validation and job_id is None: # noqa: E501 - raise ValueError("Invalid value for `job_id`, must not be `None`") # noqa: E501 + if ( + self.local_vars_configuration.client_side_validation and job_id is None + ): # noqa: E501 + raise ValueError( + "Invalid value for `job_id`, must not be `None`" + ) # noqa: E501 self._job_id = job_id @@ -86,7 +89,7 @@ def results(self): :return: The results of this JobOutputs. # noqa: E501 - :rtype: dict(str, AnyOfFilenumberintegerstring) + :rtype: dict(str, AnyOfFilenumberintegerbooleanstring) """ return self._results @@ -96,10 +99,14 @@ def results(self, results): :param results: The results of this JobOutputs. # noqa: E501 - :type: dict(str, AnyOfFilenumberintegerstring) + :type: dict(str, AnyOfFilenumberintegerbooleanstring) """ - if self.local_vars_configuration.client_side_validation and results is None: # noqa: E501 - raise ValueError("Invalid value for `results`, must not be `None`") # noqa: E501 + if ( + self.local_vars_configuration.client_side_validation and results is None + ): # noqa: E501 + raise ValueError( + "Invalid value for `results`, must not be `None`" + ) # noqa: E501 self._results = results @@ -110,18 +117,20 @@ def to_dict(self): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) + result[attr] = list( + map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value) + ) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) + result[attr] = dict( + map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") + else item, + value.items(), + ) + ) else: result[attr] = value diff --git a/osparc/models/job_status.py b/osparc/models/job_status.py index 76d22032..c3b1c365 100644 --- a/osparc/models/job_status.py +++ b/osparc/models/job_status.py @@ -5,7 +5,7 @@ osparc-simcore public web API specifications # noqa: E501 - The version of the OpenAPI document: 0.3.0 + The version of the OpenAPI document: 0.4.0 Generated by: https://openapi-generator.tech """ @@ -33,24 +33,33 @@ class JobStatus(object): and the value is json key in definition. """ openapi_types = { - 'job_id': 'str', - 'state': 'TaskStates', - 'progress': 'int', - 'submitted_at': 'datetime', - 'started_at': 'datetime', - 'stopped_at': 'datetime' + "job_id": "str", + "state": "TaskStates", + "progress": "int", + "submitted_at": "datetime", + "started_at": "datetime", + "stopped_at": "datetime", } attribute_map = { - 'job_id': 'job_id', - 'state': 'state', - 'progress': 'progress', - 'submitted_at': 'submitted_at', - 'started_at': 'started_at', - 'stopped_at': 'stopped_at' + "job_id": "job_id", + "state": "state", + "progress": "progress", + "submitted_at": "submitted_at", + "started_at": "started_at", + "stopped_at": "stopped_at", } - def __init__(self, job_id=None, state=None, progress=0, submitted_at=None, started_at=None, stopped_at=None, local_vars_configuration=None): # noqa: E501 + def __init__( + self, + job_id=None, + state=None, + progress=0, + submitted_at=None, + started_at=None, + stopped_at=None, + local_vars_configuration=None, + ): # noqa: E501 """JobStatus - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -92,8 +101,12 @@ def job_id(self, job_id): :param job_id: The job_id of this JobStatus. # noqa: E501 :type: str """ - if self.local_vars_configuration.client_side_validation and job_id is None: # noqa: E501 - raise ValueError("Invalid value for `job_id`, must not be `None`") # noqa: E501 + if ( + self.local_vars_configuration.client_side_validation and job_id is None + ): # noqa: E501 + raise ValueError( + "Invalid value for `job_id`, must not be `None`" + ) # noqa: E501 self._job_id = job_id @@ -115,8 +128,12 @@ def state(self, state): :param state: The state of this JobStatus. # noqa: E501 :type: TaskStates """ - if self.local_vars_configuration.client_side_validation and state is None: # noqa: E501 - raise ValueError("Invalid value for `state`, must not be `None`") # noqa: E501 + if ( + self.local_vars_configuration.client_side_validation and state is None + ): # noqa: E501 + raise ValueError( + "Invalid value for `state`, must not be `None`" + ) # noqa: E501 self._state = state @@ -138,12 +155,22 @@ def progress(self, progress): :param progress: The progress of this JobStatus. # noqa: E501 :type: int """ - if (self.local_vars_configuration.client_side_validation and - progress is not None and progress > 100): # noqa: E501 - raise ValueError("Invalid value for `progress`, must be a value less than or equal to `100`") # noqa: E501 - if (self.local_vars_configuration.client_side_validation and - progress is not None and progress < 0): # noqa: E501 - raise ValueError("Invalid value for `progress`, must be a value greater than or equal to `0`") # noqa: E501 + if ( + self.local_vars_configuration.client_side_validation + and progress is not None + and progress > 100 + ): # noqa: E501 + raise ValueError( + "Invalid value for `progress`, must be a value less than or equal to `100`" + ) # noqa: E501 + if ( + self.local_vars_configuration.client_side_validation + and progress is not None + and progress < 0 + ): # noqa: E501 + raise ValueError( + "Invalid value for `progress`, must be a value greater than or equal to `0`" + ) # noqa: E501 self._progress = progress @@ -165,8 +192,13 @@ def submitted_at(self, submitted_at): :param submitted_at: The submitted_at of this JobStatus. # noqa: E501 :type: datetime """ - if self.local_vars_configuration.client_side_validation and submitted_at is None: # noqa: E501 - raise ValueError("Invalid value for `submitted_at`, must not be `None`") # noqa: E501 + if ( + self.local_vars_configuration.client_side_validation + and submitted_at is None + ): # noqa: E501 + raise ValueError( + "Invalid value for `submitted_at`, must not be `None`" + ) # noqa: E501 self._submitted_at = submitted_at @@ -223,18 +255,20 @@ def to_dict(self): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) + result[attr] = list( + map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value) + ) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) + result[attr] = dict( + map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") + else item, + value.items(), + ) + ) else: result[attr] = value diff --git a/osparc/models/meta.py b/osparc/models/meta.py index af3faaae..4baf6c8d 100644 --- a/osparc/models/meta.py +++ b/osparc/models/meta.py @@ -5,7 +5,7 @@ osparc-simcore public web API specifications # noqa: E501 - The version of the OpenAPI document: 0.3.0 + The version of the OpenAPI document: 0.4.0 Generated by: https://openapi-generator.tech """ @@ -33,22 +33,30 @@ class Meta(object): and the value is json key in definition. """ openapi_types = { - 'name': 'str', - 'version': 'str', - 'released': 'dict(str, str)', - 'docs_url': 'str', - 'docs_dev_url': 'str' + "name": "str", + "version": "str", + "released": "dict(str, str)", + "docs_url": "str", + "docs_dev_url": "str", } attribute_map = { - 'name': 'name', - 'version': 'version', - 'released': 'released', - 'docs_url': 'docs_url', - 'docs_dev_url': 'docs_dev_url' + "name": "name", + "version": "version", + "released": "released", + "docs_url": "docs_url", + "docs_dev_url": "docs_dev_url", } - def __init__(self, name=None, version=None, released=None, docs_url='https://docs.osparc.io', docs_dev_url='https://api.osparc.io/dev/docs', local_vars_configuration=None): # noqa: E501 + def __init__( + self, + name=None, + version=None, + released=None, + docs_url="https://docs.osparc.io", + docs_dev_url="https://api.osparc.io/dev/docs", + local_vars_configuration=None, + ): # noqa: E501 """Meta - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -88,8 +96,12 @@ def name(self, name): :param name: The name of this Meta. # noqa: E501 :type: str """ - if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501 - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + if ( + self.local_vars_configuration.client_side_validation and name is None + ): # noqa: E501 + raise ValueError( + "Invalid value for `name`, must not be `None`" + ) # noqa: E501 self._name = name @@ -111,11 +123,23 @@ def version(self, version): :param version: The version of this Meta. # noqa: E501 :type: str """ - if self.local_vars_configuration.client_side_validation and version is None: # noqa: E501 - raise ValueError("Invalid value for `version`, must not be `None`") # noqa: E501 - if (self.local_vars_configuration.client_side_validation and - version is not None and not re.search(r'^(0|[1-9]\d*)(\.(0|[1-9]\d*)){2}(-(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*)(\.(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*))*)?(\+[-\da-zA-Z]+(\.[-\da-zA-Z-]+)*)?$', version)): # noqa: E501 - raise ValueError(r"Invalid value for `version`, must be a follow pattern or equal to `/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){2}(-(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*)(\.(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*))*)?(\+[-\da-zA-Z]+(\.[-\da-zA-Z-]+)*)?$/`") # noqa: E501 + if ( + self.local_vars_configuration.client_side_validation and version is None + ): # noqa: E501 + raise ValueError( + "Invalid value for `version`, must not be `None`" + ) # noqa: E501 + if ( + self.local_vars_configuration.client_side_validation + and version is not None + and not re.search( + r"^(0|[1-9]\d*)(\.(0|[1-9]\d*)){2}(-(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*)(\.(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*))*)?(\+[-\da-zA-Z]+(\.[-\da-zA-Z-]+)*)?$", + version, + ) + ): # noqa: E501 + raise ValueError( + r"Invalid value for `version`, must be a follow pattern or equal to `/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){2}(-(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*)(\.(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*))*)?(\+[-\da-zA-Z]+(\.[-\da-zA-Z-]+)*)?$/`" + ) # noqa: E501 self._version = version @@ -160,12 +184,22 @@ def docs_url(self, docs_url): :param docs_url: The docs_url of this Meta. # noqa: E501 :type: str """ - if (self.local_vars_configuration.client_side_validation and - docs_url is not None and len(docs_url) > 65536): - raise ValueError("Invalid value for `docs_url`, length must be less than or equal to `65536`") # noqa: E501 - if (self.local_vars_configuration.client_side_validation and - docs_url is not None and len(docs_url) < 1): - raise ValueError("Invalid value for `docs_url`, length must be greater than or equal to `1`") # noqa: E501 + if ( + self.local_vars_configuration.client_side_validation + and docs_url is not None + and len(docs_url) > 65536 + ): + raise ValueError( + "Invalid value for `docs_url`, length must be less than or equal to `65536`" + ) # noqa: E501 + if ( + self.local_vars_configuration.client_side_validation + and docs_url is not None + and len(docs_url) < 1 + ): + raise ValueError( + "Invalid value for `docs_url`, length must be greater than or equal to `1`" + ) # noqa: E501 self._docs_url = docs_url @@ -187,12 +221,22 @@ def docs_dev_url(self, docs_dev_url): :param docs_dev_url: The docs_dev_url of this Meta. # noqa: E501 :type: str """ - if (self.local_vars_configuration.client_side_validation and - docs_dev_url is not None and len(docs_dev_url) > 65536): - raise ValueError("Invalid value for `docs_dev_url`, length must be less than or equal to `65536`") # noqa: E501 - if (self.local_vars_configuration.client_side_validation and - docs_dev_url is not None and len(docs_dev_url) < 1): - raise ValueError("Invalid value for `docs_dev_url`, length must be greater than or equal to `1`") # noqa: E501 + if ( + self.local_vars_configuration.client_side_validation + and docs_dev_url is not None + and len(docs_dev_url) > 65536 + ): + raise ValueError( + "Invalid value for `docs_dev_url`, length must be less than or equal to `65536`" + ) # noqa: E501 + if ( + self.local_vars_configuration.client_side_validation + and docs_dev_url is not None + and len(docs_dev_url) < 1 + ): + raise ValueError( + "Invalid value for `docs_dev_url`, length must be greater than or equal to `1`" + ) # noqa: E501 self._docs_dev_url = docs_dev_url @@ -203,18 +247,20 @@ def to_dict(self): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) + result[attr] = list( + map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value) + ) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) + result[attr] = dict( + map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") + else item, + value.items(), + ) + ) else: result[attr] = value diff --git a/osparc/models/profile.py b/osparc/models/profile.py index a0478921..2e597f8c 100644 --- a/osparc/models/profile.py +++ b/osparc/models/profile.py @@ -5,7 +5,7 @@ osparc-simcore public web API specifications # noqa: E501 - The version of the OpenAPI document: 0.3.0 + The version of the OpenAPI document: 0.4.0 Generated by: https://openapi-generator.tech """ @@ -33,24 +33,33 @@ class Profile(object): and the value is json key in definition. """ openapi_types = { - 'first_name': 'str', - 'last_name': 'str', - 'login': 'str', - 'role': 'UserRoleEnum', - 'groups': 'Groups', - 'gravatar_id': 'str' + "first_name": "str", + "last_name": "str", + "login": "str", + "role": "UserRoleEnum", + "groups": "Groups", + "gravatar_id": "str", } attribute_map = { - 'first_name': 'first_name', - 'last_name': 'last_name', - 'login': 'login', - 'role': 'role', - 'groups': 'groups', - 'gravatar_id': 'gravatar_id' + "first_name": "first_name", + "last_name": "last_name", + "login": "login", + "role": "role", + "groups": "groups", + "gravatar_id": "gravatar_id", } - def __init__(self, first_name=None, last_name=None, login=None, role=None, groups=None, gravatar_id=None, local_vars_configuration=None): # noqa: E501 + def __init__( + self, + first_name=None, + last_name=None, + login=None, + role=None, + groups=None, + gravatar_id=None, + local_vars_configuration=None, + ): # noqa: E501 """Profile - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -135,8 +144,12 @@ def login(self, login): :param login: The login of this Profile. # noqa: E501 :type: str """ - if self.local_vars_configuration.client_side_validation and login is None: # noqa: E501 - raise ValueError("Invalid value for `login`, must not be `None`") # noqa: E501 + if ( + self.local_vars_configuration.client_side_validation and login is None + ): # noqa: E501 + raise ValueError( + "Invalid value for `login`, must not be `None`" + ) # noqa: E501 self._login = login @@ -158,8 +171,12 @@ def role(self, role): :param role: The role of this Profile. # noqa: E501 :type: UserRoleEnum """ - if self.local_vars_configuration.client_side_validation and role is None: # noqa: E501 - raise ValueError("Invalid value for `role`, must not be `None`") # noqa: E501 + if ( + self.local_vars_configuration.client_side_validation and role is None + ): # noqa: E501 + raise ValueError( + "Invalid value for `role`, must not be `None`" + ) # noqa: E501 self._role = role @@ -204,9 +221,14 @@ def gravatar_id(self, gravatar_id): :param gravatar_id: The gravatar_id of this Profile. # noqa: E501 :type: str """ - if (self.local_vars_configuration.client_side_validation and - gravatar_id is not None and len(gravatar_id) > 40): - raise ValueError("Invalid value for `gravatar_id`, length must be less than or equal to `40`") # noqa: E501 + if ( + self.local_vars_configuration.client_side_validation + and gravatar_id is not None + and len(gravatar_id) > 40 + ): + raise ValueError( + "Invalid value for `gravatar_id`, length must be less than or equal to `40`" + ) # noqa: E501 self._gravatar_id = gravatar_id @@ -217,18 +239,20 @@ def to_dict(self): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) + result[attr] = list( + map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value) + ) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) + result[attr] = dict( + map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") + else item, + value.items(), + ) + ) else: result[attr] = value diff --git a/osparc/models/profile_update.py b/osparc/models/profile_update.py index 06c17ec1..cc327d9a 100644 --- a/osparc/models/profile_update.py +++ b/osparc/models/profile_update.py @@ -5,7 +5,7 @@ osparc-simcore public web API specifications # noqa: E501 - The version of the OpenAPI document: 0.3.0 + The version of the OpenAPI document: 0.4.0 Generated by: https://openapi-generator.tech """ @@ -32,17 +32,13 @@ class ProfileUpdate(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = { - 'first_name': 'str', - 'last_name': 'str' - } + openapi_types = {"first_name": "str", "last_name": "str"} - attribute_map = { - 'first_name': 'first_name', - 'last_name': 'last_name' - } + attribute_map = {"first_name": "first_name", "last_name": "last_name"} - def __init__(self, first_name=None, last_name=None, local_vars_configuration=None): # noqa: E501 + def __init__( + self, first_name=None, last_name=None, local_vars_configuration=None + ): # noqa: E501 """ProfileUpdate - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -106,18 +102,20 @@ def to_dict(self): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) + result[attr] = list( + map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value) + ) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) + result[attr] = dict( + map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") + else item, + value.items(), + ) + ) else: result[attr] = value diff --git a/osparc/models/solver.py b/osparc/models/solver.py index 065e46bb..3c2218e3 100644 --- a/osparc/models/solver.py +++ b/osparc/models/solver.py @@ -5,7 +5,7 @@ osparc-simcore public web API specifications # noqa: E501 - The version of the OpenAPI document: 0.3.0 + The version of the OpenAPI document: 0.4.0 Generated by: https://openapi-generator.tech """ @@ -33,24 +33,33 @@ class Solver(object): and the value is json key in definition. """ openapi_types = { - 'id': 'str', - 'version': 'str', - 'title': 'str', - 'description': 'str', - 'maintainer': 'str', - 'url': 'str' + "id": "str", + "version": "str", + "title": "str", + "description": "str", + "maintainer": "str", + "url": "str", } attribute_map = { - 'id': 'id', - 'version': 'version', - 'title': 'title', - 'description': 'description', - 'maintainer': 'maintainer', - 'url': 'url' + "id": "id", + "version": "version", + "title": "title", + "description": "description", + "maintainer": "maintainer", + "url": "url", } - def __init__(self, id=None, version=None, title=None, description=None, maintainer=None, url=None, local_vars_configuration=None): # noqa: E501 + def __init__( + self, + id=None, + version=None, + title=None, + description=None, + maintainer=None, + url=None, + local_vars_configuration=None, + ): # noqa: E501 """Solver - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -92,11 +101,18 @@ def id(self, id): :param id: The id of this Solver. # noqa: E501 :type: str """ - if self.local_vars_configuration.client_side_validation and id is None: # noqa: E501 + if ( + self.local_vars_configuration.client_side_validation and id is None + ): # noqa: E501 raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 - if (self.local_vars_configuration.client_side_validation and - id is not None and not re.search(r'^(simcore)\/(services)\/comp(\/[\w\/-]+)+$', id)): # noqa: E501 - raise ValueError(r"Invalid value for `id`, must be a follow pattern or equal to `/^(simcore)\/(services)\/comp(\/[\w\/-]+)+$/`") # noqa: E501 + if ( + self.local_vars_configuration.client_side_validation + and id is not None + and not re.search(r"^(simcore)\/(services)\/comp(\/[\w\/-]+)+$", id) + ): # noqa: E501 + raise ValueError( + r"Invalid value for `id`, must be a follow pattern or equal to `/^(simcore)\/(services)\/comp(\/[\w\/-]+)+$/`" + ) # noqa: E501 self._id = id @@ -120,11 +136,23 @@ def version(self, version): :param version: The version of this Solver. # noqa: E501 :type: str """ - if self.local_vars_configuration.client_side_validation and version is None: # noqa: E501 - raise ValueError("Invalid value for `version`, must not be `None`") # noqa: E501 - if (self.local_vars_configuration.client_side_validation and - version is not None and not re.search(r'^(0|[1-9]\d*)(\.(0|[1-9]\d*)){2}(-(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*)(\.(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*))*)?(\+[-\da-zA-Z]+(\.[-\da-zA-Z-]+)*)?$', version)): # noqa: E501 - raise ValueError(r"Invalid value for `version`, must be a follow pattern or equal to `/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){2}(-(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*)(\.(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*))*)?(\+[-\da-zA-Z]+(\.[-\da-zA-Z-]+)*)?$/`") # noqa: E501 + if ( + self.local_vars_configuration.client_side_validation and version is None + ): # noqa: E501 + raise ValueError( + "Invalid value for `version`, must not be `None`" + ) # noqa: E501 + if ( + self.local_vars_configuration.client_side_validation + and version is not None + and not re.search( + r"^(0|[1-9]\d*)(\.(0|[1-9]\d*)){2}(-(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*)(\.(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*))*)?(\+[-\da-zA-Z]+(\.[-\da-zA-Z-]+)*)?$", + version, + ) + ): # noqa: E501 + raise ValueError( + r"Invalid value for `version`, must be a follow pattern or equal to `/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){2}(-(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*)(\.(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*))*)?(\+[-\da-zA-Z]+(\.[-\da-zA-Z-]+)*)?$/`" + ) # noqa: E501 self._version = version @@ -148,8 +176,12 @@ def title(self, title): :param title: The title of this Solver. # noqa: E501 :type: str """ - if self.local_vars_configuration.client_side_validation and title is None: # noqa: E501 - raise ValueError("Invalid value for `title`, must not be `None`") # noqa: E501 + if ( + self.local_vars_configuration.client_side_validation and title is None + ): # noqa: E501 + raise ValueError( + "Invalid value for `title`, must not be `None`" + ) # noqa: E501 self._title = title @@ -192,8 +224,12 @@ def maintainer(self, maintainer): :param maintainer: The maintainer of this Solver. # noqa: E501 :type: str """ - if self.local_vars_configuration.client_side_validation and maintainer is None: # noqa: E501 - raise ValueError("Invalid value for `maintainer`, must not be `None`") # noqa: E501 + if ( + self.local_vars_configuration.client_side_validation and maintainer is None + ): # noqa: E501 + raise ValueError( + "Invalid value for `maintainer`, must not be `None`" + ) # noqa: E501 self._maintainer = maintainer @@ -217,14 +253,28 @@ def url(self, url): :param url: The url of this Solver. # noqa: E501 :type: str """ - if self.local_vars_configuration.client_side_validation and url is None: # noqa: E501 - raise ValueError("Invalid value for `url`, must not be `None`") # noqa: E501 - if (self.local_vars_configuration.client_side_validation and - url is not None and len(url) > 2083): - raise ValueError("Invalid value for `url`, length must be less than or equal to `2083`") # noqa: E501 - if (self.local_vars_configuration.client_side_validation and - url is not None and len(url) < 1): - raise ValueError("Invalid value for `url`, length must be greater than or equal to `1`") # noqa: E501 + if ( + self.local_vars_configuration.client_side_validation and url is None + ): # noqa: E501 + raise ValueError( + "Invalid value for `url`, must not be `None`" + ) # noqa: E501 + if ( + self.local_vars_configuration.client_side_validation + and url is not None + and len(url) > 2083 + ): + raise ValueError( + "Invalid value for `url`, length must be less than or equal to `2083`" + ) # noqa: E501 + if ( + self.local_vars_configuration.client_side_validation + and url is not None + and len(url) < 1 + ): + raise ValueError( + "Invalid value for `url`, length must be greater than or equal to `1`" + ) # noqa: E501 self._url = url @@ -235,18 +285,20 @@ def to_dict(self): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) + result[attr] = list( + map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value) + ) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) + result[attr] = dict( + map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") + else item, + value.items(), + ) + ) else: result[attr] = value diff --git a/osparc/models/task_states.py b/osparc/models/task_states.py index d471d93c..c9838c7a 100644 --- a/osparc/models/task_states.py +++ b/osparc/models/task_states.py @@ -5,7 +5,7 @@ osparc-simcore public web API specifications # noqa: E501 - The version of the OpenAPI document: 0.3.0 + The version of the OpenAPI document: 0.4.0 Generated by: https://openapi-generator.tech """ @@ -38,7 +38,17 @@ class TaskStates(object): FAILED = "FAILED" ABORTED = "ABORTED" - allowable_values = [UNKNOWN, PUBLISHED, NOT_STARTED, PENDING, STARTED, RETRY, SUCCESS, FAILED, ABORTED] # noqa: E501 + allowable_values = [ + UNKNOWN, + PUBLISHED, + NOT_STARTED, + PENDING, + STARTED, + RETRY, + SUCCESS, + FAILED, + ABORTED, + ] # noqa: E501 """ Attributes: @@ -47,11 +57,9 @@ class TaskStates(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = { - } + openapi_types = {} - attribute_map = { - } + attribute_map = {} def __init__(self, local_vars_configuration=None): # noqa: E501 """TaskStates - a model defined in OpenAPI""" # noqa: E501 @@ -67,18 +75,20 @@ def to_dict(self): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) + result[attr] = list( + map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value) + ) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) + result[attr] = dict( + map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") + else item, + value.items(), + ) + ) else: result[attr] = value diff --git a/osparc/models/user_role_enum.py b/osparc/models/user_role_enum.py index 476562dc..077edb7e 100644 --- a/osparc/models/user_role_enum.py +++ b/osparc/models/user_role_enum.py @@ -5,7 +5,7 @@ osparc-simcore public web API specifications # noqa: E501 - The version of the OpenAPI document: 0.3.0 + The version of the OpenAPI document: 0.4.0 Generated by: https://openapi-generator.tech """ @@ -32,8 +32,9 @@ class UserRoleEnum(object): GUEST = "GUEST" USER = "USER" TESTER = "TESTER" + ADMIN = "ADMIN" - allowable_values = [ANONYMOUS, GUEST, USER, TESTER] # noqa: E501 + allowable_values = [ANONYMOUS, GUEST, USER, TESTER, ADMIN] # noqa: E501 """ Attributes: @@ -42,11 +43,9 @@ class UserRoleEnum(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = { - } + openapi_types = {} - attribute_map = { - } + attribute_map = {} def __init__(self, local_vars_configuration=None): # noqa: E501 """UserRoleEnum - a model defined in OpenAPI""" # noqa: E501 @@ -62,18 +61,20 @@ def to_dict(self): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) + result[attr] = list( + map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value) + ) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) + result[attr] = dict( + map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") + else item, + value.items(), + ) + ) else: result[attr] = value diff --git a/osparc/models/users_group.py b/osparc/models/users_group.py index 9798d1a3..25887dc7 100644 --- a/osparc/models/users_group.py +++ b/osparc/models/users_group.py @@ -5,7 +5,7 @@ osparc-simcore public web API specifications # noqa: E501 - The version of the OpenAPI document: 0.3.0 + The version of the OpenAPI document: 0.4.0 Generated by: https://openapi-generator.tech """ @@ -32,19 +32,13 @@ class UsersGroup(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = { - 'gid': 'str', - 'label': 'str', - 'description': 'str' - } - - attribute_map = { - 'gid': 'gid', - 'label': 'label', - 'description': 'description' - } - - def __init__(self, gid=None, label=None, description=None, local_vars_configuration=None): # noqa: E501 + openapi_types = {"gid": "str", "label": "str", "description": "str"} + + attribute_map = {"gid": "gid", "label": "label", "description": "description"} + + def __init__( + self, gid=None, label=None, description=None, local_vars_configuration=None + ): # noqa: E501 """UsersGroup - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -78,8 +72,12 @@ def gid(self, gid): :param gid: The gid of this UsersGroup. # noqa: E501 :type: str """ - if self.local_vars_configuration.client_side_validation and gid is None: # noqa: E501 - raise ValueError("Invalid value for `gid`, must not be `None`") # noqa: E501 + if ( + self.local_vars_configuration.client_side_validation and gid is None + ): # noqa: E501 + raise ValueError( + "Invalid value for `gid`, must not be `None`" + ) # noqa: E501 self._gid = gid @@ -101,8 +99,12 @@ def label(self, label): :param label: The label of this UsersGroup. # noqa: E501 :type: str """ - if self.local_vars_configuration.client_side_validation and label is None: # noqa: E501 - raise ValueError("Invalid value for `label`, must not be `None`") # noqa: E501 + if ( + self.local_vars_configuration.client_side_validation and label is None + ): # noqa: E501 + raise ValueError( + "Invalid value for `label`, must not be `None`" + ) # noqa: E501 self._label = label @@ -134,18 +136,20 @@ def to_dict(self): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) + result[attr] = list( + map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value) + ) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) + result[attr] = dict( + map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") + else item, + value.items(), + ) + ) else: result[attr] = value diff --git a/osparc/models/validation_error.py b/osparc/models/validation_error.py index 44354151..1edca70e 100644 --- a/osparc/models/validation_error.py +++ b/osparc/models/validation_error.py @@ -5,7 +5,7 @@ osparc-simcore public web API specifications # noqa: E501 - The version of the OpenAPI document: 0.3.0 + The version of the OpenAPI document: 0.4.0 Generated by: https://openapi-generator.tech """ @@ -32,19 +32,13 @@ class ValidationError(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = { - 'loc': 'list[str]', - 'msg': 'str', - 'type': 'str' - } - - attribute_map = { - 'loc': 'loc', - 'msg': 'msg', - 'type': 'type' - } - - def __init__(self, loc=None, msg=None, type=None, local_vars_configuration=None): # noqa: E501 + openapi_types = {"loc": "list[str]", "msg": "str", "type": "str"} + + attribute_map = {"loc": "loc", "msg": "msg", "type": "type"} + + def __init__( + self, loc=None, msg=None, type=None, local_vars_configuration=None + ): # noqa: E501 """ValidationError - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -77,8 +71,12 @@ def loc(self, loc): :param loc: The loc of this ValidationError. # noqa: E501 :type: list[str] """ - if self.local_vars_configuration.client_side_validation and loc is None: # noqa: E501 - raise ValueError("Invalid value for `loc`, must not be `None`") # noqa: E501 + if ( + self.local_vars_configuration.client_side_validation and loc is None + ): # noqa: E501 + raise ValueError( + "Invalid value for `loc`, must not be `None`" + ) # noqa: E501 self._loc = loc @@ -100,8 +98,12 @@ def msg(self, msg): :param msg: The msg of this ValidationError. # noqa: E501 :type: str """ - if self.local_vars_configuration.client_side_validation and msg is None: # noqa: E501 - raise ValueError("Invalid value for `msg`, must not be `None`") # noqa: E501 + if ( + self.local_vars_configuration.client_side_validation and msg is None + ): # noqa: E501 + raise ValueError( + "Invalid value for `msg`, must not be `None`" + ) # noqa: E501 self._msg = msg @@ -123,8 +125,12 @@ def type(self, type): :param type: The type of this ValidationError. # noqa: E501 :type: str """ - if self.local_vars_configuration.client_side_validation and type is None: # noqa: E501 - raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + if ( + self.local_vars_configuration.client_side_validation and type is None + ): # noqa: E501 + raise ValueError( + "Invalid value for `type`, must not be `None`" + ) # noqa: E501 self._type = type @@ -135,18 +141,20 @@ def to_dict(self): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) + result[attr] = list( + map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value) + ) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) + result[attr] = dict( + map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") + else item, + value.items(), + ) + ) else: result[attr] = value diff --git a/osparc/rest.py b/osparc/rest.py index 623815a5..9cedee11 100644 --- a/osparc/rest.py +++ b/osparc/rest.py @@ -5,7 +5,7 @@ osparc-simcore public web API specifications # noqa: E501 - The version of the OpenAPI document: 0.3.0 + The version of the OpenAPI document: 0.4.0 Generated by: https://openapi-generator.tech """ @@ -19,6 +19,7 @@ import ssl import certifi + # python 2 and python 3 compatibility library import six from six.moves.urllib.parse import urlencode @@ -31,7 +32,6 @@ class RESTResponse(io.IOBase): - def __init__(self, resp): self.urllib3_response = resp self.status = resp.status @@ -48,7 +48,6 @@ def getheader(self, name, default=None): class RESTClientObject(object): - def __init__(self, configuration, pools_size=4, maxsize=None): # urllib3.PoolManager will pass all kw parameters to connectionpool # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 @@ -71,10 +70,12 @@ def __init__(self, configuration, pools_size=4, maxsize=None): addition_pool_args = {} if configuration.assert_hostname is not None: - addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501 + addition_pool_args[ + "assert_hostname" + ] = configuration.assert_hostname # noqa: E501 if configuration.retries is not None: - addition_pool_args['retries'] = configuration.retries + addition_pool_args["retries"] = configuration.retries if maxsize is None: if configuration.connection_pool_maxsize is not None: @@ -106,9 +107,17 @@ def __init__(self, configuration, pools_size=4, maxsize=None): **addition_pool_args ) - def request(self, method, url, query_params=None, headers=None, - body=None, post_params=None, _preload_content=True, - _request_timeout=None): + def request( + self, + method, + url, + query_params=None, + headers=None, + body=None, + post_params=None, + _preload_content=True, + _request_timeout=None, + ): """Perform requests. :param method: http request method @@ -128,8 +137,7 @@ def request(self, method, url, query_params=None, headers=None, (connection, read) timeouts. """ method = method.upper() - assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', - 'PATCH', 'OPTIONS'] + assert method in ["GET", "HEAD", "DELETE", "POST", "PUT", "PATCH", "OPTIONS"] if post_params and body: raise ApiValueError( @@ -141,62 +149,74 @@ def request(self, method, url, query_params=None, headers=None, timeout = None if _request_timeout: - if isinstance(_request_timeout, (int, ) if six.PY3 else (int, long)): # noqa: E501,F821 + if isinstance( + _request_timeout, (int,) if six.PY3 else (int, long) + ): # noqa: E501,F821 timeout = urllib3.Timeout(total=_request_timeout) - elif (isinstance(_request_timeout, tuple) and - len(_request_timeout) == 2): + elif isinstance(_request_timeout, tuple) and len(_request_timeout) == 2: timeout = urllib3.Timeout( - connect=_request_timeout[0], read=_request_timeout[1]) + connect=_request_timeout[0], read=_request_timeout[1] + ) - if 'Content-Type' not in headers: - headers['Content-Type'] = 'application/json' + if "Content-Type" not in headers: + headers["Content-Type"] = "application/json" try: # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` - if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: + if method in ["POST", "PUT", "PATCH", "OPTIONS", "DELETE"]: if query_params: - url += '?' + urlencode(query_params) - if re.search('json', headers['Content-Type'], re.IGNORECASE): + url += "?" + urlencode(query_params) + if re.search("json", headers["Content-Type"], re.IGNORECASE): request_body = None if body is not None: request_body = json.dumps(body) r = self.pool_manager.request( - method, url, + method, + url, body=request_body, preload_content=_preload_content, timeout=timeout, - headers=headers) - elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 + headers=headers, + ) + elif ( + headers["Content-Type"] == "application/x-www-form-urlencoded" + ): # noqa: E501 r = self.pool_manager.request( - method, url, + method, + url, fields=post_params, encode_multipart=False, preload_content=_preload_content, timeout=timeout, - headers=headers) - elif headers['Content-Type'] == 'multipart/form-data': + headers=headers, + ) + elif headers["Content-Type"] == "multipart/form-data": # must del headers['Content-Type'], or the correct # Content-Type which generated by urllib3 will be # overwritten. - del headers['Content-Type'] + del headers["Content-Type"] r = self.pool_manager.request( - method, url, + method, + url, fields=post_params, encode_multipart=True, preload_content=_preload_content, timeout=timeout, - headers=headers) + headers=headers, + ) # Pass a `string` parameter directly in the body to support # other content types than Json when `body` argument is # provided in serialized form elif isinstance(body, str) or isinstance(body, bytes): request_body = body r = self.pool_manager.request( - method, url, + method, + url, body=request_body, preload_content=_preload_content, timeout=timeout, - headers=headers) + headers=headers, + ) else: # Cannot generate the request from given parameters msg = """Cannot prepare a request message for provided @@ -205,11 +225,14 @@ def request(self, method, url, query_params=None, headers=None, raise ApiException(status=0, reason=msg) # For `GET`, `HEAD` else: - r = self.pool_manager.request(method, url, - fields=query_params, - preload_content=_preload_content, - timeout=timeout, - headers=headers) + r = self.pool_manager.request( + method, + url, + fields=query_params, + preload_content=_preload_content, + timeout=timeout, + headers=headers, + ) except urllib3.exceptions.SSLError as e: msg = "{0}\n{1}".format(type(e).__name__, str(e)) raise ApiException(status=0, reason=msg) @@ -222,7 +245,7 @@ def request(self, method, url, query_params=None, headers=None, if six.PY3: # PATCH------------------------------------- try: - r.data = r.data.decode('utf8') + r.data = r.data.decode("utf8") except UnicodeDecodeError: # NOTE: hdf5 files cannot be decoded pass @@ -233,67 +256,139 @@ def request(self, method, url, query_params=None, headers=None, return r - def GET(self, url, headers=None, query_params=None, _preload_content=True, - _request_timeout=None): - return self.request("GET", url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params) - - def HEAD(self, url, headers=None, query_params=None, _preload_content=True, - _request_timeout=None): - return self.request("HEAD", url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params) - - def OPTIONS(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("OPTIONS", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def DELETE(self, url, headers=None, query_params=None, body=None, - _preload_content=True, _request_timeout=None): - return self.request("DELETE", url, - headers=headers, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def POST(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("POST", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def PUT(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("PUT", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def PATCH(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("PATCH", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) + def GET( + self, + url, + headers=None, + query_params=None, + _preload_content=True, + _request_timeout=None, + ): + return self.request( + "GET", + url, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + query_params=query_params, + ) + + def HEAD( + self, + url, + headers=None, + query_params=None, + _preload_content=True, + _request_timeout=None, + ): + return self.request( + "HEAD", + url, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + query_params=query_params, + ) + + def OPTIONS( + self, + url, + headers=None, + query_params=None, + post_params=None, + body=None, + _preload_content=True, + _request_timeout=None, + ): + return self.request( + "OPTIONS", + url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body, + ) + + def DELETE( + self, + url, + headers=None, + query_params=None, + body=None, + _preload_content=True, + _request_timeout=None, + ): + return self.request( + "DELETE", + url, + headers=headers, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body, + ) + + def POST( + self, + url, + headers=None, + query_params=None, + post_params=None, + body=None, + _preload_content=True, + _request_timeout=None, + ): + return self.request( + "POST", + url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body, + ) + + def PUT( + self, + url, + headers=None, + query_params=None, + post_params=None, + body=None, + _preload_content=True, + _request_timeout=None, + ): + return self.request( + "PUT", + url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body, + ) + + def PATCH( + self, + url, + headers=None, + query_params=None, + post_params=None, + body=None, + _preload_content=True, + _request_timeout=None, + ): + return self.request( + "PATCH", + url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body, + ) diff --git a/requirements-tools.txt b/requirements-dev.txt similarity index 73% rename from requirements-tools.txt rename to requirements-dev.txt index 532a1ea1..3ca253d9 100644 --- a/requirements-tools.txt +++ b/requirements-dev.txt @@ -1,8 +1,8 @@ -c requirements-tests.txt black +bump2version isort - -nox notedown -bump2version \ No newline at end of file +nox +pylint \ No newline at end of file diff --git a/requirements-tests.txt b/requirements-tests.txt index 6b2aecc5..e685427a 100644 --- a/requirements-tests.txt +++ b/requirements-tests.txt @@ -1,6 +1,5 @@ pytest - -python-dotenv +pytest-asyncio pytest-cov pytest-randomly -pytest-asyncio +python-dotenv diff --git a/scripts/openapi-generator-cli.bash b/scripts/openapi-generator-cli.bash new file mode 100755 index 00000000..4d536cb7 --- /dev/null +++ b/scripts/openapi-generator-cli.bash @@ -0,0 +1,38 @@ +#!/bin/bash +# OpenAPI Generator: generate clients, servers, and documentation from OpenAPI 2.0/3.x documents +# +# +# usage: openapi-generator-cli [] +# +# The most commonly used openapi-generator-cli commands are: +# config-help Config help for chosen lang +# generate Generate code with the specified generator. +# help Display help information +# list Lists the available generators +# meta MetaGenerator. Generator for creating a new template set and configuration for Codegen. The output will be based on the language you specify, and includes default templates to include. +# validate Validate specification +# version Show version information +# +# IMPORTANT: use absolute paths so they can be automaticaly mapped inside of the container +# +# REFERENCES: +# https://openapi-generator.tech/ +# https://hub.docker.com/r/openapitools/openapi-generator-cli +# + +USERID=$(stat --format=%u "$PWD") +GROUPID=$(stat --format=%g "$PWD") + +# +# openapitools/openapi-generator-cli v4.2.3 sha256:c90e7f2d63340574bba015ad88a5abb55d5b25ab3d5460c02e14a566574e8d55 +# + +exec docker run \ + --rm \ + --user "$USERID:$GROUPID" \ + --volume "$PWD:/local" \ + openapitools/openapi-generator-cli@sha256:c90e7f2d63340574bba015ad88a5abb55d5b25ab3d5460c02e14a566574e8d55 "$@" + +# Example +# openapi-generator-cli generate -i /local/api/specs/webserver/openapi.yaml -g python -o /local/out/sdk/webserver +# diff --git a/setup.cfg b/setup.cfg index 6bc5cffe..88dc5ecf 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,7 +1,7 @@ [bumpversion] -current_version = 0.4.3 +current_version = 0.5.0 commit = True -message = Version upgrade {current_version} → {new_version} +message = Package version upgrade {current_version} → {new_version} tag = False [bumpversion:file:setup.py] diff --git a/setup.py b/setup.py index 1d10a6ae..29894818 100644 --- a/setup.py +++ b/setup.py @@ -5,8 +5,8 @@ from setuptools import setup, find_packages NAME = "osparc" -VERSION = "0.4.3" -API_VERSION = "0.4" +VERSION = "0.5.0" +API_VERSION = "0.4.0" REQUIRES = ["urllib3 >= 1.26.4", "six >= 1.10", "certifi", "python-dateutil"] README = Path("README.md").read_text() diff --git a/test/conftest.py b/test/conftest.py index 5ebad000..0461fcde 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -4,11 +4,11 @@ import sys -current_dir = Path( sys.argv[0] if __name__ == "__main__" else __file__ ).parent.resolve() +current_dir = Path(sys.argv[0] if __name__ == "__main__" else __file__).parent.resolve() + @pytest.fixture(scope="session") def root_repo_dir() -> Path: repo_dir = current_dir.parent - assert any( repo_dir.glob(".git") ) + assert any(repo_dir.glob(".git")) return repo_dir - diff --git a/test/test_body_upload_file_v0_files_content_put.py b/test/test_body_upload_file_v0_files_content_put.py index 763d09e2..2690819c 100644 --- a/test/test_body_upload_file_v0_files_content_put.py +++ b/test/test_body_upload_file_v0_files_content_put.py @@ -16,9 +16,12 @@ import datetime import osparc -from osparc.models.body_upload_file_v0_files_content_put import BodyUploadFileV0FilesContentPut # noqa: E501 +from osparc.models.body_upload_file_v0_files_content_put import ( + BodyUploadFileV0FilesContentPut, +) # noqa: E501 from osparc.rest import ApiException + class TestBodyUploadFileV0FilesContentPut(unittest.TestCase): """BodyUploadFileV0FilesContentPut unit test stubs""" @@ -30,18 +33,16 @@ def tearDown(self): def make_instance(self, include_optional): """Test BodyUploadFileV0FilesContentPut - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included""" # model = osparc.models.body_upload_file_v0_files_content_put.BodyUploadFileV0FilesContentPut() # noqa: E501 - if include_optional : + if include_optional: + return BodyUploadFileV0FilesContentPut(file=bytes(b"blah")) + else: return BodyUploadFileV0FilesContentPut( - file = bytes(b'blah') + file=bytes(b"blah"), ) - else : - return BodyUploadFileV0FilesContentPut( - file = bytes(b'blah'), - ) def testBodyUploadFileV0FilesContentPut(self): """Test BodyUploadFileV0FilesContentPut""" @@ -49,5 +50,5 @@ def testBodyUploadFileV0FilesContentPut(self): inst_req_and_optional = self.make_instance(include_optional=True) -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_file.py b/test/test_file.py index f1c41fed..aab78994 100644 --- a/test/test_file.py +++ b/test/test_file.py @@ -19,6 +19,7 @@ from osparc.models.file import File # noqa: E501 from osparc.rest import ApiException + class TestFile(unittest.TestCase): """File unit test stubs""" @@ -30,21 +31,21 @@ def tearDown(self): def make_instance(self, include_optional): """Test File - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included""" # model = osparc.models.file.File() # noqa: E501 - if include_optional : + if include_optional: return File( - id = 'f0e1fb11-208d-3ed2-b5ef-cab7a7398f78', - filename = 'Architecture-of-Scalable-Distributed-ETL-System-whitepaper.pdf', - content_type = 'application/pdf', - checksum = 'de47d0e1229aa2dfb80097389094eadd-1' + id="f0e1fb11-208d-3ed2-b5ef-cab7a7398f78", + filename="Architecture-of-Scalable-Distributed-ETL-System-whitepaper.pdf", + content_type="application/pdf", + checksum="de47d0e1229aa2dfb80097389094eadd-1", ) - else : + else: return File( - id = 'f0e1fb11-208d-3ed2-b5ef-cab7a7398f78', - filename = 'Architecture-of-Scalable-Distributed-ETL-System-whitepaper.pdf', + id="f0e1fb11-208d-3ed2-b5ef-cab7a7398f78", + filename="Architecture-of-Scalable-Distributed-ETL-System-whitepaper.pdf", ) def testFile(self): @@ -53,5 +54,5 @@ def testFile(self): inst_req_and_optional = self.make_instance(include_optional=True) -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_files_api.py b/test/test_files_api.py index dbc858ed..51bc3fb4 100644 --- a/test/test_files_api.py +++ b/test/test_files_api.py @@ -57,5 +57,5 @@ def test_upload_file(self): pass -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_groups.py b/test/test_groups.py index 42f9543f..c05a02fa 100644 --- a/test/test_groups.py +++ b/test/test_groups.py @@ -19,6 +19,7 @@ from osparc.models.groups import Groups # noqa: E501 from osparc.rest import ApiException + class TestGroups(unittest.TestCase): """Groups unit test stubs""" @@ -30,38 +31,43 @@ def tearDown(self): def make_instance(self, include_optional): """Test Groups - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included""" # model = osparc.models.groups.Groups() # noqa: E501 - if include_optional : + if include_optional: return Groups( - me = osparc.models.users_group.UsersGroup( - gid = '0', - label = '0', - description = '0', ), - organizations = [ + me=osparc.models.users_group.UsersGroup( + gid="0", + label="0", + description="0", + ), + organizations=[ osparc.models.users_group.UsersGroup( - gid = '0', - label = '0', - description = '0', ) - ], - all = osparc.models.users_group.UsersGroup( - gid = '0', - label = '0', - description = '0', ) + gid="0", + label="0", + description="0", + ) + ], + all=osparc.models.users_group.UsersGroup( + gid="0", + label="0", + description="0", + ), ) - else : + else: return Groups( - me = osparc.models.users_group.UsersGroup( - gid = '0', - label = '0', - description = '0', ), - all = osparc.models.users_group.UsersGroup( - gid = '0', - label = '0', - description = '0', ), - ) + me=osparc.models.users_group.UsersGroup( + gid="0", + label="0", + description="0", + ), + all=osparc.models.users_group.UsersGroup( + gid="0", + label="0", + description="0", + ), + ) def testGroups(self): """Test Groups""" @@ -69,5 +75,5 @@ def testGroups(self): inst_req_and_optional = self.make_instance(include_optional=True) -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_http_validation_error.py b/test/test_http_validation_error.py index 63447d4f..94d3c362 100644 --- a/test/test_http_validation_error.py +++ b/test/test_http_validation_error.py @@ -19,6 +19,7 @@ from osparc.models.http_validation_error import HTTPValidationError # noqa: E501 from osparc.rest import ApiException + class TestHTTPValidationError(unittest.TestCase): """HTTPValidationError unit test stubs""" @@ -30,24 +31,22 @@ def tearDown(self): def make_instance(self, include_optional): """Test HTTPValidationError - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included""" # model = osparc.models.http_validation_error.HTTPValidationError() # noqa: E501 - if include_optional : + if include_optional: return HTTPValidationError( - errors = [ + errors=[ osparc.models.validation_error.ValidationError( - loc = [ - '0' - ], - msg = '0', - type = '0', ) - ] + loc=["0"], + msg="0", + type="0", + ) + ] ) - else : - return HTTPValidationError( - ) + else: + return HTTPValidationError() def testHTTPValidationError(self): """Test HTTPValidationError""" @@ -55,5 +54,5 @@ def testHTTPValidationError(self): inst_req_and_optional = self.make_instance(include_optional=True) -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_job.py b/test/test_job.py index eae6f5e0..520a4ae5 100644 --- a/test/test_job.py +++ b/test/test_job.py @@ -19,6 +19,7 @@ from osparc.models.job import Job # noqa: E501 from osparc.rest import ApiException + class TestJob(unittest.TestCase): """Job unit test stubs""" @@ -30,32 +31,36 @@ def tearDown(self): def make_instance(self, include_optional): """Test Job - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included""" # model = osparc.models.job.Job() # noqa: E501 - if include_optional : + if include_optional: return Job( - id = '0', - name = 'a', - inputs_checksum = '0', - created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - runner_name = 'a', - url = '0', - runner_url = '0', - outputs_url = '0' + id="0", + name="a", + inputs_checksum="0", + created_at=datetime.datetime.strptime( + "2013-10-20 19:20:30.00", "%Y-%m-%d %H:%M:%S.%f" + ), + runner_name="a", + url="0", + runner_url="0", + outputs_url="0", ) - else : + else: return Job( - id = '0', - name = 'a', - inputs_checksum = '0', - created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - runner_name = 'a', - url = '0', - runner_url = '0', - outputs_url = '0', - ) + id="0", + name="a", + inputs_checksum="0", + created_at=datetime.datetime.strptime( + "2013-10-20 19:20:30.00", "%Y-%m-%d %H:%M:%S.%f" + ), + runner_name="a", + url="0", + runner_url="0", + outputs_url="0", + ) def testJob(self): """Test Job""" @@ -63,5 +68,5 @@ def testJob(self): inst_req_and_optional = self.make_instance(include_optional=True) -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_job_inputs.py b/test/test_job_inputs.py index 2a41beb0..bfd44d84 100644 --- a/test/test_job_inputs.py +++ b/test/test_job_inputs.py @@ -19,6 +19,7 @@ from osparc.models.job_inputs import JobInputs # noqa: E501 from osparc.rest import ApiException + class TestJobInputs(unittest.TestCase): """JobInputs unit test stubs""" @@ -30,22 +31,16 @@ def tearDown(self): def make_instance(self, include_optional): """Test JobInputs - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included""" # model = osparc.models.job_inputs.JobInputs() # noqa: E501 - if include_optional : + if include_optional: + return JobInputs(values={"key": 33}) + else: return JobInputs( - values = { - 'key' : 33 - } + values={"key": 34}, ) - else : - return JobInputs( - values = { - 'key' : 34 - }, - ) def testJobInputs(self): """Test JobInputs""" @@ -53,5 +48,5 @@ def testJobInputs(self): inst_req_and_optional = self.make_instance(include_optional=True) -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_job_outputs.py b/test/test_job_outputs.py index 5e6a3b14..a9e59623 100644 --- a/test/test_job_outputs.py +++ b/test/test_job_outputs.py @@ -19,6 +19,7 @@ from osparc.models.job_outputs import JobOutputs # noqa: E501 from osparc.rest import ApiException + class TestJobOutputs(unittest.TestCase): """JobOutputs unit test stubs""" @@ -30,24 +31,19 @@ def tearDown(self): def make_instance(self, include_optional): """Test JobOutputs - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included""" # model = osparc.models.job_outputs.JobOutputs() # noqa: E501 - if include_optional : + if include_optional: return JobOutputs( - job_id = '2d59e648-647b-4f5a-b6fc-b934937c2f6b', - results = { - 'x' : 42.4 - } + job_id="2d59e648-647b-4f5a-b6fc-b934937c2f6b", results={"x": 42.4} ) - else : + else: return JobOutputs( - job_id = '2d59e648-647b-4f5a-b6fc-b934937c2f6b', - results = { - 'y' : 43 - }, - ) + job_id="2d59e648-647b-4f5a-b6fc-b934937c2f6b", + results={"y": 43}, + ) def testJobOutputs(self): """Test JobOutputs""" @@ -55,5 +51,5 @@ def testJobOutputs(self): inst_req_and_optional = self.make_instance(include_optional=True) -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_job_status.py b/test/test_job_status.py index 784227be..824ba132 100644 --- a/test/test_job_status.py +++ b/test/test_job_status.py @@ -19,6 +19,7 @@ from osparc.models.job_status import JobStatus # noqa: E501 from osparc.rest import ApiException + class TestJobStatus(unittest.TestCase): """JobStatus unit test stubs""" @@ -30,25 +31,33 @@ def tearDown(self): def make_instance(self, include_optional): """Test JobStatus - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included""" # model = osparc.models.job_status.JobStatus() # noqa: E501 - if include_optional : + if include_optional: return JobStatus( - job_id = '0', - state = 'undefined', - progress = 0.0, - submitted_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - started_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - stopped_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f') + job_id="0", + state="undefined", + progress=0.0, + submitted_at=datetime.datetime.strptime( + "2013-10-20 19:20:30.00", "%Y-%m-%d %H:%M:%S.%f" + ), + started_at=datetime.datetime.strptime( + "2013-10-20 19:20:30.00", "%Y-%m-%d %H:%M:%S.%f" + ), + stopped_at=datetime.datetime.strptime( + "2013-10-20 19:20:30.00", "%Y-%m-%d %H:%M:%S.%f" + ), ) - else : + else: return JobStatus( - job_id = '0', - state = 'undefined', - submitted_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - ) + job_id="0", + state="undefined", + submitted_at=datetime.datetime.strptime( + "2013-10-20 19:20:30.00", "%Y-%m-%d %H:%M:%S.%f" + ), + ) def testJobStatus(self): """Test JobStatus""" @@ -56,5 +65,5 @@ def testJobStatus(self): inst_req_and_optional = self.make_instance(include_optional=True) -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_meta_api.py b/test/test_meta_api.py index 59862ff1..bf00d077 100644 --- a/test/test_meta_api.py +++ b/test/test_meta_api.py @@ -41,5 +41,6 @@ def test_get_service_metadata(self): assert meta.name == "simcore_service_api_server" assert meta.docs_url == "http://api.osparc.io/doc" -if __name__ == '__main__': + +if __name__ == "__main__": unittest.main() diff --git a/test/test_profile.py b/test/test_profile.py index 0082e279..b9ba9f4a 100644 --- a/test/test_profile.py +++ b/test/test_profile.py @@ -19,6 +19,7 @@ from osparc.models.profile import Profile # noqa: E501 from osparc.rest import ApiException + class TestProfile(unittest.TestCase): """Profile unit test stubs""" @@ -30,38 +31,42 @@ def tearDown(self): def make_instance(self, include_optional): """Test Profile - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included""" # model = osparc.models.profile.Profile() # noqa: E501 - if include_optional : + if include_optional: return Profile( - first_name = 'James', - last_name = 'Maxwell', - login = '0', - role = 'ANONYMOUS', - groups = osparc.models.groups.Groups( - me = osparc.models.users_group.UsersGroup( - gid = '0', - label = '0', - description = '0', ), - organizations = [ + first_name="James", + last_name="Maxwell", + login="0", + role="ANONYMOUS", + groups=osparc.models.groups.Groups( + me=osparc.models.users_group.UsersGroup( + gid="0", + label="0", + description="0", + ), + organizations=[ osparc.models.users_group.UsersGroup( - gid = '0', - label = '0', - description = '0', ) - ], - all = osparc.models.users_group.UsersGroup( - gid = '0', - label = '0', - description = '0', ), ), - gravatar_id = '0' + gid="0", + label="0", + description="0", + ) + ], + all=osparc.models.users_group.UsersGroup( + gid="0", + label="0", + description="0", + ), + ), + gravatar_id="0", ) - else : + else: return Profile( - login = '0', - role = 'ANONYMOUS', - ) + login="0", + role="ANONYMOUS", + ) def testProfile(self): """Test Profile""" @@ -69,5 +74,5 @@ def testProfile(self): inst_req_and_optional = self.make_instance(include_optional=True) -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_profile_update.py b/test/test_profile_update.py index baeceffe..3976d6e1 100644 --- a/test/test_profile_update.py +++ b/test/test_profile_update.py @@ -19,6 +19,7 @@ from osparc.models.profile_update import ProfileUpdate # noqa: E501 from osparc.rest import ApiException + class TestProfileUpdate(unittest.TestCase): """ProfileUpdate unit test stubs""" @@ -30,18 +31,14 @@ def tearDown(self): def make_instance(self, include_optional): """Test ProfileUpdate - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included""" # model = osparc.models.profile_update.ProfileUpdate() # noqa: E501 - if include_optional : - return ProfileUpdate( - first_name = 'James', - last_name = 'Maxwell' - ) - else : - return ProfileUpdate( - ) + if include_optional: + return ProfileUpdate(first_name="James", last_name="Maxwell") + else: + return ProfileUpdate() def testProfileUpdate(self): """Test ProfileUpdate""" @@ -49,5 +46,5 @@ def testProfileUpdate(self): inst_req_and_optional = self.make_instance(include_optional=True) -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_solvers_api.py b/test/test_solvers_api.py index 69460e8a..bb889400 100644 --- a/test/test_solvers_api.py +++ b/test/test_solvers_api.py @@ -113,5 +113,5 @@ def test_stop_job(self): pass -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_task_states.py b/test/test_task_states.py index c755bdee..6b21f7db 100644 --- a/test/test_task_states.py +++ b/test/test_task_states.py @@ -19,6 +19,7 @@ from osparc.models.task_states import TaskStates # noqa: E501 from osparc.rest import ApiException + class TestTaskStates(unittest.TestCase): """TaskStates unit test stubs""" @@ -30,16 +31,14 @@ def tearDown(self): def make_instance(self, include_optional): """Test TaskStates - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included""" # model = osparc.models.task_states.TaskStates() # noqa: E501 - if include_optional : - return TaskStates( - ) - else : - return TaskStates( - ) + if include_optional: + return TaskStates() + else: + return TaskStates() def testTaskStates(self): """Test TaskStates""" @@ -47,5 +46,5 @@ def testTaskStates(self): inst_req_and_optional = self.make_instance(include_optional=True) -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_user_role_enum.py b/test/test_user_role_enum.py index f41497b3..df97ec4a 100644 --- a/test/test_user_role_enum.py +++ b/test/test_user_role_enum.py @@ -19,6 +19,7 @@ from osparc.models.user_role_enum import UserRoleEnum # noqa: E501 from osparc.rest import ApiException + class TestUserRoleEnum(unittest.TestCase): """UserRoleEnum unit test stubs""" @@ -30,16 +31,14 @@ def tearDown(self): def make_instance(self, include_optional): """Test UserRoleEnum - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included""" # model = osparc.models.user_role_enum.UserRoleEnum() # noqa: E501 - if include_optional : - return UserRoleEnum( - ) - else : - return UserRoleEnum( - ) + if include_optional: + return UserRoleEnum() + else: + return UserRoleEnum() def testUserRoleEnum(self): """Test UserRoleEnum""" @@ -47,5 +46,5 @@ def testUserRoleEnum(self): inst_req_and_optional = self.make_instance(include_optional=True) -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_users_api.py b/test/test_users_api.py index cf7b4aa0..6aacc39b 100644 --- a/test/test_users_api.py +++ b/test/test_users_api.py @@ -43,5 +43,5 @@ def test_update_my_profile(self): pass -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_users_group.py b/test/test_users_group.py index ace0bb2e..c7f97b34 100644 --- a/test/test_users_group.py +++ b/test/test_users_group.py @@ -19,6 +19,7 @@ from osparc.models.users_group import UsersGroup # noqa: E501 from osparc.rest import ApiException + class TestUsersGroup(unittest.TestCase): """UsersGroup unit test stubs""" @@ -30,21 +31,17 @@ def tearDown(self): def make_instance(self, include_optional): """Test UsersGroup - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included""" # model = osparc.models.users_group.UsersGroup() # noqa: E501 - if include_optional : + if include_optional: + return UsersGroup(gid="0", label="0", description="0") + else: return UsersGroup( - gid = '0', - label = '0', - description = '0' + gid="0", + label="0", ) - else : - return UsersGroup( - gid = '0', - label = '0', - ) def testUsersGroup(self): """Test UsersGroup""" @@ -52,5 +49,5 @@ def testUsersGroup(self): inst_req_and_optional = self.make_instance(include_optional=True) -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_validation_error.py b/test/test_validation_error.py index 557074d7..01594e4e 100644 --- a/test/test_validation_error.py +++ b/test/test_validation_error.py @@ -19,6 +19,7 @@ from osparc.models.validation_error import ValidationError # noqa: E501 from osparc.rest import ApiException + class TestValidationError(unittest.TestCase): """ValidationError unit test stubs""" @@ -30,26 +31,18 @@ def tearDown(self): def make_instance(self, include_optional): """Test ValidationError - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included""" # model = osparc.models.validation_error.ValidationError() # noqa: E501 - if include_optional : + if include_optional: + return ValidationError(loc=["0"], msg="0", type="0") + else: return ValidationError( - loc = [ - '0' - ], - msg = '0', - type = '0' + loc=["0"], + msg="0", + type="0", ) - else : - return ValidationError( - loc = [ - '0' - ], - msg = '0', - type = '0', - ) def testValidationError(self): """Test ValidationError""" @@ -57,5 +50,5 @@ def testValidationError(self): inst_req_and_optional = self.make_instance(include_optional=True) -if __name__ == '__main__': +if __name__ == "__main__": unittest.main()