mate_rest_client package¶
Python APIs and models for interacting with MATE’s REST API.
- class mate_rest_client.Client(base: str = 'http://localhost:8666')¶
Bases:
object
The top-level Python client for MATE’s REST API.
Users can interact with subcomponents of the MATE REST API via attributes on any
Client
instance:client.artifacts
(artifacts.ArtifactRoutes
): interactions with artifactsclient.builds
(artifacts.BuildRoutes
): interactions with buildsclient.compilations
(artifacts.CompilationRoutes
): interactions with compilationsclient.analyses
(artifacts.AnalysisRoutes
): interactions with analysesclient.pois
(artifacts.POIRoutes
): interactions with POIsclient.graphs
(artifacts.GraphRoutes
): interactions with graphsclient.manticore
(artifacts.ManticoreRoutes
): interactions with Manticore tasks
Client
instances can also make direct requests viaClient.get()
,Client.post()
, andClient.delete()
. This interface should be considered lower-level and not preferred.- Parameters
base (str) –
- Return type
None
- delete(path: str, **kwargs: Dict[str, Any]) requests.Response ¶
- Parameters
path (str) –
kwargs (Dict[str, Any]) –
- Return type
requests.Response
- delete_as(model: Type[_Model], path: str, **kwargs: Dict[str, Any]) _Model ¶
- Parameters
model (Type[_Model]) –
path (str) –
kwargs (Dict[str, Any]) –
- Return type
_Model
- delete_as_maybe(model: Type[_Model], path: str, **kwargs: Dict[str, Any]) Optional[_Model] ¶
- Parameters
model (Type[_Model]) –
path (str) –
kwargs (Dict[str, Any]) –
- Return type
Optional[_Model]
- get(path: str, **kwargs: Dict[str, Any]) requests.Response ¶
- Parameters
path (str) –
kwargs (Dict[str, Any]) –
- Return type
requests.Response
- get_as(model: Type[_Model], path: str, **kwargs: Dict[str, Any]) _Model ¶
- Parameters
model (Type[_Model]) –
path (str) –
kwargs (Dict[str, Any]) –
- Return type
_Model
- get_as_maybe(model: Type[_Model], path: str, **kwargs: Dict[str, Any]) Optional[_Model] ¶
- Parameters
model (Type[_Model]) –
path (str) –
kwargs (Dict[str, Any]) –
- Return type
Optional[_Model]
- patch(path: str, **kwargs: Dict[str, Any]) requests.Response ¶
- Parameters
path (str) –
kwargs (Dict[str, Any]) –
- Return type
requests.Response
- patch_as(model: Type[_Model], path: str, **kwargs: Dict[str, Any]) _Model ¶
- Parameters
model (Type[_Model]) –
path (str) –
kwargs (Dict[str, Any]) –
- Return type
_Model
- patch_as_maybe(model: Type[_Model], path: str, **kwargs: Dict[str, Any]) Optional[_Model] ¶
- Parameters
model (Type[_Model]) –
path (str) –
kwargs (Dict[str, Any]) –
- Return type
Optional[_Model]
- post(path: str, **kwargs: Dict[str, Any]) requests.Response ¶
- Parameters
path (str) –
kwargs (Dict[str, Any]) –
- Return type
requests.Response
- post_as(model: Type[_Model], path: str, **kwargs: Dict[str, Any]) _Model ¶
- Parameters
model (Type[_Model]) –
path (str) –
kwargs (Dict[str, Any]) –
- Return type
_Model
- post_as_maybe(model: Type[_Model], path: str, **kwargs: Dict[str, Any]) Optional[_Model] ¶
- Parameters
model (Type[_Model]) –
path (str) –
kwargs (Dict[str, Any]) –
- Return type
Optional[_Model]
- put(path: str, **kwargs: Dict[str, Any]) requests.Response ¶
- Parameters
path (str) –
kwargs (Dict[str, Any]) –
- Return type
requests.Response
- put_as(model: Type[_Model], path: str, **kwargs: Dict[str, Any]) _Model ¶
- Parameters
model (Type[_Model]) –
path (str) –
kwargs (Dict[str, Any]) –
- Return type
_Model
- put_as_maybe(model: Type[_Model], path: str, **kwargs: Dict[str, Any]) Optional[_Model] ¶
- Parameters
model (Type[_Model]) –
path (str) –
kwargs (Dict[str, Any]) –
- Return type
Optional[_Model]
- exception mate_rest_client.RestError(status_code: StatusCode, reason: str, url: Url)¶
Bases:
Exception
Raised when a request or other operation internal to the REST client fails.
- Parameters
status_code (StatusCode) –
reason (str) –
url (Url) –
- Return type
None
- classmethod from_(resp: requests.models.Response) mate_rest_client.RestError ¶
Create a
RestError
from the givenrequests.Response
.Assumes that the
request.Response
is an error response.- Parameters
resp (requests.models.Response) –
- Return type
- reason: str¶
- status_code: StatusCode¶
- url: Url¶