98505b2aa0499fea247a1f2c5f1806c5ce3cdb29
Commit Graph

281 Commits

This Branch
This Branch
All Branches
Author SHA1 Message Date
Artem Goncharov
98505b2aa0 Fix octavia operations with empty response body.
Certain octavia operations (failover) return 202 with empty body.
Address this in the schema, so that also the cli commands do not fail
expecting a body.
Change-Id: Id19511311c82a9381aa1eb120cc64a644f346f89
Signed-off-by: Artem Goncharov <artem.goncharov@gmail.com>
2025年07月24日 15:17:49 +02:00
Artem Goncharov
3ac902ebd9 Header names must be lowercase
Per HTTP/2.0 header names must only contain lowercase characters,
numerals and symbols.
Change-Id: I62806d01d53754de95afe16e5a8d95580cc8b5a7
Signed-off-by: Artem Goncharov <artem.goncharov@gmail.com>
2025年07月23日 16:55:25 +02:00
Artem Goncharov
171d3b39ad Change signature for adding request headers
Static strings are heavily complicating the headers management. Switch
to Into<HeaderName> and Into<HeaderValue> instead.
Change-Id: Iea470a5dd5950f155469e5de0ec4a3c3f70f39ae
Signed-off-by: Artem Goncharov <artem.goncharov@gmail.com>
2025年07月22日 13:51:26 +02:00
Zuul
a14fe0a8a4 Merge "Add header query params to dns list operations" 2025年07月17日 17:08:11 +00:00
Zuul
b8166a6f14 Merge "OpenAPI: Fix arrays without items" 2025年07月17日 15:48:58 +00:00
Artem Goncharov
df065d731e Add header query params to dns list operations
All dns list/get operations support `x-auth-all-projects` and
`x-auth-sudo-project-id` headers, which can be used by admins.
Change-Id: Ic5a7cd6c0312a6ac28d895c290924621943e598a
Signed-off-by: Artem Goncharov <artem.goncharov@gmail.com>
2025年07月17日 16:17:58 +02:00
Zuul
9ea8e742bf Merge "YAML version support" 2025年06月30日 16:02:13 +00:00
Gorka Eguileor
19fe468358 OpenAPI: Fix arrays without items
As explained in the documentation `arrays` have an `items` section, and
arrays that can have arbitrary values are defined like this [1]:
```
type: array
items: {}
```
In the cinder schemas we have a couple of cases where we are defining an
`array` without `items`, all other arrays in the openapi codebase seem
to be right.
In this patch we fix these issues and introduce code in the
`_sanitize_schema` to detect future cases of this issue and fix the
schema automatically for the output.
[1]: https://swagger.io/docs/specification/v3_0/data-models/data-types/#mixed-type-arrays
Change-Id: I49cadcccf64ed9699a4b41674109b4afbfa1e106
2025年06月30日 14:31:24 +00:00
Artem Goncharov
bd3c647035 Make image.locations.metadata not required
Glance defines metadata property of the image location as mandatory
while in devstack it is not present. Hardcode a dirty fix for the
schema.
Change-Id: I15f2f0a543174eccbeb5c0d4da9e5222ce1e5d7a
Signed-off-by: Artem Goncharov <artem.goncharov@gmail.com>
2025年06月28日 12:27:04 +02:00
Zuul
72020020c6 Merge "Improve support for array with prefixItems" 2025年06月27日 17:33:04 +00:00
Artem Goncharov
80a9ec9aa4 Improve support for array with prefixItems
Change-Id: Id87bf2700e6ddc9183e924f8c9cf6b9f53a44baa
Signed-off-by: Artem Goncharov <artem.goncharov@gmail.com>
2025年06月27日 15:43:06 +02:00
Stephen Finucane
b4ae043f3a Add missing name attribute
I assume this is the intention.
Change-Id: I622731b4cbd2727c38c82348f47a4692964281b9
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025年06月27日 09:32:41 +01:00
Zuul
447deedfdf Merge "Improve UX clarity of "limit" query parameter" 2025年06月26日 16:12:56 +00:00
Artem Goncharov
ca752ffa71 Improve UX clarity of "limit" query parameter
Rename "limit" query parameter of the list operations to "page-size" for
giving precise meaning (keep alias "limit"). This is necessary to
finally resolve the conflict that we have in the python-openstackclient
where "limit" means a page size and all entries are fetched unless you
also specify the marker (which is not something anybody can really
understand why).
Change-Id: I9a6ddcbe30d92c4d190229ac77a10c28eb0015fb
Signed-off-by: Artem Goncharov <artem.goncharov@gmail.com>
2025年06月26日 16:17:49 +02:00
Artem Goncharov
595b37c1b2 Make keystone job voting again
The fix was merged so we should enforce the identity openapi job now.
Change-Id: Ic482c7e0e8444a415a5fe5e3c3a801884447006f
Signed-off-by: Artem Goncharov <artem.goncharov@gmail.com>
2025年06月26日 07:54:34 +00:00
Zuul
916c9241b9 Merge "OpenAPI: Fix nova examples" 2025年06月25日 20:36:35 +00:00
Gorka Eguileor
643fe11eb9 README: Fix missing \
Change-Id: I9d8b5ee8f860c6de6ca2006ec85f9bb8f7a02e47
2025年06月25日 18:12:19 +00:00
Gorka Eguileor
40b76e1500 OpenAPI: Fix nova examples
When generating the nova AZ detail schema we are adding examples to the
`hosts` object, but we are doing it wrong:
- We are adding a dictionary instead of a list, which is what the plural
 form of example indicates and also what we can see in the OpenAPI spec
 documentation [1].
