github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/networkmanager/getDevices.go (about)

     1  // Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
     2  // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
     3  
     4  package networkmanager
     5  
     6  import (
     7  	"context"
     8  	"reflect"
     9  
    10  	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal"
    11  	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    12  )
    13  
    14  // Retrieve information about devices.
    15  //
    16  // ## Example Usage
    17  //
    18  // <!--Start PulumiCodeChooser -->
    19  // ```go
    20  // package main
    21  //
    22  // import (
    23  //
    24  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/networkmanager"
    25  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    26  //
    27  // )
    28  //
    29  //	func main() {
    30  //		pulumi.Run(func(ctx *pulumi.Context) error {
    31  //			_, err := networkmanager.GetDevices(ctx, &networkmanager.GetDevicesArgs{
    32  //				GlobalNetworkId: globalNetworkId,
    33  //				Tags: map[string]interface{}{
    34  //					"Env": "test",
    35  //				},
    36  //			}, nil)
    37  //			if err != nil {
    38  //				return err
    39  //			}
    40  //			return nil
    41  //		})
    42  //	}
    43  //
    44  // ```
    45  // <!--End PulumiCodeChooser -->
    46  func GetDevices(ctx *pulumi.Context, args *GetDevicesArgs, opts ...pulumi.InvokeOption) (*GetDevicesResult, error) {
    47  	opts = internal.PkgInvokeDefaultOpts(opts)
    48  	var rv GetDevicesResult
    49  	err := ctx.Invoke("aws:networkmanager/getDevices:getDevices", args, &rv, opts...)
    50  	if err != nil {
    51  		return nil, err
    52  	}
    53  	return &rv, nil
    54  }
    55  
    56  // A collection of arguments for invoking getDevices.
    57  type GetDevicesArgs struct {
    58  	// ID of the Global Network of the devices to retrieve.
    59  	GlobalNetworkId string `pulumi:"globalNetworkId"`
    60  	// ID of the site of the devices to retrieve.
    61  	SiteId *string `pulumi:"siteId"`
    62  	// Restricts the list to the devices with these tags.
    63  	Tags map[string]string `pulumi:"tags"`
    64  }
    65  
    66  // A collection of values returned by getDevices.
    67  type GetDevicesResult struct {
    68  	GlobalNetworkId string `pulumi:"globalNetworkId"`
    69  	// The provider-assigned unique ID for this managed resource.
    70  	Id string `pulumi:"id"`
    71  	// IDs of the devices.
    72  	Ids    []string          `pulumi:"ids"`
    73  	SiteId *string           `pulumi:"siteId"`
    74  	Tags   map[string]string `pulumi:"tags"`
    75  }
    76  
    77  func GetDevicesOutput(ctx *pulumi.Context, args GetDevicesOutputArgs, opts ...pulumi.InvokeOption) GetDevicesResultOutput {
    78  	return pulumi.ToOutputWithContext(context.Background(), args).
    79  		ApplyT(func(v interface{}) (GetDevicesResult, error) {
    80  			args := v.(GetDevicesArgs)
    81  			r, err := GetDevices(ctx, &args, opts...)
    82  			var s GetDevicesResult
    83  			if r != nil {
    84  				s = *r
    85  			}
    86  			return s, err
    87  		}).(GetDevicesResultOutput)
    88  }
    89  
    90  // A collection of arguments for invoking getDevices.
    91  type GetDevicesOutputArgs struct {
    92  	// ID of the Global Network of the devices to retrieve.
    93  	GlobalNetworkId pulumi.StringInput `pulumi:"globalNetworkId"`
    94  	// ID of the site of the devices to retrieve.
    95  	SiteId pulumi.StringPtrInput `pulumi:"siteId"`
    96  	// Restricts the list to the devices with these tags.
    97  	Tags pulumi.StringMapInput `pulumi:"tags"`
    98  }
    99  
   100  func (GetDevicesOutputArgs) ElementType() reflect.Type {
   101  	return reflect.TypeOf((*GetDevicesArgs)(nil)).Elem()
   102  }
   103  
   104  // A collection of values returned by getDevices.
   105  type GetDevicesResultOutput struct{ *pulumi.OutputState }
   106  
   107  func (GetDevicesResultOutput) ElementType() reflect.Type {
   108  	return reflect.TypeOf((*GetDevicesResult)(nil)).Elem()
   109  }
   110  
   111  func (o GetDevicesResultOutput) ToGetDevicesResultOutput() GetDevicesResultOutput {
   112  	return o
   113  }
   114  
   115  func (o GetDevicesResultOutput) ToGetDevicesResultOutputWithContext(ctx context.Context) GetDevicesResultOutput {
   116  	return o
   117  }
   118  
   119  func (o GetDevicesResultOutput) GlobalNetworkId() pulumi.StringOutput {
   120  	return o.ApplyT(func(v GetDevicesResult) string { return v.GlobalNetworkId }).(pulumi.StringOutput)
   121  }
   122  
   123  // The provider-assigned unique ID for this managed resource.
   124  func (o GetDevicesResultOutput) Id() pulumi.StringOutput {
   125  	return o.ApplyT(func(v GetDevicesResult) string { return v.Id }).(pulumi.StringOutput)
   126  }
   127  
   128  // IDs of the devices.
   129  func (o GetDevicesResultOutput) Ids() pulumi.StringArrayOutput {
   130  	return o.ApplyT(func(v GetDevicesResult) []string { return v.Ids }).(pulumi.StringArrayOutput)
   131  }
   132  
   133  func (o GetDevicesResultOutput) SiteId() pulumi.StringPtrOutput {
   134  	return o.ApplyT(func(v GetDevicesResult) *string { return v.SiteId }).(pulumi.StringPtrOutput)
   135  }
   136  
   137  func (o GetDevicesResultOutput) Tags() pulumi.StringMapOutput {
   138  	return o.ApplyT(func(v GetDevicesResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput)
   139  }
   140  
   141  func init() {
   142  	pulumi.RegisterOutputType(GetDevicesResultOutput{})
   143  }