oci.Optimizer.getHistories
Explore with Pulumi AI
This data source provides the list of Histories in Oracle Cloud Infrastructure Optimizer service.
Lists changes to the recommendations based on user activity. For example, lists when recommendations have been implemented, dismissed, postponed, or reactivated.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";
const testHistories = oci.Optimizer.getHistories({
    compartmentId: compartmentId,
    compartmentIdInSubtree: historyCompartmentIdInSubtree,
    includeResourceMetadata: historyIncludeResourceMetadata,
    name: historyName,
    recommendationId: testRecommendation.id,
    recommendationName: testRecommendation.name,
    resourceType: historyResourceType,
    state: historyState,
    status: historyStatus,
});
import pulumi
import pulumi_oci as oci
test_histories = oci.Optimizer.get_histories(compartment_id=compartment_id,
    compartment_id_in_subtree=history_compartment_id_in_subtree,
    include_resource_metadata=history_include_resource_metadata,
    name=history_name,
    recommendation_id=test_recommendation["id"],
    recommendation_name=test_recommendation["name"],
    resource_type=history_resource_type,
    state=history_state,
    status=history_status)
package main
import (
	"github.com/pulumi/pulumi-oci/sdk/v2/go/oci/optimizer"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := optimizer.GetHistories(ctx, &optimizer.GetHistoriesArgs{
			CompartmentId:           compartmentId,
			CompartmentIdInSubtree:  historyCompartmentIdInSubtree,
			IncludeResourceMetadata: pulumi.BoolRef(historyIncludeResourceMetadata),
			Name:                    pulumi.StringRef(historyName),
			RecommendationId:        pulumi.StringRef(testRecommendation.Id),
			RecommendationName:      pulumi.StringRef(testRecommendation.Name),
			ResourceType:            pulumi.StringRef(historyResourceType),
			State:                   pulumi.StringRef(historyState),
			Status:                  pulumi.StringRef(historyStatus),
		}, 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 testHistories = Oci.Optimizer.GetHistories.Invoke(new()
    {
        CompartmentId = compartmentId,
        CompartmentIdInSubtree = historyCompartmentIdInSubtree,
        IncludeResourceMetadata = historyIncludeResourceMetadata,
        Name = historyName,
        RecommendationId = testRecommendation.Id,
        RecommendationName = testRecommendation.Name,
        ResourceType = historyResourceType,
        State = historyState,
        Status = historyStatus,
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.oci.Optimizer.OptimizerFunctions;
import com.pulumi.oci.Optimizer.inputs.GetHistoriesArgs;
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 testHistories = OptimizerFunctions.getHistories(GetHistoriesArgs.builder()
            .compartmentId(compartmentId)
            .compartmentIdInSubtree(historyCompartmentIdInSubtree)
            .includeResourceMetadata(historyIncludeResourceMetadata)
            .name(historyName)
            .recommendationId(testRecommendation.id())
            .recommendationName(testRecommendation.name())
            .resourceType(historyResourceType)
            .state(historyState)
            .status(historyStatus)
            .build());
    }
}
variables:
  testHistories:
    fn::invoke:
      function: oci:Optimizer:getHistories
      arguments:
        compartmentId: ${compartmentId}
        compartmentIdInSubtree: ${historyCompartmentIdInSubtree}
        includeResourceMetadata: ${historyIncludeResourceMetadata}
        name: ${historyName}
        recommendationId: ${testRecommendation.id}
        recommendationName: ${testRecommendation.name}
        resourceType: ${historyResourceType}
        state: ${historyState}
        status: ${historyStatus}
Using getHistories
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 getHistories(args: GetHistoriesArgs, opts?: InvokeOptions): Promise<GetHistoriesResult>
function getHistoriesOutput(args: GetHistoriesOutputArgs, opts?: InvokeOptions): Output<GetHistoriesResult>def get_histories(compartment_id: Optional[str] = None,
                  compartment_id_in_subtree: Optional[bool] = None,
                  filters: Optional[Sequence[GetHistoriesFilter]] = None,
                  include_resource_metadata: Optional[bool] = None,
                  name: Optional[str] = None,
                  recommendation_id: Optional[str] = None,
                  recommendation_name: Optional[str] = None,
                  resource_type: Optional[str] = None,
                  state: Optional[str] = None,
                  status: Optional[str] = None,
                  opts: Optional[InvokeOptions] = None) -> GetHistoriesResult
def get_histories_output(compartment_id: Optional[pulumi.Input[str]] = None,
                  compartment_id_in_subtree: Optional[pulumi.Input[bool]] = None,
                  filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetHistoriesFilterArgs]]]] = None,
                  include_resource_metadata: Optional[pulumi.Input[bool]] = None,
                  name: Optional[pulumi.Input[str]] = None,
                  recommendation_id: Optional[pulumi.Input[str]] = None,
                  recommendation_name: Optional[pulumi.Input[str]] = None,
                  resource_type: Optional[pulumi.Input[str]] = None,
                  state: Optional[pulumi.Input[str]] = None,
                  status: Optional[pulumi.Input[str]] = None,
                  opts: Optional[InvokeOptions] = None) -> Output[GetHistoriesResult]func GetHistories(ctx *Context, args *GetHistoriesArgs, opts ...InvokeOption) (*GetHistoriesResult, error)
