Oracle Cloud Infrastructure v2.17.0 published on Friday, Nov 15, 2024 by Pulumi
oci.Core.getInstanceDevices
Explore with Pulumi AI
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:
- 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
Sequence[core.
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
Sequence[core.
Get Instance Devices Device] - The list of devices.
- id str
- The provider-assigned unique ID for this managed resource.
- instance_
id str - filters
Sequence[core.
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.