1. Packages
  2. Cloudflare Provider
  3. API Docs
  4. getDevices
Viewing docs for Cloudflare v4.16.0 (Older version)
published on Monday, Mar 9, 2026 by Pulumi
cloudflare logo
Viewing docs for Cloudflare v4.16.0 (Older version)
published on Monday, Mar 9, 2026 by Pulumi

    Use this data source to lookup Devices.

    Example Usage

    using System.Collections.Generic;
    using Pulumi;
    using Cloudflare = Pulumi.Cloudflare;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Cloudflare.GetDevices.Invoke(new()
        {
            AccountId = "f037e56e89293a057740de681ac9abbe",
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-cloudflare/sdk/v4/go/cloudflare"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := cloudflare.GetDevices(ctx, &cloudflare.GetDevicesArgs{
    			AccountId: "f037e56e89293a057740de681ac9abbe",
    		}, 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.cloudflare.CloudflareFunctions;
    import com.pulumi.cloudflare.inputs.GetDevicesArgs;
    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 example = CloudflareFunctions.getDevices(GetDevicesArgs.builder()
                .accountId("f037e56e89293a057740de681ac9abbe")
                .build());
    
        }
    }
    
    import * as pulumi from "@pulumi/pulumi";
    import * as cloudflare from "@pulumi/cloudflare";
    
    const example = cloudflare.getDevices({
        accountId: "f037e56e89293a057740de681ac9abbe",
    });
    
    import pulumi
    import pulumi_cloudflare as cloudflare
    
    example = cloudflare.get_devices(account_id="f037e56e89293a057740de681ac9abbe")
    
    variables:
      example:
        fn::invoke:
          Function: cloudflare:getDevices
          Arguments:
            accountId: f037e56e89293a057740de681ac9abbe
    

    Using getDevices

    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 getDevices(args: GetDevicesArgs, opts?: InvokeOptions): Promise<GetDevicesResult>
    function getDevicesOutput(args: GetDevicesOutputArgs, opts?: InvokeOptions): Output<GetDevicesResult>
    def get_devices(account_id: Optional[str] = None,
                    opts: Optional[InvokeOptions] = None) -> GetDevicesResult
    def get_devices_output(account_id: Optional[pulumi.Input[str]] = None,
                    opts: Optional[InvokeOptions] = None) -> Output[GetDevicesResult]
    func GetDevices(ctx *Context, args *GetDevicesArgs, opts ...InvokeOption) (*GetDevicesResult, error)
    func GetDevicesOutput(ctx *Context, args *GetDevicesOutputArgs, opts ...InvokeOption) GetDevicesResultOutput

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

    public static class GetDevices 
    {
        public static Task<GetDevicesResult> InvokeAsync(GetDevicesArgs args, InvokeOptions? opts = null)
        public static Output<GetDevicesResult> Invoke(GetDevicesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetDevicesResult> getDevices(GetDevicesArgs args, InvokeOptions options)
    public static Output<GetDevicesResult> getDevices(GetDevicesArgs args, InvokeOptions options)
    
    fn::invoke:
      function: cloudflare:index/getDevices:getDevices
      arguments:
        # arguments dictionary

    The following arguments are supported:

    AccountId string
    The account identifier to target for the resource.
    AccountId string
    The account identifier to target for the resource.
    accountId String
    The account identifier to target for the resource.
    accountId string
    The account identifier to target for the resource.
    account_id str
    The account identifier to target for the resource.
    accountId String
    The account identifier to target for the resource.

    getDevices Result

    The following output properties are available:

    AccountId string
    The account identifier to target for the resource.
    Devices List<GetDevicesDevice>
    Id string
    The provider-assigned unique ID for this managed resource.
    AccountId string
    The account identifier to target for the resource.
    Devices []GetDevicesDevice
    Id string
    The provider-assigned unique ID for this managed resource.
    accountId String
    The account identifier to target for the resource.
    devices List<GetDevicesDevice>
    id String
    The provider-assigned unique ID for this managed resource.
    accountId string
    The account identifier to target for the resource.
    devices GetDevicesDevice[]
    id string
    The provider-assigned unique ID for this managed resource.
    account_id str
    The account identifier to target for the resource.
    devices Sequence[GetDevicesDevice]
    id str
    The provider-assigned unique ID for this managed resource.
    accountId String
    The account identifier to target for the resource.
    devices List<Property Map>
    id String
    The provider-assigned unique ID for this managed resource.

    Supporting Types

    GetDevicesDevice

    Created string
    DeviceType string
    Id string
    The ID of this resource.
    Ip string
    Key string
    LastSeen string
    Model string
    Name string
    OsDistroName string
    OsDistroRevision string
    OsVersion string
    Updated string
    UserEmail string
    UserId string
    UserName string
    Version string
    Created string
    DeviceType string
    Id string
    The ID of this resource.
    Ip string
    Key string
    LastSeen string
    Model string
    Name string
    OsDistroName string
    OsDistroRevision string
    OsVersion string
    Updated string
    UserEmail string
    UserId string
    UserName string
    Version string
    created String
    deviceType String
    id String
    The ID of this resource.
    ip String
    key String
    lastSeen String
    model String
    name String
    osDistroName String
    osDistroRevision String
    osVersion String
    updated String
    userEmail String
    userId String
    userName String
    version String
    created string
    deviceType string
    id string
    The ID of this resource.
    ip string
    key string
    lastSeen string
    model string
    name string
    osDistroName string
    osDistroRevision string
    osVersion string
    updated string
    userEmail string
    userId string
    userName string
    version string
    created str
    device_type str
    id str
    The ID of this resource.
    ip str
    key str
    last_seen str
    model str
    name str
    os_distro_name str
    os_distro_revision str
    os_version str
    updated str
    user_email str
    user_id str
    user_name str
    version str
    created String
    deviceType String
    id String
    The ID of this resource.
    ip String
    key String
    lastSeen String
    model String
    name String
    osDistroName String
    osDistroRevision String
    osVersion String
    updated String
    userEmail String
    userId String
    userName String
    version String

    Package Details

    Repository
    Cloudflare pulumi/pulumi-cloudflare
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the cloudflare Terraform Provider.
    cloudflare logo
    Viewing docs for Cloudflare v4.16.0 (Older version)
    published on Monday, Mar 9, 2026 by Pulumi
      Try Pulumi Cloud free. Your team will thank you.