com.pulumi.azurenative.apimanagement.WorkspaceApiDiagnostic Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-native Show documentation
Show all versions of azure-native Show documentation
A native Pulumi package for creating and managing Azure resources.
// *** 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.apimanagement;
import com.pulumi.azurenative.Utilities;
import com.pulumi.azurenative.apimanagement.WorkspaceApiDiagnosticArgs;
import com.pulumi.azurenative.apimanagement.outputs.PipelineDiagnosticSettingsResponse;
import com.pulumi.azurenative.apimanagement.outputs.SamplingSettingsResponse;
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.Optional;
import javax.annotation.Nullable;
/**
* Diagnostic details.
* Azure REST API version: 2023-09-01-preview.
*
* Other available API versions: 2024-05-01.
*
* ## Example Usage
* ### ApiManagementCreateWorkspaceApiDiagnostic
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.apimanagement.WorkspaceApiDiagnostic;
* import com.pulumi.azurenative.apimanagement.WorkspaceApiDiagnosticArgs;
* import com.pulumi.azurenative.apimanagement.inputs.PipelineDiagnosticSettingsArgs;
* import com.pulumi.azurenative.apimanagement.inputs.HttpMessageDiagnosticArgs;
* import com.pulumi.azurenative.apimanagement.inputs.BodyDiagnosticSettingsArgs;
* import com.pulumi.azurenative.apimanagement.inputs.SamplingSettingsArgs;
* 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 workspaceApiDiagnostic = new WorkspaceApiDiagnostic("workspaceApiDiagnostic", WorkspaceApiDiagnosticArgs.builder()
* .alwaysLog("allErrors")
* .apiId("57d1f7558aa04f15146d9d8a")
* .backend(PipelineDiagnosticSettingsArgs.builder()
* .request(HttpMessageDiagnosticArgs.builder()
* .body(BodyDiagnosticSettingsArgs.builder()
* .bytes(512)
* .build())
* .headers("Content-type")
* .build())
* .response(HttpMessageDiagnosticArgs.builder()
* .body(BodyDiagnosticSettingsArgs.builder()
* .bytes(512)
* .build())
* .headers("Content-type")
* .build())
* .build())
* .diagnosticId("applicationinsights")
* .frontend(PipelineDiagnosticSettingsArgs.builder()
* .request(HttpMessageDiagnosticArgs.builder()
* .body(BodyDiagnosticSettingsArgs.builder()
* .bytes(512)
* .build())
* .headers("Content-type")
* .build())
* .response(HttpMessageDiagnosticArgs.builder()
* .body(BodyDiagnosticSettingsArgs.builder()
* .bytes(512)
* .build())
* .headers("Content-type")
* .build())
* .build())
* .loggerId("/workspaces/wks1/loggers/applicationinsights")
* .resourceGroupName("rg1")
* .sampling(SamplingSettingsArgs.builder()
* .percentage(50)
* .samplingType("fixed")
* .build())
* .serviceName("apimService1")
* .workspaceId("wks1")
* .build());
*
* }
* }
*
* }
*
*
* ## Import
*
* An existing resource can be imported using its type token, name, and identifier, e.g.
*
* ```sh
* $ pulumi import azure-native:apimanagement:WorkspaceApiDiagnostic applicationinsights /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/apis/{apiId}/diagnostics/{diagnosticId}
* ```
*
*/
@ResourceType(type="azure-native:apimanagement:WorkspaceApiDiagnostic")
public class WorkspaceApiDiagnostic extends com.pulumi.resources.CustomResource {
/**
* Specifies for what type of messages sampling settings should not apply.
*
*/
@Export(name="alwaysLog", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> alwaysLog;
/**
* @return Specifies for what type of messages sampling settings should not apply.
*
*/
public Output> alwaysLog() {
return Codegen.optional(this.alwaysLog);
}
/**
* Diagnostic settings for incoming/outgoing HTTP messages to the Backend
*
*/
@Export(name="backend", refs={PipelineDiagnosticSettingsResponse.class}, tree="[0]")
private Output* @Nullable */ PipelineDiagnosticSettingsResponse> backend;
/**
* @return Diagnostic settings for incoming/outgoing HTTP messages to the Backend
*
*/
public Output> backend() {
return Codegen.optional(this.backend);
}
/**
* Diagnostic settings for incoming/outgoing HTTP messages to the Gateway.
*
*/
@Export(name="frontend", refs={PipelineDiagnosticSettingsResponse.class}, tree="[0]")
private Output* @Nullable */ PipelineDiagnosticSettingsResponse> frontend;
/**
* @return Diagnostic settings for incoming/outgoing HTTP messages to the Gateway.
*
*/
public Output> frontend() {
return Codegen.optional(this.frontend);
}
/**
* Sets correlation protocol to use for Application Insights diagnostics.
*
*/
@Export(name="httpCorrelationProtocol", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> httpCorrelationProtocol;
/**
* @return Sets correlation protocol to use for Application Insights diagnostics.
*
*/
public Output> httpCorrelationProtocol() {
return Codegen.optional(this.httpCorrelationProtocol);
}
/**
* Log the ClientIP. Default is false.
*
*/
@Export(name="logClientIp", refs={Boolean.class}, tree="[0]")
private Output* @Nullable */ Boolean> logClientIp;
/**
* @return Log the ClientIP. Default is false.
*
*/
public Output> logClientIp() {
return Codegen.optional(this.logClientIp);
}
/**
* Resource Id of a target logger.
*
*/
@Export(name="loggerId", refs={String.class}, tree="[0]")
private Output loggerId;
/**
* @return Resource Id of a target logger.
*
*/
public Output loggerId() {
return this.loggerId;
}
/**
* Emit custom metrics via emit-metric policy. Applicable only to Application Insights diagnostic settings.
*
*/
@Export(name="metrics", refs={Boolean.class}, tree="[0]")
private Output* @Nullable */ Boolean> metrics;
/**
* @return Emit custom metrics via emit-metric policy. Applicable only to Application Insights diagnostic settings.
*
*/
public Output> metrics() {
return Codegen.optional(this.metrics);
}
/**
* The name of the resource
*
*/
@Export(name="name", refs={String.class}, tree="[0]")
private Output name;
/**
* @return The name of the resource
*
*/
public Output name() {
return this.name;
}
/**
* The format of the Operation Name for Application Insights telemetries. Default is Name.
*
*/
@Export(name="operationNameFormat", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> operationNameFormat;
/**
* @return The format of the Operation Name for Application Insights telemetries. Default is Name.
*
*/
public Output> operationNameFormat() {
return Codegen.optional(this.operationNameFormat);
}
/**
* Sampling settings for Diagnostic.
*
*/
@Export(name="sampling", refs={SamplingSettingsResponse.class}, tree="[0]")
private Output* @Nullable */ SamplingSettingsResponse> sampling;
/**
* @return Sampling settings for Diagnostic.
*
*/
public Output> sampling() {
return Codegen.optional(this.sampling);
}
/**
* The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
*
*/
@Export(name="type", refs={String.class}, tree="[0]")
private Output type;
/**
* @return The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
*
*/
public Output type() {
return this.type;
}
/**
* The verbosity level applied to traces emitted by trace policies.
*
*/
@Export(name="verbosity", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> verbosity;
/**
* @return The verbosity level applied to traces emitted by trace policies.
*
*/
public Output> verbosity() {
return Codegen.optional(this.verbosity);
}
/**
*
* @param name The _unique_ name of the resulting resource.
*/
public WorkspaceApiDiagnostic(java.lang.String name) {
this(name, WorkspaceApiDiagnosticArgs.Empty);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
*/
public WorkspaceApiDiagnostic(java.lang.String name, WorkspaceApiDiagnosticArgs 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 WorkspaceApiDiagnostic(java.lang.String name, WorkspaceApiDiagnosticArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure-native:apimanagement:WorkspaceApiDiagnostic", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false);
}
private WorkspaceApiDiagnostic(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure-native:apimanagement:WorkspaceApiDiagnostic", name, null, makeResourceOptions(options, id), false);
}
private static WorkspaceApiDiagnosticArgs makeArgs(WorkspaceApiDiagnosticArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
if (options != null && options.getUrn().isPresent()) {
return null;
}
return args == null ? WorkspaceApiDiagnosticArgs.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:apimanagement/v20230901preview:WorkspaceApiDiagnostic").build()),
Output.of(Alias.builder().type("azure-native:apimanagement/v20240501:WorkspaceApiDiagnostic").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 WorkspaceApiDiagnostic get(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) {
return new WorkspaceApiDiagnostic(name, id, options);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy