Skip to content

Latest commit

 

History

History
1705 lines (1379 loc) · 116 KB

ModelsApi.md

File metadata and controls

1705 lines (1379 loc) · 116 KB

waylay.services.registry.ModelsApi

All URIs are relative to https://api.waylay.io

Method HTTP request Description
create POST /registry/v2/models/ Create Model
delete_asset DELETE /registry/v2/models/{name}/versions/{version}/content/{wildcard} Delete Model Asset
get_archive GET /registry/v2/models/{name}/versions/{version}/content Get Model Archive
get_asset GET /registry/v2/models/{name}/versions/{version}/content/{wildcard} Get File From Model Archive
get_latest GET /registry/v2/models/{name} Get Latest Model Version
get GET /registry/v2/models/{name}/versions/{version} Get Model Version
jobs GET /registry/v2/models/{name}/versions/{version}/jobs List Model Jobs
list GET /registry/v2/models/ List Models
list_versions GET /registry/v2/models/{name}/versions List Model Versions
patch_metadata PATCH /registry/v2/models/{name}/versions/{version}/metadata Patch Model Metadata
protect POST /registry/v2/models/{name}/versions/{version}/protect Protect Model Version
protect_versions POST /registry/v2/models/{name}/protect Protect Model
publish POST /registry/v2/models/{name}/versions/{version}/publish Publish Draft Model
rebuild POST /registry/v2/models/{name}/versions/{version}/rebuild Rebuild Model
remove_version DELETE /registry/v2/models/{name}/versions/{version} Remove Model Version
remove_versions DELETE /registry/v2/models/{name} Remove Model
update_asset PUT /registry/v2/models/{name}/versions/{version}/content/{wildcard} Update Model Asset
update_assets PUT /registry/v2/models/{name}/versions/{version}/content Update Model Assets
verify POST /registry/v2/models/{name}/versions/{version}/verify Verify Health Of Model

create

create( query: CreateQuery, files, headers ) -> PostModelJobSyncResponseV2 | PostModelJobAsyncResponseV2

Create Model

Creates a new model function by uploading its assets. The assets for a model function can be provided as

  • A single tar archive (optionally compressed), with one of the content types application/octet-stream, application/tar, application/tar+gzip, application/x-gzip, application/x-tar, application/gzip
  • Separate files in a multipart/form-data request
  • A reference to the assets of another model in the copy argument
The required model.json json file contains the function metadata, and must have a runtime attribute that is one of the supported runtimes (see GET /registry/v2/runtimes?functionType=kfserving). For each runtime other files will be required or supported.

Example

from pprint import pprint

# Import the waylay-client from the waylay-sdk-core package
from waylay.sdk.client import WaylayClient
from waylay.sdk.api.api_exceptions import ApiError

# Intialize a waylay client instance
waylay_client = WaylayClient.from_profile()

# Note that the typed model classes for responses/parameters/... are only available when `waylay-sdk-registry-types` is installed
from waylay.services.registry.models.post_model_job_sync_response_v2 import PostModelJobSyncResponseV2
try:
    # Create Model
    # calls `POST /registry/v2/models/`
    api_response = await waylay_client.registry.models.create(
        # query parameters:
        query = {
            'deploy': True
            'scaleToZero': False
            'deprecatePrevious': waylay.services.registry.DeprecatePreviousPolicy()
            'dryRun': True
            'async': True
            'draft': False
        },
        # json data: use a generated model or a json-serializable python data structure (dict, list)
        json = None # bytearray | The assets for a <em>model</em> function can be provided as   <ul>     <li>A single <em>tar</em> archive (optionally compressed), with one of the content types      <code>application/octet-stream</code>, <code>application/tar</code>, <code>application/tar+gzip</code>, <code>application/x-gzip</code>, <code>application/x-tar</code>, <code>application/gzip</code></li>     <li>Separate files in a <code>multipart/form-data</code> request</li>     <li>A reference to the assets of another <em>model</em> in the <code>copy</code> argument</li>   </ul>    The required <code>model.json</code> json file contains the function metadata,   and must have a <code>runtime</code> attribute that is one of the supported <em>runtime</em>s    (see <code>GET /registry/v2/runtimes?functionType=kfserving</code>).    For each <em>runtime</em> other files will be required or supported.  (optional)
        # non-json binary data: use a byte array or a generator of bytearray chuncks
        content=b'my-binary-data',
        # this operation supports multiple request content types: use `headers` to specify the one used
        # alternatives: 'application/tar', 'application/tar+gzip', 'application/x-gzip', 'application/x-tar', 'application/gzip', 'multipart/form-data', 'application/json', '*/*+json', 
        headers = {
            'content-type': 'application/octet-stream'
        },
    )
    print("The response of registry.models.create:\n")
    pprint(api_response)
except ApiError as e:
    print("Exception when calling registry.models.create: %s\n" % e)

Endpoint

POST /registry/v2/models/

Parameters

