v5.0.59: fix ALL ?endpoint= URLs in client.go (was missing GetInstanceStateRaw)
This commit is contained in:
@@ -2,7 +2,7 @@ terraform {
|
|||||||
required_providers {
|
required_providers {
|
||||||
nubes = {
|
nubes = {
|
||||||
source = "terra.k8c.ru/nubes-test/nubes"
|
source = "terra.k8c.ru/nubes-test/nubes"
|
||||||
version = "5.0.58"
|
version = "5.0.59"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -507,7 +507,7 @@ func (c *UniversalClient) FindInstanceByDisplayName(ctx context.Context, service
|
|||||||
if len(found) == 0 {
|
if len(found) == 0 {
|
||||||
page := 1
|
page := 1
|
||||||
for {
|
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)
|
req, err := http.NewRequestWithContext(ctx, "GET", reqURL, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
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) {
|
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)
|
req, err := http.NewRequestWithContext(ctx, "GET", url, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@@ -627,7 +627,7 @@ func isInstanceDeleted(state *InstanceStateResponse) bool {
|
|||||||
// GetInstanceStateRaw получает состояние инстанса БЕЗ валидации статуса.
|
// GetInstanceStateRaw получает состояние инстанса БЕЗ валидации статуса.
|
||||||
// Используется для проверки ref-параметров: нужно читать даже deleted/suspended инстансы.
|
// Используется для проверки ref-параметров: нужно читать даже deleted/suspended инстансы.
|
||||||
func (c *UniversalClient) GetInstanceStateRaw(ctx context.Context, instanceUid string) (*InstanceStateResponse, error) {
|
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)
|
req, err := http.NewRequestWithContext(ctx, "GET", reqURL, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
version string = "5.0.58"
|
version string = "5.0.59"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|||||||
Reference in New Issue
Block a user