OpenStack

Pulumi Official
Package maintained by Pulumi
v3.9.0 published on Thursday, Aug 4, 2022 by Pulumi

getInstanceV2

Use this data source to get the details of a running server

Example Usage

using Pulumi;
using OpenStack = Pulumi.OpenStack;

class MyStack : Stack
{
    public MyStack()
    {
        var instance = Output.Create(OpenStack.Compute.GetInstanceV2.InvokeAsync(new OpenStack.Compute.GetInstanceV2Args
        {
            Id = "2ba26dc6-a12d-4889-8f25-794ea5bf4453",
        }));
    }

}
package main

import (
	"github.com/pulumi/pulumi-openstack/sdk/v3/go/openstack/compute"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := compute.GetInstanceV2(ctx, &compute.GetInstanceV2Args{
			Id: "2ba26dc6-a12d-4889-8f25-794ea5bf4453",
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.openstack.compute.ComputeFunctions;
import com.pulumi.openstack.compute.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 instance = ComputeFunctions.getInstanceV2(GetInstanceV2Args.builder()
            .id("2ba26dc6-a12d-4889-8f25-794ea5bf4453")
            .build());

    }
}
import pulumi
import pulumi_openstack as openstack

instance = openstack.compute.get_instance_v2(id="2ba26dc6-a12d-4889-8f25-794ea5bf4453")
import * as pulumi from "@pulumi/pulumi";
import * as openstack from "@pulumi/openstack";

const instance = pulumi.output(openstack.compute.getInstanceV2({
    // Randomly generated UUID, for demonstration purposes
    id: "2ba26dc6-a12d-4889-8f25-794ea5bf4453",
}));
variables:
  instance:
    Fn::Invoke:
      Function: openstack:compute:getInstanceV2
      Arguments:
        id: 2ba26dc6-a12d-4889-8f25-794ea5bf4453

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,
                    networks: Optional[Sequence[GetInstanceV2Network]] = None,
                    region: Optional[str] = None,
                    user_data: Optional[str] = None,
                    opts: Optional[InvokeOptions] = None) -> GetInstanceV2Result
def get_instance_v2_output(id: Optional[pulumi.Input[str]] = None,
                    networks: Optional[pulumi.Input[Sequence[pulumi.Input[GetInstanceV2NetworkArgs]]]] = None,
                    region: Optional[pulumi.Input[str]] = None,
                    user_data: Optional[pulumi.Input[str]] = None,
                    opts: Optional[InvokeOptions] = None) -> Output[GetInstanceV2Result]
func GetInstanceV2(ctx *Context, args *GetInstanceV2Args, opts ...InvokeOption) (*GetInstanceV2Result, error)
func GetInstanceV2Output(ctx *Context, args *GetInstanceV2OutputArgs, opts ...InvokeOption) GetInstanceV2ResultOutput

> Note: This function is named GetInstanceV2 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)
// Output-based functions aren't available in Java yet
Fn::Invoke:
  Function: openstack:compute/getInstanceV2:getInstanceV2
  Arguments:
    # Arguments dictionary

The following arguments are supported:

Id string

The UUID of the instance

Networks List<Pulumi.OpenStack.Compute.Inputs.GetInstanceV2Network>

An array of maps, detailed below.

Region string
UserData string

The user data added when the server was created.

Id string

The UUID of the instance

Networks []GetInstanceV2Network

An array of maps, detailed below.

Region string
UserData string

The user data added when the server was created.

id String

The UUID of the instance

networks List<GetInstanceV2Network>

An array of maps, detailed below.

region String
userData String

The user data added when the server was created.

id string

The UUID of the instance

networks GetInstanceV2Network[]

An array of maps, detailed below.

region string
userData string

The user data added when the server was created.

id str

The UUID of the instance

networks Sequence[GetInstanceV2Network]

An array of maps, detailed below.

region str
user_data str

The user data added when the server was created.

id String

The UUID of the instance

networks List<Property Map>

An array of maps, detailed below.

region String
userData String

The user data added when the server was created.

getInstanceV2 Result

The following output properties are available:

AccessIpV4 string

The first IPv4 address assigned to this server.

AccessIpV6 string

The first IPv6 address assigned to this server.

AvailabilityZone string

The availability zone of this server.

FlavorId string

The flavor ID used to create the server.

FlavorName string

The flavor name used to create the server.

Id string
ImageId string

The image ID used to create the server.

ImageName string

The image name used to create the server.

KeyPair string

The name of the key pair assigned to this server.

Metadata Dictionary<string, object>

A set of key/value pairs made available to the server.

Name string

The name of the network

Networks List<Pulumi.OpenStack.Compute.Outputs.GetInstanceV2Network>

An array of maps, detailed below.

PowerState string
Region string
SecurityGroups List<string>

An array of security group names associated with this server.

Tags List<string>

A set of string tags assigned to this server.

UserData string

The user data added when the server was created.

AccessIpV4 string

The first IPv4 address assigned to this server.

AccessIpV6 string

The first IPv6 address assigned to this server.

AvailabilityZone string

The availability zone of this server.

FlavorId string

The flavor ID used to create the server.

FlavorName string

The flavor name used to create the server.

Id string
ImageId string

