Opsgenie

Pulumi Official
Package maintained by Pulumi
v1.1.5 published on Friday, Feb 18, 2022 by Pulumi

Maintenance

Manages a Maintenance within Opsgenie.

Example Usage

using Pulumi;
using Opsgenie = Pulumi.Opsgenie;

class MyStack : Stack
{
    public MyStack()
    {
        var test = new Opsgenie.Maintenance("test", new Opsgenie.MaintenanceArgs
        {
            Description = "geniemaintenance-%s",
            Rules = 
            {
                new Opsgenie.Inputs.MaintenanceRuleArgs
                {
                    Entities = 
                    {
                        new Opsgenie.Inputs.MaintenanceRuleEntityArgs
                        {
                            Id = opsgenie_email_integration.Test.Id,
                            Type = "integration",
                        },
                    },
                    State = "enabled",
                },
            },
            Times = 
            {
                new Opsgenie.Inputs.MaintenanceTimeArgs
                {
                    EndDate = "2019-06-%dT17:50:00Z",
                    StartDate = "2019-06-20T17:45:00Z",
                    Type = "schedule",
                },
            },
        });
    }

}
package main

import (
	"fmt"

	"github.com/pulumi/pulumi-opsgenie/sdk/go/opsgenie"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := opsgenie.NewMaintenance(ctx, "test", &opsgenie.MaintenanceArgs{
			Description: pulumi.String(fmt.Sprintf("%v%v%v", "geniemaintenance-", "%", "s")),
			Rules: MaintenanceRuleArray{
				&MaintenanceRuleArgs{
					Entities: MaintenanceRuleEntityArray{
						&MaintenanceRuleEntityArgs{
							Id:   pulumi.Any(opsgenie_email_integration.Test.Id),
							Type: pulumi.String("integration"),
						},
					},
					State: pulumi.String("enabled"),
				},
			},
			Times: MaintenanceTimeArray{
				&MaintenanceTimeArgs{
					EndDate:   pulumi.String(fmt.Sprintf("%v%v%v", "2019-06-", "%", "dT17:50:00Z")),
					StartDate: pulumi.String("2019-06-20T17:45:00Z"),
					Type:      pulumi.String("schedule"),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}

Coming soon!

import pulumi
import pulumi_opsgenie as opsgenie

test = opsgenie.Maintenance("test",
    description="geniemaintenance-%s",
    rules=[opsgenie.MaintenanceRuleArgs(
        entities=[opsgenie.MaintenanceRuleEntityArgs(
            id=opsgenie_email_integration["test"]["id"],
            type="integration",
        )],
        state="enabled",
    )],
    times=[opsgenie.MaintenanceTimeArgs(
        end_date="2019-06-%dT17:50:00Z",
        start_date="2019-06-20T17:45:00Z",
        type="schedule",
    )])
import * as pulumi from "@pulumi/pulumi";
import * as opsgenie from "@pulumi/opsgenie";

const test = new opsgenie.Maintenance("test", {
    description: "geniemaintenance-%s",
    rules: [{
        entities: [{
            id: opsgenie_email_integration_test.id,
            type: "integration",
        }],
        state: "enabled",
    }],
    times: [{
        endDate: "2019-06-%dT17:50:00Z",
        startDate: "2019-06-20T17:45:00Z",
        type: "schedule",
    }],
});

Coming soon!

Create a Maintenance Resource

new Maintenance(name: string, args: MaintenanceArgs, opts?: CustomResourceOptions);
@overload
def Maintenance(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                description: Optional[str] = None,
                rules: Optional[Sequence[MaintenanceRuleArgs]] = None,
                times: Optional[Sequence[MaintenanceTimeArgs]] = None)
@overload
def Maintenance(resource_name: str,
                args: MaintenanceArgs,
                opts: Optional[ResourceOptions] = None)
func NewMaintenance(ctx *Context, name string, args MaintenanceArgs, opts ...ResourceOption) (*Maintenance, error)
public Maintenance(string name, MaintenanceArgs args, CustomResourceOptions? opts = null)
public Maintenance(String name, MaintenanceArgs args)
public Maintenance(String name, MaintenanceArgs args, CustomResourceOptions options)
type: opsgenie:Maintenance
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args MaintenanceArgs
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 MaintenanceArgs
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 MaintenanceArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args MaintenanceArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args MaintenanceArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Maintenance 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 Maintenance resource accepts the following input properties:

Description string

Description for the maintenance.

Rules List<MaintenanceRuleArgs>

Rules of maintenance, which takes a list of rule objects and defines the maintenance rules over integrations and policies.

Times List<MaintenanceTimeArgs>

Time configuration of maintenance. It takes a time object which has type, startDate and endDate fields

Description string

Description for the maintenance.

Rules []MaintenanceRuleArgs

Rules of maintenance, which takes a list of rule objects and defines the maintenance rules over integrations and policies.

Times []MaintenanceTimeArgs

Time configuration of maintenance. It takes a time object which has type, startDate and endDate fields

description String

Description for the maintenance.

rules ListRuleArgs>

Rules of maintenance, which takes a list of rule objects and defines the maintenance rules over integrations and policies.

times ListTimeArgs>

Time configuration of maintenance. It takes a time object which has type, startDate and endDate fields

description string

Description for the maintenance.

rules MaintenanceRuleArgs[]

Rules of maintenance, which takes a list of rule objects and defines the maintenance rules over integrations and policies.

times MaintenanceTimeArgs[]

Time configuration of maintenance. It takes a time object which has type, startDate and endDate fields

description str

Description for the maintenance.

rules Sequence[MaintenanceRuleArgs]

Rules of maintenance, which takes a list of rule objects and defines the maintenance rules over integrations and policies.

times Sequence[MaintenanceTimeArgs]

Time configuration of maintenance. It takes a time object which has type, startDate and endDate fields

description String

Description for the maintenance.

rules List

Rules of maintenance, which takes a list of rule objects and defines the maintenance rules over integrations and policies.

times List

Time configuration of maintenance. It takes a time object which has type, startDate and endDate fields

Outputs

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

Id string

The provider-assigned unique ID for this managed resource.

Id string

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

id string

The provider-assigned unique ID for this managed resource.

id str

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

Look up an Existing Maintenance Resource

Get an existing Maintenance 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?: MaintenanceState, opts?: CustomResourceOptions): Maintenance
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        description: Optional[str] = None,
        rules: Optional[Sequence[MaintenanceRuleArgs]] = None,
        times: Optional[Sequence[MaintenanceTimeArgs]] = None) -> Maintenance
func GetMaintenance(ctx *Context, name string, id IDInput, state *MaintenanceState, opts ...ResourceOption) (*Maintenance, error)
public static Maintenance Get(string name, Input<string> id, MaintenanceState? state, CustomResourceOptions? opts = null)
public static Maintenance get(String name, Output<String> id, MaintenanceState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
name
The unique name of the resulting resource.
id
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
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
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
The unique name of the resulting resource.
id
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
The unique name of the resulting resource.
id
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:
Description string

Description for the maintenance.

Rules List<MaintenanceRuleArgs>

Rules of maintenance, which takes a list of rule objects and defines the maintenance rules over integrations and policies.

Times List<MaintenanceTimeArgs>

Time configuration of maintenance. It takes a time object which has type, startDate and endDate fields

Description string

Description for the maintenance.

Rules []MaintenanceRuleArgs

Rules of maintenance, which takes a list of rule objects and defines the maintenance rules over integrations and policies.

Times []MaintenanceTimeArgs

Time configuration of maintenance. It takes a time object which has type, startDate and endDate fields

description String

Description for the maintenance.

rules ListRuleArgs>

Rules of maintenance, which takes a list of rule objects and defines the maintenance rules over integrations and policies.

times ListTimeArgs>

Time configuration of maintenance. It takes a time object which has type, startDate and endDate fields

description string

Description for the maintenance.

rules MaintenanceRuleArgs[]

Rules of maintenance, which takes a list of rule objects and defines the maintenance rules over integrations and policies.

times MaintenanceTimeArgs[]

Time configuration of maintenance. It takes a time object which has type, startDate and endDate fields

description str

Description for the maintenance.

rules Sequence[MaintenanceRuleArgs]

Rules of maintenance, which takes a list of rule objects and defines the maintenance rules over integrations and policies.

times Sequence[MaintenanceTimeArgs]

Time configuration of maintenance. It takes a time object which has type, startDate and endDate fields

description String

Description for the maintenance.

rules List

Rules of maintenance, which takes a list of rule objects and defines the maintenance rules over integrations and policies.

times List

Time configuration of maintenance. It takes a time object which has type, startDate and endDate fields

Supporting Types

MaintenanceRule

Entities List<MaintenanceRuleEntity>

This field represents the entity that maintenance will be applied. Entity field takes two mandatory fields as id and type.

State string

State of rule that will be defined in maintenance and can take either enabled or disabled for policy type rules. This field has to be disabled for integration type entity rules.

Entities []MaintenanceRuleEntity

This field represents the entity that maintenance will be applied. Entity field takes two mandatory fields as id and type.

State string

State of rule that will be defined in maintenance and can take either enabled or disabled for policy type rules. This field has to be disabled for integration type entity rules.

entities ListRuleEntity>

This field represents the entity that maintenance will be applied. Entity field takes two mandatory fields as id and type.

state String

State of rule that will be defined in maintenance and can take either enabled or disabled for policy type rules. This field has to be disabled for integration type entity rules.

entities MaintenanceRuleEntity[]

This field represents the entity that maintenance will be applied. Entity field takes two mandatory fields as id and type.

state string

State of rule that will be defined in maintenance and can take either enabled or disabled for policy type rules. This field has to be disabled for integration type entity rules.

entities Sequence[MaintenanceRuleEntity]

This field represents the entity that maintenance will be applied. Entity field takes two mandatory fields as id and type.

state str

State of rule that will be defined in maintenance and can take either enabled or disabled for policy type rules. This field has to be disabled for integration type entity rules.

entities List

This field represents the entity that maintenance will be applied. Entity field takes two mandatory fields as id and type.

state String

State of rule that will be defined in maintenance and can take either enabled or disabled for policy type rules. This field has to be disabled for integration type entity rules.

MaintenanceRuleEntity

Id string

The id of the entity that maintenance will be applied.

Type string

This parameter defines when the maintenance will be active. It can take one of for-5-minutes, for-30-minutes, for-1-hour, indefinitely or schedule.

Id string

The id of the entity that maintenance will be applied.

Type string

This parameter defines when the maintenance will be active. It can take one of for-5-minutes, for-30-minutes, for-1-hour, indefinitely or schedule.

id String

The id of the entity that maintenance will be applied.

type String

This parameter defines when the maintenance will be active. It can take one of for-5-minutes, for-30-minutes, for-1-hour, indefinitely or schedule.

id string

The id of the entity that maintenance will be applied.

type string

This parameter defines when the maintenance will be active. It can take one of for-5-minutes, for-30-minutes, for-1-hour, indefinitely or schedule.

id str

The id of the entity that maintenance will be applied.

type str

This parameter defines when the maintenance will be active. It can take one of for-5-minutes, for-30-minutes, for-1-hour, indefinitely or schedule.

id String

The id of the entity that maintenance will be applied.

type String

This parameter defines when the maintenance will be active. It can take one of for-5-minutes, for-30-minutes, for-1-hour, indefinitely or schedule.

MaintenanceTime

Type string

This parameter defines when the maintenance will be active. It can take one of for-5-minutes, for-30-minutes, for-1-hour, indefinitely or schedule.

EndDate string

This parameter takes a date format as (yyyy-MM-dd'T'HH:mm:ssZ) (e.g. 2019-06-11T08:00:00+02:00).

StartDate string

This parameter takes a date format as (yyyy-MM-dd'T'HH:mm:ssZ) (e.g. 2019-06-11T08:00:00+02:00).

Type string

This parameter defines when the maintenance will be active. It can take one of for-5-minutes, for-30-minutes, for-1-hour, indefinitely or schedule.

EndDate string

This parameter takes a date format as (yyyy-MM-dd'T'HH:mm:ssZ) (e.g. 2019-06-11T08:00:00+02:00).

StartDate string

This parameter takes a date format as (yyyy-MM-dd'T'HH:mm:ssZ) (e.g. 2019-06-11T08:00:00+02:00).

type String

This parameter defines when the maintenance will be active. It can take one of for-5-minutes, for-30-minutes, for-1-hour, indefinitely or schedule.

endDate String

This parameter takes a date format as (yyyy-MM-dd'T'HH:mm:ssZ) (e.g. 2019-06-11T08:00:00+02:00).

startDate String

This parameter takes a date format as (yyyy-MM-dd'T'HH:mm:ssZ) (e.g. 2019-06-11T08:00:00+02:00).

type string

This parameter defines when the maintenance will be active. It can take one of for-5-minutes, for-30-minutes, for-1-hour, indefinitely or schedule.

endDate string

This parameter takes a date format as (yyyy-MM-dd'T'HH:mm:ssZ) (e.g. 2019-06-11T08:00:00+02:00).

startDate string

This parameter takes a date format as (yyyy-MM-dd'T'HH:mm:ssZ) (e.g. 2019-06-11T08:00:00+02:00).

type str

This parameter defines when the maintenance will be active. It can take one of for-5-minutes, for-30-minutes, for-1-hour, indefinitely or schedule.

end_date str

This parameter takes a date format as (yyyy-MM-dd'T'HH:mm:ssZ) (e.g. 2019-06-11T08:00:00+02:00).

start_date str

This parameter takes a date format as (yyyy-MM-dd'T'HH:mm:ssZ) (e.g. 2019-06-11T08:00:00+02:00).

type String

This parameter defines when the maintenance will be active. It can take one of for-5-minutes, for-30-minutes, for-1-hour, indefinitely or schedule.

endDate String

This parameter takes a date format as (yyyy-MM-dd'T'HH:mm:ssZ) (e.g. 2019-06-11T08:00:00+02:00).

startDate String

This parameter takes a date format as (yyyy-MM-dd'T'HH:mm:ssZ) (e.g. 2019-06-11T08:00:00+02:00).

Import

Maintenance policies can be imported using the policy_id, e.g.

 $ pulumi import opsgenie:index/maintenance:Maintenance test policy_id`

Package Details

Repository
https://github.com/pulumi/pulumi-opsgenie
License
Apache-2.0
Notes

This Pulumi package is based on the opsgenie Terraform Provider.