func GetHistoriesOutput(ctx *Context, args *GetHistoriesOutputArgs, opts ...InvokeOption) GetHistoriesResultOutput> Note: This function is named GetHistories in the Go SDK.
public static class GetHistories 
{
    public static Task<GetHistoriesResult> InvokeAsync(GetHistoriesArgs args, InvokeOptions? opts = null)
    public static Output<GetHistoriesResult> Invoke(GetHistoriesInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetHistoriesResult> getHistories(GetHistoriesArgs args, InvokeOptions options)
public static Output<GetHistoriesResult> getHistories(GetHistoriesArgs args, InvokeOptions options)
fn::invoke:
  function: oci:Optimizer/getHistories:getHistories
  arguments:
    # arguments dictionaryThe following arguments are supported:
- CompartmentId string
- The OCID of the compartment.
- CompartmentId boolIn Subtree 
- When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned depending on the the setting of - accessLevel.- Can only be set to true when performing ListCompartments on the tenancy (root compartment). 
- Filters
List<GetHistories Filter> 
- IncludeResource boolMetadata 
- Supplement additional resource information in extended metadata response.
- Name string
- Optional. A filter that returns results that match the name specified.
- RecommendationId string
- The unique OCID associated with the recommendation.
- RecommendationName string
- Optional. A filter that returns results that match the recommendation name specified.
- ResourceType string
- Optional. A filter that returns results that match the resource type specified.
- State string
- A filter that returns results that match the lifecycle state specified.
- Status string
- A filter that returns recommendations that match the status specified.
- CompartmentId string
- The OCID of the compartment.
- CompartmentId boolIn Subtree 
- When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned depending on the the setting of - accessLevel.- Can only be set to true when performing ListCompartments on the tenancy (root compartment). 
- Filters
[]GetHistories Filter 
- IncludeResource boolMetadata 
- Supplement additional resource information in extended metadata response.
- Name string
- Optional. A filter that returns results that match the name specified.
- RecommendationId string
- The unique OCID associated with the recommendation.
- RecommendationName string
- Optional. A filter that returns results that match the recommendation name specified.
- ResourceType string
- Optional. A filter that returns results that match the resource type specified.
- State string
- A filter that returns results that match the lifecycle state specified.
- Status string
- A filter that returns recommendations that match the status specified.
- compartmentId String
- The OCID of the compartment.
- compartmentId BooleanIn Subtree 
- When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned depending on the the setting of - accessLevel.- Can only be set to true when performing ListCompartments on the tenancy (root compartment). 
- filters
List<GetHistories Filter> 
- includeResource BooleanMetadata 
- Supplement additional resource information in extended metadata response.
- name String
- Optional. A filter that returns results that match the name specified.
- recommendationId String
- The unique OCID associated with the recommendation.
- recommendationName String
- Optional. A filter that returns results that match the recommendation name specified.
- resourceType String
- Optional. A filter that returns results that match the resource type specified.
- state String
- A filter that returns results that match the lifecycle state specified.
- status String
- A filter that returns recommendations that match the status specified.
- compartmentId string
- The OCID of the compartment.
- compartmentId booleanIn Subtree 
- When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned depending on the the setting of - accessLevel.- Can only be set to true when performing ListCompartments on the tenancy (root compartment). 
- filters
GetHistories Filter[] 
- includeResource booleanMetadata 
- Supplement additional resource information in extended metadata response.
- name string
- Optional. A filter that returns results that match the name specified.
- recommendationId string
- The unique OCID associated with the recommendation.
- recommendationName string
- Optional. A filter that returns results that match the recommendation name specified.
- resourceType string
- Optional. A filter that returns results that match the resource type specified.
- state string
- A filter that returns results that match the lifecycle state specified.
- status string
- A filter that returns recommendations that match the status specified.
- compartment_id str
- The OCID of the compartment.
- compartment_id_ boolin_ subtree 
- When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned depending on the the setting of - accessLevel.- Can only be set to true when performing ListCompartments on the tenancy (root compartment). 
- filters
Sequence[GetHistories Filter] 
- include_resource_ boolmetadata 
- Supplement additional resource information in extended metadata response.
- name str
- Optional. A filter that returns results that match the name specified.
- recommendation_id str
- The unique OCID associated with the recommendation.
- recommendation_name str
- Optional. A filter that returns results that match the recommendation name specified.
- resource_type str
- Optional. A filter that returns results that match the resource type specified.
- state str
- A filter that returns results that match the lifecycle state specified.
- status str
- A filter that returns recommendations that match the status specified.
- compartmentId String
- The OCID of the compartment.
- compartmentId BooleanIn Subtree 
- When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned depending on the the setting of - accessLevel.- Can only be set to true when performing ListCompartments on the tenancy (root compartment). 
- filters List<Property Map>
- includeResource BooleanMetadata 
- Supplement additional resource information in extended metadata response.
- name String
- Optional. A filter that returns results that match the name specified.
- recommendationId String
- The unique OCID associated with the recommendation.
- recommendationName String
- Optional. A filter that returns results that match the recommendation name specified.
- resourceType String
- Optional. A filter that returns results that match the resource type specified.
- state String
- A filter that returns results that match the lifecycle state specified.
- status String
- A filter that returns recommendations that match the status specified.
getHistories Result
The following output properties are available:
- CompartmentId string
- The OCID of the compartment.
- CompartmentId boolIn Subtree 
- HistoryCollections List<GetHistories History Collection> 
- The list of history_collection.
- Id string
- The provider-assigned unique ID for this managed resource.
- Filters
List<GetHistories Filter> 
- IncludeResource boolMetadata 
- Name string
- The name assigned to the resource.
- RecommendationId string
- The unique OCID associated with the recommendation.
- RecommendationName string
- The name assigned to the recommendation.
- ResourceType string
- The kind of resource.
- State string
- The recommendation history's current state.
- Status string
- The current status of the resource action.
- CompartmentId string
- The OCID of the compartment.
- CompartmentId boolIn Subtree 
- HistoryCollections []GetHistories History Collection 
- The list of history_collection.
- Id string
- The provider-assigned unique ID for this managed resource.
- Filters
[]GetHistories Filter 
- IncludeResource boolMetadata 
- Name string
- The name assigned to the resource.
- RecommendationId string
- The unique OCID associated with the recommendation.
- RecommendationName string
- The name assigned to the recommendation.
- ResourceType string
- The kind of resource.
- State string
- The recommendation history's current state.
- Status string
- The current status of the resource action.
- compartmentId String
- The OCID of the compartment.
- compartmentId BooleanIn Subtree 
- historyCollections List<GetHistories History Collection> 
- The list of history_collection.
- id String
- The provider-assigned unique ID for this managed resource.
- filters
List<GetHistories Filter> 
- includeResource BooleanMetadata 
- name String
- The name assigned to the resource.
- recommendationId String
- The unique OCID associated with the recommendation.
- recommendationName String
- The name assigned to the recommendation.
- resourceType String
- The kind of resource.
- state String
- The recommendation history's current state.
- status String
- The current status of the resource action.
- compartmentId string
- The OCID of the compartment.
- compartmentId booleanIn Subtree 
- historyCollections GetHistories History Collection[] 
- The list of history_collection.
- id string
- The provider-assigned unique ID for this managed resource.
- filters
GetHistories Filter[] 
- includeResource booleanMetadata 
- name string
- The name assigned to the resource.
- recommendationId string
- The unique OCID associated with the recommendation.
- recommendationName string
- The name assigned to the recommendation.
- resourceType string
- The kind of resource.
- state string
- The recommendation history's current state.
- status string
- The current status of the resource action.
- compartment_id str
- The OCID of the compartment.
- compartment_id_ boolin_ subtree 
- history_collections Sequence[GetHistories History Collection] 
- The list of history_collection.
- id str
- The provider-assigned unique ID for this managed resource.
- filters
Sequence[GetHistories Filter] 
- include_resource_ boolmetadata 
- name str
- The name assigned to the resource.
- recommendation_id str
- The unique OCID associated with the recommendation.
- recommendation_name str
- The name assigned to the recommendation.
- resource_type str
- The kind of resource.
- state str
- The recommendation history's current state.
- status str
- The current status of the resource action.
- compartmentId String
- The OCID of the compartment.
- compartmentId BooleanIn Subtree 
- historyCollections List<Property Map>
- The list of history_collection.
- id String
- The provider-assigned unique ID for this managed resource.
- filters List<Property Map>
- includeResource BooleanMetadata 
- name String
- The name assigned to the resource.
- recommendationId String
- The unique OCID associated with the recommendation.
- recommendationName String
- The name assigned to the recommendation.
- resourceType String
- The kind of resource.
- state String
- The recommendation history's current state.
- status String
- The current status of the resource action.
Supporting Types
GetHistoriesFilter  
GetHistoriesHistoryCollection   
- Items
List<GetHistories History Collection Item> 
- A collection of history summaries.
- Items
[]GetHistories History Collection Item 
- A collection of history summaries.
- items
List<GetHistories History Collection Item> 
- A collection of history summaries.
- items
GetHistories History Collection Item[] 
- A collection of history summaries.
- items
Sequence[GetHistories History Collection Item] 
- A collection of history summaries.
- items List<Property Map>
- A collection of history summaries.
GetHistoriesHistoryCollectionItem    
- Actions
List<GetHistories History Collection Item Action> 
- Details about the recommended action.
- CategoryId string
- The unique OCID associated with the category.
- CompartmentId string
- The OCID of the compartment.
- CompartmentName string
- The name assigned to the compartment.
- EstimatedCost doubleSaving 
- The estimated cost savings, in dollars, for the resource action.
- ExtendedMetadata Dictionary<string, string>
- Additional metadata key/value pairs that you provide. They serve the same purpose and functionality as fields in the metadataobject.
- Id string
- The unique OCID associated with the recommendation history.
- Metadata Dictionary<string, string>
- Custom metadata key/value pairs for the resource action.
- Name string
- Optional. A filter that returns results that match the name specified.
- RecommendationId string
- The unique OCID associated with the recommendation.
- RecommendationName string
- Optional. A filter that returns results that match the recommendation name specified.
- ResourceAction stringId 
- The unique OCID associated with the resource action.
- ResourceId string
- The unique OCID associated with the resource.
- ResourceType string
- Optional. A filter that returns results that match the resource type specified.
- State string
- A filter that returns results that match the lifecycle state specified.
- Status string
- A filter that returns recommendations that match the status specified.
- TimeCreated string
- The date and time the recommendation history was created, in the format defined by RFC3339.
- Actions
[]GetHistories History Collection Item Action 
- Details about the recommended action.
- CategoryId string
- The unique OCID associated with the category.
- CompartmentId string
- The OCID of the compartment.
- CompartmentName string
- The name assigned to the compartment.
- EstimatedCost float64Saving 
- The estimated cost savings, in dollars, for the resource action.
- ExtendedMetadata map[string]string
- Additional metadata key/value pairs that you provide. They serve the same purpose and functionality as fields in the metadataobject.
- Id string
- The unique OCID associated with the recommendation history.
- Metadata map[string]string
- Custom metadata key/value pairs for the resource action.
- Name string
- Optional. A filter that returns results that match the name specified.
- RecommendationId string
- The unique OCID associated with the recommendation.
- RecommendationName string
- Optional. A filter that returns results that match the recommendation name specified.
- ResourceAction stringId 
- The unique OCID associated with the resource action.
- ResourceId string
- The unique OCID associated with the resource.
- ResourceType string
- Optional. A filter that returns results that match the resource type specified.
- State string
- A filter that returns results that match the lifecycle state specified.
- Status string
- A filter that returns recommendations that match the status specified.
- TimeCreated string
- The date and time the recommendation history was created, in the format defined by RFC3339.
- actions
List<GetHistories History Collection Item Action> 
- Details about the recommended action.
- categoryId String
- The unique OCID associated with the category.
- compartmentId String
- The OCID of the compartment.
- compartmentName String
- The name assigned to the compartment.
- estimatedCost DoubleSaving 
- The estimated cost savings, in dollars, for the resource action.
- extendedMetadata Map<String,String>
- Additional metadata key/value pairs that you provide. They serve the same purpose and functionality as fields in the metadataobject.
- id String
- The unique OCID associated with the recommendation history.
- metadata Map<String,String>
- Custom metadata key/value pairs for the resource action.
- name String
- Optional. A filter that returns results that match the name specified.
- recommendationId String
- The unique OCID associated with the recommendation.
- recommendationName String
- Optional. A filter that returns results that match the recommendation name specified.
- resourceAction StringId 
- The unique OCID associated with the resource action.
- resourceId String
- The unique OCID associated with the resource.
- resourceType String
- Optional. A filter that returns results that match the resource type specified.
- state String
- A filter that returns results that match the lifecycle state specified.
- status String
- A filter that returns recommendations that match the status specified.
- timeCreated String
- The date and time the recommendation history was created, in the format defined by RFC3339.
- actions
GetHistories History Collection Item Action[] 
- Details about the recommended action.
- categoryId string
- The unique OCID associated with the category.
- compartmentId string
- The OCID of the compartment.
- compartmentName string
- The name assigned to the compartment.
- estimatedCost numberSaving 
- The estimated cost savings, in dollars, for the resource action.
- extendedMetadata {[key: string]: string}
- Additional metadata key/value pairs that you provide. They serve the same purpose and functionality as fields in the metadataobject.
- id string
- The unique OCID associated with the recommendation history.
- metadata {[key: string]: string}
- Custom metadata key/value pairs for the resource action.
- name string
- Optional. A filter that returns results that match the name specified.
- recommendationId string
- The unique OCID associated with the recommendation.
- recommendationName string
- Optional. A filter that returns results that match the recommendation name specified.
- resourceAction stringId 
- The unique OCID associated with the resource action.
- resourceId string
- The unique OCID associated with the resource.
- resourceType string
- Optional. A filter that returns results that match the resource type specified.
- state string
- A filter that returns results that match the lifecycle state specified.
- status string
- A filter that returns recommendations that match the status specified.
- timeCreated string
- The date and time the recommendation history was created, in the format defined by RFC3339.
- actions
Sequence[GetHistories History Collection Item Action] 
- Details about the recommended action.
- category_id str
- The unique OCID associated with the category.
- compartment_id str
- The OCID of the compartment.
- compartment_name str
- The name assigned to the compartment.
- estimated_cost_ floatsaving 
- The estimated cost savings, in dollars, for the resource action.
- extended_metadata Mapping[str, str]
- Additional metadata key/value pairs that you provide. They serve the same purpose and functionality as fields in the metadataobject.
- id str
- The unique OCID associated with the recommendation history.
- metadata Mapping[str, str]
- Custom metadata key/value pairs for the resource action.
- name str
- Optional. A filter that returns results that match the name specified.
- recommendation_id str
- The unique OCID associated with the recommendation.
- recommendation_name str
- Optional. A filter that returns results that match the recommendation name specified.
- resource_action_ strid 
- The unique OCID associated with the resource action.
- resource_id str
- The unique OCID associated with the resource.
- resource_type str
- Optional. A filter that returns results that match the resource type specified.
- state str
- A filter that returns results that match the lifecycle state specified.
- status str
- A filter that returns recommendations that match the status specified.
- time_created str
- The date and time the recommendation history was created, in the format defined by RFC3339.
- actions List<Property Map>
- Details about the recommended action.
- categoryId String
- The unique OCID associated with the category.
- compartmentId String
- The OCID of the compartment.
- compartmentName String
- The name assigned to the compartment.
- estimatedCost NumberSaving 
- The estimated cost savings, in dollars, for the resource action.
- extendedMetadata Map<String>
- Additional metadata key/value pairs that you provide. They serve the same purpose and functionality as fields in the metadataobject.
- id String
- The unique OCID associated with the recommendation history.
- metadata Map<String>
- Custom metadata key/value pairs for the resource action.
- name String
- Optional. A filter that returns results that match the name specified.
- recommendationId String
- The unique OCID associated with the recommendation.
- recommendationName String
- Optional. A filter that returns results that match the recommendation name specified.
- resourceAction StringId 
- The unique OCID associated with the resource action.
- resourceId String
- The unique OCID associated with the resource.
- resourceType String
- Optional. A filter that returns results that match the resource type specified.
- state String
- A filter that returns results that match the lifecycle state specified.
- status String
- A filter that returns recommendations that match the status specified.
- timeCreated String
- The date and time the recommendation history was created, in the format defined by RFC3339.
GetHistoriesHistoryCollectionItemAction     
- Description string
- Text describing the recommended action.
- Type string
- The status of the resource action.
- Url string
- The URL path to documentation that explains how to perform the action.
- Description string
- Text describing the recommended action.
- Type string
- The status of the resource action.
- Url string
- The URL path to documentation that explains how to perform the action.
- description String
- Text describing the recommended action.
- type String
- The status of the resource action.
- url String
- The URL path to documentation that explains how to perform the action.
- description string
- Text describing the recommended action.
- type string
- The status of the resource action.
- url string
- The URL path to documentation that explains how to perform the action.
- description str
- Text describing the recommended action.
- type str
- The status of the resource action.
- url str
- The URL path to documentation that explains how to perform the action.
- description String
- Text describing the recommended action.
- type String
- The status of the resource action.
- url String
- The URL path to documentation that explains how to perform the action.
Package Details
- Repository
- oci pulumi/pulumi-oci
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the ociTerraform Provider.