1. Packages
  2. Outscale Provider
  3. API Docs
  4. getVmState
outscale 1.1.0 published on Thursday, Apr 3, 2025 by outscale

outscale.getVmState

Explore with Pulumi AI

outscale 1.1.0 published on Thursday, Apr 3, 2025 by outscale

Provides information about a VM state.

For more information on this resource, see the User Guide.
For more information on this resource actions, see the API documentation.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as outscale from "@pulumi/outscale";

const vmState01 = outscale.getVmState({
    allVms: true,
    filters: [{
        name: "vm_ids",
        values: ["i-12345678"],
    }],
});
Copy
import pulumi
import pulumi_outscale as outscale

vm_state01 = outscale.get_vm_state(all_vms=True,
    filters=[{
        "name": "vm_ids",
        "values": ["i-12345678"],
    }])
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/outscale/outscale"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := outscale.GetVmState(ctx, &outscale.GetVmStateArgs{
			AllVms: pulumi.BoolRef(true),
			Filters: []outscale.GetVmStateFilter{
				{
					Name: "vm_ids",
					Values: []string{
						"i-12345678",
					},
				},
			},
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Outscale = Pulumi.Outscale;

return await Deployment.RunAsync(() => 
{
    var vmState01 = Outscale.GetVmState.Invoke(new()
    {
        AllVms = true,
        Filters = new[]
        {
            new Outscale.Inputs.GetVmStateFilterInputArgs
            {
                Name = "vm_ids",
                Values = new[]
                {
                    "i-12345678",
                },
            },
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.outscale.OutscaleFunctions;
import com.pulumi.outscale.inputs.GetVmStateArgs;
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 vmState01 = OutscaleFunctions.getVmState(GetVmStateArgs.builder()
            .allVms(true)
            .filters(GetVmStateFilterArgs.builder()
                .name("vm_ids")
                .values("i-12345678")
                .build())
            .build());

    }
}
Copy
variables:
  vmState01:
    fn::invoke:
      function: outscale:getVmState
      arguments:
        allVms: true
        filters:
          - name: vm_ids
            values:
              - i-12345678
Copy

Using getVmState

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 getVmState(args: GetVmStateArgs, opts?: InvokeOptions): Promise<GetVmStateResult>
function getVmStateOutput(args: GetVmStateOutputArgs, opts?: InvokeOptions): Output<GetVmStateResult>
Copy
def get_vm_state(all_vms: Optional[bool] = None,
                 filters: Optional[Sequence[GetVmStateFilter]] = None,
                 id: Optional[str] = None,
                 vm_id: Optional[str] = None,
                 opts: Optional[InvokeOptions] = None) -> GetVmStateResult
def get_vm_state_output(all_vms: Optional[pulumi.Input[bool]] = None,
                 filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetVmStateFilterArgs]]]] = None,
                 id: Optional[pulumi.Input[str]] = None,
                 vm_id: Optional[pulumi.Input[str]] = None,
                 opts: Optional[InvokeOptions] = None) -> Output[GetVmStateResult]
Copy
func GetVmState(ctx *Context, args *GetVmStateArgs, opts ...InvokeOption) (*GetVmStateResult, error)
func GetVmStateOutput(ctx *Context, args *GetVmStateOutputArgs, opts ...InvokeOption) GetVmStateResultOutput
Copy

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

public static class GetVmState 
{
    public static Task<GetVmStateResult> InvokeAsync(GetVmStateArgs args, InvokeOptions? opts = null)
    public static Output<GetVmStateResult> Invoke(GetVmStateInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetVmStateResult> getVmState(GetVmStateArgs args, InvokeOptions options)
public static Output<GetVmStateResult> getVmState(GetVmStateArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: outscale:index/getVmState:getVmState
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

AllVms bool
If true, includes the status of all VMs. By default or if set to false, only includes the status of running VMs.
Filters List<GetVmStateFilter>
A combination of a filter name and one or more filter values. You can specify this argument for as many filter names as you need. The filter name can be any of the following:
Id string
VmId string
The ID of the VM.
AllVms bool
If true, includes the status of all VMs. By default or if set to false, only includes the status of running VMs.
Filters []GetVmStateFilter
A combination of a filter name and one or more filter values. You can specify this argument for as many filter names as you need. The filter name can be any of the following:
Id string
VmId string
The ID of the VM.
allVms Boolean
If true, includes the status of all VMs. By default or if set to false, only includes the status of running VMs.
filters List<GetVmStateFilter>
A combination of a filter name and one or more filter values. You can specify this argument for as many filter names as you need. The filter name can be any of the following:
id String
vmId String
The ID of the VM.
allVms boolean
If true, includes the status of all VMs. By default or if set to false, only includes the status of running VMs.
filters GetVmStateFilter[]
A combination of a filter name and one or more filter values. You can specify this argument for as many filter names as you need. The filter name can be any of the following:
id string
vmId string
The ID of the VM.
all_vms bool
If true, includes the status of all VMs. By default or if set to false, only includes the status of running VMs.
filters Sequence[GetVmStateFilter]
A combination of a filter name and one or more filter values. You can specify this argument for as many filter names as you need. The filter name can be any of the following:
id str
vm_id str
The ID of the VM.
allVms Boolean
If true, includes the status of all VMs. By default or if set to false, only includes the status of running VMs.
filters List<Property Map>
A combination of a filter name and one or more filter values. You can specify this argument for as many filter names as you need. The filter name can be any of the following:
id String
vmId String
The ID of the VM.

getVmState Result

The following output properties are available:

Id string
MaintenanceEvents List<GetVmStateMaintenanceEvent>
One or more scheduled events associated with the VM.
RequestId string
SubregionName string
The name of the Subregion of the VM.
VmState string
The state of the VM (pending | running | stopping | stopped | shutting-down | terminated | quarantine).
AllVms bool
Filters List<GetVmStateFilter>
VmId string
The ID of the VM.
Id string
MaintenanceEvents []GetVmStateMaintenanceEvent
One or more scheduled events associated with the VM.
RequestId string
SubregionName string
The name of the Subregion of the VM.
VmState string
The state of the VM (pending | running | stopping | stopped | shutting-down | terminated | quarantine).
AllVms bool
Filters []GetVmStateFilter
VmId string
The ID of the VM.
id String
maintenanceEvents List<GetVmStateMaintenanceEvent>
One or more scheduled events associated with the VM.
requestId String
subregionName String
The name of the Subregion of the VM.
vmState String
The state of the VM (pending | running | stopping | stopped | shutting-down | terminated | quarantine).
allVms Boolean
filters List<GetVmStateFilter>
vmId String
The ID of the VM.
id string
maintenanceEvents GetVmStateMaintenanceEvent[]
One or more scheduled events associated with the VM.
requestId string
subregionName string
The name of the Subregion of the VM.
vmState string
The state of the VM (pending | running | stopping | stopped | shutting-down | terminated | quarantine).
allVms boolean
filters GetVmStateFilter[]
vmId string
The ID of the VM.
id str
maintenance_events Sequence[GetVmStateMaintenanceEvent]
One or more scheduled events associated with the VM.
request_id str
subregion_name str
The name of the Subregion of the VM.
vm_state str
The state of the VM (pending | running | stopping | stopped | shutting-down | terminated | quarantine).
all_vms bool
filters Sequence[GetVmStateFilter]
vm_id str
The ID of the VM.
id String
maintenanceEvents List<Property Map>
One or more scheduled events associated with the VM.
requestId String
subregionName String
The name of the Subregion of the VM.
vmState String
The state of the VM (pending | running | stopping | stopped | shutting-down | terminated | quarantine).
allVms Boolean
filters List<Property Map>
vmId String
The ID of the VM.

Supporting Types

GetVmStateFilter

Name This property is required. string
Values This property is required. List<string>
Name This property is required. string
Values This property is required. []string
name This property is required. String
values This property is required. List<String>
name This property is required. string
values This property is required. string[]
name This property is required. str
values This property is required. Sequence[str]
name This property is required. String
values This property is required. List<String>

GetVmStateMaintenanceEvent

Code This property is required. string
The code of the event (system-reboot | system-maintenance).
Description This property is required. string
The description of the event.
NotAfter This property is required. string
The latest scheduled end date and time (UTC) for the event.
NotBefore This property is required. string
The earliest scheduled start date and time (UTC) for the event.
Code This property is required. string
The code of the event (system-reboot | system-maintenance).
Description This property is required. string
The description of the event.
NotAfter This property is required. string
The latest scheduled end date and time (UTC) for the event.
NotBefore This property is required. string
The earliest scheduled start date and time (UTC) for the event.
code This property is required. String
The code of the event (system-reboot | system-maintenance).
description This property is required. String
The description of the event.
notAfter This property is required. String
The latest scheduled end date and time (UTC) for the event.
notBefore This property is required. String
The earliest scheduled start date and time (UTC) for the event.
code This property is required. string
The code of the event (system-reboot | system-maintenance).
description This property is required. string
The description of the event.
notAfter This property is required. string
The latest scheduled end date and time (UTC) for the event.
notBefore This property is required. string
The earliest scheduled start date and time (UTC) for the event.
code This property is required. str
The code of the event (system-reboot | system-maintenance).
description This property is required. str
The description of the event.
not_after This property is required. str
The latest scheduled end date and time (UTC) for the event.
not_before This property is required. str
The earliest scheduled start date and time (UTC) for the event.
code This property is required. String
The code of the event (system-reboot | system-maintenance).
description This property is required. String
The description of the event.
notAfter This property is required. String
The latest scheduled end date and time (UTC) for the event.
notBefore This property is required. String
The earliest scheduled start date and time (UTC) for the event.

Package Details

Repository
outscale outscale/terraform-provider-outscale
License
Notes
This Pulumi package is based on the outscale Terraform Provider.
outscale 1.1.0 published on Thursday, Apr 3, 2025 by outscale