Oracle Cloud Infrastructure v2.33.0 published on Thursday, May 1, 2025 by Pulumi
oci.Optimizer.getResourceAction
Explore with Pulumi AI
This data source provides details about a specific Resource Action resource in Oracle Cloud Infrastructure Optimizer service.
Gets the resource action that corresponds to the specified OCID.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";
const testResourceAction = oci.Optimizer.getResourceAction({
    resourceActionId: testResourceActionOciOptimizerResourceAction.id,
    includeResourceMetadata: resourceActionIncludeResourceMetadata,
});
import pulumi
import pulumi_oci as oci
test_resource_action = oci.Optimizer.get_resource_action(resource_action_id=test_resource_action_oci_optimizer_resource_action["id"],
    include_resource_metadata=resource_action_include_resource_metadata)
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.GetResourceAction(ctx, &optimizer.GetResourceActionArgs{
			ResourceActionId:        testResourceActionOciOptimizerResourceAction.Id,
			IncludeResourceMetadata: pulumi.BoolRef(resourceActionIncludeResourceMetadata),
		}, 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 testResourceAction = Oci.Optimizer.GetResourceAction.Invoke(new()
    {
        ResourceActionId = testResourceActionOciOptimizerResourceAction.Id,
        IncludeResourceMetadata = resourceActionIncludeResourceMetadata,
    });
});
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.GetResourceActionArgs;
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 testResourceAction = OptimizerFunctions.getResourceAction(GetResourceActionArgs.builder()
            .resourceActionId(testResourceActionOciOptimizerResourceAction.id())
            .includeResourceMetadata(resourceActionIncludeResourceMetadata)
            .build());
    }
}
variables:
  testResourceAction:
    fn::invoke:
      function: oci:Optimizer:getResourceAction
      arguments:
        resourceActionId: ${testResourceActionOciOptimizerResourceAction.id}
        includeResourceMetadata: ${resourceActionIncludeResourceMetadata}
Using getResourceAction
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 getResourceAction(args: GetResourceActionArgs, opts?: InvokeOptions): Promise<GetResourceActionResult>
function getResourceActionOutput(args: GetResourceActionOutputArgs, opts?: InvokeOptions): Output<GetResourceActionResult>def get_resource_action(include_resource_metadata: Optional[bool] = None,
                        resource_action_id: Optional[str] = None,
                        opts: Optional[InvokeOptions] = None) -> GetResourceActionResult
def get_resource_action_output(include_resource_metadata: Optional[pulumi.Input[bool]] = None,
                        resource_action_id: Optional[pulumi.Input[str]] = None,
                        opts: Optional[InvokeOptions] = None) -> Output[GetResourceActionResult]func LookupResourceAction(ctx *Context, args *LookupResourceActionArgs, opts ...InvokeOption) (*LookupResourceActionResult, error)
