快照是一种备份方式,每个快照都是文件存储在某个时间点的备份。当数据丢失或故障时,您可以通过快照恢复文件存储数据,找回丢失的数据。
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as bytepluscc from "@byteplus/pulumi-bytepluscc";
const fileNASSnapshotDemo = new bytepluscc.filenas.Snapshot("FileNASSnapshotDemo", {
fileSystemId: "enas-apse1a059****",
snapshotName: "FileNASSnapshotDemo",
description: "FileNASSnapshotDemo description",
});
import pulumi
import pulumi_bytepluscc as bytepluscc
file_nas_snapshot_demo = bytepluscc.filenas.Snapshot("FileNASSnapshotDemo",
file_system_id="enas-apse1a059****",
snapshot_name="FileNASSnapshotDemo",
description="FileNASSnapshotDemo description")
package main
import (
"github.com/byteplus-sdk/pulumi-bytepluscc/sdk/go/bytepluscc/filenas"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := filenas.NewSnapshot(ctx, "FileNASSnapshotDemo", &filenas.SnapshotArgs{
FileSystemId: pulumi.String("enas-apse1a059****"),
SnapshotName: pulumi.String("FileNASSnapshotDemo"),
Description: pulumi.String("FileNASSnapshotDemo description"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Bytepluscc = Byteplus.Pulumi.Bytepluscc;
return await Deployment.RunAsync(() =>
{
var fileNASSnapshotDemo = new Bytepluscc.Filenas.Snapshot("FileNASSnapshotDemo", new()
{
FileSystemId = "enas-apse1a059****",
SnapshotName = "FileNASSnapshotDemo",
Description = "FileNASSnapshotDemo description",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.byteplus.bytepluscc.filenas.Snapshot;
import com.byteplus.bytepluscc.filenas.SnapshotArgs;
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) {
var fileNASSnapshotDemo = new Snapshot("fileNASSnapshotDemo", SnapshotArgs.builder()
.fileSystemId("enas-apse1a059****")
.snapshotName("FileNASSnapshotDemo")
.description("FileNASSnapshotDemo description")
.build());
}
}
resources:
fileNASSnapshotDemo:
type: bytepluscc:filenas:Snapshot
name: FileNASSnapshotDemo
properties:
fileSystemId: enas-apse1a059****
snapshotName: FileNASSnapshotDemo
description: FileNASSnapshotDemo description
Create Snapshot Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Snapshot(name: string, args: SnapshotArgs, opts?: CustomResourceOptions);@overload
def Snapshot(resource_name: str,
args: SnapshotArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Snapshot(resource_name: str,
opts: Optional[ResourceOptions] = None,
file_system_id: Optional[str] = None,
snapshot_name: Optional[str] = None,
description: Optional[str] = None)func NewSnapshot(ctx *Context, name string, args SnapshotArgs, opts ...ResourceOption) (*Snapshot, error)public Snapshot(string name, SnapshotArgs args, CustomResourceOptions? opts = null)
public Snapshot(String name, SnapshotArgs args)
public Snapshot(String name, SnapshotArgs args, CustomResourceOptions options)
type: bytepluscc:filenas:Snapshot
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 SnapshotArgs
- 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 SnapshotArgs
- 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 SnapshotArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args SnapshotArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args SnapshotArgs
- 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 snapshotResource = new Bytepluscc.Filenas.Snapshot("snapshotResource", new()
{
FileSystemId = "string",
SnapshotName = "string",
Description = "string",
});
example, err := filenas.NewSnapshot(ctx, "snapshotResource", &filenas.SnapshotArgs{
FileSystemId: pulumi.String("string"),
SnapshotName: pulumi.String("string"),
Description: pulumi.String("string"),
})
var snapshotResource = new com.byteplus.bytepluscc.filenas.Snapshot("snapshotResource", com.byteplus.bytepluscc.filenas.SnapshotArgs.builder()
.fileSystemId("string")
.snapshotName("string")
.description("string")
.build());
snapshot_resource = bytepluscc.filenas.Snapshot("snapshotResource",
file_system_id="string",
snapshot_name="string",
description="string")
const snapshotResource = new bytepluscc.filenas.Snapshot("snapshotResource", {
fileSystemId: "string",
snapshotName: "string",
description: "string",
});
type: bytepluscc:filenas:Snapshot
properties:
description: string
fileSystemId: string
snapshotName: string
Snapshot 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 Snapshot resource accepts the following input properties:
- File
System stringId - 文件系统 ID。
- Snapshot
Name string - 快照名称。
- Description string
- 快照描述信息。
- File
System stringId - 文件系统 ID。
- Snapshot
Name string - 快照名称。
- Description string
- 快照描述信息。
- file
System StringId - 文件系统 ID。
- snapshot
Name String - 快照名称。
- description String
- 快照描述信息。
- file
System stringId - 文件系统 ID。
- snapshot
Name string - 快照名称。
- description string
- 快照描述信息。
- file_
system_ strid - 文件系统 ID。
- snapshot_
name str - 快照名称。
- description str
- 快照描述信息。
- file
System StringId - 文件系统 ID。
- snapshot
Name String - 快照名称。
- description String
- 快照描述信息。
Outputs
All input properties are implicitly available as output properties. Additionally, the Snapshot resource produces the following output properties:
- Created
Time string - 快照创建时间。
- File
System stringName - 文件系统名称。
- Id string
- The provider-assigned unique ID for this managed resource.
- Is
Encrypt bool - 是否加密,当前仅支持false,即不加密。
- Progress string
- 快照创建进度。
- Retention
Days int - 快照保留时间,默认为2147483647,即永久保留。
- Snapshot
Id string - 快照 ID。
- Snapshot
Type string - 快照类型,默认为Manual,即手动快照。
- Source
Size int - 文件系统容量,单位为 GiB。
- Source
Version string - 文件系统版本。
- Status string
- 快照状态。说明如下:Progressing:正在创建。Accomplished:创建成功。Failed:创建失败。
- Zone
Id string - 可用区 ID。
- Created
Time string - 快照创建时间。
- File
System stringName - 文件系统名称。
- Id string
- The provider-assigned unique ID for this managed resource.
- Is
Encrypt bool - 是否加密,当前仅支持false,即不加密。
- Progress string
- 快照创建进度。
- Retention
Days int - 快照保留时间,默认为2147483647,即永久保留。
- Snapshot
Id string - 快照 ID。
- Snapshot
Type string - 快照类型,默认为Manual,即手动快照。
- Source
Size int - 文件系统容量,单位为 GiB。
- Source
Version string - 文件系统版本。
- Status string
- 快照状态。说明如下:Progressing:正在创建。Accomplished:创建成功。Failed:创建失败。
- Zone
Id string - 可用区 ID。
- created
Time String - 快照创建时间。
- file
System StringName - 文件系统名称。
- id String
- The provider-assigned unique ID for this managed resource.
- is
Encrypt Boolean - 是否加密,当前仅支持false,即不加密。
- progress String
- 快照创建进度。
- retention
Days Integer - 快照保留时间,默认为2147483647,即永久保留。
- snapshot
Id String - 快照 ID。
- snapshot
Type String - 快照类型,默认为Manual,即手动快照。
- source
Size Integer - 文件系统容量,单位为 GiB。
- source
Version String - 文件系统版本。
- status String
- 快照状态。说明如下:Progressing:正在创建。Accomplished:创建成功。Failed:创建失败。
- zone
Id String - 可用区 ID。
- created
Time string - 快照创建时间。
- file
System stringName - 文件系统名称。
- id string
- The provider-assigned unique ID for this managed resource.
- is
Encrypt boolean - 是否加密,当前仅支持false,即不加密。
- progress string
- 快照创建进度。
- retention
Days number - 快照保留时间,默认为2147483647,即永久保留。
- snapshot
Id string - 快照 ID。
- snapshot
Type string - 快照类型,默认为Manual,即手动快照。
- source
Size number - 文件系统容量,单位为 GiB。
- source
Version string - 文件系统版本。
- status string
- 快照状态。说明如下:Progressing:正在创建。Accomplished:创建成功。Failed:创建失败。
- zone
Id string - 可用区 ID。
- created_
time str - 快照创建时间。
- file_
system_ strname - 文件系统名称。
- id str
- The provider-assigned unique ID for this managed resource.
- is_
encrypt bool - 是否加密,当前仅支持false,即不加密。
- progress str
- 快照创建进度。
- retention_
days int - 快照保留时间,默认为2147483647,即永久保留。
- snapshot_
id str - 快照 ID。
- snapshot_
type str - 快照类型,默认为Manual,即手动快照。
- source_
size int - 文件系统容量,单位为 GiB。
- source_
version str - 文件系统版本。
- status str
- 快照状态。说明如下:Progressing:正在创建。Accomplished:创建成功。Failed:创建失败。
- zone_
id str - 可用区 ID。
- created
Time String - 快照创建时间。
- file
System StringName - 文件系统名称。
- id String
- The provider-assigned unique ID for this managed resource.
- is
Encrypt Boolean - 是否加密,当前仅支持false,即不加密。
- progress String
- 快照创建进度。
- retention
Days Number - 快照保留时间,默认为2147483647,即永久保留。
- snapshot
Id String - 快照 ID。
- snapshot
Type String - 快照类型,默认为Manual,即手动快照。
- source
Size Number - 文件系统容量,单位为 GiB。
- source
Version String - 文件系统版本。
- status String
- 快照状态。说明如下:Progressing:正在创建。Accomplished:创建成功。Failed:创建失败。
- zone
Id String - 可用区 ID。
Look up Existing Snapshot Resource
Get an existing Snapshot 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?: SnapshotState, opts?: CustomResourceOptions): Snapshot@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
created_time: Optional[str] = None,
description: Optional[str] = None,
file_system_id: Optional[str] = None,
file_system_name: Optional[str] = None,
is_encrypt: Optional[bool] = None,
progress: Optional[str] = None,
retention_days: Optional[int] = None,
snapshot_id: Optional[str] = None,
snapshot_name: Optional[str] = None,
snapshot_type: Optional[str] = None,
source_size: Optional[int] = None,
source_version: Optional[str] = None,
status: Optional[str] = None,
zone_id: Optional[str] = None) -> Snapshotfunc GetSnapshot(ctx *Context, name string, id IDInput, state *SnapshotState, opts ...ResourceOption) (*Snapshot, error)public static Snapshot Get(string name, Input<string> id, SnapshotState? state, CustomResourceOptions? opts = null)public static Snapshot get(String name, Output<String> id, SnapshotState state, CustomResourceOptions options)resources: _: type: bytepluscc:filenas:Snapshot 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.
- Created
Time string - 快照创建时间。
- Description string
- 快照描述信息。
- File
System stringId - 文件系统 ID。
- File
System stringName - 文件系统名称。
- Is
Encrypt bool - 是否加密,当前仅支持false,即不加密。
- Progress string
- 快照创建进度。
- Retention
Days int - 快照保留时间,默认为2147483647,即永久保留。
- Snapshot
Id string - 快照 ID。
- Snapshot
Name string - 快照名称。
- Snapshot
Type string - 快照类型,默认为Manual,即手动快照。
- Source
Size int - 文件系统容量,单位为 GiB。
- Source
Version string - 文件系统版本。
- Status string
- 快照状态。说明如下:Progressing:正在创建。Accomplished:创建成功。Failed:创建失败。
- Zone
Id string - 可用区 ID。
- Created
Time string - 快照创建时间。
- Description string
- 快照描述信息。
- File
System stringId - 文件系统 ID。
- File
System stringName - 文件系统名称。
- Is
Encrypt bool - 是否加密,当前仅支持false,即不加密。
- Progress string
- 快照创建进度。
- Retention
Days int - 快照保留时间,默认为2147483647,即永久保留。
- Snapshot
Id string - 快照 ID。
- Snapshot
Name string - 快照名称。
- Snapshot
Type string - 快照类型,默认为Manual,即手动快照。
- Source
Size int - 文件系统容量,单位为 GiB。
- Source
Version string - 文件系统版本。
- Status string
- 快照状态。说明如下:Progressing:正在创建。Accomplished:创建成功。Failed:创建失败。
- Zone
Id string - 可用区 ID。
- created
Time String - 快照创建时间。
- description String
- 快照描述信息。
- file
System StringId - 文件系统 ID。
- file
System StringName - 文件系统名称。
- is
Encrypt Boolean - 是否加密,当前仅支持false,即不加密。
- progress String
- 快照创建进度。
- retention
Days Integer - 快照保留时间,默认为2147483647,即永久保留。
- snapshot
Id String - 快照 ID。
- snapshot
Name String - 快照名称。
- snapshot
Type String - 快照类型,默认为Manual,即手动快照。
- source
Size Integer - 文件系统容量,单位为 GiB。
- source
Version String - 文件系统版本。
- status String
- 快照状态。说明如下:Progressing:正在创建。Accomplished:创建成功。Failed:创建失败。
- zone
Id String - 可用区 ID。
- created
Time string - 快照创建时间。
- description string
- 快照描述信息。
- file
System stringId - 文件系统 ID。
- file
System stringName - 文件系统名称。
- is
Encrypt boolean - 是否加密,当前仅支持false,即不加密。
- progress string
- 快照创建进度。
- retention
Days number - 快照保留时间,默认为2147483647,即永久保留。
- snapshot
Id string - 快照 ID。
- snapshot
Name string - 快照名称。
- snapshot
Type string - 快照类型,默认为Manual,即手动快照。
- source
Size number - 文件系统容量,单位为 GiB。
- source
Version string - 文件系统版本。
- status string
- 快照状态。说明如下:Progressing:正在创建。Accomplished:创建成功。Failed:创建失败。
- zone
Id string - 可用区 ID。
- created_
time str - 快照创建时间。
- description str
- 快照描述信息。
- file_
system_ strid - 文件系统 ID。
- file_
system_ strname - 文件系统名称。
- is_
encrypt bool - 是否加密,当前仅支持false,即不加密。
- progress str
- 快照创建进度。
- retention_
days int - 快照保留时间,默认为2147483647,即永久保留。
- snapshot_
id str - 快照 ID。
- snapshot_
name str - 快照名称。
- snapshot_
type str - 快照类型,默认为Manual,即手动快照。
- source_
size int - 文件系统容量,单位为 GiB。
- source_
version str - 文件系统版本。
- status str
- 快照状态。说明如下:Progressing:正在创建。Accomplished:创建成功。Failed:创建失败。
- zone_
id str - 可用区 ID。
- created
Time String - 快照创建时间。
- description String
- 快照描述信息。
- file
System StringId - 文件系统 ID。
- file
System StringName - 文件系统名称。
- is
Encrypt Boolean - 是否加密,当前仅支持false,即不加密。
- progress String
- 快照创建进度。
- retention
Days Number - 快照保留时间,默认为2147483647,即永久保留。
- snapshot
Id String - 快照 ID。
- snapshot
Name String - 快照名称。
- snapshot
Type String - 快照类型,默认为Manual,即手动快照。
- source
Size Number - 文件系统容量,单位为 GiB。
- source
Version String - 文件系统版本。
- status String
- 快照状态。说明如下:Progressing:正在创建。Accomplished:创建成功。Failed:创建失败。
- zone
Id String - 可用区 ID。
Import
$ pulumi import bytepluscc:filenas/snapshot:Snapshot example "snapshot_id"
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- bytepluscc byteplus-sdk/pulumi-bytepluscc
- License
- MPL-2.0
- Notes
- This Pulumi package is based on the
byteplusccTerraform Provider.
