Skip to content

Commit

Permalink
Merge pull request #596 from gabriel-farache/osdfm_model
Browse files Browse the repository at this point in the history
Add osd fleet mgmt model
  • Loading branch information
tiwillia authored Aug 8, 2022
2 parents ed6ab4d + d026e33 commit c33a399
Show file tree
Hide file tree
Showing 13 changed files with 474 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.vscode/
.idea/
/metamodel
/openapi/
25 changes: 25 additions & 0 deletions model/osd_fleet_mgmt/v1/cluster_management_reference_type.model
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
}
62 changes: 62 additions & 0 deletions model/osd_fleet_mgmt/v1/dns_type.model
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 model/osd_fleet_mgmt/v1/management_cluster_parent_type.model
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 model/osd_fleet_mgmt/v1/management_cluster_request_payload.model
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
}
35 changes: 35 additions & 0 deletions model/osd_fleet_mgmt/v1/management_cluster_resource.model
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 {

}

}
72 changes: 72 additions & 0 deletions model/osd_fleet_mgmt/v1/management_cluster_type.model
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 model/osd_fleet_mgmt/v1/management_clusters_resource.model
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
}
}
29 changes: 29 additions & 0 deletions model/osd_fleet_mgmt/v1/root_resource.model
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 model/osd_fleet_mgmt/v1/service_cluster_request_payload.model
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
}
35 changes: 35 additions & 0 deletions model/osd_fleet_mgmt/v1/service_cluster_resource.model
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 {

}

}
Loading

0 comments on commit c33a399

Please sign in to comment.