v5.0.59: fix ALL ?endpoint= URLs in client.go (was missing GetInstanceStateRaw)

This commit is contained in:
“Naeel”
2026-07-01 14:31:20 +04:00
parent d2b9e91624
commit 45a722db29
3 changed files with 5 additions and 5 deletions
+3 -3
View File
@@ -507,7 +507,7 @@ func (c *UniversalClient) FindInstanceByDisplayName(ctx context.Context, service
if len(found) == 0 {
page := 1
for {
reqURL := fmt.Sprintf("%s/instances?page=%d&size=100", c.ApiEndpoint, page)
reqURL := fmt.Sprintf("%s?endpoint=/instances&page=%d&size=100", c.ApiEndpoint, page)
req, err := http.NewRequestWithContext(ctx, "GET", reqURL, nil)
if err != nil {
return nil, err
@@ -581,7 +581,7 @@ func (c *UniversalClient) FindInstanceByDisplayName(ctx context.Context, service
}
func (c *UniversalClient) GetInstanceState(ctx context.Context, instanceUid string) (*InstanceStateResponse, error) {
url := fmt.Sprintf("%s/instances/%s", c.ApiEndpoint, instanceUid)
url := fmt.Sprintf("%s?endpoint=/instances/%s", c.ApiEndpoint, instanceUid)
req, err := http.NewRequestWithContext(ctx, "GET", url, nil)
if err != nil {
return nil, err
@@ -627,7 +627,7 @@ func isInstanceDeleted(state *InstanceStateResponse) bool {
// GetInstanceStateRaw получает состояние инстанса БЕЗ валидации статуса.
// Используется для проверки ref-параметров: нужно читать даже deleted/suspended инстансы.
func (c *UniversalClient) GetInstanceStateRaw(ctx context.Context, instanceUid string) (*InstanceStateResponse, error) {
reqURL := fmt.Sprintf("%s/instances/%s", c.ApiEndpoint, instanceUid)
reqURL := fmt.Sprintf("%s?endpoint=/instances/%s", c.ApiEndpoint, instanceUid)
req, err := http.NewRequestWithContext(ctx, "GET", reqURL, nil)
if err != nil {
return nil, err
+1 -1
View File
@@ -10,7 +10,7 @@ import (
)
var (
version string = "5.0.58"
version string = "5.0.59"
)
func main() {