You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
This repository supports the development of the Hyperfleet OpenAPI contract, but is not the source-of-truth for the OpenAPI contract.
4
4
5
-
This project hosts the TypeSpec files to generate the HyperFleet core OpenAPI specification. TypeSpec is an implementation detail providing better ergonomics than writing contracts in plain YAML. The repository generates the core provider contract; the GCP-specific contract lives in [hyperfleet-api-spec-gcp](https://github.com/openshift-hyperfleet/hyperfleet-api-spec-gcp).
5
+
This project hosts the TypeSpec files to generate the HyperFleet core OpenAPI specification. TypeSpec is an implementation detail providing better ergonomics than writing contracts in plain YAML. The repository generates the core provider contract; the provider-specific contract lives in [hyperfleet-api-spec-template](https://github.com/openshift-hyperfleet/hyperfleet-api-spec-template).
6
6
7
7
Access to the OpenAPI contract source of truth in hyperfleet-api repository:
8
8
@@ -68,7 +68,7 @@ The repository is organized with root-level configuration files and two main dir
68
68
69
69
### `/shared`
70
70
71
-
Contains models and services shared across providers (also published as an npm package for consumption by provider-specific repos like `hyperfleet-api-spec-gcp`):
71
+
Contains models and services shared across providers (also published as an npm package for consumption by provider-specific repos like `hyperfleet-api-spec-template`):
72
72
73
73
-**`shared/models/clusters/`** - Cluster resource definitions (interfaces and base models)
74
74
-**`shared/models/statuses/`** - Status resource definitions for clusters and nodepools
@@ -89,10 +89,10 @@ Contains core-specific models and internal services:
89
89
90
90
The status endpoints are split into two files to support different API consumers:
91
91
92
-
| File | Operations | Audience | Included in Build |
|`shared/services/statuses.tsp`| GET (read) | External clients | ✅ Yes (default)|
95
+
|`core/services/statuses-internal.tsp`| PUT (write) | Internal adapters | ❌ No (opt-in) |
96
96
97
97
**Why the split?**
98
98
@@ -149,7 +149,7 @@ The HyperFleet API provides simple CRUD operations for managing cluster resource
149
149
150
150
## Adding a New Provider
151
151
152
-
Provider-specific contracts live in their own repository and consume this repo as an npm package (the `hyperfleet` package). See [hyperfleet-api-spec-gcp](https://github.com/openshift-hyperfleet/hyperfleet-api-spec-gcp) for a reference implementation.
152
+
Provider-specific contracts live in their own repository and consume this repo as an npm package (the `hyperfleet` package). See [hyperfleet-api-spec-template](https://github.com/openshift-hyperfleet/hyperfleet-api-spec-template) for a reference implementation.
153
153
154
154
## Adding a New Service
155
155
@@ -162,7 +162,7 @@ To add a new service (e.g., with additional endpoints):
Copy file name to clipboardExpand all lines: core/services/resources-internal.tsp
+54-3Lines changed: 54 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -2,9 +2,9 @@ import "@typespec/http";
2
2
import"@typespec/openapi";
3
3
import"@typespec/openapi3";
4
4
5
-
import"../models/resource/model.tsp";
6
-
import"../models/common/model.tsp";
7
-
import"../models/statuses/model.tsp";
5
+
import"../../shared/models/resource/model.tsp";
6
+
import"../../shared/models/common/model.tsp";
7
+
import"../../shared/models/statuses/model.tsp";
8
8
9
9
usingHttp;
10
10
usingOpenAPI;
@@ -90,4 +90,55 @@ interface Resources {
90
90
| Error
91
91
| BadRequestResponse;
92
92
93
+
/**
94
+
* Permanently removes the resource record from the database for a resource stuck in Finalizing state.
95
+
* This is a database-only operation. Requires a reason for audit purposes.
96
+
*/
97
+
@route("/{resource_id}/force-delete")
98
+
@post
99
+
@summary("Force-delete a resource")
100
+
@operationId("forceDeleteResource")
101
+
forceDeleteResource(
102
+
@pathresource_id:string,
103
+
@bodybody:ForceDeleteRequest,
104
+
): {
105
+
@statusCodestatusCode:204;
106
+
} | Error
107
+
| NotFoundResponse
108
+
| BadRequestResponse
109
+
| ConflictResponse;
110
+
}
111
+
112
+
@tag("Resource statuses")
113
+
@route("/resources/{resource_id}/statuses")
114
+
@useAuth(HyperFleet.BearerAuth)
115
+
interfaceResourceStatuses {
116
+
/**
117
+
* Returns adapter statuses for a resource.
118
+
*/
119
+
@route("")
120
+
@get
121
+
@summary("List resource statuses")
122
+
@operationId("getResourceStatuses")
123
+
getResourceStatuses(
124
+
@pathresource_id:string,
125
+
...QueryParams,
126
+
):Body<AdapterStatusList>
127
+
| Error
128
+
| NotFoundResponse
129
+
| BadRequestResponse;
130
+
131
+
@route("")
132
+
@put
133
+
@summary("Adapter creates or updates resource status")
134
+
@operationId("putResourceStatuses")
135
+
@doc("Adapters call this endpoint to report status for a resource after each evaluation. The adapter's status entry is created if it doesn't exist, or updated if it does (upserted by adapter name).")
@summary("Adapter creates or updates resource status")
72
-
@operationId("putResourceStatuses")
73
-
@doc("Adapters call this endpoint to report status for a resource after each evaluation. The adapter's status entry is created if it doesn't exist, or updated if it does (upserted by adapter name).")
74
-
putResourceStatuses(
75
-
@pathresource_id:string,
76
-
@bodybody:AdapterStatusCreateRequest,
77
-
):
78
-
| (CreatedResponse & AdapterStatus)
79
-
| BadRequestResponse
80
-
| NotFoundResponse
81
-
| ConflictResponse;
82
-
}
83
-
84
-
@tag("Resources")
85
-
@route("/resources")
86
-
@useAuth(HyperFleet.BearerAuth)
87
-
interfaceResourcesForceDelete {
88
-
/**
89
-
* Permanently removes the resource record from the database for a resource stuck in Finalizing state.
90
-
* This is a database-only operation. Requires a reason for audit purposes.
0 commit comments