diff --git a/nodes.go b/nodes.go index f5e668c..751b7b8 100644 --- a/nodes.go +++ b/nodes.go @@ -172,6 +172,11 @@ func (n *Node) Storage(ctx context.Context, name string) (storage *Storage, err return } +func (n *Node) StorageDownloadURL(ctx context.Context, StorageDownloadURLOptions *StorageDownloadURLOptions) (ret string, err error) { + err = n.client.Post(ctx, fmt.Sprintf("/nodes/%s/storage/%s/download-url", n.Name, StorageDownloadURLOptions.Storage), StorageDownloadURLOptions, &ret) + return ret, err +} + func (n *Node) StorageISO(ctx context.Context) (*Storage, error) { return n.findStorageByContent(ctx, "iso") } diff --git a/types.go b/types.go index 80bc591..7bacc8c 100644 --- a/types.go +++ b/types.go @@ -1133,3 +1133,15 @@ type ACLOptions struct { Propagate IntOrBool `json:",omitempty"` Delete IntOrBool `json:",omitempty"` // true to delete the ACL } + +type StorageDownloadURLOptions struct { + Content string `json:"content,omitempty"` + Filename string `json:"filename,omitempty"` + Node string `json:"node,omitempty"` + Storage string `json:"storage,omitempty"` + URL string `json:"url,omitempty"` + Checksum string `json:"checksum,omitempty"` + ChecksumAlgorithm string `json:"checksum-algorithm,omitempty"` + Compression string `json:"compression,omitempty"` + VerifyCertificates IntOrBool `json:"verify-certificates,omitempty"` +}