1. Packages
  2. OpenStack
  3. API Docs
  4. compute
  5. getFlavor
OpenStack v3.15.2 published on Friday, Mar 29, 2024 by Pulumi

openstack.compute.getFlavor

Explore with Pulumi AI

openstack logo
OpenStack v3.15.2 published on Friday, Mar 29, 2024 by Pulumi

    Use this data source to get the ID of an available OpenStack flavor.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as openstack from "@pulumi/openstack";
    
    const small = openstack.compute.getFlavor({
        ram: 512,
        vcpus: 1,
    });
    
    import pulumi
    import pulumi_openstack as openstack
    
    small = openstack.compute.get_flavor(ram=512,
        vcpus=1)
    
    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.LookupFlavor(ctx, &compute.LookupFlavorArgs{
    			Ram:   pulumi.IntRef(512),
    			Vcpus: pulumi.IntRef(1),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using OpenStack = Pulumi.OpenStack;
    
    return await Deployment.RunAsync(() => 
    {
        var small = OpenStack.Compute.GetFlavor.Invoke(new()
        {
            Ram = 512,
            Vcpus = 1,
        });
    
    });
    
    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.GetFlavorArgs;
    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 small = ComputeFunctions.getFlavor(GetFlavorArgs.builder()
                .ram(512)
                .vcpus(1)
                .build());
    
        }
    }
    
    variables:
      small:
        fn::invoke:
          Function: openstack:compute:getFlavor
          Arguments:
            ram: 512
            vcpus: 1
    

    Using getFlavor

    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 getFlavor(args: GetFlavorArgs, opts?: InvokeOptions): Promise<GetFlavorResult>
    function getFlavorOutput(args: GetFlavorOutputArgs, opts?: InvokeOptions): Output<GetFlavorResult>
    def get_flavor(description: Optional[str] = None,
                   disk: Optional[int] = None,
                   flavor_id: Optional[str] = None,
                   is_public: Optional[bool] = None,
                   min_disk: Optional[int] = None,
                   min_ram: Optional[int] = None,
                   name: Optional[str] = None,
                   ram: Optional[int] = None,
                   region: Optional[str] = None,
                   rx_tx_factor: Optional[float] = None,
                   swap: Optional[int] = None,
                   vcpus: Optional[int] = None,
                   opts: Optional[InvokeOptions] = None) -> GetFlavorResult
    def get_flavor_output(description: Optional[pulumi.Input[str]] = None,
                   disk: Optional[pulumi.Input[int]] = None,
                   flavor_id: Optional[pulumi.Input[str]] = None,
                   is_public: Optional[pulumi.Input[bool]] = None,
                   min_disk: Optional[pulumi.Input[int]] = None,
                   min_ram: Optional[pulumi.Input[int]] = None,
                   name: Optional[pulumi.Input[str]] = None,
                   ram: Optional[pulumi.Input[int]] = None,
                   region: Optional[pulumi.Input[str]] = None,
                   rx_tx_factor: Optional[pulumi.Input[float]] = None,
                   swap: Optional[pulumi.Input[int]] = None,
                   vcpus: Optional[pulumi.Input[int]] = None,
                   opts: Optional[InvokeOptions] = None) -> Output[GetFlavorResult]
    func LookupFlavor(ctx *Context, args *LookupFlavorArgs, opts ...InvokeOption) (*LookupFlavorResult, error)
    func LookupFlavorOutput(ctx *Context, args *LookupFlavorOutputArgs, opts ...InvokeOption) LookupFlavorResultOutput

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

    public static class GetFlavor 
    {
        public static Task<GetFlavorResult> InvokeAsync(GetFlavorArgs args, InvokeOptions? opts = null)
        public static Output<GetFlavorResult> Invoke(GetFlavorInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetFlavorResult> getFlavor(GetFlavorArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: openstack:compute/getFlavor:getFlavor
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Description string
    The description of the flavor.
    Disk int
    The exact amount of disk (in gigabytes).
    FlavorId string
    The ID of the flavor. Conflicts with the name, min_ram and min_disk
    IsPublic bool
    The flavor visibility.
    MinDisk int
    The minimum amount of disk (in gigabytes). Conflicts with the flavor_id.
    MinRam int
    The minimum amount of RAM (in megabytes). Conflicts with the flavor_id.
    Name string
    The name of the flavor. Conflicts with the flavor_id.
    Ram int
    The exact amount of RAM (in megabytes).
    Region string
    The region in which to obtain the V2 Compute client. If omitted, the region argument of the provider is used.
    RxTxFactor double
    The rx_tx_factor of the flavor.
    Swap int
    The amount of swap (in gigabytes).
    Vcpus int
    The amount of VCPUs.
    Description string
    The description of the flavor.
    Disk int
    The exact amount of disk (in gigabytes).
    FlavorId string
    The ID of the flavor. Conflicts with the name, min_ram and min_disk
    IsPublic bool
    The flavor visibility.
    MinDisk int
    The minimum amount of disk (in gigabytes). Conflicts with the flavor_id.
    MinRam int
    The minimum amount of RAM (in megabytes). Conflicts with the flavor_id.
    Name string
    The name of the flavor. Conflicts with the flavor_id.
    Ram int
    The exact amount of RAM (in megabytes).
    Region string
    The region in which to obtain the V2 Compute client. If omitted, the region argument of the provider is used.
    RxTxFactor float64
    The rx_tx_factor of the flavor.
    Swap int
    The amount of swap (in gigabytes).
    Vcpus int
    The amount of VCPUs.
    description String
    The description of the flavor.
    disk Integer
    The exact amount of disk (in gigabytes).
    flavorId String
    The ID of the flavor. Conflicts with the name, min_ram and min_disk
    isPublic Boolean
    The flavor visibility.
    minDisk Integer
    The minimum amount of disk (in gigabytes). Conflicts with the flavor_id.
    minRam Integer
    The minimum amount of RAM (in megabytes). Conflicts with the flavor_id.
    name String
    The name of the flavor. Conflicts with the flavor_id.
    ram Integer
    The exact amount of RAM (in megabytes).
    region String
    The region in which to obtain the V2 Compute client. If omitted, the region argument of the provider is used.
    rxTxFactor Double
    The rx_tx_factor of the flavor.
    swap Integer
    The amount of swap (in gigabytes).
    vcpus Integer
    The amount of VCPUs.
    description string
    The description of the flavor.
    disk number
    The exact amount of disk (in gigabytes).
    flavorId string
    The ID of the flavor. Conflicts with the name, min_ram and min_disk
    isPublic boolean
    The flavor visibility.
    minDisk number
    The minimum amount of disk (in gigabytes). Conflicts with the flavor_id.
    minRam number
    The minimum amount of RAM (in megabytes). Conflicts with the flavor_id.
    name string
    The name of the flavor. Conflicts with the flavor_id.
    ram number
    The exact amount of RAM (in megabytes).
    region string
    The region in which to obtain the V2 Compute client. If omitted, the region argument of the provider is used.
    rxTxFactor number
    The rx_tx_factor of the flavor.
    swap number
    The amount of swap (in gigabytes).
    vcpus number
    The amount of VCPUs.
    description str
    The description of the flavor.
    disk int
    The exact amount of disk (in gigabytes).
    flavor_id str
    The ID of the flavor. Conflicts with the name, min_ram and min_disk
    is_public bool
    The flavor visibility.
    min_disk int
    The minimum amount of disk (in gigabytes). Conflicts with the flavor_id.
    min_ram int
    The minimum amount of RAM (in megabytes). Conflicts with the flavor_id.
    name str
    The name of the flavor. Conflicts with the flavor_id.
    ram int
    The exact amount of RAM (in megabytes).
    region str
    The region in which to obtain the V2 Compute client. If omitted, the region argument of the provider is used.
    rx_tx_factor float
    The rx_tx_factor of the flavor.
    swap int
    The amount of swap (in gigabytes).
    vcpus int
    The amount of VCPUs.
    description String
    The description of the flavor.
    disk Number
    The exact amount of disk (in gigabytes).
    flavorId String
    The ID of the flavor. Conflicts with the name, min_ram and min_disk
    isPublic Boolean
    The flavor visibility.
    minDisk Number
    The minimum amount of disk (in gigabytes). Conflicts with the flavor_id.
    minRam Number
    The minimum amount of RAM (in megabytes). Conflicts with the flavor_id.
    name String
    The name of the flavor. Conflicts with the flavor_id.
    ram Number
    The exact amount of RAM (in megabytes).
    region String
    The region in which to obtain the V2 Compute client. If omitted, the region argument of the provider is used.
    rxTxFactor Number
    The rx_tx_factor of the flavor.
    swap Number
    The amount of swap (in gigabytes).
    vcpus Number
    The amount of VCPUs.

    getFlavor Result

    The following output properties are available:

    ExtraSpecs Dictionary<string, object>
    Key/Value pairs of metadata for the flavor.
    Id string
    The provider-assigned unique ID for this managed resource.
    Region string
    Description string
    Disk int
    FlavorId string
    IsPublic bool
    MinDisk int
    MinRam int
    Name string
    Ram int
    RxTxFactor double
    Swap int
    Vcpus int
    ExtraSpecs map[string]interface{}
    Key/Value pairs of metadata for the flavor.
    Id string
    The provider-assigned unique ID for this managed resource.
    Region string
    Description string
    Disk int
    FlavorId string
    IsPublic bool
    MinDisk int
    MinRam int
    Name string
    Ram int
    RxTxFactor float64
    Swap int
    Vcpus int
    extraSpecs Map<String,Object>
    Key/Value pairs of metadata for the flavor.
    id String
    The provider-assigned unique ID for this managed resource.
    region String
    description String
    disk Integer
    flavorId String
    isPublic Boolean
    minDisk Integer
    minRam Integer
    name String
    ram Integer
    rxTxFactor Double
    swap Integer
    vcpus Integer
    extraSpecs {[key: string]: any}
    Key/Value pairs of metadata for the flavor.
    id string
    The provider-assigned unique ID for this managed resource.
    region string
    description string
    disk number
    flavorId string
    isPublic boolean
    minDisk number
    minRam number
    name string
    ram number
    rxTxFactor number
    swap number
    vcpus number
    extra_specs Mapping[str, Any]
    Key/Value pairs of metadata for the flavor.
    id str
    The provider-assigned unique ID for this managed resource.
    region str
    description str
    disk int
    flavor_id str
    is_public bool
    min_disk int
    min_ram int
    name str
    ram int
    rx_tx_factor float
    swap int
    vcpus int
    extraSpecs Map<Any>
    Key/Value pairs of metadata for the flavor.
    id String
    The provider-assigned unique ID for this managed resource.
    region String
    description String
    disk Number
    flavorId String
    isPublic Boolean
    minDisk Number
    minRam Number
    name String
    ram Number
    rxTxFactor Number
    swap Number
    vcpus Number

    Package Details

    Repository
    OpenStack pulumi/pulumi-openstack
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the openstack Terraform Provider.
    openstack logo
    OpenStack v3.15.2 published on Friday, Mar 29, 2024 by Pulumi