getCategories

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

Lists the supported Cloud Advisor categories.

Example Usage

using System.Collections.Generic;
using Pulumi;
using Oci = Pulumi.Oci;

return await Deployment.RunAsync(() => 
{
    var testCategories = Oci.Optimizer.GetCategories.Invoke(new()
    {
        CompartmentId = @var.Compartment_id,
        CompartmentIdInSubtree = @var.Category_compartment_id_in_subtree,
        ChildTenancyIds = @var.Category_child_tenancy_ids,
        IncludeOrganization = @var.Category_include_organization,
        Name = @var.Category_name,
        State = @var.Category_state,
    });

});
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.GetCategories(ctx, &optimizer.GetCategoriesArgs{
			CompartmentId:          _var.Compartment_id,
			CompartmentIdInSubtree: _var.Category_compartment_id_in_subtree,
			ChildTenancyIds:        _var.Category_child_tenancy_ids,
			IncludeOrganization:    pulumi.BoolRef(_var.Category_include_organization),
			Name:                   pulumi.StringRef(_var.Category_name),
			State:                  pulumi.StringRef(_var.Category_state),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
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.Marketplace.inputs.GetCategoriesArgs;
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 testCategories = OptimizerFunctions.getCategories(GetCategoriesArgs.builder()
            .compartmentId(var_.compartment_id())
            .compartmentIdInSubtree(var_.category_compartment_id_in_subtree())
            .childTenancyIds(var_.category_child_tenancy_ids())
            .includeOrganization(var_.category_include_organization())
            .name(var_.category_name())
            .state(var_.category_state())
            .build());

    }
}
import pulumi
import pulumi_oci as oci

test_categories = oci.Optimizer.get_categories(compartment_id=var["compartment_id"],
    compartment_id_in_subtree=var["category_compartment_id_in_subtree"],
    child_tenancy_ids=var["category_child_tenancy_ids"],
    include_organization=var["category_include_organization"],
    name=var["category_name"],
    state=var["category_state"])
import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";

const testCategories = oci.Optimizer.getCategories({
    compartmentId: _var.compartment_id,
    compartmentIdInSubtree: _var.category_compartment_id_in_subtree,
    childTenancyIds: _var.category_child_tenancy_ids,
    includeOrganization: _var.category_include_organization,
    name: _var.category_name,
    state: _var.category_state,
});
variables:
  testCategories:
    Fn::Invoke:
      Function: oci:Optimizer:getCategories
      Arguments:
        compartmentId: ${var.compartment_id}
        compartmentIdInSubtree: ${var.category_compartment_id_in_subtree}
        childTenancyIds: ${var.category_child_tenancy_ids}
        includeOrganization: ${var.category_include_organization}
        name: ${var.category_name}
        state: ${var.category_state}

Using getCategories

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 getCategories(args: GetCategoriesArgs, opts?: InvokeOptions): Promise<GetCategoriesResult>
function getCategoriesOutput(args: GetCategoriesOutputArgs, opts?: InvokeOptions): Output<GetCategoriesResult>
def get_categories(child_tenancy_ids: Optional[Sequence[str]] = None,
                   compartment_id: Optional[str] = None,
                   compartment_id_in_subtree: Optional[bool] = None,
                   filters: Optional[Sequence[_optimizer.GetCategoriesFilter]] = None,
                   include_organization: Optional[bool] = None,
                   name: Optional[str] = None,
                   state: Optional[str] = None,
                   opts: Optional[InvokeOptions] = None) -> GetCategoriesResult
def get_categories_output(child_tenancy_ids: Optional[pulumi.Input[Sequence[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.GetCategoriesFilterArgs]]]] = None,
                   include_organization: Optional[pulumi.Input[bool]] = None,
                   name: Optional[pulumi.Input[str]] = None,
                   state: Optional[pulumi.Input[str]] = None,
                   opts: Optional[InvokeOptions] = None) -> Output[GetCategoriesResult]
func GetCategories(ctx *Context, args *GetCategoriesArgs, opts ...InvokeOption) (*GetCategoriesResult, error)
func GetCategoriesOutput(ctx *Context, args *GetCategoriesOutputArgs, opts ...InvokeOption) GetCategoriesResultOutput

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

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

ChildTenancyIds List<string>

A list of child tenancies for which the respective data will be returned. Please note that the parent tenancy id can also be included in this list. For example, if there is a parent P with two children A and B, to return results of only parent P and child A, this list should be populated with tenancy id of parent P and child A.

