32 const ProviderInfo = <DataProviderInfo>{
33 "type":
"RestClientDataProvider",
34 "constructor_options": ConstructorOptions,
35 "supports_children":
True,
39 const ConstructorOptions = {
40 "assume_encoding": <DataProviderOptionInfo>{
41 "type": AbstractDataProviderType::get(StringType),
42 "desc":
"Assumes the given encoding if the server does not send a `charset` value",
44 "connect_timeout": <DataProviderOptionInfo>{
45 "type": AbstractDataProviderType::get(IntType),
46 "desc":
"The connection timeout to use in milliseconds (default: 45 seconds)",
47 "default_value": 45000,
49 "content_encoding": <DataProviderOptionInfo>{
50 "type": AbstractDataProviderType::get(StringType),
51 "desc":
"Sets the send encoding (if the `send_encoding` option is not set) and the "
52 "response encoding to request"
53 "Sets the send encoding (if the `send_encoding` option is not set) and the requested response "
54 "encoding (note that only outgoing message bodies over `1024` bytes in size are compressed)",
55 "default_value":
"gzip",
59 "desc":
"use GNU zip encoding ([RFC 1952](https://tools.ietf.org/html/rfc1952))",
60 }, <AllowedValueInfo>{
62 "desc":
"use bzip2 encoding",
63 }, <AllowedValueInfo>{
65 "desc":
"use the deflate algorithm ([RFC 1951](https://tools.ietf.org/html/rfc1951))",
66 }, <AllowedValueInfo>{
68 "desc":
"use no content encoding",
72 "data": <DataProviderOptionInfo>{
73 "type": AbstractDataProviderType::get(StringType),
74 "desc":
"Determines how message bodies are serialized",
75 "default_value":
"auto",
79 "desc":
"Prefers in this order: `json`, `yaml`, `rawxml`, `xml`, `url`, and `text`",
80 }, <AllowedValueInfo>{
82 "desc":
"For binary message bodies without data serialization",
83 }, <AllowedValueInfo>{
85 "desc":
"Use JSON serialization",
86 }, <AllowedValueInfo>{
88 "desc":
"Message bodies are encoded with XML without any data type encodings",
89 }, <AllowedValueInfo>{
91 "desc":
"Use only plain text; no serialization is used",
92 }, <AllowedValueInfo>{
94 "desc":
"For URL-encoded message bodies "
95 "(see [RFC 2738 2.2](https://tools.ietf.org/html/rfc1738))",
96 }, <AllowedValueInfo>{
98 "desc":
"Use only XML-RPC value serialization",
99 }, <AllowedValueInfo>{
101 "desc":
"Use only YAML serialization",
105 "error_passthru": <DataProviderOptionInfo>{
106 "type": AbstractDataProviderType::get(BoolType),
107 "desc":
"If `True` then REST status codes indicating errors will not cause an "
108 "`REST-CLIENT-RECEIVE-ERROR` exception to be raised, rather such responses will be "
109 "passed through to the caller like any other response",
110 "default_value":
False,
112 "headers": <DataProviderOptionInfo>{
113 "type": AbstractDataProviderType::get(HashType),
114 "desc":
"An optional hash of headers to send with every request"
116 "http_version": <DataProviderOptionInfo>{
117 "type": AbstractDataProviderType::get(StringType),
118 "desc":
"HTTP version to use (`1.0` or `1.1`, defaults to `1.1`)",
119 "default_value":
"1.1",
123 "desc":
"Use HTTP version \"1.0\"",
124 }, <AllowedValueInfo>{
126 "desc":
"Use HTTP version \"1.1\" (the default)",
130 "max_redirects": <DataProviderOptionInfo>{
131 "type": AbstractDataProviderType::get(IntType),
132 "desc":
"Maximum redirects to support",
134 "no_charset": <DataProviderOptionInfo>{
135 "type": AbstractDataProviderType::get(BoolType),
136 "desc":
"If `True` no charset will be added to the `Content-Type` header",
138 "proxy": <DataProviderOptionInfo>{
139 "type": AbstractDataProviderType::get(StringType),
140 "desc":
"The proxy URL to use",
142 "redirect_passthru": <DataProviderOptionInfo>{
143 "type": AbstractDataProviderType::get(BoolType),
144 "desc":
"if `True` then redirect responses will be passed to the caller instead of processed",
145 "default_value":
False,
147 "send_encoding": <DataProviderOptionInfo>{
148 "type": AbstractDataProviderType::get(StringType),
149 "desc":
"Sets the send encoding (if the `send_encoding` option is not set) and the requested response "
150 "encoding (note that only outgoing message bodies over `1024` bytes in size are compressed)",
154 "desc":
"use GNU zip encoding ([RFC 1952](https://tools.ietf.org/html/rfc1952))",
155 }, <AllowedValueInfo>{
157 "desc":
"use bzip2 encoding",
158 }, <AllowedValueInfo>{
160 "desc":
"use the deflate algorithm ([RFC 1951](https://tools.ietf.org/html/rfc1951))",
161 }, <AllowedValueInfo>{
163 "desc":
"use no content encoding",
167 "ssl_cert_der": <DataProviderOptionInfo>{
168 "type": AbstractDataProviderType::get(BoolType),
169 "desc":
"If `True` then the data represented by `ssl_cert_location` will be assumed to be in binary "
171 "default_value":
False,
173 "ssl_cert_location": <DataProviderOptionInfo>{
174 "type": AbstractDataProviderType::get(StringType,
NOTHING, {
176 DTT_FromLocation:
True,
178 "desc":
"A path or location to an X.509 client certificate file",
180 "ssl_key_der": <DataProviderOptionInfo>{
181 "type": AbstractDataProviderType::get(BoolType),
182 "desc":
"If `True` then the data represented by `ssl_key_location` will be assumed to be in binary "
184 "default_value":
False,
186 "ssl_key_location": <DataProviderOptionInfo>{
187 "type": AbstractDataProviderType::get(StringType,
NOTHING, {
189 DTT_FromLocation:
True,
191 "desc":
"A path or location to a private key file for the X.509 client certificate",
193 "ssl_key_password": <DataProviderOptionInfo>{
194 "type": AbstractDataProviderType::get(StringType),
195 "desc":
"The password to the private key given with `ssl_key_path` (text PEM format only)",
198 "ssl_verify_cert": <DataProviderOptionInfo>{
199 "type": AbstractDataProviderType::get(BoolType),
200 "desc":
"if `True` then the server's certificate will only be accepted if it's verified",
201 "default_value":
False,
203 "swagger": <DataProviderOptionInfo>{
204 "type": AbstractDataProviderType::get(StringType,
NOTHING, {
206 DTT_FromLocation:
True,
208 "desc":
"A Swagger 2.0 schema location or file data for the REST connection",
210 "timeout": <DataProviderOptionInfo>{
211 "type": AbstractDataProviderType::get(IntType),
212 "desc":
"Transfer timeout to use in milliseconds (default: 45 seconds)",
213 "default_value": 45000,
215 "url": <DataProviderOptionInfo>{
216 "type": AbstractDataProviderType::get(StringType),
217 "desc":
"A URL for a REST or RESTS connection",
220 "validator_base_path": <DataProviderOptionInfo>{
221 "type": AbstractDataProviderType::get(StringType),
222 "desc":
"In case a REST validator is used, the base path in the schema can be overridden with this "
231 "call": Class::forName(
"RestClientDataProvider::RestClientCallDataProvider"),
232 "delete": Class::forName(
"RestClientDataProvider::RestClientDeleteDataProvider"),
233 "get": Class::forName(
"RestClientDataProvider::RestClientGetDataProvider"),
234 "head": Class::forName(
"RestClientDataProvider::RestClientHeadDataProvider"),
235 "options": Class::forName(
"RestClientDataProvider::RestClientOptionsDataProvider"),
236 "patch": Class::forName(
"RestClientDataProvider::RestClientPatchDataProvider"),
237 "post": Class::forName(
"RestClientDataProvider::RestClientPostDataProvider"),
238 "put": Class::forName(
"RestClientDataProvider::RestClientPutDataProvider"),
*AbstractDataProvider getChildProviderImpl(string name)
Returns the given child provider or NOTHING if the given child is unknown.
*list< string > getChildProviderNamesImpl()
Returns a list of child data provider names, if any.
constructor(*hash< auto > options)
Creates the object from constructor options.
hash< DataProviderInfo > getStaticInfoImpl()
Returns data provider static info.
static hash< auto > processRestOptions(hash< auto > options)
Processes common REST options.
*string getDesc()
Returns the data provider description.
*list< hash< DataProviderSummaryInfo > > getChildProviderSummaryInfo()
Return data provider summary info.
constructor(RestClient rest)
Creates the object from a REST connection.
string getName()
Returns the data provider name.
static RestClient getRestConnection(hash< auto > options)
Returns a REST connection.
static hash< auto > makeRequest(RestClient rest, string meth, *data body, string path, *hash< auto > hdr)
Makes a REST request and returns the response.
Qore RestClientDataProvider module definition.
Definition: RestClientCallDataProvider.qc.dox.h:26