api.system.components.runtime.v1.lookup — Argus-Toolbelt 1.0 documentation

# Source code for api.system.components.runtime.v1.lookup

    """Autogenerated API"""
    import requests
    from argus_cli.plugin import register_command

    @register_command(extending=('system','components','runtime','v1','lookup'))
    def get_properties(type: str = None,json: bool = True, verify: bool = True, apiKey: str = "", authentication: dict = {}) -> dict:
        """Lookup runtime components (INTERNAL)

        :param str type:
        :raises AuthenticationFailedException: on 401
        :raises AccessDeniedException: on 403
        :returns: {"offset": 260, "limit": 485, "responseCode": 200, "count": 240, "data": ["Use into model person card day."], "metaData": {"additionalProperties": {}}, "messages": [{"message": "Billion six move right professional choice institution.", "messageTemplate": "Window very rock if police.", "field": "Anyone fish thousand conference up challenge hundred.", "parameter": {}, "timestamp": 608487691}], "currentPage": 92, "size": 573}
        """
        from requests import post
        from argus_api.exceptions import http

        url = "https://osl-argus-trunk-web1.mnemonic.no/web/api/system/components/runtime/v1/lookup".format()
        headers = {
            'Content-Type': 'application/json',
            'User-Agent': 'ArgusToolbelt/1.0'
        }

        if apiKey:
            headers["Argus-API-Key"] = apiKey
        elif authentication and isinstance(authentication, dict):
            headers.update(authentication)
        elif callable(authentication):
            headers.update(authentication(url))

        body = {}

        if type:
            body.update({"type": type})

        response = post(url, json=body if body else None, verify=verify, headers=headers)

        errors = []
        if response.status_code == 401:
            raise http.AuthenticationFailedException(response)
        elif response.status_code == 403:
            raise http.AccessDeniedException(response)
        elif response.status_code == 412:
            raise http.ValidationErrorException(response)
        elif response.status_code == 404:
            raise http.ObjectNotFoundException(response)

        return response.json() if json else response