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[_optimizer.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[_optimizer.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)
// Output-based functions aren't available in Java yet
fn::invoke:
function: oci:Optimizer/getHistories:getHistories
arguments:
# arguments dictionary
The following arguments are supported:
- Compartment
Id string - 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
List<Get
Histories Filter> - Include
Resource boolMetadata - Supplement additional resource information in extended metadata response.
- Name string
- Optional. A filter that returns results that match the name specified.
- Recommendation
Id string - The unique OCID associated with the recommendation.
- Recommendation
Name string - Optional. A filter that returns results that match the recommendation name specified.
- Resource
Type 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 string - 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
[]Get
Histories Filter - Include
Resource boolMetadata - Supplement additional resource information in extended metadata response.
- Name string
- Optional. A filter that returns results that match the name specified.
- Recommendation
Id string - The unique OCID associated with the recommendation.
- Recommendation
Name string - Optional. A filter that returns results that match the recommendation name specified.
- Resource
Type 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 String - The OCID of the compartment.
- compartment
Id 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<Get
Histories Filter> - include
Resource BooleanMetadata - Supplement additional resource information in extended metadata response.
- name String
- Optional. A filter that returns results that match the name specified.
- recommendation
Id String - The unique OCID associated with the recommendation.
- recommendation
Name String - Optional. A filter that returns results that match the recommendation name specified.
- resource
Type 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 string - The OCID of the compartment.
- compartment
Id 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
Get
Histories Filter[] - include
Resource booleanMetadata - Supplement additional resource information in extended metadata response.
- name string
- Optional. A filter that returns results that match the name specified.
- recommendation
Id string - The unique OCID associated with the recommendation.
- recommendation
Name string - Optional. A filter that returns results that match the recommendation name specified.
- resource
Type 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[optimizer.
Get Histories 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.
- compartment
Id String - The OCID of the compartment.
- compartment
Id 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>
- include
Resource BooleanMetadata - Supplement additional resource information in extended metadata response.
- name String
- Optional. A filter that returns results that match the name specified.
- recommendation
Id String - The unique OCID associated with the recommendation.
- recommendation
Name String - Optional. A filter that returns results that match the recommendation name specified.
- resource
Type 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:
- Compartment
Id string - The OCID of the compartment.
- Compartment
Id boolIn Subtree - History
Collections List<GetHistories History Collection> - The list of history_collection.
- Id string
- The provider-assigned unique ID for this managed resource.
- Filters
List<Get
Histories Filter> - Include
Resource boolMetadata - Name string
- The name assigned to the resource.
- Recommendation
Id string - The unique OCID associated with the recommendation.
- Recommendation
Name string - The name assigned to the recommendation.
- Resource
Type string - The kind of resource.
- State string
- The recommendation history's current state.
- Status string
- The current status of the resource action.
- Compartment
Id string - The OCID of the compartment.
- Compartment
Id boolIn Subtree - History
Collections []GetHistories History Collection - The list of history_collection.
- Id string
- The provider-assigned unique ID for this managed resource.
- Filters
[]Get
Histories Filter - Include
Resource boolMetadata - Name string
- The name assigned to the resource.
- Recommendation
Id string - The unique OCID associated with the recommendation.
- Recommendation
Name string - The name assigned to the recommendation.
- Resource
Type string - The kind of resource.
- State string
- The recommendation history's current state.
- Status string
- The current status of the resource action.
- compartment
Id String - The OCID of the compartment.
- compartment
Id BooleanIn Subtree - history
Collections List<GetHistories History Collection> - The list of history_collection.
- id String
- The provider-assigned unique ID for this managed resource.
- filters
List<Get
Histories Filter> - include
Resource BooleanMetadata - name String
- The name assigned to the resource.
- recommendation
Id String - The unique OCID associated with the recommendation.
- recommendation
Name String - The name assigned to the recommendation.
- resource
Type String - The kind of resource.
- state String
- The recommendation history's current state.
- status String
- The current status of the resource action.
- compartment
Id string - The OCID of the compartment.
- compartment
Id booleanIn Subtree - history
Collections GetHistories History Collection[] - The list of history_collection.
- id string
- The provider-assigned unique ID for this managed resource.
- filters
Get
Histories Filter[] - include
Resource booleanMetadata - name string
- The name assigned to the resource.
- recommendation
Id string - The unique OCID associated with the recommendation.
- recommendation
Name string - The name assigned to the recommendation.
- resource
Type 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[optimizer.Get Histories History Collection] - The list of history_collection.
- id str
- The provider-assigned unique ID for this managed resource.
- filters
Sequence[optimizer.
Get Histories 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.
- compartment
Id String - The OCID of the compartment.
- compartment
Id BooleanIn Subtree - history
Collections List<Property Map> - The list of history_collection.
- id String
- The provider-assigned unique ID for this managed resource.
- filters List<Property Map>
- include
Resource BooleanMetadata - name String
- The name assigned to the resource.
- recommendation
Id String - The unique OCID associated with the recommendation.
- recommendation
Name String - The name assigned to the recommendation.
- resource
Type 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<Get
Histories History Collection Item> - A collection of history summaries.
- Items
[]Get
Histories History Collection Item - A collection of history summaries.
- items
List<Get
Histories History Collection Item> - A collection of history summaries.
- items
Get
Histories History Collection Item[] - A collection of history summaries.
- items
Sequence[optimizer.
Get Histories History Collection Item] - A collection of history summaries.
- items List<Property Map>
- A collection of history summaries.
GetHistoriesHistoryCollectionItem
- Actions
List<Get
Histories History Collection Item Action> - Details about the recommended action.
- Category
Id string - The unique OCID associated with the category.
- Compartment
Id string - The OCID of the compartment.
- Compartment
Name string - The name assigned to the compartment.
- Estimated
Cost doubleSaving - The estimated cost savings, in dollars, for the resource action.
- Extended
Metadata Dictionary<string, string> - 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, string>
- Custom metadata key/value pairs for the resource action.
- Name string
- Optional. A filter that returns results that match the name specified.
- Recommendation
Id string - The unique OCID associated with the recommendation.
- Recommendation
Name string - Optional. A filter that returns results that match the recommendation name specified.
- Resource
Action stringId - The unique OCID associated with the resource action.
- Resource
Id string - The unique OCID associated with the resource.
- Resource
Type 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.
- Time
Created string - The date and time the recommendation history was created, in the format defined by RFC3339.
- Actions
[]Get
Histories History Collection Item Action - Details about the recommended action.
- Category
Id string - The unique OCID associated with the category.
- Compartment
Id string - The OCID of the compartment.
- Compartment
Name string - The name assigned to the compartment.
- Estimated
Cost float64Saving - The estimated cost savings, in dollars, for the resource action.
- Extended
Metadata map[string]string - 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]string
- Custom metadata key/value pairs for the resource action.
- Name string
- Optional. A filter that returns results that match the name specified.
- Recommendation
Id string - The unique OCID associated with the recommendation.
- Recommendation
Name string - Optional. A filter that returns results that match the recommendation name specified.
- Resource
Action stringId - The unique OCID associated with the resource action.
- Resource
Id string - The unique OCID associated with the resource.
- Resource
Type 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.
- Time
Created string - The date and time the recommendation history was created, in the format defined by RFC3339.
- actions
List<Get
Histories History Collection Item Action> - Details about the recommended action.
- category
Id String - The unique OCID associated with the category.
- compartment
Id String - The OCID of the compartment.
- compartment
Name String - The name assigned to the compartment.
- estimated
Cost DoubleSaving - The estimated cost savings, in dollars, for the resource action.
- extended
Metadata Map<String,String> - 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,String>
- Custom metadata key/value pairs for the resource action.
- name String
- Optional. A filter that returns results that match the name specified.
- recommendation
Id String - The unique OCID associated with the recommendation.
- recommendation
Name String - Optional. A filter that returns results that match the recommendation name specified.
- resource
Action StringId - The unique OCID associated with the resource action.
- resource
Id String - The unique OCID associated with the resource.
- resource
Type 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.
- time
Created String - The date and time the recommendation history was created, in the format defined by RFC3339.
- actions
Get
Histories History Collection Item Action[] - Details about the recommended action.
- category
Id string - The unique OCID associated with the category.
- compartment
Id string - The OCID of the compartment.
- compartment
Name string - The name assigned to the compartment.
- estimated
Cost numberSaving - The estimated cost savings, in dollars, for the resource action.
- extended
Metadata {[key: string]: string} - 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]: string}
- Custom metadata key/value pairs for the resource action.
- name string
- Optional. A filter that returns results that match the name specified.
- recommendation
Id string - The unique OCID associated with the recommendation.
- recommendation
Name string - Optional. A filter that returns results that match the recommendation name specified.
- resource
Action stringId - The unique OCID associated with the resource action.
- resource
Id string - The unique OCID associated with the resource.
- resource
Type 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.
- time
Created string - The date and time the recommendation history was created, in the format defined by RFC3339.
- actions
Sequence[optimizer.
Get Histories 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
metadata
object. - 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.
- category
Id String - The unique OCID associated with the category.
- compartment
Id String - The OCID of the compartment.
- compartment
Name String - The name assigned to the compartment.
- estimated
Cost NumberSaving - The estimated cost savings, in dollars, for the resource action.
- extended
Metadata Map<String> - 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>
- Custom metadata key/value pairs for the resource action.
- name String
- Optional. A filter that returns results that match the name specified.
- recommendation
Id String - The unique OCID associated with the recommendation.
- recommendation
Name String - Optional. A filter that returns results that match the recommendation name specified.
- resource
Action StringId - The unique OCID associated with the resource action.
- resource
Id String - The unique OCID associated with the resource.
- resource
Type 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.
- time
Created 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
oci
Terraform Provider.