1. Packages
  2. Nutanix
  3. API Docs
  4. PromoteProtectedResourceV2
Nutanix v0.8.0 published on Sunday, May 11, 2025 by Piers Karsenbarg

nutanix.PromoteProtectedResourceV2

Explore with Pulumi AI

nutanix logo
Nutanix v0.8.0 published on Sunday, May 11, 2025 by Piers Karsenbarg

    Promotes the specified synced entity at the target site. This is only relevant if the synced entity is protected in a synchronous schedule.

    Example:

    import * as pulumi from "@pulumi/pulumi";
    import * as nutanix from "@pierskarsenbarg/nutanix";
    
    // Promote a protected virtual machine on remote site
    // This example promotes a protected virtual machine on a remote site.
    // Steps:
    // 1. Define the provider for the remote site
    // 2. Create a category and a protection policy, on the local site
    // 3. Create a virtual machine and associate it with the protection policy, on local site
    // 4. Promote the protected virtual machine on the remote site
    // define another alias for the provider, this time for the remote PC
    const remote = new nutanix.Provider("remote", {
        username: _var.nutanix_remote_username,
        password: _var.nutanix_remote_password,
        endpoint: _var.nutanix_remote_endpoint,
        insecure: true,
        port: "9440",
    });
    // create a category and a protection policy on the local site
    // promote the protected virtual machine on the remote site
    const promote_example = new nutanix.PromoteProtectedResourceV2("promote-example", {extId: "d22529bb-f02d-4710-894b-d1de772d7832"}, {
        provider: nutanix.remote,
    });
    // protected resource (VM or VG) ext_id
    
    import pulumi
    import pulumi_nutanix as nutanix
    
    # Promote a protected virtual machine on remote site
    # This example promotes a protected virtual machine on a remote site.
    # Steps:
    # 1. Define the provider for the remote site
    # 2. Create a category and a protection policy, on the local site
    # 3. Create a virtual machine and associate it with the protection policy, on local site
    # 4. Promote the protected virtual machine on the remote site
    # define another alias for the provider, this time for the remote PC
    remote = nutanix.Provider("remote",
        username=var["nutanix_remote_username"],
        password=var["nutanix_remote_password"],
        endpoint=var["nutanix_remote_endpoint"],
        insecure=True,
        port="9440")
    # create a category and a protection policy on the local site
    # promote the protected virtual machine on the remote site
    promote_example = nutanix.PromoteProtectedResourceV2("promote-example", ext_id="d22529bb-f02d-4710-894b-d1de772d7832",
    opts = pulumi.ResourceOptions(provider=nutanix["remote"]))
    # protected resource (VM or VG) ext_id
    
    package main
    
    import (
    	"github.com/pierskarsenbarg/pulumi-nutanix/sdk/go/nutanix"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// Promote a protected virtual machine on remote site
    		// This example promotes a protected virtual machine on a remote site.
    		// Steps:
    		// 1. Define the provider for the remote site
    		// 2. Create a category and a protection policy, on the local site
    		// 3. Create a virtual machine and associate it with the protection policy, on local site
    		// 4. Promote the protected virtual machine on the remote site
    		// define another alias for the provider, this time for the remote PC
    		_, err := nutanix.NewProvider(ctx, "remote", &nutanix.ProviderArgs{
    			Username: pulumi.Any(_var.Nutanix_remote_username),
    			Password: pulumi.Any(_var.Nutanix_remote_password),
    			Endpoint: pulumi.Any(_var.Nutanix_remote_endpoint),
    			Insecure: pulumi.Bool(true),
    			Port:     pulumi.String("9440"),
    		})
    		if err != nil {
    			return err
    		}
    		// promote the protected virtual machine on the remote site
    		_, err = nutanix.NewPromoteProtectedResourceV2(ctx, "promote-example", &nutanix.PromoteProtectedResourceV2Args{
    			ExtId: pulumi.String("d22529bb-f02d-4710-894b-d1de772d7832"),
    		}, pulumi.Provider(nutanix.Remote))
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Nutanix = PiersKarsenbarg.Nutanix;
    
    return await Deployment.RunAsync(() => 
    {
        // Promote a protected virtual machine on remote site
        // This example promotes a protected virtual machine on a remote site.
        // Steps:
        // 1. Define the provider for the remote site
        // 2. Create a category and a protection policy, on the local site
        // 3. Create a virtual machine and associate it with the protection policy, on local site
        // 4. Promote the protected virtual machine on the remote site
        // define another alias for the provider, this time for the remote PC
        var remote = new Nutanix.Provider("remote", new()
        {
            Username = @var.Nutanix_remote_username,
            Password = @var.Nutanix_remote_password,
            Endpoint = @var.Nutanix_remote_endpoint,
            Insecure = true,
            Port = "9440",
        });
    
        // create a category and a protection policy on the local site
        // promote the protected virtual machine on the remote site
        var promote_example = new Nutanix.PromoteProtectedResourceV2("promote-example", new()
        {
            ExtId = "d22529bb-f02d-4710-894b-d1de772d7832",
        }, new CustomResourceOptions
        {
            Provider = nutanix.Remote,
        });
    
        // protected resource (VM or VG) ext_id
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.nutanix.Provider;
    import com.pulumi.nutanix.ProviderArgs;
    import com.pulumi.nutanix.PromoteProtectedResourceV2;
    import com.pulumi.nutanix.PromoteProtectedResourceV2Args;
    import com.pulumi.resources.CustomResourceOptions;
    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) {
            // Promote a protected virtual machine on remote site
            // This example promotes a protected virtual machine on a remote site.
            // Steps:
            // 1. Define the provider for the remote site
            // 2. Create a category and a protection policy, on the local site
            // 3. Create a virtual machine and associate it with the protection policy, on local site
            // 4. Promote the protected virtual machine on the remote site
            // define another alias for the provider, this time for the remote PC
            var remote = new Provider("remote", ProviderArgs.builder()
                .username(var_.nutanix_remote_username())
                .password(var_.nutanix_remote_password())
                .endpoint(var_.nutanix_remote_endpoint())
                .insecure(true)
                .port("9440")
                .build());
    
            // create a category and a protection policy on the local site
            // promote the protected virtual machine on the remote site
            var promote_example = new PromoteProtectedResourceV2("promote-example", PromoteProtectedResourceV2Args.builder()
                .extId("d22529bb-f02d-4710-894b-d1de772d7832")
                .build(), CustomResourceOptions.builder()
                    .provider(nutanix.remote())
                    .build());
    
            // protected resource (VM or VG) ext_id
        }
    }
    
    resources:
      # Promote a protected virtual machine on remote site
      # This example promotes a protected virtual machine on a remote site.
      # Steps:
      # 1. Define the provider for the remote site
      # 2. Create a category and a protection policy, on the local site
      # 3. Create a virtual machine and associate it with the protection policy, on local site
      # 4. Promote the protected virtual machine on the remote site
    
      # define another alias for the provider, this time for the remote PC
      remote: # create a category and a protection policy on the local site
        type: pulumi:providers:nutanix
        properties:
          username: ${var.nutanix_remote_username}
          password: ${var.nutanix_remote_password}
          endpoint: ${var.nutanix_remote_endpoint}
          insecure: true
          port: 9440
      # promote the protected virtual machine on the remote site
      promote-example:
        type: nutanix:PromoteProtectedResourceV2
        properties:
          extId: d22529bb-f02d-4710-894b-d1de772d7832
        options:
          provider: ${nutanix.remote}
    

    Create PromoteProtectedResourceV2 Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new PromoteProtectedResourceV2(name: string, args: PromoteProtectedResourceV2Args, opts?: CustomResourceOptions);
    @overload
    def PromoteProtectedResourceV2(resource_name: str,
                                   args: PromoteProtectedResourceV2Args,
                                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def PromoteProtectedResourceV2(resource_name: str,
                                   opts: Optional[ResourceOptions] = None,
                                   ext_id: Optional[str] = None)
    func NewPromoteProtectedResourceV2(ctx *Context, name string, args PromoteProtectedResourceV2Args, opts ...ResourceOption) (*PromoteProtectedResourceV2, error)
    public PromoteProtectedResourceV2(string name, PromoteProtectedResourceV2Args args, CustomResourceOptions? opts = null)
    public PromoteProtectedResourceV2(String name, PromoteProtectedResourceV2Args args)
    public PromoteProtectedResourceV2(String name, PromoteProtectedResourceV2Args args, CustomResourceOptions options)
    
    type: nutanix:PromoteProtectedResourceV2
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args PromoteProtectedResourceV2Args
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args PromoteProtectedResourceV2Args
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args PromoteProtectedResourceV2Args
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args PromoteProtectedResourceV2Args
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args PromoteProtectedResourceV2Args
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var promoteProtectedResourceV2Resource = new Nutanix.PromoteProtectedResourceV2("promoteProtectedResourceV2Resource", new()
    {
        ExtId = "string",
    });
    
    example, err := nutanix.NewPromoteProtectedResourceV2(ctx, "promoteProtectedResourceV2Resource", &nutanix.PromoteProtectedResourceV2Args{
    	ExtId: pulumi.String("string"),
    })
    
    var promoteProtectedResourceV2Resource = new PromoteProtectedResourceV2("promoteProtectedResourceV2Resource", PromoteProtectedResourceV2Args.builder()
        .extId("string")
        .build());
    
    promote_protected_resource_v2_resource = nutanix.PromoteProtectedResourceV2("promoteProtectedResourceV2Resource", ext_id="string")
    
    const promoteProtectedResourceV2Resource = new nutanix.PromoteProtectedResourceV2("promoteProtectedResourceV2Resource", {extId: "string"});
    
    type: nutanix:PromoteProtectedResourceV2
    properties:
        extId: string
    

    PromoteProtectedResourceV2 Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The PromoteProtectedResourceV2 resource accepts the following input properties:

    ExtId string

    -(Required) The external identifier of a protected VM or volume group that can be used to retrieve the protected resource.

    See detailed information in Nutanix Promote Protected Resource v4.

    ExtId string

    -(Required) The external identifier of a protected VM or volume group that can be used to retrieve the protected resource.

    See detailed information in Nutanix Promote Protected Resource v4.

    extId String

    -(Required) The external identifier of a protected VM or volume group that can be used to retrieve the protected resource.

    See detailed information in Nutanix Promote Protected Resource v4.

    extId string

    -(Required) The external identifier of a protected VM or volume group that can be used to retrieve the protected resource.

    See detailed information in Nutanix Promote Protected Resource v4.

    ext_id str

    -(Required) The external identifier of a protected VM or volume group that can be used to retrieve the protected resource.

    See detailed information in Nutanix Promote Protected Resource v4.

    extId String

    -(Required) The external identifier of a protected VM or volume group that can be used to retrieve the protected resource.

    See detailed information in Nutanix Promote Protected Resource v4.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the PromoteProtectedResourceV2 resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing PromoteProtectedResourceV2 Resource

    Get an existing PromoteProtectedResourceV2 resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: PromoteProtectedResourceV2State, opts?: CustomResourceOptions): PromoteProtectedResourceV2
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            ext_id: Optional[str] = None) -> PromoteProtectedResourceV2
    func GetPromoteProtectedResourceV2(ctx *Context, name string, id IDInput, state *PromoteProtectedResourceV2State, opts ...ResourceOption) (*PromoteProtectedResourceV2, error)
    public static PromoteProtectedResourceV2 Get(string name, Input<string> id, PromoteProtectedResourceV2State? state, CustomResourceOptions? opts = null)
    public static PromoteProtectedResourceV2 get(String name, Output<String> id, PromoteProtectedResourceV2State state, CustomResourceOptions options)
    resources:  _:    type: nutanix:PromoteProtectedResourceV2    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    ExtId string

    -(Required) The external identifier of a protected VM or volume group that can be used to retrieve the protected resource.

    See detailed information in Nutanix Promote Protected Resource v4.

    ExtId string

    -(Required) The external identifier of a protected VM or volume group that can be used to retrieve the protected resource.

    See detailed information in Nutanix Promote Protected Resource v4.

    extId String

    -(Required) The external identifier of a protected VM or volume group that can be used to retrieve the protected resource.

    See detailed information in Nutanix Promote Protected Resource v4.

    extId string

    -(Required) The external identifier of a protected VM or volume group that can be used to retrieve the protected resource.

    See detailed information in Nutanix Promote Protected Resource v4.

    ext_id str

    -(Required) The external identifier of a protected VM or volume group that can be used to retrieve the protected resource.

    See detailed information in Nutanix Promote Protected Resource v4.

    extId String

    -(Required) The external identifier of a protected VM or volume group that can be used to retrieve the protected resource.

    See detailed information in Nutanix Promote Protected Resource v4.

    Package Details

    Repository
    nutanix pierskarsenbarg/pulumi-nutanix
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the nutanix Terraform Provider.
    nutanix logo
    Nutanix v0.8.0 published on Sunday, May 11, 2025 by Piers Karsenbarg