1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. Limits
  5. getResourceAvailability
Oracle Cloud Infrastructure v1.32.0 published on Thursday, Apr 18, 2024 by Pulumi

oci.Limits.getResourceAvailability

Explore with Pulumi AI

oci logo
Oracle Cloud Infrastructure v1.32.0 published on Thursday, Apr 18, 2024 by Pulumi

    This data source provides details about a specific Resource Availability resource in Oracle Cloud Infrastructure Limits service.

    For a given compartmentId, resource limit name, and scope, returns the following:

    • The number of available resources associated with the given limit.
    • The usage in the selected compartment for the given limit. Note that not all resource limits support this API. If the value is not available, the API returns a 404 response.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as oci from "@pulumi/oci";
    
    const testResourceAvailability = oci.Limits.getResourceAvailability({
        compartmentId: _var.tenancy_ocid,
        limitName: _var.resource_availability_limit_name,
        serviceName: oci_limits_service.test_service.name,
        availabilityDomain: _var.resource_availability_availability_domain,
    });
    
    import pulumi
    import pulumi_oci as oci
    
    test_resource_availability = oci.Limits.get_resource_availability(compartment_id=var["tenancy_ocid"],
        limit_name=var["resource_availability_limit_name"],
        service_name=oci_limits_service["test_service"]["name"],
        availability_domain=var["resource_availability_availability_domain"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-oci/sdk/go/oci/Limits"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := Limits.GetResourceAvailability(ctx, &limits.GetResourceAvailabilityArgs{
    			CompartmentId:      _var.Tenancy_ocid,
    			LimitName:          _var.Resource_availability_limit_name,
    			ServiceName:        oci_limits_service.Test_service.Name,
    			AvailabilityDomain: pulumi.StringRef(_var.Resource_availability_availability_domain),
    		}, 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 testResourceAvailability = Oci.Limits.GetResourceAvailability.Invoke(new()
        {
            CompartmentId = @var.Tenancy_ocid,
            LimitName = @var.Resource_availability_limit_name,
            ServiceName = oci_limits_service.Test_service.Name,
            AvailabilityDomain = @var.Resource_availability_availability_domain,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.oci.Limits.LimitsFunctions;
    import com.pulumi.oci.Limits.inputs.GetResourceAvailabilityArgs;
    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 testResourceAvailability = LimitsFunctions.getResourceAvailability(GetResourceAvailabilityArgs.builder()
                .compartmentId(var_.tenancy_ocid())
                .limitName(var_.resource_availability_limit_name())
                .serviceName(oci_limits_service.test_service().name())
                .availabilityDomain(var_.resource_availability_availability_domain())
                .build());
    
        }
    }
    
    variables:
      testResourceAvailability:
        fn::invoke:
          Function: oci:Limits:getResourceAvailability
          Arguments:
            compartmentId: ${var.tenancy_ocid}
            limitName: ${var.resource_availability_limit_name}
            serviceName: ${oci_limits_service.test_service.name}
            availabilityDomain: ${var.resource_availability_availability_domain}
    

    Using getResourceAvailability

    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 getResourceAvailability(args: GetResourceAvailabilityArgs, opts?: InvokeOptions): Promise<GetResourceAvailabilityResult>
    function getResourceAvailabilityOutput(args: GetResourceAvailabilityOutputArgs, opts?: InvokeOptions): Output<GetResourceAvailabilityResult>
    def get_resource_availability(availability_domain: Optional[str] = None,
                                  compartment_id: Optional[str] = None,
                                  limit_name: Optional[str] = None,
                                  service_name: Optional[str] = None,
                                  opts: Optional[InvokeOptions] = None) -> GetResourceAvailabilityResult
    def get_resource_availability_output(availability_domain: Optional[pulumi.Input[str]] = None,
                                  compartment_id: Optional[pulumi.Input[str]] = None,
                                  limit_name: Optional[pulumi.Input[str]] = None,
                                  service_name: Optional[pulumi.Input[str]] = None,
                                  opts: Optional[InvokeOptions] = None) -> Output[GetResourceAvailabilityResult]
    func GetResourceAvailability(ctx *Context, args *GetResourceAvailabilityArgs, opts ...InvokeOption) (*GetResourceAvailabilityResult, error)
    func GetResourceAvailabilityOutput(ctx *Context, args *GetResourceAvailabilityOutputArgs, opts ...InvokeOption) GetResourceAvailabilityResultOutput

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

    public static class GetResourceAvailability 
    {
        public static Task<GetResourceAvailabilityResult> InvokeAsync(GetResourceAvailabilityArgs args, InvokeOptions? opts = null)
        public static Output<GetResourceAvailabilityResult> Invoke(GetResourceAvailabilityInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetResourceAvailabilityResult> getResourceAvailability(GetResourceAvailabilityArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: oci:Limits/getResourceAvailability:getResourceAvailability
      arguments:
        # arguments dictionary

    The following arguments are supported:

    CompartmentId string
    The OCID of the compartment for which data is being fetched.
    LimitName string
    The limit name for which to fetch the data.
    ServiceName string
    The service name of the target quota.
    AvailabilityDomain string
    This field is mandatory if the scopeType of the target resource limit is AD. Otherwise, this field should be omitted. If the above requirements are not met, the API returns a 400 - InvalidParameter response.
    CompartmentId string
    The OCID of the compartment for which data is being fetched.
    LimitName string
    The limit name for which to fetch the data.
    ServiceName string
    The service name of the target quota.
    AvailabilityDomain string
    This field is mandatory if the scopeType of the target resource limit is AD. Otherwise, this field should be omitted. If the above requirements are not met, the API returns a 400 - InvalidParameter response.
    compartmentId String
    The OCID of the compartment for which data is being fetched.
    limitName String
    The limit name for which to fetch the data.
    serviceName String
    The service name of the target quota.
    availabilityDomain String
    This field is mandatory if the scopeType of the target resource limit is AD. Otherwise, this field should be omitted. If the above requirements are not met, the API returns a 400 - InvalidParameter response.
    compartmentId string
    The OCID of the compartment for which data is being fetched.
    limitName string
    The limit name for which to fetch the data.
    serviceName string
    The service name of the target quota.
    availabilityDomain string
    This field is mandatory if the scopeType of the target resource limit is AD. Otherwise, this field should be omitted. If the above requirements are not met, the API returns a 400 - InvalidParameter response.
    compartment_id str
    The OCID of the compartment for which data is being fetched.
    limit_name str
    The limit name for which to fetch the data.
    service_name str
    The service name of the target quota.
    availability_domain str
    This field is mandatory if the scopeType of the target resource limit is AD. Otherwise, this field should be omitted. If the above requirements are not met, the API returns a 400 - InvalidParameter response.
    compartmentId String
    The OCID of the compartment for which data is being fetched.
    limitName String
    The limit name for which to fetch the data.
    serviceName String
    The service name of the target quota.
    availabilityDomain String
    This field is mandatory if the scopeType of the target resource limit is AD. Otherwise, this field should be omitted. If the above requirements are not met, the API returns a 400 - InvalidParameter response.

    getResourceAvailability Result

    The following output properties are available:

    Available string
    The count of available resources. To support resources with fractional counts, the field rounds down to the nearest integer.
    CompartmentId string
    EffectiveQuotaValue double
    The effective quota value for the given compartment. This field is only present if there is a current quota policy affecting the current resource in the target region or availability domain.
    FractionalAvailability double
    The most accurate count of available resources.
    FractionalUsage double
    The current most accurate usage in the given compartment.
    Id string
    The provider-assigned unique ID for this managed resource.
    LimitName string
    ServiceName string
    Used string
    The current usage in the given compartment. To support resources with fractional counts, the field rounds up to the nearest integer.
    AvailabilityDomain string
    Available string
    The count of available resources. To support resources with fractional counts, the field rounds down to the nearest integer.
    CompartmentId string
    EffectiveQuotaValue float64
    The effective quota value for the given compartment. This field is only present if there is a current quota policy affecting the current resource in the target region or availability domain.
    FractionalAvailability float64
    The most accurate count of available resources.
    FractionalUsage float64
    The current most accurate usage in the given compartment.
    Id string
    The provider-assigned unique ID for this managed resource.
    LimitName string
    ServiceName string
    Used string
    The current usage in the given compartment. To support resources with fractional counts, the field rounds up to the nearest integer.
    AvailabilityDomain string
    available String
    The count of available resources. To support resources with fractional counts, the field rounds down to the nearest integer.
    compartmentId String
    effectiveQuotaValue Double
    The effective quota value for the given compartment. This field is only present if there is a current quota policy affecting the current resource in the target region or availability domain.
    fractionalAvailability Double
    The most accurate count of available resources.
    fractionalUsage Double
    The current most accurate usage in the given compartment.
    id String
    The provider-assigned unique ID for this managed resource.
    limitName String
    serviceName String
    used String
    The current usage in the given compartment. To support resources with fractional counts, the field rounds up to the nearest integer.
    availabilityDomain String
    available string
    The count of available resources. To support resources with fractional counts, the field rounds down to the nearest integer.
    compartmentId string
    effectiveQuotaValue number
    The effective quota value for the given compartment. This field is only present if there is a current quota policy affecting the current resource in the target region or availability domain.
    fractionalAvailability number
    The most accurate count of available resources.
    fractionalUsage number
    The current most accurate usage in the given compartment.
    id string
    The provider-assigned unique ID for this managed resource.
    limitName string
    serviceName string
    used string
    The current usage in the given compartment. To support resources with fractional counts, the field rounds up to the nearest integer.
    availabilityDomain string
    available str
    The count of available resources. To support resources with fractional counts, the field rounds down to the nearest integer.
    compartment_id str
    effective_quota_value float
    The effective quota value for the given compartment. This field is only present if there is a current quota policy affecting the current resource in the target region or availability domain.
    fractional_availability float
    The most accurate count of available resources.
    fractional_usage float
    The current most accurate usage in the given compartment.
    id str
    The provider-assigned unique ID for this managed resource.
    limit_name str
    service_name str
    used str
    The current usage in the given compartment. To support resources with fractional counts, the field rounds up to the nearest integer.
    availability_domain str
    available String
    The count of available resources. To support resources with fractional counts, the field rounds down to the nearest integer.
    compartmentId String
    effectiveQuotaValue Number
    The effective quota value for the given compartment. This field is only present if there is a current quota policy affecting the current resource in the target region or availability domain.
    fractionalAvailability Number
    The most accurate count of available resources.
    fractionalUsage Number
    The current most accurate usage in the given compartment.
    id String
    The provider-assigned unique ID for this managed resource.
    limitName String
    serviceName String
    used String
    The current usage in the given compartment. To support resources with fractional counts, the field rounds up to the nearest integer.
    availabilityDomain String

    Package Details

    Repository
    oci pulumi/pulumi-oci
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the oci Terraform Provider.
    oci logo
    Oracle Cloud Infrastructure v1.32.0 published on Thursday, Apr 18, 2024 by Pulumi