All URIs are relative to https://graphhopper.com/api/1
| Method | HTTP request | Description |
|---|---|---|
| AsyncVRP | Post /vrp/optimize | Submit a route optimization job |
| GetSolution | Get /vrp/solution/{jobId} | Retrieve solution of a route optimization job |
| SolveVRP | Post /vrp | Solve a route optimization problem |
JobId AsyncVRP(ctx).Request(request).Execute()
Submit a route optimization job
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/meission/go-graphhopper"
)
func main() {
request := *openapiclient.NewRequest() // Request | The request that contains the problem to be solved.
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.RouteOptimizationAPI.AsyncVRP(context.Background()).Request(request).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `RouteOptimizationAPI.AsyncVRP``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `AsyncVRP`: JobId
fmt.Fprintf(os.Stdout, "Response from `RouteOptimizationAPI.AsyncVRP`: %v\n", resp)
}Other parameters are passed through a pointer to a apiAsyncVRPRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| request | Request | The request that contains the problem to be solved. |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Response GetSolution(ctx, jobId).Execute()
Retrieve solution of a route optimization job
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/meission/go-graphhopper"
)
func main() {
jobId := "jobId_example" // string | Request solution with jobId
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.RouteOptimizationAPI.GetSolution(context.Background(), jobId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `RouteOptimizationAPI.GetSolution``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetSolution`: Response
fmt.Fprintf(os.Stdout, "Response from `RouteOptimizationAPI.GetSolution`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| jobId | string | Request solution with jobId |
Other parameters are passed through a pointer to a apiGetSolutionRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Response SolveVRP(ctx).Request(request).Execute()
Solve a route optimization problem
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/meission/go-graphhopper"
)
func main() {
request := *openapiclient.NewRequest() // Request | The request that contains the vehicle routing problem to be solved.
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.RouteOptimizationAPI.SolveVRP(context.Background()).Request(request).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `RouteOptimizationAPI.SolveVRP``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `SolveVRP`: Response
fmt.Fprintf(os.Stdout, "Response from `RouteOptimizationAPI.SolveVRP`: %v\n", resp)
}Other parameters are passed through a pointer to a apiSolveVRPRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| request | Request | The request that contains the vehicle routing problem to be solved. |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]