oci.Optimizer.getRecommendationStrategy
Explore with Pulumi AI
This data source provides details about a specific Recommendation Strategy resource 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 testRecommendationStrategy = oci.Optimizer.getRecommendationStrategy({
compartmentId: compartmentId,
compartmentIdInSubtree: recommendationStrategyCompartmentIdInSubtree,
name: recommendationStrategyName,
recommendationName: testRecommendation.name,
});
import pulumi
import pulumi_oci as oci
test_recommendation_strategy = oci.Optimizer.get_recommendation_strategy(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/go/oci/Optimizer"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := Optimizer.GetRecommendationStrategy(ctx, &optimizer.GetRecommendationStrategyArgs{
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 testRecommendationStrategy = Oci.Optimizer.GetRecommendationStrategy.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.GetRecommendationStrategyArgs;
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 testRecommendationStrategy = OptimizerFunctions.getRecommendationStrategy(GetRecommendationStrategyArgs.builder()
.compartmentId(compartmentId)
.compartmentIdInSubtree(recommendationStrategyCompartmentIdInSubtree)
.name(recommendationStrategyName)
.recommendationName(testRecommendation.name())
.build());
}
}
variables:
testRecommendationStrategy:
fn::invoke:
Function: oci:Optimizer:getRecommendationStrategy
Arguments:
compartmentId: ${compartmentId}
compartmentIdInSubtree: ${recommendationStrategyCompartmentIdInSubtree}
name: ${recommendationStrategyName}
recommendationName: ${testRecommendation.name}
Using getRecommendationStrategy
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 getRecommendationStrategy(args: GetRecommendationStrategyArgs, opts?: InvokeOptions): Promise<GetRecommendationStrategyResult>
function getRecommendationStrategyOutput(args: GetRecommendationStrategyOutputArgs, opts?: InvokeOptions): Output<GetRecommendationStrategyResult>
def get_recommendation_strategy(compartment_id: Optional[str] = None,
compartment_id_in_subtree: Optional[bool] = None,
name: Optional[str] = None,
recommendation_name: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetRecommendationStrategyResult
def get_recommendation_strategy_output(compartment_id: Optional[pulumi.Input[str]] = None,
compartment_id_in_subtree: Optional[pulumi.Input[bool]] = None,
name: Optional[pulumi.Input[str]] = None,
recommendation_name: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetRecommendationStrategyResult]
func GetRecommendationStrategy(ctx *Context, args *GetRecommendationStrategyArgs, opts ...InvokeOption) (*GetRecommendationStrategyResult, error)
func GetRecommendationStrategyOutput(ctx *Context, args *GetRecommendationStrategyOutputArgs, opts ...InvokeOption) GetRecommendationStrategyResultOutput
> Note: This function is named GetRecommendationStrategy
in the Go SDK.
public static class GetRecommendationStrategy
{
public static Task<GetRecommendationStrategyResult> InvokeAsync(GetRecommendationStrategyArgs args, InvokeOptions? opts = null)
public static Output<GetRecommendationStrategyResult> Invoke(GetRecommendationStrategyInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetRecommendationStrategyResult> getRecommendationStrategy(GetRecommendationStrategyArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: oci:Optimizer/getRecommendationStrategy:getRecommendationStrategy
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).
- Name string
- Optional. A filter that returns results that match the name specified.
- Recommendation
Name string - Optional. A filter that returns results that match the recommendation name 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).
- Name string
- Optional. A filter that returns results that match the name specified.
- Recommendation
Name string - Optional. A filter that returns results that match the recommendation name 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).
- name String
- Optional. A filter that returns results that match the name specified.
- recommendation
Name String - Optional. A filter that returns results that match the recommendation name 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).
- name string
- Optional. A filter that returns results that match the name specified.
- recommendation
Name string - Optional. A filter that returns results that match the recommendation name 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).
- 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.
- 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).
- name String
- Optional. A filter that returns results that match the name specified.
- recommendation
Name String - Optional. A filter that returns results that match the recommendation name specified.
getRecommendationStrategy Result
The following output properties are available:
- Compartment
Id string - Compartment
Id boolIn Subtree - Id string
- The provider-assigned unique ID for this managed resource.
- Items
List<Get
Recommendation Strategy Item> - A collection of recommendation strategy summaries.
- Name string
- The name of the strategy parameter.
- Recommendation
Name string
- Compartment
Id string - Compartment
Id boolIn Subtree - Id string
- The provider-assigned unique ID for this managed resource.
- Items
[]Get
Recommendation Strategy Item - A collection of recommendation strategy summaries.
- Name string
- The name of the strategy parameter.
- Recommendation
Name string
- compartment
Id String - compartment
Id BooleanIn Subtree - id String
- The provider-assigned unique ID for this managed resource.
- items
List<Get
Recommendation Strategy Item> - A collection of recommendation strategy summaries.
- name String
- The name of the strategy parameter.
- recommendation
Name String
- compartment
Id string - compartment
Id booleanIn Subtree - id string
- The provider-assigned unique ID for this managed resource.
- items
Get
Recommendation Strategy Item[] - A collection of recommendation strategy summaries.
- name string
- The name of the strategy parameter.
- recommendation
Name string
- compartment_
id str - compartment_
id_ boolin_ subtree - id str
- The provider-assigned unique ID for this managed resource.
- items
Sequence[optimizer.
Get Recommendation Strategy Item] - A collection of recommendation strategy summaries.
- name str
- The name of the strategy parameter.
- recommendation_
name str
- compartment
Id String - compartment
Id BooleanIn Subtree - id String
- The provider-assigned unique ID for this managed resource.
- items List<Property Map>
- A collection of recommendation strategy summaries.
- name String
- The name of the strategy parameter.
- recommendation
Name String
Supporting Types
GetRecommendationStrategyItem
- Name string
- Optional. A filter that returns results that match the name specified.
- Strategies
List<Get
Recommendation Strategy Item Strategy> - The list of strategies used.
- Name string
- Optional. A filter that returns results that match the name specified.
- Strategies
[]Get
Recommendation Strategy Item Strategy - The list of strategies used.
- name String
- Optional. A filter that returns results that match the name specified.
- strategies
List<Get
Recommendation Strategy Item Strategy> - The list of strategies used.
- name string
- Optional. A filter that returns results that match the name specified.
- strategies
Get
Recommendation Strategy Item Strategy[] - The list of strategies used.
- name str
- Optional. A filter that returns results that match the name specified.
- strategies
Sequence[optimizer.
Get Recommendation Strategy Item Strategy] - 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.
GetRecommendationStrategyItemStrategy
- Is
Default bool - Whether this is the default recommendation strategy.
- Parameters
Definitions List<GetRecommendation Strategy Item Strategy Parameters Definition> - The list of strategies for the parameters.
- Strategy
Name string - The name of the strategy.
- Is
Default bool - Whether this is the default recommendation strategy.
- Parameters
Definitions []GetRecommendation Strategy Item Strategy Parameters Definition - The list of strategies for the parameters.
- Strategy
Name string - The name of the strategy.
- is
Default Boolean - Whether this is the default recommendation strategy.
- parameters
Definitions List<GetRecommendation Strategy Item Strategy Parameters Definition> - The list of strategies for the parameters.
- strategy
Name String - The name of the strategy.
- is
Default boolean - Whether this is the default recommendation strategy.
- parameters
Definitions GetRecommendation Strategy Item Strategy Parameters Definition[] - The list of strategies for the parameters.
- strategy
Name string - The name of the strategy.
- is_
default bool - Whether this is the default recommendation strategy.
- parameters_
definitions Sequence[optimizer.Get Recommendation Strategy Item Strategy Parameters Definition] - The list of strategies for the parameters.
- strategy_
name str - The name of the strategy.
- is
Default Boolean - Whether this is the default recommendation strategy.
- parameters
Definitions List<Property Map> - The list of strategies for the parameters.
- strategy
Name String - The name of the strategy.
GetRecommendationStrategyItemStrategyParametersDefinition
- Default
Values List<object> - A default value used for the strategy parameter.
- Description string
- Text describing the strategy parameter.
- Is
Required bool - Whether this parameter is required.
- Name string
- Optional. A filter that returns results that match the name specified.
- Possible
Values List<object> - The list of possible values used for these strategy parameters.
- Type string
- The type of strategy parameter.
- Default
Values []interface{} - A default value used for the strategy parameter.
- Description string
- Text describing the strategy parameter.
- Is
Required bool - Whether this parameter is required.
- Name string
- Optional. A filter that returns results that match the name specified.
- Possible
Values []interface{} - The list of possible values used for these strategy parameters.
- Type string
- The type of strategy parameter.
- default
Values List<Object> - A default value used for the strategy parameter.
- description String
- Text describing the strategy parameter.
- is
Required Boolean - Whether this parameter is required.
- name String
- Optional. A filter that returns results that match the name specified.
- possible
Values List<Object> - The list of possible values used for these strategy parameters.
- type String
- The type of strategy parameter.
- default
Values any[] - A default value used for the strategy parameter.
- description string
- Text describing the strategy parameter.
- is
Required boolean - Whether this parameter is required.
- name string
- Optional. A filter that returns results that match the name specified.
- possible
Values 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.
- default
Values List<Any> - A default value used for the strategy parameter.
- description String
- Text describing the strategy parameter.
- is
Required Boolean - Whether this parameter is required.
- name String
- Optional. A filter that returns results that match the name specified.
- possible
Values 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.