Class SnapshotPolicy
Provides an ECS snapshot policy resource.
For information about snapshot policy and how to use it, see Snapshot.
NOTE: Available in 1.42.0+.
Example Usage
using Pulumi;
using AliCloud = Pulumi.AliCloud;
class MyStack : Stack
{
public MyStack()
{
var sp = new AliCloud.Ecs.SnapshotPolicy("sp", new AliCloud.Ecs.SnapshotPolicyArgs
{
RepeatWeekdays =
{
"1",
"2",
"3",
},
RetentionDays = -1,
TimePoints =
{
"1",
"22",
"23",
},
});
}
}
Inherited Members
Namespace: Pulumi.AliCloud.Ecs
Assembly: Pulumi.AliCloud.dll
Syntax
public class SnapshotPolicy : CustomResource
Constructors
View SourceSnapshotPolicy(String, SnapshotPolicyArgs, CustomResourceOptions)
Create a SnapshotPolicy resource with the given unique name, arguments, and options.
Declaration
public SnapshotPolicy(string name, SnapshotPolicyArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| SnapshotPolicyArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceName
The snapshot policy name.
Declaration
public Output<string> Name { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
RepeatWeekdays
The automatic snapshot repetition dates. The unit of measurement is day and the repeating cycle is a week. Value range: [1, 7], which represents days starting from Monday to Sunday, for example 1 indicates Monday. When you want to schedule multiple automatic snapshot tasks for a disk in a week, you can set the RepeatWeekdays to an array.
- A maximum of seven time points can be selected.
- The format is an JSON array of ["1", "2", … "7"] and the time points are separated by commas (,).
Declaration
public Output<ImmutableArray<string>> RepeatWeekdays { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
RetentionDays
The snapshot retention time, and the unit of measurement is day. Optional values:
- -1: The automatic snapshots are retained permanently.
- [1, 65536]: The number of days retained.
Declaration
public Output<int> RetentionDays { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Int32> |
TimePoints
The automatic snapshot creation schedule, and the unit of measurement is hour. Value range: [0, 23], which represents from 00:00 to 24:00, for example 1 indicates 01:00. When you want to schedule multiple automatic snapshot tasks for a disk in a day, you can set the TimePoints to an array.
- A maximum of 24 time points can be selected.
- The format is an JSON array of ["0", "1", … "23"] and the time points are separated by commas (,).
Declaration
public Output<ImmutableArray<string>> TimePoints { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
Methods
View SourceGet(String, Input<String>, SnapshotPolicyState, CustomResourceOptions)
Get an existing SnapshotPolicy resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static SnapshotPolicy Get(string name, Input<string> id, SnapshotPolicyState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| SnapshotPolicyState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| SnapshotPolicy |