The image ID used to create the server.

ImageName string

The image name used to create the server.

KeyPair string

The name of the key pair assigned to this server.

Metadata map[string]interface{}

A set of key/value pairs made available to the server.

Name string

The name of the network

Networks []GetInstanceV2Network

An array of maps, detailed below.

PowerState string
Region string
SecurityGroups []string

An array of security group names associated with this server.

Tags []string

A set of string tags assigned to this server.

UserData string

The user data added when the server was created.

accessIpV4 String

The first IPv4 address assigned to this server.

accessIpV6 String

The first IPv6 address assigned to this server.

availabilityZone String

The availability zone of this server.

flavorId String

The flavor ID used to create the server.

flavorName String

The flavor name used to create the server.

id String
imageId String

The image ID used to create the server.

imageName String

The image name used to create the server.

keyPair String

The name of the key pair assigned to this server.

metadata Map<String,Object>

A set of key/value pairs made available to the server.

name String

The name of the network

networks List<GetInstanceV2Network>

An array of maps, detailed below.

powerState String
region String
securityGroups List<String>

An array of security group names associated with this server.

tags List<String>

A set of string tags assigned to this server.

userData String

The user data added when the server was created.

accessIpV4 string

The first IPv4 address assigned to this server.

accessIpV6 string

The first IPv6 address assigned to this server.

availabilityZone string

The availability zone of this server.

flavorId string

The flavor ID used to create the server.

flavorName string

The flavor name used to create the server.

id string
imageId string

The image ID used to create the server.

imageName string

The image name used to create the server.

keyPair string

The name of the key pair assigned to this server.

metadata {[key: string]: any}

A set of key/value pairs made available to the server.

name string

The name of the network

networks GetInstanceV2Network[]

An array of maps, detailed below.

powerState string
region string
securityGroups string[]

An array of security group names associated with this server.

tags string[]

A set of string tags assigned to this server.

userData string

The user data added when the server was created.

access_ip_v4 str

The first IPv4 address assigned to this server.

access_ip_v6 str

The first IPv6 address assigned to this server.

availability_zone str

The availability zone of this server.

flavor_id str

The flavor ID used to create the server.

flavor_name str

The flavor name used to create the server.

id str
image_id str

The image ID used to create the server.

image_name str

The image name used to create the server.

key_pair str

The name of the key pair assigned to this server.

metadata Mapping[str, Any]

A set of key/value pairs made available to the server.

name str

The name of the network

networks Sequence[GetInstanceV2Network]

An array of maps, detailed below.

power_state str
region str
security_groups Sequence[str]

An array of security group names associated with this server.

tags Sequence[str]

A set of string tags assigned to this server.

user_data str

The user data added when the server was created.

accessIpV4 String

The first IPv4 address assigned to this server.

accessIpV6 String

The first IPv6 address assigned to this server.

availabilityZone String

The availability zone of this server.

flavorId String

The flavor ID used to create the server.

flavorName String

The flavor name used to create the server.

id String
imageId String

The image ID used to create the server.

imageName String

The image name used to create the server.

keyPair String

The name of the key pair assigned to this server.

metadata Map<Any>

A set of key/value pairs made available to the server.

name String

The name of the network

networks List<Property Map>

An array of maps, detailed below.

powerState String
region String
securityGroups List<String>

An array of security group names associated with this server.

tags List<String>

A set of string tags assigned to this server.

userData String

The user data added when the server was created.

Supporting Types

GetInstanceV2Network

FixedIpV4 string

The IPv4 address assigned to this network port.

FixedIpV6 string

The IPv6 address assigned to this network port.

Mac string

The MAC address assigned to this network interface.

Name string

The name of the network

Port string

The port UUID for this network

Uuid string

The UUID of the network

FixedIpV4 string

The IPv4 address assigned to this network port.

FixedIpV6 string

The IPv6 address assigned to this network port.

Mac string

The MAC address assigned to this network interface.

Name string

The name of the network

Port string

The port UUID for this network

Uuid string

The UUID of the network

fixedIpV4 String

The IPv4 address assigned to this network port.

fixedIpV6 String

The IPv6 address assigned to this network port.

mac String

The MAC address assigned to this network interface.

name String

The name of the network

port String

The port UUID for this network

uuid String

The UUID of the network

fixedIpV4 string

The IPv4 address assigned to this network port.

fixedIpV6 string

The IPv6 address assigned to this network port.

mac string

The MAC address assigned to this network interface.

name string

The name of the network

port string

The port UUID for this network

uuid string

The UUID of the network

fixed_ip_v4 str

The IPv4 address assigned to this network port.

fixed_ip_v6 str

The IPv6 address assigned to this network port.

mac str

The MAC address assigned to this network interface.

name str

The name of the network

port str

The port UUID for this network

uuid str

The UUID of the network

fixedIpV4 String

The IPv4 address assigned to this network port.

fixedIpV6 String

The IPv6 address assigned to this network port.

mac String

The MAC address assigned to this network interface.

name String

The name of the network

port String

The port UUID for this network

uuid String

The UUID of the network

Package Details

Repository
https://github.com/pulumi/pulumi-openstack
License
Apache-2.0
Notes

This Pulumi package is based on the openstack Terraform Provider.