Filters List<GetCategoriesFilter>
IncludeOrganization bool

When set to true, the data for all child tenancies including the parent is returned. That is, if there is an organization with parent P and children A and B, to return the data for the parent P, child A and child B, this parameter value should be set to true.

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.

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.

ChildTenancyIds []string

A list of child tenancies for which the respective data will be returned. Please note that the parent tenancy id can also be included in this list. For example, if there is a parent P with two children A and B, to return results of only parent P and child A, this list should be populated with tenancy id of parent P and child A.

Filters []GetCategoriesFilter
IncludeOrganization bool

When set to true, the data for all child tenancies including the parent is returned. That is, if there is an organization with parent P and children A and B, to return the data for the parent P, child A and child B, this parameter value should be set to true.

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.

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.

childTenancyIds List<String>

A list of child tenancies for which the respective data will be returned. Please note that the parent tenancy id can also be included in this list. For example, if there is a parent P with two children A and B, to return results of only parent P and child A, this list should be populated with tenancy id of parent P and child A.

filters List<GetCategoriesFilter>
includeOrganization Boolean

When set to true, the data for all child tenancies including the parent is returned. That is, if there is an organization with parent P and children A and B, to return the data for the parent P, child A and child B, this parameter value should be set to true.

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.

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.

childTenancyIds string[]

A list of child tenancies for which the respective data will be returned. Please note that the parent tenancy id can also be included in this list. For example, if there is a parent P with two children A and B, to return results of only parent P and child A, this list should be populated with tenancy id of parent P and child A.

filters GetCategoriesFilter[]
includeOrganization boolean

When set to true, the data for all child tenancies including the parent is returned. That is, if there is an organization with parent P and children A and B, to return the data for the parent P, child A and child B, this parameter value should be set to true.

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.

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.

child_tenancy_ids Sequence[str]

A list of child tenancies for which the respective data will be returned. Please note that the parent tenancy id can also be included in this list. For example, if there is a parent P with two children A and B, to return results of only parent P and child A, this list should be populated with tenancy id of parent P and child A.

filters GetCategoriesFilter]
include_organization bool

When set to true, the data for all child tenancies including the parent is returned. That is, if there is an organization with parent P and children A and B, to return the data for the parent P, child A and child B, this parameter value should be set to true.

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.

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.

childTenancyIds List<String>

A list of child tenancies for which the respective data will be returned. Please note that the parent tenancy id can also be included in this list. For example, if there is a parent P with two children A and B, to return results of only parent P and child A, this list should be populated with tenancy id of parent P and child A.

filters List<Property Map>
includeOrganization Boolean

When set to true, the data for all child tenancies including the parent is returned. That is, if there is an organization with parent P and children A and B, to return the data for the parent P, child A and child B, this parameter value should be set to true.

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.

getCategories Result

The following output properties are available:

CategoryCollections List<GetCategoriesCategoryCollection>

The list of category_collection.

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.

ChildTenancyIds List<string>
Filters List<GetCategoriesFilter>
IncludeOrganization bool
Name string

The name assigned to the category.

State string

The category's current state.

CategoryCollections []GetCategoriesCategoryCollection

The list of category_collection.

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.

ChildTenancyIds []string
Filters []GetCategoriesFilter
IncludeOrganization bool
Name string

The name assigned to the category.

State string

The category's current state.

categoryCollections List<GetCategoriesCategoryCollection>

The list of category_collection.

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.

childTenancyIds List<String>
filters List<GetCategoriesFilter>
includeOrganization Boolean
name String

The name assigned to the category.

state String

The category's current state.

categoryCollections GetCategoriesCategoryCollection[]

The list of category_collection.

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.

childTenancyIds string[]
filters GetCategoriesFilter[]
includeOrganization boolean
name string

The name assigned to the category.

state string

The category's current state.

category_collections GetCategoriesCategoryCollection]

The list of category_collection.

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.

child_tenancy_ids Sequence[str]
filters GetCategoriesFilter]
include_organization bool
name str

The name assigned to the category.

state str

The category's current state.

categoryCollections List<Property Map>

The list of category_collection.

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.

childTenancyIds List<String>
filters List<Property Map>
includeOrganization Boolean
name String

The name assigned to the category.

state String

The category's current state.

Supporting Types

GetCategoriesCategoryCollection

GetCategoriesCategoryCollectionItem

CompartmentId string

The OCID of the compartment.

CompartmentName string

