1. Registry
  2. Packages
  3. Powerflex Provider
  4. API Docs
  5. getDeviceGroupV2
Viewing docs for powerflex 1.9.0
published on Monday, Sep 28, 2026 by dell
Viewing docs for powerflex 1.9.0
published on Monday, Sep 28, 2026 by dell

    This datasource is used to query Device Groups from a PowerFlex Gen2 system (5.0+).

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as powerflex from "@pulumi/powerflex";
    
    // Copyright (c) 2024-2026 Dell Inc., or its subsidiaries. All Rights Reserved.
    //
    // Licensed under the Mozilla Public License Version 2.0 (the "License");
    // you may not use this file except in compliance with the License.
    // You may obtain a copy of the License at
    //
    //     http://mozilla.org/MPL/2.0/
    //
    // Unless required by applicable law or agreed to in writing, software
    // distributed under the License is distributed on an "AS IS" BASIS,
    // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    // See the License for the specific language governing permissions and
    // limitations under the License.
    // List all device groups
    const all = powerflex.getDeviceGroupV2({});
    export const allDeviceGroups = all.then(all => all.deviceGroups);
    // Get device group by ID
    const byId = powerflex.getDeviceGroupV2({
        id: "abc123def456",
    });
    // Filter by name
    const byName = powerflex.getDeviceGroupV2({
        name: "device-group-1",
    });
    // Filter by protection domain
    const byPd = powerflex.getDeviceGroupV2({
        protectionDomainId: "pd-123456",
    });
    
    import pulumi
    import pulumi_powerflex as powerflex
    
    # Copyright (c) 2024-2026 Dell Inc., or its subsidiaries. All Rights Reserved.
    #
    # Licensed under the Mozilla Public License Version 2.0 (the "License");
    # you may not use this file except in compliance with the License.
    # You may obtain a copy of the License at
    #
    #     http://mozilla.org/MPL/2.0/
    #
    # Unless required by applicable law or agreed to in writing, software
    # distributed under the License is distributed on an "AS IS" BASIS,
    # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    # See the License for the specific language governing permissions and
    # limitations under the License.
    # List all device groups
    all = powerflex.get_device_group_v2()
    pulumi.export("allDeviceGroups", all.device_groups)
    # Get device group by ID
    by_id = powerflex.get_device_group_v2(id="abc123def456")
    # Filter by name
    by_name = powerflex.get_device_group_v2(name="device-group-1")
    # Filter by protection domain
    by_pd = powerflex.get_device_group_v2(protection_domain_id="pd-123456")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/powerflex/powerflex"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// Copyright (c) 2024-2026 Dell Inc., or its subsidiaries. All Rights Reserved.
    		//
    		// Licensed under the Mozilla Public License Version 2.0 (the "License");
    		// you may not use this file except in compliance with the License.
    		// You may obtain a copy of the License at
    		//
    		//	http://mozilla.org/MPL/2.0/
    		//
    		// Unless required by applicable law or agreed to in writing, software
    		// distributed under the License is distributed on an "AS IS" BASIS,
    		// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    		// See the License for the specific language governing permissions and
    		// limitations under the License.
    		// List all device groups
    		all, err := powerflex.LookupDeviceGroupV2(ctx, &powerflex.LookupDeviceGroupV2Args{}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("allDeviceGroups", all.DeviceGroups)
    		// Get device group by ID
    		_, err = powerflex.LookupDeviceGroupV2(ctx, &powerflex.LookupDeviceGroupV2Args{
    			Id: pulumi.StringRef("abc123def456"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		// Filter by name
    		_, err = powerflex.LookupDeviceGroupV2(ctx, &powerflex.LookupDeviceGroupV2Args{
    			Name: pulumi.StringRef("device-group-1"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		// Filter by protection domain
    		_, err = powerflex.LookupDeviceGroupV2(ctx, &powerflex.LookupDeviceGroupV2Args{
    			ProtectionDomainId: pulumi.StringRef("pd-123456"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Powerflex = Pulumi.Powerflex;
    
    return await Deployment.RunAsync(() => 
    {
        // Copyright (c) 2024-2026 Dell Inc., or its subsidiaries. All Rights Reserved.
        //
        // Licensed under the Mozilla Public License Version 2.0 (the "License");
        // you may not use this file except in compliance with the License.
        // You may obtain a copy of the License at
        //
        //     http://mozilla.org/MPL/2.0/
        //
        // Unless required by applicable law or agreed to in writing, software
        // distributed under the License is distributed on an "AS IS" BASIS,
        // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
        // See the License for the specific language governing permissions and
        // limitations under the License.
        // List all device groups
        var all = Powerflex.GetDeviceGroupV2.Invoke();
    
        // Get device group by ID
        var byId = Powerflex.GetDeviceGroupV2.Invoke(new()
        {
            Id = "abc123def456",
        });
    
        // Filter by name
        var byName = Powerflex.GetDeviceGroupV2.Invoke(new()
        {
            Name = "device-group-1",
        });
    
        // Filter by protection domain
        var byPd = Powerflex.GetDeviceGroupV2.Invoke(new()
        {
            ProtectionDomainId = "pd-123456",
        });
    
        return new Dictionary<string, object?>
        {
            ["allDeviceGroups"] = all.Apply(getDeviceGroupV2Result => getDeviceGroupV2Result.DeviceGroups),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.powerflex.PowerflexFunctions;
    import com.pulumi.powerflex.inputs.GetDeviceGroupV2Args;
    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) {
            // Copyright (c) 2024-2026 Dell Inc., or its subsidiaries. All Rights Reserved.
            //
            // Licensed under the Mozilla Public License Version 2.0 (the "License");
            // you may not use this file except in compliance with the License.
            // You may obtain a copy of the License at
            //
            //     http://mozilla.org/MPL/2.0/
            //
            // Unless required by applicable law or agreed to in writing, software
            // distributed under the License is distributed on an "AS IS" BASIS,
            // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
            // See the License for the specific language governing permissions and
            // limitations under the License.
            // List all device groups
            final var all = PowerflexFunctions.getDeviceGroupV2(GetDeviceGroupV2Args.builder()
                .build());
    
            ctx.export("allDeviceGroups", all.deviceGroups());
            // Get device group by ID
            final var byId = PowerflexFunctions.getDeviceGroupV2(GetDeviceGroupV2Args.builder()
                .id("abc123def456")
                .build());
    
            // Filter by name
            final var byName = PowerflexFunctions.getDeviceGroupV2(GetDeviceGroupV2Args.builder()
                .name("device-group-1")
                .build());
    
            // Filter by protection domain
            final var byPd = PowerflexFunctions.getDeviceGroupV2(GetDeviceGroupV2Args.builder()
                .protectionDomainId("pd-123456")
                .build());
    
        }
    }
    
    variables:
      # Copyright (c) 2024-2026 Dell Inc., or its subsidiaries. All Rights Reserved.
      #
      # Licensed under the Mozilla Public License Version 2.0 (the "License");
      # you may not use this file except in compliance with the License.
      # You may obtain a copy of the License at
      #
      #     http://mozilla.org/MPL/2.0/
      #
      # Unless required by applicable law or agreed to in writing, software
      # distributed under the License is distributed on an "AS IS" BASIS,
      # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
      # See the License for the specific language governing permissions and
      # limitations under the License.
    
      # List all device groups
      all:
        fn::invoke:
          function: powerflex:getDeviceGroupV2
          arguments: {}
      # Get device group by ID
      byId:
        fn::invoke:
          function: powerflex:getDeviceGroupV2
          arguments:
            id: abc123def456
      # Filter by name
      byName:
        fn::invoke:
          function: powerflex:getDeviceGroupV2
          arguments:
            name: device-group-1
      # Filter by protection domain
      byPd:
        fn::invoke:
          function: powerflex:getDeviceGroupV2
          arguments:
            protectionDomainId: pd-123456
    outputs:
      allDeviceGroups: ${all.deviceGroups}
    
    Example coming soon!
    

    Using getDeviceGroupV2

    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 getDeviceGroupV2(args: GetDeviceGroupV2Args, opts?: InvokeOptions): Promise<GetDeviceGroupV2Result>
    function getDeviceGroupV2Output(args: GetDeviceGroupV2OutputArgs, opts?: InvokeOutputOptions): Output<GetDeviceGroupV2Result>
    def get_device_group_v2(id: Optional[str] = None,
                            name: Optional[str] = None,
                            protection_domain_id: Optional[str] = None,
                            opts: Optional[InvokeOptions] = None) -> GetDeviceGroupV2Result
    def get_device_group_v2_output(id: pulumi.Input[Optional[str]] = None,
                            name: pulumi.Input[Optional[str]] = None,
                            protection_domain_id: pulumi.Input[Optional[str]] = None,
                            opts: Optional[InvokeOutputOptions] = None) -> Output[GetDeviceGroupV2Result]
    func LookupDeviceGroupV2(ctx *Context, args *LookupDeviceGroupV2Args, opts ...InvokeOption) (*LookupDeviceGroupV2Result, error)
    func LookupDeviceGroupV2Output(ctx *Context, args *LookupDeviceGroupV2OutputArgs, opts ...InvokeOption) LookupDeviceGroupV2ResultOutput

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

    public static class GetDeviceGroupV2 
    {
        public static Task<GetDeviceGroupV2Result> InvokeAsync(GetDeviceGroupV2Args args, InvokeOptions? opts = null)
        public static Output<GetDeviceGroupV2Result> Invoke(GetDeviceGroupV2InvokeArgs args, InvokeOptions? opts = null)
        public static Output<GetDeviceGroupV2Result> Invoke(GetDeviceGroupV2InvokeArgs args, InvokeOutputOptions opts)
    }
    public static CompletableFuture<GetDeviceGroupV2Result> getDeviceGroupV2(GetDeviceGroupV2Args args, InvokeOptions options)
    public static Output<GetDeviceGroupV2Result> getDeviceGroupV2(GetDeviceGroupV2Args args, InvokeOptions options)
    public static Output<GetDeviceGroupV2Result> getDeviceGroupV2(GetDeviceGroupV2Args args, InvokeOutputOptions options)
    
    fn::invoke:
      function: powerflex:index/getDeviceGroupV2:getDeviceGroupV2
      arguments:
        # arguments dictionary
    data "powerflex_get_device_group_v2" "name" {
        # arguments
    }

    The following arguments are supported:

    Id string
    The ID of the device group to query. If not specified, all device groups are returned.
    Name string
    The name of the device group to query.
    ProtectionDomainId string
    The protection domain ID to filter device groups.
    Id string
    The ID of the device group to query. If not specified, all device groups are returned.
    Name string
    The name of the device group to query.
    ProtectionDomainId string
    The protection domain ID to filter device groups.
    id string
    The ID of the device group to query. If not specified, all device groups are returned.
    name string
    The name of the device group to query.
    protection_domain_id string
    The protection domain ID to filter device groups.
    id String
    The ID of the device group to query. If not specified, all device groups are returned.
    name String
    The name of the device group to query.
    protectionDomainId String
    The protection domain ID to filter device groups.
    id string
    The ID of the device group to query. If not specified, all device groups are returned.
    name string
    The name of the device group to query.
    protectionDomainId string
    The protection domain ID to filter device groups.
    id str
    The ID of the device group to query. If not specified, all device groups are returned.
    name str
    The name of the device group to query.
    protection_domain_id str
    The protection domain ID to filter device groups.
    id String
    The ID of the device group to query. If not specified, all device groups are returned.
    name String
    The name of the device group to query.
    protectionDomainId String
    The protection domain ID to filter device groups.

    getDeviceGroupV2 Result

    The following output properties are available:

    DeviceGroups List<GetDeviceGroupV2DeviceGroup>
    List of device groups with the following attributes:
    Id string
    The ID of the device group.
    Name string
    The name of the device group.
    ProtectionDomainId string
    The protection domain ID.
    DeviceGroups []GetDeviceGroupV2DeviceGroup
    List of device groups with the following attributes:
    Id string
    The ID of the device group.
    Name string
    The name of the device group.
    ProtectionDomainId string
    The protection domain ID.
    device_groups list(object)
    List of device groups with the following attributes:
    id string
    The ID of the device group.
    name string
    The name of the device group.
    protection_domain_id string
    The protection domain ID.
    deviceGroups List<GetDeviceGroupV2DeviceGroup>
    List of device groups with the following attributes:
    id String
    The ID of the device group.
    name String
    The name of the device group.
    protectionDomainId String
    The protection domain ID.
    deviceGroups GetDeviceGroupV2DeviceGroup[]
    List of device groups with the following attributes:
    id string
    The ID of the device group.
    name string
    The name of the device group.
    protectionDomainId string
    The protection domain ID.
    device_groups Sequence[GetDeviceGroupV2DeviceGroup]
    List of device groups with the following attributes:
    id str
    The ID of the device group.
    name str
    The name of the device group.
    protection_domain_id str
    The protection domain ID.
    deviceGroups List<Property Map>
    List of device groups with the following attributes:
    id String
    The ID of the device group.
    name String
    The name of the device group.
    protectionDomainId String
    The protection domain ID.

    Supporting Types

    GetDeviceGroupV2DeviceGroup

    Id string
    Device Group ID.
    Name string
    Device Group name.
    NumOfDevices double
    Number of devices in the group.
    ProtectionDomainId string
    Protection Domain ID.
    Status string
    Status of the device group.
    UsableCapacityInKb double
    Usable capacity in KB.
    UsedCapacityInKb double
    Used capacity in KB.
    Id string
    Device Group ID.
    Name string
    Device Group name.
    NumOfDevices float64
    Number of devices in the group.
    ProtectionDomainId string
    Protection Domain ID.
    Status string
    Status of the device group.
    UsableCapacityInKb float64
    Usable capacity in KB.
    UsedCapacityInKb float64
    Used capacity in KB.
    id string
    Device Group ID.
    name string
    Device Group name.
    num_of_devices number
    Number of devices in the group.
    protection_domain_id string
    Protection Domain ID.
    status string
    Status of the device group.
    usable_capacity_in_kb number
    Usable capacity in KB.
    used_capacity_in_kb number
    Used capacity in KB.
    id String
    Device Group ID.
    name String
    Device Group name.
    numOfDevices Double
    Number of devices in the group.
    protectionDomainId String
    Protection Domain ID.
    status String
    Status of the device group.
    usableCapacityInKb Double
    Usable capacity in KB.
    usedCapacityInKb Double
    Used capacity in KB.
    id string
    Device Group ID.
    name string
    Device Group name.
    numOfDevices number
    Number of devices in the group.
    protectionDomainId string
    Protection Domain ID.
    status string
    Status of the device group.
    usableCapacityInKb number
    Usable capacity in KB.
    usedCapacityInKb number
    Used capacity in KB.
    id str
    Device Group ID.
    name str
    Device Group name.
    num_of_devices float
    Number of devices in the group.
    protection_domain_id str
    Protection Domain ID.
    status str
    Status of the device group.
    usable_capacity_in_kb float
    Usable capacity in KB.
    used_capacity_in_kb float
    Used capacity in KB.
    id String
    Device Group ID.
    name String
    Device Group name.
    numOfDevices Number
    Number of devices in the group.
    protectionDomainId String
    Protection Domain ID.
    status String
    Status of the device group.
    usableCapacityInKb Number
    Usable capacity in KB.
    usedCapacityInKb Number
    Used capacity in KB.

    Package Details

    Repository
    powerflex dell/terraform-provider-powerflex
    License
    Notes
    This Pulumi package is based on the powerflex Terraform Provider.
    Viewing docs for powerflex 1.9.0
    published on Monday, Sep 28, 2026 by dell

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial