This commit is contained in:
mr 2024-11-07 13:42:19 +01:00
parent 21b3041783
commit 5f5072f176
10 changed files with 182 additions and 177 deletions

82
controllers/compute.go Normal file
View File

@ -0,0 +1,82 @@
package controllers
import (
"encoding/json"
oclib "cloud.o-forge.io/core/oc-lib"
beego "github.com/beego/beego/v2/server/web"
)
// Operations about compute
type ComputeController struct {
beego.Controller
}
// @Title Update
// @Description create computes
// @Param id path string true "the compute id you want to get"
// @Param body body models.compute true "The compute content"
// @Success 200 {compute} models.compute
// @router /:id [put]
func (o *ComputeController) Put() {
// store and return Id or post with UUID
var res map[string]interface{}
id := o.Ctx.Input.Param(":id")
json.Unmarshal(o.Ctx.Input.CopyBody(10000), &res)
o.Data["json"] = oclib.UpdateOne(oclib.LibDataEnum(oclib.COMPUTE_RESOURCE), res, id)
o.ServeJSON()
}
// @Title Create
// @Description create compute
// @Param compute body json true "body for compute content (Json format)"
// @Success 200 {compute} models.compute
// @router / [post]
func (o *ComputeController) Post() {
var res map[string]interface{}
json.Unmarshal(o.Ctx.Input.CopyBody(10000), &res)
o.Data["json"] = oclib.StoreOne(oclib.LibDataEnum(oclib.COMPUTE_RESOURCE), res)
o.ServeJSON()
}
// @Title GetAll
// @Description find compute by id
// @Success 200 {compute} models.compute
// @router / [get]
func (o *ComputeController) GetAll() {
o.Data["json"] = oclib.LoadAll(oclib.LibDataEnum(oclib.COMPUTE_RESOURCE))
o.ServeJSON()
}
// @Title Get
// @Description find compute by key word
// @Param search path string true "the search you want to get"
// @Success 200 {compute} models.compute
// @router /search/:search [get]
func (o *ComputeController) Search() {
search := o.Ctx.Input.Param(":search")
o.Data["json"] = oclib.Search(nil, search, oclib.LibDataEnum(oclib.COMPUTE_RESOURCE))
o.ServeJSON()
}
// @Title Get
// @Description find compute by id
// @Param id path string true "the id you want to get"
// @Success 200 {compute} models.compute
// @router /:id [get]
func (o *ComputeController) Get() {
id := o.Ctx.Input.Param(":id")
o.Data["json"] = oclib.LoadOne(oclib.LibDataEnum(oclib.COMPUTE_RESOURCE), id)
o.ServeJSON()
}
// @Title Delete
// @Description delete the compute
// @Param id path string true "The id you want to delete"
// @Success 200 {compute} delete success!
// @router /:id [delete]
func (o *ComputeController) Delete() {
id := o.Ctx.Input.Param(":id")
o.Data["json"] = oclib.DeleteOne(oclib.LibDataEnum(oclib.COMPUTE_RESOURCE), id)
o.ServeJSON()
}

View File

