1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. Optimizer
  5. getProfileLevels
Oracle Cloud Infrastructure v2.32.0 published on Thursday, Apr 24, 2025 by Pulumi

oci.Optimizer.getProfileLevels

Explore with Pulumi AI

Oracle Cloud Infrastructure v2.32.0 published on Thursday, Apr 24, 2025 by Pulumi

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

Lists the existing profile levels.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";

const testProfileLevels = oci.Optimizer.getProfileLevels({
    compartmentId: compartmentId,
    compartmentIdInSubtree: profileLevelCompartmentIdInSubtree,
    name: profileLevelName,
    recommendationName: testRecommendation.name,
});
Copy
import pulumi
import pulumi_oci as oci

test_profile_levels = oci.Optimizer.get_profile_levels(compartment_id=compartment_id,
    compartment_id_in_subtree=profile_level_compartment_id_in_subtree,
    name=profile_level_name,
    recommendation_name=test_recommendation["name"])
Copy
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.GetProfileLevels(ctx, &optimizer.GetProfileLevelsArgs{
			CompartmentId:          compartmentId,
			CompartmentIdInSubtree: profileLevelCompartmentIdInSubtree,
			Name:                   pulumi.StringRef(profileLevelName),
			RecommendationName:     pulumi.StringRef(testRecommendation.Name),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Oci = Pulumi.Oci;

return await Deployment.RunAsync(() => 
{
    var testProfileLevels = Oci.Optimizer.GetProfileLevels.Invoke(new()
    {
        CompartmentId = compartmentId,
        CompartmentIdInSubtree = profileLevelCompartmentIdInSubtree,
        Name = profileLevelName,
        RecommendationName = testRecommendation.Name,
    });

});
Copy
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.GetProfileLevelsArgs;
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 testProfileLevels = OptimizerFunctions.getProfileLevels(GetProfileLevelsArgs.builder()
            .compartmentId(compartmentId)
            .compartmentIdInSubtree(profileLevelCompartmentIdInSubtree)
            .name(profileLevelName)
            .recommendationName(testRecommendation.name())
            .build());

    }
}
Copy
variables:
  testProfileLevels:
    fn::invoke:
      function: oci:Optimizer:getProfileLevels
      arguments:
        compartmentId: ${compartmentId}
        compartmentIdInSubtree: ${profileLevelCompartmentIdInSubtree}
        name: ${profileLevelName}
        recommendationName: ${testRecommendation.name}
Copy

Using getProfileLevels

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 getProfileLevels(args: GetProfileLevelsArgs, opts?: InvokeOptions): Promise<GetProfileLevelsResult>
function getProfileLevelsOutput(args: GetProfileLevelsOutputArgs, opts?: InvokeOptions): Output<GetProfileLevelsResult>
Copy
def get_profile_levels(compartment_id: Optional[str] = None,
                       compartment_id_in_subtree: Optional[bool] = None,
                       filters: Optional[Sequence[_optimizer.GetProfileLevelsFilter]] = None,
                       name: Optional[str] = None,
                       recommendation_name: Optional[str] = None,
                       opts: Optional[InvokeOptions] = None) -> GetProfileLevelsResult
def get_profile_levels_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.GetProfileLevelsFilterArgs]]]] = None,
                       name: Optional[pulumi.Input[str]] = None,
                       recommendation_name: Optional[pulumi.Input[str]] = None,
                       opts: Optional[InvokeOptions] = None) -> Output[GetProfileLevelsResult]
Copy
func GetProfileLevels(ctx *Context, args *GetProfileLevelsArgs, opts ...InvokeOption) (*GetProfileLevelsResult, error)
func GetProfileLevelsOutput(ctx *Context, args *GetProfileLevelsOutputArgs, opts ...InvokeOption) GetProfileLevelsResultOutput
Copy

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

