wallaroo.wallaroo_ml_ops_api_client.api.pipeline.pipelines_undeploy API documentation

# wallaroo.wallaroo_ml_ops_api_client.api.pipeline.pipelines_undeploy

View Source

      1from typing import Any, Dict, Optional, Union
      2
      3import httpx
      4
      5from ...client import Client
      6from ...models.pipelines_undeploy_json_body import PipelinesUndeployJsonBody
      7from ...models.pipelines_undeploy_response_200 import \
      8    PipelinesUndeployResponse200
      9from ...models.pipelines_undeploy_response_400 import \
     10    PipelinesUndeployResponse400
     11from ...models.pipelines_undeploy_response_401 import \
     12    PipelinesUndeployResponse401
     13from ...models.pipelines_undeploy_response_500 import \
     14    PipelinesUndeployResponse500
     15from ...types import Response
     16
     17
     18def _get_kwargs(
     19    *,
     20    client: Client,
     21    json_body: PipelinesUndeployJsonBody,
     22
     23) -> Dict[str, Any]:
     24    url = "{}/v1/api/pipelines/undeploy".format(
     25        client.base_url)
     26
     27    headers: Dict[str, str] = client.get_headers()
     28    cookies: Dict[str, Any] = client.get_cookies()
     29
     30
     31
     32
     33
     34
     35
     36    json_json_body = json_body.to_dict()
     37
     38
     39
     40
     41
     42    return {
     43	    "method": "post",
     44        "url": url,
     45        "headers": headers,
     46        "cookies": cookies,
     47        "timeout": client.get_timeout(),
     48        "json": json_json_body,
     49    }
     50
     51
     52def _parse_response(*, response: httpx.Response) -> Optional[Union[Optional[PipelinesUndeployResponse200], PipelinesUndeployResponse400, PipelinesUndeployResponse401, PipelinesUndeployResponse500]]:
     53    if response.status_code == 500:
     54        response_500 = PipelinesUndeployResponse500.from_dict(response.json())
     55
     56
     57
     58        return response_500
     59    if response.status_code == 400:
     60        response_400 = PipelinesUndeployResponse400.from_dict(response.json())
     61
     62
     63
     64        return response_400
     65    if response.status_code == 401:
     66        response_401 = PipelinesUndeployResponse401.from_dict(response.json())
     67
     68
     69
     70        return response_401
     71    if response.status_code == 200:
     72        _response_200 = response.json()
     73        response_200: Optional[PipelinesUndeployResponse200]
     74        if _response_200 is None:
     75            response_200 = None
     76        else:
     77            response_200 = PipelinesUndeployResponse200.from_dict(_response_200)
     78
     79
     80
     81        return response_200
     82    return None
     83
     84
     85def _build_response(*, response: httpx.Response) -> Response[Union[Optional[PipelinesUndeployResponse200], PipelinesUndeployResponse400, PipelinesUndeployResponse401, PipelinesUndeployResponse500]]:
     86    return Response(
     87        status_code=response.status_code,
     88        content=response.content,
     89        headers=response.headers,
     90        parsed=_parse_response(response=response),
     91    )
     92
     93
     94def sync_detailed(
     95    *,
     96    client: Client,
     97    json_body: PipelinesUndeployJsonBody,
     98
     99) -> Response[Union[Optional[PipelinesUndeployResponse200], PipelinesUndeployResponse400, PipelinesUndeployResponse401, PipelinesUndeployResponse500]]:
    100    """Undeploy pipeline
    101
    102     Undeploys a previously deployed pipeline.
    103
    104    Args:
    105        json_body (PipelinesUndeployJsonBody):  Request to undeploy a pipeline by either its own
    106            identifier,  or the deployment identifier.
    107
    108    Returns:
    109        Response[Union[Optional[PipelinesUndeployResponse200], PipelinesUndeployResponse400, PipelinesUndeployResponse401, PipelinesUndeployResponse500]]
    110    """
    111
    112
    113    kwargs = _get_kwargs(
    114        client=client,
    115json_body=json_body,
    116
    117    )
    118
    119    response = httpx.request(
    120        verify=client.verify_ssl,
    121        **kwargs,
    122    )
    123
    124    return _build_response(response=response)
    125
    126def sync(
    127    *,
    128    client: Client,
    129    json_body: PipelinesUndeployJsonBody,
    130
    131) -> Optional[Union[Optional[PipelinesUndeployResponse200], PipelinesUndeployResponse400, PipelinesUndeployResponse401, PipelinesUndeployResponse500]]:
    132    """Undeploy pipeline
    133
    134     Undeploys a previously deployed pipeline.
    135
    136    Args:
    137        json_body (PipelinesUndeployJsonBody):  Request to undeploy a pipeline by either its own
    138            identifier,  or the deployment identifier.
    139
    140    Returns:
    141        Response[Union[Optional[PipelinesUndeployResponse200], PipelinesUndeployResponse400, PipelinesUndeployResponse401, PipelinesUndeployResponse500]]
    142    """
    143
    144
    145    return sync_detailed(
    146        client=client,
    147json_body=json_body,
    148
    149    ).parsed
    150
    151async def asyncio_detailed(
    152    *,
    153    client: Client,
    154    json_body: PipelinesUndeployJsonBody,
    155
    156) -> Response[Union[Optional[PipelinesUndeployResponse200], PipelinesUndeployResponse400, PipelinesUndeployResponse401, PipelinesUndeployResponse500]]:
    157    """Undeploy pipeline
    158
    159     Undeploys a previously deployed pipeline.
    160
    161    Args:
    162        json_body (PipelinesUndeployJsonBody):  Request to undeploy a pipeline by either its own
    163            identifier,  or the deployment identifier.
    164
    165    Returns:
    166        Response[Union[Optional[PipelinesUndeployResponse200], PipelinesUndeployResponse400, PipelinesUndeployResponse401, PipelinesUndeployResponse500]]
    167    """
    168
    169
    170    kwargs = _get_kwargs(
    171        client=client,
    172json_body=json_body,
    173
    174    )
    175
    176    async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
    177        response = await _client.request(
    178            **kwargs
    179        )
    180
    181    return _build_response(response=response)
    182
    183async def asyncio(
    184    *,
    185    client: Client,
    186    json_body: PipelinesUndeployJsonBody,
    187
    188) -> Optional[Union[Optional[PipelinesUndeployResponse200], PipelinesUndeployResponse400, PipelinesUndeployResponse401, PipelinesUndeployResponse500]]:
    189    """Undeploy pipeline
    190
    191     Undeploys a previously deployed pipeline.
    192
    193    Args:
    194        json_body (PipelinesUndeployJsonBody):  Request to undeploy a pipeline by either its own
    195            identifier,  or the deployment identifier.
    196
    197    Returns:
    198        Response[Union[Optional[PipelinesUndeployResponse200], PipelinesUndeployResponse400, PipelinesUndeployResponse401, PipelinesUndeployResponse500]]
    199    """
    200
    201
    202    return (await asyncio_detailed(
    203        client=client,
    204json_body=json_body,
    205
    206    )).parsed