@ -1,82 +0,0 @@
package controllers
import (
"encoding/json"
oclib "cloud.o-forge.io/core/oc-lib"
beego "github.com/beego/beego/v2/server/web"
)
// Operations about datacenter
type DatacenterController struct {
beego.Controller
}
// @Title Update
// @Description create datacenters
// @Param id path string true "the datacenter id you want to get"
// @Param body body models.datacenter true "The datacenter content"
// @Success 200 {datacenter} models.datacenter
// @router /:id [put]
func (o *DatacenterController) Put() {
// store and return Id or post with UUID
var res map[string]interface{}
id := o.Ctx.Input.Param(":id")
json.Unmarshal(o.Ctx.Input.CopyBody(10000), &res)
o.Data["json"] = oclib.UpdateOne(oclib.LibDataEnum(oclib.DATACENTER_RESOURCE), res, id)
o.ServeJSON()
}
// @Title Create
// @Description create datacenter
// @Param datacenter body json true "body for datacenter content (Json format)"
// @Success 200 {datacenter} models.datacenter
// @router / [post]
func (o *DatacenterController) Post() {
var res map[string]interface{}
json.Unmarshal(o.Ctx.Input.CopyBody(10000), &res)
o.Data["json"] = oclib.StoreOne(oclib.LibDataEnum(oclib.DATACENTER_RESOURCE), res)
o.ServeJSON()
}
// @Title GetAll
// @Description find datacenter by id
// @Success 200 {datacenter} models.datacenter
// @router / [get]
func (o *DatacenterController) GetAll() {
o.Data["json"] = oclib.LoadAll(oclib.LibDataEnum(oclib.DATACENTER_RESOURCE))
o.ServeJSON()
}
// @Title Get
// @Description find datacenter by key word
// @Param search path string true "the search you want to get"
// @Success 200 {datacenter} models.datacenter
// @router /search/:search [get]
func (o *DatacenterController) Search() {
search := o.Ctx.Input.Param(":search")
o.Data["json"] = oclib.Search(nil, search, oclib.LibDataEnum(oclib.DATACENTER_RESOURCE))
o.ServeJSON()
}
// @Title Get
// @Description find datacenter by id
// @Param id path string true "the id you want to get"
// @Success 200 {datacenter} models.datacenter
// @router /:id [get]
func (o *DatacenterController) Get() {
id := o.Ctx.Input.Param(":id")
o.Data["json"] = oclib.LoadOne(oclib.LibDataEnum(oclib.DATACENTER_RESOURCE), id)
o.ServeJSON()
}
// @Title Delete
// @Description delete the datacenter
// @Param id path string true "The id you want to delete"
// @Success 200 {datacenter} delete success!
// @router /:id [delete]
func (o *DatacenterController) Delete() {
id := o.Ctx.Input.Param(":id")
o.Data["json"] = oclib.DeleteOne(oclib.LibDataEnum(oclib.DATACENTER_RESOURCE), id)
o.ServeJSON()
}

View File

