1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. Core
  5. getInstanceDevices
Oracle Cloud Infrastructure v2.17.0 published on Friday, Nov 15, 2024 by Pulumi

oci.Core.getInstanceDevices

Explore with Pulumi AI

oci logo
Oracle Cloud Infrastructure v2.17.0 published on Friday, Nov 15, 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

    import * as pulumi from "@pulumi/pulumi";
    import * as oci from "@pulumi/oci";
    
    const testInstanceDevices = oci.Core.getInstanceDevices({
        instanceId: testInstance.id,
        isAvailable: instanceDeviceIsAvailable,
        name: instanceDeviceName,
    });
    
    import pulumi
    import pulumi_oci as oci
    
    test_instance_devices = oci.Core.get_instance_devices(instance_id=test_instance["id"],
        is_available=instance_device_is_available,
        name=instance_device_name)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-oci/sdk/v2/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:  testInstance.Id,
    			IsAvailable: pulumi.BoolRef(instanceDeviceIsAvailable),
    			Name:        pulumi.StringRef(instanceDeviceName),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    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 = testInstance.Id,
            IsAvailable = instanceDeviceIsAvailable,
            Name = instanceDeviceName,
        });
    
    });
    
    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(testInstance.id())
                .isAvailable(instanceDeviceIsAvailable)
                .name(instanceDeviceName)
                .build());
    
        }
    }
    
    variables:
      testInstanceDevices:
        fn::invoke:
          Function: oci:Core:getInstanceDevices
          Arguments:
            instanceId: ${testInstance.id}
            isAvailable: ${instanceDeviceIsAvailable}
            name: ${instanceDeviceName}
    

    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 Sequence[core.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 Sequence[core.GetInstanceDevicesDevice]
    The list of devices.
    id str
    The provider-assigned unique ID for this managed resource.
    instance_id str
    filters Sequence[core.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 v2.17.0 published on Friday, Nov 15, 2024 by Pulumi