Skip to content

Commit

Permalink
[fix] missing change the url
Browse files Browse the repository at this point in the history
  • Loading branch information
cuongpiger committed Oct 17, 2024
1 parent aee2a78 commit 9b1845c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions test/endpoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func TestListEndpointTags(t *ltesting.T) {

func TestCreateEndpointTags(t *ltesting.T) {
vngcloud := validSuperSdkConfig()
opt := lsnwv1.NewCreateTagsWithEndpointIdRequest("60108", "enp-7e8e4476-feeb-414c-ac03-3501aae607d0").
opt := lsnwv1.NewCreateTagsWithEndpointIdRequest("60108", "pro-88265bae-d2ef-424b-b8a7-9eeb08aec1f7", "enp-7e8e4476-feeb-414c-ac03-3501aae607d0").
AddTag("cuongdm3", "test")

sdkerr := vngcloud.VNetworkGateway().InternalV1().NetworkService().CreateTagsWithEndpointId(opt)
Expand All @@ -110,7 +110,7 @@ func TestCreateEndpointTags(t *ltesting.T) {

func TestDeleteTagByEndpointId(t *ltesting.T) {
vngcloud := validSuperSdkConfig()
opt := lsnwv1.NewDeleteTagOfEndpointRequest("60108", "tag-6ceb41e1-47e9-43f0-94dd-521a1af870ee")
opt := lsnwv1.NewDeleteTagOfEndpointRequest("60108", "pro-88265bae-d2ef-424b-b8a7-9eeb08aec1f7", "tag-6ceb41e1-47e9-43f0-94dd-521a1af870ee")

sdkerr := vngcloud.VNetworkGateway().InternalV1().NetworkService().DeleteTagOfEndpoint(opt)
if sdkerr != nil {
Expand All @@ -123,7 +123,7 @@ func TestDeleteTagByEndpointId(t *ltesting.T) {

func TestUpdateEndpointTag(t *ltesting.T) {
vngcloud := validSuperSdkConfig()
opt := lsnwv1.NewUpdateTagValueOfEndpointRequest("60108", "tag-c6d6e343-ed13-4bf1-bf2e-e63a1a5e0eab", "cuonghahahah")
opt := lsnwv1.NewUpdateTagValueOfEndpointRequest("60108", "pro-88265bae-d2ef-424b-b8a7-9eeb08aec1f7", "tag-c6d6e343-ed13-4bf1-bf2e-e63a1a5e0eab", "cuonghahahah")

sdkerr := vngcloud.VNetworkGateway().InternalV1().NetworkService().UpdateTagValueOfEndpoint(opt)
if sdkerr != nil {
Expand Down
2 changes: 1 addition & 1 deletion vngcloud/services/network/v1/endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func (s *NetworkServiceInternalV1) ListTagsByEndpointId(popts IListTagsByEndpoin
}

func (s *NetworkServiceInternalV1) CreateTagsWithEndpointId(popts ICreateTagsWithEndpointIdRequest) lserr.IError {
url := createTagsWithEndpointIdUrl(s.VNetworkClient)
url := createTagsWithEndpointIdUrl(s.VNetworkClient, popts)
errResp := lserr.NewErrorResponse(lserr.NetworkGatewayErrorType)
req := lsclient.NewRequest().
WithMapHeaders(popts.GetMapHeaders()).
Expand Down
8 changes: 4 additions & 4 deletions vngcloud/services/network/v1/url.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,22 +45,22 @@ func listTagsByEndpointIdUrl(psc lsclient.IServiceClient, popts IListTagsByEndpo
"tags") + query
}

func createTagsWithEndpointIdUrl(psc lsclient.IServiceClient) string {
func createTagsWithEndpointIdUrl(psc lsclient.IServiceClient, popts ICreateTagsWithEndpointIdRequest) string {
return psc.ServiceURL(
psc.GetProjectId(),
popts.GetProjectId(),
"tags")
}

func deleteTagOfEndpointUrl(psc lsclient.IServiceClient, popts IDeleteTagOfEndpointRequest) string {
return psc.ServiceURL(
psc.GetProjectId(),
popts.GetProjectId(),
"tags",
popts.GetTagId())
}

func updateTagValueOfEndpointUrl(psc lsclient.IServiceClient, popts IUpdateTagValueOfEndpointRequest) string {
return psc.ServiceURL(
psc.GetProjectId(),
popts.GetProjectId(),
"tags",
popts.GetTagId())
}

0 comments on commit 9b1845c

Please sign in to comment.