Oracle Cloud Infrastructure

v0.5.0 published on Monday, Sep 12, 2022 by Pulumi

getHistories

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

using System.Collections.Generic;
using Pulumi;
using Oci = Pulumi.Oci;

return await Deployment.RunAsync(() => 
{
    var testHistories = Oci.Optimizer.GetHistories.Invoke(new()
    {
        CompartmentId = @var.Compartment_id,
        CompartmentIdInSubtree = @var.History_compartment_id_in_subtree,
        Name = @var.History_name,
        RecommendationId = oci_optimizer_recommendation.Test_recommendation.Id,
        RecommendationName = oci_optimizer_recommendation.Test_recommendation.Name,
        ResourceType = @var.History_resource_type,
        State = @var.History_state,
        Status = @var.History_status,
    });

});
package main

import (
	"github.com/pulumi/pulumi-oci/sdk/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:          _var.Compartment_id,
			CompartmentIdInSubtree: _var.History_compartment_id_in_subtree,
			Name:                   pulumi.StringRef(_var.History_name),
			RecommendationId:       pulumi.StringRef(oci_optimizer_recommendation.Test_recommendation.Id),
			RecommendationName:     pulumi.StringRef(oci_optimizer_recommendation.Test_recommendation.Name),
			ResourceType:           pulumi.StringRef(_var.History_resource_type),
			State:                  pulumi.StringRef(_var.History_state),
			Status:                 pulumi.StringRef(_var.History_status),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
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(var_.compartment_id())
            .compartmentIdInSubtree(var_.history_compartment_id_in_subtree())
            .name(var_.history_name())
            .recommendationId(oci_optimizer_recommendation.test_recommendation().id())
            .recommendationName(oci_optimizer_recommendation.test_recommendation().name())
            .resourceType(var_.history_resource_type())
            .state(var_.history_state())
            .status(var_.history_status())
            .build());

    }
}
import pulumi
import pulumi_oci as oci

test_histories = oci.Optimizer.get_histories(compartment_id=var["compartment_id"],
    compartment_id_in_subtree=var["history_compartment_id_in_subtree"],
    name=var["history_name"],
    recommendation_id=oci_optimizer_recommendation["test_recommendation"]["id"],
    recommendation_name=oci_optimizer_recommendation["test_recommendation"]["name"],
    resource_type=var["history_resource_type"],
    state=var["history_state"],
    status=var["history_status"])
import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";

const testHistories = oci.Optimizer.getHistories({
    compartmentId: _var.compartment_id,
    compartmentIdInSubtree: _var.history_compartment_id_in_subtree,
    name: _var.history_name,
    recommendationId: oci_optimizer_recommendation.test_recommendation.id,
    recommendationName: oci_optimizer_recommendation.test_recommendation.name,
    resourceType: _var.history_resource_type,
    state: _var.history_state,
    status: _var.history_status,
});
variables:
  testHistories:
    Fn::Invoke:
      Function: oci:Optimizer:getHistories
      Arguments:
        compartmentId: ${var.compartment_id}
        compartmentIdInSubtree: ${var.history_compartment_id_in_subtree}
        name: ${var.history_name}
        recommendationId: ${oci_optimizer_recommendation.test_recommendation.id}
        recommendationName: ${oci_optimizer_recommendation.test_recommendation.name}
        resourceType: ${var.history_resource_type}
        state: ${var.history_state}
        status: ${var.history_status}

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[_optimizer.GetHistoriesFilter]] = 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[_optimizer.GetHistoriesFilterArgs]]]] = 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)
// Output-based functions aren't available in Java yet
Fn::Invoke:
  Function: oci:Optimizer/getHistories:getHistories
  Arguments:
    # Arguments dictionary

The following arguments are supported:

CompartmentId string

The OCID of the compartment.

CompartmentIdInSubtree bool

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.

Filters List<GetHistoriesFilter>
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.

CompartmentIdInSubtree bool

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.

Filters []GetHistoriesFilter
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.

compartmentIdInSubtree Boolean

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.

filters List<GetHistoriesFilter>
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.

compartmentIdInSubtree boolean

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.

filters GetHistoriesFilter[]
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_in_subtree bool

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.

filters GetHistoriesFilter]
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.

compartmentIdInSubtree Boolean

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.

filters List<Property Map>
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.

CompartmentIdInSubtree bool
HistoryCollections List<GetHistoriesHistoryCollection>

The list of history_collection.

Id string

The provider-assigned unique ID for this managed resource.

Filters List<GetHistoriesFilter>
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.

