Oracle Cloud Infrastructure

Pulumi Official
Package maintained by Pulumi
v0.1.1 published on Tuesday, May 3, 2022 by Pulumi

getRecommendations

This data source provides the list of Recommendations in Oracle Cloud Infrastructure Optimizer service.

Lists the Cloud Advisor recommendations that are currently supported in the specified category.

Example Usage

using Pulumi;
using Oci = Pulumi.Oci;

class MyStack : Stack
{
    public MyStack()
    {
        var testRecommendations = Output.Create(Oci.Optimizer.GetRecommendations.InvokeAsync(new Oci.Optimizer.GetRecommendationsArgs
        {
            CategoryId = oci_optimizer_category.Test_category.Id,
            CompartmentId = @var.Compartment_id,
            CompartmentIdInSubtree = @var.Recommendation_compartment_id_in_subtree,
            Name = @var.Recommendation_name,
            State = @var.Recommendation_state,
            Status = @var.Recommendation_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.GetRecommendations(ctx, &optimizer.GetRecommendationsArgs{
			CategoryId:             oci_optimizer_category.Test_category.Id,
			CompartmentId:          _var.Compartment_id,
			CompartmentIdInSubtree: _var.Recommendation_compartment_id_in_subtree,
			Name:                   pulumi.StringRef(_var.Recommendation_name),
			State:                  pulumi.StringRef(_var.Recommendation_state),
			Status:                 pulumi.StringRef(_var.Recommendation_status),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}

Coming soon!

import pulumi
import pulumi_oci as oci

test_recommendations = oci.Optimizer.get_recommendations(category_id=oci_optimizer_category["test_category"]["id"],
    compartment_id=var["compartment_id"],
    compartment_id_in_subtree=var["recommendation_compartment_id_in_subtree"],
    name=var["recommendation_name"],
    state=var["recommendation_state"],
    status=var["recommendation_status"])
import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";

const testRecommendations = oci.Optimizer.getRecommendations({
    categoryId: oci_optimizer_category.test_category.id,
    compartmentId: _var.compartment_id,
    compartmentIdInSubtree: _var.recommendation_compartment_id_in_subtree,
    name: _var.recommendation_name,
    state: _var.recommendation_state,
    status: _var.recommendation_status,
});

Coming soon!

Using getRecommendations

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 getRecommendations(args: GetRecommendationsArgs, opts?: InvokeOptions): Promise<GetRecommendationsResult>
function getRecommendationsOutput(args: GetRecommendationsOutputArgs, opts?: InvokeOptions): Output<GetRecommendationsResult>
def get_recommendations(category_id: Optional[str] = None,
                        compartment_id: Optional[str] = None,
                        compartment_id_in_subtree: Optional[bool] = None,
                        filters: Optional[Sequence[_optimizer.GetRecommendationsFilter]] = None,
                        name: Optional[str] = None,
                        state: Optional[str] = None,
                        status: Optional[str] = None,
                        opts: Optional[InvokeOptions] = None) -> GetRecommendationsResult
def get_recommendations_output(category_id: Optional[pulumi.Input[str]] = None,
                        compartment_id: Optional[pulumi.Input[str]] = None,
                        compartment_id_in_subtree: Optional[pulumi.Input[bool]] = None,
                        filters: Optional[pulumi.Input[Sequence[pulumi.Input[_optimizer.GetRecommendationsFilterArgs]]]] = None,
                        name: Optional[pulumi.Input[str]] = None,
                        state: Optional[pulumi.Input[str]] = None,
                        status: Optional[pulumi.Input[str]] = None,
                        opts: Optional[InvokeOptions] = None) -> Output[GetRecommendationsResult]
func GetRecommendations(ctx *Context, args *GetRecommendationsArgs, opts ...InvokeOption) (*GetRecommendationsResult, error)
func GetRecommendationsOutput(ctx *Context, args *GetRecommendationsOutputArgs, opts ...InvokeOption) GetRecommendationsResultOutput

> Note: This function is named GetRecommendations in the Go SDK.

public static class GetRecommendations 
{
    public static Task<GetRecommendationsResult> InvokeAsync(GetRecommendationsArgs args, InvokeOptions? opts = null)
    public static Output<GetRecommendationsResult> Invoke(GetRecommendationsInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetRecommendationsResult> getRecommendations(GetRecommendationsArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
  Function: oci:Optimizer/getRecommendations:getRecommendations
  Arguments:
    # Arguments dictionary

The following arguments are supported:

CategoryId string

The unique OCID associated with the category.

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<GetRecommendationsFilter>
Name string

Optional. A filter that returns results that match the name 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.

CategoryId string

The unique OCID associated with the category.

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 []GetRecommendationsFilter
Name string

Optional. A filter that returns results that match the name 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.

categoryId String

The unique OCID associated with the category.

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<GetRecommendationsFilter>
name String

Optional. A filter that returns results that match the name 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.

categoryId string

The unique OCID associated with the category.

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 GetRecommendationsFilter[]
name string

Optional. A filter that returns results that match the name 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.

category_id str

The unique OCID associated with the category.

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 GetRecommendationsFilter]
name str

Optional. A filter that returns results that match the name 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.

categoryId String

The unique OCID associated with the category.

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.

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.

getRecommendations 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.

CompartmentIdInSubtree bool
Id string

The provider-assigned unique ID for this managed resource.

RecommendationCollections List<GetRecommendationsRecommendationCollection>

The list of recommendation_collection.

Filters List<GetRecommendationsFilter>
Name string

The name of the profile level.

State string

The recommendation's current state.

Status string

The current status of the recommendation.

CategoryId string

The unique OCID associated with the category.

CompartmentId string

The OCID of the tenancy. The tenancy is the root compartment.

CompartmentIdInSubtree bool
Id string

The provider-assigned unique ID for this managed resource.

RecommendationCollections []GetRecommendationsRecommendationCollection

The list of recommendation_collection.

Filters []GetRecommendationsFilter
Name string

The name of the profile level.

State string

The recommendation's current state.

Status string

The current status of the recommendation.

categoryId String

The unique OCID associated with the category.

compartmentId String

The OCID of the tenancy. The tenancy is the root compartment.

compartmentIdInSubtree Boolean
id String

The provider-assigned unique ID for this managed resource.

recommendationCollections List<GetRecommendationsRecommendationCollection>

The list of recommendation_collection.

filters List<GetRecommendationsFilter>
name String

The name of the profile level.

state String

The recommendation's current state.

status String

The current status of the recommendation.

categoryId string

The unique OCID associated with the category.

compartmentId string

The OCID of the tenancy. The tenancy is the root compartment.

compartmentIdInSubtree boolean
id string

The provider-assigned unique ID for this managed resource.

recommendationCollections GetRecommendationsRecommendationCollection[]

The list of recommendation_collection.

filters GetRecommendationsFilter[]
name string

The name of the profile level.

state string

The recommendation's current state.

status string

The current status of the recommendation.

category_id str

The unique OCID associated with the category.

compartment_id str

The OCID of the tenancy. The tenancy is the root compartment.

compartment_id_in_subtree bool
id str

The provider-assigned unique ID for this managed resource.

recommendation_collections GetRecommendationsRecommendationCollection]

The list of recommendation_collection.

filters GetRecommendationsFilter]
name str

The name of the profile level.

state str

The recommendation's current state.

status str

The current status of the recommendation.

categoryId String

The unique OCID associated with the category.

compartmentId String

The OCID of the tenancy. The tenancy is the root compartment.

compartmentIdInSubtree Boolean
id String

The provider-assigned unique ID for this managed resource.

recommendationCollections List<Property Map>

The list of recommendation_collection.

filters List<Property Map>
name String

The name of the profile level.

state String

The recommendation's current state.

status String

The current status of the recommendation.

Supporting Types

GetRecommendationsFilter

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

GetRecommendationsRecommendationCollection

items List<Property Map>

The list of supported levels.

GetRecommendationsRecommendationCollectionItem

CategoryId string

The unique OCID associated with the category.

CompartmentId string

The OCID of the compartment.

Description string

Text describing the recommendation.

EstimatedCostSaving double

The estimated cost savings, in dollars, for the recommendation.

ExtendedMetadata Dictionary<string, object>

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

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

RecommendationId string
ResourceCounts List<GetRecommendationsRecommendationCollectionItemResourceCount>

An array of ResourceCount objects grouped by the status of the resource actions.

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.

SupportedLevels List<GetRecommendationsRecommendationCollectionItemSupportedLevel>

Optional. The profile levels supported by a recommendation. For example, profile level values could be Low, Medium, and High. Not all recommendations support this field.

TimeCreated string

The date and time the recommendation details were created, in the format defined by RFC3339.

TimeStatusBegin string

The date and time that the recommendation entered its current status. The format is defined by RFC3339.

TimeStatusEnd string

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 compartment.

Description string

Text describing the recommendation.

EstimatedCostSaving float64

The estimated cost savings, in dollars, for the recommendation.

ExtendedMetadata map[string]interface{}

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

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

RecommendationId string
ResourceCounts []GetRecommendationsRecommendationCollectionItemResourceCount

An array of ResourceCount objects grouped by the status of the resource actions.

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.

SupportedLevels []GetRecommendationsRecommendationCollectionItemSupportedLevel

Optional. The profile levels supported by a recommendation. For example, profile level values could be Low, Medium, and High. Not all recommendations support this field.

TimeCreated string

The date and time the recommendation details were created, in the format defined by RFC3339.

TimeStatusBegin string

The date and time that the recommendation entered its current status. The format is defined by RFC3339.

TimeStatusEnd string

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 compartment.

description String

Text describing the recommendation.

estimatedCostSaving Double

The estimated cost savings, in dollars, for the recommendation.

extendedMetadata Map<String,Object>

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

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

recommendationId String
resourceCounts List<GetRecommendationsRecommendationCollectionItemResourceCount>

An array of ResourceCount objects grouped by the status of the resource actions.

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.

supportedLevels List<GetRecommendationsRecommendationCollectionItemSupportedLevel>

Optional. The profile levels supported by a recommendation. For example, profile level values could be Low, Medium, and High. Not all recommendations support this field.

timeCreated String

The date and time the recommendation details were created, in the format defined by RFC3339.

timeStatusBegin String

The date and time that the recommendation entered its current status. The format is defined by RFC3339.

timeStatusEnd String

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 compartment.

description string

Text describing the recommendation.

estimatedCostSaving number

The estimated cost savings, in dollars, for the recommendation.

extendedMetadata {[key: string]: any}

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

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

recommendationId string
resourceCounts GetRecommendationsRecommendationCollectionItemResourceCount[]

An array of ResourceCount objects grouped by the status of the resource actions.

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.

supportedLevels GetRecommendationsRecommendationCollectionItemSupportedLevel[]

Optional. The profile levels supported by a recommendation. For example, profile level values could be Low, Medium, and High. Not all recommendations support this field.

timeCreated string

The date and time the recommendation details were created, in the format defined by RFC3339.

timeStatusBegin string

The date and time that the recommendation entered its current status. The format is defined by RFC3339.

timeStatusEnd string

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 compartment.

description str

Text describing the recommendation.

estimated_cost_saving float

The estimated cost savings, in dollars, for the recommendation.

extended_metadata Mapping[str, Any]

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

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

recommendation_id str
resource_counts GetRecommendationsRecommendationCollectionItemResourceCount]

An array of ResourceCount objects grouped by the status of the resource actions.

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.

supported_levels GetRecommendationsRecommendationCollectionItemSupportedLevel]

Optional. The profile levels supported by a recommendation. For example, profile level values could be Low, Medium, and High. 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_begin str

The date and time that the recommendation entered its current status. The format is defined by RFC3339.

time_status_end str

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 compartment.

description String

Text describing the recommendation.

estimatedCostSaving Number

The estimated cost savings, in dollars, for the recommendation.

extendedMetadata Map<Any>

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

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

recommendationId String
resourceCounts List<Property Map>

An array of ResourceCount objects grouped by the status of the resource actions.

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.

supportedLevels List<Property Map>

Optional. The profile levels supported by a recommendation. For example, profile level values could be Low, Medium, and High. Not all recommendations support this field.

timeCreated String

The date and time the recommendation details were created, in the format defined by RFC3339.

timeStatusBegin String

The date and time that the recommendation entered its current status. The format is defined by RFC3339.

timeStatusEnd String

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.

GetRecommendationsRecommendationCollectionItemResourceCount

Count int

The count of resources.

Status string

A filter that returns recommendations that match the status specified.

Count int

The count of resources.

Status string

A filter that returns recommendations that match the status specified.

count Integer

The count of resources.

status String

A filter that returns recommendations that match the status specified.

count number

The count of resources.

status string

A filter that returns recommendations that match the status specified.

count int

The count of resources.

status str

A filter that returns recommendations that match the status specified.

count Number

The count of resources.

status String

A filter that returns recommendations that match the status specified.

GetRecommendationsRecommendationCollectionItemSupportedLevel

items List<Property Map>

The list of supported levels.

GetRecommendationsRecommendationCollectionItemSupportedLevelItem

Name string

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

Name string

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

name String

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

name string

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

name str

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

name String

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

Package Details

Repository
https://github.com/pulumi/pulumi-oci
License
Apache-2.0
Notes

This Pulumi package is based on the oci Terraform Provider.