1. Packages
  2. Vcd Provider
  3. API Docs
  4. getCatalogMedia
vcd 3.14.1 published on Monday, Apr 14, 2025 by vmware

vcd.getCatalogMedia

Explore with Pulumi AI

vcd logo
vcd 3.14.1 published on Monday, Apr 14, 2025 by vmware

    Provides a VMware Cloud Director Catalog media data source. A Catalog media can be used to reference a catalog media and use its data within other resources or data sources.

    Supported in provider v2.5+

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as vcd from "@pulumi/vcd";
    
    const my_catalog = vcd.getCatalog({
        org: "my-org",
        name: "my-catalog",
    });
    const existing_media = my_catalog.then(my_catalog => vcd.getCatalogMedia({
        org: "my-org",
        catalogId: my_catalog.id,
        name: "my-media",
    }));
    export const mediaSize = existing_media.then(existing_media => existing_media.size);
    export const typeIsIso = existing_media.then(existing_media => existing_media.isIso);
    
    import pulumi
    import pulumi_vcd as vcd
    
    my_catalog = vcd.get_catalog(org="my-org",
        name="my-catalog")
    existing_media = vcd.get_catalog_media(org="my-org",
        catalog_id=my_catalog.id,
        name="my-media")
    pulumi.export("mediaSize", existing_media.size)
    pulumi.export("typeIsIso", existing_media.is_iso)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/vcd/v3/vcd"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		my_catalog, err := vcd.LookupCatalog(ctx, &vcd.LookupCatalogArgs{
    			Org:  pulumi.StringRef("my-org"),
    			Name: pulumi.StringRef("my-catalog"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		existing_media, err := vcd.LookupCatalogMedia(ctx, &vcd.LookupCatalogMediaArgs{
    			Org:       pulumi.StringRef("my-org"),
    			CatalogId: pulumi.StringRef(my_catalog.Id),
    			Name:      pulumi.StringRef("my-media"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("mediaSize", existing_media.Size)
    		ctx.Export("typeIsIso", existing_media.IsIso)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Vcd = Pulumi.Vcd;
    
    return await Deployment.RunAsync(() => 
    {
        var my_catalog = Vcd.GetCatalog.Invoke(new()
        {
            Org = "my-org",
            Name = "my-catalog",
        });
    
        var existing_media = Vcd.GetCatalogMedia.Invoke(new()
        {
            Org = "my-org",
            CatalogId = my_catalog.Apply(getCatalogResult => getCatalogResult.Id),
            Name = "my-media",
        });
    
        return new Dictionary<string, object?>
        {
            ["mediaSize"] = existing_media.Apply(existing_media => existing_media.Apply(getCatalogMediaResult => getCatalogMediaResult.Size)),
            ["typeIsIso"] = existing_media.Apply(existing_media => existing_media.Apply(getCatalogMediaResult => getCatalogMediaResult.IsIso)),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.vcd.VcdFunctions;
    import com.pulumi.vcd.inputs.GetCatalogArgs;
    import com.pulumi.vcd.inputs.GetCatalogMediaArgs;
    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 my-catalog = VcdFunctions.getCatalog(GetCatalogArgs.builder()
                .org("my-org")
                .name("my-catalog")
                .build());
    
            final var existing-media = VcdFunctions.getCatalogMedia(GetCatalogMediaArgs.builder()
                .org("my-org")
                .catalogId(my_catalog.id())
                .name("my-media")
                .build());
    
            ctx.export("mediaSize", existing_media.size());
            ctx.export("typeIsIso", existing_media.isIso());
        }
    }
    
    variables:
      my-catalog:
        fn::invoke:
          function: vcd:getCatalog
          arguments:
            org: my-org
            name: my-catalog
      existing-media:
        fn::invoke:
          function: vcd:getCatalogMedia
          arguments:
            org: my-org
            catalogId: ${["my-catalog"].id}
            name: my-media
    outputs:
      mediaSize: ${["existing-media"].size}
      typeIsIso: ${["existing-media"].isIso}
    

    Filter arguments

    (Supported in provider v2.9+)

    • name_regex - (Optional) matches the name using a regular expression.
    • date - (Optional) is an expression starting with an operator (>, <, >=, <=, ==), followed by a date, with optional spaces in between. For example: > 2020-02-01 12:35:00.523Z The filter recognizes several formats, but one of yyyy-mm-dd [hh:mm[:ss[.nnnZ]]] or dd-MMM-yyyy [hh:mm[:ss[.nnnZ]]] is recommended. Comparison with equality operator (==) need to define the date to the microseconds.
    • latest - (Optional) If true, retrieve the latest item among the ones matching other parameters. If no other parameters are set, it retrieves the newest item.
    • earliest - (Optional) If true, retrieve the earliest item among the ones matching other parameters. If no other parameters are set, it retrieves the oldest item.
    • metadata - (Optional) One or more parameters that will match metadata contents.

    See Filters reference for details and examples.

    Using getCatalogMedia

    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 getCatalogMedia(args: GetCatalogMediaArgs, opts?: InvokeOptions): Promise<GetCatalogMediaResult>
    function getCatalogMediaOutput(args: GetCatalogMediaOutputArgs, opts?: InvokeOptions): Output<GetCatalogMediaResult>
    def get_catalog_media(catalog: Optional[str] = None,
                          catalog_id: Optional[str] = None,
                          download_to_file: Optional[str] = None,
                          filter: Optional[GetCatalogMediaFilter] = None,
                          id: Optional[str] = None,
                          name: Optional[str] = None,
                          org: Optional[str] = None,
                          opts: Optional[InvokeOptions] = None) -> GetCatalogMediaResult
    def get_catalog_media_output(catalog: Optional[pulumi.Input[str]] = None,
                          catalog_id: Optional[pulumi.Input[str]] = None,
                          download_to_file: Optional[pulumi.Input[str]] = None,
                          filter: Optional[pulumi.Input[GetCatalogMediaFilterArgs]] = None,
                          id: Optional[pulumi.Input[str]] = None,
                          name: Optional[pulumi.Input[str]] = None,
                          org: Optional[pulumi.Input[str]] = None,
                          opts: Optional[InvokeOptions] = None) -> Output[GetCatalogMediaResult]
    func LookupCatalogMedia(ctx *Context, args *LookupCatalogMediaArgs, opts ...InvokeOption) (*LookupCatalogMediaResult, error)
    func LookupCatalogMediaOutput(ctx *Context, args *LookupCatalogMediaOutputArgs, opts ...InvokeOption) LookupCatalogMediaResultOutput

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

    public static class GetCatalogMedia 
    {
        public static Task<GetCatalogMediaResult> InvokeAsync(GetCatalogMediaArgs args, InvokeOptions? opts = null)
        public static Output<GetCatalogMediaResult> Invoke(GetCatalogMediaInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetCatalogMediaResult> getCatalogMedia(GetCatalogMediaArgs args, InvokeOptions options)
    public static Output<GetCatalogMediaResult> getCatalogMedia(GetCatalogMediaArgs args, InvokeOptions options)
    
    fn::invoke:
      function: vcd:index/getCatalogMedia:getCatalogMedia
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Catalog string
    The name of the catalog to which media file belongs. It's mandatory if catalog_id is not used.

    Deprecated: Deprecated

    CatalogId string
    The ID of the catalog to which the media file belongs. It's mandatory if catalog field is not used.
    DownloadToFile string
    Filter GetCatalogMediaFilter
    Retrieves the data source using one or more filter parameters
    Id string
    Name string
    Media name in catalog (optional when filter is used)
    Org string
    The name of organization to use, optional if defined at provider level
    Catalog string
    The name of the catalog to which media file belongs. It's mandatory if catalog_id is not used.

    Deprecated: Deprecated

    CatalogId string
    The ID of the catalog to which the media file belongs. It's mandatory if catalog field is not used.
    DownloadToFile string
    Filter GetCatalogMediaFilter
    Retrieves the data source using one or more filter parameters
    Id string
    Name string
    Media name in catalog (optional when filter is used)
    Org string
    The name of organization to use, optional if defined at provider level
    catalog String
    The name of the catalog to which media file belongs. It's mandatory if catalog_id is not used.

    Deprecated: Deprecated

    catalogId String
    The ID of the catalog to which the media file belongs. It's mandatory if catalog field is not used.
    downloadToFile String
    filter GetCatalogMediaFilter
    Retrieves the data source using one or more filter parameters
    id String
    name String
    Media name in catalog (optional when filter is used)
    org String
    The name of organization to use, optional if defined at provider level
    catalog string
    The name of the catalog to which media file belongs. It's mandatory if catalog_id is not used.

    Deprecated: Deprecated

    catalogId string
    The ID of the catalog to which the media file belongs. It's mandatory if catalog field is not used.
    downloadToFile string
    filter GetCatalogMediaFilter
    Retrieves the data source using one or more filter parameters
    id string
    name string
    Media name in catalog (optional when filter is used)
    org string
    The name of organization to use, optional if defined at provider level
    catalog str
    The name of the catalog to which media file belongs. It's mandatory if catalog_id is not used.

    Deprecated: Deprecated

    catalog_id str
    The ID of the catalog to which the media file belongs. It's mandatory if catalog field is not used.
    download_to_file str
    filter GetCatalogMediaFilter
    Retrieves the data source using one or more filter parameters
    id str
    name str
    Media name in catalog (optional when filter is used)
    org str
    The name of organization to use, optional if defined at provider level
    catalog String
    The name of the catalog to which media file belongs. It's mandatory if catalog_id is not used.

    Deprecated: Deprecated

    catalogId String
    The ID of the catalog to which the media file belongs. It's mandatory if catalog field is not used.
    downloadToFile String
    filter Property Map
    Retrieves the data source using one or more filter parameters
    id String
    name String
    Media name in catalog (optional when filter is used)
    org String
    The name of organization to use, optional if defined at provider level

    getCatalogMedia Result

    The following output properties are available:

    Catalog string

    Deprecated: Deprecated

    CatalogItemId string
    CreationDate string
    Description string
    Id string
    IsIso bool
    IsPublished bool
    Metadata Dictionary<string, string>

    Deprecated: Deprecated

    MetadataEntries List<GetCatalogMediaMetadataEntry>
    OwnerName string
    Size double
    Status string
    StorageProfileName string
    CatalogId string
    DownloadToFile string
    Filter GetCatalogMediaFilter
    Name string
    Org string
    Catalog string

    Deprecated: Deprecated

    CatalogItemId string
    CreationDate string
    Description string
    Id string
    IsIso bool
    IsPublished bool
    Metadata map[string]string

    Deprecated: Deprecated

    MetadataEntries []GetCatalogMediaMetadataEntry
    OwnerName string
    Size float64
    Status string
    StorageProfileName string
    CatalogId string
    DownloadToFile string
    Filter GetCatalogMediaFilter
    Name string
    Org string
    catalog String

    Deprecated: Deprecated

    catalogItemId String
    creationDate String
    description String
    id String
    isIso Boolean
    isPublished Boolean
    metadata Map<String,String>

    Deprecated: Deprecated

    metadataEntries List<GetCatalogMediaMetadataEntry>
    ownerName String
    size Double
    status String
    storageProfileName String
    catalogId String
    downloadToFile String
    filter GetCatalogMediaFilter
    name String
    org String
    catalog string

    Deprecated: Deprecated

    catalogItemId string
    creationDate string
    description string
    id string
    isIso boolean
    isPublished boolean
    metadata {[key: string]: string}

    Deprecated: Deprecated

    metadataEntries GetCatalogMediaMetadataEntry[]
    ownerName string
    size number
    status string
    storageProfileName string
    catalogId string
    downloadToFile string
    filter GetCatalogMediaFilter
    name string
    org string
    catalog String

    Deprecated: Deprecated

    catalogItemId String
    creationDate String
    description String
    id String
    isIso Boolean
    isPublished Boolean
    metadata Map<String>

    Deprecated: Deprecated

    metadataEntries List<Property Map>
    ownerName String
    size Number
    status String
    storageProfileName String
    catalogId String
    downloadToFile String
    filter Property Map
    name String
    org String

    Supporting Types

    GetCatalogMediaFilter

    Date string
    Search by date comparison ({>|>=|<|<=|==} yyyy-mm-dd[ hh[:mm[:ss]]])
    Earliest bool
    Retrieves the oldest item
    Latest bool
    Retrieves the newest item
    Metadatas List<GetCatalogMediaFilterMetadata>
    metadata filter
    NameRegex string
    Search by name with a regular expression
    Date string
    Search by date comparison ({>|>=|<|<=|==} yyyy-mm-dd[ hh[:mm[:ss]]])
    Earliest bool
    Retrieves the oldest item
    Latest bool
    Retrieves the newest item
    Metadatas []GetCatalogMediaFilterMetadata
    metadata filter
    NameRegex string
    Search by name with a regular expression
    date String
    Search by date comparison ({>|>=|<|<=|==} yyyy-mm-dd[ hh[:mm[:ss]]])
    earliest Boolean
    Retrieves the oldest item
    latest Boolean
    Retrieves the newest item
    metadatas List<GetCatalogMediaFilterMetadata>
    metadata filter
    nameRegex String
    Search by name with a regular expression
    date string
    Search by date comparison ({>|>=|<|<=|==} yyyy-mm-dd[ hh[:mm[:ss]]])
    earliest boolean
    Retrieves the oldest item
    latest boolean
    Retrieves the newest item
    metadatas GetCatalogMediaFilterMetadata[]
    metadata filter
    nameRegex string
    Search by name with a regular expression
    date str
    Search by date comparison ({>|>=|<|<=|==} yyyy-mm-dd[ hh[:mm[:ss]]])
    earliest bool
    Retrieves the oldest item
    latest bool
    Retrieves the newest item
    metadatas Sequence[GetCatalogMediaFilterMetadata]
    metadata filter
    name_regex str
    Search by name with a regular expression
    date String
    Search by date comparison ({>|>=|<|<=|==} yyyy-mm-dd[ hh[:mm[:ss]]])
    earliest Boolean
    Retrieves the oldest item
    latest Boolean
    Retrieves the newest item
    metadatas List<Property Map>
    metadata filter
    nameRegex String
    Search by name with a regular expression

    GetCatalogMediaFilterMetadata

    Key string
    Metadata key (field name)
    Value string
    Metadata value (can be a regular expression if "use_api_search" is false)
    IsSystem bool
    True if is a metadata@SYSTEM key
    Type string
    Type of metadata value (needed only if "use_api_search" is true)
    UseApiSearch bool
    If true, will search the vCD using native metadata query (without regular expressions)
    Key string
    Metadata key (field name)
    Value string
    Metadata value (can be a regular expression if "use_api_search" is false)
    IsSystem bool
    True if is a metadata@SYSTEM key
    Type string
    Type of metadata value (needed only if "use_api_search" is true)
    UseApiSearch bool
    If true, will search the vCD using native metadata query (without regular expressions)
    key String
    Metadata key (field name)
    value String
    Metadata value (can be a regular expression if "use_api_search" is false)
    isSystem Boolean
    True if is a metadata@SYSTEM key
    type String
    Type of metadata value (needed only if "use_api_search" is true)
    useApiSearch Boolean
    If true, will search the vCD using native metadata query (without regular expressions)
    key string
    Metadata key (field name)
    value string
    Metadata value (can be a regular expression if "use_api_search" is false)
    isSystem boolean
    True if is a metadata@SYSTEM key
    type string
    Type of metadata value (needed only if "use_api_search" is true)
    useApiSearch boolean
    If true, will search the vCD using native metadata query (without regular expressions)
    key str
    Metadata key (field name)
    value str
    Metadata value (can be a regular expression if "use_api_search" is false)
    is_system bool
    True if is a metadata@SYSTEM key
    type str
    Type of metadata value (needed only if "use_api_search" is true)
    use_api_search bool
    If true, will search the vCD using native metadata query (without regular expressions)
    key String
    Metadata key (field name)
    value String
    Metadata value (can be a regular expression if "use_api_search" is false)
    isSystem Boolean
    True if is a metadata@SYSTEM key
    type String
    Type of metadata value (needed only if "use_api_search" is true)
    useApiSearch Boolean
    If true, will search the vCD using native metadata query (without regular expressions)

    GetCatalogMediaMetadataEntry

    IsSystem bool
    Key string
    Type string
    UserAccess string
    Value string
    IsSystem bool
    Key string
    Type string
    UserAccess string
    Value string
    isSystem Boolean
    key String
    type String
    userAccess String
    value String
    isSystem boolean
    key string
    type string
    userAccess string
    value string
    isSystem Boolean
    key String
    type String
    userAccess String
    value String

    Package Details

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