generated from pulumi/pulumi-tf-provider-boilerplate
/
getSubinterface.go
191 lines (165 loc) · 6.68 KB
/
getSubinterface.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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
// 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 nxos
import (
"context"
"reflect"
"github.com/lbrlabs/pulumi-nxos/sdk/go/nxos/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumix"
)
// This data source can read a subinterface.
//
// - API Documentation: [l3EncRtdIf](https://pubhub.devnetcloud.com/media/dme-docs-10-2-2/docs/Layer%203/l3:EncRtdIf/)
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/lbrlabs/pulumi-nxos/sdk/go/nxos"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := nxos.LookupSubinterface(ctx, &nxos.LookupSubinterfaceArgs{
// InterfaceId: "eth1/10.124",
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
func LookupSubinterface(ctx *pulumi.Context, args *LookupSubinterfaceArgs, opts ...pulumi.InvokeOption) (*LookupSubinterfaceResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv LookupSubinterfaceResult
err := ctx.Invoke("nxos:index/getSubinterface:getSubinterface", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getSubinterface.
type LookupSubinterfaceArgs struct {
// A device name from the provider configuration.
Device *string `pulumi:"device"`
// Must match first field in the output of `show intf brief`. Example: `eth1/1.10`.
InterfaceId string `pulumi:"interfaceId"`
}
// A collection of values returned by getSubinterface.
type LookupSubinterfaceResult struct {
// Administrative state.
AdminState string `pulumi:"adminState"`
// Specifies the administrative port bandwidth.
Bandwidth int `pulumi:"bandwidth"`
// Specifies the administrative port delay.
Delay int `pulumi:"delay"`
// Interface description.
Description string `pulumi:"description"`
// A device name from the provider configuration.
Device *string `pulumi:"device"`
// Subinterface encapsulation. Possible values are `unknown`, `vlan-XX` or `vxlan-XX`.
Encap string `pulumi:"encap"`
// The distinguished name of the object.
Id string `pulumi:"id"`
// Must match first field in the output of `show intf brief`. Example: `eth1/1.10`.
InterfaceId string `pulumi:"interfaceId"`
// Administrative link logging.
LinkLogging string `pulumi:"linkLogging"`
// The administrative port medium type.
Medium string `pulumi:"medium"`
// Administrative port MTU.
Mtu int `pulumi:"mtu"`
}
func LookupSubinterfaceOutput(ctx *pulumi.Context, args LookupSubinterfaceOutputArgs, opts ...pulumi.InvokeOption) LookupSubinterfaceResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupSubinterfaceResult, error) {
args := v.(LookupSubinterfaceArgs)
r, err := LookupSubinterface(ctx, &args, opts...)
var s LookupSubinterfaceResult
if r != nil {
s = *r
}
return s, err
}).(LookupSubinterfaceResultOutput)
}
// A collection of arguments for invoking getSubinterface.
type LookupSubinterfaceOutputArgs struct {
// A device name from the provider configuration.
Device pulumi.StringPtrInput `pulumi:"device"`
// Must match first field in the output of `show intf brief`. Example: `eth1/1.10`.
InterfaceId pulumi.StringInput `pulumi:"interfaceId"`
}
func (LookupSubinterfaceOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupSubinterfaceArgs)(nil)).Elem()
}
// A collection of values returned by getSubinterface.
type LookupSubinterfaceResultOutput struct{ *pulumi.OutputState }
func (LookupSubinterfaceResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupSubinterfaceResult)(nil)).Elem()
}
func (o LookupSubinterfaceResultOutput) ToLookupSubinterfaceResultOutput() LookupSubinterfaceResultOutput {
return o
}
func (o LookupSubinterfaceResultOutput) ToLookupSubinterfaceResultOutputWithContext(ctx context.Context) LookupSubinterfaceResultOutput {
return o
}
func (o LookupSubinterfaceResultOutput) ToOutput(ctx context.Context) pulumix.Output[LookupSubinterfaceResult] {
return pulumix.Output[LookupSubinterfaceResult]{
OutputState: o.OutputState,
}
}
// Administrative state.
func (o LookupSubinterfaceResultOutput) AdminState() pulumi.StringOutput {
return o.ApplyT(func(v LookupSubinterfaceResult) string { return v.AdminState }).(pulumi.StringOutput)
}
// Specifies the administrative port bandwidth.
func (o LookupSubinterfaceResultOutput) Bandwidth() pulumi.IntOutput {
return o.ApplyT(func(v LookupSubinterfaceResult) int { return v.Bandwidth }).(pulumi.IntOutput)
}
// Specifies the administrative port delay.
func (o LookupSubinterfaceResultOutput) Delay() pulumi.IntOutput {
return o.ApplyT(func(v LookupSubinterfaceResult) int { return v.Delay }).(pulumi.IntOutput)
}
// Interface description.
func (o LookupSubinterfaceResultOutput) Description() pulumi.StringOutput {
return o.ApplyT(func(v LookupSubinterfaceResult) string { return v.Description }).(pulumi.StringOutput)
}
// A device name from the provider configuration.
func (o LookupSubinterfaceResultOutput) Device() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupSubinterfaceResult) *string { return v.Device }).(pulumi.StringPtrOutput)
}
// Subinterface encapsulation. Possible values are `unknown`, `vlan-XX` or `vxlan-XX`.
func (o LookupSubinterfaceResultOutput) Encap() pulumi.StringOutput {
return o.ApplyT(func(v LookupSubinterfaceResult) string { return v.Encap }).(pulumi.StringOutput)
}
// The distinguished name of the object.
func (o LookupSubinterfaceResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupSubinterfaceResult) string { return v.Id }).(pulumi.StringOutput)
}
// Must match first field in the output of `show intf brief`. Example: `eth1/1.10`.
func (o LookupSubinterfaceResultOutput) InterfaceId() pulumi.StringOutput {
return o.ApplyT(func(v LookupSubinterfaceResult) string { return v.InterfaceId }).(pulumi.StringOutput)
}
// Administrative link logging.
func (o LookupSubinterfaceResultOutput) LinkLogging() pulumi.StringOutput {
return o.ApplyT(func(v LookupSubinterfaceResult) string { return v.LinkLogging }).(pulumi.StringOutput)
}
// The administrative port medium type.
func (o LookupSubinterfaceResultOutput) Medium() pulumi.StringOutput {
return o.ApplyT(func(v LookupSubinterfaceResult) string { return v.Medium }).(pulumi.StringOutput)
}
// Administrative port MTU.
func (o LookupSubinterfaceResultOutput) Mtu() pulumi.IntOutput {
return o.ApplyT(func(v LookupSubinterfaceResult) int { return v.Mtu }).(pulumi.IntOutput)
}
func init() {
pulumi.RegisterOutputType(LookupSubinterfaceResultOutput{})
}