1. Packages
  2. Vultr
  3. API Docs
  4. getOs
Vultr v2.23.1 published on Tuesday, Dec 10, 2024 by dirien

vultr.getOs

Explore with Pulumi AI

Vultr v2.23.1 published on Tuesday, Dec 10, 2024 by dirien

Get information about operating systems that can be launched when creating a Vultr VPS.

Example Usage

Get the information for an operating system by name:

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

const centos = vultr.getOs({
    filters: [{
        name: "name",
        values: ["CentOS 7 x64"],
    }],
});
Copy
import pulumi
import pulumi_vultr as vultr

centos = vultr.get_os(filters=[{
    "name": "name",
    "values": ["CentOS 7 x64"],
}])
Copy
package main

import (
	"github.com/dirien/pulumi-vultr/sdk/v2/go/vultr"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := vultr.GetOs(ctx, &vultr.GetOsArgs{
			Filters: []vultr.GetOsFilter{
				{
					Name: "name",
					Values: []string{
						"CentOS 7 x64",
					},
				},
			},
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Vultr = Pulumi.Vultr;

return await Deployment.RunAsync(() => 
{
    var centos = Vultr.GetOs.Invoke(new()
    {
        Filters = new[]
        {
            new Vultr.Inputs.GetOsFilterInputArgs
            {
                Name = "name",
                Values = new[]
                {
                    "CentOS 7 x64",
                },
            },
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.vultr.VultrFunctions;
import com.pulumi.vultr.inputs.GetOsArgs;
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 centos = VultrFunctions.getOs(GetOsArgs.builder()
            .filters(GetOsFilterArgs.builder()
                .name("name")
                .values("CentOS 7 x64")
                .build())
            .build());

    }
}
Copy
variables:
  centos:
    fn::invoke:
      Function: vultr:getOs
      Arguments:
        filters:
          - name: name
            values:
              - CentOS 7 x64
Copy

Using getOs

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 getOs(args: GetOsArgs, opts?: InvokeOptions): Promise<GetOsResult>
function getOsOutput(args: GetOsOutputArgs, opts?: InvokeOptions): Output<GetOsResult>
Copy
def get_os(filters: Optional[Sequence[GetOsFilter]] = None,
           opts: Optional[InvokeOptions] = None) -> GetOsResult
def get_os_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetOsFilterArgs]]]] = None,
           opts: Optional[InvokeOptions] = None) -> Output[GetOsResult]
Copy
func GetOs(ctx *Context, args *GetOsArgs, opts ...InvokeOption) (*GetOsResult, error)
func GetOsOutput(ctx *Context, args *GetOsOutputArgs, opts ...InvokeOption) GetOsResultOutput
Copy

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

public static class GetOs 
{
    public static Task<GetOsResult> InvokeAsync(GetOsArgs args, InvokeOptions? opts = null)
    public static Output<GetOsResult> Invoke(GetOsInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetOsResult> getOs(GetOsArgs args, InvokeOptions options)
public static Output<GetOsResult> getOs(GetOsArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: vultr:index/getOs:getOs
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Filters Changes to this property will trigger replacement. List<ediri.Vultr.Inputs.GetOsFilter>
Query parameters for finding operating systems.
Filters Changes to this property will trigger replacement. []GetOsFilter
Query parameters for finding operating systems.
filters Changes to this property will trigger replacement. List<GetOsFilter>
Query parameters for finding operating systems.
filters Changes to this property will trigger replacement. GetOsFilter[]
Query parameters for finding operating systems.
filters Changes to this property will trigger replacement. Sequence[GetOsFilter]
Query parameters for finding operating systems.
filters Changes to this property will trigger replacement. List<Property Map>
Query parameters for finding operating systems.

getOs Result

The following output properties are available:

Arch string
The architecture of the operating system.
Family string
The family of the operating system.
Id string
The provider-assigned unique ID for this managed resource.
Name string
The name of the operating system.
Filters List<ediri.Vultr.Outputs.GetOsFilter>
Arch string
The architecture of the operating system.
Family string
The family of the operating system.
Id string
The provider-assigned unique ID for this managed resource.
Name string
The name of the operating system.
Filters []GetOsFilter
arch String
The architecture of the operating system.
family String
The family of the operating system.
id String
The provider-assigned unique ID for this managed resource.
name String
The name of the operating system.
filters List<GetOsFilter>
arch string
The architecture of the operating system.
family string
The family of the operating system.
id string
The provider-assigned unique ID for this managed resource.
name string
The name of the operating system.
filters GetOsFilter[]
arch str
The architecture of the operating system.
family str
The family of the operating system.
id str
The provider-assigned unique ID for this managed resource.
name str
The name of the operating system.
filters Sequence[GetOsFilter]
arch String
The architecture of the operating system.
family String
The family of the operating system.
id String
The provider-assigned unique ID for this managed resource.
name String
The name of the operating system.
filters List<Property Map>

Supporting Types

GetOsFilter

Name This property is required. string
Attribute name to filter with.
Values This property is required. List<string>
One or more values filter with.
Name This property is required. string
Attribute name to filter with.
Values This property is required. []string
One or more values filter with.
name This property is required. String
Attribute name to filter with.
values This property is required. List<String>
One or more values filter with.
name This property is required. string
Attribute name to filter with.
values This property is required. string[]
One or more values filter with.
name This property is required. str
Attribute name to filter with.
values This property is required. Sequence[str]
One or more values filter with.
name This property is required. String
Attribute name to filter with.
values This property is required. List<String>
One or more values filter with.

Package Details

Repository
vultr dirien/pulumi-vultr
License
Apache-2.0
Notes
This Pulumi package is based on the vultr Terraform Provider.
Vultr v2.23.1 published on Tuesday, Dec 10, 2024 by dirien