Skip to content

Latest commit

 

History

History
1705 lines (1379 loc) · 117 KB

WebscriptsApi.md

File metadata and controls

1705 lines (1379 loc) · 117 KB

waylay.services.registry.WebscriptsApi

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

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

create

create( query: CreateQuery, files, headers ) -> PostWebscriptJobSyncResponseV2 | PostWebscriptJobAsyncResponseV2

Create Webscript Version

Creates a new webscript function by uploading its assets. The assets for a webscript 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 webscript in the copy argument
The required webscript.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=webscripts). 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_webscript_job_sync_response_v2 import PostWebscriptJobSyncResponseV2
try:
    # Create Webscript Version
    # calls `POST /registry/v2/webscripts/`
    api_response = await waylay_client.registry.webscripts.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>webscript</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>webscript</em> in the <code>copy</code> argument</li>   </ul>    The required <code>webscript.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=webscripts</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.webscripts.create:\n")
    pprint(api_response)
except ApiError as e:
    print("Exception when calling registry.webscripts.create: %s\n" % e)

Endpoint

POST /registry/v2/webscripts/

Parameters

Name Type API binding Description Notes
json bytearray json request body The assets for a <em>webscript</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>webscript</em> in the <code>copy</code> argument</li> </ul> The required <code>webscript.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=webscripts</code>). For each <em>runtime</em> other files will be required or supported. [optional]
content ContentRequest binary request body The assets for a <em>webscript</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>webscript</em> in the <code>copy</code> argument</li> </ul> The required <code>webscript.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=webscripts</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) PostWebscriptJobSyncResponseV2 | PostWebscriptJobAsyncResponseV2 PostWebscriptJobSyncResponseV2
PostWebscriptJobAsyncResponseV2
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 ) -> PostWebscriptJobSyncResponseV2 | PostWebscriptJobAsyncResponseV2

Delete Webscript Asset

Delete an asset from the webscript'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_webscript_job_sync_response_v2 import PostWebscriptJobSyncResponseV2
try:
    # Delete Webscript Asset
    # calls `DELETE /registry/v2/webscripts/{name}/versions/{version}/content/{wildcard}`
    api_response = await waylay_client.registry.webscripts.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.webscripts.delete_asset:\n")
    pprint(api_response)
except ApiError as e:
    print("Exception when calling registry.webscripts.delete_asset: %s\n" % e)

Endpoint

DELETE /registry/v2/webscripts/{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) PostWebscriptJobSyncResponseV2 | PostWebscriptJobAsyncResponseV2 PostWebscriptJobSyncResponseV2
PostWebscriptJobAsyncResponseV2
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 Webscript Archive

Get the specification archive of a webscript.

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 Webscript Archive
    # calls `GET /registry/v2/webscripts/{name}/versions/{version}/content`
    api_response = await waylay_client.registry.webscripts.get_archive(
        'name_example', # name | path param "name"
        'version_example', # version | path param "version"
        # query parameters:
        query = {
            'ls': False
        },
    )
    print("The response of registry.webscripts.get_archive:\n")
    pprint(api_response)
except ApiError as e:
    print("Exception when calling registry.webscripts.get_archive: %s\n" % e)

Endpoint

