1. Packages
  2. Ibm Provider
  3. API Docs
  4. getPiHosts
ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud

ibm.getPiHosts

Explore with Pulumi AI

ibm logo
ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud

    Provides a read-only data source to retrieve information about hosts. For more information, about IBM power virtual server cloud, see getting started with IBM Power Systems Virtual Servers.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as ibm from "@pulumi/ibm";
    
    const hosts = ibm.getPiHosts({
        piCloudInstanceId: "<value of the cloud_instance_id>",
    });
    
    import pulumi
    import pulumi_ibm as ibm
    
    hosts = ibm.get_pi_hosts(pi_cloud_instance_id="<value of the cloud_instance_id>")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ibm/ibm"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ibm.GetPiHosts(ctx, &ibm.GetPiHostsArgs{
    			PiCloudInstanceId: "<value of the cloud_instance_id>",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ibm = Pulumi.Ibm;
    
    return await Deployment.RunAsync(() => 
    {
        var hosts = Ibm.GetPiHosts.Invoke(new()
        {
            PiCloudInstanceId = "<value of the cloud_instance_id>",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ibm.IbmFunctions;
    import com.pulumi.ibm.inputs.GetPiHostsArgs;
    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 hosts = IbmFunctions.getPiHosts(GetPiHostsArgs.builder()
                .piCloudInstanceId("<value of the cloud_instance_id>")
                .build());
    
        }
    }
    
    variables:
      hosts:
        fn::invoke:
          function: ibm:getPiHosts
          arguments:
            piCloudInstanceId: <value of the cloud_instance_id>
    

    Notes

    • Please find supported Regions for endpoints.
    • If a Power cloud instance is provisioned at lon04, The provider level attributes should be as follows:
      • region - lon
      • zone - lon04

    Example usage:

    import * as pulumi from "@pulumi/pulumi";
    
    import pulumi
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    
    return await Deployment.RunAsync(() => 
    {
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    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) {
        }
    }
    
    {}
    

    Using getPiHosts

    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 getPiHosts(args: GetPiHostsArgs, opts?: InvokeOptions): Promise<GetPiHostsResult>
    function getPiHostsOutput(args: GetPiHostsOutputArgs, opts?: InvokeOptions): Output<GetPiHostsResult>
    def get_pi_hosts(id: Optional[str] = None,
                     pi_cloud_instance_id: Optional[str] = None,
                     opts: Optional[InvokeOptions] = None) -> GetPiHostsResult
    def get_pi_hosts_output(id: Optional[pulumi.Input[str]] = None,
                     pi_cloud_instance_id: Optional[pulumi.Input[str]] = None,
                     opts: Optional[InvokeOptions] = None) -> Output[GetPiHostsResult]
    func GetPiHosts(ctx *Context, args *GetPiHostsArgs, opts ...InvokeOption) (*GetPiHostsResult, error)
    func GetPiHostsOutput(ctx *Context, args *GetPiHostsOutputArgs, opts ...InvokeOption) GetPiHostsResultOutput

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

    public static class GetPiHosts 
    {
        public static Task<GetPiHostsResult> InvokeAsync(GetPiHostsArgs args, InvokeOptions? opts = null)
        public static Output<GetPiHostsResult> Invoke(GetPiHostsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetPiHostsResult> getPiHosts(GetPiHostsArgs args, InvokeOptions options)
    public static Output<GetPiHostsResult> getPiHosts(GetPiHostsArgs args, InvokeOptions options)
    
    fn::invoke:
      function: ibm:index/getPiHosts:getPiHosts
      arguments:
        # arguments dictionary

    The following arguments are supported:

    PiCloudInstanceId string
    The GUID of the service instance associated with an account.
    Id string
    (String) The unique identifier of the pi_hosts.
    PiCloudInstanceId string
    The GUID of the service instance associated with an account.
    Id string
    (String) The unique identifier of the pi_hosts.
    piCloudInstanceId String
    The GUID of the service instance associated with an account.
    id String
    (String) The unique identifier of the pi_hosts.
    piCloudInstanceId string
    The GUID of the service instance associated with an account.
    id string
    (String) The unique identifier of the pi_hosts.
    pi_cloud_instance_id str
    The GUID of the service instance associated with an account.
    id str
    (String) The unique identifier of the pi_hosts.
    piCloudInstanceId String
    The GUID of the service instance associated with an account.
    id String
    (String) The unique identifier of the pi_hosts.

    getPiHosts Result

    The following output properties are available:

    Hosts List<GetPiHostsHost>
    (List) List of hosts.
    Id string
    (String) The unique identifier of the pi_hosts.
    PiCloudInstanceId string
    Hosts []GetPiHostsHost
    (List) List of hosts.
    Id string
    (String) The unique identifier of the pi_hosts.
    PiCloudInstanceId string
    hosts List<GetPiHostsHost>
    (List) List of hosts.
    id String
    (String) The unique identifier of the pi_hosts.
    piCloudInstanceId String
    hosts GetPiHostsHost[]
    (List) List of hosts.
    id string
    (String) The unique identifier of the pi_hosts.
    piCloudInstanceId string
    hosts Sequence[GetPiHostsHost]
    (List) List of hosts.
    id str
    (String) The unique identifier of the pi_hosts.
    pi_cloud_instance_id str
    hosts List<Property Map>
    (List) List of hosts.
    id String
    (String) The unique identifier of the pi_hosts.
    piCloudInstanceId String

    Supporting Types

    GetPiHostsHost

    Capacities List<GetPiHostsHostCapacity>
    (List) Capacities of the host.
    Crn string
    (String) The CRN of this resource.
    DisplayName string
    (String) Name of the host.
    HostGroup Dictionary<string, string>
    (Map) Information about the owning host group.
    HostId string
    (String) ID of the host.
    HostReference double
    (Integer) Current physical ID of the host.
    State string
    (String) State of the host up or down.
    Status string
    (String) Status of the host enabled or disabled.
    SysType string
    (String) System type.
    UserTags List<string>
    (List) List of user tags attached to the resource.
    Capacities []GetPiHostsHostCapacity
    (List) Capacities of the host.
    Crn string
    (String) The CRN of this resource.
    DisplayName string
    (String) Name of the host.
    HostGroup map[string]string
    (Map) Information about the owning host group.
    HostId string
    (String) ID of the host.
    HostReference float64
    (Integer) Current physical ID of the host.
    State string
    (String) State of the host up or down.
    Status string
    (String) Status of the host enabled or disabled.
    SysType string
    (String) System type.
    UserTags []string
    (List) List of user tags attached to the resource.
    capacities List<GetPiHostsHostCapacity>
    (List) Capacities of the host.
    crn String
    (String) The CRN of this resource.
    displayName String
    (String) Name of the host.
    hostGroup Map<String,String>
    (Map) Information about the owning host group.
    hostId String
    (String) ID of the host.
    hostReference Double
    (Integer) Current physical ID of the host.
    state String
    (String) State of the host up or down.
    status String
    (String) Status of the host enabled or disabled.
    sysType String
    (String) System type.
    userTags List<String>
    (List) List of user tags attached to the resource.
    capacities GetPiHostsHostCapacity[]
    (List) Capacities of the host.
    crn string
    (String) The CRN of this resource.
    displayName string
    (String) Name of the host.
    hostGroup {[key: string]: string}
    (Map) Information about the owning host group.
    hostId string
    (String) ID of the host.
    hostReference number
    (Integer) Current physical ID of the host.
    state string
    (String) State of the host up or down.
    status string
    (String) Status of the host enabled or disabled.
    sysType string
    (String) System type.
    userTags string[]
    (List) List of user tags attached to the resource.
    capacities Sequence[GetPiHostsHostCapacity]
    (List) Capacities of the host.
    crn str
    (String) The CRN of this resource.
    display_name str
    (String) Name of the host.
    host_group Mapping[str, str]
    (Map) Information about the owning host group.
    host_id str
    (String) ID of the host.
    host_reference float
    (Integer) Current physical ID of the host.
    state str
    (String) State of the host up or down.
    status str
    (String) Status of the host enabled or disabled.
    sys_type str
    (String) System type.
    user_tags Sequence[str]
    (List) List of user tags attached to the resource.
    capacities List<Property Map>
    (List) Capacities of the host.
    crn String
    (String) The CRN of this resource.
    displayName String
    (String) Name of the host.
    hostGroup Map<String>
    (Map) Information about the owning host group.
    hostId String
    (String) ID of the host.
    hostReference Number
    (Integer) Current physical ID of the host.
    state String
    (String) State of the host up or down.
    status String
    (String) Status of the host enabled or disabled.
    sysType String
    (String) System type.
    userTags List<String>
    (List) List of user tags attached to the resource.

    GetPiHostsHostCapacity

    AvailableCores double
    AvailableMemory double
    (Float) Amount of memory currently available (in GB).
    ReservedCore double
    (Float) Number of cores reserved for system use.
    ReservedMemory double
    (Float) Amount of memory reserved for system use (in GB).
    TotalCore double
    (Float) Total number of cores of the host.
    TotalMemory double
    (Float) Total amount of memory of the host (in GB).
    UsedCore double
    (Float) Number of cores in use on the host.
    UsedMemory double
    (Float) Amount of memory used on the host (in GB).
    AvailableCores float64
    AvailableMemory float64
    (Float) Amount of memory currently available (in GB).
    ReservedCore float64
    (Float) Number of cores reserved for system use.
    ReservedMemory float64
    (Float) Amount of memory reserved for system use (in GB).
    TotalCore float64
    (Float) Total number of cores of the host.
    TotalMemory float64
    (Float) Total amount of memory of the host (in GB).
    UsedCore float64
    (Float) Number of cores in use on the host.
    UsedMemory float64
    (Float) Amount of memory used on the host (in GB).
    availableCores Double
    availableMemory Double
    (Float) Amount of memory currently available (in GB).
    reservedCore Double
    (Float) Number of cores reserved for system use.
    reservedMemory Double
    (Float) Amount of memory reserved for system use (in GB).
    totalCore Double
    (Float) Total number of cores of the host.
    totalMemory Double
    (Float) Total amount of memory of the host (in GB).
    usedCore Double
    (Float) Number of cores in use on the host.
    usedMemory Double
    (Float) Amount of memory used on the host (in GB).
    availableCores number
    availableMemory number
    (Float) Amount of memory currently available (in GB).
    reservedCore number
    (Float) Number of cores reserved for system use.
    reservedMemory number
    (Float) Amount of memory reserved for system use (in GB).
    totalCore number
    (Float) Total number of cores of the host.
    totalMemory number
    (Float) Total amount of memory of the host (in GB).
    usedCore number
    (Float) Number of cores in use on the host.
    usedMemory number
    (Float) Amount of memory used on the host (in GB).
    available_cores float
    available_memory float
    (Float) Amount of memory currently available (in GB).
    reserved_core float
    (Float) Number of cores reserved for system use.
    reserved_memory float
    (Float) Amount of memory reserved for system use (in GB).
    total_core float
    (Float) Total number of cores of the host.
    total_memory float
    (Float) Total amount of memory of the host (in GB).
    used_core float
    (Float) Number of cores in use on the host.
    used_memory float
    (Float) Amount of memory used on the host (in GB).
    availableCores Number
    availableMemory Number
    (Float) Amount of memory currently available (in GB).
    reservedCore Number
    (Float) Number of cores reserved for system use.
    reservedMemory Number
    (Float) Amount of memory reserved for system use (in GB).
    totalCore Number
    (Float) Total number of cores of the host.
    totalMemory Number
    (Float) Total amount of memory of the host (in GB).
    usedCore Number
    (Float) Number of cores in use on the host.
    usedMemory Number
    (Float) Amount of memory used on the host (in GB).

    Package Details

    Repository
    ibm ibm-cloud/terraform-provider-ibm
    License
    Notes
    This Pulumi package is based on the ibm Terraform Provider.
    ibm logo
    ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud