azure-native.sql.Job
Explore with Pulumi AI
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, 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",
});
});
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={
"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)
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={
"enabled": False,
"endTime": "string",
"interval": "string",
"startTime": "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:
- Job
Agent stringName - The name of the job agent.
- Resource
Group stringName - 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 string - The name of the server.
- Description string
- User-defined description of the job.
- Job
Name string - The name of the job to get.
- Schedule
Pulumi.
Azure Native. Sql. Inputs. Job Schedule - Schedule properties of the job.
- Job
Agent stringName - The name of the job agent.
- Resource
Group stringName - 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 string - The name of the server.
- Description string
- User-defined description of the job.
- Job
Name string - The name of the job to get.
- Schedule
Job
Schedule Args - Schedule properties of the job.
- job
Agent StringName - The name of the job agent.
- resource
Group StringName - 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 String - The name of the server.
- description String
- User-defined description of the job.
- job
Name String - The name of the job to get.
- schedule
Job
Schedule - Schedule properties of the job.
- job
Agent stringName - The name of the job agent.
- resource
Group stringName - 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 string - The name of the server.
- description string
- User-defined description of the job.
- job
Name string - The name of the job to get.
- schedule
Job
Schedule - Schedule properties of the job.
- job_
agent_ strname - The name of the job agent.
- resource_
group_ strname - 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
Job
Schedule Args - Schedule properties of the job.
- job
Agent StringName - The name of the job agent.
- resource
Group StringName - 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 String - The name of the server.
- description String
- User-defined description of the job.
- job
Name 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:
Supporting Types
JobSchedule, JobScheduleArgs
- Enabled bool
- Whether or not the schedule is enabled.
- End
Time string - Schedule end time.
- Interval string
- Value of the schedule's recurring interval, if the ScheduleType is recurring. ISO8601 duration format.
- Start
Time string - Schedule start time.
- Type
Pulumi.
Azure Native. Sql. Job Schedule Type - 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
Job
Schedule Type - Schedule interval type
JobScheduleResponse, JobScheduleResponseArgs
- 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
JobScheduleType, JobScheduleTypeArgs
- Once
- Once
- Recurring
- Recurring
- Job
Schedule Type Once - Once
- Job
Schedule Type Recurring - 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