/
getService.go
241 lines (206 loc) · 10.3 KB
/
getService.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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package apimanagement
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Use this data source to access information about an existing API Management Service.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-azure/sdk/v4/go/azure/apimanagement"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := apimanagement.LookupService(ctx, &apimanagement.LookupServiceArgs{
// Name: "search-api",
// ResourceGroupName: "search-service",
// }, nil)
// if err != nil {
// return err
// }
// ctx.Export("apiManagementId", example.Id)
// return nil
// })
// }
// ```
func LookupService(ctx *pulumi.Context, args *LookupServiceArgs, opts ...pulumi.InvokeOption) (*LookupServiceResult, error) {
var rv LookupServiceResult
err := ctx.Invoke("azure:apimanagement/getService:getService", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getService.
type LookupServiceArgs struct {
// The name of the API Management service.
Name string `pulumi:"name"`
// The Name of the Resource Group in which the API Management Service exists.
ResourceGroupName string `pulumi:"resourceGroupName"`
}
// A collection of values returned by getService.
type LookupServiceResult struct {
// Zero or more `additionalLocation` blocks as defined below
AdditionalLocations []GetServiceAdditionalLocation `pulumi:"additionalLocations"`
// The URL for the Developer Portal associated with this API Management service.
DeveloperPortalUrl string `pulumi:"developerPortalUrl"`
// Gateway URL of the API Management service in the Region.
GatewayRegionalUrl string `pulumi:"gatewayRegionalUrl"`
// The URL for the API Management Service's Gateway.
GatewayUrl string `pulumi:"gatewayUrl"`
// A `hostnameConfiguration` block as defined below.
HostnameConfigurations []GetServiceHostnameConfiguration `pulumi:"hostnameConfigurations"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
// (Optional) An `identity` block as defined below.
Identities []GetServiceIdentity `pulumi:"identities"`
// The location name of the additional region among Azure Data center regions.
Location string `pulumi:"location"`
// The URL for the Management API.
ManagementApiUrl string `pulumi:"managementApiUrl"`
// Specifies the plan's pricing tier.
Name string `pulumi:"name"`
// The email address from which the notification will be sent.
NotificationSenderEmail string `pulumi:"notificationSenderEmail"`
// The URL of the Publisher Portal.
PortalUrl string `pulumi:"portalUrl"`
// Private IP addresses of the API Management service in the additional location, for instances using virtual network mode.
PrivateIpAddresses []string `pulumi:"privateIpAddresses"`
// ID of the standard SKU IPv4 Public IP. Available only for Premium SKU deployed in a virtual network.
PublicIpAddressId string `pulumi:"publicIpAddressId"`
// Public Static Load Balanced IP addresses of the API Management service in the additional location. Available only for Basic, Standard and Premium SKU.
PublicIpAddresses []string `pulumi:"publicIpAddresses"`
// The email of Publisher/Company of the API Management Service.
PublisherEmail string `pulumi:"publisherEmail"`
// The name of the Publisher/Company of the API Management Service.
PublisherName string `pulumi:"publisherName"`
ResourceGroupName string `pulumi:"resourceGroupName"`
// The SCM (Source Code Management) endpoint.
ScmUrl string `pulumi:"scmUrl"`
SkuName string `pulumi:"skuName"`
// A mapping of tags assigned to the resource.
Tags map[string]string `pulumi:"tags"`
}
func LookupServiceOutput(ctx *pulumi.Context, args LookupServiceOutputArgs, opts ...pulumi.InvokeOption) LookupServiceResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupServiceResult, error) {
args := v.(LookupServiceArgs)
r, err := LookupService(ctx, &args, opts...)
return *r, err
}).(LookupServiceResultOutput)
}
// A collection of arguments for invoking getService.
type LookupServiceOutputArgs struct {
// The name of the API Management service.
Name pulumi.StringInput `pulumi:"name"`
// The Name of the Resource Group in which the API Management Service exists.
ResourceGroupName pulumi.StringInput `pulumi:"resourceGroupName"`
}
func (LookupServiceOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupServiceArgs)(nil)).Elem()
}
// A collection of values returned by getService.
type LookupServiceResultOutput struct{ *pulumi.OutputState }
func (LookupServiceResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupServiceResult)(nil)).Elem()
}
func (o LookupServiceResultOutput) ToLookupServiceResultOutput() LookupServiceResultOutput {
return o
}
func (o LookupServiceResultOutput) ToLookupServiceResultOutputWithContext(ctx context.Context) LookupServiceResultOutput {
return o
}
// Zero or more `additionalLocation` blocks as defined below
func (o LookupServiceResultOutput) AdditionalLocations() GetServiceAdditionalLocationArrayOutput {
return o.ApplyT(func(v LookupServiceResult) []GetServiceAdditionalLocation { return v.AdditionalLocations }).(GetServiceAdditionalLocationArrayOutput)
}
// The URL for the Developer Portal associated with this API Management service.
func (o LookupServiceResultOutput) DeveloperPortalUrl() pulumi.StringOutput {
return o.ApplyT(func(v LookupServiceResult) string { return v.DeveloperPortalUrl }).(pulumi.StringOutput)
}
// Gateway URL of the API Management service in the Region.
func (o LookupServiceResultOutput) GatewayRegionalUrl() pulumi.StringOutput {
return o.ApplyT(func(v LookupServiceResult) string { return v.GatewayRegionalUrl }).(pulumi.StringOutput)
}
// The URL for the API Management Service's Gateway.
func (o LookupServiceResultOutput) GatewayUrl() pulumi.StringOutput {
return o.ApplyT(func(v LookupServiceResult) string { return v.GatewayUrl }).(pulumi.StringOutput)
}
// A `hostnameConfiguration` block as defined below.
func (o LookupServiceResultOutput) HostnameConfigurations() GetServiceHostnameConfigurationArrayOutput {
return o.ApplyT(func(v LookupServiceResult) []GetServiceHostnameConfiguration { return v.HostnameConfigurations }).(GetServiceHostnameConfigurationArrayOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o LookupServiceResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupServiceResult) string { return v.Id }).(pulumi.StringOutput)
}
// (Optional) An `identity` block as defined below.
func (o LookupServiceResultOutput) Identities() GetServiceIdentityArrayOutput {
return o.ApplyT(func(v LookupServiceResult) []GetServiceIdentity { return v.Identities }).(GetServiceIdentityArrayOutput)
}
// The location name of the additional region among Azure Data center regions.
func (o LookupServiceResultOutput) Location() pulumi.StringOutput {
return o.ApplyT(func(v LookupServiceResult) string { return v.Location }).(pulumi.StringOutput)
}
// The URL for the Management API.
func (o LookupServiceResultOutput) ManagementApiUrl() pulumi.StringOutput {
return o.ApplyT(func(v LookupServiceResult) string { return v.ManagementApiUrl }).(pulumi.StringOutput)
}
// Specifies the plan's pricing tier.
func (o LookupServiceResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupServiceResult) string { return v.Name }).(pulumi.StringOutput)
}
// The email address from which the notification will be sent.
func (o LookupServiceResultOutput) NotificationSenderEmail() pulumi.StringOutput {
return o.ApplyT(func(v LookupServiceResult) string { return v.NotificationSenderEmail }).(pulumi.StringOutput)
}
// The URL of the Publisher Portal.
func (o LookupServiceResultOutput) PortalUrl() pulumi.StringOutput {
return o.ApplyT(func(v LookupServiceResult) string { return v.PortalUrl }).(pulumi.StringOutput)
}
// Private IP addresses of the API Management service in the additional location, for instances using virtual network mode.
func (o LookupServiceResultOutput) PrivateIpAddresses() pulumi.StringArrayOutput {
return o.ApplyT(func(v LookupServiceResult) []string { return v.PrivateIpAddresses }).(pulumi.StringArrayOutput)
}
// ID of the standard SKU IPv4 Public IP. Available only for Premium SKU deployed in a virtual network.
func (o LookupServiceResultOutput) PublicIpAddressId() pulumi.StringOutput {
return o.ApplyT(func(v LookupServiceResult) string { return v.PublicIpAddressId }).(pulumi.StringOutput)
}
// Public Static Load Balanced IP addresses of the API Management service in the additional location. Available only for Basic, Standard and Premium SKU.
func (o LookupServiceResultOutput) PublicIpAddresses() pulumi.StringArrayOutput {
return o.ApplyT(func(v LookupServiceResult) []string { return v.PublicIpAddresses }).(pulumi.StringArrayOutput)
}
// The email of Publisher/Company of the API Management Service.
func (o LookupServiceResultOutput) PublisherEmail() pulumi.StringOutput {
return o.ApplyT(func(v LookupServiceResult) string { return v.PublisherEmail }).(pulumi.StringOutput)
}
// The name of the Publisher/Company of the API Management Service.
func (o LookupServiceResultOutput) PublisherName() pulumi.StringOutput {
return o.ApplyT(func(v LookupServiceResult) string { return v.PublisherName }).(pulumi.StringOutput)
}
func (o LookupServiceResultOutput) ResourceGroupName() pulumi.StringOutput {
return o.ApplyT(func(v LookupServiceResult) string { return v.ResourceGroupName }).(pulumi.StringOutput)
}
// The SCM (Source Code Management) endpoint.
func (o LookupServiceResultOutput) ScmUrl() pulumi.StringOutput {
return o.ApplyT(func(v LookupServiceResult) string { return v.ScmUrl }).(pulumi.StringOutput)
}
func (o LookupServiceResultOutput) SkuName() pulumi.StringOutput {
return o.ApplyT(func(v LookupServiceResult) string { return v.SkuName }).(pulumi.StringOutput)
}
// A mapping of tags assigned to the resource.
func (o LookupServiceResultOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v LookupServiceResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput)
}
func init() {
pulumi.RegisterOutputType(LookupServiceResultOutput{})
}