@@ -88,6 +88,7 @@ type HTTPMatchRequest struct {
88
88
// HTTPFaultInjection can be used to specify one or more faults to inject
89
89
// while forwarding HTTP requests to the destination specified in a route.
90
90
type HTTPFaultInjection struct {
91
+ // Name is the name of the policy
91
92
Name string `json:"name,omitempty"`
92
93
// Delay requests before forwarding, emulating various failures such as
93
94
// network issues, overloaded upstream service, etc.
@@ -99,6 +100,8 @@ type HTTPFaultInjection struct {
99
100
// Match specifies a set of criterion to be met in order for the
100
101
// rule to be applied to the HTTP request.
101
102
Match * HTTPMatchRequest `json:"match,omitempty"`
103
+ // Effective time of fault injection
104
+ EffectiveTime * EffectiveTimeRange `json:"effectiveTime,omitempty"`
102
105
}
103
106
104
107
type FaultInjectionSpec struct {
@@ -110,6 +113,27 @@ type FaultInjectionSpec struct {
110
113
HTTPFaultInjections []* HTTPFaultInjection `json:"httpFault,omitempty"`
111
114
}
112
115
116
+ type EffectiveTimeRange struct {
117
+ // StartTime is the starting time of fault injection.
118
+ StartTime string `json:"startTime,omitempty"`
119
+
120
+ // EndTime is the ending time of fault injection.
121
+ EndTime string `json:"endTime,omitempty"`
122
+
123
+ // DaysOfWeek specifies on which days of the week the fault injection configuration is effective.
124
+ // 0 represents Sunday, 1 represents Monday, and so on.
125
+ DaysOfWeek []int `json:"daysOfWeek,omitempty"`
126
+
127
+ // DaysOfMonth specifies on which days of the month the fault injection configuration is effective.
128
+ // For example, 1 represents the first day of the month, and so on.
129
+ DaysOfMonth []int `json:"daysOfMonth,omitempty"`
130
+
131
+ // Months specifies in which months of the year the fault injection configuration is effective.
132
+ // 1 represents January, 2 represents February, and so on.
133
+ Months []int `json:"months,omitempty"`
134
+ }
135
+
136
+
113
137
// FaultInjectionState is the status of the fault injection, which may be 'Opened' or 'Closed'.
114
138
type FaultInjectionState string
115
139
0 commit comments