The name associated with the compartment.

Description string

Text describing the category.

EstimatedCostSaving double

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

ExtendedMetadata Dictionary<string, object>

Additional metadata key/value pairs for the category.

Id string

The unique OCID of the category.

Name string

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

RecommendationCounts List<GetCategoriesCategoryCollectionItemRecommendationCount>

An array of RecommendationCount objects grouped by the level of importance assigned to the recommendation.

ResourceCounts List<GetCategoriesCategoryCollectionItemResourceCount>

An array of ResourceCount objects grouped by the status of the recommendation.

State string

A filter that returns results that match the lifecycle state specified.

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.

CompartmentId string

The OCID of the compartment.

CompartmentName string

The name associated with the compartment.

Description string

Text describing the category.

EstimatedCostSaving float64

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

ExtendedMetadata map[string]interface{}

Additional metadata key/value pairs for the category.

Id string

The unique OCID of the category.

Name string

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

RecommendationCounts []GetCategoriesCategoryCollectionItemRecommendationCount

An array of RecommendationCount objects grouped by the level of importance assigned to the recommendation.

ResourceCounts []GetCategoriesCategoryCollectionItemResourceCount

An array of ResourceCount objects grouped by the status of the recommendation.

State string

A filter that returns results that match the lifecycle state specified.

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.

compartmentId String

The OCID of the compartment.

compartmentName String

The name associated with the compartment.

description String

Text describing the category.

estimatedCostSaving Double

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

extendedMetadata Map<String,Object>

Additional metadata key/value pairs for the category.

id String

The unique OCID of the category.

name String

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

recommendationCounts List<GetCategoriesCategoryCollectionItemRecommendationCount>

An array of RecommendationCount objects grouped by the level of importance assigned to the recommendation.

resourceCounts List<GetCategoriesCategoryCollectionItemResourceCount>

An array of ResourceCount objects grouped by the status of the recommendation.

state String

A filter that returns results that match the lifecycle state specified.

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.

compartmentId string

The OCID of the compartment.

compartmentName string

The name associated with the compartment.

description string

Text describing the category.

estimatedCostSaving number

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

extendedMetadata {[key: string]: any}

Additional metadata key/value pairs for the category.

id string

The unique OCID of the category.

name string

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

recommendationCounts GetCategoriesCategoryCollectionItemRecommendationCount[]

An array of RecommendationCount objects grouped by the level of importance assigned to the recommendation.

resourceCounts GetCategoriesCategoryCollectionItemResourceCount[]

An array of ResourceCount objects grouped by the status of the recommendation.

state string

A filter that returns results that match the lifecycle state specified.

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.

compartment_id str

The OCID of the compartment.

compartment_name str

The name associated with the compartment.

description str

Text describing the category.

estimated_cost_saving float

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

extended_metadata Mapping[str, Any]

Additional metadata key/value pairs for the category.

id str

The unique OCID of the category.

name str

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

recommendation_counts GetCategoriesCategoryCollectionItemRecommendationCount]

An array of RecommendationCount objects grouped by the level of importance assigned to the recommendation.

resource_counts GetCategoriesCategoryCollectionItemResourceCount]

An array of ResourceCount objects grouped by the status of the recommendation.

state str

A filter that returns results that match the lifecycle state specified.

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.

compartmentId String

The OCID of the compartment.

compartmentName String

The name associated with the compartment.

description String

Text describing the category.

estimatedCostSaving Number

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

extendedMetadata Map<Any>

Additional metadata key/value pairs for the category.

id String

The unique OCID of the category.

name String

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

recommendationCounts List<Property Map>

An array of RecommendationCount objects grouped by the level of importance assigned to the recommendation.

resourceCounts List<Property Map>

An array of ResourceCount objects grouped by the status of the recommendation.

state String

A filter that returns results that match the lifecycle state specified.

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.

GetCategoriesCategoryCollectionItemRecommendationCount

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.

GetCategoriesCategoryCollectionItemResourceCount

Count int

The count of resources.

Status string

The recommendation status of the resource.

Count int

The count of resources.

Status string

The recommendation status of the resource.

count Integer

The count of resources.

status String

The recommendation status of the resource.

count number

The count of resources.

status string

The recommendation status of the resource.

count int

The count of resources.

status str

The recommendation status of the resource.

count Number

The count of resources.

status String

The recommendation status of the resource.

GetCategoriesFilter

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

Package Details

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

This Pulumi package is based on the oci Terraform Provider.