1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. Optimizer
  5. getResourceAction
Oracle Cloud Infrastructure v2.29.0 published on Wednesday, Apr 9, 2025 by Pulumi

oci.Optimizer.getResourceAction

Explore with Pulumi AI

Oracle Cloud Infrastructure v2.29.0 published on Wednesday, Apr 9, 2025 by Pulumi

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,
});
Copy
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)
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.GetResourceAction(ctx, &optimizer.GetResourceActionArgs{
			ResourceActionId:        testResourceActionOciOptimizerResourceAction.Id,
			IncludeResourceMetadata: pulumi.BoolRef(resourceActionIncludeResourceMetadata),
		}, 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 testResourceAction = Oci.Optimizer.GetResourceAction.Invoke(new()
    {
        ResourceActionId = testResourceActionOciOptimizerResourceAction.Id,
        IncludeResourceMetadata = resourceActionIncludeResourceMetadata,
    });

});
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.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());

    }
}
Copy
variables:
  testResourceAction:
    fn::invoke:
      function: oci:Optimizer:getResourceAction
      arguments:
        resourceActionId: ${testResourceActionOciOptimizerResourceAction.id}
        includeResourceMetadata: ${resourceActionIncludeResourceMetadata}
Copy

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>
Copy
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]
Copy
func GetResourceAction(ctx *Context, args *GetResourceActionArgs, opts ...InvokeOption) (*GetResourceActionResult, error)
func GetResourceActionOutput(ctx *Context, args *GetResourceActionOutputArgs, opts ...InvokeOption) GetResourceActionResultOutput
Copy

> Note: This function is named GetResourceAction 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)
}
Copy
public static CompletableFuture<GetResourceActionResult> getResourceAction(GetResourceActionArgs args, InvokeOptions options)
public static Output<GetResourceActionResult> getResourceAction(GetResourceActionArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: oci:Optimizer/getResourceAction:getResourceAction
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

ResourceActionId This property is required. string
The unique OCID associated with the resource action.
IncludeResourceMetadata bool
Supplement additional resource information in extended metadata response.
ResourceActionId This property is required. string
The unique OCID associated with the resource action.
IncludeResourceMetadata bool
Supplement additional resource information in extended metadata response.
resourceActionId This property is required. String
The unique OCID associated with the resource action.
includeResourceMetadata Boolean
Supplement additional resource information in extended metadata response.
resourceActionId This property is required. string
The unique OCID associated with the resource action.
includeResourceMetadata boolean
Supplement additional resource information in extended metadata response.
resource_action_id This property is required. str
The unique OCID associated with the resource action.
include_resource_metadata bool
Supplement additional resource information in extended metadata response.
resourceActionId This property is required. String
The unique OCID associated with the resource action.
includeResourceMetadata Boolean
Supplement additional resource information in extended metadata response.

getResourceAction Result

The following output properties are available:

Actions List<GetResourceActionAction>
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.
EstimatedCostSaving double
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 metadata object.
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.
ResourceActionId string
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.
TimeStatusBegin string
The date and time that the resource action entered its current status. The format is defined by RFC3339.
TimeStatusEnd string
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.
IncludeResourceMetadata bool
Actions []GetResourceActionAction
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.
EstimatedCostSaving float64
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 metadata object.
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.
ResourceActionId string
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.
TimeStatusBegin string
The date and time that the resource action entered its current status. The format is defined by RFC3339.
TimeStatusEnd string
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.
IncludeResourceMetadata bool
actions List<GetResourceActionAction>
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.
estimatedCostSaving Double
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 metadata object.
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.
resourceActionId String
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.
timeStatusBegin String
The date and time that the resource action entered its current status. The format is defined by RFC3339.
timeStatusEnd String
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.
includeResourceMetadata Boolean
actions GetResourceActionAction[]
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.
estimatedCostSaving number
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 metadata object.
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.
resourceActionId string
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.
timeStatusBegin string
The date and time that the resource action entered its current status. The format is defined by RFC3339.
timeStatusEnd string
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.
includeResourceMetadata boolean
actions Sequence[optimizer.GetResourceActionAction]
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_saving float
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 metadata object.
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_id str
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_begin str
The date and time that the resource action entered its current status. The format is defined by RFC3339.
time_status_end str
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_metadata bool
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.
estimatedCostSaving Number
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 metadata object.
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.
resourceActionId String
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.
timeStatusBegin String
The date and time that the resource action entered its current status. The format is defined by RFC3339.
timeStatusEnd String
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.
includeResourceMetadata Boolean

Supporting Types

GetResourceActionAction

Description This property is required. string
Text describing the recommended action.
Type This property is required. string
The status of the resource action.
Url This property is required. string
The URL path to documentation that explains how to perform the action.
Description This property is required. string
Text describing the recommended action.
Type This property is required. string
The status of the resource action.
Url This property is required. string
The URL path to documentation that explains how to perform the action.
description This property is required. String
Text describing the recommended action.
type This property is required. String
The status of the resource action.
url This property is required. String
The URL path to documentation that explains how to perform the action.
description This property is required. string
Text describing the recommended action.
type This property is required. string
The status of the resource action.
url This property is required. string
The URL path to documentation that explains how to perform the action.
description This property is required. str
Text describing the recommended action.
type This property is required. str
The status of the resource action.
url This property is required. str
The URL path to documentation that explains how to perform the action.
description This property is required. String
Text describing the recommended action.
type This property is required. String
The status of the resource action.
url This property is required. 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 oci Terraform Provider.
Oracle Cloud Infrastructure v2.29.0 published on Wednesday, Apr 9, 2025 by Pulumi