commit
f45fbf271e
|
@ -22,8 +22,8 @@ func NewSetupHandler() *SetupHandler {
|
|||
h := &SetupHandler{
|
||||
Router: httprouter.New(),
|
||||
}
|
||||
h.HandlerFunc("POST", "/setup", h.handlePostSetup)
|
||||
h.HandlerFunc("GET", "/setup", h.isOnboarding)
|
||||
h.HandlerFunc("POST", "/api/v2/setup", h.handlePostSetup)
|
||||
h.HandlerFunc("GET", "/api/v2/setup", h.isOnboarding)
|
||||
return h
|
||||
}
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ func setCORSResponseHeaders(w nethttp.ResponseWriter, r *nethttp.Request) {
|
|||
}
|
||||
|
||||
var platformLinks = map[string]interface{}{
|
||||
"setup": "/setup",
|
||||
"setup": "/api/v2/setup",
|
||||
"sources": "/api/v2/sources",
|
||||
"dashboards": "/api/v2/dashboards",
|
||||
"query": "/api/v2/query",
|
||||
|
@ -81,8 +81,7 @@ func (h *PlatformHandler) ServeHTTP(w nethttp.ResponseWriter, r *nethttp.Request
|
|||
// of the platform API.
|
||||
if !strings.HasPrefix(r.URL.Path, "/v1") &&
|
||||
!strings.HasPrefix(r.URL.Path, "/api/v2") &&
|
||||
!strings.HasPrefix(r.URL.Path, "/chronograf/") &&
|
||||
!strings.HasPrefix(r.URL.Path, "/setup") {
|
||||
!strings.HasPrefix(r.URL.Path, "/chronograf/") {
|
||||
h.AssetHandler.ServeHTTP(w, r)
|
||||
return
|
||||
}
|
||||
|
@ -93,7 +92,7 @@ func (h *PlatformHandler) ServeHTTP(w nethttp.ResponseWriter, r *nethttp.Request
|
|||
return
|
||||
}
|
||||
|
||||
if strings.HasPrefix(r.URL.Path, "/setup") {
|
||||
if strings.HasPrefix(r.URL.Path, "/api/v2/setup") {
|
||||
h.SetupHandler.ServeHTTP(w, r)
|
||||
return
|
||||
}
|
||||
|
|
|
@ -50,14 +50,14 @@ paths:
|
|||
tags:
|
||||
- Setup
|
||||
summary: check if database has default user, org, bucket created, returns true if not.
|
||||
response:
|
||||
responses:
|
||||
'200':
|
||||
description:
|
||||
allowed true or false
|
||||
content:
|
||||
application/json:
|
||||
type: object
|
||||
properties:
|
||||
allowed:
|
||||
type: boolean
|
||||
schema:
|
||||
$ref: "#/components/schemas/IsOnboarding"
|
||||
post:
|
||||
tags:
|
||||
- Setup
|
||||
|
@ -75,8 +75,7 @@ paths:
|
|||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/OnboardingResponse"
|
||||
|
||||
$ref: "#/components/schemas/OnboardingResponse"
|
||||
/macros:
|
||||
get:
|
||||
tags:
|
||||
|
@ -3292,6 +3291,11 @@ components:
|
|||
type: array
|
||||
items:
|
||||
$ref: "#/components/schemas/Source"
|
||||
IsOnboarding:
|
||||
type: object
|
||||
properties:
|
||||
allowed:
|
||||
type: boolean
|
||||
OnboardingRequest:
|
||||
type: object
|
||||
properties:
|
||||
|
|
Loading…
Reference in New Issue