1. Packages
  2. Azure Native
  3. API Docs
  4. sql
  5. Job
This is the latest version of Azure Native. Use the Azure Native v1 docs if using the v1 version of this package.
Azure Native v2.47.1 published on Monday, Jun 24, 2024 by Pulumi

azure-native.sql.Job

Explore with Pulumi AI

azure-native logo
This is the latest version of Azure Native. Use the Azure Native v1 docs if using the v1 version of this package.
Azure Native v2.47.1 published on Monday, Jun 24, 2024 by Pulumi

    A job. Azure REST API version: 2021-11-01. Prior API version in Azure Native 1.x: 2020-11-01-preview.

    Other available API versions: 2022-11-01-preview, 2023-02-01-preview, 2023-05-01-preview, 2023-08-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",
        });
    
    });
    
    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());
    
        }
    }
    
    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 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 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

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new Job(name: string, args: JobArgs, opts?: CustomResourceOptions);
    @overload
    def Job(resource_name: str,
            args: JobArgs,
            opts: Optional[ResourceOptions] = None)
    
    @overload
    def Job(resource_name: str,
            opts: Optional[ResourceOptions] = None,
            job_agent_name: Optional[str] = None,
            resource_group_name: Optional[str] = None,
            server_name: Optional[str] = None,
            description: Optional[str] = None,
            job_name: Optional[str] = None,
            schedule: Optional[JobScheduleArgs] = 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.
    
    

    Parameters

    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.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var examplejobResourceResourceFromSql = new AzureNative.Sql.Job("examplejobResourceResourceFromSql", new()
    {
        JobAgentName = "string",
        ResourceGroupName = "string",
        ServerName = "string",
        Description = "string",
        JobName = "string",
        Schedule = new AzureNative.Sql.Inputs.JobScheduleArgs
        {
            Enabled = false,
            EndTime = "string",
            Interval = "string",
            StartTime = "string",
            Type = AzureNative.Sql.JobScheduleType.Once,
        },
    });
    
    example, err := sql.NewJob(ctx, "examplejobResourceResourceFromSql", &sql.JobArgs{
    JobAgentName: pulumi.String("string"),
    ResourceGroupName: pulumi.String("string"),
    ServerName: pulumi.String("string"),
    Description: pulumi.String("string"),
    JobName: pulumi.String("string"),
    Schedule: &sql.JobScheduleArgs{
    Enabled: pulumi.Bool(false),
    EndTime: pulumi.String("string"),
    Interval: pulumi.String("string"),
    StartTime: pulumi.String("string"),
    Type: sql.JobScheduleTypeOnce,
    },
    })
    
    var examplejobResourceResourceFromSql = new Job("examplejobResourceResourceFromSql", JobArgs.builder()
        .jobAgentName("string")
        .resourceGroupName("string")
        .serverName("string")
        .description("string")
        .jobName("string")
        .schedule(JobScheduleArgs.builder()
            .enabled(false)
            .endTime("string")
            .interval("string")
            .startTime("string")
            .type("Once")
            .build())
        .build());
    
    examplejob_resource_resource_from_sql = azure_native.sql.Job("examplejobResourceResourceFromSql",
        job_agent_name="string",
        resource_group_name="string",
        server_name="string",
        description="string",
        job_name="string",
        schedule=azure_native.sql.JobScheduleArgs(
            enabled=False,
            end_time="string",
            interval="string",
            start_time="string",
            type=azure_native.sql.JobScheduleType.ONCE,
        ))
    
    const examplejobResourceResourceFromSql = new azure_native.sql.Job("examplejobResourceResourceFromSql", {
        jobAgentName: "string",
        resourceGroupName: "string",
        serverName: "string",
        description: "string",
        jobName: "string",
        schedule: {
            enabled: false,
            endTime: "string",
            interval: "string",
            startTime: "string",
            type: azure_native.sql.JobScheduleType.Once,
        },
    });
    
    type: azure-native:sql:Job
    properties:
        description: string
        jobAgentName: string
        jobName: string
        resourceGroupName: string
        schedule:
            enabled: false
            endTime: string
            interval: string
            startTime: string
            type: Once
        serverName: string
    

    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.JobSchedule
    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 JobSchedule
    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 JobSchedule
    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, JobScheduleArgs

    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, JobScheduleResponseArgs

    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, JobScheduleTypeArgs

    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/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName} 
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Azure Native pulumi/pulumi-azure-native
    License
    Apache-2.0
    azure-native logo
    This is the latest version of Azure Native. Use the Azure Native v1 docs if using the v1 version of this package.
    Azure Native v2.47.1 published on Monday, Jun 24, 2024 by Pulumi