oci.Optimizer.getCategories
Explore with Pulumi AI
This data source provides the list of Categories in Oracle Cloud Infrastructure Optimizer service.
Lists the supported Cloud Advisor categories.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";
const testCategories = oci.Optimizer.getCategories({
compartmentId: compartmentId,
compartmentIdInSubtree: categoryCompartmentIdInSubtree,
childTenancyIds: categoryChildTenancyIds,
includeOrganization: categoryIncludeOrganization,
name: categoryName,
state: categoryState,
});
import pulumi
import pulumi_oci as oci
test_categories = oci.Optimizer.get_categories(compartment_id=compartment_id,
compartment_id_in_subtree=category_compartment_id_in_subtree,
child_tenancy_ids=category_child_tenancy_ids,
include_organization=category_include_organization,
name=category_name,
state=category_state)
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.GetCategories(ctx, &optimizer.GetCategoriesArgs{
CompartmentId: compartmentId,
CompartmentIdInSubtree: categoryCompartmentIdInSubtree,
ChildTenancyIds: categoryChildTenancyIds,
IncludeOrganization: pulumi.BoolRef(categoryIncludeOrganization),
Name: pulumi.StringRef(categoryName),
State: pulumi.StringRef(categoryState),
}, 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 testCategories = Oci.Optimizer.GetCategories.Invoke(new()
{
CompartmentId = compartmentId,
CompartmentIdInSubtree = categoryCompartmentIdInSubtree,
ChildTenancyIds = categoryChildTenancyIds,
IncludeOrganization = categoryIncludeOrganization,
Name = categoryName,
State = categoryState,
});
});
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.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(compartmentId)
.compartmentIdInSubtree(categoryCompartmentIdInSubtree)
.childTenancyIds(categoryChildTenancyIds)
.includeOrganization(categoryIncludeOrganization)
.name(categoryName)
.state(categoryState)
.build());
}
}
variables:
testCategories:
fn::invoke:
Function: oci:Optimizer:getCategories
Arguments:
compartmentId: ${compartmentId}
compartmentIdInSubtree: ${categoryCompartmentIdInSubtree}
childTenancyIds: ${categoryChildTenancyIds}
includeOrganization: ${categoryIncludeOrganization}
name: ${categoryName}
state: ${categoryState}
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:
- 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).
- Child
Tenancy List<string>Ids 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.
If this list contains a tenancy id that isn't part of the organization of parent P, the request will fail. That is, let's say there is an organization with parent P with children A and B, and also one other tenant T that isn't part of the organization. If T is included in the list of childTenancyIds, the request will fail.
It is important to note that if you are setting the includeOrganization parameter value as true and also populating the childTenancyIds parameter with a list of child tenancies, the request will fail. The childTenancyIds and includeOrganization should be used exclusively.
When using this parameter, please make sure to set the compartmentId with the parent tenancy ID.
- Filters
List<Get
Categories Filter> - 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.
Please note that this parameter shouldn't be used along with childTenancyIds parameter. If you would like to get results specifically for parent P and only child A, use the childTenancyIds parameter and populate the list with tenancy id of P and A.
When using this parameter, please make sure to set the compartmentId with the parent tenancy ID.
- 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 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).
- Child
Tenancy []stringIds 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.
If this list contains a tenancy id that isn't part of the organization of parent P, the request will fail. That is, let's say there is an organization with parent P with children A and B, and also one other tenant T that isn't part of the organization. If T is included in the list of childTenancyIds, the request will fail.
It is important to note that if you are setting the includeOrganization parameter value as true and also populating the childTenancyIds parameter with a list of child tenancies, the request will fail. The childTenancyIds and includeOrganization should be used exclusively.
When using this parameter, please make sure to set the compartmentId with the parent tenancy ID.
- Filters
[]Get
Categories Filter - 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.
Please note that this parameter shouldn't be used along with childTenancyIds parameter. If you would like to get results specifically for parent P and only child A, use the childTenancyIds parameter and populate the list with tenancy id of P and A.
When using this parameter, please make sure to set the compartmentId with the parent tenancy ID.
- 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 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).
- child
Tenancy List<String>Ids 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.
If this list contains a tenancy id that isn't part of the organization of parent P, the request will fail. That is, let's say there is an organization with parent P with children A and B, and also one other tenant T that isn't part of the organization. If T is included in the list of childTenancyIds, the request will fail.
It is important to note that if you are setting the includeOrganization parameter value as true and also populating the childTenancyIds parameter with a list of child tenancies, the request will fail. The childTenancyIds and includeOrganization should be used exclusively.
When using this parameter, please make sure to set the compartmentId with the parent tenancy ID.
- filters
List<Get
Categories Filter> - include
Organization 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.
Please note that this parameter shouldn't be used along with childTenancyIds parameter. If you would like to get results specifically for parent P and only child A, use the childTenancyIds parameter and populate the list with tenancy id of P and A.
When using this parameter, please make sure to set the compartmentId with the parent tenancy ID.
- 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 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).
- child
Tenancy string[]Ids 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.
If this list contains a tenancy id that isn't part of the organization of parent P, the request will fail. That is, let's say there is an organization with parent P with children A and B, and also one other tenant T that isn't part of the organization. If T is included in the list of childTenancyIds, the request will fail.
It is important to note that if you are setting the includeOrganization parameter value as true and also populating the childTenancyIds parameter with a list of child tenancies, the request will fail. The childTenancyIds and includeOrganization should be used exclusively.
When using this parameter, please make sure to set the compartmentId with the parent tenancy ID.
- filters
Get
Categories Filter[] - include
Organization 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.
Please note that this parameter shouldn't be used along with childTenancyIds parameter. If you would like to get results specifically for parent P and only child A, use the childTenancyIds parameter and populate the list with tenancy id of P and A.
When using this parameter, please make sure to set the compartmentId with the parent tenancy ID.
- 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_ 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).
- child_
tenancy_ Sequence[str]ids 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.
If this list contains a tenancy id that isn't part of the organization of parent P, the request will fail. That is, let's say there is an organization with parent P with children A and B, and also one other tenant T that isn't part of the organization. If T is included in the list of childTenancyIds, the request will fail.
It is important to note that if you are setting the includeOrganization parameter value as true and also populating the childTenancyIds parameter with a list of child tenancies, the request will fail. The childTenancyIds and includeOrganization should be used exclusively.
When using this parameter, please make sure to set the compartmentId with the parent tenancy ID.
- filters
Sequence[optimizer.
Get Categories Filter] - 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.
Please note that this parameter shouldn't be used along with childTenancyIds parameter. If you would like to get results specifically for parent P and only child A, use the childTenancyIds parameter and populate the list with tenancy id of P and A.
When using this parameter, please make sure to set the compartmentId with the parent tenancy ID.
- 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.
- 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).
- child
Tenancy List<String>Ids 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.
If this list contains a tenancy id that isn't part of the organization of parent P, the request will fail. That is, let's say there is an organization with parent P with children A and B, and also one other tenant T that isn't part of the organization. If T is included in the list of childTenancyIds, the request will fail.
It is important to note that if you are setting the includeOrganization parameter value as true and also populating the childTenancyIds parameter with a list of child tenancies, the request will fail. The childTenancyIds and includeOrganization should be used exclusively.
When using this parameter, please make sure to set the compartmentId with the parent tenancy ID.
- filters List<Property Map>
- include
Organization 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.
Please note that this parameter shouldn't be used along with childTenancyIds parameter. If you would like to get results specifically for parent P and only child A, use the childTenancyIds parameter and populate the list with tenancy id of P and A.
When using this parameter, please make sure to set the compartmentId with the parent tenancy ID.
- 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:
- Category
Collections List<GetCategories Category Collection> - The list of category_collection.
- Compartment
Id string - The OCID of the tenancy. The tenancy is the root compartment.
- Compartment
Id boolIn Subtree - Id string
- The provider-assigned unique ID for this managed resource.
- Child
Tenancy List<string>Ids - Filters
List<Get
Categories Filter> - Include
Organization bool - Name string
- The name assigned to the category.
- State string
- The category's current state.
- Category
Collections []GetCategories Category Collection - The list of category_collection.
- Compartment
Id string - The OCID of the tenancy. The tenancy is the root compartment.
- Compartment
Id boolIn Subtree - Id string
- The provider-assigned unique ID for this managed resource.
- Child
Tenancy []stringIds - Filters
[]Get
Categories Filter - Include
Organization bool - Name string
- The name assigned to the category.
- State string
- The category's current state.
- category
Collections List<GetCategories Category Collection> - The list of category_collection.
- compartment
Id String - The OCID of the tenancy. The tenancy is the root compartment.
- compartment
Id BooleanIn Subtree - id String
- The provider-assigned unique ID for this managed resource.
- child
Tenancy List<String>Ids - filters
List<Get
Categories Filter> - include
Organization Boolean - name String
- The name assigned to the category.
- state String
- The category's current state.
- category
Collections GetCategories Category Collection[] - The list of category_collection.
- compartment
Id string - The OCID of the tenancy. The tenancy is the root compartment.
- compartment
Id booleanIn Subtree - id string
- The provider-assigned unique ID for this managed resource.
- child
Tenancy string[]Ids - filters
Get
Categories Filter[] - include
Organization boolean - name string
- The name assigned to the category.
- state string
- The category's current state.
- category_
collections Sequence[optimizer.Get Categories Category Collection] - The list of category_collection.
- compartment_
id str - The OCID of the tenancy. The tenancy is the root compartment.
- compartment_
id_ boolin_ subtree - id str
- The provider-assigned unique ID for this managed resource.
- child_
tenancy_ Sequence[str]ids - filters
Sequence[optimizer.
Get Categories Filter] - include_
organization bool - name str
- The name assigned to the category.
- state str
- The category's current state.
- category
Collections List<Property Map> - The list of category_collection.
- compartment
Id String - The OCID of the tenancy. The tenancy is the root compartment.
- compartment
Id BooleanIn Subtree - id String
- The provider-assigned unique ID for this managed resource.
- child
Tenancy List<String>Ids - filters List<Property Map>
- include
Organization Boolean - name String
- The name assigned to the category.
- state String
- The category's current state.
Supporting Types
GetCategoriesCategoryCollection
GetCategoriesCategoryCollectionItem
- Compartment
Id string - The OCID of the compartment.
- Compartment
Name string - The name associated with the compartment.
- Description string
- Text describing the category.
- Estimated
Cost doubleSaving - The estimated cost savings, in dollars, for the category.
- Extended
Metadata Dictionary<string, string> - 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.
- Recommendation
Counts List<GetCategories Category Collection Item Recommendation Count> - An array of
RecommendationCount
objects grouped by the level of importance assigned to the recommendation. - Resource
Counts List<GetCategories Category Collection Item Resource Count> - 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.
- Time
Created string - The date and time the category details were created, in the format defined by RFC3339.
- Time
Updated string - The date and time the category details were last updated, in the format defined by RFC3339.
- Compartment
Id string - The OCID of the compartment.
- Compartment
Name string - The name associated with the compartment.
- Description string
- Text describing the category.
- Estimated
Cost float64Saving - The estimated cost savings, in dollars, for the category.
- Extended
Metadata map[string]string - 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.
- Recommendation
Counts []GetCategories Category Collection Item Recommendation Count - An array of
RecommendationCount
objects grouped by the level of importance assigned to the recommendation. - Resource
Counts []GetCategories Category Collection Item Resource Count - 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.
- Time
Created string - The date and time the category details were created, in the format defined by RFC3339.
- Time
Updated string - The date and time the category details were last updated, in the format defined by RFC3339.
- compartment
Id String - The OCID of the compartment.
- compartment
Name String - The name associated with the compartment.
- description String
- Text describing the category.
- estimated
Cost DoubleSaving - The estimated cost savings, in dollars, for the category.
- extended
Metadata Map<String,String> - 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.
- recommendation
Counts List<GetCategories Category Collection Item Recommendation Count> - An array of
RecommendationCount
objects grouped by the level of importance assigned to the recommendation. - resource
Counts List<GetCategories Category Collection Item Resource Count> - 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.
- time
Created String - The date and time the category details were created, in the format defined by RFC3339.
- time
Updated String - The date and time the category details were last updated, in the format defined by RFC3339.
- compartment
Id string - The OCID of the compartment.
- compartment
Name string - The name associated with the compartment.
- description string
- Text describing the category.
- estimated
Cost numberSaving - The estimated cost savings, in dollars, for the category.
- extended
Metadata {[key: string]: string} - 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.
- recommendation
Counts GetCategories Category Collection Item Recommendation Count[] - An array of
RecommendationCount
objects grouped by the level of importance assigned to the recommendation. - resource
Counts GetCategories Category Collection Item Resource Count[] - 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.
- time
Created string - The date and time the category details were created, in the format defined by RFC3339.
- time
Updated 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_ 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 unique OCID of the category.
- name str
- Optional. A filter that returns results that match the name specified.
- recommendation_
counts Sequence[optimizer.Get Categories Category Collection Item Recommendation Count] - An array of
RecommendationCount
objects grouped by the level of importance assigned to the recommendation. - resource_
counts Sequence[optimizer.Get Categories Category Collection Item Resource Count] - 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.
- compartment
Id String - The OCID of the compartment.
- compartment
Name String - The name associated with the compartment.
- description String
- Text describing the category.
- estimated
Cost NumberSaving - The estimated cost savings, in dollars, for the category.
- extended
Metadata Map<String> - 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.
- recommendation
Counts List<Property Map> - An array of
RecommendationCount
objects grouped by the level of importance assigned to the recommendation. - resource
Counts 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.
- time
Created String - The date and time the category details were created, in the format defined by RFC3339.
- time
Updated 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
GetCategoriesFilter
Package Details
- Repository
- oci pulumi/pulumi-oci
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
oci
Terraform Provider.