-
Notifications
You must be signed in to change notification settings - Fork 8
/
project.go
195 lines (182 loc) · 6.34 KB
/
project.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
// *** 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 identity
import (
"reflect"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// Manages a V3 Project resource within OpenStack Keystone.
//
// Note: You _must_ have admin privileges in your OpenStack cloud to use
// this resource.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-openstack/sdk/v2/go/openstack/identity"
// "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := identity.NewProject(ctx, "project1", &identity.ProjectArgs{
// Description: pulumi.String("A project"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
type Project struct {
pulumi.CustomResourceState
// A description of the project.
Description pulumi.StringPtrOutput `pulumi:"description"`
// The domain this project belongs to.
DomainId pulumi.StringOutput `pulumi:"domainId"`
// Whether the project is enabled or disabled. Valid
// values are `true` and `false`.
Enabled pulumi.BoolPtrOutput `pulumi:"enabled"`
// Whether this project is a domain. Valid values
// are `true` and `false`.
IsDomain pulumi.BoolPtrOutput `pulumi:"isDomain"`
// The name of the project.
Name pulumi.StringOutput `pulumi:"name"`
// The parent of this project.
ParentId pulumi.StringOutput `pulumi:"parentId"`
// The region in which to obtain the V3 Keystone client.
// If omitted, the `region` argument of the provider is used. Changing this
// creates a new project.
Region pulumi.StringOutput `pulumi:"region"`
// Tags for the project. Changing this updates the existing
// project.
Tags pulumi.StringArrayOutput `pulumi:"tags"`
}
// NewProject registers a new resource with the given unique name, arguments, and options.
func NewProject(ctx *pulumi.Context,
name string, args *ProjectArgs, opts ...pulumi.ResourceOption) (*Project, error) {
if args == nil {
args = &ProjectArgs{}
}
var resource Project
err := ctx.RegisterResource("openstack:identity/project:Project", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetProject gets an existing Project resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetProject(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *ProjectState, opts ...pulumi.ResourceOption) (*Project, error) {
var resource Project
err := ctx.ReadResource("openstack:identity/project:Project", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Project resources.
type projectState struct {
// A description of the project.
Description *string `pulumi:"description"`
// The domain this project belongs to.
DomainId *string `pulumi:"domainId"`
// Whether the project is enabled or disabled. Valid
// values are `true` and `false`.
Enabled *bool `pulumi:"enabled"`
// Whether this project is a domain. Valid values
// are `true` and `false`.
IsDomain *bool `pulumi:"isDomain"`
// The name of the project.
Name *string `pulumi:"name"`
// The parent of this project.
ParentId *string `pulumi:"parentId"`
// The region in which to obtain the V3 Keystone client.
// If omitted, the `region` argument of the provider is used. Changing this
// creates a new project.
Region *string `pulumi:"region"`
// Tags for the project. Changing this updates the existing
// project.
Tags []string `pulumi:"tags"`
}
type ProjectState struct {
// A description of the project.
Description pulumi.StringPtrInput
// The domain this project belongs to.
DomainId pulumi.StringPtrInput
// Whether the project is enabled or disabled. Valid
// values are `true` and `false`.
Enabled pulumi.BoolPtrInput
// Whether this project is a domain. Valid values
// are `true` and `false`.
IsDomain pulumi.BoolPtrInput
// The name of the project.
Name pulumi.StringPtrInput
// The parent of this project.
ParentId pulumi.StringPtrInput
// The region in which to obtain the V3 Keystone client.
// If omitted, the `region` argument of the provider is used. Changing this
// creates a new project.
Region pulumi.StringPtrInput
// Tags for the project. Changing this updates the existing
// project.
Tags pulumi.StringArrayInput
}
func (ProjectState) ElementType() reflect.Type {
return reflect.TypeOf((*projectState)(nil)).Elem()
}
type projectArgs struct {
// A description of the project.
Description *string `pulumi:"description"`
// The domain this project belongs to.
DomainId *string `pulumi:"domainId"`
// Whether the project is enabled or disabled. Valid
// values are `true` and `false`.
Enabled *bool `pulumi:"enabled"`
// Whether this project is a domain. Valid values
// are `true` and `false`.
IsDomain *bool `pulumi:"isDomain"`
// The name of the project.
Name *string `pulumi:"name"`
// The parent of this project.
ParentId *string `pulumi:"parentId"`
// The region in which to obtain the V3 Keystone client.
// If omitted, the `region` argument of the provider is used. Changing this
// creates a new project.
Region *string `pulumi:"region"`
// Tags for the project. Changing this updates the existing
// project.
Tags []string `pulumi:"tags"`
}
// The set of arguments for constructing a Project resource.
type ProjectArgs struct {
// A description of the project.
Description pulumi.StringPtrInput
// The domain this project belongs to.
DomainId pulumi.StringPtrInput
// Whether the project is enabled or disabled. Valid
// values are `true` and `false`.
Enabled pulumi.BoolPtrInput
// Whether this project is a domain. Valid values
// are `true` and `false`.
IsDomain pulumi.BoolPtrInput
// The name of the project.
Name pulumi.StringPtrInput
// The parent of this project.
ParentId pulumi.StringPtrInput
// The region in which to obtain the V3 Keystone client.
// If omitted, the `region` argument of the provider is used. Changing this
// creates a new project.
Region pulumi.StringPtrInput
// Tags for the project. Changing this updates the existing
// project.
Tags pulumi.StringArrayInput
}
func (ProjectArgs) ElementType() reflect.Type {
return reflect.TypeOf((*projectArgs)(nil)).Elem()
}