oci.Core.getInstanceDevices
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 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:
- Instance
Id string The OCID of the instance.
- Filters
List<Get
Instance Devices Filter> - Is
Available 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.
- Instance
Id string The OCID of the instance.
- Filters
[]Get
Instance Devices Filter - Is
Available 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.
- instance
Id String The OCID of the instance.
- filters
List<Get
Instance Devices Filter> - is
Available 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 string The OCID of the instance.
- filters
Get
Instance Devices Filter[] - is
Available 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
Get
Instance Devices Filter] - 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.
- instance
Id String The OCID of the instance.
- filters List<Property Map>
- is
Available 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<Get
Instance Devices Device> The list of devices.
- Id string
The provider-assigned unique ID for this managed resource.
- Instance
Id string - Filters
List<Get
Instance Devices Filter> - Is
Available bool The flag denoting whether device is available.
- Name string
The device name.
- Devices
[]Get
Instance Devices Device The list of devices.
- Id string
The provider-assigned unique ID for this managed resource.
- Instance
Id string - Filters
[]Get
Instance Devices Filter - Is
Available bool The flag denoting whether device is available.
- Name string
The device name.
- devices
List<Get
Instance Devices Device> The list of devices.
- id String
The provider-assigned unique ID for this managed resource.
- instance
Id String - filters
List<Get
Instance Devices Filter> - is
Available Boolean The flag denoting whether device is available.
- name String
The device name.
- devices
Get
Instance Devices Device[] The list of devices.
- id string
The provider-assigned unique ID for this managed resource.
- instance
Id string - filters
Get
Instance Devices Filter[] - is
Available boolean The flag denoting whether device is available.
- name string
The device name.
- devices
Get
Instance Devices Device] The list of devices.
- id str
The provider-assigned unique ID for this managed resource.
- instance_
id str - filters
Get
Instance Devices Filter] - 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.
- instance
Id String - filters List<Property Map>
- is
Available Boolean The flag denoting whether device is available.
- name String
The device name.
Supporting Types
GetInstanceDevicesDevice
- Is
Available 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.
- Is
Available 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.
- is
Available 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 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.
- is
Available 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
Package Details
- Repository
- oci pulumi/pulumi-oci
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
oci
Terraform Provider.