@ -18,7 +18,7 @@ func (o *ResourceController) GetAll() {
results := map[string]interface{}{} results := map[string]interface{}{}
for _, resource := range []oclib.LibDataEnum{ for _, resource := range []oclib.LibDataEnum{
oclib.LibDataEnum(oclib.DATA_RESOURCE), oclib.LibDataEnum(oclib.DATA_RESOURCE),
oclib.LibDataEnum(oclib.DATACENTER_RESOURCE), oclib.LibDataEnum(oclib.COMPUTE_RESOURCE),
oclib.LibDataEnum(oclib.STORAGE_RESOURCE), oclib.LibDataEnum(oclib.STORAGE_RESOURCE),
oclib.LibDataEnum(oclib.PROCESSING_RESOURCE), oclib.LibDataEnum(oclib.PROCESSING_RESOURCE),
oclib.LibDataEnum(oclib.WORKFLOW_RESOURCE)} { oclib.LibDataEnum(oclib.WORKFLOW_RESOURCE)} {
@ -43,7 +43,7 @@ func (o *ResourceController) Search() {
results := map[string]interface{}{} results := map[string]interface{}{}
for _, resource := range []oclib.LibDataEnum{ for _, resource := range []oclib.LibDataEnum{
oclib.LibDataEnum(oclib.DATA_RESOURCE), oclib.LibDataEnum(oclib.DATA_RESOURCE),
oclib.LibDataEnum(oclib.DATACENTER_RESOURCE), oclib.LibDataEnum(oclib.COMPUTE_RESOURCE),
oclib.LibDataEnum(oclib.STORAGE_RESOURCE), oclib.LibDataEnum(oclib.STORAGE_RESOURCE),
oclib.LibDataEnum(oclib.PROCESSING_RESOURCE), oclib.LibDataEnum(oclib.PROCESSING_RESOURCE),
oclib.LibDataEnum(oclib.WORKFLOW_RESOURCE)} { oclib.LibDataEnum(oclib.WORKFLOW_RESOURCE)} {
@ -68,7 +68,7 @@ func (o *ResourceController) Get() {
results := map[string]interface{}{} results := map[string]interface{}{}
for _, resource := range []oclib.LibDataEnum{ for _, resource := range []oclib.LibDataEnum{
oclib.LibDataEnum(oclib.DATA_RESOURCE), oclib.LibDataEnum(oclib.DATA_RESOURCE),
oclib.LibDataEnum(oclib.DATACENTER_RESOURCE), oclib.LibDataEnum(oclib.COMPUTE_RESOURCE),
oclib.LibDataEnum(oclib.STORAGE_RESOURCE), oclib.LibDataEnum(oclib.STORAGE_RESOURCE),
oclib.LibDataEnum(oclib.PROCESSING_RESOURCE), oclib.LibDataEnum(oclib.PROCESSING_RESOURCE),
oclib.LibDataEnum(oclib.WORKFLOW_RESOURCE)} { oclib.LibDataEnum(oclib.WORKFLOW_RESOURCE)} {
@ -93,7 +93,7 @@ func (o *ResourceController) Delete() {
results := map[string]interface{}{} results := map[string]interface{}{}
for _, resource := range []oclib.LibDataEnum{ for _, resource := range []oclib.LibDataEnum{
oclib.LibDataEnum(oclib.DATA_RESOURCE), oclib.LibDataEnum(oclib.DATA_RESOURCE),
oclib.LibDataEnum(oclib.DATACENTER_RESOURCE), oclib.LibDataEnum(oclib.COMPUTE_RESOURCE),
oclib.LibDataEnum(oclib.STORAGE_RESOURCE), oclib.LibDataEnum(oclib.STORAGE_RESOURCE),
oclib.LibDataEnum(oclib.PROCESSING_RESOURCE), oclib.LibDataEnum(oclib.PROCESSING_RESOURCE),
oclib.LibDataEnum(oclib.WORKFLOW_RESOURCE)} { oclib.LibDataEnum(oclib.WORKFLOW_RESOURCE)} {

View File

@ -627,19 +627,19 @@
] ]
}, },
{ {
"api": "/oc/datacenter/", "api": "/oc/compute/",
"content": [ "content": [
{ {
"name": "Mundi datacenter", "name": "Mundi compute",
"acronym": "DC_myDC", "acronym": "DC_myDC",
"hosts": [ "hosts": [
"localhost:49618", "localhost:49618",
"oc-catalog:49618" "oc-catalog:49618"
], ],
"short_description": "Mundi Opencloud Instance", "short_description": "Mundi Opencloud Instance",
"logo": "https://cloud.o-forge.io/core/deperecated-oc-catalog/raw/branch/main/scripts/local_imgs/Mundi datacenter.png", "logo": "https://cloud.o-forge.io/core/deperecated-oc-catalog/raw/branch/main/scripts/local_imgs/Mundi compute.png",
"description": "A very long description of what this data is", "description": "A very long description of what this data is",
"type": "datacenter", "type": "compute",
"bookingPrice": 650, "bookingPrice": 650,
"owner": "IRT", "owner": "IRT",
"cpus": [{ "cpus": [{
@ -662,16 +662,16 @@
"source_url": "http://www.google.com" "source_url": "http://www.google.com"
}, },
{ {
"name": "CNES datacenter", "name": "CNES compute",
"acronym": "DC_superDC1", "acronym": "DC_superDC1",
"hosts": [ "hosts": [
"localhost:49619", "localhost:49619",
"dc1:49618" "dc1:49618"
], ],
"short_description": "CNES Opencloud Instance", "short_description": "CNES Opencloud Instance",
"logo": "https://cloud.o-forge.io/core/deperecated-oc-catalog/raw/branch/main/scripts/local_imgs/CNES datacenter.png", "logo": "https://cloud.o-forge.io/core/deperecated-oc-catalog/raw/branch/main/scripts/local_imgs/CNES compute.png",
"description": "A very long description of what this data is", "description": "A very long description of what this data is",
"type": "datacenter", "type": "compute",
"bookingPrice": 650, "bookingPrice": 650,
"owner": "IRT", "owner": "IRT",
"cpus": [{ "cpus": [{
@ -687,16 +687,16 @@
"source_url": "http://www.google.com" "source_url": "http://www.google.com"
}, },
{ {
"name": "Meteo France datacenter", "name": "Meteo France compute",
"acronym": "DC_superDC2", "acronym": "DC_superDC2",
"hosts": [ "hosts": [
"localhost:49620", "localhost:49620",
"dc2:49618" "dc2:49618"
], ],
"short_description": "Meteo France Opencloud Instance", "short_description": "Meteo France Opencloud Instance",
"logo": "https://cloud.o-forge.io/core/deperecated-oc-catalog/raw/branch/main/scripts/local_imgs/Meteo France datacenter.png", "logo": "https://cloud.o-forge.io/core/deperecated-oc-catalog/raw/branch/main/scripts/local_imgs/Meteo France compute.png",
"description": "A very long description of what this data is", "description": "A very long description of what this data is",
"type": "datacenter", "type": "compute",
"bookingPrice": 650, "bookingPrice": 650,
"owner": "Meteo France", "owner": "Meteo France",
"cpus": [{ "cpus": [{

2
go.mod Normal file → Executable file
View File

@ -5,7 +5,7 @@ go 1.22.0
toolchain go1.22.4 toolchain go1.22.4
require ( require (
cloud.o-forge.io/core/oc-lib v0.0.0-20241030105814-5f05b73366ab cloud.o-forge.io/core/oc-lib v0.0.0-20241107122526-f3df1e42b9ba
github.com/beego/beego/v2 v2.3.1 github.com/beego/beego/v2 v2.3.1
github.com/smartystreets/goconvey v1.7.2 github.com/smartystreets/goconvey v1.7.2
) )

5
go.sum Normal file → Executable file
View File

@ -16,11 +16,16 @@ cloud.o-forge.io/core/oc-lib v0.0.0-20241030091613-1a5521237800 h1:uZ4Qrxk/KEpOf
cloud.o-forge.io/core/oc-lib v0.0.0-20241030091613-1a5521237800/go.mod h1:t+zpCTVKVdHH/BImwtMYY2QIWLMXKgY4n/JhFm3Vpu8= cloud.o-forge.io/core/oc-lib v0.0.0-20241030091613-1a5521237800/go.mod h1:t+zpCTVKVdHH/BImwtMYY2QIWLMXKgY4n/JhFm3Vpu8=
cloud.o-forge.io/core/oc-lib v0.0.0-20241030105814-5f05b73366ab h1:hYUf9xXpqhp9w0eBfOWVi7c17iWpN+FL2FbhsAkmQ2E= cloud.o-forge.io/core/oc-lib v0.0.0-20241030105814-5f05b73366ab h1:hYUf9xXpqhp9w0eBfOWVi7c17iWpN+FL2FbhsAkmQ2E=
cloud.o-forge.io/core/oc-lib v0.0.0-20241030105814-5f05b73366ab/go.mod h1:t+zpCTVKVdHH/BImwtMYY2QIWLMXKgY4n/JhFm3Vpu8= cloud.o-forge.io/core/oc-lib v0.0.0-20241030105814-5f05b73366ab/go.mod h1:t+zpCTVKVdHH/BImwtMYY2QIWLMXKgY4n/JhFm3Vpu8=
cloud.o-forge.io/core/oc-lib v0.0.0-20241107114600-4c0c75be9161 h1:so5V7C6kiJ9tpuxtgK/KcgjXQC2ythInAH8X2gohuaM=
cloud.o-forge.io/core/oc-lib v0.0.0-20241107114600-4c0c75be9161/go.mod h1:ya7Q+zHhaKM+XF6sAJ+avqHEVzaMnFJQih2X3TlTlGo=
cloud.o-forge.io/core/oc-lib v0.0.0-20241107122526-f3df1e42b9ba h1:MGd8N7bY1LWXMhAp7gibDNwMS2hsatLQ3rfayvy5rGs=
cloud.o-forge.io/core/oc-lib v0.0.0-20241107122526-f3df1e42b9ba/go.mod h1:ya7Q+zHhaKM+XF6sAJ+avqHEVzaMnFJQih2X3TlTlGo=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/beego/beego/v2 v2.3.0 h1:iECVwzm6egw6iw6tkWrEDqXG4NQtKLQ6QBSYqlM6T/I= github.com/beego/beego/v2 v2.3.0 h1:iECVwzm6egw6iw6tkWrEDqXG4NQtKLQ6QBSYqlM6T/I=
github.com/beego/beego/v2 v2.3.0/go.mod h1:Ob/5BJ9fIKZLd4s9ZV3o9J6odkkIyL83et+p98gyYXo= github.com/beego/beego/v2 v2.3.0/go.mod h1:Ob/5BJ9fIKZLd4s9ZV3o9J6odkkIyL83et+p98gyYXo=
github.com/beego/beego/v2 v2.3.1 h1:7MUKMpJYzOXtCUsTEoXOxsDV/UcHw6CPbaWMlthVNsc= github.com/beego/beego/v2 v2.3.1 h1:7MUKMpJYzOXtCUsTEoXOxsDV/UcHw6CPbaWMlthVNsc=
github.com/beego/beego/v2 v2.3.1/go.mod h1:5cqHsOHJIxkq44tBpRvtDe59GuVRVv/9/tyVDxd5ce4= github.com/beego/beego/v2 v2.3.1/go.mod h1:5cqHsOHJIxkq44tBpRvtDe59GuVRVv/9/tyVDxd5ce4=
github.com/beego/beego/v2 v2.3.2/go.mod h1:5cqHsOHJIxkq44tBpRvtDe59GuVRVv/9/tyVDxd5ce4=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=

View File

@ -61,7 +61,7 @@ func init() {
Filters: nil, Filters: nil,
Params: nil}) Params: nil})
beego.GlobalControllerRouter["oc-catalog/controllers:DatacenterController"] = append(beego.GlobalControllerRouter["oc-catalog/controllers:DatacenterController"], beego.GlobalControllerRouter["oc-catalog/controllers:ComputeController"] = append(beego.GlobalControllerRouter["oc-catalog/controllers:ComputeController"],
beego.ControllerComments{ beego.ControllerComments{
Method: "Post", Method: "Post",
Router: `/`, Router: `/`,
@ -70,7 +70,7 @@ func init() {
Filters: nil, Filters: nil,
Params: nil}) Params: nil})
beego.GlobalControllerRouter["oc-catalog/controllers:DatacenterController"] = append(beego.GlobalControllerRouter["oc-catalog/controllers:DatacenterController"], beego.GlobalControllerRouter["oc-catalog/controllers:ComputeController"] = append(beego.GlobalControllerRouter["oc-catalog/controllers:ComputeController"],
beego.ControllerComments{ beego.ControllerComments{
Method: "GetAll", Method: "GetAll",
Router: `/`, Router: `/`,
@ -79,7 +79,7 @@ func init() {
Filters: nil, Filters: nil,
Params: nil}) Params: nil})
beego.GlobalControllerRouter["oc-catalog/controllers:DatacenterController"] = append(beego.GlobalControllerRouter["oc-catalog/controllers:DatacenterController"], beego.GlobalControllerRouter["oc-catalog/controllers:ComputeController"] = append(beego.GlobalControllerRouter["oc-catalog/controllers:ComputeController"],
beego.ControllerComments{ beego.ControllerComments{
Method: "Put", Method: "Put",
Router: `/:id`, Router: `/:id`,
@ -88,7 +88,7 @@ func init() {
Filters: nil, Filters: nil,
Params: nil}) Params: nil})
beego.GlobalControllerRouter["oc-catalog/controllers:DatacenterController"] = append(beego.GlobalControllerRouter["oc-catalog/controllers:DatacenterController"], beego.GlobalControllerRouter["oc-catalog/controllers:ComputeController"] = append(beego.GlobalControllerRouter["oc-catalog/controllers:ComputeController"],
beego.ControllerComments{ beego.ControllerComments{
Method: "Get", Method: "Get",
Router: `/:id`, Router: `/:id`,
@ -97,7 +97,7 @@ func init() {
Filters: nil, Filters: nil,
Params: nil}) Params: nil})
beego.GlobalControllerRouter["oc-catalog/controllers:DatacenterController"] = append(beego.GlobalControllerRouter["oc-catalog/controllers:DatacenterController"], beego.GlobalControllerRouter["oc-catalog/controllers:ComputeController"] = append(beego.GlobalControllerRouter["oc-catalog/controllers:ComputeController"],
beego.ControllerComments{ beego.ControllerComments{
Method: "Delete", Method: "Delete",
Router: `/:id`, Router: `/:id`,
@ -106,7 +106,7 @@ func init() {
Filters: nil, Filters: nil,
Params: nil}) Params: nil})
beego.GlobalControllerRouter["oc-catalog/controllers:DatacenterController"] = append(beego.GlobalControllerRouter["oc-catalog/controllers:DatacenterController"], beego.GlobalControllerRouter["oc-catalog/controllers:ComputeController"] = append(beego.GlobalControllerRouter["oc-catalog/controllers:ComputeController"],
beego.ControllerComments{ beego.ControllerComments{
Method: "Search", Method: "Search",
Router: `/search/:search`, Router: `/search/:search`,

View File

@ -25,9 +25,9 @@ func init() {
&controllers.DataController{}, &controllers.DataController{},
), ),
), ),
beego.NSNamespace("/datacenter", beego.NSNamespace("/compute",
beego.NSInclude( beego.NSInclude(
&controllers.DatacenterController{}, &controllers.ComputeController{},
), ),
), ),
beego.NSNamespace("/storage", beego.NSNamespace("/storage",

View File

@ -149,30 +149,30 @@
} }
} }
}, },
"/datacenter/": { "/compute/": {
"get": { "get": {
"tags": [ "tags": [
"datacenter" "compute"
], ],
"description": "find datacenter by id\n\u003cbr\u003e", "description": "find compute by id\n\u003cbr\u003e",
"operationId": "DatacenterController.GetAll", "operationId": "ComputeController.GetAll",
"responses": { "responses": {
"200": { "200": {
"description": "{datacenter} models.datacenter" "description": "{compute} models.compute"
} }
} }
}, },
"post": { "post": {
"tags": [ "tags": [
"datacenter" "compute"
], ],
"description": "create datacenter\n\u003cbr\u003e", "description": "create compute\n\u003cbr\u003e",
"operationId": "DatacenterController.Create", "operationId": "ComputeController.Create",
"parameters": [ "parameters": [
{ {
"in": "body", "in": "body",
"name": "datacenter", "name": "compute",
"description": "body for datacenter content (Json format)", "description": "body for compute content (Json format)",
"required": true, "required": true,
"schema": { "schema": {
"$ref": "#/definitions/json" "$ref": "#/definitions/json"
@ -181,18 +181,18 @@
], ],
"responses": { "responses": {
"200": { "200": {
"description": "{datacenter} models.datacenter" "description": "{compute} models.compute"
} }
} }
} }
}, },
"/datacenter/search/{search}": { "/compute/search/{search}": {
"get": { "get": {
"tags": [ "tags": [
"datacenter" "compute"
], ],
"description": "find datacenter by key word\n\u003cbr\u003e", "description": "find compute by key word\n\u003cbr\u003e",
"operationId": "DatacenterController.Get", "operationId": "ComputeController.Get",
"parameters": [ "parameters": [
{ {
"in": "path", "in": "path",
@ -204,18 +204,18 @@
], ],
"responses": { "responses": {
"200": { "200": {
"description": "{datacenter} models.datacenter" "description": "{compute} models.compute"
} }
} }
} }
}, },
"/datacenter/{id}": { "/compute/{id}": {
"get": { "get": {
"tags": [ "tags": [
"datacenter" "compute"
], ],
"description": "find datacenter by id\n\u003cbr\u003e", "description": "find compute by id\n\u003cbr\u003e",
"operationId": "DatacenterController.Get", "operationId": "ComputeController.Get",
"parameters": [ "parameters": [
{ {
"in": "path", "in": "path",
@ -227,46 +227,46 @@
], ],
"responses": { "responses": {
"200": { "200": {
"description": "{datacenter} models.datacenter" "description": "{compute} models.compute"
} }
} }
}, },
"put": { "put": {
"tags": [ "tags": [
"datacenter" "compute"
], ],
"description": "create datacenters\n\u003cbr\u003e", "description": "create computes\n\u003cbr\u003e",
"operationId": "DatacenterController.Update", "operationId": "ComputeController.Update",
"parameters": [ "parameters": [
{ {
"in": "path", "in": "path",
"name": "id", "name": "id",
"description": "the datacenter id you want to get", "description": "the compute id you want to get",
"required": true, "required": true,
"type": "string" "type": "string"
}, },
{ {
"in": "body", "in": "body",
"name": "body", "name": "body",
"description": "The datacenter content", "description": "The compute content",
"required": true, "required": true,
"schema": { "schema": {
"$ref": "#/definitions/models.datacenter" "$ref": "#/definitions/models.compute"
} }
} }
], ],
"responses": { "responses": {
"200": { "200": {
"description": "{datacenter} models.datacenter" "description": "{compute} models.compute"
} }
} }
}, },
"delete": { "delete": {
"tags": [ "tags": [
"datacenter" "compute"
], ],
"description": "delete the datacenter\n\u003cbr\u003e", "description": "delete the compute\n\u003cbr\u003e",
"operationId": "DatacenterController.Delete", "operationId": "ComputeController.Delete",
"parameters": [ "parameters": [
{ {
"in": "path", "in": "path",
@ -278,7 +278,7 @@
], ],
"responses": { "responses": {
"200": { "200": {
"description": "{datacenter} delete success!" "description": "{compute} delete success!"
} }
} }
} }
@ -804,8 +804,8 @@
"title": "data", "title": "data",
"type": "object" "type": "object"
}, },
"models.datacenter": { "models.compute": {
"title": "datacenter", "title": "compute",
"type": "object" "type": "object"
}, },
"models.processing": { "models.processing": {
@ -831,8 +831,8 @@
"description": "Operations about data\n" "description": "Operations about data\n"
}, },
{ {
"name": "datacenter", "name": "compute",
"description": "Operations about datacenter\n" "description": "Operations about compute\n"
}, },
{ {
"name": "storage", "name": "storage",

View File

@ -112,42 +112,42 @@ paths:
responses: responses:
"200": "200":
description: '{data} models.data' description: '{data} models.data'
/datacenter/: /compute/:
get: get:
tags: tags:
- datacenter - compute
description: |- description: |-
find datacenter by id find compute by id
<br> <br>
operationId: DatacenterController.GetAll operationId: ComputeController.GetAll
responses: responses:
"200": "200":
description: '{datacenter} models.datacenter' description: '{compute} models.compute'
post: post:
tags: tags:
- datacenter - compute
description: |- description: |-
create datacenter create compute
<br> <br>
operationId: DatacenterController.Create operationId: ComputeController.Create
parameters: parameters:
- in: body - in: body
name: datacenter name: compute
description: body for datacenter content (Json format) description: body for compute content (Json format)
required: true required: true
schema: schema:
$ref: '#/definitions/json' $ref: '#/definitions/json'
responses: responses:
"200": "200":
description: '{datacenter} models.datacenter' description: '{compute} models.compute'
/datacenter/{id}: /compute/{id}:
get: get:
tags: tags:
- datacenter - compute
description: |- description: |-
find datacenter by id find compute by id
<br> <br>
operationId: DatacenterController.Get operationId: ComputeController.Get
parameters: parameters:
- in: path - in: path
name: id name: id
@ -156,36 +156,36 @@ paths:
type: string type: string
responses: responses:
"200": "200":
description: '{datacenter} models.datacenter' description: '{compute} models.compute'
put: put:
tags: tags:
- datacenter - compute
description: |- description: |-
create datacenters create computes
<br> <br>
operationId: DatacenterController.Update operationId: ComputeController.Update
parameters: parameters:
- in: path - in: path
name: id name: id
description: the datacenter id you want to get description: the compute id you want to get
required: true required: true
type: string type: string
- in: body - in: body
name: body name: body
description: The datacenter content description: The compute content
required: true required: true
schema: schema:
$ref: '#/definitions/models.datacenter' $ref: '#/definitions/models.compute'
responses: responses:
"200": "200":
description: '{datacenter} models.datacenter' description: '{compute} models.compute'
delete: delete:
tags: tags:
- datacenter - compute
description: |- description: |-
delete the datacenter delete the compute
<br> <br>
operationId: DatacenterController.Delete operationId: ComputeController.Delete
parameters: parameters:
- in: path - in: path
name: id name: id
@ -194,15 +194,15 @@ paths:
type: string type: string
responses: responses:
"200": "200":
description: '{datacenter} delete success!' description: '{compute} delete success!'
/datacenter/search/{search}: /compute/search/{search}:
get: get:
tags: tags:
- datacenter - compute
description: |- description: |-
find datacenter by key word find compute by key word
<br> <br>
operationId: DatacenterController.Get operationId: ComputeController.Get
parameters: parameters:
- in: path - in: path
name: search name: search
@ -211,7 +211,7 @@ paths:
type: string type: string
responses: responses:
"200": "200":
description: '{datacenter} models.datacenter' description: '{compute} models.compute'
/processing/: /processing/:
get: get:
tags: tags:
@ -602,8 +602,8 @@ definitions:
models.data: models.data:
title: data title: data
type: object type: object
models.datacenter: models.compute:
title: datacenter title: compute
type: object type: object
models.processing: models.processing:
title: processing title: processing
@ -621,9 +621,9 @@ tags:
- name: data - name: data
description: | description: |
Operations about data Operations about data
- name: datacenter - name: compute
description: | description: |
Operations about datacenter Operations about compute
- name: storage - name: storage
description: | description: |
Operations about storage Operations about storage