All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.gcp.monitoring.kotlin.DashboardArgs.kt Maven / Gradle / Ivy

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gcp.monitoring.kotlin

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.monitoring.DashboardArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName

/**
 * A Google Stackdriver dashboard. Dashboards define the content and layout of pages in the Stackdriver web application.
 * To get more information about Dashboards, see:
 * * [API documentation](https://cloud.google.com/monitoring/api/ref_v3/rest/v1/projects.dashboards)
 * * How-to Guides
 *     * [Official Documentation](https://cloud.google.com/monitoring/dashboards)
 * ## Example Usage
 * ### Monitoring Dashboard Basic
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const dashboard = new gcp.monitoring.Dashboard("dashboard", {dashboardJson: `{
 *   "displayName": "Demo Dashboard",
 *   "gridLayout": {
 *     "widgets": [
 *       {
 *         "blank": {}
 *       }
 *     ]
 *   }
 * }
 * `});
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * dashboard = gcp.monitoring.Dashboard("dashboard", dashboard_json="""{
 *   "displayName": "Demo Dashboard",
 *   "gridLayout": {
 *     "widgets": [
 *       {
 *         "blank": {}
 *       }
 *     ]
 *   }
 * }
 * """)
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var dashboard = new Gcp.Monitoring.Dashboard("dashboard", new()
 *     {
 *         DashboardJson = @"{
 *   ""displayName"": ""Demo Dashboard"",
 *   ""gridLayout"": {
 *     ""widgets"": [
 *       {
 *         ""blank"": {}
 *       }
 *     ]
 *   }
 * }
 * ",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/monitoring"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := monitoring.NewDashboard(ctx, "dashboard", &monitoring.DashboardArgs{
 * 			DashboardJson: pulumi.String(`{
 *   "displayName": "Demo Dashboard",
 *   "gridLayout": {
 *     "widgets": [
 *       {
 *         "blank": {}
 *       }
 *     ]
 *   }
 * }
 * `),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * package generated_program;
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.gcp.monitoring.Dashboard;
 * import com.pulumi.gcp.monitoring.DashboardArgs;
 * 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 dashboard = new Dashboard("dashboard", DashboardArgs.builder()
 *             .dashboardJson("""
 * {
 *   "displayName": "Demo Dashboard",
 *   "gridLayout": {
 *     "widgets": [
 *       {
 *         "blank": {}
 *       }
 *     ]
 *   }
 * }
 *             """)
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   dashboard:
 *     type: gcp:monitoring:Dashboard
 *     properties:
 *       dashboardJson: |+
 *         {
 *           "displayName": "Demo Dashboard",
 *           "gridLayout": {
 *             "widgets": [
 *               {
 *                 "blank": {}
 *               }
 *             ]
 *           }
 *         }
 * ```
 * 
 * ### Monitoring Dashboard GridLayout
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const dashboard = new gcp.monitoring.Dashboard("dashboard", {dashboardJson: `{
 *   "displayName": "Grid Layout Example",
 *   "gridLayout": {
 *     "columns": "2",
 *     "widgets": [
 *       {
 *         "title": "Widget 1",
 *         "xyChart": {
 *           "dataSets": [{
 *             "timeSeriesQuery": {
 *               "timeSeriesFilter": {
 *                 "filter": "metric.type=\\"agent.googleapis.com/nginx/connections/accepted_count\\"",
 *                 "aggregation": {
 *                   "perSeriesAligner": "ALIGN_RATE"
 *                 }
 *               },
 *               "unitOverride": "1"
 *             },
 *             "plotType": "LINE"
 *           }],
 *           "timeshiftDuration": "0s",
 *           "yAxis": {
 *             "label": "y1Axis",
 *             "scale": "LINEAR"
 *           }
 *         }
 *       },
 *       {
 *         "text": {
 *           "content": "Widget 2",
 *           "format": "MARKDOWN"
 *         }
 *       },
 *       {
 *         "title": "Widget 3",
 *         "xyChart": {
 *           "dataSets": [{
 *             "timeSeriesQuery": {
 *               "timeSeriesFilter": {
 *                 "filter": "metric.type=\\"agent.googleapis.com/nginx/connections/accepted_count\\"",
 *                 "aggregation": {
 *                   "perSeriesAligner": "ALIGN_RATE"
 *                 }
 *               },
 *               "unitOverride": "1"
 *             },
 *             "plotType": "STACKED_BAR"
 *           }],
 *           "timeshiftDuration": "0s",
 *           "yAxis": {
 *             "label": "y1Axis",
 *             "scale": "LINEAR"
 *           }
 *         }
 *       }
 *     ]
 *   }
 * }
 * `});
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * dashboard = gcp.monitoring.Dashboard("dashboard", dashboard_json="""{
 *   "displayName": "Grid Layout Example",
 *   "gridLayout": {
 *     "columns": "2",
 *     "widgets": [
 *       {
 *         "title": "Widget 1",
 *         "xyChart": {
 *           "dataSets": [{
 *             "timeSeriesQuery": {
 *               "timeSeriesFilter": {
 *                 "filter": "metric.type=\"agent.googleapis.com/nginx/connections/accepted_count\"",
 *                 "aggregation": {
 *                   "perSeriesAligner": "ALIGN_RATE"
 *                 }
 *               },
 *               "unitOverride": "1"
 *             },
 *             "plotType": "LINE"
 *           }],
 *           "timeshiftDuration": "0s",
 *           "yAxis": {
 *             "label": "y1Axis",
 *             "scale": "LINEAR"
 *           }
 *         }
 *       },
 *       {
 *         "text": {
 *           "content": "Widget 2",
 *           "format": "MARKDOWN"
 *         }
 *       },
 *       {
 *         "title": "Widget 3",
 *         "xyChart": {
 *           "dataSets": [{
 *             "timeSeriesQuery": {
 *               "timeSeriesFilter": {
 *                 "filter": "metric.type=\"agent.googleapis.com/nginx/connections/accepted_count\"",
 *                 "aggregation": {
 *                   "perSeriesAligner": "ALIGN_RATE"
 *                 }
 *               },
 *               "unitOverride": "1"
 *             },
 *             "plotType": "STACKED_BAR"
 *           }],
 *           "timeshiftDuration": "0s",
 *           "yAxis": {
 *             "label": "y1Axis",
 *             "scale": "LINEAR"
 *           }
 *         }
 *       }
 *     ]
 *   }
 * }
 * """)
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var dashboard = new Gcp.Monitoring.Dashboard("dashboard", new()
 *     {
 *         DashboardJson = @"{
 *   ""displayName"": ""Grid Layout Example"",
 *   ""gridLayout"": {
 *     ""columns"": ""2"",
 *     ""widgets"": [
 *       {
 *         ""title"": ""Widget 1"",
 *         ""xyChart"": {
 *           ""dataSets"": [{
 *             ""timeSeriesQuery"": {
 *               ""timeSeriesFilter"": {
 *                 ""filter"": ""metric.type=\""agent.googleapis.com/nginx/connections/accepted_count\"""",
 *                 ""aggregation"": {
 *                   ""perSeriesAligner"": ""ALIGN_RATE""
 *                 }
 *               },
 *               ""unitOverride"": ""1""
 *             },
 *             ""plotType"": ""LINE""
 *           }],
 *           ""timeshiftDuration"": ""0s"",
 *           ""yAxis"": {
 *             ""label"": ""y1Axis"",
 *             ""scale"": ""LINEAR""
 *           }
 *         }
 *       },
 *       {
 *         ""text"": {
 *           ""content"": ""Widget 2"",
 *           ""format"": ""MARKDOWN""
 *         }
 *       },
 *       {
 *         ""title"": ""Widget 3"",
 *         ""xyChart"": {
 *           ""dataSets"": [{
 *             ""timeSeriesQuery"": {
 *               ""timeSeriesFilter"": {
 *                 ""filter"": ""metric.type=\""agent.googleapis.com/nginx/connections/accepted_count\"""",
 *                 ""aggregation"": {
 *                   ""perSeriesAligner"": ""ALIGN_RATE""
 *                 }
 *               },
 *               ""unitOverride"": ""1""
 *             },
 *             ""plotType"": ""STACKED_BAR""
 *           }],
 *           ""timeshiftDuration"": ""0s"",
 *           ""yAxis"": {
 *             ""label"": ""y1Axis"",
 *             ""scale"": ""LINEAR""
 *           }
 *         }
 *       }
 *     ]
 *   }
 * }
 * ",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/monitoring"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := monitoring.NewDashboard(ctx, "dashboard", &monitoring.DashboardArgs{
 * 			DashboardJson: pulumi.String(`{
 *   "displayName": "Grid Layout Example",
 *   "gridLayout": {
 *     "columns": "2",
 *     "widgets": [
 *       {
 *         "title": "Widget 1",
 *         "xyChart": {
 *           "dataSets": [{
 *             "timeSeriesQuery": {
 *               "timeSeriesFilter": {
 *                 "filter": "metric.type=\"agent.googleapis.com/nginx/connections/accepted_count\"",
 *                 "aggregation": {
 *                   "perSeriesAligner": "ALIGN_RATE"
 *                 }
 *               },
 *               "unitOverride": "1"
 *             },
 *             "plotType": "LINE"
 *           }],
 *           "timeshiftDuration": "0s",
 *           "yAxis": {
 *             "label": "y1Axis",
 *             "scale": "LINEAR"
 *           }
 *         }
 *       },
 *       {
 *         "text": {
 *           "content": "Widget 2",
 *           "format": "MARKDOWN"
 *         }
 *       },
 *       {
 *         "title": "Widget 3",
 *         "xyChart": {
 *           "dataSets": [{
 *             "timeSeriesQuery": {
 *               "timeSeriesFilter": {
 *                 "filter": "metric.type=\"agent.googleapis.com/nginx/connections/accepted_count\"",
 *                 "aggregation": {
 *                   "perSeriesAligner": "ALIGN_RATE"
 *                 }
 *               },
 *               "unitOverride": "1"
 *             },
 *             "plotType": "STACKED_BAR"
 *           }],
 *           "timeshiftDuration": "0s",
 *           "yAxis": {
 *             "label": "y1Axis",
 *             "scale": "LINEAR"
 *           }
 *         }
 *       }
 *     ]
 *   }
 * }
 * `),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * package generated_program;
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.gcp.monitoring.Dashboard;
 * import com.pulumi.gcp.monitoring.DashboardArgs;
 * 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 dashboard = new Dashboard("dashboard", DashboardArgs.builder()
 *             .dashboardJson("""
 * {
 *   "displayName": "Grid Layout Example",
 *   "gridLayout": {
 *     "columns": "2",
 *     "widgets": [
 *       {
 *         "title": "Widget 1",
 *         "xyChart": {
 *           "dataSets": [{
 *             "timeSeriesQuery": {
 *               "timeSeriesFilter": {
 *                 "filter": "metric.type=\"agent.googleapis.com/nginx/connections/accepted_count\"",
 *                 "aggregation": {
 *                   "perSeriesAligner": "ALIGN_RATE"
 *                 }
 *               },
 *               "unitOverride": "1"
 *             },
 *             "plotType": "LINE"
 *           }],
 *           "timeshiftDuration": "0s",
 *           "yAxis": {
 *             "label": "y1Axis",
 *             "scale": "LINEAR"
 *           }
 *         }
 *       },
 *       {
 *         "text": {
 *           "content": "Widget 2",
 *           "format": "MARKDOWN"
 *         }
 *       },
 *       {
 *         "title": "Widget 3",
 *         "xyChart": {
 *           "dataSets": [{
 *             "timeSeriesQuery": {
 *               "timeSeriesFilter": {
 *                 "filter": "metric.type=\"agent.googleapis.com/nginx/connections/accepted_count\"",
 *                 "aggregation": {
 *                   "perSeriesAligner": "ALIGN_RATE"
 *                 }
 *               },
 *               "unitOverride": "1"
 *             },
 *             "plotType": "STACKED_BAR"
 *           }],
 *           "timeshiftDuration": "0s",
 *           "yAxis": {
 *             "label": "y1Axis",
 *             "scale": "LINEAR"
 *           }
 *         }
 *       }
 *     ]
 *   }
 * }
 *             """)
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   dashboard:
 *     type: gcp:monitoring:Dashboard
 *     properties:
 *       dashboardJson: |+
 *         {
 *           "displayName": "Grid Layout Example",
 *           "gridLayout": {
 *             "columns": "2",
 *             "widgets": [
 *               {
 *                 "title": "Widget 1",
 *                 "xyChart": {
 *                   "dataSets": [{
 *                     "timeSeriesQuery": {
 *                       "timeSeriesFilter": {
 *                         "filter": "metric.type=\"agent.googleapis.com/nginx/connections/accepted_count\"",
 *                         "aggregation": {
 *                           "perSeriesAligner": "ALIGN_RATE"
 *                         }
 *                       },
 *                       "unitOverride": "1"
 *                     },
 *                     "plotType": "LINE"
 *                   }],
 *                   "timeshiftDuration": "0s",
 *                   "yAxis": {
 *                     "label": "y1Axis",
 *                     "scale": "LINEAR"
 *                   }
 *                 }
 *               },
 *               {
 *                 "text": {
 *                   "content": "Widget 2",
 *                   "format": "MARKDOWN"
 *                 }
 *               },
 *               {
 *                 "title": "Widget 3",
 *                 "xyChart": {
 *                   "dataSets": [{
 *                     "timeSeriesQuery": {
 *                       "timeSeriesFilter": {
 *                         "filter": "metric.type=\"agent.googleapis.com/nginx/connections/accepted_count\"",
 *                         "aggregation": {
 *                           "perSeriesAligner": "ALIGN_RATE"
 *                         }
 *                       },
 *                       "unitOverride": "1"
 *                     },
 *                     "plotType": "STACKED_BAR"
 *                   }],
 *                   "timeshiftDuration": "0s",
 *                   "yAxis": {
 *                     "label": "y1Axis",
 *                     "scale": "LINEAR"
 *                   }
 *                 }
 *               }
 *             ]
 *           }
 *         }
 * ```
 * 
 * ## Import
 * Dashboard can be imported using any of these accepted formats:
 * * `projects/{{project}}/dashboards/{{dashboard_id}}`
 * * `{{dashboard_id}}`
 * When using the `pulumi import` command, Dashboard can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:monitoring/dashboard:Dashboard default projects/{{project}}/dashboards/{{dashboard_id}}
 * ```
 * ```sh
 * $ pulumi import gcp:monitoring/dashboard:Dashboard default {{dashboard_id}}
 * ```
 * @property dashboardJson The JSON representation of a dashboard, following the format at
 * https://cloud.google.com/monitoring/api/ref_v3/rest/v1/projects.dashboards.
 * @property project The ID of the project in which the resource belongs.
 * If it is not provided, the provider project is used.
 */
