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

com.pulumi.azurenative.deviceregistry.Asset 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.deviceregistry;

import com.pulumi.azurenative.Utilities;
import com.pulumi.azurenative.deviceregistry.AssetArgs;
import com.pulumi.azurenative.deviceregistry.outputs.AssetStatusResponse;
import com.pulumi.azurenative.deviceregistry.outputs.DataPointResponse;
import com.pulumi.azurenative.deviceregistry.outputs.EventResponse;
import com.pulumi.azurenative.deviceregistry.outputs.ExtendedLocationResponse;
import com.pulumi.azurenative.deviceregistry.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.Integer;
import java.lang.Object;
import java.lang.String;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * Asset definition.
 * Azure REST API version: 2023-11-01-preview.
 * 
 * Other available API versions: 2024-09-01-preview.
 * 
 * ## Example Usage
 * ### Create_Asset_With_ExternalAssetId
 * 
 * 
 * {@code
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.azurenative.deviceregistry.Asset;
 * import com.pulumi.azurenative.deviceregistry.AssetArgs;
 * import com.pulumi.azurenative.deviceregistry.inputs.DataPointArgs;
 * import com.pulumi.azurenative.deviceregistry.inputs.EventArgs;
 * import com.pulumi.azurenative.deviceregistry.inputs.ExtendedLocationArgs;
 * 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 asset = new Asset("asset", AssetArgs.builder()
 *             .assetEndpointProfileUri("https://www.example.com/myAssetEndpointProfile")
 *             .assetName("my-asset")
 *             .assetType("MyAssetType")
 *             .dataPoints(            
 *                 DataPointArgs.builder()
 *                     .capabilityId("dtmi:com:example:Thermostat:__temperature;1")
 *                     .dataPointConfiguration("{\"publishingInterval\":8,\"samplingInterval\":8,\"queueSize\":4}")
 *                     .dataSource("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt1")
 *                     .observabilityMode("counter")
 *                     .build(),
 *                 DataPointArgs.builder()
 *                     .capabilityId("dtmi:com:example:Thermostat:__pressure;1")
 *                     .dataPointConfiguration("{\"publishingInterval\":4,\"samplingInterval\":4,\"queueSize\":7}")
 *                     .dataSource("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt2")
 *                     .observabilityMode("none")
 *                     .build())
 *             .defaultDataPointsConfiguration("{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}")
 *             .defaultEventsConfiguration("{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}")
 *             .description("This is a sample Asset")
 *             .displayName("AssetDisplayName")
 *             .documentationUri("https://www.example.com/manual")
 *             .enabled(true)
 *             .events(            
 *                 EventArgs.builder()
 *                     .capabilityId("dtmi:com:example:Thermostat:__temperature;1")
 *                     .eventConfiguration("{\"publishingInterval\":7,\"samplingInterval\":1,\"queueSize\":8}")
 *                     .eventNotifier("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt3")
 *                     .observabilityMode("none")
 *                     .build(),
 *                 EventArgs.builder()
 *                     .capabilityId("dtmi:com:example:Thermostat:__pressure;1")
 *                     .eventConfiguration("{\"publishingInterval\":7,\"samplingInterval\":8,\"queueSize\":4}")
 *                     .eventNotifier("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt4")
 *                     .observabilityMode("log")
 *                     .build())
 *             .extendedLocation(ExtendedLocationArgs.builder()
 *                 .name("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1")
 *                 .type("CustomLocation")
 *                 .build())
 *             .externalAssetId("8ZBA6LRHU0A458969")
 *             .hardwareRevision("1.0")
 *             .location("West Europe")
 *             .manufacturer("Contoso")
 *             .manufacturerUri("https://www.contoso.com/manufacturerUri")
 *             .model("ContosoModel")
 *             .productCode("SA34VDG")
 *             .resourceGroupName("myResourceGroup")
 *             .serialNumber("64-103816-519918-8")
 *             .softwareRevision("2.0")
 *             .tags(Map.of("site", "building-1"))
 *             .build());
 * 
 *     }
 * }
 * 
 * }
 * 
* ### Create_Asset_Without_DisplayName * *
 * {@code
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.azurenative.deviceregistry.Asset;
 * import com.pulumi.azurenative.deviceregistry.AssetArgs;
 * import com.pulumi.azurenative.deviceregistry.inputs.DataPointArgs;
 * import com.pulumi.azurenative.deviceregistry.inputs.EventArgs;
 * import com.pulumi.azurenative.deviceregistry.inputs.ExtendedLocationArgs;
 * 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 asset = new Asset("asset", AssetArgs.builder()
 *             .assetEndpointProfileUri("https://www.example.com/myAssetEndpointProfile")
 *             .assetName("my-asset")
 *             .assetType("MyAssetType")
 *             .dataPoints(            
 *                 DataPointArgs.builder()
 *                     .capabilityId("dtmi:com:example:Thermostat:__temperature;1")
 *                     .dataPointConfiguration("{\"publishingInterval\":8,\"samplingInterval\":8,\"queueSize\":4}")
 *                     .dataSource("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt1")
 *                     .observabilityMode("counter")
 *                     .build(),
 *                 DataPointArgs.builder()
 *                     .capabilityId("dtmi:com:example:Thermostat:__pressure;1")
 *                     .dataPointConfiguration("{\"publishingInterval\":4,\"samplingInterval\":4,\"queueSize\":7}")
 *                     .dataSource("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt2")
 *                     .observabilityMode("none")
 *                     .build())
 *             .defaultDataPointsConfiguration("{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}")
 *             .defaultEventsConfiguration("{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}")
 *             .description("This is a sample Asset")
 *             .documentationUri("https://www.example.com/manual")
 *             .enabled(true)
 *             .events(            
 *                 EventArgs.builder()
 *                     .capabilityId("dtmi:com:example:Thermostat:__temperature;1")
 *                     .eventConfiguration("{\"publishingInterval\":7,\"samplingInterval\":1,\"queueSize\":8}")
 *                     .eventNotifier("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt3")
 *                     .observabilityMode("none")
 *                     .build(),
 *                 EventArgs.builder()
 *                     .capabilityId("dtmi:com:example:Thermostat:__pressure;1")
 *                     .eventConfiguration("{\"publishingInterval\":7,\"samplingInterval\":8,\"queueSize\":4}")
 *                     .eventNotifier("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt4")
 *                     .observabilityMode("log")
 *                     .build())
 *             .extendedLocation(ExtendedLocationArgs.builder()
 *                 .name("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1")
 *                 .type("CustomLocation")
 *                 .build())
 *             .externalAssetId("8ZBA6LRHU0A458969")
 *             .hardwareRevision("1.0")
 *             .location("West Europe")
 *             .manufacturer("Contoso")
 *             .manufacturerUri("https://www.contoso.com/manufacturerUri")
 *             .model("ContosoModel")
 *             .productCode("SA34VDG")
 *             .resourceGroupName("myResourceGroup")
 *             .serialNumber("64-103816-519918-8")
 *             .softwareRevision("2.0")
 *             .tags(Map.of("site", "building-1"))
 *             .build());
 * 
 *     }
 * }
 * 
 * }
 * 
* ### Create_Asset_Without_ExternalAssetId * *
 * {@code
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.azurenative.deviceregistry.Asset;
 * import com.pulumi.azurenative.deviceregistry.AssetArgs;
 * import com.pulumi.azurenative.deviceregistry.inputs.DataPointArgs;
 * import com.pulumi.azurenative.deviceregistry.inputs.EventArgs;
 * import com.pulumi.azurenative.deviceregistry.inputs.ExtendedLocationArgs;
 * 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 asset = new Asset("asset", AssetArgs.builder()
 *             .assetEndpointProfileUri("https://www.example.com/myAssetEndpointProfile")
 *             .assetName("my-asset")
 *             .assetType("MyAssetType")
 *             .dataPoints(            
 *                 DataPointArgs.builder()
 *                     .capabilityId("dtmi:com:example:Thermostat:__temperature;1")
 *                     .dataPointConfiguration("{\"publishingInterval\":8,\"samplingInterval\":8,\"queueSize\":4}")
 *                     .dataSource("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt1")
 *                     .observabilityMode("counter")
 *                     .build(),
 *                 DataPointArgs.builder()
 *                     .capabilityId("dtmi:com:example:Thermostat:__pressure;1")
 *                     .dataPointConfiguration("{\"publishingInterval\":4,\"samplingInterval\":4,\"queueSize\":7}")
 *                     .dataSource("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt2")
 *                     .observabilityMode("none")
 *                     .build())
 *             .defaultDataPointsConfiguration("{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}")
 *             .defaultEventsConfiguration("{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}")
 *             .description("This is a sample Asset")
 *             .displayName("AssetDisplayName")
 *             .documentationUri("https://www.example.com/manual")
 *             .enabled(true)
 *             .events(            
 *                 EventArgs.builder()
 *                     .capabilityId("dtmi:com:example:Thermostat:__temperature;1")
 *                     .eventConfiguration("{\"publishingInterval\":7,\"samplingInterval\":1,\"queueSize\":8}")
 *                     .eventNotifier("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt3")
 *                     .observabilityMode("none")
 *                     .build(),
 *                 EventArgs.builder()
 *                     .capabilityId("dtmi:com:example:Thermostat:__pressure;1")
 *                     .eventConfiguration("{\"publishingInterval\":7,\"samplingInterval\":8,\"queueSize\":4}")
 *                     .eventNotifier("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt4")
 *                     .observabilityMode("log")
 *                     .build())
 *             .extendedLocation(ExtendedLocationArgs.builder()
 *                 .name("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1")
 *                 .type("CustomLocation")
 *                 .build())
 *             .hardwareRevision("1.0")
 *             .location("West Europe")
 *             .manufacturer("Contoso")
 *             .manufacturerUri("https://www.contoso.com/manufacturerUri")
 *             .model("ContosoModel")
 *             .productCode("SA34VDG")
 *             .resourceGroupName("myResourceGroup")
 *             .serialNumber("64-103816-519918-8")
 *             .softwareRevision("2.0")
 *             .tags(Map.of("site", "building-1"))
 *             .build());
 * 
 *     }
 * }
 * 
 * }
 * 
