Commit 2a88d903 authored by Sonja Happ's avatar Sonja Happ
Browse files

rename IC startParameterScheme --> startParameterSchema

parent a67ebb54
Pipeline #422002 failed with stages
in 8 minutes and 46 seconds
......@@ -142,7 +142,7 @@ type InfrastructureComponent struct {
// Description of the IC
Description string `json:"description" gorm:"default:''"`
// JSON scheme of start parameters for IC
StartParameterScheme postgres.Jsonb `json:"startparameterscheme"`
StartParameterSchema postgres.Jsonb `json:"startparameterschema"`
// raw JSON of last status update
StatusUpdateRaw postgres.Jsonb `json:"statusupdateraw"`
// Boolean indicating if IC is managed externally (via AMQP/ VILLAScontroller)
......
......@@ -37,7 +37,7 @@
"description": "A signal generator for testing purposes",
"state": "idle",
"managedexternally": false,
"startparameterscheme": {
"startparameterschema": {
"param1": 42,
"param2": "testvalue"
}
......@@ -52,7 +52,7 @@
"state": "running",
"managedexternally": false,
"manager": "4854af30-325f-44a5-ad59-b67bdeadbeef",
"startparameterscheme": {
"startparameterschema": {
"param1": 55,
"param2": "testvalue2"
}
......
......@@ -3560,10 +3560,13 @@ var doc = `{
"ManagedExternally": {
"type": "boolean"
},
"Manager": {
"type": "string"
},
"Name": {
"type": "string"
},
"StartParameterScheme": {
"StartParameterSchema": {
"$ref": "#/definitions/postgres.Jsonb"
},
"State": {
......@@ -3601,10 +3604,13 @@ var doc = `{
"Location": {
"type": "string"
},
"Manager": {
"type": "string"
},
"Name": {
"type": "string"
},
"StartParameterScheme": {
"StartParameterSchema": {
"$ref": "#/definitions/postgres.Jsonb"
},
"State": {
......
......@@ -3544,10 +3544,13 @@
"ManagedExternally": {
"type": "boolean"
},
"Manager": {
"type": "string"
},
"Name": {
"type": "string"
},
"StartParameterScheme": {
"StartParameterSchema": {
"$ref": "#/definitions/postgres.Jsonb"
},
"State": {
......@@ -3585,10 +3588,13 @@
"Location": {
"type": "string"
},
"Manager": {
"type": "string"
},
"Name": {
"type": "string"
},
"StartParameterScheme": {
"StartParameterSchema": {
"$ref": "#/definitions/postgres.Jsonb"
},
"State": {
......
......@@ -175,9 +175,11 @@ definitions:
type: string
ManagedExternally:
type: boolean
Manager:
type: string
Name:
type: string
StartParameterScheme:
StartParameterSchema:
$ref: '#/definitions/postgres.Jsonb'
State:
type: string
......@@ -207,9 +209,11 @@ definitions:
type: string
Location:
type: string
Manager:
type: string
Name:
type: string
StartParameterScheme:
StartParameterSchema:
$ref: '#/definitions/postgres.Jsonb'
State:
type: string
......@@ -490,8 +494,7 @@ paths:
- application/json
responses:
"200":
description: JSON web token, success status, message and authenticated user
object
description: JSON web token, success status, message and authenticated user object
schema:
$ref: '#/definitions/api.ResponseAuthenticate'
"401":
......@@ -502,8 +505,7 @@ paths:
description: Internal server error.
schema:
$ref: '#/definitions/api.ResponseError'
summary: Check if user is authenticated and provide details on how the user
can authenticate
summary: Check if user is authenticated and provide details on how the user can authenticate
tags:
- authentication
/authenticate/{mechanism}:
......@@ -530,8 +532,7 @@ paths:
- application/json
responses:
"200":
description: JSON web token, success status, message and authenticated user
object
description: JSON web token, success status, message and authenticated user object
schema:
$ref: '#/definitions/api.ResponseAuthenticate'
"401":
......@@ -596,8 +597,7 @@ paths:
- application/json
operationId: addConfig
parameters:
- description: component configuration to be added incl. IDs of scenario and
IC
- description: component configuration to be added incl. IDs of scenario and IC
in: body
name: inputConfig
required: true
......@@ -1162,8 +1162,7 @@ paths:
- application/json
responses:
"204":
description: Backend is healthy, database and AMQP broker connections are
alive
description: Backend is healthy, database and AMQP broker connections are alive
schema:
type: string
"500":
......@@ -1395,8 +1394,7 @@ paths:
$ref: '#/definitions/api.ResponseError'
security:
- Bearer: []
summary: Send an action to IC (only available if backend server is started with
-amqp parameter)
summary: Send an action to IC (only available if backend server is started with -amqp parameter)
tags:
- infrastructure-components
/ic/{ICID}/configs:
......@@ -2072,8 +2070,7 @@ paths:
- application/json
operationId: AddSignal
parameters:
- description: A signal to be added to the component configuration incl. direction
and config ID to which signal shall be added
- description: A signal to be added to the component configuration incl. direction and config ID to which signal shall be added
in: body
name: inputSignal
required: true
......@@ -2358,8 +2355,7 @@ paths:
- application/json
operationId: UpdateUser
parameters:
- description: User to be updated (anything except for ID can be changed, role
can only be change by admin)
- description: User to be updated (anything except for ID can be changed, role can only be change by admin)
in: body
name: inputUser
required: true
......
......@@ -58,7 +58,7 @@ type ICRequest struct {
State string `json:"state,omitempty"`
Location string `json:"location,omitempty"`
Description string `json:"description,omitempty"`
StartParameterScheme postgres.Jsonb `json:"startparameterscheme,omitempty"`
StartParameterSchema postgres.Jsonb `json:"startparameterschema,omitempty"`
ManagedExternally *bool `json:"managedexternally,omitempty"`
}
......@@ -94,7 +94,7 @@ func addScenarioAndIC() (scenarioID uint, ICID uint) {
State: "idle",
Location: "k8s",
Description: "A signal generator for testing purposes",
StartParameterScheme: postgres.Jsonb{json.RawMessage(`{"prop1" : "a nice prop"}`)},
StartParameterSchema: postgres.Jsonb{json.RawMessage(`{"prop1" : "a nice prop"}`)},
ManagedExternally: newFalse(),
}
......
......@@ -59,16 +59,17 @@ type ICStatus struct {
}
type ICProperties struct {
UUID string `json:"uuid"`
Name string `json:"name"`
Description string `json:"description"`
Location string `json:"location"`
Owner string `json:"owner"`
WS_url string `json:"ws_url"`
API_url string `json:"api_url"`
Category string `json:"category"`
Type string `json:"type"`
ManagedBy string `json:"managed_by"`
UUID string `json:"uuid"`
Name string `json:"name"`
Description string `json:"description"`
Location string `json:"location"`
Owner string `json:"owner"`
WS_url string `json:"ws_url"`
API_url string `json:"api_url"`
Category string `json:"category"`
Type string `json:"type"`
ManagedBy string `json:"managed_by"`
StartParameterSchema json.RawMessage `json:"start_parameter_schema"`
}
type ICUpdate struct {
......@@ -293,6 +294,7 @@ func createExternalIC(payload ICUpdate, ICUUID string, body []byte) error {
// set managed externally to true because this IC is created via AMQP
newICReq.InfrastructureComponent.ManagedExternally = newTrue()
newICReq.InfrastructureComponent.Manager = payload.Properties.ManagedBy
newICReq.InfrastructureComponent.StartParameterSchema = postgres.Jsonb{RawMessage: payload.Properties.StartParameterSchema}
// set raw status update if IC
newICReq.InfrastructureComponent.StatusUpdateRaw = postgres.Jsonb{RawMessage: body}
......@@ -351,6 +353,7 @@ func (s *InfrastructureComponent) updateExternalIC(payload ICUpdate, body []byte
updatedICReq.InfrastructureComponent.Location = payload.Properties.Location
updatedICReq.InfrastructureComponent.Description = payload.Properties.Description
updatedICReq.InfrastructureComponent.Manager = payload.Properties.ManagedBy
updatedICReq.InfrastructureComponent.StartParameterSchema = postgres.Jsonb{RawMessage: payload.Properties.StartParameterSchema}
// set raw status update if IC
updatedICReq.InfrastructureComponent.StatusUpdateRaw = postgres.Jsonb{RawMessage: body}
......
......@@ -58,7 +58,7 @@ type ICRequest struct {
State string `json:"state,omitempty"`
Location string `json:"location,omitempty"`
Description string `json:"description,omitempty"`
StartParameterScheme postgres.Jsonb `json:"startparameterscheme,omitempty"`
StartParameterSchema postgres.Jsonb `json:"startparameterschema,omitempty"`
ManagedExternally *bool `json:"managedexternally"`
Manager string `json:"manager,omitempty"`
}
......@@ -87,7 +87,7 @@ var newIC1 = ICRequest{
State: "idle",
Location: "k8s",
Description: "A signal generator for testing purposes",
StartParameterScheme: postgres.Jsonb{json.RawMessage(`{"prop1" : "a nice prop"}`)},
StartParameterSchema: postgres.Jsonb{json.RawMessage(`{"prop1" : "a nice prop"}`)},
ManagedExternally: newFalse(),
Manager: "7be0322d-354e-431e-84bd-ae4c9633beef",
}
......@@ -102,7 +102,7 @@ var newIC2 = ICRequest{
State: "running",
Location: "k8s",
Description: "This is a test description",
StartParameterScheme: postgres.Jsonb{json.RawMessage(`{"prop1" : "a nice prop"}`)},
StartParameterSchema: postgres.Jsonb{json.RawMessage(`{"prop1" : "a nice prop"}`)},
ManagedExternally: newTrue(),
Manager: "4854af30-325f-44a5-ad59-b67b2597de99",
}
......
......@@ -43,7 +43,7 @@ type validNewIC struct {
State string `form:"State" validate:"omitempty"`
Location string `form:"Location" validate:"omitempty"`
Description string `form:"Description" validate:"omitempty"`
StartParameterScheme postgres.Jsonb `form:"StartParameterScheme" validate:"omitempty"`
StartParameterSchema postgres.Jsonb `form:"StartParameterSchema" validate:"omitempty"`
StatusUpdateRaw postgres.Jsonb `form:"StatusUpdateRaw" validate:"omitempty"`
ManagedExternally *bool `form:"ManagedExternally" validate:"required"`
Manager string `form:"Manager" validate:"omitempty"`
......@@ -60,7 +60,7 @@ type validUpdatedIC struct {
State string `form:"State" validate:"omitempty"`
Location string `form:"Location" validate:"omitempty"`
Description string `form:"Description" validate:"omitempty"`
StartParameterScheme postgres.Jsonb `form:"StartParameterScheme" validate:"omitempty"`
StartParameterSchema postgres.Jsonb `form:"StartParameterSchema" validate:"omitempty"`
StatusUpdateRaw postgres.Jsonb `form:"StatusUpdateRaw" validate:"omitempty"`
Manager string `form:"Manager" validate:"omitempty"`
Uptime float64 `form:"Uptime" validate:"omitempty"`
......@@ -129,7 +129,7 @@ func (r *AddICRequest) createIC() (InfrastructureComponent, error) {
s.Category = r.InfrastructureComponent.Category
s.Location = r.InfrastructureComponent.Location
s.Description = r.InfrastructureComponent.Description
s.StartParameterScheme = r.InfrastructureComponent.StartParameterScheme
s.StartParameterSchema = r.InfrastructureComponent.StartParameterSchema
s.StatusUpdateRaw = r.InfrastructureComponent.StatusUpdateRaw
s.ManagedExternally = *r.InfrastructureComponent.ManagedExternally
s.Manager = r.InfrastructureComponent.Manager
......@@ -182,10 +182,10 @@ func (r *UpdateICRequest) updatedIC(oldIC InfrastructureComponent) Infrastructur
emptyJson_ser, _ := json.Marshal(emptyJson)
opts := jsondiff.DefaultConsoleOptions()
startParams_ser, _ := json.Marshal(r.InfrastructureComponent.StartParameterScheme)
startParams_ser, _ := json.Marshal(r.InfrastructureComponent.StartParameterSchema)
diff, _ := jsondiff.Compare(emptyJson_ser, startParams_ser, &opts)
if diff.String() != "FullMatch" {
s.StartParameterScheme = r.InfrastructureComponent.StartParameterScheme
s.StartParameterSchema = r.InfrastructureComponent.StartParameterSchema
}
statusUpdateRaw_ser, _ := json.Marshal(r.InfrastructureComponent.StatusUpdateRaw)
......
......@@ -66,7 +66,7 @@ type ICRequest struct {
State string `json:"state,omitempty"`
Location string `json:"location,omitempty"`
Description string `json:"description,omitempty"`
StartParameterScheme postgres.Jsonb `json:"startparameterscheme,omitempty"`
StartParameterSchema postgres.Jsonb `json:"startparameterschema,omitempty"`
ManagedExternally *bool `json:"managedexternally,omitempty"`
}
......@@ -103,7 +103,7 @@ func addScenarioAndICAndConfig() (scenarioID uint, ICID uint, configID uint) {
State: "idle",
Location: "k8s",
Description: "A signal generator for testing purposes",
StartParameterScheme: postgres.Jsonb{json.RawMessage(`{"prop1" : "a nice prop"}`)},
StartParameterSchema: postgres.Jsonb{json.RawMessage(`{"prop1" : "a nice prop"}`)},
ManagedExternally: newFalse(),
}
_, resp, _ := helper.TestEndpoint(router, token,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment