Revert "get whole api path from config"

This reverts commit 392f5f4c5f.
This commit is contained in:
abhishek9686 2024-04-04 20:59:47 +05:30
parent 392f5f4c5f
commit 8dc872f6b1

View file

@ -39,7 +39,7 @@ func (e *EmqxCloud) CreateEmqxUser(username, pass string) error {
}
data, _ := json.Marshal(payload)
client := &http.Client{}
req, err := http.NewRequest(http.MethodPost, fmt.Sprintf("%s/auth_username", e.URL), strings.NewReader(string(data)))
req, err := http.NewRequest(http.MethodPost, fmt.Sprintf("%s/api/auth_username", e.URL), strings.NewReader(string(data)))
if err != nil {
return err
}
@ -69,7 +69,7 @@ func (e *EmqxCloud) CreateEmqxUserforServer() error {
}
data, _ := json.Marshal(payload)
client := &http.Client{}
req, err := http.NewRequest(http.MethodPost, fmt.Sprintf("%s/auth_username", e.URL), strings.NewReader(string(data)))
req, err := http.NewRequest(http.MethodPost, fmt.Sprintf("%s/api/auth_username", e.URL), strings.NewReader(string(data)))
if err != nil {
return err
}
@ -155,7 +155,7 @@ func (e *EmqxCloud) createacls(acls []cloudAcl) error {
return err
}
client := &http.Client{}
req, err := http.NewRequest(http.MethodPost, fmt.Sprintf("%s/acl", e.URL), strings.NewReader(string(payload)))
req, err := http.NewRequest(http.MethodPost, fmt.Sprintf("%s/api/acl", e.URL), strings.NewReader(string(payload)))
if err != nil {
return err
}
@ -246,7 +246,7 @@ func (e *EmqxCloud) GetUserACL(username string) (*aclObject, error) { return nil
func (e *EmqxCloud) DeleteEmqxUser(username string) error {
client := &http.Client{}
req, err := http.NewRequest(http.MethodDelete, fmt.Sprintf("%s/auth_username/%s", e.URL, username), nil)
req, err := http.NewRequest(http.MethodDelete, fmt.Sprintf("%s/api/auth_username/%s", e.URL, username), nil)
if err != nil {
return err
}