diff --git a/api/handler/service.go b/api/handler/service.go index bc92da7fb..79d1f8842 100644 --- a/api/handler/service.go +++ b/api/handler/service.go @@ -1769,8 +1769,8 @@ func (s *ServiceAction) CreateTenandIDAndName(eid string) (string, string, error type K8sPodInfo struct { ServiceID string `json:"service_id"` //部署资源的ID ,例如rc ,deploment, statefulset - ReplicationID string `json:"replication_id"` - ReplicationType string `json:"replication_type"` + ReplicationID string `json:"rc_id"` + ReplicationType string `json:"rc_type"` PodName string `json:"pod_name"` PodIP string `json:"pod_ip"` Container map[string]map[string]string `json:"container"` diff --git a/api/region/region.go b/api/region/region.go index b44354e6d..f1929e772 100644 --- a/api/region/region.go +++ b/api/region/region.go @@ -70,6 +70,13 @@ type APIConf struct { CertKey string `yaml:"tls-private-key-file"` } +type serviceInfo struct { + ServicesAlias string `json:"serviceAlias"` + TenantName string `json:"tenantName"` + ServiceId string `json:"serviceId"` + TenantId string `json:"tenantId"` +} + //NewRegion NewRegion func NewRegion(c APIConf) (Region, error) { if region == nil { @@ -188,7 +195,7 @@ func (t *tenant) Services(serviceAlias string) ServiceInterface { //ServiceInterface ServiceInterface type ServiceInterface interface { - Get() (*dbmodel.TenantServices, *util.APIHandleError) + Get() (*serviceInfo, *util.APIHandleError) Pods() ([]*dbmodel.K8sPod, *util.APIHandleError) List() ([]*dbmodel.TenantServices, *util.APIHandleError) Stop(eventID string) (string, *util.APIHandleError) @@ -209,8 +216,8 @@ func (s *services) Pods() ([]*dbmodel.K8sPod, *util.APIHandleError) { } return gc, nil } -func (s *services) Get() (*dbmodel.TenantServices, *util.APIHandleError) { - var service dbmodel.TenantServices +func (s *services) Get() (*serviceInfo, *util.APIHandleError) { + var service serviceInfo var decode utilhttp.ResponseBody decode.Bean = &service code, err := s.DoRequest(s.prefix, "GET", nil, &decode) diff --git a/grctl/cmd/service.go b/grctl/cmd/service.go index 6b18b99f7..572a2d92a 100644 --- a/grctl/cmd/service.go +++ b/grctl/cmd/service.go @@ -336,8 +336,8 @@ func getAppInfoV2(c *cli.Context) error { table := uitable.New() table.Wrap = true // wrap columns - tenantID := service.TenantID - serviceID := service.ServiceID + tenantID := service.TenantId + serviceID := service.ServiceId //volumes:=service[""] table.AddRow("Namespace:", tenantID)