OVHCloud v0.50.0 published on Friday, Sep 20, 2024 by OVHcloud
ovh.Dedicated.ServerRebootTask
Explore with Pulumi AI
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as ovh from "@ovhcloud/pulumi-ovh";
import * as ovh from "@pulumi/ovh";
const rescue = ovh.Dedicated.getServerBoots({
serviceName: "nsxxxxxxx.ip-xx-xx-xx.eu",
bootType: "rescue",
kernel: "rescue64-pro",
});
const serverOnRescue = new ovh.dedicated.ServerUpdate("serverOnRescue", {
serviceName: "nsxxxxxxx.ip-xx-xx-xx.eu",
bootId: rescue.then(rescue => rescue.results?.[0]),
monitoring: true,
state: "ok",
});
const serverReboot = new ovh.dedicated.ServerRebootTask("serverReboot", {
serviceName: rescue.then(rescue => rescue.serviceName),
keepers: [serverOnRescue.bootId],
});
import pulumi
import pulumi_ovh as ovh
rescue = ovh.Dedicated.get_server_boots(service_name="nsxxxxxxx.ip-xx-xx-xx.eu",
boot_type="rescue",
kernel="rescue64-pro")
server_on_rescue = ovh.dedicated.ServerUpdate("serverOnRescue",
service_name="nsxxxxxxx.ip-xx-xx-xx.eu",
boot_id=rescue.results[0],
monitoring=True,
state="ok")
server_reboot = ovh.dedicated.ServerRebootTask("serverReboot",
service_name=rescue.service_name,
keepers=[server_on_rescue.boot_id])
package main
import (
"github.com/ovh/pulumi-ovh/sdk/go/ovh/Dedicated"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
rescue, err := Dedicated.GetServerBoots(ctx, &dedicated.GetServerBootsArgs{
ServiceName: "nsxxxxxxx.ip-xx-xx-xx.eu",
BootType: pulumi.StringRef("rescue"),
Kernel: pulumi.StringRef("rescue64-pro"),
}, nil)
if err != nil {
return err
}
serverOnRescue, err := Dedicated.NewServerUpdate(ctx, "serverOnRescue", &Dedicated.ServerUpdateArgs{
ServiceName: pulumi.String("nsxxxxxxx.ip-xx-xx-xx.eu"),
BootId: pulumi.Int(rescue.Results[0]),
Monitoring: pulumi.Bool(true),
State: pulumi.String("ok"),
})
if err != nil {
return err
}
_, err = Dedicated.NewServerRebootTask(ctx, "serverReboot", &Dedicated.ServerRebootTaskArgs{
ServiceName: pulumi.String(rescue.ServiceName),
Keepers: pulumi.StringArray{
serverOnRescue.BootId,
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ovh = Pulumi.Ovh;
return await Deployment.RunAsync(() =>
{
var rescue = Ovh.Dedicated.GetServerBoots.Invoke(new()
{
ServiceName = "nsxxxxxxx.ip-xx-xx-xx.eu",
BootType = "rescue",
Kernel = "rescue64-pro",
});
var serverOnRescue = new Ovh.Dedicated.ServerUpdate("serverOnRescue", new()
{
ServiceName = "nsxxxxxxx.ip-xx-xx-xx.eu",
BootId = rescue.Apply(getServerBootsResult => getServerBootsResult.Results[0]),
Monitoring = true,
State = "ok",
});
var serverReboot = new Ovh.Dedicated.ServerRebootTask("serverReboot", new()
{
ServiceName = rescue.Apply(getServerBootsResult => getServerBootsResult.ServiceName),
Keepers = new[]
{
serverOnRescue.BootId,
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ovh.Dedicated.DedicatedFunctions;
import com.pulumi.ovh.Dedicated.inputs.GetServerBootsArgs;
import com.pulumi.ovh.Dedicated.ServerUpdate;
import com.pulumi.ovh.Dedicated.ServerUpdateArgs;
import com.pulumi.ovh.Dedicated.ServerRebootTask;
import com.pulumi.ovh.Dedicated.ServerRebootTaskArgs;
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 rescue = DedicatedFunctions.getServerBoots(GetServerBootsArgs.builder()
.serviceName("nsxxxxxxx.ip-xx-xx-xx.eu")
.bootType("rescue")
.kernel("rescue64-pro")
.build());
var serverOnRescue = new ServerUpdate("serverOnRescue", ServerUpdateArgs.builder()
.serviceName("nsxxxxxxx.ip-xx-xx-xx.eu")
.bootId(rescue.applyValue(getServerBootsResult -> getServerBootsResult.results()[0]))
.monitoring(true)
.state("ok")
.build());
var serverReboot = new ServerRebootTask("serverReboot", ServerRebootTaskArgs.builder()
.serviceName(rescue.applyValue(getServerBootsResult -> getServerBootsResult.serviceName()))
.keepers(serverOnRescue.bootId())
.build());
}
}
resources:
serverOnRescue:
type: ovh:Dedicated:ServerUpdate
properties:
serviceName: nsxxxxxxx.ip-xx-xx-xx.eu
bootId: ${rescue.results[0]}
monitoring: true
state: ok
serverReboot:
type: ovh:Dedicated:ServerRebootTask
properties:
serviceName: ${rescue.serviceName}
keepers:
- ${serverOnRescue.bootId}
variables:
rescue:
fn::invoke:
Function: ovh:Dedicated:getServerBoots
Arguments:
serviceName: nsxxxxxxx.ip-xx-xx-xx.eu
bootType: rescue
kernel: rescue64-pro
Create ServerRebootTask Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ServerRebootTask(name: string, args: ServerRebootTaskArgs, opts?: CustomResourceOptions);
@overload
def ServerRebootTask(resource_name: str,
args: ServerRebootTaskArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ServerRebootTask(resource_name: str,
opts: Optional[ResourceOptions] = None,
keepers: Optional[Sequence[str]] = None,
service_name: Optional[str] = None)
func NewServerRebootTask(ctx *Context, name string, args ServerRebootTaskArgs, opts ...ResourceOption) (*ServerRebootTask, error)
public ServerRebootTask(string name, ServerRebootTaskArgs args, CustomResourceOptions? opts = null)
public ServerRebootTask(String name, ServerRebootTaskArgs args)
public ServerRebootTask(String name, ServerRebootTaskArgs args, CustomResourceOptions options)
type: ovh:Dedicated:ServerRebootTask
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 ServerRebootTaskArgs
- 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 ServerRebootTaskArgs
- 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 ServerRebootTaskArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ServerRebootTaskArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ServerRebootTaskArgs
- 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 serverRebootTaskResource = new Ovh.Dedicated.ServerRebootTask("serverRebootTaskResource", new()
{
Keepers = new[]
{
"string",
},
ServiceName = "string",
});
example, err := Dedicated.NewServerRebootTask(ctx, "serverRebootTaskResource", &Dedicated.ServerRebootTaskArgs{
Keepers: pulumi.StringArray{
pulumi.String("string"),
},
ServiceName: pulumi.String("string"),
})
var serverRebootTaskResource = new ServerRebootTask("serverRebootTaskResource", ServerRebootTaskArgs.builder()
.keepers("string")
.serviceName("string")
.build());
server_reboot_task_resource = ovh.dedicated.ServerRebootTask("serverRebootTaskResource",
keepers=["string"],
service_name="string")
const serverRebootTaskResource = new ovh.dedicated.ServerRebootTask("serverRebootTaskResource", {
keepers: ["string"],
serviceName: "string",
});
type: ovh:Dedicated:ServerRebootTask
properties:
keepers:
- string
serviceName: string
ServerRebootTask Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The ServerRebootTask resource accepts the following input properties:
- Keepers List<string>
- List of values tracked to trigger reboot, used also to form implicit dependencies.
- Service
Name string - The service_name of your dedicated server.
- Keepers []string
- List of values tracked to trigger reboot, used also to form implicit dependencies.
- Service
Name string - The service_name of your dedicated server.
- keepers List<String>
- List of values tracked to trigger reboot, used also to form implicit dependencies.
- service
Name String - The service_name of your dedicated server.
- keepers string[]
- List of values tracked to trigger reboot, used also to form implicit dependencies.
- service
Name string - The service_name of your dedicated server.
- keepers Sequence[str]
- List of values tracked to trigger reboot, used also to form implicit dependencies.
- service_
name str - The service_name of your dedicated server.
- keepers List<String>
- List of values tracked to trigger reboot, used also to form implicit dependencies.
- service
Name String - The service_name of your dedicated server.
Outputs
All input properties are implicitly available as output properties. Additionally, the ServerRebootTask resource produces the following output properties:
- Comment string
- Details of this task. (should be
Reboot asked
) - Done
Date string - Completion date in RFC3339 format.
- Function string
- Function name (should be
hardReboot
). - Id string
- The provider-assigned unique ID for this managed resource.
- Last
Update string - Last update in RFC3339 format.
- Start
Date string - Task creation date in RFC3339 format.
- Status string
- Task status (should be
done
)
- Comment string
- Details of this task. (should be
Reboot asked
) - Done
Date string - Completion date in RFC3339 format.
- Function string
- Function name (should be
hardReboot
). - Id string
- The provider-assigned unique ID for this managed resource.
- Last
Update string - Last update in RFC3339 format.
- Start
Date string - Task creation date in RFC3339 format.
- Status string
- Task status (should be
done
)
- comment String
- Details of this task. (should be
Reboot asked
) - done
Date String - Completion date in RFC3339 format.
- function String
- Function name (should be
hardReboot
). - id String
- The provider-assigned unique ID for this managed resource.
- last
Update String - Last update in RFC3339 format.
- start
Date String - Task creation date in RFC3339 format.
- status String
- Task status (should be
done
)
- comment string
- Details of this task. (should be
Reboot asked
) - done
Date string - Completion date in RFC3339 format.
- function string
- Function name (should be
hardReboot
). - id string
- The provider-assigned unique ID for this managed resource.
- last
Update string - Last update in RFC3339 format.
- start
Date string - Task creation date in RFC3339 format.
- status string
- Task status (should be
done
)
- comment str
- Details of this task. (should be
Reboot asked
) - done_
date str - Completion date in RFC3339 format.
- function str
- Function name (should be
hardReboot
). - id str
- The provider-assigned unique ID for this managed resource.
- last_
update str - Last update in RFC3339 format.
- start_
date str - Task creation date in RFC3339 format.
- status str
- Task status (should be
done
)
- comment String
- Details of this task. (should be
Reboot asked
) - done
Date String - Completion date in RFC3339 format.
- function String
- Function name (should be
hardReboot
). - id String
- The provider-assigned unique ID for this managed resource.
- last
Update String - Last update in RFC3339 format.
- start
Date String - Task creation date in RFC3339 format.
- status String
- Task status (should be
done
)
Look up Existing ServerRebootTask Resource
Get an existing ServerRebootTask 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?: ServerRebootTaskState, opts?: CustomResourceOptions): ServerRebootTask
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
comment: Optional[str] = None,
done_date: Optional[str] = None,
function: Optional[str] = None,
keepers: Optional[Sequence[str]] = None,
last_update: Optional[str] = None,
service_name: Optional[str] = None,
start_date: Optional[str] = None,
status: Optional[str] = None) -> ServerRebootTask
func GetServerRebootTask(ctx *Context, name string, id IDInput, state *ServerRebootTaskState, opts ...ResourceOption) (*ServerRebootTask, error)
public static ServerRebootTask Get(string name, Input<string> id, ServerRebootTaskState? state, CustomResourceOptions? opts = null)
public static ServerRebootTask get(String name, Output<String> id, ServerRebootTaskState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- 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.
- Comment string
- Details of this task. (should be
Reboot asked
) - Done
Date string - Completion date in RFC3339 format.
- Function string
- Function name (should be
hardReboot
). - Keepers List<string>
- List of values tracked to trigger reboot, used also to form implicit dependencies.
- Last
Update string - Last update in RFC3339 format.
- Service
Name string - The service_name of your dedicated server.
- Start
Date string - Task creation date in RFC3339 format.
- Status string
- Task status (should be
done
)
- Comment string
- Details of this task. (should be
Reboot asked
) - Done
Date string - Completion date in RFC3339 format.
- Function string
- Function name (should be
hardReboot
). - Keepers []string
- List of values tracked to trigger reboot, used also to form implicit dependencies.
- Last
Update string - Last update in RFC3339 format.
- Service
Name string - The service_name of your dedicated server.
- Start
Date string - Task creation date in RFC3339 format.
- Status string
- Task status (should be
done
)
- comment String
- Details of this task. (should be
Reboot asked
) - done
Date String - Completion date in RFC3339 format.
- function String
- Function name (should be
hardReboot
). - keepers List<String>
- List of values tracked to trigger reboot, used also to form implicit dependencies.
- last
Update String - Last update in RFC3339 format.
- service
Name String - The service_name of your dedicated server.
- start
Date String - Task creation date in RFC3339 format.
- status String
- Task status (should be
done
)
- comment string
- Details of this task. (should be
Reboot asked
) - done
Date string - Completion date in RFC3339 format.
- function string
- Function name (should be
hardReboot
). - keepers string[]
- List of values tracked to trigger reboot, used also to form implicit dependencies.
- last
Update string - Last update in RFC3339 format.
- service
Name string - The service_name of your dedicated server.
- start
Date string - Task creation date in RFC3339 format.
- status string
- Task status (should be
done
)
- comment str
- Details of this task. (should be
Reboot asked
) - done_
date str - Completion date in RFC3339 format.
- function str
- Function name (should be
hardReboot
). - keepers Sequence[str]
- List of values tracked to trigger reboot, used also to form implicit dependencies.
- last_
update str - Last update in RFC3339 format.
- service_
name str - The service_name of your dedicated server.
- start_
date str - Task creation date in RFC3339 format.
- status str
- Task status (should be
done
)
- comment String
- Details of this task. (should be
Reboot asked
) - done
Date String - Completion date in RFC3339 format.
- function String
- Function name (should be
hardReboot
). - keepers List<String>
- List of values tracked to trigger reboot, used also to form implicit dependencies.
- last
Update String - Last update in RFC3339 format.
- service
Name String - The service_name of your dedicated server.
- start
Date String - Task creation date in RFC3339 format.
- status String
- Task status (should be
done
)
Package Details
- Repository
- ovh ovh/pulumi-ovh
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
ovh
Terraform Provider.