diff --git a/api/pkg/backend/router.go b/api/pkg/backend/router.go index 94569e9cd..fffd7f240 100644 --- a/api/pkg/backend/router.go +++ b/api/pkg/backend/router.go @@ -36,15 +36,15 @@ func RegisterRouter(ws *restful.WebService) { ws.Route(ws.POST("/{tenantId}/encrypt").To(handler.EncryptData)). Doc("Encrypt the data") - ws.Route(ws.GET("/{tenantId}/tiers/{id}").To(handler.GetTier)). - Doc("Show tier details") - ws.Route(ws.GET("/{tenantId}/tiers").To(handler.ListTiers)). - Doc("list tiers") - ws.Route(ws.POST("/{tenantId}/tiers").To(handler.CreateTier)). - Doc("Create tier") - ws.Route(ws.PUT("/{tenantId}/tiers/{id}").To(handler.UpdateTier)). - Doc("Update tier") - ws.Route(ws.DELETE("/{tenantId}/tiers/{id}").To(handler.DeleteTier)). - Doc("Delete tier") + ws.Route(ws.GET("/{tenantId}/ssps/{id}").To(handler.GetSsp)). + Doc("Show ssp details") + ws.Route(ws.GET("/{tenantId}/ssps").To(handler.ListSsps)). + Doc("list ssps") + ws.Route(ws.POST("/{tenantId}/ssps").To(handler.CreateSsp)). + Doc("Create ssp") + ws.Route(ws.PUT("/{tenantId}/ssps/{id}").To(handler.UpdateSsp)). + Doc("Update ssp") + ws.Route(ws.DELETE("/{tenantId}/ssps/{id}").To(handler.DeleteSsp)). + Doc("Delete ssp") } diff --git a/api/pkg/backend/service.go b/api/pkg/backend/service.go index 05851e24c..c350c430d 100644 --- a/api/pkg/backend/service.go +++ b/api/pkg/backend/service.go @@ -220,11 +220,11 @@ func (s *APIService) ListBackend(request *restful.Request, response *restful.Res ctx := common.InitCtxWithAuthInfo(request) para := request.QueryParameter("tier") - if para != "" { //List those backends which support the specific tier. + if para != "" { //List those backends which support the specific ssp. tier, err := strconv.Atoi(para) if err != nil { log.Errorf("list backends with tier as filter, but tier[%v] is invalid\n", tier) - response.WriteError(http.StatusBadRequest, errors.New("invalid service plan")) + response.WriteError(http.StatusBadRequest, errors.New("invalid tier")) return } s.FilterBackendByTier(ctx, request, response, int32(tier)) @@ -355,19 +355,19 @@ func (s *APIService) DeleteBackend(request *restful.Request, response *restful.R count := len(res.Buckets) - //checking if backend is associated with any tier: + //checking if backend is associated with any ssp: id_array := []string{id} - tiersList, err := s.backendClient.ListTiers(ctx, &backend.ListTierRequest{}) + sspsList, err := s.backendClient.ListSsps(ctx, &backend.ListSspRequest{}) if err != nil { - log.Errorf("failed to list tiers: %v\n", err) + log.Errorf("failed to list ssps: %v\n", err) response.WriteError(http.StatusInternalServerError, err) return } - for _, tier := range tiersList.Tiers { - res := utils.ResourcesAlreadyExists(tier.Backends, id_array) + for _, ssp := range sspsList.Ssps { + res := utils.ResourcesAlreadyExists(ssp.Backends, id_array) if len(res) != 0 { - errMsg := fmt.Sprintf("failed to delete backend because it is associated with %v SSP", tier.Name) + errMsg := fmt.Sprintf("failed to delete backend because it is associated with %v SSP", ssp.Name) log.Error(errMsg) response.WriteError(http.StatusBadRequest, errors.New(errMsg)) return @@ -549,21 +549,21 @@ func ValidateTenant(authToken, tenantId string) bool { return false } -//tiering functions -func (s *APIService) CreateTier(request *restful.Request, response *restful.Response) { +//ssping functions +func (s *APIService) CreateSsp(request *restful.Request, response *restful.Response) { log.Info("Received request for creating service plan.") - if !policy.Authorize(request, response, "tier:create") { + if !policy.Authorize(request, response, "ssp:create") { return } - tier := &backend.Tier{} + ssp := &backend.Ssp{} body := utils.ReadBody(request) - err := json.Unmarshal(body, &tier) + err := json.Unmarshal(body, &ssp) if err != nil { log.Error("error occurred while decoding body", err) response.WriteError(http.StatusBadRequest, nil) return } - if len(tier.Name) == 0 { + if len(ssp.Name) == 0 { errMsg := fmt.Sprintf("\"Name\" is required parameter should not be empty") log.Error(errMsg) response.WriteError(http.StatusBadRequest, errors.New(errMsg)) @@ -571,25 +571,25 @@ func (s *APIService) CreateTier(request *restful.Request, response *restful.Resp } ctx := common.InitCtxWithAuthInfo(request) - tier.TenantId = request.PathParameter("tenantId") + ssp.TenantId = request.PathParameter("tenantId") // ValidationCheck:1:: Name should be unique. Repeated name not allowed - tierResult, err := s.backendClient.ListTiers(ctx, &backend.ListTierRequest{ - Filter: map[string]string{"name": tier.Name}, + sspResult, err := s.backendClient.ListSsps(ctx, &backend.ListSspRequest{ + Filter: map[string]string{"name": ssp.Name}, }) if err != nil { log.Errorf("failed to list Service plans: %v\n", err) response.WriteError(http.StatusInternalServerError, err) return } - if len(tierResult.Tiers) > 0 { - errMsg := fmt.Sprintf("name: %v is already exists.", tier.Name) + if len(sspResult.Ssps) > 0 { + errMsg := fmt.Sprintf("name: %v is already exists.", ssp.Name) log.Error(errMsg) response.WriteError(http.StatusBadRequest, errors.New(errMsg)) return } // ValidationCheck:2:: Check tenants in request should not be repeated - dupTenants := utils.IsDuplicateItemExist(tier.Tenants) + dupTenants := utils.IsDuplicateItemExist(ssp.Tenants) if len(dupTenants) != 0 { errMsg := fmt.Sprintf("duplicate tenants are found in request: %v", dupTenants) log.Error(errMsg) @@ -598,7 +598,7 @@ func (s *APIService) CreateTier(request *restful.Request, response *restful.Resp } // ValidationCheck:3:: Check backends in request should not be repeated - dupBackends := utils.IsDuplicateItemExist(tier.Backends) + dupBackends := utils.IsDuplicateItemExist(ssp.Backends) if len(dupBackends) != 0 { errMsg := fmt.Sprintf("duplicate backends are found in request: %v", dupBackends) log.Error(errMsg) @@ -607,7 +607,7 @@ func (s *APIService) CreateTier(request *restful.Request, response *restful.Resp } // ValidationCheck:4:: validation of backends whether they are valid or not - invalidBackends, err := s.CheckInvalidBackends(ctx, tier.Backends) + invalidBackends, err := s.CheckInvalidBackends(ctx, ssp.Backends) if err != nil { log.Errorf("failed to find invalidBackends: %v\n", err) response.WriteError(http.StatusInternalServerError, err) @@ -620,27 +620,27 @@ func (s *APIService) CreateTier(request *restful.Request, response *restful.Resp return } - //Validation of tenantId of tier: + //Validation of tenantId of ssp: actx := request.Attribute(c.KContext).(*c.Context) token := actx.AuthToken - if !ValidateTenant(token, tier.TenantId) { - errMsg := fmt.Sprintf("tenantId:%v in request is invalid:", tier.TenantId) + if !ValidateTenant(token, ssp.TenantId) { + errMsg := fmt.Sprintf("tenantId:%v in request is invalid:", ssp.TenantId) log.Error(errMsg) response.WriteError(http.StatusBadRequest, errors.New(errMsg)) return } - //validation of tenants to be associated with the tier: - for _, tenant := range tier.Tenants { + //validation of tenants to be associated with the ssp: + for _, tenant := range ssp.Tenants { if !ValidateTenant(token, tenant) { - errMsg := fmt.Sprintf("tenant:%v is invalid so cannot be associated to the tier:", tenant) + errMsg := fmt.Sprintf("tenant:%v is invalid so cannot be associated to the ssp:", tenant) log.Error(errMsg) response.WriteError(http.StatusBadRequest, errors.New(errMsg)) return } } - // Now, tier can be created with backends for tenants - res, err := s.backendClient.CreateTier(ctx, &backend.CreateTierRequest{Tier: tier}) + // Now, ssp can be created with backends for tenants + res, err := s.backendClient.CreateSsp(ctx, &backend.CreateSspRequest{Ssp: ssp}) if err != nil { log.Errorf("failed to create service plan: %v\n", err) response.WriteError(http.StatusInternalServerError, err) @@ -648,20 +648,20 @@ func (s *APIService) CreateTier(request *restful.Request, response *restful.Resp } log.Info("Created service plan successfully.") - response.WriteEntity(res.Tier) + response.WriteEntity(res.Ssp) } //here backendId can be updated -func (s *APIService) UpdateTier(request *restful.Request, response *restful.Response) { +func (s *APIService) UpdateSsp(request *restful.Request, response *restful.Response) { log.Infof("Received request for updating service plan: %v\n", request.PathParameter("id")) - if !policy.Authorize(request, response, "tier:update") { + if !policy.Authorize(request, response, "ssp:update") { return } id := request.PathParameter("id") - updateTier := backend.UpdateTier{Id: id} + updateSsp := backend.UpdateSsp{Id: id} body := utils.ReadBody(request) - err := json.Unmarshal(body, &updateTier) + err := json.Unmarshal(body, &updateSsp) if err != nil { log.Error("error occurred while decoding body", err) response.WriteError(http.StatusBadRequest, nil) @@ -669,7 +669,7 @@ func (s *APIService) UpdateTier(request *restful.Request, response *restful.Resp } ctx := common.InitCtxWithAuthInfo(request) - //Validation of tenantId of tier: + //Validation of tenantId of ssp: actx := request.Attribute(c.KContext).(*c.Context) token := actx.AuthToken tenantid := request.PathParameter("tenantId") @@ -680,9 +680,9 @@ func (s *APIService) UpdateTier(request *restful.Request, response *restful.Resp return } - // ValidationCheck::BackendExists:: Check whether tier id exists or not + // ValidationCheck::BackendExists:: Check whether ssp id exists or not log.Info("ValidationCheck::BackendExists:: Check whether service plan id exists or not") - res, err := s.backendClient.GetTier(ctx, &backend.GetTierRequest{Id: id}) + res, err := s.backendClient.GetSsp(ctx, &backend.GetSspRequest{Id: id}) if err != nil { errMsg := fmt.Sprintf("failed to get service plan details for id: %v\n, err: %v\n", id, err) log.Error(errMsg) @@ -693,7 +693,7 @@ func (s *APIService) UpdateTier(request *restful.Request, response *restful.Resp // ValidationCheck:DuplicateBackendsInAddBackends:: Check AddBackends in request should not be repeated log.Info("ValidationCheck:Duplicate Backends In AddBackends") - dupBackends := utils.IsDuplicateItemExist(updateTier.AddBackends) + dupBackends := utils.IsDuplicateItemExist(updateSsp.AddBackends) if len(dupBackends) > 0 { errMsg := fmt.Sprintf("duplicate backends are found in AddBackends request: %v", dupBackends) log.Error(errMsg) @@ -703,7 +703,7 @@ func (s *APIService) UpdateTier(request *restful.Request, response *restful.Resp // ValidationCheck:DuplicateBackendsInAddBackends:: Check DeleteBackends in request should not be repeated log.Info("ValidationCheck: Duplicate Backends In DeleteBackends") - dupBackends = utils.IsDuplicateItemExist(updateTier.DeleteBackends) + dupBackends = utils.IsDuplicateItemExist(updateSsp.DeleteBackends) if len(dupBackends) > 0 { errMsg := fmt.Sprintf("duplicate backends are found in DeleteBackends request: %v", dupBackends) log.Error(errMsg) @@ -713,9 +713,9 @@ func (s *APIService) UpdateTier(request *restful.Request, response *restful.Resp // ValidationCheck:2:: In the same request, same backend can not be // present in AddBackends and DeleteBackends both - log.Info("ValidationCheck::dupItemFoundInDelandAddBackends:: Check whether tier id exists or not") - dupItemFoundInDelandAddBackends := utils.CompareDeleteAndAddList(updateTier.AddBackends, - updateTier.DeleteBackends) + log.Info("ValidationCheck::dupItemFoundInDelandAddBackends:: Check whether ssp id exists or not") + dupItemFoundInDelandAddBackends := utils.CompareDeleteAndAddList(updateSsp.AddBackends, + updateSsp.DeleteBackends) if len(dupItemFoundInDelandAddBackends) > 0 { errMsg := fmt.Sprintf("some backends found in AddBackends and DeleteBackends"+ "in same request, which is not allowed: %v", dupItemFoundInDelandAddBackends) @@ -727,7 +727,7 @@ func (s *APIService) UpdateTier(request *restful.Request, response *restful.Resp // ValidationCheck:DuplicateTenants:: Check tenants in AddTenants request should not be repeated log.Info("ValidationCheck::DuplicateTenants should not allowed in AddTenants") - dupTenants := utils.IsDuplicateItemExist(updateTier.AddTenants) + dupTenants := utils.IsDuplicateItemExist(updateSsp.AddTenants) if len(dupTenants) > 0 { errMsg := fmt.Sprintf("duplicate tenants are found in AddTenants request: %v", dupTenants) log.Error(errMsg) @@ -737,7 +737,7 @@ func (s *APIService) UpdateTier(request *restful.Request, response *restful.Resp // ValidationCheck:2:: Check tenants in DeleteTenants request should not be repeated log.Info("ValidationCheck::DuplicateTenants should not allowed in DeleteTenants") - dupTenants = utils.IsDuplicateItemExist(updateTier.DeleteTenants) + dupTenants = utils.IsDuplicateItemExist(updateSsp.DeleteTenants) if len(dupTenants) > 0 { errMsg := fmt.Sprintf("duplicate tenants are found in DeleteTenants request: %v", dupTenants) log.Error(errMsg) @@ -748,8 +748,8 @@ func (s *APIService) UpdateTier(request *restful.Request, response *restful.Resp // ValidationCheck:SameBackendsNotAllowedInBoth:: In the same request, same backend can not be // present in AddBackends and DeleteBackends both log.Info("ValidationCheck:Same Tenants should Not Allowed In Both") - dupItemFoundInDelandAddTenants := utils.CompareDeleteAndAddList(updateTier.AddTenants, - updateTier.DeleteTenants) + dupItemFoundInDelandAddTenants := utils.CompareDeleteAndAddList(updateSsp.AddTenants, + updateSsp.DeleteTenants) if len(dupItemFoundInDelandAddTenants) > 0 { errMsg := fmt.Sprintf("some backends found in AddBackends and DeleteBackends"+ "in same request, which is not allowed: %v", dupItemFoundInDelandAddTenants) @@ -760,7 +760,7 @@ func (s *APIService) UpdateTier(request *restful.Request, response *restful.Resp // ValidationCheck:5:: validation of backends whether they are valid or not log.Info("Check for invalid backends") - invalidBackends, err := s.CheckInvalidBackends(ctx, updateTier.AddBackends) + invalidBackends, err := s.CheckInvalidBackends(ctx, updateSsp.AddBackends) if err != nil { log.Errorf("failed to find invalidBackends: %v\n", err) response.WriteError(http.StatusInternalServerError, err) @@ -775,7 +775,7 @@ func (s *APIService) UpdateTier(request *restful.Request, response *restful.Resp } log.Info("Check whether backends already exists before adding") - backendsExist := utils.ResourcesAlreadyExists(res.Tier.Backends, updateTier.AddBackends) + backendsExist := utils.ResourcesAlreadyExists(res.Ssp.Backends, updateSsp.AddBackends) if len(backendsExist) > 0 { errMsg := fmt.Sprintf("some backends in AddBackends request: %v already exists in service plan", backendsExist) log.Error(errMsg) @@ -784,7 +784,7 @@ func (s *APIService) UpdateTier(request *restful.Request, response *restful.Resp } log.Info("Check backends should exists before removing") - backendsNotExist := utils.ResourcesCheckBeforeRemove(res.Tier.Backends, updateTier.DeleteBackends) + backendsNotExist := utils.ResourcesCheckBeforeRemove(res.Ssp.Backends, updateSsp.DeleteBackends) if len(backendsNotExist) > 0 { errMsg := fmt.Sprintf("failed to update service plan because delete backends: %v doesnt exist in service plan", backendsNotExist) log.Error(errMsg) @@ -793,7 +793,7 @@ func (s *APIService) UpdateTier(request *restful.Request, response *restful.Resp } log.Info("Check whether Tenant already exists before adding") - tenantExist := utils.ResourcesAlreadyExists(res.Tier.Tenants, updateTier.AddTenants) + tenantExist := utils.ResourcesAlreadyExists(res.Ssp.Tenants, updateSsp.AddTenants) if len(tenantExist) > 0 { errMsg := fmt.Sprintf("some backends in AddBackends request: %v already exists in service plan", tenantExist) log.Error(errMsg) @@ -801,7 +801,7 @@ func (s *APIService) UpdateTier(request *restful.Request, response *restful.Resp return } log.Info("Check Tenant should exists before removing") - tenantNotExist := utils.ResourcesCheckBeforeRemove(res.Tier.Tenants, updateTier.DeleteTenants) + tenantNotExist := utils.ResourcesCheckBeforeRemove(res.Ssp.Tenants, updateSsp.DeleteTenants) if len(tenantNotExist) > 0 { errMsg := fmt.Sprintf("failed to update service plan because delete backends: %v doesnt exist in service plan", tenantNotExist) log.Error(errMsg) @@ -809,9 +809,9 @@ func (s *APIService) UpdateTier(request *restful.Request, response *restful.Resp return } log.Info("Check whether Tenants are valid") - for _, tenant := range updateTier.AddTenants { + for _, tenant := range updateSsp.AddTenants { if !ValidateTenant(token, tenant) { - errMsg := fmt.Sprintf("invalid tenant:%v is present in adding tenants in tier:", tenant) + errMsg := fmt.Sprintf("invalid tenant:%v is present in adding tenants in ssp:", tenant) log.Error(errMsg) response.WriteError(http.StatusBadRequest, errors.New(errMsg)) return @@ -819,7 +819,7 @@ func (s *APIService) UpdateTier(request *restful.Request, response *restful.Resp } log.Info("Check Backends have any buckets before removing") - for _, backendId := range updateTier.DeleteBackends { + for _, backendId := range updateSsp.DeleteBackends { result, err := s.backendClient.GetBackend(ctx, &backend.GetBackendRequest{Id: backendId}) if err != nil { log.Errorf("failed to get backend details: %v\n", err) @@ -842,16 +842,16 @@ func (s *APIService) UpdateTier(request *restful.Request, response *restful.Resp } log.Info("Prepare update list with AddBackends and DeleteBackends") - res.Tier.Backends = utils.PrepareUpdateList(res.Tier.Backends, updateTier.AddBackends, - updateTier.DeleteBackends) + res.Ssp.Backends = utils.PrepareUpdateList(res.Ssp.Backends, updateSsp.AddBackends, + updateSsp.DeleteBackends) log.Info("Prepare update list with AddTenants and DeleteTenants") - res.Tier.Tenants = utils.PrepareUpdateList(res.Tier.Tenants, updateTier.AddTenants, - updateTier.DeleteTenants) + res.Ssp.Tenants = utils.PrepareUpdateList(res.Ssp.Tenants, updateSsp.AddTenants, + updateSsp.DeleteTenants) - // Now, tier details can be updated - updateTierRequest := &backend.UpdateTierRequest{Tier: res.Tier} - res1, err := s.backendClient.UpdateTier(ctx, updateTierRequest) + // Now, ssp details can be updated + updateSspRequest := &backend.UpdateSspRequest{Ssp: res.Ssp} + res1, err := s.backendClient.UpdateSsp(ctx, updateSspRequest) if err != nil { log.Errorf("failed to update service plan: %v\n", err) response.WriteError(http.StatusInternalServerError, err) @@ -859,20 +859,20 @@ func (s *APIService) UpdateTier(request *restful.Request, response *restful.Resp } log.Info("Update service plan successfully.") - response.WriteEntity(res1.Tier) + response.WriteEntity(res1.Ssp) } -// GetTier if tierId is given then details of tier to be given -func (s *APIService) GetTier(request *restful.Request, response *restful.Response) { +// GetSsp if sspId is given then details of ssp to be given +func (s *APIService) GetSsp(request *restful.Request, response *restful.Response) { log.Infof("Received request for service plan details: %s\n", request.PathParameter("id")) - if !policy.Authorize(request, response, "tier:get") { + if !policy.Authorize(request, response, "ssp:get") { return } id := request.PathParameter("id") ctx := common.InitCtxWithAuthInfo(request) - //Validation of tenantId of tier: + //Validation of tenantId of ssp: actx := request.Attribute(c.KContext).(*c.Context) token := actx.AuthToken tenantid := request.PathParameter("tenantId") @@ -883,7 +883,7 @@ func (s *APIService) GetTier(request *restful.Request, response *restful.Respons return } - res, err := s.backendClient.GetTier(ctx, &backend.GetTierRequest{Id: id}) + res, err := s.backendClient.GetSsp(ctx, &backend.GetSspRequest{Id: id}) if err != nil { log.Errorf("failed to get service plan details: %v\n", err) response.WriteError(http.StatusInternalServerError, err) @@ -891,13 +891,13 @@ func (s *APIService) GetTier(request *restful.Request, response *restful.Respons } log.Info("Get service plan details successfully.") - response.WriteEntity(res.Tier) + response.WriteEntity(res.Ssp) } -//List of tiers is displayed -func (s *APIService) ListTiers(request *restful.Request, response *restful.Response) { +//List of ssps is displayed +func (s *APIService) ListSsps(request *restful.Request, response *restful.Response) { log.Info("Received request for service plan list.") - if !policy.Authorize(request, response, "tier:list") { + if !policy.Authorize(request, response, "ssp:list") { return } ctx := common.GetAdminContext() @@ -910,7 +910,7 @@ func (s *APIService) ListTiers(request *restful.Request, response *restful.Respo var key string tenantId := request.PathParameter("tenantId") - //Validation of tenantId of tier: + //Validation of tenantId of ssp: actx := request.Attribute(c.KContext).(*c.Context) token := actx.AuthToken if !ValidateTenant(token, tenantId) { @@ -926,7 +926,7 @@ func (s *APIService) ListTiers(request *restful.Request, response *restful.Respo key = "tenants" } - res, err := s.backendClient.ListTiers(ctx, &backend.ListTierRequest{ + res, err := s.backendClient.ListSsps(ctx, &backend.ListSspRequest{ Limit: limit, Offset: offset, Filter: map[string]string{key: tenantId}, @@ -943,16 +943,16 @@ func (s *APIService) ListTiers(request *restful.Request, response *restful.Respo return } -//given tierId need to delete the tier -func (s *APIService) DeleteTier(request *restful.Request, response *restful.Response) { +//given sspId need to delete the ssp +func (s *APIService) DeleteSsp(request *restful.Request, response *restful.Response) { id := request.PathParameter("id") log.Infof("Received request for deleting service plan: %s\n", id) - if !policy.Authorize(request, response, "tier:delete") { + if !policy.Authorize(request, response, "ssp:delete") { return } ctx := common.InitCtxWithAuthInfo(request) - //Validation of tenantId of tier: + //Validation of tenantId of ssp: actx := request.Attribute(c.KContext).(*c.Context) token := actx.AuthToken tenantid := request.PathParameter("tenantId") @@ -963,20 +963,20 @@ func (s *APIService) DeleteTier(request *restful.Request, response *restful.Resp return } - res, err := s.backendClient.GetTier(ctx, &backend.GetTierRequest{Id: id}) + res, err := s.backendClient.GetSsp(ctx, &backend.GetSspRequest{Id: id}) if err != nil { log.Errorf("failed to get service plan details: %v\n", err) response.WriteError(http.StatusInternalServerError, err) return } - // check whether tier is empty - if len(res.Tier.Backends) > 0 { + // check whether ssp is empty + if len(res.Ssp.Backends) > 0 { log.Errorf("failed to delete service plan because service plan is not empty has backends: %v\n", err) response.WriteError(http.StatusInternalServerError, err) return } - _, err = s.backendClient.DeleteTier(ctx, &backend.DeleteTierRequest{Id: id}) + _, err = s.backendClient.DeleteSsp(ctx, &backend.DeleteSspRequest{Id: id}) if err != nil { log.Errorf("failed to delete service plan: %v\n", err) err1 := errors.New("failed to delete service plan because service plan has associated backends") diff --git a/api/pkg/examples/policy.json b/api/pkg/examples/policy.json index a0f423afe..d968e22e1 100644 --- a/api/pkg/examples/policy.json +++ b/api/pkg/examples/policy.json @@ -6,11 +6,11 @@ "AkSk:get": "", "AkSk:create": "", "AkSk:delete": "", - "tier:create": "role:admin", - "tier:update": "role:admin", - "tier:get": "role:admin", - "tier:delete": "role:admin", - "tier:list": "is_admin:True or (role:admin and is_admin_project:True) or tenant_id:%(tenant_id)s", + "ssp:create": "role:admin", + "ssp:update": "role:admin", + "ssp:get": "role:admin", + "ssp:delete": "role:admin", + "ssp:list": "is_admin:True or (role:admin and is_admin_project:True) or tenant_id:%(tenant_id)s", "backend:get":"", "backend:list":"", "backend:create":"", diff --git a/api/pkg/s3/bucketput.go b/api/pkg/s3/bucketput.go index da741001d..25ddea35f 100644 --- a/api/pkg/s3/bucketput.go +++ b/api/pkg/s3/bucketput.go @@ -36,9 +36,9 @@ const ( func (s *APIService) BucketPut(request *restful.Request, response *restful.Response) { log.Info("Create bucket request received") - var isTier string + var isSsp string - isTier = request.HeaderParameter("tier") + isSsp = request.HeaderParameter("ssp") bucketName := strings.ToLower(request.PathParameter(common.REQUEST_PATH_BUCKET_NAME)) if !isValidBucketName(bucketName) { WriteErrorResponse(response, request, s3error.ErrInvalidBucketName) @@ -84,12 +84,12 @@ func (s *APIService) BucketPut(request *restful.Request, response *restful.Respo } var backendName string - if strings.EqualFold(isTier, TrueValue) { - backendName = s.getBackendFromTier(ctx, createBucketConf.LocationConstraint) + if strings.EqualFold(isSsp, TrueValue) { + backendName = s.getBackendFromSsp(ctx, createBucketConf.LocationConstraint) if backendName != "" { bucket.DefaultLocation = backendName ctx = common.GetAdminContext() - bucket.Tiers = createBucketConf.LocationConstraint + bucket.Ssps = createBucketConf.LocationConstraint flag = true } @@ -110,7 +110,7 @@ func (s *APIService) BucketPut(request *restful.Request, response *restful.Respo rsp, err := s.s3Client.CreateBucket(ctx, &bucket) if HandleS3Error(response, request, err, rsp.GetErrorCode()) != nil { - log.Errorf("delete bucket[%s] failed, err=%v, errCode=%d\n", bucketName, err, rsp.GetErrorCode()) + log.Errorf("create bucket[%s] failed, err=%v, errCode=%d\n", bucketName, err, rsp.GetErrorCode()) return } diff --git a/api/pkg/s3/objectput.go b/api/pkg/s3/objectput.go index 2f6e95165..e598bf2d6 100644 --- a/api/pkg/s3/objectput.go +++ b/api/pkg/s3/objectput.go @@ -54,7 +54,7 @@ func (s *APIService) ObjectPut(request *restful.Request, response *restful.Respo return } - if isArchive == "Archive" && bucketMeta.Tiers != "" { + if isArchive == "Archive" && bucketMeta.Ssps != "" { adminCtx := common.GetAdminContext() backendMeta, backendErr := s.backendClient.ListBackend(adminCtx, &backend.ListBackendRequest{ Offset: 0, diff --git a/api/pkg/s3/objectrestore.go b/api/pkg/s3/objectrestore.go index bd08e7332..656774580 100644 --- a/api/pkg/s3/objectrestore.go +++ b/api/pkg/s3/objectrestore.go @@ -70,7 +70,7 @@ func (s *APIService) RestoreObject(request *restful.Request, response *restful.R return } - // if tier is enabled, get the bucketMeta data to get all the details + // if ssp is enabled, get the bucketMeta data to get all the details // like backend, backend type, storageClass etc. bucketMeta, err := s.getBucketMeta(ctx, bucketName) if err != nil { @@ -79,12 +79,12 @@ func (s *APIService) RestoreObject(request *restful.Request, response *restful.R return } - if bucketMeta.Tiers != "" { + if bucketMeta.Ssps != "" { adminCtx := common.GetAdminContext() - backendId := s.GetBackendIdFromTier(adminCtx, bucketMeta.Tiers) + backendId := s.GetBackendIdFromSsp(adminCtx, bucketMeta.Ssps) backendMeta, err := s.backendClient.GetBackend(adminCtx, &backend.GetBackendRequest{Id: backendId}) if err != nil { - log.Error("the selected backends from tier doesn't exists.") + log.Error("the selected backends from ssp doesn't exists.") response.WriteError(http.StatusInternalServerError, err) } if backendMeta != nil { diff --git a/api/pkg/s3/service.go b/api/pkg/s3/service.go index e538c48ed..91c1ece09 100644 --- a/api/pkg/s3/service.go +++ b/api/pkg/s3/service.go @@ -165,39 +165,39 @@ func HandleS3Error(response *restful.Response, request *restful.Request, err err return nil } -func (s *APIService) GetBackendIdFromTier(ctx context.Context, tierName string) string { - log.Info("Request for GetBackendIdFromTier received", tierName) +func (s *APIService) GetBackendIdFromSsp(ctx context.Context, sspName string) string { + log.Info("Request for GetBackendIdFromTier received", sspName) var response *restful.Response var backendId string - res, err := s.backendClient.ListTiers(common.GetAdminContext(), &backend.ListTierRequest{ + res, err := s.backendClient.ListSsps(common.GetAdminContext(), &backend.ListSspRequest{ Limit: common.MaxPaginationLimit, Offset: common.DefaultPaginationOffset, - Filter: map[string]string{"name": tierName}, + Filter: map[string]string{"name": sspName}, }) if err != nil { - log.Error("list tier failed during getting backends from tier") + log.Error("list ssp failed during getting backends from ssp") response.WriteError(http.StatusInternalServerError, err) return "" } - backendId = res.Tiers[0].Backends[rand.Intn(len(res.Tiers[0].Backends))] + backendId = res.Ssps[0].Backends[rand.Intn(len(res.Ssps[0].Backends))] return backendId } -// this method is basically for getting the backends name from tier -func (s *APIService) getBackendFromTier(ctx context.Context, tierName string) string { - log.Info("The received tier name for getting backend name:", tierName) +// this method is basically for getting the backends name from ssp +func (s *APIService) getBackendFromSsp(ctx context.Context, sspName string) string { + log.Info("The received ssp name for getting backend name:", sspName) var backendId, backendName string var response *restful.Response - backendId = s.GetBackendIdFromTier(ctx, tierName) + backendId = s.GetBackendIdFromSsp(ctx, sspName) adminCtx := common.GetAdminContext() if backendId != "" { backendRep, err := s.backendClient.GetBackend(adminCtx, &backend.GetBackendRequest{Id: backendId}) if err != nil { - log.Error("the selected backends from tier doesn't exists.") + log.Error("the selected backends from ssp doesn't exists.") response.WriteError(http.StatusInternalServerError, err) return "" } diff --git a/backend/pkg/db/db.go b/backend/pkg/db/db.go index 81768a28a..bab813d85 100644 --- a/backend/pkg/db/db.go +++ b/backend/pkg/db/db.go @@ -30,11 +30,11 @@ type Repository interface { UpdateBackend(ctx context.Context, backend *model.Backend) (*model.Backend, error) GetBackend(ctx context.Context, id string) (*model.Backend, error) ListBackend(ctx context.Context, limit, offset int, query interface{}) ([]*model.Backend, error) - CreateTier(ctx context.Context, tier *model.Tier) (*model.Tier, error) - DeleteTier(ctx context.Context, id string) error - UpdateTier(ctx context.Context, tier *model.Tier) (*model.Tier, error) - GetTier(ctx context.Context, id string) (*model.Tier, error) - ListTiers(ctx context.Context, limit, offset int, query interface{}) ([]*model.Tier, error) + CreateSsp(ctx context.Context, ssp *model.Ssp) (*model.Ssp, error) + DeleteSsp(ctx context.Context, id string) error + UpdateSsp(ctx context.Context, ssp *model.Ssp) (*model.Ssp, error) + GetSsp(ctx context.Context, id string) (*model.Ssp, error) + ListSsps(ctx context.Context, limit, offset int, query interface{}) ([]*model.Ssp, error) Close() } diff --git a/backend/pkg/db/drivers/mongo/mongo.go b/backend/pkg/db/drivers/mongo/mongo.go index 26b14f92e..9ab1df629 100644 --- a/backend/pkg/db/drivers/mongo/mongo.go +++ b/backend/pkg/db/drivers/mongo/mongo.go @@ -35,7 +35,7 @@ type mongoRepository struct { var defaultDBName = "multi-cloud" var defaultCollection = "backends" -var defaultTierCollection = "tiers" +var defaultSspCollection = "ssps" var mutex sync.Mutex var mongoRepo = &mongoRepository{} @@ -183,24 +183,24 @@ func (repo *mongoRepository) ListBackend(ctx context.Context, limit, offset int, return backends, nil } -func (repo *mongoRepository) CreateTier(ctx context.Context, tier *model.Tier) (*model.Tier, error) { - log.Debug("received request to create tier in db") +func (repo *mongoRepository) CreateSsp(ctx context.Context, ssp *model.Ssp) (*model.Ssp, error) { + log.Debug("received request to create ssp in db") session := repo.session.Copy() defer session.Close() - if tier.Id == "" { - tier.Id = bson.NewObjectId() + if ssp.Id == "" { + ssp.Id = bson.NewObjectId() } - err := session.DB(defaultDBName).C(defaultTierCollection).Insert(tier) + err := session.DB(defaultDBName).C(defaultSspCollection).Insert(ssp) if err != nil { return nil, err } - return tier, nil + return ssp, nil } -func (repo *mongoRepository) DeleteTier(ctx context.Context, id string) error { - log.Debug("received request to delete tier from db") +func (repo *mongoRepository) DeleteSsp(ctx context.Context, id string) error { + log.Debug("received request to delete ssp from db") session := repo.session.Copy() defer session.Close() @@ -212,51 +212,51 @@ func (repo *mongoRepository) DeleteTier(ctx context.Context, id string) error { return err } - return session.DB(defaultDBName).C(defaultTierCollection).Remove(m) + return session.DB(defaultDBName).C(defaultSspCollection).Remove(m) } -func (repo *mongoRepository) UpdateTier(ctx context.Context, tier *model.Tier) (*model.Tier, error) { - log.Debug("received request to update tier") +func (repo *mongoRepository) UpdateSsp(ctx context.Context, ssp *model.Ssp) (*model.Ssp, error) { + log.Debug("received request to update ssp") session := repo.session.Copy() defer session.Close() - m := bson.M{"_id": tier.Id} + m := bson.M{"_id": ssp.Id} err := UpdateContextFilter(ctx, m) if err != nil { return nil, err } - err = session.DB(defaultDBName).C(defaultTierCollection).Update(m, tier) + err = session.DB(defaultDBName).C(defaultSspCollection).Update(m, ssp) if err != nil { return nil, err } - return tier, nil + return ssp, nil } -func (repo *mongoRepository) ListTiers(ctx context.Context, limit, offset int, query interface{}) ([]*model.Tier, error) { - log.Debug("received request to list tiers") +func (repo *mongoRepository) ListSsps(ctx context.Context, limit, offset int, query interface{}) ([]*model.Ssp, error) { + log.Debug("received request to list ssps") session := repo.session.Copy() defer session.Close() if limit == 0 { limit = math.MinInt32 } - var tiers []*model.Tier + var ssps []*model.Ssp m := bson.M{} UpdateFilter(m, query.(map[string]string)) err := UpdateContextFilter(ctx, m) if err != nil { return nil, err } - log.Infof("ListTiers, limit=%d, offset=%d, m=%+v\n", limit, offset, m) - err = session.DB(defaultDBName).C(defaultTierCollection).Find(m).Skip(offset).Limit(limit).All(&tiers) + log.Infof("ListSsps, limit=%d, offset=%d, m=%+v\n", limit, offset, m) + err = session.DB(defaultDBName).C(defaultSspCollection).Find(m).Skip(offset).Limit(limit).All(&ssps) if err != nil { return nil, err } - return tiers, nil + return ssps, nil } -func (repo *mongoRepository) GetTier(ctx context.Context, id string) (*model.Tier, +func (repo *mongoRepository) GetSsp(ctx context.Context, id string) (*model.Ssp, error) { - log.Debug("received request to get tier details") + log.Debug("received request to get ssp details") session := repo.session.Copy() defer session.Close() @@ -265,13 +265,13 @@ func (repo *mongoRepository) GetTier(ctx context.Context, id string) (*model.Tie if err != nil { return nil, err } - var tier = &model.Tier{} - collection := session.DB(defaultDBName).C(defaultTierCollection) - err = collection.Find(m).One(tier) + var ssp = &model.Ssp{} + collection := session.DB(defaultDBName).C(defaultSspCollection) + err = collection.Find(m).One(ssp) if err != nil { return nil, err } - return tier, nil + return ssp, nil } func (repo *mongoRepository) Close() { diff --git a/backend/pkg/model/model.go b/backend/pkg/model/model.go index 68b38ebaa..dec4d29b0 100644 --- a/backend/pkg/model/model.go +++ b/backend/pkg/model/model.go @@ -31,7 +31,7 @@ type Backend struct { Security string `json:"security,omitempty" bson:"security,omitempty"` } -type Tier struct { +type Ssp struct { Id bson.ObjectId `json:"id,omitempty" bson:"_id,omitempty"` TenantId string `json:"tenantId,omitempty" bson:"tenantId,omitempty"` Name string `json:"name,omitempty" bson:"name,omitempty"` diff --git a/backend/pkg/service/service.go b/backend/pkg/service/service.go index 975441ff4..74f15a740 100644 --- a/backend/pkg/service/service.go +++ b/backend/pkg/service/service.go @@ -270,99 +270,99 @@ func (b *backendService) ListType(ctx context.Context, in *pb.ListTypeRequest, o return nil } -func (b *backendService) CreateTier(ctx context.Context, in *pb.CreateTierRequest, out *pb.CreateTierResponse) error { - log.Info("Received CreateTier request.") - tier := &model.Tier{ - Name: in.Tier.Name, - TenantId: in.Tier.TenantId, - Backends: in.Tier.Backends, - Tenants: in.Tier.Tenants, +func (b *backendService) CreateSsp(ctx context.Context, in *pb.CreateSspRequest, out *pb.CreateSspResponse) error { + log.Info("Received CreateSsp request.") + ssp := &model.Ssp{ + Name: in.Ssp.Name, + TenantId: in.Ssp.TenantId, + Backends: in.Ssp.Backends, + Tenants: in.Ssp.Tenants, } - res, err := db.Repo.CreateTier(ctx, tier) + res, err := db.Repo.CreateSsp(ctx, ssp) if err != nil { - log.Errorf("Failed to create tier: %v", err) + log.Errorf("Failed to create ssp: %v", err) return err } - out.Tier = &pb.Tier{ + out.Ssp = &pb.Ssp{ Id: res.Id.Hex(), Name: res.Name, TenantId: res.TenantId, Backends: res.Backends, - Tenants: in.Tier.Tenants, + Tenants: in.Ssp.Tenants, } - log.Info("Create tier successfully.") + log.Info("Create ssp successfully.") return nil } -func (b *backendService) UpdateTier(ctx context.Context, in *pb.UpdateTierRequest, out *pb.UpdateTierResponse) error { - log.Info("Received UpdateTier request.") +func (b *backendService) UpdateSsp(ctx context.Context, in *pb.UpdateSspRequest, out *pb.UpdateSspResponse) error { + log.Info("Received UpdateSsp request.") - res1, err := db.Repo.GetTier(ctx, in.Tier.Id) + res1, err := db.Repo.GetSsp(ctx, in.Ssp.Id) if err != nil { - log.Errorf("failed to update tier: %v\n", err) + log.Errorf("failed to update ssp: %v\n", err) return err } - tier := &model.Tier{ + ssp := &model.Ssp{ Id: res1.Id, Name: res1.Name, TenantId: res1.TenantId, - Backends: in.Tier.Backends, - Tenants: in.Tier.Tenants, + Backends: in.Ssp.Backends, + Tenants: in.Ssp.Tenants, } - res, err := db.Repo.UpdateTier(ctx, tier) + res, err := db.Repo.UpdateSsp(ctx, ssp) if err != nil { - log.Errorf("failed to update tier: %v\n", err) + log.Errorf("failed to update ssp: %v\n", err) return err } - out.Tier = &pb.Tier{ + out.Ssp = &pb.Ssp{ Id: res.Id.Hex(), Name: res.Name, TenantId: res.TenantId, Backends: res.Backends, - Tenants: in.Tier.Tenants, + Tenants: in.Ssp.Tenants, } - log.Info("Update tier successfully.") + log.Info("Update ssp successfully.") return nil } -func (b *backendService) GetTier(ctx context.Context, in *pb.GetTierRequest, out *pb.GetTierResponse) error { - log.Info("Received GetTier request.") - res, err := db.Repo.GetTier(ctx, in.Id) +func (b *backendService) GetSsp(ctx context.Context, in *pb.GetSspRequest, out *pb.GetSspResponse) error { + log.Info("Received GetSsp request.") + res, err := db.Repo.GetSsp(ctx, in.Id) if err != nil { - log.Errorf("failed to get tier: %v\n", err) + log.Errorf("failed to get ssp: %v\n", err) return err } - out.Tier = &pb.Tier{ + out.Ssp = &pb.Ssp{ Id: res.Id.Hex(), Name: res.Name, TenantId: res.TenantId, Backends: res.Backends, Tenants: res.Tenants, } - log.Info("Get Tier successfully.") + log.Info("Get Ssp successfully.") return nil } -func (b *backendService) ListTiers(ctx context.Context, in *pb.ListTierRequest, out *pb.ListTierResponse) error { - log.Info("Received ListTiers request.") +func (b *backendService) ListSsps(ctx context.Context, in *pb.ListSspRequest, out *pb.ListSspResponse) error { + log.Info("Received ListSsps request.") if in.Limit < 0 || in.Offset < 0 { msg := fmt.Sprintf("invalid pagination parameter, limit = %d and offset = %d.", in.Limit, in.Offset) log.Info(msg) return errors.New(msg) } - res, err := db.Repo.ListTiers(ctx, int(in.Limit), int(in.Offset), in.Filter) + res, err := db.Repo.ListSsps(ctx, int(in.Limit), int(in.Offset), in.Filter) if err != nil { log.Errorf("failed to list backend: %v\n", err) return err } - var tiers []*pb.Tier + var ssps []*pb.Ssp for _, item := range res { - tiers = append(tiers, &pb.Tier{ + ssps = append(ssps, &pb.Ssp{ Id: item.Id.Hex(), Name: item.Name, TenantId: item.TenantId, @@ -370,22 +370,22 @@ func (b *backendService) ListTiers(ctx context.Context, in *pb.ListTierRequest, Tenants: item.Tenants, }) } - out.Tiers = tiers + out.Ssps = ssps out.Next = in.Offset + int32(len(res)) - log.Infof("List Tiers successfully, #num=%d", len(tiers)) + log.Infof("List Ssps successfully, #num=%d", len(ssps)) return nil } -func (b *backendService) DeleteTier(ctx context.Context, in *pb.DeleteTierRequest, out *pb.DeleteTierResponse) error { - log.Info("Received DeleteTier request.") - err := db.Repo.DeleteTier(ctx, in.Id) +func (b *backendService) DeleteSsp(ctx context.Context, in *pb.DeleteSspRequest, out *pb.DeleteSspResponse) error { + log.Info("Received DeleteSsp request.") + err := db.Repo.DeleteSsp(ctx, in.Id) if err != nil { - log.Errorf("failed to delete tier: %v\n", err) + log.Errorf("failed to delete ssp: %v\n", err) return err } - log.Info("Delete tier successfully.") + log.Info("Delete ssp successfully.") return nil } diff --git a/backend/pkg/service/service_test.go b/backend/pkg/service/service_test.go index f27d440c5..0707b4b8c 100644 --- a/backend/pkg/service/service_test.go +++ b/backend/pkg/service/service_test.go @@ -77,35 +77,35 @@ func (_m *MockBackendService) ListType(ctx context.Context, in *pb.ListTypeReque return result.(error) } -func (_m *MockBackendService) CreateTier(ctx context.Context, in *pb.CreateTierRequest, out *pb.CreateTierResponse) error { +func (_m *MockBackendService) CreateSsp(ctx context.Context, in *pb.CreateSspRequest, out *pb.CreateSspResponse) error { args := _m.Called() result := args.Get(0) return result.(error) } -func (_m *MockBackendService) GetTier(ctx context.Context, in *pb.GetTierRequest, out *pb.GetTierResponse) error { +func (_m *MockBackendService) GetSsp(ctx context.Context, in *pb.GetSspRequest, out *pb.GetSspResponse) error { args := _m.Called() result := args.Get(0) return result.(error) } -func (_m *MockBackendService) ListTiers(ctx context.Context, in *pb.ListTierRequest, out *pb.ListTierResponse) error { +func (_m *MockBackendService) ListSsps(ctx context.Context, in *pb.ListSspRequest, out *pb.ListSspResponse) error { args := _m.Called() result := args.Get(0) return result.(error) } -func (_m *MockBackendService) UpdateTier(ctx context.Context, in *pb.UpdateTierRequest, out *pb.UpdateTierResponse) error { +func (_m *MockBackendService) UpdateSsp(ctx context.Context, in *pb.UpdateSspRequest, out *pb.UpdateSspResponse) error { args := _m.Called() result := args.Get(0) return result.(error) } -func (_m *MockBackendService) DeleteTier(ctx context.Context, in *pb.DeleteTierRequest, out *pb.DeleteTierResponse) error { +func (_m *MockBackendService) DeleteSsp(ctx context.Context, in *pb.DeleteSspRequest, out *pb.DeleteSspResponse) error { args := _m.Called() result := args.Get(0) @@ -348,21 +348,21 @@ func TestListTypes(t *testing.T) { t.Log(err) } -func TestCreateTier(t *testing.T) { - var mockTier = &collection.SampleCreateTier[0] +func TestCreateSsp(t *testing.T) { + var mockSsp = &collection.SampleCreateSsp[0] - mockTierDetail := pb.Tier{ + mockSspDetail := pb.Ssp{ Id: "", - TenantId: "sample-tier-tenantID", - Name: "sample-tier-name", - Backends: []string{"sample-tier-backend-1", "sample-tier-backend-2"}, + TenantId: "sample-ssp-tenantID", + Name: "sample-ssp-name", + Backends: []string{"sample-ssp-backend-1", "sample-ssp-backend-2"}, } - var req = &pb.CreateTierRequest{ - Tier: &mockTierDetail, + var req = &pb.CreateSspRequest{ + Ssp: &mockSspDetail, } - var resp = &pb.CreateTierResponse{ - Tier: &mockTierDetail, + var resp = &pb.CreateSspResponse{ + Ssp: &mockSspDetail, } ctx := context.Background() @@ -371,31 +371,31 @@ func TestCreateTier(t *testing.T) { defer cancel() mockRepoClient := new(mockrepo.Repository) - mockRepoClient.On("CreateTier", ctx, mockTier).Return(mockTier, nil) + mockRepoClient.On("CreateSsp", ctx, mockSsp).Return(mockSsp, nil) db.Repo = mockRepoClient testService := NewBackendService() - err := testService.CreateTier(ctx, req, resp) + err := testService.CreateSsp(ctx, req, resp) t.Log(err) mockRepoClient.AssertExpectations(t) } -func TestGetTier(t *testing.T) { - var mockTier = &collection.SampleTiers[0] - var req = &pb.GetTierRequest{ +func TestGetSsp(t *testing.T) { + var mockSsp = &collection.SampleSsps[0] + var req = &pb.GetSspRequest{ Id: "Id", } - mockTierDetail := pb.Tier{ + mockSspDetail := pb.Ssp{ Id: "3769855c-b103-11e7-b772-17b880d2f537", - TenantId: "sample-tiers-tenantID", - Name: "sample-tiers-name", - Backends: []string{"sample-tier-backend-1", "sample-tier-backend-2"}, + TenantId: "sample-ssps-tenantID", + Name: "sample-ssps-name", + Backends: []string{"sample-ssp-backend-1", "sample-ssp-backend-2"}, } - var resp = &pb.GetTierResponse{ - Tier: &mockTierDetail, + var resp = &pb.GetSspResponse{ + Ssp: &mockSspDetail, } ctx := context.Background() @@ -404,41 +404,41 @@ func TestGetTier(t *testing.T) { defer cancel() mockRepoClient := new(mockrepo.Repository) - mockRepoClient.On("GetTier", ctx, "Id").Return(mockTier, nil) + mockRepoClient.On("GetSsp", ctx, "Id").Return(mockSsp, nil) db.Repo = mockRepoClient testService := NewBackendService() - err := testService.GetTier(ctx, req, resp) + err := testService.GetSsp(ctx, req, resp) t.Log(err) mockRepoClient.AssertExpectations(t) } -func TestListTiers(t *testing.T) { - var req = &pb.ListTierRequest{ +func TestListSsps(t *testing.T) { + var req = &pb.ListSspRequest{ Limit: 10, Offset: 20, SortKeys: []string{"k1", "k2"}, SortDirs: []string{"dir1", "dir2"}, } - var pbTier = []*model.Tier{ - {Id: "tierId", + var pbSsp = []*model.Ssp{ + {Id: "sspId", TenantId: "tenantId", Name: "name", Backends: []string{"backends"}, }, } - var pbTierDetail = []*pb.Tier{ - {Id: "tierId", + var pbSspDetail = []*pb.Ssp{ + {Id: "sspId", TenantId: "tenantId", Name: "name", Backends: []string{"backends"}, }, } - var resp = &pb.ListTierResponse{ - Tiers: pbTierDetail, + var resp = &pb.ListSspResponse{ + Ssps: pbSspDetail, } ctx := context.Background() @@ -447,38 +447,38 @@ func TestListTiers(t *testing.T) { defer cancel() mockRepoClient := new(mockrepo.Repository) - mockRepoClient.On("ListTiers", ctx, 10, 20).Return(pbTier, nil) + mockRepoClient.On("ListSsps", ctx, 10, 20).Return(pbSsp, nil) db.Repo = mockRepoClient testService := NewBackendService() - err := testService.ListTiers(ctx, req, resp) + err := testService.ListSsps(ctx, req, resp) t.Log(err) mockRepoClient.AssertExpectations(t) } -func TestUpdateTier(t *testing.T) { +func TestUpdateSsp(t *testing.T) { - var mockTier = &collection.SampleUpdateTier[0] - mockTierReqDetail := pb.Tier{ + var mockSsp = &collection.SampleUpdateSsp[0] + mockSspReqDetail := pb.Ssp{ Id: "Id", - TenantId: "tier-tenant", - Name: "tier-name", + TenantId: "ssp-tenant", + Name: "ssp-name", Backends: []string{"Backends"}, } - var req = &pb.UpdateTierRequest{ - Tier: &mockTierReqDetail, + var req = &pb.UpdateSspRequest{ + Ssp: &mockSspReqDetail, } - mockTierResDetail := pb.Tier{ + mockSspResDetail := pb.Ssp{ Id: "Id", - TenantId: "tier-tenant", + TenantId: "ssp-tenant", Name: "ter-name", Backends: []string{"Backends"}, } - var resp = &pb.UpdateTierResponse{ - Tier: &mockTierResDetail, + var resp = &pb.UpdateSspResponse{ + Ssp: &mockSspResDetail, } ctx := context.Background() @@ -487,22 +487,22 @@ func TestUpdateTier(t *testing.T) { defer cancel() mockRepoClient := new(mockrepo.Repository) - mockRepoClient.On("GetTier", ctx, "Id").Return(mockTier, nil) - mockRepoClient.On("UpdateTier", ctx, mockTier).Return(mockTier, nil) + mockRepoClient.On("GetSsp", ctx, "Id").Return(mockSsp, nil) + mockRepoClient.On("UpdateSsp", ctx, mockSsp).Return(mockSsp, nil) db.Repo = mockRepoClient testService := NewBackendService() - err := testService.UpdateTier(ctx, req, resp) + err := testService.UpdateSsp(ctx, req, resp) t.Log(err) mockRepoClient.AssertExpectations(t) } -func TestDeleteTier(t *testing.T) { - var req = &pb.DeleteTierRequest{ +func TestDeleteSsp(t *testing.T) { + var req = &pb.DeleteSspRequest{ Id: "Id", } - var resp = &pb.DeleteTierResponse{} + var resp = &pb.DeleteSspResponse{} ctx := context.Background() deadline := time.Now().Add(time.Duration(50) * time.Second) @@ -510,11 +510,11 @@ func TestDeleteTier(t *testing.T) { defer cancel() mockRepoClient := new(mockrepo.Repository) - mockRepoClient.On("DeleteTier", ctx, "Id").Return(nil) + mockRepoClient.On("DeleteSsp", ctx, "Id").Return(nil) db.Repo = mockRepoClient testService := NewBackendService() - err := testService.DeleteTier(ctx, req, resp) + err := testService.DeleteSsp(ctx, req, resp) t.Log(err) mockRepoClient.AssertExpectations(t) } diff --git a/backend/proto/backend.pb.go b/backend/proto/backend.pb.go index e009834cd..d2293dfcf 100644 --- a/backend/proto/backend.pb.go +++ b/backend/proto/backend.pb.go @@ -1,13 +1,12 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0 -// protoc (unknown) +// protoc-gen-go v1.26.0 +// protoc v3.17.0 // source: backend/proto/backend.proto package proto import ( - proto "github.com/golang/protobuf/proto" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -21,10 +20,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - type CreateBackendRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -222,7 +217,7 @@ type ListBackendRequest struct { Offset int32 `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"` SortKeys []string `protobuf:"bytes,3,rep,name=sortKeys,proto3" json:"sortKeys,omitempty"` SortDirs []string `protobuf:"bytes,4,rep,name=sortDirs,proto3" json:"sortDirs,omitempty"` - Filter map[string]string `protobuf:"bytes,5,rep,name=Filter,json=filter,proto3" json:"Filter,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Filter map[string]string `protobuf:"bytes,5,rep,name=Filter,proto3" json:"Filter,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } func (x *ListBackendRequest) Reset() { @@ -670,7 +665,7 @@ type ListTypeRequest struct { Offset int32 `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"` SortKeys []string `protobuf:"bytes,3,rep,name=sortKeys,proto3" json:"sortKeys,omitempty"` SortDirs []string `protobuf:"bytes,4,rep,name=sortDirs,proto3" json:"sortDirs,omitempty"` - Filter map[string]string `protobuf:"bytes,5,rep,name=Filter,json=filter,proto3" json:"Filter,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Filter map[string]string `protobuf:"bytes,5,rep,name=Filter,proto3" json:"Filter,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } func (x *ListTypeRequest) Reset() { @@ -850,16 +845,16 @@ func (x *TypeDetail) GetDescription() string { return "" } -type CreateTierRequest struct { +type CreateSspRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Tier *Tier `protobuf:"bytes,1,opt,name=tier,proto3" json:"tier,omitempty"` + Ssp *Ssp `protobuf:"bytes,1,opt,name=ssp,proto3" json:"ssp,omitempty"` } -func (x *CreateTierRequest) Reset() { - *x = CreateTierRequest{} +func (x *CreateSspRequest) Reset() { + *x = CreateSspRequest{} if protoimpl.UnsafeEnabled { mi := &file_backend_proto_backend_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -867,13 +862,13 @@ func (x *CreateTierRequest) Reset() { } } -func (x *CreateTierRequest) String() string { +func (x *CreateSspRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*CreateTierRequest) ProtoMessage() {} +func (*CreateSspRequest) ProtoMessage() {} -func (x *CreateTierRequest) ProtoReflect() protoreflect.Message { +func (x *CreateSspRequest) ProtoReflect() protoreflect.Message { mi := &file_backend_proto_backend_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -885,28 +880,28 @@ func (x *CreateTierRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use CreateTierRequest.ProtoReflect.Descriptor instead. -func (*CreateTierRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use CreateSspRequest.ProtoReflect.Descriptor instead. +func (*CreateSspRequest) Descriptor() ([]byte, []int) { return file_backend_proto_backend_proto_rawDescGZIP(), []int{14} } -func (x *CreateTierRequest) GetTier() *Tier { +func (x *CreateSspRequest) GetSsp() *Ssp { if x != nil { - return x.Tier + return x.Ssp } return nil } -type CreateTierResponse struct { +type CreateSspResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Tier *Tier `protobuf:"bytes,1,opt,name=tier,proto3" json:"tier,omitempty"` + Ssp *Ssp `protobuf:"bytes,1,opt,name=ssp,proto3" json:"ssp,omitempty"` } -func (x *CreateTierResponse) Reset() { - *x = CreateTierResponse{} +func (x *CreateSspResponse) Reset() { + *x = CreateSspResponse{} if protoimpl.UnsafeEnabled { mi := &file_backend_proto_backend_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -914,13 +909,13 @@ func (x *CreateTierResponse) Reset() { } } -func (x *CreateTierResponse) String() string { +func (x *CreateSspResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*CreateTierResponse) ProtoMessage() {} +func (*CreateSspResponse) ProtoMessage() {} -func (x *CreateTierResponse) ProtoReflect() protoreflect.Message { +func (x *CreateSspResponse) ProtoReflect() protoreflect.Message { mi := &file_backend_proto_backend_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -932,19 +927,19 @@ func (x *CreateTierResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use CreateTierResponse.ProtoReflect.Descriptor instead. -func (*CreateTierResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use CreateSspResponse.ProtoReflect.Descriptor instead. +func (*CreateSspResponse) Descriptor() ([]byte, []int) { return file_backend_proto_backend_proto_rawDescGZIP(), []int{15} } -func (x *CreateTierResponse) GetTier() *Tier { +func (x *CreateSspResponse) GetSsp() *Ssp { if x != nil { - return x.Tier + return x.Ssp } return nil } -type GetTierRequest struct { +type GetSspRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -952,8 +947,8 @@ type GetTierRequest struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` } -func (x *GetTierRequest) Reset() { - *x = GetTierRequest{} +func (x *GetSspRequest) Reset() { + *x = GetSspRequest{} if protoimpl.UnsafeEnabled { mi := &file_backend_proto_backend_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -961,13 +956,13 @@ func (x *GetTierRequest) Reset() { } } -func (x *GetTierRequest) String() string { +func (x *GetSspRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetTierRequest) ProtoMessage() {} +func (*GetSspRequest) ProtoMessage() {} -func (x *GetTierRequest) ProtoReflect() protoreflect.Message { +func (x *GetSspRequest) ProtoReflect() protoreflect.Message { mi := &file_backend_proto_backend_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -979,28 +974,28 @@ func (x *GetTierRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetTierRequest.ProtoReflect.Descriptor instead. -func (*GetTierRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use GetSspRequest.ProtoReflect.Descriptor instead. +func (*GetSspRequest) Descriptor() ([]byte, []int) { return file_backend_proto_backend_proto_rawDescGZIP(), []int{16} } -func (x *GetTierRequest) GetId() string { +func (x *GetSspRequest) GetId() string { if x != nil { return x.Id } return "" } -type GetTierResponse struct { +type GetSspResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Tier *Tier `protobuf:"bytes,1,opt,name=tier,proto3" json:"tier,omitempty"` + Ssp *Ssp `protobuf:"bytes,1,opt,name=ssp,proto3" json:"ssp,omitempty"` } -func (x *GetTierResponse) Reset() { - *x = GetTierResponse{} +func (x *GetSspResponse) Reset() { + *x = GetSspResponse{} if protoimpl.UnsafeEnabled { mi := &file_backend_proto_backend_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1008,13 +1003,13 @@ func (x *GetTierResponse) Reset() { } } -func (x *GetTierResponse) String() string { +func (x *GetSspResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetTierResponse) ProtoMessage() {} +func (*GetSspResponse) ProtoMessage() {} -func (x *GetTierResponse) ProtoReflect() protoreflect.Message { +func (x *GetSspResponse) ProtoReflect() protoreflect.Message { mi := &file_backend_proto_backend_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1026,19 +1021,19 @@ func (x *GetTierResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetTierResponse.ProtoReflect.Descriptor instead. -func (*GetTierResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use GetSspResponse.ProtoReflect.Descriptor instead. +func (*GetSspResponse) Descriptor() ([]byte, []int) { return file_backend_proto_backend_proto_rawDescGZIP(), []int{17} } -func (x *GetTierResponse) GetTier() *Tier { +func (x *GetSspResponse) GetSsp() *Ssp { if x != nil { - return x.Tier + return x.Ssp } return nil } -type ListTierRequest struct { +type ListSspRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -1047,11 +1042,11 @@ type ListTierRequest struct { Offset int32 `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"` SortKeys []string `protobuf:"bytes,3,rep,name=sortKeys,proto3" json:"sortKeys,omitempty"` SortDirs []string `protobuf:"bytes,4,rep,name=sortDirs,proto3" json:"sortDirs,omitempty"` - Filter map[string]string `protobuf:"bytes,5,rep,name=Filter,json=filter,proto3" json:"Filter,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Filter map[string]string `protobuf:"bytes,5,rep,name=Filter,proto3" json:"Filter,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } -func (x *ListTierRequest) Reset() { - *x = ListTierRequest{} +func (x *ListSspRequest) Reset() { + *x = ListSspRequest{} if protoimpl.UnsafeEnabled { mi := &file_backend_proto_backend_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1059,13 +1054,13 @@ func (x *ListTierRequest) Reset() { } } -func (x *ListTierRequest) String() string { +func (x *ListSspRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ListTierRequest) ProtoMessage() {} +func (*ListSspRequest) ProtoMessage() {} -func (x *ListTierRequest) ProtoReflect() protoreflect.Message { +func (x *ListSspRequest) ProtoReflect() protoreflect.Message { mi := &file_backend_proto_backend_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1077,57 +1072,57 @@ func (x *ListTierRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ListTierRequest.ProtoReflect.Descriptor instead. -func (*ListTierRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use ListSspRequest.ProtoReflect.Descriptor instead. +func (*ListSspRequest) Descriptor() ([]byte, []int) { return file_backend_proto_backend_proto_rawDescGZIP(), []int{18} } -func (x *ListTierRequest) GetLimit() int32 { +func (x *ListSspRequest) GetLimit() int32 { if x != nil { return x.Limit } return 0 } -func (x *ListTierRequest) GetOffset() int32 { +func (x *ListSspRequest) GetOffset() int32 { if x != nil { return x.Offset } return 0 } -func (x *ListTierRequest) GetSortKeys() []string { +func (x *ListSspRequest) GetSortKeys() []string { if x != nil { return x.SortKeys } return nil } -func (x *ListTierRequest) GetSortDirs() []string { +func (x *ListSspRequest) GetSortDirs() []string { if x != nil { return x.SortDirs } return nil } -func (x *ListTierRequest) GetFilter() map[string]string { +func (x *ListSspRequest) GetFilter() map[string]string { if x != nil { return x.Filter } return nil } -type ListTierResponse struct { +type ListSspResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Tiers []*Tier `protobuf:"bytes,1,rep,name=tiers,proto3" json:"tiers,omitempty"` - Next int32 `protobuf:"varint,2,opt,name=next,proto3" json:"next,omitempty"` + Ssps []*Ssp `protobuf:"bytes,1,rep,name=ssps,proto3" json:"ssps,omitempty"` + Next int32 `protobuf:"varint,2,opt,name=next,proto3" json:"next,omitempty"` } -func (x *ListTierResponse) Reset() { - *x = ListTierResponse{} +func (x *ListSspResponse) Reset() { + *x = ListSspResponse{} if protoimpl.UnsafeEnabled { mi := &file_backend_proto_backend_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1135,13 +1130,13 @@ func (x *ListTierResponse) Reset() { } } -func (x *ListTierResponse) String() string { +func (x *ListSspResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ListTierResponse) ProtoMessage() {} +func (*ListSspResponse) ProtoMessage() {} -func (x *ListTierResponse) ProtoReflect() protoreflect.Message { +func (x *ListSspResponse) ProtoReflect() protoreflect.Message { mi := &file_backend_proto_backend_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1153,35 +1148,35 @@ func (x *ListTierResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ListTierResponse.ProtoReflect.Descriptor instead. -func (*ListTierResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use ListSspResponse.ProtoReflect.Descriptor instead. +func (*ListSspResponse) Descriptor() ([]byte, []int) { return file_backend_proto_backend_proto_rawDescGZIP(), []int{19} } -func (x *ListTierResponse) GetTiers() []*Tier { +func (x *ListSspResponse) GetSsps() []*Ssp { if x != nil { - return x.Tiers + return x.Ssps } return nil } -func (x *ListTierResponse) GetNext() int32 { +func (x *ListSspResponse) GetNext() int32 { if x != nil { return x.Next } return 0 } -type UpdateTierRequest struct { +type UpdateSspRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Tier *Tier `protobuf:"bytes,1,opt,name=tier,proto3" json:"tier,omitempty"` + Ssp *Ssp `protobuf:"bytes,1,opt,name=ssp,proto3" json:"ssp,omitempty"` } -func (x *UpdateTierRequest) Reset() { - *x = UpdateTierRequest{} +func (x *UpdateSspRequest) Reset() { + *x = UpdateSspRequest{} if protoimpl.UnsafeEnabled { mi := &file_backend_proto_backend_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1189,13 +1184,13 @@ func (x *UpdateTierRequest) Reset() { } } -func (x *UpdateTierRequest) String() string { +func (x *UpdateSspRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*UpdateTierRequest) ProtoMessage() {} +func (*UpdateSspRequest) ProtoMessage() {} -func (x *UpdateTierRequest) ProtoReflect() protoreflect.Message { +func (x *UpdateSspRequest) ProtoReflect() protoreflect.Message { mi := &file_backend_proto_backend_proto_msgTypes[20] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1207,28 +1202,28 @@ func (x *UpdateTierRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use UpdateTierRequest.ProtoReflect.Descriptor instead. -func (*UpdateTierRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use UpdateSspRequest.ProtoReflect.Descriptor instead. +func (*UpdateSspRequest) Descriptor() ([]byte, []int) { return file_backend_proto_backend_proto_rawDescGZIP(), []int{20} } -func (x *UpdateTierRequest) GetTier() *Tier { +func (x *UpdateSspRequest) GetSsp() *Ssp { if x != nil { - return x.Tier + return x.Ssp } return nil } -type UpdateTierResponse struct { +type UpdateSspResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Tier *Tier `protobuf:"bytes,1,opt,name=tier,proto3" json:"tier,omitempty"` + Ssp *Ssp `protobuf:"bytes,1,opt,name=ssp,proto3" json:"ssp,omitempty"` } -func (x *UpdateTierResponse) Reset() { - *x = UpdateTierResponse{} +func (x *UpdateSspResponse) Reset() { + *x = UpdateSspResponse{} if protoimpl.UnsafeEnabled { mi := &file_backend_proto_backend_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1236,13 +1231,13 @@ func (x *UpdateTierResponse) Reset() { } } -func (x *UpdateTierResponse) String() string { +func (x *UpdateSspResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*UpdateTierResponse) ProtoMessage() {} +func (*UpdateSspResponse) ProtoMessage() {} -func (x *UpdateTierResponse) ProtoReflect() protoreflect.Message { +func (x *UpdateSspResponse) ProtoReflect() protoreflect.Message { mi := &file_backend_proto_backend_proto_msgTypes[21] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1254,19 +1249,19 @@ func (x *UpdateTierResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use UpdateTierResponse.ProtoReflect.Descriptor instead. -func (*UpdateTierResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use UpdateSspResponse.ProtoReflect.Descriptor instead. +func (*UpdateSspResponse) Descriptor() ([]byte, []int) { return file_backend_proto_backend_proto_rawDescGZIP(), []int{21} } -func (x *UpdateTierResponse) GetTier() *Tier { +func (x *UpdateSspResponse) GetSsp() *Ssp { if x != nil { - return x.Tier + return x.Ssp } return nil } -type DeleteTierRequest struct { +type DeleteSspRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -1274,8 +1269,8 @@ type DeleteTierRequest struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` } -func (x *DeleteTierRequest) Reset() { - *x = DeleteTierRequest{} +func (x *DeleteSspRequest) Reset() { + *x = DeleteSspRequest{} if protoimpl.UnsafeEnabled { mi := &file_backend_proto_backend_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1283,13 +1278,13 @@ func (x *DeleteTierRequest) Reset() { } } -func (x *DeleteTierRequest) String() string { +func (x *DeleteSspRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*DeleteTierRequest) ProtoMessage() {} +func (*DeleteSspRequest) ProtoMessage() {} -func (x *DeleteTierRequest) ProtoReflect() protoreflect.Message { +func (x *DeleteSspRequest) ProtoReflect() protoreflect.Message { mi := &file_backend_proto_backend_proto_msgTypes[22] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1301,26 +1296,26 @@ func (x *DeleteTierRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use DeleteTierRequest.ProtoReflect.Descriptor instead. -func (*DeleteTierRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use DeleteSspRequest.ProtoReflect.Descriptor instead. +func (*DeleteSspRequest) Descriptor() ([]byte, []int) { return file_backend_proto_backend_proto_rawDescGZIP(), []int{22} } -func (x *DeleteTierRequest) GetId() string { +func (x *DeleteSspRequest) GetId() string { if x != nil { return x.Id } return "" } -type DeleteTierResponse struct { +type DeleteSspResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields } -func (x *DeleteTierResponse) Reset() { - *x = DeleteTierResponse{} +func (x *DeleteSspResponse) Reset() { + *x = DeleteSspResponse{} if protoimpl.UnsafeEnabled { mi := &file_backend_proto_backend_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1328,13 +1323,13 @@ func (x *DeleteTierResponse) Reset() { } } -func (x *DeleteTierResponse) String() string { +func (x *DeleteSspResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*DeleteTierResponse) ProtoMessage() {} +func (*DeleteSspResponse) ProtoMessage() {} -func (x *DeleteTierResponse) ProtoReflect() protoreflect.Message { +func (x *DeleteSspResponse) ProtoReflect() protoreflect.Message { mi := &file_backend_proto_backend_proto_msgTypes[23] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1346,12 +1341,12 @@ func (x *DeleteTierResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use DeleteTierResponse.ProtoReflect.Descriptor instead. -func (*DeleteTierResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use DeleteSspResponse.ProtoReflect.Descriptor instead. +func (*DeleteSspResponse) Descriptor() ([]byte, []int) { return file_backend_proto_backend_proto_rawDescGZIP(), []int{23} } -type Tier struct { +type Ssp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -1363,8 +1358,8 @@ type Tier struct { Tenants []string `protobuf:"bytes,5,rep,name=tenants,proto3" json:"tenants,omitempty"` } -func (x *Tier) Reset() { - *x = Tier{} +func (x *Ssp) Reset() { + *x = Ssp{} if protoimpl.UnsafeEnabled { mi := &file_backend_proto_backend_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1372,13 +1367,13 @@ func (x *Tier) Reset() { } } -func (x *Tier) String() string { +func (x *Ssp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*Tier) ProtoMessage() {} +func (*Ssp) ProtoMessage() {} -func (x *Tier) ProtoReflect() protoreflect.Message { +func (x *Ssp) ProtoReflect() protoreflect.Message { mi := &file_backend_proto_backend_proto_msgTypes[24] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1390,60 +1385,60 @@ func (x *Tier) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use Tier.ProtoReflect.Descriptor instead. -func (*Tier) Descriptor() ([]byte, []int) { +// Deprecated: Use Ssp.ProtoReflect.Descriptor instead. +func (*Ssp) Descriptor() ([]byte, []int) { return file_backend_proto_backend_proto_rawDescGZIP(), []int{24} } -func (x *Tier) GetId() string { +func (x *Ssp) GetId() string { if x != nil { return x.Id } return "" } -func (x *Tier) GetTenantId() string { +func (x *Ssp) GetTenantId() string { if x != nil { return x.TenantId } return "" } -func (x *Tier) GetName() string { +func (x *Ssp) GetName() string { if x != nil { return x.Name } return "" } -func (x *Tier) GetBackends() []string { +func (x *Ssp) GetBackends() []string { if x != nil { return x.Backends } return nil } -func (x *Tier) GetTenants() []string { +func (x *Ssp) GetTenants() []string { if x != nil { return x.Tenants } return nil } -type UpdateTier struct { +type UpdateSsp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - AddBackends []string `protobuf:"bytes,3,rep,name=AddBackends,json=addBackends,proto3" json:"AddBackends,omitempty"` - DeleteBackends []string `protobuf:"bytes,4,rep,name=DeleteBackends,json=deleteBackends,proto3" json:"DeleteBackends,omitempty"` - AddTenants []string `protobuf:"bytes,5,rep,name=AddTenants,json=addTenants,proto3" json:"AddTenants,omitempty"` - DeleteTenants []string `protobuf:"bytes,6,rep,name=DeleteTenants,json=deleteTenants,proto3" json:"DeleteTenants,omitempty"` + AddBackends []string `protobuf:"bytes,3,rep,name=AddBackends,proto3" json:"AddBackends,omitempty"` + DeleteBackends []string `protobuf:"bytes,4,rep,name=DeleteBackends,proto3" json:"DeleteBackends,omitempty"` + AddTenants []string `protobuf:"bytes,5,rep,name=AddTenants,proto3" json:"AddTenants,omitempty"` + DeleteTenants []string `protobuf:"bytes,6,rep,name=DeleteTenants,proto3" json:"DeleteTenants,omitempty"` } -func (x *UpdateTier) Reset() { - *x = UpdateTier{} +func (x *UpdateSsp) Reset() { + *x = UpdateSsp{} if protoimpl.UnsafeEnabled { mi := &file_backend_proto_backend_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1451,13 +1446,13 @@ func (x *UpdateTier) Reset() { } } -func (x *UpdateTier) String() string { +func (x *UpdateSsp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*UpdateTier) ProtoMessage() {} +func (*UpdateSsp) ProtoMessage() {} -func (x *UpdateTier) ProtoReflect() protoreflect.Message { +func (x *UpdateSsp) ProtoReflect() protoreflect.Message { mi := &file_backend_proto_backend_proto_msgTypes[25] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1469,40 +1464,40 @@ func (x *UpdateTier) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use UpdateTier.ProtoReflect.Descriptor instead. -func (*UpdateTier) Descriptor() ([]byte, []int) { +// Deprecated: Use UpdateSsp.ProtoReflect.Descriptor instead. +func (*UpdateSsp) Descriptor() ([]byte, []int) { return file_backend_proto_backend_proto_rawDescGZIP(), []int{25} } -func (x *UpdateTier) GetId() string { +func (x *UpdateSsp) GetId() string { if x != nil { return x.Id } return "" } -func (x *UpdateTier) GetAddBackends() []string { +func (x *UpdateSsp) GetAddBackends() []string { if x != nil { return x.AddBackends } return nil } -func (x *UpdateTier) GetDeleteBackends() []string { +func (x *UpdateSsp) GetDeleteBackends() []string { if x != nil { return x.DeleteBackends } return nil } -func (x *UpdateTier) GetAddTenants() []string { +func (x *UpdateSsp) GetAddTenants() []string { if x != nil { return x.AddTenants } return nil } -func (x *UpdateTier) GetDeleteTenants() []string { +func (x *UpdateSsp) GetDeleteTenants() []string { if x != nil { return x.DeleteTenants } @@ -1539,7 +1534,7 @@ var file_backend_proto_backend_proto_rawDesc = []byte{ 0x44, 0x69, 0x72, 0x73, 0x12, 0x37, 0x0a, 0x06, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x1a, 0x39, 0x0a, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x1a, 0x39, 0x0a, 0x0b, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, @@ -1589,7 +1584,7 @@ var file_backend_proto_backend_proto_rawDesc = []byte{ 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x73, 0x6f, 0x72, 0x74, 0x44, 0x69, 0x72, 0x73, 0x12, 0x34, 0x0a, 0x06, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x66, + 0x74, 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x1a, 0x39, 0x0a, 0x0b, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, @@ -1603,107 +1598,104 @@ var file_backend_proto_backend_proto_rawDesc = []byte{ 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, - 0x2e, 0x0a, 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x65, 0x72, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x04, 0x74, 0x69, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x54, 0x69, 0x65, 0x72, 0x52, 0x04, 0x74, 0x69, 0x65, 0x72, 0x22, - 0x2f, 0x0a, 0x12, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x65, 0x72, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x19, 0x0a, 0x04, 0x74, 0x69, 0x65, 0x72, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x54, 0x69, 0x65, 0x72, 0x52, 0x04, 0x74, 0x69, 0x65, 0x72, - 0x22, 0x20, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x54, 0x69, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, - 0x69, 0x64, 0x22, 0x2c, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x54, 0x69, 0x65, 0x72, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x19, 0x0a, 0x04, 0x74, 0x69, 0x65, 0x72, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x54, 0x69, 0x65, 0x72, 0x52, 0x04, 0x74, 0x69, 0x65, 0x72, - 0x22, 0xe8, 0x01, 0x0a, 0x0f, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x69, 0x65, 0x72, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, - 0x66, 0x73, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, - 0x65, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x6f, 0x72, 0x74, 0x4b, 0x65, 0x79, 0x73, 0x18, 0x03, - 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x73, 0x6f, 0x72, 0x74, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x1a, - 0x0a, 0x08, 0x73, 0x6f, 0x72, 0x74, 0x44, 0x69, 0x72, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, - 0x52, 0x08, 0x73, 0x6f, 0x72, 0x74, 0x44, 0x69, 0x72, 0x73, 0x12, 0x34, 0x0a, 0x06, 0x46, 0x69, - 0x6c, 0x74, 0x65, 0x72, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x54, 0x69, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x46, 0x69, 0x6c, - 0x74, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, - 0x1a, 0x39, 0x0a, 0x0b, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, - 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, - 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x43, 0x0a, 0x10, 0x4c, - 0x69, 0x73, 0x74, 0x54, 0x69, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x1b, 0x0a, 0x05, 0x74, 0x69, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x05, - 0x2e, 0x54, 0x69, 0x65, 0x72, 0x52, 0x05, 0x74, 0x69, 0x65, 0x72, 0x73, 0x12, 0x12, 0x0a, 0x04, - 0x6e, 0x65, 0x78, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x6e, 0x65, 0x78, 0x74, - 0x22, 0x2e, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x65, 0x72, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x04, 0x74, 0x69, 0x65, 0x72, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x54, 0x69, 0x65, 0x72, 0x52, 0x04, 0x74, 0x69, 0x65, 0x72, - 0x22, 0x2f, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x65, 0x72, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x19, 0x0a, 0x04, 0x74, 0x69, 0x65, 0x72, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x54, 0x69, 0x65, 0x72, 0x52, 0x04, 0x74, 0x69, 0x65, - 0x72, 0x22, 0x23, 0x0a, 0x11, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x69, 0x65, 0x72, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x14, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, - 0x54, 0x69, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x7c, 0x0a, 0x04, - 0x54, 0x69, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x02, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x49, 0x64, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x49, 0x64, - 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x73, - 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x73, - 0x12, 0x18, 0x0a, 0x07, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, - 0x09, 0x52, 0x07, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x73, 0x22, 0xac, 0x01, 0x0a, 0x0a, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x41, 0x64, 0x64, - 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, - 0x61, 0x64, 0x64, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x73, 0x12, 0x26, 0x0a, 0x0e, 0x44, - 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x73, 0x18, 0x04, 0x20, - 0x03, 0x28, 0x09, 0x52, 0x0e, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x65, - 0x6e, 0x64, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x41, 0x64, 0x64, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, - 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x61, 0x64, 0x64, 0x54, 0x65, 0x6e, 0x61, - 0x6e, 0x74, 0x73, 0x12, 0x24, 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x65, 0x6e, - 0x61, 0x6e, 0x74, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x64, 0x65, 0x6c, 0x65, - 0x74, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x73, 0x32, 0x86, 0x05, 0x0a, 0x07, 0x42, 0x61, - 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x12, 0x40, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, - 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x12, 0x15, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, - 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x37, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x42, 0x61, - 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x12, 0x12, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x61, 0x63, 0x6b, 0x65, - 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x47, 0x65, 0x74, 0x42, - 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, - 0x12, 0x3a, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x12, - 0x13, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x61, 0x63, 0x6b, 0x65, - 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x40, 0x0a, 0x0d, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x12, 0x15, 0x2e, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x61, 0x63, - 0x6b, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x40, - 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x12, - 0x15, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, - 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, - 0x12, 0x31, 0x0a, 0x08, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x10, 0x2e, 0x4c, - 0x69, 0x73, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, - 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x00, 0x12, 0x37, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x65, - 0x72, 0x12, 0x12, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x65, 0x72, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, - 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x2e, 0x0a, 0x07, - 0x47, 0x65, 0x74, 0x54, 0x69, 0x65, 0x72, 0x12, 0x0f, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x69, 0x65, - 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x10, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x69, - 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x32, 0x0a, 0x09, - 0x4c, 0x69, 0x73, 0x74, 0x54, 0x69, 0x65, 0x72, 0x73, 0x12, 0x10, 0x2e, 0x4c, 0x69, 0x73, 0x74, - 0x54, 0x69, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x4c, 0x69, - 0x73, 0x74, 0x54, 0x69, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, - 0x12, 0x37, 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x65, 0x72, 0x12, 0x12, - 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x65, 0x72, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x37, 0x0a, 0x0a, 0x44, 0x65, 0x6c, - 0x65, 0x74, 0x65, 0x54, 0x69, 0x65, 0x72, 0x12, 0x12, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, - 0x54, 0x69, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x44, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x54, 0x69, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x00, 0x42, 0x0f, 0x5a, 0x0d, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x2f, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x2a, 0x0a, 0x10, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x73, 0x70, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x03, 0x73, 0x73, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x04, 0x2e, 0x53, 0x73, 0x70, 0x52, 0x03, 0x73, 0x73, 0x70, 0x22, 0x2b, 0x0a, 0x11, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x73, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x16, 0x0a, 0x03, 0x73, 0x73, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x04, 0x2e, + 0x53, 0x73, 0x70, 0x52, 0x03, 0x73, 0x73, 0x70, 0x22, 0x1f, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x53, + 0x73, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x28, 0x0a, 0x0e, 0x47, 0x65, 0x74, + 0x53, 0x73, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x03, 0x73, + 0x73, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x04, 0x2e, 0x53, 0x73, 0x70, 0x52, 0x03, + 0x73, 0x73, 0x70, 0x22, 0xe6, 0x01, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x73, 0x70, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x16, 0x0a, 0x06, + 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x6f, 0x66, + 0x66, 0x73, 0x65, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x6f, 0x72, 0x74, 0x4b, 0x65, 0x79, 0x73, + 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x73, 0x6f, 0x72, 0x74, 0x4b, 0x65, 0x79, 0x73, + 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x6f, 0x72, 0x74, 0x44, 0x69, 0x72, 0x73, 0x18, 0x04, 0x20, 0x03, + 0x28, 0x09, 0x52, 0x08, 0x73, 0x6f, 0x72, 0x74, 0x44, 0x69, 0x72, 0x73, 0x12, 0x33, 0x0a, 0x06, + 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x4c, + 0x69, 0x73, 0x74, 0x53, 0x73, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x46, 0x69, + 0x6c, 0x74, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x46, 0x69, 0x6c, 0x74, 0x65, + 0x72, 0x1a, 0x39, 0x0a, 0x0b, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, + 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x3f, 0x0a, 0x0f, + 0x4c, 0x69, 0x73, 0x74, 0x53, 0x73, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x18, 0x0a, 0x04, 0x73, 0x73, 0x70, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x04, 0x2e, + 0x53, 0x73, 0x70, 0x52, 0x04, 0x73, 0x73, 0x70, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x65, 0x78, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x6e, 0x65, 0x78, 0x74, 0x22, 0x2a, 0x0a, + 0x10, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x73, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x16, 0x0a, 0x03, 0x73, 0x73, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x04, + 0x2e, 0x53, 0x73, 0x70, 0x52, 0x03, 0x73, 0x73, 0x70, 0x22, 0x2b, 0x0a, 0x11, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x53, 0x73, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, + 0x0a, 0x03, 0x73, 0x73, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x04, 0x2e, 0x53, 0x73, + 0x70, 0x52, 0x03, 0x73, 0x73, 0x70, 0x22, 0x22, 0x0a, 0x10, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x53, 0x73, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x13, 0x0a, 0x11, 0x44, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x53, 0x73, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x7b, 0x0a, 0x03, 0x53, 0x73, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, + 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, + 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, + 0x64, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, + 0x64, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x73, 0x18, 0x05, 0x20, + 0x03, 0x28, 0x09, 0x52, 0x07, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x73, 0x22, 0xab, 0x01, 0x0a, + 0x09, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x73, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x41, 0x64, + 0x64, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, + 0x0b, 0x41, 0x64, 0x64, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x73, 0x12, 0x26, 0x0a, 0x0e, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x73, 0x18, 0x04, + 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x61, 0x63, 0x6b, + 0x65, 0x6e, 0x64, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x41, 0x64, 0x64, 0x54, 0x65, 0x6e, 0x61, 0x6e, + 0x74, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x41, 0x64, 0x64, 0x54, 0x65, 0x6e, + 0x61, 0x6e, 0x74, 0x73, 0x12, 0x24, 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x65, + 0x6e, 0x61, 0x6e, 0x74, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x44, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x73, 0x32, 0xf7, 0x04, 0x0a, 0x07, 0x42, + 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x12, 0x40, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x12, 0x15, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, + 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x37, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x42, + 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x12, 0x12, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x61, 0x63, 0x6b, + 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x47, 0x65, 0x74, + 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x00, 0x12, 0x3a, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, + 0x12, 0x13, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x61, 0x63, 0x6b, + 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x40, 0x0a, + 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x12, 0x15, + 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x61, + 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, + 0x40, 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, + 0x12, 0x15, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x00, 0x12, 0x31, 0x0a, 0x08, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x10, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x11, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x00, 0x12, 0x34, 0x0a, 0x09, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x73, + 0x70, 0x12, 0x11, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x73, 0x70, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x73, 0x70, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x2b, 0x0a, 0x06, 0x47, 0x65, + 0x74, 0x53, 0x73, 0x70, 0x12, 0x0e, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x73, 0x70, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0f, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x73, 0x70, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x2f, 0x0a, 0x08, 0x4c, 0x69, 0x73, 0x74, 0x53, + 0x73, 0x70, 0x73, 0x12, 0x0f, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x73, 0x70, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x10, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x73, 0x70, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x34, 0x0a, 0x09, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x53, 0x73, 0x70, 0x12, 0x11, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x73, + 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x53, 0x73, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x34, + 0x0a, 0x09, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x73, 0x70, 0x12, 0x11, 0x2e, 0x44, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x53, 0x73, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, + 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x73, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x00, 0x42, 0x0f, 0x5a, 0x0d, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x2f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1734,21 +1726,21 @@ var file_backend_proto_backend_proto_goTypes = []interface{}{ (*ListTypeRequest)(nil), // 11: ListTypeRequest (*ListTypeResponse)(nil), // 12: ListTypeResponse (*TypeDetail)(nil), // 13: TypeDetail - (*CreateTierRequest)(nil), // 14: CreateTierRequest - (*CreateTierResponse)(nil), // 15: CreateTierResponse - (*GetTierRequest)(nil), // 16: GetTierRequest - (*GetTierResponse)(nil), // 17: GetTierResponse - (*ListTierRequest)(nil), // 18: ListTierRequest - (*ListTierResponse)(nil), // 19: ListTierResponse - (*UpdateTierRequest)(nil), // 20: UpdateTierRequest - (*UpdateTierResponse)(nil), // 21: UpdateTierResponse - (*DeleteTierRequest)(nil), // 22: DeleteTierRequest - (*DeleteTierResponse)(nil), // 23: DeleteTierResponse - (*Tier)(nil), // 24: Tier - (*UpdateTier)(nil), // 25: UpdateTier + (*CreateSspRequest)(nil), // 14: CreateSspRequest + (*CreateSspResponse)(nil), // 15: CreateSspResponse + (*GetSspRequest)(nil), // 16: GetSspRequest + (*GetSspResponse)(nil), // 17: GetSspResponse + (*ListSspRequest)(nil), // 18: ListSspRequest + (*ListSspResponse)(nil), // 19: ListSspResponse + (*UpdateSspRequest)(nil), // 20: UpdateSspRequest + (*UpdateSspResponse)(nil), // 21: UpdateSspResponse + (*DeleteSspRequest)(nil), // 22: DeleteSspRequest + (*DeleteSspResponse)(nil), // 23: DeleteSspResponse + (*Ssp)(nil), // 24: Ssp + (*UpdateSsp)(nil), // 25: UpdateSsp nil, // 26: ListBackendRequest.FilterEntry nil, // 27: ListTypeRequest.FilterEntry - nil, // 28: ListTierRequest.FilterEntry + nil, // 28: ListSspRequest.FilterEntry } var file_backend_proto_backend_proto_depIdxs = []int32{ 10, // 0: CreateBackendRequest.backend:type_name -> BackendDetail @@ -1759,35 +1751,35 @@ var file_backend_proto_backend_proto_depIdxs = []int32{ 10, // 5: UpdateBackendResponse.backend:type_name -> BackendDetail 27, // 6: ListTypeRequest.Filter:type_name -> ListTypeRequest.FilterEntry 13, // 7: ListTypeResponse.types:type_name -> TypeDetail - 24, // 8: CreateTierRequest.tier:type_name -> Tier - 24, // 9: CreateTierResponse.tier:type_name -> Tier - 24, // 10: GetTierResponse.tier:type_name -> Tier - 28, // 11: ListTierRequest.Filter:type_name -> ListTierRequest.FilterEntry - 24, // 12: ListTierResponse.tiers:type_name -> Tier - 24, // 13: UpdateTierRequest.tier:type_name -> Tier - 24, // 14: UpdateTierResponse.tier:type_name -> Tier + 24, // 8: CreateSspRequest.ssp:type_name -> Ssp + 24, // 9: CreateSspResponse.ssp:type_name -> Ssp + 24, // 10: GetSspResponse.ssp:type_name -> Ssp + 28, // 11: ListSspRequest.Filter:type_name -> ListSspRequest.FilterEntry + 24, // 12: ListSspResponse.ssps:type_name -> Ssp + 24, // 13: UpdateSspRequest.ssp:type_name -> Ssp + 24, // 14: UpdateSspResponse.ssp:type_name -> Ssp 0, // 15: Backend.CreateBackend:input_type -> CreateBackendRequest 2, // 16: Backend.GetBackend:input_type -> GetBackendRequest 4, // 17: Backend.ListBackend:input_type -> ListBackendRequest 6, // 18: Backend.UpdateBackend:input_type -> UpdateBackendRequest 8, // 19: Backend.DeleteBackend:input_type -> DeleteBackendRequest 11, // 20: Backend.ListType:input_type -> ListTypeRequest - 14, // 21: Backend.CreateTier:input_type -> CreateTierRequest - 16, // 22: Backend.GetTier:input_type -> GetTierRequest - 18, // 23: Backend.ListTiers:input_type -> ListTierRequest - 20, // 24: Backend.UpdateTier:input_type -> UpdateTierRequest - 22, // 25: Backend.DeleteTier:input_type -> DeleteTierRequest + 14, // 21: Backend.CreateSsp:input_type -> CreateSspRequest + 16, // 22: Backend.GetSsp:input_type -> GetSspRequest + 18, // 23: Backend.ListSsps:input_type -> ListSspRequest + 20, // 24: Backend.UpdateSsp:input_type -> UpdateSspRequest + 22, // 25: Backend.DeleteSsp:input_type -> DeleteSspRequest 1, // 26: Backend.CreateBackend:output_type -> CreateBackendResponse 3, // 27: Backend.GetBackend:output_type -> GetBackendResponse 5, // 28: Backend.ListBackend:output_type -> ListBackendResponse 7, // 29: Backend.UpdateBackend:output_type -> UpdateBackendResponse 9, // 30: Backend.DeleteBackend:output_type -> DeleteBackendResponse 12, // 31: Backend.ListType:output_type -> ListTypeResponse - 15, // 32: Backend.CreateTier:output_type -> CreateTierResponse - 17, // 33: Backend.GetTier:output_type -> GetTierResponse - 19, // 34: Backend.ListTiers:output_type -> ListTierResponse - 21, // 35: Backend.UpdateTier:output_type -> UpdateTierResponse - 23, // 36: Backend.DeleteTier:output_type -> DeleteTierResponse + 15, // 32: Backend.CreateSsp:output_type -> CreateSspResponse + 17, // 33: Backend.GetSsp:output_type -> GetSspResponse + 19, // 34: Backend.ListSsps:output_type -> ListSspResponse + 21, // 35: Backend.UpdateSsp:output_type -> UpdateSspResponse + 23, // 36: Backend.DeleteSsp:output_type -> DeleteSspResponse 26, // [26:37] is the sub-list for method output_type 15, // [15:26] is the sub-list for method input_type 15, // [15:15] is the sub-list for extension type_name @@ -1970,7 +1962,7 @@ func file_backend_proto_backend_proto_init() { } } file_backend_proto_backend_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateTierRequest); i { + switch v := v.(*CreateSspRequest); i { case 0: return &v.state case 1: @@ -1982,7 +1974,7 @@ func file_backend_proto_backend_proto_init() { } } file_backend_proto_backend_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateTierResponse); i { + switch v := v.(*CreateSspResponse); i { case 0: return &v.state case 1: @@ -1994,7 +1986,7 @@ func file_backend_proto_backend_proto_init() { } } file_backend_proto_backend_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetTierRequest); i { + switch v := v.(*GetSspRequest); i { case 0: return &v.state case 1: @@ -2006,7 +1998,7 @@ func file_backend_proto_backend_proto_init() { } } file_backend_proto_backend_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetTierResponse); i { + switch v := v.(*GetSspResponse); i { case 0: return &v.state case 1: @@ -2018,7 +2010,7 @@ func file_backend_proto_backend_proto_init() { } } file_backend_proto_backend_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListTierRequest); i { + switch v := v.(*ListSspRequest); i { case 0: return &v.state case 1: @@ -2030,7 +2022,7 @@ func file_backend_proto_backend_proto_init() { } } file_backend_proto_backend_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListTierResponse); i { + switch v := v.(*ListSspResponse); i { case 0: return &v.state case 1: @@ -2042,7 +2034,7 @@ func file_backend_proto_backend_proto_init() { } } file_backend_proto_backend_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateTierRequest); i { + switch v := v.(*UpdateSspRequest); i { case 0: return &v.state case 1: @@ -2054,7 +2046,7 @@ func file_backend_proto_backend_proto_init() { } } file_backend_proto_backend_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateTierResponse); i { + switch v := v.(*UpdateSspResponse); i { case 0: return &v.state case 1: @@ -2066,7 +2058,7 @@ func file_backend_proto_backend_proto_init() { } } file_backend_proto_backend_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteTierRequest); i { + switch v := v.(*DeleteSspRequest); i { case 0: return &v.state case 1: @@ -2078,7 +2070,7 @@ func file_backend_proto_backend_proto_init() { } } file_backend_proto_backend_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteTierResponse); i { + switch v := v.(*DeleteSspResponse); i { case 0: return &v.state case 1: @@ -2090,7 +2082,7 @@ func file_backend_proto_backend_proto_init() { } } file_backend_proto_backend_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Tier); i { + switch v := v.(*Ssp); i { case 0: return &v.state case 1: @@ -2102,7 +2094,7 @@ func file_backend_proto_backend_proto_init() { } } file_backend_proto_backend_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateTier); i { + switch v := v.(*UpdateSsp); i { case 0: return &v.state case 1: diff --git a/backend/proto/backend.pb.micro.go b/backend/proto/backend.pb.micro.go index 3afe9f7ac..073530b89 100644 --- a/backend/proto/backend.pb.micro.go +++ b/backend/proto/backend.pb.micro.go @@ -48,11 +48,11 @@ type BackendService interface { UpdateBackend(ctx context.Context, in *UpdateBackendRequest, opts ...client.CallOption) (*UpdateBackendResponse, error) DeleteBackend(ctx context.Context, in *DeleteBackendRequest, opts ...client.CallOption) (*DeleteBackendResponse, error) ListType(ctx context.Context, in *ListTypeRequest, opts ...client.CallOption) (*ListTypeResponse, error) - CreateTier(ctx context.Context, in *CreateTierRequest, opts ...client.CallOption) (*CreateTierResponse, error) - GetTier(ctx context.Context, in *GetTierRequest, opts ...client.CallOption) (*GetTierResponse, error) - ListTiers(ctx context.Context, in *ListTierRequest, opts ...client.CallOption) (*ListTierResponse, error) - UpdateTier(ctx context.Context, in *UpdateTierRequest, opts ...client.CallOption) (*UpdateTierResponse, error) - DeleteTier(ctx context.Context, in *DeleteTierRequest, opts ...client.CallOption) (*DeleteTierResponse, error) + CreateSsp(ctx context.Context, in *CreateSspRequest, opts ...client.CallOption) (*CreateSspResponse, error) + GetSsp(ctx context.Context, in *GetSspRequest, opts ...client.CallOption) (*GetSspResponse, error) + ListSsps(ctx context.Context, in *ListSspRequest, opts ...client.CallOption) (*ListSspResponse, error) + UpdateSsp(ctx context.Context, in *UpdateSspRequest, opts ...client.CallOption) (*UpdateSspResponse, error) + DeleteSsp(ctx context.Context, in *DeleteSspRequest, opts ...client.CallOption) (*DeleteSspResponse, error) } type backendService struct { @@ -127,9 +127,9 @@ func (c *backendService) ListType(ctx context.Context, in *ListTypeRequest, opts return out, nil } -func (c *backendService) CreateTier(ctx context.Context, in *CreateTierRequest, opts ...client.CallOption) (*CreateTierResponse, error) { - req := c.c.NewRequest(c.name, "Backend.CreateTier", in) - out := new(CreateTierResponse) +func (c *backendService) CreateSsp(ctx context.Context, in *CreateSspRequest, opts ...client.CallOption) (*CreateSspResponse, error) { + req := c.c.NewRequest(c.name, "Backend.CreateSsp", in) + out := new(CreateSspResponse) err := c.c.Call(ctx, req, out, opts...) if err != nil { return nil, err @@ -137,9 +137,9 @@ func (c *backendService) CreateTier(ctx context.Context, in *CreateTierRequest, return out, nil } -func (c *backendService) GetTier(ctx context.Context, in *GetTierRequest, opts ...client.CallOption) (*GetTierResponse, error) { - req := c.c.NewRequest(c.name, "Backend.GetTier", in) - out := new(GetTierResponse) +func (c *backendService) GetSsp(ctx context.Context, in *GetSspRequest, opts ...client.CallOption) (*GetSspResponse, error) { + req := c.c.NewRequest(c.name, "Backend.GetSsp", in) + out := new(GetSspResponse) err := c.c.Call(ctx, req, out, opts...) if err != nil { return nil, err @@ -147,9 +147,9 @@ func (c *backendService) GetTier(ctx context.Context, in *GetTierRequest, opts . return out, nil } -func (c *backendService) ListTiers(ctx context.Context, in *ListTierRequest, opts ...client.CallOption) (*ListTierResponse, error) { - req := c.c.NewRequest(c.name, "Backend.ListTiers", in) - out := new(ListTierResponse) +func (c *backendService) ListSsps(ctx context.Context, in *ListSspRequest, opts ...client.CallOption) (*ListSspResponse, error) { + req := c.c.NewRequest(c.name, "Backend.ListSsps", in) + out := new(ListSspResponse) err := c.c.Call(ctx, req, out, opts...) if err != nil { return nil, err @@ -157,9 +157,9 @@ func (c *backendService) ListTiers(ctx context.Context, in *ListTierRequest, opt return out, nil } -func (c *backendService) UpdateTier(ctx context.Context, in *UpdateTierRequest, opts ...client.CallOption) (*UpdateTierResponse, error) { - req := c.c.NewRequest(c.name, "Backend.UpdateTier", in) - out := new(UpdateTierResponse) +func (c *backendService) UpdateSsp(ctx context.Context, in *UpdateSspRequest, opts ...client.CallOption) (*UpdateSspResponse, error) { + req := c.c.NewRequest(c.name, "Backend.UpdateSsp", in) + out := new(UpdateSspResponse) err := c.c.Call(ctx, req, out, opts...) if err != nil { return nil, err @@ -167,9 +167,9 @@ func (c *backendService) UpdateTier(ctx context.Context, in *UpdateTierRequest, return out, nil } -func (c *backendService) DeleteTier(ctx context.Context, in *DeleteTierRequest, opts ...client.CallOption) (*DeleteTierResponse, error) { - req := c.c.NewRequest(c.name, "Backend.DeleteTier", in) - out := new(DeleteTierResponse) +func (c *backendService) DeleteSsp(ctx context.Context, in *DeleteSspRequest, opts ...client.CallOption) (*DeleteSspResponse, error) { + req := c.c.NewRequest(c.name, "Backend.DeleteSsp", in) + out := new(DeleteSspResponse) err := c.c.Call(ctx, req, out, opts...) if err != nil { return nil, err @@ -186,11 +186,11 @@ type BackendHandler interface { UpdateBackend(context.Context, *UpdateBackendRequest, *UpdateBackendResponse) error DeleteBackend(context.Context, *DeleteBackendRequest, *DeleteBackendResponse) error ListType(context.Context, *ListTypeRequest, *ListTypeResponse) error - CreateTier(context.Context, *CreateTierRequest, *CreateTierResponse) error - GetTier(context.Context, *GetTierRequest, *GetTierResponse) error - ListTiers(context.Context, *ListTierRequest, *ListTierResponse) error - UpdateTier(context.Context, *UpdateTierRequest, *UpdateTierResponse) error - DeleteTier(context.Context, *DeleteTierRequest, *DeleteTierResponse) error + CreateSsp(context.Context, *CreateSspRequest, *CreateSspResponse) error + GetSsp(context.Context, *GetSspRequest, *GetSspResponse) error + ListSsps(context.Context, *ListSspRequest, *ListSspResponse) error + UpdateSsp(context.Context, *UpdateSspRequest, *UpdateSspResponse) error + DeleteSsp(context.Context, *DeleteSspRequest, *DeleteSspResponse) error } func RegisterBackendHandler(s server.Server, hdlr BackendHandler, opts ...server.HandlerOption) error { @@ -201,11 +201,11 @@ func RegisterBackendHandler(s server.Server, hdlr BackendHandler, opts ...server UpdateBackend(ctx context.Context, in *UpdateBackendRequest, out *UpdateBackendResponse) error DeleteBackend(ctx context.Context, in *DeleteBackendRequest, out *DeleteBackendResponse) error ListType(ctx context.Context, in *ListTypeRequest, out *ListTypeResponse) error - CreateTier(ctx context.Context, in *CreateTierRequest, out *CreateTierResponse) error - GetTier(ctx context.Context, in *GetTierRequest, out *GetTierResponse) error - ListTiers(ctx context.Context, in *ListTierRequest, out *ListTierResponse) error - UpdateTier(ctx context.Context, in *UpdateTierRequest, out *UpdateTierResponse) error - DeleteTier(ctx context.Context, in *DeleteTierRequest, out *DeleteTierResponse) error + CreateSsp(ctx context.Context, in *CreateSspRequest, out *CreateSspResponse) error + GetSsp(ctx context.Context, in *GetSspRequest, out *GetSspResponse) error + ListSsps(ctx context.Context, in *ListSspRequest, out *ListSspResponse) error + UpdateSsp(ctx context.Context, in *UpdateSspRequest, out *UpdateSspResponse) error + DeleteSsp(ctx context.Context, in *DeleteSspRequest, out *DeleteSspResponse) error } type Backend struct { backend @@ -242,22 +242,22 @@ func (h *backendHandler) ListType(ctx context.Context, in *ListTypeRequest, out return h.BackendHandler.ListType(ctx, in, out) } -func (h *backendHandler) CreateTier(ctx context.Context, in *CreateTierRequest, out *CreateTierResponse) error { - return h.BackendHandler.CreateTier(ctx, in, out) +func (h *backendHandler) CreateSsp(ctx context.Context, in *CreateSspRequest, out *CreateSspResponse) error { + return h.BackendHandler.CreateSsp(ctx, in, out) } -func (h *backendHandler) GetTier(ctx context.Context, in *GetTierRequest, out *GetTierResponse) error { - return h.BackendHandler.GetTier(ctx, in, out) +func (h *backendHandler) GetSsp(ctx context.Context, in *GetSspRequest, out *GetSspResponse) error { + return h.BackendHandler.GetSsp(ctx, in, out) } -func (h *backendHandler) ListTiers(ctx context.Context, in *ListTierRequest, out *ListTierResponse) error { - return h.BackendHandler.ListTiers(ctx, in, out) +func (h *backendHandler) ListSsps(ctx context.Context, in *ListSspRequest, out *ListSspResponse) error { + return h.BackendHandler.ListSsps(ctx, in, out) } -func (h *backendHandler) UpdateTier(ctx context.Context, in *UpdateTierRequest, out *UpdateTierResponse) error { - return h.BackendHandler.UpdateTier(ctx, in, out) +func (h *backendHandler) UpdateSsp(ctx context.Context, in *UpdateSspRequest, out *UpdateSspResponse) error { + return h.BackendHandler.UpdateSsp(ctx, in, out) } -func (h *backendHandler) DeleteTier(ctx context.Context, in *DeleteTierRequest, out *DeleteTierResponse) error { - return h.BackendHandler.DeleteTier(ctx, in, out) +func (h *backendHandler) DeleteSsp(ctx context.Context, in *DeleteSspRequest, out *DeleteSspResponse) error { + return h.BackendHandler.DeleteSsp(ctx, in, out) } diff --git a/backend/proto/backend.proto b/backend/proto/backend.proto index d4eccf534..6a88aa327 100644 --- a/backend/proto/backend.proto +++ b/backend/proto/backend.proto @@ -9,11 +9,11 @@ service Backend { rpc UpdateBackend(UpdateBackendRequest) returns (UpdateBackendResponse) {} rpc DeleteBackend(DeleteBackendRequest) returns (DeleteBackendResponse) {} rpc ListType(ListTypeRequest) returns (ListTypeResponse) {} - rpc CreateTier(CreateTierRequest) returns (CreateTierResponse) {} - rpc GetTier(GetTierRequest) returns (GetTierResponse) {} - rpc ListTiers(ListTierRequest) returns (ListTierResponse) {} - rpc UpdateTier(UpdateTierRequest) returns (UpdateTierResponse) {} - rpc DeleteTier(DeleteTierRequest) returns (DeleteTierResponse) {} + rpc CreateSsp(CreateSspRequest) returns (CreateSspResponse) {} + rpc GetSsp(GetSspRequest) returns (GetSspResponse) {} + rpc ListSsps(ListSspRequest) returns (ListSspResponse) {} + rpc UpdateSsp(UpdateSspRequest) returns (UpdateSspResponse) {} + rpc DeleteSsp(DeleteSspRequest) returns (DeleteSspResponse) {} } message CreateBackendRequest { @@ -93,23 +93,23 @@ message TypeDetail { string description = 2; } -message CreateTierRequest { - Tier tier = 1; +message CreateSspRequest { + Ssp ssp = 1; } -message CreateTierResponse { - Tier tier = 1; +message CreateSspResponse { + Ssp ssp = 1; } -message GetTierRequest { +message GetSspRequest { string id = 1; } -message GetTierResponse { - Tier tier = 1; +message GetSspResponse { + Ssp ssp = 1; } -message ListTierRequest { +message ListSspRequest { int32 limit = 1; int32 offset = 2; repeated string sortKeys = 3; @@ -117,27 +117,27 @@ message ListTierRequest { map Filter = 5; } -message ListTierResponse { - repeated Tier tiers = 1; +message ListSspResponse { + repeated Ssp ssps = 1; int32 next = 2; } -message UpdateTierRequest { - Tier tier = 1; +message UpdateSspRequest { + Ssp ssp = 1; } -message UpdateTierResponse { - Tier tier = 1; +message UpdateSspResponse { + Ssp ssp = 1; } -message DeleteTierRequest { +message DeleteSspRequest { string id = 1; } -message DeleteTierResponse { +message DeleteSspResponse { } -message Tier { +message Ssp { string id = 1; string tenantId = 2; string name = 3; @@ -145,7 +145,7 @@ message Tier { repeated string tenants = 5; } -message UpdateTier { +message UpdateSsp { string id = 1; repeated string AddBackends = 3; repeated string DeleteBackends = 4; @@ -154,3 +154,4 @@ message UpdateTier { } + diff --git a/s3/pkg/conf/tidb.sql b/s3/pkg/conf/tidb.sql index 6707acd44..be1f690dc 100644 --- a/s3/pkg/conf/tidb.sql +++ b/s3/pkg/conf/tidb.sql @@ -37,7 +37,7 @@ CREATE TABLE IF NOT EXISTS `buckets` ( `versioning` varchar(255) DEFAULT NULL, `replication` JSON DEFAULT NULL, `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `tiers` varchar(255) DEFAULT NULL, + `ssps` varchar(255) DEFAULT NULL, PRIMARY KEY (`bucketname`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; /*!40101 SET character_set_client = @saved_cs_client */; diff --git a/s3/pkg/meta/db/drivers/tidb/bucket.go b/s3/pkg/meta/db/drivers/tidb/bucket.go index 65ced15de..286c9b4bc 100644 --- a/s3/pkg/meta/db/drivers/tidb/bucket.go +++ b/s3/pkg/meta/db/drivers/tidb/bucket.go @@ -41,7 +41,7 @@ func (t *TidbClient) GetBucket(ctx context.Context, bucketName string) (bucket * var row *sql.Row sqltext := "select bucketname,tenantid,createtime,usages,location,acl,cors,lc,policy,versioning,replication," + - "update_time,tiers from buckets where bucketname=?;" + "update_time,ssps from buckets where bucketname=?;" row = t.Client.QueryRow(sqltext, bucketName) tmp := &Bucket{Bucket: &pb.Bucket{}} @@ -59,7 +59,7 @@ func (t *TidbClient) GetBucket(ctx context.Context, bucketName string) (bucket * &tmp.Versioning.Status, &replication, &updateTime, - &tmp.Tiers, + &tmp.Ssps, ) if err != nil { err = handleDBError(err) @@ -147,15 +147,15 @@ func (t *TidbClient) GetBuckets(ctx context.Context, query interface{}) (buckets var rows *sql.Rows sqltext := "select bucketname,tenantid,userid,createtime,usages,location,deleted,acl,cors,lc,policy," + - "versioning,replication,update_time,tiers from buckets;" + "versioning,replication,update_time,ssps from buckets;" if location != "" { sqltext = "select bucketname,tenantid,userid,createtime,usages,location,deleted,acl,cors,lc,policy," + - "versioning,replication,update_time,tiers from buckets where location=?;" + "versioning,replication,update_time,ssps from buckets where location=?;" rows, err = t.Client.Query(sqltext, location) } else if !isAdmin { sqltext = "select bucketname,tenantid,userid,createtime,usages,location,deleted,acl,cors,lc,policy," + - "versioning,replication,update_time,tiers from buckets where tenantid=?;" + "versioning,replication,update_time,ssps from buckets where tenantid=?;" rows, err = t.Client.Query(sqltext, tenantId) } else { rows, err = t.Client.Query(sqltext) @@ -191,7 +191,7 @@ func (t *TidbClient) GetBuckets(ctx context.Context, query interface{}) (buckets &tmp.Versioning.Status, &replication, &updateTime, - &tmp.Tiers) + &tmp.Ssps) if err != nil { err = handleDBError(err) return diff --git a/s3/pkg/meta/types/bucket.go b/s3/pkg/meta/types/bucket.go index 5d4ae5e9f..7b1bb0267 100644 --- a/s3/pkg/meta/types/bucket.go +++ b/s3/pkg/meta/types/bucket.go @@ -69,7 +69,7 @@ func (b *Bucket) String() (s string) { s += "Policy: " + fmt.Sprintf("%+v", b.BucketPolicy) + "\n" s += "Versioning: " + fmt.Sprintf("%+v", b.Versioning) + "\n" s += "Usage: " + humanize.Bytes(uint64(b.Usages)) + "\n" - s += "Tiers: " + b.Tiers + "\n" + s += "Ssps: " + b.Ssps + "\n" return } @@ -91,7 +91,7 @@ func (b *Bucket) GetValues() (values map[string]map[string][]byte, err error) { return } values = map[string]map[string][]byte{ - BUCKET_COLUMN_FAMILY: map[string][]byte{ + BUCKET_COLUMN_FAMILY: { "UID": []byte(b.TenantId), "ACL": []byte(b.Acl.CannedAcl), "CORS": cors, @@ -115,8 +115,8 @@ func (b Bucket) GetCreateSql() (string, []interface{}) { log.Infof("createTime=%v\n", createTime) sql := "insert into buckets(bucketname,tenantid,userid,createtime,usages,location,acl,cors,lc,policy,versioning," + - "replication,tiers) values(?,?,?,?,?,?,?,?,?,?,?,?,?);" + "replication,ssps) values(?,?,?,?,?,?,?,?,?,?,?,?,?);" args := []interface{}{b.Name, b.TenantId, b.UserId, createTime, b.Usages, b.DefaultLocation, acl, cors, lc, - bucket_policy, b.Versioning.Status, replia, b.Tiers} + bucket_policy, b.Versioning.Status, replia, b.Ssps} return sql, args } diff --git a/s3/pkg/service/bucket.go b/s3/pkg/service/bucket.go index 64f48263a..8d911629b 100644 --- a/s3/pkg/service/bucket.go +++ b/s3/pkg/service/bucket.go @@ -68,11 +68,11 @@ func (s *s3Service) ListBuckets(ctx context.Context, in *pb.ListBucketsRequest, DefaultLocation: buckets[j].DefaultLocation, Versioning: buckets[j].Versioning, ServerSideEncryption: buckets[j].ServerSideEncryption, - Tiers: buckets[j].Tiers, + Ssps: buckets[j].Ssps, }) - if buckets[j].Tiers != "" { - out.Buckets[j].DefaultLocation = buckets[j].Tiers + if buckets[j].Ssps != "" { + out.Buckets[j].DefaultLocation = buckets[j].Ssps } } } @@ -216,7 +216,7 @@ func (s *s3Service) GetBucket(ctx context.Context, in *pb.Bucket, out *pb.GetBuc Usages: bucket.Usages, Versioning: bucket.Versioning, ServerSideEncryption: bucket.ServerSideEncryption, - Tiers: bucket.Tiers, + Ssps: bucket.Ssps, } return nil @@ -255,7 +255,7 @@ func (s *s3Service) DeleteBucket(ctx context.Context, in *pb.Bucket, out *pb.Bas // if tiers is enabled, list all the backend using admin context bkndCtx := ctx - if bucket.Tiers != "" { + if bucket.Ssps != "" { bkndCtx = utils.GetAdminContext() } diff --git a/s3/pkg/service/object.go b/s3/pkg/service/object.go index 1efa54950..f09db55b3 100644 --- a/s3/pkg/service/object.go +++ b/s3/pkg/service/object.go @@ -86,7 +86,7 @@ func (s *s3Service) RestoreObject(ctx context.Context, req *pb.RestoreObjectRequ // if tiers is enabled, list all the backend using admin context bkndCtx := ctx - if bucket.Tiers != "" { + if bucket.Ssps != "" { bkndCtx = utils.GetAdminContext() } // incase get backend failed @@ -277,7 +277,7 @@ func (s *s3Service) PutObject(ctx context.Context, in pb.S3_PutObjectStream) err // if tiers is enabled, list all the backend using admin context bkndCtx := ctx - if bucket.Tiers != "" { + if bucket.Ssps != "" { bkndCtx = utils.GetAdminContext() } @@ -480,7 +480,7 @@ func (s *s3Service) GetObject(ctx context.Context, req *pb.GetObjectInput, strea // if tiers is enabled, list all the backend using admin context bkndCtx := ctx - if bucket.Tiers != "" { + if bucket.Ssps != "" { bkndCtx = utils.GetAdminContext() } @@ -645,7 +645,7 @@ func (s *s3Service) CopyObject(ctx context.Context, in *pb.CopyObjectRequest, ou // if tiers is enabled, list all the backend using admin context bkndCtx := ctx - if srcBucket.Tiers != "" { + if srcBucket.Ssps != "" { bkndCtx = utils.GetAdminContext() } @@ -666,7 +666,7 @@ func (s *s3Service) CopyObject(ctx context.Context, in *pb.CopyObjectRequest, ou // if tiers is enabled, list all the backend using admin context bkndCtx = ctx - if targetBucket.Tiers != "" { + if targetBucket.Ssps != "" { bkndCtx = utils.GetAdminContext() } @@ -830,7 +830,7 @@ func (s *s3Service) MoveObject(ctx context.Context, in *pb.MoveObjectRequest, ou // if tiers is enabled, list all the backend using admin context bkndCtx := ctx - if srcBucket.Tiers != "" { + if srcBucket.Ssps != "" { bkndCtx = utils.GetAdminContext() } @@ -888,7 +888,7 @@ func (s *s3Service) MoveObject(ctx context.Context, in *pb.MoveObjectRequest, ou // if tiers is enabled, list all the backend using admin context bkndCtx := ctx - if targetBucket.Tiers != "" { + if targetBucket.Ssps != "" { bkndCtx = utils.GetAdminContext() } @@ -1099,7 +1099,7 @@ func (s *s3Service) removeObject(ctx context.Context, bucket *meta.Bucket, obj * // if tiers is enabled, list all the backend using admin context bkndCtx := ctx - if bucket.Tiers != "" { + if bucket.Ssps != "" { bkndCtx = utils.GetAdminContext() } // incase get backend failed @@ -1202,8 +1202,8 @@ func (s *s3Service) ListObjects(ctx context.Context, in *pb.ListObjectsRequest, ObjectKey: obj.ObjectKey, } - if bucket.Tiers != "" { - object.Location = bucket.Tiers + if bucket.Ssps != "" { + object.Location = bucket.Ssps } object.StorageClass, _ = GetNameFromTier(obj.Tier, utils.OSTYPE_OPENSDS) diff --git a/s3/proto/s3.pb.go b/s3/proto/s3.pb.go index 985008aa7..293d4e99c 100644 --- a/s3/proto/s3.pb.go +++ b/s3/proto/s3.pb.go @@ -3518,7 +3518,7 @@ type Bucket struct { Usages int64 `protobuf:"varint,16,opt,name=usages,proto3" json:"usages,omitempty"` Tier int32 `protobuf:"varint,17,opt,name=tier,proto3" json:"tier,omitempty"` ReplicationInfo []*ReplicationInfo `protobuf:"bytes,18,rep,name=replicationInfo,proto3" json:"replicationInfo,omitempty"` - Tiers string `protobuf:"bytes,19,opt,name=tiers,proto3" json:"tiers,omitempty"` + Ssps string `protobuf:"bytes,19,opt,name=ssps,proto3" json:"ssps,omitempty"` } func (x *Bucket) Reset() { @@ -3681,7 +3681,7 @@ func (x *Bucket) GetReplicationInfo() []*ReplicationInfo { func (x *Bucket) GetTiers() string { if x != nil { - return x.Tiers + return x.Ssps } return "" } diff --git a/s3/proto/s3.proto b/s3/proto/s3.proto index 716c8ab8d..ec9e6d66f 100644 --- a/s3/proto/s3.proto +++ b/s3/proto/s3.proto @@ -476,7 +476,7 @@ message Bucket { int64 usages = 16; int32 tier = 17; repeated ReplicationInfo replicationInfo = 18; - string tiers = 19; + string ssps = 19; } message Partion { diff --git a/testutils/backend/collection/data.go b/testutils/backend/collection/data.go index 7e4cf7cfd..c5f6fab34 100644 --- a/testutils/backend/collection/data.go +++ b/testutils/backend/collection/data.go @@ -52,29 +52,29 @@ var ( }, } - ////tier samples - SampleTiers = []backendModel.Tier{ + ////ssp samples + SampleSsps = []backendModel.Ssp{ { Id: "4769855c-a102-11e7-b772-17b880d2f530", - TenantId: "sample-tier-tenantID", - Name: "sample-tier-name", - Backends: []string{"sample-tier-backend-1", "sample-tier-backend-2"}, + TenantId: "sample-ssp-tenantID", + Name: "sample-ssp-name", + Backends: []string{"sample-ssp-backend-1", "sample-ssp-backend-2"}, }, } - SampleCreateTier = []backendModel.Tier{ + SampleCreateSsp = []backendModel.Ssp{ { Id: "", - TenantId: "sample-tier-tenantID", - Name: "sample-tier-name", - Backends: []string{"sample-tier-backend-1", "sample-tier-backend-2"}, + TenantId: "sample-ssp-tenantID", + Name: "sample-ssp-name", + Backends: []string{"sample-ssp-backend-1", "sample-ssp-backend-2"}, }, } - SampleUpdateTier = []backendModel.Tier{ + SampleUpdateSsp = []backendModel.Ssp{ { Id: "4769855c-a102-11e7-b772-17b880d2f531", - TenantId: "tier-tenant", - Name: "tier-name", + TenantId: "ssp-tenant", + Name: "ssp-name", Backends: []string{"Backends"}, }, } diff --git a/testutils/backend/db/testing/repository.go b/testutils/backend/db/testing/repository.go index 494ede936..b78fd33a5 100644 --- a/testutils/backend/db/testing/repository.go +++ b/testutils/backend/db/testing/repository.go @@ -43,22 +43,22 @@ func (_m *Repository) CreateBackend(ctx context.Context, backend *model.Backend) return r0, r1 } -// CreateTier provides a mock function with given fields: ctx, tier -func (_m *Repository) CreateTier(ctx context.Context, tier *model.Tier) (*model.Tier, error) { - ret := _m.Called(ctx, tier) +// CreateSsp provides a mock function with given fields: ctx, ssp +func (_m *Repository) CreateSsp(ctx context.Context, ssp *model.Ssp) (*model.Ssp, error) { + ret := _m.Called(ctx, ssp) - var r0 *model.Tier - if rf, ok := ret.Get(0).(func(context.Context, *model.Tier) *model.Tier); ok { - r0 = rf(ctx, tier) + var r0 *model.Ssp + if rf, ok := ret.Get(0).(func(context.Context, *model.Ssp) *model.Ssp); ok { + r0 = rf(ctx, ssp) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.Tier) + r0 = ret.Get(0).(*model.Ssp) } } var r1 error - if rf, ok := ret.Get(1).(func(context.Context, *model.Tier) error); ok { - r1 = rf(ctx, tier) + if rf, ok := ret.Get(1).(func(context.Context, *model.Ssp) error); ok { + r1 = rf(ctx, ssp) } else { r1 = ret.Error(1) } @@ -80,8 +80,8 @@ func (_m *Repository) DeleteBackend(ctx context.Context, id string) error { return r0 } -// DeleteTier provides a mock function with given fields: ctx, id -func (_m *Repository) DeleteTier(ctx context.Context, id string) error { +// DeleteSsp provides a mock function with given fields: ctx, id +func (_m *Repository) DeleteSsp(ctx context.Context, id string) error { ret := _m.Called(ctx, id) var r0 error @@ -117,16 +117,16 @@ func (_m *Repository) GetBackend(ctx context.Context, id string) (*model.Backend return r0, r1 } -// GetTier provides a mock function with given fields: ctx, id -func (_m *Repository) GetTier(ctx context.Context, id string) (*model.Tier, error) { +// GetSsp provides a mock function with given fields: ctx, id +func (_m *Repository) GetSsp(ctx context.Context, id string) (*model.Ssp, error) { ret := _m.Called(ctx, id) - var r0 *model.Tier - if rf, ok := ret.Get(0).(func(context.Context, string) *model.Tier); ok { + var r0 *model.Ssp + if rf, ok := ret.Get(0).(func(context.Context, string) *model.Ssp); ok { r0 = rf(ctx, id) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.Tier) + r0 = ret.Get(0).(*model.Ssp) } } @@ -163,16 +163,16 @@ func (_m *Repository) ListBackend(ctx context.Context, limit int, offset int, qu return r0, r1 } -// ListTiers provides a mock function with given fields: ctx, limit, offset -func (_m *Repository) ListTiers(ctx context.Context, limit int, offset int, query interface{}) ([]*model.Tier, error) { +// ListSsps provides a mock function with given fields: ctx, limit, offset +func (_m *Repository) ListSsps(ctx context.Context, limit int, offset int, query interface{}) ([]*model.Ssp, error) { ret := _m.Called(ctx, limit, offset) - var r0 []*model.Tier - if rf, ok := ret.Get(0).(func(context.Context, int, int) []*model.Tier); ok { + var r0 []*model.Ssp + if rf, ok := ret.Get(0).(func(context.Context, int, int) []*model.Ssp); ok { r0 = rf(ctx, limit, offset) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).([]*model.Tier) + r0 = ret.Get(0).([]*model.Ssp) } } @@ -209,22 +209,22 @@ func (_m *Repository) UpdateBackend(ctx context.Context, backend *model.Backend) return r0, r1 } -// UpdateTier provides a mock function with given fields: ctx, tier -func (_m *Repository) UpdateTier(ctx context.Context, tier *model.Tier) (*model.Tier, error) { - ret := _m.Called(ctx, tier) +// UpdateSsp provides a mock function with given fields: ctx, ssp +func (_m *Repository) UpdateSsp(ctx context.Context, ssp *model.Ssp) (*model.Ssp, error) { + ret := _m.Called(ctx, ssp) - var r0 *model.Tier - if rf, ok := ret.Get(0).(func(context.Context, *model.Tier) *model.Tier); ok { - r0 = rf(ctx, tier) + var r0 *model.Ssp + if rf, ok := ret.Get(0).(func(context.Context, *model.Ssp) *model.Ssp); ok { + r0 = rf(ctx, ssp) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.Tier) + r0 = ret.Get(0).(*model.Ssp) } } var r1 error - if rf, ok := ret.Get(1).(func(context.Context, *model.Tier) error); ok { - r1 = rf(ctx, tier) + if rf, ok := ret.Get(1).(func(context.Context, *model.Ssp) error); ok { + r1 = rf(ctx, ssp) } else { r1 = ret.Error(1) } diff --git a/testutils/backend/proto/backend_service.go b/testutils/backend/proto/backend_service.go index d12eddb9b..c36241396 100644 --- a/testutils/backend/proto/backend_service.go +++ b/testutils/backend/proto/backend_service.go @@ -47,8 +47,8 @@ func (_m *BackendService) CreateBackend(ctx context.Context, in *proto.CreateBac return r0, r1 } -// CreateTier provides a mock function with given fields: ctx, in, opts -func (_m *BackendService) CreateTier(ctx context.Context, in *proto.CreateTierRequest, opts ...client.CallOption) (*proto.CreateTierResponse, error) { +// CreateSsp provides a mock function with given fields: ctx, in, opts +func (_m *BackendService) CreateSsp(ctx context.Context, in *proto.CreateSspRequest, opts ...client.CallOption) (*proto.CreateSspResponse, error) { _va := make([]interface{}, len(opts)) for _i := range opts { _va[_i] = opts[_i] @@ -58,17 +58,17 @@ func (_m *BackendService) CreateTier(ctx context.Context, in *proto.CreateTierRe _ca = append(_ca, _va...) ret := _m.Called(_ca...) - var r0 *proto.CreateTierResponse - if rf, ok := ret.Get(0).(func(context.Context, *proto.CreateTierRequest, ...client.CallOption) *proto.CreateTierResponse); ok { + var r0 *proto.CreateSspResponse + if rf, ok := ret.Get(0).(func(context.Context, *proto.CreateSspRequest, ...client.CallOption) *proto.CreateSspResponse); ok { r0 = rf(ctx, in, opts...) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*proto.CreateTierResponse) + r0 = ret.Get(0).(*proto.CreateSspResponse) } } var r1 error - if rf, ok := ret.Get(1).(func(context.Context, *proto.CreateTierRequest, ...client.CallOption) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *proto.CreateSspRequest, ...client.CallOption) error); ok { r1 = rf(ctx, in, opts...) } else { r1 = ret.Error(1) @@ -107,8 +107,8 @@ func (_m *BackendService) DeleteBackend(ctx context.Context, in *proto.DeleteBac return r0, r1 } -// DeleteTier provides a mock function with given fields: ctx, in, opts -func (_m *BackendService) DeleteTier(ctx context.Context, in *proto.DeleteTierRequest, opts ...client.CallOption) (*proto.DeleteTierResponse, error) { +// DeleteSsp provides a mock function with given fields: ctx, in, opts +func (_m *BackendService) DeleteSsp(ctx context.Context, in *proto.DeleteSspRequest, opts ...client.CallOption) (*proto.DeleteSspResponse, error) { _va := make([]interface{}, len(opts)) for _i := range opts { _va[_i] = opts[_i] @@ -118,17 +118,17 @@ func (_m *BackendService) DeleteTier(ctx context.Context, in *proto.DeleteTierRe _ca = append(_ca, _va...) ret := _m.Called(_ca...) - var r0 *proto.DeleteTierResponse - if rf, ok := ret.Get(0).(func(context.Context, *proto.DeleteTierRequest, ...client.CallOption) *proto.DeleteTierResponse); ok { + var r0 *proto.DeleteSspResponse + if rf, ok := ret.Get(0).(func(context.Context, *proto.DeleteSspRequest, ...client.CallOption) *proto.DeleteSspResponse); ok { r0 = rf(ctx, in, opts...) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*proto.DeleteTierResponse) + r0 = ret.Get(0).(*proto.DeleteSspResponse) } } var r1 error - if rf, ok := ret.Get(1).(func(context.Context, *proto.DeleteTierRequest, ...client.CallOption) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *proto.DeleteSspRequest, ...client.CallOption) error); ok { r1 = rf(ctx, in, opts...) } else { r1 = ret.Error(1) @@ -167,8 +167,8 @@ func (_m *BackendService) GetBackend(ctx context.Context, in *proto.GetBackendRe return r0, r1 } -// GetTier provides a mock function with given fields: ctx, in, opts -func (_m *BackendService) GetTier(ctx context.Context, in *proto.GetTierRequest, opts ...client.CallOption) (*proto.GetTierResponse, error) { +// GetSsp provides a mock function with given fields: ctx, in, opts +func (_m *BackendService) GetSsp(ctx context.Context, in *proto.GetSspRequest, opts ...client.CallOption) (*proto.GetSspResponse, error) { _va := make([]interface{}, len(opts)) for _i := range opts { _va[_i] = opts[_i] @@ -178,17 +178,17 @@ func (_m *BackendService) GetTier(ctx context.Context, in *proto.GetTierRequest, _ca = append(_ca, _va...) ret := _m.Called(_ca...) - var r0 *proto.GetTierResponse - if rf, ok := ret.Get(0).(func(context.Context, *proto.GetTierRequest, ...client.CallOption) *proto.GetTierResponse); ok { + var r0 *proto.GetSspResponse + if rf, ok := ret.Get(0).(func(context.Context, *proto.GetSspRequest, ...client.CallOption) *proto.GetSspResponse); ok { r0 = rf(ctx, in, opts...) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*proto.GetTierResponse) + r0 = ret.Get(0).(*proto.GetSspResponse) } } var r1 error - if rf, ok := ret.Get(1).(func(context.Context, *proto.GetTierRequest, ...client.CallOption) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *proto.GetSspRequest, ...client.CallOption) error); ok { r1 = rf(ctx, in, opts...) } else { r1 = ret.Error(1) @@ -227,8 +227,8 @@ func (_m *BackendService) ListBackend(ctx context.Context, in *proto.ListBackend return r0, r1 } -// ListTiers provides a mock function with given fields: ctx, in, opts -func (_m *BackendService) ListTiers(ctx context.Context, in *proto.ListTierRequest, opts ...client.CallOption) (*proto.ListTierResponse, error) { +// ListSsps provides a mock function with given fields: ctx, in, opts +func (_m *BackendService) ListSsps(ctx context.Context, in *proto.ListSspRequest, opts ...client.CallOption) (*proto.ListSspResponse, error) { _va := make([]interface{}, len(opts)) for _i := range opts { _va[_i] = opts[_i] @@ -238,17 +238,17 @@ func (_m *BackendService) ListTiers(ctx context.Context, in *proto.ListTierReque _ca = append(_ca, _va...) ret := _m.Called(_ca...) - var r0 *proto.ListTierResponse - if rf, ok := ret.Get(0).(func(context.Context, *proto.ListTierRequest, ...client.CallOption) *proto.ListTierResponse); ok { + var r0 *proto.ListSspResponse + if rf, ok := ret.Get(0).(func(context.Context, *proto.ListSspRequest, ...client.CallOption) *proto.ListSspResponse); ok { r0 = rf(ctx, in, opts...) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*proto.ListTierResponse) + r0 = ret.Get(0).(*proto.ListSspResponse) } } var r1 error - if rf, ok := ret.Get(1).(func(context.Context, *proto.ListTierRequest, ...client.CallOption) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *proto.ListSspRequest, ...client.CallOption) error); ok { r1 = rf(ctx, in, opts...) } else { r1 = ret.Error(1) @@ -317,8 +317,8 @@ func (_m *BackendService) UpdateBackend(ctx context.Context, in *proto.UpdateBac return r0, r1 } -// UpdateTier provides a mock function with given fields: ctx, in, opts -func (_m *BackendService) UpdateTier(ctx context.Context, in *proto.UpdateTierRequest, opts ...client.CallOption) (*proto.UpdateTierResponse, error) { +// UpdateSsp provides a mock function with given fields: ctx, in, opts +func (_m *BackendService) UpdateSsp(ctx context.Context, in *proto.UpdateSspRequest, opts ...client.CallOption) (*proto.UpdateSspResponse, error) { _va := make([]interface{}, len(opts)) for _i := range opts { _va[_i] = opts[_i] @@ -328,17 +328,17 @@ func (_m *BackendService) UpdateTier(ctx context.Context, in *proto.UpdateTierRe _ca = append(_ca, _va...) ret := _m.Called(_ca...) - var r0 *proto.UpdateTierResponse - if rf, ok := ret.Get(0).(func(context.Context, *proto.UpdateTierRequest, ...client.CallOption) *proto.UpdateTierResponse); ok { + var r0 *proto.UpdateSspResponse + if rf, ok := ret.Get(0).(func(context.Context, *proto.UpdateSspRequest, ...client.CallOption) *proto.UpdateSspResponse); ok { r0 = rf(ctx, in, opts...) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*proto.UpdateTierResponse) + r0 = ret.Get(0).(*proto.UpdateSspResponse) } } var r1 error - if rf, ok := ret.Get(1).(func(context.Context, *proto.UpdateTierRequest, ...client.CallOption) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *proto.UpdateSspRequest, ...client.CallOption) error); ok { r1 = rf(ctx, in, opts...) } else { r1 = ret.Error(1) @@ -347,3 +347,4 @@ func (_m *BackendService) UpdateTier(ctx context.Context, in *proto.UpdateTierRe return r0, r1 } +