/
getQuotasetV3.go
186 lines (161 loc) · 6.53 KB
/
getQuotasetV3.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
// 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 blockstorage
import (
"context"
"reflect"
"github.com/pulumi/pulumi-openstack/sdk/v3/go/openstack/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Use this data source to get the blockstorage quotaset v3 of an OpenStack project.
//
// ## Example Usage
//
// <!--Start PulumiCodeChooser -->
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-openstack/sdk/v3/go/openstack/blockstorage"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := blockstorage.GetQuotasetV3(ctx, &blockstorage.GetQuotasetV3Args{
// ProjectId: "2e367a3d29f94fd988e6ec54e305ec9d",
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// <!--End PulumiCodeChooser -->
func GetQuotasetV3(ctx *pulumi.Context, args *GetQuotasetV3Args, opts ...pulumi.InvokeOption) (*GetQuotasetV3Result, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv GetQuotasetV3Result
err := ctx.Invoke("openstack:blockstorage/getQuotasetV3:getQuotasetV3", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getQuotasetV3.
type GetQuotasetV3Args struct {
// The id of the project to retrieve the quotaset.
ProjectId string `pulumi:"projectId"`
// The region in which to obtain the V3 Blockstorage client.
// If omitted, the `region` argument of the provider is used.
Region *string `pulumi:"region"`
}
// A collection of values returned by getQuotasetV3.
type GetQuotasetV3Result struct {
// The size (GB) of backups that are allowed.
BackupGigabytes int `pulumi:"backupGigabytes"`
// The number of backups that are allowed.
Backups int `pulumi:"backups"`
// The size (GB) of volumes and snapshots that are allowed.
Gigabytes int `pulumi:"gigabytes"`
// The number of groups that are allowed.
Groups int `pulumi:"groups"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
// The size (GB) of volumes that are allowed for each volume.
PerVolumeGigabytes int `pulumi:"perVolumeGigabytes"`
// See Argument Reference above.
ProjectId string `pulumi:"projectId"`
// See Argument Reference above.
Region string `pulumi:"region"`
// The number of snapshots that are allowed.
Snapshots int `pulumi:"snapshots"`
// Map with gigabytes_{volume_type}, snapshots_{volume_type}, volumes_{volume_type} for each volume type.
VolumeTypeQuota map[string]interface{} `pulumi:"volumeTypeQuota"`
// The number of volumes that are allowed.
Volumes int `pulumi:"volumes"`
}
func GetQuotasetV3Output(ctx *pulumi.Context, args GetQuotasetV3OutputArgs, opts ...pulumi.InvokeOption) GetQuotasetV3ResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (GetQuotasetV3Result, error) {
args := v.(GetQuotasetV3Args)
r, err := GetQuotasetV3(ctx, &args, opts...)
var s GetQuotasetV3Result
if r != nil {
s = *r
}
return s, err
}).(GetQuotasetV3ResultOutput)
}
// A collection of arguments for invoking getQuotasetV3.
type GetQuotasetV3OutputArgs struct {
// The id of the project to retrieve the quotaset.
ProjectId pulumi.StringInput `pulumi:"projectId"`
// The region in which to obtain the V3 Blockstorage client.
// If omitted, the `region` argument of the provider is used.
Region pulumi.StringPtrInput `pulumi:"region"`
}
func (GetQuotasetV3OutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*GetQuotasetV3Args)(nil)).Elem()
}
// A collection of values returned by getQuotasetV3.
type GetQuotasetV3ResultOutput struct{ *pulumi.OutputState }
func (GetQuotasetV3ResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*GetQuotasetV3Result)(nil)).Elem()
}
func (o GetQuotasetV3ResultOutput) ToGetQuotasetV3ResultOutput() GetQuotasetV3ResultOutput {
return o
}
func (o GetQuotasetV3ResultOutput) ToGetQuotasetV3ResultOutputWithContext(ctx context.Context) GetQuotasetV3ResultOutput {
return o
}
// The size (GB) of backups that are allowed.
func (o GetQuotasetV3ResultOutput) BackupGigabytes() pulumi.IntOutput {
return o.ApplyT(func(v GetQuotasetV3Result) int { return v.BackupGigabytes }).(pulumi.IntOutput)
}
// The number of backups that are allowed.
func (o GetQuotasetV3ResultOutput) Backups() pulumi.IntOutput {
return o.ApplyT(func(v GetQuotasetV3Result) int { return v.Backups }).(pulumi.IntOutput)
}
// The size (GB) of volumes and snapshots that are allowed.
func (o GetQuotasetV3ResultOutput) Gigabytes() pulumi.IntOutput {
return o.ApplyT(func(v GetQuotasetV3Result) int { return v.Gigabytes }).(pulumi.IntOutput)
}
// The number of groups that are allowed.
func (o GetQuotasetV3ResultOutput) Groups() pulumi.IntOutput {
return o.ApplyT(func(v GetQuotasetV3Result) int { return v.Groups }).(pulumi.IntOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o GetQuotasetV3ResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v GetQuotasetV3Result) string { return v.Id }).(pulumi.StringOutput)
}
// The size (GB) of volumes that are allowed for each volume.
func (o GetQuotasetV3ResultOutput) PerVolumeGigabytes() pulumi.IntOutput {
return o.ApplyT(func(v GetQuotasetV3Result) int { return v.PerVolumeGigabytes }).(pulumi.IntOutput)
}
// See Argument Reference above.
func (o GetQuotasetV3ResultOutput) ProjectId() pulumi.StringOutput {
return o.ApplyT(func(v GetQuotasetV3Result) string { return v.ProjectId }).(pulumi.StringOutput)
}
// See Argument Reference above.
func (o GetQuotasetV3ResultOutput) Region() pulumi.StringOutput {
return o.ApplyT(func(v GetQuotasetV3Result) string { return v.Region }).(pulumi.StringOutput)
}
// The number of snapshots that are allowed.
func (o GetQuotasetV3ResultOutput) Snapshots() pulumi.IntOutput {
return o.ApplyT(func(v GetQuotasetV3Result) int { return v.Snapshots }).(pulumi.IntOutput)
}
// Map with gigabytes_{volume_type}, snapshots_{volume_type}, volumes_{volume_type} for each volume type.
func (o GetQuotasetV3ResultOutput) VolumeTypeQuota() pulumi.MapOutput {
return o.ApplyT(func(v GetQuotasetV3Result) map[string]interface{} { return v.VolumeTypeQuota }).(pulumi.MapOutput)
}
// The number of volumes that are allowed.
func (o GetQuotasetV3ResultOutput) Volumes() pulumi.IntOutput {
return o.ApplyT(func(v GetQuotasetV3Result) int { return v.Volumes }).(pulumi.IntOutput)
}
func init() {
pulumi.RegisterOutputType(GetQuotasetV3ResultOutput{})
}