1. Packages
  2. Ibm Provider
  3. API Docs
  4. ComputeMonitor
ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud

ibm.ComputeMonitor

Explore with Pulumi AI

ibm logo
ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud

    Create, update, or delete a monitor for your virtual server instance. With monitors, you can verify the health of your virtual server instance by sending ping requests to the instance and checking the responsiveness of your instance. For more information, about compute monitor resource, see viewing and managing monitors.

    Note

    For more information, see IBM Cloud Classic Infrastructure (SoftLayer) API docs.

    Example Usage

    In the following example, you can create a monitor:

    import * as pulumi from "@pulumi/pulumi";
    import * as ibm from "@pulumi/ibm";
    
    const testMonitor = new ibm.ComputeMonitor("testMonitor", {
        guestId: ibm_compute_vm_instance.test_server.id,
        ipAddress: ibm_compute_vm_instance.test_server.id.ipv4_address,
        queryTypeId: 1,
        responseActionId: 1,
        waitCycles: 5,
        notifiedUsers: [460547],
    });
    
    import pulumi
    import pulumi_ibm as ibm
    
    test_monitor = ibm.ComputeMonitor("testMonitor",
        guest_id=ibm_compute_vm_instance["test_server"]["id"],
        ip_address=ibm_compute_vm_instance["test_server"]["id"]["ipv4_address"],
        query_type_id=1,
        response_action_id=1,
        wait_cycles=5,
        notified_users=[460547])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ibm/ibm"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ibm.NewComputeMonitor(ctx, "testMonitor", &ibm.ComputeMonitorArgs{
    			GuestId:          pulumi.Any(ibm_compute_vm_instance.Test_server.Id),
    			IpAddress:        pulumi.Any(ibm_compute_vm_instance.Test_server.Id.Ipv4_address),
    			QueryTypeId:      pulumi.Float64(1),
    			ResponseActionId: pulumi.Float64(1),
    			WaitCycles:       pulumi.Float64(5),
    			NotifiedUsers: pulumi.Float64Array{
    				pulumi.Float64(460547),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ibm = Pulumi.Ibm;
    
    return await Deployment.RunAsync(() => 
    {
        var testMonitor = new Ibm.ComputeMonitor("testMonitor", new()
        {
            GuestId = ibm_compute_vm_instance.Test_server.Id,
            IpAddress = ibm_compute_vm_instance.Test_server.Id.Ipv4_address,
            QueryTypeId = 1,
            ResponseActionId = 1,
            WaitCycles = 5,
            NotifiedUsers = new[]
            {
                460547,
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ibm.ComputeMonitor;
    import com.pulumi.ibm.ComputeMonitorArgs;
    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 testMonitor = new ComputeMonitor("testMonitor", ComputeMonitorArgs.builder()
                .guestId(ibm_compute_vm_instance.test_server().id())
                .ipAddress(ibm_compute_vm_instance.test_server().id().ipv4_address())
                .queryTypeId(1)
                .responseActionId(1)
                .waitCycles(5)
                .notifiedUsers(460547)
                .build());
    
        }
    }
    
    resources:
      testMonitor:
        type: ibm:ComputeMonitor
        properties:
          guestId: ${ibm_compute_vm_instance.test_server.id}
          ipAddress: ${ibm_compute_vm_instance.test_server.id.ipv4_address}
          queryTypeId: 1
          responseActionId: 1
          waitCycles: 5
          notifiedUsers:
            - 460547
    

    Create ComputeMonitor Resource

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

    Constructor syntax

    new ComputeMonitor(name: string, args: ComputeMonitorArgs, opts?: CustomResourceOptions);
    @overload
    def ComputeMonitor(resource_name: str,
                       args: ComputeMonitorArgs,
                       opts: Optional[ResourceOptions] = None)
    
    @overload
    def ComputeMonitor(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       guest_id: Optional[float] = None,
                       query_type_id: Optional[float] = None,
                       response_action_id: Optional[float] = None,
                       compute_monitor_id: Optional[str] = None,
                       ip_address: Optional[str] = None,
                       notified_users: Optional[Sequence[float]] = None,
                       tags: Optional[Sequence[str]] = None,
                       wait_cycles: Optional[float] = None)
    func NewComputeMonitor(ctx *Context, name string, args ComputeMonitorArgs, opts ...ResourceOption) (*ComputeMonitor, error)
    public ComputeMonitor(string name, ComputeMonitorArgs args, CustomResourceOptions? opts = null)
    public ComputeMonitor(String name, ComputeMonitorArgs args)
    public ComputeMonitor(String name, ComputeMonitorArgs args, CustomResourceOptions options)
    
    type: ibm:ComputeMonitor
    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 ComputeMonitorArgs
    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 ComputeMonitorArgs
    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 ComputeMonitorArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ComputeMonitorArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ComputeMonitorArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

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

    var computeMonitorResource = new Ibm.ComputeMonitor("computeMonitorResource", new()
    {
        GuestId = 0,
        QueryTypeId = 0,
        ResponseActionId = 0,
        ComputeMonitorId = "string",
        IpAddress = "string",
        NotifiedUsers = new[]
        {
            0,
        },
        Tags = new[]
        {
            "string",
        },
        WaitCycles = 0,
    });
    
    example, err := ibm.NewComputeMonitor(ctx, "computeMonitorResource", &ibm.ComputeMonitorArgs{
    	GuestId:          pulumi.Float64(0),
    	QueryTypeId:      pulumi.Float64(0),
    	ResponseActionId: pulumi.Float64(0),
    	ComputeMonitorId: pulumi.String("string"),
    	IpAddress:        pulumi.String("string"),
    	NotifiedUsers: pulumi.Float64Array{
    		pulumi.Float64(0),
    	},
    	Tags: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	WaitCycles: pulumi.Float64(0),
    })
    
    var computeMonitorResource = new ComputeMonitor("computeMonitorResource", ComputeMonitorArgs.builder()
        .guestId(0)
        .queryTypeId(0)
        .responseActionId(0)
        .computeMonitorId("string")
        .ipAddress("string")
        .notifiedUsers(0)
        .tags("string")
        .waitCycles(0)
        .build());
    
    compute_monitor_resource = ibm.ComputeMonitor("computeMonitorResource",
        guest_id=0,
        query_type_id=0,
        response_action_id=0,
        compute_monitor_id="string",
        ip_address="string",
        notified_users=[0],
        tags=["string"],
        wait_cycles=0)
    
    const computeMonitorResource = new ibm.ComputeMonitor("computeMonitorResource", {
        guestId: 0,
        queryTypeId: 0,
        responseActionId: 0,
        computeMonitorId: "string",
        ipAddress: "string",
        notifiedUsers: [0],
        tags: ["string"],
        waitCycles: 0,
    });
    
    type: ibm:ComputeMonitor
    properties:
        computeMonitorId: string
        guestId: 0
        ipAddress: string
        notifiedUsers:
            - 0
        queryTypeId: 0
        responseActionId: 0
        tags:
            - string
        waitCycles: 0
    

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

    GuestId double
    The ID of the virtual guest that you want to monitor.
    QueryTypeId double
    The ID of the query type.
    ResponseActionId double
    The ID of the response action to take if the monitor fails. Accepted values are 1 or 2.
    ComputeMonitorId string
    (String) The unique identifier of the monitor.
    IpAddress string
    The IP address that you want to monitor.
    NotifiedUsers List<double>
    The list of user IDs that is notified.
    Tags List<string>
    Tags associated with the monitoring instance. Note Tags are managed locally and not stored on the IBM Cloud Service Endpoint at this moment.
    WaitCycles double
    The number of 5-minute cycles to wait before the response action is taken.
    GuestId float64
    The ID of the virtual guest that you want to monitor.
    QueryTypeId float64
    The ID of the query type.
    ResponseActionId float64
    The ID of the response action to take if the monitor fails. Accepted values are 1 or 2.
    ComputeMonitorId string
    (String) The unique identifier of the monitor.
    IpAddress string
    The IP address that you want to monitor.
    NotifiedUsers []float64
    The list of user IDs that is notified.
    Tags []string
    Tags associated with the monitoring instance. Note Tags are managed locally and not stored on the IBM Cloud Service Endpoint at this moment.
    WaitCycles float64
    The number of 5-minute cycles to wait before the response action is taken.
    guestId Double
    The ID of the virtual guest that you want to monitor.
    queryTypeId Double
    The ID of the query type.
    responseActionId Double
    The ID of the response action to take if the monitor fails. Accepted values are 1 or 2.
    computeMonitorId String
    (String) The unique identifier of the monitor.
    ipAddress String
    The IP address that you want to monitor.
    notifiedUsers List<Double>
    The list of user IDs that is notified.
    tags List<String>
    Tags associated with the monitoring instance. Note Tags are managed locally and not stored on the IBM Cloud Service Endpoint at this moment.
    waitCycles Double
    The number of 5-minute cycles to wait before the response action is taken.
    guestId number
    The ID of the virtual guest that you want to monitor.
    queryTypeId number
    The ID of the query type.
    responseActionId number
    The ID of the response action to take if the monitor fails. Accepted values are 1 or 2.
    computeMonitorId string
    (String) The unique identifier of the monitor.
    ipAddress string
    The IP address that you want to monitor.
    notifiedUsers number[]
    The list of user IDs that is notified.
    tags string[]
    Tags associated with the monitoring instance. Note Tags are managed locally and not stored on the IBM Cloud Service Endpoint at this moment.
    waitCycles number
    The number of 5-minute cycles to wait before the response action is taken.
    guest_id float
    The ID of the virtual guest that you want to monitor.
    query_type_id float
    The ID of the query type.
    response_action_id float
    The ID of the response action to take if the monitor fails. Accepted values are 1 or 2.
    compute_monitor_id str
    (String) The unique identifier of the monitor.
    ip_address str
    The IP address that you want to monitor.
    notified_users Sequence[float]
    The list of user IDs that is notified.
    tags Sequence[str]
    Tags associated with the monitoring instance. Note Tags are managed locally and not stored on the IBM Cloud Service Endpoint at this moment.
    wait_cycles float
    The number of 5-minute cycles to wait before the response action is taken.
    guestId Number
    The ID of the virtual guest that you want to monitor.
    queryTypeId Number
    The ID of the query type.
    responseActionId Number
    The ID of the response action to take if the monitor fails. Accepted values are 1 or 2.
    computeMonitorId String
    (String) The unique identifier of the monitor.
    ipAddress String
    The IP address that you want to monitor.
    notifiedUsers List<Number>
    The list of user IDs that is notified.
    tags List<String>
    Tags associated with the monitoring instance. Note Tags are managed locally and not stored on the IBM Cloud Service Endpoint at this moment.
    waitCycles Number
    The number of 5-minute cycles to wait before the response action is taken.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the ComputeMonitor 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 ComputeMonitor Resource

    Get an existing ComputeMonitor 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?: ComputeMonitorState, opts?: CustomResourceOptions): ComputeMonitor
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            compute_monitor_id: Optional[str] = None,
            guest_id: Optional[float] = None,
            ip_address: Optional[str] = None,
            notified_users: Optional[Sequence[float]] = None,
            query_type_id: Optional[float] = None,
            response_action_id: Optional[float] = None,
            tags: Optional[Sequence[str]] = None,
            wait_cycles: Optional[float] = None) -> ComputeMonitor
    func GetComputeMonitor(ctx *Context, name string, id IDInput, state *ComputeMonitorState, opts ...ResourceOption) (*ComputeMonitor, error)
    public static ComputeMonitor Get(string name, Input<string> id, ComputeMonitorState? state, CustomResourceOptions? opts = null)
    public static ComputeMonitor get(String name, Output<String> id, ComputeMonitorState state, CustomResourceOptions options)
    resources:  _:    type: ibm:ComputeMonitor    get:      id: ${id}
    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:
    ComputeMonitorId string
    (String) The unique identifier of the monitor.
    GuestId double
    The ID of the virtual guest that you want to monitor.
    IpAddress string
    The IP address that you want to monitor.
    NotifiedUsers List<double>
    The list of user IDs that is notified.
    QueryTypeId double
    The ID of the query type.
    ResponseActionId double
    The ID of the response action to take if the monitor fails. Accepted values are 1 or 2.
    Tags List<string>
    Tags associated with the monitoring instance. Note Tags are managed locally and not stored on the IBM Cloud Service Endpoint at this moment.
    WaitCycles double
    The number of 5-minute cycles to wait before the response action is taken.
    ComputeMonitorId string
    (String) The unique identifier of the monitor.
    GuestId float64
    The ID of the virtual guest that you want to monitor.
    IpAddress string
    The IP address that you want to monitor.
    NotifiedUsers []float64
    The list of user IDs that is notified.
    QueryTypeId float64
    The ID of the query type.
    ResponseActionId float64
    The ID of the response action to take if the monitor fails. Accepted values are 1 or 2.
    Tags []string
    Tags associated with the monitoring instance. Note Tags are managed locally and not stored on the IBM Cloud Service Endpoint at this moment.
    WaitCycles float64
    The number of 5-minute cycles to wait before the response action is taken.
    computeMonitorId String
    (String) The unique identifier of the monitor.
    guestId Double
    The ID of the virtual guest that you want to monitor.
    ipAddress String
    The IP address that you want to monitor.
    notifiedUsers List<Double>
    The list of user IDs that is notified.
    queryTypeId Double
    The ID of the query type.
    responseActionId Double
    The ID of the response action to take if the monitor fails. Accepted values are 1 or 2.
    tags List<String>
    Tags associated with the monitoring instance. Note Tags are managed locally and not stored on the IBM Cloud Service Endpoint at this moment.
    waitCycles Double
    The number of 5-minute cycles to wait before the response action is taken.
    computeMonitorId string
    (String) The unique identifier of the monitor.
    guestId number
    The ID of the virtual guest that you want to monitor.
    ipAddress string
    The IP address that you want to monitor.
    notifiedUsers number[]
    The list of user IDs that is notified.
    queryTypeId number
    The ID of the query type.
    responseActionId number
    The ID of the response action to take if the monitor fails. Accepted values are 1 or 2.
    tags string[]
    Tags associated with the monitoring instance. Note Tags are managed locally and not stored on the IBM Cloud Service Endpoint at this moment.
    waitCycles number
    The number of 5-minute cycles to wait before the response action is taken.
    compute_monitor_id str
    (String) The unique identifier of the monitor.
    guest_id float
    The ID of the virtual guest that you want to monitor.
    ip_address str
    The IP address that you want to monitor.
    notified_users Sequence[float]
    The list of user IDs that is notified.
    query_type_id float
    The ID of the query type.
    response_action_id float
    The ID of the response action to take if the monitor fails. Accepted values are 1 or 2.
    tags Sequence[str]
    Tags associated with the monitoring instance. Note Tags are managed locally and not stored on the IBM Cloud Service Endpoint at this moment.
    wait_cycles float
    The number of 5-minute cycles to wait before the response action is taken.
    computeMonitorId String
    (String) The unique identifier of the monitor.
    guestId Number
    The ID of the virtual guest that you want to monitor.
    ipAddress String
    The IP address that you want to monitor.
    notifiedUsers List<Number>
    The list of user IDs that is notified.
    queryTypeId Number
    The ID of the query type.
    responseActionId Number
    The ID of the response action to take if the monitor fails. Accepted values are 1 or 2.
    tags List<String>
    Tags associated with the monitoring instance. Note Tags are managed locally and not stored on the IBM Cloud Service Endpoint at this moment.
    waitCycles Number
    The number of 5-minute cycles to wait before the response action is taken.

    Package Details

    Repository
    ibm ibm-cloud/terraform-provider-ibm
    License
    Notes
    This Pulumi package is based on the ibm Terraform Provider.
    ibm logo
    ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud