Shubham | Refactor Directory structure & relative path accessbility

This commit is contained in:
Kuamr Shubham
2020-04-22 13:55:04 +05:30
parent 6564ce7419
commit 47e791ebad
32 changed files with 134 additions and 81 deletions

View File

@@ -47,7 +47,7 @@ class ValidationUtils {
public ProcessingReport getReport(JsonNode data) throws IOException, ProcessingException {
File schemaFile = new File("src/main/java/com/DeploymentPortal/api/Manifest/schema/manifest.json");
File schemaFile = new File("src/main/java/com/DeploymentPortal/api/Manifest/validation/manifest.json");
final JsonSchema schemaNode = getSchemaNode(schemaFile);
return isJsonValid(schemaNode, data);
}

View File

@@ -1,49 +0,0 @@
{
"$schema": "http://json-schema.org/draft-04/schema/#",
"definitions": {
"healthCheck": {
"type": "object",
"properties": {
"type": {
"enum": ["tcp", "http"]
},
"port": {
"enum": ["metrics","serviceport"]
},
"successThreshold": {
"type": "integer"
},
"initialDelaySeconds": {
"type": "integer"
},
"periodSeconds": {
"type": "integer"
},
"failureThreshold": {
"type": "integer"
}
}
}
},
"type": "object",
"properties": {
"livenessCheck": {
"$ref": "#/definitions/healthCheck"
},
"readinessCheck":{
"allOf": [
{
"$ref": "#/definitions/healthCheck"
},
{
"properties": {
"path": {
"type": "string"
}
}
}
]
}
},
"required": ["livenessCheck","readinessCheck"]
}

View File

@@ -1,22 +0,0 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Product",
"description": "A product from Acme's catalog",
"type": "object",
"properties": {
"version": {
"description": "Version of the manifest file",
"type": "string"
},
"deployment": {
"$ref": "file:src/main/java/com/DeploymentPortal/api/Manifest/schema/deployment.json"
},
"team": {
"$ref": "file:/Users/ankitkumargupta/Desktop/bootcamp/reactApplication/newDM/deployment-portal-backend/src/main/java/com/DeploymentPortal/api/Manifest/schema/team.json"
},
"labels": {
"$ref": "file:/Users/ankitkumargupta/Desktop/bootcamp/reactApplication/newDM/deployment-portal-backend/src/main/java/com/DeploymentPortal/api/Manifest/schema/labels.json"
}
},
"required": ["version","team"]
}

View File

@@ -21,12 +21,12 @@
"minimum": 0
},
"instance": {
"$ref": "file:/Users/ankitkumargupta/Desktop/bootcamp/reactApplication/newDM/deployment-portal-backend/src/main/java/com/DeploymentPortal/api/Manifest/schema/instance.json"
"$ref": "file:src/main/java/com/DeploymentPortal/api/Manifest/validation/deployment/instance.json"
},
"environmentVariables": {
"type": "array",
"items": {
"$ref": "file:/Users/ankitkumargupta/Desktop/bootcamp/reactApplication/newDM/deployment-portal-backend/src/main/java/com/DeploymentPortal/api/Manifest/schema/environmentVariable.json"
"$ref": "file:src/main/java/com/DeploymentPortal/api/Manifest/validation/deployment/environmentVariable.json"
},
"minItems": 1,
"uniqueItems": true
@@ -34,14 +34,14 @@
"loadBalancer": {
"type": "array",
"items": {
"$ref": "file:/Users/ankitkumargupta/Desktop/bootcamp/reactApplication/newDM/deployment-portal-backend/src/main/java/com/DeploymentPortal/api/Manifest/schema/loadBalancer.json"
"$ref": "files:src/main/java/com/DeploymentPortal/api/Manifest/validation/deployment/loadBalancer.json"
},
"minItems": 1
},
"exposedPorts": {
"type": "array",
"items": {
"$ref": "file:/Users/ankitkumargupta/Desktop/bootcamp/reactApplication/newDM/deployment-portal-backend/src/main/java/com/DeploymentPortal/api/Manifest/schema/exposedPorts.json"
"$ref": "file:src/main/java/com/DeploymentPortal/api/Manifest/validation/deployment/exposedPorts.json"
},
"minItems": 1
},
@@ -52,7 +52,7 @@
]
},
"healthChecks": {
"$ref": "file:/Users/ankitkumargupta/Desktop/bootcamp/reactApplication/newDM/deployment-portal-backend/src/main/java/com/DeploymentPortal/api/Manifest/schema/healthChecks.json"
"$ref": "file:src/main/java/com/DeploymentPortal/api/Manifest/validation/deployment/healthChecks.json"
}
},
"required": [

View File

@@ -1,4 +1,4 @@
{
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Name and Value of Environment Variable",
"type": "object",
@@ -8,7 +8,7 @@
"type": "string"
},
"value": {
"type": "number"
"type": "string"
}
},
"required": ["name","value"]

View File

@@ -8,7 +8,7 @@
"enum": ["metrics","serviceport"]
},
"port": {
"type": "integer"
"type": "string"
}
},
"required": ["name","port"]

View File

@@ -0,0 +1,102 @@
{
"$schema": "http://json-schema.org/draft-04/schema/#",
"definitions": {
"healthCheck": {
"type": "object",
"properties": {
"type": {
"enum": [
"tcp",
"http"
]
},
"port": {
"enum": [
"metrics",
"serviceport"
]
},
"successThreshold": {
"type": "integer"
},
"initialDelaySeconds": {
"type": "integer"
},
"periodSeconds": {
"type": "integer"
},
"failureThreshold": {
"type": "integer"
}
}
}
},
"type": "object",
"properties": {
"livenessCheck": {
"type": "object",
"properties": {
"type": {
"enum": [
"tcp",
"http"
]
},
"port": {
"enum": [
"metrics",
"serviceport"
]
},
"successThreshold": {
"type": "integer"
},
"initialDelaySeconds": {
"type": "integer"
},
"periodSeconds": {
"type": "integer"
},
"failureThreshold": {
"type": "integer"
}
}
},
"readinessCheck": {
"type": "object",
"properties": {
"type": {
"enum": [
"tcp",
"http"
]
},
"port": {
"enum": [
"metrics",
"serviceport"
]
},
"successThreshold": {
"type": "integer"
},
"initialDelaySeconds": {
"type": "integer"
},
"periodSeconds": {
"type": "integer"
},
"failureThreshold": {
"type": "integer"
},
"path": {
"type": "string"
}
}
}
},
"required": [
"livenessCheck",
"readinessCheck"
]
}

View File

@@ -14,7 +14,7 @@
"minimum": 0
},
"memory": {
"type": "string"
"type": "number"
}
},
"required": ["count","cpu","memory"]

View File

@@ -0,0 +1,22 @@
{
"$schema": "http://json-schema.org/draft-04/validation#",
"title": "Product",
"description": "A product from Acme's catalog",
"type": "object",
"properties": {
"version": {
"description": "Version of the manifest file",
"type": "string"
},
"deployment": {
"$ref": "file:src/main/java/com/DeploymentPortal/api/Manifest/validation/deployment.json"
},
"team": {
"$ref": "file:src/main/java/com/DeploymentPortal/api/Manifest/validation/team.json"
},
"labels": {
"$ref": "file:src/main/java/com/DeploymentPortal/api/Manifest/validation/labels.json"
}
},
"required": ["deployment","version","team"]
}