2
votes

A core requirement of my application is the ability to automatically deploy ArangoDB with all collections, graphs, data, and APIs. The HTTP API and the various wrappers have been sufficient for this so far, but I haven't been able to find an API for deploying Foxx services. Is there any way to create and deploy a Foxx service via RESTful API or through one of the wrappers? So far, the only way I know to create a Foxx service is through the web interface.

I found this question which leads me to believe it's possible, but I don't know how to specify the Git location of the Foxx service. Could you provide instructions for creating a Foxx service without the web UI and list the possible parameters?

1
Is the Foxx manager an option? foxx-manager install <service-info> <mount-point> option1=value1CodeManX
I would prefer something that could be implemented RESTfully or via Python without dependency on ArangoSH. My team works cross-platform and not everyone has ArangoSH installed, thus CLIs aren't ideal. Everything is scripted, and it's very difficult to get scripts to work properly cross-platform when they need to call a CLI, since accessing bash and accessing cmd are pretty different from Python.Nate Gardner
You can have a look to my project foxx-framework.com I use a script to deploy all my services using foxx-managersolisoft
Is there a RESTful backend to Foxx manager? Or can it be installed via npm? I'm trying to limit dependencies on ArangoSH.Nate Gardner

1 Answers

3
votes

To install a Foxx service via the REST API, you can use the endpoint HTTP PUT /_admin/foxx/install.

It will require a JSON body to be sent, with attributes named mount and appInfo. mount needs to contain the mountpoint (needs to start with a forward slash). appInfo is the application to be mounted. It can contain the filename as previously returned by the server from the call to /_api/upload, e.g.

{ 
    "appInfo" : "uploads/tmp-30573-2010894858", 
    "mount" : "/my-mount-point" 
}

install from remote URL

You can also install a Foxx service from a zip file available via HTTP(S) from an external server. You can include the username and password for HTTP Basic Auth as necessary:

{ 
    "appInfo" : "https://user:[email protected]/my-service.zip", 
    "mount" : "/my-mount-point" 
}

install from GitHub

You can also install a Foxx service from a GitHub repository, if the repository is public accessible, e.g.

{ 
    "appInfo" : "git:arangodb-foxx/demo-hello-foxx:master", 
    "mount" : "/my-mount-point" 
}

Behind the scenes, ArangoDB will translate the request into a regular URL for the zip bundle GitHub provides.

install from local file system

You can also install a Foxx service from a zip file or directory on the local filesystem:

{ 
    "appInfo" : "/path/to/foxx-service.zip", 
    "mount" : "/my-mount-point" 
}

This also works with directory, but ArangoDB will create a temporary zip file for you in this case.