0
0
mirror of https://github.com/bpg/terraform-provider-proxmox.git synced 2025-06-30 10:33:46 +00:00
terraform-provider-proxmox/proxmox/nodes/query_url_metadata.go
Pavel Boldyrev 268c861649
chore: improve acceptance tests on CI (#1173)
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-04-07 04:41:57 +00:00

35 lines
880 B
Go

/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package nodes
import (
"context"
"fmt"
"net/http"
"github.com/bpg/terraform-provider-proxmox/proxmox/api"
)
// GetQueryURLMetadata retrieves the URL filename details for a node.
func (c *Client) GetQueryURLMetadata(
ctx context.Context,
d *QueryURLMetadataGetRequestBody,
) (*QueryURLMetadataGetResponseData, error) {
resBody := &QueryURLMetadataGetResponseBody{}
err := c.DoRequest(ctx, http.MethodGet, c.ExpandPath("query-url-metadata"), d, resBody)
if err != nil {
return nil, fmt.Errorf("error retrieving URL metadata for %+v: %w", d.URL, err)
}
if resBody.Data == nil {
return nil, api.ErrNoDataObjectInResponse
}
return resBody.Data, nil
}