Skip to content

Commit

Permalink
server: api: rest: Get namespace from tumblebug
Browse files Browse the repository at this point in the history
  • Loading branch information
ish-hcc committed Oct 7, 2024
1 parent fc18e9c commit 06190cd
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 75 deletions.
7 changes: 1 addition & 6 deletions server/pkg/api/rest/controller/sourceGroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -403,12 +403,7 @@ func RegisterTargetInfoToSourceGroup(c echo.Context) error {
}

if registerTargetInfoReq.ResourceType == "mci" {
if registerTargetInfoReq.ID == "" {
oldSourceGroup.TargetInfo.NSID = ""
} else {
// TODO: Must be able to set NSID next time.
oldSourceGroup.TargetInfo.NSID = "mig01"
}
oldSourceGroup.TargetInfo.NSID = registerTargetInfoReq.Label.SysNamespace
oldSourceGroup.TargetInfo.MCIID = registerTargetInfoReq.ID
}

Expand Down
28 changes: 6 additions & 22 deletions server/pkg/api/rest/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -1871,35 +1871,19 @@ const docTemplate = `{
"resourceType"
],
"properties": {
"description": {
"type": "string"
},
"id": {
"type": "string"
},
"label": {
"type": "string"
},
"name": {
"type": "string"
"type": "object",
"properties": {
"sys.namespace": {
"type": "string"
}
}
},
"resourceType": {
"type": "string"
},
"systemLabel": {
"type": "string"
},
"systemMessage": {
"type": "string"
},
"targetAction": {
"type": "string"
},
"targetStatus": {
"type": "string"
},
"uid": {
"type": "string"
}
}
},
Expand Down
28 changes: 6 additions & 22 deletions server/pkg/api/rest/docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -1864,35 +1864,19 @@
"resourceType"
],
"properties": {
"description": {
"type": "string"
},
"id": {
"type": "string"
},
"label": {
"type": "string"
},
"name": {
"type": "string"
"type": "object",
"properties": {
"sys.namespace": {
"type": "string"
}
}
},
"resourceType": {
"type": "string"
},
"systemLabel": {
"type": "string"
},
"systemMessage": {
"type": "string"
},
"targetAction": {
"type": "string"
},
"targetStatus": {
"type": "string"
},
"uid": {
"type": "string"
}
}
},
Expand Down
19 changes: 4 additions & 15 deletions server/pkg/api/rest/docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -149,26 +149,15 @@ definitions:
type: object
github_com_cloud-barista_cm-honeybee_server_pkg_api_rest_model.RegisterTargetInfoReq:
properties:
description:
type: string
id:
type: string
label:
type: string
name:
type: string
properties:
sys.namespace:
type: string
type: object
resourceType:
type: string
systemLabel:
type: string
systemMessage:
type: string
targetAction:
type: string
targetStatus:
type: string
uid:
type: string
required:
- id
- resourceType
Expand Down
15 changes: 5 additions & 10 deletions server/pkg/api/rest/model/sourceGroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,11 @@ type TargetInfo struct {
}

type RegisterTargetInfoReq struct {
ResourceType string `json:"resourceType" validate:"required"`
ID string `json:"id" validate:"required"`
UID string `json:"uid"`
Name string `json:"name"`
TargetStatus string `json:"targetStatus"`
TargetAction string `json:"targetAction"`
Label string `json:"label"`
SystemLabel string `json:"systemLabel"`
SystemMessage string `json:"systemMessage"`
Description string `json:"description"`
ResourceType string `json:"resourceType" validate:"required"`
ID string `json:"id" validate:"required"`
Label struct {
SysNamespace string `json:"sys.namespace"`
} `json:"label"`
}

type SourceGroup struct {
Expand Down

0 comments on commit 06190cd

Please sign in to comment.