JobArgs

data class JobArgs(val description: Output<String>? = null, val jobAgentName: Output<String>? = null, val jobName: Output<String>? = null, val resourceGroupName: Output<String>? = null, val schedule: Output<JobScheduleArgs>? = null, val serverName: Output<String>? = null) : ConvertibleToJava<JobArgs>

A job. Uses Azure REST API version 2023-08-01. In version 2.x of the Azure Native provider, it used API version 2021-11-01. Other available API versions: 2017-03-01-preview, 2020-02-02-preview, 2020-08-01-preview, 2020-11-01-preview, 2021-02-01-preview, 2021-05-01-preview, 2021-08-01-preview, 2021-11-01, 2021-11-01-preview, 2022-02-01-preview, 2022-05-01-preview, 2022-08-01-preview, 2022-11-01-preview, 2023-02-01-preview, 2023-05-01-preview, 2023-08-01-preview, 2024-05-01-preview. These can be accessed by generating a local SDK package using the CLI command pulumi package add azure-native sql [ApiVersion]. See the ../../../version-guide/#accessing-any-api-version-via-local-packages for details.

Example Usage

Create a job with all properties specified

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var job = new AzureNative.Sql.Job("job", new()
{
Description = "my favourite job",
JobAgentName = "agent1",
JobName = "job1",
ResourceGroupName = "group1",
Schedule = new AzureNative.Sql.Inputs.JobScheduleArgs
{
Enabled = true,
EndTime = "2015-09-24T23:59:59Z",
Interval = "PT5M",
StartTime = "2015-09-24T18:30:01Z",
Type = AzureNative.Sql.JobScheduleType.Recurring,
},
ServerName = "server1",
});
});
package main
import (
sql "github.com/pulumi/pulumi-azure-native-sdk/sql/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := sql.NewJob(ctx, "job", &sql.JobArgs{
Description: pulumi.String("my favourite job"),
JobAgentName: pulumi.String("agent1"),
JobName: pulumi.String("job1"),
ResourceGroupName: pulumi.String("group1"),
Schedule: &sql.JobScheduleArgs{
Enabled: pulumi.Bool(true),
EndTime: pulumi.String("2015-09-24T23:59:59Z"),
Interval: pulumi.String("PT5M"),
StartTime: pulumi.String("2015-09-24T18:30:01Z"),
Type: sql.JobScheduleTypeRecurring,
},
ServerName: pulumi.String("server1"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.sql.Job;
import com.pulumi.azurenative.sql.JobArgs;
import com.pulumi.azurenative.sql.inputs.JobScheduleArgs;
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) {
var job = new Job("job", JobArgs.builder()
.description("my favourite job")
.jobAgentName("agent1")
.jobName("job1")
.resourceGroupName("group1")
.schedule(JobScheduleArgs.builder()
.enabled(true)
.endTime("2015-09-24T23:59:59Z")
.interval("PT5M")
.startTime("2015-09-24T18:30:01Z")
.type("Recurring")
.build())
.serverName("server1")
.build());
}
}

Create a job with default properties

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var job = new AzureNative.Sql.Job("job", new()
{
JobAgentName = "agent1",
JobName = "job1",
ResourceGroupName = "group1",
ServerName = "server1",
});
});
package main
import (
sql "github.com/pulumi/pulumi-azure-native-sdk/sql/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := sql.NewJob(ctx, "job", &sql.JobArgs{
JobAgentName: pulumi.String("agent1"),
JobName: pulumi.String("job1"),
ResourceGroupName: pulumi.String("group1"),
ServerName: pulumi.String("server1"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.sql.Job;
import com.pulumi.azurenative.sql.JobArgs;
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) {
var job = new Job("job", JobArgs.builder()
.jobAgentName("agent1")
.jobName("job1")
.resourceGroupName("group1")
.serverName("server1")
.build());
}
}

Import

An existing resource can be imported using its type token, name, and identifier, e.g.

$ pulumi import azure-native:sql:Job job1 /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}

Constructors

Link copied to clipboard
constructor(description: Output<String>? = null, jobAgentName: Output<String>? = null, jobName: Output<String>? = null, resourceGroupName: Output<String>? = null, schedule: Output<JobScheduleArgs>? = null, serverName: Output<String>? = null)

Properties

Link copied to clipboard
val description: Output<String>? = null

User-defined description of the job.

Link copied to clipboard
val jobAgentName: Output<String>? = null

The name of the job agent.

Link copied to clipboard
val jobName: Output<String>? = null

The name of the job to get.

Link copied to clipboard
val resourceGroupName: Output<String>? = null

The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.

Link copied to clipboard
val schedule: Output<JobScheduleArgs>? = null

Schedule properties of the job.

Link copied to clipboard
val serverName: Output<String>? = null

The name of the server.

Functions

Link copied to clipboard
open override fun toJava(): JobArgs