1. Packages
  2. Hcloud Provider
  3. API Docs
  4. getStorageBoxSnapshots
Hetzner Cloud v1.29.0 published on Saturday, Nov 29, 2025 by Pulumi
hcloud logo
Hetzner Cloud v1.29.0 published on Saturday, Nov 29, 2025 by Pulumi

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as hcloud from "@pulumi/hcloud";
    
    const config = new pulumi.Config();
    const storageBoxId = config.requireObject<any>("storageBoxId");
    const all = hcloud.getStorageBoxSnapshots({
        storageBoxId: storageBoxId,
    });
    const byLabelSelector = hcloud.getStorageBoxSnapshots({
        storageBoxId: storageBoxId,
        withSelector: "env=production",
    });
    
    import pulumi
    import pulumi_hcloud as hcloud
    
    config = pulumi.Config()
    storage_box_id = config.require_object("storageBoxId")
    all = hcloud.get_storage_box_snapshots(storage_box_id=storage_box_id)
    by_label_selector = hcloud.get_storage_box_snapshots(storage_box_id=storage_box_id,
        with_selector="env=production")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-hcloud/sdk/go/hcloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		cfg := config.New(ctx, "")
    		storageBoxId := cfg.RequireObject("storageBoxId")
    		_, err := hcloud.GetStorageBoxSnapshots(ctx, &hcloud.GetStorageBoxSnapshotsArgs{
    			StorageBoxId: storageBoxId,
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = hcloud.GetStorageBoxSnapshots(ctx, &hcloud.GetStorageBoxSnapshotsArgs{
    			StorageBoxId: storageBoxId,
    			WithSelector: pulumi.StringRef("env=production"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using HCloud = Pulumi.HCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var storageBoxId = config.RequireObject<dynamic>("storageBoxId");
        var all = HCloud.GetStorageBoxSnapshots.Invoke(new()
        {
            StorageBoxId = storageBoxId,
        });
    
        var byLabelSelector = HCloud.GetStorageBoxSnapshots.Invoke(new()
        {
            StorageBoxId = storageBoxId,
            WithSelector = "env=production",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.hcloud.HcloudFunctions;
    import com.pulumi.hcloud.inputs.GetStorageBoxSnapshotsArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var config = ctx.config();
            final var storageBoxId = config.get("storageBoxId");
            final var all = HcloudFunctions.getStorageBoxSnapshots(GetStorageBoxSnapshotsArgs.builder()
                .storageBoxId(storageBoxId)
                .build());
    
            final var byLabelSelector = HcloudFunctions.getStorageBoxSnapshots(GetStorageBoxSnapshotsArgs.builder()
                .storageBoxId(storageBoxId)
                .withSelector("env=production")
                .build());
    
        }
    }
    
    configuration:
      storageBoxId:
        type: dynamic
    variables:
      all:
        fn::invoke:
          function: hcloud:getStorageBoxSnapshots
          arguments:
            storageBoxId: ${storageBoxId}
      byLabelSelector:
        fn::invoke:
          function: hcloud:getStorageBoxSnapshots
          arguments:
            storageBoxId: ${storageBoxId}
            withSelector: env=production
    

    Using getStorageBoxSnapshots

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getStorageBoxSnapshots(args: GetStorageBoxSnapshotsArgs, opts?: InvokeOptions): Promise<GetStorageBoxSnapshotsResult>
    function getStorageBoxSnapshotsOutput(args: GetStorageBoxSnapshotsOutputArgs, opts?: InvokeOptions): Output<GetStorageBoxSnapshotsResult>
    def get_storage_box_snapshots(storage_box_id: Optional[int] = None,
                                  with_selector: Optional[str] = None,
                                  opts: Optional[InvokeOptions] = None) -> GetStorageBoxSnapshotsResult
    def get_storage_box_snapshots_output(storage_box_id: Optional[pulumi.Input[int]] = None,
                                  with_selector: Optional[pulumi.Input[str]] = None,
                                  opts: Optional[InvokeOptions] = None) -> Output[GetStorageBoxSnapshotsResult]
    func GetStorageBoxSnapshots(ctx *Context, args *GetStorageBoxSnapshotsArgs, opts ...InvokeOption) (*GetStorageBoxSnapshotsResult, error)
    func GetStorageBoxSnapshotsOutput(ctx *Context, args *GetStorageBoxSnapshotsOutputArgs, opts ...InvokeOption) GetStorageBoxSnapshotsResultOutput

    > Note: This function is named GetStorageBoxSnapshots in the Go SDK.

    public static class GetStorageBoxSnapshots 
    {
        public static Task<GetStorageBoxSnapshotsResult> InvokeAsync(GetStorageBoxSnapshotsArgs args, InvokeOptions? opts = null)
        public static Output<GetStorageBoxSnapshotsResult> Invoke(GetStorageBoxSnapshotsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetStorageBoxSnapshotsResult> getStorageBoxSnapshots(GetStorageBoxSnapshotsArgs args, InvokeOptions options)
    public static Output<GetStorageBoxSnapshotsResult> getStorageBoxSnapshots(GetStorageBoxSnapshotsArgs args, InvokeOptions options)
    
    fn::invoke:
      function: hcloud:index/getStorageBoxSnapshots:getStorageBoxSnapshots
      arguments:
        # arguments dictionary

    The following arguments are supported:

    StorageBoxId int
    ID of the Storage Box.
    WithSelector string
    Filter results using a Label Selector
    StorageBoxId int
    ID of the Storage Box.
    WithSelector string
    Filter results using a Label Selector
    storageBoxId Integer
    ID of the Storage Box.
    withSelector String
    Filter results using a Label Selector
    storageBoxId number
    ID of the Storage Box.
    withSelector string
    Filter results using a Label Selector
    storage_box_id int
    ID of the Storage Box.
    with_selector str
    Filter results using a Label Selector
    storageBoxId Number
    ID of the Storage Box.
    withSelector String
    Filter results using a Label Selector

    getStorageBoxSnapshots Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Snapshots List<Pulumi.HCloud.Outputs.GetStorageBoxSnapshotsSnapshot>
    StorageBoxId int
    ID of the Storage Box.
    WithSelector string
    Filter results using a Label Selector
    Id string
    The provider-assigned unique ID for this managed resource.
    Snapshots []GetStorageBoxSnapshotsSnapshot
    StorageBoxId int
    ID of the Storage Box.
    WithSelector string
    Filter results using a Label Selector
    id String
    The provider-assigned unique ID for this managed resource.
    snapshots List<GetStorageBoxSnapshotsSnapshot>
    storageBoxId Integer
    ID of the Storage Box.
    withSelector String
    Filter results using a Label Selector
    id string
    The provider-assigned unique ID for this managed resource.
    snapshots GetStorageBoxSnapshotsSnapshot[]
    storageBoxId number
    ID of the Storage Box.
    withSelector string
    Filter results using a Label Selector
    id str
    The provider-assigned unique ID for this managed resource.
    snapshots Sequence[GetStorageBoxSnapshotsSnapshot]
    storage_box_id int
    ID of the Storage Box.
    with_selector str
    Filter results using a Label Selector
    id String
    The provider-assigned unique ID for this managed resource.
    snapshots List<Property Map>
    storageBoxId Number
    ID of the Storage Box.
    withSelector String
    Filter results using a Label Selector

    Supporting Types

    GetStorageBoxSnapshotsSnapshot

    Description string
    Description of the Storage Box Snapshot.
    Id int
    ID of the Storage Box Snapshot.
    IsAutomatic bool
    Whether the Storage Box Snapshot was created automatically.
    Labels Dictionary<string, string>
    User-defined labels (key-value pairs) for the resource.
    Name string
    Name of the Storage Box Snapshot.
    Stats Pulumi.HCloud.Inputs.GetStorageBoxSnapshotsSnapshotStats
    Statistics of the Storage Box Snapshot.
    StorageBoxId int
    ID of the Storage Box.
    Description string
    Description of the Storage Box Snapshot.
    Id int
    ID of the Storage Box Snapshot.
    IsAutomatic bool
    Whether the Storage Box Snapshot was created automatically.
    Labels map[string]string
    User-defined labels (key-value pairs) for the resource.
    Name string
    Name of the Storage Box Snapshot.
    Stats GetStorageBoxSnapshotsSnapshotStats
    Statistics of the Storage Box Snapshot.
    StorageBoxId int
    ID of the Storage Box.
    description String
    Description of the Storage Box Snapshot.
    id Integer
    ID of the Storage Box Snapshot.
    isAutomatic Boolean
    Whether the Storage Box Snapshot was created automatically.
    labels Map<String,String>
    User-defined labels (key-value pairs) for the resource.
    name String
    Name of the Storage Box Snapshot.
    stats GetStorageBoxSnapshotsSnapshotStats
    Statistics of the Storage Box Snapshot.
    storageBoxId Integer
    ID of the Storage Box.
    description string
    Description of the Storage Box Snapshot.
    id number
    ID of the Storage Box Snapshot.
    isAutomatic boolean
    Whether the Storage Box Snapshot was created automatically.
    labels {[key: string]: string}
    User-defined labels (key-value pairs) for the resource.
    name string
    Name of the Storage Box Snapshot.
    stats GetStorageBoxSnapshotsSnapshotStats
    Statistics of the Storage Box Snapshot.
    storageBoxId number
    ID of the Storage Box.
    description str
    Description of the Storage Box Snapshot.
    id int
    ID of the Storage Box Snapshot.
    is_automatic bool
    Whether the Storage Box Snapshot was created automatically.
    labels Mapping[str, str]
    User-defined labels (key-value pairs) for the resource.
    name str
    Name of the Storage Box Snapshot.
    stats GetStorageBoxSnapshotsSnapshotStats
    Statistics of the Storage Box Snapshot.
    storage_box_id int
    ID of the Storage Box.
    description String
    Description of the Storage Box Snapshot.
    id Number
    ID of the Storage Box Snapshot.
    isAutomatic Boolean
    Whether the Storage Box Snapshot was created automatically.
    labels Map<String>
    User-defined labels (key-value pairs) for the resource.
    name String
    Name of the Storage Box Snapshot.
    stats Property Map
    Statistics of the Storage Box Snapshot.
    storageBoxId Number
    ID of the Storage Box.

    GetStorageBoxSnapshotsSnapshotStats

    Size int
    Current storage requirements of the Snapshot in bytes.
    SizeFilesystem int
    Size of the compressed file system contained in the Snapshot in bytes.
    Size int
    Current storage requirements of the Snapshot in bytes.
    SizeFilesystem int
    Size of the compressed file system contained in the Snapshot in bytes.
    size Integer
    Current storage requirements of the Snapshot in bytes.
    sizeFilesystem Integer
    Size of the compressed file system contained in the Snapshot in bytes.
    size number
    Current storage requirements of the Snapshot in bytes.
    sizeFilesystem number
    Size of the compressed file system contained in the Snapshot in bytes.
    size int
    Current storage requirements of the Snapshot in bytes.
    size_filesystem int
    Size of the compressed file system contained in the Snapshot in bytes.
    size Number
    Current storage requirements of the Snapshot in bytes.
    sizeFilesystem Number
    Size of the compressed file system contained in the Snapshot in bytes.

    Package Details

    Repository
    Hetzner Cloud pulumi/pulumi-hcloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the hcloud Terraform Provider.
    hcloud logo
    Hetzner Cloud v1.29.0 published on Saturday, Nov 29, 2025 by Pulumi
      Meet Neo: Your AI Platform Teammate