$darkmode
Qore ElasticSearchDataProvider Module Reference 1.0
ElasticSearchDocumentCreateDataProvider.qc.dox.h
1 // -*- mode: c++; indent-tabs-mode: nil -*-
3 
26 namespace ElasticSearchDataProvider {
28 
33 
34 public:
36  const ProviderInfo = <DataProviderInfo>{
37  "name": "create",
38  "desc": "ElasticSearch document create API data provider",
39  "type": "ElasticSearchDocumentCreateDataProvider",
40  "constructor_options": ElasticSearchDataProvider::ConstructorOptions,
41  "supports_request": True,
42  };
43 
45  const ProviderSummaryInfo = cast<hash<DataProviderSummaryInfo>>(ProviderInfo{
46  AbstractDataProvider::DataProviderSummaryInfoKeys
47  });
48 
51 
54 
56  const QueryArgs = ...;
57 
58 
60  constructor(*hash<auto> options);
61 
62 
65 
66 
68  string getName();
69 
70 
72  *string getDesc();
73 
74 
76 
81 protected:
82  auto doRequestImpl(auto req, *hash<auto> request_options);
83 public:
84 
85 
87 
89 protected:
91 public:
92 
93 
95 
97 protected:
99 public:
100 
101 
103  hash<DataProvider::DataProviderInfo> getStaticInfoImpl();
104 
105 };
106 
109 
110 public:
111 protected:
113  const Fields = {
114  // query parameters
115  "index": {
116  "type": StringType,
117  "desc": "The name of the index to use",
118  },
119  "if_seq_no": {
120  "type": IntOrNothingType,
121  "desc": "Only perform the operation if the document has this sequence number",
122  },
123  "if_primary_term": {
124  "type": IntOrNothingType,
125  "desc": "Only perform the operation if the document has this primary term",
126  },
127  "op_type": {
128  "type": StringOrNothingType,
129  "desc": "Set to create to only index the document if it does not already exist (put if absent). If a "
130  "document with the specified `_id` already exists, the indexing operation will fail. Same as "
131  "using the `<index>/_create` endpoint. Valid values: `index`, `create`. If document id is "
132  "specified, it defaults to `index`. Otherwise, it defaults to `create`",
133  },
134  "pipeline": {
135  "type": StringOrNothingType,
136  "desc": "ID of the pipeline to use to preprocess incoming documents. If the index has a default "
137  "ingest pipeline specified, then setting the value to _none disables the default ingest pipeline "
138  "for this request. If a final pipeline is configured it will always run, regardless of the value "
139  "of this parameter",
140  },
141  "refresh": {
142  "type": StringOrNothingType,
143  "desc": "If `true` (default: `false`), Elasticsearch refreshes the affected shards to make this operation visible to "
144  "search, if `wait_for` then wait for a refresh to make this operation visible to search, if "
145  "`false` do nothing with refreshes. Valid values: `true`, `false`, `wait_for`",
146  },
147  "routing": {
148  "type": StringOrNothingType,
149  "desc": "Custom value used to route operations to a specific shard",
150  },
151  "timeout": {
152  "type": StringOrNothingType,
153  "desc": "Period to wait for a response (default: `1m`). If no response is received before the "
154  "timeout expires, the request fails and returns an error",
155  },
156  "version": {
157  "type": IntOrNothingType,
158  "desc": "Explicit version number for concurrency control. The specified version must match the "
159  "current version of the document for the request to succeed",
160  },
161  "version_type": {
162  "type": StringOrNothingType,
163  "desc": "Specific version type: `external`, `external_gte`",
164  },
165  "wait_for_active_shards": {
166  "type": StringOrNothingType,
167  "desc": "The number of shard copies that must be active before proceeding with the operation "
168  "(default `1`). Set to `all` or any positive integer up to the total number of shards in the "
169  "index (number_of_replicas+1)",
170  },
171  "require_alias": {
172  "type": SoftBoolStringType,
173  "desc": "If `true` (default `false`), the destination must be an index alias",
174  },
175  };
176 
177 public:
178 
181 
182 };
183 
186 
187 public:
188 protected:
190  const Fields = {
191  "total": {
192  "type": IntType,
193  "desc": "Indicates how many shard copies (primary and replica shards) the index operation should be "
194  "executed on",
195  },
196  "successful": {
197  "type": IntType,
198  "desc": "Indicates the number of shard copies the index operation succeeded on. When the index "
199  "operation is successful, `successful` is at least 1.\n\n"
200  "Replica shards might not all be started when an indexing operation returns successfully; ​by "
201  "default, only the primary is required. Set `wait_for_active_shards` to change this default "
202  "behavior",
203  },
204  "failed": {
205  "type": IntType,
206  "desc": "An array that contains replication-related errors in the case an index operation failed on "
207  "a replica shard. `0` indicates there were no failures.",
208  },
209  };
210 
211 public:
212 
215 
216 };
217 
220 
221 public:
222 protected:
224  const Fields = {
225  "_index": {
226  "type": StringType,
227  "desc": "The name of the index the document was added to",
228  },
229  "_id": {
230  "type": StringType,
231  "desc": "The unique identifier for the added document",
232  },
233  "_version": {
234  "type": IntType,
235  "desc": "The document version. Incremented each time the document is updated",
236  },
237  "result": {
238  "type": StringType,
239  "desc": "The result of the indexing operation, `created` or `updated`",
240  },
241  "_shards": {
243  "desc": "Provides information about the replication process of the index operation",
244  },
245  "_seq_no": {
246  "type": IntType,
247  "desc": "The sequence number assigned to the document for the indexing operation. Sequence numbers "
248  "are used to ensure an older version of a document doesn’t overwrite a newer version",
249  },
250  "_primary_term": {
251  "type": IntType,
252  "desc": "The primary term assigned to the document for the indexing operation",
253  },
254  "_type": {
255  "type": StringOrNothingType,
256  "desc": "The document type. Elasticsearch indices now support a single document type, `_doc`"
257  },
258  };
259 
260 public:
261 
264 
265 };
266 };
The AWS REST client base data provider class.
Definition: ElasticSearchDataProviderBase.qc.dox.h:28
const ConstructorOptions
Constructor options.
Definition: ElasticSearchDataProvider.qc.dox.h:61
The ElasticSearch document create API data provider.
Definition: ElasticSearchDocumentCreateDataProvider.qc.dox.h:32
auto doRequestImpl(auto req, *hash< auto > request_options)
Makes a request and returns the response.
*string getDesc()
Returns the data provider description.
const ResponseType
Response type.
Definition: ElasticSearchDocumentCreateDataProvider.qc.dox.h:53
constructor(RestClient::RestClient rest)
Creates the object from a REST connection.
const RequestType
Request type.
Definition: ElasticSearchDocumentCreateDataProvider.qc.dox.h:50
const QueryArgs
Query args.
Definition: ElasticSearchDocumentCreateDataProvider.qc.dox.h:56
*DataProvider::AbstractDataProviderType getRequestTypeImpl()
Returns the description of a successful request message, if any.
const ProviderInfo
Provider info.
Definition: ElasticSearchDocumentCreateDataProvider.qc.dox.h:36
*DataProvider::AbstractDataProviderType getResponseTypeImpl()
Returns the description of a response message, if this object represents a response message.
hash< DataProvider::DataProviderInfo > getStaticInfoImpl()
Returns data provider static info.
constructor(*hash< auto > options)
Creates the object from constructor options.
const ProviderSummaryInfo
Provider summary info.
Definition: ElasticSearchDocumentCreateDataProvider.qc.dox.h:45
Create document request data type.
Definition: ElasticSearchDocumentCreateDataProvider.qc.dox.h:108
const Fields
Field descriptions.
Definition: ElasticSearchDocumentCreateDataProvider.qc.dox.h:113
Document create API response.
Definition: ElasticSearchDocumentCreateDataProvider.qc.dox.h:219
const Fields
Field descriptions.
Definition: ElasticSearchDocumentCreateDataProvider.qc.dox.h:224
Shard data type.
Definition: ElasticSearchDocumentCreateDataProvider.qc.dox.h:185
const Fields
Field descriptions.
Definition: ElasticSearchDocumentCreateDataProvider.qc.dox.h:190
const True
Qore ElasticSearchDataProvider module definition.
Definition: ElasticSearchAcknowledgedDataType.qc.dox.h:26
const SoftBoolStringType
Boolean string type for query parameters.
Definition: ElasticSearchDataProvider.qc.dox.h:135