diff --git a/main.tsp b/main.tsp index 5712de6..d3dd4c3 100644 --- a/main.tsp +++ b/main.tsp @@ -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; diff --git a/models/clusters/model.tsp b/models/clusters/model.tsp index aaeaaa9..f83d65b 100644 --- a/models/clusters/model.tsp +++ b/models/clusters/model.tsp @@ -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) @@ -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; } @@ -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; /** @@ -61,7 +52,8 @@ model ClusterStatus { } @example(exampleCluster) -model Cluster extends ClusterBase { +model Cluster { + ...ClusterBase; ...APICreatedResource; /** @@ -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; } diff --git a/models/common/model.tsp b/models/common/model.tsp index 4772e60..7d7fc3d 100644 --- a/models/common/model.tsp +++ b/models/common/model.tsp @@ -72,7 +72,8 @@ model ErrorResponse { @body error: Error; } -model APIResource extends ObjectReference { +model APIResource { + ...ObjectReference; /** labels for the API resource as pairs of name:value strings */ labels?: Record; } @@ -102,7 +103,8 @@ model SearchParams { search?: string; } -model QueryParams extends SearchParams { +model QueryParams { + ...SearchParams; @query page?: int32 = 1; @@ -116,10 +118,10 @@ model QueryParams extends SearchParams { order?: OrderDirection; } -model List { +model List { kind: string; page: int32; size: int32; total: int32; - items: unknown[]; + items: T[]; } diff --git a/models/nodepools/model.tsp b/models/nodepools/model.tsp index de07d0e..c15f72a 100644 --- a/models/nodepools/model.tsp +++ b/models/nodepools/model.tsp @@ -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; } @@ -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; /** @@ -58,7 +49,8 @@ model NodePoolStatus { } @example(exampleNodePool) -model NodePool extends NodePoolBase { +model NodePool { + ...NodePoolBase; ...APICreatedResource; /** @@ -80,6 +72,6 @@ model NodePoolCreateResponse { ...NodePool; } -model NodePoolList extends List { - items: NodePool[]; +model NodePoolList { + ...List; } diff --git a/models/statuses/model.tsp b/models/statuses/model.tsp index e115022..61a387c 100644 --- a/models/statuses/model.tsp +++ b/models/statuses/model.tsp @@ -19,9 +19,6 @@ model ConditionBase { */ type: string; - /** - * Condition status - */ status: ConditionStatus; /** @@ -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 } @@ -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 */ @@ -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 @@ -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 @@ -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; } diff --git a/schemas/core/openapi.yaml b/schemas/core/openapi.yaml index 7b20a9f..d19b926 100644 --- a/schemas/core/openapi.yaml +++ b/schemas/core/openapi.yaml @@ -1,7 +1,7 @@ openapi: 3.0.0 info: title: HyperFleet API - version: 1.0.1 + version: 1.0.2 contact: name: HyperFleet Team license: @@ -20,11 +20,11 @@ paths: operationId: getClusters summary: List clusters parameters: + - $ref: '#/components/parameters/SearchParams' - $ref: '#/components/parameters/QueryParams.page' - $ref: '#/components/parameters/QueryParams.pageSize' - $ref: '#/components/parameters/QueryParams.orderBy' - $ref: '#/components/parameters/QueryParams.order' - - $ref: '#/components/parameters/SearchParams' responses: '200': description: The request has succeeded. @@ -115,11 +115,11 @@ paths: description: Cluster ID schema: type: string + - $ref: '#/components/parameters/SearchParams' - $ref: '#/components/parameters/QueryParams.page' - $ref: '#/components/parameters/QueryParams.pageSize' - $ref: '#/components/parameters/QueryParams.orderBy' - $ref: '#/components/parameters/QueryParams.order' - - $ref: '#/components/parameters/SearchParams' responses: '200': description: The request has succeeded. @@ -263,11 +263,11 @@ paths: required: true schema: type: string + - $ref: '#/components/parameters/SearchParams' - $ref: '#/components/parameters/QueryParams.page' - $ref: '#/components/parameters/QueryParams.pageSize' - $ref: '#/components/parameters/QueryParams.orderBy' - $ref: '#/components/parameters/QueryParams.order' - - $ref: '#/components/parameters/SearchParams' responses: '200': description: The request has succeeded. @@ -332,11 +332,11 @@ paths: description: Cluster ID schema: type: string + - $ref: '#/components/parameters/SearchParams' - $ref: '#/components/parameters/QueryParams.page' - $ref: '#/components/parameters/QueryParams.pageSize' - $ref: '#/components/parameters/QueryParams.orderBy' - $ref: '#/components/parameters/QueryParams.order' - - $ref: '#/components/parameters/SearchParams' responses: '200': description: The request has succeeded. @@ -356,11 +356,11 @@ paths: summary: List all nodepools for cluster description: Returns the list of all nodepools parameters: + - $ref: '#/components/parameters/SearchParams' - $ref: '#/components/parameters/QueryParams.page' - $ref: '#/components/parameters/QueryParams.pageSize' - $ref: '#/components/parameters/QueryParams.orderBy' - $ref: '#/components/parameters/QueryParams.order' - - $ref: '#/components/parameters/SearchParams' responses: '200': description: The request has succeeded. @@ -424,20 +424,30 @@ components: type: string explode: false schemas: - APIResource: - type: object - properties: - labels: - type: object - additionalProperties: - type: string - description: labels for the API resource as pairs of name:value strings - allOf: - - $ref: '#/components/schemas/ObjectReference' AdapterCondition: type: object - allOf: - - $ref: '#/components/schemas/ConditionBase' + required: + - type + - status + - last_transition_time + properties: + type: + type: string + description: Condition type + status: + $ref: '#/components/schemas/ConditionStatus' + reason: + type: string + description: Machine-readable reason code + message: + type: string + description: Human-readable message + last_transition_time: + type: string + format: date-time + description: |- + When this condition last transitioned status (API-managed) + Only updated when status changes (True/False/Unknown), not when reason/message changes description: |- Condition in AdapterStatus Used for standard Kubernetes condition types: "Available", "Applied", "Health" @@ -446,10 +456,42 @@ components: AdapterStatus: type: object required: + - adapter + - observed_generation - conditions - created_time - last_report_time properties: + adapter: + type: string + description: Adapter name (e.g., "validator", "dns", "provisioner") + observed_generation: + type: integer + format: int32 + description: Which generation of the resource this status reflects + metadata: + type: object + properties: + job_name: + type: string + job_namespace: + type: string + attempt: + type: integer + format: int32 + started_time: + type: string + format: date-time + completed_time: + type: string + format: date-time + duration: + type: string + description: Job execution metadata + data: + type: object + additionalProperties: {} + description: Adapter-specific data (structure varies by adapter type) conditions: type: array items: @@ -468,8 +510,6 @@ components: When this adapter last reported its status (API-managed) Updated every time the adapter POSTs, even if conditions haven't changed Used by Sentinel to detect adapter liveness - allOf: - - $ref: '#/components/schemas/AdapterStatusBase' description: |- AdapterStatus represents the complete status report from an adapter Contains multiple conditions, job metadata, and adapter-specific data @@ -506,11 +546,13 @@ components: failed: 0 created_time: '2021-01-01T10:00:00Z' last_report_time: '2021-01-01T10:02:00Z' - AdapterStatusBase: + AdapterStatusCreateRequest: type: object required: - adapter - observed_generation + - observed_time + - conditions properties: adapter: type: string @@ -542,13 +584,6 @@ components: type: object additionalProperties: {} description: Adapter-specific data (structure varies by adapter type) - description: Base fields shared by AdapterStatus and AdapterStatusCreateRequest - AdapterStatusCreateRequest: - type: object - required: - - observed_time - - conditions - properties: observed_time: type: string format: date-time @@ -559,8 +594,6 @@ components: type: array items: $ref: '#/components/schemas/ConditionRequest' - allOf: - - $ref: '#/components/schemas/AdapterStatusBase' description: Request payload for creating/updating adapter status example: adapter: validator @@ -594,14 +627,27 @@ components: AdapterStatusList: type: object required: + - kind + - page + - size + - total - items properties: + kind: + type: string + page: + type: integer + format: int32 + size: + type: integer + format: int32 + total: + type: integer + format: int32 items: type: array items: $ref: '#/components/schemas/AdapterStatus' - allOf: - - $ref: '#/components/schemas/List' description: List of adapter statuses with pagination metadata example: kind: AdapterStatusList @@ -649,6 +695,8 @@ components: Cluster: type: object required: + - name + - spec - created_time - updated_time - created_by @@ -656,6 +704,28 @@ components: - generation - status properties: + id: + type: string + description: Resource identifier + kind: + type: string + description: Resource kind + href: + type: string + description: Resource URI + labels: + type: object + additionalProperties: + type: string + description: labels for the API resource as pairs of name:value strings + name: + type: string + minLength: 3 + maxLength: 63 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + description: Cluster name (unique) + spec: + $ref: '#/components/schemas/ClusterSpec' created_time: type: string format: date-time @@ -675,8 +745,6 @@ components: description: Generation field is updated on customer updates, reflecting the version of the "intent" of the customer status: $ref: '#/components/schemas/ClusterStatus' - allOf: - - $ref: '#/components/schemas/ClusterBase' example: kind: Cluster id: cluster-123 @@ -713,16 +781,26 @@ components: last_transition_time: '2021-01-01T10:01:00Z' created_by: user-123@example.com updated_by: user-123@example.com - ClusterBase: + ClusterCreateRequest: type: object required: - - kind - name - spec properties: + id: + type: string + description: Resource identifier kind: type: string - default: Cluster + description: Resource kind + href: + type: string + description: Resource URI + labels: + type: object + additionalProperties: + type: string + description: labels for the API resource as pairs of name:value strings name: type: string minLength: 3 @@ -730,18 +808,7 @@ components: pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ description: Cluster name (unique) spec: - allOf: - - $ref: '#/components/schemas/ClusterSpec' - description: |- - 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 - allOf: - - $ref: '#/components/schemas/APIResource' - ClusterCreateRequest: - type: object - allOf: - - $ref: '#/components/schemas/ClusterBase' + $ref: '#/components/schemas/ClusterSpec' example: kind: Cluster name: cluster-123 @@ -752,14 +819,27 @@ components: ClusterList: type: object required: + - kind + - page + - size + - total - items properties: + kind: + type: string + page: + type: integer + format: int32 + size: + type: integer + format: int32 + total: + type: integer + format: int32 items: type: array items: $ref: '#/components/schemas/Cluster' - allOf: - - $ref: '#/components/schemas/List' ClusterSpec: type: object description: |- @@ -776,12 +856,7 @@ components: - conditions properties: phase: - allOf: - - $ref: '#/components/schemas/ResourcePhase' - description: |- - Current cluster phase (native database column). - Updated when conditions are reported. - Note: status.phase provides aggregated view from all conditions. + $ref: '#/components/schemas/ResourcePhase' last_transition_time: type: string format: date-time @@ -815,33 +890,6 @@ components: It is aggregated from condition updates posted to `/clusters/{id}/statuses`. Provides quick overview of all reported conditions and aggregated phase. - ConditionBase: - type: object - required: - - type - - status - - last_transition_time - properties: - type: - type: string - description: Condition type - status: - allOf: - - $ref: '#/components/schemas/ConditionStatus' - description: Condition status - reason: - type: string - description: Machine-readable reason code - message: - type: string - description: Human-readable message - last_transition_time: - type: string - format: date-time - description: |- - When this condition last transitioned status (API-managed) - Only updated when status changes (True/False/Unknown), not when reason/message changes - description: Base condition fields shared by all condition types ConditionRequest: type: object required: @@ -895,32 +943,11 @@ components: type: string description: Validation error message for this field description: Field-level validation errors (optional) - List: - type: object - required: - - kind - - page - - size - - total - - items - properties: - kind: - type: string - page: - type: integer - format: int32 - size: - type: integer - format: int32 - total: - type: integer - format: int32 - items: - type: array - items: {} NodePool: type: object required: + - name + - spec - created_time - updated_time - created_by @@ -929,6 +956,28 @@ components: - owner_references - status properties: + id: + type: string + description: Resource identifier + kind: + type: string + description: Resource kind + href: + type: string + description: Resource URI + labels: + type: object + additionalProperties: + type: string + description: labels for the API resource as pairs of name:value strings + name: + type: string + minLength: 3 + maxLength: 63 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + description: NodePool name (unique in a cluster) + spec: + $ref: '#/components/schemas/NodePoolSpec' created_time: type: string format: date-time @@ -950,8 +999,6 @@ components: $ref: '#/components/schemas/ObjectReference' status: $ref: '#/components/schemas/NodePoolStatus' - allOf: - - $ref: '#/components/schemas/NodePoolBase' example: kind: NodePool id: nodepool-123 @@ -992,17 +1039,12 @@ components: created_time: '2021-01-01T10:01:00Z' last_updated_time: '2021-01-01T10:01:00Z' last_transition_time: '2021-01-01T10:01:00Z' - NodePoolBase: + NodePoolCreateRequest: type: object required: - name - spec properties: - labels: - type: object - additionalProperties: - type: string - description: labels for the API resource as pairs of name:value strings id: type: string description: Resource identifier @@ -1012,39 +1054,11 @@ components: href: type: string description: Resource URI - name: - type: string - minLength: 3 - maxLength: 63 - pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ - description: NodePool name (unique in a cluster) - spec: - allOf: - - $ref: '#/components/schemas/NodePoolSpec' - description: |- - 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 - NodePoolCreateRequest: - type: object - required: - - name - - spec - properties: labels: type: object additionalProperties: type: string description: labels for the API resource as pairs of name:value strings - id: - type: string - description: Resource identifier - kind: - type: string - description: Resource kind - href: - type: string - description: Resource URI name: type: string minLength: 3 @@ -1052,12 +1066,7 @@ components: pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ description: NodePool name (unique in a cluster) spec: - allOf: - - $ref: '#/components/schemas/NodePoolSpec' - description: |- - 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 + $ref: '#/components/schemas/NodePoolSpec' example: name: worker-pool-1 labels: @@ -1067,6 +1076,8 @@ components: NodePoolCreateResponse: type: object required: + - name + - spec - created_time - updated_time - created_by @@ -1074,9 +1085,29 @@ components: - generation - owner_references - status - - name - - spec properties: + id: + type: string + description: Resource identifier + kind: + type: string + description: Resource kind + href: + type: string + description: Resource URI + labels: + type: object + additionalProperties: + type: string + description: labels for the API resource as pairs of name:value strings + name: + type: string + minLength: 3 + maxLength: 63 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + description: NodePool name (unique in a cluster) + spec: + $ref: '#/components/schemas/NodePoolSpec' created_time: type: string format: date-time @@ -1098,44 +1129,30 @@ components: $ref: '#/components/schemas/ObjectReference' status: $ref: '#/components/schemas/NodePoolStatus' - labels: - type: object - additionalProperties: - type: string - description: labels for the API resource as pairs of name:value strings - id: - type: string - description: Resource identifier - kind: - type: string - description: Resource kind - href: - type: string - description: Resource URI - name: - type: string - minLength: 3 - maxLength: 63 - pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ - description: NodePool name (unique in a cluster) - spec: - allOf: - - $ref: '#/components/schemas/NodePoolSpec' - description: |- - 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 NodePoolList: type: object required: + - kind + - page + - size + - total - items properties: + kind: + type: string + page: + type: integer + format: int32 + size: + type: integer + format: int32 + total: + type: integer + format: int32 items: type: array items: $ref: '#/components/schemas/NodePool' - allOf: - - $ref: '#/components/schemas/List' NodePoolSpec: type: object description: |- @@ -1152,12 +1169,7 @@ components: - conditions properties: phase: - allOf: - - $ref: '#/components/schemas/ResourcePhase' - description: |- - Current NodePool phase (native database column). - Updated when conditions are reported. - Note: status.phase provides aggregated view from all conditions. + $ref: '#/components/schemas/ResourcePhase' observed_generation: type: integer format: int32 @@ -1207,10 +1219,30 @@ components: ResourceCondition: type: object required: + - type + - status + - last_transition_time - observed_generation - created_time - last_updated_time properties: + type: + type: string + description: Condition type + status: + $ref: '#/components/schemas/ConditionStatus' + reason: + type: string + description: Machine-readable reason code + message: + type: string + description: Human-readable message + last_transition_time: + type: string + format: date-time + description: |- + When this condition last transitioned status (API-managed) + Only updated when status changes (True/False/Unknown), not when reason/message changes observed_generation: type: integer format: int32 @@ -1226,8 +1258,6 @@ components: When the corresponding adapter last reported (API-managed) Updated every time the adapter POSTs, even if condition status hasn't changed Copied from AdapterStatus.last_report_time - allOf: - - $ref: '#/components/schemas/ConditionBase' description: |- Condition in Cluster/NodePool status Used for semantic condition types: "ValidationSuccessful", "DNSSuccessful", "NodePoolSuccessful", etc. diff --git a/schemas/gcp/openapi.yaml b/schemas/gcp/openapi.yaml index 24dfb34..1139595 100644 --- a/schemas/gcp/openapi.yaml +++ b/schemas/gcp/openapi.yaml @@ -1,7 +1,7 @@ openapi: 3.0.0 info: title: HyperFleet API - version: 1.0.1 + version: 1.0.2 contact: name: HyperFleet Team license: @@ -20,11 +20,11 @@ paths: operationId: getClusters summary: List clusters parameters: + - $ref: '#/components/parameters/SearchParams' - $ref: '#/components/parameters/QueryParams.page' - $ref: '#/components/parameters/QueryParams.pageSize' - $ref: '#/components/parameters/QueryParams.orderBy' - $ref: '#/components/parameters/QueryParams.order' - - $ref: '#/components/parameters/SearchParams' responses: '200': description: The request has succeeded. @@ -115,11 +115,11 @@ paths: description: Cluster ID schema: type: string + - $ref: '#/components/parameters/SearchParams' - $ref: '#/components/parameters/QueryParams.page' - $ref: '#/components/parameters/QueryParams.pageSize' - $ref: '#/components/parameters/QueryParams.orderBy' - $ref: '#/components/parameters/QueryParams.order' - - $ref: '#/components/parameters/SearchParams' responses: '200': description: The request has succeeded. @@ -223,11 +223,11 @@ paths: required: true schema: type: string + - $ref: '#/components/parameters/SearchParams' - $ref: '#/components/parameters/QueryParams.page' - $ref: '#/components/parameters/QueryParams.pageSize' - $ref: '#/components/parameters/QueryParams.orderBy' - $ref: '#/components/parameters/QueryParams.order' - - $ref: '#/components/parameters/SearchParams' responses: '200': description: The request has succeeded. @@ -255,11 +255,11 @@ paths: description: Cluster ID schema: type: string + - $ref: '#/components/parameters/SearchParams' - $ref: '#/components/parameters/QueryParams.page' - $ref: '#/components/parameters/QueryParams.pageSize' - $ref: '#/components/parameters/QueryParams.orderBy' - $ref: '#/components/parameters/QueryParams.order' - - $ref: '#/components/parameters/SearchParams' responses: '200': description: The request has succeeded. @@ -279,11 +279,11 @@ paths: summary: List all nodepools for cluster description: Returns the list of all nodepools parameters: + - $ref: '#/components/parameters/SearchParams' - $ref: '#/components/parameters/QueryParams.page' - $ref: '#/components/parameters/QueryParams.pageSize' - $ref: '#/components/parameters/QueryParams.orderBy' - $ref: '#/components/parameters/QueryParams.order' - - $ref: '#/components/parameters/SearchParams' responses: '200': description: The request has succeeded. @@ -347,16 +347,6 @@ components: type: string explode: false schemas: - APIResource: - type: object - properties: - labels: - type: object - additionalProperties: - type: string - description: labels for the API resource as pairs of name:value strings - allOf: - - $ref: '#/components/schemas/ObjectReference' AcceleratorSpec: type: object required: @@ -369,82 +359,42 @@ components: type: integer minimum: 1 AdapterCondition: - type: object - allOf: - - $ref: '#/components/schemas/ConditionBase' - description: |- - Condition in AdapterStatus - Used for standard Kubernetes condition types: "Available", "Applied", "Health" - Note: observed_generation is at AdapterStatus level, not per-condition, - since all conditions in one AdapterStatus share the same observed generation - AdapterStatus: type: object required: - - conditions - - created_time - - last_report_time + - type + - status + - last_transition_time properties: - conditions: - type: array - items: - $ref: '#/components/schemas/AdapterCondition' - description: |- - Kubernetes-style conditions tracking adapter state - Typically includes: Available, Applied, Health - created_time: + type: type: string - format: date-time - description: When this adapter status was first created (API-managed) - last_report_time: + description: Condition type + status: + $ref: '#/components/schemas/ConditionStatus' + reason: + type: string + description: Machine-readable reason code + message: + type: string + description: Human-readable message + last_transition_time: type: string format: date-time description: |- - When this adapter last reported its status (API-managed) - Updated every time the adapter POSTs, even if conditions haven't changed - Used by Sentinel to detect adapter liveness - allOf: - - $ref: '#/components/schemas/AdapterStatusBase' + When this condition last transitioned status (API-managed) + Only updated when status changes (True/False/Unknown), not when reason/message changes description: |- - AdapterStatus represents the complete status report from an adapter - Contains multiple conditions, job metadata, and adapter-specific data - example: - adapter: validator - observed_generation: 1 - conditions: - - type: Available - status: 'True' - reason: All validations passed - message: All 30 validation tests passed - last_transition_time: '2021-01-01T10:00:00Z' - - type: Applied - status: 'True' - reason: Validation job applied - message: Validation job applied successfully - last_transition_time: '2021-01-01T10:00:00Z' - - type: Health - status: 'True' - reason: All adapter operations completed successfully - message: All adapter runtime operations completed successfully - last_transition_time: '2021-01-01T10:00:00Z' - metadata: - job_name: validator-job-abc123 - job_namespace: hyperfleet-system - attempt: 1 - started_time: '2021-01-01T10:00:00Z' - completed_time: '2021-01-01T10:02:00Z' - duration: 2m - data: - validation_results: - total_tests: 30 - passed: 30 - failed: 0 - created_time: '2021-01-01T10:00:00Z' - last_report_time: '2021-01-01T10:02:00Z' - AdapterStatusBase: + Condition in AdapterStatus + Used for standard Kubernetes condition types: "Available", "Applied", "Health" + Note: observed_generation is at AdapterStatus level, not per-condition, + since all conditions in one AdapterStatus share the same observed generation + AdapterStatus: type: object required: - adapter - observed_generation + - conditions + - created_time + - last_report_time properties: adapter: type: string @@ -476,43 +426,46 @@ components: type: object additionalProperties: {} description: Adapter-specific data (structure varies by adapter type) - description: Base fields shared by AdapterStatus and AdapterStatusCreateRequest - AdapterStatusCreateRequest: - type: object - required: - - observed_time - - conditions - properties: - observed_time: - type: string - format: date-time - description: |- - When the adapter observed this resource state - API will use this to set AdapterStatus.last_report_time conditions: type: array items: - $ref: '#/components/schemas/ConditionRequest' - allOf: - - $ref: '#/components/schemas/AdapterStatusBase' - description: Request payload for creating/updating adapter status + $ref: '#/components/schemas/AdapterCondition' + description: |- + Kubernetes-style conditions tracking adapter state + Typically includes: Available, Applied, Health + created_time: + type: string + format: date-time + description: When this adapter status was first created (API-managed) + last_report_time: + type: string + format: date-time + description: |- + When this adapter last reported its status (API-managed) + Updated every time the adapter POSTs, even if conditions haven't changed + Used by Sentinel to detect adapter liveness + description: |- + AdapterStatus represents the complete status report from an adapter + Contains multiple conditions, job metadata, and adapter-specific data example: adapter: validator observed_generation: 1 - observed_time: '2021-01-01T10:00:00Z' conditions: - type: Available status: 'True' reason: All validations passed message: All 30 validation tests passed + last_transition_time: '2021-01-01T10:00:00Z' - type: Applied status: 'True' reason: Validation job applied message: Validation job applied successfully + last_transition_time: '2021-01-01T10:00:00Z' - type: Health status: 'True' reason: All adapter operations completed successfully message: All adapter runtime operations completed successfully + last_transition_time: '2021-01-01T10:00:00Z' metadata: job_name: validator-job-abc123 job_namespace: hyperfleet-system @@ -525,17 +478,32 @@ components: total_tests: 30 passed: 30 failed: 0 + created_time: '2021-01-01T10:00:00Z' + last_report_time: '2021-01-01T10:02:00Z' AdapterStatusList: type: object required: + - kind + - page + - size + - total - items properties: + kind: + type: string + page: + type: integer + format: int32 + size: + type: integer + format: int32 + total: + type: integer + format: int32 items: type: array items: $ref: '#/components/schemas/AdapterStatus' - allOf: - - $ref: '#/components/schemas/List' description: List of adapter statuses with pagination metadata example: kind: AdapterStatusList @@ -606,6 +574,8 @@ components: Cluster: type: object required: + - name + - spec - created_time - updated_time - created_by @@ -613,6 +583,28 @@ components: - generation - status properties: + id: + type: string + description: Resource identifier + kind: + type: string + description: Resource kind + href: + type: string + description: Resource URI + labels: + type: object + additionalProperties: + type: string + description: labels for the API resource as pairs of name:value strings + name: + type: string + minLength: 3 + maxLength: 63 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + description: Cluster name (unique) + spec: + $ref: '#/components/schemas/ClusterSpec' created_time: type: string format: date-time @@ -632,8 +624,6 @@ components: description: Generation field is updated on customer updates, reflecting the version of the "intent" of the customer status: $ref: '#/components/schemas/ClusterStatus' - allOf: - - $ref: '#/components/schemas/ClusterBase' example: kind: Cluster id: cluster-123 @@ -689,16 +679,26 @@ components: last_transition_time: '2021-01-01T10:01:00Z' created_by: user-123@example.com updated_by: user-123@example.com - ClusterBase: + ClusterCreateRequest: type: object required: - - kind - name - spec properties: + id: + type: string + description: Resource identifier kind: type: string - default: Cluster + description: Resource kind + href: + type: string + description: Resource URI + labels: + type: object + additionalProperties: + type: string + description: labels for the API resource as pairs of name:value strings name: type: string minLength: 3 @@ -706,18 +706,7 @@ components: pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ description: Cluster name (unique) spec: - allOf: - - $ref: '#/components/schemas/ClusterSpec' - description: |- - 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 - allOf: - - $ref: '#/components/schemas/APIResource' - ClusterCreateRequest: - type: object - allOf: - - $ref: '#/components/schemas/ClusterBase' + $ref: '#/components/schemas/ClusterSpec' example: kind: Cluster name: cluster-123 @@ -747,14 +736,27 @@ components: ClusterList: type: object required: + - kind + - page + - size + - total - items properties: + kind: + type: string + page: + type: integer + format: int32 + size: + type: integer + format: int32 + total: + type: integer + format: int32 items: type: array items: $ref: '#/components/schemas/Cluster' - allOf: - - $ref: '#/components/schemas/List' ClusterNetworkEntry: type: object properties: @@ -812,12 +814,7 @@ components: - conditions properties: phase: - allOf: - - $ref: '#/components/schemas/ResourcePhase' - description: |- - Current cluster phase (native database column). - Updated when conditions are reported. - Note: status.phase provides aggregated view from all conditions. + $ref: '#/components/schemas/ResourcePhase' last_transition_time: type: string format: date-time @@ -851,50 +848,6 @@ components: It is aggregated from condition updates posted to `/clusters/{id}/statuses`. Provides quick overview of all reported conditions and aggregated phase. - ConditionBase: - type: object - required: - - type - - status - - last_transition_time - properties: - type: - type: string - description: Condition type - status: - allOf: - - $ref: '#/components/schemas/ConditionStatus' - description: Condition status - reason: - type: string - description: Machine-readable reason code - message: - type: string - description: Human-readable message - last_transition_time: - type: string - format: date-time - description: |- - When this condition last transitioned status (API-managed) - Only updated when status changes (True/False/Unknown), not when reason/message changes - description: Base condition fields shared by all condition types - ConditionRequest: - type: object - required: - - type - - status - properties: - type: - type: string - status: - $ref: '#/components/schemas/ConditionStatus' - reason: - type: string - message: - type: string - description: |- - Condition data for create/update requests (from adapters) - observed_generation and observed_time are now at AdapterStatusCreateRequest level ConditionStatus: type: string enum: @@ -936,29 +889,6 @@ components: type: string description: Validation error message for this field description: Field-level validation errors (optional) - List: - type: object - required: - - kind - - page - - size - - total - - items - properties: - kind: - type: string - page: - type: integer - format: int32 - size: - type: integer - format: int32 - total: - type: integer - format: int32 - items: - type: array - items: {} NetworkingSpec: type: object properties: @@ -973,6 +903,8 @@ components: NodePool: type: object required: + - name + - spec - created_time - updated_time - created_by @@ -981,6 +913,28 @@ components: - owner_references - status properties: + id: + type: string + description: Resource identifier + kind: + type: string + description: Resource kind + href: + type: string + description: Resource URI + labels: + type: object + additionalProperties: + type: string + description: labels for the API resource as pairs of name:value strings + name: + type: string + minLength: 3 + maxLength: 63 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + description: NodePool name (unique in a cluster) + spec: + $ref: '#/components/schemas/NodePoolSpec' created_time: type: string format: date-time @@ -1002,8 +956,6 @@ components: $ref: '#/components/schemas/ObjectReference' status: $ref: '#/components/schemas/NodePoolStatus' - allOf: - - $ref: '#/components/schemas/NodePoolBase' example: kind: NodePool id: nodepool-123 @@ -1063,17 +1015,12 @@ components: created_time: '2021-01-01T10:01:00Z' last_updated_time: '2021-01-01T10:01:00Z' last_transition_time: '2021-01-01T10:01:00Z' - NodePoolBase: + NodePoolCreateRequest: type: object required: - name - spec properties: - labels: - type: object - additionalProperties: - type: string - description: labels for the API resource as pairs of name:value strings id: type: string description: Resource identifier @@ -1083,39 +1030,11 @@ components: href: type: string description: Resource URI - name: - type: string - minLength: 3 - maxLength: 63 - pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ - description: NodePool name (unique in a cluster) - spec: - allOf: - - $ref: '#/components/schemas/NodePoolSpec' - description: |- - 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 - NodePoolCreateRequest: - type: object - required: - - name - - spec - properties: labels: type: object additionalProperties: type: string description: labels for the API resource as pairs of name:value strings - id: - type: string - description: Resource identifier - kind: - type: string - description: Resource kind - href: - type: string - description: Resource URI name: type: string minLength: 3 @@ -1123,12 +1042,7 @@ components: pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ description: NodePool name (unique in a cluster) spec: - allOf: - - $ref: '#/components/schemas/NodePoolSpec' - description: |- - 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 + $ref: '#/components/schemas/NodePoolSpec' example: name: worker-pool-1 labels: @@ -1157,6 +1071,8 @@ components: NodePoolCreateResponse: type: object required: + - name + - spec - created_time - updated_time - created_by @@ -1164,9 +1080,29 @@ components: - generation - owner_references - status - - name - - spec properties: + id: + type: string + description: Resource identifier + kind: + type: string + description: Resource kind + href: + type: string + description: Resource URI + labels: + type: object + additionalProperties: + type: string + description: labels for the API resource as pairs of name:value strings + name: + type: string + minLength: 3 + maxLength: 63 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + description: NodePool name (unique in a cluster) + spec: + $ref: '#/components/schemas/NodePoolSpec' created_time: type: string format: date-time @@ -1188,44 +1124,30 @@ components: $ref: '#/components/schemas/ObjectReference' status: $ref: '#/components/schemas/NodePoolStatus' - labels: - type: object - additionalProperties: - type: string - description: labels for the API resource as pairs of name:value strings - id: - type: string - description: Resource identifier - kind: - type: string - description: Resource kind - href: - type: string - description: Resource URI - name: - type: string - minLength: 3 - maxLength: 63 - pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ - description: NodePool name (unique in a cluster) - spec: - allOf: - - $ref: '#/components/schemas/NodePoolSpec' - description: |- - 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 NodePoolList: type: object required: + - kind + - page + - size + - total - items properties: + kind: + type: string + page: + type: integer + format: int32 + size: + type: integer + format: int32 + total: + type: integer + format: int32 items: type: array items: $ref: '#/components/schemas/NodePool' - allOf: - - $ref: '#/components/schemas/List' NodePoolPlatform: type: object properties: @@ -1292,12 +1214,7 @@ components: - conditions properties: phase: - allOf: - - $ref: '#/components/schemas/ResourcePhase' - description: |- - Current NodePool phase (native database column). - Updated when conditions are reported. - Note: status.phase provides aggregated view from all conditions. + $ref: '#/components/schemas/ResourcePhase' observed_generation: type: integer format: int32 @@ -1354,10 +1271,30 @@ components: ResourceCondition: type: object required: + - type + - status + - last_transition_time - observed_generation - created_time - last_updated_time properties: + type: + type: string + description: Condition type + status: + $ref: '#/components/schemas/ConditionStatus' + reason: + type: string + description: Machine-readable reason code + message: + type: string + description: Human-readable message + last_transition_time: + type: string + format: date-time + description: |- + When this condition last transitioned status (API-managed) + Only updated when status changes (True/False/Unknown), not when reason/message changes observed_generation: type: integer format: int32 @@ -1373,8 +1310,6 @@ components: When the corresponding adapter last reported (API-managed) Updated every time the adapter POSTs, even if condition status hasn't changed Copied from AdapterStatus.last_report_time - allOf: - - $ref: '#/components/schemas/ConditionBase' description: |- Condition in Cluster/NodePool status Used for semantic condition types: "ValidationSuccessful", "DNSSuccessful", "NodePoolSuccessful", etc. diff --git a/schemas/gcp/swagger.yaml b/schemas/gcp/swagger.yaml index 57b7cc2..512776b 100644 --- a/schemas/gcp/swagger.yaml +++ b/schemas/gcp/swagger.yaml @@ -16,7 +16,7 @@ info: name: Apache 2.0 url: 'https://www.apache.org/licenses/LICENSE-2.0' title: HyperFleet API - version: 1.0.1 + version: 1.0.2 host: hyperfleet.redhat.com basePath: / schemes: @@ -27,6 +27,15 @@ paths: produces: - application/json parameters: + - description: >- + Filter results using TSL (Tree Search Language) query syntax. + + Examples: `status.phase='NotReady'`, `name in ('c1','c2')`, + `labels.region='us-east'` + in: query + name: search + required: false + type: string - default: 1 format: int32 in: query @@ -51,15 +60,6 @@ paths: name: order required: false type: string - - description: >- - Filter results using TSL (Tree Search Language) query syntax. - - Examples: `status.phase='NotReady'`, `name in ('c1','c2')`, - `labels.region='us-east'` - in: query - name: search - required: false - type: string responses: '200': description: The request has succeeded. @@ -157,6 +157,15 @@ paths: name: cluster_id required: true type: string + - description: >- + Filter results using TSL (Tree Search Language) query syntax. + + Examples: `status.phase='NotReady'`, `name in ('c1','c2')`, + `labels.region='us-east'` + in: query + name: search + required: false + type: string - default: 1 format: int32 in: query @@ -181,15 +190,6 @@ paths: name: order required: false type: string - - description: >- - Filter results using TSL (Tree Search Language) query syntax. - - Examples: `status.phase='NotReady'`, `name in ('c1','c2')`, - `labels.region='us-east'` - in: query - name: search - required: false - type: string responses: '200': description: The request has succeeded. @@ -285,6 +285,15 @@ paths: name: nodepool_id required: true type: string + - description: >- + Filter results using TSL (Tree Search Language) query syntax. + + Examples: `status.phase='NotReady'`, `name in ('c1','c2')`, + `labels.region='us-east'` + in: query + name: search + required: false + type: string - default: 1 format: int32 in: query @@ -309,15 +318,6 @@ paths: name: order required: false type: string - - description: >- - Filter results using TSL (Tree Search Language) query syntax. - - Examples: `status.phase='NotReady'`, `name in ('c1','c2')`, - `labels.region='us-east'` - in: query - name: search - required: false - type: string responses: '200': description: The request has succeeded. @@ -342,6 +342,15 @@ paths: name: cluster_id required: true type: string + - description: >- + Filter results using TSL (Tree Search Language) query syntax. + + Examples: `status.phase='NotReady'`, `name in ('c1','c2')`, + `labels.region='us-east'` + in: query + name: search + required: false + type: string - default: 1 format: int32 in: query @@ -366,15 +375,6 @@ paths: name: order required: false type: string - - description: >- - Filter results using TSL (Tree Search Language) query syntax. - - Examples: `status.phase='NotReady'`, `name in ('c1','c2')`, - `labels.region='us-east'` - in: query - name: search - required: false - type: string responses: '200': description: The request has succeeded. @@ -394,6 +394,15 @@ paths: produces: - application/json parameters: + - description: >- + Filter results using TSL (Tree Search Language) query syntax. + + Examples: `status.phase='NotReady'`, `name in ('c1','c2')`, + `labels.region='us-east'` + in: query + name: search + required: false + type: string - default: 1 format: int32 in: query @@ -418,15 +427,6 @@ paths: name: order required: false type: string - - description: >- - Filter results using TSL (Tree Search Language) query syntax. - - Examples: `status.phase='NotReady'`, `name in ('c1','c2')`, - `labels.region='us-east'` - in: query - name: search - required: false - type: string responses: '200': description: The request has succeeded. @@ -444,16 +444,6 @@ paths: operationId: getNodePools summary: List all nodepools for cluster definitions: - APIResource: - allOf: - - $ref: '#/definitions/ObjectReference' - properties: - labels: - additionalProperties: - type: string - description: 'labels for the API resource as pairs of name:value strings' - type: object - type: object AcceleratorSpec: properties: count: @@ -466,8 +456,6 @@ definitions: - count type: object AdapterCondition: - allOf: - - $ref: '#/definitions/ConditionBase' description: >- Condition in AdapterStatus @@ -478,10 +466,32 @@ definitions: since all conditions in one AdapterStatus share the same observed generation + properties: + last_transition_time: + description: >- + When this condition last transitioned status (API-managed) + + Only updated when status changes (True/False/Unknown), not when + reason/message changes + format: date-time + type: string + message: + description: Human-readable message + type: string + reason: + description: Machine-readable reason code + type: string + status: + $ref: '#/definitions/ConditionStatus' + type: + description: Condition type + type: string + required: + - type + - status + - last_transition_time type: object AdapterStatus: - allOf: - - $ref: '#/definitions/AdapterStatusBase' description: |- AdapterStatus represents the complete status report from an adapter Contains multiple conditions, job metadata, and adapter-specific data @@ -519,6 +529,9 @@ definitions: started_time: '2021-01-01T10:00:00Z' observed_generation: 1 properties: + adapter: + description: 'Adapter name (e.g., "validator", "dns", "provisioner")' + type: string conditions: description: |- Kubernetes-style conditions tracking adapter state @@ -530,6 +543,10 @@ definitions: description: When this adapter status was first created (API-managed) format: date-time type: string + data: + additionalProperties: {} + description: Adapter-specific data (structure varies by adapter type) + type: object last_report_time: description: >- When this adapter last reported its status (API-managed) @@ -540,21 +557,6 @@ definitions: Used by Sentinel to detect adapter liveness format: date-time type: string - required: - - conditions - - created_time - - last_report_time - type: object - AdapterStatusBase: - description: Base fields shared by AdapterStatus and AdapterStatusCreateRequest - properties: - adapter: - description: 'Adapter name (e.g., "validator", "dns", "provisioner")' - type: string - data: - additionalProperties: {} - description: Adapter-specific data (structure varies by adapter type) - type: object metadata: description: Job execution metadata properties: @@ -581,58 +583,11 @@ definitions: required: - adapter - observed_generation - type: object - AdapterStatusCreateRequest: - allOf: - - $ref: '#/definitions/AdapterStatusBase' - description: Request payload for creating/updating adapter status - example: - adapter: validator - conditions: - - message: All 30 validation tests passed - reason: All validations passed - status: 'True' - type: Available - - message: Validation job applied successfully - reason: Validation job applied - status: 'True' - type: Applied - - message: All adapter runtime operations completed successfully - reason: All adapter operations completed successfully - status: 'True' - type: Health - data: - validation_results: - failed: 0 - passed: 30 - total_tests: 30 - metadata: - attempt: 1 - completed_time: '2021-01-01T10:02:00Z' - duration: 2m - job_name: validator-job-abc123 - job_namespace: hyperfleet-system - started_time: '2021-01-01T10:00:00Z' - observed_generation: 1 - observed_time: '2021-01-01T10:00:00Z' - properties: - conditions: - items: - $ref: '#/definitions/ConditionRequest' - type: array - observed_time: - description: |- - When the adapter observed this resource state - API will use this to set AdapterStatus.last_report_time - format: date-time - type: string - required: - - observed_time - conditions + - created_time + - last_report_time type: object AdapterStatusList: - allOf: - - $ref: '#/definitions/List' description: List of adapter statuses with pagination metadata example: items: @@ -668,7 +623,22 @@ definitions: items: $ref: '#/definitions/AdapterStatus' type: array + kind: + type: string + page: + format: int32 + type: integer + size: + format: int32 + type: integer + total: + format: int32 + type: integer required: + - kind + - page + - size + - total - items type: object AutoscalingSpec: @@ -709,8 +679,6 @@ definitions: - scheme type: object Cluster: - allOf: - - $ref: '#/definitions/ClusterBase' example: created_by: user-123@example.com created_time: '2021-01-01T00:00:00Z' @@ -780,6 +748,28 @@ definitions: format: int32 minimum: 1 type: integer + href: + description: Resource URI + type: string + id: + description: Resource identifier + type: string + kind: + description: Resource kind + type: string + labels: + additionalProperties: + type: string + description: 'labels for the API resource as pairs of name:value strings' + type: object + name: + description: Cluster name (unique) + maxLength: 63 + minLength: 3 + pattern: '^[a-z0-9]([-a-z0-9]*[a-z0-9])?$' + type: string + spec: + $ref: '#/definitions/ClusterSpec' status: $ref: '#/definitions/ClusterStatus' updated_by: @@ -789,6 +779,8 @@ definitions: format: date-time type: string required: + - name + - spec - created_time - updated_time - created_by @@ -796,37 +788,7 @@ definitions: - generation - status type: object - ClusterBase: - allOf: - - $ref: '#/definitions/APIResource' - properties: - kind: - default: Cluster - type: string - name: - description: Cluster name (unique) - maxLength: 63 - minLength: 3 - pattern: '^[a-z0-9]([-a-z0-9]*[a-z0-9])?$' - type: string - spec: - allOf: - - $ref: '#/definitions/ClusterSpec' - description: >- - 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 - required: - - kind - - name - - spec - type: object ClusterCreateRequest: - allOf: - - $ref: '#/definitions/ClusterBase' example: kind: Cluster labels: @@ -853,16 +815,55 @@ definitions: release: image: 'registry.redhat.io/openshift4/ose-cluster-version-operator:v4.14.0' version: 4.14.0 + properties: + href: + description: Resource URI + type: string + id: + description: Resource identifier + type: string + kind: + description: Resource kind + type: string + labels: + additionalProperties: + type: string + description: 'labels for the API resource as pairs of name:value strings' + type: object + name: + description: Cluster name (unique) + maxLength: 63 + minLength: 3 + pattern: '^[a-z0-9]([-a-z0-9]*[a-z0-9])?$' + type: string + spec: + $ref: '#/definitions/ClusterSpec' + required: + - name + - spec type: object ClusterList: - allOf: - - $ref: '#/definitions/List' properties: items: items: $ref: '#/definitions/Cluster' type: array + kind: + type: string + page: + format: int32 + type: integer + size: + format: int32 + type: integer + total: + format: int32 + type: integer required: + - kind + - page + - size + - total - items type: object ClusterNetworkEntry: @@ -961,12 +962,7 @@ definitions: format: int32 type: integer phase: - allOf: - - $ref: '#/definitions/ResourcePhase' - description: |- - Current cluster phase (native database column). - Updated when conditions are reported. - Note: status.phase provides aggregated view from all conditions. + $ref: '#/definitions/ResourcePhase' required: - phase - last_transition_time @@ -974,54 +970,6 @@ definitions: - last_updated_time - conditions type: object - ConditionBase: - description: Base condition fields shared by all condition types - properties: - last_transition_time: - description: >- - When this condition last transitioned status (API-managed) - - Only updated when status changes (True/False/Unknown), not when - reason/message changes - format: date-time - type: string - message: - description: Human-readable message - type: string - reason: - description: Machine-readable reason code - type: string - status: - allOf: - - $ref: '#/definitions/ConditionStatus' - description: Condition status - type: - description: Condition type - type: string - required: - - type - - status - - last_transition_time - type: object - ConditionRequest: - description: >- - Condition data for create/update requests (from adapters) - - observed_generation and observed_time are now at - AdapterStatusCreateRequest level - properties: - message: - type: string - reason: - type: string - status: - $ref: '#/definitions/ConditionStatus' - type: - type: string - required: - - type - - status - type: object ConditionStatus: description: Status value for conditions enum: @@ -1063,29 +1011,6 @@ definitions: reason: type: string type: object - List: - properties: - items: - items: {} - type: array - kind: - type: string - page: - format: int32 - type: integer - size: - format: int32 - type: integer - total: - format: int32 - type: integer - required: - - kind - - page - - size - - total - - items - type: object NetworkingSpec: properties: clusterNetwork: @@ -1098,8 +1023,6 @@ definitions: type: array type: object NodePool: - allOf: - - $ref: '#/definitions/NodePoolBase' example: created_by: user-123@example.com created_time: '2021-01-01T00:00:00Z' @@ -1173,27 +1096,6 @@ definitions: format: int32 minimum: 1 type: integer - owner_references: - $ref: '#/definitions/ObjectReference' - status: - $ref: '#/definitions/NodePoolStatus' - updated_by: - format: email - type: string - updated_time: - format: date-time - type: string - required: - - created_time - - updated_time - - created_by - - updated_by - - generation - - owner_references - - status - type: object - NodePoolBase: - properties: href: description: Resource URI type: string @@ -1214,19 +1116,28 @@ definitions: minLength: 3 pattern: '^[a-z0-9]([-a-z0-9]*[a-z0-9])?$' type: string + owner_references: + $ref: '#/definitions/ObjectReference' spec: - allOf: - - $ref: '#/definitions/NodePoolSpec' - description: >- - 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 + $ref: '#/definitions/NodePoolSpec' + status: + $ref: '#/definitions/NodePoolStatus' + updated_by: + format: email + type: string + updated_time: + format: date-time + type: string required: - name - spec + - created_time + - updated_time + - created_by + - updated_by + - generation + - owner_references + - status type: object NodePoolCreateRequest: example: @@ -1276,15 +1187,7 @@ definitions: pattern: '^[a-z0-9]([-a-z0-9]*[a-z0-9])?$' type: string spec: - allOf: - - $ref: '#/definitions/NodePoolSpec' - description: >- - 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 + $ref: '#/definitions/NodePoolSpec' required: - name - spec @@ -1327,15 +1230,7 @@ definitions: owner_references: $ref: '#/definitions/ObjectReference' spec: - allOf: - - $ref: '#/definitions/NodePoolSpec' - description: >- - 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 + $ref: '#/definitions/NodePoolSpec' status: $ref: '#/definitions/NodePoolStatus' updated_by: @@ -1345,6 +1240,8 @@ definitions: format: date-time type: string required: + - name + - spec - created_time - updated_time - created_by @@ -1352,18 +1249,29 @@ definitions: - generation - owner_references - status - - name - - spec type: object NodePoolList: - allOf: - - $ref: '#/definitions/List' properties: items: items: $ref: '#/definitions/NodePool' type: array + kind: + type: string + page: + format: int32 + type: integer + size: + format: int32 + type: integer + total: + format: int32 + type: integer required: + - kind + - page + - size + - total - items type: object NodePoolPlatform: @@ -1463,12 +1371,7 @@ definitions: minimum: 1 type: integer phase: - allOf: - - $ref: '#/definitions/ResourcePhase' - description: |- - Current NodePool phase (native database column). - Updated when conditions are reported. - Note: status.phase provides aggregated view from all conditions. + $ref: '#/definitions/ResourcePhase' required: - phase - observed_generation @@ -1501,8 +1404,6 @@ definitions: type: string type: object ResourceCondition: - allOf: - - $ref: '#/definitions/ConditionBase' description: >- Condition in Cluster/NodePool status @@ -1516,6 +1417,14 @@ definitions: description: When this condition was first created (API-managed) format: date-time type: string + last_transition_time: + description: >- + When this condition last transitioned status (API-managed) + + Only updated when status changes (True/False/Unknown), not when + reason/message changes + format: date-time + type: string last_updated_time: description: >- When the corresponding adapter last reported (API-managed) @@ -1526,11 +1435,25 @@ definitions: Copied from AdapterStatus.last_report_time format: date-time type: string + message: + description: Human-readable message + type: string observed_generation: description: Generation of the spec that this condition reflects format: int32 type: integer + reason: + description: Machine-readable reason code + type: string + status: + $ref: '#/definitions/ConditionStatus' + type: + description: Condition type + type: string required: + - type + - status + - last_transition_time - observed_generation - created_time - last_updated_time