GET /registry/v2/webscripts/{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 Webscript Archive

Get a file from the specification archive of a webscript.

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 Webscript Archive
    # calls `GET /registry/v2/webscripts/{name}/versions/{version}/content/{wildcard}`
    api_response = await waylay_client.registry.webscripts.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.webscripts.get_asset:\n")
    pprint(api_response)
except ApiError as e:
    print("Exception when calling registry.webscripts.get_asset: %s\n" % e)

Endpoint

GET /registry/v2/webscripts/{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 ) -> GetWebscriptResponseV2

Get Latest Webscript Version

Fetch the latest version of a webscript. 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 webscript 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_webscript_response_v2 import GetWebscriptResponseV2
try:
    # Get Latest Webscript Version
    # calls `GET /registry/v2/webscripts/{name}`
    api_response = await waylay_client.registry.webscripts.get_latest(
        'name_example', # name | path param "name"
        # query parameters:
        query = {
            'includeDraft': True
            'includeDeprecated': True
            'showTags': 'embed'
        },
    )
    print("The response of registry.webscripts.get_latest:\n")
    pprint(api_response)
except ApiError as e:
    print("Exception when calling registry.webscripts.get_latest: %s\n" % e)

Endpoint

GET /registry/v2/webscripts/{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['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['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) GetWebscriptResponseV2 GetWebscriptResponseV2
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 ) -> GetWebscriptResponseV2

Get Webscript Version

Get the webscript 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_webscript_response_v2 import GetWebscriptResponseV2
try:
    # Get Webscript Version
    # calls `GET /registry/v2/webscripts/{name}/versions/{version}`
    api_response = await waylay_client.registry.webscripts.get(
        'name_example', # name | path param "name"
        'version_example', # version | path param "version"
        # query parameters:
        query = {
            'showTags': 'embed'
        },
    )
    print("The response of registry.webscripts.get:\n")
    pprint(api_response)
except ApiError as e:
    print("Exception when calling registry.webscripts.get: %s\n" % e)

Endpoint

GET /registry/v2/webscripts/{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) GetWebscriptResponseV2 GetWebscriptResponseV2
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 ) -> JobsForWebscriptResponseV2

List Webscript Jobs

List the ongoing and completed operations on a specific webscript.

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_webscript_response_v2 import JobsForWebscriptResponseV2
try:
    # List Webscript Jobs
    # calls `GET /registry/v2/webscripts/{name}/versions/{version}/jobs`
    api_response = await waylay_client.registry.webscripts.jobs(
        'name_example', # name | path param "name"
        'version_example', # version | path param "version"
        # query parameters:
        query = {
        },
    )
    print("The response of registry.webscripts.jobs:\n")
    pprint(api_response)
except ApiError as e:
    print("Exception when calling registry.webscripts.jobs: %s\n" % e)

Endpoint

GET /registry/v2/webscripts/{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) JobsForWebscriptResponseV2 JobsForWebscriptResponseV2
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 ) -> WebscriptVersionsResponseV2

List Webscript Versions

List all deployed versions of a webscript.

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.status_filter import StatusFilter
from waylay.services.registry.models.webscript_versions_response_v2 import WebscriptVersionsResponseV2
try:
    # List Webscript Versions
    # calls `GET /registry/v2/webscripts/{name}/versions`
    api_response = await waylay_client.registry.webscripts.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.webscripts.list_versions:\n")
    pprint(api_response)
except ApiError as e:
    print("Exception when calling registry.webscripts.list_versions: %s\n" % e)

Endpoint

GET /registry/v2/webscripts/{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) WebscriptVersionsResponseV2 WebscriptVersionsResponseV2
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 ) -> LatestWebscriptsResponseV2

List Webscripts

List the (latest) versions of available webscripts. ### List Latest Webscript Versions By default, the result includes the latest non-deprecated, non-draft version for each webscript 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 webscript 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 Webscript Versions (with filter) When any of the version filter query parameters are used, the response contains the latest version per named webscript that satisfy the filters, but without links. ### List All Webscript Versions When using latest=false (default when using the namedVersion filter), the listing contains all webscripts versions that satisfy the query, possibly multiple versions per named webscripts. No HAL links are provided. #### Filter on status By default webscript 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 webscript 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_webscripts_response_v2 import LatestWebscriptsResponseV2
from waylay.services.registry.models.status_filter import StatusFilter
try:
    # List Webscripts
    # calls `GET /registry/v2/webscripts/`
    api_response = await waylay_client.registry.webscripts.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.webscripts.list:\n")
    pprint(api_response)
except ApiError as e:
    print("Exception when calling registry.webscripts.list: %s\n" % e)

Endpoint

GET /registry/v2/webscripts/

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) LatestWebscriptsResponseV2 LatestWebscriptsResponseV2
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 ) -> GetWebscriptResponseV2

Patch Webscript Metadata

