Oracle Cloud Infrastructure v2.33.0 published on Thursday, May 1, 2025 by Pulumi
oci.Optimizer.getRecommendation
Explore with Pulumi AI
This data source provides details about a specific Recommendation resource in Oracle Cloud Infrastructure Optimizer service.
Gets the recommendation for the specified OCID.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";
const testRecommendation = oci.Optimizer.getRecommendation({
    recommendationId: testRecommendationOciOptimizerRecommendation.id,
});
import pulumi
import pulumi_oci as oci
test_recommendation = oci.Optimizer.get_recommendation(recommendation_id=test_recommendation_oci_optimizer_recommendation["id"])
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.GetRecommendation(ctx, &optimizer.GetRecommendationArgs{
			RecommendationId: testRecommendationOciOptimizerRecommendation.Id,
		}, 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 testRecommendation = Oci.Optimizer.GetRecommendation.Invoke(new()
    {
        RecommendationId = testRecommendationOciOptimizerRecommendation.Id,
    });
});
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.GetRecommendationArgs;
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 testRecommendation = OptimizerFunctions.getRecommendation(GetRecommendationArgs.builder()
            .recommendationId(testRecommendationOciOptimizerRecommendation.id())
            .build());
    }
}
variables:
  testRecommendation:
    fn::invoke:
      function: oci:Optimizer:getRecommendation
      arguments:
        recommendationId: ${testRecommendationOciOptimizerRecommendation.id}
Using getRecommendation
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 getRecommendation(args: GetRecommendationArgs, opts?: InvokeOptions): Promise<GetRecommendationResult>
function getRecommendationOutput(args: GetRecommendationOutputArgs, opts?: InvokeOptions): Output<GetRecommendationResult>def get_recommendation(recommendation_id: Optional[str] = None,
                       opts: Optional[InvokeOptions] = None) -> GetRecommendationResult
def get_recommendation_output(recommendation_id: Optional[pulumi.Input[str]] = None,
                       opts: Optional[InvokeOptions] = None) -> Output[GetRecommendationResult]func LookupRecommendation(ctx *Context, args *LookupRecommendationArgs, opts ...InvokeOption) (*LookupRecommendationResult, error)
