hpegl 0.4.18 published on Friday, Apr 18, 2025 by hpe
hpegl.getMetalAvailableResources
Explore with Pulumi AI
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 dictionaryThe following arguments are supported:
- Filters
List<GetMetal Available Resources Filter> 
- Id string
- The ID of this resource.
- Filters
[]GetMetal Available Resources Filter 
- Id string
- The ID of this resource.
- filters
List<GetMetal Available Resources Filter> 
- id String
- The ID of this resource.
- filters
GetMetal Available Resources Filter[] 
- id string
- The ID of this resource.
- filters
Sequence[GetMetal Available Resources Filter] 
- id str
- The ID of this resource.
- filters List<Property Map>
- id String
- The ID of this resource.
getMetalAvailableResources Result
The following output properties are available:
- Id string
- The ID of this resource.
- Images
List<GetMetal Available Resources Image> 
- Locations
List<GetMetal Available Resources Location> 
- MachineSizes List<GetMetal Available Resources Machine Size> 
- Networks
List<GetMetal Available Resources Network> 
- SshKeys List<GetMetal Available Resources Ssh Key> 
- StoragePools List<GetMetal Available Resources Storage Pool> 
- VolumeCollections List<GetMetal Available Resources Volume Collection> 
- VolumeFlavors List<GetMetal Available Resources Volume Flavor> 
- Volumes
List<GetMetal Available Resources Volume> 
- Filters
List<GetMetal Available Resources Filter> 
- Id string
- The ID of this resource.
- Images
[]GetMetal Available Resources Image 
- Locations
[]GetMetal Available Resources Location 
- MachineSizes []GetMetal Available Resources Machine Size 
- Networks
[]GetMetal Available Resources Network 
- SshKeys []GetMetal Available Resources Ssh Key 
- StoragePools []GetMetal Available Resources Storage Pool 
- VolumeCollections []GetMetal Available Resources Volume Collection 
- VolumeFlavors []GetMetal Available Resources Volume Flavor 
- Volumes
[]GetMetal Available Resources Volume 
- Filters
[]GetMetal Available Resources Filter 
- id String
- The ID of this resource.
- images
List<GetMetal Available Resources Image> 
- locations
List<GetMetal Available Resources Location> 
- machineSizes List<GetMetal Available Resources Machine Size> 
- networks
List<GetMetal Available Resources Network> 
- sshKeys List<GetMetal Available Resources Ssh Key> 
- storagePools List<GetMetal Available Resources Storage Pool> 
- volumeCollections List<GetMetal Available Resources Volume Collection> 
- volumeFlavors List<GetMetal Available Resources Volume Flavor> 
- volumes
List<GetMetal Available Resources Volume> 
- filters
List<GetMetal Available Resources Filter> 
- id string
- The ID of this resource.
- images
GetMetal Available Resources Image[] 
- locations
GetMetal Available Resources Location[] 
- machineSizes GetMetal Available Resources Machine Size[] 
- networks
GetMetal Available Resources Network[] 
- sshKeys GetMetal Available Resources Ssh Key[] 
- storagePools GetMetal Available Resources Storage Pool[] 
- volumeCollections GetMetal Available Resources Volume Collection[] 
- volumeFlavors GetMetal Available Resources Volume Flavor[] 
- volumes
GetMetal Available Resources Volume[] 
- filters
GetMetal Available Resources Filter[] 
- id str
- The ID of this resource.
- images
Sequence[GetMetal Available Resources Image] 
- locations
Sequence[GetMetal Available Resources Location] 
- machine_sizes Sequence[GetMetal Available Resources Machine Size] 
- networks
Sequence[GetMetal Available Resources Network] 
- ssh_keys Sequence[GetMetal Available Resources Ssh Key] 
- storage_pools Sequence[GetMetal Available Resources Storage Pool] 
- volume_collections Sequence[GetMetal Available Resources Volume Collection] 
- volume_flavors Sequence[GetMetal Available Resources Volume Flavor] 
- volumes
Sequence[GetMetal Available Resources Volume] 
- filters
Sequence[GetMetal Available Resources Filter] 
- id String
- The ID of this resource.
- images List<Property Map>
- locations List<Property Map>
- machineSizes List<Property Map>
- networks List<Property Map>
- sshKeys List<Property Map>
- storagePools List<Property Map>
- volumeCollections List<Property Map>
- volumeFlavors List<Property Map>
- volumes List<Property Map>
- filters List<Property Map>
Supporting Types
GetMetalAvailableResourcesFilter    
GetMetalAvailableResourcesImage    
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 str
- data_center str
- id str
- location str
- region str
- 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 str
- id str
- location str
- location_id str
- name str
- quantity float
- description String
- id String
- location String
- locationId String
- name String
- quantity Number
GetMetalAvailableResourcesNetwork    
- Description string
- HostUse string
- Id string
- IpPool stringId 
- IpPools List<GetMetal Available Resources Network Ip Pool> 
- Location string
- LocationId string
- Name string
- Purpose string
- Vlan double
- Vni double
- Description string
- HostUse string
- Id string
- IpPool stringId 
- IpPools []GetMetal Available Resources Network Ip Pool 
- Location string
- LocationId string
- Name string
- Purpose string
- Vlan float64
- Vni float64
- description String
- hostUse String
- id String
- ipPool StringId 
- ipPools List<GetMetal Available Resources Network Ip Pool> 
- location String
- locationId String
- name String
- purpose String
- vlan Double
- vni Double
- description string
- hostUse string
- id string
- ipPool stringId 
- ipPools GetMetal Available Resources Network Ip Pool[] 
- location string
- locationId string
- name string
- purpose string
- vlan number
- vni number
- description str
- host_use str
- id str
- ip_pool_ strid 
- ip_pools Sequence[GetMetal Available Resources Network Ip Pool] 
- location str
- location_id str
- name str
- purpose str
- vlan float
- vni float
- description String
- hostUse String
- id String
- ipPool StringId 
- 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<GetMetal Available Resources Network Ip Pool Source> 
- BaseIp string
- DefaultRoute string
- Description string
- Dns []string
- IpVer string
- Name string
- Netmask string
- NoProxy string
- Ntps []string
- Proxy string
- Sources
[]GetMetal Available Resources Network Ip Pool Source 
- baseIp String
- defaultRoute String
- description String
- dns List<String>
- ipVer String
- name String
- netmask String
- noProxy String
- ntps List<String>
- proxy String
- sources
List<GetMetal Available Resources Network Ip Pool Source> 
- baseIp string
- defaultRoute string
- description string
- dns string[]
- ipVer string
- name string
- netmask string
- noProxy string
- ntps string[]
- proxy string
- sources
GetMetal Available Resources Network Ip Pool Source[] 
- base_ip str
- default_route str
- description str
- dns Sequence[str]
- ip_ver str
- name str
- netmask str
- no_proxy str
- ntps Sequence[str]
- proxy str
- sources
Sequence[GetMetal Available Resources Network Ip Pool Source] 
- 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       
GetMetalAvailableResourcesSshKey     
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
- bool
- Size double
- SizeIn doubleUse 
- State string
- Status string
- StoragePool string
- StoragePool stringId 
- Unmanaged bool
- VolumeCollection string
- VolumeCollection stringId 
- 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
- bool
- Size float64
- SizeIn float64Use 
- State string
- Status string
- StoragePool string
- StoragePool stringId 
- Unmanaged bool
- VolumeCollection string
- VolumeCollection stringId 
- 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
- Boolean
- size Double
- sizeIn DoubleUse 
- state String
- status String
- storagePool String
- storagePool StringId 
- unmanaged Boolean
- volumeCollection String
- volumeCollection StringId 
- 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
- boolean
- size number
- sizeIn numberUse 
- state string
- status string
- storagePool string
- storagePool stringId 
- unmanaged boolean
- volumeCollection string
- volumeCollection stringId 
- wwn string
- active_site str
- created_site str
- description str
- export_count float
- flavor str
- flavor_id str
- id str
- labels Mapping[str, str]
- location str
- location_id str
- name str
- replication_enabled bool
- bool
- size float
- size_in_ floatuse 
- state str
- status str
- storage_pool str
- storage_pool_ strid 
- unmanaged bool
- volume_collection str
- volume_collection_ strid 
- wwn str
- 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
- Boolean
- size Number
- sizeIn NumberUse 
- state String
- status String
- storagePool String
- storagePool StringId 
- unmanaged Boolean
- volumeCollection String
- volumeCollection StringId 
- wwn String
GetMetalAvailableResourcesVolumeCollection     
- Description string
- Id string
- Location string
- LocationId string
- Name string
- StoragePool List<string>Ids 
- Description string
- Id string
- Location string
- LocationId string
- Name string
- StoragePool []stringIds 
- description String
- id String
- location String
- locationId String
- name String
- storagePool List<String>Ids 
- description string
- id string
- location string
- locationId string
- name string
- storagePool string[]Ids 
- description str
- id str
- location str
- location_id str
- name str
- storage_pool_ Sequence[str]ids 
- description String
- id String
- location String
- locationId String
- name String
- storagePool List<String>Ids 
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 hpeglTerraform Provider.