Oracle Cloud Infrastructure v2.33.0 published on Thursday, May 1, 2025 by Pulumi
oci.Core.getConsoleHistories
Explore with Pulumi AI
This data source provides the list of Console Histories in Oracle Cloud Infrastructure Core service.
Lists the console history metadata for the specified compartment or instance.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";
const testConsoleHistories = oci.Core.getConsoleHistories({
    compartmentId: compartmentId,
    availabilityDomain: consoleHistoryAvailabilityDomain,
    instanceId: testInstance.id,
    state: consoleHistoryState,
});
import pulumi
import pulumi_oci as oci
test_console_histories = oci.Core.get_console_histories(compartment_id=compartment_id,
    availability_domain=console_history_availability_domain,
    instance_id=test_instance["id"],
    state=console_history_state)
package main
import (
	"github.com/pulumi/pulumi-oci/sdk/v2/go/oci/core"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := core.GetConsoleHistories(ctx, &core.GetConsoleHistoriesArgs{
			CompartmentId:      compartmentId,
			AvailabilityDomain: pulumi.StringRef(consoleHistoryAvailabilityDomain),
			InstanceId:         pulumi.StringRef(testInstance.Id),
			State:              pulumi.StringRef(consoleHistoryState),
		}, 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 testConsoleHistories = Oci.Core.GetConsoleHistories.Invoke(new()
    {
        CompartmentId = compartmentId,
        AvailabilityDomain = consoleHistoryAvailabilityDomain,
        InstanceId = testInstance.Id,
        State = consoleHistoryState,
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.oci.Core.CoreFunctions;
import com.pulumi.oci.Core.inputs.GetConsoleHistoriesArgs;
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 testConsoleHistories = CoreFunctions.getConsoleHistories(GetConsoleHistoriesArgs.builder()
            .compartmentId(compartmentId)
            .availabilityDomain(consoleHistoryAvailabilityDomain)
            .instanceId(testInstance.id())
            .state(consoleHistoryState)
            .build());
    }
}
variables:
  testConsoleHistories:
    fn::invoke:
      function: oci:Core:getConsoleHistories
      arguments:
        compartmentId: ${compartmentId}
        availabilityDomain: ${consoleHistoryAvailabilityDomain}
        instanceId: ${testInstance.id}
        state: ${consoleHistoryState}
Using getConsoleHistories
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 getConsoleHistories(args: GetConsoleHistoriesArgs, opts?: InvokeOptions): Promise<GetConsoleHistoriesResult>
function getConsoleHistoriesOutput(args: GetConsoleHistoriesOutputArgs, opts?: InvokeOptions): Output<GetConsoleHistoriesResult>def get_console_histories(availability_domain: Optional[str] = None,
                          compartment_id: Optional[str] = None,
                          filters: Optional[Sequence[GetConsoleHistoriesFilter]] = None,
                          instance_id: Optional[str] = None,
                          state: Optional[str] = None,
                          opts: Optional[InvokeOptions] = None) -> GetConsoleHistoriesResult
def get_console_histories_output(availability_domain: Optional[pulumi.Input[str]] = None,
                          compartment_id: Optional[pulumi.Input[str]] = None,
                          filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetConsoleHistoriesFilterArgs]]]] = None,
                          instance_id: Optional[pulumi.Input[str]] = None,
                          state: Optional[pulumi.Input[str]] = None,
                          opts: Optional[InvokeOptions] = None) -> Output[GetConsoleHistoriesResult]func GetConsoleHistories(ctx *Context, args *GetConsoleHistoriesArgs, opts ...InvokeOption) (*GetConsoleHistoriesResult, error)
