-
Notifications
You must be signed in to change notification settings - Fork 479
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
17508 FIX REST-API: change DCD request and response types
This werk changes the connector configuration for create and get DCD endpoints. Change-Id: I4f97cdecf9f778a78ee4ee30321025c2bb86c9b8 JIRA-Ref: SUP-22388
- Loading branch information
Showing
2 changed files
with
142 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
[//]: # (werk v2) | ||
# REST-API: change DCD request and response types | ||
|
||
key | value | ||
---------- | --- | ||
date | 2025-02-23T11:43:14+00:00 | ||
version | 2.4.0b1 | ||
class | fix | ||
edition | cee | ||
component | rest-api | ||
level | 1 | ||
compatible | no | ||
|
||
This werk changes the connector configuration for create and get DCD endpoints. | ||
|
||
For the create request: | ||
|
||
1. the connector specific configuration is now nested under the `connector` key | ||
2. the validation for `restrict_source_hosts` and `matching_hosts` was changed | ||
to only allow valid regular expressions | ||
3. the `exclude_time_ranges` field was removed, as it is now a global setting | ||
|
||
Before: | ||
```json5 | ||
{ | ||
"title": "my-title", | ||
"site": "my-site", | ||
"dcd_id": "connection_1", | ||
"connector_type": "piggyback", | ||
// other connector keys, like interval, creation_rules etc. | ||
} | ||
``` | ||
|
||
After: | ||
```json5 | ||
{ | ||
"title": "my-title", | ||
"site": "my-site", | ||
"dcd_id": "connection_1", | ||
"connector": { | ||
"connector_type": "piggyback", | ||
// other connector keys, like interval, creation_rules etc. | ||
} | ||
} | ||
``` | ||
|
||
For the responses of both create and get endpoints, the schema was adjusted to | ||
reflect the create endpoint. It is also now correctly documented. | ||
|
||
Before: | ||
```json5 | ||
{ | ||
// other keys omitted, as they didn't change | ||
"extensions": { | ||
"title": "my-title", | ||
"comment": "...", | ||
"docu_url": "...", | ||
"disabled": false, | ||
"site": "my-site", | ||
"connector": [ | ||
"piggyback", | ||
{ | ||
"source_filters": [ | ||
"some.+regex" | ||
], | ||
"interval": 60.0, | ||
"creation_rules": [ | ||
{ | ||
"create_folder_path": "sub/folder", | ||
"host_attributes": [ | ||
[ | ||
"tag_address_family", | ||
"no-ip" | ||
] | ||
], | ||
"delete_hosts": true, | ||
"host_filters": [ | ||
"another.+regex" | ||
] | ||
} | ||
], | ||
"discover_on_creation": true, | ||
"no_deletion_time_after_init": 600.0, | ||
"max_cache_age": 3600.0, | ||
"validity_period": 60.0 | ||
} | ||
] | ||
} | ||
} | ||
``` | ||
|
||
After: | ||
```json5 | ||
{ | ||
// other keys omitted, as they didn't change | ||
"extensions": { | ||
"title": "my-title", | ||
"comment": "...", | ||
"documentation_url": "...", // renamed from docu_url | ||
"disabled": false, | ||
"site": "my-site", | ||
"connector": { // now an object, not an array | ||
"connector_type": "piggyback", | ||
"restrict_source_hosts": [ // renamed from source_filters | ||
"some.+regex" | ||
], | ||
"interval": 60, // now an integer, not a float | ||
"creation_rules": [ | ||
{ | ||
"folder_path": "/sub/folder", // renamed from create_folder_path | ||
"host_attributes": { // now an object, not an array | ||
"tag_address_family": "no-ip" | ||
}, | ||
"delete_hosts": true, | ||
"matching_hosts": [ // renamed from host_filters | ||
"another.+regex" | ||
] | ||
} | ||
], | ||
"discover_on_creation": true, | ||
"no_deletion_time_after_init": 600, // now an integer, not a float | ||
"max_cache_age": 3600, // now an integer, not a float | ||
"validity_period": 60 // now an integer, not a float | ||
} | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters