Job Args
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 2021-11-01. In version 1.x of the Azure Native provider, it used API version 2020-11-01-preview. Other available API versions: 2022-11-01-preview, 2023-02-01-preview, 2023-05-01-preview, 2023-08-01, 2023-08-01-preview, 2024-05-01-preview.
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",
});
});
Content copied to clipboard
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
})
}
Content copied to clipboard
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());
}
}
Content copied to clipboard
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",
});
});
Content copied to clipboard
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
})
}
Content copied to clipboard
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());
}
}
Content copied to clipboard
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}
Content copied to clipboard
Constructors
Properties
Link copied to clipboard
User-defined description of the job.
Link copied to clipboard
The name of the job agent.
Link copied to clipboard
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
Schedule properties of the job.
Link copied to clipboard
The name of the server.