func GetConsoleHistoriesOutput(ctx *Context, args *GetConsoleHistoriesOutputArgs, opts ...InvokeOption) GetConsoleHistoriesResultOutput> Note: This function is named GetConsoleHistories in the Go SDK.
public static class GetConsoleHistories 
{
    public static Task<GetConsoleHistoriesResult> InvokeAsync(GetConsoleHistoriesArgs args, InvokeOptions? opts = null)
    public static Output<GetConsoleHistoriesResult> Invoke(GetConsoleHistoriesInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetConsoleHistoriesResult> getConsoleHistories(GetConsoleHistoriesArgs args, InvokeOptions options)
public static Output<GetConsoleHistoriesResult> getConsoleHistories(GetConsoleHistoriesArgs args, InvokeOptions options)
fn::invoke:
  function: oci:Core/getConsoleHistories:getConsoleHistories
  arguments:
    # arguments dictionaryThe following arguments are supported:
- CompartmentId string
- The OCID of the compartment.
- AvailabilityDomain string
- The name of the availability domain. Example: Uocm:PHX-AD-1
- Filters
List<GetConsole Histories Filter> 
- InstanceId string
- The OCID of the instance.
- State string
- A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
- CompartmentId string
- The OCID of the compartment.
- AvailabilityDomain string
- The name of the availability domain. Example: Uocm:PHX-AD-1
- Filters
[]GetConsole Histories Filter 
- InstanceId string
- The OCID of the instance.
- State string
- A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
- compartmentId String
- The OCID of the compartment.
- availabilityDomain String
- The name of the availability domain. Example: Uocm:PHX-AD-1
- filters
List<GetConsole Histories Filter> 
- instanceId String
- The OCID of the instance.
- state String
- A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
- compartmentId string
- The OCID of the compartment.
- availabilityDomain string
- The name of the availability domain. Example: Uocm:PHX-AD-1
- filters
GetConsole Histories Filter[] 
- instanceId string
- The OCID of the instance.
- state string
- A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
- compartment_id str
- The OCID of the compartment.
- availability_domain str
- The name of the availability domain. Example: Uocm:PHX-AD-1
- filters
Sequence[GetConsole Histories Filter] 
- instance_id str
- The OCID of the instance.
- state str
- A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
- compartmentId String
- The OCID of the compartment.
- availabilityDomain String
- The name of the availability domain. Example: Uocm:PHX-AD-1
- filters List<Property Map>
- instanceId String
- The OCID of the instance.
- state String
- A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
getConsoleHistories Result
The following output properties are available:
- CompartmentId string
- The OCID of the compartment.
- ConsoleHistories List<GetConsole Histories Console History> 
- The list of console_histories.
- Id string
- The provider-assigned unique ID for this managed resource.
- AvailabilityDomain string
- The availability domain of an instance. Example: Uocm:PHX-AD-1
- Filters
List<GetConsole Histories Filter> 
- InstanceId string
- The OCID of the instance this console history was fetched from.
- State string
- The current state of the console history.
- CompartmentId string
- The OCID of the compartment.
- ConsoleHistories []GetConsole Histories Console History 
- The list of console_histories.
- Id string
- The provider-assigned unique ID for this managed resource.
- AvailabilityDomain string
- The availability domain of an instance. Example: Uocm:PHX-AD-1
- Filters
[]GetConsole Histories Filter 
- InstanceId string
- The OCID of the instance this console history was fetched from.
- State string
- The current state of the console history.
- compartmentId String
- The OCID of the compartment.
- consoleHistories List<GetConsole Histories Console History> 
- The list of console_histories.
- id String
- The provider-assigned unique ID for this managed resource.
- availabilityDomain String
- The availability domain of an instance. Example: Uocm:PHX-AD-1
- filters
List<GetConsole Histories Filter> 
- instanceId String
- The OCID of the instance this console history was fetched from.
- state String
- The current state of the console history.
- compartmentId string
- The OCID of the compartment.
- consoleHistories GetConsole Histories Console History[] 
- The list of console_histories.
- id string
- The provider-assigned unique ID for this managed resource.
- availabilityDomain string
- The availability domain of an instance. Example: Uocm:PHX-AD-1
- filters
GetConsole Histories Filter[] 
- instanceId string
- The OCID of the instance this console history was fetched from.
- state string
- The current state of the console history.
- compartment_id str
- The OCID of the compartment.
- console_histories Sequence[GetConsole Histories Console History] 
- The list of console_histories.
- id str
- The provider-assigned unique ID for this managed resource.
- availability_domain str
- The availability domain of an instance. Example: Uocm:PHX-AD-1
- filters
Sequence[GetConsole Histories Filter] 
- instance_id str
- The OCID of the instance this console history was fetched from.
- state str
- The current state of the console history.
- compartmentId String
- The OCID of the compartment.
- consoleHistories List<Property Map>
- The list of console_histories.
- id String
- The provider-assigned unique ID for this managed resource.
- availabilityDomain String
- The availability domain of an instance. Example: Uocm:PHX-AD-1
- filters List<Property Map>
- instanceId String
- The OCID of the instance this console history was fetched from.
- state String
- The current state of the console history.
Supporting Types
GetConsoleHistoriesConsoleHistory    
- AvailabilityDomain string
- The name of the availability domain. Example: Uocm:PHX-AD-1
- CompartmentId string
- The OCID of the compartment.
- Dictionary<string, string>
- Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
- DisplayName string
- A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
- Dictionary<string, string>
- 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
- The OCID of the console history metadata object.
- InstanceId string
- The OCID of the instance.
- State string
- A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
- TimeCreated string
- The date and time the history was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
- AvailabilityDomain string
- The name of the availability domain. Example: Uocm:PHX-AD-1
- CompartmentId string
- The OCID of the compartment.
- map[string]string
- Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
- DisplayName string
- A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
- map[string]string
- 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
- The OCID of the console history metadata object.
- InstanceId string
- The OCID of the instance.
- State string
- A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
- TimeCreated string
- The date and time the history was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
- availabilityDomain String
- The name of the availability domain. Example: Uocm:PHX-AD-1
- compartmentId String
- The OCID of the compartment.
- Map<String,String>
- Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
- displayName String
- A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
- Map<String,String>
- 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
- The OCID of the console history metadata object.
- instanceId String
- The OCID of the instance.
- state String
- A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
- timeCreated String
- The date and time the history was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
- availabilityDomain string
- The name of the availability domain. Example: Uocm:PHX-AD-1
- compartmentId string
- The OCID of the compartment.
- {[key: string]: string}
- Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
- displayName string
- A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
- {[key: string]: string}
- 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
- The OCID of the console history metadata object.
- instanceId string
- The OCID of the instance.
- state string
- A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
- timeCreated string
- The date and time the history was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
- availability_domain str
- The name of the availability domain. Example: Uocm:PHX-AD-1
- compartment_id str
- The OCID of the compartment.
- Mapping[str, str]
- Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
- display_name str
- A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
- Mapping[str, str]
- 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
- The OCID of the console history metadata object.
- instance_id str
- The OCID of the instance.
- state str
- A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
- time_created str
- The date and time the history was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
- availabilityDomain String
- The name of the availability domain. Example: Uocm:PHX-AD-1
- compartmentId String
- The OCID of the compartment.
- Map<String>
- Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
- displayName String
- A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
- Map<String>
- 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
- The OCID of the console history metadata object.
- instanceId String
- The OCID of the instance.
- state String
- A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
- timeCreated String
- The date and time the history was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
GetConsoleHistoriesFilter   
Package Details
- Repository
- oci pulumi/pulumi-oci
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the ociTerraform Provider.