@ThreadSafe public interface InvokableScriptsApi
API invokable scripts let you assign scripts to API endpoints and then execute them as standard REST operations in InfluxDB Cloud.
| Modifier and Type | Method and Description |
|---|---|
Script |
createScript(ScriptCreateRequest createRequest)
Create a script.
|
void |
deleteScript(String scriptId)
Delete a script.
|
List<Script> |
findScripts()
List scripts.
|
List<Script> |
findScripts(InvokableScriptsQuery query)
List scripts.
|
List<FluxTable> |
invokeScript(String scriptId,
Map<String,Object> params)
Executes the script and synchronously map whole response to
List<FluxTable>. |
void |
invokeScript(String scriptId,
Map<String,Object> params,
BiConsumer<Cancellable,FluxRecord> onNext)
Executes the script and asynchronously stream
FluxRecords to onNext consumer. |
void |
invokeScript(String scriptId,
Map<String,Object> params,
BiConsumer<Cancellable,FluxRecord> onNext,
Consumer<? super Throwable> onError,
Runnable onComplete)
Executes the script and asynchronously stream
FluxRecords to onNext consumer. |
<M> List<M> |
invokeScript(String scriptId,
Map<String,Object> params,
Class<M> measurementType)
Executes the script and synchronously map whole response to list of object with given type.
|
<M> void |
invokeScript(String scriptId,
Map<String,Object> params,
Class<M> measurementType,
BiConsumer<Cancellable,M> onNext)
Executes the script and asynchronously stream POJO classes to
onNext consumer. |
<M> void |
invokeScript(String scriptId,
Map<String,Object> params,
Class<M> measurementType,
BiConsumer<Cancellable,M> onNext,
Consumer<? super Throwable> onError,
Runnable onComplete)
Executes the script and asynchronously stream POJO classes to
onNext consumer. |
String |
invokeScriptRaw(String scriptId,
Map<String,Object> params)
Executes the script and synchronously map whole response to
String result. |
void |
invokeScriptRaw(String scriptId,
Map<String,Object> params,
BiConsumer<Cancellable,String> onResponse)
Executes the script and asynchronously stream response (line by line) to
onResponse. |
void |
invokeScriptRaw(String scriptId,
Map<String,Object> params,
BiConsumer<Cancellable,String> onResponse,
Consumer<? super Throwable> onError,
Runnable onComplete)
Executes the script and asynchronously stream response (line by line) to
onResponse. |
Script |
updateScript(String scriptId,
ScriptUpdateRequest updateRequest)
Update a script.
|
@Nonnull Script createScript(@Nonnull ScriptCreateRequest createRequest)
createRequest - The script to create. (required)@Nonnull Script updateScript(@Nonnull String scriptId, @Nonnull ScriptUpdateRequest updateRequest)
scriptId - The ID of the script to update. (required)updateRequest - Script updates to apply (required)@Nonnull List<Script> findScripts(@Nonnull InvokableScriptsQuery query)
query - to filtering resultsvoid deleteScript(@Nonnull String scriptId)
scriptId - The ID of the script to delete. (required)@Nonnull List<FluxTable> invokeScript(@Nonnull String scriptId, @Nullable Map<String,Object> params)
List<FluxTable>.
NOTE: This method is not intended for large query results.
Use invokeScript(String, Map, BiConsumer, Consumer, Runnable)
for large data streaming.
scriptId - The ID of the script to invoke. (required)params - bind parametersList<FluxTable>void invokeScript(@Nonnull String scriptId, @Nullable Map<String,Object> params, @Nonnull BiConsumer<Cancellable,FluxRecord> onNext)
FluxRecords to onNext consumer.scriptId - The ID of the script to invoke. (required)params - bind parametersonNext - the callback to consume the FluxRecord result with capability
to discontinue a streaming invocationvoid invokeScript(@Nonnull String scriptId, @Nullable Map<String,Object> params, @Nonnull BiConsumer<Cancellable,FluxRecord> onNext, @Nonnull Consumer<? super Throwable> onError, @Nonnull Runnable onComplete)
FluxRecords to onNext consumer.scriptId - The ID of the script to invoke. (required)params - bind parametersonNext - the callback to consume the FluxRecord result with capability
to discontinue a streaming invocationonError - the callback to consume any error notificationonComplete - the callback to consume a notification about successfully end of stream@Nonnull <M> List<M> invokeScript(@Nonnull String scriptId, @Nullable Map<String,Object> params, @Nonnull Class<M> measurementType)
NOTE: This method is not intended for large query results.
Use invokeScript(String, Map, Class, BiConsumer, Consumer, Runnable)
for large data streaming.
M - the type of the measurement (POJO)scriptId - The ID of the script to invoke. (required)params - bind parametersmeasurementType - the type of measurementList<T><M> void invokeScript(@Nonnull String scriptId, @Nullable Map<String,Object> params, @Nonnull Class<M> measurementType, @Nonnull BiConsumer<Cancellable,M> onNext)
onNext consumer.M - the type of the measurement (POJO)scriptId - The ID of the script to invoke. (required)params - bind parametersmeasurementType - the type of measurementonNext - the callback to consume the mapped Measurements with capability to discontinue
a streaming invocation<M> void invokeScript(@Nonnull String scriptId, @Nullable Map<String,Object> params, @Nonnull Class<M> measurementType, @Nonnull BiConsumer<Cancellable,M> onNext, @Nonnull Consumer<? super Throwable> onError, @Nonnull Runnable onComplete)
onNext consumer.M - the type of the measurement (POJO)scriptId - The ID of the script to invoke. (required)params - bind parametersmeasurementType - the type of measurementonNext - the callback to consume the mapped Measurements with capability to discontinue
a streaming invocationonError - the callback to consume any error notificationonComplete - the callback to consume a notification about successfully end of stream@Nonnull String invokeScriptRaw(@Nonnull String scriptId, @Nullable Map<String,Object> params)
String result.
NOTE: This method is not intended for large query results.
Use invokeScriptRaw(String, Map, BiConsumer, Consumer, Runnable)
for large data streaming.
scriptId - The ID of the script to invoke. (required)params - bind parametersvoid invokeScriptRaw(@Nonnull String scriptId, @Nullable Map<String,Object> params, @Nonnull BiConsumer<Cancellable,String> onResponse)
onResponse.scriptId - The ID of the script to invoke. (required)params - bind parametersonResponse - callback to consume the response line by line with capability to discontinue a streaming queryvoid invokeScriptRaw(@Nonnull String scriptId, @Nullable Map<String,Object> params, @Nonnull BiConsumer<Cancellable,String> onResponse, @Nonnull Consumer<? super Throwable> onError, @Nonnull Runnable onComplete)
onResponse.scriptId - The ID of the script to invoke. (required)params - bind parametersonResponse - callback to consume the response line by line with capability to discontinue a streaming queryonError - the callback to consume any error notificationonComplete - the callback to consume a notification about successfully end of streamCopyright © 2018–2023 InfluxData, Inc.. All rights reserved.