oci.FileStorage.getSnapshots
Explore with Pulumi AI
This data source provides the list of Snapshots in Oracle Cloud Infrastructure File Storage service.
Lists snapshots of the specified file system, or by file system snapshot policy and compartment, or by file system snapshot policy and file system.
If file system ID is not specified, a file system snapshot policy ID and compartment ID must be specified.
Users can only sort by time created when listing snapshots by file system snapshot policy ID and compartment ID (sort by name is NOT supported for listing snapshots by policy and compartment).
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";
const testSnapshots = oci.FileStorage.getSnapshots({
compartmentId: compartmentId,
fileSystemId: testFileSystem.id,
filesystemSnapshotPolicyId: testFilesystemSnapshotPolicy.id,
id: snapshotId,
state: snapshotState,
});
import pulumi
import pulumi_oci as oci
test_snapshots = oci.FileStorage.get_snapshots(compartment_id=compartment_id,
file_system_id=test_file_system["id"],
filesystem_snapshot_policy_id=test_filesystem_snapshot_policy["id"],
id=snapshot_id,
state=snapshot_state)
package main
import (
"github.com/pulumi/pulumi-oci/sdk/go/oci/FileStorage"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := FileStorage.GetSnapshots(ctx, &filestorage.GetSnapshotsArgs{
CompartmentId: pulumi.StringRef(compartmentId),
FileSystemId: pulumi.StringRef(testFileSystem.Id),
FilesystemSnapshotPolicyId: pulumi.StringRef(testFilesystemSnapshotPolicy.Id),
Id: pulumi.StringRef(snapshotId),
State: pulumi.StringRef(snapshotState),
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Oci = Pulumi.Oci;
return await Deployment.RunAsync(() =>
{
var testSnapshots = Oci.FileStorage.GetSnapshots.Invoke(new()
{
CompartmentId = compartmentId,
FileSystemId = testFileSystem.Id,
FilesystemSnapshotPolicyId = testFilesystemSnapshotPolicy.Id,
Id = snapshotId,
State = snapshotState,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.oci.FileStorage.FileStorageFunctions;
import com.pulumi.oci.FileStorage.inputs.GetSnapshotsArgs;
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 testSnapshots = FileStorageFunctions.getSnapshots(GetSnapshotsArgs.builder()
.compartmentId(compartmentId)
.fileSystemId(testFileSystem.id())
.filesystemSnapshotPolicyId(testFilesystemSnapshotPolicy.id())
.id(snapshotId)
.state(snapshotState)
.build());
}
}
variables:
testSnapshots:
fn::invoke:
Function: oci:FileStorage:getSnapshots
Arguments:
compartmentId: ${compartmentId}
fileSystemId: ${testFileSystem.id}
filesystemSnapshotPolicyId: ${testFilesystemSnapshotPolicy.id}
id: ${snapshotId}
state: ${snapshotState}
Using getSnapshots
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 getSnapshots(args: GetSnapshotsArgs, opts?: InvokeOptions): Promise<GetSnapshotsResult>
function getSnapshotsOutput(args: GetSnapshotsOutputArgs, opts?: InvokeOptions): Output<GetSnapshotsResult>
def get_snapshots(compartment_id: Optional[str] = None,
file_system_id: Optional[str] = None,
filesystem_snapshot_policy_id: Optional[str] = None,
filters: Optional[Sequence[_filestorage.GetSnapshotsFilter]] = None,
id: Optional[str] = None,
state: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetSnapshotsResult
def get_snapshots_output(compartment_id: Optional[pulumi.Input[str]] = None,
file_system_id: Optional[pulumi.Input[str]] = None,
filesystem_snapshot_policy_id: Optional[pulumi.Input[str]] = None,
filters: Optional[pulumi.Input[Sequence[pulumi.Input[_filestorage.GetSnapshotsFilterArgs]]]] = None,
id: Optional[pulumi.Input[str]] = None,
state: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetSnapshotsResult]
func GetSnapshots(ctx *Context, args *GetSnapshotsArgs, opts ...InvokeOption) (*GetSnapshotsResult, error)
func GetSnapshotsOutput(ctx *Context, args *GetSnapshotsOutputArgs, opts ...InvokeOption) GetSnapshotsResultOutput
> Note: This function is named GetSnapshots
in the Go SDK.
public static class GetSnapshots
{
public static Task<GetSnapshotsResult> InvokeAsync(GetSnapshotsArgs args, InvokeOptions? opts = null)
public static Output<GetSnapshotsResult> Invoke(GetSnapshotsInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetSnapshotsResult> getSnapshots(GetSnapshotsArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: oci:FileStorage/getSnapshots:getSnapshots
arguments:
# arguments dictionary
The following arguments are supported:
- Compartment
Id string - The OCID of the compartment.
- File
System stringId - The OCID of the file system.
- Filesystem
Snapshot stringPolicy Id - The OCID of the file system snapshot policy that is used to create the snapshots.
- Filters
List<Get
Snapshots Filter> - Id string
- Filter results by OCID. Must be an OCID of the correct type for the resouce type.
- State string
- Filter results by the specified lifecycle state. Must be a valid state for the resource type.
- Compartment
Id string - The OCID of the compartment.
- File
System stringId - The OCID of the file system.
- Filesystem
Snapshot stringPolicy Id - The OCID of the file system snapshot policy that is used to create the snapshots.
- Filters
[]Get
Snapshots Filter - Id string
- Filter results by OCID. Must be an OCID of the correct type for the resouce type.
- State string
- Filter results by the specified lifecycle state. Must be a valid state for the resource type.
- compartment
Id String - The OCID of the compartment.
- file
System StringId - The OCID of the file system.
- filesystem
Snapshot StringPolicy Id - The OCID of the file system snapshot policy that is used to create the snapshots.
- filters
List<Get
Snapshots Filter> - id String
- Filter results by OCID. Must be an OCID of the correct type for the resouce type.
- state String
- Filter results by the specified lifecycle state. Must be a valid state for the resource type.
- compartment
Id string - The OCID of the compartment.
- file
System stringId - The OCID of the file system.
- filesystem
Snapshot stringPolicy Id - The OCID of the file system snapshot policy that is used to create the snapshots.
- filters
Get
Snapshots Filter[] - id string
- Filter results by OCID. Must be an OCID of the correct type for the resouce type.
- state string
- Filter results by the specified lifecycle state. Must be a valid state for the resource type.
- compartment_
id str - The OCID of the compartment.
- file_
system_ strid - The OCID of the file system.
- filesystem_
snapshot_ strpolicy_ id - The OCID of the file system snapshot policy that is used to create the snapshots.
- filters
Sequence[filestorage.
Get Snapshots Filter] - id str
- Filter results by OCID. Must be an OCID of the correct type for the resouce type.
- state str
- Filter results by the specified lifecycle state. Must be a valid state for the resource type.
- compartment
Id String - The OCID of the compartment.
- file
System StringId - The OCID of the file system.
- filesystem
Snapshot StringPolicy Id - The OCID of the file system snapshot policy that is used to create the snapshots.
- filters List<Property Map>
- id String
- Filter results by OCID. Must be an OCID of the correct type for the resouce type.
- state String
- Filter results by the specified lifecycle state. Must be a valid state for the resource type.
getSnapshots Result
The following output properties are available:
- Snapshots
List<Get
Snapshots Snapshot> - The list of snapshots.
- Compartment
Id string - File
System stringId - The OCID of the file system from which the snapshot was created.
- Filesystem
Snapshot stringPolicy Id - The OCID of the file system snapshot policy that created this snapshot.
- Filters
List<Get
Snapshots Filter> - Id string
- The OCID of the snapshot.
- State string
- The current state of the snapshot.
- Snapshots
[]Get
Snapshots Snapshot - The list of snapshots.
- Compartment
Id string - File
System stringId - The OCID of the file system from which the snapshot was created.
- Filesystem
Snapshot stringPolicy Id - The OCID of the file system snapshot policy that created this snapshot.
- Filters
[]Get
Snapshots Filter - Id string
- The OCID of the snapshot.
- State string
- The current state of the snapshot.
- snapshots
List<Get
Snapshots Snapshot> - The list of snapshots.
- compartment
Id String - file
System StringId - The OCID of the file system from which the snapshot was created.
- filesystem
Snapshot StringPolicy Id - The OCID of the file system snapshot policy that created this snapshot.
- filters
List<Get
Snapshots Filter> - id String
- The OCID of the snapshot.
- state String
- The current state of the snapshot.
- snapshots
Get
Snapshots Snapshot[] - The list of snapshots.
- compartment
Id string - file
System stringId - The OCID of the file system from which the snapshot was created.
- filesystem
Snapshot stringPolicy Id - The OCID of the file system snapshot policy that created this snapshot.
- filters
Get
Snapshots Filter[] - id string
- The OCID of the snapshot.
- state string
- The current state of the snapshot.
- snapshots
Sequence[filestorage.
Get Snapshots Snapshot] - The list of snapshots.
- compartment_
id str - file_
system_ strid - The OCID of the file system from which the snapshot was created.
- filesystem_
snapshot_ strpolicy_ id - The OCID of the file system snapshot policy that created this snapshot.
- filters
Sequence[filestorage.
Get Snapshots Filter] - id str
- The OCID of the snapshot.
- state str
- The current state of the snapshot.
- snapshots List<Property Map>
- The list of snapshots.
- compartment
Id String - file
System StringId - The OCID of the file system from which the snapshot was created.
- filesystem
Snapshot StringPolicy Id - The OCID of the file system snapshot policy that created this snapshot.
- filters List<Property Map>
- id String
- The OCID of the snapshot.
- state String
- The current state of the snapshot.
Supporting Types
GetSnapshotsFilter
GetSnapshotsSnapshot
- Dictionary<string, object>
- Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example:
{"Operations.CostCenter": "42"}
- Expiration
Time string - The time when this snapshot will be deleted.
- File
System stringId - The OCID of the file system.
- Filesystem
Snapshot stringPolicy Id - The OCID of the file system snapshot policy that is used to create the snapshots.
- Dictionary<string, object>
- Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example:
{"Department": "Finance"}
- Id string
- Filter results by OCID. Must be an OCID of the correct type for the resouce type.
- Is
Clone boolSource - Specifies whether the snapshot has been cloned. See Cloning a File System.
- Lifecycle
Details string - Additional information about the current
lifecycleState
. - Name string
- Name of the snapshot. This value is immutable.
- Provenance
Id string - An OCID identifying the parent from which this snapshot was cloned. If this snapshot was not cloned, then the
provenanceId
is the same as the snapshotid
value. If this snapshot was cloned, then theprovenanceId
value is the parent'sprovenanceId
. See Cloning a File System. - Snapshot
Time string - The date and time the snapshot was taken, expressed in RFC 3339 timestamp format. This value might be the same or different from
timeCreated
depending on the following factors:- If the snapshot is created in the original file system directory.
- If the snapshot is cloned from a file system.
- If the snapshot is replicated from a file system.
- Snapshot
Type string - Specifies the generation type of the snapshot.
- State string
- Filter results by the specified lifecycle state. Must be a valid state for the resource type.
- Time
Created string - The date and time the snapshot was created, expressed in RFC 3339 timestamp format. Example:
2016-08-25T21:10:29.600Z
- map[string]interface{}
- Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example:
{"Operations.CostCenter": "42"}
- Expiration
Time string - The time when this snapshot will be deleted.
- File
System stringId - The OCID of the file system.
- Filesystem
Snapshot stringPolicy Id - The OCID of the file system snapshot policy that is used to create the snapshots.
- map[string]interface{}
- Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example:
{"Department": "Finance"}
- Id string
- Filter results by OCID. Must be an OCID of the correct type for the resouce type.
- Is
Clone boolSource - Specifies whether the snapshot has been cloned. See Cloning a File System.
- Lifecycle
Details string - Additional information about the current
lifecycleState
. - Name string
- Name of the snapshot. This value is immutable.
- Provenance
Id string - An OCID identifying the parent from which this snapshot was cloned. If this snapshot was not cloned, then the
provenanceId
is the same as the snapshotid
value. If this snapshot was cloned, then theprovenanceId
value is the parent'sprovenanceId
. See Cloning a File System. - Snapshot
Time string - The date and time the snapshot was taken, expressed in RFC 3339 timestamp format. This value might be the same or different from
timeCreated
depending on the following factors:- If the snapshot is created in the original file system directory.
- If the snapshot is cloned from a file system.
- If the snapshot is replicated from a file system.
- Snapshot
Type string - Specifies the generation type of the snapshot.
- State string
- Filter results by the specified lifecycle state. Must be a valid state for the resource type.
- Time
Created string - The date and time the snapshot was created, expressed in RFC 3339 timestamp format. Example:
2016-08-25T21:10:29.600Z
- Map<String,Object>
- Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example:
{"Operations.CostCenter": "42"}
- expiration
Time String - The time when this snapshot will be deleted.
- file
System StringId - The OCID of the file system.
- filesystem
Snapshot StringPolicy Id - The OCID of the file system snapshot policy that is used to create the snapshots.
- Map<String,Object>
- Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example:
{"Department": "Finance"}
- id String
- Filter results by OCID. Must be an OCID of the correct type for the resouce type.
- is
Clone BooleanSource - Specifies whether the snapshot has been cloned. See Cloning a File System.
- lifecycle
Details String - Additional information about the current
lifecycleState
. - name String
- Name of the snapshot. This value is immutable.
- provenance
Id String - An OCID identifying the parent from which this snapshot was cloned. If this snapshot was not cloned, then the
provenanceId
is the same as the snapshotid
value. If this snapshot was cloned, then theprovenanceId
value is the parent'sprovenanceId
. See Cloning a File System. - snapshot
Time String - The date and time the snapshot was taken, expressed in RFC 3339 timestamp format. This value might be the same or different from
timeCreated
depending on the following factors:- If the snapshot is created in the original file system directory.
- If the snapshot is cloned from a file system.
- If the snapshot is replicated from a file system.
- snapshot
Type String - Specifies the generation type of the snapshot.
- state String
- Filter results by the specified lifecycle state. Must be a valid state for the resource type.
- time
Created String - The date and time the snapshot was created, expressed in RFC 3339 timestamp format. Example:
2016-08-25T21:10:29.600Z
- {[key: string]: any}
- Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example:
{"Operations.CostCenter": "42"}
- expiration
Time string - The time when this snapshot will be deleted.
- file
System stringId - The OCID of the file system.
- filesystem
Snapshot stringPolicy Id - The OCID of the file system snapshot policy that is used to create the snapshots.
- {[key: string]: any}
- Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example:
{"Department": "Finance"}
- id string
- Filter results by OCID. Must be an OCID of the correct type for the resouce type.
- is
Clone booleanSource - Specifies whether the snapshot has been cloned. See Cloning a File System.
- lifecycle
Details string - Additional information about the current
lifecycleState
. - name string
- Name of the snapshot. This value is immutable.
- provenance
Id string - An OCID identifying the parent from which this snapshot was cloned. If this snapshot was not cloned, then the
provenanceId
is the same as the snapshotid
value. If this snapshot was cloned, then theprovenanceId
value is the parent'sprovenanceId
. See Cloning a File System. - snapshot
Time string - The date and time the snapshot was taken, expressed in RFC 3339 timestamp format. This value might be the same or different from
timeCreated
depending on the following factors:- If the snapshot is created in the original file system directory.
- If the snapshot is cloned from a file system.
- If the snapshot is replicated from a file system.
- snapshot
Type string - Specifies the generation type of the snapshot.
- state string
- Filter results by the specified lifecycle state. Must be a valid state for the resource type.
- time
Created string - The date and time the snapshot was created, expressed in RFC 3339 timestamp format. Example:
2016-08-25T21:10:29.600Z
- Mapping[str, Any]
- Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example:
{"Operations.CostCenter": "42"}
- expiration_
time str - The time when this snapshot will be deleted.
- file_
system_ strid - The OCID of the file system.
- filesystem_
snapshot_ strpolicy_ id - The OCID of the file system snapshot policy that is used to create the snapshots.
- Mapping[str, Any]
- Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example:
{"Department": "Finance"}
- id str
- Filter results by OCID. Must be an OCID of the correct type for the resouce type.
- is_
clone_ boolsource - Specifies whether the snapshot has been cloned. See Cloning a File System.
- lifecycle_
details str - Additional information about the current
lifecycleState
. - name str
- Name of the snapshot. This value is immutable.
- provenance_
id str - An OCID identifying the parent from which this snapshot was cloned. If this snapshot was not cloned, then the
provenanceId
is the same as the snapshotid
value. If this snapshot was cloned, then theprovenanceId
value is the parent'sprovenanceId
. See Cloning a File System. - snapshot_
time str - The date and time the snapshot was taken, expressed in RFC 3339 timestamp format. This value might be the same or different from
timeCreated
depending on the following factors:- If the snapshot is created in the original file system directory.
- If the snapshot is cloned from a file system.
- If the snapshot is replicated from a file system.
- snapshot_
type str - Specifies the generation type of the snapshot.
- state str
- Filter results by the specified lifecycle state. Must be a valid state for the resource type.
- time_
created str - The date and time the snapshot was created, expressed in RFC 3339 timestamp format. Example:
2016-08-25T21:10:29.600Z
- Map<Any>
- Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example:
{"Operations.CostCenter": "42"}
- expiration
Time String - The time when this snapshot will be deleted.
- file
System StringId - The OCID of the file system.
- filesystem
Snapshot StringPolicy Id - The OCID of the file system snapshot policy that is used to create the snapshots.
- Map<Any>
- Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example:
{"Department": "Finance"}
- id String
- Filter results by OCID. Must be an OCID of the correct type for the resouce type.
- is
Clone BooleanSource - Specifies whether the snapshot has been cloned. See Cloning a File System.
- lifecycle
Details String - Additional information about the current
lifecycleState
. - name String
- Name of the snapshot. This value is immutable.
- provenance
Id String - An OCID identifying the parent from which this snapshot was cloned. If this snapshot was not cloned, then the
provenanceId
is the same as the snapshotid
value. If this snapshot was cloned, then theprovenanceId
value is the parent'sprovenanceId
. See Cloning a File System. - snapshot
Time String - The date and time the snapshot was taken, expressed in RFC 3339 timestamp format. This value might be the same or different from
timeCreated
depending on the following factors:- If the snapshot is created in the original file system directory.
- If the snapshot is cloned from a file system.
- If the snapshot is replicated from a file system.
- snapshot
Type String - Specifies the generation type of the snapshot.
- state String
- Filter results by the specified lifecycle state. Must be a valid state for the resource type.
- time
Created String - The date and time the snapshot was created, expressed in RFC 3339 timestamp format. Example:
2016-08-25T21:10:29.600Z
Package Details
- Repository
- oci pulumi/pulumi-oci
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
oci
Terraform Provider.