Start building DNS bindings

Change-Id: I62888041ce2cf8d2c4dd27beeda6d04f94f1cbd6
This commit is contained in:
Artem Goncharov 2024-10-02 18:15:59 +02:00
parent 32b8fbd34e
commit e575c6fe7d
6 changed files with 21 additions and 27 deletions

View File

@ -452,6 +452,8 @@ def get_resource_names_from_url(path: str):
part = el[0:-3] + "y"
elif el[-4:] == "sses":
part = el[0:-2]
elif el.endswith("statuses"):
part = el[0:-2]
elif (
el[-1] == "s"
and el[-3:] != "dns"
@ -571,6 +573,8 @@ def get_rust_service_type_from_str(xtype: str):
return "BlockStorage"
case "compute":
return "Compute"
case "dns":
return "Dns"
case "identity":
return "Identity"
case "image":

View File

@ -263,7 +263,9 @@ class OpenStackServerSourceBase:
rn = path_resource_names[-1]
if rn.endswith("ies"):
rn = rn.replace("ies", "y")
if rn.endswith("sses"):
elif rn.endswith("sses"):
rn = rn[:-2]
elif rn.endswith("statuses"):
rn = rn[:-2]
else:
rn = rn.rstrip("s")

View File

@ -237,6 +237,12 @@ class DesignateGenerator(OpenStackServerSourceBase):
):
# returns 405 in Designate anyway
continue
if route.routepath in [
"/v2/service_status",
"/v2/service_status/{service_id}",
]:
# backwards compatibility for mistake
continue
self._process_route(route, openapi_spec, framework="pecan")
if args.api_ref_src:

View File

@ -181,6 +181,7 @@ RECORDSET_SCHEMA: dict[str, Any] = {
"zone_id": {
"type": "string",
"format": "uuid",
"readOnly": True,
"description": "ID for the zone that contains this recordset",
},
"zone_name": {

View File

@ -614,37 +614,13 @@ resources:
module_name: create
sdk_mod_name: create
cli_full_command: pool create
dns.service_statuse:
dns.service_status:
spec_file: wrk/openapi_specs/dns/v2.1.yaml
api_version: v2
operations:
list:
operation_id: service_statuses:get
operation_type: list
targets:
rust-sdk:
module_name: list
rust-cli:
module_name: list
sdk_mod_name: list
cli_full_command: service-statuse list
show:
operation_id: service_statuses/service_id:get
operation_type: show
targets:
rust-sdk:
module_name: get
rust-cli:
module_name: show
sdk_mod_name: get
cli_full_command: service-statuse show
dns.service_status:
spec_file: wrk/openapi_specs/dns/v2.1.yaml
api_version: v2
operations:
list:
operation_id: service_status:get
operation_type: list
targets:
rust-sdk:
module_name: list
@ -653,7 +629,7 @@ resources:
sdk_mod_name: list
cli_full_command: service-status list
show:
operation_id: service_status/service_id:get
operation_id: service_statuses/service_id:get
operation_type: show
targets:
rust-sdk:

View File

@ -18,6 +18,9 @@
- service: "compute"
metadata: "metadata/compute_metadata.yaml"
targets: ["rust-sdk", "rust-cli"]
- service: "dns"
metadata: "metadata/dns_metadata.yaml"
targets: ["rust-sdk", "rust-cli"]
- service: "identity"
metadata: "metadata/identity_metadata.yaml"
targets: ["rust-sdk", "rust-cli"]
@ -51,6 +54,8 @@
soft: true
- name: codegenerator-openapi-compute-tips-with-api-ref
soft: true
- name: codegenerator-openapi-dns-tips-with-api-ref
soft: true
- name: codegenerator-openapi-identity-tips-with-api-ref
soft: true
- name: codegenerator-openapi-image-tips-with-api-ref