def sync_detailed( *, client: wallaroo.wallaroo_ml_ops_api_client.client.Client, json_body: wallaroo.wallaroo_ml_ops_api_client.models.pipelines_undeploy_json_body.PipelinesUndeployJsonBody) -> wallaroo.wallaroo_ml_ops_api_client.types.Response[typing.Union[wallaroo.wallaroo_ml_ops_api_client.models.pipelines_undeploy_response_200.PipelinesUndeployResponse200, NoneType, wallaroo.wallaroo_ml_ops_api_client.models.pipelines_undeploy_response_400.PipelinesUndeployResponse400, wallaroo.wallaroo_ml_ops_api_client.models.pipelines_undeploy_response_401.PipelinesUndeployResponse401, wallaroo.wallaroo_ml_ops_api_client.models.pipelines_undeploy_response_500.PipelinesUndeployResponse500]]: View Source

     95def sync_detailed(
     96    *,
     97    client: Client,
     98    json_body: PipelinesUndeployJsonBody,
     99
    100) -> Response[Union[Optional[PipelinesUndeployResponse200], PipelinesUndeployResponse400, PipelinesUndeployResponse401, PipelinesUndeployResponse500]]:
    101    """Undeploy pipeline
    102
    103     Undeploys a previously deployed pipeline.
    104
    105    Args:
    106        json_body (PipelinesUndeployJsonBody):  Request to undeploy a pipeline by either its own
    107            identifier,  or the deployment identifier.
    108
    109    Returns:
    110        Response[Union[Optional[PipelinesUndeployResponse200], PipelinesUndeployResponse400, PipelinesUndeployResponse401, PipelinesUndeployResponse500]]
    111    """
    112
    113
    114    kwargs = _get_kwargs(
    115        client=client,
    116json_body=json_body,
    117
    118    )
    119
    120    response = httpx.request(
    121        verify=client.verify_ssl,
    122        **kwargs,
    123    )
    124
    125    return _build_response(response=response)

