Julia API server for BmiServer

OpenAPI specification for the Basic Modeling Interface (BMI). All functions are described on the BMI homepage.

Overview

This API server was generated by the OpenAPI Generator project. By using the openapi-spec from a remote server, you can easily generate an API client.

  • API version: 2.0
  • Generator version: 7.9.0
  • Build package: org.openapitools.codegen.languages.JuliaServerCodegen

For more information, please visit https://www.ewatercycle.org/contact/

Installation

Place the Julia files generated under the src folder in your Julia project. Include BmiServer.jl in the project code. It would include the module named BmiServer.

Implement the server methods as listed below. They are also documented with the BmiServer module. Launch a HTTP server with a router that has all handlers registered. A register method is provided in BmiServer module for convenience.

register(
    router::HTTP.Router,        # Router to register handlers in
    impl;                       # Module that implements the server methods
    path_prefix::String="",     # Prefix to be applied to all paths
    optional_middlewares...     # Optional middlewares to be applied to all handlers
)

Optional middlewares can be one or more of:

  • init: called before the request is processed
  • pre_validation: called after the request is parsed but before validation
  • pre_invoke: called after validation but before the handler is invoked
  • post_invoke: called after the handler is invoked but before the response is sent

The order in which middlewares are invoked are: init |> read |> pre_validation |> validate |> pre_invoke |> invoke |> post_invoke

API Endpoints

The following server methods must be implemented:

ClassMethodHTTP requestDescription
ExchangeItemsApigetcomponentnameGET /getcomponentname
ExchangeItemsApigetinputitem_countGET /getinputitem_count
ExchangeItemsApigetinputvar_namesGET /getinputvar_names
ExchangeItemsApigetoutputitem_countGET /getoutputitem_count
ExchangeItemsApigetoutputvar_namesGET /getoutputvar_names
GettersApiget_valueGET /get_value/{name}
GettersApigetvalueat_indicesPOST /getvalueat_indices/{name}
GridInformationApigetgridrankGET /getgridrank/{grid}
GridInformationApigetgridsizeGET /getgridsize/{grid}
GridInformationApigetgridtypeGET /getgridtype/{grid}
IRFApifinalizeDELETE /finalize
IRFApiinitializePOST /initialize
IRFApiupdatePOST /update
IRFApiupdate_untilPOST /update_until
NURCApigetgridxGET /getgridx/{grid}
NURCApigetgridyGET /getgridy/{grid}
NURCApigetgridzGET /getgridz/{grid}
SettersApiset_valuePOST /set_value/{name}
SettersApisetvalueat_indicesPOST /setvalueat_indices/{name}
TimeInformationApigetcurrenttimeGET /getcurrenttime
TimeInformationApigetendtimeGET /getendtime
TimeInformationApigetstarttimeGET /getstarttime
TimeInformationApigettimestepGET /gettimestep
TimeInformationApigettimeunitsGET /gettimeunits
UniformRectilinearApigetgridoriginGET /getgridorigin/{grid}
UniformRectilinearApigetgridshapeGET /getgridshape/{grid}
UniformRectilinearApigetgridspacingGET /getgridspacing/{grid}
UnstructuredApigetgridedge_countGET /getgridedge_count/{grid}
UnstructuredApigetgridedge_nodesGET /getgridedge_nodes/{grid}
UnstructuredApigetgridface_countGET /getgridface_count/{grid}
UnstructuredApigetgridface_edgesGET /getgridface_edges/{grid}
UnstructuredApigetgridface_nodesGET /getgridface_nodes/{grid}
UnstructuredApigetgridnode_countGET /getgridnode_count/{grid}
UnstructuredApigetgridnodesperfaceGET /getgridnodesperface/{grid}
VariableInformationApigetvargridGET /getvargrid/{name}
VariableInformationApigetvaritemsizeGET /getvaritemsize/{name}
VariableInformationApigetvarlocationGET /getvarlocation/{name}
VariableInformationApigetvarnbytesGET /getvarnbytes/{name}
VariableInformationApigetvartypeGET /getvartype/{name}
VariableInformationApigetvarunitsGET /getvarunits/{name}

Models

Author