Oracle Cloud Infrastructure v2.33.0 published on Thursday, May 1, 2025 by Pulumi
oci.Optimizer.getCategory
Explore with Pulumi AI
This data source provides details about a specific Category resource in Oracle Cloud Infrastructure Optimizer service.
Gets the category that corresponds to the specified OCID.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";
const testCategory = oci.Optimizer.getCategory({
    categoryId: testCategoryOciOptimizerCategory.id,
});
import pulumi
import pulumi_oci as oci
test_category = oci.Optimizer.get_category(category_id=test_category_oci_optimizer_category["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.GetCategory(ctx, &optimizer.GetCategoryArgs{
			CategoryId: testCategoryOciOptimizerCategory.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 testCategory = Oci.Optimizer.GetCategory.Invoke(new()
    {
        CategoryId = testCategoryOciOptimizerCategory.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.GetCategoryArgs;
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 testCategory = OptimizerFunctions.getCategory(GetCategoryArgs.builder()
            .categoryId(testCategoryOciOptimizerCategory.id())
            .build());
    }
}
variables:
  testCategory:
    fn::invoke:
      function: oci:Optimizer:getCategory
      arguments:
        categoryId: ${testCategoryOciOptimizerCategory.id}
Using getCategory
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 getCategory(args: GetCategoryArgs, opts?: InvokeOptions): Promise<GetCategoryResult>
function getCategoryOutput(args: GetCategoryOutputArgs, opts?: InvokeOptions): Output<GetCategoryResult>def get_category(category_id: Optional[str] = None,
                 opts: Optional[InvokeOptions] = None) -> GetCategoryResult
def get_category_output(category_id: Optional[pulumi.Input[str]] = None,
                 opts: Optional[InvokeOptions] = None) -> Output[GetCategoryResult]func GetCategory(ctx *Context, args *GetCategoryArgs, opts ...InvokeOption) (*GetCategoryResult, error)
func GetCategoryOutput(ctx *Context, args *GetCategoryOutputArgs, opts ...InvokeOption) GetCategoryResultOutput> Note: This function is named GetCategory in the Go SDK.
public static class GetCategory 
{
    public static Task<GetCategoryResult> InvokeAsync(GetCategoryArgs args, InvokeOptions? opts = null)
    public static Output<GetCategoryResult> Invoke(GetCategoryInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetCategoryResult> getCategory(GetCategoryArgs args, InvokeOptions options)
public static Output<GetCategoryResult> getCategory(GetCategoryArgs args, InvokeOptions options)
fn::invoke:
  function: oci:Optimizer/getCategory:getCategory
  arguments:
    # arguments dictionaryThe following arguments are supported:
- CategoryId string
- The unique OCID associated with the category.
- CategoryId string
- The unique OCID associated with the category.
- categoryId String
- The unique OCID associated with the category.
- categoryId string
- The unique OCID associated with the category.
- category_id str
- The unique OCID associated with the category.
- categoryId String
- The unique OCID associated with the category.
getCategory Result
The following output properties are available:
- CategoryId string
- CompartmentId string
- The OCID of the tenancy. The tenancy is the root compartment.
- CompartmentName string
- The name associated with the compartment.
- Description string
- Text describing the category.
- EstimatedCost doubleSaving 
- The estimated cost savings, in dollars, for the category.
- ExtendedMetadata Dictionary<string, string>
- Additional metadata key/value pairs for the category.
- Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- The name assigned to the category.
- RecommendationCounts List<GetCategory Recommendation Count> 
- An array of RecommendationCountobjects grouped by the level of importance assigned to the recommendation.
- ResourceCounts List<GetCategory Resource Count> 
- An array of ResourceCountobjects grouped by the status of the recommendation.
- State string
- The category's current state.
- TimeCreated string
- The date and time the category details were created, in the format defined by RFC3339.
- TimeUpdated string
- The date and time the category details were last updated, in the format defined by RFC3339.
- CategoryId string
- CompartmentId string
- The OCID of the tenancy. The tenancy is the root compartment.
- CompartmentName string
- The name associated with the compartment.
- Description string
- Text describing the category.
- EstimatedCost float64Saving 
- The estimated cost savings, in dollars, for the category.
- ExtendedMetadata map[string]string
- Additional metadata key/value pairs for the category.
- Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- The name assigned to the category.
- RecommendationCounts []GetCategory Recommendation Count 
- An array of RecommendationCountobjects grouped by the level of importance assigned to the recommendation.
- ResourceCounts []GetCategory Resource Count 
- An array of ResourceCountobjects grouped by the status of the recommendation.
- State string
- The category's current state.
- TimeCreated string
- The date and time the category details were created, in the format defined by RFC3339.
- TimeUpdated string
- The date and time the category details were last updated, in the format defined by RFC3339.
- categoryId String
- compartmentId String
- The OCID of the tenancy. The tenancy is the root compartment.
- compartmentName String
- The name associated with the compartment.
- description String
- Text describing the category.
- estimatedCost DoubleSaving 
- The estimated cost savings, in dollars, for the category.
- extendedMetadata Map<String,String>
- Additional metadata key/value pairs for the category.
- id String
- The provider-assigned unique ID for this managed resource.
- name String
- The name assigned to the category.
- recommendationCounts List<GetCategory Recommendation Count> 
- An array of RecommendationCountobjects grouped by the level of importance assigned to the recommendation.
- resourceCounts List<GetCategory Resource Count> 
- An array of ResourceCountobjects grouped by the status of the recommendation.
- state String
- The category's current state.
- timeCreated String
- The date and time the category details were created, in the format defined by RFC3339.
- timeUpdated String
- The date and time the category details were last updated, in the format defined by RFC3339.
- categoryId string
- compartmentId string
- The OCID of the tenancy. The tenancy is the root compartment.
- compartmentName string
- The name associated with the compartment.
- description string
- Text describing the category.
- estimatedCost numberSaving 
- The estimated cost savings, in dollars, for the category.
- extendedMetadata {[key: string]: string}
- Additional metadata key/value pairs for the category.
- id string
- The provider-assigned unique ID for this managed resource.
- name string
- The name assigned to the category.
- recommendationCounts GetCategory Recommendation Count[] 
- An array of RecommendationCountobjects grouped by the level of importance assigned to the recommendation.
- resourceCounts GetCategory Resource Count[] 
- An array of ResourceCountobjects grouped by the status of the recommendation.
- state string
- The category's current state.
- timeCreated string
- The date and time the category details were created, in the format defined by RFC3339.
- timeUpdated string
- The date and time the category details were last updated, in the format defined by RFC3339.
- category_id str
- compartment_id str
- The OCID of the tenancy. The tenancy is the root compartment.
- compartment_name str
- The name associated with the compartment.
- description str
- Text describing the category.
- estimated_cost_ floatsaving 
- The estimated cost savings, in dollars, for the category.
- extended_metadata Mapping[str, str]
- Additional metadata key/value pairs for the category.
- id str
- The provider-assigned unique ID for this managed resource.
- name str
- The name assigned to the category.
- recommendation_counts Sequence[GetCategory Recommendation Count] 
- An array of RecommendationCountobjects grouped by the level of importance assigned to the recommendation.
- resource_counts Sequence[GetCategory Resource Count] 
- An array of ResourceCountobjects grouped by the status of the recommendation.
- state str
- The category's current state.
- time_created str
- The date and time the category details were created, in the format defined by RFC3339.
- time_updated str
- The date and time the category details were last updated, in the format defined by RFC3339.
- categoryId String
- compartmentId String
- The OCID of the tenancy. The tenancy is the root compartment.
- compartmentName String
- The name associated with the compartment.
- description String
- Text describing the category.
- estimatedCost NumberSaving 
- The estimated cost savings, in dollars, for the category.
- extendedMetadata Map<String>
- Additional metadata key/value pairs for the category.
- id String
- The provider-assigned unique ID for this managed resource.
- name String
- The name assigned to the category.
- recommendationCounts List<Property Map>
- An array of RecommendationCountobjects grouped by the level of importance assigned to the recommendation.
- resourceCounts List<Property Map>
- An array of ResourceCountobjects grouped by the status of the recommendation.
- state String
- The category's current state.
- timeCreated String
- The date and time the category details were created, in the format defined by RFC3339.
- timeUpdated String
- The date and time the category details were last updated, in the format defined by RFC3339.
Supporting Types
GetCategoryRecommendationCount   
- Count int
- The count of resources.
- Importance string
- The level of importance assigned to the recommendation.
- Count int
- The count of resources.
- Importance string
- The level of importance assigned to the recommendation.
- count Integer
- The count of resources.
- importance String
- The level of importance assigned to the recommendation.
- count number
- The count of resources.
- importance string
- The level of importance assigned to the recommendation.
- count int
- The count of resources.
- importance str
- The level of importance assigned to the recommendation.
- count Number
- The count of resources.
- importance String
- The level of importance assigned to the recommendation.
GetCategoryResourceCount   
Package Details
- Repository
- oci pulumi/pulumi-oci
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the ociTerraform Provider.