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

com.pulumi.azurenative.insights.AutoscaleSetting Maven / Gradle / Ivy

There is a newer version: 2.78.0
Show newest version
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package com.pulumi.azurenative.insights;

import com.pulumi.azurenative.Utilities;
import com.pulumi.azurenative.insights.AutoscaleSettingArgs;
import com.pulumi.azurenative.insights.outputs.AutoscaleNotificationResponse;
import com.pulumi.azurenative.insights.outputs.AutoscaleProfileResponse;
import com.pulumi.azurenative.insights.outputs.PredictiveAutoscalePolicyResponse;
import com.pulumi.azurenative.insights.outputs.SystemDataResponse;
import com.pulumi.core.Alias;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import java.lang.Boolean;
import java.lang.String;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * The autoscale setting resource.
 * Azure REST API version: 2022-10-01. Prior API version in Azure Native 1.x: 2015-04-01.
 * 
 * ## Example Usage
 * ### Create or update an autoscale setting
 * 
 * 
 * {@code
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.azurenative.insights.AutoscaleSetting;
 * import com.pulumi.azurenative.insights.AutoscaleSettingArgs;
 * import com.pulumi.azurenative.insights.inputs.AutoscaleNotificationArgs;
 * import com.pulumi.azurenative.insights.inputs.EmailNotificationArgs;
 * import com.pulumi.azurenative.insights.inputs.PredictiveAutoscalePolicyArgs;
 * import com.pulumi.azurenative.insights.inputs.AutoscaleProfileArgs;
 * import com.pulumi.azurenative.insights.inputs.ScaleCapacityArgs;
 * import com.pulumi.azurenative.insights.inputs.TimeWindowArgs;
 * import com.pulumi.azurenative.insights.inputs.RecurrenceArgs;
 * import com.pulumi.azurenative.insights.inputs.RecurrentScheduleArgs;
 * 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 }{{@code
 *     public static void main(String[] args) }{{@code
 *         Pulumi.run(App::stack);
 *     }}{@code
 * 
 *     public static void stack(Context ctx) }{{@code
 *         var autoscaleSetting = new AutoscaleSetting("autoscaleSetting", AutoscaleSettingArgs.builder()
 *             .autoscaleSettingName("MySetting")
 *             .enabled(true)
 *             .location("West US")
 *             .notifications(AutoscaleNotificationArgs.builder()
 *                 .email(EmailNotificationArgs.builder()
 *                     .customEmails(                    
 *                         "gu}{@literal @}{@code ms.com",
 *                         "ge}{@literal @}{@code ns.net")
 *                     .sendToSubscriptionAdministrator(true)
 *                     .sendToSubscriptionCoAdministrators(true)
 *                     .build())
 *                 .operation("Scale")
 *                 .webhooks(WebhookNotificationArgs.builder()
 *                     .properties()
 *                     .serviceUri("http://myservice.com")
 *                     .build())
 *                 .build())
 *             .predictiveAutoscalePolicy(PredictiveAutoscalePolicyArgs.builder()
 *                 .scaleMode("Enabled")
 *                 .build())
 *             .profiles(            
 *                 AutoscaleProfileArgs.builder()
 *                     .capacity(ScaleCapacityArgs.builder()
 *                         .default_("1")
 *                         .maximum("10")
 *                         .minimum("1")
 *                         .build())
 *                     .fixedDate(TimeWindowArgs.builder()
 *                         .end("2015-03-05T14:30:00Z")
 *                         .start("2015-03-05T14:00:00Z")
 *                         .timeZone("UTC")
 *                         .build())
 *                     .name("adios")
 *                     .rules(                    
 *                         ScaleRuleArgs.builder()
 *                             .metricTrigger(MetricTriggerArgs.builder()
 *                                 .dividePerInstance(false)
 *                                 .metricName("Percentage CPU")
 *                                 .metricResourceUri("/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc")
 *                                 .operator("GreaterThan")
 *                                 .statistic("Average")
 *                                 .threshold(10)
 *                                 .timeAggregation("Average")
 *                                 .timeGrain("PT1M")
 *                                 .timeWindow("PT5M")
 *                                 .build())
 *                             .scaleAction(ScaleActionArgs.builder()
 *                                 .cooldown("PT5M")
 *                                 .direction("Increase")
 *                                 .type("ChangeCount")
 *                                 .value("1")
 *                                 .build())
 *                             .build(),
 *                         ScaleRuleArgs.builder()
 *                             .metricTrigger(MetricTriggerArgs.builder()
 *                                 .dividePerInstance(false)
 *                                 .metricName("Percentage CPU")
 *                                 .metricResourceUri("/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc")
 *                                 .operator("GreaterThan")
 *                                 .statistic("Average")
 *                                 .threshold(15)
 *                                 .timeAggregation("Average")
 *                                 .timeGrain("PT2M")
 *                                 .timeWindow("PT5M")
 *                                 .build())
 *                             .scaleAction(ScaleActionArgs.builder()
 *                                 .cooldown("PT6M")
 *                                 .direction("Decrease")
 *                                 .type("ChangeCount")
 *                                 .value("2")
 *                                 .build())
 *                             .build())
 *                     .build(),
 *                 AutoscaleProfileArgs.builder()
 *                     .capacity(ScaleCapacityArgs.builder()
 *                         .default_("1")
 *                         .maximum("10")
 *                         .minimum("1")
 *                         .build())
 *                     .name("saludos")
 *                     .recurrence(RecurrenceArgs.builder()
 *                         .frequency("Week")
 *                         .schedule(RecurrentScheduleArgs.builder()
 *                             .days("1")
 *                             .hours(5)
 *                             .minutes(15)
 *                             .timeZone("UTC")
 *                             .build())
 *                         .build())
 *                     .rules(                    
 *                         ScaleRuleArgs.builder()
 *                             .metricTrigger(MetricTriggerArgs.builder()
 *                                 .dividePerInstance(false)
 *                                 .metricName("Percentage CPU")
 *                                 .metricResourceUri("/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc")
 *                                 .operator("GreaterThan")
 *                                 .statistic("Average")
 *                                 .threshold(10)
 *                                 .timeAggregation("Average")
 *                                 .timeGrain("PT1M")
 *                                 .timeWindow("PT5M")
 *                                 .build())
 *                             .scaleAction(ScaleActionArgs.builder()
 *                                 .cooldown("PT5M")
 *                                 .direction("Increase")
 *                                 .type("ChangeCount")
 *                                 .value("1")
 *                                 .build())
 *                             .build(),
 *                         ScaleRuleArgs.builder()
 *                             .metricTrigger(MetricTriggerArgs.builder()
 *                                 .dividePerInstance(false)
 *                                 .metricName("Percentage CPU")
 *                                 .metricResourceUri("/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc")
 *                                 .operator("GreaterThan")
 *                                 .statistic("Average")
 *                                 .threshold(15)
 *                                 .timeAggregation("Average")
 *                                 .timeGrain("PT2M")
 *                                 .timeWindow("PT5M")
 *                                 .build())
 *                             .scaleAction(ScaleActionArgs.builder()
 *                                 .cooldown("PT6M")
 *                                 .direction("Decrease")
 *                                 .type("ChangeCount")
 *                                 .value("2")
 *                                 .build())
 *                             .build())
 *                     .build())
 *             .resourceGroupName("TestingMetricsScaleSet")
 *             .tags(Map.ofEntries(
 *                 Map.entry("key1", "value1"),
 *                 Map.entry("key2", "value2")
 *             ))
 *             .targetResourceUri("/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc")
 *             .build());
 * 
 *     }}{@code
 * }}{@code
 * 
 * }
 * 
* * ## Import * * An existing resource can be imported using its type token, name, and identifier, e.g. * * ```sh * $ pulumi import azure-native:insights:AutoscaleSetting MySetting /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/autoscalesettings/{autoscaleSettingName} * ``` * */ @ResourceType(type="azure-native:insights:AutoscaleSetting") public class AutoscaleSetting extends com.pulumi.resources.CustomResource { /** * the enabled flag. Specifies whether automatic scaling is enabled for the resource. The default value is 'false'. * */ @Export(name="enabled", refs={Boolean.class}, tree="[0]") private Output enabled; /** * @return the enabled flag. Specifies whether automatic scaling is enabled for the resource. The default value is 'false'. * */ public Output> enabled() { return Codegen.optional(this.enabled); } /** * Resource location * */ @Export(name="location", refs={String.class}, tree="[0]") private Output location; /** * @return Resource location * */ public Output location() { return this.location; } /** * Azure resource name * */ @Export(name="name", refs={String.class}, tree="[0]") private Output name; /** * @return Azure resource name * */ public Output name() { return this.name; } /** * the collection of notifications. * */ @Export(name="notifications", refs={List.class,AutoscaleNotificationResponse.class}, tree="[0,1]") private Output> notifications; /** * @return the collection of notifications. * */ public Output>> notifications() { return Codegen.optional(this.notifications); } /** * the predictive autoscale policy mode. * */ @Export(name="predictiveAutoscalePolicy", refs={PredictiveAutoscalePolicyResponse.class}, tree="[0]") private Output predictiveAutoscalePolicy; /** * @return the predictive autoscale policy mode. * */ public Output> predictiveAutoscalePolicy() { return Codegen.optional(this.predictiveAutoscalePolicy); } /** * the collection of automatic scaling profiles that specify different scaling parameters for different time periods. A maximum of 20 profiles can be specified. * */ @Export(name="profiles", refs={List.class,AutoscaleProfileResponse.class}, tree="[0,1]") private Output> profiles; /** * @return the collection of automatic scaling profiles that specify different scaling parameters for different time periods. A maximum of 20 profiles can be specified. * */ public Output> profiles() { return this.profiles; } /** * The system metadata related to the response. * */ @Export(name="systemData", refs={SystemDataResponse.class}, tree="[0]") private Output systemData; /** * @return The system metadata related to the response. * */ public Output systemData() { return this.systemData; } /** * Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater in length than 128 characters and a value no greater in length than 256 characters. * */ @Export(name="tags", refs={Map.class,String.class}, tree="[0,1,1]") private Output> tags; /** * @return Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater in length than 128 characters and a value no greater in length than 256 characters. * */ public Output>> tags() { return Codegen.optional(this.tags); } /** * the location of the resource that the autoscale setting should be added to. * */ @Export(name="targetResourceLocation", refs={String.class}, tree="[0]") private Output targetResourceLocation; /** * @return the location of the resource that the autoscale setting should be added to. * */ public Output> targetResourceLocation() { return Codegen.optional(this.targetResourceLocation); } /** * the resource identifier of the resource that the autoscale setting should be added to. * */ @Export(name="targetResourceUri", refs={String.class}, tree="[0]") private Output targetResourceUri; /** * @return the resource identifier of the resource that the autoscale setting should be added to. * */ public Output> targetResourceUri() { return Codegen.optional(this.targetResourceUri); } /** * Azure resource type * */ @Export(name="type", refs={String.class}, tree="[0]") private Output type; /** * @return Azure resource type * */ public Output type() { return this.type; } /** * * @param name The _unique_ name of the resulting resource. */ public AutoscaleSetting(java.lang.String name) { this(name, AutoscaleSettingArgs.Empty); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. */ public AutoscaleSetting(java.lang.String name, AutoscaleSettingArgs args) { this(name, args, null); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. * @param options A bag of options that control this resource's behavior. */ public AutoscaleSetting(java.lang.String name, AutoscaleSettingArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure-native:insights:AutoscaleSetting", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false); } private AutoscaleSetting(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure-native:insights:AutoscaleSetting", name, null, makeResourceOptions(options, id), false); } private static AutoscaleSettingArgs makeArgs(AutoscaleSettingArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { if (options != null && options.getUrn().isPresent()) { return null; } return args == null ? AutoscaleSettingArgs.Empty : args; } private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output id) { var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder() .version(Utilities.getVersion()) .aliases(List.of( Output.of(Alias.builder().type("azure-native:insights/v20140401:AutoscaleSetting").build()), Output.of(Alias.builder().type("azure-native:insights/v20150401:AutoscaleSetting").build()), Output.of(Alias.builder().type("azure-native:insights/v20210501preview:AutoscaleSetting").build()), Output.of(Alias.builder().type("azure-native:insights/v20221001:AutoscaleSetting").build()) )) .build(); return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id); } /** * Get an existing Host resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param options Optional settings to control the behavior of the CustomResource. */ public static AutoscaleSetting get(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) { return new AutoscaleSetting(name, id, options); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy