Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion main.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ using OpenAPI;
*
*/
@service(#{ title: "HyperFleet API" })
@info(#{ version: "1.0.3", contact: #{ name: "HyperFleet Team" }, license: #{ name: "Apache 2.0" ,url: "https://www.apache.org/licenses/LICENSE-2.0"} })
@info(#{ version: "1.0.4", contact: #{ name: "HyperFleet Team" }, license: #{ name: "Apache 2.0" ,url: "https://www.apache.org/licenses/LICENSE-2.0"} })
@server("https://hyperfleet.redhat.com", "Production")
@route("/api/hyperfleet/v1")
namespace HyperFleet;
Expand Down
41 changes: 29 additions & 12 deletions models-core/cluster/example_cluster.tsp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import "../../aliases-core.tsp";
import "../../models/clusters/model.tsp";
import "../../models/common/model.tsp";

const exampleCluster: Cluster = #{
kind: "Cluster",
Expand All @@ -12,26 +13,42 @@ const exampleCluster: Cluster = #{
updated_time: "2021-01-01T00:00:00Z",
generation: 1,
status: #{
phase: ResourcePhase.Ready,
last_transition_time: "2021-01-01T00:00:00Z",
observed_generation: 1,
last_updated_time: "2021-01-01T00:00:00Z",
conditions: #[
#{
type: "ValidationSuccessful",
status: ConditionStatus.True,
reason: "All validations passed",
message: "All 30 validation tests passed",
type: ConditionType.Ready,
status: ResourceConditionStatus.True,
reason: ExampleReadyReason,
message: ExampleReadyMessage,
observed_generation: 1,
created_time: "2021-01-01T10:00:00Z",
last_updated_time: "2021-01-01T10:00:00Z",
last_transition_time: "2021-01-01T10:00:00Z",
},
#{
type: "DNSSuccessful",
status: ConditionStatus.True,
reason: "DNS configured",
message: "DNS records created for custom.domain.com",
type: ConditionType.Available,
status: ResourceConditionStatus.True,
reason: ExampleAvailableReason,
message: ExampleAvailableMessage,
observed_generation: 1,
created_time: "2021-01-01T10:00:00Z",
last_updated_time: "2021-01-01T10:00:00Z",
last_transition_time: "2021-01-01T10:00:00Z",
},
#{
type: "Adapter1Successful",
status: ResourceConditionStatus.True,
reason: ExampleAdapter1AvaliableReason,
message: ExampleAdapter1AvaliableMessage,
observed_generation: 1,
created_time: "2021-01-01T10:00:00Z",
last_updated_time: "2021-01-01T10:00:00Z",
last_transition_time: "2021-01-01T10:00:00Z",
},
#{
type: "Adapter2Successful",
status: ResourceConditionStatus.True,
reason: ExampleAdapter2AvaliableReason,
message: ExampleAdapter2AvaliableMessage,
observed_generation: 1,
created_time: "2021-01-01T10:01:00Z",
last_updated_time: "2021-01-01T10:01:00Z",
Expand Down
41 changes: 29 additions & 12 deletions models-core/nodepool/example_nodepool.tsp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import "../../aliases-core.tsp";
import "../../models/nodepools/model.tsp";
import "../../models/common/model.tsp";

const exampleNodePool: NodePool = #{
kind: "NodePool",
Expand All @@ -19,26 +20,42 @@ const exampleNodePool: NodePool = #{
href: "https://api.hyperfleet.com/v1/clusters/cluster-123",
},
status: #{
phase: ResourcePhase.Ready,
last_transition_time: "2021-01-01T10:00:00Z",
observed_generation: 1,
last_updated_time: "2021-01-01T10:02:00Z",
conditions: #[
#{
type: "ValidationSuccessful",
status: ConditionStatus.True,
reason: "All validations passed",
message: "NodePool validation passed",
type: ConditionType.Ready,
status: ResourceConditionStatus.True,
reason: ExampleReadyReason,
message: ExampleReadyMessage,
observed_generation: 1,
created_time: "2021-01-01T10:00:00Z",
last_updated_time: "2021-01-01T10:00:00Z",
last_transition_time: "2021-01-01T10:00:00Z",
},
#{
type: "NodePoolSuccessful",
status: ConditionStatus.True,
reason: "NodePool provisioned successfully",
message: "NodePool has been scaled to desired count",
type: ConditionType.Available,
status: ResourceConditionStatus.True,
reason: ExampleAvailableReason,
message: ExampleAvailableMessage,
observed_generation: 1,
created_time: "2021-01-01T10:00:00Z",
last_updated_time: "2021-01-01T10:00:00Z",
last_transition_time: "2021-01-01T10:00:00Z",
},
#{
type: "Adapter1Successful",
status: ResourceConditionStatus.True,
reason: ExampleAdapter1AvaliableReason,
message: ExampleAdapter1AvaliableMessage,
observed_generation: 1,
created_time: "2021-01-01T10:00:00Z",
last_updated_time: "2021-01-01T10:00:00Z",
last_transition_time: "2021-01-01T10:00:00Z",
},
#{
type: "Adapter2Successful",
status: ResourceConditionStatus.True,
reason: ExampleAdapter2AvaliableReason,
message: ExampleAdapter2AvaliableMessage,
observed_generation: 1,
created_time: "2021-01-01T10:01:00Z",
last_updated_time: "2021-01-01T10:01:00Z",
Expand Down
43 changes: 30 additions & 13 deletions models-gcp/cluster/example_cluster.tsp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import "../../aliases-gcp.tsp";
import "../../models/clusters/model.tsp";
import "../../models/common/model.tsp";

