This repository has been archived by the owner on Mar 11, 2021. It is now read-only.
/
backupSchedule.go
234 lines (210 loc) · 7.98 KB
/
backupSchedule.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
// *** WARNING: this file was generated by the Pulumi SDK Generator. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package v20170601
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// The backup schedule.
type BackupSchedule struct {
pulumi.CustomResourceState
// The type of backup which needs to be taken.
BackupType pulumi.StringOutput `pulumi:"backupType"`
// The Kind of the object. Currently only Series8000 is supported
Kind pulumi.StringPtrOutput `pulumi:"kind"`
// The last successful backup run which was triggered for the schedule.
LastSuccessfulRun pulumi.StringOutput `pulumi:"lastSuccessfulRun"`
// The name of the object.
Name pulumi.StringOutput `pulumi:"name"`
// The number of backups to be retained.
RetentionCount pulumi.Float64Output `pulumi:"retentionCount"`
// The schedule recurrence.
ScheduleRecurrence ScheduleRecurrenceResponseOutput `pulumi:"scheduleRecurrence"`
// The schedule status.
ScheduleStatus pulumi.StringOutput `pulumi:"scheduleStatus"`
// The start time of the schedule.
StartTime pulumi.StringOutput `pulumi:"startTime"`
// The hierarchical type of the object.
Type pulumi.StringOutput `pulumi:"type"`
}
// NewBackupSchedule registers a new resource with the given unique name, arguments, and options.
func NewBackupSchedule(ctx *pulumi.Context,
name string, args *BackupScheduleArgs, opts ...pulumi.ResourceOption) (*BackupSchedule, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.BackupPolicyName == nil {
return nil, errors.New("invalid value for required argument 'BackupPolicyName'")
}
if args.BackupScheduleName == nil {
return nil, errors.New("invalid value for required argument 'BackupScheduleName'")
}
if args.DeviceName == nil {
return nil, errors.New("invalid value for required argument 'DeviceName'")
}
if args.ManagerName == nil {
return nil, errors.New("invalid value for required argument 'ManagerName'")
}
if args.ResourceGroupName == nil {
return nil, errors.New("invalid value for required argument 'ResourceGroupName'")
}
if args.RetentionCount == nil {
return nil, errors.New("invalid value for required argument 'RetentionCount'")
}
if args.ScheduleRecurrence == nil {
return nil, errors.New("invalid value for required argument 'ScheduleRecurrence'")
}
if args.StartTime == nil {
return nil, errors.New("invalid value for required argument 'StartTime'")
}
aliases := pulumi.Aliases([]pulumi.Alias{
{
Type: pulumi.String("azure-nextgen:storsimple/latest:BackupSchedule"),
},
})
opts = append(opts, aliases)
var resource BackupSchedule
err := ctx.RegisterResource("azure-nextgen:storsimple/v20170601:BackupSchedule", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetBackupSchedule gets an existing BackupSchedule 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 GetBackupSchedule(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *BackupScheduleState, opts ...pulumi.ResourceOption) (*BackupSchedule, error) {
var resource BackupSchedule
err := ctx.ReadResource("azure-nextgen:storsimple/v20170601:BackupSchedule", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering BackupSchedule resources.
type backupScheduleState struct {
// The type of backup which needs to be taken.
BackupType *string `pulumi:"backupType"`
// The Kind of the object. Currently only Series8000 is supported
Kind *string `pulumi:"kind"`
// The last successful backup run which was triggered for the schedule.
LastSuccessfulRun *string `pulumi:"lastSuccessfulRun"`
// The name of the object.
Name *string `pulumi:"name"`
// The number of backups to be retained.
RetentionCount *float64 `pulumi:"retentionCount"`
// The schedule recurrence.
ScheduleRecurrence *ScheduleRecurrenceResponse `pulumi:"scheduleRecurrence"`
// The schedule status.
ScheduleStatus *string `pulumi:"scheduleStatus"`
// The start time of the schedule.
StartTime *string `pulumi:"startTime"`
// The hierarchical type of the object.
Type *string `pulumi:"type"`
}
type BackupScheduleState struct {
// The type of backup which needs to be taken.
BackupType pulumi.StringPtrInput
// The Kind of the object. Currently only Series8000 is supported
Kind pulumi.StringPtrInput
// The last successful backup run which was triggered for the schedule.
LastSuccessfulRun pulumi.StringPtrInput
// The name of the object.
Name pulumi.StringPtrInput
// The number of backups to be retained.
RetentionCount pulumi.Float64PtrInput
// The schedule recurrence.
ScheduleRecurrence ScheduleRecurrenceResponsePtrInput
// The schedule status.
ScheduleStatus pulumi.StringPtrInput
// The start time of the schedule.
StartTime pulumi.StringPtrInput
// The hierarchical type of the object.
Type pulumi.StringPtrInput
}
func (BackupScheduleState) ElementType() reflect.Type {
return reflect.TypeOf((*backupScheduleState)(nil)).Elem()
}
type backupScheduleArgs struct {
// The backup policy name.
BackupPolicyName string `pulumi:"backupPolicyName"`
// The backup schedule name.
BackupScheduleName string `pulumi:"backupScheduleName"`
// The type of backup which needs to be taken.
BackupType string `pulumi:"backupType"`
// The device name
DeviceName string `pulumi:"deviceName"`
// The Kind of the object. Currently only Series8000 is supported
Kind *string `pulumi:"kind"`
// The manager name
ManagerName string `pulumi:"managerName"`
// The resource group name
ResourceGroupName string `pulumi:"resourceGroupName"`
// The number of backups to be retained.
RetentionCount float64 `pulumi:"retentionCount"`
// The schedule recurrence.
ScheduleRecurrence ScheduleRecurrence `pulumi:"scheduleRecurrence"`
// The schedule status.
ScheduleStatus string `pulumi:"scheduleStatus"`
// The start time of the schedule.
StartTime string `pulumi:"startTime"`
}
// The set of arguments for constructing a BackupSchedule resource.
type BackupScheduleArgs struct {
// The backup policy name.
BackupPolicyName pulumi.StringInput
// The backup schedule name.
BackupScheduleName pulumi.StringInput
// The type of backup which needs to be taken.
BackupType BackupType
// The device name
DeviceName pulumi.StringInput
// The Kind of the object. Currently only Series8000 is supported
Kind *Kind
// The manager name
ManagerName pulumi.StringInput
// The resource group name
ResourceGroupName pulumi.StringInput
// The number of backups to be retained.
RetentionCount pulumi.Float64Input
// The schedule recurrence.
ScheduleRecurrence ScheduleRecurrenceInput
// The schedule status.
ScheduleStatus ScheduleStatus
// The start time of the schedule.
StartTime pulumi.StringInput
}
func (BackupScheduleArgs) ElementType() reflect.Type {
return reflect.TypeOf((*backupScheduleArgs)(nil)).Elem()
}
type BackupScheduleInput interface {
pulumi.Input
ToBackupScheduleOutput() BackupScheduleOutput
ToBackupScheduleOutputWithContext(ctx context.Context) BackupScheduleOutput
}
func (*BackupSchedule) ElementType() reflect.Type {
return reflect.TypeOf((*BackupSchedule)(nil))
}
func (i *BackupSchedule) ToBackupScheduleOutput() BackupScheduleOutput {
return i.ToBackupScheduleOutputWithContext(context.Background())
}
func (i *BackupSchedule) ToBackupScheduleOutputWithContext(ctx context.Context) BackupScheduleOutput {
return pulumi.ToOutputWithContext(ctx, i).(BackupScheduleOutput)
}
type BackupScheduleOutput struct {
*pulumi.OutputState
}
func (BackupScheduleOutput) ElementType() reflect.Type {
return reflect.TypeOf((*BackupSchedule)(nil))
}
func (o BackupScheduleOutput) ToBackupScheduleOutput() BackupScheduleOutput {
return o
}
func (o BackupScheduleOutput) ToBackupScheduleOutputWithContext(ctx context.Context) BackupScheduleOutput {
return o
}
func init() {
pulumi.RegisterOutputType(BackupScheduleOutput{})
}