vSphere
getContentLibraryItem
The vsphere.ContentLibraryItem
data source can be used to discover the ID of a Content Library item.
NOTE: This resource requires vCenter and is not available on direct ESXi connections.
Example Usage
using Pulumi;
using VSphere = Pulumi.VSphere;
class MyStack : Stack
{
public MyStack()
{
var library = Output.Create(VSphere.GetContentLibrary.InvokeAsync(new VSphere.GetContentLibraryArgs
{
Name = "Content Library Test",
}));
var item = library.Apply(library => Output.Create(VSphere.GetContentLibraryItem.InvokeAsync(new VSphere.GetContentLibraryItemArgs
{
Name = "Ubuntu Bionic 18.04",
LibraryId = library.Id,
})));
}
}
package main
import (
"github.com/pulumi/pulumi-vsphere/sdk/v4/go/vsphere"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
library, err := vsphere.LookupContentLibrary(ctx, &GetContentLibraryArgs{
Name: "Content Library Test",
}, nil)
if err != nil {
return err
}
_, err = vsphere.LookupContentLibraryItem(ctx, &GetContentLibraryItemArgs{
Name: "Ubuntu Bionic 18.04",
LibraryId: library.Id,
}, nil)
if err != nil {
return err
}
return nil
})
}
Coming soon!
import pulumi
import pulumi_vsphere as vsphere
library = vsphere.get_content_library(name="Content Library Test")
item = vsphere.get_content_library_item(name="Ubuntu Bionic 18.04",
library_id=library.id)
import * as pulumi from "@pulumi/pulumi";
import * as vsphere from "@pulumi/vsphere";
const library = vsphere.getContentLibrary({
name: "Content Library Test",
});
const item = library.then(library => vsphere.getContentLibraryItem({
name: "Ubuntu Bionic 18.04",
libraryId: library.id,
}));
Coming soon!
Using getContentLibraryItem
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 getContentLibraryItem(args: GetContentLibraryItemArgs, opts?: InvokeOptions): Promise<GetContentLibraryItemResult>
function getContentLibraryItemOutput(args: GetContentLibraryItemOutputArgs, opts?: InvokeOptions): Output<GetContentLibraryItemResult>
def get_content_library_item(library_id: Optional[str] = None,
name: Optional[str] = None,
type: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetContentLibraryItemResult
def get_content_library_item_output(library_id: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
type: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetContentLibraryItemResult]
func LookupContentLibraryItem(ctx *Context, args *LookupContentLibraryItemArgs, opts ...InvokeOption) (*LookupContentLibraryItemResult, error)
func LookupContentLibraryItemOutput(ctx *Context, args *LookupContentLibraryItemOutputArgs, opts ...InvokeOption) LookupContentLibraryItemResultOutput
> Note: This function is named LookupContentLibraryItem
in the Go SDK.
public static class GetContentLibraryItem
{
public static Task<GetContentLibraryItemResult> InvokeAsync(GetContentLibraryItemArgs args, InvokeOptions? opts = null)
public static Output<GetContentLibraryItemResult> Invoke(GetContentLibraryItemInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetContentLibraryItemResult> getContentLibraryItem(GetContentLibraryItemArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
Function: vsphere:index/getContentLibraryItem:getContentLibraryItem
Arguments:
# Arguments dictionary
The following arguments are supported:
- library_
id str The ID of the Content Library the item exists in.
- name str
The name of the Content Library.
- type str
The Content Library type. Can be ovf, iso, or vm-template.
getContentLibraryItem Result
The following output properties are available:
- id str
The provider-assigned unique ID for this managed resource.
- library_
id str - name str
- type str
The Content Library type. Can be ovf, iso, or vm-template.
Package Details
- Repository
- https://github.com/pulumi/pulumi-vsphere
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
vsphere
Terraform Provider.