Skip to content

Commit

Permalink
Merge pull request #28 from pagopa/NOD-303_scrittura_db
Browse files Browse the repository at this point in the history
feat: Nod 303 scrittura db
  • Loading branch information
cesarecaccuri committed Jun 26, 2023
2 parents 708f1be + 0dde89b commit 143e239
Show file tree
Hide file tree
Showing 20 changed files with 119 additions and 66 deletions.
42 changes: 37 additions & 5 deletions helm/neu-dev/values-dev.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
basecache: &basecache
namespace: "apiconfig"
image:
repository: pagopadcommonacr.azurecr.io/pagopaapiconfigcache
tag: "0.1.8"
livenessProbe:
httpGet:
path: /actuator/health/liveness
Expand All @@ -21,9 +18,10 @@ basecache: &basecache
memory: "512Mi"
cpu: "0.25"
limits:
memory: "2G"
cpu: "1"
memory: "6G"
cpu: "2.5"
envConfig: &envConfig
TZ: "Europe/Rome"
AZURE_INSIGHTS_ENABLED: "true"
REDIS_HOST: "pagopa-d-redis.redis.cache.windows.net"
REDIS_PORT: "6380"
Expand All @@ -49,6 +47,9 @@ basecache: &basecache
# Configuration used to update image tag
postgresql:
!!merge <<: *basecache
image:
repository: pagopadcommonacr.azurecr.io/pagopaapiconfigcache
tag: "0.5.0"
ingress:
!!merge <<: *ingress
path: /api-config-cache/p(/|$)(.*)
Expand All @@ -67,6 +68,9 @@ postgresql:
DB_CONFIG_PASSWORD: "postgresql-db-cfg-password"
oracle:
!!merge <<: *basecache
image:
repository: pagopadcommonacr.azurecr.io/pagopaapiconfigcache
tag: "0.5.0"
ingress:
!!merge <<: *ingress
path: /api-config-cache/o(/|$)(.*)
Expand All @@ -79,13 +83,17 @@ oracle:
JAVA_OPTS: "-Dspring.jpa.show-sql=false"
DATABASE_ID: "o"
HEALTHCHECK_QUERY: "select 1 from dual"
SAVE_DB: "true"
secretProvider:
!!merge <<: *azureSecretProvider
envSecrets:
!!merge <<: *envSecret
DB_CONFIG_PASSWORD: "oracle-db-cfg-password"
oracledev:
!!merge <<: *basecache
image:
repository: pagopadcommonacr.azurecr.io/pagopaapiconfigcache
tag: "0.5.0"
ingress:
!!merge <<: *ingress
path: /api-config-cachedev/o(/|$)(.*)
Expand All @@ -98,8 +106,32 @@ oracledev:
JAVA_OPTS: "-Dspring.jpa.show-sql=false"
DATABASE_ID: "odev"
HEALTHCHECK_QUERY: "select 1 from dual"
SAVE_DB: "true"
secretProvider:
!!merge <<: *azureSecretProvider
envSecrets:
!!merge <<: *envSecret
DB_CONFIG_PASSWORD: "oracle-db-cfg-dev-password"
oracleprod:
!!merge <<: *basecache
image:
repository: pagopadcommonacr.azurecr.io/pagopaapiconfigcache
tag: "0.5.0-nocolumns"
ingress:
!!merge <<: *ingress
path: /api-config-cachedev/oprod(/|$)(.*)
envConfig:
!!merge <<: *envConfig
APPLICATIONINSIGHTS_ROLE_NAME: "pagopa-api-config-cache-oracle"
DB_CONFIG_URL: "jdbc:oracle:thin:@db-nodo-pagamenti.d.db-nodo-pagamenti.com:1522/NDPSPCT_NODO4_CFG"
DB_CONFIG_USER: "NODO4_CFG_EXPORT"
DB_CONFIG_DRIVER: "oracle.jdbc.OracleDriver"
JAVA_OPTS: "-Dspring.jpa.show-sql=false"
DATABASE_ID: "oprod"
HEALTHCHECK_QUERY: "select 1 from dual"
SAVE_DB: "true"
secretProvider:
!!merge <<: *azureSecretProvider
envSecrets:
!!merge <<: *envSecret
DB_CONFIG_PASSWORD: "oracle-db-cfg-prod-password"
11 changes: 8 additions & 3 deletions helm/weu-dev/values-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ basecache: &basecache
memory: "6G"
cpu: "2.5"
envConfig: &envConfig
TZ: "Europe/Rome"
AZURE_INSIGHTS_ENABLED: "true"
REDIS_HOST: "pagopa-d-redis.redis.cache.windows.net"
REDIS_PORT: "6380"
Expand Down Expand Up @@ -48,7 +49,7 @@ postgresql:
!!merge <<: *basecache
image:
repository: pagopadcommonacr.azurecr.io/pagopaapiconfigcache
tag: "0.5.0"
tag: "0.6.0"
ingress:
!!merge <<: *ingress
path: /api-config-cache/p(/|$)(.*)
Expand All @@ -60,6 +61,7 @@ postgresql:
DB_CONFIG_DRIVER: "org.postgresql.Driver"
DATABASE_ID: "p"
HEALTHCHECK_QUERY: "select 1"
SAVE_DB: "true"
secretProvider:
!!merge <<: *azureSecretProvider
envSecrets:
Expand All @@ -69,7 +71,7 @@ oracle:
!!merge <<: *basecache
image:
repository: pagopadcommonacr.azurecr.io/pagopaapiconfigcache
tag: "0.5.0"
tag: "0.6.0"
ingress:
!!merge <<: *ingress
path: /api-config-cache/o(/|$)(.*)
Expand All @@ -82,6 +84,7 @@ oracle:
JAVA_OPTS: "-Dspring.jpa.show-sql=false"
DATABASE_ID: "o"
HEALTHCHECK_QUERY: "select 1 from dual"
SAVE_DB: "true"
secretProvider:
!!merge <<: *azureSecretProvider
envSecrets:
Expand All @@ -91,7 +94,7 @@ oracledev:
!!merge <<: *basecache
image:
repository: pagopadcommonacr.azurecr.io/pagopaapiconfigcache
tag: "0.5.0"
tag: "0.6.0"
ingress:
!!merge <<: *ingress
path: /api-config-cachedev/o(/|$)(.*)
Expand All @@ -104,6 +107,7 @@ oracledev:
JAVA_OPTS: "-Dspring.jpa.show-sql=false"
DATABASE_ID: "odev"
HEALTHCHECK_QUERY: "select 1 from dual"
SAVE_DB: "true"
secretProvider:
!!merge <<: *azureSecretProvider
envSecrets:
Expand All @@ -126,6 +130,7 @@ oracleprod:
JAVA_OPTS: "-Dspring.jpa.show-sql=false"
DATABASE_ID: "oprod"
HEALTHCHECK_QUERY: "select 1 from dual"
SAVE_DB: "true"
secretProvider:
!!merge <<: *azureSecretProvider
envSecrets:
Expand Down
1 change: 1 addition & 0 deletions helm/weu-it/values-it.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ oracle:
JAVA_OPTS: "-Dspring.jpa.show-sql=false"
DATABASE_ID: "or"
HEALTHCHECK_QUERY: "select 1 from dual"
SAVE_DB: "true"
secretProvider:
!!merge <<: *azureSecretProvider
envSecrets:
Expand Down
1 change: 1 addition & 0 deletions helm/weu-prf/values-prf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ oracle:
JAVA_OPTS: "-Dspring.jpa.show-sql=false"
DATABASE_ID: "or"
HEALTHCHECK_QUERY: "select 1 from dual"
SAVE_DB: "true"
secretProvider:
!!merge <<: *azureSecretProvider
envSecrets:
Expand Down
2 changes: 2 additions & 0 deletions helm/weu-prod/values-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ oracle:
DATABASE_ID: "o"
IN_PROGRESS_TTL: "20"
HEALTHCHECK_QUERY: "select 1 from dual"
SAVE_DB: "true"
secretProvider:
!!merge <<: *azureSecretProvider
envSecrets:
Expand All @@ -108,6 +109,7 @@ oracleprod:
DATABASE_ID: "oprod"
IN_PROGRESS_TTL: "20"
HEALTHCHECK_QUERY: "select 1 from dual"
SAVE_DB: "true"
secretProvider:
!!merge <<: *azureSecretProvider
envSecrets:
Expand Down
1 change: 1 addition & 0 deletions helm/weu-uat/values-uat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ oracle:
JAVA_OPTS: "-Dspring.jpa.show-sql=false"
DATABASE_ID: "o"
HEALTHCHECK_QUERY: "select 1 from dual"
SAVE_DB: "true"
secretProvider:
!!merge <<: *azureSecretProvider
envSecrets:
Expand Down
2 changes: 1 addition & 1 deletion openapi/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"title": "API-Config Cacher",
"description": "Generate cache for regarding Nodo dei Pagamenti configuration",
"termsOfService": "https://www.pagopa.gov.it/",
"version": "0.5.0"
"version": "0.6.0"
},
"servers": [
{
Expand Down
2 changes: 1 addition & 1 deletion openapi/openapi_fdrv1.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"title": "API-Config Cacher",
"description": "Generate cache for regarding Nodo dei Pagamenti configuration",
"termsOfService": "https://www.pagopa.gov.it/",
"version": "0.5.0"
"version": "0.6.0"
},
"servers": [
{
Expand Down
2 changes: 1 addition & 1 deletion openapi/openapi_nodev1.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"title": "API-Config Cacher",
"description": "Generate cache for regarding Nodo dei Pagamenti configuration",
"termsOfService": "https://www.pagopa.gov.it/",
"version": "0.5.0"
"version": "0.6.0"
},
"servers": [
{
Expand Down
2 changes: 1 addition & 1 deletion openapi/openapi_verifierv1.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"title": "API-Config Cacher",
"description": "Generate cache for regarding Nodo dei Pagamenti configuration",
"termsOfService": "https://www.pagopa.gov.it/",
"version": "0.5.0"
"version": "0.6.0"
},
"servers": [
{
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<groupId>it.gov.pagopa.api-config</groupId>
<artifactId>cache</artifactId>
<version>0.5.0</version>
<version>0.6.0</version>
<name>API-Config Cacher</name>
<description>Generate cache for regarding Nodo dei Pagamenti configuration</description>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,8 @@
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
public abstract class CacheController {
Expand All @@ -43,7 +40,7 @@ private void loadCacheFromRedis() {
summary = "Get selected key of fdr v1 config",
security = {@SecurityRequirement(name = "ApiKey")},
tags = {
"Cache",
"Cache",
})
@ApiResponses(
value = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,35 +1,15 @@
package it.gov.pagopa.apiconfig.cache.controller;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import it.gov.pagopa.apiconfig.cache.model.NodeCacheKey;
import it.gov.pagopa.apiconfig.cache.model.ProblemJson;
import it.gov.pagopa.apiconfig.cache.model.node.CacheVersion;
import it.gov.pagopa.apiconfig.cache.model.node.v1.ConfigDataV1;
import it.gov.pagopa.apiconfig.cache.service.ConfigService;
import java.io.IOException;
import java.util.Optional;
import javax.annotation.PostConstruct;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/stakeholders/fdr/cache/schemas")
@Validated
@Slf4j
public class FdrCacheController extends CacheController{
public class FdrCacheController extends CacheController {
@Override
String stakeholder() {
return "fdr";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,34 +1,15 @@
package it.gov.pagopa.apiconfig.cache.controller;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import it.gov.pagopa.apiconfig.cache.model.ProblemJson;
import it.gov.pagopa.apiconfig.cache.model.node.CacheVersion;
import it.gov.pagopa.apiconfig.cache.model.node.v1.ConfigDataV1;
import it.gov.pagopa.apiconfig.cache.service.ConfigService;
import java.io.IOException;
import java.util.Optional;
import javax.annotation.PostConstruct;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/stakeholders/node/cache/schemas")
@Validated
@Slf4j
public class NodeCacheController extends CacheController{
public class NodeCacheController extends CacheController {
@Override
String stakeholder() {
return "node";
Expand Down
Loading

0 comments on commit 143e239

Please sign in to comment.