com.pulumi.azure.streamanalytics.kotlin.FunctionJavascriptUdaArgs.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-azure-kotlin Show documentation
Show all versions of pulumi-azure-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azure.streamanalytics.kotlin
import com.pulumi.azure.streamanalytics.FunctionJavascriptUdaArgs.builder
import com.pulumi.azure.streamanalytics.kotlin.inputs.FunctionJavascriptUdaInputArgs
import com.pulumi.azure.streamanalytics.kotlin.inputs.FunctionJavascriptUdaInputArgsBuilder
import com.pulumi.azure.streamanalytics.kotlin.inputs.FunctionJavascriptUdaOutputArgs
import com.pulumi.azure.streamanalytics.kotlin.inputs.FunctionJavascriptUdaOutputArgsBuilder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName
/**
* Manages a JavaScript UDA Function within a Stream Analytics Streaming Job.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azure from "@pulumi/azure";
* const example = azure.core.getResourceGroup({
* name: "example-resources",
* });
* const exampleGetJob = example.then(example => azure.streamanalytics.getJob({
* name: "example-job",
* resourceGroupName: example.name,
* }));
* const exampleFunctionJavascriptUda = new azure.streamanalytics.FunctionJavascriptUda("example", {
* name: "example-javascript-function",
* streamAnalyticsJobId: exampleGetJob.then(exampleGetJob => exampleGetJob.id),
* script: `function main() {
* this.init = function () {
* this.state = 0;
* }
* this.accumulate = function (value, timestamp) {
* this.state += value;
* }
* this.computeResult = function () {
* return this.state;
* }
* }
* `,
* inputs: [{
* type: "bigint",
* }],
* output: {
* type: "bigint",
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_azure as azure
* example = azure.core.get_resource_group(name="example-resources")
* example_get_job = azure.streamanalytics.get_job(name="example-job",
* resource_group_name=example.name)
* example_function_javascript_uda = azure.streamanalytics.FunctionJavascriptUda("example",
* name="example-javascript-function",
* stream_analytics_job_id=example_get_job.id,
* script="""function main() {
* this.init = function () {
* this.state = 0;
* }
* this.accumulate = function (value, timestamp) {
* this.state += value;
* }
* this.computeResult = function () {
* return this.state;
* }
* }
* """,
* inputs=[azure.streamanalytics.FunctionJavascriptUdaInputArgs(
* type="bigint",
* )],
* output=azure.streamanalytics.FunctionJavascriptUdaOutputArgs(
* type="bigint",
* ))
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Azure = Pulumi.Azure;
* return await Deployment.RunAsync(() =>
* {
* var example = Azure.Core.GetResourceGroup.Invoke(new()
* {
* Name = "example-resources",
* });
* var exampleGetJob = Azure.StreamAnalytics.GetJob.Invoke(new()
* {
* Name = "example-job",
* ResourceGroupName = example.Apply(getResourceGroupResult => getResourceGroupResult.Name),
* });
* var exampleFunctionJavascriptUda = new Azure.StreamAnalytics.FunctionJavascriptUda("example", new()
* {
* Name = "example-javascript-function",
* StreamAnalyticsJobId = exampleGetJob.Apply(getJobResult => getJobResult.Id),
* Script = @"function main() {
* this.init = function () {
* this.state = 0;
* }
* this.accumulate = function (value, timestamp) {
* this.state += value;
* }
* this.computeResult = function () {
* return this.state;
* }
* }
* ",
* Inputs = new[]
* {
* new Azure.StreamAnalytics.Inputs.FunctionJavascriptUdaInputArgs
* {
* Type = "bigint",
* },
* },
* Output = new Azure.StreamAnalytics.Inputs.FunctionJavascriptUdaOutputArgs
* {
* Type = "bigint",
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/streamanalytics"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* example, err := core.LookupResourceGroup(ctx, &core.LookupResourceGroupArgs{
* Name: "example-resources",
* }, nil)
* if err != nil {
* return err
* }
* exampleGetJob, err := streamanalytics.LookupJob(ctx, &streamanalytics.LookupJobArgs{
* Name: "example-job",
* ResourceGroupName: example.Name,
* }, nil)
* if err != nil {
* return err
* }
* _, err = streamanalytics.NewFunctionJavascriptUda(ctx, "example", &streamanalytics.FunctionJavascriptUdaArgs{
* Name: pulumi.String("example-javascript-function"),
* StreamAnalyticsJobId: pulumi.String(exampleGetJob.Id),
* Script: pulumi.String(`function main() {
* this.init = function () {
* this.state = 0;
* }
* this.accumulate = function (value, timestamp) {
* this.state += value;
* }
* this.computeResult = function () {
* return this.state;
* }
* }
* `),
* Inputs: streamanalytics.FunctionJavascriptUdaInputTypeArray{
* &streamanalytics.FunctionJavascriptUdaInputTypeArgs{
* Type: pulumi.String("bigint"),
* },
* },
* Output: &streamanalytics.FunctionJavascriptUdaOutputTypeArgs{
* Type: pulumi.String("bigint"),
* },
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azure.core.CoreFunctions;
* import com.pulumi.azure.core.inputs.GetResourceGroupArgs;
* import com.pulumi.azure.streamanalytics.StreamanalyticsFunctions;
* import com.pulumi.azure.streamanalytics.inputs.GetJobArgs;
* import com.pulumi.azure.streamanalytics.FunctionJavascriptUda;
* import com.pulumi.azure.streamanalytics.FunctionJavascriptUdaArgs;
* import com.pulumi.azure.streamanalytics.inputs.FunctionJavascriptUdaInputArgs;
* import com.pulumi.azure.streamanalytics.inputs.FunctionJavascriptUdaOutputArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* final var example = CoreFunctions.getResourceGroup(GetResourceGroupArgs.builder()
* .name("example-resources")
* .build());
* final var exampleGetJob = StreamanalyticsFunctions.getJob(GetJobArgs.builder()
* .name("example-job")
* .resourceGroupName(example.applyValue(getResourceGroupResult -> getResourceGroupResult.name()))
* .build());
* var exampleFunctionJavascriptUda = new FunctionJavascriptUda("exampleFunctionJavascriptUda", FunctionJavascriptUdaArgs.builder()
* .name("example-javascript-function")
* .streamAnalyticsJobId(exampleGetJob.applyValue(getJobResult -> getJobResult.id()))
* .script("""
* function main() {
* this.init = function () {
* this.state = 0;
* }
* this.accumulate = function (value, timestamp) {
* this.state += value;
* }
* this.computeResult = function () {
* return this.state;
* }
* }
* """)
* .inputs(FunctionJavascriptUdaInputArgs.builder()
* .type("bigint")
* .build())
* .output(FunctionJavascriptUdaOutputArgs.builder()
* .type("bigint")
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* exampleFunctionJavascriptUda:
* type: azure:streamanalytics:FunctionJavascriptUda
* name: example
* properties:
* name: example-javascript-function
* streamAnalyticsJobId: ${exampleGetJob.id}
* script: |
* function main() {
* this.init = function () {
* this.state = 0;
* }
* this.accumulate = function (value, timestamp) {
* this.state += value;
* }
* this.computeResult = function () {
* return this.state;
* }
* }
* inputs:
* - type: bigint
* output:
* type: bigint
* variables:
* example:
* fn::invoke:
* Function: azure:core:getResourceGroup
* Arguments:
* name: example-resources
* exampleGetJob:
* fn::invoke:
* Function: azure:streamanalytics:getJob
* Arguments:
* name: example-job
* resourceGroupName: ${example.name}
* ```
*
* ## Import
* Stream Analytics JavaScript UDA Functions can be imported using the `resource id`, e.g.
* ```sh
* $ pulumi import azure:streamanalytics/functionJavascriptUda:FunctionJavascriptUda example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.StreamAnalytics/streamingJobs/job1/functions/func1
* ```
* @property inputs One or more `input` blocks as defined below.
* @property name The name of the JavaScript UDA Function. Changing this forces a new resource to be created.
* @property output An `output` block as defined below.
* @property script The JavaScript of this UDA Function.
* @property streamAnalyticsJobId The resource ID of the Stream Analytics Job where this Function should be created. Changing this forces a new resource to be created.
*/
public data class FunctionJavascriptUdaArgs(
public val inputs: Output>? = null,
public val name: Output? = null,
public val output: Output? = null,
public val script: Output? = null,
public val streamAnalyticsJobId: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.azure.streamanalytics.FunctionJavascriptUdaArgs =
com.pulumi.azure.streamanalytics.FunctionJavascriptUdaArgs.builder()
.inputs(inputs?.applyValue({ args0 -> args0.map({ args0 -> args0.let({ args0 -> args0.toJava() }) }) }))
.name(name?.applyValue({ args0 -> args0 }))
.output(output?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
.script(script?.applyValue({ args0 -> args0 }))
.streamAnalyticsJobId(streamAnalyticsJobId?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [FunctionJavascriptUdaArgs].
*/
@PulumiTagMarker
public class FunctionJavascriptUdaArgsBuilder internal constructor() {
private var inputs: Output>? = null
private var name: Output? = null
private var output: Output? = null
private var script: Output? = null
private var streamAnalyticsJobId: Output? = null
/**
* @param value One or more `input` blocks as defined below.
*/
@JvmName("fchhogjhvpnhrwdd")
public suspend fun inputs(`value`: Output>) {
this.inputs = value
}
@JvmName("oxoxuvsqekvdydso")
public suspend fun inputs(vararg values: Output) {
this.inputs = Output.all(values.asList())
}
/**
* @param values One or more `input` blocks as defined below.
*/
@JvmName("ylusywmrpwdphpni")
public suspend fun inputs(values: List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy