/
db_system_upgrade_history_entry.go
177 lines (145 loc) · 8.94 KB
/
db_system_upgrade_history_entry.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
// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved.
// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
// Code generated. DO NOT EDIT.
// Database Service API
//
// The API for the Database Service. Use this API to manage resources such as databases and DB Systems. For more information, see Overview of the Database Service (https://docs.cloud.oracle.com/iaas/Content/Database/Concepts/databaseoverview.htm).
//
package database
import (
"fmt"
"github.com/oracle/oci-go-sdk/v65/common"
"strings"
)
// DbSystemUpgradeHistoryEntry The record of an OS upgrade action on a DB system.
// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API.
type DbSystemUpgradeHistoryEntry struct {
// The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the upgrade history entry.
Id *string `mandatory:"true" json:"id"`
// The operating system upgrade action.
Action DbSystemUpgradeHistoryEntryActionEnum `mandatory:"true" json:"action"`
// The retention period, in days, for the snapshot that allows you to perform a rollback of the upgrade operation. After this number of days passes, you cannot roll back the upgrade.
SnapshotRetentionPeriodInDays *int `mandatory:"true" json:"snapshotRetentionPeriodInDays"`
// The current state of the action.
LifecycleState DbSystemUpgradeHistoryEntryLifecycleStateEnum `mandatory:"true" json:"lifecycleState"`
// The date and time when the upgrade action started.
TimeStarted *common.SDKTime `mandatory:"true" json:"timeStarted"`
// A valid Oracle Grid Infrastructure (GI) software version.
NewGiVersion *string `mandatory:"false" json:"newGiVersion"`
// A valid Oracle Grid Infrastructure (GI) software version.
OldGiVersion *string `mandatory:"false" json:"oldGiVersion"`
// A valid Oracle Software (OS) version eg. Oracle Linux Server release 8
OldOsVersion *string `mandatory:"false" json:"oldOsVersion"`
// A valid Oracle Software (OS) version eg. Oracle Linux Server release 8
NewOsVersion *string `mandatory:"false" json:"newOsVersion"`
// A descriptive text associated with the lifecycleState.
// Typically contains additional displayable text.
LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"`
// The date and time when the upgrade action completed
TimeEnded *common.SDKTime `mandatory:"false" json:"timeEnded"`
}
func (m DbSystemUpgradeHistoryEntry) String() string {
return common.PointerString(m)
}
// ValidateEnumValue returns an error when providing an unsupported enum value
// This function is being called during constructing API request process
// Not recommended for calling this function directly
func (m DbSystemUpgradeHistoryEntry) ValidateEnumValue() (bool, error) {
errMessage := []string{}
if _, ok := GetMappingDbSystemUpgradeHistoryEntryActionEnum(string(m.Action)); !ok && m.Action != "" {
errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Action: %s. Supported values are: %s.", m.Action, strings.Join(GetDbSystemUpgradeHistoryEntryActionEnumStringValues(), ",")))
}
if _, ok := GetMappingDbSystemUpgradeHistoryEntryLifecycleStateEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" {
errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetDbSystemUpgradeHistoryEntryLifecycleStateEnumStringValues(), ",")))
}
if len(errMessage) > 0 {
return true, fmt.Errorf(strings.Join(errMessage, "\n"))
}
return false, nil
}
// DbSystemUpgradeHistoryEntryActionEnum Enum with underlying type: string
type DbSystemUpgradeHistoryEntryActionEnum string
// Set of constants representing the allowable values for DbSystemUpgradeHistoryEntryActionEnum
const (
DbSystemUpgradeHistoryEntryActionPrecheck DbSystemUpgradeHistoryEntryActionEnum = "PRECHECK"
DbSystemUpgradeHistoryEntryActionRollback DbSystemUpgradeHistoryEntryActionEnum = "ROLLBACK"
DbSystemUpgradeHistoryEntryActionUpdateSnapshotRetentionDays DbSystemUpgradeHistoryEntryActionEnum = "UPDATE_SNAPSHOT_RETENTION_DAYS"
DbSystemUpgradeHistoryEntryActionUpgrade DbSystemUpgradeHistoryEntryActionEnum = "UPGRADE"
)
var mappingDbSystemUpgradeHistoryEntryActionEnum = map[string]DbSystemUpgradeHistoryEntryActionEnum{
"PRECHECK": DbSystemUpgradeHistoryEntryActionPrecheck,
"ROLLBACK": DbSystemUpgradeHistoryEntryActionRollback,
"UPDATE_SNAPSHOT_RETENTION_DAYS": DbSystemUpgradeHistoryEntryActionUpdateSnapshotRetentionDays,
"UPGRADE": DbSystemUpgradeHistoryEntryActionUpgrade,
}
var mappingDbSystemUpgradeHistoryEntryActionEnumLowerCase = map[string]DbSystemUpgradeHistoryEntryActionEnum{
"precheck": DbSystemUpgradeHistoryEntryActionPrecheck,
"rollback": DbSystemUpgradeHistoryEntryActionRollback,
"update_snapshot_retention_days": DbSystemUpgradeHistoryEntryActionUpdateSnapshotRetentionDays,
"upgrade": DbSystemUpgradeHistoryEntryActionUpgrade,
}
// GetDbSystemUpgradeHistoryEntryActionEnumValues Enumerates the set of values for DbSystemUpgradeHistoryEntryActionEnum
func GetDbSystemUpgradeHistoryEntryActionEnumValues() []DbSystemUpgradeHistoryEntryActionEnum {
values := make([]DbSystemUpgradeHistoryEntryActionEnum, 0)
for _, v := range mappingDbSystemUpgradeHistoryEntryActionEnum {
values = append(values, v)
}
return values
}
// GetDbSystemUpgradeHistoryEntryActionEnumStringValues Enumerates the set of values in String for DbSystemUpgradeHistoryEntryActionEnum
func GetDbSystemUpgradeHistoryEntryActionEnumStringValues() []string {
return []string{
"PRECHECK",
"ROLLBACK",
"UPDATE_SNAPSHOT_RETENTION_DAYS",
"UPGRADE",
}
}
// GetMappingDbSystemUpgradeHistoryEntryActionEnum performs case Insensitive comparison on enum value and return the desired enum
func GetMappingDbSystemUpgradeHistoryEntryActionEnum(val string) (DbSystemUpgradeHistoryEntryActionEnum, bool) {
enum, ok := mappingDbSystemUpgradeHistoryEntryActionEnumLowerCase[strings.ToLower(val)]
return enum, ok
}
// DbSystemUpgradeHistoryEntryLifecycleStateEnum Enum with underlying type: string
type DbSystemUpgradeHistoryEntryLifecycleStateEnum string
// Set of constants representing the allowable values for DbSystemUpgradeHistoryEntryLifecycleStateEnum
const (
DbSystemUpgradeHistoryEntryLifecycleStateInProgress DbSystemUpgradeHistoryEntryLifecycleStateEnum = "IN_PROGRESS"
DbSystemUpgradeHistoryEntryLifecycleStateSucceeded DbSystemUpgradeHistoryEntryLifecycleStateEnum = "SUCCEEDED"
DbSystemUpgradeHistoryEntryLifecycleStateFailed DbSystemUpgradeHistoryEntryLifecycleStateEnum = "FAILED"
DbSystemUpgradeHistoryEntryLifecycleStateNeedsAttention DbSystemUpgradeHistoryEntryLifecycleStateEnum = "NEEDS_ATTENTION"
)
var mappingDbSystemUpgradeHistoryEntryLifecycleStateEnum = map[string]DbSystemUpgradeHistoryEntryLifecycleStateEnum{
"IN_PROGRESS": DbSystemUpgradeHistoryEntryLifecycleStateInProgress,
"SUCCEEDED": DbSystemUpgradeHistoryEntryLifecycleStateSucceeded,
"FAILED": DbSystemUpgradeHistoryEntryLifecycleStateFailed,
"NEEDS_ATTENTION": DbSystemUpgradeHistoryEntryLifecycleStateNeedsAttention,
}
var mappingDbSystemUpgradeHistoryEntryLifecycleStateEnumLowerCase = map[string]DbSystemUpgradeHistoryEntryLifecycleStateEnum{
"in_progress": DbSystemUpgradeHistoryEntryLifecycleStateInProgress,
"succeeded": DbSystemUpgradeHistoryEntryLifecycleStateSucceeded,
"failed": DbSystemUpgradeHistoryEntryLifecycleStateFailed,
"needs_attention": DbSystemUpgradeHistoryEntryLifecycleStateNeedsAttention,
}
// GetDbSystemUpgradeHistoryEntryLifecycleStateEnumValues Enumerates the set of values for DbSystemUpgradeHistoryEntryLifecycleStateEnum
func GetDbSystemUpgradeHistoryEntryLifecycleStateEnumValues() []DbSystemUpgradeHistoryEntryLifecycleStateEnum {
values := make([]DbSystemUpgradeHistoryEntryLifecycleStateEnum, 0)
for _, v := range mappingDbSystemUpgradeHistoryEntryLifecycleStateEnum {
values = append(values, v)
}
return values
}
// GetDbSystemUpgradeHistoryEntryLifecycleStateEnumStringValues Enumerates the set of values in String for DbSystemUpgradeHistoryEntryLifecycleStateEnum
func GetDbSystemUpgradeHistoryEntryLifecycleStateEnumStringValues() []string {
return []string{
"IN_PROGRESS",
"SUCCEEDED",
"FAILED",
"NEEDS_ATTENTION",
}
}
// GetMappingDbSystemUpgradeHistoryEntryLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum
func GetMappingDbSystemUpgradeHistoryEntryLifecycleStateEnum(val string) (DbSystemUpgradeHistoryEntryLifecycleStateEnum, bool) {
enum, ok := mappingDbSystemUpgradeHistoryEntryLifecycleStateEnumLowerCase[strings.ToLower(val)]
return enum, ok
}