func LookupResourceActionOutput(ctx *Context, args *LookupResourceActionOutputArgs, opts ...InvokeOption) LookupResourceActionResultOutput> Note: This function is named LookupResourceAction in the Go SDK.
public static class GetResourceAction 
{
    public static Task<GetResourceActionResult> InvokeAsync(GetResourceActionArgs args, InvokeOptions? opts = null)
    public static Output<GetResourceActionResult> Invoke(GetResourceActionInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetResourceActionResult> getResourceAction(GetResourceActionArgs args, InvokeOptions options)
public static Output<GetResourceActionResult> getResourceAction(GetResourceActionArgs args, InvokeOptions options)
fn::invoke:
  function: oci:Optimizer/getResourceAction:getResourceAction
  arguments:
    # arguments dictionaryThe following arguments are supported:
- ResourceAction stringId 
- The unique OCID associated with the resource action.
- IncludeResource boolMetadata 
- Supplement additional resource information in extended metadata response.
- ResourceAction stringId 
- The unique OCID associated with the resource action.
- IncludeResource boolMetadata 
- Supplement additional resource information in extended metadata response.
- resourceAction StringId 
- The unique OCID associated with the resource action.
- includeResource BooleanMetadata 
- Supplement additional resource information in extended metadata response.
- resourceAction stringId 
- The unique OCID associated with the resource action.
- includeResource booleanMetadata 
- Supplement additional resource information in extended metadata response.
- resource_action_ strid 
- The unique OCID associated with the resource action.
- include_resource_ boolmetadata 
- Supplement additional resource information in extended metadata response.
- resourceAction StringId 
- The unique OCID associated with the resource action.
- includeResource BooleanMetadata 
- Supplement additional resource information in extended metadata response.
getResourceAction Result
The following output properties are available:
- Actions
List<GetResource Action Action> 
- Details about the recommended action.
- CategoryId string
- The unique OCID associated with the category.
- CompartmentId string
- The OCID of the compartment.
- CompartmentName string
- The name associated with the compartment.
- EstimatedCost doubleSaving 
- The estimated cost savings, in dollars, for the resource action.
- ExtendedMetadata Dictionary<string, string>
- Additional metadata key/value pairs that you provide. They serve the same purpose and functionality as fields in the metadataobject.
- Id string
- The unique OCID associated with the resource action.
- Metadata Dictionary<string, string>
- Custom metadata key/value pairs for the resource action.
- Name string
- The name assigned to the resource.
- RecommendationId string
- The unique OCID associated with the recommendation.
- ResourceAction stringId 
- ResourceId string
- The unique OCID associated with the resource.
- ResourceType string
- The kind of resource.
- State string
- The resource action's current state.
- Status string
- The current status of the resource action.
- TimeCreated string
- The date and time the resource action details were created, in the format defined by RFC3339.
- TimeStatus stringBegin 
- The date and time that the resource action entered its current status. The format is defined by RFC3339.
- TimeStatus stringEnd 
- The date and time the current status will change. The format is defined by RFC3339.
- TimeUpdated string
- The date and time the resource action details were last updated, in the format defined by RFC3339.
- IncludeResource boolMetadata 
- Actions
[]GetResource Action Action 
- Details about the recommended action.
- CategoryId string
- The unique OCID associated with the category.
- CompartmentId string
- The OCID of the compartment.
- CompartmentName string
- The name associated with the compartment.
- EstimatedCost float64Saving 
- The estimated cost savings, in dollars, for the resource action.
- ExtendedMetadata map[string]string
- Additional metadata key/value pairs that you provide. They serve the same purpose and functionality as fields in the metadataobject.
- Id string
- The unique OCID associated with the resource action.
- Metadata map[string]string
- Custom metadata key/value pairs for the resource action.
- Name string
- The name assigned to the resource.
- RecommendationId string
- The unique OCID associated with the recommendation.
- ResourceAction stringId 
- ResourceId string
- The unique OCID associated with the resource.
- ResourceType string
- The kind of resource.
- State string
- The resource action's current state.
- Status string
- The current status of the resource action.
- TimeCreated string
- The date and time the resource action details were created, in the format defined by RFC3339.
- TimeStatus stringBegin 
- The date and time that the resource action entered its current status. The format is defined by RFC3339.
- TimeStatus stringEnd 
- The date and time the current status will change. The format is defined by RFC3339.
- TimeUpdated string
- The date and time the resource action details were last updated, in the format defined by RFC3339.
- IncludeResource boolMetadata 
- actions
List<GetResource Action Action> 
- Details about the recommended action.
- categoryId String
- The unique OCID associated with the category.
- compartmentId String
- The OCID of the compartment.
- compartmentName String
- The name associated with the compartment.
- estimatedCost DoubleSaving 
- The estimated cost savings, in dollars, for the resource action.
- extendedMetadata Map<String,String>
- Additional metadata key/value pairs that you provide. They serve the same purpose and functionality as fields in the metadataobject.
- id String
- The unique OCID associated with the resource action.
- metadata Map<String,String>
- Custom metadata key/value pairs for the resource action.
- name String
- The name assigned to the resource.
- recommendationId String
- The unique OCID associated with the recommendation.
- resourceAction StringId 
- resourceId String
- The unique OCID associated with the resource.
- resourceType String
- The kind of resource.
- state String
- The resource action's current state.
- status String
- The current status of the resource action.
- timeCreated String
- The date and time the resource action details were created, in the format defined by RFC3339.
- timeStatus StringBegin 
- The date and time that the resource action entered its current status. The format is defined by RFC3339.
- timeStatus StringEnd 
- The date and time the current status will change. The format is defined by RFC3339.
- timeUpdated String
- The date and time the resource action details were last updated, in the format defined by RFC3339.
- includeResource BooleanMetadata 
- actions
GetResource Action Action[] 
- Details about the recommended action.
- categoryId string
- The unique OCID associated with the category.
- compartmentId string
- The OCID of the compartment.
- compartmentName string
- The name associated with the compartment.
- estimatedCost numberSaving 
- The estimated cost savings, in dollars, for the resource action.
- extendedMetadata {[key: string]: string}
- Additional metadata key/value pairs that you provide. They serve the same purpose and functionality as fields in the metadataobject.
- id string
- The unique OCID associated with the resource action.
- metadata {[key: string]: string}
- Custom metadata key/value pairs for the resource action.
- name string
- The name assigned to the resource.
- recommendationId string
- The unique OCID associated with the recommendation.
- resourceAction stringId 
- resourceId string
- The unique OCID associated with the resource.
- resourceType string
- The kind of resource.
- state string
- The resource action's current state.
- status string
- The current status of the resource action.
- timeCreated string
- The date and time the resource action details were created, in the format defined by RFC3339.
- timeStatus stringBegin 
- The date and time that the resource action entered its current status. The format is defined by RFC3339.
- timeStatus stringEnd 
- The date and time the current status will change. The format is defined by RFC3339.
- timeUpdated string
- The date and time the resource action details were last updated, in the format defined by RFC3339.
- includeResource booleanMetadata 
- actions
Sequence[GetResource Action Action] 
- Details about the recommended action.
- category_id str
- The unique OCID associated with the category.
- compartment_id str
- The OCID of the compartment.
- compartment_name str
- The name associated with the compartment.
- estimated_cost_ floatsaving 
- The estimated cost savings, in dollars, for the resource action.
- extended_metadata Mapping[str, str]
- Additional metadata key/value pairs that you provide. They serve the same purpose and functionality as fields in the metadataobject.
- id str
- The unique OCID associated with the resource action.
- metadata Mapping[str, str]
- Custom metadata key/value pairs for the resource action.
- name str
- The name assigned to the resource.
- recommendation_id str
- The unique OCID associated with the recommendation.
- resource_action_ strid 
- resource_id str
- The unique OCID associated with the resource.
- resource_type str
- The kind of resource.
- state str
- The resource action's current state.
- status str
- The current status of the resource action.
- time_created str
- The date and time the resource action details were created, in the format defined by RFC3339.
- time_status_ strbegin 
- The date and time that the resource action entered its current status. The format is defined by RFC3339.
- time_status_ strend 
- The date and time the current status will change. The format is defined by RFC3339.
- time_updated str
- The date and time the resource action details were last updated, in the format defined by RFC3339.
- include_resource_ boolmetadata 
- actions List<Property Map>
- Details about the recommended action.
- categoryId String
- The unique OCID associated with the category.
- compartmentId String
- The OCID of the compartment.
- compartmentName String
- The name associated with the compartment.
- estimatedCost NumberSaving 
- The estimated cost savings, in dollars, for the resource action.
- extendedMetadata Map<String>
- Additional metadata key/value pairs that you provide. They serve the same purpose and functionality as fields in the metadataobject.
- id String
- The unique OCID associated with the resource action.
- metadata Map<String>
- Custom metadata key/value pairs for the resource action.
- name String
- The name assigned to the resource.
- recommendationId String
- The unique OCID associated with the recommendation.
- resourceAction StringId 
- resourceId String
- The unique OCID associated with the resource.
- resourceType String
- The kind of resource.
- state String
- The resource action's current state.
- status String
- The current status of the resource action.
- timeCreated String
- The date and time the resource action details were created, in the format defined by RFC3339.
- timeStatus StringBegin 
- The date and time that the resource action entered its current status. The format is defined by RFC3339.
- timeStatus StringEnd 
- The date and time the current status will change. The format is defined by RFC3339.
- timeUpdated String
- The date and time the resource action details were last updated, in the format defined by RFC3339.
- includeResource BooleanMetadata 
Supporting Types
GetResourceActionAction   
- Description string
- Text describing the recommended action.
- Type string
- The status of the resource action.
- Url string
- The URL path to documentation that explains how to perform the action.
- Description string
- Text describing the recommended action.
- Type string
- The status of the resource action.
- Url string
- The URL path to documentation that explains how to perform the action.
- description String
- Text describing the recommended action.
- type String
- The status of the resource action.
- url String
- The URL path to documentation that explains how to perform the action.
- description string
- Text describing the recommended action.
- type string
- The status of the resource action.
- url string
- The URL path to documentation that explains how to perform the action.
- description str
- Text describing the recommended action.
- type str
- The status of the resource action.
- url str
- The URL path to documentation that explains how to perform the action.
- description String
- Text describing the recommended action.
- type String
- The status of the resource action.
- url String
- The URL path to documentation that explains how to perform the action.
Package Details
- Repository
- oci pulumi/pulumi-oci
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the ociTerraform Provider.