vcd 3.14.1 published on Monday, Apr 14, 2025 by vmware
vcd.getCatalogMedia
Explore with Pulumi AI
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 ofyyyy-mm-dd [hh:mm[:ss[.nnnZ]]]
ordd-MMM-yyyy [hh:mm[:ss[.nnnZ]]]
is recommended. Comparison with equality operator (==
) need to define the date to the microseconds.latest
- (Optional) Iftrue
, retrieve the latest item among the ones matching other parameters. If no other parameters are set, it retrieves the newest item.earliest
- (Optional) Iftrue
, 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. - Catalog
Id string - The ID of the catalog to which the media file belongs. It's mandatory if
catalog
field is not used. - Download
To stringFile - Filter
Get
Catalog Media Filter - 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. - Catalog
Id string - The ID of the catalog to which the media file belongs. It's mandatory if
catalog
field is not used. - Download
To stringFile - Filter
Get
Catalog Media Filter - 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. - catalog
Id String - The ID of the catalog to which the media file belongs. It's mandatory if
catalog
field is not used. - download
To StringFile - filter
Get
Catalog Media Filter - 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. - catalog
Id string - The ID of the catalog to which the media file belongs. It's mandatory if
catalog
field is not used. - download
To stringFile - filter
Get
Catalog Media Filter - 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. - 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_ strfile - filter
Get
Catalog Media Filter - 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. - catalog
Id String - The ID of the catalog to which the media file belongs. It's mandatory if
catalog
field is not used. - download
To StringFile - 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
- Catalog
Item stringId - Creation
Date string - Description string
- Id string
- Is
Iso bool - Is
Published bool - Metadata Dictionary<string, string>
- Metadata
Entries List<GetCatalog Media Metadata Entry> - Owner
Name string - Size double
- Status string
- Storage
Profile stringName - Catalog
Id string - Download
To stringFile - Filter
Get
Catalog Media Filter - Name string
- Org string
- Catalog string
- Catalog
Item stringId - Creation
Date string - Description string
- Id string
- Is
Iso bool - Is
Published bool - Metadata map[string]string
- Metadata
Entries []GetCatalog Media Metadata Entry - Owner
Name string - Size float64
- Status string
- Storage
Profile stringName - Catalog
Id string - Download
To stringFile - Filter
Get
Catalog Media Filter - Name string
- Org string
- catalog String
- catalog
Item StringId - creation
Date String - description String
- id String
- is
Iso Boolean - is
Published Boolean - metadata Map<String,String>
- metadata
Entries List<GetCatalog Media Metadata Entry> - owner
Name String - size Double
- status String
- storage
Profile StringName - catalog
Id String - download
To StringFile - filter
Get
Catalog Media Filter - name String
- org String
- catalog string
- catalog
Item stringId - creation
Date string - description string
- id string
- is
Iso boolean - is
Published boolean - metadata {[key: string]: string}
- metadata
Entries GetCatalog Media Metadata Entry[] - owner
Name string - size number
- status string
- storage
Profile stringName - catalog
Id string - download
To stringFile - filter
Get
Catalog Media Filter - name string
- org string
- catalog str
- catalog_
item_ strid - creation_
date str - description str
- id str
- is_
iso bool - is_
published bool - metadata Mapping[str, str]
- metadata_
entries Sequence[GetCatalog Media Metadata Entry] - owner_
name str - size float
- status str
- storage_
profile_ strname - catalog_
id str - download_
to_ strfile - filter
Get
Catalog Media Filter - name str
- org str
- catalog String
- catalog
Item StringId - creation
Date String - description String
- id String
- is
Iso Boolean - is
Published Boolean - metadata Map<String>
- metadata
Entries List<Property Map> - owner
Name String - size Number
- status String
- storage
Profile StringName - catalog
Id String - download
To StringFile - filter Property Map
- name String
- org String
Supporting Types
GetCatalogMediaFilter
- 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[Get
Catalog Media Filter Metadata] - metadata filter
- name_
regex str - 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)
- Is
System bool - True if is a metadata@SYSTEM key
- Type string
- Type of metadata value (needed only if "use_api_search" is true)
- Use
Api boolSearch - 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)
- Is
System bool - True if is a metadata@SYSTEM key
- Type string
- Type of metadata value (needed only if "use_api_search" is true)
- Use
Api boolSearch - 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)
- is
System Boolean - True if is a metadata@SYSTEM key
- type String
- Type of metadata value (needed only if "use_api_search" is true)
- use
Api BooleanSearch - 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)
- is
System boolean - True if is a metadata@SYSTEM key
- type string
- Type of metadata value (needed only if "use_api_search" is true)
- use
Api booleanSearch - 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_ boolsearch - 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)
- is
System Boolean - True if is a metadata@SYSTEM key
- type String
- Type of metadata value (needed only if "use_api_search" is true)
- use
Api BooleanSearch - If true, will search the vCD using native metadata query (without regular expressions)
GetCatalogMediaMetadataEntry
- Is
System bool - Key string
- Type string
- User
Access string - Value string
- Is
System bool - Key string
- Type string
- User
Access string - Value string
- is
System Boolean - key String
- type String
- user
Access String - value String
- is
System boolean - key string
- type string
- user
Access string - value string
- is_
system bool - key str
- type str
- user_
access str - value str
- is
System Boolean - key String
- type String
- user
Access String - value String
Package Details
- Repository
- vcd vmware/terraform-provider-vcd
- License
- Notes
- This Pulumi package is based on the
vcd
Terraform Provider.