-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat OCM-12069 | add class and resources for cluster migrations
- Loading branch information
Showing
7 changed files
with
194 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
Copyright (c) 2025 Red Hat, Inc. | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
// Manages a specific cluster migration. | ||
resource ClusterMigration { | ||
// Retrieves the details of the cluster migration. | ||
method Get { | ||
out Body ClusterMigration | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
Copyright (c) 2025 Red Hat, Inc. | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
// The state of the cluster migration. | ||
enum ClusterMigrationState { | ||
@json(name = "scheduled") | ||
Scheduled | ||
|
||
@json(name = "in progress") | ||
InProgress | ||
|
||
@json(name = "completed") | ||
Completed | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
Copyright (c) 2025 Red Hat, Inc. | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
// Representation of a cluster migration. | ||
class ClusterMigration { | ||
// Internal cluster ID. | ||
ClusterID string | ||
|
||
// Type of cluster migration. The rest of the attributes will be populated according to this | ||
// value. For example, if the type is `sdnToOvn` then only the `SdnToOvn` attribute will be | ||
// populated. | ||
Type ClusterMigrationType | ||
|
||
// The state of the cluster migration. | ||
State ClusterMigrationState | ||
|
||
// Details for `SdnToOvn` cluster migrations. | ||
SdnToOvn SdnToOvnClusterMigration | ||
|
||
// Date and time when the cluster migration was initially created, using the | ||
// format defined in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt). | ||
CreationTimestamp Date | ||
|
||
// Date and time when the cluster migration was last updated, using the | ||
// format defined in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt). | ||
UpdatedTimestamp Date | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* | ||
Copyright (c) 2025 Red Hat, Inc. | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
// Type of cluster migration. | ||
enum ClusterMigrationType { | ||
@json(name = "SdnToOvnClusterMigration") | ||
SdnToOvn | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
Copyright (c) 2025 Red Hat, Inc. | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
// Manages the collection of cluster migrations of a cluster. | ||
resource ClusterMigrations { | ||
method List { | ||
// Index of the returned page, where one corresponds to the first page. As this | ||
// collection doesn't support paging the result will always be `1`. | ||
in out Page Integer = 1 | ||
|
||
// Number of items that will be contained in the returned page. As this collection | ||
// doesn't support paging or searching the result will always be the total number of | ||
// migrations of the cluster. | ||
in out Size Integer = 100 | ||
|
||
// Total number of items of the collection that match the search criteria, | ||
// regardless of the size of the page. As this collection doesn't support paging or | ||
// searching the result will always be the total number of migrations of the cluster. | ||
out Total Integer | ||
|
||
// Retrieved list of cluster migrations. | ||
out Items []ClusterMigration | ||
} | ||
|
||
// Adds a cluster migration to the database. | ||
method Add { | ||
// Description of the cluster migration. | ||
in out Body ClusterMigration | ||
} | ||
|
||
// Returns a reference to the service that manages a specific cluster migration. | ||
locator ClusterMigration { | ||
target ClusterMigration | ||
variable ID | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
model/clusters_mgmt/v1/sdn_to_ovn_cluster_migration_type.model
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
Copyright (c) 2025 Red Hat, Inc. | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
// Details for `SdnToOvn` cluster migrations. | ||
struct SdnToOvnClusterMigration { | ||
// The IP address range to use for the internalTransSwitchSubnet parameter of OVN-Kubernetes | ||
// upon migration. | ||
TransitIpv4 String | ||
|
||
// The IP address range to use for the internalJoinSubnet parameter of OVN-Kubernetes | ||
// upon migration. | ||
JoinIpv4 String | ||
|
||
// The IP address range to us for the internalMasqueradeSubnet parameter of OVN-Kubernetes | ||
// upon migration. | ||
MasqueradeIpv4 String | ||
} |