xenorchestra v1.5.2 published on Monday, Mar 10, 2025 by Vates
xenorchestra.getXoaStorageRepository
Explore with Pulumi AI
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as xenorchestra from "@pulumi/xenorchestra";
import * as xenorchestra from "@vates/pulumi-xenorchestra";
const localStorage = xenorchestra.getXoaStorageRepository({
    nameLabel: "Your storage repository label",
});
const demo_vm = new xenorchestra.Vm("demo-vm", {disks: [{
    srId: localStorage.then(localStorage => localStorage.id),
    nameLabel: "Ubuntu Bionic Beaver 18.04_imavo",
    size: 32212254720,
}]});
import pulumi
import pulumi_xenorchestra as xenorchestra
local_storage = xenorchestra.get_xoa_storage_repository(name_label="Your storage repository label")
demo_vm = xenorchestra.Vm("demo-vm", disks=[{
    "sr_id": local_storage.id,
    "name_label": "Ubuntu Bionic Beaver 18.04_imavo",
    "size": 32212254720,
}])
package main
import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/vatesfr/pulumi-xenorchestra/sdk/go/xenorchestra"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		localStorage, err := xenorchestra.GetXoaStorageRepository(ctx, &xenorchestra.GetXoaStorageRepositoryArgs{
			NameLabel: "Your storage repository label",
		}, nil)
		if err != nil {
			return err
		}
		_, err = xenorchestra.NewVm(ctx, "demo-vm", &xenorchestra.VmArgs{
			Disks: xenorchestra.VmDiskArray{
				&xenorchestra.VmDiskArgs{
					SrId:      pulumi.String(localStorage.Id),
					NameLabel: pulumi.String("Ubuntu Bionic Beaver 18.04_imavo"),
					Size:      pulumi.Float64(32212254720),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Xenorchestra = Pulumi.Xenorchestra;
return await Deployment.RunAsync(() => 
{
    var localStorage = Xenorchestra.GetXoaStorageRepository.Invoke(new()
    {
        NameLabel = "Your storage repository label",
    });
    var demo_vm = new Xenorchestra.Vm("demo-vm", new()
    {
        Disks = new[]
        {
            new Xenorchestra.Inputs.VmDiskArgs
            {
                SrId = localStorage.Apply(getXoaStorageRepositoryResult => getXoaStorageRepositoryResult.Id),
                NameLabel = "Ubuntu Bionic Beaver 18.04_imavo",
                Size = 32212254720,
            },
        },
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.xenorchestra.XenorchestraFunctions;
import com.pulumi.xenorchestra.inputs.GetXoaStorageRepositoryArgs;
import com.pulumi.xenorchestra.Vm;
import com.pulumi.xenorchestra.VmArgs;
import com.pulumi.xenorchestra.inputs.VmDiskArgs;
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 localStorage = XenorchestraFunctions.getXoaStorageRepository(GetXoaStorageRepositoryArgs.builder()
            .nameLabel("Your storage repository label")
            .build());
        var demo_vm = new Vm("demo-vm", VmArgs.builder()
            .disks(VmDiskArgs.builder()
                .srId(localStorage.applyValue(getXoaStorageRepositoryResult -> getXoaStorageRepositoryResult.id()))
                .nameLabel("Ubuntu Bionic Beaver 18.04_imavo")
                .size(32212254720)
                .build())
            .build());
    }
}
resources:
  demo-vm:
    type: xenorchestra:Vm
    properties:
      disks:
        - srId: ${localStorage.id}
          nameLabel: Ubuntu Bionic Beaver 18.04_imavo
          size: 3.221225472e+10
variables:
  localStorage:
    fn::invoke:
      function: xenorchestra:getXoaStorageRepository
      arguments:
        nameLabel: Your storage repository label
Using getXoaStorageRepository
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 getXoaStorageRepository(args: GetXoaStorageRepositoryArgs, opts?: InvokeOptions): Promise<GetXoaStorageRepositoryResult>
function getXoaStorageRepositoryOutput(args: GetXoaStorageRepositoryOutputArgs, opts?: InvokeOptions): Output<GetXoaStorageRepositoryResult>def get_xoa_storage_repository(name_label: Optional[str] = None,
                               pool_id: Optional[str] = None,
                               tags: Optional[Sequence[str]] = None,
                               opts: Optional[InvokeOptions] = None) -> GetXoaStorageRepositoryResult
def get_xoa_storage_repository_output(name_label: Optional[pulumi.Input[str]] = None,
                               pool_id: Optional[pulumi.Input[str]] = None,
                               tags: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                               opts: Optional[InvokeOptions] = None) -> Output[GetXoaStorageRepositoryResult]func GetXoaStorageRepository(ctx *Context, args *GetXoaStorageRepositoryArgs, opts ...InvokeOption) (*GetXoaStorageRepositoryResult, error)
func GetXoaStorageRepositoryOutput(ctx *Context, args *GetXoaStorageRepositoryOutputArgs, opts ...InvokeOption) GetXoaStorageRepositoryResultOutput> Note: This function is named GetXoaStorageRepository in the Go SDK.
public static class GetXoaStorageRepository 
{
    public static Task<GetXoaStorageRepositoryResult> InvokeAsync(GetXoaStorageRepositoryArgs args, InvokeOptions? opts = null)
    public static Output<GetXoaStorageRepositoryResult> Invoke(GetXoaStorageRepositoryInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetXoaStorageRepositoryResult> getXoaStorageRepository(GetXoaStorageRepositoryArgs args, InvokeOptions options)
public static Output<GetXoaStorageRepositoryResult> getXoaStorageRepository(GetXoaStorageRepositoryArgs args, InvokeOptions options)
fn::invoke:
  function: xenorchestra:index/getXoaStorageRepository:getXoaStorageRepository
  arguments:
    # arguments dictionaryThe following arguments are supported:
- name_
label str - The name of the storage repository to look up
 - pool_
id str - The Id of the pool the storage repository exists on.
 - Sequence[str]
 - The tags (labels) applied to the given entity.
 
getXoaStorageRepository Result
The following output properties are available:
- Container string
 - The storage container.
 - Id string
 - The provider-assigned unique ID for this managed resource.
 - Name
Label string - The name of the storage repository to look up
 - Physical
Usage double - The physical storage size.
 - Size double
 - The storage size.
 - Sr
Type string - The type of storage repository (lvm, udev, iso, user, etc).
 - Usage double
 - The current usage for this storage repository.
 - Uuid string
 - uuid of the storage repository. This is equivalent to the id.
 - Pool
Id string - The Id of the pool the storage repository exists on.
 - List<string>
 - The tags (labels) applied to the given entity.
 
- Container string
 - The storage container.
 - Id string
 - The provider-assigned unique ID for this managed resource.
 - Name
Label string - The name of the storage repository to look up
 - Physical
Usage float64 - The physical storage size.
 - Size float64
 - The storage size.
 - Sr
Type string - The type of storage repository (lvm, udev, iso, user, etc).
 - Usage float64
 - The current usage for this storage repository.
 - Uuid string
 - uuid of the storage repository. This is equivalent to the id.
 - Pool
Id string - The Id of the pool the storage repository exists on.
 - []string
 - The tags (labels) applied to the given entity.
 
- container String
 - The storage container.
 - id String
 - The provider-assigned unique ID for this managed resource.
 - name
Label String - The name of the storage repository to look up
 - physical
Usage Double - The physical storage size.
 - size Double
 - The storage size.
 - sr
Type String - The type of storage repository (lvm, udev, iso, user, etc).
 - usage Double
 - The current usage for this storage repository.
 - uuid String
 - uuid of the storage repository. This is equivalent to the id.
 - pool
Id String - The Id of the pool the storage repository exists on.
 - List<String>
 - The tags (labels) applied to the given entity.
 
- container string
 - The storage container.
 - id string
 - The provider-assigned unique ID for this managed resource.
 - name
Label string - The name of the storage repository to look up
 - physical
Usage number - The physical storage size.
 - size number
 - The storage size.
 - sr
Type string - The type of storage repository (lvm, udev, iso, user, etc).
 - usage number
 - The current usage for this storage repository.
 - uuid string
 - uuid of the storage repository. This is equivalent to the id.
 - pool
Id string - The Id of the pool the storage repository exists on.
 - string[]
 - The tags (labels) applied to the given entity.
 
- container str
 - The storage container.
 - id str
 - The provider-assigned unique ID for this managed resource.
 - name_
label str - The name of the storage repository to look up
 - physical_
usage float - The physical storage size.
 - size float
 - The storage size.
 - sr_
type str - The type of storage repository (lvm, udev, iso, user, etc).
 - usage float
 - The current usage for this storage repository.
 - uuid str
 - uuid of the storage repository. This is equivalent to the id.
 - pool_
id str - The Id of the pool the storage repository exists on.
 - Sequence[str]
 - The tags (labels) applied to the given entity.
 
- container String
 - The storage container.
 - id String
 - The provider-assigned unique ID for this managed resource.
 - name
Label String - The name of the storage repository to look up
 - physical
Usage Number - The physical storage size.
 - size Number
 - The storage size.
 - sr
Type String - The type of storage repository (lvm, udev, iso, user, etc).
 - usage Number
 - The current usage for this storage repository.
 - uuid String
 - uuid of the storage repository. This is equivalent to the id.
 - pool
Id String - The Id of the pool the storage repository exists on.
 - List<String>
 - The tags (labels) applied to the given entity.
 
Package Details
- Repository
 - xenorchestra vatesfr/pulumi-xenorchestra
 - License
 - Apache-2.0
 - Notes
 - This Pulumi package is based on the 
xenorchestraTerraform Provider.