xenorchestra v1.5.0 published on Friday, Mar 7, 2025 by Vates
xenorchestra.getSr
Explore with Pulumi AI
Deprecated: xenorchestra.index/getsr.getSr has been deprecated in favor of xenorchestra.index/getxoastoragerepository.getXoaStorageRepository
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 getSr
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 getSr(args: GetSrArgs, opts?: InvokeOptions): Promise<GetSrResult>
function getSrOutput(args: GetSrOutputArgs, opts?: InvokeOptions): Output<GetSrResult>def get_sr(name_label: Optional[str] = None,
           pool_id: Optional[str] = None,
           tags: Optional[Sequence[str]] = None,
           opts: Optional[InvokeOptions] = None) -> GetSrResult
def get_sr_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[GetSrResult]func GetSr(ctx *Context, args *GetSrArgs, opts ...InvokeOption) (*GetSrResult, error)
func GetSrOutput(ctx *Context, args *GetSrOutputArgs, opts ...InvokeOption) GetSrResultOutput> Note: This function is named GetSr in the Go SDK.
public static class GetSr 
{
    public static Task<GetSrResult> InvokeAsync(GetSrArgs args, InvokeOptions? opts = null)
    public static Output<GetSrResult> Invoke(GetSrInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetSrResult> getSr(GetSrArgs args, InvokeOptions options)
public static Output<GetSrResult> getSr(GetSrArgs args, InvokeOptions options)
fn::invoke:
  function: xenorchestra:index/getSr:getSr
  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.
getSr 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.
- 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.
- []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.
- 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.
- 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.
- 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.
- 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.
