azure-native.sql.Job

Explore with Pulumi AI

A job. API Version: 2020-11-01-preview.

Example Usage

Create a job with all properties specified

using System.Collections.Generic;
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/go/azure/sql"
	"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 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(Map.ofEntries(
                Map.entry("enabled", true),
                Map.entry("endTime", "2015-09-24T23:59:59Z"),
                Map.entry("interval", "PT5M"),
                Map.entry("startTime", "2015-09-24T18:30:01Z"),
                Map.entry("type", "Recurring")
            ))
            .serverName("server1")
            .build());

    }
}
import pulumi
import pulumi_azure_native as azure_native

job = azure_native.sql.Job("job",
    description="my favourite job",
    job_agent_name="agent1",
    job_name="job1",
    resource_group_name="group1",
    schedule=azure_native.sql.JobScheduleArgs(
        enabled=True,
        end_time="2015-09-24T23:59:59Z",
        interval="PT5M",
        start_time="2015-09-24T18:30:01Z",
        type=azure_native.sql.JobScheduleType.RECURRING,
    ),
    server_name="server1")
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";

const job = new azure_native.sql.Job("job", {
    description: "my favourite job",
    jobAgentName: "agent1",
    jobName: "job1",
    resourceGroupName: "group1",
    schedule: {
        enabled: true,
        endTime: "2015-09-24T23:59:59Z",
        interval: "PT5M",
        startTime: "2015-09-24T18:30:01Z",
        type: azure_native.sql.JobScheduleType.Recurring,
    },
    serverName: "server1",
});
resources:
  job:
    type: azure-native:sql:Job
    properties:
      description: my favourite job
      jobAgentName: agent1
      jobName: job1
      resourceGroupName: group1
      schedule:
        enabled: true
        endTime: 2015-09-24T23:59:59Z
        interval: PT5M
        startTime: 2015-09-24T18:30:01Z
        type: Recurring
      serverName: server1

Create a job with default properties

using System.Collections.Generic;
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/go/azure/sql"
	"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 pulumi
import pulumi_azure_native as azure_native

job = azure_native.sql.Job("job",
    job_agent_name="agent1",
    job_name="job1",
    resource_group_name="group1",
    server_name="server1")
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";

const job = new azure_native.sql.Job("job", {
    jobAgentName: "agent1",
    jobName: "job1",
    resourceGroupName: "group1",
    serverName: "server1",
});
resources:
  job:
    type: azure-native:sql:Job
    properties:
      jobAgentName: agent1
      jobName: job1
      resourceGroupName: group1
      serverName: server1

Create Job Resource

new Job(name: string, args: JobArgs, opts?: CustomResourceOptions);
@overload
def Job(resource_name: str,
        opts: Optional[ResourceOptions] = None,
        description: Optional[str] = None,
        job_agent_name: Optional[str] = None,
        job_name: Optional[str] = None,
        resource_group_name: Optional[str] = None,
        schedule: Optional[JobScheduleArgs] = None,
        server_name: Optional[str] = None)
@overload
def Job(resource_name: str,
        args: JobArgs,
        opts: Optional[ResourceOptions] = None)
func NewJob(ctx *Context, name string, args JobArgs, opts ...ResourceOption) (*Job, error)
public Job(string name, JobArgs args, CustomResourceOptions? opts = null)
public Job(String name, JobArgs args)
public Job(String name, JobArgs args, CustomResourceOptions options)
type: azure-native:sql:Job
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args JobArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args JobArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args JobArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args JobArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args JobArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Job Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The Job resource accepts the following input properties:

JobAgentName string

The name of the job agent.

ResourceGroupName string

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

ServerName string

The name of the server.

Description string

User-defined description of the job.

JobName string

The name of the job to get.

Schedule Pulumi.AzureNative.Sql.Inputs.JobScheduleArgs

Schedule properties of the job.

JobAgentName string

The name of the job agent.

ResourceGroupName string

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

ServerName string

The name of the server.

Description string

User-defined description of the job.

JobName string

The name of the job to get.

Schedule JobScheduleArgs

Schedule properties of the job.

jobAgentName String

The name of the job agent.

resourceGroupName String

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

serverName String

The name of the server.

description String

User-defined description of the job.

jobName String

The name of the job to get.

schedule JobScheduleArgs

Schedule properties of the job.

jobAgentName string

The name of the job agent.

resourceGroupName string

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

serverName string

The name of the server.

description string

User-defined description of the job.

jobName string

The name of the job to get.

schedule JobScheduleArgs

Schedule properties of the job.

job_agent_name str

The name of the job agent.

resource_group_name str

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

server_name str

The name of the server.

description str

User-defined description of the job.

job_name str

The name of the job to get.

schedule JobScheduleArgs

Schedule properties of the job.

jobAgentName String

The name of the job agent.

resourceGroupName String

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

