1. Packages
  2. Packages
  3. Oracle Cloud Infrastructure
  4. API Docs
  5. OsManagementHub
  6. getManagedInstanceSnaps
Viewing docs for Oracle Cloud Infrastructure v4.8.0
published on Friday, Apr 24, 2026 by Pulumi
oci logo
Viewing docs for Oracle Cloud Infrastructure v4.8.0
published on Friday, Apr 24, 2026 by Pulumi

    This data source provides the list of Managed Instance Snaps in Oracle Cloud Infrastructure Os Management Hub service.

    Retrieves a list of snaps for a managed instance. Filters may be applied to select a subset of snaps based on the filter criteria.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as oci from "@pulumi/oci";
    
    const testManagedInstanceSnaps = oci.OsManagementHub.getManagedInstanceSnaps({
        managedInstanceId: testManagedInstance.id,
        compartmentId: compartmentId,
        name: managedInstanceSnapName,
        nameContains: managedInstanceSnapNameContains,
    });
    
    import pulumi
    import pulumi_oci as oci
    
    test_managed_instance_snaps = oci.OsManagementHub.get_managed_instance_snaps(managed_instance_id=test_managed_instance["id"],
        compartment_id=compartment_id,
        name=managed_instance_snap_name,
        name_contains=managed_instance_snap_name_contains)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-oci/sdk/v4/go/oci/osmanagementhub"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := osmanagementhub.GetManagedInstanceSnaps(ctx, &osmanagementhub.GetManagedInstanceSnapsArgs{
    			ManagedInstanceId: testManagedInstance.Id,
    			CompartmentId:     pulumi.StringRef(compartmentId),
    			Name:              pulumi.StringRef(managedInstanceSnapName),
    			NameContains:      pulumi.StringRef(managedInstanceSnapNameContains),
    		}, 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 testManagedInstanceSnaps = Oci.OsManagementHub.GetManagedInstanceSnaps.Invoke(new()
        {
            ManagedInstanceId = testManagedInstance.Id,
            CompartmentId = compartmentId,
            Name = managedInstanceSnapName,
            NameContains = managedInstanceSnapNameContains,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.oci.OsManagementHub.OsManagementHubFunctions;
    import com.pulumi.oci.OsManagementHub.inputs.GetManagedInstanceSnapsArgs;
    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 testManagedInstanceSnaps = OsManagementHubFunctions.getManagedInstanceSnaps(GetManagedInstanceSnapsArgs.builder()
                .managedInstanceId(testManagedInstance.id())
                .compartmentId(compartmentId)
                .name(managedInstanceSnapName)
                .nameContains(managedInstanceSnapNameContains)
                .build());
    
        }
    }
    
    variables:
      testManagedInstanceSnaps:
        fn::invoke:
          function: oci:OsManagementHub:getManagedInstanceSnaps
          arguments:
            managedInstanceId: ${testManagedInstance.id}
            compartmentId: ${compartmentId}
            name: ${managedInstanceSnapName}
            nameContains: ${managedInstanceSnapNameContains}
    

    Using getManagedInstanceSnaps

    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 getManagedInstanceSnaps(args: GetManagedInstanceSnapsArgs, opts?: InvokeOptions): Promise<GetManagedInstanceSnapsResult>
    function getManagedInstanceSnapsOutput(args: GetManagedInstanceSnapsOutputArgs, opts?: InvokeOptions): Output<GetManagedInstanceSnapsResult>
    def get_managed_instance_snaps(compartment_id: Optional[str] = None,
                                   filters: Optional[Sequence[GetManagedInstanceSnapsFilter]] = None,
                                   managed_instance_id: Optional[str] = None,
                                   name: Optional[str] = None,
                                   name_contains: Optional[str] = None,
                                   opts: Optional[InvokeOptions] = None) -> GetManagedInstanceSnapsResult
    def get_managed_instance_snaps_output(compartment_id: Optional[pulumi.Input[str]] = None,
                                   filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetManagedInstanceSnapsFilterArgs]]]] = None,
                                   managed_instance_id: Optional[pulumi.Input[str]] = None,
                                   name: Optional[pulumi.Input[str]] = None,
                                   name_contains: Optional[pulumi.Input[str]] = None,
                                   opts: Optional[InvokeOptions] = None) -> Output[GetManagedInstanceSnapsResult]
    func GetManagedInstanceSnaps(ctx *Context, args *GetManagedInstanceSnapsArgs, opts ...InvokeOption) (*GetManagedInstanceSnapsResult, error)
    func GetManagedInstanceSnapsOutput(ctx *Context, args *GetManagedInstanceSnapsOutputArgs, opts ...InvokeOption) GetManagedInstanceSnapsResultOutput

    > Note: This function is named GetManagedInstanceSnaps in the Go SDK.

    public static class GetManagedInstanceSnaps 
    {
        public static Task<GetManagedInstanceSnapsResult> InvokeAsync(GetManagedInstanceSnapsArgs args, InvokeOptions? opts = null)
        public static Output<GetManagedInstanceSnapsResult> Invoke(GetManagedInstanceSnapsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetManagedInstanceSnapsResult> getManagedInstanceSnaps(GetManagedInstanceSnapsArgs args, InvokeOptions options)
    public static Output<GetManagedInstanceSnapsResult> getManagedInstanceSnaps(GetManagedInstanceSnapsArgs args, InvokeOptions options)
    
    fn::invoke:
      function: oci:OsManagementHub/getManagedInstanceSnaps:getManagedInstanceSnaps
      arguments:
        # arguments dictionary

    The following arguments are supported:

    ManagedInstanceId string
    The OCID of the managed instance.
    CompartmentId string
    The OCID of the compartment that contains the resources to list. This filter returns only resources contained within the specified compartment.
    Filters List<GetManagedInstanceSnapsFilter>
    Name string
    The resource name.
    NameContains string
    A filter to return resources that may partially match the name given.
    ManagedInstanceId string
    The OCID of the managed instance.
    CompartmentId string
    The OCID of the compartment that contains the resources to list. This filter returns only resources contained within the specified compartment.
    Filters []GetManagedInstanceSnapsFilter
    Name string
    The resource name.
    NameContains string
    A filter to return resources that may partially match the name given.
    managedInstanceId String
    The OCID of the managed instance.
    compartmentId String
    The OCID of the compartment that contains the resources to list. This filter returns only resources contained within the specified compartment.
    filters List<GetManagedInstanceSnapsFilter>
    name String
    The resource name.
    nameContains String
    A filter to return resources that may partially match the name given.
    managedInstanceId string
    The OCID of the managed instance.
    compartmentId string
    The OCID of the compartment that contains the resources to list. This filter returns only resources contained within the specified compartment.
    filters GetManagedInstanceSnapsFilter[]
    name string
    The resource name.
    nameContains string
    A filter to return resources that may partially match the name given.
    managed_instance_id str
    The OCID of the managed instance.
    compartment_id str
    The OCID of the compartment that contains the resources to list. This filter returns only resources contained within the specified compartment.
    filters Sequence[GetManagedInstanceSnapsFilter]
    name str
    The resource name.
    name_contains str
    A filter to return resources that may partially match the name given.
    managedInstanceId String
    The OCID of the managed instance.
    compartmentId String
    The OCID of the compartment that contains the resources to list. This filter returns only resources contained within the specified compartment.
    filters List<Property Map>
    name String
    The resource name.
    nameContains String
    A filter to return resources that may partially match the name given.

    getManagedInstanceSnaps Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    ManagedInstanceId string
    SnapCollections List<GetManagedInstanceSnapsSnapCollection>
    The list of snap_collection.
    CompartmentId string
    Filters List<GetManagedInstanceSnapsFilter>
    Name string
    The name of the snap.
    NameContains string
    Id string
    The provider-assigned unique ID for this managed resource.
    ManagedInstanceId string
    SnapCollections []GetManagedInstanceSnapsSnapCollection
    The list of snap_collection.
    CompartmentId string
    Filters []GetManagedInstanceSnapsFilter
    Name string
    The name of the snap.
    NameContains string
    id String
    The provider-assigned unique ID for this managed resource.
    managedInstanceId String
    snapCollections List<GetManagedInstanceSnapsSnapCollection>
    The list of snap_collection.
    compartmentId String
    filters List<GetManagedInstanceSnapsFilter>
    name String
    The name of the snap.
    nameContains String
    id string
    The provider-assigned unique ID for this managed resource.
    managedInstanceId string
    snapCollections GetManagedInstanceSnapsSnapCollection[]
    The list of snap_collection.
    compartmentId string
    filters GetManagedInstanceSnapsFilter[]
    name string
    The name of the snap.
    nameContains string
    id str
    The provider-assigned unique ID for this managed resource.
    managed_instance_id str
    snap_collections Sequence[GetManagedInstanceSnapsSnapCollection]
    The list of snap_collection.
    compartment_id str
    filters Sequence[GetManagedInstanceSnapsFilter]
    name str
    The name of the snap.
    name_contains str
    id String
    The provider-assigned unique ID for this managed resource.
    managedInstanceId String
    snapCollections List<Property Map>
    The list of snap_collection.
    compartmentId String
    filters List<Property Map>
    name String
    The name of the snap.
    nameContains String

    Supporting Types

    GetManagedInstanceSnapsFilter

    Name string
    The resource name.
    Values List<string>
    Regex bool
    Name string
    The resource name.
    Values []string
    Regex bool
    name String
    The resource name.
    values List<String>
    regex Boolean
    name string
    The resource name.
    values string[]
    regex boolean
    name str
    The resource name.
    values Sequence[str]
    regex bool
    name String
    The resource name.
    values List<String>
    regex Boolean

    GetManagedInstanceSnapsSnapCollection

    items List<Property Map>
    The list of snaps.

    GetManagedInstanceSnapsSnapCollectionItem

    Description string
    The description of of snap.
    Name string
    The resource name.
    Publisher string
    The publisher of the snap.
    Revision string
    The revision number of the snap channel.
    StoreUrl string
    The snap's store url.
    TimeRefreshed string
    The date and time of the snap's last refresh in RFC 3339 format.
    Tracking string
    The track this snap is following.
    Version string
    The version of the snap.
    Description string
    The description of of snap.
    Name string
    The resource name.
    Publisher string
    The publisher of the snap.
    Revision string
    The revision number of the snap channel.
    StoreUrl string
    The snap's store url.
    TimeRefreshed string
    The date and time of the snap's last refresh in RFC 3339 format.
    Tracking string
    The track this snap is following.
    Version string
    The version of the snap.
    description String
    The description of of snap.
    name String
    The resource name.
    publisher String
    The publisher of the snap.
    revision String
    The revision number of the snap channel.
    storeUrl String
    The snap's store url.
    timeRefreshed String
    The date and time of the snap's last refresh in RFC 3339 format.
    tracking String
    The track this snap is following.
    version String
    The version of the snap.
    description string
    The description of of snap.
    name string
    The resource name.
    publisher string
    The publisher of the snap.
    revision string
    The revision number of the snap channel.
    storeUrl string
    The snap's store url.
    timeRefreshed string
    The date and time of the snap's last refresh in RFC 3339 format.
    tracking string
    The track this snap is following.
    version string
    The version of the snap.
    description str
    The description of of snap.
    name str
    The resource name.
    publisher str
    The publisher of the snap.
    revision str
    The revision number of the snap channel.
    store_url str
    The snap's store url.
    time_refreshed str
    The date and time of the snap's last refresh in RFC 3339 format.
    tracking str
    The track this snap is following.
    version str
    The version of the snap.
    description String
    The description of of snap.
    name String
    The resource name.
    publisher String
    The publisher of the snap.
    revision String
    The revision number of the snap channel.
    storeUrl String
    The snap's store url.
    timeRefreshed String
    The date and time of the snap's last refresh in RFC 3339 format.
    tracking String
    The track this snap is following.
    version String
    The version of the snap.

    Package Details

    Repository
    oci pulumi/pulumi-oci
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the oci Terraform Provider.
    oci logo
    Viewing docs for Oracle Cloud Infrastructure v4.8.0
    published on Friday, Apr 24, 2026 by Pulumi
      Try Pulumi Cloud free. Your team will thank you.