1. Packages
  2. Opsgenie
  3. API Docs
  4. Maintenance
Opsgenie v1.3.6 published on Tuesday, Feb 27, 2024 by Pulumi

opsgenie.Maintenance

Explore with Pulumi AI

opsgenie logo
Opsgenie v1.3.6 published on Tuesday, Feb 27, 2024 by Pulumi

    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

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

    Constructor syntax

    new Maintenance(name: string, args: MaintenanceArgs, opts?: CustomResourceOptions);
    @overload
    def Maintenance(resource_name: str,
                    args: MaintenanceArgs,
                    opts: Optional[ResourceOptions] = None)
    
    @overload
    def Maintenance(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    description: Optional[str] = None,
                    rules: Optional[Sequence[MaintenanceRuleArgs]] = None,
                    times: Optional[Sequence[MaintenanceTimeArgs]] = 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.
    
    

    Parameters

    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.

    Example

    The following reference example uses placeholder values for all input properties.

    var maintenanceResource = new Opsgenie.Maintenance("maintenanceResource", new()
    {
        Description = "string",
        Rules = new[]
        {
            new Opsgenie.Inputs.MaintenanceRuleArgs
            {
                Entities = new[]
                {
                    new Opsgenie.Inputs.MaintenanceRuleEntityArgs
                    {
                        Id = "string",
                        Type = "string",
                    },
                },
                State = "string",
            },
        },
        Times = new[]
        {
            new Opsgenie.Inputs.MaintenanceTimeArgs
            {
                Type = "string",
                EndDate = "string",
                StartDate = "string",
            },
        },
    });
    
    example, err := opsgenie.NewMaintenance(ctx, "maintenanceResource", &opsgenie.MaintenanceArgs{
    	Description: pulumi.String("string"),
    	Rules: opsgenie.MaintenanceRuleArray{
    		&opsgenie.MaintenanceRuleArgs{
    			Entities: opsgenie.MaintenanceRuleEntityArray{
    				&opsgenie.MaintenanceRuleEntityArgs{
    					Id:   pulumi.String("string"),
    					Type: pulumi.String("string"),
    				},
    			},
    			State: pulumi.String("string"),
    		},
    	},
    	Times: opsgenie.MaintenanceTimeArray{
    		&opsgenie.MaintenanceTimeArgs{
    			Type:      pulumi.String("string"),
    			EndDate:   pulumi.String("string"),
    			StartDate: pulumi.String("string"),
    		},
    	},
    })
    
    var maintenanceResource = new Maintenance("maintenanceResource", MaintenanceArgs.builder()        
        .description("string")
        .rules(MaintenanceRuleArgs.builder()
            .entities(MaintenanceRuleEntityArgs.builder()
                .id("string")
                .type("string")
                .build())
            .state("string")
            .build())
        .times(MaintenanceTimeArgs.builder()
            .type("string")
            .endDate("string")
            .startDate("string")
            .build())
        .build());
    
    maintenance_resource = opsgenie.Maintenance("maintenanceResource",
        description="string",
        rules=[opsgenie.MaintenanceRuleArgs(
            entities=[opsgenie.MaintenanceRuleEntityArgs(
                id="string",
                type="string",
            )],
            state="string",
        )],
        times=[opsgenie.MaintenanceTimeArgs(
            type="string",
            end_date="string",
            start_date="string",
        )])
    
    const maintenanceResource = new opsgenie.Maintenance("maintenanceResource", {
        description: "string",
        rules: [{
            entities: [{
                id: "string",
                type: "string",
            }],
            state: "string",
        }],
        times: [{
            type: "string",
            endDate: "string",
            startDate: "string",
        }],
    });
    
    type: opsgenie:Maintenance
    properties:
        description: string
        rules:
            - entities:
                - id: string
                  type: string
              state: string
        times:
            - endDate: string
              startDate: string
              type: string
    

    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<MaintenanceRule>
    Rules of maintenance, which takes a list of rule objects and defines the maintenance rules over integrations and policies.
    Times List<MaintenanceTime>
    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 List<MaintenanceRule>
    Rules of maintenance, which takes a list of rule objects and defines the maintenance rules over integrations and policies.
    times List<MaintenanceTime>
    Time configuration of maintenance. It takes a time object which has type, startDate and endDate fields
    description string
    Description for the maintenance.
    rules MaintenanceRule[]
    Rules of maintenance, which takes a list of rule objects and defines the maintenance rules over integrations and policies.
    times MaintenanceTime[]
    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<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.
    The following state arguments are supported:
    Description string
    Description for the maintenance.
    Rules List<MaintenanceRule>
    Rules of maintenance, which takes a list of rule objects and defines the maintenance rules over integrations and policies.
    Times List<MaintenanceTime>
    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 List<MaintenanceRule>
    Rules of maintenance, which takes a list of rule objects and defines the maintenance rules over integrations and policies.
    times List<MaintenanceTime>
    Time configuration of maintenance. It takes a time object which has type, startDate and endDate fields
    description string
    Description for the maintenance.
    rules MaintenanceRule[]
    Rules of maintenance, which takes a list of rule objects and defines the maintenance rules over integrations and policies.
    times MaintenanceTime[]
    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<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<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 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 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<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

    Id string
    The id of the entity that maintenance will be applied.
    Type string
    The type of the entity that maintenance will be applied. It can be either integration or policy.
    Id string
    The id of the entity that maintenance will be applied.
    Type string
    The type of the entity that maintenance will be applied. It can be either integration or policy.
    id String
    The id of the entity that maintenance will be applied.
    type String
    The type of the entity that maintenance will be applied. It can be either integration or policy.
    id string
    The id of the entity that maintenance will be applied.
    type string
    The type of the entity that maintenance will be applied. It can be either integration or policy.
    id str
    The id of the entity that maintenance will be applied.
    type str
    The type of the entity that maintenance will be applied. It can be either integration or policy.
    id String
    The id of the entity that maintenance will be applied.
    type String
    The type of the entity that maintenance will be applied. It can be either integration or policy.

    MaintenanceTime, MaintenanceTimeArgs

    Type string
    The type of the entity that maintenance will be applied. It can be either integration or policy.
    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
    The type of the entity that maintenance will be applied. It can be either integration or policy.
    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
    The type of the entity that maintenance will be applied. It can be either integration or policy.
    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
    The type of the entity that maintenance will be applied. It can be either integration or policy.
    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
    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.
    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`
    

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

    Package Details

    Repository
    Opsgenie pulumi/pulumi-opsgenie
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the opsgenie Terraform Provider.
    opsgenie logo
    Opsgenie v1.3.6 published on Tuesday, Feb 27, 2024 by Pulumi