func LookupRecommendationOutput(ctx *Context, args *LookupRecommendationOutputArgs, opts ...InvokeOption) LookupRecommendationResultOutput> Note: This function is named LookupRecommendation in the Go SDK.
public static class GetRecommendation 
{
    public static Task<GetRecommendationResult> InvokeAsync(GetRecommendationArgs args, InvokeOptions? opts = null)
    public static Output<GetRecommendationResult> Invoke(GetRecommendationInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetRecommendationResult> getRecommendation(GetRecommendationArgs args, InvokeOptions options)
public static Output<GetRecommendationResult> getRecommendation(GetRecommendationArgs args, InvokeOptions options)
fn::invoke:
  function: oci:Optimizer/getRecommendation:getRecommendation
  arguments:
    # arguments dictionaryThe following arguments are supported:
- RecommendationId string
- The unique OCID associated with the recommendation.
- RecommendationId string
- The unique OCID associated with the recommendation.
- recommendationId String
- The unique OCID associated with the recommendation.
- recommendationId string
- The unique OCID associated with the recommendation.
- recommendation_id str
- The unique OCID associated with the recommendation.
- recommendationId String
- The unique OCID associated with the recommendation.
getRecommendation Result
The following output properties are available:
- CategoryId string
- The unique OCID associated with the category.
- CompartmentId string
- The OCID of the tenancy. The tenancy is the root compartment.
- Description string
- Text describing the recommendation.
- EstimatedCost doubleSaving 
- The estimated cost savings, in dollars, for the recommendation.
- ExtendedMetadata Dictionary<string, string>
- Additional metadata key/value pairs for the recommendation.
- Id string
- The unique OCID associated with the recommendation.
- Importance string
- The level of importance assigned to the recommendation.
- Name string
- The name of the profile level.
- RecommendationId string
- ResourceCounts List<GetRecommendation Resource Count> 
- An array of ResourceCountobjects grouped by the status of the resource actions.
- State string
- The recommendation's current state.
- Status string
- The current status of the recommendation.
- SupportedLevels List<GetRecommendation Supported Level> 
- Optional. The profile levels supported by a recommendation. For example, profile level values could be Low,Medium, andHigh. Not all recommendations support this field.
- TimeCreated string
- The date and time the recommendation details were created, in the format defined by RFC3339.
- TimeStatus stringBegin 
- The date and time that the recommendation entered its current status. The format is defined by RFC3339.
- TimeStatus stringEnd 
- The date and time the current status will change. The format is defined by RFC3339.
- TimeUpdated string
- The date and time the recommendation details were last updated, in the format defined by RFC3339.
- CategoryId string
- The unique OCID associated with the category.
- CompartmentId string
- The OCID of the tenancy. The tenancy is the root compartment.
- Description string
- Text describing the recommendation.
- EstimatedCost float64Saving 
- The estimated cost savings, in dollars, for the recommendation.
- ExtendedMetadata map[string]string
- Additional metadata key/value pairs for the recommendation.
- Id string
- The unique OCID associated with the recommendation.
- Importance string
- The level of importance assigned to the recommendation.
- Name string
- The name of the profile level.
- RecommendationId string
- ResourceCounts []GetRecommendation Resource Count 
- An array of ResourceCountobjects grouped by the status of the resource actions.
- State string
- The recommendation's current state.
- Status string
- The current status of the recommendation.
- SupportedLevels []GetRecommendation Supported Level 
- Optional. The profile levels supported by a recommendation. For example, profile level values could be Low,Medium, andHigh. Not all recommendations support this field.
- TimeCreated string
- The date and time the recommendation details were created, in the format defined by RFC3339.
- TimeStatus stringBegin 
- The date and time that the recommendation entered its current status. The format is defined by RFC3339.
- TimeStatus stringEnd 
- The date and time the current status will change. The format is defined by RFC3339.
- TimeUpdated string
- The date and time the recommendation details were last updated, in the format defined by RFC3339.
- categoryId String
- The unique OCID associated with the category.
- compartmentId String
- The OCID of the tenancy. The tenancy is the root compartment.
- description String
- Text describing the recommendation.
- estimatedCost DoubleSaving 
- The estimated cost savings, in dollars, for the recommendation.
- extendedMetadata Map<String,String>
- Additional metadata key/value pairs for the recommendation.
- id String
- The unique OCID associated with the recommendation.
- importance String
- The level of importance assigned to the recommendation.
- name String
- The name of the profile level.
- recommendationId String
- resourceCounts List<GetRecommendation Resource Count> 
- An array of ResourceCountobjects grouped by the status of the resource actions.
- state String
- The recommendation's current state.
- status String
- The current status of the recommendation.
- supportedLevels List<GetRecommendation Supported Level> 
- Optional. The profile levels supported by a recommendation. For example, profile level values could be Low,Medium, andHigh. Not all recommendations support this field.
- timeCreated String
- The date and time the recommendation details were created, in the format defined by RFC3339.
- timeStatus StringBegin 
- The date and time that the recommendation entered its current status. The format is defined by RFC3339.
- timeStatus StringEnd 
- The date and time the current status will change. The format is defined by RFC3339.
- timeUpdated String
- The date and time the recommendation details were last updated, in the format defined by RFC3339.
- categoryId string
- The unique OCID associated with the category.
- compartmentId string
- The OCID of the tenancy. The tenancy is the root compartment.
- description string
- Text describing the recommendation.
- estimatedCost numberSaving 
- The estimated cost savings, in dollars, for the recommendation.
- extendedMetadata {[key: string]: string}
- Additional metadata key/value pairs for the recommendation.
- id string
- The unique OCID associated with the recommendation.
- importance string
- The level of importance assigned to the recommendation.
- name string
- The name of the profile level.
- recommendationId string
- resourceCounts GetRecommendation Resource Count[] 
- An array of ResourceCountobjects grouped by the status of the resource actions.
- state string
- The recommendation's current state.
- status string
- The current status of the recommendation.
- supportedLevels GetRecommendation Supported Level[] 
- Optional. The profile levels supported by a recommendation. For example, profile level values could be Low,Medium, andHigh. Not all recommendations support this field.
- timeCreated string
- The date and time the recommendation details were created, in the format defined by RFC3339.
- timeStatus stringBegin 
- The date and time that the recommendation entered its current status. The format is defined by RFC3339.
- timeStatus stringEnd 
- The date and time the current status will change. The format is defined by RFC3339.
- timeUpdated string
- The date and time the recommendation details were last updated, in the format defined by RFC3339.
- category_id str
- The unique OCID associated with the category.
- compartment_id str
- The OCID of the tenancy. The tenancy is the root compartment.
- description str
- Text describing the recommendation.
- estimated_cost_ floatsaving 
- The estimated cost savings, in dollars, for the recommendation.
- extended_metadata Mapping[str, str]
- Additional metadata key/value pairs for the recommendation.
- id str
- The unique OCID associated with the recommendation.
- importance str
- The level of importance assigned to the recommendation.
- name str
- The name of the profile level.
- recommendation_id str
- resource_counts Sequence[GetRecommendation Resource Count] 
- An array of ResourceCountobjects grouped by the status of the resource actions.
- state str
- The recommendation's current state.
- status str
- The current status of the recommendation.
- supported_levels Sequence[GetRecommendation Supported Level] 
- Optional. The profile levels supported by a recommendation. For example, profile level values could be Low,Medium, andHigh. Not all recommendations support this field.
- time_created str
- The date and time the recommendation details were created, in the format defined by RFC3339.
- time_status_ strbegin 
- The date and time that the recommendation entered its current status. The format is defined by RFC3339.
- time_status_ strend 
- The date and time the current status will change. The format is defined by RFC3339.
- time_updated str
- The date and time the recommendation details were last updated, in the format defined by RFC3339.
- categoryId String
- The unique OCID associated with the category.
- compartmentId String
- The OCID of the tenancy. The tenancy is the root compartment.
- description String
- Text describing the recommendation.
- estimatedCost NumberSaving 
- The estimated cost savings, in dollars, for the recommendation.
- extendedMetadata Map<String>
- Additional metadata key/value pairs for the recommendation.
- id String
- The unique OCID associated with the recommendation.
- importance String
- The level of importance assigned to the recommendation.
- name String
- The name of the profile level.
- recommendationId String
- resourceCounts List<Property Map>
- An array of ResourceCountobjects grouped by the status of the resource actions.
- state String
- The recommendation's current state.
- status String
- The current status of the recommendation.
- supportedLevels List<Property Map>
- Optional. The profile levels supported by a recommendation. For example, profile level values could be Low,Medium, andHigh. Not all recommendations support this field.
- timeCreated String
- The date and time the recommendation details were created, in the format defined by RFC3339.
- timeStatus StringBegin 
- The date and time that the recommendation entered its current status. The format is defined by RFC3339.
- timeStatus StringEnd 
- The date and time the current status will change. The format is defined by RFC3339.
- timeUpdated String
- The date and time the recommendation details were last updated, in the format defined by RFC3339.
Supporting Types
GetRecommendationResourceCount   
GetRecommendationSupportedLevel   
- Items
List<GetRecommendation Supported Level Item> 
- The list of supported levels.
- Items
[]GetRecommendation Supported Level Item 
- The list of supported levels.
- items
List<GetRecommendation Supported Level Item> 
- The list of supported levels.
- items
GetRecommendation Supported Level Item[] 
- The list of supported levels.
- items
Sequence[GetRecommendation Supported Level Item] 
- The list of supported levels.
- items List<Property Map>
- The list of supported levels.
GetRecommendationSupportedLevelItem    
- Name string
- The name of the profile level.
- Name string
- The name of the profile level.
- name String
- The name of the profile level.
- name string
- The name of the profile level.
- name str
- The name of the profile level.
- name String
- The name of the profile level.
Package Details
- Repository
- oci pulumi/pulumi-oci
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the ociTerraform Provider.