Skip to content

[#IOPLT-1054] Refactor and decouple OpenAPI specs #1206

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 32 commits into
base: master
Choose a base branch
from

Conversation

BurnedMarshal
Copy link
Contributor

@BurnedMarshal BurnedMarshal commented Apr 8, 2025

List of Changes

Migrate all the OpenAPI specification in the root folder into the openapi folder.
Aggregate at domain level the APIs on the same file if exposed publicly. Keep a separated OpenAPI file for APIs of the same domain available only on internal network (needs a different API Group when declared into the APIM)
Update the types references into the codebase.
Remove death code for APIs no more used in production.
Trial System and Public API are merged under platform OpenAPI specs.
Remove references to local types packages no more maintained.

Motivation and Context

To build the new IO Proxy with the APIM is needed to create API Products for each stream aligned team. Every product can have different APIGroups related the the same domain. API specs with multiple domain API are forbidden.
OpenAPI v3 is the new standard

How Has This Been Tested?

After code generation build and test was executed.

Screenshots (if appropriate):

Types of changes

  • Chore (nothing changes by a user perspective)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • Remove the old OpenAPI after domain teams verifications

Sorry, something went wrong.

Copy link

changeset-bot bot commented Apr 8, 2025

⚠️ No Changeset found

Latest commit: 464be8d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

github-actions bot commented Apr 8, 2025

Jira Pull Request Link

This Pull Request refers to the following Jira issue IOPLT-1054

Copy link
Contributor

github-actions bot commented Apr 18, 2025

Terraform Plan 📖

Terraform Plan
DashboardPart"
                                }
                              + position = {
                                  + colSpan = 6
                                  + rowSpan = 4
                                  + x       = 12
                                  + y       = 28
                                }
                            }
                          ~ "3"  = {
                              ~ metadata = {
                                  ~ inputs   = [
                                        # (7 unchanged elements hidden)
                                        {
                                            isOptional = true
                                            name       = "DraftRequestParameters"
                                            value      = {
                                                scope = "hierarchy"
                                            }
                                        },
                                      ~ {
                                            name       = "Query"
                                          ~ value      = <<-EOT
                                                let api_hosts = datatable (name: string) ["app-backend.io.italia.it", "api-app.io.pagopa.it"];
                                              - let threshold = 0.99;
                                              + let threshold = 0.7;
                                                AzureDiagnostics
                                                | where originalHost_s in (api_hosts)
                                              - | where requestUri_s matches regex "/user-identity"
                                              + | where requestUri_s matches regex "/api/v1/profile"
                                                | summarize
                                                  Total=count(),
                                              -   Success=count(httpStatus_d < 500) by bin(TimeGenerated, 10m)
                                              +   Success=count(httpStatus_d < 500) by bin(TimeGenerated, 5m)
                                                | extend availability=toreal(Success) / Total
                                                | project TimeGenerated, availability, watermark=threshold
                                                | render timechart with (xtitle = "time", ytitle= "availability(%)")
                                            EOT
                                            # (1 unchanged attribute hidden)
                                        },
                                        {
                                            isOptional = true
                                            name       = "ControlType"
                                            value      = "FrameControlChart"
                                        },
                                        {
                                            isOptional = true
                                            name       = "SpecificChart"
                                            value      = "Line"
                                        },
                                      ~ {
                                            name       = "PartTitle"
                                          ~ value      = "Availability (10m)" -> "Availability (5m)"
                                            # (1 unchanged attribute hidden)
                                        },
                                      ~ {
                                            name       = "PartSubTitle"
                                          ~ value      = "/user-identity" -> "/api/v1/profile"
                                            # (1 unchanged attribute hidden)
                                        },
                                        {
                                            isOptional = true
                                            name       = "Dimensions"
                                            value      = {
                                                aggregation = "Sum"
                                                splitBy     = []
                                                xAxis       = {
                                                    name = "TimeGenerated"
                                                    type = "datetime"
                                                }
                                                yAxis       = [
                                                    {
                                                        name = "availability"
                                                        type = "real"
                                                    },
                                                    {
                                                        name = "watermark"
                                                        type = "real"
                                                    },
                                                ]
                                            }
                                        },
                                        # (2 unchanged elements hidden)
                                    ]
                                  ~ settings = {
                                      ~ content = {
                                          ~ PartTitle = "Availability (10m)" -> "Availability (5m)"
                                          ~ Query     = <<-EOT
                                                let api_hosts = datatable (name: string) ["app-backend.io.italia.it", "api-app.io.pagopa.it"];
                                              - let threshold = 0.99;
                                              + let threshold = 0.7;
                                                AzureDiagnostics
                                                | where originalHost_s in (api_hosts)
                                              - | where requestUri_s matches regex "/user-identity"
                                              + | where requestUri_s matches regex "/api/v1/profile"
                                                | summarize
                                                  Total=count(),
                                              -   Success=count(httpStatus_d < 500) by bin(TimeGenerated, 10m)
                                              +   Success=count(httpStatus_d < 500) by bin(TimeGenerated, 5m)
                                                | extend availability=toreal(Success) / Total
                                                | project TimeGenerated, availability, watermark=threshold
                                                | render timechart with (xtitle = "time", ytitle= "availability(%)")
                                            EOT
                                        }
                                    }
                                    # (1 unchanged attribute hidden)
                                }
                                # (1 unchanged attribute hidden)
                            }
                          ~ "4"  = {
                              ~ metadata = {
                                  ~ inputs   = [
                                        # (7 unchanged elements hidden)
                                        {
                                            isOptional = true
                                            name       = "DraftRequestParameters"
                                            value      = {
                                                scope = "hierarchy"
                                            }
                                        },
                                      ~ {
                                            name       = "Query"
                                          ~ value      = <<-EOT
                                              - let api_url = "/user-identity";
                                              + let api_url = "/api/v1/profile";
                                                let api_hosts = datatable (name: string) ["app-backend.io.italia.it", "api-app.io.pagopa.it"];
                                                AzureDiagnostics
                                                | where originalHost_s in (api_hosts)
                                                | where requestUri_s matches regex api_url
                                                | extend HTTPStatus = case(
                                                  httpStatus_d between (100 .. 199), "1XX",
                                                  httpStatus_d between (200 .. 299), "2XX",
                                                  httpStatus_d between (300 .. 399), "3XX",
                                                  httpStatus_d between (400 .. 499), "4XX",
                                                  "5XX")
                                              - | summarize count() by HTTPStatus, bin(TimeGenerated, 10m)
                                              + | summarize count() by HTTPStatus, bin(TimeGenerated, 5m)
                                                | render areachart with (xtitle = "time", ytitle= "count")
                                            EOT
                                            # (1 unchanged attribute hidden)
                                        },
                                        {
                                            isOptional = true
                                            name       = "ControlType"
                                            value      = "FrameControlChart"
                                        },
                                        {
                                            isOptional = true
                                            name       = "SpecificChart"
                                            value      = "Pie"
                                        },
                                      ~ {
                                            name       = "PartTitle"
                                          ~ value      = "Response Codes (10m)" -> "Response Codes (5m)"
                                            # (1 unchanged attribute hidden)
                                        },
                                      ~ {
                                            name       = "PartSubTitle"
                                          ~ value      = "/user-identity" -> "/api/v1/profile"
                                            # (1 unchanged attribute hidden)
                                        },
                                        {
                                            isOptional = true
                                            name       = "Dimensions"
                                            value      = {
                                                aggregation = "Sum"
                                                splitBy     = []
                                                xAxis       = {
                                                    name = "httpStatus_d"
                                                    type = "string"
                                                }
                                                yAxis       = [
                                                    {
                                                        name = "count_"
                                                        type = "long"
                                                    },
                                                ]
                                            }
                                        },
                                        # (2 unchanged elements hidden)
                                    ]
                                  ~ settings = {
                                      ~ content = {
                                          ~ PartTitle     = "Response Codes (10m)" -> "Response Codes (5m)"
                                          ~ Query         = <<-EOT
                                              - let api_url = "/user-identity";
                                              + let api_url = "/api/v1/profile";
                                                let api_hosts = datatable (name: string) ["app-backend.io.italia.it", "api-app.io.pagopa.it"];
                                                AzureDiagnostics
                                                | where originalHost_s in (api_hosts)
                                                | where requestUri_s matches regex api_url
                                                | extend HTTPStatus = case(
                                                  httpStatus_d between (100 .. 199), "1XX",
                                                  httpStatus_d between (200 .. 299), "2XX",
                                                  httpStatus_d between (300 .. 399), "3XX",
                                                  httpStatus_d between (400 .. 499), "4XX",
                                                  "5XX")
                                              - | summarize count() by HTTPStatus, bin(TimeGenerated, 10m)
                                              + | summarize count() by HTTPStatus, bin(TimeGenerated, 5m)
                                                | render areachart with (xtitle = "time", ytitle= "count")
                                            EOT
                                            # (2 unchanged attributes hidden)
                                        }
                                    }
                                    # (1 unchanged attribute hidden)
                                }
                                # (1 unchanged attribute hidden)
                            }
                          ~ "5"  = {
                              ~ metadata = {
                                  ~ inputs   = [
                                        # (7 unchanged elements hidden)
                                        {
                                            isOptional = true
                                            name       = "DraftRequestParameters"
                                            value      = {
                                                scope = "hierarchy"
                                            }
                                        },
                                      ~ {
                                            name       = "Query"
                                          ~ value      = <<-EOT
                                                let api_hosts = datatable (name: string) ["app-backend.io.italia.it", "api-app.io.pagopa.it"];
                                              - let threshold = 1;
                                              + let threshold = 8;
                                                AzureDiagnostics
                                                | where originalHost_s in (api_hosts)
                                              - | where requestUri_s matches regex "/user-identity"
                                              + | where requestUri_s matches regex "/api/v1/profile"
                                                | summarize
                                                    watermark=threshold,
                                              -     duration_percentile_95=percentiles(timeTaken_d, 95) by bin(TimeGenerated, 10m)
                                              +     duration_percentile_95=percentiles(timeTaken_d, 95) by bin(TimeGenerated, 5m)
                                                | render timechart with (xtitle = "time", ytitle= "response time(s)")
                                            EOT
                                            # (1 unchanged attribute hidden)
                                        },
                                        {
                                            isOptional = true
                                            name       = "ControlType"
                                            value      = "FrameControlChart"
                                        },
                                        {
                                            isOptional = true
                                            name       = "SpecificChart"
                                            value      = "StackedColumn"
                                        },
                                      ~ {
                                            name       = "PartTitle"
                                          ~ value      = "Percentile Response Time (10m)" -> "Percentile Response Time (5m)"
                                            # (1 unchanged attribute hidden)
                                        },
                                      ~ {
                                            name       = "PartSubTitle"
                                          ~ value      = "/user-identity" -> "/api/v1/profile"
                                            # (1 unchanged attribute hidden)
                                        },
                                        {
                                            isOptional = true
                                            name       = "Dimensions"
                                            value      = {
                                                aggregation = "Sum"
                                                splitBy     = []
                                                xAxis       = {
                                                    name = "TimeGenerated"
                                                    type = "datetime"
                                                }
                                                yAxis       = [
                                                    {
                                                        name = "duration_percentile_95"
                                                        type = "real"
                                                    },
                                                ]
                                            }
                                        },
                                        # (2 unchanged elements hidden)
                                    ]
                                  ~ settings = {
                                      ~ content = {
                                          ~ PartTitle     = "Percentile Response Time (10m)" -> "Percentile Response Time (5m)"
                                          ~ Query         = <<-EOT
                                                let api_hosts = datatable (name: string) ["app-backend.io.italia.it", "api-app.io.pagopa.it"];
                                              - let threshold = 1;
                                              + let threshold = 8;
                                                AzureDiagnostics
                                                | where originalHost_s in (api_hosts)
                                              - | where requestUri_s matches regex "/user-identity"
                                              + | where requestUri_s matches regex "/api/v1/profile"
                                                | summarize
                                                    watermark=threshold,
                                              -     duration_percentile_95=percentiles(timeTaken_d, 95) by bin(TimeGenerated, 10m)
                                              +     duration_percentile_95=percentiles(timeTaken_d, 95) by bin(TimeGenerated, 5m)
                                                | render timechart with (xtitle = "time", ytitle= "response time(s)")
                                            EOT
                                            # (2 unchanged attributes hidden)
                                        }
                                    }
                                    # (1 unchanged attribute hidden)
                                }
                                # (1 unchanged attribute hidden)
                            }
                          + "6"  = {
                              + metadata = {
                                  + inputs   = [
                                      + {
                                          + isOptional = true
                                          + name       = "resourceTypeMode"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "ComponentId"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "Scope"
                                          + value      = {
                                              + resourceIds = [
                                                  + "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-rg-external/providers/Microsoft.Network/applicationGateways/io-p-appgateway",
                                                ]
                                            }
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "PartId"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "Version"
                                          + value      = "2.0"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "TimeRange"
                                          + value      = "PT4H"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "DashboardId"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "DraftRequestParameters"
                                          + value      = {
                                              + scope = "hierarchy"
                                            }
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "Query"
                                          + value      = <<-EOT
                                                let api_hosts = datatable (name: string) ["app-backend.io.italia.it", "api-app.io.pagopa.it"];
                                                let threshold = 0.99;
                                                AzureDiagnostics
                                                | where originalHost_s in (api_hosts)
                                                | where requestUri_s matches regex "/api/v1/api-profile"
                                                | summarize
                                                  Total=count(),
                                                  Success=count(httpStatus_d < 500) by bin(TimeGenerated, 5m)
                                                | extend availability=toreal(Success) / Total
                                                | project TimeGenerated, availability, watermark=threshold
                                                | render timechart with (xtitle = "time", ytitle= "availability(%)")
                                            EOT
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "ControlType"
                                          + value      = "FrameControlChart"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "SpecificChart"
                                          + value      = "Line"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "PartTitle"
                                          + value      = "Availability (5m)"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "PartSubTitle"
                                          + value      = "/api/v1/api-profile"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "Dimensions"
                                          + value      = {
                                              + aggregation = "Sum"
                                              + splitBy     = []
                                              + xAxis       = {
                                                  + name = "TimeGenerated"
                                                  + type = "datetime"
                                                }
                                              + yAxis       = [
                                                  + {
                                                      + name = "availability"
                                                      + type = "real"
                                                    },
                                                  + {
                                                      + name = "watermark"
                                                      + type = "real"
                                                    },
                                                ]
                                            }
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "LegendOptions"
                                          + value      = {
                                              + isEnabled = true
                                              + position  = "Bottom"
                                            }
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "IsQueryContainTimeRange"
                                          + value      = false
                                        },
                                    ]
                                  + settings = {
                                      + content = {
                                          + PartTitle = "Availability (5m)"
                                          + Query     = <<-EOT
                                                let api_hosts = datatable (name: string) ["app-backend.io.italia.it", "api-app.io.pagopa.it"];
                                                let threshold = 0.99;
                                                AzureDiagnostics
                                                | where originalHost_s in (api_hosts)
                                                | where requestUri_s matches regex "/api/v1/api-profile"
                                                | summarize
                                                  Total=count(),
                                                  Success=count(httpStatus_d < 500) by bin(TimeGenerated, 5m)
                                                | extend availability=toreal(Success) / Total
                                                | project TimeGenerated, availability, watermark=threshold
                                                | render timechart with (xtitle = "time", ytitle= "availability(%)")
                                            EOT
                                        }
                                    }
                                  + type     = "Extension/Microsoft_OperationsManagementSuite_Workspace/PartType/LogsDashboardPart"
                                }
                              + position = {
                                  + colSpan = 6
                                  + rowSpan = 4
                                  + x       = 0
                                  + y       = 8
                                }
                            }
                          + "7"  = {
                              + metadata = {
                                  + inputs   = [
                                      + {
                                          + isOptional = true
                                          + name       = "resourceTypeMode"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "ComponentId"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "Scope"
                                          + value      = {
                                              + resourceIds = [
                                                  + "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-rg-external/providers/Microsoft.Network/applicationGateways/io-p-appgateway",
                                                ]
                                            }
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "PartId"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "Version"
                                          + value      = "2.0"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "TimeRange"
                                          + value      = "PT4H"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "DashboardId"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "DraftRequestParameters"
                                          + value      = {
                                              + scope = "hierarchy"
                                            }
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "Query"
                                          + value      = <<-EOT
                                                let api_url = "/api/v1/api-profile";
                                                let api_hosts = datatable (name: string) ["app-backend.io.italia.it", "api-app.io.pagopa.it"];
                                                AzureDiagnostics
                                                | where originalHost_s in (api_hosts)
                                                | where requestUri_s matches regex api_url
                                                | extend HTTPStatus = case(
                                                  httpStatus_d between (100 .. 199), "1XX",
                                                  httpStatus_d between (200 .. 299), "2XX",
                                                  httpStatus_d between (300 .. 399), "3XX",
                                                  httpStatus_d between (400 .. 499), "4XX",
                                                  "5XX")
                                                | summarize count() by HTTPStatus, bin(TimeGenerated, 5m)
                                                | render areachart with (xtitle = "time", ytitle= "count")
                                            EOT
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "ControlType"
                                          + value      = "FrameControlChart"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "SpecificChart"
                                          + value      = "Pie"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "PartTitle"
                                          + value      = "Response Codes (5m)"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "PartSubTitle"
                                          + value      = "/api/v1/api-profile"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "Dimensions"
                                          + value      = {
                                              + aggregation = "Sum"
                                              + splitBy     = []
                                              + xAxis       = {
                                                  + name = "httpStatus_d"
                                                  + type = "string"
                                                }
                                              + yAxis       = [
                                                  + {
                                                      + name = "count_"
                                                      + type = "long"
                                                    },
                                                ]
                                            }
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "LegendOptions"
                                          + value      = {
                                              + isEnabled = true
                                              + position  = "Bottom"
                                            }
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "IsQueryContainTimeRange"
                                          + value      = false
                                        },
                                    ]
                                  + settings = {
                                      + content = {
                                          + Dimensions    = {
                                              + aggregation = "Sum"
                                              + splitBy     = [
                                                  + {
                                                      + name = "HTTPStatus"
                                                      + type = "string"
                                                    },
                                                ]
                                              + xAxis       = {
                                                  + name = "TimeGenerated"
                                                  + type = "datetime"
                                                }
                                              + yAxis       = [
                                                  + {
                                                      + name = "count_"
                                                      + type = "long"
                                                    },
                                                ]
                                            }
                                          + PartTitle     = "Response Codes (5m)"
                                          + Query         = <<-EOT
                                                let api_url = "/api/v1/api-profile";
                                                let api_hosts = datatable (name: string) ["app-backend.io.italia.it", "api-app.io.pagopa.it"];
                                                AzureDiagnostics
                                                | where originalHost_s in (api_hosts)
                                                | where requestUri_s matches regex api_url
                                                | extend HTTPStatus = case(
                                                  httpStatus_d between (100 .. 199), "1XX",
                                                  httpStatus_d between (200 .. 299), "2XX",
                                                  httpStatus_d between (300 .. 399), "3XX",
                                                  httpStatus_d between (400 .. 499), "4XX",
                                                  "5XX")
                                                | summarize count() by HTTPStatus, bin(TimeGenerated, 5m)
                                                | render areachart with (xtitle = "time", ytitle= "count")
                                            EOT
                                          + SpecificChart = "StackedArea"
                                        }
                                    }
                                  + type     = "Extension/Microsoft_OperationsManagementSuite_Workspace/PartType/LogsDashboardPart"
                                }
                              + position = {
                                  + colSpan = 6
                                  + rowSpan = 4
                                  + x       = 6
                                  + y       = 8
                                }
                            }
                          + "8"  = {
                              + metadata = {
                                  + inputs   = [
                                      + {
                                          + isOptional = true
                                          + name       = "resourceTypeMode"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "ComponentId"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "Scope"
                                          + value      = {
                                              + resourceIds = [
                                                  + "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-rg-external/providers/Microsoft.Network/applicationGateways/io-p-appgateway",
                                                ]
                                            }
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "PartId"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "Version"
                                          + value      = "2.0"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "TimeRange"
                                          + value      = "PT4H"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "DashboardId"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "DraftRequestParameters"
                                          + value      = {
                                              + scope = "hierarchy"
                                            }
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "Query"
                                          + value      = <<-EOT
                                                let api_hosts = datatable (name: string) ["app-backend.io.italia.it", "api-app.io.pagopa.it"];
                                                let threshold = 1;
                                                AzureDiagnostics
                                                | where originalHost_s in (api_hosts)
                                                | where requestUri_s matches regex "/api/v1/api-profile"
                                                | summarize
                                                    watermark=threshold,
                                                    duration_percentile_95=percentiles(timeTaken_d, 95) by bin(TimeGenerated, 5m)
                                                | render timechart with (xtitle = "time", ytitle= "response time(s)")
                                            EOT
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "ControlType"
                                          + value      = "FrameControlChart"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "SpecificChart"
                                          + value      = "StackedColumn"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "PartTitle"
                                          + value      = "Percentile Response Time (5m)"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "PartSubTitle"
                                          + value      = "/api/v1/api-profile"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "Dimensions"
                                          + value      = {
                                              + aggregation = "Sum"
                                              + splitBy     = []
                                              + xAxis       = {
                                                  + name = "TimeGenerated"
                                                  + type = "datetime"
                                                }
                                              + yAxis       = [
                                                  + {
                                                      + name = "duration_percentile_95"
                                                      + type = "real"
                                                    },
                                                ]
                                            }
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "LegendOptions"
                                          + value      = {
                                              + isEnabled = true
                                              + position  = "Bottom"
                                            }
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "IsQueryContainTimeRange"
                                          + value      = false
                                        },
                                    ]
                                  + settings = {
                                      + content = {
                                          + Dimensions    = {
                                              + aggregation = "Sum"
                                              + splitBy     = []
                                              + xAxis       = {
                                                  + name = "TimeGenerated"
                                                  + type = "datetime"
                                                }
                                              + yAxis       = [
                                                  + {
                                                      + name = "watermark"
                                                      + type = "long"
                                                    },
                                                  + {
                                                      + name = "duration_percentile_95"
                                                      + type = "real"
                                                    },
                                                ]
                                            }
                                          + PartTitle     = "Percentile Response Time (5m)"
                                          + Query         = <<-EOT
                                                let api_hosts = datatable (name: string) ["app-backend.io.italia.it", "api-app.io.pagopa.it"];
                                                let threshold = 1;
                                                AzureDiagnostics
                                                | where originalHost_s in (api_hosts)
                                                | where requestUri_s matches regex "/api/v1/api-profile"
                                                | summarize
                                                    watermark=threshold,
                                                    duration_percentile_95=percentiles(timeTaken_d, 95) by bin(TimeGenerated, 5m)
                                                | render timechart with (xtitle = "time", ytitle= "response time(s)")
                                            EOT
                                          + SpecificChart = "Line"
                                        }
                                    }
                                  + type     = "Extension/Microsoft_OperationsManagementSuite_Workspace/PartType/LogsDashboardPart"
                                }
                              + position = {
                                  + colSpan = 6
                                  + rowSpan = 4
                                  + x       = 12
                                  + y       = 8
                                }
                            }
                          + "9"  = {
                              + metadata = {
                                  + inputs   = [
                                      + {
                                          + isOptional = true
                                          + name       = "resourceTypeMode"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "ComponentId"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "Scope"
                                          + value      = {
                                              + resourceIds = [
                                                  + "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-rg-external/providers/Microsoft.Network/applicationGateways/io-p-appgateway",
                                                ]
                                            }
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "PartId"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "Version"
                                          + value      = "2.0"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "TimeRange"
                                          + value      = "PT4H"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "DashboardId"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "DraftRequestParameters"
                                          + value      = {
                                              + scope = "hierarchy"
                                            }
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "Query"
                                          + value      = <<-EOT
                                                let api_hosts = datatable (name: string) ["app-backend.io.italia.it", "api-app.io.pagopa.it"];
                                                let threshold = 0.99;
                                                AzureDiagnostics
                                                | where originalHost_s in (api_hosts)
                                                | where requestUri_s matches regex "/api/v1/email-validation-process"
                                                | summarize
                                                  Total=count(),
                                                  Success=count(httpStatus_d < 500) by bin(TimeGenerated, 5m)
                                                | extend availability=toreal(Success) / Total
                                                | project TimeGenerated, availability, watermark=threshold
                                                | render timechart with (xtitle = "time", ytitle= "availability(%)")
                                            EOT
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "ControlType"
                                          + value      = "FrameControlChart"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "SpecificChart"
                                          + value      = "Line"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "PartTitle"
                                          + value      = "Availability (5m)"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "PartSubTitle"
                                          + value      = "/api/v1/email-validation-process"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "Dimensions"
                                          + value      = {
                                              + aggregation = "Sum"
                                              + splitBy     = []
                                              + xAxis       = {
                                                  + name = "TimeGenerated"
                                                  + type = "datetime"
                                                }
                                              + yAxis       = [
                                                  + {
                                                      + name = "availability"
                                                      + type = "real"
                                                    },
                                                  + {
                                                      + name = "watermark"
                                                      + type = "real"
                                                    },
                                                ]
                                            }
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "LegendOptions"
                                          + value      = {
                                              + isEnabled = true
                                              + position  = "Bottom"
                                            }
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "IsQueryContainTimeRange"
                                          + value      = false
                                        },
                                    ]
                                  + settings = {
                                      + content = {
                                          + PartTitle = "Availability (5m)"
                                          + Query     = <<-EOT
                                                let api_hosts = datatable (name: string) ["app-backend.io.italia.it", "api-app.io.pagopa.it"];
                                                let threshold = 0.99;
                                                AzureDiagnostics
                                                | where originalHost_s in (api_hosts)
                                                | where requestUri_s matches regex "/api/v1/email-validation-process"
                                                | summarize
                                                  Total=count(),
                                                  Success=count(httpStatus_d < 500) by bin(TimeGenerated, 5m)
                                                | extend availability=toreal(Success) / Total
                                                | project TimeGenerated, availability, watermark=threshold
                                                | render timechart with (xtitle = "time", ytitle= "availability(%)")
                                            EOT
                                        }
                                    }
                                  + type     = "Extension/Microsoft_OperationsManagementSuite_Workspace/PartType/LogsDashboardPart"
                                }
                              + position = {
                                  + colSpan = 6
                                  + rowSpan = 4
                                  + x       = 0
                                  + y       = 12
                                }
                            }
                        }
                        # (1 unchanged attribute hidden)
                    }
                }
                # (1 unchanged attribute hidden)
            }
        )
        id                   = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/dashboards/providers/Microsoft.Portal/dashboards/io-p-opex_iobackend_api_auth"
        name                 = "io-p-opex_iobackend_api_auth"
      ~ tags                 = {
          - "BusinessUnit" = "App IO" -> null
            "CostCenter"   = "TS310 - PAGAMENTI & SERVIZI"
            "CreatedBy"    = "Terraform"
            "Environment"  = "Prod"
            "Owner"        = "io"
            "Source"       = "https://github.com/pagopa/io-backend"
        }
        # (2 unchanged attributes hidden)
    }

Plan: 16 to add, 1 to change, 4 to destroy.

─────────────────────────────────────────────────────────────────────────────

Note: You didn't use the -out option to save this plan, so Terraform can't
guarantee to take exactly these actions if you run "terraform apply" now.

@BurnedMarshal BurnedMarshal force-pushed the refactor-openapi-specs branch from 561e887 to 4ed4af5 Compare April 18, 2025 09:51
@BurnedMarshal BurnedMarshal force-pushed the refactor-openapi-specs branch from bc82600 to 9e5e8ab Compare May 27, 2025 09:55
Copy link
Contributor

@acuiuli acuiuli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes for Comunicazione LGTM but it is missing the new api added here

@BurnedMarshal BurnedMarshal force-pushed the refactor-openapi-specs branch from b9bff16 to 9e5e8ab Compare June 24, 2025 07:46
Copy link

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

api_session is no longer exposed by appbacked, a rebase is needed in order to align with last updates

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants