From b87e420f4b1bec9684f9d93e972a74af87511ee2 Mon Sep 17 00:00:00 2001 From: Samira Barouti Date: Thu, 15 Sep 2022 13:46:24 -0400 Subject: [PATCH] [Hypershift] Expose /manifests * Fixes SDA-6794 --- .../v1/external_configuration_type.model | 3 ++ .../clusters_mgmt/v1/manifest_resource.model | 32 +++++++++++++ model/clusters_mgmt/v1/manifest_type.model | 21 +++++++++ .../clusters_mgmt/v1/manifests_resource.model | 45 +++++++++++++++++++ 4 files changed, 101 insertions(+) create mode 100644 model/clusters_mgmt/v1/manifest_resource.model create mode 100644 model/clusters_mgmt/v1/manifest_type.model create mode 100644 model/clusters_mgmt/v1/manifests_resource.model diff --git a/model/clusters_mgmt/v1/external_configuration_type.model b/model/clusters_mgmt/v1/external_configuration_type.model index 49ca58d5..99a1a573 100644 --- a/model/clusters_mgmt/v1/external_configuration_type.model +++ b/model/clusters_mgmt/v1/external_configuration_type.model @@ -21,4 +21,7 @@ struct ExternalConfiguration { // list of labels externally configured on the clusterdeployment. link Labels []Label + + // list of manifest externally configured for a hosted cluster. + link Manifests []Manifest } diff --git a/model/clusters_mgmt/v1/manifest_resource.model b/model/clusters_mgmt/v1/manifest_resource.model new file mode 100644 index 00000000..4acc1870 --- /dev/null +++ b/model/clusters_mgmt/v1/manifest_resource.model @@ -0,0 +1,32 @@ +/* +Copyright (c) 2020 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 Manifest. +resource Manifest { + // Retrieves the details of the manifest. + method Get { + out Body Manifest + } + + // Update the manifest. + method Update { + in out Body Manifest + } + + // Deletes the manifest. + method Delete { + } +} diff --git a/model/clusters_mgmt/v1/manifest_type.model b/model/clusters_mgmt/v1/manifest_type.model new file mode 100644 index 00000000..08448bd7 --- /dev/null +++ b/model/clusters_mgmt/v1/manifest_type.model @@ -0,0 +1,21 @@ +/* +Copyright (c) 2020 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 manifestwork. +class Manifest { + // List of k8s objects to deploy on a hosted cluster. + Workloads []Interface +} diff --git a/model/clusters_mgmt/v1/manifests_resource.model b/model/clusters_mgmt/v1/manifests_resource.model new file mode 100644 index 00000000..11f16957 --- /dev/null +++ b/model/clusters_mgmt/v1/manifests_resource.model @@ -0,0 +1,45 @@ +/* +Copyright (c) 2019 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 Manifests of a cluster. +resource Manifests { + // Retrieves the list of manifests. + method List { + // Index of the requested page, where one corresponds to the first page. + in out Page Integer = 1 + + // Number of items contained in the returned page. + in out Size Integer = 100 + + // Total number of items of the collection. + out Total Integer + + // Retrieved list of Manifests. + out Items []Manifest + } + + // Adds a new manifest to a cluster. + method Add { + // Description of the manifest. + in out Body Manifest + } + + // Reference to the service that manages a specific manifest. + locator Manifest { + target Manifest + variable ID + } +}