Interface IResource
- All Superinterfaces:
software.constructs.IConstruct
,software.constructs.IDependable
,IResource
,software.amazon.jsii.JsiiSerializable
- All Known Subinterfaces:
IResource.Jsii$Default
- All Known Implementing Classes:
IResource.Jsii$Proxy
,ProxyResource
,Resource
,ResourceBase
@Generated(value="jsii-pacmak/1.103.1 (build bef2dea)",
date="2024-10-05T03:43:37.927Z")
@Stability(Stable)
public interface IResource
extends software.amazon.jsii.JsiiSerializable, IResource
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Internal default implementation forIResource
.static final class
A proxy class which represents a concrete javascript instance of this type. -
Method Summary
Modifier and TypeMethodDescriptionaddCorsPreflight
(CorsOptions options) Adds an OPTIONS method to this resource which responds to Cross-Origin Resource Sharing (CORS) preflight requests.Defines a new method for this resource.addMethod
(String httpMethod, Integration target) Defines a new method for this resource.addMethod
(String httpMethod, Integration target, MethodOptions options) Defines a new method for this resource.addProxy()
Adds a greedy proxy resource ("{proxy+}") and an ANY method to this route.addProxy
(ProxyResourceOptions options) Adds a greedy proxy resource ("{proxy+}") and an ANY method to this route.addResource
(String pathPart) Defines a new child resource where this resource is the parent.addResource
(String pathPart, ResourceOptions options) Defines a new child resource where this resource is the parent.getApi()
The rest API that this resource is part of.default CorsOptions
Default options for CORS preflight OPTIONS method.default Integration
An integration to use as a default for all methods created within this API unless an integration is specified.default MethodOptions
Method options to use as a default for all methods created within this API unless custom options are specified.default IResource
The parent of this resource or undefined for the root resource.getPath()
The full path of this resource.getResource
(String pathPart) Retrieves a child resource by path part.The ID of the resource.resourceForPath
(String path) Gets or create all resources leading up to the specified path.Methods inherited from interface software.constructs.IConstruct
getNode
Methods inherited from interface software.amazon.awscdk.IResource
applyRemovalPolicy, getEnv, getStack
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getApi
The rest API that this resource is part of.The reason we need the RestApi object itself and not just the ID is because the model is being tracked by the top-level RestApi object for the purpose of calculating it's hash to determine the ID of the deployment. This allows us to automatically update the deployment when the model of the REST API changes.
-
getPath
The full path of this resource. -
getResourceId
The ID of the resource. -
getDefaultCorsPreflightOptions
Default options for CORS preflight OPTIONS method. -
getDefaultIntegration
An integration to use as a default for all methods created within this API unless an integration is specified. -
getDefaultMethodOptions
Method options to use as a default for all methods created within this API unless custom options are specified. -
getParentResource
The parent of this resource or undefined for the root resource. -
addCorsPreflight
Adds an OPTIONS method to this resource which responds to Cross-Origin Resource Sharing (CORS) preflight requests.Cross-Origin Resource Sharing (CORS) is a mechanism that uses additional HTTP headers to tell browsers to give a web application running at one origin, access to selected resources from a different origin. A web application executes a cross-origin HTTP request when it requests a resource that has a different origin (domain, protocol, or port) from its own.
- Parameters:
options
- CORS options. This parameter is required.- Returns:
- a
Method
object - See Also:
-
addMethod
@Stability(Stable) @NotNull Method addMethod(@NotNull String httpMethod, @Nullable Integration target, @Nullable MethodOptions options) Defines a new method for this resource.- Parameters:
httpMethod
- The HTTP method. This parameter is required.target
- The target backend integration for this method.options
- Method options, such as authentication.- Returns:
- The newly created
Method
object.
-
addMethod
@Stability(Stable) @NotNull Method addMethod(@NotNull String httpMethod, @Nullable Integration target) Defines a new method for this resource.- Parameters:
httpMethod
- The HTTP method. This parameter is required.target
- The target backend integration for this method.- Returns:
- The newly created
Method
object.
-
addMethod
Defines a new method for this resource.- Parameters:
httpMethod
- The HTTP method. This parameter is required.- Returns:
- The newly created
Method
object.
-
addProxy
Adds a greedy proxy resource ("{proxy+}") and an ANY method to this route.- Parameters:
options
- Default integration and method options.
-
addProxy
Adds a greedy proxy resource ("{proxy+}") and an ANY method to this route. -
addResource
@Stability(Stable) @NotNull Resource addResource(@NotNull String pathPart, @Nullable ResourceOptions options) Defines a new child resource where this resource is the parent.- Parameters:
pathPart
- The path part for the child resource. This parameter is required.options
- Resource options.- Returns:
- A Resource object
-
addResource
Defines a new child resource where this resource is the parent.- Parameters:
pathPart
- The path part for the child resource. This parameter is required.- Returns:
- A Resource object
-
getResource
Retrieves a child resource by path part.- Parameters:
pathPart
- The path part of the child resource. This parameter is required.- Returns:
- the child resource or undefined if not found
-
resourceForPath
Gets or create all resources leading up to the specified path.- Path may only start with "/" if this method is called on the root resource.
- All resources are created using default options.
- Parameters:
path
- The relative path. This parameter is required.- Returns:
- a new or existing resource.
-