1. Packages
  2. Splight
  3. API Docs
  4. AssetAttribute
splight v1.1.5 published on Thursday, Oct 3, 2024 by splightplatform

splight.AssetAttribute

Explore with Pulumi AI

splight logo
splight v1.1.5 published on Thursday, Oct 3, 2024 by splightplatform

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as splight from "@splightplatform/pulumi-splight";
    
    const myAsset = new splight.Asset("myAsset", {
        description: "My Asset Description",
        geometry: JSON.stringify({
            type: "GeometryCollection",
            geometries: [{
                type: "Point",
                coordinates: [
                    0,
                    0,
                ],
            }],
        }),
    });
    const myAttribute = new splight.AssetAttribute("myAttribute", {
        type: "Number",
        unit: "meters",
        asset: myAsset.id,
    });
    
    import pulumi
    import json
    import pulumi_splight as splight
    
    my_asset = splight.Asset("myAsset",
        description="My Asset Description",
        geometry=json.dumps({
            "type": "GeometryCollection",
            "geometries": [{
                "type": "Point",
                "coordinates": [
                    0,
                    0,
                ],
            }],
        }))
    my_attribute = splight.AssetAttribute("myAttribute",
        type="Number",
        unit="meters",
        asset=my_asset.id)
    
    package main
    
    import (
    	"encoding/json"
    
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/splightplatform/pulumi-splight/sdk/go/splight"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		tmpJSON0, err := json.Marshal(map[string]interface{}{
    			"type": "GeometryCollection",
    			"geometries": []map[string]interface{}{
    				map[string]interface{}{
    					"type": "Point",
    					"coordinates": []float64{
    						0,
    						0,
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		json0 := string(tmpJSON0)
    		myAsset, err := splight.NewAsset(ctx, "myAsset", &splight.AssetArgs{
    			Description: pulumi.String("My Asset Description"),
    			Geometry:    pulumi.String(json0),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = splight.NewAssetAttribute(ctx, "myAttribute", &splight.AssetAttributeArgs{
    			Type:  pulumi.String("Number"),
    			Unit:  pulumi.String("meters"),
    			Asset: myAsset.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using System.Text.Json;
    using Pulumi;
    using Splight = Splight.Splight;
    
    return await Deployment.RunAsync(() => 
    {
        var myAsset = new Splight.Asset("myAsset", new()
        {
            Description = "My Asset Description",
            Geometry = JsonSerializer.Serialize(new Dictionary<string, object?>
            {
                ["type"] = "GeometryCollection",
                ["geometries"] = new[]
                {
                    new Dictionary<string, object?>
                    {
                        ["type"] = "Point",
                        ["coordinates"] = new[]
                        {
                            0,
                            0,
                        },
                    },
                },
            }),
        });
    
        var myAttribute = new Splight.AssetAttribute("myAttribute", new()
        {
            Type = "Number",
            Unit = "meters",
            Asset = myAsset.Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.splight.Asset;
    import com.pulumi.splight.AssetArgs;
    import com.pulumi.splight.AssetAttribute;
    import com.pulumi.splight.AssetAttributeArgs;
    import static com.pulumi.codegen.internal.Serialization.*;
    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 myAsset = new Asset("myAsset", AssetArgs.builder()
                .description("My Asset Description")
                .geometry(serializeJson(
                    jsonObject(
                        jsonProperty("type", "GeometryCollection"),
                        jsonProperty("geometries", jsonArray(jsonObject(
                            jsonProperty("type", "Point"),
                            jsonProperty("coordinates", jsonArray(
                                0, 
                                0
                            ))
                        )))
                    )))
                .build());
    
            var myAttribute = new AssetAttribute("myAttribute", AssetAttributeArgs.builder()
                .type("Number")
                .unit("meters")
                .asset(myAsset.id())
                .build());
    
        }
    }
    
    resources:
      myAsset:
        type: splight:Asset
        properties:
          description: My Asset Description
          geometry:
            fn::toJSON:
              type: GeometryCollection
              geometries:
                - type: Point
                  coordinates:
                    - 0
                    - 0
      myAttribute:
        type: splight:AssetAttribute
        properties:
          type: Number
          unit: meters
          asset: ${myAsset.id}
    

    Create AssetAttribute Resource

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

    Constructor syntax

    new AssetAttribute(name: string, args: AssetAttributeArgs, opts?: CustomResourceOptions);
    @overload
    def AssetAttribute(resource_name: str,
                       args: AssetAttributeArgs,
                       opts: Optional[ResourceOptions] = None)
    
    @overload
    def AssetAttribute(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       asset: Optional[str] = None,
                       type: Optional[str] = None,
                       name: Optional[str] = None,
                       unit: Optional[str] = None)
    func NewAssetAttribute(ctx *Context, name string, args AssetAttributeArgs, opts ...ResourceOption) (*AssetAttribute, error)
    public AssetAttribute(string name, AssetAttributeArgs args, CustomResourceOptions? opts = null)
    public AssetAttribute(String name, AssetAttributeArgs args)
    public AssetAttribute(String name, AssetAttributeArgs args, CustomResourceOptions options)
    
    type: splight:AssetAttribute
    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 AssetAttributeArgs
    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 AssetAttributeArgs
    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 AssetAttributeArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args AssetAttributeArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args AssetAttributeArgs
    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 assetAttributeResource = new Splight.AssetAttribute("assetAttributeResource", new()
    {
        Asset = "string",
        Type = "string",
        Name = "string",
        Unit = "string",
    });
    
    example, err := splight.NewAssetAttribute(ctx, "assetAttributeResource", &splight.AssetAttributeArgs{
    	Asset: pulumi.String("string"),
    	Type:  pulumi.String("string"),
    	Name:  pulumi.String("string"),
    	Unit:  pulumi.String("string"),
    })
    
    var assetAttributeResource = new AssetAttribute("assetAttributeResource", AssetAttributeArgs.builder()
        .asset("string")
        .type("string")
        .name("string")
        .unit("string")
        .build());
    
    asset_attribute_resource = splight.AssetAttribute("assetAttributeResource",
        asset="string",
        type="string",
        name="string",
        unit="string")
    
    const assetAttributeResource = new splight.AssetAttribute("assetAttributeResource", {
        asset: "string",
        type: "string",
        name: "string",
        unit: "string",
    });
    
    type: splight:AssetAttribute
    properties:
        asset: string
        name: string
        type: string
        unit: string
    

    AssetAttribute Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The AssetAttribute resource accepts the following input properties:

    Asset string
    reference to the asset to be linked to
    Type string
    [String|Boolean|Number] type of the data to be ingested in this attribute
    Name string
    name of the resource
    Unit string
    optional reference to the unit of the measure
    Asset string
    reference to the asset to be linked to
    Type string
    [String|Boolean|Number] type of the data to be ingested in this attribute
    Name string
    name of the resource
    Unit string
    optional reference to the unit of the measure
    asset String
    reference to the asset to be linked to
    type String
    [String|Boolean|Number] type of the data to be ingested in this attribute
    name String
    name of the resource
    unit String
    optional reference to the unit of the measure
    asset string
    reference to the asset to be linked to
    type string
    [String|Boolean|Number] type of the data to be ingested in this attribute
    name string
    name of the resource
    unit string
    optional reference to the unit of the measure
    asset str
    reference to the asset to be linked to
    type str
    [String|Boolean|Number] type of the data to be ingested in this attribute
    name str
    name of the resource
    unit str
    optional reference to the unit of the measure
    asset String
    reference to the asset to be linked to
    type String
    [String|Boolean|Number] type of the data to be ingested in this attribute
    name String
    name of the resource
    unit String
    optional reference to the unit of the measure

    Outputs

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

    Get an existing AssetAttribute 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?: AssetAttributeState, opts?: CustomResourceOptions): AssetAttribute
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            asset: Optional[str] = None,
            name: Optional[str] = None,
            type: Optional[str] = None,
            unit: Optional[str] = None) -> AssetAttribute
    func GetAssetAttribute(ctx *Context, name string, id IDInput, state *AssetAttributeState, opts ...ResourceOption) (*AssetAttribute, error)
    public static AssetAttribute Get(string name, Input<string> id, AssetAttributeState? state, CustomResourceOptions? opts = null)
    public static AssetAttribute get(String name, Output<String> id, AssetAttributeState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    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:
    Asset string
    reference to the asset to be linked to
    Name string
    name of the resource
    Type string
    [String|Boolean|Number] type of the data to be ingested in this attribute
    Unit string
    optional reference to the unit of the measure
    Asset string
    reference to the asset to be linked to
    Name string
    name of the resource
    Type string
    [String|Boolean|Number] type of the data to be ingested in this attribute
    Unit string
    optional reference to the unit of the measure
    asset String
    reference to the asset to be linked to
    name String
    name of the resource
    type String
    [String|Boolean|Number] type of the data to be ingested in this attribute
    unit String
    optional reference to the unit of the measure
    asset string
    reference to the asset to be linked to
    name string
    name of the resource
    type string
    [String|Boolean|Number] type of the data to be ingested in this attribute
    unit string
    optional reference to the unit of the measure
    asset str
    reference to the asset to be linked to
    name str
    name of the resource
    type str
    [String|Boolean|Number] type of the data to be ingested in this attribute
    unit str
    optional reference to the unit of the measure
    asset String
    reference to the asset to be linked to
    name String
    name of the resource
    type String
    [String|Boolean|Number] type of the data to be ingested in this attribute
    unit String
    optional reference to the unit of the measure

    Import

    $ pulumi import splight:index/assetAttribute:AssetAttribute [options] splight_asset_attribute.<name> <asset_attribute_id>
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    splight splightplatform/pulumi-splight
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the splight Terraform Provider.
    splight logo
    splight v1.1.5 published on Thursday, Oct 3, 2024 by splightplatform