forked from pulumi/pulumi-azure-native-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
getPeerAsn.go
132 lines (110 loc) · 4.49 KB
/
getPeerAsn.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
// Code generated by the Pulumi SDK Generator DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package peering
import (
"context"
"reflect"
"github.com/pulumi/pulumi-azure-native-sdk/v2/utilities"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Gets the peer ASN with the specified name under the given subscription.
// Azure REST API version: 2022-10-01.
//
// Other available API versions: 2019-09-01-preview, 2021-01-01.
func LookupPeerAsn(ctx *pulumi.Context, args *LookupPeerAsnArgs, opts ...pulumi.InvokeOption) (*LookupPeerAsnResult, error) {
opts = utilities.PkgInvokeDefaultOpts(opts)
var rv LookupPeerAsnResult
err := ctx.Invoke("azure-native:peering:getPeerAsn", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
type LookupPeerAsnArgs struct {
// The peer ASN name.
PeerAsnName string `pulumi:"peerAsnName"`
}
// The essential information related to the peer's ASN.
type LookupPeerAsnResult struct {
// The error message for the validation state
ErrorMessage string `pulumi:"errorMessage"`
// The ID of the resource.
Id string `pulumi:"id"`
// The name of the resource.
Name string `pulumi:"name"`
// The Autonomous System Number (ASN) of the peer.
PeerAsn *int `pulumi:"peerAsn"`
// The contact details of the peer.
PeerContactDetail []ContactDetailResponse `pulumi:"peerContactDetail"`
// The name of the peer.
PeerName *string `pulumi:"peerName"`
// The type of the resource.
Type string `pulumi:"type"`
// The validation state of the ASN associated with the peer.
ValidationState string `pulumi:"validationState"`
}
func LookupPeerAsnOutput(ctx *pulumi.Context, args LookupPeerAsnOutputArgs, opts ...pulumi.InvokeOption) LookupPeerAsnResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupPeerAsnResult, error) {
args := v.(LookupPeerAsnArgs)
r, err := LookupPeerAsn(ctx, &args, opts...)
var s LookupPeerAsnResult
if r != nil {
s = *r
}
return s, err
}).(LookupPeerAsnResultOutput)
}
type LookupPeerAsnOutputArgs struct {
// The peer ASN name.
PeerAsnName pulumi.StringInput `pulumi:"peerAsnName"`
}
func (LookupPeerAsnOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupPeerAsnArgs)(nil)).Elem()
}
// The essential information related to the peer's ASN.
type LookupPeerAsnResultOutput struct{ *pulumi.OutputState }
func (LookupPeerAsnResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupPeerAsnResult)(nil)).Elem()
}
func (o LookupPeerAsnResultOutput) ToLookupPeerAsnResultOutput() LookupPeerAsnResultOutput {
return o
}
func (o LookupPeerAsnResultOutput) ToLookupPeerAsnResultOutputWithContext(ctx context.Context) LookupPeerAsnResultOutput {
return o
}
// The error message for the validation state
func (o LookupPeerAsnResultOutput) ErrorMessage() pulumi.StringOutput {
return o.ApplyT(func(v LookupPeerAsnResult) string { return v.ErrorMessage }).(pulumi.StringOutput)
}
// The ID of the resource.
func (o LookupPeerAsnResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupPeerAsnResult) string { return v.Id }).(pulumi.StringOutput)
}
// The name of the resource.
func (o LookupPeerAsnResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupPeerAsnResult) string { return v.Name }).(pulumi.StringOutput)
}
// The Autonomous System Number (ASN) of the peer.
func (o LookupPeerAsnResultOutput) PeerAsn() pulumi.IntPtrOutput {
return o.ApplyT(func(v LookupPeerAsnResult) *int { return v.PeerAsn }).(pulumi.IntPtrOutput)
}
// The contact details of the peer.
func (o LookupPeerAsnResultOutput) PeerContactDetail() ContactDetailResponseArrayOutput {
return o.ApplyT(func(v LookupPeerAsnResult) []ContactDetailResponse { return v.PeerContactDetail }).(ContactDetailResponseArrayOutput)
}
// The name of the peer.
func (o LookupPeerAsnResultOutput) PeerName() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupPeerAsnResult) *string { return v.PeerName }).(pulumi.StringPtrOutput)
}
// The type of the resource.
func (o LookupPeerAsnResultOutput) Type() pulumi.StringOutput {
return o.ApplyT(func(v LookupPeerAsnResult) string { return v.Type }).(pulumi.StringOutput)
}
// The validation state of the ASN associated with the peer.
func (o LookupPeerAsnResultOutput) ValidationState() pulumi.StringOutput {
return o.ApplyT(func(v LookupPeerAsnResult) string { return v.ValidationState }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(LookupPeerAsnResultOutput{})
}