@pulumiverse/grafana
Version:
A Pulumi package for creating and managing grafana.
169 lines (168 loc) • 5.99 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "../types/input";
import * as outputs from "../types/output";
/**
* Retrieves a k6 schedule.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as grafana from "@pulumiverse/grafana";
*
* const scheduleProject = new grafana.k6.Project("schedule_project", {name: "Terraform Schedule Test Project"});
* const scheduleLoadTest = new grafana.k6.LoadTest("schedule_load_test", {
* projectId: scheduleProject.id,
* name: "Terraform Test Load Test for Schedule",
* script: `export default function() {
* console.log('Hello from k6 schedule test!');
* }
* `,
* }, {
* dependsOn: [scheduleProject],
* });
* const testSchedule = new grafana.k6.Schedule("test_schedule", {
* loadTestId: scheduleLoadTest.id,
* starts: "2024-12-25T10:00:00Z",
* recurrenceRule: {
* frequency: "MONTHLY",
* interval: 12,
* count: 100,
* },
* }, {
* dependsOn: [scheduleLoadTest],
* });
* const fromLoadTest = grafana.k6.getScheduleOutput({
* loadTestId: scheduleLoadTest.id,
* });
* export const completeScheduleInfo = {
* id: fromLoadTest.apply(fromLoadTest => fromLoadTest.id),
* loadTestId: fromLoadTest.apply(fromLoadTest => fromLoadTest.loadTestId),
* starts: fromLoadTest.apply(fromLoadTest => fromLoadTest.starts),
* deactivated: fromLoadTest.apply(fromLoadTest => fromLoadTest.deactivated),
* nextRun: fromLoadTest.apply(fromLoadTest => fromLoadTest.nextRun),
* createdBy: fromLoadTest.apply(fromLoadTest => fromLoadTest.createdBy),
* recurrenceRule: fromLoadTest.apply(fromLoadTest => fromLoadTest.recurrenceRule),
* cron: fromLoadTest.apply(fromLoadTest => fromLoadTest.cron),
* };
* ```
*/
export declare function getSchedule(args: GetScheduleArgs, opts?: pulumi.InvokeOptions): Promise<GetScheduleResult>;
/**
* A collection of arguments for invoking getSchedule.
*/
export interface GetScheduleArgs {
/**
* The cron schedule to trigger the test periodically. If null, the test will run only once on the 'starts' date.
*/
cron?: inputs.k6.GetScheduleCron;
/**
* The identifier of the load test to retrieve the schedule for.
*/
loadTestId: string;
/**
* The schedule recurrence settings. If null, the test will run only once on the starts date.
*/
recurrenceRule?: inputs.k6.GetScheduleRecurrenceRule;
}
/**
* A collection of values returned by getSchedule.
*/
export interface GetScheduleResult {
/**
* The email of the user who created the schedule.
*/
readonly createdBy: string;
/**
* The cron schedule to trigger the test periodically. If null, the test will run only once on the 'starts' date.
*/
readonly cron?: outputs.k6.GetScheduleCron;
/**
* Whether the schedule is deactivated.
*/
readonly deactivated: boolean;
/**
* Numeric identifier of the schedule.
*/
readonly id: string;
/**
* The identifier of the load test to retrieve the schedule for.
*/
readonly loadTestId: string;
/**
* The next scheduled execution time.
*/
readonly nextRun: string;
/**
* The schedule recurrence settings. If null, the test will run only once on the starts date.
*/
readonly recurrenceRule?: outputs.k6.GetScheduleRecurrenceRule;
/**
* The start time for the schedule (RFC3339 format).
*/
readonly starts: string;
}
/**
* Retrieves a k6 schedule.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as grafana from "@pulumiverse/grafana";
*
* const scheduleProject = new grafana.k6.Project("schedule_project", {name: "Terraform Schedule Test Project"});
* const scheduleLoadTest = new grafana.k6.LoadTest("schedule_load_test", {
* projectId: scheduleProject.id,
* name: "Terraform Test Load Test for Schedule",
* script: `export default function() {
* console.log('Hello from k6 schedule test!');
* }
* `,
* }, {
* dependsOn: [scheduleProject],
* });
* const testSchedule = new grafana.k6.Schedule("test_schedule", {
* loadTestId: scheduleLoadTest.id,
* starts: "2024-12-25T10:00:00Z",
* recurrenceRule: {
* frequency: "MONTHLY",
* interval: 12,
* count: 100,
* },
* }, {
* dependsOn: [scheduleLoadTest],
* });
* const fromLoadTest = grafana.k6.getScheduleOutput({
* loadTestId: scheduleLoadTest.id,
* });
* export const completeScheduleInfo = {
* id: fromLoadTest.apply(fromLoadTest => fromLoadTest.id),
* loadTestId: fromLoadTest.apply(fromLoadTest => fromLoadTest.loadTestId),
* starts: fromLoadTest.apply(fromLoadTest => fromLoadTest.starts),
* deactivated: fromLoadTest.apply(fromLoadTest => fromLoadTest.deactivated),
* nextRun: fromLoadTest.apply(fromLoadTest => fromLoadTest.nextRun),
* createdBy: fromLoadTest.apply(fromLoadTest => fromLoadTest.createdBy),
* recurrenceRule: fromLoadTest.apply(fromLoadTest => fromLoadTest.recurrenceRule),
* cron: fromLoadTest.apply(fromLoadTest => fromLoadTest.cron),
* };
* ```
*/
export declare function getScheduleOutput(args: GetScheduleOutputArgs, opts?: pulumi.InvokeOutputOptions): pulumi.Output<GetScheduleResult>;
/**
* A collection of arguments for invoking getSchedule.
*/
export interface GetScheduleOutputArgs {
/**
* The cron schedule to trigger the test periodically. If null, the test will run only once on the 'starts' date.
*/
cron?: pulumi.Input<inputs.k6.GetScheduleCronArgs>;
/**
* The identifier of the load test to retrieve the schedule for.
*/
loadTestId: pulumi.Input<string>;
/**
* The schedule recurrence settings. If null, the test will run only once on the starts date.
*/
recurrenceRule?: pulumi.Input<inputs.k6.GetScheduleRecurrenceRuleArgs>;
}