32 const ProviderInfo = <DataProviderInfo>{
33 "type":
"RestClientDataProvider",
34 "constructor_options": ConstructorOptions,
35 "supports_children": True,
36 "children_can_support_apis": True,
37 "children_can_support_records": False,
38 "children_can_support_observers": False,
42 const ConstructorOptions = {
43 "assume_encoding": <DataProviderOptionInfo>{
44 "type": AbstractDataProviderType::get(StringType),
45 "desc":
"Assumes the given encoding if the server does not send a `charset` value",
47 "connect_timeout": <DataProviderOptionInfo>{
48 "type": AbstractDataProviderType::get(IntType),
49 "desc":
"The connection timeout to use in milliseconds (default: 45 seconds)",
50 "default_value": 45000,
52 "content_encoding": <DataProviderOptionInfo>{
53 "type": AbstractDataProviderType::get(StringType),
54 "desc":
"Sets the send encoding (if the `send_encoding` option is not set) and the "
55 "response encoding to request"
56 "Sets the send encoding (if the `send_encoding` option is not set) and the requested response "
57 "encoding (note that only outgoing message bodies over `1024` bytes in size are compressed)",
58 "default_value":
"gzip",
62 "desc":
"use GNU zip encoding ([RFC 1952](https://tools.ietf.org/html/rfc1952))",
63 }, <AllowedValueInfo>{
65 "desc":
"use bzip2 encoding",
66 }, <AllowedValueInfo>{
68 "desc":
"use the deflate algorithm ([RFC 1951](https://tools.ietf.org/html/rfc1951))",
69 }, <AllowedValueInfo>{
71 "desc":
"use no content encoding",
75 "data": <DataProviderOptionInfo>{
76 "type": AbstractDataProviderType::get(StringType),
77 "desc":
"Determines how message bodies are serialized",
78 "default_value":
"auto",
82 "desc":
"Prefers in this order: `json`, `yaml`, `rawxml`, `xml`, `url`, and `text`",
83 }, <AllowedValueInfo>{
85 "desc":
"For binary message bodies without data serialization",
86 }, <AllowedValueInfo>{
88 "desc":
"Use JSON serialization",
89 }, <AllowedValueInfo>{
91 "desc":
"Message bodies are encoded with XML without any data type encodings",
92 }, <AllowedValueInfo>{
94 "desc":
"Use only plain text; no serialization is used",
95 }, <AllowedValueInfo>{
97 "desc":
"For URL-encoded message bodies "
98 "(see [RFC 2738 2.2](https://tools.ietf.org/html/rfc1738))",
99 }, <AllowedValueInfo>{
101 "desc":
"Use only XML-RPC value serialization",
102 }, <AllowedValueInfo>{
104 "desc":
"Use only YAML serialization",
108 "error_passthru": <DataProviderOptionInfo>{
109 "type": AbstractDataProviderType::get(BoolType),
110 "desc":
"If `True` then REST status codes indicating errors will not cause an "
111 "`REST-CLIENT-RECEIVE-ERROR` exception to be raised, rather such responses will be "
112 "passed through to the caller like any other response",
113 "default_value": False,
115 "headers": <DataProviderOptionInfo>{
116 "type": AbstractDataProviderType::get(HashType),
117 "desc":
"An optional hash of headers to send with every request"
119 "http_version": <DataProviderOptionInfo>{
120 "type": AbstractDataProviderType::get(StringType),
121 "desc":
"HTTP version to use (`1.0` or `1.1`, defaults to `1.1`)",
122 "default_value":
"1.1",
126 "desc":
"Use HTTP version \"1.0\"",
127 }, <AllowedValueInfo>{
129 "desc":
"Use HTTP version \"1.1\" (the default)",
133 "max_redirects": <DataProviderOptionInfo>{
134 "type": AbstractDataProviderType::get(IntType),
135 "desc":
"Maximum redirects to support",
137 "no_charset": <DataProviderOptionInfo>{
138 "type": AbstractDataProviderType::get(BoolType),
139 "desc":
"If `True` no charset will be added to the `Content-Type` header",
141 "pre_encoded_urls": <DataProviderOptionInfo>{
142 "type": AbstractDataProviderType::get(BoolType),
143 "desc":
"if `true` then all URI paths in URLs are assumed to be already "
144 "[percent encoded](https://en.wikipedia.org/wiki/Percent-encoding); if this flag is set and "
145 "any unencoded characters are sent in a URL with a new request, an exception is raised",
146 "default_value": False,
148 "proxy": <DataProviderOptionInfo>{
149 "type": AbstractDataProviderType::get(StringType),
150 "desc":
"The proxy URL to use",
152 "redirect_passthru": <DataProviderOptionInfo>{
153 "type": AbstractDataProviderType::get(BoolType),
154 "desc":
"if `True` then redirect responses will be passed to the caller instead of processed",
155 "default_value": False,
157 "send_encoding": <DataProviderOptionInfo>{
158 "type": AbstractDataProviderType::get(StringType),
159 "desc":
"Sets the send encoding (if the `send_encoding` option is not set) and the requested response "
160 "encoding (note that only outgoing message bodies over `1024` bytes in size are compressed)",
164 "desc":
"use GNU zip encoding ([RFC 1952](https://tools.ietf.org/html/rfc1952))",
165 }, <AllowedValueInfo>{
167 "desc":
"use bzip2 encoding",
168 }, <AllowedValueInfo>{
170 "desc":
"use the deflate algorithm ([RFC 1951](https://tools.ietf.org/html/rfc1951))",
171 }, <AllowedValueInfo>{
173 "desc":
"use no content encoding",
177 "ssl_cert_der": <DataProviderOptionInfo>{
178 "type": AbstractDataProviderType::get(BoolType),
179 "desc":
"If `True` then the data represented by `ssl_cert_location` will be assumed to be in binary "
181 "default_value": False,
183 "ssl_cert_location": <DataProviderOptionInfo>{
184 "type": AbstractDataProviderType::get(StringType, NOTHING, {
186 DTT_FromLocation: True,
188 "desc":
"A path or location to an X.509 client certificate file",
190 "ssl_key_der": <DataProviderOptionInfo>{
191 "type": AbstractDataProviderType::get(BoolType),
192 "desc":
"If `True` then the data represented by `ssl_key_location` will be assumed to be in binary "
194 "default_value": False,
196 "ssl_key_location": <DataProviderOptionInfo>{
197 "type": AbstractDataProviderType::get(StringType, NOTHING, {
199 DTT_FromLocation: True,
201 "desc":
"A path or location to a private key file for the X.509 client certificate",
203 "ssl_key_password": <DataProviderOptionInfo>{
204 "type": AbstractDataProviderType::get(StringType),
205 "desc":
"The password to the private key given with `ssl_key_path` (text PEM format only)",
208 "ssl_verify_cert": <DataProviderOptionInfo>{
209 "type": AbstractDataProviderType::get(BoolType),
210 "desc":
"if `True` then the server's certificate will only be accepted if it's verified",
211 "default_value": False,
213 "swagger": <DataProviderOptionInfo>{
214 "type": AbstractDataProviderType::get(StringType, NOTHING, {
216 DTT_FromLocation: True,
218 "desc":
"A Swagger 2.0 schema location or file data for the REST connection",
220 "timeout": <DataProviderOptionInfo>{
221 "type": AbstractDataProviderType::get(IntType),
222 "desc":
"Transfer timeout to use in milliseconds (default: 45 seconds)",
223 "default_value": 45000,
225 "url": <DataProviderOptionInfo>{
226 "type": AbstractDataProviderType::get(StringType),
227 "desc":
"A URL for a REST or RESTS connection",
230 "validator_base_path": <DataProviderOptionInfo>{
231 "type": AbstractDataProviderType::get(StringType),
232 "desc":
"In case a REST validator is used, the base path in the schema can be overridden with this "
241 "call": Class::forName(
"RestClientDataProvider::RestClientCallDataProvider"),
242 "delete": Class::forName(
"RestClientDataProvider::RestClientDeleteDataProvider"),
243 "get": Class::forName(
"RestClientDataProvider::RestClientGetDataProvider"),
244 "head": Class::forName(
"RestClientDataProvider::RestClientHeadDataProvider"),
245 "options": Class::forName(
"RestClientDataProvider::RestClientOptionsDataProvider"),
246 "patch": Class::forName(
"RestClientDataProvider::RestClientPatchDataProvider"),
247 "post": Class::forName(
"RestClientDataProvider::RestClientPostDataProvider"),
248 "put": Class::forName(
"RestClientDataProvider::RestClientPutDataProvider"),
*list< string > getChildProviderNamesImpl()
Returns a list of child data provider names, if any.
*AbstractDataProvider getChildProviderImpl(string name)
Returns the given child provider or NOTHING if the given child is unknown.
hash< DataProviderInfo > getStaticInfoImpl()
Returns data provider static info.
constructor(*hash< auto > options)
Creates the object from constructor options.
*string getDesc()
Returns the data provider description.
constructor(RestClient rest)
Creates the object from a REST connection.
string getName()
Returns the data provider name.
*list< hash< DataProviderSummaryInfo > > getChildProviderSummaryInfo()
Return data provider summary info.
static hash< auto > processRestOptions(hash< auto > options)
Processes common REST options.
static hash< auto > makeRequest(RestClient rest, string meth, *data body, string path, *hash< auto > hdr)
Makes a REST request and returns the response.
static RestClient getRestConnection(hash< auto > options)
Returns a REST connection.
Qore RestClientDataProvider module definition.
Definition: RestClientCallDataProvider.qc.dox.h:26