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.1", contact: #{ name: "HyperFleet Team" }, license: #{ name: "Apache 2.0" ,url: "https://www.apache.org/licenses/LICENSE-2.0"} })
@info(#{ version: "1.0.2", 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
24 changes: 9 additions & 15 deletions models/clusters/model.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import "../common/model.tsp";
import "../statuses/model.tsp";
import "../../aliases.tsp";

model ClusterBase extends APIResource {
kind: string = "Cluster";
model ClusterBase {
...APIResource;

/**
* Cluster name (unique)
Expand All @@ -13,10 +13,6 @@ model ClusterBase extends APIResource {
@pattern("^[a-z0-9]([-a-z0-9]*[a-z0-9])?$")
name: string;

/** Cluster specification
* CLM doesn't know how to unmarshall the spec, it only stores and forwards to adapters to do their job
* But CLM will validate the schema before accepting the request
*/
spec: ClusterSpec;
}

Expand All @@ -29,11 +25,6 @@ model ClusterBase extends APIResource {
* Provides quick overview of all reported conditions and aggregated phase.
*/
model ClusterStatus {
/**
* Current cluster phase (native database column).
* Updated when conditions are reported.
* Note: status.phase provides aggregated view from all conditions.
*/
phase: ResourcePhase;

/**
Expand Down Expand Up @@ -61,7 +52,8 @@ model ClusterStatus {
}

@example(exampleCluster)
model Cluster extends ClusterBase {
model Cluster {
...ClusterBase;
...APICreatedResource;

/**
Expand All @@ -74,8 +66,10 @@ model Cluster extends ClusterBase {
}

@example(exampleClusterCreateRequest)
model ClusterCreateRequest extends ClusterBase {}
model ClusterCreateRequest {
...ClusterBase;
}

model ClusterList extends List {
items: Cluster[];
model ClusterList {
...List<Cluster>;
}
10 changes: 6 additions & 4 deletions models/common/model.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ model ErrorResponse<Kind, ErrorCode> {
@body error: Error;
}

model APIResource extends ObjectReference {
model APIResource {
...ObjectReference;
/** labels for the API resource as pairs of name:value strings */
labels?: Record<string>;
}
Expand Down Expand Up @@ -102,7 +103,8 @@ model SearchParams {
search?: string;
}

model QueryParams extends SearchParams {
model QueryParams {
...SearchParams;
@query
page?: int32 = 1;

Expand All @@ -116,10 +118,10 @@ model QueryParams extends SearchParams {
order?: OrderDirection;
}

model List {
model List<T> {
kind: string;
page: int32;
size: int32;
total: int32;
items: unknown[];
items: T[];
}
16 changes: 4 additions & 12 deletions models/nodepools/model.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ model NodePoolBase {
@pattern("^[a-z0-9]([-a-z0-9]*[a-z0-9])?$")
name: string;

/** NodePool specification
* CLM doesn't know how to unmarshall the spec, it only stores and forwards to adapters to do their job
* But CLM will validate the schema before accepting the request
*/
spec: NodePoolSpec;
}

Expand All @@ -26,11 +22,6 @@ model NodePoolBase {
* This object is computed by the service and CANNOT be modified directly.
*/
model NodePoolStatus {
/**
* Current NodePool phase (native database column).
* Updated when conditions are reported.
* Note: status.phase provides aggregated view from all conditions.
*/
phase: ResourcePhase;

/**
Expand Down Expand Up @@ -58,7 +49,8 @@ model NodePoolStatus {
}

@example(exampleNodePool)
model NodePool extends NodePoolBase {
model NodePool {
...NodePoolBase;
...APICreatedResource;

/**
Expand All @@ -80,6 +72,6 @@ model NodePoolCreateResponse {
...NodePool;
}

model NodePoolList extends List {
items: NodePool[];
model NodePoolList {
...List<NodePool>;
}
19 changes: 10 additions & 9 deletions models/statuses/model.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ model ConditionBase {
*/
type: string;

/**
* Condition status
*/
status: ConditionStatus;

/**
Expand All @@ -47,7 +44,8 @@ model ConditionBase {
* Note: observed_generation is at AdapterStatus level, not per-condition,
* since all conditions in one AdapterStatus share the same observed generation
*/
model AdapterCondition extends ConditionBase {
model AdapterCondition {
...ConditionBase;
// No additional fields - inherits all fields from ConditionBase
}

Expand All @@ -56,7 +54,8 @@ model AdapterCondition extends ConditionBase {
* Used for semantic condition types: "ValidationSuccessful", "DNSSuccessful", "NodePoolSuccessful", etc.
* Includes observed_generation and last_updated_time to track adapter-specific state
*/
model ResourceCondition extends ConditionBase {
model ResourceCondition {
...ConditionBase;
/**
* Generation of the spec that this condition reflects
*/
Expand Down Expand Up @@ -123,7 +122,8 @@ model AdapterStatusBase {
* Contains multiple conditions, job metadata, and adapter-specific data
*/
@example(exampleAdapterStatus)
model AdapterStatus extends AdapterStatusBase {
model AdapterStatus {
...AdapterStatusBase;
/**
* Kubernetes-style conditions tracking adapter state
* Typically includes: Available, Applied, Health
Expand All @@ -147,7 +147,8 @@ model AdapterStatus extends AdapterStatusBase {
* Request payload for creating/updating adapter status
*/
@example(exampleAdapterStatusCreateRequest)
model AdapterStatusCreateRequest extends AdapterStatusBase {
model AdapterStatusCreateRequest {
...AdapterStatusBase;
/**
* When the adapter observed this resource state
* API will use this to set AdapterStatus.last_report_time
Expand All @@ -161,6 +162,6 @@ model AdapterStatusCreateRequest extends AdapterStatusBase {
* List of adapter statuses with pagination metadata
*/
@example(exampleAdapterStatusList)
model AdapterStatusList extends List {
items: AdapterStatus[];
model AdapterStatusList {
...List<AdapterStatus>;
}
Loading