public data class DashboardArgs(
    public val dashboardJson: Output? = null,
    public val project: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.monitoring.DashboardArgs =
        com.pulumi.gcp.monitoring.DashboardArgs.builder()
            .dashboardJson(dashboardJson?.applyValue({ args0 -> args0 }))
            .project(project?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [DashboardArgs].
 */
@PulumiTagMarker
public class DashboardArgsBuilder internal constructor() {
    private var dashboardJson: Output? = null

    private var project: Output? = null

    /**
     * @param value The JSON representation of a dashboard, following the format at
     * https://cloud.google.com/monitoring/api/ref_v3/rest/v1/projects.dashboards.
     */
    @JvmName("sjmuqtymwagjjsgx")
    public suspend fun dashboardJson(`value`: Output) {
        this.dashboardJson = value
    }

    /**
     * @param value The ID of the project in which the resource belongs.
     * If it is not provided, the provider project is used.
     */
    @JvmName("wmvwldhlmcumneqs")
    public suspend fun project(`value`: Output) {
        this.project = value
    }

    /**
     * @param value The JSON representation of a dashboard, following the format at
     * https://cloud.google.com/monitoring/api/ref_v3/rest/v1/projects.dashboards.
     */
    @JvmName("yovayvvdhvyfmixn")
    public suspend fun dashboardJson(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.dashboardJson = mapped
    }

    /**
     * @param value The ID of the project in which the resource belongs.
     * If it is not provided, the provider project is used.
     */
    @JvmName("byffyltqidgidydw")
    public suspend fun project(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.project = mapped
    }

    internal fun build(): DashboardArgs = DashboardArgs(
        dashboardJson = dashboardJson,
        project = project,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy