-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #596 from gabriel-farache/osdfm_model
Add osd fleet mgmt model
- Loading branch information
Showing
13 changed files
with
474 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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
.vscode/ | ||
.idea/ | ||
/metamodel | ||
/openapi/ |
25 changes: 25 additions & 0 deletions
25
model/osd_fleet_mgmt/v1/cluster_management_reference_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,25 @@ | ||
/* | ||
Copyright (c) 2022 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. | ||
*/ | ||
|
||
// Cluster Mgmt reference settings of the cluster. | ||
struct ClusterManagementReference { | ||
// Cluster Mgmt ID | ||
ClusterId String | ||
|
||
// Reference link to external cluster_mgmt service based on ClusterId field | ||
// ClusterId is not the name of the field used by the external cluster_mgmt service | ||
Href String | ||
} |
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,62 @@ | ||
/* | ||
Copyright (c) 2022 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. | ||
*/ | ||
|
||
// DNS settings of the cluster. | ||
struct DNS { | ||
// Base DNS domain of the cluster. | ||
// | ||
// During the installation of the cluster it is necessary to create multiple DNS records. | ||
// They will be created as sub-domains of this domain. For example, if the name of the | ||
// cluster is `mycluster` and the base domain is `example.com` then the following DNS | ||
// records will be created: | ||
// | ||
// ``` | ||
// mycluster-api.example.com | ||
// mycluster-etcd-0.example.com | ||
// mycluster-etcd-1.example.com | ||
// mycluster-etcd-3.example.com | ||
// ``` | ||
// | ||
// The exact number, type and names of the created DNS record depends on the characteristics | ||
// of the cluster, and may be different for different versions of _OpenShift_. Please don't | ||
// rely on them. For example, to find what is the URL of the Kubernetes API server of the | ||
// cluster don't assume that it will be `mycluster-api.example.com`. Instead of that use | ||
// this API to retrieve the description of the cluster, and get it from the `api.url` | ||
// attribute. For example, if the identifier of the cluster is `123` send a request like | ||
// this: | ||
// | ||
// ```http | ||
// GET /api/clusters_mgmt/v1/clusters/123 HTTP/1.1 | ||
// ``` | ||
// | ||
// That will return a response like this, including the `api.url` attribute: | ||
// | ||
// ```json | ||
// { | ||
// "kind": "Cluster", | ||
// "id": "123", | ||
// "href": "/api/clusters_mgmt/v1/clusters/123", | ||
// "api": { | ||
// "url": "https://mycluster-api.example.com:6443" | ||
// }, | ||
// ... | ||
// } | ||
// ``` | ||
// | ||
// When the cluster is created in Amazon Web Services it is necessary to create this base | ||
// DNS domain in advance, using AWS Route53 (https://console.aws.amazon.com/route53). | ||
BaseDomain String | ||
} |
27 changes: 27 additions & 0 deletions
27
model/osd_fleet_mgmt/v1/management_cluster_parent_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,27 @@ | ||
/* | ||
Copyright (c) 2022 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. | ||
*/ | ||
|
||
// Cluster Mgmt reference settings of the cluster. | ||
struct ManagementClusterParent { | ||
// Parent Cluster ID | ||
ClusterId String | ||
|
||
// Reference link to internal parent cluster | ||
Href String | ||
|
||
// Kind of internal parent cluster | ||
Kind String | ||
} |
19 changes: 19 additions & 0 deletions
19
model/osd_fleet_mgmt/v1/management_cluster_request_payload.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,19 @@ | ||
/* | ||
Copyright (c) 2022 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. | ||
*/ | ||
|
||
struct ManagementClusterRequestPayload { | ||
service_cluster_id String | ||
} |
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,35 @@ | ||
/* | ||
Copyright (c) 2022 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 service cluster. | ||
resource ManagementCluster { | ||
// Retrieves the details of the cluster. | ||
method Get { | ||
out Body ManagementCluster | ||
} | ||
|
||
// Updates the service cluster. | ||
method Post { | ||
in Request ManagementClusterRequestPayload | ||
out Response ManagementCluster | ||
} | ||
|
||
// Deletes the service cluster. | ||
method Delete { | ||
|
||
} | ||
|
||
} |
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,72 @@ | ||
/* | ||
Copyright (c) 2022 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. | ||
*/ | ||
|
||
// Definition of an _OpenShift_ cluster. | ||
// | ||
// The `cloud_provider` attribute is a reference to the cloud provider. When a | ||
// cluster is retrieved it will be a link to the cloud provider, containing only | ||
// the kind, id and href attributes: | ||
// | ||
// ```json | ||
// { | ||
// "cloud_provider": { | ||
// "kind": "CloudProviderLink", | ||
// "id": "123", | ||
// "href": "/api/clusters_mgmt/v1/cloud_providers/123" | ||
// } | ||
// } | ||
// ``` | ||
// | ||
// When a cluster is created this is optional, and if used it should contain the | ||
// identifier of the cloud provider to use: | ||
// | ||
// ```json | ||
// { | ||
// "cloud_provider": { | ||
// "id": "123", | ||
// } | ||
// } | ||
// ``` | ||
// | ||
// If not included, then the cluster will be created using the default cloud | ||
// provider, which is currently Amazon Web Services. | ||
// | ||
// The region attribute is mandatory when a cluster is created. | ||
// | ||
// The `aws.access_key_id`, `aws.secret_access_key` and `dns.base_domain` | ||
// attributes are mandatory when creation a cluster with your own Amazon Web | ||
// Services account. | ||
class ManagementCluster { | ||
// Cluster mgmt reference | ||
ClusterManagementReference ClusterManagementReference | ||
|
||
// Cloud provider region where the cluster is installed. | ||
Region String | ||
|
||
// DNS settings of the cluster. | ||
DNS DNS | ||
|
||
// Cloud provider where the cluster is installed. | ||
CloudProvider String | ||
|
||
// Status of cluster | ||
Status String | ||
|
||
// Service cluster handling the management cluster | ||
link Parent ManagementClusterParent | ||
|
||
|
||
} |
41 changes: 41 additions & 0 deletions
41
model/osd_fleet_mgmt/v1/management_clusters_resource.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,41 @@ | ||
/* | ||
Copyright (c) 2022 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 clusters. | ||
resource ManagementClusters { | ||
// Retrieves the list of service clusters. | ||
method List { | ||
// Index of the requested page, where one corresponds to the first page. | ||
in out Page Integer = 1 | ||
|
||
// Maximum number of items that will be contained in the returned page. | ||
in out Size Integer = 100 | ||
|
||
// Total number of items of the collection that match the search criteria, | ||
// regardless of the size of the page. | ||
out Total Integer | ||
|
||
// Retrieved list of clusters. | ||
out Items []ManagementCluster | ||
} | ||
|
||
|
||
// Returns a reference to the service that manages an specific service cluster. | ||
locator ManagementCluster { | ||
target ManagementCluster | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
Copyright (c) 2022 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. | ||
*/ | ||
|
||
// Root of the tree of resources of the clusters management service. | ||
resource Root { | ||
// Reference to the resource that manages the collection of service clusters. | ||
locator ServiceClusters { | ||
target ServiceClusters | ||
} | ||
|
||
// Reference to the resource that manages the collection of management clusters. | ||
locator ManagementClusters { | ||
target ManagementClusters | ||
} | ||
|
||
} |
20 changes: 20 additions & 0 deletions
20
model/osd_fleet_mgmt/v1/service_cluster_request_payload.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,20 @@ | ||
/* | ||
Copyright (c) 2022 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. | ||
*/ | ||
|
||
struct ServiceClusterRequestPayload { | ||
CloudProvider String | ||
Region String | ||
} |
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,35 @@ | ||
/* | ||
Copyright (c) 2022 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 service cluster. | ||
resource ServiceCluster { | ||
// Retrieves the details of the cluster. | ||
method Get { | ||
out Body ServiceCluster | ||
} | ||
|
||
// Updates the service cluster. | ||
method Post { | ||
in Request ServiceClusterRequestPayload | ||
out Response ServiceCluster | ||
} | ||
|
||
// Deletes the service cluster. | ||
method Delete { | ||
|
||
} | ||
|
||
} |
Oops, something went wrong.