Patch the metadata of a webscript 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_webscript_response_v2 import GetWebscriptResponseV2
from waylay.services.registry.models.update_metadata_request_v2 import UpdateMetadataRequestV2
try:
    # Patch Webscript Metadata
    # calls `PATCH /registry/v2/webscripts/{name}/versions/{version}/metadata`
    api_response = await waylay_client.registry.webscripts.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.webscripts.patch_metadata:\n")
    pprint(api_response)
except ApiError as e:
    print("Exception when calling registry.webscripts.patch_metadata: %s\n" % e)

Endpoint

PATCH /registry/v2/webscripts/{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) GetWebscriptResponseV2 GetWebscriptResponseV2
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_versions

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

Protect Webscript

Enable/disable protection for all webscript 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 Webscript
    # calls `POST /registry/v2/webscripts/{name}/protect`
    api_response = await waylay_client.registry.webscripts.protect_versions(
        'name_example', # name | path param "name"
        # query parameters:
        query = {
            'chown': False
            'showTags': 'embed'
            'enable': True
        },
    )
    print("The response of registry.webscripts.protect_versions:\n")
    pprint(api_response)
except ApiError as e:
    print("Exception when calling registry.webscripts.protect_versions: %s\n" % e)

Endpoint

POST /registry/v2/webscripts/{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]

protect

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

Protect Webscript Version

Enable/disable protection for a webscript 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_webscript_response_v2 import GetWebscriptResponseV2
try:
    # Protect Webscript Version
    # calls `POST /registry/v2/webscripts/{name}/versions/{version}/protect`
    api_response = await waylay_client.registry.webscripts.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.webscripts.protect:\n")
    pprint(api_response)
except ApiError as e:
    print("Exception when calling registry.webscripts.protect: %s\n" % e)

Endpoint

POST /registry/v2/webscripts/{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) GetWebscriptResponseV2 GetWebscriptResponseV2
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 ) -> PostWebscriptJobSyncResponseV2 | PostWebscriptJobAsyncResponseV2

Publish Draft Webscript

Mark the webscript to be ready and stable, taking it out of draft mode., Typically, the webscript 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_webscript_job_sync_response_v2 import PostWebscriptJobSyncResponseV2
try:
    # Publish Draft Webscript
    # calls `POST /registry/v2/webscripts/{name}/versions/{version}/publish`
    api_response = await waylay_client.registry.webscripts.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.webscripts.publish:\n")
    pprint(api_response)
except ApiError as e:
    print("Exception when calling registry.webscripts.publish: %s\n" % e)

Endpoint

POST /registry/v2/webscripts/{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) PostWebscriptJobSyncResponseV2 | PostWebscriptJobAsyncResponseV2 PostWebscriptJobSyncResponseV2
PostWebscriptJobAsyncResponseV2
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 Webscript Published -
202 Webscript 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 ) -> RebuildWebscriptSyncResponseV2 | RebuildWebscriptAsyncResponseV2

Rebuild Webscript

Rebuild and deploy a webscript 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_policy import RebuildPolicy
from waylay.services.registry.models.rebuild_request_v2 import RebuildRequestV2
from waylay.services.registry.models.rebuild_webscript_sync_response_v2 import RebuildWebscriptSyncResponseV2
try:
    # Rebuild Webscript
    # calls `POST /registry/v2/webscripts/{name}/versions/{version}/rebuild`
    api_response = await waylay_client.registry.webscripts.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.webscripts.rebuild:\n")
    pprint(api_response)
except ApiError as e:
    print("Exception when calling registry.webscripts.rebuild: %s\n" % e)

Endpoint

POST /registry/v2/webscripts/{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) RebuildWebscriptSyncResponseV2 | RebuildWebscriptAsyncResponseV2 RebuildWebscriptSyncResponseV2
RebuildWebscriptAsyncResponseV2
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 Webscript Version

Deprecate, undeploy and/or remove a webscript version. By default, a DELETE * deprecates the webscript version(s): they are no longer included in listings by default. * undeploys the webscript 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 webscript 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 Webscript Version
    # calls `DELETE /registry/v2/webscripts/{name}/versions/{version}`
    api_response = await waylay_client.registry.webscripts.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.webscripts.remove_version:\n")
    pprint(api_response)
