@@ -61,7 +61,7 @@ public class SnapshotLifecyclePolicy implements SimpleDiffable<SnapshotLifecycle
6161 private static final ParseField REPOSITORY = new ParseField ("repository" );
6262 private static final ParseField CONFIG = new ParseField ("config" );
6363 private static final ParseField RETENTION = new ParseField ("retention" );
64- private static final ParseField TIME_ALLOWED_SINCE_LAST_SNAPSHOT = new ParseField ("time_allowed_since_last_snapshot " );
64+ private static final ParseField MISSING_SNAPSHOT_UNHEALTHY_THRESHOLD = new ParseField ("missing_snapshot_unhealthy_threshold " );
6565 private static final String METADATA_FIELD_NAME = "metadata" ;
6666
6767 @ SuppressWarnings ("unchecked" )
@@ -87,8 +87,8 @@ public class SnapshotLifecyclePolicy implements SimpleDiffable<SnapshotLifecycle
8787 PARSER .declareObject (ConstructingObjectParser .optionalConstructorArg (), SnapshotRetentionConfiguration ::parse , RETENTION );
8888 PARSER .declareField (
8989 ConstructingObjectParser .optionalConstructorArg (),
90- (p , c ) -> TimeValue .parseTimeValue (p .text (), TIME_ALLOWED_SINCE_LAST_SNAPSHOT .getPreferredName ()),
91- TIME_ALLOWED_SINCE_LAST_SNAPSHOT ,
90+ (p , c ) -> TimeValue .parseTimeValue (p .text (), MISSING_SNAPSHOT_UNHEALTHY_THRESHOLD .getPreferredName ()),
91+ MISSING_SNAPSHOT_UNHEALTHY_THRESHOLD ,
9292 ObjectParser .ValueType .STRING
9393 );
9494 }
@@ -130,7 +130,7 @@ public SnapshotLifecyclePolicy(StreamInput in) throws IOException {
130130 this .repository = in .readString ();
131131 this .configuration = in .readGenericMap ();
132132 this .retentionPolicy = in .readOptionalWriteable (SnapshotRetentionConfiguration ::new );
133- this .missingSnapshotUnhealthyThreshold = in .getTransportVersion ().onOrAfter (TransportVersions .SLM_TIME_ALLOWED_SINCE_LAST_SNAPSHOT )
133+ this .missingSnapshotUnhealthyThreshold = in .getTransportVersion ().onOrAfter (TransportVersions .SLM_MISSING_SNAPSHOT_UNHEALTHY_THRESHOLD )
134134 ? in .readOptionalTimeValue ()
135135 : null ;
136136 this .isCronSchedule = isCronSchedule (schedule );
@@ -394,7 +394,7 @@ public void writeTo(StreamOutput out) throws IOException {
394394 out .writeString (this .repository );
395395 out .writeGenericMap (this .configuration );
396396 out .writeOptionalWriteable (this .retentionPolicy );
397- if (out .getTransportVersion ().onOrAfter (TransportVersions .SLM_TIME_ALLOWED_SINCE_LAST_SNAPSHOT )) {
397+ if (out .getTransportVersion ().onOrAfter (TransportVersions .SLM_MISSING_SNAPSHOT_UNHEALTHY_THRESHOLD )) {
398398 out .writeOptionalTimeValue (this .missingSnapshotUnhealthyThreshold );
399399 }
400400 }
@@ -412,7 +412,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws
412412 builder .field (RETENTION .getPreferredName (), this .retentionPolicy );
413413 }
414414 if (this .missingSnapshotUnhealthyThreshold != null ) {
415- builder .field (TIME_ALLOWED_SINCE_LAST_SNAPSHOT .getPreferredName (), this .missingSnapshotUnhealthyThreshold );
415+ builder .field (MISSING_SNAPSHOT_UNHEALTHY_THRESHOLD .getPreferredName (), this .missingSnapshotUnhealthyThreshold );
416416 }
417417 builder .endObject ();
418418 return builder ;
0 commit comments