1. Packages
  2. Hpegl Provider
  3. API Docs
  4. getMetalAvailableResources
hpegl 0.4.18 published on Friday, Apr 18, 2025 by hpe

hpegl.getMetalAvailableResources

Explore with Pulumi AI

hpegl logo
hpegl 0.4.18 published on Friday, Apr 18, 2025 by hpe

    Provides a list of available resources in a project for creating Hosts and Volumes.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as hpegl from "@pulumi/hpegl";
    
    export = async () => {
        const physical = await hpegl.getMetalAvailableResources({});
        return {
            locations: physical.locations,
            images: physical.images,
            "ssh-keys": physical.sshKeys,
            networks: .filter(net => net.location == _var.location).map(net => (net)),
            volumes: .filter(vol => vol.location == _var.location).map(vol => (vol)),
            "volume-flavors": physical.volumeFlavors,
            "machine-sizes": physical.machineSizes,
            "storage-pools": physical.storagePools,
            "volume-collections": physical.volumeCollections,
        };
    }
    
    import pulumi
    import pulumi_hpegl as hpegl
    
    physical = hpegl.get_metal_available_resources()
    pulumi.export("locations", physical.locations)
    pulumi.export("images", physical.images)
    pulumi.export("ssh-keys", physical.ssh_keys)
    pulumi.export("networks", [net for net in physical.networks if net.location == var["location"]])
    pulumi.export("volumes", [vol for vol in physical.volumes if vol.location == var["location"]])
    pulumi.export("volume-flavors", physical.volume_flavors)
    pulumi.export("machine-sizes", physical.machine_sizes)
    pulumi.export("storage-pools", physical.storage_pools)
    pulumi.export("volume-collections", physical.volume_collections)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/hpegl/hpegl"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		physical, err := hpegl.GetMetalAvailableResources(ctx, &hpegl.GetMetalAvailableResourcesArgs{}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("locations", physical.Locations)
    		ctx.Export("images", physical.Images)
    		ctx.Export("ssh-keys", physical.SshKeys)
    		ctx.Export("networks", []hpegl.GetMetalAvailableResourcesNetwork("TODO: For expression"))
    		ctx.Export("volumes", []hpegl.GetMetalAvailableResourcesVolume("TODO: For expression"))
    		ctx.Export("volume-flavors", physical.VolumeFlavors)
    		ctx.Export("machine-sizes", physical.MachineSizes)
    		ctx.Export("storage-pools", physical.StoragePools)
    		ctx.Export("volume-collections", physical.VolumeCollections)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Hpegl = Pulumi.Hpegl;
    
    return await Deployment.RunAsync(() => 
    {
        var physical = Hpegl.GetMetalAvailableResources.Invoke();
    
        return new Dictionary<string, object?>
        {
            ["locations"] = physical.Apply(getMetalAvailableResourcesResult => getMetalAvailableResourcesResult.Locations),
            ["images"] = physical.Apply(getMetalAvailableResourcesResult => getMetalAvailableResourcesResult.Images),
            ["ssh-keys"] = physical.Apply(getMetalAvailableResourcesResult => getMetalAvailableResourcesResult.SshKeys),
            ["networks"] = .Where(net => net.Location == @var.Location).Select(net => 
            {
                return net;
            }).ToList(),
            ["volumes"] = .Where(vol => vol.Location == @var.Location).Select(vol => 
            {
                return vol;
            }).ToList(),
            ["volume-flavors"] = physical.Apply(getMetalAvailableResourcesResult => getMetalAvailableResourcesResult.VolumeFlavors),
            ["machine-sizes"] = physical.Apply(getMetalAvailableResourcesResult => getMetalAvailableResourcesResult.MachineSizes),
            ["storage-pools"] = physical.Apply(getMetalAvailableResourcesResult => getMetalAvailableResourcesResult.StoragePools),
            ["volume-collections"] = physical.Apply(getMetalAvailableResourcesResult => getMetalAvailableResourcesResult.VolumeCollections),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.hpegl.HpeglFunctions;
    import com.pulumi.hpegl.inputs.GetMetalAvailableResourcesArgs;
    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 physical = HpeglFunctions.getMetalAvailableResources();
    
            ctx.export("locations", physical.applyValue(getMetalAvailableResourcesResult -> getMetalAvailableResourcesResult.locations()));
            ctx.export("images", physical.applyValue(getMetalAvailableResourcesResult -> getMetalAvailableResourcesResult.images()));
            ctx.export("ssh-keys", physical.applyValue(getMetalAvailableResourcesResult -> getMetalAvailableResourcesResult.sshKeys()));
            ctx.export("networks", "TODO: ForExpression");
            ctx.export("volumes", "TODO: ForExpression");
            ctx.export("volume-flavors", physical.applyValue(getMetalAvailableResourcesResult -> getMetalAvailableResourcesResult.volumeFlavors()));
            ctx.export("machine-sizes", physical.applyValue(getMetalAvailableResourcesResult -> getMetalAvailableResourcesResult.machineSizes()));
            ctx.export("storage-pools", physical.applyValue(getMetalAvailableResourcesResult -> getMetalAvailableResourcesResult.storagePools()));
            ctx.export("volume-collections", physical.applyValue(getMetalAvailableResourcesResult -> getMetalAvailableResourcesResult.volumeCollections()));
        }
    }
    
    Coming soon!
    

    Using getMetalAvailableResources

    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 getMetalAvailableResources(args: GetMetalAvailableResourcesArgs, opts?: InvokeOptions): Promise<GetMetalAvailableResourcesResult>
    function getMetalAvailableResourcesOutput(args: GetMetalAvailableResourcesOutputArgs, opts?: InvokeOptions): Output<GetMetalAvailableResourcesResult>
    def get_metal_available_resources(filters: Optional[Sequence[GetMetalAvailableResourcesFilter]] = None,
                                      id: Optional[str] = None,
                                      opts: Optional[InvokeOptions] = None) -> GetMetalAvailableResourcesResult
    def get_metal_available_resources_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetMetalAvailableResourcesFilterArgs]]]] = None,
                                      id: Optional[pulumi.Input[str]] = None,
                                      opts: Optional[InvokeOptions] = None) -> Output[GetMetalAvailableResourcesResult]
    func GetMetalAvailableResources(ctx *Context, args *GetMetalAvailableResourcesArgs, opts ...InvokeOption) (*GetMetalAvailableResourcesResult, error)
    func GetMetalAvailableResourcesOutput(ctx *Context, args *GetMetalAvailableResourcesOutputArgs, opts ...InvokeOption) GetMetalAvailableResourcesResultOutput

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

    public static class GetMetalAvailableResources 
    {
        public static Task<GetMetalAvailableResourcesResult> InvokeAsync(GetMetalAvailableResourcesArgs args, InvokeOptions? opts = null)
        public static Output<GetMetalAvailableResourcesResult> Invoke(GetMetalAvailableResourcesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetMetalAvailableResourcesResult> getMetalAvailableResources(GetMetalAvailableResourcesArgs args, InvokeOptions options)
    public static Output<GetMetalAvailableResourcesResult> getMetalAvailableResources(GetMetalAvailableResourcesArgs args, InvokeOptions options)
    
    fn::invoke:
      function: hpegl:index/getMetalAvailableResources:getMetalAvailableResources
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Filters List<GetMetalAvailableResourcesFilter>
    Id string
    The ID of this resource.
    Filters []GetMetalAvailableResourcesFilter
    Id string
    The ID of this resource.
    filters List<GetMetalAvailableResourcesFilter>
    id String
    The ID of this resource.
    filters GetMetalAvailableResourcesFilter[]
    id string
    The ID of this resource.
    filters List<Property Map>
    id String
    The ID of this resource.

    getMetalAvailableResources Result

    The following output properties are available:

    Supporting Types

    GetMetalAvailableResourcesFilter

    Name string
    Values List<string>
    Name string
    Values []string
    name String
    values List<String>
    name string
    values string[]
    name str
    values Sequence[str]
    name String
    values List<String>

    GetMetalAvailableResourcesImage

    Category string
    Flavor string
    Id string
    Version string
    Category string
    Flavor string
    Id string
    Version string
    category String
    flavor String
    id String
    version String
    category string
    flavor string
    id string
    version string
    category str
    flavor str
    id str
    version str
    category String
    flavor String
    id String
    version String

    GetMetalAvailableResourcesLocation

    Country string
    DataCenter string
    Id string
    Location string
    Region string
    Country string
    DataCenter string
    Id string
    Location string
    Region string
    country String
    dataCenter String
    id String
    location String
    region String
    country string
    dataCenter string
    id string
    location string
    region string
    country String
    dataCenter String
    id String
    location String
    region String

    GetMetalAvailableResourcesMachineSize

    Description string
    Id string
    Location string
    LocationId string
    Name string
    Quantity double
    Description string
    Id string
    Location string
    LocationId string
    Name string
    Quantity float64
    description String
    id String
    location String
    locationId String
    name String
    quantity Double
    description string
    id string
    location string
    locationId string
    name string
    quantity number
    description String
    id String
    location String
    locationId String
    name String
    quantity Number

    GetMetalAvailableResourcesNetwork

    description String
    hostUse String
    id String
    ipPoolId String
    ipPools List<Property Map>
    location String
    locationId String
    name String
    purpose String
    vlan Number
    vni Number

    GetMetalAvailableResourcesNetworkIpPool

    BaseIp string
    DefaultRoute string
    Description string
    Dns List<string>
    IpVer string
    Name string
    Netmask string
    NoProxy string
    Ntps List<string>
    Proxy string
    Sources List<GetMetalAvailableResourcesNetworkIpPoolSource>
    baseIp String
    defaultRoute String
    description String
    dns List<String>
    ipVer String
    name String
    netmask String
    noProxy String
    ntps List<String>
    proxy String
    sources List<GetMetalAvailableResourcesNetworkIpPoolSource>
    baseIp String
    defaultRoute String
    description String
    dns List<String>
    ipVer String
    name String
    netmask String
    noProxy String
    ntps List<String>
    proxy String
    sources List<Property Map>

    GetMetalAvailableResourcesNetworkIpPoolSource

    BaseIp string
    Count double
    BaseIp string
    Count float64
    baseIp String
    count Double
    baseIp string
    count number
    base_ip str
    count float
    baseIp String
    count Number

    GetMetalAvailableResourcesSshKey

    Id string
    Name string
    Id string
    Name string
    id String
    name String
    id string
    name string
    id str
    name str
    id String
    name String

    GetMetalAvailableResourcesStoragePool

    Capacity double
    Id string
    Location string
    LocationId string
    Name string
    Capacity float64
    Id string
    Location string
    LocationId string
    Name string
    capacity Double
    id String
    location String
    locationId String
    name String
    capacity number
    id string
    location string
    locationId string
    name string
    capacity float
    id str
    location str
    location_id str
    name str
    capacity Number
    id String
    location String
    locationId String
    name String

    GetMetalAvailableResourcesVolume

    ActiveSite string
    CreatedSite string
    Description string
    ExportCount double
    Flavor string
    FlavorId string
    Id string
    Labels Dictionary<string, string>
    Location string
    LocationId string
    Name string
    ReplicationEnabled bool
    Shareable bool
    Size double
    SizeInUse double
    State string
    Status string
    StoragePool string
    StoragePoolId string
    Unmanaged bool
    VolumeCollection string
    VolumeCollectionId string
    Wwn string
    ActiveSite string
    CreatedSite string
    Description string
    ExportCount float64
    Flavor string
    FlavorId string
    Id string
    Labels map[string]string
    Location string
    LocationId string
    Name string
    ReplicationEnabled bool
    Shareable bool
    Size float64
    SizeInUse float64
    State string
    Status string
    StoragePool string
    StoragePoolId string
    Unmanaged bool
    VolumeCollection string
    VolumeCollectionId string
    Wwn string
    activeSite String
    createdSite String
    description String
    exportCount Double
    flavor String
    flavorId String
    id String
    labels Map<String,String>
    location String
    locationId String
    name String
    replicationEnabled Boolean
    shareable Boolean
    size Double
    sizeInUse Double
    state String
    status String
    storagePool String
    storagePoolId String
    unmanaged Boolean
    volumeCollection String
    volumeCollectionId String
    wwn String
    activeSite string
    createdSite string
    description string
    exportCount number
    flavor string
    flavorId string
    id string
    labels {[key: string]: string}
    location string
    locationId string
    name string
    replicationEnabled boolean
    shareable boolean
    size number
    sizeInUse number
    state string
    status string
    storagePool string
    storagePoolId string
    unmanaged boolean
    volumeCollection string
    volumeCollectionId string
    wwn string
    activeSite String
    createdSite String
    description String
    exportCount Number
    flavor String
    flavorId String
    id String
    labels Map<String>
    location String
    locationId String
    name String
    replicationEnabled Boolean
    shareable Boolean
    size Number
    sizeInUse Number
    state String
    status String
    storagePool String
    storagePoolId String
    unmanaged Boolean
    volumeCollection String
    volumeCollectionId String
    wwn String

    GetMetalAvailableResourcesVolumeCollection

    Description string
    Id string
    Location string
    LocationId string
    Name string
    StoragePoolIds List<string>
    Description string
    Id string
    Location string
    LocationId string
    Name string
    StoragePoolIds []string
    description String
    id String
    location String
    locationId String
    name String
    storagePoolIds List<String>
    description string
    id string
    location string
    locationId string
    name string
    storagePoolIds string[]
    description String
    id String
    location String
    locationId String
    name String
    storagePoolIds List<String>

    GetMetalAvailableResourcesVolumeFlavor

    Description string
    Id string
    Name string
    Description string
    Id string
    Name string
    description String
    id String
    name String
    description string
    id string
    name string
    description str
    id str
    name str
    description String
    id String
    name String

    Package Details

    Repository
    hpegl hpe/terraform-provider-hpegl
    License
    Notes
    This Pulumi package is based on the hpegl Terraform Provider.
    hpegl logo
    hpegl 0.4.18 published on Friday, Apr 18, 2025 by hpe