generated from pulumi/pulumi-tf-provider-boilerplate
/
getIpRange.go
108 lines (92 loc) · 2.87 KB
/
getIpRange.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package netbox
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/hbjydev/pulumi-netbox/sdk/go/netbox"
// "github.com/pulumi/pulumi-netbox/sdk/go/netbox"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := netbox.LookupIpRange(ctx, &GetIpRangeArgs{
// Contains: "10.0.0.1/24",
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
func LookupIpRange(ctx *pulumi.Context, args *LookupIpRangeArgs, opts ...pulumi.InvokeOption) (*LookupIpRangeResult, error) {
var rv LookupIpRangeResult
err := ctx.Invoke("netbox:index/getIpRange:getIpRange", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getIpRange.
type LookupIpRangeArgs struct {
Contains string `pulumi:"contains"`
}
// A collection of values returned by getIpRange.
type LookupIpRangeResult struct {
Contains string `pulumi:"contains"`
// The ID of this resource.
Id int `pulumi:"id"`
}
func LookupIpRangeOutput(ctx *pulumi.Context, args LookupIpRangeOutputArgs, opts ...pulumi.InvokeOption) LookupIpRangeResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupIpRangeResult, error) {
args := v.(LookupIpRangeArgs)
r, err := LookupIpRange(ctx, &args, opts...)
var s LookupIpRangeResult
if r != nil {
s = *r
}
return s, err
}).(LookupIpRangeResultOutput)
}
// A collection of arguments for invoking getIpRange.
type LookupIpRangeOutputArgs struct {
Contains pulumi.StringInput `pulumi:"contains"`
}
func (LookupIpRangeOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupIpRangeArgs)(nil)).Elem()
}
// A collection of values returned by getIpRange.
type LookupIpRangeResultOutput struct{ *pulumi.OutputState }
func (LookupIpRangeResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupIpRangeResult)(nil)).Elem()
}
func (o LookupIpRangeResultOutput) ToLookupIpRangeResultOutput() LookupIpRangeResultOutput {
return o
}
func (o LookupIpRangeResultOutput) ToLookupIpRangeResultOutputWithContext(ctx context.Context) LookupIpRangeResultOutput {
return o
}
func (o LookupIpRangeResultOutput) Contains() pulumi.StringOutput {
return o.ApplyT(func(v LookupIpRangeResult) string { return v.Contains }).(pulumi.StringOutput)
}
// The ID of this resource.
func (o LookupIpRangeResultOutput) Id() pulumi.IntOutput {
return o.ApplyT(func(v LookupIpRangeResult) int { return v.Id }).(pulumi.IntOutput)
}
func init() {
pulumi.RegisterOutputType(LookupIpRangeResultOutput{})
}