diff --git a/model/addons_mgmt/v1/addon_config_type.model b/model/addons_mgmt/v1/addon_config_type.model new file mode 100644 index 00000000..fe7481b0 --- /dev/null +++ b/model/addons_mgmt/v1/addon_config_type.model @@ -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. +*/ + +// Representation of an addon config. +// The attributes under it are to be used by the addon once its installed in the cluster. +struct AddonConfig { + // List of environment variables for the addon + EnvironmentVariables []AddonEnvironmentVariable + + // List of secret propagations for the addon + SecretPropagations []AddonSecretPropagation +} diff --git a/model/addons_mgmt/v1/addon_credential_request_type.model b/model/addons_mgmt/v1/addon_credential_request_type.model new file mode 100644 index 00000000..f2e30add --- /dev/null +++ b/model/addons_mgmt/v1/addon_credential_request_type.model @@ -0,0 +1,30 @@ +/* +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. +*/ + +// Contains the necessary attributes to allow each operator to access the necessary AWS resources +struct CredentialRequest { + // Name of the credentials secret used to access cloud resources + Name String + + // Namespace where the credentials secret lives in the cluster + Namespace String + + // Service account name to use when authenticating + ServiceAccount String + + // List of policy permissions needed to access cloud resources + PolicyPermissions []String +} diff --git a/model/addons_mgmt/v1/addon_environment_variable_type.model b/model/addons_mgmt/v1/addon_environment_variable_type.model new file mode 100644 index 00000000..4d19bd43 --- /dev/null +++ b/model/addons_mgmt/v1/addon_environment_variable_type.model @@ -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. +*/ + +// Representation of an addon env object. +struct AddonEnvironmentVariable { + // Name of the env object. + Name String + + // Value of the env object. + Value String + + // Indicates is this environment variable is enabled for the addon + Enabled Boolean +} diff --git a/model/addons_mgmt/v1/addon_install_mode_type.model b/model/addons_mgmt/v1/addon_install_mode_type.model new file mode 100644 index 00000000..a37ffa4c --- /dev/null +++ b/model/addons_mgmt/v1/addon_install_mode_type.model @@ -0,0 +1,26 @@ +/* +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. +*/ + +// Representation of an addon InstallMode field. +enum AddonInstallMode { + // This mode means that the the addon CRD exists in a single specific namespace. + // This namespace is reflected by the TargetNamespace addon field + OwnNamespace + + // This mode means that the addon is deployed in all namespaces. + // However, the addon status is retrieved from the target namespace + AllNamespaces +} diff --git a/model/addons_mgmt/v1/addon_namespace_type.model b/model/addons_mgmt/v1/addon_namespace_type.model new file mode 100644 index 00000000..75864a13 --- /dev/null +++ b/model/addons_mgmt/v1/addon_namespace_type.model @@ -0,0 +1,30 @@ +/* +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. +*/ + +// Representation of an addon namespace object. +struct AddonNamespace { + // Name of the namespace + Name String + + // Enabled shows if this namespace object is in use + Enabled Boolean + + // Labels to be included in the addon namespace + Labels [String]String + + // Annotations to be included in the addon namespace + Annotations [String]String +} diff --git a/model/addons_mgmt/v1/addon_parameter_option_type.model b/model/addons_mgmt/v1/addon_parameter_option_type.model new file mode 100644 index 00000000..2a160670 --- /dev/null +++ b/model/addons_mgmt/v1/addon_parameter_option_type.model @@ -0,0 +1,30 @@ +/* +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. +*/ + +// Representation of an addon parameter option. +struct AddonParameterOption { + // Name of the addon parameter option. + Name String + + // Value of the addon parameter option. + Value String + + // Rank of option to be used in cases where editable direction should be restricted. + Rank Integer + + // List of addon requirements for this parameter option. + Requirements []AddonRequirement +} diff --git a/model/addons_mgmt/v1/addon_parameter_type.model b/model/addons_mgmt/v1/addon_parameter_type.model new file mode 100644 index 00000000..b7b63f4d --- /dev/null +++ b/model/addons_mgmt/v1/addon_parameter_type.model @@ -0,0 +1,58 @@ +/* +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. +*/ + +// Representation of an addon parameter. +struct AddonParameter { + // ID for this addon parameter + ID String + + // Name of the addon parameter. + Name String + + // Description of the addon parameter. + Description String + + // Type of value of the addon parameter. + ValueType AddonParameterValueType + + // Validation rule for the addon parameter. + Validation String + + // Error message to return should the parameter be invalid. + ValidationErrMsg String + + // Indicates if this parameter is required by the addon. + Required Boolean + + // Indicates if this parameter can be edited after creation. + Editable Boolean + + // Restricts if the parameter can be upscaled/downscaled + // Expected values are "up", "down", or "" (no restriction). + EditableDirection String + + // Indicates if this parameter is enabled for the addon. + Enabled Boolean + + // Indicates the value default for the addon parameter. + DefaultValue String + + // List of options for the addon parameter value. + Options []AddonParameterOption + + // Conditions in which this parameter is valid for + Conditions []AddonRequirement +} diff --git a/model/addons_mgmt/v1/addon_parameter_value_type.model b/model/addons_mgmt/v1/addon_parameter_value_type.model new file mode 100644 index 00000000..2019c8cc --- /dev/null +++ b/model/addons_mgmt/v1/addon_parameter_value_type.model @@ -0,0 +1,36 @@ +/* +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. +*/ + +// Representation of the value type for this specific addon parameter +enum AddonParameterValueType { + // This value type must be a valid string + String + + // This value type must be a valid boolean + Boolean + + // This value type must be a valid number, this includes integer and float type numbers + Number + + // This value type enforces a valid CIDR value to be passed as parameter value + CIDR + + // This value must match a valid SKU resource in OCM + Resource + + // This value must match a valid SKU resource in OCM and allows for validation of SKU resource in OCM + ResourceRequirement +} diff --git a/model/addons_mgmt/v1/addon_requirement_resource_type.model b/model/addons_mgmt/v1/addon_requirement_resource_type.model new file mode 100644 index 00000000..b2a5b66c --- /dev/null +++ b/model/addons_mgmt/v1/addon_requirement_resource_type.model @@ -0,0 +1,28 @@ +/* +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. +*/ + +// Addon requirement resource type +enum AddonRequirementResource { + // This requirement resource data will be validated and checked against cluster resources + Cluster + + // This requirement resource data will be validated and checked against machine pool resources + @json(name = "machine_pool") + MachinePool + + // This requirement resource data will be validated and checked against addon installation resources + Addon +} diff --git a/model/addons_mgmt/v1/addon_requirement_status_type.model b/model/addons_mgmt/v1/addon_requirement_status_type.model new file mode 100644 index 00000000..3c80ce87 --- /dev/null +++ b/model/addons_mgmt/v1/addon_requirement_status_type.model @@ -0,0 +1,24 @@ +/* +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. +*/ + +// Representation of an addon requirement status. +struct AddonRequirementStatus { + // Indicates if this requirement is fulfilled. + Fulfilled Boolean + + // Error messages detailing reasons for unfulfilled requirements. + ErrorMsgs []String +} diff --git a/model/addons_mgmt/v1/addon_requirement_type.model b/model/addons_mgmt/v1/addon_requirement_type.model new file mode 100644 index 00000000..9e18abf9 --- /dev/null +++ b/model/addons_mgmt/v1/addon_requirement_type.model @@ -0,0 +1,33 @@ +/* +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. +*/ + +// Representation of an addon requirement. +struct AddonRequirement { + // ID of the addon requirement. + ID String + + // Type of resource of the addon requirement. + Resource AddonRequirementResource + + // Data for the addon requirement. + Data [String]Interface + + // Indicates if this requirement is enabled for the addon. + Enabled Boolean + + // Optional cluster specific status for the addon. + Status AddonRequirementStatus +} diff --git a/model/addons_mgmt/v1/addon_resource.model b/model/addons_mgmt/v1/addon_resource.model new file mode 100644 index 00000000..6147920a --- /dev/null +++ b/model/addons_mgmt/v1/addon_resource.model @@ -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 a specific addon. +resource Addon { + // Retrieves the details of the addon. + method Get { + out Body Addon + } + + // Updates the addon. + method Update { + // DryRun indicates the request body will not be persisted when dryRun=true. + @json(name = "dryRun") + in DryRun Boolean + + in out Body Addon + } + + // Deletes the addon. + method Delete { + } + + // Reference to the resource that manages the collection of addon versions. + locator Versions { + target AddonVersions + } +} diff --git a/model/addons_mgmt/v1/addon_secret_propagation_type.model b/model/addons_mgmt/v1/addon_secret_propagation_type.model new file mode 100644 index 00000000..d02935b9 --- /dev/null +++ b/model/addons_mgmt/v1/addon_secret_propagation_type.model @@ -0,0 +1,30 @@ +/* +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. +*/ + +// Representation of an addon secret propagation +struct AddonSecretPropagation { + // ID of the secret propagation + ID string + + // SourceSecret is location of the source secret + SourceSecret String + + // DestinationSecret is location of the secret to be added + DestinationSecret String + + // Indicates is this secret propagation is enabled for the addon + Enabled Boolean +} diff --git a/model/addons_mgmt/v1/addon_sub_operator_type.model b/model/addons_mgmt/v1/addon_sub_operator_type.model new file mode 100644 index 00000000..208948e4 --- /dev/null +++ b/model/addons_mgmt/v1/addon_sub_operator_type.model @@ -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. +*/ + +// Representation of an addon sub operator. A sub operator is an operator +// who's life cycle is controlled by the addon umbrella operator. +struct AddonSubOperator { + // Name of the addon sub operator + OperatorName String + + // Namespace of the addon sub operator + OperatorNamespace String + + // Indicates if the sub operator is enabled for the addon + Enabled Boolean +} + diff --git a/model/addons_mgmt/v1/addon_type.model b/model/addons_mgmt/v1/addon_type.model new file mode 100644 index 00000000..d3df35ef --- /dev/null +++ b/model/addons_mgmt/v1/addon_type.model @@ -0,0 +1,81 @@ +/* +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. +*/ + +// Representation of an addon that can be installed in a cluster. +class Addon { + // Name of the addon. + Name String + + // Description of the addon. + Description String + + // Link to documentation about the addon. + DocsLink String + + // Label used to attach to a cluster deployment when addon is installed. + Label String + + // Base64-encoded icon representing an addon. The icon should be in PNG format. + Icon String + + // Indicates if this addon can be added to clusters. + Enabled Boolean + + // Indicates if this addon is hidden. + Hidden Boolean + + // Used to determine from where to reserve quota for this addon. + ResourceName String + + // Used to determine how many units of quota an addon consumes per resource name. + ResourceCost Float + + // The namespace in which the addon CRD exists. + TargetNamespace String + + // The mode in which the addon is deployed. + InstallMode AddonInstallMode + + // The name of the operator installed by this addon. + OperatorName String + + // Indicates if this addon has external resources associated with it + HasExternalResources Boolean + + // List of parameters for this addon. + Parameters []AddonParameter + + // List of requirements for this addon. + Requirements []AddonRequirement + + // List of sub operators for this addon. + SubOperators []AddonSubOperator + + // List of credentials requests to authenticate operators to access cloud resources. + CredentialsRequests []CredentialRequest + + // Additional configs to be used by the addon once its installed in the cluster. + Config AddonConfig + + // List of namespaces associated with this addon. + Namespaces []AddonNamespace + + // Link to the current default version of this addon. + link Version AddonVersion + + // Indicates if addon is part of a managed service + ManagedService Boolean +} diff --git a/model/addons_mgmt/v1/addon_version_additional_catalog_sources_type.model b/model/addons_mgmt/v1/addon_version_additional_catalog_sources_type.model new file mode 100644 index 00000000..1df0d133 --- /dev/null +++ b/model/addons_mgmt/v1/addon_version_additional_catalog_sources_type.model @@ -0,0 +1,30 @@ +/* +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. +*/ + +// Representation of an addon catalog source object used by addon versions. +struct AdditionalCatalogSource { + // ID of the additional catalog source + ID String + + // Name of the additional catalog source. + Name String + + // Image of the additional catalog source. + Image String + + // Indicates is this additional catalog source is enabled for the addon + Enabled Boolean +} diff --git a/model/addons_mgmt/v1/addon_version_resource.model b/model/addons_mgmt/v1/addon_version_resource.model new file mode 100644 index 00000000..88473f4e --- /dev/null +++ b/model/addons_mgmt/v1/addon_version_resource.model @@ -0,0 +1,36 @@ +/* +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 addon version. +resource AddonVersion { + // Retrieves the details of the addon version. + method Get { + out Body AddonVersion + } + + // Updates the addon version. + method Update { + // DryRun indicates the request body will not be persisted when dryRun=true. + @json(name = "dryRun") + in DryRun Boolean + + in out Body AddonVersion + } + + // Deletes the addon version. + method Delete { + } +} diff --git a/model/addons_mgmt/v1/addon_version_type.model b/model/addons_mgmt/v1/addon_version_type.model new file mode 100644 index 00000000..dc373d0a --- /dev/null +++ b/model/addons_mgmt/v1/addon_version_type.model @@ -0,0 +1,48 @@ +/* +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. +*/ + +// Representation of an addon version. +class AddonVersion { + // Indicates if this addon version can be added to clusters. + Enabled Boolean + + // The catalog source image for this addon version. + SourceImage String + + // The pull secret name used for this addon version. + PullSecretName String + + // The specific addon catalog source channel of packages + Channel String + + // Additional catalog sources associated with this addon version + AdditionalCatalogSources []AdditionalCatalogSource + + // List of parameters for this addon version. + Parameters []AddonParameter + + // List of requirements for this addon version. + Requirements []AddonRequirement + + // List of sub operators for this addon version. + SubOperators []AddonSubOperator + + // Additional configs to be used by the addon once its installed in the cluster. + Config AddonConfig + + // AvailableUpgrades is the list of versions this version can be upgraded to. + AvailableUpgrades []String +} diff --git a/model/addons_mgmt/v1/addon_versions_resource.model b/model/addons_mgmt/v1/addon_versions_resource.model new file mode 100644 index 00000000..2d7edace --- /dev/null +++ b/model/addons_mgmt/v1/addon_versions_resource.model @@ -0,0 +1,80 @@ +/* +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 addon versions. +resource AddonVersions { + // Retrieves the list of addon versions. + 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 + + // Search criteria. + // + // The syntax of this parameter is similar to the syntax of the _where_ clause of an + // SQL statement, but using the names of the attributes of the addon version instead + // of the names of the columns of a table. For example, in order to retrieve all the + // addon versions with an id starting with `0.1` the value should be: + // + // ```sql + // id like '0.1.%' + // ``` + // + // If the parameter isn't provided, or if the value is empty, then all the addon + // versions 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 addon instead of + // the names of the columns of a table. For example, in order to sort the addon + // versions descending by id 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 that match the search criteria, + // regardless of the size of the page. + out Total Integer + + // Retrieved list of addon versions. + out Items []AddonVersion + } + + // Create a new addon version and add it to the collection of addons. + method Add { + // DryRun indicates the request body will not be persisted when dryRun=true. + @json(name = "dryRun") + in DryRun Boolean + + // Description of the addon version. + in out Body AddonVersion + } + + // Returns a reference to the service that manages a specific addon version. + locator Version { + target AddonVersion + variable ID + } +} diff --git a/model/addons_mgmt/v1/addons_resource.model b/model/addons_mgmt/v1/addons_resource.model new file mode 100644 index 00000000..508bcbd9 --- /dev/null +++ b/model/addons_mgmt/v1/addons_resource.model @@ -0,0 +1,80 @@ +/* +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 addons. +resource Addons { + // Retrieves the list of addons. + 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 + + // Search criteria. + // + // The syntax of this parameter is similar to the syntax of the _where_ clause of an + // SQL statement, but using the names of the attributes of the addon instead of + // the names of the columns of a table. For example, in order to retrieve all the + // addons with a name starting with `my` the value should be: + // + // ```sql + // name like 'my%' + // ``` + // + // If the parameter isn't provided, or if the value is empty, then all the addons + // 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 addon instead of + // the names of the columns of a table. For example, in order to sort the addons + // descending by name the value should be: + // + // ```sql + // name 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 that match the search criteria, + // regardless of the size of the page. + out Total Integer + + // Retrieved list of add-ons. + out Items []Addon + } + + // Create a new addon and add it to the collection of addons. + method Add { + // DryRun indicates the request body will not be persisted when dryRun=true. + @json(name = "dryRun") + in DryRun Boolean + + // Description of the addon. + in out Body Addon + } + + // Returns a reference to the service that manages a specific addon. + locator Addon { + target Addon + variable ID + } +} diff --git a/model/addons_mgmt/v1/root_resource.model b/model/addons_mgmt/v1/root_resource.model new file mode 100644 index 00000000..e51ce6b2 --- /dev/null +++ b/model/addons_mgmt/v1/root_resource.model @@ -0,0 +1,23 @@ +/* +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 Addons Management. +resource Root { + // Reference to the resource that manages the collection of Addons. + locator Addons { + target Addons + } +}