1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. ApiGateway
  5. getApi
Oracle Cloud Infrastructure v2.17.0 published on Friday, Nov 15, 2024 by Pulumi

oci.ApiGateway.getApi

Explore with Pulumi AI

oci logo
Oracle Cloud Infrastructure v2.17.0 published on Friday, Nov 15, 2024 by Pulumi

    This data source provides details about a specific Api resource in Oracle Cloud Infrastructure API Gateway service.

    Gets an API by identifier.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as oci from "@pulumi/oci";
    
    const testApi = oci.ApiGateway.getApi({
        apiId: testApiOciApigatewayApi.id,
    });
    
    import pulumi
    import pulumi_oci as oci
    
    test_api = oci.ApiGateway.get_api(api_id=test_api_oci_apigateway_api["id"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-oci/sdk/v2/go/oci/ApiGateway"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ApiGateway.GetApi(ctx, &apigateway.GetApiArgs{
    			ApiId: testApiOciApigatewayApi.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 testApi = Oci.ApiGateway.GetApi.Invoke(new()
        {
            ApiId = testApiOciApigatewayApi.Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.oci.ApiGateway.ApiGatewayFunctions;
    import com.pulumi.oci.ApiGateway.inputs.GetApiArgs;
    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 testApi = ApiGatewayFunctions.getApi(GetApiArgs.builder()
                .apiId(testApiOciApigatewayApi.id())
                .build());
    
        }
    }
    
    variables:
      testApi:
        fn::invoke:
          Function: oci:ApiGateway:getApi
          Arguments:
            apiId: ${testApiOciApigatewayApi.id}
    

    Using getApi

    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 getApi(args: GetApiArgs, opts?: InvokeOptions): Promise<GetApiResult>
    function getApiOutput(args: GetApiOutputArgs, opts?: InvokeOptions): Output<GetApiResult>
    def get_api(api_id: Optional[str] = None,
                opts: Optional[InvokeOptions] = None) -> GetApiResult
    def get_api_output(api_id: Optional[pulumi.Input[str]] = None,
                opts: Optional[InvokeOptions] = None) -> Output[GetApiResult]
    func GetApi(ctx *Context, args *GetApiArgs, opts ...InvokeOption) (*GetApiResult, error)
    func GetApiOutput(ctx *Context, args *GetApiOutputArgs, opts ...InvokeOption) GetApiResultOutput

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

    public static class GetApi 
    {
        public static Task<GetApiResult> InvokeAsync(GetApiArgs args, InvokeOptions? opts = null)
        public static Output<GetApiResult> Invoke(GetApiInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetApiResult> getApi(GetApiArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: oci:ApiGateway/getApi:getApi
      arguments:
        # arguments dictionary

    The following arguments are supported:

    ApiId string
    The ocid of the API.
    ApiId string
    The ocid of the API.
    apiId String
    The ocid of the API.
    apiId string
    The ocid of the API.
    api_id str
    The ocid of the API.
    apiId String
    The ocid of the API.

    getApi Result

    The following output properties are available:

    ApiId string
    CompartmentId string
    The OCID of the compartment in which the resource is created.
    Content string
    DefinedTags Dictionary<string, string>
    Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    DisplayName string
    A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. Example: My new resource
    FreeformTags Dictionary<string, string>
    Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
    Id string
    The OCID of the resource.
    LifecycleDetails string
    A message describing the current lifecycleState in more detail. For ACTIVE state it describes if the document has been validated and the possible values are:

    • 'New' for just updated API Specifications
    • 'Validating' for a document which is being validated.
    • 'Valid' the document has been validated without any errors or warnings
    • 'Warning' the document has been validated and contains warnings
    • 'Error' the document has been validated and contains errors
    • 'Failed' the document validation failed
    • 'Canceled' the document validation was canceled
    SpecificationType string
    Type of API Specification file.
    State string
    The current state of the API.
    TimeCreated string
    The time this resource was created. An RFC3339 formatted datetime string.
    TimeUpdated string
    The time this resource was last updated. An RFC3339 formatted datetime string.
    ValidationResults List<GetApiValidationResult>
    Status of each feature available from the API.
    ApiId string
    CompartmentId string
    The OCID of the compartment in which the resource is created.
    Content string
    DefinedTags map[string]string
    Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    DisplayName string
    A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. Example: My new resource
    FreeformTags map[string]string
    Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
    Id string
    The OCID of the resource.
    LifecycleDetails string
    A message describing the current lifecycleState in more detail. For ACTIVE state it describes if the document has been validated and the possible values are:

    • 'New' for just updated API Specifications
    • 'Validating' for a document which is being validated.
    • 'Valid' the document has been validated without any errors or warnings
    • 'Warning' the document has been validated and contains warnings
    • 'Error' the document has been validated and contains errors
    • 'Failed' the document validation failed
    • 'Canceled' the document validation was canceled
    SpecificationType string
    Type of API Specification file.
    State string
    The current state of the API.
    TimeCreated string
    The time this resource was created. An RFC3339 formatted datetime string.
    TimeUpdated string
    The time this resource was last updated. An RFC3339 formatted datetime string.
    ValidationResults []GetApiValidationResult
    Status of each feature available from the API.
    apiId String
    compartmentId String
    The OCID of the compartment in which the resource is created.
    content String
    definedTags Map<String,String>
    Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    displayName String
    A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. Example: My new resource
    freeformTags Map<String,String>
    Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
    id String
    The OCID of the resource.
    lifecycleDetails String
    A message describing the current lifecycleState in more detail. For ACTIVE state it describes if the document has been validated and the possible values are:

    • 'New' for just updated API Specifications
    • 'Validating' for a document which is being validated.
    • 'Valid' the document has been validated without any errors or warnings
    • 'Warning' the document has been validated and contains warnings
    • 'Error' the document has been validated and contains errors
    • 'Failed' the document validation failed
    • 'Canceled' the document validation was canceled
    specificationType String
    Type of API Specification file.
    state String
    The current state of the API.
    timeCreated String
    The time this resource was created. An RFC3339 formatted datetime string.
    timeUpdated String
    The time this resource was last updated. An RFC3339 formatted datetime string.
    validationResults List<GetApiValidationResult>
    Status of each feature available from the API.
    apiId string
    compartmentId string
    The OCID of the compartment in which the resource is created.
    content string
    definedTags {[key: string]: string}
    Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    displayName string
    A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. Example: My new resource
    freeformTags {[key: string]: string}
    Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
    id string
    The OCID of the resource.
    lifecycleDetails string
    A message describing the current lifecycleState in more detail. For ACTIVE state it describes if the document has been validated and the possible values are:

    • 'New' for just updated API Specifications
    • 'Validating' for a document which is being validated.
    • 'Valid' the document has been validated without any errors or warnings
    • 'Warning' the document has been validated and contains warnings
    • 'Error' the document has been validated and contains errors
    • 'Failed' the document validation failed
    • 'Canceled' the document validation was canceled
    specificationType string
    Type of API Specification file.
    state string
    The current state of the API.
    timeCreated string
    The time this resource was created. An RFC3339 formatted datetime string.
    timeUpdated string
    The time this resource was last updated. An RFC3339 formatted datetime string.
    validationResults GetApiValidationResult[]
    Status of each feature available from the API.
    api_id str
    compartment_id str
    The OCID of the compartment in which the resource is created.
    content str
    defined_tags Mapping[str, str]
    Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    display_name str
    A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. Example: My new resource
    freeform_tags Mapping[str, str]
    Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
    id str
    The OCID of the resource.
    lifecycle_details str
    A message describing the current lifecycleState in more detail. For ACTIVE state it describes if the document has been validated and the possible values are:

    • 'New' for just updated API Specifications
    • 'Validating' for a document which is being validated.
    • 'Valid' the document has been validated without any errors or warnings
    • 'Warning' the document has been validated and contains warnings
    • 'Error' the document has been validated and contains errors
    • 'Failed' the document validation failed
    • 'Canceled' the document validation was canceled
    specification_type str
    Type of API Specification file.
    state str
    The current state of the API.
    time_created str
    The time this resource was created. An RFC3339 formatted datetime string.
    time_updated str
    The time this resource was last updated. An RFC3339 formatted datetime string.
    validation_results Sequence[apigateway.GetApiValidationResult]
    Status of each feature available from the API.
    apiId String
    compartmentId String
    The OCID of the compartment in which the resource is created.
    content String
    definedTags Map<String>
    Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    displayName String
    A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. Example: My new resource
    freeformTags Map<String>
    Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
    id String
    The OCID of the resource.
    lifecycleDetails String
    A message describing the current lifecycleState in more detail. For ACTIVE state it describes if the document has been validated and the possible values are:

    • 'New' for just updated API Specifications
    • 'Validating' for a document which is being validated.
    • 'Valid' the document has been validated without any errors or warnings
    • 'Warning' the document has been validated and contains warnings
    • 'Error' the document has been validated and contains errors
    • 'Failed' the document validation failed
    • 'Canceled' the document validation was canceled
    specificationType String
    Type of API Specification file.
    state String
    The current state of the API.
    timeCreated String
    The time this resource was created. An RFC3339 formatted datetime string.
    timeUpdated String
    The time this resource was last updated. An RFC3339 formatted datetime string.
    validationResults List<Property Map>
    Status of each feature available from the API.

    Supporting Types

    GetApiValidationResult

    Name string
    Name of the validation.
    Result string
    Result of the validation.
    Name string
    Name of the validation.
    Result string
    Result of the validation.
    name String
    Name of the validation.
    result String
    Result of the validation.
    name string
    Name of the validation.
    result string
    Result of the validation.
    name str
    Name of the validation.
    result str
    Result of the validation.
    name String
    Name of the validation.
    result String
    Result of the validation.

    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 v2.17.0 published on Friday, Nov 15, 2024 by Pulumi