google.cloud.forseti.common.util.replay module

Wrapper functions used to record and replay API responses.

_key_from_request(request)[source]

Generate a unique key from a request.

Parameters:request (HttpRequest) – a googleapiclient HttpRequest object.
Returns:A unique key from the request uri and body.
Return type:str
record(requests)[source]

Record and serialize GCP API call answers.

Parameters:requests (dict) – A dictionary to store a copy of all requests and responses in, before pickling.
Returns:Decorator function.
Return type:function
replay(requests)[source]

Record and serialize GCP API call answers.

Parameters:requests (dict) – A dictionary to store a copy of all requests and responses in, after unpickling.
Returns:Decorator function.
Return type:function