generated from pulumi/pulumi-tf-provider-boilerplate
/
getServices.go
130 lines (112 loc) · 4.09 KB
/
getServices.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
// 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 limits
import (
"context"
"reflect"
"github.com/pulumi/pulumi-oci/sdk/go/oci/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// This data source provides the list of Services in Oracle Cloud Infrastructure Limits service.
//
// Returns the list of supported services.
// This includes the programmatic service name, along with the friendly service name.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-oci/sdk/go/oci/Limits"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := Limits.GetServices(ctx, &limits.GetServicesArgs{
// CompartmentId: tenancyOcid,
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
func GetServices(ctx *pulumi.Context, args *GetServicesArgs, opts ...pulumi.InvokeOption) (*GetServicesResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv GetServicesResult
err := ctx.Invoke("oci:Limits/getServices:getServices", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getServices.
type GetServicesArgs struct {
// The OCID of the parent compartment (remember that the tenancy is simply the root compartment).
CompartmentId string `pulumi:"compartmentId"`
Filters []GetServicesFilter `pulumi:"filters"`
}
// A collection of values returned by getServices.
type GetServicesResult struct {
CompartmentId string `pulumi:"compartmentId"`
Filters []GetServicesFilter `pulumi:"filters"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
// The list of services.
Services []GetServicesService `pulumi:"services"`
}
func GetServicesOutput(ctx *pulumi.Context, args GetServicesOutputArgs, opts ...pulumi.InvokeOption) GetServicesResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (GetServicesResult, error) {
args := v.(GetServicesArgs)
r, err := GetServices(ctx, &args, opts...)
var s GetServicesResult
if r != nil {
s = *r
}
return s, err
}).(GetServicesResultOutput)
}
// A collection of arguments for invoking getServices.
type GetServicesOutputArgs struct {
// The OCID of the parent compartment (remember that the tenancy is simply the root compartment).
CompartmentId pulumi.StringInput `pulumi:"compartmentId"`
Filters GetServicesFilterArrayInput `pulumi:"filters"`
}
func (GetServicesOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*GetServicesArgs)(nil)).Elem()
}
// A collection of values returned by getServices.
type GetServicesResultOutput struct{ *pulumi.OutputState }
func (GetServicesResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*GetServicesResult)(nil)).Elem()
}
func (o GetServicesResultOutput) ToGetServicesResultOutput() GetServicesResultOutput {
return o
}
func (o GetServicesResultOutput) ToGetServicesResultOutputWithContext(ctx context.Context) GetServicesResultOutput {
return o
}
func (o GetServicesResultOutput) CompartmentId() pulumi.StringOutput {
return o.ApplyT(func(v GetServicesResult) string { return v.CompartmentId }).(pulumi.StringOutput)
}
func (o GetServicesResultOutput) Filters() GetServicesFilterArrayOutput {
return o.ApplyT(func(v GetServicesResult) []GetServicesFilter { return v.Filters }).(GetServicesFilterArrayOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o GetServicesResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v GetServicesResult) string { return v.Id }).(pulumi.StringOutput)
}
// The list of services.
func (o GetServicesResultOutput) Services() GetServicesServiceArrayOutput {
return o.ApplyT(func(v GetServicesResult) []GetServicesService { return v.Services }).(GetServicesServiceArrayOutput)
}
func init() {
pulumi.RegisterOutputType(GetServicesResultOutput{})
}