Oracle Cloud Infrastructure v2.4.0 published on Thursday, Jul 25, 2024 by Pulumi
oci.Limits.getResourceAvailability
Explore with Pulumi AI
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: tenancyOcid,
limitName: resourceAvailabilityLimitName,
serviceName: testService.name,
availabilityDomain: resourceAvailabilityAvailabilityDomain,
});
import pulumi
import pulumi_oci as oci
test_resource_availability = oci.Limits.get_resource_availability(compartment_id=tenancy_ocid,
limit_name=resource_availability_limit_name,
service_name=test_service["name"],
availability_domain=resource_availability_availability_domain)
package main
import (
"github.com/pulumi/pulumi-oci/sdk/v2/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: tenancyOcid,
LimitName: resourceAvailabilityLimitName,
ServiceName: testService.Name,
AvailabilityDomain: pulumi.StringRef(resourceAvailabilityAvailabilityDomain),
}, 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 = tenancyOcid,
LimitName = resourceAvailabilityLimitName,
ServiceName = testService.Name,
AvailabilityDomain = resourceAvailabilityAvailabilityDomain,
});
});
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(tenancyOcid)
.limitName(resourceAvailabilityLimitName)
.serviceName(testService.name())
.availabilityDomain(resourceAvailabilityAvailabilityDomain)
.build());
}
}
variables:
testResourceAvailability:
fn::invoke:
Function: oci:Limits:getResourceAvailability
Arguments:
compartmentId: ${tenancyOcid}
limitName: ${resourceAvailabilityLimitName}
serviceName: ${testService.name}
availabilityDomain: ${resourceAvailabilityAvailabilityDomain}
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:
- Compartment
Id string - The OCID of the compartment for which data is being fetched.
- Limit
Name string - The limit name for which to fetch the data.
- Service
Name string - The service name of the target quota.
- Availability
Domain 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 string - The OCID of the compartment for which data is being fetched.
- Limit
Name string - The limit name for which to fetch the data.
- Service
Name string - The service name of the target quota.
- Availability
Domain 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 String - The OCID of the compartment for which data is being fetched.
- limit
Name String - The limit name for which to fetch the data.
- service
Name String - The service name of the target quota.
- availability
Domain 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 string - The OCID of the compartment for which data is being fetched.
- limit
Name string - The limit name for which to fetch the data.
- service
Name string - The service name of the target quota.
- availability
Domain 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.
- compartment
Id String - The OCID of the compartment for which data is being fetched.
- limit
Name String - The limit name for which to fetch the data.
- service
Name String - The service name of the target quota.
- availability
Domain 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.
- Compartment
Id string - Effective
Quota doubleValue - 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 double - The most accurate count of available resources.
- Fractional
Usage double - The current most accurate usage in the given compartment.
- Id string
- The provider-assigned unique ID for this managed resource.
- Limit
Name string - Service
Name string - Used string
- The current usage in the given compartment. To support resources with fractional counts, the field rounds up to the nearest integer.
- Availability
Domain string
- Available string
- The count of available resources. To support resources with fractional counts, the field rounds down to the nearest integer.
- Compartment
Id string - Effective
Quota float64Value - 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 float64 - The most accurate count of available resources.
- Fractional
Usage float64 - The current most accurate usage in the given compartment.
- Id string
- The provider-assigned unique ID for this managed resource.
- Limit
Name string - Service
Name string - Used string
- The current usage in the given compartment. To support resources with fractional counts, the field rounds up to the nearest integer.
- Availability
Domain string
- available String
- The count of available resources. To support resources with fractional counts, the field rounds down to the nearest integer.
- compartment
Id String - effective
Quota DoubleValue - 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 Double - The most accurate count of available resources.
- fractional
Usage Double - The current most accurate usage in the given compartment.
- id String
- The provider-assigned unique ID for this managed resource.
- limit
Name String - service
Name String - used String
- The current usage in the given compartment. To support resources with fractional counts, the field rounds up to the nearest integer.
- availability
Domain String
- available string
- The count of available resources. To support resources with fractional counts, the field rounds down to the nearest integer.
- compartment
Id string - effective
Quota numberValue - 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 number - The most accurate count of available resources.
- fractional
Usage number - The current most accurate usage in the given compartment.
- id string
- The provider-assigned unique ID for this managed resource.
- limit
Name string - service
Name string - used string
- The current usage in the given compartment. To support resources with fractional counts, the field rounds up to the nearest integer.
- availability
Domain 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_ floatvalue - 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.
- compartment
Id String - effective
Quota NumberValue - 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 Number - The most accurate count of available resources.
- fractional
Usage Number - The current most accurate usage in the given compartment.
- id String
- The provider-assigned unique ID for this managed resource.
- limit
Name String - service
Name String - used String
- The current usage in the given compartment. To support resources with fractional counts, the field rounds up to the nearest integer.
- availability
Domain String
Package Details
- Repository
- oci pulumi/pulumi-oci
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
oci
Terraform Provider.