From f39220455a6e0383884b5018e7cf0da3e8c9e216 Mon Sep 17 00:00:00 2001 From: Chetan Giradkar Date: Wed, 26 Jun 2024 18:19:19 +0100 Subject: [PATCH] OCM-7800 | Define and add pagination model to cloud_provider_inquiries Signed-off-by: Chetan Giradkar --- model/clusters_mgmt/v1/pagination_type.model | 23 +++++++ .../v1/provider_data_inquiries_resource.model | 63 +++++++++++++++++++ .../v1/provider_data_inquiry_resource.model | 23 +++++++ 3 files changed, 109 insertions(+) create mode 100644 model/clusters_mgmt/v1/pagination_type.model create mode 100644 model/clusters_mgmt/v1/provider_data_inquiries_resource.model create mode 100644 model/clusters_mgmt/v1/provider_data_inquiry_resource.model diff --git a/model/clusters_mgmt/v1/pagination_type.model b/model/clusters_mgmt/v1/pagination_type.model new file mode 100644 index 00000000..bcb422be --- /dev/null +++ b/model/clusters_mgmt/v1/pagination_type.model @@ -0,0 +1,23 @@ +/* +Copyright (c) 2024 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. +*/ + +// Pagination contains the data which enables pagination on the response +struct Pagination { + Page Integer + Size Integer + Search String + Order String +} diff --git a/model/clusters_mgmt/v1/provider_data_inquiries_resource.model b/model/clusters_mgmt/v1/provider_data_inquiries_resource.model new file mode 100644 index 00000000..da86daa4 --- /dev/null +++ b/model/clusters_mgmt/v1/provider_data_inquiries_resource.model @@ -0,0 +1,63 @@ +/* +Copyright (c) 2024 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 cloud provider data of a cluster. +resource CloudProvidersData { + // Retrieves the list of cloud provider data. + 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 + + // Search criteria. + // + // The syntax of this parameter is similar to the syntax of the _where_ clause of a + // SQL statement, but using the names of the attributes of the break glass credentials + // instead of the names of the columns of a table. For example, in order to retrieve all + // the credentials with a specific username and status the following is required: + // + // ```sql + // username='user1' AND status='expired' + // ``` + // + // If the parameter isn't provided, or if the value is empty, then all the + // break glass credentials that the user has permission to see will be returned. + in Search String + + // Order criteria. + // + // The syntax of this parameter is similar to the syntax of the _order by_ clause of + // a SQL statement, but using the names of the attributes of the break glass credentials + // instead of the the names of the columns of a table. For example, in order to sort the + // credentials descending by identifier the value should be: + // + // ```sql + // id desc + // ``` + // + // If the parameter isn't provided, or if the value is empty, then the order of the + // results is undefined. + in Order String + + // Total number of items of the collection. + out Total Integer + + // Retrieved list of cloud provider data. + out Items []CloudProviderData + } +} \ No newline at end of file diff --git a/model/clusters_mgmt/v1/provider_data_inquiry_resource.model b/model/clusters_mgmt/v1/provider_data_inquiry_resource.model new file mode 100644 index 00000000..9b8d777f --- /dev/null +++ b/model/clusters_mgmt/v1/provider_data_inquiry_resource.model @@ -0,0 +1,23 @@ +/* +Copyright (c) 2024 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 cloud provider data. +resource CloudProviderData { + // Retrieves the details of the cloud provider data. + method Get { + out Body CloudProviderData + } +}