Grassroots Infrastructure
The Grassroots Infrastructure is a suite of computing tools to help users and developers use scientific data infrastructure that can easily be interconnected.
web_service_util.h File Reference
#include "jansson.h"
#include "grassroots_service_library.h"
#include "service.h"
#include "parameter_set.h"
#include "byte_buffer.h"
#include "curl_tools.h"
#include "service_job.h"
Include dependency graph for web_service_util.h:

Go to the source code of this file.

Data Structures

struct  WebServiceData
 The configuration data for a WebService. More...
 

Enumerations

enum  MatchType { MT_EXACT_MATCH, MT_AND, MT_OR, MT_NUM_MATCH_TYPES }
 An enumeration detailing how to combine different parameters upon submission to a web service. More...
 
enum  SubmissionMethod {
  SM_UNKNOWN = -1, SM_POST, SM_GET, SM_BODY,
  SM_NUM_METHODS
}
 An enumeration of the different web-based submission methods. More...
 

Functions

SubmissionMethod GetSubmissionMethod (const json_t *op_json_p)
 Get the requested SubmissionMethod from a reference service. More...
 
bool AddMatchTypeParameter (WebServiceData *data_p, ParameterSet *param_set_p)
 Add a Parameter giving the choice of MatchTypes to a ParameterSet. More...
 
MatchType GetMatchTypeParameterValue (ParameterSet *const param_set_p)
 Get the value of the MatchType parameter from a ParameterSet. More...
 

Function Documentation

◆ GetSubmissionMethod()

SubmissionMethod GetSubmissionMethod ( const json_t *  op_json_p)

Get the requested SubmissionMethod from a reference service.

Parameters
op_json_pThe JSON fragment for the reference service which will be used to initialise the WebServiceData.
Returns
The SubmissionMethod.

◆ AddMatchTypeParameter()

bool AddMatchTypeParameter ( WebServiceData data_p,
ParameterSet param_set_p 
)

Add a Parameter giving the choice of MatchTypes to a ParameterSet.

Parameters
data_pThe WebServiceData to to use for configuration details.
param_set_pThe ParameterSet to add the MatchType parameter to.
Returns
true if successful, false otherwise.

◆ GetMatchTypeParameterValue()

MatchType GetMatchTypeParameterValue ( ParameterSet *const  param_set_p)

Get the value of the MatchType parameter from a ParameterSet.

Parameters
param_set_pThe ParameterSet to get the MatchType parameter from.
Returns
The MatchType parameter.