Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
api/gen/** linguist-generated
api/*/gen/** linguist-generated
go.work.sum linguist-generated
*/go.sum linguist-generated
7 changes: 5 additions & 2 deletions api/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
include ../tools.mk

.PHONY: generate-v1
generate-v1:
goa gen github.com/pgEdge/control-plane/api/v1/design -o v1

.PHONY: generate
generate:
goa gen github.com/pgEdge/control-plane/api/design
generate: generate-v1
1 change: 0 additions & 1 deletion api/gen/http/openapi.json

This file was deleted.

1 change: 0 additions & 1 deletion api/gen/http/openapi3.json

This file was deleted.

49 changes: 24 additions & 25 deletions api/design/api.go → api/v1/design/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@ import (
"net/http"

g "goa.design/goa/v3/dsl"
)

//go:embed version.txt
var version string
"github.com/pgEdge/control-plane/api"
)

var _ = g.API("control-plane", func() {
g.Title("pgEdge Control Plane API")
g.Version(version)
g.Title("pgEdge Control Plane v1 API")
g.Version(api.Version)
g.Description("Service for creating, modifying, and operating pgEdge databases.")
g.Server("control-plane", func() {
g.Host("localhost", func() {
Expand Down Expand Up @@ -70,7 +69,7 @@ var _ = g.Service("control-plane", func() {
g.Error("cluster_already_initialized")

g.HTTP(func() {
g.GET("/cluster/init")
g.GET("/v1/cluster/init")

g.Meta("openapi:tag:Cluster")
})
Expand All @@ -84,7 +83,7 @@ var _ = g.Service("control-plane", func() {
g.Error("invalid_join_token")

g.HTTP(func() {
g.POST("/cluster/join")
g.POST("/v1/cluster/join")

g.Meta("openapi:tag:Cluster")
})
Expand All @@ -97,7 +96,7 @@ var _ = g.Service("control-plane", func() {
g.Error("cluster_not_initialized")

g.HTTP(func() {
g.GET("/cluster/join-token")
g.GET("/v1/cluster/join-token")

g.Meta("openapi:tag:Cluster")
})
Expand All @@ -112,7 +111,7 @@ var _ = g.Service("control-plane", func() {
g.Error("invalid_join_token")

g.HTTP(func() {
g.POST("/internal/cluster/join-options")
g.POST("/v1/internal/cluster/join-options")
})
})

Expand All @@ -123,7 +122,7 @@ var _ = g.Service("control-plane", func() {
g.Error("cluster_not_initialized")

g.HTTP(func() {
g.GET("/cluster")
g.GET("/v1/cluster")

g.Meta("openapi:tag:Cluster")
})
Expand All @@ -136,7 +135,7 @@ var _ = g.Service("control-plane", func() {
g.Error("cluster_not_initialized")

g.HTTP(func() {
g.GET("/hosts")
g.GET("/v1/hosts")

g.Meta("openapi:tag:Host")
})
Expand All @@ -160,7 +159,7 @@ var _ = g.Service("control-plane", func() {
g.Error("not_found")

g.HTTP(func() {
g.GET("/hosts/{host_id}")
g.GET("/v1/hosts/{host_id}")

g.Meta("openapi:tag:Host")
})
Expand All @@ -183,7 +182,7 @@ var _ = g.Service("control-plane", func() {
g.Error("not_found")

g.HTTP(func() {
g.DELETE("/hosts/{host_id}")
g.DELETE("/v1/hosts/{host_id}")

g.Meta("openapi:tag:Host")
})
Expand All @@ -198,7 +197,7 @@ var _ = g.Service("control-plane", func() {
g.Error("cluster_not_initialized")

g.HTTP(func() {
g.GET("/databases")
g.GET("/v1/databases")

g.Meta("openapi:tag:Database")
})
Expand All @@ -215,7 +214,7 @@ var _ = g.Service("control-plane", func() {
g.Error("operation_already_in_progress")

g.HTTP(func() {
g.POST("/databases")
g.POST("/v1/databases")
g.Response("database_already_exists", http.StatusConflict)

g.Meta("openapi:tag:Database")
Expand All @@ -242,7 +241,7 @@ var _ = g.Service("control-plane", func() {
g.Error("not_found")

g.HTTP(func() {
g.GET("/databases/{database_id}")
g.GET("/v1/databases/{database_id}")

g.Meta("openapi:tag:Database")
})
Expand Down Expand Up @@ -274,7 +273,7 @@ var _ = g.Service("control-plane", func() {
g.Error("operation_already_in_progress")

g.HTTP(func() {
g.POST("/databases/{database_id}")
g.POST("/v1/databases/{database_id}")
g.Param("force_update")
g.Body("request")

Expand Down Expand Up @@ -302,7 +301,7 @@ var _ = g.Service("control-plane", func() {
g.Error("operation_already_in_progress")

g.HTTP(func() {
g.DELETE("/databases/{database_id}")
g.DELETE("/v1/databases/{database_id}")

g.Meta("openapi:tag:Database")
})
Expand Down Expand Up @@ -334,7 +333,7 @@ var _ = g.Service("control-plane", func() {
g.Error("operation_already_in_progress")

g.HTTP(func() {
g.POST("/databases/{database_id}/nodes/{node_name}/backups")
g.POST("/v1/databases/{database_id}/nodes/{node_name}/backups")
g.Body("options")

g.Meta("openapi:tag:Database")
Expand Down Expand Up @@ -373,7 +372,7 @@ var _ = g.Service("control-plane", func() {
g.Error("not_found")

g.HTTP(func() {
g.GET("/databases/{database_id}/tasks")
g.GET("/v1/databases/{database_id}/tasks")
g.Param("after_task_id")
g.Param("limit")
g.Param("sort_order")
Expand Down Expand Up @@ -405,7 +404,7 @@ var _ = g.Service("control-plane", func() {
g.Error("not_found")

g.HTTP(func() {
g.GET("/databases/{database_id}/tasks/{task_id}")
g.GET("/v1/databases/{database_id}/tasks/{task_id}")

g.Meta("openapi:tag:Database")
})
Expand Down Expand Up @@ -443,7 +442,7 @@ var _ = g.Service("control-plane", func() {
g.Error("not_found")

g.HTTP(func() {
g.GET("/databases/{database_id}/tasks/{task_id}/log")
g.GET("/v1/databases/{database_id}/tasks/{task_id}/log")
g.Param("after_entry_id")
g.Param("limit")

Expand Down Expand Up @@ -472,7 +471,7 @@ var _ = g.Service("control-plane", func() {
g.Error("operation_already_in_progress")

g.HTTP(func() {
g.POST("/databases/{database_id}/restore")
g.POST("/v1/databases/{database_id}/restore")
g.Body("request")

g.Meta("openapi:tag:Database")
Expand All @@ -485,14 +484,14 @@ var _ = g.Service("control-plane", func() {
g.Result(VersionInfo)

g.HTTP(func() {
g.GET("/version")
g.GET("/v1/version")

g.Meta("openapi:tag:System")
})
})

// Serves the OpenAPI spec as a static file
g.Files("/openapi.json", "./gen/http/openapi3.json", func() {
g.Files("/v1/openapi.json", "./gen/http/openapi3.json", func() {
g.Meta("openapi:generate", "false")
})
})
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading