Skip to content
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

add_logic #1

Merged
merged 9 commits into from
Nov 2, 2021
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ typings/
.env
.env.test
config.json
local.json

# parcel-bundler cache (https://parceljs.org/)
.cache
Expand Down
27 changes: 27 additions & 0 deletions config/custom-environment-variables.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,32 @@
}
}
}
},
"httpRetry": {
"attempts": {
"__name": "HTTP_RETRY_ATTEMPTS",
"__format": "number"
},
"delay": "HTTP_RETRY_DELAY",
"shouldResetTimeout": {
"__name": "HTTP_RETRY_SHOULD_RESET_TIMEOUT",
"__format": "boolean"
}
},
"jobManager": {
"url": "JOB_MANAGER_URL",
"expirationTime": {
"__name": "JOB_MANAGER_EXPIRATION_TIME",
"__format": "number"
}
},
"rasterCatalogManager": {
"url": "RASTER_CATALOG_MANAGER_URL"
},
"workerTypes": {
"tiles": {
"jobType": "WORKER_TYPES_TILES_JOB_TYPE",
"taskType": "WORKER_TYPES_TILES_TASK_TYPE"
}
}
}
18 changes: 18 additions & 0 deletions config/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,23 @@
"options": null
}
}
},
"httpRetry": {
"attempts": 5,
"delay": "exponential",
"shouldResetTimeout": true
},
"jobManager": {
"url": "http://job-manager-job-manager",
"expirationTime": 30
},
"rasterCatalogManager": {
"url": "http://raster-catalog-manager"
},
"workerTypes": {
"tiles": {
"jobType": "rasterTilesExporter",
"taskType": "rasterTilesExporter"
}
}
}
151 changes: 102 additions & 49 deletions openapi3.yaml
Original file line number Diff line number Diff line change
@@ -1,87 +1,140 @@
openapi: 3.0.1
info:
title: service-name
description: basic template for map colonies service
title: exporter-trigger
description: Service that responsible for activating the export geopackage process
version: 1.0.0
license:
name: MIT
url: https://opensource.org/licenses/MIT

paths:
/anotherResource:
get:
operationId: getAnotherResource
/create:
post:
tags:
- anotherResource
summary: gets the resource
- createGpkg
summary: Trigger export geopackage process
operationId: exportTilesToGpkg
requestBody:
$ref: '#/components/requestBodies/ExportGetmapBody'
responses:
200:
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/anotherResource'
/resourceName:
get:
operationId: getResourceName
tags:
- resourceName
summary: gets the resource
responses:
200:
description: OK
$ref: '#/components/schemas/createGpkgJobResponse'
400:
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/resource'
post:
operationId: createResource
tags:
- resourceName
summary: creates a new record of type resource
responses:
201:
description: created
$ref: '#/components/schemas/error'
404:
description: Could not find layer with matched dbId
content:
application/json:
schema:
$ref: '#/components/schemas/resource'
400:
description: Bad Request
$ref: '#/components/schemas/error'
500:
description: Internal Server Error
content:
application/json:
schema:
$ref: '#/components/schemas/error'
$ref: '#/components/schemas/internalError'

components:
requestBodies:
ExportGetmapBody:
description: Export to gpkg via GetMap
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/exportGetMap'

schemas:
error:
exportGetMap:
type: object
properties:
dbId:
type: string
format: uuid
description: ID as the primary key from the Raster Catalog
packageName:
type: string
description: The name of the desired GPKG (no need for .gpkg extension)
pattern: '^[\/\w\-. ]+$' # Allowed characters for file name in Linux
maxLength: 255 # Linux maximum file name length is 255 bytes
bbox:
type: array
items:
type: number
minItems: 4
maxItems: 4
description: Bounding box corners (lower left, upper right)=[minx,miny,maxx,maxy] in crs units as array
targetResolution:
type: number
description: The target resolution in which the tiles will be created - DEGREE to PIXEL
callbackURL:
type: string
description: The callback URL to notify the process if finished
crs:
$ref: '#/components/schemas/CRS'
priority:
type: number
description: The priority of the record. Maximum priority = most urgent.
minimum: 0
maximum: 999999999
required:
- message
- dbId
asafMasa marked this conversation as resolved.
Show resolved Hide resolved
- bbox
- targetResolution
- callbackURL
- packageName

example:
dbId: ef03ca54-c68e-4ca8-8432-50ae5ad7a7f8
packageName: myPackage
bbox: [34.811938017107494, 31.95475033759175, 34.82237261707599, 31.96426962177354]
targetResolution: 4.29153442382812e-05
callbackURL: 'http://example.getmap.com/callback'
crs: 'EPSG:4326'
priority: 0

createGpkgJobResponse:
type: object
properties:
message:
jobId:
type: string
format: uuid
taskId:
type: string
resource:
format: uuid
required:
- jobId
- taskId

error:
type: object
required:
- id
- name
- description
- message
properties:
id:
type: number
format: int64
name:
type: string
description:
message:
type: string
anotherResource:

internalError:
type: object
required:
- kind
- isAlive
- message
- stacktrace
properties:
kind:
message:
type: string
isAlive:
type: boolean
stacktrace:
type: string

CRS:
type: string
description: List of supported
enum:
- EPSG:4326
Loading