Undeploy pipeline

Undeploys a previously deployed pipeline.

Args: json_body (PipelinesUndeployJsonBody): Request to undeploy a pipeline by either its own identifier, or the deployment identifier.

Returns: Response[Union[Optional[PipelinesUndeployResponse200], PipelinesUndeployResponse400, PipelinesUndeployResponse401, PipelinesUndeployResponse500]]

def sync( *, client: wallaroo.wallaroo_ml_ops_api_client.client.Client, json_body: wallaroo.wallaroo_ml_ops_api_client.models.pipelines_undeploy_json_body.PipelinesUndeployJsonBody) -> Union[wallaroo.wallaroo_ml_ops_api_client.models.pipelines_undeploy_response_200.PipelinesUndeployResponse200, NoneType, wallaroo.wallaroo_ml_ops_api_client.models.pipelines_undeploy_response_400.PipelinesUndeployResponse400, wallaroo.wallaroo_ml_ops_api_client.models.pipelines_undeploy_response_401.PipelinesUndeployResponse401, wallaroo.wallaroo_ml_ops_api_client.models.pipelines_undeploy_response_500.PipelinesUndeployResponse500]: View Source

    127def sync(
    128    *,
    129    client: Client,
    130    json_body: PipelinesUndeployJsonBody,
    131
    132) -> Optional[Union[Optional[PipelinesUndeployResponse200], PipelinesUndeployResponse400, PipelinesUndeployResponse401, PipelinesUndeployResponse500]]:
    133    """Undeploy pipeline
    134
    135     Undeploys a previously deployed pipeline.
    136
    137    Args:
    138        json_body (PipelinesUndeployJsonBody):  Request to undeploy a pipeline by either its own
    139            identifier,  or the deployment identifier.
    140
    141    Returns:
    142        Response[Union[Optional[PipelinesUndeployResponse200], PipelinesUndeployResponse400, PipelinesUndeployResponse401, PipelinesUndeployResponse500]]
    143    """
    144
    145
    146    return sync_detailed(
    147        client=client,
    148json_body=json_body,
    149
    150    ).parsed

Undeploy pipeline

Undeploys a previously deployed pipeline.

Args: json_body (PipelinesUndeployJsonBody): Request to undeploy a pipeline by either its own identifier, or the deployment identifier.

Returns: Response[Union[Optional[PipelinesUndeployResponse200], PipelinesUndeployResponse400, PipelinesUndeployResponse401, PipelinesUndeployResponse500]]

