1. Packages
  2. Flexibleengine Provider
  3. API Docs
  4. getComputeInstanceV2
flexibleengine 1.46.0 published on Monday, Apr 14, 2025 by flexibleenginecloud

flexibleengine.getComputeInstanceV2

Explore with Pulumi AI

flexibleengine logo
flexibleengine 1.46.0 published on Monday, Apr 14, 2025 by flexibleenginecloud

    Use this data source to get the details of a specified compute instance.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as flexibleengine from "@pulumi/flexibleengine";
    
    const config = new pulumi.Config();
    const serverName = config.requireObject("serverName");
    const demo = flexibleengine.getComputeInstanceV2({
        name: serverName,
    });
    
    import pulumi
    import pulumi_flexibleengine as flexibleengine
    
    config = pulumi.Config()
    server_name = config.require_object("serverName")
    demo = flexibleengine.get_compute_instance_v2(name=server_name)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/flexibleengine/flexibleengine"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		cfg := config.New(ctx, "")
    		serverName := cfg.RequireObject("serverName")
    		_, err := flexibleengine.LookupComputeInstanceV2(ctx, &flexibleengine.LookupComputeInstanceV2Args{
    			Name: pulumi.StringRef(serverName),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Flexibleengine = Pulumi.Flexibleengine;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var serverName = config.RequireObject<dynamic>("serverName");
        var demo = Flexibleengine.GetComputeInstanceV2.Invoke(new()
        {
            Name = serverName,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.flexibleengine.FlexibleengineFunctions;
    import com.pulumi.flexibleengine.inputs.GetComputeInstanceV2Args;
    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 config = ctx.config();
            final var serverName = config.get("serverName");
            final var demo = FlexibleengineFunctions.getComputeInstanceV2(GetComputeInstanceV2Args.builder()
                .name(serverName)
                .build());
    
        }
    }
    
    configuration:
      serverName:
        type: dynamic
    variables:
      demo:
        fn::invoke:
          function: flexibleengine:getComputeInstanceV2
          arguments:
            name: ${serverName}
    

    Using getComputeInstanceV2

    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 getComputeInstanceV2(args: GetComputeInstanceV2Args, opts?: InvokeOptions): Promise<GetComputeInstanceV2Result>
    function getComputeInstanceV2Output(args: GetComputeInstanceV2OutputArgs, opts?: InvokeOptions): Output<GetComputeInstanceV2Result>
    def get_compute_instance_v2(fixed_ip_v4: Optional[str] = None,
                                flavor_id: Optional[str] = None,
                                id: Optional[str] = None,
                                name: Optional[str] = None,
                                region: Optional[str] = None,
                                opts: Optional[InvokeOptions] = None) -> GetComputeInstanceV2Result
    def get_compute_instance_v2_output(fixed_ip_v4: Optional[pulumi.Input[str]] = None,
                                flavor_id: Optional[pulumi.Input[str]] = None,
                                id: Optional[pulumi.Input[str]] = None,
                                name: Optional[pulumi.Input[str]] = None,
                                region: Optional[pulumi.Input[str]] = None,
                                opts: Optional[InvokeOptions] = None) -> Output[GetComputeInstanceV2Result]
    func LookupComputeInstanceV2(ctx *Context, args *LookupComputeInstanceV2Args, opts ...InvokeOption) (*LookupComputeInstanceV2Result, error)
    func LookupComputeInstanceV2Output(ctx *Context, args *LookupComputeInstanceV2OutputArgs, opts ...InvokeOption) LookupComputeInstanceV2ResultOutput

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

    public static class GetComputeInstanceV2 
    {
        public static Task<GetComputeInstanceV2Result> InvokeAsync(GetComputeInstanceV2Args args, InvokeOptions? opts = null)
        public static Output<GetComputeInstanceV2Result> Invoke(GetComputeInstanceV2InvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetComputeInstanceV2Result> getComputeInstanceV2(GetComputeInstanceV2Args args, InvokeOptions options)
    public static Output<GetComputeInstanceV2Result> getComputeInstanceV2(GetComputeInstanceV2Args args, InvokeOptions options)
    
    fn::invoke:
      function: flexibleengine:index/getComputeInstanceV2:getComputeInstanceV2
      arguments:
        # arguments dictionary

    The following arguments are supported:

    FixedIpV4 string
    Specifies the IPv4 addresses of the server.
    FlavorId string
    Specifies the flavor ID.
    Id string
    The instance ID in UUID format.
    Name string
    Specifies the server name, which can be queried with a regular expression.
    Region string
    The region in which to obtain the server instance. If omitted, the provider-level region will be used.
    FixedIpV4 string
    Specifies the IPv4 addresses of the server.
    FlavorId string
    Specifies the flavor ID.
    Id string
    The instance ID in UUID format.
    Name string
    Specifies the server name, which can be queried with a regular expression.
    Region string
    The region in which to obtain the server instance. If omitted, the provider-level region will be used.
    fixedIpV4 String
    Specifies the IPv4 addresses of the server.
    flavorId String
    Specifies the flavor ID.
    id String
    The instance ID in UUID format.
    name String
    Specifies the server name, which can be queried with a regular expression.
    region String
    The region in which to obtain the server instance. If omitted, the provider-level region will be used.
    fixedIpV4 string
    Specifies the IPv4 addresses of the server.
    flavorId string
    Specifies the flavor ID.
    id string
    The instance ID in UUID format.
    name string
    Specifies the server name, which can be queried with a regular expression.
    region string
    The region in which to obtain the server instance. If omitted, the provider-level region will be used.
    fixed_ip_v4 str
    Specifies the IPv4 addresses of the server.
    flavor_id str
    Specifies the flavor ID.
    id str
    The instance ID in UUID format.
    name str
    Specifies the server name, which can be queried with a regular expression.
    region str
    The region in which to obtain the server instance. If omitted, the provider-level region will be used.
    fixedIpV4 String
    Specifies the IPv4 addresses of the server.
    flavorId String
    Specifies the flavor ID.
    id String
    The instance ID in UUID format.
    name String
    Specifies the server name, which can be queried with a regular expression.
    region String
    The region in which to obtain the server instance. If omitted, the provider-level region will be used.

    getComputeInstanceV2 Result

    The following output properties are available:

    AvailabilityZone string
    The availability zone where the instance is located.
    BlockDevices List<GetComputeInstanceV2BlockDevice>
    An array of one or more disks to attach to the instance. The block_device object structure is documented below.
    FlavorId string
    FlavorName string
    The flavor name of the instance.
    FloatingIp string
    The EIP address that is associated to the instance.
    Id string
    The instance ID in UUID format.
    ImageId string
    The image ID of the instance.
    ImageName string
    The image name of the instance.
    KeyPair string
    The key pair that is used to authenticate the instance.
    Metadata Dictionary<string, string>
    The metadata of the instance in key/value format.
    Name string
    Networks List<GetComputeInstanceV2Network>
    An array of one or more networks to attach to the instance. The network object structure is documented below.
    Region string
    SchedulerHints List<GetComputeInstanceV2SchedulerHint>
    The scheduler with hints on how the instance should be launched. The scheduler_hints object structure is documented below.
    SecurityGroups List<string>
    An array of one or more security group names to associate with the instance.
    Status string
    The status of the instance.
    SystemDiskId string
    The system disk volume ID.
    Tags Dictionary<string, string>
    The tags of the instance in key/value format.
    UserData string
    The user data (information after encoding) configured during instance creation.
    FixedIpV4 string
    The fixed IPv4 address of the instance on this network.
    AvailabilityZone string
    The availability zone where the instance is located.
    BlockDevices []GetComputeInstanceV2BlockDevice
    An array of one or more disks to attach to the instance. The block_device object structure is documented below.
    FlavorId string
    FlavorName string
    The flavor name of the instance.
    FloatingIp string
    The EIP address that is associated to the instance.
    Id string
    The instance ID in UUID format.
    ImageId string
    The image ID of the instance.
    ImageName string
    The image name of the instance.
    KeyPair string
    The key pair that is used to authenticate the instance.
    Metadata map[string]string
    The metadata of the instance in key/value format.
    Name string
    Networks []GetComputeInstanceV2Network
    An array of one or more networks to attach to the instance. The network object structure is documented below.
    Region string
    SchedulerHints []GetComputeInstanceV2SchedulerHint
    The scheduler with hints on how the instance should be launched. The scheduler_hints object structure is documented below.
    SecurityGroups []string
    An array of one or more security group names to associate with the instance.
    Status string
    The status of the instance.
    SystemDiskId string
    The system disk volume ID.
    Tags map[string]string
    The tags of the instance in key/value format.
    UserData string
    The user data (information after encoding) configured during instance creation.
    FixedIpV4 string
    The fixed IPv4 address of the instance on this network.
    availabilityZone String
    The availability zone where the instance is located.
    blockDevices List<GetComputeInstanceV2BlockDevice>
    An array of one or more disks to attach to the instance. The block_device object structure is documented below.
    flavorId String
    flavorName String
    The flavor name of the instance.
    floatingIp String
    The EIP address that is associated to the instance.
    id String
    The instance ID in UUID format.
    imageId String
    The image ID of the instance.
    imageName String
    The image name of the instance.
    keyPair String
    The key pair that is used to authenticate the instance.
    metadata Map<String,String>
    The metadata of the instance in key/value format.
    name String
    networks List<GetComputeInstanceV2Network>
    An array of one or more networks to attach to the instance. The network object structure is documented below.
    region String
    schedulerHints List<GetComputeInstanceV2SchedulerHint>
    The scheduler with hints on how the instance should be launched. The scheduler_hints object structure is documented below.
    securityGroups List<String>
    An array of one or more security group names to associate with the instance.
    status String
    The status of the instance.
    systemDiskId String
    The system disk volume ID.
    tags Map<String,String>
    The tags of the instance in key/value format.
    userData String
    The user data (information after encoding) configured during instance creation.
    fixedIpV4 String
    The fixed IPv4 address of the instance on this network.
    availabilityZone string
    The availability zone where the instance is located.
    blockDevices GetComputeInstanceV2BlockDevice[]
    An array of one or more disks to attach to the instance. The block_device object structure is documented below.
    flavorId string
    flavorName string
    The flavor name of the instance.
    floatingIp string
    The EIP address that is associated to the instance.
    id string
    The instance ID in UUID format.
    imageId string
    The image ID of the instance.
    imageName string
    The image name of the instance.
    keyPair string
    The key pair that is used to authenticate the instance.
    metadata {[key: string]: string}
    The metadata of the instance in key/value format.
    name string
    networks GetComputeInstanceV2Network[]
    An array of one or more networks to attach to the instance. The network object structure is documented below.
    region string
    schedulerHints GetComputeInstanceV2SchedulerHint[]
    The scheduler with hints on how the instance should be launched. The scheduler_hints object structure is documented below.
    securityGroups string[]
    An array of one or more security group names to associate with the instance.
    status string
    The status of the instance.
    systemDiskId string
    The system disk volume ID.
    tags {[key: string]: string}
    The tags of the instance in key/value format.
    userData string
    The user data (information after encoding) configured during instance creation.
    fixedIpV4 string
    The fixed IPv4 address of the instance on this network.
    availability_zone str
    The availability zone where the instance is located.
    block_devices Sequence[GetComputeInstanceV2BlockDevice]
    An array of one or more disks to attach to the instance. The block_device object structure is documented below.
    flavor_id str
    flavor_name str
    The flavor name of the instance.
    floating_ip str
    The EIP address that is associated to the instance.
    id str
    The instance ID in UUID format.
    image_id str
    The image ID of the instance.
    image_name str
    The image name of the instance.
    key_pair str
    The key pair that is used to authenticate the instance.
    metadata Mapping[str, str]
    The metadata of the instance in key/value format.
    name str
    networks Sequence[GetComputeInstanceV2Network]
    An array of one or more networks to attach to the instance. The network object structure is documented below.
    region str
    scheduler_hints Sequence[GetComputeInstanceV2SchedulerHint]
    The scheduler with hints on how the instance should be launched. The scheduler_hints object structure is documented below.
    security_groups Sequence[str]
    An array of one or more security group names to associate with the instance.
    status str
    The status of the instance.
    system_disk_id str
    The system disk volume ID.
    tags Mapping[str, str]
    The tags of the instance in key/value format.
    user_data str
    The user data (information after encoding) configured during instance creation.
    fixed_ip_v4 str
    The fixed IPv4 address of the instance on this network.
    availabilityZone String
    The availability zone where the instance is located.
    blockDevices List<Property Map>
    An array of one or more disks to attach to the instance. The block_device object structure is documented below.
    flavorId String
    flavorName String
    The flavor name of the instance.
    floatingIp String
    The EIP address that is associated to the instance.
    id String
    The instance ID in UUID format.
    imageId String
    The image ID of the instance.
    imageName String
    The image name of the instance.
    keyPair String
    The key pair that is used to authenticate the instance.
    metadata Map<String>
    The metadata of the instance in key/value format.
    name String
    networks List<Property Map>
    An array of one or more networks to attach to the instance. The network object structure is documented below.
    region String
    schedulerHints List<Property Map>
    The scheduler with hints on how the instance should be launched. The scheduler_hints object structure is documented below.
    securityGroups List<String>
    An array of one or more security group names to associate with the instance.
    status String
    The status of the instance.
    systemDiskId String
    The system disk volume ID.
    tags Map<String>
    The tags of the instance in key/value format.
    userData String
    The user data (information after encoding) configured during instance creation.
    fixedIpV4 String
    The fixed IPv4 address of the instance on this network.

    Supporting Types

    GetComputeInstanceV2BlockDevice

    BootIndex double
    The volume boot index on that attachment.
    PciAddress string
    The volume pci address on that attachment.
    Size double
    The volume size on that attachment.
    Type string
    The volume type on that attachment.
    Uuid string
    The volume id on that attachment.
    BootIndex float64
    The volume boot index on that attachment.
    PciAddress string
    The volume pci address on that attachment.
    Size float64
    The volume size on that attachment.
    Type string
    The volume type on that attachment.
    Uuid string
    The volume id on that attachment.
    bootIndex Double
    The volume boot index on that attachment.
    pciAddress String
    The volume pci address on that attachment.
    size Double
    The volume size on that attachment.
    type String
    The volume type on that attachment.
    uuid String
    The volume id on that attachment.
    bootIndex number
    The volume boot index on that attachment.
    pciAddress string
    The volume pci address on that attachment.
    size number
    The volume size on that attachment.
    type string
    The volume type on that attachment.
    uuid string
    The volume id on that attachment.
    boot_index float
    The volume boot index on that attachment.
    pci_address str
    The volume pci address on that attachment.
    size float
    The volume size on that attachment.
    type str
    The volume type on that attachment.
    uuid str
    The volume id on that attachment.
    bootIndex Number
    The volume boot index on that attachment.
    pciAddress String
    The volume pci address on that attachment.
    size Number
    The volume size on that attachment.
    type String
    The volume type on that attachment.
    uuid String
    The volume id on that attachment.

    GetComputeInstanceV2Network

    FixedIpV4 string
    Specifies the IPv4 addresses of the server.
    FixedIpV6 string
    The Fixed IPv6 address of the instance on that network.
    Mac string
    The MAC address of the NIC on that network.
    Port string
    The port ID corresponding to the IP address on that network.
    Uuid string
    The volume id on that attachment.
    FixedIpV4 string
    Specifies the IPv4 addresses of the server.
    FixedIpV6 string
    The Fixed IPv6 address of the instance on that network.
    Mac string
    The MAC address of the NIC on that network.
    Port string
    The port ID corresponding to the IP address on that network.
    Uuid string
    The volume id on that attachment.
    fixedIpV4 String
    Specifies the IPv4 addresses of the server.
    fixedIpV6 String
    The Fixed IPv6 address of the instance on that network.
    mac String
    The MAC address of the NIC on that network.
    port String
    The port ID corresponding to the IP address on that network.
    uuid String
    The volume id on that attachment.
    fixedIpV4 string
    Specifies the IPv4 addresses of the server.
    fixedIpV6 string
    The Fixed IPv6 address of the instance on that network.
    mac string
    The MAC address of the NIC on that network.
    port string
    The port ID corresponding to the IP address on that network.
    uuid string
    The volume id on that attachment.
    fixed_ip_v4 str
    Specifies the IPv4 addresses of the server.
    fixed_ip_v6 str
    The Fixed IPv6 address of the instance on that network.
    mac str
    The MAC address of the NIC on that network.
    port str
    The port ID corresponding to the IP address on that network.
    uuid str
    The volume id on that attachment.
    fixedIpV4 String
    Specifies the IPv4 addresses of the server.
    fixedIpV6 String
    The Fixed IPv6 address of the instance on that network.
    mac String
    The MAC address of the NIC on that network.
    port String
    The port ID corresponding to the IP address on that network.
    uuid String
    The volume id on that attachment.

    GetComputeInstanceV2SchedulerHint

    Group string
    The UUID of a Server Group where the instance will be placed into.
    Group string
    The UUID of a Server Group where the instance will be placed into.
    group String
    The UUID of a Server Group where the instance will be placed into.
    group string
    The UUID of a Server Group where the instance will be placed into.
    group str
    The UUID of a Server Group where the instance will be placed into.
    group String
    The UUID of a Server Group where the instance will be placed into.

    Package Details

    Repository
    flexibleengine flexibleenginecloud/terraform-provider-flexibleengine
    License
    Notes
    This Pulumi package is based on the flexibleengine Terraform Provider.
    flexibleengine logo
    flexibleengine 1.46.0 published on Monday, Apr 14, 2025 by flexibleenginecloud