@muhlba91/pulumi-proxmoxve
Version:
A Pulumi package for creating and managing Proxmox Virtual Environment cloud resources.
134 lines • 4.38 kB
JavaScript
"use strict";
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.getFileOutput = exports.getFile = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Retrieves information about an existing file in a Proxmox Virtual Environment node.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as proxmoxve from "@muhlba91/pulumi-proxmoxve";
*
* const ubuntuIso = proxmoxve.getFile({
* nodeName: "pve",
* datastoreId: "local",
* contentType: "iso",
* fileName: "ubuntu-22.04.3-live-server-amd64.iso",
* });
* const ubuntuContainerTemplate = proxmoxve.getFile({
* nodeName: "pve",
* datastoreId: "local",
* contentType: "vztmpl",
* fileName: "ubuntu-22.04-standard_22.04-1_amd64.tar.zst",
* });
* const cloudInitSnippet = proxmoxve.getFile({
* nodeName: "pve",
* datastoreId: "local",
* contentType: "snippets",
* fileName: "cloud-init-config.yaml",
* });
* export const ubuntuIsoId = ubuntuIso.then(ubuntuIso => ubuntuIso.id);
* export const ubuntuIsoSize = ubuntuIso.then(ubuntuIso => ubuntuIso.fileSize);
* export const containerTemplateFormat = ubuntuContainerTemplate.then(ubuntuContainerTemplate => ubuntuContainerTemplate.fileFormat);
* const example = new proxmoxve.vm.VirtualMachine("example", {
* nodeName: "pve",
* vmId: 100,
* cdrom: {
* fileId: ubuntuIso.then(ubuntuIso => ubuntuIso.id),
* },
* cpu: {
* cores: 2,
* },
* memory: {
* dedicated: 2048,
* },
* disks: [{
* datastoreId: "local-lvm",
* fileFormat: "qcow2",
* size: 20,
* }],
* networkDevices: [{
* bridge: "vmbr0",
* }],
* });
* ```
*/
function getFile(args, opts) {
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invoke("proxmoxve:index/getFile:getFile", {
"contentType": args.contentType,
"datastoreId": args.datastoreId,
"fileName": args.fileName,
"nodeName": args.nodeName,
}, opts);
}
exports.getFile = getFile;
/**
* Retrieves information about an existing file in a Proxmox Virtual Environment node.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as proxmoxve from "@muhlba91/pulumi-proxmoxve";
*
* const ubuntuIso = proxmoxve.getFile({
* nodeName: "pve",
* datastoreId: "local",
* contentType: "iso",
* fileName: "ubuntu-22.04.3-live-server-amd64.iso",
* });
* const ubuntuContainerTemplate = proxmoxve.getFile({
* nodeName: "pve",
* datastoreId: "local",
* contentType: "vztmpl",
* fileName: "ubuntu-22.04-standard_22.04-1_amd64.tar.zst",
* });
* const cloudInitSnippet = proxmoxve.getFile({
* nodeName: "pve",
* datastoreId: "local",
* contentType: "snippets",
* fileName: "cloud-init-config.yaml",
* });
* export const ubuntuIsoId = ubuntuIso.then(ubuntuIso => ubuntuIso.id);
* export const ubuntuIsoSize = ubuntuIso.then(ubuntuIso => ubuntuIso.fileSize);
* export const containerTemplateFormat = ubuntuContainerTemplate.then(ubuntuContainerTemplate => ubuntuContainerTemplate.fileFormat);
* const example = new proxmoxve.vm.VirtualMachine("example", {
* nodeName: "pve",
* vmId: 100,
* cdrom: {
* fileId: ubuntuIso.then(ubuntuIso => ubuntuIso.id),
* },
* cpu: {
* cores: 2,
* },
* memory: {
* dedicated: 2048,
* },
* disks: [{
* datastoreId: "local-lvm",
* fileFormat: "qcow2",
* size: 20,
* }],
* networkDevices: [{
* bridge: "vmbr0",
* }],
* });
* ```
*/
function getFileOutput(args, opts) {
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invokeOutput("proxmoxve:index/getFile:getFile", {
"contentType": args.contentType,
"datastoreId": args.datastoreId,
"fileName": args.fileName,
"nodeName": args.nodeName,
}, opts);
}
exports.getFileOutput = getFileOutput;
//# sourceMappingURL=getFile.js.map