1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. PtsCronJob
tencentcloud 1.81.182 published on Monday, Apr 14, 2025 by tencentcloudstack

tencentcloud.PtsCronJob

Explore with Pulumi AI

Provides a resource to create a pts cron_job

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";

const cronJob = new tencentcloud.PtsCronJob("cronJob", {
    cronExpression: "* 1 * * *",
    frequencyType: 2,
    jobOwner: "userName",
    note: "desc",
    noticeId: "notice-vp6i38jt",
    projectId: "project-7qkzxhea",
    scenarioId: "scenario-c22lqb1w",
    scenarioName: "pts-js(2022-11-10 21:53:53)",
});
Copy
import pulumi
import pulumi_tencentcloud as tencentcloud

cron_job = tencentcloud.PtsCronJob("cronJob",
    cron_expression="* 1 * * *",
    frequency_type=2,
    job_owner="userName",
    note="desc",
    notice_id="notice-vp6i38jt",
    project_id="project-7qkzxhea",
    scenario_id="scenario-c22lqb1w",
    scenario_name="pts-js(2022-11-10 21:53:53)")
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := tencentcloud.NewPtsCronJob(ctx, "cronJob", &tencentcloud.PtsCronJobArgs{
			CronExpression: pulumi.String("* 1 * * *"),
			FrequencyType:  pulumi.Float64(2),
			JobOwner:       pulumi.String("userName"),
			Note:           pulumi.String("desc"),
			NoticeId:       pulumi.String("notice-vp6i38jt"),
			ProjectId:      pulumi.String("project-7qkzxhea"),
			ScenarioId:     pulumi.String("scenario-c22lqb1w"),
			ScenarioName:   pulumi.String("pts-js(2022-11-10 21:53:53)"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Tencentcloud = Pulumi.Tencentcloud;

return await Deployment.RunAsync(() => 
{
    var cronJob = new Tencentcloud.PtsCronJob("cronJob", new()
    {
        CronExpression = "* 1 * * *",
        FrequencyType = 2,
        JobOwner = "userName",
        Note = "desc",
        NoticeId = "notice-vp6i38jt",
        ProjectId = "project-7qkzxhea",
        ScenarioId = "scenario-c22lqb1w",
        ScenarioName = "pts-js(2022-11-10 21:53:53)",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.PtsCronJob;
import com.pulumi.tencentcloud.PtsCronJobArgs;
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 cronJob = new PtsCronJob("cronJob", PtsCronJobArgs.builder()
            .cronExpression("* 1 * * *")
            .frequencyType(2)
            .jobOwner("userName")
            .note("desc")
            .noticeId("notice-vp6i38jt")
            .projectId("project-7qkzxhea")
            .scenarioId("scenario-c22lqb1w")
            .scenarioName("pts-js(2022-11-10 21:53:53)")
            .build());

    }
}
Copy
resources:
  cronJob:
    type: tencentcloud:PtsCronJob
    properties:
      cronExpression: '* 1 * * *'
      frequencyType: 2
      jobOwner: userName
      note: desc
      # end_time = ""
      noticeId: notice-vp6i38jt
      projectId: project-7qkzxhea
      scenarioId: scenario-c22lqb1w
      scenarioName: pts-js(2022-11-10 21:53:53)
Copy

Create PtsCronJob Resource

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

Constructor syntax

new PtsCronJob(name: string, args: PtsCronJobArgs, opts?: CustomResourceOptions);
@overload
def PtsCronJob(resource_name: str,
               args: PtsCronJobArgs,
               opts: Optional[ResourceOptions] = None)

@overload
def PtsCronJob(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               cron_expression: Optional[str] = None,
               frequency_type: Optional[float] = None,
               job_owner: Optional[str] = None,
               project_id: Optional[str] = None,
               scenario_id: Optional[str] = None,
               scenario_name: Optional[str] = None,
               end_time: Optional[str] = None,
               name: Optional[str] = None,
               note: Optional[str] = None,
               notice_id: Optional[str] = None,
               pts_cron_job_id: Optional[str] = None)
func NewPtsCronJob(ctx *Context, name string, args PtsCronJobArgs, opts ...ResourceOption) (*PtsCronJob, error)
public PtsCronJob(string name, PtsCronJobArgs args, CustomResourceOptions? opts = null)
public PtsCronJob(String name, PtsCronJobArgs args)
public PtsCronJob(String name, PtsCronJobArgs args, CustomResourceOptions options)
type: tencentcloud:PtsCronJob
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

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

PtsCronJob Resource Properties

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

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The PtsCronJob resource accepts the following input properties:

CronExpression This property is required. string
Cron expression, When setting cron_expression at that time, frequency_type must be greater than 1.
FrequencyType This property is required. double
Execution frequency type, 1: execute only once; 2: daily granularity; 3: weekly granularity; 4: advanced.
JobOwner This property is required. string
Job Owner.
ProjectId This property is required. string
Project Id.
ScenarioId This property is required. string
Scenario Id.
ScenarioName This property is required. string
Scenario Name.
EndTime string
End Time; type: Timestamp ISO8601.
Name string
Cron Job Name.
Note string
Note.
NoticeId string
Notice ID.
PtsCronJobId string
ID of the resource.
CronExpression This property is required. string
Cron expression, When setting cron_expression at that time, frequency_type must be greater than 1.
FrequencyType This property is required. float64
Execution frequency type, 1: execute only once; 2: daily granularity; 3: weekly granularity; 4: advanced.
JobOwner This property is required. string
Job Owner.
ProjectId This property is required. string
Project Id.
ScenarioId This property is required. string
Scenario Id.
ScenarioName This property is required. string
Scenario Name.
EndTime string
End Time; type: Timestamp ISO8601.
Name string
Cron Job Name.
Note string
Note.
NoticeId string
Notice ID.
PtsCronJobId string
ID of the resource.
cronExpression This property is required. String
Cron expression, When setting cron_expression at that time, frequency_type must be greater than 1.
frequencyType This property is required. Double
Execution frequency type, 1: execute only once; 2: daily granularity; 3: weekly granularity; 4: advanced.
jobOwner This property is required. String
Job Owner.
projectId This property is required. String
Project Id.
scenarioId This property is required. String
Scenario Id.
scenarioName This property is required. String
Scenario Name.
endTime String
End Time; type: Timestamp ISO8601.
name String
Cron Job Name.
note String
Note.
noticeId String
Notice ID.
ptsCronJobId String
ID of the resource.
cronExpression This property is required. string
Cron expression, When setting cron_expression at that time, frequency_type must be greater than 1.
frequencyType This property is required. number
Execution frequency type, 1: execute only once; 2: daily granularity; 3: weekly granularity; 4: advanced.
jobOwner This property is required. string
Job Owner.
projectId This property is required. string
Project Id.
scenarioId This property is required. string
Scenario Id.
scenarioName This property is required. string
Scenario Name.
endTime string
End Time; type: Timestamp ISO8601.
name string
Cron Job Name.
note string
Note.
noticeId string
Notice ID.
ptsCronJobId string
ID of the resource.
cron_expression This property is required. str
Cron expression, When setting cron_expression at that time, frequency_type must be greater than 1.
frequency_type This property is required. float
Execution frequency type, 1: execute only once; 2: daily granularity; 3: weekly granularity; 4: advanced.
job_owner This property is required. str
Job Owner.
project_id This property is required. str
Project Id.
scenario_id This property is required. str
Scenario Id.
scenario_name This property is required. str
Scenario Name.
end_time str
End Time; type: Timestamp ISO8601.
name str
Cron Job Name.
note str
Note.
notice_id str
Notice ID.
pts_cron_job_id str
ID of the resource.
cronExpression This property is required. String
Cron expression, When setting cron_expression at that time, frequency_type must be greater than 1.
frequencyType This property is required. Number
Execution frequency type, 1: execute only once; 2: daily granularity; 3: weekly granularity; 4: advanced.
jobOwner This property is required. String
Job Owner.
projectId This property is required. String
Project Id.
scenarioId This property is required. String
Scenario Id.
scenarioName This property is required. String
Scenario Name.
endTime String
End Time; type: Timestamp ISO8601.
name String
Cron Job Name.
note String
Note.
noticeId String
Notice ID.
ptsCronJobId String
ID of the resource.

Outputs

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

AbortReason double
Reason for suspension.
AppId double
App ID.
CreatedAt string
Creation time; type: Timestamp ISO8601.
CronJobId string
Cron job ID.
Id string
The provider-assigned unique ID for this managed resource.
Status double
Scheduled task status.
SubAccountUin string
Sub-user ID.
Uin string
User ID.
UpdatedAt string
Update time; type: Timestamp ISO8601.
AbortReason float64
Reason for suspension.
AppId float64
App ID.
CreatedAt string
Creation time; type: Timestamp ISO8601.
CronJobId string
Cron job ID.
Id string
The provider-assigned unique ID for this managed resource.
Status float64
Scheduled task status.
SubAccountUin string
Sub-user ID.
Uin string
User ID.
UpdatedAt string
Update time; type: Timestamp ISO8601.
abortReason Double
Reason for suspension.
appId Double
App ID.
createdAt String
Creation time; type: Timestamp ISO8601.
cronJobId String
Cron job ID.
id String
The provider-assigned unique ID for this managed resource.
status Double
Scheduled task status.
subAccountUin String
Sub-user ID.
uin String
User ID.
updatedAt String
Update time; type: Timestamp ISO8601.
abortReason number
Reason for suspension.
appId number
App ID.
createdAt string
Creation time; type: Timestamp ISO8601.
cronJobId string
Cron job ID.
id string
The provider-assigned unique ID for this managed resource.
status number
Scheduled task status.
subAccountUin string
Sub-user ID.
uin string
User ID.
updatedAt string
Update time; type: Timestamp ISO8601.
abort_reason float
Reason for suspension.
app_id float
App ID.
created_at str
Creation time; type: Timestamp ISO8601.
cron_job_id str
Cron job ID.
id str
The provider-assigned unique ID for this managed resource.
status float
Scheduled task status.
sub_account_uin str
Sub-user ID.
uin str
User ID.
updated_at str
Update time; type: Timestamp ISO8601.
abortReason Number
Reason for suspension.
appId Number
App ID.
createdAt String
Creation time; type: Timestamp ISO8601.
cronJobId String
Cron job ID.
id String
The provider-assigned unique ID for this managed resource.
status Number
Scheduled task status.
subAccountUin String
Sub-user ID.
uin String
User ID.
updatedAt String
Update time; type: Timestamp ISO8601.

Look up Existing PtsCronJob Resource

Get an existing PtsCronJob resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: PtsCronJobState, opts?: CustomResourceOptions): PtsCronJob
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        abort_reason: Optional[float] = None,
        app_id: Optional[float] = None,
        created_at: Optional[str] = None,
        cron_expression: Optional[str] = None,
        cron_job_id: Optional[str] = None,
        end_time: Optional[str] = None,
        frequency_type: Optional[float] = None,
        job_owner: Optional[str] = None,
        name: Optional[str] = None,
        note: Optional[str] = None,
        notice_id: Optional[str] = None,
        project_id: Optional[str] = None,
        pts_cron_job_id: Optional[str] = None,
        scenario_id: Optional[str] = None,
        scenario_name: Optional[str] = None,
        status: Optional[float] = None,
        sub_account_uin: Optional[str] = None,
        uin: Optional[str] = None,
        updated_at: Optional[str] = None) -> PtsCronJob
func GetPtsCronJob(ctx *Context, name string, id IDInput, state *PtsCronJobState, opts ...ResourceOption) (*PtsCronJob, error)
public static PtsCronJob Get(string name, Input<string> id, PtsCronJobState? state, CustomResourceOptions? opts = null)
public static PtsCronJob get(String name, Output<String> id, PtsCronJobState state, CustomResourceOptions options)
resources:  _:    type: tencentcloud:PtsCronJob    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
AbortReason double
Reason for suspension.
AppId double
App ID.
CreatedAt string
Creation time; type: Timestamp ISO8601.
CronExpression string
Cron expression, When setting cron_expression at that time, frequency_type must be greater than 1.
CronJobId string
Cron job ID.
EndTime string
End Time; type: Timestamp ISO8601.
FrequencyType double
Execution frequency type, 1: execute only once; 2: daily granularity; 3: weekly granularity; 4: advanced.
JobOwner string
Job Owner.
Name string
Cron Job Name.
Note string
Note.
NoticeId string
Notice ID.
ProjectId string
Project Id.
PtsCronJobId string
ID of the resource.
ScenarioId string
Scenario Id.
ScenarioName string
Scenario Name.
Status double
Scheduled task status.
SubAccountUin string
Sub-user ID.
Uin string
User ID.
UpdatedAt string
Update time; type: Timestamp ISO8601.
AbortReason float64
Reason for suspension.
AppId float64
App ID.
CreatedAt string
Creation time; type: Timestamp ISO8601.
CronExpression string
Cron expression, When setting cron_expression at that time, frequency_type must be greater than 1.
CronJobId string
Cron job ID.
EndTime string
End Time; type: Timestamp ISO8601.
FrequencyType float64
Execution frequency type, 1: execute only once; 2: daily granularity; 3: weekly granularity; 4: advanced.
JobOwner string
Job Owner.
Name string
Cron Job Name.
Note string
Note.
NoticeId string
Notice ID.
ProjectId string
Project Id.
PtsCronJobId string
ID of the resource.
ScenarioId string
Scenario Id.
ScenarioName string
Scenario Name.
Status float64
Scheduled task status.
SubAccountUin string
Sub-user ID.
Uin string
User ID.
UpdatedAt string
Update time; type: Timestamp ISO8601.
abortReason Double
Reason for suspension.
appId Double
App ID.
createdAt String
Creation time; type: Timestamp ISO8601.
cronExpression String
Cron expression, When setting cron_expression at that time, frequency_type must be greater than 1.
cronJobId String
Cron job ID.
endTime String
End Time; type: Timestamp ISO8601.
frequencyType Double
Execution frequency type, 1: execute only once; 2: daily granularity; 3: weekly granularity; 4: advanced.
jobOwner String
Job Owner.
name String
Cron Job Name.
note String
Note.
noticeId String
Notice ID.
projectId String
Project Id.
ptsCronJobId String
ID of the resource.
scenarioId String
Scenario Id.
scenarioName String
Scenario Name.
status Double
Scheduled task status.
subAccountUin String
Sub-user ID.
uin String
User ID.
updatedAt String
Update time; type: Timestamp ISO8601.
abortReason number
Reason for suspension.
appId number
App ID.
createdAt string
Creation time; type: Timestamp ISO8601.
cronExpression string
Cron expression, When setting cron_expression at that time, frequency_type must be greater than 1.
cronJobId string
Cron job ID.
endTime string
End Time; type: Timestamp ISO8601.
frequencyType number
Execution frequency type, 1: execute only once; 2: daily granularity; 3: weekly granularity; 4: advanced.
jobOwner string
Job Owner.
name string
Cron Job Name.
note string
Note.
noticeId string
Notice ID.
projectId string
Project Id.
ptsCronJobId string
ID of the resource.
scenarioId string
Scenario Id.
scenarioName string
Scenario Name.
status number
Scheduled task status.
subAccountUin string
Sub-user ID.
uin string
User ID.
updatedAt string
Update time; type: Timestamp ISO8601.
abort_reason float
Reason for suspension.
app_id float
App ID.
created_at str
Creation time; type: Timestamp ISO8601.
cron_expression str
Cron expression, When setting cron_expression at that time, frequency_type must be greater than 1.
cron_job_id str
Cron job ID.
end_time str
End Time; type: Timestamp ISO8601.
frequency_type float
Execution frequency type, 1: execute only once; 2: daily granularity; 3: weekly granularity; 4: advanced.
job_owner str
Job Owner.
name str
Cron Job Name.
note str
Note.
notice_id str
Notice ID.
project_id str
Project Id.
pts_cron_job_id str
ID of the resource.
scenario_id str
Scenario Id.
scenario_name str
Scenario Name.
status float
Scheduled task status.
sub_account_uin str
Sub-user ID.
uin str
User ID.
updated_at str
Update time; type: Timestamp ISO8601.
abortReason Number
Reason for suspension.
appId Number
App ID.
createdAt String
Creation time; type: Timestamp ISO8601.
cronExpression String
Cron expression, When setting cron_expression at that time, frequency_type must be greater than 1.
cronJobId String
Cron job ID.
endTime String
End Time; type: Timestamp ISO8601.
frequencyType Number
Execution frequency type, 1: execute only once; 2: daily granularity; 3: weekly granularity; 4: advanced.
jobOwner String
Job Owner.
name String
Cron Job Name.
note String
Note.
noticeId String
Notice ID.
projectId String
Project Id.
ptsCronJobId String
ID of the resource.
scenarioId String
Scenario Id.
scenarioName String
Scenario Name.
status Number
Scheduled task status.
subAccountUin String
Sub-user ID.
uin String
User ID.
updatedAt String
Update time; type: Timestamp ISO8601.

Import

pts cron_job can be imported using the projectId#cronJobId, e.g.

$ pulumi import tencentcloud:index/ptsCronJob:PtsCronJob cron_job project-7qkzxhea#scenario-c22lqb1w
Copy

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

Package Details

Repository
tencentcloud tencentcloudstack/terraform-provider-tencentcloud
License
Notes
This Pulumi package is based on the tencentcloud Terraform Provider.