serverName String

The name of the server.

description String

User-defined description of the job.

jobName String

The name of the job to get.

schedule Property Map

Schedule properties of the job.

Outputs

All input properties are implicitly available as output properties. Additionally, the Job resource produces the following output properties:

Id string

The provider-assigned unique ID for this managed resource.

Name string

Resource name.

Type string

Resource type.

Version int

The job version number.

Id string

The provider-assigned unique ID for this managed resource.

Name string

Resource name.

Type string

Resource type.

Version int

The job version number.

id String

The provider-assigned unique ID for this managed resource.

name String

Resource name.

type String

Resource type.

version Integer

The job version number.

id string

The provider-assigned unique ID for this managed resource.

name string

Resource name.

type string

Resource type.

version number

The job version number.

id str

The provider-assigned unique ID for this managed resource.

name str

Resource name.

type str

Resource type.

version int

The job version number.

id String

The provider-assigned unique ID for this managed resource.

name String

Resource name.

type String

Resource type.

version Number

The job version number.

Supporting Types

JobSchedule

Enabled bool

Whether or not the schedule is enabled.

EndTime string

Schedule end time.

Interval string

Value of the schedule's recurring interval, if the ScheduleType is recurring. ISO8601 duration format.

StartTime string

Schedule start time.

Type Pulumi.AzureNative.Sql.JobScheduleType

Schedule interval type

Enabled bool

Whether or not the schedule is enabled.

EndTime string

Schedule end time.

Interval string

Value of the schedule's recurring interval, if the ScheduleType is recurring. ISO8601 duration format.

StartTime string

Schedule start time.

Type JobScheduleType

Schedule interval type

enabled Boolean

Whether or not the schedule is enabled.

endTime String

Schedule end time.

interval String

Value of the schedule's recurring interval, if the ScheduleType is recurring. ISO8601 duration format.

startTime String

Schedule start time.

type JobScheduleType

Schedule interval type

enabled boolean

Whether or not the schedule is enabled.

endTime string

Schedule end time.

interval string

Value of the schedule's recurring interval, if the ScheduleType is recurring. ISO8601 duration format.

startTime string

Schedule start time.

type JobScheduleType

Schedule interval type

enabled bool

Whether or not the schedule is enabled.

end_time str

Schedule end time.

interval str

Value of the schedule's recurring interval, if the ScheduleType is recurring. ISO8601 duration format.

start_time str

Schedule start time.

type JobScheduleType

Schedule interval type

enabled Boolean

Whether or not the schedule is enabled.

endTime String

Schedule end time.

interval String

Value of the schedule's recurring interval, if the ScheduleType is recurring. ISO8601 duration format.

startTime String

Schedule start time.

type "Once" | "Recurring"

Schedule interval type

JobScheduleResponse

Enabled bool

Whether or not the schedule is enabled.

EndTime string

Schedule end time.

Interval string

Value of the schedule's recurring interval, if the ScheduleType is recurring. ISO8601 duration format.

StartTime string

Schedule start time.

Type string

Schedule interval type

Enabled bool

Whether or not the schedule is enabled.

EndTime string

Schedule end time.

Interval string

Value of the schedule's recurring interval, if the ScheduleType is recurring. ISO8601 duration format.

StartTime string

Schedule start time.

Type string

Schedule interval type

enabled Boolean

Whether or not the schedule is enabled.

endTime String

Schedule end time.

interval String

Value of the schedule's recurring interval, if the ScheduleType is recurring. ISO8601 duration format.

startTime String

Schedule start time.

type String

Schedule interval type

enabled boolean

Whether or not the schedule is enabled.

endTime string

Schedule end time.

interval string

Value of the schedule's recurring interval, if the ScheduleType is recurring. ISO8601 duration format.

startTime string

Schedule start time.

type string

Schedule interval type

enabled bool

Whether or not the schedule is enabled.

end_time str

Schedule end time.

interval str

Value of the schedule's recurring interval, if the ScheduleType is recurring. ISO8601 duration format.

start_time str

Schedule start time.

type str

Schedule interval type

enabled Boolean

Whether or not the schedule is enabled.

endTime String

Schedule end time.

interval String

Value of the schedule's recurring interval, if the ScheduleType is recurring. ISO8601 duration format.

startTime String

Schedule start time.

type String

Schedule interval type

JobScheduleType

Once
Once
Recurring
Recurring
JobScheduleTypeOnce
Once
JobScheduleTypeRecurring
Recurring
Once
Once
Recurring
Recurring
Once
Once
Recurring
Recurring
ONCE
Once
RECURRING
Recurring
"Once"
Once
"Recurring"
Recurring

Import

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

$ pulumi import azure-native:sql:Job job1 /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/jobs/job1 

Package Details

Repository
Azure Native pulumi/pulumi-azure-native
License
Apache-2.0