async def asyncio_detailed( *, client: wallaroo.wallaroo_ml_ops_api_client.client.Client, json_body: wallaroo.wallaroo_ml_ops_api_client.models.pipelines_undeploy_json_body.PipelinesUndeployJsonBody) -> wallaroo.wallaroo_ml_ops_api_client.types.Response[typing.Union[wallaroo.wallaroo_ml_ops_api_client.models.pipelines_undeploy_response_200.PipelinesUndeployResponse200, NoneType, wallaroo.wallaroo_ml_ops_api_client.models.pipelines_undeploy_response_400.PipelinesUndeployResponse400, wallaroo.wallaroo_ml_ops_api_client.models.pipelines_undeploy_response_401.PipelinesUndeployResponse401, wallaroo.wallaroo_ml_ops_api_client.models.pipelines_undeploy_response_500.PipelinesUndeployResponse500]]: View Source

    152async def asyncio_detailed(
    153    *,
    154    client: Client,
    155    json_body: PipelinesUndeployJsonBody,
    156
    157) -> Response[Union[Optional[PipelinesUndeployResponse200], PipelinesUndeployResponse400, PipelinesUndeployResponse401, PipelinesUndeployResponse500]]:
    158    """Undeploy pipeline
    159
    160     Undeploys a previously deployed pipeline.
    161
    162    Args:
    163        json_body (PipelinesUndeployJsonBody):  Request to undeploy a pipeline by either its own
    164            identifier,  or the deployment identifier.
    165
    166    Returns:
    167        Response[Union[Optional[PipelinesUndeployResponse200], PipelinesUndeployResponse400, PipelinesUndeployResponse401, PipelinesUndeployResponse500]]
    168    """
    169
    170
    171    kwargs = _get_kwargs(
    172        client=client,
    173json_body=json_body,
    174
    175    )
    176
    177    async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
    178        response = await _client.request(
    179            **kwargs
    180        )
    181
    182    return _build_response(response=response)

Undeploy pipeline

Undeploys a previously deployed pipeline.

Args: json_body (PipelinesUndeployJsonBody): Request to undeploy a pipeline by either its own identifier, or the deployment identifier.

Returns: Response[Union[Optional[PipelinesUndeployResponse200], PipelinesUndeployResponse400, PipelinesUndeployResponse401, PipelinesUndeployResponse500]]

async def asyncio( *, client: wallaroo.wallaroo_ml_ops_api_client.client.Client, json_body: wallaroo.wallaroo_ml_ops_api_client.models.pipelines_undeploy_json_body.PipelinesUndeployJsonBody) -> Union[wallaroo.wallaroo_ml_ops_api_client.models.pipelines_undeploy_response_200.PipelinesUndeployResponse200, NoneType, wallaroo.wallaroo_ml_ops_api_client.models.pipelines_undeploy_response_400.PipelinesUndeployResponse400, wallaroo.wallaroo_ml_ops_api_client.models.pipelines_undeploy_response_401.PipelinesUndeployResponse401, wallaroo.wallaroo_ml_ops_api_client.models.pipelines_undeploy_response_500.PipelinesUndeployResponse500]: View Source

    184async def asyncio(
    185    *,
    186    client: Client,
    187    json_body: PipelinesUndeployJsonBody,
    188
    189) -> Optional[Union[Optional[PipelinesUndeployResponse200], PipelinesUndeployResponse400, PipelinesUndeployResponse401, PipelinesUndeployResponse500]]:
    190    """Undeploy pipeline
    191
    192     Undeploys a previously deployed pipeline.
    193
    194    Args:
    195        json_body (PipelinesUndeployJsonBody):  Request to undeploy a pipeline by either its own
    196            identifier,  or the deployment identifier.
    197
    198    Returns:
    199        Response[Union[Optional[PipelinesUndeployResponse200], PipelinesUndeployResponse400, PipelinesUndeployResponse401, PipelinesUndeployResponse500]]
    200    """
    201
    202
    203    return (await asyncio_detailed(
    204        client=client,
    205json_body=json_body,
    206
    207    )).parsed

Undeploy pipeline

Undeploys a previously deployed pipeline.

Args: json_body (PipelinesUndeployJsonBody): Request to undeploy a pipeline by either its own identifier, or the deployment identifier.

Returns: Response[Union[Optional[PipelinesUndeployResponse200], PipelinesUndeployResponse400, PipelinesUndeployResponse401, PipelinesUndeployResponse500]]