1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. Core
  5. getInstanceDevices
Oracle Cloud Infrastructure v1.24.0 published on Thursday, Feb 22, 2024 by Pulumi

oci.Core.getInstanceDevices

Explore with Pulumi AI

oci logo
Oracle Cloud Infrastructure v1.24.0 published on Thursday, Feb 22, 2024 by Pulumi

    This data source provides the list of Instance Devices in Oracle Cloud Infrastructure Core service.

    Gets a list of all the devices for given instance. You can optionally filter results by device availability.

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Oci = Pulumi.Oci;
    
    return await Deployment.RunAsync(() => 
    {
        var testInstanceDevices = Oci.Core.GetInstanceDevices.Invoke(new()
        {
            InstanceId = oci_core_instance.Test_instance.Id,
            IsAvailable = @var.Instance_device_is_available,
            Name = @var.Instance_device_name,
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-oci/sdk/go/oci/Core"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := Core.GetInstanceDevices(ctx, &core.GetInstanceDevicesArgs{
    			InstanceId:  oci_core_instance.Test_instance.Id,
    			IsAvailable: pulumi.BoolRef(_var.Instance_device_is_available),
    			Name:        pulumi.StringRef(_var.Instance_device_name),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.oci.Core.CoreFunctions;
    import com.pulumi.oci.Core.inputs.GetInstanceDevicesArgs;
    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 testInstanceDevices = CoreFunctions.getInstanceDevices(GetInstanceDevicesArgs.builder()
                .instanceId(oci_core_instance.test_instance().id())
                .isAvailable(var_.instance_device_is_available())
                .name(var_.instance_device_name())
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_oci as oci
    
    test_instance_devices = oci.Core.get_instance_devices(instance_id=oci_core_instance["test_instance"]["id"],
        is_available=var["instance_device_is_available"],
        name=var["instance_device_name"])
    
    import * as pulumi from "@pulumi/pulumi";
    import * as oci from "@pulumi/oci";
    
    const testInstanceDevices = oci.Core.getInstanceDevices({
        instanceId: oci_core_instance.test_instance.id,
        isAvailable: _var.instance_device_is_available,
        name: _var.instance_device_name,
    });
    
    variables:
      testInstanceDevices:
        fn::invoke:
          Function: oci:Core:getInstanceDevices
          Arguments:
            instanceId: ${oci_core_instance.test_instance.id}
            isAvailable: ${var.instance_device_is_available}
            name: ${var.instance_device_name}
    

    Using getInstanceDevices

    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 getInstanceDevices(args: GetInstanceDevicesArgs, opts?: InvokeOptions): Promise<GetInstanceDevicesResult>
    function getInstanceDevicesOutput(args: GetInstanceDevicesOutputArgs, opts?: InvokeOptions): Output<GetInstanceDevicesResult>
    def get_instance_devices(filters: Optional[Sequence[_core.GetInstanceDevicesFilter]] = None,
                             instance_id: Optional[str] = None,
                             is_available: Optional[bool] = None,
                             name: Optional[str] = None,
                             opts: Optional[InvokeOptions] = None) -> GetInstanceDevicesResult
    def get_instance_devices_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[_core.GetInstanceDevicesFilterArgs]]]] = None,
                             instance_id: Optional[pulumi.Input[str]] = None,
                             is_available: Optional[pulumi.Input[bool]] = None,
                             name: Optional[pulumi.Input[str]] = None,
                             opts: Optional[InvokeOptions] = None) -> Output[GetInstanceDevicesResult]
    func GetInstanceDevices(ctx *Context, args *GetInstanceDevicesArgs, opts ...InvokeOption) (*GetInstanceDevicesResult, error)
    func GetInstanceDevicesOutput(ctx *Context, args *GetInstanceDevicesOutputArgs, opts ...InvokeOption) GetInstanceDevicesResultOutput

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

    public static class GetInstanceDevices 
    {
        public static Task<GetInstanceDevicesResult> InvokeAsync(GetInstanceDevicesArgs args, InvokeOptions? opts = null)
        public static Output<GetInstanceDevicesResult> Invoke(GetInstanceDevicesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetInstanceDevicesResult> getInstanceDevices(GetInstanceDevicesArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: oci:Core/getInstanceDevices:getInstanceDevices
      arguments:
        # arguments dictionary

    The following arguments are supported:

    InstanceId string
    The OCID of the instance.
    Filters List<GetInstanceDevicesFilter>
    IsAvailable bool
    A filter to return only available devices or only used devices.
    Name string
    A filter to return only devices that match the given name exactly.
    InstanceId string
    The OCID of the instance.
    Filters []GetInstanceDevicesFilter
    IsAvailable bool
    A filter to return only available devices or only used devices.
    Name string
    A filter to return only devices that match the given name exactly.
    instanceId String
    The OCID of the instance.
    filters List<GetInstanceDevicesFilter>
    isAvailable Boolean
    A filter to return only available devices or only used devices.
    name String
    A filter to return only devices that match the given name exactly.
    instanceId string
    The OCID of the instance.
    filters GetInstanceDevicesFilter[]
    isAvailable boolean
    A filter to return only available devices or only used devices.
    name string
    A filter to return only devices that match the given name exactly.
    instance_id str
    The OCID of the instance.
    filters GetInstanceDevicesFilter]
    is_available bool
    A filter to return only available devices or only used devices.
    name str
    A filter to return only devices that match the given name exactly.
    instanceId String
    The OCID of the instance.
    filters List<Property Map>
    isAvailable Boolean
    A filter to return only available devices or only used devices.
    name String
    A filter to return only devices that match the given name exactly.

    getInstanceDevices Result

    The following output properties are available:

    Devices List<GetInstanceDevicesDevice>
    The list of devices.
    Id string
    The provider-assigned unique ID for this managed resource.
    InstanceId string
    Filters List<GetInstanceDevicesFilter>
    IsAvailable bool
    The flag denoting whether device is available.
    Name string
    The device name.
    Devices []GetInstanceDevicesDevice
    The list of devices.
    Id string
    The provider-assigned unique ID for this managed resource.
    InstanceId string
    Filters []GetInstanceDevicesFilter
    IsAvailable bool
    The flag denoting whether device is available.
    Name string
    The device name.
    devices List<GetInstanceDevicesDevice>
    The list of devices.
    id String
    The provider-assigned unique ID for this managed resource.
    instanceId String
    filters List<GetInstanceDevicesFilter>
    isAvailable Boolean
    The flag denoting whether device is available.
    name String
    The device name.
    devices GetInstanceDevicesDevice[]
    The list of devices.
    id string
    The provider-assigned unique ID for this managed resource.
    instanceId string
    filters GetInstanceDevicesFilter[]
    isAvailable boolean
    The flag denoting whether device is available.
    name string
    The device name.
    devices GetInstanceDevicesDevice]
    The list of devices.
    id str
    The provider-assigned unique ID for this managed resource.
    instance_id str
    filters GetInstanceDevicesFilter]
    is_available bool
    The flag denoting whether device is available.
    name str
    The device name.
    devices List<Property Map>
    The list of devices.
    id String
    The provider-assigned unique ID for this managed resource.
    instanceId String
    filters List<Property Map>
    isAvailable Boolean
    The flag denoting whether device is available.
    name String
    The device name.

    Supporting Types

    GetInstanceDevicesDevice

    IsAvailable bool
    A filter to return only available devices or only used devices.
    Name string
    A filter to return only devices that match the given name exactly.
    IsAvailable bool
    A filter to return only available devices or only used devices.
    Name string
    A filter to return only devices that match the given name exactly.
    isAvailable Boolean
    A filter to return only available devices or only used devices.
    name String
    A filter to return only devices that match the given name exactly.
    isAvailable boolean
    A filter to return only available devices or only used devices.
    name string
    A filter to return only devices that match the given name exactly.
    is_available bool
    A filter to return only available devices or only used devices.
    name str
    A filter to return only devices that match the given name exactly.
    isAvailable Boolean
    A filter to return only available devices or only used devices.
    name String
    A filter to return only devices that match the given name exactly.

    GetInstanceDevicesFilter

    Name string
    A filter to return only devices that match the given name exactly.
    Values List<string>
    Regex bool
    Name string
    A filter to return only devices that match the given name exactly.
    Values []string
    Regex bool
    name String
    A filter to return only devices that match the given name exactly.
    values List<String>
    regex Boolean
    name string
    A filter to return only devices that match the given name exactly.
    values string[]
    regex boolean
    name str
    A filter to return only devices that match the given name exactly.
    values Sequence[str]
    regex bool
    name String
    A filter to return only devices that match the given name exactly.
    values List<String>
    regex Boolean

    Package Details

    Repository
    oci pulumi/pulumi-oci
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the oci Terraform Provider.
    oci logo
    Oracle Cloud Infrastructure v1.24.0 published on Thursday, Feb 22, 2024 by Pulumi