1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. Optimizer
  5. getRecommendationStrategies
Oracle Cloud Infrastructure v2.17.0 published on Friday, Nov 15, 2024 by Pulumi

oci.Optimizer.getRecommendationStrategies

Explore with Pulumi AI

oci logo
Oracle Cloud Infrastructure v2.17.0 published on Friday, Nov 15, 2024 by Pulumi

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

    Lists the existing strategies.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as oci from "@pulumi/oci";
    
    const testRecommendationStrategies = oci.Optimizer.getRecommendationStrategies({
        compartmentId: compartmentId,
        compartmentIdInSubtree: recommendationStrategyCompartmentIdInSubtree,
        name: recommendationStrategyName,
        recommendationName: testRecommendation.name,
    });
    
    import pulumi
    import pulumi_oci as oci
    
    test_recommendation_strategies = oci.Optimizer.get_recommendation_strategies(compartment_id=compartment_id,
        compartment_id_in_subtree=recommendation_strategy_compartment_id_in_subtree,
        name=recommendation_strategy_name,
        recommendation_name=test_recommendation["name"])
    
    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.GetRecommendationStrategies(ctx, &optimizer.GetRecommendationStrategiesArgs{
    			CompartmentId:          compartmentId,
    			CompartmentIdInSubtree: recommendationStrategyCompartmentIdInSubtree,
    			Name:                   pulumi.StringRef(recommendationStrategyName),
    			RecommendationName:     pulumi.StringRef(testRecommendation.Name),
    		}, 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 testRecommendationStrategies = Oci.Optimizer.GetRecommendationStrategies.Invoke(new()
        {
            CompartmentId = compartmentId,
            CompartmentIdInSubtree = recommendationStrategyCompartmentIdInSubtree,
            Name = recommendationStrategyName,
            RecommendationName = testRecommendation.Name,
        });
    
    });
    
    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.GetRecommendationStrategiesArgs;
    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 testRecommendationStrategies = OptimizerFunctions.getRecommendationStrategies(GetRecommendationStrategiesArgs.builder()
                .compartmentId(compartmentId)
                .compartmentIdInSubtree(recommendationStrategyCompartmentIdInSubtree)
                .name(recommendationStrategyName)
                .recommendationName(testRecommendation.name())
                .build());
    
        }
    }
    
    variables:
      testRecommendationStrategies:
        fn::invoke:
          Function: oci:Optimizer:getRecommendationStrategies
          Arguments:
            compartmentId: ${compartmentId}
            compartmentIdInSubtree: ${recommendationStrategyCompartmentIdInSubtree}
            name: ${recommendationStrategyName}
            recommendationName: ${testRecommendation.name}
    

    Using getRecommendationStrategies

    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 getRecommendationStrategies(args: GetRecommendationStrategiesArgs, opts?: InvokeOptions): Promise<GetRecommendationStrategiesResult>
    function getRecommendationStrategiesOutput(args: GetRecommendationStrategiesOutputArgs, opts?: InvokeOptions): Output<GetRecommendationStrategiesResult>
    def get_recommendation_strategies(compartment_id: Optional[str] = None,
                                      compartment_id_in_subtree: Optional[bool] = None,
                                      filters: Optional[Sequence[_optimizer.GetRecommendationStrategiesFilter]] = None,
                                      name: Optional[str] = None,
                                      recommendation_name: Optional[str] = None,
                                      opts: Optional[InvokeOptions] = None) -> GetRecommendationStrategiesResult
    def get_recommendation_strategies_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.GetRecommendationStrategiesFilterArgs]]]] = None,
                                      name: Optional[pulumi.Input[str]] = None,
                                      recommendation_name: Optional[pulumi.Input[str]] = None,
                                      opts: Optional[InvokeOptions] = None) -> Output[GetRecommendationStrategiesResult]
    func GetRecommendationStrategies(ctx *Context, args *GetRecommendationStrategiesArgs, opts ...InvokeOption) (*GetRecommendationStrategiesResult, error)
    func GetRecommendationStrategiesOutput(ctx *Context, args *GetRecommendationStrategiesOutputArgs, opts ...InvokeOption) GetRecommendationStrategiesResultOutput

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

    public static class GetRecommendationStrategies 
    {
        public static Task<GetRecommendationStrategiesResult> InvokeAsync(GetRecommendationStrategiesArgs args, InvokeOptions? opts = null)
        public static Output<GetRecommendationStrategiesResult> Invoke(GetRecommendationStrategiesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetRecommendationStrategiesResult> getRecommendationStrategies(GetRecommendationStrategiesArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: oci:Optimizer/getRecommendationStrategies:getRecommendationStrategies
      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.

    Can only be set to true when performing ListCompartments on the tenancy (root compartment).

    Filters List<GetRecommendationStrategiesFilter>
    Name string
    Optional. A filter that returns results that match the name specified.
    RecommendationName string
    Optional. A filter that returns results that match the recommendation name 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.

    Can only be set to true when performing ListCompartments on the tenancy (root compartment).

    Filters []GetRecommendationStrategiesFilter
    Name string
    Optional. A filter that returns results that match the name specified.
    RecommendationName string
    Optional. A filter that returns results that match the recommendation name 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.

    Can only be set to true when performing ListCompartments on the tenancy (root compartment).

    filters List<GetRecommendationStrategiesFilter>
    name String
    Optional. A filter that returns results that match the name specified.
    recommendationName String
    Optional. A filter that returns results that match the recommendation name 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.

    Can only be set to true when performing ListCompartments on the tenancy (root compartment).

    filters GetRecommendationStrategiesFilter[]
    name string
    Optional. A filter that returns results that match the name specified.
    recommendationName string
    Optional. A filter that returns results that match the recommendation name 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.

    Can only be set to true when performing ListCompartments on the tenancy (root compartment).

    filters Sequence[optimizer.GetRecommendationStrategiesFilter]
    name str
    Optional. A filter that returns results that match the name specified.
    recommendation_name str
    Optional. A filter that returns results that match the recommendation name 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.

    Can only be set to true when performing ListCompartments on the tenancy (root compartment).

    filters List<Property Map>
    name String
    Optional. A filter that returns results that match the name specified.
    recommendationName String
    Optional. A filter that returns results that match the recommendation name specified.

    getRecommendationStrategies Result

    The following output properties are available:

    CompartmentId string
    CompartmentIdInSubtree bool
    Id string
    The provider-assigned unique ID for this managed resource.
    RecommendationStrategyCollections List<GetRecommendationStrategiesRecommendationStrategyCollection>
    The list of recommendation_strategy_collection.
    Filters List<GetRecommendationStrategiesFilter>
    Name string
    The name of the strategy parameter.
    RecommendationName string
    CompartmentId string
    CompartmentIdInSubtree bool
    Id string
    The provider-assigned unique ID for this managed resource.
    RecommendationStrategyCollections []GetRecommendationStrategiesRecommendationStrategyCollection
    The list of recommendation_strategy_collection.
    Filters []GetRecommendationStrategiesFilter
    Name string
    The name of the strategy parameter.
    RecommendationName string
    compartmentId String
    compartmentIdInSubtree Boolean
    id String
    The provider-assigned unique ID for this managed resource.
    recommendationStrategyCollections List<GetRecommendationStrategiesRecommendationStrategyCollection>
    The list of recommendation_strategy_collection.
    filters List<GetRecommendationStrategiesFilter>
    name String
    The name of the strategy parameter.
    recommendationName String
    compartmentId string
    compartmentIdInSubtree boolean
    id string
    The provider-assigned unique ID for this managed resource.
    recommendationStrategyCollections GetRecommendationStrategiesRecommendationStrategyCollection[]
    The list of recommendation_strategy_collection.
    filters GetRecommendationStrategiesFilter[]
    name string
    The name of the strategy parameter.
    recommendationName string
    compartment_id str
    compartment_id_in_subtree bool
    id str
    The provider-assigned unique ID for this managed resource.
    recommendation_strategy_collections Sequence[optimizer.GetRecommendationStrategiesRecommendationStrategyCollection]
    The list of recommendation_strategy_collection.
    filters Sequence[optimizer.GetRecommendationStrategiesFilter]
    name str
    The name of the strategy parameter.
    recommendation_name str
    compartmentId String
    compartmentIdInSubtree Boolean
    id String
    The provider-assigned unique ID for this managed resource.
    recommendationStrategyCollections List<Property Map>
    The list of recommendation_strategy_collection.
    filters List<Property Map>
    name String
    The name of the strategy parameter.
    recommendationName String

    Supporting Types

    GetRecommendationStrategiesFilter

    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

    GetRecommendationStrategiesRecommendationStrategyCollection

    Items List<GetRecommendationStrategiesRecommendationStrategyCollectionItem>
    A collection of recommendation strategy summaries.
    Items []GetRecommendationStrategiesRecommendationStrategyCollectionItem
    A collection of recommendation strategy summaries.
    items List<GetRecommendationStrategiesRecommendationStrategyCollectionItem>
    A collection of recommendation strategy summaries.
    items GetRecommendationStrategiesRecommendationStrategyCollectionItem[]
    A collection of recommendation strategy summaries.
    items List<Property Map>
    A collection of recommendation strategy summaries.

    GetRecommendationStrategiesRecommendationStrategyCollectionItem

    Name string
    Optional. A filter that returns results that match the name specified.
    Strategies List<GetRecommendationStrategiesRecommendationStrategyCollectionItemStrategy>
    The list of strategies used.
    Name string
    Optional. A filter that returns results that match the name specified.
    Strategies []GetRecommendationStrategiesRecommendationStrategyCollectionItemStrategy
    The list of strategies used.
    name String
    Optional. A filter that returns results that match the name specified.
    strategies List<GetRecommendationStrategiesRecommendationStrategyCollectionItemStrategy>
    The list of strategies used.
    name string
    Optional. A filter that returns results that match the name specified.
    strategies GetRecommendationStrategiesRecommendationStrategyCollectionItemStrategy[]
    The list of strategies used.
    name str
    Optional. A filter that returns results that match the name specified.
    strategies Sequence[optimizer.GetRecommendationStrategiesRecommendationStrategyCollectionItemStrategy]
    The list of strategies used.
    name String
    Optional. A filter that returns results that match the name specified.
    strategies List<Property Map>
    The list of strategies used.

    GetRecommendationStrategiesRecommendationStrategyCollectionItemStrategy

    IsDefault bool
    Whether this is the default recommendation strategy.
    ParametersDefinitions List<GetRecommendationStrategiesRecommendationStrategyCollectionItemStrategyParametersDefinition>
    The list of strategies for the parameters.
    StrategyName string
    The name of the strategy.
    IsDefault bool
    Whether this is the default recommendation strategy.
    ParametersDefinitions []GetRecommendationStrategiesRecommendationStrategyCollectionItemStrategyParametersDefinition
    The list of strategies for the parameters.
    StrategyName string
    The name of the strategy.
    isDefault Boolean
    Whether this is the default recommendation strategy.
    parametersDefinitions List<GetRecommendationStrategiesRecommendationStrategyCollectionItemStrategyParametersDefinition>
    The list of strategies for the parameters.
    strategyName String
    The name of the strategy.
    isDefault boolean
    Whether this is the default recommendation strategy.
    parametersDefinitions GetRecommendationStrategiesRecommendationStrategyCollectionItemStrategyParametersDefinition[]
    The list of strategies for the parameters.
    strategyName string
    The name of the strategy.
    is_default bool
    Whether this is the default recommendation strategy.
    parameters_definitions Sequence[optimizer.GetRecommendationStrategiesRecommendationStrategyCollectionItemStrategyParametersDefinition]
    The list of strategies for the parameters.
    strategy_name str
    The name of the strategy.
    isDefault Boolean
    Whether this is the default recommendation strategy.
    parametersDefinitions List<Property Map>
    The list of strategies for the parameters.
    strategyName String
    The name of the strategy.

    GetRecommendationStrategiesRecommendationStrategyCollectionItemStrategyParametersDefinition

    DefaultValues List<object>
    A default value used for the strategy parameter.
    Description string
    Text describing the strategy parameter.
    IsRequired bool
    Whether this parameter is required.
    Name string
    Optional. A filter that returns results that match the name specified.
    PossibleValues List<object>
    The list of possible values used for these strategy parameters.
    Type string
    The type of strategy parameter.
    DefaultValues []interface{}
    A default value used for the strategy parameter.
    Description string
    Text describing the strategy parameter.
    IsRequired bool
    Whether this parameter is required.
    Name string
    Optional. A filter that returns results that match the name specified.
    PossibleValues []interface{}
    The list of possible values used for these strategy parameters.
    Type string
    The type of strategy parameter.
    defaultValues List<Object>
    A default value used for the strategy parameter.
    description String
    Text describing the strategy parameter.
    isRequired Boolean
    Whether this parameter is required.
    name String
    Optional. A filter that returns results that match the name specified.
    possibleValues List<Object>
    The list of possible values used for these strategy parameters.
    type String
    The type of strategy parameter.
    defaultValues any[]
    A default value used for the strategy parameter.
    description string
    Text describing the strategy parameter.
    isRequired boolean
    Whether this parameter is required.
    name string
    Optional. A filter that returns results that match the name specified.
    possibleValues any[]
    The list of possible values used for these strategy parameters.
    type string
    The type of strategy parameter.
    default_values Sequence[Any]
    A default value used for the strategy parameter.
    description str
    Text describing the strategy parameter.
    is_required bool
    Whether this parameter is required.
    name str
    Optional. A filter that returns results that match the name specified.
    possible_values Sequence[Any]
    The list of possible values used for these strategy parameters.
    type str
    The type of strategy parameter.
    defaultValues List<Any>
    A default value used for the strategy parameter.
    description String
    Text describing the strategy parameter.
    isRequired Boolean
    Whether this parameter is required.
    name String
    Optional. A filter that returns results that match the name specified.
    possibleValues List<Any>
    The list of possible values used for these strategy parameters.
    type String
    The type of strategy parameter.

    Package Details

    Repository
    oci pulumi/pulumi-oci
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the oci Terraform Provider.
    oci logo
    Oracle Cloud Infrastructure v2.17.0 published on Friday, Nov 15, 2024 by Pulumi