opsgenie.Maintenance
Explore with Pulumi AI
Manages a Maintenance within Opsgenie.
Example Usage
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Opsgenie = Pulumi.Opsgenie;
return await Deployment.RunAsync(() =>
{
var test = new Opsgenie.Maintenance("test", new()
{
Description = "geniemaintenance-%s",
Rules = new[]
{
new Opsgenie.Inputs.MaintenanceRuleArgs
{
Entities = new[]
{
new Opsgenie.Inputs.MaintenanceRuleEntityArgs
{
Id = opsgenie_email_integration.Test.Id,
Type = "integration",
},
},
State = "enabled",
},
},
Times = new[]
{
new Opsgenie.Inputs.MaintenanceTimeArgs
{
EndDate = "2019-06-%dT17:50:00Z",
StartDate = "2019-06-20T17:45:00Z",
Type = "schedule",
},
},
});
});
package main
import (
"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("geniemaintenance-%s"),
Rules: opsgenie.MaintenanceRuleArray{
&opsgenie.MaintenanceRuleArgs{
Entities: opsgenie.MaintenanceRuleEntityArray{
&opsgenie.MaintenanceRuleEntityArgs{
Id: pulumi.Any(opsgenie_email_integration.Test.Id),
Type: pulumi.String("integration"),
},
},
State: pulumi.String("enabled"),
},
},
Times: opsgenie.MaintenanceTimeArray{
&opsgenie.MaintenanceTimeArgs{
EndDate: pulumi.String("2019-06-%dT17:50:00Z"),
StartDate: pulumi.String("2019-06-20T17:45:00Z"),
Type: pulumi.String("schedule"),
},
},
})
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.opsgenie.Maintenance;
import com.pulumi.opsgenie.MaintenanceArgs;
import com.pulumi.opsgenie.inputs.MaintenanceRuleArgs;
import com.pulumi.opsgenie.inputs.MaintenanceTimeArgs;
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 test = new Maintenance("test", MaintenanceArgs.builder()
.description("geniemaintenance-%s")
.rules(MaintenanceRuleArgs.builder()
.entities(MaintenanceRuleEntityArgs.builder()
.id(opsgenie_email_integration.test().id())
.type("integration")
.build())
.state("enabled")
.build())
.times(MaintenanceTimeArgs.builder()
.endDate("2019-06-%dT17:50:00Z")
.startDate("2019-06-20T17:45:00Z")
.type("schedule")
.build())
.build());
}
}
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",
}],
});
resources:
test:
type: opsgenie:Maintenance
properties:
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
Create 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<Maintenance
Rule> Rules of maintenance, which takes a list of rule objects and defines the maintenance rules over integrations and policies.
- Times
List<Maintenance
Time> Time configuration of maintenance. It takes a time object which has type, startDate and endDate fields
- Description string
Description for the maintenance.
- Rules
[]Maintenance
Rule Args Rules of maintenance, which takes a list of rule objects and defines the maintenance rules over integrations and policies.
- Times
[]Maintenance
Time Args Time configuration of maintenance. It takes a time object which has type, startDate and endDate fields
- description String
Description for the maintenance.
- rules
List<Maintenance
Rule> Rules of maintenance, which takes a list of rule objects and defines the maintenance rules over integrations and policies.
- times
List<Maintenance
Time> Time configuration of maintenance. It takes a time object which has type, startDate and endDate fields
- description string
Description for the maintenance.
- rules
Maintenance
Rule[] Rules of maintenance, which takes a list of rule objects and defines the maintenance rules over integrations and policies.
- times
Maintenance
Time[] Time configuration of maintenance. It takes a time object which has type, startDate and endDate fields
- description str
Description for the maintenance.
- rules
Sequence[Maintenance
Rule Args] Rules of maintenance, which takes a list of rule objects and defines the maintenance rules over integrations and policies.
- times
Sequence[Maintenance
Time Args] Time configuration of maintenance. It takes a time object which has type, startDate and endDate fields
- description String
Description for the maintenance.
- rules List<Property Map>
Rules of maintenance, which takes a list of rule objects and defines the maintenance rules over integrations and policies.
- times List<Property Map>
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 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.
- Description string
Description for the maintenance.
- Rules
List<Maintenance
Rule> Rules of maintenance, which takes a list of rule objects and defines the maintenance rules over integrations and policies.
- Times
List<Maintenance
Time> Time configuration of maintenance. It takes a time object which has type, startDate and endDate fields
- Description string
Description for the maintenance.
- Rules
[]Maintenance
Rule Args Rules of maintenance, which takes a list of rule objects and defines the maintenance rules over integrations and policies.
- Times
[]Maintenance
Time Args Time configuration of maintenance. It takes a time object which has type, startDate and endDate fields
- description String
Description for the maintenance.
- rules
List<Maintenance
Rule> Rules of maintenance, which takes a list of rule objects and defines the maintenance rules over integrations and policies.
- times
List<Maintenance
Time> Time configuration of maintenance. It takes a time object which has type, startDate and endDate fields
- description string
Description for the maintenance.
- rules
Maintenance
Rule[] Rules of maintenance, which takes a list of rule objects and defines the maintenance rules over integrations and policies.
- times
Maintenance
Time[] Time configuration of maintenance. It takes a time object which has type, startDate and endDate fields
- description str
Description for the maintenance.
- rules
Sequence[Maintenance
Rule Args] Rules of maintenance, which takes a list of rule objects and defines the maintenance rules over integrations and policies.
- times
Sequence[Maintenance
Time Args] Time configuration of maintenance. It takes a time object which has type, startDate and endDate fields
- description String
Description for the maintenance.
- rules List<Property Map>
Rules of maintenance, which takes a list of rule objects and defines the maintenance rules over integrations and policies.
- times List<Property Map>
Time configuration of maintenance. It takes a time object which has type, startDate and endDate fields
Supporting Types
MaintenanceRule, MaintenanceRuleArgs
- Entities
List<Maintenance
Rule Entity> 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
[]Maintenance
Rule Entity 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
List<Maintenance
Rule Entity> 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
Maintenance
Rule Entity[] 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[Maintenance
Rule Entity] 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<Property Map>
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, MaintenanceRuleEntityArgs
MaintenanceTime, MaintenanceTimeArgs
- Type string
The type of the entity that maintenance will be applied. It can be either integration or policy.
- End
Date string 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 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
The type of the entity that maintenance will be applied. It can be either integration or policy.
- End
Date string 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 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
The type of the entity that maintenance will be applied. It can be either integration or policy.
- end
Date String 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 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
The type of the entity that maintenance will be applied. It can be either integration or policy.
- end
Date string 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 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
The type of the entity that maintenance will be applied. It can be either integration or policy.
- 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
The type of the entity that maintenance will be applied. It can be either integration or policy.
- end
Date String 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 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
- Opsgenie pulumi/pulumi-opsgenie
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
opsgenie
Terraform Provider.