except ApiError as e:
    print("Exception when calling registry.webscripts.remove_version: %s\n" % e)

Endpoint

DELETE /registry/v2/webscripts/{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 Webscript

Deprecate, undeploy and/or remove all versions of this named webscript. By default, a DELETE * deprecates the webscript version(s): they are no longer included in listings by default. * undeploys the webscript 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 webscript 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 Webscript
    # calls `DELETE /registry/v2/webscripts/{name}`
    api_response = await waylay_client.registry.webscripts.remove_versions(
        'name_example', # name | path param "name"
        # query parameters:
        query = {
            'async': True
            'force': True
            'undeploy': True
            'reset': True
        },
    )
    print("The response of registry.webscripts.remove_versions:\n")
    pprint(api_response)
except ApiError as e:
    print("Exception when calling registry.webscripts.remove_versions: %s\n" % e)

Endpoint

DELETE /registry/v2/webscripts/{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['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]

update_asset

update_asset( name: str, version: str, wildcard: str, query: UpdateAssetQuery, headers ) -> PostWebscriptJobSyncResponseV2 | PostWebscriptJobAsyncResponseV2

Update Webscript Asset

The provided asset will be added to the webscript function's collection of existing assets, replacing any existing asset with the same name. Please note that it is not allowed to update the webscript.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_webscript_job_sync_response_v2 import PostWebscriptJobSyncResponseV2
try:
    # Update Webscript Asset
    # calls `PUT /registry/v2/webscripts/{name}/versions/{version}/content/{wildcard}`
    api_response = await waylay_client.registry.webscripts.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.webscripts.update_asset:\n")
    pprint(api_response)
except ApiError as e:
    print("Exception when calling registry.webscripts.update_asset: %s\n" % e)

Endpoint

PUT /registry/v2/webscripts/{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) PostWebscriptJobSyncResponseV2 | PostWebscriptJobAsyncResponseV2 PostWebscriptJobSyncResponseV2
PostWebscriptJobAsyncResponseV2
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 ) -> PostWebscriptJobSyncResponseV2 | PostWebscriptJobAsyncResponseV2

Update Webscript Assets

Update a draft webscript function by updating its assets. The assets for a webscript 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 webscript function's collection of existing assets, replacing any existing assets with the same name. Please note that it is not allowed to update the webscript.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_webscript_job_sync_response_v2 import PostWebscriptJobSyncResponseV2
try:
    # Update Webscript Assets
    # calls `PUT /registry/v2/webscripts/{name}/versions/{version}/content`
    api_response = await waylay_client.registry.webscripts.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.webscripts.update_assets:\n")
    pprint(api_response)
except ApiError as e:
    print("Exception when calling registry.webscripts.update_assets: %s\n" % e)

Endpoint

PUT /registry/v2/webscripts/{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>webscript</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>webscript</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 webscript.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) PostWebscriptJobSyncResponseV2 | PostWebscriptJobAsyncResponseV2 PostWebscriptJobSyncResponseV2
PostWebscriptJobAsyncResponseV2
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 ) -> VerifyWebscriptSyncResponseV2 | PostWebscriptJobAsyncResponseV2

Verify Health Of Webscript

Verify health of webscript 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_webscript_sync_response_v2 import VerifyWebscriptSyncResponseV2
try:
    # Verify Health Of Webscript
    # calls `POST /registry/v2/webscripts/{name}/versions/{version}/verify`
    api_response = await waylay_client.registry.webscripts.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.webscripts.verify:\n")
    pprint(api_response)
except ApiError as e:
    print("Exception when calling registry.webscripts.verify: %s\n" % e)

Endpoint

POST /registry/v2/webscripts/{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) VerifyWebscriptSyncResponseV2 | PostWebscriptJobAsyncResponseV2 VerifyWebscriptSyncResponseV2
PostWebscriptJobAsyncResponseV2
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 Webscript Verification Initiated -

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