1. Packages
  2. Xen Orchestra
  3. API Docs
  4. getXoaStorageRepository
xenorchestra v1.5.2 published on Monday, Mar 10, 2025 by Vates

xenorchestra.getXoaStorageRepository

Explore with Pulumi AI

xenorchestra v1.5.2 published on Monday, Mar 10, 2025 by Vates

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,
}]});
Copy
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,
}])
Copy
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
	})
}
Copy
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,
            },
        },
    });

});
Copy
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());

    }
}
Copy
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
Copy

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>
Copy
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]
Copy
func GetXoaStorageRepository(ctx *Context, args *GetXoaStorageRepositoryArgs, opts ...InvokeOption) (*GetXoaStorageRepositoryResult, error)
func GetXoaStorageRepositoryOutput(ctx *Context, args *GetXoaStorageRepositoryOutputArgs, opts ...InvokeOption) GetXoaStorageRepositoryResultOutput
Copy

> 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)
}
Copy
public static CompletableFuture<GetXoaStorageRepositoryResult> getXoaStorageRepository(GetXoaStorageRepositoryArgs args, InvokeOptions options)
public static Output<GetXoaStorageRepositoryResult> getXoaStorageRepository(GetXoaStorageRepositoryArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: xenorchestra:index/getXoaStorageRepository:getXoaStorageRepository
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

NameLabel This property is required. string
The name of the storage repository to look up
PoolId string
The Id of the pool the storage repository exists on.
Tags List<string>
The tags (labels) applied to the given entity.
NameLabel This property is required. string
The name of the storage repository to look up
PoolId string
The Id of the pool the storage repository exists on.
Tags []string
The tags (labels) applied to the given entity.
nameLabel This property is required. String
The name of the storage repository to look up
poolId String
The Id of the pool the storage repository exists on.
tags List<String>
The tags (labels) applied to the given entity.
nameLabel This property is required. string
The name of the storage repository to look up
poolId string
The Id of the pool the storage repository exists on.
tags string[]
The tags (labels) applied to the given entity.
name_label This property is required. str
The name of the storage repository to look up
pool_id str
The Id of the pool the storage repository exists on.
tags Sequence[str]
The tags (labels) applied to the given entity.
nameLabel This property is required. String
The name of the storage repository to look up
poolId String
The Id of the pool the storage repository exists on.
tags List<String>
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.
NameLabel string
The name of the storage repository to look up
PhysicalUsage double
The physical storage size.
Size double
The storage size.
SrType 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.
PoolId string
The Id of the pool the storage repository exists on.
Tags 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.
NameLabel string
The name of the storage repository to look up
PhysicalUsage float64
The physical storage size.
Size float64
The storage size.
SrType 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.
PoolId string
The Id of the pool the storage repository exists on.
Tags []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.
nameLabel String
The name of the storage repository to look up
physicalUsage Double
The physical storage size.
size Double
The storage size.
srType 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.
poolId String
The Id of the pool the storage repository exists on.
tags 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.
nameLabel string
The name of the storage repository to look up
physicalUsage number
The physical storage size.
size number
The storage size.
srType 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.
poolId string
The Id of the pool the storage repository exists on.
tags 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.
tags 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.
nameLabel String
The name of the storage repository to look up
physicalUsage Number
The physical storage size.
size Number
The storage size.
srType 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.
poolId String
The Id of the pool the storage repository exists on.
tags 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 xenorchestra Terraform Provider.
xenorchestra v1.5.2 published on Monday, Mar 10, 2025 by Vates