Skip to content

Commit 0f0a404

Browse files
Merge pull request #29 from 86254860/HYPERFLEET-732-replace-id-with-uuid
HYPERFLEET-732 - feat: replace existing IDs with RFC4122 UUID v7 for both Cluster and NodePool IDs
2 parents 6b9148e + eae1c79 commit 0f0a404

10 files changed

Lines changed: 48 additions & 41 deletions

File tree

main.tsp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ using OpenAPI;
2020
*
2121
*/
2222
@service(#{ title: "HyperFleet API" })
23-
@info(#{ version: "1.0.4", contact: #{ name: "HyperFleet Team" }, license: #{ name: "Apache 2.0" ,url: "https://www.apache.org/licenses/LICENSE-2.0"} })
23+
@info(#{ version: "1.0.5", contact: #{ name: "HyperFleet Team" }, license: #{ name: "Apache 2.0" ,url: "https://www.apache.org/licenses/LICENSE-2.0"} })
2424
@server("https://hyperfleet.redhat.com", "Production")
2525
@route("/api/hyperfleet/v1")
2626
namespace HyperFleet;

models-core/cluster/example_cluster.tsp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import "../../models/common/model.tsp";
44

55
const exampleCluster: Cluster = #{
66
kind: "Cluster",
7-
id: "cluster-123",
8-
href: "https://api.hyperfleet.com/v1/clusters/cluster-123",
7+
id: "019466a0-8f8e-7abc-9def-0123456789ab",
8+
href: "https://api.hyperfleet.com/v1/clusters/019466a0-8f8e-7abc-9def-0123456789ab",
99
name: "cluster-123",
1010
labels: #{ environment: "production", team: "platform" },
1111
spec: #{},

models-core/nodepool/example_nodepool.tsp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import "../../models/common/model.tsp";
44

55
const exampleNodePool: NodePool = #{
66
kind: "NodePool",
7-
id: "nodepool-123",
8-
href: "https://api.hyperfleet.com/v1/nodepools/nodepool-123",
7+
id: "019466a1-2b3c-7def-8abc-456789abcdef",
8+
href: "https://api.hyperfleet.com/v1/nodepools/019466a1-2b3c-7def-8abc-456789abcdef",
99
name: "worker-pool-1",
1010
labels: #{ environment: "production", pooltype: "worker" },
1111
spec: #{},
@@ -15,9 +15,9 @@ const exampleNodePool: NodePool = #{
1515
created_by: "user-123@example.com",
1616
updated_by: "user-123@example.com",
1717
owner_references: #{
18-
id: "cluster-123",
18+
id: "019466a0-8f8e-7abc-9def-0123456789ab",
1919
kind: "Cluster",
20-
href: "https://api.hyperfleet.com/v1/clusters/cluster-123",
20+
href: "https://api.hyperfleet.com/v1/clusters/019466a0-8f8e-7abc-9def-0123456789ab",
2121
},
2222
status: #{
2323
conditions: #[

models-gcp/cluster/example_cluster.tsp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import "../../models/common/model.tsp";
44

55
const exampleCluster: Cluster = #{
66
kind: "Cluster",
7-
id: "cluster-123",
8-
href: "https://api.hyperfleet.com/v1/clusters/cluster-123",
7+
id: "019466a0-8f8e-7abc-9def-0123456789ab",
8+
href: "https://api.hyperfleet.com/v1/clusters/019466a0-8f8e-7abc-9def-0123456789ab",
99
name: "cluster-123",
1010
labels: #{ environment: "production", team: "platform" },
1111
spec: #{

models-gcp/nodepool/example_nodepool.tsp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import "../../models/nodepools/model.tsp";
33

44
const exampleNodePool: NodePool = #{
55
kind: "NodePool",
6-
id: "nodepool-123",
7-
href: "https://api.hyperfleet.com/v1/nodepools/nodepool-123",
6+
id: "019466a1-2b3c-7def-8abc-456789abcdef",
7+
href: "https://api.hyperfleet.com/v1/nodepools/019466a1-2b3c-7def-8abc-456789abcdef",
88
name: "worker-pool-1",
99
labels: #{ environment: "production", pooltype: "worker" },
1010
generation: 1,
@@ -36,9 +36,9 @@ const exampleNodePool: NodePool = #{
3636
created_by: "user-123@example.com",
3737
updated_by: "user-123@example.com",
3838
owner_references: #{
39-
id: "cluster-123",
39+
id: "019466a0-8f8e-7abc-9def-0123456789ab",
4040
kind: "Cluster",
41-
href: "https://api.hyperfleet.com/v1/clusters/cluster-123",
41+
href: "https://api.hyperfleet.com/v1/clusters/019466a0-8f8e-7abc-9def-0123456789ab",
4242
},
4343
status: #{
4444
conditions: #[

models/common/model.tsp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import "@typespec/openapi";
33
using Http;
44
using OpenAPI;
55

6+
/** Resource identifier in RFC4122 UUID v7 format (time-ordered, e.g., "019466a0-8f8e-7abc-9def-0123456789ab") */
67
alias Identifier = string;
78

89
alias KindCluster = "Cluster";

schemas/core/openapi.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
openapi: 3.0.0
22
info:
33
title: HyperFleet API
4-
version: 1.0.4
4+
version: 1.0.5
55
contact:
66
name: HyperFleet Team
77
license:
@@ -754,8 +754,8 @@ components:
754754
$ref: '#/components/schemas/ClusterStatus'
755755
example:
756756
kind: Cluster
757-
id: cluster-123
758-
href: https://api.hyperfleet.com/v1/clusters/cluster-123
757+
id: 019466a0-8f8e-7abc-9def-0123456789ab
758+
href: https://api.hyperfleet.com/v1/clusters/019466a0-8f8e-7abc-9def-0123456789ab
759759
name: cluster-123
760760
labels:
761761
environment: production
@@ -1013,8 +1013,8 @@ components:
10131013
$ref: '#/components/schemas/NodePoolStatus'
10141014
example:
10151015
kind: NodePool
1016-
id: nodepool-123
1017-
href: https://api.hyperfleet.com/v1/nodepools/nodepool-123
1016+
id: 019466a1-2b3c-7def-8abc-456789abcdef
1017+
href: https://api.hyperfleet.com/v1/nodepools/019466a1-2b3c-7def-8abc-456789abcdef
10181018
name: worker-pool-1
10191019
labels:
10201020
environment: production
@@ -1026,9 +1026,9 @@ components:
10261026
created_by: user-123@example.com
10271027
updated_by: user-123@example.com
10281028
owner_references:
1029-
id: cluster-123
1029+
id: 019466a0-8f8e-7abc-9def-0123456789ab
10301030
kind: Cluster
1031-
href: https://api.hyperfleet.com/v1/clusters/cluster-123
1031+
href: https://api.hyperfleet.com/v1/clusters/019466a0-8f8e-7abc-9def-0123456789ab
10321032
status:
10331033
conditions:
10341034
- type: Ready

schemas/core/swagger.yaml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ info:
1616
name: Apache 2.0
1717
url: 'https://www.apache.org/licenses/LICENSE-2.0'
1818
title: HyperFleet API
19-
version: 1.0.4
19+
version: 1.0.5
2020
host: hyperfleet.redhat.com
2121
basePath: /
2222
schemes:
@@ -830,8 +830,9 @@ definitions:
830830
created_by: user-123@example.com
831831
created_time: '2021-01-01T00:00:00Z'
832832
generation: 1
833-
href: 'https://api.hyperfleet.com/v1/clusters/cluster-123'
834-
id: cluster-123
833+
href: >-
834+
https://api.hyperfleet.com/v1/clusters/019466a0-8f8e-7abc-9def-0123456789ab
835+
id: 019466a0-8f8e-7abc-9def-0123456789ab
835836
kind: Cluster
836837
labels:
837838
environment: production
@@ -1100,16 +1101,18 @@ definitions:
11001101
created_by: user-123@example.com
11011102
created_time: '2021-01-01T00:00:00Z'
11021103
generation: 1
1103-
href: 'https://api.hyperfleet.com/v1/nodepools/nodepool-123'
1104-
id: nodepool-123
1104+
href: >-
1105+
https://api.hyperfleet.com/v1/nodepools/019466a1-2b3c-7def-8abc-456789abcdef
1106+
id: 019466a1-2b3c-7def-8abc-456789abcdef
11051107
kind: NodePool
11061108
labels:
11071109
environment: production
11081110
pooltype: worker
11091111
name: worker-pool-1
11101112
owner_references:
1111-
href: 'https://api.hyperfleet.com/v1/clusters/cluster-123'
1112-
id: cluster-123
1113+
href: >-
1114+
https://api.hyperfleet.com/v1/clusters/019466a0-8f8e-7abc-9def-0123456789ab
1115+
id: 019466a0-8f8e-7abc-9def-0123456789ab
11131116
kind: Cluster
11141117
spec: {}
11151118
status:

schemas/gcp/openapi.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
openapi: 3.0.0
22
info:
33
title: HyperFleet API
4-
version: 1.0.4
4+
version: 1.0.5
55
contact:
66
name: HyperFleet Team
77
license:
@@ -633,8 +633,8 @@ components:
633633
$ref: '#/components/schemas/ClusterStatus'
634634
example:
635635
kind: Cluster
636-
id: cluster-123
637-
href: https://api.hyperfleet.com/v1/clusters/cluster-123
636+
id: 019466a0-8f8e-7abc-9def-0123456789ab
637+
href: https://api.hyperfleet.com/v1/clusters/019466a0-8f8e-7abc-9def-0123456789ab
638638
name: cluster-123
639639
labels:
640640
environment: production
@@ -970,8 +970,8 @@ components:
970970
$ref: '#/components/schemas/NodePoolStatus'
971971
example:
972972
kind: NodePool
973-
id: nodepool-123
974-
href: https://api.hyperfleet.com/v1/nodepools/nodepool-123
973+
id: 019466a1-2b3c-7def-8abc-456789abcdef
974+
href: https://api.hyperfleet.com/v1/nodepools/019466a1-2b3c-7def-8abc-456789abcdef
975975
name: worker-pool-1
976976
labels:
977977
environment: production
@@ -1002,9 +1002,9 @@ components:
10021002
created_by: user-123@example.com
10031003
updated_by: user-123@example.com
10041004
owner_references:
1005-
id: cluster-123
1005+
id: 019466a0-8f8e-7abc-9def-0123456789ab
10061006
kind: Cluster
1007-
href: https://api.hyperfleet.com/v1/clusters/cluster-123
1007+
href: https://api.hyperfleet.com/v1/clusters/019466a0-8f8e-7abc-9def-0123456789ab
10081008
status:
10091009
conditions:
10101010
- type: Ready

schemas/gcp/swagger.yaml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ info:
1616
name: Apache 2.0
1717
url: 'https://www.apache.org/licenses/LICENSE-2.0'
1818
title: HyperFleet API
19-
version: 1.0.4
19+
version: 1.0.5
2020
host: hyperfleet.redhat.com
2121
basePath: /
2222
schemes:
@@ -698,8 +698,9 @@ definitions:
698698
created_by: user-123@example.com
699699
created_time: '2021-01-01T00:00:00Z'
700700
generation: 1
701-
href: 'https://api.hyperfleet.com/v1/clusters/cluster-123'
702-
id: cluster-123
701+
href: >-
702+
https://api.hyperfleet.com/v1/clusters/019466a0-8f8e-7abc-9def-0123456789ab
703+
id: 019466a0-8f8e-7abc-9def-0123456789ab
703704
kind: Cluster
704705
labels:
705706
environment: production
@@ -1044,16 +1045,18 @@ definitions:
10441045
created_by: user-123@example.com
10451046
created_time: '2021-01-01T00:00:00Z'
10461047
generation: 1
1047-
href: 'https://api.hyperfleet.com/v1/nodepools/nodepool-123'
1048-
id: nodepool-123
1048+
href: >-
1049+
https://api.hyperfleet.com/v1/nodepools/019466a1-2b3c-7def-8abc-456789abcdef
1050+
id: 019466a1-2b3c-7def-8abc-456789abcdef
10491051
kind: NodePool
10501052
labels:
10511053
environment: production
10521054
pooltype: worker
10531055
name: worker-pool-1
10541056
owner_references:
1055-
href: 'https://api.hyperfleet.com/v1/clusters/cluster-123'
1056-
id: cluster-123
1057+
href: >-
1058+
https://api.hyperfleet.com/v1/clusters/019466a0-8f8e-7abc-9def-0123456789ab
1059+
id: 019466a0-8f8e-7abc-9def-0123456789ab
10571060
kind: Cluster
10581061
spec:
10591062
autoscaling:

0 commit comments

Comments
 (0)