Name Type API binding Description Notes
json bytearray json request body The assets for a <em>model</em> function can be provided as <ul> <li>A single <em>tar</em> archive (optionally compressed), with one of the content types <code>application/octet-stream</code>, <code>application/tar</code>, <code>application/tar+gzip</code>, <code>application/x-gzip</code>, <code>application/x-tar</code>, <code>application/gzip</code></li> <li>Separate files in a <code>multipart/form-data</code> request</li> <li>A reference to the assets of another <em>model</em> in the <code>copy</code> argument</li> </ul> The required <code>model.json</code> json file contains the function metadata, and must have a <code>runtime</code> attribute that is one of the supported <em>runtime</em>s (see <code>GET /registry/v2/runtimes?functionType=kfserving</code>). For each <em>runtime</em> other files will be required or supported. [optional]
content ContentRequest binary request body The assets for a <em>model</em> function can be provided as <ul> <li>A single <em>tar</em> archive (optionally compressed), with one of the content types <code>application/octet-stream</code>, <code>application/tar</code>, <code>application/tar+gzip</code>, <code>application/x-gzip</code>, <code>application/x-tar</code>, <code>application/gzip</code></li> <li>Separate files in a <code>multipart/form-data</code> request</li> <li>A reference to the assets of another <em>model</em> in the <code>copy</code> argument</li> </ul> The required <code>model.json</code> json file contains the function metadata, and must have a <code>runtime</code> attribute that is one of the supported <em>runtime</em>s (see <code>GET /registry/v2/runtimes?functionType=kfserving</code>). For each <em>runtime</em> other files will be required or supported. [optional]
files FileTypes request body files
query QueryParamTypes | None URL query parameter
query['deploy'] (dict)
query.deploy (Query)
bool query parameter "deploy" Indicates that a function should be deployed when its assets are valid. * If `true` (default), jobs to build and deploy the function will be initiated after it is checked that the assets are valid. Invalid assets lead to a validation error, and the function and its assets are not created or updated. * If `false`, the uploaded assets are stored and the function is created/updated in `registered` state. Asset validation errors are only returned as warning, and stored as `failureReason` on the function entity. Use an asset update or rebuild to initiate a build and deploy at a later stage. [optional] [default True]
query['author'] (dict)
query.author (Query)
str query parameter "author" Optionally changes the author metadata when updating a function. [optional]
query['comment'] (dict)
query.comment (Query)
str query parameter "comment" An optional user-specified comment corresponding to the operation. [optional]
query['scaleToZero'] (dict)
query.scale_to_zero (Query)
bool query parameter "scaleToZero" If set to <code>true</code>, after successful deployment, the deployed function will be scaled to zero. This saves computing resources when the function is not to be used immediately. [optional] [default False]
query['deprecatePrevious'] (dict)
query.deprecate_previous (Query)
DeprecatePreviousPolicy query parameter "deprecatePrevious" Set the cleanup policy used to automatically deprecate/delete previous versions. [optional]
query['dryRun'] (dict)
query.dry_run (Query)
bool query parameter "dryRun" If set to <code>true</code>, validates the deployment conditions, but does not change anything. [optional]
query['async'] (dict)
query.var_async (Query)
bool query parameter "async" Unless this is set to <code>false</code>, the server will start the required job actions asynchronously and return a <code>202</code> <em>Accepted</em> response. If <code>false</code> the request will block until the job actions are completed, or a timeout occurs. [optional] [default True]
query['version'] (dict)
query.version (Query)
SemanticVersionRange query parameter "version" If set, the function version will be an increment of the latest existing version that satisfies the `version` range. Note that this increment always takes precedence over an explicit `version` in the function manifest. [optional]
query['name'] (dict)
query.name (Query)
str query parameter "name" If set, the value will be used as the function name instead of the one specified in the manifest. [optional]
query['draft'] (dict)
query.draft (Query)
bool query parameter "draft" If set, the created function will be a draft function and its assets are still mutable. A build and deploy is initiated only in the case when all necessary assets are present and valid. [optional] [default False]
query['runtime'] (dict)
query.runtime (Query)
str query parameter "runtime" If set, the created function will use the indicated runtime (latest version within specified range). This takes precedence over the runtime specified in a function manifest (copied or from request body). [optional]
query['copy'] (dict)
query.copy_from (Query)
CreateWebscriptsCopyParameter query parameter "copy" Indicates the source of initial assets for a new function. When using this query parameter, the request body does not need to contain assets, but any assets in the request body will overwrite the copied assets. #### Selection of assets source * If set as `<sourceName>[@<sourceVersionRange>]`, the new function will be created with copied assets of the selected source function. * If set as `!example`, a `runtime` query parameter is required, and the new function will be initialized with assets of the runtime example. #### Selection of the source function When `<sourceVersionRange>` is a range (or is not given), the latest published version (in that range) is used. If no published version exists, the latest draft is selected. If no versions in the range exist, a `404` Not Found error is returned. #### The `name` of the new function If a `name` is NOT specified (either as query parameter, or in an optional manifest asset in the request body), the `name` of the new function will be that of the source function. #### The `version` of the new function When the target and source name are equal, the `version` query parameters is defaulted to `<sourceVersionRange>` (`~<sourceVersionRange>` when it's an exact version) The version of the new function will be: * If a `version` is NOT specified (either as query parameter, in an optional manifest asset, or as `<sourceVersionRange>` default) * a patch increment (`<major>.<minor>.<patch>+1`) of the latest existing version with the target `name` * `1.0.0` otherwise * If a `version` is specified: * the lowest version in that range if no existing version is in that range. * an increment of the latest existing version, at the highest level (major,minor,patch) allowed by that range. * otherwise, if all allowed versions already exist, a `409` Duplicate error is raised. #### Deployment overrides The new function will use the deployment overrides of the copied function, unless a manifest was specified in the request body. [optional]
headers HeaderTypes request headers
headers['content-type'] str content type request header "content-type" should match mediaType application/octet-stream, application/tar, application/tar+gzip, application/x-gzip, application/x-tar, application/gzip, multipart/form-data, application/json, */*+json

Return type

Selected path param Raw response param Return Type Description Links
Literal[""] (default) False (default) PostModelJobSyncResponseV2 | PostModelJobAsyncResponseV2 PostModelJobSyncResponseV2
PostModelJobAsyncResponseV2
str False (default) Any If any other string value for the selected path is provided, the exact type of the response will only be known at runtime.
/ True Response The raw http response object.

HTTP request headers

  • Content-Type: application/octet-stream, application/tar, application/tar+gzip, application/x-gzip, application/x-tar, application/gzip, multipart/form-data, application/json, /+json
  • Accept: application/json

HTTP response details

Status code Description Response headers
201 Default Response -
202 Default Response -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

delete_asset

delete_asset( name: str, version: str, wildcard: str, query: DeleteAssetQuery, headers ) -> PostModelJobSyncResponseV2 | PostModelJobAsyncResponseV2

Delete Model Asset

Delete an asset from the model's collection of existing assets.

Example

from pprint import pprint

# Import the waylay-client from the waylay-sdk-core package
from waylay.sdk.client import WaylayClient
from waylay.sdk.api.api_exceptions import ApiError

# Intialize a waylay client instance
waylay_client = WaylayClient.from_profile()

# Note that the typed model classes for responses/parameters/... are only available when `waylay-sdk-registry-types` is installed
from waylay.services.registry.models.post_model_job_sync_response_v2 import PostModelJobSyncResponseV2
try:
    # Delete Model Asset
    # calls `DELETE /registry/v2/models/{name}/versions/{version}/content/{wildcard}`
    api_response = await waylay_client.registry.models.delete_asset(
        'name_example', # name | path param "name"
        'version_example', # version | path param "version"
        'wildcard_example', # wildcard | path param "wildcard"
        # query parameters:
        query = {
            'scaleToZero': False
            'deploy': True
            'chown': False
            'async': True
        },
    )
    print("The response of registry.models.delete_asset:\n")
    pprint(api_response)
except ApiError as e:
    print("Exception when calling registry.models.delete_asset: %s\n" % e)

Endpoint

DELETE /registry/v2/models/{name}/versions/{version}/content/{wildcard}

Parameters

Name Type API binding Description Notes
name str path parameter "name" The name of the function.
version str path parameter "version" The version of the function.
wildcard str path parameter "wildcard" Full path or path prefix of the asset within the archive
query QueryParamTypes | None URL query parameter
query['scaleToZero'] (dict)
query.scale_to_zero (Query)
bool query parameter "scaleToZero" If set to <code>true</code>, after successful deployment, the deployed function will be scaled to zero. This saves computing resources when the function is not to be used immediately. [optional] [default False]
query['deploy'] (dict)
query.deploy (Query)
bool query parameter "deploy" Indicates that a function should be deployed when its assets are valid. * If `true` (default), jobs to build and deploy the function will be initiated after it is checked that the assets are valid. Invalid assets lead to a validation error, and the function and its assets are not created or updated. * If `false`, the uploaded assets are stored and the function is created/updated in `registered` state. Asset validation errors are only returned as warning, and stored as `failureReason` on the function entity. Use an asset update or rebuild to initiate a build and deploy at a later stage. [optional] [default True]
query['chown'] (dict)
query.chown (Query)
bool query parameter "chown" If set, ownership of a draft function is transferred to the current user. [optional] [default False]
query['comment'] (dict)
query.comment (Query)
str query parameter "comment" An optional user-specified comment corresponding to the operation. [optional]
query['author'] (dict)
query.author (Query)
str query parameter "author" Optionally changes the author metadata when updating a function. [optional]
query['async'] (dict)
query.var_async (Query)
bool query parameter "async" Unless this is set to <code>false</code>, the server will start the required job actions asynchronously and return a <code>202</code> <em>Accepted</em> response. If <code>false</code> the request will block until the job actions are completed, or a timeout occurs. [optional] [default True]
headers HeaderTypes request headers

Return type

Selected path param Raw response param Return Type Description Links
Literal[""] (default) False (default) PostModelJobSyncResponseV2 | PostModelJobAsyncResponseV2 PostModelJobSyncResponseV2
PostModelJobAsyncResponseV2
str False (default) Any If any other string value for the selected path is provided, the exact type of the response will only be known at runtime.
/ True Response The raw http response object.

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
201 Default Response -
202 Default Response -
403 Default Response -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_archive

get_archive( name: str, version: str, query: GetArchiveQuery, headers ) -> bytearray

Get Model Archive

Get the specification archive of a model.

Example

from pprint import pprint

# Import the waylay-client from the waylay-sdk-core package
from waylay.sdk.client import WaylayClient
from waylay.sdk.api.api_exceptions import ApiError

# Intialize a waylay client instance
waylay_client = WaylayClient.from_profile()

# Note that the typed model classes for responses/parameters/... are only available when `waylay-sdk-registry-types` is installed
try:
    # Get Model Archive
    # calls `GET /registry/v2/models/{name}/versions/{version}/content`
    api_response = await waylay_client.registry.models.get_archive(
        'name_example', # name | path param "name"
        'version_example', # version | path param "version"
        # query parameters:
        query = {
            'ls': False
        },
    )
    print("The response of registry.models.get_archive:\n")
    pprint(api_response)
except ApiError as e:
    print("Exception when calling registry.models.get_archive: %s\n" % e)

Endpoint

GET /registry/v2/models/{name}/versions/{version}/content

Parameters

Name Type API binding Description Notes
name str path parameter "name" The name of the function.
version str path parameter "version" The version of the function.
query QueryParamTypes | None URL query parameter
query['ls'] (dict)
query.ls (Query)
bool query parameter "ls" If set to `true`, the result will be a listing of the files in the asset, annotated with metadata and validation report from the asset conditions of the functions runtime. [optional] [default False]
headers HeaderTypes request headers

Return type

Selected path param Raw response param Return Type Description Links
Literal[""] (default) False (default) bytearray
str False (default) Any If any other string value for the selected path is provided, the exact type of the response will only be known at runtime.
/ True Response The raw http response object.

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/octet-stream, application/tar, application/tar+gzip, application/x-gzip, application/x-tar, application/gzip, application/json

HTTP response details

Status code Description Response headers
200 Successful Response -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_asset

get_asset( name: str, version: str, wildcard: str, query: GetAssetQuery, headers ) -> bytearray

Get File From Model Archive

Get a file from the specification archive of a model.

Example

from pprint import pprint

# Import the waylay-client from the waylay-sdk-core package
from waylay.sdk.client import WaylayClient
from waylay.sdk.api.api_exceptions import ApiError

# Intialize a waylay client instance
waylay_client = WaylayClient.from_profile()

# Note that the typed model classes for responses/parameters/... are only available when `waylay-sdk-registry-types` is installed
try:
    # Get File From Model Archive
    # calls `GET /registry/v2/models/{name}/versions/{version}/content/{wildcard}`
    api_response = await waylay_client.registry.models.get_asset(
        'name_example', # name | path param "name"
        'version_example', # version | path param "version"
        'wildcard_example', # wildcard | path param "wildcard"
        # query parameters:
        query = {
            'ls': False
        },
    )
    print("The response of registry.models.get_asset:\n")
    pprint(api_response)
except ApiError as e:
    print("Exception when calling registry.models.get_asset: %s\n" % e)

Endpoint

GET /registry/v2/models/{name}/versions/{version}/content/{wildcard}

Parameters

Name Type API binding Description Notes
name str path parameter "name" The name of the function.
version str path parameter "version" The version of the function.
wildcard str path parameter "wildcard" Full path or path prefix of the asset within the archive
query QueryParamTypes | None URL query parameter
query['ls'] (dict)
query.ls (Query)
bool query parameter "ls" If set to `true`, the result will be a listing of the files in the asset, annotated with metadata and validation report from the asset conditions of the functions runtime. [optional] [default False]
headers HeaderTypes request headers

Return type

Selected path param Raw response param Return Type Description Links
Literal[""] (default) False (default) bytearray
str False (default) Any If any other string value for the selected path is provided, the exact type of the response will only be known at runtime.
/ True Response The raw http response object.

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/octet-stream, application/tar, application/tar+gzip, application/x-gzip, application/x-tar, application/gzip, application/json

HTTP response details

Status code Description Response headers
200 Successful Response -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_latest

get_latest( name: str, query: GetLatestQuery, headers ) -> GetModelResponseV2

Get Latest Model Version

Fetch the latest version of a model. By default, the result shows the latest non-deprecated, non-draft version. If there is no such version, the latest deprecated or the latest draft version is returned, with the former taking precedence. Use the boolean query parameters includeDeprecated or includeDraft to change this behaviour:

  • includeDeprecated=true: do not prefer non-deprecated versions as a latest version: if the latest version is a deprecated one, it will be shown, even if there are older non-deprecated versions.
  • includeDraft=true: do not prefer non-draft versions as a latest version: if the latest version is a draft, it will be shown, even if there are older non-draft versions.
The returned model version will contain a link to its latest draft or latest published version (if existing and different).

Example

from pprint import pprint

# Import the waylay-client from the waylay-sdk-core package
from waylay.sdk.client import WaylayClient
from waylay.sdk.api.api_exceptions import ApiError

# Intialize a waylay client instance
waylay_client = WaylayClient.from_profile()

# Note that the typed model classes for responses/parameters/... are only available when `waylay-sdk-registry-types` is installed
from waylay.services.registry.models.get_model_response_v2 import GetModelResponseV2
try:
    # Get Latest Model Version
    # calls `GET /registry/v2/models/{name}`
    api_response = await waylay_client.registry.models.get_latest(
        'name_example', # name | path param "name"
        # query parameters:
        query = {
            'showTags': 'embed'
            'includeDraft': True
            'includeDeprecated': True
        },
    )
    print("The response of registry.models.get_latest:\n")
    pprint(api_response)
except ApiError as e:
    print("Exception when calling registry.models.get_latest: %s\n" % e)

Endpoint

GET /registry/v2/models/{name}

Parameters

Name Type API binding Description Notes
name str path parameter "name" The name of the function.
query QueryParamTypes | None URL query parameter
query['showTags'] (dict)
query.show_tags (Query)
ShowInlineOrEmbedding query parameter "showTags" Instructs how tag (objects) should be rendered in responses. The tags are show at the `tags` property of the manifest (legacy: the `metadata.tags` property) - `inline`: Show full tag objects in the manifest. - `embed`: Show tag references in the manifest. Referenced full tag objects are included in a separate `_embedded` HAL section. - `none`: Show tag references in the manifest. Do not render tag objects. The default behaviour depends on deployment settings. [optional]
query['includeDraft'] (dict)
query.include_draft (Query)
bool query parameter "includeDraft" Configures the inclusion of draft versions when selecting latest versions per name. By default, draft versions are only considered when no other versions are available. If set to `true`, draft versions are included. If set to `false`, draft versions are excluded. [optional]
query['includeDeprecated'] (dict)
query.include_deprecated (Query)
bool query parameter "includeDeprecated" Configures the inclusion of deprecated versions when selecting latest versions per name. By default, deprecated versions are only considered when no other versions are available. If set to `true`, deprecated versions are included. If set to `false`, deprecated versions are excluded. [optional]
headers HeaderTypes request headers

Return type

Selected path param Raw response param Return Type Description Links
Literal[""] (default) False (default) GetModelResponseV2 GetModelResponseV2
str False (default) Any If any other string value for the selected path is provided, the exact type of the response will only be known at runtime.
/ True Response The raw http response object.

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Default Response -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get

get( name: str, version: str, query: GetQuery, headers ) -> GetModelResponseV2

Get Model Version

Get a model by name and version.

Example

from pprint import pprint

# Import the waylay-client from the waylay-sdk-core package
from waylay.sdk.client import WaylayClient
from waylay.sdk.api.api_exceptions import ApiError

# Intialize a waylay client instance
waylay_client = WaylayClient.from_profile()

# Note that the typed model classes for responses/parameters/... are only available when `waylay-sdk-registry-types` is installed
from waylay.services.registry.models.get_model_response_v2 import GetModelResponseV2
try:
    # Get Model Version
    # calls `GET /registry/v2/models/{name}/versions/{version}`
    api_response = await waylay_client.registry.models.get(
        'name_example', # name | path param "name"
        'version_example', # version | path param "version"
        # query parameters:
        query = {
            'showTags': 'embed'
        },
    )
    print("The response of registry.models.get:\n")
    pprint(api_response)
except ApiError as e:
    print("Exception when calling registry.models.get: %s\n" % e)

Endpoint

GET /registry/v2/models/{name}/versions/{version}

Parameters

Name Type API binding Description Notes
name str path parameter "name" The name of the function.
version str path parameter "version" The version of the function.
query QueryParamTypes | None URL query parameter
query['showTags'] (dict)
query.show_tags (Query)
ShowInlineOrEmbedding query parameter "showTags" Instructs how tag (objects) should be rendered in responses. The tags are show at the `tags` property of the manifest (legacy: the `metadata.tags` property) - `inline`: Show full tag objects in the manifest. - `embed`: Show tag references in the manifest. Referenced full tag objects are included in a separate `_embedded` HAL section. - `none`: Show tag references in the manifest. Do not render tag objects. The default behaviour depends on deployment settings. [optional]
headers HeaderTypes request headers

Return type

Selected path param Raw response param Return Type Description Links
Literal[""] (default) False (default) GetModelResponseV2 GetModelResponseV2
str False (default) Any If any other string value for the selected path is provided, the exact type of the response will only be known at runtime.
/ True Response The raw http response object.

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Default Response -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

jobs

jobs( name: str, version: str, query: JobsQuery, headers ) -> JobsForModelResponseV2

List Model Jobs

List the ongoing and completed operations on a model.

Example

from pprint import pprint

# Import the waylay-client from the waylay-sdk-core package
from waylay.sdk.client import WaylayClient
from waylay.sdk.api.api_exceptions import ApiError

# Intialize a waylay client instance
waylay_client = WaylayClient.from_profile()

# Note that the typed model classes for responses/parameters/... are only available when `waylay-sdk-registry-types` is installed
from waylay.services.registry.models.function_type import FunctionType
from waylay.services.registry.models.job_state_result import JobStateResult
from waylay.services.registry.models.job_type_schema import JobTypeSchema
from waylay.services.registry.models.jobs_for_model_response_v2 import JobsForModelResponseV2
try:
    # List Model Jobs
    # calls `GET /registry/v2/models/{name}/versions/{version}/jobs`
    api_response = await waylay_client.registry.models.jobs(
        'name_example', # name | path param "name"
        'version_example', # version | path param "version"
        # query parameters:
        query = {
        },
    )
    print("The response of registry.models.jobs:\n")
    pprint(api_response)
except ApiError as e:
    print("Exception when calling registry.models.jobs: %s\n" % e)

Endpoint

GET /registry/v2/models/{name}/versions/{version}/jobs

Parameters

Name Type API binding Description Notes
name str path parameter "name" The name of the function.
version str path parameter "version" The version of the function.
query QueryParamTypes | None URL query parameter
query['limit'] (dict)
query.limit (Query)
float query parameter "limit" The maximum number of items to be return from this query. Has a deployment-defined default and maximum value. [optional]
query['type'] (dict)
query.type (Query)
List[JobTypeSchema] query parameter "type" Filter on job type [optional]
query['state'] (dict)
query.state (Query)
List[JobStateResult] query parameter "state" Filter on job state [optional]
query['functionType'] (dict)
query.function_type (Query)
List[FunctionType] query parameter "functionType" Filter on function type [optional]
query['createdBefore'] (dict)
query.created_before (Query)
TimestampSpec query parameter "createdBefore" Filter on jobs that created before the given timestamp or age [optional]
query['createdAfter'] (dict)
query.created_after (Query)
TimestampSpec query parameter "createdAfter" Filter on jobs that created after the given timestamp or age [optional]
headers HeaderTypes request headers

Return type

Selected path param Raw response param Return Type Description Links
Literal[""] (default) False (default) JobsForModelResponseV2 JobsForModelResponseV2
str False (default) Any If any other string value for the selected path is provided, the exact type of the response will only be known at runtime.
/ True Response The raw http response object.

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Default Response -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

list

list( query: ListQuery, headers ) -> LatestModelsResponseV2

List Models

List the (latest) versions of available models. ### List Latest Model Versions By default, the result includes the latest non-deprecated, non-draft version for each model name. If there is no such version, the latest deprecated or the latest draft version is included, with the former taking precedence. Use the boolean query parameters includeDeprecated or includeDraft to change this behaviour:

  • includeDeprecated=true: do not prefer non-deprecated versions as a latest version: if the latest version is a deprecated one, it will be shown, even if there are older non-deprecated versions.
  • includeDraft=true: do not prefer non-draft versions as a latest version: if the latest version is a draft, it will be shown, even if there are older non-draft versions.
As long as no version filters are used, each listed model version contains representations of the latest draft (entities[]._links.draft) or latest published (entities[]._links.published) version (if existing and different). Use the query parameter showRelated to include only a link (default showRelated=link) or a full representation (showRelated=embed). ### List Latest Model Versions (with filter) When any of the version filter query parameters are used, the response contains the latest version per named model that satisfy the filters, but without links. ### List All Model Versions When using latest=false (default when using the namedVersion filter), the listing contains all models versions that satisfy the query, possibly multiple versions per named models. No HAL links are provided. #### Filter on status By default model versions with status undeployed are excluded in all cases. Use the version filter status to include/exclude a status from the results. By example, > ?status=any&includeDeprecated=true&includeDraft=true&latest=false will list ALL versions known to the function registry. #### Version filter parameters The following query parameters are version filters for the model listing: > version, status, runtimeVersion, createdBy, createdBefore, createdAfter, updatedBy, updatedBefore, updatedAfter, nameVersion, deprecated, draft, tags, wql

Example

from pprint import pprint

# Import the waylay-client from the waylay-sdk-core package
from waylay.sdk.client import WaylayClient
from waylay.sdk.api.api_exceptions import ApiError

# Intialize a waylay client instance
waylay_client = WaylayClient.from_profile()

# Note that the typed model classes for responses/parameters/... are only available when `waylay-sdk-registry-types` is installed
from waylay.services.registry.models.archive_format_filter import ArchiveFormatFilter
from waylay.services.registry.models.latest_models_response_v2 import LatestModelsResponseV2
from waylay.services.registry.models.status_filter import StatusFilter
try:
    # List Models
    # calls `GET /registry/v2/models/`
    api_response = await waylay_client.registry.models.list(
        # query parameters:
        query = {
            'includeDraft': True
            'includeDeprecated': True
            'deprecated': True
            'draft': True
            'showTags': 'embed'
            'createdBy': '@me'
            'updatedBy': '@me'
            'latest': True
        },
    )
    print("The response of registry.models.list:\n")
    pprint(api_response)
except ApiError as e:
    print("Exception when calling registry.models.list: %s\n" % e)

Endpoint

GET /registry/v2/models/

Parameters

Name Type API binding Description Notes
query QueryParamTypes | None URL query parameter
query['limit'] (dict)
query.limit (Query)
float query parameter "limit" The maximum number of items to be return from this query. Has a deployment-defined default and maximum value. [optional]
query['page'] (dict)
query.page (Query)
float query parameter "page" The number of pages to skip when returning result to this query. [optional]
query['includeDraft'] (dict)
query.include_draft (Query)
bool query parameter "includeDraft" Configures the inclusion of draft versions when selecting latest versions per name. By default, draft versions are only considered when no other versions are available. If set to `true`, draft versions are included. If set to `false`, draft versions are excluded. [optional]
query['includeDeprecated'] (dict)
query.include_deprecated (Query)
bool query parameter "includeDeprecated" Configures the inclusion of deprecated versions when selecting latest versions per name. By default, deprecated versions are only considered when no other versions are available. If set to `true`, deprecated versions are included. If set to `false`, deprecated versions are excluded. [optional]
query['deprecated'] (dict)
query.deprecated (Query)
bool query parameter "deprecated" Filter on the deprecation status of the function. [optional]
query['draft'] (dict)
query.draft (Query)
bool query parameter "draft" Filter on the draft status of the function. [optional]
query['nameVersion'] (dict)
query.name_version (Query)
List[str] query parameter "nameVersion" Filter on exact `{name}@{version}` functions. Using this filter implies a `latest=false` default, returning multiple versions of the same named versions if they are filtered. [optional]
query['showTags'] (dict)
query.show_tags (Query)
ShowInlineOrEmbedding query parameter "showTags" Instructs how tag (objects) should be rendered in responses. The tags are show at the `tags` property of the manifest (legacy: the `metadata.tags` property) - `inline`: Show full tag objects in the manifest. - `embed`: Show tag references in the manifest. Referenced full tag objects are included in a separate `_embedded` HAL section. - `none`: Show tag references in the manifest. Do not render tag objects. The default behaviour depends on deployment settings. [optional]
query['tags'] (dict)
query.tags (Query)
TagsFilter query parameter "tags" Filter on the tags of the item. Can be a single tag, or a list of tags. When multiple tags are specified, an item must have all of the tags to be selected. [optional]
query['wql'] (dict)
query.wql (Query)
str query parameter "wql" Query filter using the 'wql' query language. This is a unstable preview feature, currently supporting the following match terms: * `tag:<name>` entity has a tag that fully matches `<name>` (case insensitive). * `tag:<name1>,<name2>` entity has a tag that fully matches any of `<name1>`, `<name2>` (case insensitive). * `tag:inIgnoreCase(<name1>,<name2>)` is the fully specified format for the previous statements. `inIgnoreCase` is the default match predicate. * `tag:in(<name1>,<name2>)` entity has a tag matches one of `<name1>`,`<name2>` (case sensitive) * `tag:equals(<name>)` entity has a tag matches `<name>` (case sensitive) * `tag:like(<pattern>)` entity has a tag that matches `<pattern>` (case insensitive), where `<pattern>` can contain `` (multiple characters) and `?` (single character) wildcards. Each argument of a match term (like `<name>` above) can either be a * a quoted match argument, quoted using `&quot;`, can contain any character except `&quot;`: `tag:&quot;Status:In Review&quot;`. * a safe match argument can only contain alpha-numeric characters or `_`: `tag:Status_In_Review`. Multiple _match term_s can be combined in a boolean predicate using the `AND`, `OR` and `NOT` operators: * `tag:abc AND tag:&quot;My Demo&quot; AND tag:like(&quot;prj:&quot;)`: entity has a tag matching `abc` AND a tag matching `&quot;My Demo&quot;` AND a tag that has the `prj:` prefix * `tag:abc tag:&quot;My Demo&quot; tag:like(&quot;prj:&quot;)`: same as the previous statement: a (space-deliminated) list of terms is implicitly combined with `AND`. * `tag:abc OR tag:&quot;My Demo&quot;`: entity has a tag matching `abc` OR a tag matching `&quot;My Demo&quot;` * `NOT tag:abc`: entity does not have a tag matching `abc` Round brackets can be used to combine predicates with different operators: * `(tag:abc OR tag:&quot;My Demo&quot;) AND tag:like(&quot;prj:&quot;)`: entity has a tag `abc` or a tag `My Demo`, and a tag with prefix `prj:` For a multi-valued attribute like `tag`, each match term tests the existence of a matching tag assigned to the entity. When multiple match predicates on the same tag need to be specified, the boolean operators `not`, `all`, `any` can be used within the match term: * `tag:all(like(&quot;prj:&quot;),not(like(&quot;:Done&quot;)))`: entity has a tag that starts with `prj:` and does NOT end with `:Done`. * `tag:not(Done)`: entity has a tag that does not match `Done` (this excludes entities without tags, and with a single `Done` tag!). * `NOT tag:not(in(abc,def))`: each tag of the entity is in `abc` or `def` (matches entities without tags!) * `tag:any(like(&quot;prj:&quot;),not(done)))`: entity has a tag that either starts with `prj:` or does not match `done`. [optional]
query['version'] (dict)
query.version (Query)
str query parameter "version" Filter on the version of the function (case-sensitive, supports wildcards). [optional]
query['status'] (dict)
query.status (Query)
List[StatusFilter] query parameter "status" Filter on the status of the plug. Filter values with a `-` postfix exclude the status. Use the `any` filter value to include all states. When not specified, a default `undeployed-` filter excludes undeployed functions. [optional]
query['runtimeVersion'] (dict)
query.runtime_version (Query)
SemanticVersionRange query parameter "runtimeVersion" Filter on the runtime version. [optional]
query['createdBy'] (dict)
query.created_by (Query)
str query parameter "createdBy" Filter on the user that create the plug. You can use the `@me` token to indicate your own plugs. [optional]
query['updatedBy'] (dict)
query.updated_by (Query)
str query parameter "updatedBy" Filter on the user that last updated the plug. You can use the `@me` token to indicate your own plugs. [optional]
query['createdBefore'] (dict)
query.created_before (Query)
TimestampSpec query parameter "createdBefore" Filter on funtions that were created before the given timestamp or age. [optional]
query['createdAfter'] (dict)
query.created_after (Query)
TimestampSpec query parameter "createdAfter" Filter on funtions that were created after the given timestamp or age. [optional]
query['updatedBefore'] (dict)
query.updated_before (Query)
TimestampSpec query parameter "updatedBefore" Filter on funtions that were updated before the given timestamp or age. [optional]
query['updatedAfter'] (dict)
query.updated_after (Query)
TimestampSpec query parameter "updatedAfter" Filter on funtions that were updated after the given timestamp or age. [optional]
query['name'] (dict)
query.name (Query)
str query parameter "name" Filter on the name of the function. This is case-insensitive and supports wild-cards `?` (any one character) and `*` (any sequence of characters). [optional]
query['archiveFormat'] (dict)
query.archive_format (Query)
List[ArchiveFormatFilter] query parameter "archiveFormat" Filter on the archive format of the function. [optional]
query['runtime'] (dict)
query.runtime (Query)
List[str] query parameter "runtime" Filter on the runtime of the function. [optional]
query['latest'] (dict)
query.latest (Query)
bool query parameter "latest" When `true`, only the latest version per function name is returned. If set to `false`, multiple versions per named function can be returned. Defaults to `true`, except when specific versions are selected with the `nameVersion` filter. [optional]
query['showRelated'] (dict)
query.show_related (Query)
ShowLinkOrEmbedding query parameter "showRelated" Sets the representation of related function versions (like the latest draft and/or published) in the response. Ignored (forced to `none`) when any of the version filter query params are used. - `embed`: as full summary representation (in `_embedded`). - `link`: as HAL link in (in `_links`). - `none`: omitted. [optional]
headers HeaderTypes request headers

Return type

Selected path param Raw response param Return Type Description Links
Literal[""] (default) False (default) LatestModelsResponseV2 LatestModelsResponseV2
str False (default) Any If any other string value for the selected path is provided, the exact type of the response will only be known at runtime.
/ True Response The raw http response object.

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Default Response -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

list_versions

list_versions( name: str, query: ListVersionsQuery, headers ) -> ModelVersionsResponseV2

List Model Versions

List all deployed versions of a model.

Example

from pprint import pprint

# Import the waylay-client from the waylay-sdk-core package
from waylay.sdk.client import WaylayClient
from waylay.sdk.api.api_exceptions import ApiError

# Intialize a waylay client instance
waylay_client = WaylayClient.from_profile()

# Note that the typed model classes for responses/parameters/... are only available when `waylay-sdk-registry-types` is installed
from waylay.services.registry.models.archive_format_filter import ArchiveFormatFilter
from waylay.services.registry.models.model_versions_response_v2 import ModelVersionsResponseV2
from waylay.services.registry.models.status_filter import StatusFilter
try:
    # List Model Versions
    # calls `GET /registry/v2/models/{name}/versions`
    api_response = await waylay_client.registry.models.list_versions(
        'name_example', # name | path param "name"
        # query parameters:
        query = {
            'deprecated': True
            'draft': True
            'showTags': 'embed'
            'createdBy': '@me'
            'updatedBy': '@me'
        },
    )
    print("The response of registry.models.list_versions:\n")
    pprint(api_response)
except ApiError as e:
    print("Exception when calling registry.models.list_versions: %s\n" % e)

Endpoint

GET /registry/v2/models/{name}/versions

Parameters

Name Type API binding Description Notes
name str path parameter "name" The name of the function.
query QueryParamTypes | None URL query parameter
query['limit'] (dict)
query.limit (Query)
float query parameter "limit" The maximum number of items to be return from this query. Has a deployment-defined default and maximum value. [optional]
query['page'] (dict)
query.page (Query)
float query parameter "page" The number of pages to skip when returning result to this query. [optional]
query['deprecated'] (dict)
query.deprecated (Query)
bool query parameter "deprecated" Filter on the deprecation status of the function. [optional]
query['draft'] (dict)
query.draft (Query)
bool query parameter "draft" Filter on the draft status of the function. [optional]
query['showTags'] (dict)
query.show_tags (Query)
ShowInlineOrEmbedding query parameter "showTags" Instructs how tag (objects) should be rendered in responses. The tags are show at the `tags` property of the manifest (legacy: the `metadata.tags` property) - `inline`: Show full tag objects in the manifest. - `embed`: Show tag references in the manifest. Referenced full tag objects are included in a separate `_embedded` HAL section. - `none`: Show tag references in the manifest. Do not render tag objects. The default behaviour depends on deployment settings. [optional]
query['tags'] (dict)
query.tags (Query)
TagsFilter query parameter "tags" Filter on the tags of the item. Can be a single tag, or a list of tags. When multiple tags are specified, an item must have all of the tags to be selected. [optional]
query['version'] (dict)
query.version (Query)
str query parameter "version" Filter on the version of the function (case-sensitive, supports wildcards). [optional]
query['status'] (dict)
query.status (Query)
List[StatusFilter] query parameter "status" Filter on the status of the plug. Filter values with a `-` postfix exclude the status. Use the `any` filter value to include all states. When not specified, a default `undeployed-` filter excludes undeployed functions. [optional]
query['runtimeVersion'] (dict)
query.runtime_version (Query)
SemanticVersionRange query parameter "runtimeVersion" Filter on the runtime version. [optional]
query['createdBy'] (dict)
query.created_by (Query)
str query parameter "createdBy" Filter on the user that create the plug. You can use the `@me` token to indicate your own plugs. [optional]
query['updatedBy'] (dict)
query.updated_by (Query)
str query parameter "updatedBy" Filter on the user that last updated the plug. You can use the `@me` token to indicate your own plugs. [optional]
query['createdBefore'] (dict)
query.created_before (Query)
TimestampSpec query parameter "createdBefore" Filter on funtions that were created before the given timestamp or age. [optional]
query['createdAfter'] (dict)
query.created_after (Query)
TimestampSpec query parameter "createdAfter" Filter on funtions that were created after the given timestamp or age. [optional]
query['updatedBefore'] (dict)
query.updated_before (Query)
TimestampSpec query parameter "updatedBefore" Filter on funtions that were updated before the given timestamp or age. [optional]
query['updatedAfter'] (dict)
query.updated_after (Query)
TimestampSpec query parameter "updatedAfter" Filter on funtions that were updated after the given timestamp or age. [optional]
query['archiveFormat'] (dict)
query.archive_format (Query)
List[ArchiveFormatFilter] query parameter "archiveFormat" Filter on the archive format of the function. [optional]
query['runtime'] (dict)
query.runtime (Query)
List[str] query parameter "runtime" Filter on the runtime of the function. [optional]
headers HeaderTypes request headers

Return type

Selected path param Raw response param Return Type Description Links
Literal[""] (default) False (default) ModelVersionsResponseV2 ModelVersionsResponseV2
str False (default) Any If any other string value for the selected path is provided, the exact type of the response will only be known at runtime.
/ True Response The raw http response object.

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Default Response -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

patch_metadata

patch_metadata( name: str, version: str, query: PatchMetadataQuery, headers ) -> GetModelResponseV2

Patch Model Metadata

Patch the metadata of a model version.

Example

from pprint import pprint

# Import the waylay-client from the waylay-sdk-core package
from waylay.sdk.client import WaylayClient
from waylay.sdk.api.api_exceptions import ApiError

# Intialize a waylay client instance
waylay_client = WaylayClient.from_profile()

# Note that the typed model classes for responses/parameters/... are only available when `waylay-sdk-registry-types` is installed
from waylay.services.registry.models.get_model_response_v2 import GetModelResponseV2
from waylay.services.registry.models.update_metadata_request_v2 import UpdateMetadataRequestV2
try:
    # Patch Model Metadata
    # calls `PATCH /registry/v2/models/{name}/versions/{version}/metadata`
    api_response = await waylay_client.registry.models.patch_metadata(
        'name_example', # name | path param "name"
        'version_example', # version | path param "version"
        # query parameters:
        query = {
            'showTags': 'embed'
        },
        # json data: use a generated model or a json-serializable python data structure (dict, list)
        json = waylay.services.registry.UpdateMetadataRequestV2() # UpdateMetadataRequestV2 |  (optional)
    )
    print("The response of registry.models.patch_metadata:\n")
    pprint(api_response)
except ApiError as e:
    print("Exception when calling registry.models.patch_metadata: %s\n" % e)

Endpoint

PATCH /registry/v2/models/{name}/versions/{version}/metadata

Parameters

Name Type API binding Description Notes
name str path parameter "name" The name of the function.
version str path parameter "version" The version of the function.
json UpdateMetadataRequestV2 json request body [optional]
query QueryParamTypes | None URL query parameter
query['comment'] (dict)
query.comment (Query)
str query parameter "comment" An optional user-specified comment corresponding to the operation. [optional]
query['showTags'] (dict)
query.show_tags (Query)
ShowInlineOrEmbedding query parameter "showTags" Instructs how tag (objects) should be rendered in responses. The tags are show at the `tags` property of the manifest (legacy: the `metadata.tags` property) - `inline`: Show full tag objects in the manifest. - `embed`: Show tag references in the manifest. Referenced full tag objects are included in a separate `_embedded` HAL section. - `none`: Show tag references in the manifest. Do not render tag objects. The default behaviour depends on deployment settings. [optional]
headers HeaderTypes request headers

Return type

Selected path param Raw response param Return Type Description Links
Literal[""] (default) False (default) GetModelResponseV2 GetModelResponseV2
str False (default) Any If any other string value for the selected path is provided, the exact type of the response will only be known at runtime.
/ True Response The raw http response object.

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Default Response -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

protect

protect( name: str, version: str, query: ProtectQuery, headers ) -> GetModelResponseV2

Protect Model Version

Enable/disable protection for a model version. Enabling protection requires ownership for draft versions.

Example

from pprint import pprint

# Import the waylay-client from the waylay-sdk-core package
from waylay.sdk.client import WaylayClient
from waylay.sdk.api.api_exceptions import ApiError

# Intialize a waylay client instance
waylay_client = WaylayClient.from_profile()

# Note that the typed model classes for responses/parameters/... are only available when `waylay-sdk-registry-types` is installed
from waylay.services.registry.models.get_model_response_v2 import GetModelResponseV2
try:
    # Protect Model Version
    # calls `POST /registry/v2/models/{name}/versions/{version}/protect`
    api_response = await waylay_client.registry.models.protect(
        'name_example', # name | path param "name"
        'version_example', # version | path param "version"
        # query parameters:
        query = {
            'chown': False
            'showTags': 'embed'
            'enable': True
        },
    )
    print("The response of registry.models.protect:\n")
    pprint(api_response)
except ApiError as e:
    print("Exception when calling registry.models.protect: %s\n" % e)

Endpoint

POST /registry/v2/models/{name}/versions/{version}/protect

Parameters

Name Type API binding Description Notes
name str path parameter "name" The name of the function.
version str path parameter "version" The version of the function.
query QueryParamTypes | None URL query parameter
query['author'] (dict)
query.author (Query)
str query parameter "author" Optionally changes the author metadata when updating a function. [optional]
query['chown'] (dict)
query.chown (Query)
bool query parameter "chown" If set, ownership of a draft function is transferred to the current user. [optional] [default False]
query['comment'] (dict)
query.comment (Query)
str query parameter "comment" An optional user-specified comment corresponding to the operation. [optional]
query['showTags'] (dict)
query.show_tags (Query)
ShowInlineOrEmbedding query parameter "showTags" Instructs how tag (objects) should be rendered in responses. The tags are show at the `tags` property of the manifest (legacy: the `metadata.tags` property) - `inline`: Show full tag objects in the manifest. - `embed`: Show tag references in the manifest. Referenced full tag objects are included in a separate `_embedded` HAL section. - `none`: Show tag references in the manifest. Do not render tag objects. The default behaviour depends on deployment settings. [optional]
query['enable'] (dict)
query.enable (Query)
bool query parameter "enable" If set to `true`, the function assets (including its code) will be protected by requiring additional permissions. If set to `false`, the function assets will no longer be protected. [optional] [default True]
headers HeaderTypes request headers

Return type

Selected path param Raw response param Return Type Description Links
Literal[""] (default) False (default) GetModelResponseV2 GetModelResponseV2
str False (default) Any If any other string value for the selected path is provided, the exact type of the response will only be known at runtime.
/ True Response The raw http response object.

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Default Response -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

protect_versions

protect_versions( name: str, query: ProtectVersionsQuery, headers ) -> ProtectByNameResponseV2

Protect Model

Enable/disable protection for all model versions. Enabling protection requires ownership for draft versions.

Example

from pprint import pprint

# Import the waylay-client from the waylay-sdk-core package
from waylay.sdk.client import WaylayClient
from waylay.sdk.api.api_exceptions import ApiError

# Intialize a waylay client instance
waylay_client = WaylayClient.from_profile()

# Note that the typed model classes for responses/parameters/... are only available when `waylay-sdk-registry-types` is installed
from waylay.services.registry.models.protect_by_name_response_v2 import ProtectByNameResponseV2
try:
    # Protect Model
    # calls `POST /registry/v2/models/{name}/protect`
    api_response = await waylay_client.registry.models.protect_versions(
        'name_example', # name | path param "name"
        # query parameters:
        query = {
            'chown': False
            'showTags': 'embed'
            'enable': True
        },
    )
    print("The response of registry.models.protect_versions:\n")
    pprint(api_response)
except ApiError as e:
    print("Exception when calling registry.models.protect_versions: %s\n" % e)

Endpoint

POST /registry/v2/models/{name}/protect

Parameters

Name Type API binding Description Notes
name str path parameter "name" The name of the function.
query QueryParamTypes | None URL query parameter
query['author'] (dict)
query.author (Query)
str query parameter "author" Optionally changes the author metadata when updating a function. [optional]
query['chown'] (dict)
query.chown (Query)
bool query parameter "chown" If set, ownership of a draft function is transferred to the current user. [optional] [default False]
query['comment'] (dict)
query.comment (Query)
str query parameter "comment" An optional user-specified comment corresponding to the operation. [optional]
query['showTags'] (dict)
query.show_tags (Query)
ShowInlineOrEmbedding query parameter "showTags" Instructs how tag (objects) should be rendered in responses. The tags are show at the `tags` property of the manifest (legacy: the `metadata.tags` property) - `inline`: Show full tag objects in the manifest. - `embed`: Show tag references in the manifest. Referenced full tag objects are included in a separate `_embedded` HAL section. - `none`: Show tag references in the manifest. Do not render tag objects. The default behaviour depends on deployment settings. [optional]
query['enable'] (dict)
query.enable (Query)
bool query parameter "enable" If set to `true`, the function assets (including its code) will be protected by requiring additional permissions. If set to `false`, the function assets will no longer be protected. [optional] [default True]
headers HeaderTypes request headers

Return type

Selected path param Raw response param Return Type Description Links
Literal[""] (default) False (default) ProtectByNameResponseV2 ProtectByNameResponseV2
str False (default) Any If any other string value for the selected path is provided, the exact type of the response will only be known at runtime.
/ True Response The raw http response object.

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Default Response -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

publish

publish( name: str, version: str, query: PublishQuery, headers ) -> PostModelJobSyncResponseV2 | PostModelJobAsyncResponseV2

Publish Draft Model

Mark the model to be ready and stable, taking it out of draft mode., Typically, the model should be in the running status, such that publishing becomes a simple operation where the existing deployment can be re-used. In other statuses, plug-registry may need to initiate a new build and deployment procedure.

Example

from pprint import pprint

# Import the waylay-client from the waylay-sdk-core package
from waylay.sdk.client import WaylayClient
from waylay.sdk.api.api_exceptions import ApiError

# Intialize a waylay client instance
waylay_client = WaylayClient.from_profile()

# Note that the typed model classes for responses/parameters/... are only available when `waylay-sdk-registry-types` is installed
from waylay.services.registry.models.post_model_job_sync_response_v2 import PostModelJobSyncResponseV2
try:
    # Publish Draft Model
    # calls `POST /registry/v2/models/{name}/versions/{version}/publish`
    api_response = await waylay_client.registry.models.publish(
        'name_example', # name | path param "name"
        'version_example', # version | path param "version"
        # query parameters:
        query = {
            'chown': False
            'deprecatePrevious': waylay.services.registry.DeprecatePreviousPolicy()
            'async': True
        },
    )
    print("The response of registry.models.publish:\n")
    pprint(api_response)
except ApiError as e:
    print("Exception when calling registry.models.publish: %s\n" % e)

Endpoint

POST /registry/v2/models/{name}/versions/{version}/publish

Parameters

Name Type API binding Description Notes
name str path parameter "name" The name of the function.
version str path parameter "version" The version of the function.
query QueryParamTypes | None URL query parameter
query['chown'] (dict)
query.chown (Query)
bool query parameter "chown" If set, ownership of a draft function is transferred to the current user. [optional] [default False]
query['comment'] (dict)
query.comment (Query)
str query parameter "comment" An optional user-specified comment corresponding to the operation. [optional]
query['author'] (dict)
query.author (Query)
str query parameter "author" Optionally changes the author metadata when updating a function. [optional]
query['deprecatePrevious'] (dict)
query.deprecate_previous (Query)
DeprecatePreviousPolicy query parameter "deprecatePrevious" Set the cleanup policy used to automatically deprecate/delete previous versions. [optional]
query['async'] (dict)
query.var_async (Query)
bool query parameter "async" Unless this is set to <code>false</code>, the server will start the required job actions asynchronously and return a <code>202</code> <em>Accepted</em> response. If <code>false</code> the request will block until the job actions are completed, or a timeout occurs. [optional] [default True]
headers HeaderTypes request headers

Return type

Selected path param Raw response param Return Type Description Links
Literal[""] (default) False (default) PostModelJobSyncResponseV2 | PostModelJobAsyncResponseV2 PostModelJobSyncResponseV2
PostModelJobAsyncResponseV2
str False (default) Any If any other string value for the selected path is provided, the exact type of the response will only be known at runtime.
/ True Response The raw http response object.

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
201 Model Published -
202 Model Published And Deploy Initiated -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

rebuild

rebuild( name: str, version: str, query: RebuildQuery, headers ) -> RebuildModelSyncResponseV2 | RebuildModelAsyncResponseV2

Rebuild Model

Rebuild and deploy a model with the original or updated base image.

Example

from pprint import pprint

# Import the waylay-client from the waylay-sdk-core package
from waylay.sdk.client import WaylayClient
from waylay.sdk.api.api_exceptions import ApiError

# Intialize a waylay client instance
waylay_client = WaylayClient.from_profile()

# Note that the typed model classes for responses/parameters/... are only available when `waylay-sdk-registry-types` is installed
from waylay.services.registry.models.rebuild_model_sync_response_v2 import RebuildModelSyncResponseV2
from waylay.services.registry.models.rebuild_policy import RebuildPolicy
from waylay.services.registry.models.rebuild_request_v2 import RebuildRequestV2
try:
    # Rebuild Model
    # calls `POST /registry/v2/models/{name}/versions/{version}/rebuild`
    api_response = await waylay_client.registry.models.rebuild(
        'name_example', # name | path param "name"
        'version_example', # version | path param "version"
        # query parameters:
        query = {
            'scaleToZero': True
            'dryRun': True
            'async': True
            'showTags': 'embed'
            'upgrade': 'patch'
            'ignoreChecks': True
            'skipRebuild': True
            'skipVerify': False
        },
        # json data: use a generated model or a json-serializable python data structure (dict, list)
        json = waylay.services.registry.RebuildRequestV2() # RebuildRequestV2 |  (optional)
    )
    print("The response of registry.models.rebuild:\n")
    pprint(api_response)
except ApiError as e:
    print("Exception when calling registry.models.rebuild: %s\n" % e)

Endpoint

POST /registry/v2/models/{name}/versions/{version}/rebuild

Parameters

Name Type API binding Description Notes
name str path parameter "name" The name of the function.
version str path parameter "version" The version of the function.
json RebuildRequestV2 json request body [optional]
query QueryParamTypes | None URL query parameter
query['scaleToZero'] (dict)
query.scale_to_zero (Query)
bool query parameter "scaleToZero" Indicates whether the function needs to be scaled down after successful verification. If not set, the function is scaled to zero only if it was not active before this command. [optional]
query['comment'] (dict)
query.comment (Query)
str query parameter "comment" An optional user-specified comment corresponding to the operation. [optional]
query['dryRun'] (dict)
query.dry_run (Query)
bool query parameter "dryRun" If set to <code>true</code>, checks whether rebuild jobs are needed, but do not start any jobs. [optional]
query['async'] (dict)
query.var_async (Query)
bool query parameter "async" Unless this is set to <code>false</code>, the server will start the required job actions asynchronously and return a <code>202</code> <em>Accepted</em> response. If <code>false</code> the request will block until the job actions are completed, or a timeout occurs. [optional] [default True]
query['showTags'] (dict)
query.show_tags (Query)
ShowInlineOrEmbedding query parameter "showTags" Instructs how tag (objects) should be rendered in responses. The tags are show at the `tags` property of the manifest (legacy: the `metadata.tags` property) - `inline`: Show full tag objects in the manifest. - `embed`: Show tag references in the manifest. Referenced full tag objects are included in a separate `_embedded` HAL section. - `none`: Show tag references in the manifest. Do not render tag objects. The default behaviour depends on deployment settings. [optional]
query['upgrade'] (dict)
query.upgrade (Query)
RebuildPolicy query parameter "upgrade" If set, force a rebuild with the given <em>runtime</em> version selection policy. <ul> <li><code>same</code> <b>patch</b> version. This should only include backward compatible upgrades. </li> <li><code>minor</code> <b>major</b> version. This might include an upgrade of e.g. the language runtime and/or provided dependencies that could break compatiblity with the function. .</li> </ul> [optional]
query['forceVersion'] (dict)
query.force_version (Query)
str query parameter "forceVersion" If set, force a rebuild with the given runtime version (including downgrades). This parameter is mutually exclusive to the `upgrade` parameter. [optional]
query['ignoreChecks'] (dict)
query.ignore_checks (Query)
bool query parameter "ignoreChecks" If set to true, checks that normally prevent a rebuild are overriden. These checks include: * function state in `pending`, `running`, `failed` or `undeployed` * backoff period due to recent failures * usage of deprecated dependencies * running jobs on entity * the `dryRun` option [optional]
query['skipRebuild'] (dict)
query.skip_rebuild (Query)
bool query parameter "skipRebuild" If set, the function will not be rebuild. Always uses the current runtime version when re-deploying/re-verifying the function. [optional]
query['skipVerify'] (dict)
query.skip_verify (Query)
bool query parameter "skipVerify" If set, the function will not be validated: it transitions to `running` without verification of it's deployment health. When a `scaleToZero` is requested or implied, it is executed at the end of the deployment job, rather than as a separate job. [optional] [default False]
headers HeaderTypes request headers

Return type

Selected path param Raw response param Return Type Description Links
Literal[""] (default) False (default) RebuildModelSyncResponseV2 | RebuildModelAsyncResponseV2 RebuildModelSyncResponseV2
RebuildModelAsyncResponseV2
str False (default) Any If any other string value for the selected path is provided, the exact type of the response will only be known at runtime.
/ True Response The raw http response object.

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Default Response -
202 Default Response -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

remove_version

remove_version( name: str, version: str, query: RemoveVersionQuery, headers ) -> UndeployedResponseV2 | UndeploySubmittedResponseV2

Remove Model Version

Deprecate, undeploy and/or remove a model version. By default, a DELETE * deprecates the model version(s): they are no longer included in listings by default. * undeploys the model version(s) with delay: the function can no longer be invoked, the small delay allows other services to discover the removal. * removes the version(s) from the plug registry. Use ?force=true to immediately undeploy and remove without delay. Use ?undeploy=true to undeploy, but keep the model version registered in a undeployed state. An undeployed version can later be restored by a rebuild action.

Example

from pprint import pprint

# Import the waylay-client from the waylay-sdk-core package
from waylay.sdk.client import WaylayClient
from waylay.sdk.api.api_exceptions import ApiError

# Intialize a waylay client instance
waylay_client = WaylayClient.from_profile()

# Note that the typed model classes for responses/parameters/... are only available when `waylay-sdk-registry-types` is installed
from waylay.services.registry.models.undeployed_response_v2 import UndeployedResponseV2
try:
    # Remove Model Version
    # calls `DELETE /registry/v2/models/{name}/versions/{version}`
    api_response = await waylay_client.registry.models.remove_version(
        'name_example', # name | path param "name"
        'version_example', # version | path param "version"
        # query parameters:
        query = {
            'async': True
            'force': True
            'undeploy': True
            'reset': True
        },
    )
    print("The response of registry.models.remove_version:\n")
    pprint(api_response)
except ApiError as e:
    print("Exception when calling registry.models.remove_version: %s\n" % e)

Endpoint

DELETE /registry/v2/models/{name}/versions/{version}

Parameters

Name Type API binding Description Notes
name str path parameter "name" The name of the function.
version str path parameter "version" The version of the function.
query QueryParamTypes | None URL query parameter
query['comment'] (dict)
query.comment (Query)
str query parameter "comment" An optional user-specified comment corresponding to the operation. [optional]
query['async'] (dict)
query.var_async (Query)
bool query parameter "async" Unless this is set to <code>false</code>, the server will start the required job actions asynchronously and return a <code>202</code> <em>Accepted</em> response. If <code>false</code> the request will block until the job actions are completed, or a timeout occurs. [optional] [default True]
query['force'] (dict)
query.force (Query)
bool query parameter "force" If <code>true</code>, the function version will be immediately undeployed and removed. Otherwise, the removal will be delayed to allow current invocations to end. During that period, the function is marked deprecated. [optional]
query['undeploy'] (dict)
query.undeploy (Query)
bool query parameter "undeploy" If `true`, the `DELETE` operation * undeploys the (openfaas) function: it becomes no longer available for invocation. * does NOT remove the function from registry: it stays in an `undeployed` status. All assets and definitions are retained, so the version can be restored later with a rebuild action. If `false`, the `DELETE` operation * only marks the plug function as deprecated, the function remains active but is removed from the default listings. This also applies to draft versions. Setting this parameter is incompatible with `force=true` or `reset=true`. If not set the default behaviour applies: * draft versions are undeployed and removed from registry. * non-draft versions are marked deprecated only. [optional]
query['reset'] (dict)
query.reset (Query)
bool query parameter "reset" If `true`, the function version will be immediately undeployed and reset to `registered` state as a draft. This is incompatible with `force=true` or `undeploy=false`. [optional]
headers HeaderTypes request headers

Return type

Selected path param Raw response param Return Type Description Links
Literal[""] (default) False (default) UndeployedResponseV2 | UndeploySubmittedResponseV2 UndeployedResponseV2
UndeploySubmittedResponseV2
str False (default) Any If any other string value for the selected path is provided, the exact type of the response will only be known at runtime.
/ True Response The raw http response object.

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Default Response -
202 Default Response -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

remove_versions

remove_versions( name: str, query: RemoveVersionsQuery, headers ) -> UndeployedResponseV2 | UndeploySubmittedResponseV2

Remove Model

Deprecate, undeploy and/or remove all versions of this named model. By default, a DELETE * deprecates the model version(s): they are no longer included in listings by default. * undeploys the model version(s) with delay: the function can no longer be invoked, the small delay allows other services to discover the removal. * removes the version(s) from the plug registry. Use ?force=true to immediately undeploy and remove without delay. Use ?undeploy=true to undeploy, but keep the model version registered in a undeployed state. An undeployed version can later be restored by a rebuild action.

Example

from pprint import pprint

# Import the waylay-client from the waylay-sdk-core package
from waylay.sdk.client import WaylayClient
from waylay.sdk.api.api_exceptions import ApiError

# Intialize a waylay client instance
waylay_client = WaylayClient.from_profile()

# Note that the typed model classes for responses/parameters/... are only available when `waylay-sdk-registry-types` is installed
from waylay.services.registry.models.undeployed_response_v2 import UndeployedResponseV2
try:
    # Remove Model
    # calls `DELETE /registry/v2/models/{name}`
    api_response = await waylay_client.registry.models.remove_versions(
        'name_example', # name | path param "name"
        # query parameters:
        query = {
            'force': True
            'undeploy': True
            'reset': True
            'async': True
        },
    )
    print("The response of registry.models.remove_versions:\n")
    pprint(api_response)
except ApiError as e:
    print("Exception when calling registry.models.remove_versions: %s\n" % e)

Endpoint

DELETE /registry/v2/models/{name}

Parameters

Name Type API binding Description Notes
name str path parameter "name" The name of the function.
query QueryParamTypes | None URL query parameter
query['comment'] (dict)
query.comment (Query)
str query parameter "comment" An optional user-specified comment corresponding to the operation. [optional]
query['force'] (dict)
query.force (Query)
bool query parameter "force" If <code>true</code>, the function version will be immediately undeployed and removed. Otherwise, the removal will be delayed to allow current invocations to end. During that period, the function is marked deprecated. [optional]
query['undeploy'] (dict)
query.undeploy (Query)
bool query parameter "undeploy" If `true`, the `DELETE` operation * undeploys the (openfaas) function: it becomes no longer available for invocation. * does NOT remove the function from registry: it stays in an `undeployed` status. All assets and definitions are retained, so the version can be restored later with a rebuild action. If `false`, the `DELETE` operation * only marks the plug function as deprecated, the function remains active but is removed from the default listings. This also applies to draft versions. Setting this parameter is incompatible with `force=true` or `reset=true`. If not set the default behaviour applies: * draft versions are undeployed and removed from registry. * non-draft versions are marked deprecated only. [optional]
query['reset'] (dict)
query.reset (Query)
bool query parameter "reset" If `true`, the function version will be immediately undeployed and reset to `registered` state as a draft. This is incompatible with `force=true` or `undeploy=false`. [optional]
query['async'] (dict)
query.var_async (Query)
bool query parameter "async" Unless this is set to <code>false</code>, the server will start the required job actions asynchronously and return a <code>202</code> <em>Accepted</em> response. If <code>false</code> the request will block until the job actions are completed, or a timeout occurs. [optional] [default True]
headers HeaderTypes request headers

Return type

Selected path param Raw response param Return Type Description Links
Literal[""] (default) False (default) UndeployedResponseV2 | UndeploySubmittedResponseV2 UndeployedResponseV2
UndeploySubmittedResponseV2
str False (default) Any If any other string value for the selected path is provided, the exact type of the response will only be known at runtime.
/ True Response The raw http response object.

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Default Response -
202 Default Response -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

update_asset

update_asset( name: str, version: str, wildcard: str, query: UpdateAssetQuery, headers ) -> PostModelJobSyncResponseV2 | PostModelJobAsyncResponseV2

Update Model Asset

The provided asset will be added to the model function's collection of existing assets, replacing any existing asset with the same name. Please note that it is not allowed to update the model.json json file with a changed value for any of the name, version and/or runtime attributes. For each runtime other files are supported.

Example

from pprint import pprint

# Import the waylay-client from the waylay-sdk-core package
from waylay.sdk.client import WaylayClient
from waylay.sdk.api.api_exceptions import ApiError

# Intialize a waylay client instance
waylay_client = WaylayClient.from_profile()

# Note that the typed model classes for responses/parameters/... are only available when `waylay-sdk-registry-types` is installed
from waylay.services.registry.models.file_upload import FileUpload
from waylay.services.registry.models.post_model_job_sync_response_v2 import PostModelJobSyncResponseV2
try:
    # Update Model Asset
    # calls `PUT /registry/v2/models/{name}/versions/{version}/content/{wildcard}`
    api_response = await waylay_client.registry.models.update_asset(
        'name_example', # name | path param "name"
        'version_example', # version | path param "version"
        'wildcard_example', # wildcard | path param "wildcard"
        # query parameters:
        query = {
            'scaleToZero': False
            'deploy': True
            'chown': False
            'async': True
        },
        # non-json binary data: use a byte array or a generator of bytearray chuncks
        content=b'my-binary-data',
        # this operation supports multiple request content types: use `headers` to specify the one used
        # alternatives: 
        headers = {
            'content-type': 'application/octet-stream'
        },
    )
    print("The response of registry.models.update_asset:\n")
    pprint(api_response)
except ApiError as e:
    print("Exception when calling registry.models.update_asset: %s\n" % e)

Endpoint

PUT /registry/v2/models/{name}/versions/{version}/content/{wildcard}

Parameters

Name Type API binding Description Notes
name str path parameter "name" The name of the function.
version str path parameter "version" The version of the function.
wildcard str path parameter "wildcard" Full path or path prefix of the asset within the archive
content ContentRequest binary request body A single asset file. [optional]
query QueryParamTypes | None URL query parameter
query['scaleToZero'] (dict)
query.scale_to_zero (Query)
bool query parameter "scaleToZero" If set to <code>true</code>, after successful deployment, the deployed function will be scaled to zero. This saves computing resources when the function is not to be used immediately. [optional] [default False]
query['deploy'] (dict)
query.deploy (Query)
bool query parameter "deploy" Indicates that a function should be deployed when its assets are valid. * If `true` (default), jobs to build and deploy the function will be initiated after it is checked that the assets are valid. Invalid assets lead to a validation error, and the function and its assets are not created or updated. * If `false`, the uploaded assets are stored and the function is created/updated in `registered` state. Asset validation errors are only returned as warning, and stored as `failureReason` on the function entity. Use an asset update or rebuild to initiate a build and deploy at a later stage. [optional] [default True]
query['chown'] (dict)
query.chown (Query)
bool query parameter "chown" If set, ownership of a draft function is transferred to the current user. [optional] [default False]
query['comment'] (dict)
query.comment (Query)
str query parameter "comment" An optional user-specified comment corresponding to the operation. [optional]
query['author'] (dict)
query.author (Query)
str query parameter "author" Optionally changes the author metadata when updating a function. [optional]
query['async'] (dict)
query.var_async (Query)
bool query parameter "async" Unless this is set to <code>false</code>, the server will start the required job actions asynchronously and return a <code>202</code> <em>Accepted</em> response. If <code>false</code> the request will block until the job actions are completed, or a timeout occurs. [optional] [default True]
headers HeaderTypes request headers
headers['content-type'] str content type request header "content-type" should match mediaType

Return type

Selected path param Raw response param Return Type Description Links
Literal[""] (default) False (default) PostModelJobSyncResponseV2 | PostModelJobAsyncResponseV2 PostModelJobSyncResponseV2
PostModelJobAsyncResponseV2
str False (default) Any If any other string value for the selected path is provided, the exact type of the response will only be known at runtime.
/ True Response The raw http response object.

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
201 Default Response -
202 Default Response -
403 Default Response -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

update_assets

update_assets( name: str, version: str, query: UpdateAssetsQuery, files, headers ) -> PostModelJobSyncResponseV2 | PostModelJobAsyncResponseV2

Update Model Assets

Update a draft model function by updating its assets. The assets for a model function can be provided as either

  • a single tar archive (optionally compressed), with one of the content types application/octet-stream, application/tar, application/tar+gzip, application/x-gzip, application/x-tar, application/gzip
  • separate files in a multipart/form-data request
The provided assets will be added to the model function's collection of existing assets, replacing any existing assets with the same name. Please note that it is not allowed to update the model.json json file with a changed value for any of the name, version and/or runtime attributes. For each runtime other files are supported.

Example

from pprint import pprint

# Import the waylay-client from the waylay-sdk-core package
from waylay.sdk.client import WaylayClient
from waylay.sdk.api.api_exceptions import ApiError

# Intialize a waylay client instance
waylay_client = WaylayClient.from_profile()

# Note that the typed model classes for responses/parameters/... are only available when `waylay-sdk-registry-types` is installed
from waylay.services.registry.models.post_model_job_sync_response_v2 import PostModelJobSyncResponseV2
try:
    # Update Model Assets
    # calls `PUT /registry/v2/models/{name}/versions/{version}/content`
    api_response = await waylay_client.registry.models.update_assets(
        'name_example', # name | path param "name"
        'version_example', # version | path param "version"
        # query parameters:
        query = {
            'scaleToZero': False
            'deploy': True
            'chown': False
            'async': True
        },
        # non-json binary data: use a byte array or a generator of bytearray chuncks
        content=b'my-binary-data',
        # this operation supports multiple request content types: use `headers` to specify the one used
        # alternatives: 'application/tar', 'application/tar+gzip', 'application/x-gzip', 'application/x-tar', 'application/gzip', 'multipart/form-data', 
        headers = {
            'content-type': 'application/octet-stream'
        },
    )
    print("The response of registry.models.update_assets:\n")
    pprint(api_response)
except ApiError as e:
    print("Exception when calling registry.models.update_assets: %s\n" % e)

Endpoint

PUT /registry/v2/models/{name}/versions/{version}/content

Parameters

Name Type API binding Description Notes
name str path parameter "name" The name of the function.
version str path parameter "version" The version of the function.
content ContentRequest binary request body The assets for a <em>model</em> function can be provided as either <ul> <li>a single <em>tar</em> archive (optionally compressed), with one of the content types <code>application/octet-stream</code>, <code>application/tar</code>, <code>application/tar+gzip</code>, <code>application/x-gzip</code>, <code>application/x-tar</code>, <code>application/gzip</code></li> <li>separate files in a <code>multipart/form-data</code> request</li> </ul> The provided assets will be added to the <em>model</em> function's collection of existing assets, replacing any existing assets with the same name. Please note that it is not allowed to update the model.json</code> json file with a changed value for any of the <code>name</code>, <code>version</code> and/or <code>runtime</code> attributes. For each <em>runtime</em> other files are supported. [optional]
files FileTypes request body files
query QueryParamTypes | None URL query parameter
query['scaleToZero'] (dict)
query.scale_to_zero (Query)
bool query parameter "scaleToZero" If set to <code>true</code>, after successful deployment, the deployed function will be scaled to zero. This saves computing resources when the function is not to be used immediately. [optional] [default False]
query['deploy'] (dict)
query.deploy (Query)
bool query parameter "deploy" Indicates that a function should be deployed when its assets are valid. * If `true` (default), jobs to build and deploy the function will be initiated after it is checked that the assets are valid. Invalid assets lead to a validation error, and the function and its assets are not created or updated. * If `false`, the uploaded assets are stored and the function is created/updated in `registered` state. Asset validation errors are only returned as warning, and stored as `failureReason` on the function entity. Use an asset update or rebuild to initiate a build and deploy at a later stage. [optional] [default True]
query['chown'] (dict)
query.chown (Query)
bool query parameter "chown" If set, ownership of a draft function is transferred to the current user. [optional] [default False]
query['comment'] (dict)
query.comment (Query)
str query parameter "comment" An optional user-specified comment corresponding to the operation. [optional]
query['author'] (dict)
query.author (Query)
str query parameter "author" Optionally changes the author metadata when updating a function. [optional]
query['async'] (dict)
query.var_async (Query)
bool query parameter "async" Unless this is set to <code>false</code>, the server will start the required job actions asynchronously and return a <code>202</code> <em>Accepted</em> response. If <code>false</code> the request will block until the job actions are completed, or a timeout occurs. [optional] [default True]
headers HeaderTypes request headers
headers['content-type'] str content type request header "content-type" should match mediaType application/octet-stream, application/tar, application/tar+gzip, application/x-gzip, application/x-tar, application/gzip, multipart/form-data

Return type

Selected path param Raw response param Return Type Description Links
Literal[""] (default) False (default) PostModelJobSyncResponseV2 | PostModelJobAsyncResponseV2 PostModelJobSyncResponseV2
PostModelJobAsyncResponseV2
str False (default) Any If any other string value for the selected path is provided, the exact type of the response will only be known at runtime.
/ True Response The raw http response object.

HTTP request headers

  • Content-Type: application/octet-stream, application/tar, application/tar+gzip, application/x-gzip, application/x-tar, application/gzip, multipart/form-data
  • Accept: application/json

HTTP response details

Status code Description Response headers
201 Default Response -
202 Default Response -
403 Default Response -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

verify

verify( name: str, version: str, query: VerifyQuery, headers ) -> VerifyModelSyncResponseV2 | PostModelJobAsyncResponseV2

Verify Health Of Model

Verify health of model deployed on openfaas.

Example

from pprint import pprint

# Import the waylay-client from the waylay-sdk-core package
from waylay.sdk.client import WaylayClient
from waylay.sdk.api.api_exceptions import ApiError

# Intialize a waylay client instance
waylay_client = WaylayClient.from_profile()

# Note that the typed model classes for responses/parameters/... are only available when `waylay-sdk-registry-types` is installed
from waylay.services.registry.models.verify_model_sync_response_v2 import VerifyModelSyncResponseV2
try:
    # Verify Health Of Model
    # calls `POST /registry/v2/models/{name}/versions/{version}/verify`
    api_response = await waylay_client.registry.models.verify(
        'name_example', # name | path param "name"
        'version_example', # version | path param "version"
        # query parameters:
        query = {
            'scaleToZero': True
            'showTags': 'embed'
            'async': True
        },
    )
    print("The response of registry.models.verify:\n")
    pprint(api_response)
except ApiError as e:
    print("Exception when calling registry.models.verify: %s\n" % e)

Endpoint

POST /registry/v2/models/{name}/versions/{version}/verify

Parameters

Name Type API binding Description Notes
name str path parameter "name" The name of the function.
version str path parameter "version" The version of the function.
query QueryParamTypes | None URL query parameter
query['scaleToZero'] (dict)
query.scale_to_zero (Query)
bool query parameter "scaleToZero" Indicates whether the function needs to be scaled down after successful verification. If not set, the function is scaled to zero only if it was not active before this command. [optional]
query['showTags'] (dict)
query.show_tags (Query)
ShowInlineOrEmbedding query parameter "showTags" Instructs how tag (objects) should be rendered in responses. The tags are show at the `tags` property of the manifest (legacy: the `metadata.tags` property) - `inline`: Show full tag objects in the manifest. - `embed`: Show tag references in the manifest. Referenced full tag objects are included in a separate `_embedded` HAL section. - `none`: Show tag references in the manifest. Do not render tag objects. The default behaviour depends on deployment settings. [optional]
query['async'] (dict)
query.var_async (Query)
bool query parameter "async" Unless this is set to <code>false</code>, the server will start the required job actions asynchronously and return a <code>202</code> <em>Accepted</em> response. If <code>false</code> the request will block until the job actions are completed, or a timeout occurs. [optional] [default True]
headers HeaderTypes request headers

Return type

Selected path param Raw response param Return Type Description Links
Literal[""] (default) False (default) VerifyModelSyncResponseV2 | PostModelJobAsyncResponseV2 VerifyModelSyncResponseV2
PostModelJobAsyncResponseV2
str False (default) Any If any other string value for the selected path is provided, the exact type of the response will only be known at runtime.
/ True Response The raw http response object.

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Default Response -
202 Model Verification Initiated -

[Back to top] [Back to API list] [Back to Model list] [Back to README]