1. Packages
  2. Edgecenter Provider
  3. API Docs
  4. getInstanceV2
edgecenter 0.8.0 published on Wednesday, Apr 30, 2025 by edge-center

edgecenter.getInstanceV2

Explore with Pulumi AI

edgecenter logo
edgecenter 0.8.0 published on Wednesday, Apr 30, 2025 by edge-center

    A cloud instance is a virtual machine in a cloud environment. Could be used with baremetal too.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as edgecenter from "@pulumi/edgecenter";
    
    const pr = edgecenter.getProject({
        name: "test",
    });
    const rg = edgecenter.getRegion({
        name: "ED-10 Preprod",
    });
    const vm = Promise.all([rg, pr]).then(([rg, pr]) => edgecenter.getInstanceV2({
        name: "test-vm",
        regionId: rg.id,
        projectId: pr.id,
    }));
    export const view = vm;
    
    import pulumi
    import pulumi_edgecenter as edgecenter
    
    pr = edgecenter.get_project(name="test")
    rg = edgecenter.get_region(name="ED-10 Preprod")
    vm = edgecenter.get_instance_v2(name="test-vm",
        region_id=rg.id,
        project_id=pr.id)
    pulumi.export("view", vm)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/edgecenter/edgecenter"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		pr, err := edgecenter.LookupProject(ctx, &edgecenter.LookupProjectArgs{
    			Name: pulumi.StringRef("test"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		rg, err := edgecenter.GetRegion(ctx, &edgecenter.GetRegionArgs{
    			Name: "ED-10 Preprod",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		vm, err := edgecenter.LookupInstanceV2(ctx, &edgecenter.LookupInstanceV2Args{
    			Name:      "test-vm",
    			RegionId:  pulumi.Float64Ref(rg.Id),
    			ProjectId: pulumi.Float64Ref(pr.Id),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("view", vm)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Edgecenter = Pulumi.Edgecenter;
    
    return await Deployment.RunAsync(() => 
    {
        var pr = Edgecenter.GetProject.Invoke(new()
        {
            Name = "test",
        });
    
        var rg = Edgecenter.GetRegion.Invoke(new()
        {
            Name = "ED-10 Preprod",
        });
    
        var vm = Edgecenter.GetInstanceV2.Invoke(new()
        {
            Name = "test-vm",
            RegionId = rg.Apply(getRegionResult => getRegionResult.Id),
            ProjectId = pr.Apply(getProjectResult => getProjectResult.Id),
        });
    
        return new Dictionary<string, object?>
        {
            ["view"] = vm,
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.edgecenter.EdgecenterFunctions;
    import com.pulumi.edgecenter.inputs.GetProjectArgs;
    import com.pulumi.edgecenter.inputs.GetRegionArgs;
    import com.pulumi.edgecenter.inputs.GetInstanceV2Args;
    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) {
            final var pr = EdgecenterFunctions.getProject(GetProjectArgs.builder()
                .name("test")
                .build());
    
            final var rg = EdgecenterFunctions.getRegion(GetRegionArgs.builder()
                .name("ED-10 Preprod")
                .build());
    
            final var vm = EdgecenterFunctions.getInstanceV2(GetInstanceV2Args.builder()
                .name("test-vm")
                .regionId(rg.applyValue(getRegionResult -> getRegionResult.id()))
                .projectId(pr.applyValue(getProjectResult -> getProjectResult.id()))
                .build());
    
            ctx.export("view", vm.applyValue(getInstanceV2Result -> getInstanceV2Result));
        }
    }
    
    variables:
      pr:
        fn::invoke:
          function: edgecenter:getProject
          arguments:
            name: test
      rg:
        fn::invoke:
          function: edgecenter:getRegion
          arguments:
            name: ED-10 Preprod
      vm:
        fn::invoke:
          function: edgecenter:getInstanceV2
          arguments:
            name: test-vm
            regionId: ${rg.id}
            projectId: ${pr.id}
    outputs:
      view: ${vm}
    

    Using getInstanceV2

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getInstanceV2(args: GetInstanceV2Args, opts?: InvokeOptions): Promise<GetInstanceV2Result>
    function getInstanceV2Output(args: GetInstanceV2OutputArgs, opts?: InvokeOptions): Output<GetInstanceV2Result>
    def get_instance_v2(id: Optional[str] = None,
                        name: Optional[str] = None,
                        project_id: Optional[float] = None,
                        project_name: Optional[str] = None,
                        region_id: Optional[float] = None,
                        region_name: Optional[str] = None,
                        opts: Optional[InvokeOptions] = None) -> GetInstanceV2Result
    def get_instance_v2_output(id: Optional[pulumi.Input[str]] = None,
                        name: Optional[pulumi.Input[str]] = None,
                        project_id: Optional[pulumi.Input[float]] = None,
                        project_name: Optional[pulumi.Input[str]] = None,
                        region_id: Optional[pulumi.Input[float]] = None,
                        region_name: Optional[pulumi.Input[str]] = None,
                        opts: Optional[InvokeOptions] = None) -> Output[GetInstanceV2Result]
    func LookupInstanceV2(ctx *Context, args *LookupInstanceV2Args, opts ...InvokeOption) (*LookupInstanceV2Result, error)
    func LookupInstanceV2Output(ctx *Context, args *LookupInstanceV2OutputArgs, opts ...InvokeOption) LookupInstanceV2ResultOutput

    > Note: This function is named LookupInstanceV2 in the Go SDK.

    public static class GetInstanceV2 
    {
        public static Task<GetInstanceV2Result> InvokeAsync(GetInstanceV2Args args, InvokeOptions? opts = null)
        public static Output<GetInstanceV2Result> Invoke(GetInstanceV2InvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetInstanceV2Result> getInstanceV2(GetInstanceV2Args args, InvokeOptions options)
    public static Output<GetInstanceV2Result> getInstanceV2(GetInstanceV2Args args, InvokeOptions options)
    
    fn::invoke:
      function: edgecenter:index/getInstanceV2:getInstanceV2
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    The name of the instance.
    Id string
    The ID of this resource.
    ProjectId double
    The uuid of the project. Either 'projectid' or 'projectname' must be specified.
    ProjectName string
    The name of the project. Either 'projectid' or 'projectname' must be specified.
    RegionId double
    The uuid of the region. Either 'regionid' or 'regionname' must be specified.
    RegionName string
    The name of the region. Either 'regionid' or 'regionname' must be specified.
    Name string
    The name of the instance.
    Id string
    The ID of this resource.
    ProjectId float64
    The uuid of the project. Either 'projectid' or 'projectname' must be specified.
    ProjectName string
    The name of the project. Either 'projectid' or 'projectname' must be specified.
    RegionId float64
    The uuid of the region. Either 'regionid' or 'regionname' must be specified.
    RegionName string
    The name of the region. Either 'regionid' or 'regionname' must be specified.
    name String
    The name of the instance.
    id String
    The ID of this resource.
    projectId Double
    The uuid of the project. Either 'projectid' or 'projectname' must be specified.
    projectName String
    The name of the project. Either 'projectid' or 'projectname' must be specified.
    regionId Double
    The uuid of the region. Either 'regionid' or 'regionname' must be specified.
    regionName String
    The name of the region. Either 'regionid' or 'regionname' must be specified.
    name string
    The name of the instance.
    id string
    The ID of this resource.
    projectId number
    The uuid of the project. Either 'projectid' or 'projectname' must be specified.
    projectName string
    The name of the project. Either 'projectid' or 'projectname' must be specified.
    regionId number
    The uuid of the region. Either 'regionid' or 'regionname' must be specified.
    regionName string
    The name of the region. Either 'regionid' or 'regionname' must be specified.
    name str
    The name of the instance.
    id str
    The ID of this resource.
    project_id float
    The uuid of the project. Either 'projectid' or 'projectname' must be specified.
    project_name str
    The name of the project. Either 'projectid' or 'projectname' must be specified.
    region_id float
    The uuid of the region. Either 'regionid' or 'regionname' must be specified.
    region_name str
    The name of the region. Either 'regionid' or 'regionname' must be specified.
    name String
    The name of the instance.
    id String
    The ID of this resource.
    projectId Number
    The uuid of the project. Either 'projectid' or 'projectname' must be specified.
    projectName String
    The name of the project. Either 'projectid' or 'projectname' must be specified.
    regionId Number
    The uuid of the region. Either 'regionid' or 'regionname' must be specified.
    regionName String
    The name of the region. Either 'regionid' or 'regionname' must be specified.

    getInstanceV2 Result

    The following output properties are available:

    BootVolumes List<GetInstanceV2BootVolume>
    A set defining the volumes to be attached to the instance.
    DataVolumes List<GetInstanceV2DataVolume>
    A set defining the volumes to be attached to the instance.
    Flavor Dictionary<string, string>
    A map defining the flavor of the instance, for example, {"flavor_name": "g1-standard-2-4", "ram": 4096, ...}.
    FlavorId string
    The ID of the flavor to be used for the instance, determining its compute and memory, for example 'g1-standard-2-4'.
    Id string
    The ID of this resource.
    Interfaces List<GetInstanceV2Interface>
    A list defining the network interfaces to be attached to the instance.
    Metadata Dictionary<string, string>
    A map containing metadata, for example tags.
    Name string
    The name of the instance.
    Status string
    The current status of the instance. This is computed automatically and can be used to track the instance's state.
    VmState string
    The current virtual machine state of the instance, allowing you to start or stop the VM. Possible values are stopped and active.
    ProjectId double
    The uuid of the project. Either 'projectid' or 'projectname' must be specified.
    ProjectName string
    The name of the project. Either 'projectid' or 'projectname' must be specified.
    RegionId double
    The uuid of the region. Either 'regionid' or 'regionname' must be specified.
    RegionName string
    The name of the region. Either 'regionid' or 'regionname' must be specified.
    BootVolumes []GetInstanceV2BootVolume
    A set defining the volumes to be attached to the instance.
    DataVolumes []GetInstanceV2DataVolume
    A set defining the volumes to be attached to the instance.
    Flavor map[string]string
    A map defining the flavor of the instance, for example, {"flavor_name": "g1-standard-2-4", "ram": 4096, ...}.
    FlavorId string
    The ID of the flavor to be used for the instance, determining its compute and memory, for example 'g1-standard-2-4'.
    Id string
    The ID of this resource.
    Interfaces []GetInstanceV2Interface
    A list defining the network interfaces to be attached to the instance.
    Metadata map[string]string
    A map containing metadata, for example tags.
    Name string
    The name of the instance.
    Status string
    The current status of the instance. This is computed automatically and can be used to track the instance's state.
    VmState string
    The current virtual machine state of the instance, allowing you to start or stop the VM. Possible values are stopped and active.
    ProjectId float64
    The uuid of the project. Either 'projectid' or 'projectname' must be specified.
    ProjectName string
    The name of the project. Either 'projectid' or 'projectname' must be specified.
    RegionId float64
    The uuid of the region. Either 'regionid' or 'regionname' must be specified.
    RegionName string
    The name of the region. Either 'regionid' or 'regionname' must be specified.
    bootVolumes List<GetInstanceV2BootVolume>
    A set defining the volumes to be attached to the instance.
    dataVolumes List<GetInstanceV2DataVolume>
    A set defining the volumes to be attached to the instance.
    flavor Map<String,String>
    A map defining the flavor of the instance, for example, {"flavor_name": "g1-standard-2-4", "ram": 4096, ...}.
    flavorId String
    The ID of the flavor to be used for the instance, determining its compute and memory, for example 'g1-standard-2-4'.
    id String
    The ID of this resource.
    interfaces List<GetInstanceV2Interface>
    A list defining the network interfaces to be attached to the instance.
    metadata Map<String,String>
    A map containing metadata, for example tags.
    name String
    The name of the instance.
    status String
    The current status of the instance. This is computed automatically and can be used to track the instance's state.
    vmState String
    The current virtual machine state of the instance, allowing you to start or stop the VM. Possible values are stopped and active.
    projectId Double
    The uuid of the project. Either 'projectid' or 'projectname' must be specified.
    projectName String
    The name of the project. Either 'projectid' or 'projectname' must be specified.
    regionId Double
    The uuid of the region. Either 'regionid' or 'regionname' must be specified.
    regionName String
    The name of the region. Either 'regionid' or 'regionname' must be specified.
    bootVolumes GetInstanceV2BootVolume[]
    A set defining the volumes to be attached to the instance.
    dataVolumes GetInstanceV2DataVolume[]
    A set defining the volumes to be attached to the instance.
    flavor {[key: string]: string}
    A map defining the flavor of the instance, for example, {"flavor_name": "g1-standard-2-4", "ram": 4096, ...}.
    flavorId string
    The ID of the flavor to be used for the instance, determining its compute and memory, for example 'g1-standard-2-4'.
    id string
    The ID of this resource.
    interfaces GetInstanceV2Interface[]
    A list defining the network interfaces to be attached to the instance.
    metadata {[key: string]: string}
    A map containing metadata, for example tags.
    name string
    The name of the instance.
    status string
    The current status of the instance. This is computed automatically and can be used to track the instance's state.
    vmState string
    The current virtual machine state of the instance, allowing you to start or stop the VM. Possible values are stopped and active.
    projectId number
    The uuid of the project. Either 'projectid' or 'projectname' must be specified.
    projectName string
    The name of the project. Either 'projectid' or 'projectname' must be specified.
    regionId number
    The uuid of the region. Either 'regionid' or 'regionname' must be specified.
    regionName string
    The name of the region. Either 'regionid' or 'regionname' must be specified.
    boot_volumes Sequence[GetInstanceV2BootVolume]
    A set defining the volumes to be attached to the instance.
    data_volumes Sequence[GetInstanceV2DataVolume]
    A set defining the volumes to be attached to the instance.
    flavor Mapping[str, str]
    A map defining the flavor of the instance, for example, {"flavor_name": "g1-standard-2-4", "ram": 4096, ...}.
    flavor_id str
    The ID of the flavor to be used for the instance, determining its compute and memory, for example 'g1-standard-2-4'.
    id str
    The ID of this resource.
    interfaces Sequence[GetInstanceV2Interface]
    A list defining the network interfaces to be attached to the instance.
    metadata Mapping[str, str]
    A map containing metadata, for example tags.
    name str
    The name of the instance.
    status str
    The current status of the instance. This is computed automatically and can be used to track the instance's state.
    vm_state str
    The current virtual machine state of the instance, allowing you to start or stop the VM. Possible values are stopped and active.
    project_id float
    The uuid of the project. Either 'projectid' or 'projectname' must be specified.
    project_name str
    The name of the project. Either 'projectid' or 'projectname' must be specified.
    region_id float
    The uuid of the region. Either 'regionid' or 'regionname' must be specified.
    region_name str
    The name of the region. Either 'regionid' or 'regionname' must be specified.
    bootVolumes List<Property Map>
    A set defining the volumes to be attached to the instance.
    dataVolumes List<Property Map>
    A set defining the volumes to be attached to the instance.
    flavor Map<String>
    A map defining the flavor of the instance, for example, {"flavor_name": "g1-standard-2-4", "ram": 4096, ...}.
    flavorId String
    The ID of the flavor to be used for the instance, determining its compute and memory, for example 'g1-standard-2-4'.
    id String
    The ID of this resource.
    interfaces List<Property Map>
    A list defining the network interfaces to be attached to the instance.
    metadata Map<String>
    A map containing metadata, for example tags.
    name String
    The name of the instance.
    status String
    The current status of the instance. This is computed automatically and can be used to track the instance's state.
    vmState String
    The current virtual machine state of the instance, allowing you to start or stop the VM. Possible values are stopped and active.
    projectId Number
    The uuid of the project. Either 'projectid' or 'projectname' must be specified.
    projectName String
    The name of the project. Either 'projectid' or 'projectname' must be specified.
    regionId Number
    The uuid of the region. Either 'regionid' or 'regionname' must be specified.
    regionName String
    The name of the region. Either 'regionid' or 'regionname' must be specified.

    Supporting Types

    GetInstanceV2BootVolume

    Name string
    Size double
    TypeName string
    VolumeId string
    Name string
    Size float64
    TypeName string
    VolumeId string
    name String
    size Double
    typeName String
    volumeId String
    name string
    size number
    typeName string
    volumeId string
    name str
    size float
    type_name str
    volume_id str
    name String
    size Number
    typeName String
    volumeId String

    GetInstanceV2DataVolume

    Name string
    Size double
    TypeName string
    VolumeId string
    Name string
    Size float64
    TypeName string
    VolumeId string
    name String
    size Double
    typeName String
    volumeId String
    name string
    size number
    typeName string
    volumeId string
    name str
    size float
    type_name str
    volume_id str
    name String
    size Number
    typeName String
    volumeId String

    GetInstanceV2Interface

    IpAddress string
    NetworkId string
    NetworkName string
    Order double
    PortId string
    SubnetId string
    IpAddress string
    NetworkId string
    NetworkName string
    Order float64
    PortId string
    SubnetId string
    ipAddress String
    networkId String
    networkName String
    order Double
    portId String
    subnetId String
    ipAddress string
    networkId string
    networkName string
    order number
    portId string
    subnetId string
    ipAddress String
    networkId String
    networkName String
    order Number
    portId String
    subnetId String

    Package Details

    Repository
    edgecenter edge-center/terraform-provider-edgecenter
    License
    Notes
    This Pulumi package is based on the edgecenter Terraform Provider.
    edgecenter logo
    edgecenter 0.8.0 published on Wednesday, Apr 30, 2025 by edge-center