Source code for api.system.components.runtime.v1.status

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


[docs]@register_command(extending=('system','components','runtime','v1','status')) def get_host_map(json: bool = True, verify: bool = True, apiKey: str = "", authentication: dict = {}) -> dict: """Fetch status map (INTERNAL) :raises AuthenticationFailedException: on 401 :raises AccessDeniedException: on 403 :returns: {} """ from requests import get from argus_api.exceptions import http url = "https://osl-argus-trunk-web1.mnemonic.no/web/api/system/components/runtime/v1/status".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 = {} response = get(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
[docs]@register_command(extending=('system','components','runtime','v1','status')) def clear_component_directory(json: bool = True, verify: bool = True, apiKey: str = "", authentication: dict = {}) -> dict: """Clear component directory (INTERNAL) :raises AuthenticationFailedException: on 401 :raises AccessDeniedException: on 403 :returns: {} """ from requests import delete from argus_api.exceptions import http url = "https://osl-argus-trunk-web1.mnemonic.no/web/api/system/components/runtime/v1/status".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 = {} response = delete(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
[docs]@register_command(extending=('system','components','runtime','v1','status')) def refresh(json: bool = True, verify: bool = True, apiKey: str = "", authentication: dict = {}) -> dict: """Request all components to immediately refresh status (INTERNAL) :raises AuthenticationFailedException: on 401 :raises AccessDeniedException: on 403 :returns: {} """ from requests import put from argus_api.exceptions import http url = "https://osl-argus-trunk-web1.mnemonic.no/web/api/system/components/runtime/v1/status/refresh".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 = {} response = put(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