Skip to content

Commit

Permalink
feat: change the API name from rename to update
Browse files Browse the repository at this point in the history
  • Loading branch information
Meng-20 committed Oct 4, 2024
1 parent 3a5eb11 commit b3f2d72
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions api/cfm-openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,8 @@ paths:
schema:
$ref: "#/components/schemas/statusMessage"
put:
description: Rename an appliance by new id.
operationId: appliancesRenameById
description: Update an appliance with a new id.
operationId: appliancesUpdateById
parameters:
- $ref: "#/components/parameters/applianceId"
- name: newApplianceId
Expand Down Expand Up @@ -364,8 +364,8 @@ paths:
schema:
$ref: "#/components/schemas/statusMessage"
put:
description: Rename a blade by new id.
operationId: bladesRenameById
description: Update a blade with a new id.
operationId: bladesUpdateById
parameters:
- $ref: "#/components/parameters/applianceId"
- $ref: "#/components/parameters/bladeId"
Expand Down Expand Up @@ -880,8 +880,8 @@ paths:
schema:
$ref: "#/components/schemas/statusMessage"
put:
description: Rename a CXL host by new id.
operationId: hostsRenameById
description: Update a CXL host with a new id.
operationId: hostsUpdateById
parameters:
- $ref: "#/components/parameters/hostId"
- name: newHostId
Expand Down
12 changes: 6 additions & 6 deletions pkg/api/api_default_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ func (cfm *CfmApiService) AppliancesPost(ctx context.Context, credentials openap
return openapi.Response(http.StatusCreated, a), nil
}

// AppliancesRenameById -
func (cfm *CfmApiService) AppliancesRenameById(ctx context.Context, applianceId string, newApplianceId string) (openapi.ImplResponse, error) {
// AppliancesUpdateById -
func (cfm *CfmApiService) AppliancesUpdateById(ctx context.Context, applianceId string, newApplianceId string) (openapi.ImplResponse, error) {
// Make sure the newApplianceId doesn't exist
_, exist := manager.GetApplianceById(ctx, newApplianceId)
if exist == nil {
Expand Down Expand Up @@ -522,8 +522,8 @@ func (cfm *CfmApiService) BladesGetPorts(ctx context.Context, applianceId string
return openapi.Response(http.StatusOK, response), nil
}

// BladesRenameById -
func (cfm *CfmApiService) BladesRenameById(ctx context.Context, applianceId string, bladeId string, newBladeId string) (openapi.ImplResponse, error) {
// BladesUpdateById -
func (cfm *CfmApiService) BladesUpdateById(ctx context.Context, applianceId string, bladeId string, newBladeId string) (openapi.ImplResponse, error) {
appliance, err := manager.GetApplianceById(ctx, applianceId)
if err != nil {
return formatErrorResp(ctx, err.(*common.RequestError))
Expand Down Expand Up @@ -994,8 +994,8 @@ func (cfm *CfmApiService) HostsPost(ctx context.Context, credentials openapi.Cre
return openapi.Response(http.StatusCreated, h), nil
}

// HostsRenameById -
func (cfm *CfmApiService) HostsRenameById(ctx context.Context, hostId string, newHostId string) (openapi.ImplResponse, error) {
// HostsUpdateById -
func (cfm *CfmApiService) HostsUpdateById(ctx context.Context, hostId string, newHostId string) (openapi.ImplResponse, error) {
// Make sure the hostId exists
// Get the host information from the manager level and is used for renaming
host, err := manager.GetHostById(ctx, hostId)
Expand Down

0 comments on commit b3f2d72

Please sign in to comment.