1. Packages
  2. Ibm Provider
  3. API Docs
  4. getIsBareMetalServerDisk
ibm 1.77.1 published on Monday, Apr 14, 2025 by ibm-cloud

ibm.getIsBareMetalServerDisk

Explore with Pulumi AI

Import the details of an existing IBM Cloud Bare Metal Server Disk as a read-only data source. You can then reference the fields of the data source in other resources within the same configuration using interpolation syntax. For more information, about bare metal server disks, see Storage of Bare Metal Servers for VPC.

Note: VPC infrastructure services are a regional specific based endpoint, by default targets to us-south. Please make sure to target right region in the provider block as shown in the provider.tf file, if VPC service is created in region other than us-south.

provider.tf

import * as pulumi from "@pulumi/pulumi";
Copy
import pulumi
Copy
package main

import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;

return await Deployment.RunAsync(() => 
{
});
Copy
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) {
    }
}
Copy
{}
Copy

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as ibm from "@pulumi/ibm";

const dsBmsDisk = ibm.getIsBareMetalServerDisk({
    bareMetalServer: ibm_is_bare_metal_server.example.id,
    disk: ibm_is_bare_metal_server.example.disks[0].id,
});
Copy
import pulumi
import pulumi_ibm as ibm

ds_bms_disk = ibm.get_is_bare_metal_server_disk(bare_metal_server=ibm_is_bare_metal_server["example"]["id"],
    disk=ibm_is_bare_metal_server["example"]["disks"][0]["id"])
Copy
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.LookupIsBareMetalServerDisk(ctx, &ibm.LookupIsBareMetalServerDiskArgs{
			BareMetalServer: ibm_is_bare_metal_server.Example.Id,
			Disk:            ibm_is_bare_metal_server.Example.Disks[0].Id,
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ibm = Pulumi.Ibm;

return await Deployment.RunAsync(() => 
{
    var dsBmsDisk = Ibm.GetIsBareMetalServerDisk.Invoke(new()
    {
        BareMetalServer = ibm_is_bare_metal_server.Example.Id,
        Disk = ibm_is_bare_metal_server.Example.Disks[0].Id,
    });

});
Copy
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.GetIsBareMetalServerDiskArgs;
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 dsBmsDisk = IbmFunctions.getIsBareMetalServerDisk(GetIsBareMetalServerDiskArgs.builder()
            .bareMetalServer(ibm_is_bare_metal_server.example().id())
            .disk(ibm_is_bare_metal_server.example().disks()[0].id())
            .build());

    }
}
Copy
variables:
  dsBmsDisk:
    fn::invoke:
      function: ibm:getIsBareMetalServerDisk
      arguments:
        bareMetalServer: ${ibm_is_bare_metal_server.example.id}
        disk: ${ibm_is_bare_metal_server.example.disks[0].id}
Copy

Using getIsBareMetalServerDisk

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 getIsBareMetalServerDisk(args: GetIsBareMetalServerDiskArgs, opts?: InvokeOptions): Promise<GetIsBareMetalServerDiskResult>
function getIsBareMetalServerDiskOutput(args: GetIsBareMetalServerDiskOutputArgs, opts?: InvokeOptions): Output<GetIsBareMetalServerDiskResult>
Copy
def get_is_bare_metal_server_disk(bare_metal_server: Optional[str] = None,
                                  disk: Optional[str] = None,
                                  opts: Optional[InvokeOptions] = None) -> GetIsBareMetalServerDiskResult
def get_is_bare_metal_server_disk_output(bare_metal_server: Optional[pulumi.Input[str]] = None,
                                  disk: Optional[pulumi.Input[str]] = None,
                                  opts: Optional[InvokeOptions] = None) -> Output[GetIsBareMetalServerDiskResult]
Copy
func LookupIsBareMetalServerDisk(ctx *Context, args *LookupIsBareMetalServerDiskArgs, opts ...InvokeOption) (*LookupIsBareMetalServerDiskResult, error)
func LookupIsBareMetalServerDiskOutput(ctx *Context, args *LookupIsBareMetalServerDiskOutputArgs, opts ...InvokeOption) LookupIsBareMetalServerDiskResultOutput
Copy

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

public static class GetIsBareMetalServerDisk 
{
    public static Task<GetIsBareMetalServerDiskResult> InvokeAsync(GetIsBareMetalServerDiskArgs args, InvokeOptions? opts = null)
    public static Output<GetIsBareMetalServerDiskResult> Invoke(GetIsBareMetalServerDiskInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetIsBareMetalServerDiskResult> getIsBareMetalServerDisk(GetIsBareMetalServerDiskArgs args, InvokeOptions options)
public static Output<GetIsBareMetalServerDiskResult> getIsBareMetalServerDisk(GetIsBareMetalServerDiskArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: ibm:index/getIsBareMetalServerDisk:getIsBareMetalServerDisk
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

BareMetalServer This property is required. string
The id for this bare metal server.
Disk This property is required. string
The id for this bare metal server disk.
BareMetalServer This property is required. string
The id for this bare metal server.
Disk This property is required. string
The id for this bare metal server disk.
bareMetalServer This property is required. String
The id for this bare metal server.
disk This property is required. String
The id for this bare metal server disk.
bareMetalServer This property is required. string
The id for this bare metal server.
disk This property is required. string
The id for this bare metal server disk.
bare_metal_server This property is required. str
The id for this bare metal server.
disk This property is required. str
The id for this bare metal server disk.
bareMetalServer This property is required. String
The id for this bare metal server.
disk This property is required. String
The id for this bare metal server disk.

getIsBareMetalServerDisk Result

The following output properties are available:

BareMetalServer string
Disk string
Href string
(String) The URL for this bare metal server disk.
Id string
(String) The unique identifier for this bare metal server disk.
InterfaceType string
(String) The disk interface used for attaching the disk. Supported values are [ nvme, sata ].
Name string
(String) The user-defined name for this disk.
ResourceType string
(String) The resource type.
Size double
(String) The size of the disk in GB (gigabytes).
BareMetalServer string
Disk string
Href string
(String) The URL for this bare metal server disk.
Id string
(String) The unique identifier for this bare metal server disk.
InterfaceType string
(String) The disk interface used for attaching the disk. Supported values are [ nvme, sata ].
Name string
(String) The user-defined name for this disk.
ResourceType string
(String) The resource type.
Size float64
(String) The size of the disk in GB (gigabytes).
bareMetalServer String
disk String
href String
(String) The URL for this bare metal server disk.
id String
(String) The unique identifier for this bare metal server disk.
interfaceType String
(String) The disk interface used for attaching the disk. Supported values are [ nvme, sata ].
name String
(String) The user-defined name for this disk.
resourceType String
(String) The resource type.
size Double
(String) The size of the disk in GB (gigabytes).
bareMetalServer string
disk string
href string
(String) The URL for this bare metal server disk.
id string
(String) The unique identifier for this bare metal server disk.
interfaceType string
(String) The disk interface used for attaching the disk. Supported values are [ nvme, sata ].
name string
(String) The user-defined name for this disk.
resourceType string
(String) The resource type.
size number
(String) The size of the disk in GB (gigabytes).
bare_metal_server str
disk str
href str
(String) The URL for this bare metal server disk.
id str
(String) The unique identifier for this bare metal server disk.
interface_type str
(String) The disk interface used for attaching the disk. Supported values are [ nvme, sata ].
name str
(String) The user-defined name for this disk.
resource_type str
(String) The resource type.
size float
(String) The size of the disk in GB (gigabytes).
bareMetalServer String
disk String
href String
(String) The URL for this bare metal server disk.
id String
(String) The unique identifier for this bare metal server disk.
interfaceType String
(String) The disk interface used for attaching the disk. Supported values are [ nvme, sata ].
name String
(String) The user-defined name for this disk.
resourceType String
(String) The resource type.
size Number
(String) The size of the disk in GB (gigabytes).

Package Details

Repository
ibm ibm-cloud/terraform-provider-ibm
License
Notes
This Pulumi package is based on the ibm Terraform Provider.