- The contents of the example are wrong, it shouldn't have the `JSON
 request` key, as we can see in the upstream docs [2].
This patch fixes the examples to be correct.
[1]: https://swagger.io/specification/#model-with-example
[2]: https://docs.openstack.org/api-ref/compute/#get-detailed-availability-zone-information
Change-Id: Ic694ee083f55d44d0ecdb8a72561e24ec1b70583
2025年06月25日 18:11:56 +00:00
Artem Goncharov
4a711b1a2c Ensure schemas are not duplicated
It can happen (in Keystone it does for sure) that certain API method
decorators when applied together result in certain schemas being present
in multiple decorator processing iterations. This results in some
schemas being multiplied. It should be safe to just use `set` instead of
a `list` to deduplicate them.
While we were working on this Nova "again" changed some decorators
breaking us so fix that as well since generated code is broken.
Change-Id: I25b2506264d6027f9d605c74297e6f0cc6ab2767
Signed-off-by: Artem Goncharov <artem.goncharov@gmail.com>
2025年06月25日 09:34:23 +00:00
Artem Goncharov
f1e74e7be5 Un-vendor identity.group schema
In addition to that fix the new issue in the compute schemas with enum
without type.
Make identity job to non-voting to temporarily bypass a deadlock and
land the fix.
Change-Id: I7f5f967824e338477a6979e34c2100433458e7c1
Signed-off-by: Artem Goncharov <artem.goncharov@gmail.com>
2025年06月23日 11:25:45 +02:00
Gorka Eguileor
87ff2fe25e YAML version support
When exporting OpenAPI in YAML format we are exporting in YAML version
1.2, which is the latest. The problem with that is that there are tools
that use the PyYAML [1] python package to read these files, and that
package only supports YAML v1.1, which will lead to reading things
incorrectly.
An example is with booleans.
In v1.1 a lot of values are considered as booleans (case insensitive):
true, false, 1, 0, off, on, no, yes... But in v1.2 only true and false
are considered booleans, so the others don't need to be quoted.
As an example we were generating something like this:
```
 os_hypervisors_with_servers:
 in: query
 name: with_servers
 schema:
 type:
 - boolean
 - string
 enum:
 - true
 - 'True'
 - 'TRUE'
 - 'true'
 - '1'
 - ON
 - On
 - on
 - YES
 - Yes
 - yes
 - false
 - 'False'
 - 'FALSE'
 - 'false'
 - '0'
 - OFF
 - Off
 - off
 - NO
 - No
 - no
 x-openstack:
 min-ver: '2.53'
