Skip to content

Commit

Permalink
Device API V1 to V2 Migration
Browse files Browse the repository at this point in the history
This commit replaces calls to the v1 API transparently with calls of v2 API.

Users who are actively using method named

    GetDeviceDetails

will now call Device API v2. However, they should remember this method is
deprecated and thus may disappear in future releases.
  • Loading branch information
isimluk committed Dec 1, 2022
1 parent b0a7e3a commit 158a5b5
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 12 deletions.
16 changes: 8 additions & 8 deletions falcon/client/hosts/get_device_details_responses.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions falcon/client/hosts/hosts_client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 11 additions & 2 deletions specs/transformation.jq
Expand Up @@ -20,10 +20,18 @@
# Rename msaspec.MetaInfo to msa.MetaInfo. These are two names for the same type.
| del(.definitions."msaspec.MetaInfo")


# Device v1 API has been deprecated since August 2022. And the end point will be removed at some point in the future.
| del(.paths."/devices/entities/devices/v1")
| .paths."/devices/entities/devices//v2".get = .paths."/devices/entities/devices/v2".get
| .paths."/devices/entities/devices//v2".get.operationId = "GetDeviceDetails"
| .paths."/devices/entities/devices//v2".get.deprecated = true
| .paths."/devices/entities/devices//v2".get.summary = "Deprecated: Please use new methods: GetDeviceDetailsV2 or PostDeviceDetailsV2. This method now redirects to GetDeviceDetailsV2. The original API endpoint will be removed on or sometime after February 9, 2023."
| .paths."/devices/entities/devices//v2".get.responses."200".schema."$ref" = "#/definitions/domain.DeviceDetailsResponseSwagger"
| .paths."/devices/entities/devices//v2".get.responses.default.schema."$ref" = "#/definitions/domain.DeviceDetailsResponseSwagger"

# A patch until DeviceDetails v1 gets removed
| .definitions."domain.DeviceDetailsResponseSwagger" = .definitions."deviceapi.DeviceDetailsResponseSwagger"
| .paths."/devices/entities/devices/v1".get.responses."200".schema."$ref" = "#/definitions/domain.DeviceDetailsResponseSwagger"
| .paths."/devices/entities/devices/v1".get.responses.default.schema."$ref" = "#/definitions/domain.DeviceDetailsResponseSwagger"
| .definitions."domain.DeviceSwagger" = .definitions."deviceapi.DeviceSwagger"
| .definitions."domain.DeviceDetailsResponseSwagger".properties.resources.items."$ref" = "#/definitions/domain.DeviceSwagger"

Expand All @@ -40,4 +48,5 @@
# Needed by rusty-falcon (stricter typing)
| .definitions."deviceapi.DeviceDetailsResponseSwagger".properties.errors."x-nullable" = true

# IOA Rule Groups Combined API has incorrect swagger response object: list of ids instead of list of objects
| .paths."/ioarules/queries/rule-groups-full/v1".get.responses."200" = .paths."/ioarules/entities/rule-groups/v1".get.responses."200"

0 comments on commit 158a5b5

Please sign in to comment.