2021-12-10 17:15:33 +00:00
|
|
|
// Copyright (C) 2022 Storj Labs, Inc.
|
|
|
|
// See LICENSE for copying information.
|
|
|
|
|
|
|
|
package main
|
|
|
|
|
|
|
|
//go:generate go run ./
|
|
|
|
|
|
|
|
import (
|
2022-02-17 13:49:07 +00:00
|
|
|
"time"
|
|
|
|
|
|
|
|
"storj.io/common/uuid"
|
2021-12-10 17:15:33 +00:00
|
|
|
"storj.io/storj/private/apigen"
|
2022-02-17 13:49:07 +00:00
|
|
|
"storj.io/storj/satellite/accounting"
|
2021-12-10 17:15:33 +00:00
|
|
|
"storj.io/storj/satellite/console"
|
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
2022-01-11 13:20:02 +00:00
|
|
|
a := &apigen.API{
|
|
|
|
Version: "v1",
|
|
|
|
Description: "",
|
|
|
|
PackageName: "consoleapi",
|
|
|
|
}
|
2021-12-10 17:15:33 +00:00
|
|
|
|
|
|
|
{
|
2022-01-11 13:20:02 +00:00
|
|
|
g := a.Group("ProjectManagement", "projects")
|
2021-12-10 17:15:33 +00:00
|
|
|
|
|
|
|
g.Get("/", &apigen.Endpoint{
|
2022-01-11 13:20:02 +00:00
|
|
|
Name: "Get Projects",
|
|
|
|
Description: "Gets all projects user has",
|
2022-02-17 13:49:07 +00:00
|
|
|
MethodName: "GenGetUsersProjects",
|
2021-12-10 17:15:33 +00:00
|
|
|
Response: []console.Project{},
|
|
|
|
})
|
2022-01-11 13:20:02 +00:00
|
|
|
|
2022-02-17 13:49:07 +00:00
|
|
|
g.Get("/bucket-rollup", &apigen.Endpoint{
|
|
|
|
Name: "Get Project's Bucket Usage",
|
|
|
|
Description: "Gets project's bucket usage by bucket ID",
|
|
|
|
MethodName: "GenGetSingleBucketUsageRollup",
|
|
|
|
Response: &accounting.BucketUsageRollup{},
|
|
|
|
Params: []apigen.Param{
|
|
|
|
apigen.NewParam("projectID", uuid.UUID{}),
|
|
|
|
apigen.NewParam("bucket", ""),
|
|
|
|
apigen.NewParam("since", time.Time{}),
|
|
|
|
apigen.NewParam("before", time.Time{}),
|
|
|
|
},
|
|
|
|
})
|
2021-12-10 17:15:33 +00:00
|
|
|
}
|
2022-01-11 13:20:02 +00:00
|
|
|
|
2022-02-11 15:06:52 +00:00
|
|
|
a.MustWrite("satellite/console/consoleweb/consoleapi/api.gen.go")
|
2021-12-10 17:15:33 +00:00
|
|
|
}
|