\r\n

51Degrees Pipeline Python  4.3

51Degrees Pipeline for Python
  • pipeline-python
  • fiftyone_pipeline_cloudrequestengine
  • fiftyone_pipeline_cloudrequestengine
  • cloudrequestengine
  • CloudRequestEngine

pipeline-python.fiftyone_pipeline_cloudrequestengine.fiftyone_pipeline_cloudrequestengine.cloudrequestengine.CloudRequestEngine Class Reference

Inheritance diagram for pipeline-python.fiftyone_pipeline_cloudrequestengine.fiftyone_pipeline_cloudrequestengine.cloudrequestengine.CloudRequestEngine:

[legend]

Collaboration diagram for pipeline-python.fiftyone_pipeline_cloudrequestengine.fiftyone_pipeline_cloudrequestengine.cloudrequestengine.CloudRequestEngine:

[legend]

Public Member Functions

def  __init__ (self, settings={})
Constructor for CloudRequestEngine. More...
def  get_evidence_keys (self)
Internal function for getting evidence keys used by cloud engines @rtype: dict. More...
def  get_evidence_key_filter (self)
Instance of EvidenceKeyFilter based on the evidence keys fetched from the cloud service by the private getEvidenceKeys() method. More...
def  get_engine_properties (self)
Internal method to get properties for cloud engines from the cloud service. More...
def  validate_response (self, cloudResponse)
Validate the JSON response from the cloud service. More...
def  make_cloud_request (self, type, url, content=None)
@type url: string More...
def  process_internal (self, flowdata)
Processing function for the CloudRequestEngine Makes a request to the cloud service with the supplied resource key and evidence and returns a JSON object that is then parsed by cloud engines placed later in the pipeline. More...
def  get_content (self, flowData)
Generate the Content to send in the POST request. More...
def  add_query_data (self, query_data, all_evidence, evidence)
Add query data to the evidence. More...
def  get_selected_evidence (self, evidence, type)
Get evidence with specified prefix. More...
def  key_has_prefix (self, itemKey, prefix)
Check that the key of a KeyValuePair has the given prefix. More...

Public Attributes

 datakey
 properties
 resource_key
 baseURL
 http_client
 cloud_request_origin
 flow_element_properties
 evidence_keys
 exclude_from_messages

Constructor & Destructor Documentation

◆ __init__()

def pipeline-python.fiftyone_pipeline_cloudrequestengine.fiftyone_pipeline_cloudrequestengine.cloudrequestengine.CloudRequestEngine.__init__ (   self,
  settings = {}  
)

Constructor for CloudRequestEngine.

@type settings: dict

Parameters
settings - Settings should contain a resource_key and optionally 1) a cloud_endpoint to overwrite the default baseurl 2) an cloud_request_origin to use when making requests

Member Function Documentation

◆ add_query_data()

def pipeline-python.fiftyone_pipeline_cloudrequestengine.fiftyone_pipeline_cloudrequestengine.cloudrequestengine.CloudRequestEngine.add_query_data (   self,
  query_data,
  all_evidence,
  evidence  
)

Add query data to the evidence.

Parameters
- query_data: The destination dictionary to add query data to.
all_evidence - All evidence in the flow data. This is used to report which evidence keys are conflicting.
evidence - Evidence to add to the query Data.

◆ get_content()

def pipeline-python.fiftyone_pipeline_cloudrequestengine.fiftyone_pipeline_cloudrequestengine.cloudrequestengine.CloudRequestEngine.get_content (   self,
  flowData  
)

Generate the Content to send in the POST request.

The evidence keys e.g. 'query.' and 'header.' have an order of precedence. These are added to the evidence in reverse order, if there is conflict then the queryData value is overwritten.

'query.' evidence should take precedence over all other evidence. If there are evidence keys other than 'query.' that conflict then this is unexpected so a warning will be logged.

Parameters
- flowData: FlowData
Returns
: Evidence Dictionary

◆ get_engine_properties()

def pipeline-python.fiftyone_pipeline_cloudrequestengine.fiftyone_pipeline_cloudrequestengine.cloudrequestengine.CloudRequestEngine.get_engine_properties (   self )

Internal method to get properties for cloud engines from the cloud service.

@rtype: dict

Returns
: Returns properties for all engines

◆ get_evidence_key_filter()

def pipeline-python.fiftyone_pipeline_cloudrequestengine.fiftyone_pipeline_cloudrequestengine.cloudrequestengine.CloudRequestEngine.get_evidence_key_filter (   self )

Instance of EvidenceKeyFilter based on the evidence keys fetched from the cloud service by the private getEvidenceKeys() method.

@type: BasicListEvidenceKeyFilter

Returns
: Returns BasicListEvidenceKeyFilter

◆ get_evidence_keys()

def pipeline-python.fiftyone_pipeline_cloudrequestengine.fiftyone_pipeline_cloudrequestengine.cloudrequestengine.CloudRequestEngine.get_evidence_keys (   self )

Internal function for getting evidence keys used by cloud engines @rtype: dict.

Returns
: Returns list of keys

◆ get_selected_evidence()

def pipeline-python.fiftyone_pipeline_cloudrequestengine.fiftyone_pipeline_cloudrequestengine.cloudrequestengine.CloudRequestEngine.get_selected_evidence (   self,
  evidence,
  type  
)

Get evidence with specified prefix.

Parameters
evidence - All evidence in the flow data.
type - Required evidence key prefix

◆ key_has_prefix()

def pipeline-python.fiftyone_pipeline_cloudrequestengine.fiftyone_pipeline_cloudrequestengine.cloudrequestengine.CloudRequestEngine.key_has_prefix (   self,
  itemKey,
  prefix  
)

Check that the key of a KeyValuePair has the given prefix.

Parameters
itemKey - Key to check
prefix - The prefix to check for.
Returns
: True if the key has the prefix.

◆ make_cloud_request()

def pipeline-python.fiftyone_pipeline_cloudrequestengine.fiftyone_pipeline_cloudrequestengine.cloudrequestengine.CloudRequestEngine.make_cloud_request (   self,
  type,
  url,
  content = None  
)

@type url: string

Parameters
url - @rtype: dict
Returns
Returns dict with data and error properties error contains any errors from the request, data contains the response

◆ process_internal()

def pipeline-python.fiftyone_pipeline_cloudrequestengine.fiftyone_pipeline_cloudrequestengine.cloudrequestengine.CloudRequestEngine.process_internal (   self,
  flowdata  
)

Processing function for the CloudRequestEngine Makes a request to the cloud service with the supplied resource key and evidence and returns a JSON object that is then parsed by cloud engines placed later in the pipeline.

@type FlowData: FlowData

Parameters
FlowData - Returns a JSON object that is then parsed by cloud engines

◆ validate_response()

def pipeline-python.fiftyone_pipeline_cloudrequestengine.fiftyone_pipeline_cloudrequestengine.cloudrequestengine.CloudRequestEngine.validate_response (   self,
  cloudResponse  
)

Validate the JSON response from the cloud service.

@type: Response

Parameters
- Response returned from the cloud service. @rtype: Exception
Returns
: Thrown if there are errors returned from the cloud service.