Oracle Cloud Infrastructure v2.27.0 published on Thursday, Mar 20, 2025 by Pulumi
oci.UsageProxy.getResources
Explore with Pulumi AI
This data source provides the list of Resources in Oracle Cloud Infrastructure Usage Proxy service.
Returns the resource details for a service
Important: Calls to this API will only succeed against the endpoint in the home region.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";
const testResources = oci.UsageProxy.getResources({
    compartmentId: compartmentId,
    serviceName: testService.name,
    entitlementId: testEntitlement.id,
});
import pulumi
import pulumi_oci as oci
test_resources = oci.UsageProxy.get_resources(compartment_id=compartment_id,
    service_name=test_service["name"],
    entitlement_id=test_entitlement["id"])
package main
import (
	"github.com/pulumi/pulumi-oci/sdk/v2/go/oci/usageproxy"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := usageproxy.GetResources(ctx, &usageproxy.GetResourcesArgs{
			CompartmentId: compartmentId,
			ServiceName:   testService.Name,
			EntitlementId: pulumi.StringRef(testEntitlement.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 testResources = Oci.UsageProxy.GetResources.Invoke(new()
    {
        CompartmentId = compartmentId,
        ServiceName = testService.Name,
        EntitlementId = testEntitlement.Id,
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.oci.UsageProxy.UsageProxyFunctions;
import com.pulumi.oci.UsageProxy.inputs.GetResourcesArgs;
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 testResources = UsageProxyFunctions.getResources(GetResourcesArgs.builder()
            .compartmentId(compartmentId)
            .serviceName(testService.name())
            .entitlementId(testEntitlement.id())
            .build());
    }
}
variables:
  testResources:
    fn::invoke:
      function: oci:UsageProxy:getResources
      arguments:
        compartmentId: ${compartmentId}
        serviceName: ${testService.name}
        entitlementId: ${testEntitlement.id}
Using getResources
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 getResources(args: GetResourcesArgs, opts?: InvokeOptions): Promise<GetResourcesResult>
function getResourcesOutput(args: GetResourcesOutputArgs, opts?: InvokeOptions): Output<GetResourcesResult>def get_resources(compartment_id: Optional[str] = None,
                  entitlement_id: Optional[str] = None,
                  filters: Optional[Sequence[_usageproxy.GetResourcesFilter]] = None,
                  service_name: Optional[str] = None,
                  opts: Optional[InvokeOptions] = None) -> GetResourcesResult
def get_resources_output(compartment_id: Optional[pulumi.Input[str]] = None,
                  entitlement_id: Optional[pulumi.Input[str]] = None,
                  filters: Optional[pulumi.Input[Sequence[pulumi.Input[_usageproxy.GetResourcesFilterArgs]]]] = None,
                  service_name: Optional[pulumi.Input[str]] = None,
                  opts: Optional[InvokeOptions] = None) -> Output[GetResourcesResult]func GetResources(ctx *Context, args *GetResourcesArgs, opts ...InvokeOption) (*GetResourcesResult, error)
func GetResourcesOutput(ctx *Context, args *GetResourcesOutputArgs, opts ...InvokeOption) GetResourcesResultOutput> Note: This function is named GetResources in the Go SDK.
public static class GetResources 
{
    public static Task<GetResourcesResult> InvokeAsync(GetResourcesArgs args, InvokeOptions? opts = null)
    public static Output<GetResourcesResult> Invoke(GetResourcesInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetResourcesResult> getResources(GetResourcesArgs args, InvokeOptions options)
public static Output<GetResourcesResult> getResources(GetResourcesArgs args, InvokeOptions options)
fn::invoke:
  function: oci:UsageProxy/getResources:getResources
  arguments:
    # arguments dictionaryThe following arguments are supported:
- CompartmentId string
- The OCID of the root compartment.
- ServiceName string
- Service Name.
- EntitlementId string
- Subscription or entitlement Id.
- Filters
List<GetResources Filter> 
- CompartmentId string
- The OCID of the root compartment.
- ServiceName string
- Service Name.
- EntitlementId string
- Subscription or entitlement Id.
- Filters
[]GetResources Filter 
- compartmentId String
- The OCID of the root compartment.
- serviceName String
- Service Name.
- entitlementId String
- Subscription or entitlement Id.
- filters
List<GetResources Filter> 
- compartmentId string
- The OCID of the root compartment.
- serviceName string
- Service Name.
- entitlementId string
- Subscription or entitlement Id.
- filters
GetResources Filter[] 
- compartment_id str
- The OCID of the root compartment.
- service_name str
- Service Name.
- entitlement_id str
- Subscription or entitlement Id.
- filters
Sequence[usageproxy.Get Resources Filter] 
- compartmentId String
- The OCID of the root compartment.
- serviceName String
- Service Name.
- entitlementId String
- Subscription or entitlement Id.
- filters List<Property Map>
getResources Result
The following output properties are available:
- CompartmentId string
- Id string
- The provider-assigned unique ID for this managed resource.
- ResourcesCollections List<GetResources Resources Collection> 
- The list of resources_collection.
- ServiceName string
- EntitlementId string
- Filters
List<GetResources Filter> 
- CompartmentId string
- Id string
- The provider-assigned unique ID for this managed resource.
- ResourcesCollections []GetResources Resources Collection 
- The list of resources_collection.
- ServiceName string
- EntitlementId string
- Filters
[]GetResources Filter 
- compartmentId String
- id String
- The provider-assigned unique ID for this managed resource.
- resourcesCollections List<GetResources Resources Collection> 
- The list of resources_collection.
- serviceName String
- entitlementId String
- filters
List<GetResources Filter> 
- compartmentId string
- id string
- The provider-assigned unique ID for this managed resource.
- resourcesCollections GetResources Resources Collection[] 
- The list of resources_collection.
- serviceName string
- entitlementId string
- filters
GetResources Filter[] 
- compartment_id str
- id str
- The provider-assigned unique ID for this managed resource.
- resources_collections Sequence[usageproxy.Get Resources Resources Collection] 
- The list of resources_collection.
- service_name str
- entitlement_id str
- filters
Sequence[usageproxy.Get Resources Filter] 
- compartmentId String
- id String
- The provider-assigned unique ID for this managed resource.
- resourcesCollections List<Property Map>
- The list of resources_collection.
- serviceName String
- entitlementId String
- filters List<Property Map>
Supporting Types
GetResourcesFilter  
GetResourcesResourcesCollection   
- Items
List<GetResources Resources Collection Item> 
- The list of resource details for a service.
- Items
[]GetResources Resources Collection Item 
- The list of resource details for a service.
- items
List<GetResources Resources Collection Item> 
- The list of resource details for a service.
- items
GetResources Resources Collection Item[] 
- The list of resource details for a service.
- items
Sequence[usageproxy.Get Resources Resources Collection Item] 
- The list of resource details for a service.
- items List<Property Map>
- The list of resource details for a service.
GetResourcesResourcesCollectionItem    
- ChildResources List<string>
- The details of any child resources.
- DailyUnit stringDisplay Name 
- Units to be used for daily aggregated data.
- Description string
- Description of the resource.
- HourlyUnit stringDisplay Name 
- Units to be used for hourly aggregated data.
- InstanceType string
- Instance type for the resource.
- IsPurchased bool
- Indicates if the SKU was purchased
- Name string
- Name of the resource.
- RawUnit stringDisplay Name 
- Default units to use when unspecified.
- Servicename string
- Name of the service.
- Skuses
List<GetResources Resources Collection Item Skus> 
- The details of resource Skus.
- UsageData stringType 
- Usage data type of the resource.
- ChildResources []string
- The details of any child resources.
- DailyUnit stringDisplay Name 
- Units to be used for daily aggregated data.
- Description string
- Description of the resource.
- HourlyUnit stringDisplay Name 
- Units to be used for hourly aggregated data.
- InstanceType string
- Instance type for the resource.
- IsPurchased bool
- Indicates if the SKU was purchased
- Name string
- Name of the resource.
- RawUnit stringDisplay Name 
- Default units to use when unspecified.
- Servicename string
- Name of the service.
- Skuses
[]GetResources Resources Collection Item Skus 
- The details of resource Skus.
- UsageData stringType 
- Usage data type of the resource.
- childResources List<String>
- The details of any child resources.
- dailyUnit StringDisplay Name 
- Units to be used for daily aggregated data.
- description String
- Description of the resource.
- hourlyUnit StringDisplay Name 
- Units to be used for hourly aggregated data.
- instanceType String
- Instance type for the resource.
- isPurchased Boolean
- Indicates if the SKU was purchased
- name String
- Name of the resource.
- rawUnit StringDisplay Name 
- Default units to use when unspecified.
- servicename String
- Name of the service.
- skuses
List<GetResources Resources Collection Item Skus> 
- The details of resource Skus.
- usageData StringType 
- Usage data type of the resource.
- childResources string[]
- The details of any child resources.
- dailyUnit stringDisplay Name 
- Units to be used for daily aggregated data.
- description string
- Description of the resource.
- hourlyUnit stringDisplay Name 
- Units to be used for hourly aggregated data.
- instanceType string
- Instance type for the resource.
- isPurchased boolean
- Indicates if the SKU was purchased
- name string
- Name of the resource.
- rawUnit stringDisplay Name 
- Default units to use when unspecified.
- servicename string
- Name of the service.
- skuses
GetResources Resources Collection Item Skus[] 
- The details of resource Skus.
- usageData stringType 
- Usage data type of the resource.
- child_resources Sequence[str]
- The details of any child resources.
- daily_unit_ strdisplay_ name 
- Units to be used for daily aggregated data.
- description str
- Description of the resource.
- hourly_unit_ strdisplay_ name 
- Units to be used for hourly aggregated data.
- instance_type str
- Instance type for the resource.
- is_purchased bool
- Indicates if the SKU was purchased
- name str
- Name of the resource.
- raw_unit_ strdisplay_ name 
- Default units to use when unspecified.
- servicename str
- Name of the service.
- skuses
Sequence[usageproxy.Get Resources Resources Collection Item Skus] 
- The details of resource Skus.
- usage_data_ strtype 
- Usage data type of the resource.
- childResources List<String>
- The details of any child resources.
- dailyUnit StringDisplay Name 
- Units to be used for daily aggregated data.
- description String
- Description of the resource.
- hourlyUnit StringDisplay Name 
- Units to be used for hourly aggregated data.
- instanceType String
- Instance type for the resource.
- isPurchased Boolean
- Indicates if the SKU was purchased
- name String
- Name of the resource.
- rawUnit StringDisplay Name 
- Default units to use when unspecified.
- servicename String
- Name of the service.
- skuses List<Property Map>
- The details of resource Skus.
- usageData StringType 
- Usage data type of the resource.
GetResourcesResourcesCollectionItemSkus     
- CloudCredit stringType 
- The cloud credit type for the resource.
- SkuId string
- The Sku Id for the resource.
- SkuType string
- The Sku type for the resource.
- CloudCredit stringType 
- The cloud credit type for the resource.
- SkuId string
- The Sku Id for the resource.
- SkuType string
- The Sku type for the resource.
- cloudCredit StringType 
- The cloud credit type for the resource.
- skuId String
- The Sku Id for the resource.
- skuType String
- The Sku type for the resource.
- cloudCredit stringType 
- The cloud credit type for the resource.
- skuId string
- The Sku Id for the resource.
- skuType string
- The Sku type for the resource.
- cloud_credit_ strtype 
- The cloud credit type for the resource.
- sku_id str
- The Sku Id for the resource.
- sku_type str
- The Sku type for the resource.
- cloudCredit StringType 
- The cloud credit type for the resource.
- skuId String
- The Sku Id for the resource.
- skuType String
- The Sku type for the resource.
Package Details
- Repository
- oci pulumi/pulumi-oci
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the ociTerraform Provider.