```
Which is incorrectly interpreted by PyYAML like this:
```
 enum:
 - true
 - 'True'
 - 'TRUE'
 - 'true'
 - '1'
 - true
 - true
 - true
 - true
 - true
 - true
 - false
 - 'False'
 - 'FALSE'
 - 'false'
 - '0'
 - false
 - false
 - false
 - false
 - false
 - false ```
```
To fix this we enable our tool to output the specs in v1.1 with a new
parameter `--yaml-version` so that when it's set to 1.1 it will quote
all booleans that in v1.1 could be misinterpreted.
[1]: https://pypi.org/project/PyYAML/
Change-Id: I7236f6a94ccb2e92a086c16895efa4dc557460c4
2025年06月05日 18:52:44 +02:00
Artem Goncharov
721705d837 Rename operation_name with action_name in the metadata
Currently we comment the operation_name attribute in the metadata that
it is used as an action name. This only creates confusion especially if
we want to use something different as the operation_name (i.e.
operation_name or opertaion_type for neutron router results in
"action"). So in addition to the renaming of the metadata attribute
explicitly pass the metadata operation key as operation_name parameters
into the generator (when unset).
Change-Id: Ic04eafe5b6dea012ca18b9835cd5c86fefa87055
Signed-off-by: Artem Goncharov <artem.goncharov@gmail.com>
2025年06月05日 15:02:09 +00:00
Artem Goncharov
9872d0f590 Use operation_type when operation_name is empty
In the metadata operation_name may be empty. In the cli output processor
we should fallback to the operation_type when operation_name is empty.
Change-Id: Ib7aebca1a6e5982ea5fa32c7dfe62fd382689cc9
Signed-off-by: Artem Goncharov <artem.goncharov@gmail.com>
2025年06月04日 13:54:53 +02:00
Artem Goncharov
0088dd4e17 Use operation_name in OutputProcessor data
Using operation_type is not correct since it is simply "action" often.
Use the `operation_name` instead as we use in the metadata.
Change-Id: I8395df6816d9db25d9395b4372878abeab9c4110
2025年06月03日 11:48:35 +02:00
Artem Goncharov
1a64217aec Update the cli output initialization
Switch to the new cli OutputProcessor initialization interface with
resource_key and oepration_type parameters for enabling command specific
hints.
Change-Id: I67eaef1fd5f9f1ed72a5f11a23e8559739792f8a
Signed-off-by: Artem Goncharov <artem.goncharov@gmail.com>
2025年06月02日 11:19:04 +02:00
Artem Goncharov
5cdd70602e Update pre-commit hooks
Change-Id: I93d5520bc67135db9b0ac9da40dbfb587cb9acad
Signed-off-by: Artem Goncharov <artem.goncharov@gmail.com>
2025年05月30日 18:29:17 +00:00
Artem Goncharov
b74e1a2fbc Adapt to the modified nova query decorator
Change-Id: Ifcd98f8533fe4403c1ff8299bd08ce45bfdb60b9
Signed-off-by: Artem Goncharov <artem.goncharov@gmail.com>
2025年05月30日 19:11:04 +02:00
Zuul
21d4be5484 Merge "Unvendor identity user schema" 2025年05月28日 16:20:15 +00:00
Artem Goncharov
52bfb4e619 Unvendor identity user schema
User schema in keystone is now good enough. Drop the hardcode.
Change-Id: I718906b0c9c12fd4c7936bdb5047725fa3267b39
Signed-off-by: Artem Goncharov <artem.goncharov@gmail.com>
2025年05月28日 11:13:43 +02:00
Zuul
dd95f9da92 Merge "fix dns qp marker parameter name" 2025年05月27日 17:21:52 +00:00
Artem Goncharov
eb390639ab fix dns qp marker parameter name
Fix typo "market" where "marker" should be.
Change-Id: Ic9f94727b6abb33619bde96a610fedad7cc12398
2025年05月27日 15:34:50 +02:00
Artem Goncharov
138b6b164a fix type conversion of const bool
`prop: {const: True}` should be converted to bool and not to integer.
Change-Id: Ic3775a36c138d451dbad7615bc0e446528d8b0be
Signed-off-by: Artem Goncharov <artem.goncharov@gmail.com>
2025年05月23日 15:58:34 +02:00
Zuul
43bb841c49 Merge "Ensure swift bytes are positive integers" 2025年05月22日 19:00:48 +00:00
Artem Goncharov
303001e15e Ensure swift bytes are positive integers
In swift we service return few integer attributes which can only be
positive. Ensure this is incorporated in the schema.
Change-Id: I23509ca116f607a2b26fa1c01387dbd4f4df705a
Signed-off-by: Artem Goncharov <artem.goncharov@gmail.com>
2025年05月22日 17:42:37 +02:00
Zuul
6e40a0831b Merge "add missed serde macros in types" 2025年05月21日 20:24:11 +00:00
Artem Goncharov
e9a60ff553 add missed serde macros in types
When attribute is being locally renamed we miss the serde macros causing
deserialization to fail.
Change-Id: Ia8d8298c938ea088d1db62bf97df6defc41d93bc
2025年05月21日 18:05:35 +02:00
Artem Goncharov
2adeedf4fe Make openapi specs reproducible
Sort openapi spec to make it possible to put them under the version
control not taking care of changed ordering.
Change-Id: Ifb999f85a6d77e751cba8587c516c7d2c5c23644
2025年05月19日 15:56:50 +02:00
Artem Goncharov
d3f1f124e5 Fix role_assignments command
In the cli generation it was assumed that the first element in the
response schema is the object itself. That is used to check whether the
response is list or not. Now the role_assignment schema return `links`
object first breaking that assumption. Extend the check to first look at
the `response_key` that we identified previously.
Change-Id: Ib2cf6e394486ebd0a475ed3d9bba97feefcd5205
2025年05月17日 13:40:28 +02:00
Artem Goncharov
d201f9a6d9 Hopefully address nested structures renaming race
Sometimes (and now very often) there is some race in the deep nested
structures rename handling. Apparently during renaming the wrong object
was modified causing it not to find referred entity later causing some
confusions depending on the order in which entities are processed.
Additionally when enum with the same name occur we should also look
whether the schema hash equals, in which case it is safe to simply skip
the schema completely).
Change-Id: I1bbb5f1e4f702ab54f72cdb70418b04567047187
2025年05月17日 12:29:58 +02:00
Artem Goncharov
85c09cd60e Add support setting Null for nullable optional args
For primitive types (not arrays and not dicts or similar) when resource
attribute can be explicitly nullable (while also being optional) it is
necessary to allow CLI user to set it to null. The only practical way
found till now is to add additional argument: `device_id / no_device_id`
which can be used to set explicit null. Neither relying on specific
value ("", "null") nor using default value when no value is sustainable
looking at the variations of APIs.
Change-Id: I6d549ffcc5c51a9c3ed849c590777b5ba4f6d721
2025年05月13日 16:16:55 +02:00
Zuul
7811367bea Merge "Address explicit nullable types in network" 2025年05月13日 08:22:55 +00:00
Artem Goncharov
8a10a63394 Address explicit nullable types in network
Some conversion schemes missed explicit null support.
Change-Id: I01ed16f2690c78492a0d8673ad86f67de92c80ae
2025年05月13日 08:11:52 +02:00
Artem Goncharov
d6cbd6dc26 Fix server schema
image in the server response may be an empty string if the server was
provisioned from a volume.
Change-Id: I4ec1d5391d373ec1aaba40b0547b06ebc9629ec2
2025年05月08日 15:40:18 +02:00
Artem Goncharov
f193d31dfc Adjust fip.port_details schema
On the response admin_state_up can be only boolean
Change-Id: I2d991491dbc5a97e36446a6d29c52b653b5a1657
2025年05月08日 11:00:35 +02:00
Artem Goncharov
52d3f05969 Fix fip.port_details schema
port_details is an object and not array of objects.
Change-Id: I4095e664d714222d1d1ef8fdac0422393e7c451b
2025年05月07日 17:08:42 +02:00
Artem Goncharov
0120737d06 Add cascade QP for delete octavia loadbalancer
Change-Id: I8f394639f3272d4385618dda6731880e02e85a4e
2025年05月06日 17:18:50 +02:00
Artem Goncharov
752bc74a11 Fix typos in parameter names
Change-Id: I652e8b85632789d5172593154ddd9fef7508f359
2025年05月06日 10:01:16 +02:00
Artem Goncharov
1e293968c7 Copy openapi spec into rust project
In order to do more tests of the sdk/cli/types it is necessary to have a
convenient access to the source openapi spec. Copy this into the
`openstack_types/data`.
Change-Id: Ica1849dc81e77d05f277a14bb00030485c704ba2
2025年05月05日 13:44:44 +02:00
Artem Goncharov
63632a0ced Start populating resource_key in the CLI
Next step of enabling CLI output configuration. This time we add
resource_key into the generated CLI code so that we can map config
entries.
Change-Id: I43460adb71c18516c65ae20cf29a0a42a201a01f
2025年04月25日 16:02:38 +02:00
Artem Goncharov
a0e5529b8a Fix few nova response schemas
- keypair create response does not contain ID
- server create response has a response_key (server). This is not really
 true, since creation may return reservation_id, but this is not
 typical and we can try to find a solution for that later. For now make
 sure cli server creation works.
Change-Id: I3f52f0e6686767dcc8862543c4c3a155f42ead0e
2025年04月24日 13:28:19 +02:00