diff --git a/test/endpoint_test.go b/test/endpoint_test.go index 1ea212a..c1f3acc 100644 --- a/test/endpoint_test.go +++ b/test/endpoint_test.go @@ -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) @@ -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 { @@ -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 { diff --git a/vngcloud/services/network/v1/endpoint.go b/vngcloud/services/network/v1/endpoint.go index 7b5b4b8..cd6d2ab 100644 --- a/vngcloud/services/network/v1/endpoint.go +++ b/vngcloud/services/network/v1/endpoint.go @@ -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()). diff --git a/vngcloud/services/network/v1/url.go b/vngcloud/services/network/v1/url.go index b868383..6168c05 100644 --- a/vngcloud/services/network/v1/url.go +++ b/vngcloud/services/network/v1/url.go @@ -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()) }