Run AtlansApi locally
AtlansApi
can be tested on a local machine. Assuming you have the Julia programming language installed and the AtlansApi
repository cloned locally, first instantiate the project (i.e. installing dependencies) by:
--project -e "using Pkg; Pkg.instantiate()" julia
Now, AtlansApi
can be tested by starting an instance of localhost server and using a local coding session or any API testing tool (e.g. Postman). Below, demonstrates how to run AtlansApi
in a local coding session.
AtlansApi
contains a script run_server.jl
which can start a localhost server instance. Start the server by typing the following Powershell command from the repository folder:
--project "run_server.jl" julia
Starting server on http://127.0.0.1:8081
[ Info: Listening on: 127.0.0.1:8081, thread id: 1
Now that a server connection has been established and AtlansApi
is “listening” for incoming requests, you can open a new terminal and start a Julia
session. The code snippet below can be used as the request to test AtlansApi
. This uses AtlansApi.SAMPLE_PAYLOAD
which is the same payload as the example features from the previous page. Running the code
using AtlansApi
using HTTP
= AtlansApi.SAMPLE_PAYLOAD
payload = "http://127.0.0.1:8081/run"
url = ["Content-Type" => "application/json"]
headers post(url, headers, payload) HTTP.
HTTP.Messages.Response:
"""
HTTP/1.1 200 OK
Transfer-Encoding: chunked
{"id":"a1d6aeb4-f9b8-4b9f-be97-91c2e7d917e1","initial":"./docker/output/a1d6aeb4-f9b8-4b9f-be97-91c2e7d917e1/initial.tif","remaining":"./docker/output/a1d6aeb4-f9b8-4b9f-be97-91c2e7d917e1/remaining.tif"}"""
Example result of “initial.tif” and “remaining.tif”