/
dpmHostOverride.go
153 lines (139 loc) · 5.74 KB
/
dpmHostOverride.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
// *** 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! ***
// nolint: lll
package vsphere
import (
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/go/pulumi"
)
// The `.DpmHostOverride` resource can be used to add a DPM override to a
// cluster for a particular host. This allows you to control the power management
// settings for individual hosts in the cluster while leaving any unspecified ones
// at the default power management settings.
//
// For more information on DPM within vSphere clusters, see [this
// page][ref-vsphere-cluster-dpm].
//
// [ref-vsphere-cluster-dpm]: https://docs.vmware.com/en/VMware-vSphere/6.5/com.vmware.vsphere.resmgmt.doc/GUID-5E5E349A-4644-4C9C-B434-1C0243EBDC80.html
//
// > **NOTE:** This resource requires vCenter and is not available on direct ESXi
// connections.
//
// > **NOTE:** vSphere DRS requires a vSphere Enterprise Plus license.
//
// > This content is derived from https://github.com/terraform-providers/terraform-provider-vsphere/blob/master/website/docs/r/dpm_host_override.html.markdown.
type DpmHostOverride struct {
pulumi.CustomResourceState
// The [managed object reference
// ID][docs-about-morefs] of the cluster to put the override in. Forces a new
// resource if changed.
ComputeClusterId pulumi.StringOutput `pulumi:"computeClusterId"`
// The automation level for host power
// operations on this host. Can be one of `manual` or `automated`. Default:
// `manual`.
DpmAutomationLevel pulumi.StringPtrOutput `pulumi:"dpmAutomationLevel"`
// Enable DPM support for this host. Default:
// `false`.
DpmEnabled pulumi.BoolPtrOutput `pulumi:"dpmEnabled"`
// The managed object ID of the host.
HostSystemId pulumi.StringOutput `pulumi:"hostSystemId"`
}
// NewDpmHostOverride registers a new resource with the given unique name, arguments, and options.
func NewDpmHostOverride(ctx *pulumi.Context,
name string, args *DpmHostOverrideArgs, opts ...pulumi.ResourceOption) (*DpmHostOverride, error) {
if args == nil || args.ComputeClusterId == nil {
return nil, errors.New("missing required argument 'ComputeClusterId'")
}
if args == nil || args.HostSystemId == nil {
return nil, errors.New("missing required argument 'HostSystemId'")
}
if args == nil {
args = &DpmHostOverrideArgs{}
}
var resource DpmHostOverride
err := ctx.RegisterResource("vsphere:index/dpmHostOverride:DpmHostOverride", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetDpmHostOverride gets an existing DpmHostOverride 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 GetDpmHostOverride(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *DpmHostOverrideState, opts ...pulumi.ResourceOption) (*DpmHostOverride, error) {
var resource DpmHostOverride
err := ctx.ReadResource("vsphere:index/dpmHostOverride:DpmHostOverride", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering DpmHostOverride resources.
type dpmHostOverrideState struct {
// The [managed object reference
// ID][docs-about-morefs] of the cluster to put the override in. Forces a new
// resource if changed.
ComputeClusterId *string `pulumi:"computeClusterId"`
// The automation level for host power
// operations on this host. Can be one of `manual` or `automated`. Default:
// `manual`.
DpmAutomationLevel *string `pulumi:"dpmAutomationLevel"`
// Enable DPM support for this host. Default:
// `false`.
DpmEnabled *bool `pulumi:"dpmEnabled"`
// The managed object ID of the host.
HostSystemId *string `pulumi:"hostSystemId"`
}
type DpmHostOverrideState struct {
// The [managed object reference
// ID][docs-about-morefs] of the cluster to put the override in. Forces a new
// resource if changed.
ComputeClusterId pulumi.StringPtrInput
// The automation level for host power
// operations on this host. Can be one of `manual` or `automated`. Default:
// `manual`.
DpmAutomationLevel pulumi.StringPtrInput
// Enable DPM support for this host. Default:
// `false`.
DpmEnabled pulumi.BoolPtrInput
// The managed object ID of the host.
HostSystemId pulumi.StringPtrInput
}
func (DpmHostOverrideState) ElementType() reflect.Type {
return reflect.TypeOf((*dpmHostOverrideState)(nil)).Elem()
}
type dpmHostOverrideArgs struct {
// The [managed object reference
// ID][docs-about-morefs] of the cluster to put the override in. Forces a new
// resource if changed.
ComputeClusterId string `pulumi:"computeClusterId"`
// The automation level for host power
// operations on this host. Can be one of `manual` or `automated`. Default:
// `manual`.
DpmAutomationLevel *string `pulumi:"dpmAutomationLevel"`
// Enable DPM support for this host. Default:
// `false`.
DpmEnabled *bool `pulumi:"dpmEnabled"`
// The managed object ID of the host.
HostSystemId string `pulumi:"hostSystemId"`
}
// The set of arguments for constructing a DpmHostOverride resource.
type DpmHostOverrideArgs struct {
// The [managed object reference
// ID][docs-about-morefs] of the cluster to put the override in. Forces a new
// resource if changed.
ComputeClusterId pulumi.StringInput
// The automation level for host power
// operations on this host. Can be one of `manual` or `automated`. Default:
// `manual`.
DpmAutomationLevel pulumi.StringPtrInput
// Enable DPM support for this host. Default:
// `false`.
DpmEnabled pulumi.BoolPtrInput
// The managed object ID of the host.
HostSystemId pulumi.StringInput
}
func (DpmHostOverrideArgs) ElementType() reflect.Type {
return reflect.TypeOf((*dpmHostOverrideArgs)(nil)).Elem()
}