* * ## Import * * An existing resource can be imported using its type token, name, and identifier, e.g. * * ```sh * $ pulumi import azure-native:deviceregistry:Asset my-asset /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assets/{assetName} * ``` * */ @ResourceType(type="azure-native:deviceregistry:Asset") public class Asset extends com.pulumi.resources.CustomResource { /** * A reference to the asset endpoint profile (connection information) used by brokers to connect to an endpoint that provides data points for this asset. Must have the format <ModuleCR.metadata.namespace>/<ModuleCR.metadata.name>. * */ @Export(name="assetEndpointProfileUri", refs={String.class}, tree="[0]") private Output assetEndpointProfileUri; /** * @return A reference to the asset endpoint profile (connection information) used by brokers to connect to an endpoint that provides data points for this asset. Must have the format <ModuleCR.metadata.namespace>/<ModuleCR.metadata.name>. * */ public Output assetEndpointProfileUri() { return this.assetEndpointProfileUri; } /** * Resource path to asset type (model) definition. * */ @Export(name="assetType", refs={String.class}, tree="[0]") private Output assetType; /** * @return Resource path to asset type (model) definition. * */ public Output> assetType() { return Codegen.optional(this.assetType); } /** * A set of key-value pairs that contain custom attributes set by the customer. * */ @Export(name="attributes", refs={Object.class}, tree="[0]") private Output attributes; /** * @return A set of key-value pairs that contain custom attributes set by the customer. * */ public Output> attributes() { return Codegen.optional(this.attributes); } /** * Array of data points that are part of the asset. Each data point can reference an asset type capability and have per-data point configuration. * */ @Export(name="dataPoints", refs={List.class,DataPointResponse.class}, tree="[0,1]") private Output> dataPoints; /** * @return Array of data points that are part of the asset. Each data point can reference an asset type capability and have per-data point configuration. * */ public Output>> dataPoints() { return Codegen.optional(this.dataPoints); } /** * Stringified JSON that contains protocol-specific default configuration for all data points. Each data point can have its own configuration that overrides the default settings here. * */ @Export(name="defaultDataPointsConfiguration", refs={String.class}, tree="[0]") private Output defaultDataPointsConfiguration; /** * @return Stringified JSON that contains protocol-specific default configuration for all data points. Each data point can have its own configuration that overrides the default settings here. * */ public Output> defaultDataPointsConfiguration() { return Codegen.optional(this.defaultDataPointsConfiguration); } /** * Stringified JSON that contains connector-specific default configuration for all events. Each event can have its own configuration that overrides the default settings here. * */ @Export(name="defaultEventsConfiguration", refs={String.class}, tree="[0]") private Output defaultEventsConfiguration; /** * @return Stringified JSON that contains connector-specific default configuration for all events. Each event can have its own configuration that overrides the default settings here. * */ public Output> defaultEventsConfiguration() { return Codegen.optional(this.defaultEventsConfiguration); } /** * Human-readable description of the asset. * */ @Export(name="description", refs={String.class}, tree="[0]") private Output description; /** * @return Human-readable description of the asset. * */ public Output> description() { return Codegen.optional(this.description); } /** * Human-readable display name. * */ @Export(name="displayName", refs={String.class}, tree="[0]") private Output displayName; /** * @return Human-readable display name. * */ public Output> displayName() { return Codegen.optional(this.displayName); } /** * Reference to the documentation. * */ @Export(name="documentationUri", refs={String.class}, tree="[0]") private Output documentationUri; /** * @return Reference to the documentation. * */ public Output> documentationUri() { return Codegen.optional(this.documentationUri); } /** * Enabled/Disabled status of the asset. * */ @Export(name="enabled", refs={Boolean.class}, tree="[0]") private Output enabled; /** * @return Enabled/Disabled status of the asset. * */ public Output> enabled() { return Codegen.optional(this.enabled); } /** * Array of events that are part of the asset. Each event can have per-event configuration. * */ @Export(name="events", refs={List.class,EventResponse.class}, tree="[0,1]") private Output> events; /** * @return Array of events that are part of the asset. Each event can have per-event configuration. * */ public Output>> events() { return Codegen.optional(this.events); } /** * The extended location. * */ @Export(name="extendedLocation", refs={ExtendedLocationResponse.class}, tree="[0]") private Output extendedLocation; /** * @return The extended location. * */ public Output extendedLocation() { return this.extendedLocation; } /** * Asset id provided by the customer. * */ @Export(name="externalAssetId", refs={String.class}, tree="[0]") private Output externalAssetId; /** * @return Asset id provided by the customer. * */ public Output> externalAssetId() { return Codegen.optional(this.externalAssetId); } /** * Revision number of the hardware. * */ @Export(name="hardwareRevision", refs={String.class}, tree="[0]") private Output hardwareRevision; /** * @return Revision number of the hardware. * */ public Output> hardwareRevision() { return Codegen.optional(this.hardwareRevision); } /** * The geo-location where the resource lives * */ @Export(name="location", refs={String.class}, tree="[0]") private Output location; /** * @return The geo-location where the resource lives * */ public Output location() { return this.location; } /** * Asset manufacturer name. * */ @Export(name="manufacturer", refs={String.class}, tree="[0]") private Output manufacturer; /** * @return Asset manufacturer name. * */ public Output> manufacturer() { return Codegen.optional(this.manufacturer); } /** * Asset manufacturer URI. * */ @Export(name="manufacturerUri", refs={String.class}, tree="[0]") private Output manufacturerUri; /** * @return Asset manufacturer URI. * */ public Output> manufacturerUri() { return Codegen.optional(this.manufacturerUri); } /** * Asset model name. * */ @Export(name="model", refs={String.class}, tree="[0]") private Output model; /** * @return Asset model name. * */ public Output> model() { return Codegen.optional(this.model); } /** * 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; } /** * Asset product code. * */ @Export(name="productCode", refs={String.class}, tree="[0]") private Output productCode; /** * @return Asset product code. * */ public Output> productCode() { return Codegen.optional(this.productCode); } /** * Provisioning state of the resource. * */ @Export(name="provisioningState", refs={String.class}, tree="[0]") private Output provisioningState; /** * @return Provisioning state of the resource. * */ public Output provisioningState() { return this.provisioningState; } /** * Asset serial number. * */ @Export(name="serialNumber", refs={String.class}, tree="[0]") private Output serialNumber; /** * @return Asset serial number. * */ public Output> serialNumber() { return Codegen.optional(this.serialNumber); } /** * Revision number of the software. * */ @Export(name="softwareRevision", refs={String.class}, tree="[0]") private Output softwareRevision; /** * @return Revision number of the software. * */ public Output> softwareRevision() { return Codegen.optional(this.softwareRevision); } /** * Read only object to reflect changes that have occurred on the Edge. Similar to Kubernetes status property for custom resources. * */ @Export(name="status", refs={AssetStatusResponse.class}, tree="[0]") private Output status; /** * @return Read only object to reflect changes that have occurred on the Edge. Similar to Kubernetes status property for custom resources. * */ public Output status() { return this.status; } /** * Azure Resource Manager metadata containing createdBy and modifiedBy information. * */ @Export(name="systemData", refs={SystemDataResponse.class}, tree="[0]") private Output systemData; /** * @return Azure Resource Manager metadata containing createdBy and modifiedBy information. * */ public Output systemData() { return this.systemData; } /** * Resource tags. * */ @Export(name="tags", refs={Map.class,String.class}, tree="[0,1,1]") private Output> tags; /** * @return Resource tags. * */ public Output>> tags() { return Codegen.optional(this.tags); } /** * 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; } /** * Globally unique, immutable, non-reusable id. * */ @Export(name="uuid", refs={String.class}, tree="[0]") private Output uuid; /** * @return Globally unique, immutable, non-reusable id. * */ public Output uuid() { return this.uuid; } /** * An integer that is incremented each time the resource is modified. * */ @Export(name="version", refs={Integer.class}, tree="[0]") private Output version; /** * @return An integer that is incremented each time the resource is modified. * */ public Output version() { return this.version; } /** * * @param name The _unique_ name of the resulting resource. */ public Asset(java.lang.String name) { this(name, AssetArgs.Empty); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. */ public Asset(java.lang.String name, AssetArgs 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 Asset(java.lang.String name, AssetArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure-native:deviceregistry:Asset", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false); } private Asset(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure-native:deviceregistry:Asset", name, null, makeResourceOptions(options, id), false); } private static AssetArgs makeArgs(AssetArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { if (options != null && options.getUrn().isPresent()) { return null; } return args == null ? AssetArgs.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:deviceregistry/v20231101preview:Asset").build()), Output.of(Alias.builder().type("azure-native:deviceregistry/v20240901preview:Asset").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 Asset get(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) { return new Asset(name, id, options); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy