1. Packages
  2. Packet
  3. API Docs
  4. getOperatingSystem
Packet v3.2.2 published on Thursday, Nov 12, 2020 by Pulumi

packet.getOperatingSystem

Explore with Pulumi AI

packet logo
Packet v3.2.2 published on Thursday, Nov 12, 2020 by Pulumi

    Use this data source to get Packet Operating System image.

    Example Usage

    using Pulumi;
    using Packet = Pulumi.Packet;
    
    class MyStack : Stack
    {
        public MyStack()
        {
            var example = Output.Create(Packet.GetOperatingSystem.InvokeAsync(new Packet.GetOperatingSystemArgs
            {
                Name = "Container Linux",
                Distro = "coreos",
                Version = "alpha",
                ProvisionableOn = "c1.small.x86",
            }));
            var server = new Packet.Device("server", new Packet.DeviceArgs
            {
                Hostname = "tf.coreos2",
                Plan = "c1.small.x86",
                Facilities = 
                {
                    "ewr1",
                },
                OperatingSystem = example.Apply(example => example.Id),
                BillingCycle = "hourly",
                ProjectId = local.Project_id,
            });
        }
    
    }
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-packet/sdk/v3/go/packet"
    	"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		opt0 := "Container Linux"
    		opt1 := "coreos"
    		opt2 := "alpha"
    		opt3 := "c1.small.x86"
    		example, err := packet.GetOperatingSystem(ctx, &packet.GetOperatingSystemArgs{
    			Name:            &opt0,
    			Distro:          &opt1,
    			Version:         &opt2,
    			ProvisionableOn: &opt3,
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = packet.NewDevice(ctx, "server", &packet.DeviceArgs{
    			Hostname: pulumi.String("tf.coreos2"),
    			Plan:     pulumi.String("c1.small.x86"),
    			Facilities: pulumi.StringArray{
    				pulumi.String("ewr1"),
    			},
    			OperatingSystem: pulumi.String(example.Id),
    			BillingCycle:    pulumi.String("hourly"),
    			ProjectId:       pulumi.Any(local.Project_id),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    

    Coming soon!

    import pulumi
    import pulumi_packet as packet
    
    example = packet.get_operating_system(name="Container Linux",
        distro="coreos",
        version="alpha",
        provisionable_on="c1.small.x86")
    server = packet.Device("server",
        hostname="tf.coreos2",
        plan="c1.small.x86",
        facilities=["ewr1"],
        operating_system=example.id,
        billing_cycle="hourly",
        project_id=local["project_id"])
    
    import * as pulumi from "@pulumi/pulumi";
    import * as packet from "@pulumi/packet";
    
    const example = packet.getOperatingSystem({
        name: "Container Linux",
        distro: "coreos",
        version: "alpha",
        provisionableOn: "c1.small.x86",
    });
    const server = new packet.Device("server", {
        hostname: "tf.coreos2",
        plan: "c1.small.x86",
        facilities: ["ewr1"],
        operatingSystem: example.then(example => example.id),
        billingCycle: "hourly",
        projectId: local.project_id,
    });
    

    Coming soon!

    Using getOperatingSystem

    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 getOperatingSystem(args: GetOperatingSystemArgs, opts?: InvokeOptions): Promise<GetOperatingSystemResult>
    function getOperatingSystemOutput(args: GetOperatingSystemOutputArgs, opts?: InvokeOptions): Output<GetOperatingSystemResult>
    def get_operating_system(distro: Optional[str] = None,
                             name: Optional[str] = None,
                             provisionable_on: Optional[str] = None,
                             version: Optional[str] = None,
                             opts: Optional[InvokeOptions] = None) -> GetOperatingSystemResult
    def get_operating_system_output(distro: Optional[pulumi.Input[str]] = None,
                             name: Optional[pulumi.Input[str]] = None,
                             provisionable_on: Optional[pulumi.Input[str]] = None,
                             version: Optional[pulumi.Input[str]] = None,
                             opts: Optional[InvokeOptions] = None) -> Output[GetOperatingSystemResult]
    func GetOperatingSystem(ctx *Context, args *GetOperatingSystemArgs, opts ...InvokeOption) (*GetOperatingSystemResult, error)
    func GetOperatingSystemOutput(ctx *Context, args *GetOperatingSystemOutputArgs, opts ...InvokeOption) GetOperatingSystemResultOutput

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

    public static class GetOperatingSystem 
    {
        public static Task<GetOperatingSystemResult> InvokeAsync(GetOperatingSystemArgs args, InvokeOptions? opts = null)
        public static Output<GetOperatingSystemResult> Invoke(GetOperatingSystemInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetOperatingSystemResult> getOperatingSystem(GetOperatingSystemArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: packet:index/getOperatingSystem:getOperatingSystem
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Distro string
    Name of the OS distribution.
    Name string
    Name or part of the name of the distribution. Case insensitive.
    ProvisionableOn string
    Plan name.
    Version string
    Version of the distribution
    Distro string
    Name of the OS distribution.
    Name string
    Name or part of the name of the distribution. Case insensitive.
    ProvisionableOn string
    Plan name.
    Version string
    Version of the distribution
    distro String
    Name of the OS distribution.
    name String
    Name or part of the name of the distribution. Case insensitive.
    provisionableOn String
    Plan name.
    version String
    Version of the distribution
    distro string
    Name of the OS distribution.
    name string
    Name or part of the name of the distribution. Case insensitive.
    provisionableOn string
    Plan name.
    version string
    Version of the distribution
    distro str
    Name of the OS distribution.
    name str
    Name or part of the name of the distribution. Case insensitive.
    provisionable_on str
    Plan name.
    version str
    Version of the distribution
    distro String
    Name of the OS distribution.
    name String
    Name or part of the name of the distribution. Case insensitive.
    provisionableOn String
    Plan name.
    version String
    Version of the distribution

    getOperatingSystem Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Slug string
    Operating system slug (same as id)
    Distro string
    Name string
    ProvisionableOn string
    Version string
    Id string
    The provider-assigned unique ID for this managed resource.
    Slug string
    Operating system slug (same as id)
    Distro string
    Name string
    ProvisionableOn string
    Version string
    id String
    The provider-assigned unique ID for this managed resource.
    slug String
    Operating system slug (same as id)
    distro String
    name String
    provisionableOn String
    version String
    id string
    The provider-assigned unique ID for this managed resource.
    slug string
    Operating system slug (same as id)
    distro string
    name string
    provisionableOn string
    version string
    id str
    The provider-assigned unique ID for this managed resource.
    slug str
    Operating system slug (same as id)
    distro str
    name str
    provisionable_on str
    version str
    id String
    The provider-assigned unique ID for this managed resource.
    slug String
    Operating system slug (same as id)
    distro String
    name String
    provisionableOn String
    version String

    Package Details

    Repository
    Packet pulumi/pulumi-packet
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the packet Terraform Provider.
    packet logo
    Packet v3.2.2 published on Thursday, Nov 12, 2020 by Pulumi