Interface IRestApi

All Superinterfaces:
software.constructs.IConstruct, software.constructs.IDependable, IEnvironmentAware, IResource, IRestApiRef, software.amazon.jsii.JsiiSerializable
All Known Subinterfaces:
IRestApi.Jsii$Default
All Known Implementing Classes:
IRestApi.Jsii$Proxy, LambdaRestApi, RestApi, RestApiBase, SpecRestApi, StepFunctionsRestApi

@Generated(value="jsii-pacmak/1.119.0 (build 1634eac)", date="2025-11-13T16:09:57.839Z") @Stability(Stable) public interface IRestApi extends software.amazon.jsii.JsiiSerializable, IResource, IRestApiRef
  • Method Details

    • getRestApiId

      @Stability(Stable) @NotNull String getRestApiId()
      The ID of this API Gateway RestApi.
    • getRestApiName

      @Stability(Stable) @NotNull String getRestApiName()
      The name of this API Gateway RestApi.
    • getRestApiRootResourceId

      @Stability(Stable) @NotNull String getRestApiRootResourceId()
      The resource ID of the root resource.
    • getRoot

      @Stability(Stable) @NotNull IResource getRoot()
      Represents the root resource ("/") of this API. Use it to define the API model:.

      api.root.addMethod('ANY', redirectToHomePage); // "ANY /" api.root.addResource('friends').addMethod('GET', getFriendsHandler); // "GET /friends"

    • getLatestDeployment

      @Stability(Stable) @Nullable default Deployment getLatestDeployment()
      API Gateway deployment that represents the latest changes of the API.

      This resource will be automatically updated every time the REST API model changes. undefined when no deployment is configured.

    • getDeploymentStage

      @Stability(Stable) @NotNull Stage getDeploymentStage()
      API Gateway stage that points to the latest deployment (if defined).
    • setDeploymentStage

      void setDeploymentStage(@NotNull Stage value)
      API Gateway stage that points to the latest deployment (if defined).
    • arnForExecuteApi

      @Stability(Stable) @NotNull String arnForExecuteApi(@Nullable String method, @Nullable String path, @Nullable String stage)
      Gets the "execute-api" ARN.

      Default: "*" returns the execute API ARN for all methods/resources in this API.

      Parameters:
      method - The method (default *).
      path - The resource path.
      stage - The stage (default *).
      Returns:
      The "execute-api" ARN.
    • arnForExecuteApi

      @Stability(Stable) @NotNull String arnForExecuteApi(@Nullable String method, @Nullable String path)
      Gets the "execute-api" ARN.

      Default: "*" returns the execute API ARN for all methods/resources in this API.

      Parameters:
      method - The method (default *).
      path - The resource path.
      Returns:
      The "execute-api" ARN.
    • arnForExecuteApi

      @Stability(Stable) @NotNull String arnForExecuteApi(@Nullable String method)
      Gets the "execute-api" ARN.

      Default: "*" returns the execute API ARN for all methods/resources in this API.

      Parameters:
      method - The method (default *).
      Returns:
      The "execute-api" ARN.
    • arnForExecuteApi

      @Stability(Stable) @NotNull String arnForExecuteApi()
      Gets the "execute-api" ARN.

      Default: "*" returns the execute API ARN for all methods/resources in this API.

      Returns:
      The "execute-api" ARN.
    • getNode

      @Stability(Stable) @NotNull software.constructs.Node getNode()
      The tree node.
      Specified by:
      getNode in interface software.constructs.IConstruct
    • getEnv

      @Stability(Stable) @NotNull ResourceEnvironment getEnv()
      The environment this resource belongs to.

      For resources that are created and managed in a Stack (those created by creating new class instances like new Role(), new Bucket(), etc.), this is always the same as the environment of the stack they belong to.

      For referenced resources (those obtained from referencing methods like Role.fromRoleArn(), Bucket.fromBucketName(), etc.), they might be different than the stack they were imported into.

      Specified by:
      getEnv in interface IEnvironmentAware