1. Packages
  2. Spectrocloud Provider
  3. API Docs
  4. getPack
spectrocloud 0.23.4 published on Monday, Apr 14, 2025 by spectrocloud

spectrocloud.getPack

Explore with Pulumi AI

spectrocloud logo
spectrocloud 0.23.4 published on Monday, Apr 14, 2025 by spectrocloud

    This data resource provides the ability to search for a pack in the Palette registries. It supports more advanced search criteria than the pack_simple data source.

    The existing filters attribute will be deprecated, and a new pack_filters attribute will be introduced for advanced search functionality.

    Example Usage

    An example of how to use this data source to retrieve a specific pack from the community registry.

    import * as pulumi from "@pulumi/pulumi";
    import * as spectrocloud from "@pulumi/spectrocloud";
    
    const communityRegistry = spectrocloud.getRegistry({
        name: "Palette Community Registry",
    });
    const hellouniverse = communityRegistry.then(communityRegistry => spectrocloud.getPack({
        name: "hello-universe",
        version: "1.1.2",
        registryUid: communityRegistry.id,
    }));
    
    import pulumi
    import pulumi_spectrocloud as spectrocloud
    
    community_registry = spectrocloud.get_registry(name="Palette Community Registry")
    hellouniverse = spectrocloud.get_pack(name="hello-universe",
        version="1.1.2",
        registry_uid=community_registry.id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/spectrocloud/spectrocloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		communityRegistry, err := spectrocloud.GetRegistry(ctx, &spectrocloud.GetRegistryArgs{
    			Name: "Palette Community Registry",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = spectrocloud.GetPack(ctx, &spectrocloud.GetPackArgs{
    			Name:        pulumi.StringRef("hello-universe"),
    			Version:     pulumi.StringRef("1.1.2"),
    			RegistryUid: pulumi.StringRef(communityRegistry.Id),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Spectrocloud = Pulumi.Spectrocloud;
    
    return await Deployment.RunAsync(() => 
    {
        var communityRegistry = Spectrocloud.GetRegistry.Invoke(new()
        {
            Name = "Palette Community Registry",
        });
    
        var hellouniverse = Spectrocloud.GetPack.Invoke(new()
        {
            Name = "hello-universe",
            Version = "1.1.2",
            RegistryUid = communityRegistry.Apply(getRegistryResult => getRegistryResult.Id),
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.spectrocloud.SpectrocloudFunctions;
    import com.pulumi.spectrocloud.inputs.GetRegistryArgs;
    import com.pulumi.spectrocloud.inputs.GetPackArgs;
    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 communityRegistry = SpectrocloudFunctions.getRegistry(GetRegistryArgs.builder()
                .name("Palette Community Registry")
                .build());
    
            final var hellouniverse = SpectrocloudFunctions.getPack(GetPackArgs.builder()
                .name("hello-universe")
                .version("1.1.2")
                .registryUid(communityRegistry.applyValue(getRegistryResult -> getRegistryResult.id()))
                .build());
    
        }
    }
    
    variables:
      communityRegistry:
        fn::invoke:
          function: spectrocloud:getRegistry
          arguments:
            name: Palette Community Registry
      hellouniverse:
        fn::invoke:
          function: spectrocloud:getPack
          arguments:
            name: hello-universe
            version: 1.1.2
            registryUid: ${communityRegistry.id}
    

    In this example, a filter is applied to retrieve a Calico CNI pack from the Palette OCI registry that is compatible with Edge clusters and has a version greater than 3.26.9.

    The filter attribute is a string that can contain multiple filters separated by the AND, OR operator. You can filter for a pack by using the attributes retured in the spec object of the payload provided by the v1/packs/search endpoint. Refer to the Palette Pack Search API endpoint documentation for more information on the available filters.

    import * as pulumi from "@pulumi/pulumi";
    import * as spectrocloud from "@pulumi/spectrocloud";
    
    const paletteRegistryOci = spectrocloud.getRegistry({
        name: "Palette Registry",
    });
    const cni = paletteRegistryOci.then(paletteRegistryOci => spectrocloud.getPack({
        filters: `spec.cloudTypes=edge-nativeANDspec.layer=cniANDspec.displayName=CalicoANDspec.version>3.26.9ANDspec.registryUid=${paletteRegistryOci.id}`,
    }));
    
    import pulumi
    import pulumi_spectrocloud as spectrocloud
    
    palette_registry_oci = spectrocloud.get_registry(name="Palette Registry")
    cni = spectrocloud.get_pack(filters=f"spec.cloudTypes=edge-nativeANDspec.layer=cniANDspec.displayName=CalicoANDspec.version>3.26.9ANDspec.registryUid={palette_registry_oci.id}")
    
    package main
    
    import (
    	"fmt"
    
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/spectrocloud/spectrocloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		paletteRegistryOci, err := spectrocloud.GetRegistry(ctx, &spectrocloud.GetRegistryArgs{
    			Name: "Palette Registry",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = spectrocloud.GetPack(ctx, &spectrocloud.GetPackArgs{
    			Filters: pulumi.StringRef(fmt.Sprintf("spec.cloudTypes=edge-nativeANDspec.layer=cniANDspec.displayName=CalicoANDspec.version>3.26.9ANDspec.registryUid=%v", paletteRegistryOci.Id)),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Spectrocloud = Pulumi.Spectrocloud;
    
    return await Deployment.RunAsync(() => 
    {
        var paletteRegistryOci = Spectrocloud.GetRegistry.Invoke(new()
        {
            Name = "Palette Registry",
        });
    
        var cni = Spectrocloud.GetPack.Invoke(new()
        {
            Filters = $"spec.cloudTypes=edge-nativeANDspec.layer=cniANDspec.displayName=CalicoANDspec.version>3.26.9ANDspec.registryUid={paletteRegistryOci.Apply(getRegistryResult => getRegistryResult.Id)}",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.spectrocloud.SpectrocloudFunctions;
    import com.pulumi.spectrocloud.inputs.GetRegistryArgs;
    import com.pulumi.spectrocloud.inputs.GetPackArgs;
    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 paletteRegistryOci = SpectrocloudFunctions.getRegistry(GetRegistryArgs.builder()
                .name("Palette Registry")
                .build());
    
            final var cni = SpectrocloudFunctions.getPack(GetPackArgs.builder()
                .filters(String.format("spec.cloudTypes=edge-nativeANDspec.layer=cniANDspec.displayName=CalicoANDspec.version>3.26.9ANDspec.registryUid=%s", paletteRegistryOci.applyValue(getRegistryResult -> getRegistryResult.id())))
                .build());
    
        }
    }
    
    variables:
      paletteRegistryOci:
        fn::invoke:
          function: spectrocloud:getRegistry
          arguments:
            name: Palette Registry
      cni:
        fn::invoke:
          function: spectrocloud:getPack
          arguments:
            filters: spec.cloudTypes=edge-nativeANDspec.layer=cniANDspec.displayName=CalicoANDspec.version>3.26.9ANDspec.registryUid=${paletteRegistryOci.id}
    

    Using getPack

    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 getPack(args: GetPackArgs, opts?: InvokeOptions): Promise<GetPackResult>
    function getPackOutput(args: GetPackOutputArgs, opts?: InvokeOptions): Output<GetPackResult>
    def get_pack(clouds: Optional[Sequence[str]] = None,
                 filters: Optional[str] = None,
                 id: Optional[str] = None,
                 name: Optional[str] = None,
                 registry_uid: Optional[str] = None,
                 type: Optional[str] = None,
                 version: Optional[str] = None,
                 opts: Optional[InvokeOptions] = None) -> GetPackResult
    def get_pack_output(clouds: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                 filters: Optional[pulumi.Input[str]] = None,
                 id: Optional[pulumi.Input[str]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 registry_uid: Optional[pulumi.Input[str]] = None,
                 type: Optional[pulumi.Input[str]] = None,
                 version: Optional[pulumi.Input[str]] = None,
                 opts: Optional[InvokeOptions] = None) -> Output[GetPackResult]
    func GetPack(ctx *Context, args *GetPackArgs, opts ...InvokeOption) (*GetPackResult, error)
    func GetPackOutput(ctx *Context, args *GetPackOutputArgs, opts ...InvokeOption) GetPackResultOutput

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

    public static class GetPack 
    {
        public static Task<GetPackResult> InvokeAsync(GetPackArgs args, InvokeOptions? opts = null)
        public static Output<GetPackResult> Invoke(GetPackInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetPackResult> getPack(GetPackArgs args, InvokeOptions options)
    public static Output<GetPackResult> getPack(GetPackArgs args, InvokeOptions options)
    
    fn::invoke:
      function: spectrocloud:index/getPack:getPack
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Clouds List<string>
    Filter results by cloud type. If not provided, all cloud types are returned.
    Filters string
    Filters to apply when searching for a pack. This is a string of the form 'key1=value1' with 'AND', 'OR` operators. Refer to the Palette API pack search API endpoint documentation for filter examples..
    Id string
    The UID of the pack returned.
    Name string
    The name of the pack to search for.
    RegistryUid string
    The unique identifier (UID) of the registry where the pack is located. Specify registry_uid to search within a specific registry.
    Type string
    The type of pack to search for. Supported values are helm, manifest, container, operator-instance.
    Version string
    Specify the version of the pack to search for. If not set, the latest available version from the specified registry will be used.
    Clouds []string
    Filter results by cloud type. If not provided, all cloud types are returned.
    Filters string
    Filters to apply when searching for a pack. This is a string of the form 'key1=value1' with 'AND', 'OR` operators. Refer to the Palette API pack search API endpoint documentation for filter examples..
    Id string
    The UID of the pack returned.
    Name string
    The name of the pack to search for.
    RegistryUid string
    The unique identifier (UID) of the registry where the pack is located. Specify registry_uid to search within a specific registry.
    Type string
    The type of pack to search for. Supported values are helm, manifest, container, operator-instance.
    Version string
    Specify the version of the pack to search for. If not set, the latest available version from the specified registry will be used.
    clouds List<String>
    Filter results by cloud type. If not provided, all cloud types are returned.
    filters String
    Filters to apply when searching for a pack. This is a string of the form 'key1=value1' with 'AND', 'OR` operators. Refer to the Palette API pack search API endpoint documentation for filter examples..
    id String
    The UID of the pack returned.
    name String
    The name of the pack to search for.
    registryUid String
    The unique identifier (UID) of the registry where the pack is located. Specify registry_uid to search within a specific registry.
    type String
    The type of pack to search for. Supported values are helm, manifest, container, operator-instance.
    version String
    Specify the version of the pack to search for. If not set, the latest available version from the specified registry will be used.
    clouds string[]
    Filter results by cloud type. If not provided, all cloud types are returned.
    filters string
    Filters to apply when searching for a pack. This is a string of the form 'key1=value1' with 'AND', 'OR` operators. Refer to the Palette API pack search API endpoint documentation for filter examples..
    id string
    The UID of the pack returned.
    name string
    The name of the pack to search for.
    registryUid string
    The unique identifier (UID) of the registry where the pack is located. Specify registry_uid to search within a specific registry.
    type string
    The type of pack to search for. Supported values are helm, manifest, container, operator-instance.
    version string
    Specify the version of the pack to search for. If not set, the latest available version from the specified registry will be used.
    clouds Sequence[str]
    Filter results by cloud type. If not provided, all cloud types are returned.
    filters str
    Filters to apply when searching for a pack. This is a string of the form 'key1=value1' with 'AND', 'OR` operators. Refer to the Palette API pack search API endpoint documentation for filter examples..
    id str
    The UID of the pack returned.
    name str
    The name of the pack to search for.
    registry_uid str
    The unique identifier (UID) of the registry where the pack is located. Specify registry_uid to search within a specific registry.
    type str
    The type of pack to search for. Supported values are helm, manifest, container, operator-instance.
    version str
    Specify the version of the pack to search for. If not set, the latest available version from the specified registry will be used.
    clouds List<String>
    Filter results by cloud type. If not provided, all cloud types are returned.
    filters String
    Filters to apply when searching for a pack. This is a string of the form 'key1=value1' with 'AND', 'OR` operators. Refer to the Palette API pack search API endpoint documentation for filter examples..
    id String
    The UID of the pack returned.
    name String
    The name of the pack to search for.
    registryUid String
    The unique identifier (UID) of the registry where the pack is located. Specify registry_uid to search within a specific registry.
    type String
    The type of pack to search for. Supported values are helm, manifest, container, operator-instance.
    version String
    Specify the version of the pack to search for. If not set, the latest available version from the specified registry will be used.

    getPack Result

    The following output properties are available:

    Clouds List<string>
    Filter results by cloud type. If not provided, all cloud types are returned.
    Id string
    The UID of the pack returned.
    Name string
    The name of the pack to search for.
    RegistryUid string
    The unique identifier (UID) of the registry where the pack is located. Specify registry_uid to search within a specific registry.
    Type string
    The type of pack to search for. Supported values are helm, manifest, container, operator-instance.
    Values string
    The YAML values of the pack returned as string.
    Version string
    Specify the version of the pack to search for. If not set, the latest available version from the specified registry will be used.
    Filters string
    Filters to apply when searching for a pack. This is a string of the form 'key1=value1' with 'AND', 'OR` operators. Refer to the Palette API pack search API endpoint documentation for filter examples..
    Clouds []string
    Filter results by cloud type. If not provided, all cloud types are returned.
    Id string
    The UID of the pack returned.
    Name string
    The name of the pack to search for.
    RegistryUid string
    The unique identifier (UID) of the registry where the pack is located. Specify registry_uid to search within a specific registry.
    Type string
    The type of pack to search for. Supported values are helm, manifest, container, operator-instance.
    Values string
    The YAML values of the pack returned as string.
    Version string
    Specify the version of the pack to search for. If not set, the latest available version from the specified registry will be used.
    Filters string
    Filters to apply when searching for a pack. This is a string of the form 'key1=value1' with 'AND', 'OR` operators. Refer to the Palette API pack search API endpoint documentation for filter examples..
    clouds List<String>
    Filter results by cloud type. If not provided, all cloud types are returned.
    id String
    The UID of the pack returned.
    name String
    The name of the pack to search for.
    registryUid String
    The unique identifier (UID) of the registry where the pack is located. Specify registry_uid to search within a specific registry.
    type String
    The type of pack to search for. Supported values are helm, manifest, container, operator-instance.
    values String
    The YAML values of the pack returned as string.
    version String
    Specify the version of the pack to search for. If not set, the latest available version from the specified registry will be used.
    filters String
    Filters to apply when searching for a pack. This is a string of the form 'key1=value1' with 'AND', 'OR` operators. Refer to the Palette API pack search API endpoint documentation for filter examples..
    clouds string[]
    Filter results by cloud type. If not provided, all cloud types are returned.
    id string
    The UID of the pack returned.
    name string
    The name of the pack to search for.
    registryUid string
    The unique identifier (UID) of the registry where the pack is located. Specify registry_uid to search within a specific registry.
    type string
    The type of pack to search for. Supported values are helm, manifest, container, operator-instance.
    values string
    The YAML values of the pack returned as string.
    version string
    Specify the version of the pack to search for. If not set, the latest available version from the specified registry will be used.
    filters string
    Filters to apply when searching for a pack. This is a string of the form 'key1=value1' with 'AND', 'OR` operators. Refer to the Palette API pack search API endpoint documentation for filter examples..
    clouds Sequence[str]
    Filter results by cloud type. If not provided, all cloud types are returned.
    id str
    The UID of the pack returned.
    name str
    The name of the pack to search for.
    registry_uid str
    The unique identifier (UID) of the registry where the pack is located. Specify registry_uid to search within a specific registry.
    type str
    The type of pack to search for. Supported values are helm, manifest, container, operator-instance.
    values str
    The YAML values of the pack returned as string.
    version str
    Specify the version of the pack to search for. If not set, the latest available version from the specified registry will be used.
    filters str
    Filters to apply when searching for a pack. This is a string of the form 'key1=value1' with 'AND', 'OR` operators. Refer to the Palette API pack search API endpoint documentation for filter examples..
    clouds List<String>
    Filter results by cloud type. If not provided, all cloud types are returned.
    id String
    The UID of the pack returned.
    name String
    The name of the pack to search for.
    registryUid String
    The unique identifier (UID) of the registry where the pack is located. Specify registry_uid to search within a specific registry.
    type String
    The type of pack to search for. Supported values are helm, manifest, container, operator-instance.
    values String
    The YAML values of the pack returned as string.
    version String
    Specify the version of the pack to search for. If not set, the latest available version from the specified registry will be used.
    filters String
    Filters to apply when searching for a pack. This is a string of the form 'key1=value1' with 'AND', 'OR` operators. Refer to the Palette API pack search API endpoint documentation for filter examples..

    Package Details

    Repository
    spectrocloud spectrocloud/terraform-provider-spectrocloud
    License
    Notes
    This Pulumi package is based on the spectrocloud Terraform Provider.
    spectrocloud logo
    spectrocloud 0.23.4 published on Monday, Apr 14, 2025 by spectrocloud