const exampleCluster: Cluster = #{
kind: "Cluster",
Expand Down Expand Up @@ -34,26 +35,42 @@ const exampleCluster: Cluster = #{
updated_time: "2021-01-01T00:00:00Z",
generation: 1,
status: #{
phase: ResourcePhase.Ready,
last_transition_time: "2021-01-01T00:00:00Z",
observed_generation: 1,
last_updated_time: "2021-01-01T00:00:00Z",
conditions: #[
#{
type: "ValidationSuccessful",
status: ConditionStatus.True,
reason: "All validations passed",
message: "All 30 validation tests passed",
type: ConditionType.Ready,
status: ResourceConditionStatus.True,
reason: ExampleReadyReason,
message: ExampleReadyMessage,
observed_generation: 1,
created_time: "2021-01-01T10:00:00Z",
last_updated_time: "2021-01-01T10:00:00Z",
last_transition_time: "2021-01-01T10:00:00Z",
},
#{
type: "DNSSuccessful",
status: ConditionStatus.True,
reason: "DNS configured",
message: "DNS records created for custom.domain.com",
type: ConditionType.Available,
status: ResourceConditionStatus.True,
reason: ExampleAvailableReason,
message: ExampleAvailableMessage,
observed_generation: 1,
created_time: "2021-01-01T10:00:00Z",
last_updated_time: "2021-01-01T10:00:00Z",
last_transition_time: "2021-01-01T10:00:00Z",
},
#{
type: "Adapter1Successful",
status: ResourceConditionStatus.True,
reason: ExampleAdapter1AvaliableReason,
message: ExampleAdapter1AvaliableMessage,
observed_generation: 1,
created_time: "2021-01-01T10:00:00Z",
last_updated_time: "2021-01-01T10:00:00Z",
last_transition_time: "2021-01-01T10:00:00Z",
},
#{
type: "Adapter2Successful",
status: ResourceConditionStatus.True,
reason: ExampleAdapter2AvaliableReason,
message: ExampleAdapter2AvaliableMessage,
observed_generation: 1,
created_time: "2021-01-01T10:01:00Z",
last_updated_time: "2021-01-01T10:01:00Z",
Expand All @@ -63,4 +80,4 @@ const exampleCluster: Cluster = #{
},
created_by: "user-123@example.com",
updated_by: "user-123@example.com",
};
};
28 changes: 22 additions & 6 deletions models-gcp/nodepool/example_nodepool.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,30 @@ const exampleNodePool: NodePool = #{
href: "https://api.hyperfleet.com/v1/clusters/cluster-123",
},
status: #{
phase: ResourcePhase.Ready,
last_transition_time: "2021-01-01T10:00:00Z",
observed_generation: 1,
last_updated_time: "2021-01-01T10:02:00Z",
conditions: #[
#{
type: ConditionType.Ready,
status: ResourceConditionStatus.True,
reason: "ResourceReady",
message: "All conditions successful for current spec generation",
observed_generation: 1,
created_time: "2021-01-01T10:00:00Z",
last_updated_time: "2021-01-01T10:00:00Z",
last_transition_time: "2021-01-01T10:00:00Z",
},
#{
type: ConditionType.Available,
status: ResourceConditionStatus.True,
reason: "ResourceAvailable",
message: "All conditions successful for observed_generation",
observed_generation: 1,
created_time: "2021-01-01T10:00:00Z",
last_updated_time: "2021-01-01T10:00:00Z",
last_transition_time: "2021-01-01T10:00:00Z",
},
#{
type: "ValidationSuccessful",
status: ConditionStatus.True,
status: ResourceConditionStatus.True,
reason: "All validations passed",
message: "NodePool validation passed",
observed_generation: 1,
Expand All @@ -58,7 +74,7 @@ const exampleNodePool: NodePool = #{
},
#{
type: "NodePoolSuccessful",
status: ConditionStatus.True,
status: ResourceConditionStatus.True,
reason: "NodePool provisioned successfully",
message: "NodePool has 3 nodes running",
observed_generation: 1,
Expand Down
30 changes: 9 additions & 21 deletions models/clusters/model.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -22,32 +22,20 @@ model ClusterBase {
* This object is computed by the service and CANNOT be modified directly.
* It is aggregated from condition updates posted to `/clusters/{id}/statuses`.
*
* Provides quick overview of all reported conditions and aggregated phase.
* Provides quick overview of all reported conditions.
*/
model ClusterStatus {
phase: ResourcePhase;

/**
* When cluster last transitioned (used by Sentinel for backoff)
* Updated when conditions are reported if the phase changes
* List of status conditions for the cluster.
*
* **Mandatory conditions**:
* - `type: "Ready"`: Whether all adapters report successfully at the current generation.
* - `type: "Available"`: Aggregated adapter result for a common observed_generation.
*
* These conditions are present immediately upon resource creation.
*/
@format("date-time") last_transition_time: string;

/**
* Last generation processed
* Updated when conditions are reported.
* This will be the lowest value of each condition's observed_generation values
* The phase value is based on this generation
*/
observed_generation: int32;

/** Time of the last update
* Updated when conditions are reported.
* Computed as min(conditions[].last_updated_time) to detect stale adapters.
* Uses earliest (not latest) timestamp to ensure Sentinel can detect if any adapter has stopped reporting.
*/
@format("date-time") last_updated_time: string;

@minItems(2)
conditions: ResourceCondition[];
}

Expand Down
Loading