public static class GetProfileLevels 
{
    public static Task<GetProfileLevelsResult> InvokeAsync(GetProfileLevelsArgs args, InvokeOptions? opts = null)
    public static Output<GetProfileLevelsResult> Invoke(GetProfileLevelsInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetProfileLevelsResult> getProfileLevels(GetProfileLevelsArgs args, InvokeOptions options)
public static Output<GetProfileLevelsResult> getProfileLevels(GetProfileLevelsArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: oci:Optimizer/getProfileLevels:getProfileLevels
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

CompartmentId This property is required. string
The OCID of the compartment.
CompartmentIdInSubtree This property is required. 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 Changes to this property will trigger replacement. List<GetProfileLevelsFilter>
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 This property is required. string
The OCID of the compartment.
CompartmentIdInSubtree This property is required. 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 Changes to this property will trigger replacement. []GetProfileLevelsFilter
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 This property is required. String
The OCID of the compartment.
compartmentIdInSubtree This property is required. 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 Changes to this property will trigger replacement. List<GetProfileLevelsFilter>
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 This property is required. string
The OCID of the compartment.
compartmentIdInSubtree This property is required. 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 Changes to this property will trigger replacement. GetProfileLevelsFilter[]
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 This property is required. str
The OCID of the compartment.
compartment_id_in_subtree This property is required. 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 Changes to this property will trigger replacement. Sequence[optimizer.GetProfileLevelsFilter]
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 This property is required. String
The OCID of the compartment.
compartmentIdInSubtree This property is required. 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 Changes to this property will trigger replacement. 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.

getProfileLevels Result

The following output properties are available:

CompartmentId string
CompartmentIdInSubtree bool
Id string
The provider-assigned unique ID for this managed resource.
ProfileLevelCollections List<GetProfileLevelsProfileLevelCollection>
The list of profile_level_collection.
Filters List<GetProfileLevelsFilter>
Name string
A unique name for the profile level.
RecommendationName string
The name of the recommendation this profile level applies to.
CompartmentId string
CompartmentIdInSubtree bool
Id string
The provider-assigned unique ID for this managed resource.
ProfileLevelCollections []GetProfileLevelsProfileLevelCollection
The list of profile_level_collection.
Filters []GetProfileLevelsFilter
Name string
A unique name for the profile level.
RecommendationName string
The name of the recommendation this profile level applies to.
compartmentId String
compartmentIdInSubtree Boolean
id String
The provider-assigned unique ID for this managed resource.
profileLevelCollections List<GetProfileLevelsProfileLevelCollection>
The list of profile_level_collection.
filters List<GetProfileLevelsFilter>
name String
A unique name for the profile level.
recommendationName String
The name of the recommendation this profile level applies to.
compartmentId string
compartmentIdInSubtree boolean
id string
The provider-assigned unique ID for this managed resource.
profileLevelCollections GetProfileLevelsProfileLevelCollection[]
The list of profile_level_collection.
filters GetProfileLevelsFilter[]
name string
A unique name for the profile level.
recommendationName string
The name of the recommendation this profile level applies to.
compartment_id str
compartment_id_in_subtree bool
id str
The provider-assigned unique ID for this managed resource.
profile_level_collections Sequence[optimizer.GetProfileLevelsProfileLevelCollection]
The list of profile_level_collection.
filters Sequence[optimizer.GetProfileLevelsFilter]
name str
A unique name for the profile level.
recommendation_name str
The name of the recommendation this profile level applies to.
compartmentId String
compartmentIdInSubtree Boolean
id String
The provider-assigned unique ID for this managed resource.
profileLevelCollections List<Property Map>
The list of profile_level_collection.
filters List<Property Map>
name String
A unique name for the profile level.
recommendationName String
The name of the recommendation this profile level applies to.

Supporting Types

GetProfileLevelsFilter

Name This property is required. string
Optional. A filter that returns results that match the name specified.
Values This property is required. List<string>
Regex bool
Name This property is required. string
Optional. A filter that returns results that match the name specified.
Values This property is required. []string
Regex bool
name This property is required. String
Optional. A filter that returns results that match the name specified.
values This property is required. List<String>
regex Boolean
name This property is required. string
Optional. A filter that returns results that match the name specified.
values This property is required. string[]
regex boolean
name This property is required. str
Optional. A filter that returns results that match the name specified.
values This property is required. Sequence[str]
regex bool
name This property is required. String
Optional. A filter that returns results that match the name specified.
values This property is required. List<String>
regex Boolean

GetProfileLevelsProfileLevelCollection

Items This property is required. List<GetProfileLevelsProfileLevelCollectionItem>
A collection of profile levels.
Items This property is required. []GetProfileLevelsProfileLevelCollectionItem
A collection of profile levels.
items This property is required. List<GetProfileLevelsProfileLevelCollectionItem>
A collection of profile levels.
items This property is required. GetProfileLevelsProfileLevelCollectionItem[]
A collection of profile levels.
items This property is required. Sequence[optimizer.GetProfileLevelsProfileLevelCollectionItem]
A collection of profile levels.
items This property is required. List<Property Map>
A collection of profile levels.

GetProfileLevelsProfileLevelCollectionItem

DefaultInterval This property is required. int
The default aggregation interval (in days) for profiles using this profile level.
Metrics This property is required. List<GetProfileLevelsProfileLevelCollectionItemMetric>
The metrics that will be evaluated by profiles using this profile level.
Name This property is required. string
Optional. A filter that returns results that match the name specified.
RecommendationName This property is required. string
Optional. A filter that returns results that match the recommendation name specified.
TimeCreated This property is required. string
The date and time the category details were created, in the format defined by RFC3339.
TimeUpdated This property is required. string
The date and time the category details were last updated, in the format defined by RFC3339.
ValidIntervals This property is required. List<int>
An array of aggregation intervals (in days) allowed for profiles using this profile level.
DefaultInterval This property is required. int
The default aggregation interval (in days) for profiles using this profile level.
Metrics This property is required. []GetProfileLevelsProfileLevelCollectionItemMetric
The metrics that will be evaluated by profiles using this profile level.
Name This property is required. string
Optional. A filter that returns results that match the name specified.
RecommendationName This property is required. string
Optional. A filter that returns results that match the recommendation name specified.
TimeCreated This property is required. string
The date and time the category details were created, in the format defined by RFC3339.
TimeUpdated This property is required. string
The date and time the category details were last updated, in the format defined by RFC3339.
ValidIntervals This property is required. []int
An array of aggregation intervals (in days) allowed for profiles using this profile level.
defaultInterval This property is required. Integer
The default aggregation interval (in days) for profiles using this profile level.
metrics This property is required. List<GetProfileLevelsProfileLevelCollectionItemMetric>
The metrics that will be evaluated by profiles using this profile level.
name This property is required. String
Optional. A filter that returns results that match the name specified.
recommendationName This property is required. String
Optional. A filter that returns results that match the recommendation name specified.
timeCreated This property is required. String
The date and time the category details were created, in the format defined by RFC3339.
timeUpdated This property is required. String
The date and time the category details were last updated, in the format defined by RFC3339.
validIntervals This property is required. List<Integer>
An array of aggregation intervals (in days) allowed for profiles using this profile level.
defaultInterval This property is required. number
The default aggregation interval (in days) for profiles using this profile level.
metrics This property is required. GetProfileLevelsProfileLevelCollectionItemMetric[]
The metrics that will be evaluated by profiles using this profile level.
name This property is required. string
Optional. A filter that returns results that match the name specified.
recommendationName This property is required. string
Optional. A filter that returns results that match the recommendation name specified.
timeCreated This property is required. string
The date and time the category details were created, in the format defined by RFC3339.
timeUpdated This property is required. string
The date and time the category details were last updated, in the format defined by RFC3339.
validIntervals This property is required. number[]
An array of aggregation intervals (in days) allowed for profiles using this profile level.
default_interval This property is required. int
The default aggregation interval (in days) for profiles using this profile level.
metrics This property is required. Sequence[optimizer.GetProfileLevelsProfileLevelCollectionItemMetric]
The metrics that will be evaluated by profiles using this profile level.
name This property is required. str
Optional. A filter that returns results that match the name specified.
recommendation_name This property is required. str
Optional. A filter that returns results that match the recommendation name specified.
time_created This property is required. str
The date and time the category details were created, in the format defined by RFC3339.
time_updated This property is required. str
The date and time the category details were last updated, in the format defined by RFC3339.
valid_intervals This property is required. Sequence[int]
An array of aggregation intervals (in days) allowed for profiles using this profile level.
defaultInterval This property is required. Number
The default aggregation interval (in days) for profiles using this profile level.
metrics This property is required. List<Property Map>
The metrics that will be evaluated by profiles using this profile level.
name This property is required. String
Optional. A filter that returns results that match the name specified.
recommendationName This property is required. String
Optional. A filter that returns results that match the recommendation name specified.
timeCreated This property is required. String
The date and time the category details were created, in the format defined by RFC3339.
timeUpdated This property is required. String
The date and time the category details were last updated, in the format defined by RFC3339.
validIntervals This property is required. List<Number>
An array of aggregation intervals (in days) allowed for profiles using this profile level.

GetProfileLevelsProfileLevelCollectionItemMetric

Name This property is required. string
Optional. A filter that returns results that match the name specified.
Statistic This property is required. string
The name of the statistic (e.g., p95).
Target This property is required. double
Optional. The metric value that the recommendation will target.
Threshold This property is required. double
The threshold that must be crossed for the recommendation to appear.
Name This property is required. string
Optional. A filter that returns results that match the name specified.
Statistic This property is required. string
The name of the statistic (e.g., p95).
Target This property is required. float64
Optional. The metric value that the recommendation will target.
Threshold This property is required. float64
The threshold that must be crossed for the recommendation to appear.
name This property is required. String
Optional. A filter that returns results that match the name specified.
statistic This property is required. String
The name of the statistic (e.g., p95).
target This property is required. Double
Optional. The metric value that the recommendation will target.
threshold This property is required. Double
The threshold that must be crossed for the recommendation to appear.
name This property is required. string
Optional. A filter that returns results that match the name specified.
statistic This property is required. string
The name of the statistic (e.g., p95).
target This property is required. number
Optional. The metric value that the recommendation will target.
threshold This property is required. number
The threshold that must be crossed for the recommendation to appear.
name This property is required. str
Optional. A filter that returns results that match the name specified.
statistic This property is required. str
The name of the statistic (e.g., p95).
target This property is required. float
Optional. The metric value that the recommendation will target.
threshold This property is required. float
The threshold that must be crossed for the recommendation to appear.
name This property is required. String
Optional. A filter that returns results that match the name specified.
statistic This property is required. String
The name of the statistic (e.g., p95).
target This property is required. Number
Optional. The metric value that the recommendation will target.
threshold This property is required. Number
The threshold that must be crossed for the recommendation to appear.

Package Details

Repository
oci pulumi/pulumi-oci
License
Apache-2.0
Notes
This Pulumi package is based on the oci Terraform Provider.
Oracle Cloud Infrastructure v2.32.0 published on Thursday, Apr 24, 2025 by Pulumi