CompartmentIdInSubtree bool
HistoryCollections []GetHistoriesHistoryCollection

The list of history_collection.

Id string

The provider-assigned unique ID for this managed resource.

Filters []GetHistoriesFilter
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.

compartmentIdInSubtree Boolean
historyCollections List<GetHistoriesHistoryCollection>

The list of history_collection.

id String

The provider-assigned unique ID for this managed resource.

filters List<GetHistoriesFilter>
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.

compartmentIdInSubtree boolean
historyCollections GetHistoriesHistoryCollection[]

The list of history_collection.

id string

The provider-assigned unique ID for this managed resource.

filters GetHistoriesFilter[]
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_in_subtree bool
history_collections GetHistoriesHistoryCollection]

The list of history_collection.

id str

The provider-assigned unique ID for this managed resource.

filters GetHistoriesFilter]
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.

compartmentIdInSubtree Boolean
historyCollections List<Property Map>

The list of history_collection.

id String

The provider-assigned unique ID for this managed resource.

filters List<Property Map>
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

Name string

Optional. A filter that returns results that match the name specified.

Values List<string>
Regex bool
Name string

Optional. A filter that returns results that match the name specified.

Values []string
Regex bool
name String

Optional. A filter that returns results that match the name specified.

values List<String>
regex Boolean
name string

Optional. A filter that returns results that match the name specified.

values string[]
regex boolean
name str

Optional. A filter that returns results that match the name specified.

values Sequence[str]
regex bool
name String

Optional. A filter that returns results that match the name specified.

values List<String>
regex Boolean

GetHistoriesHistoryCollection

Items List<GetHistoriesHistoryCollectionItem>

A collection of history summaries.

Items []GetHistoriesHistoryCollectionItem

A collection of history summaries.

items List<GetHistoriesHistoryCollectionItem>

A collection of history summaries.

items GetHistoriesHistoryCollectionItem[]

A collection of history summaries.

items GetHistoriesHistoryCollectionItem]

A collection of history summaries.

items List<Property Map>

A collection of history summaries.

GetHistoriesHistoryCollectionItem

Actions List<GetHistoriesHistoryCollectionItemAction>

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.

EstimatedCostSaving double

The estimated cost savings, in dollars, for the resource action.

ExtendedMetadata Dictionary<string, object>

Additional metadata key/value pairs that you provide. They serve the same purpose and functionality as fields in the metadata object.

Id string

The unique OCID associated with the recommendation history.

Metadata Dictionary<string, object>

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.

ResourceActionId string

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 []GetHistoriesHistoryCollectionItemAction

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.

EstimatedCostSaving float64

The estimated cost savings, in dollars, for the resource action.

ExtendedMetadata map[string]interface{}

Additional metadata key/value pairs that you provide. They serve the same purpose and functionality as fields in the metadata object.

Id string

The unique OCID associated with the recommendation history.

Metadata map[string]interface{}

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.

ResourceActionId string

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<GetHistoriesHistoryCollectionItemAction>

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.

estimatedCostSaving Double

The estimated cost savings, in dollars, for the resource action.

extendedMetadata Map<String,Object>

Additional metadata key/value pairs that you provide. They serve the same purpose and functionality as fields in the metadata object.

id String

The unique OCID associated with the recommendation history.

metadata Map<String,Object>

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.

resourceActionId String

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 GetHistoriesHistoryCollectionItemAction[]

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.

estimatedCostSaving number

The estimated cost savings, in dollars, for the resource action.

extendedMetadata {[key: string]: any}

Additional metadata key/value pairs that you provide. They serve the same purpose and functionality as fields in the metadata object.

id string

The unique OCID associated with the recommendation history.

metadata {[key: string]: any}

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.

resourceActionId string

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 GetHistoriesHistoryCollectionItemAction]

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_saving float

The estimated cost savings, in dollars, for the resource action.

extended_metadata Mapping[str, Any]

Additional metadata key/value pairs that you provide. They serve the same purpose and functionality as fields in the metadata object.

id str

The unique OCID associated with the recommendation history.

metadata Mapping[str, Any]

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_id str

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.

estimatedCostSaving Number

The estimated cost savings, in dollars, for the resource action.

extendedMetadata Map<Any>

Additional metadata key/value pairs that you provide. They serve the same purpose and functionality as fields in the metadata object.

id String

The unique OCID associated with the recommendation history.

metadata Map<Any>

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.

resourceActionId String

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
https://github.com/pulumi/pulumi-oci
License
Apache-2.0
Notes

This Pulumi package is based on the oci Terraform Provider.