Api
This class encapsulates and extends the ROS resource type ALIYUN::ApiGateway::Api
, which is used to create an API.
Initializers
import com.aliyun.ros.cdk.apigateway.Api;
Api.Builder.create(Construct scope, java.lang.String id, java.lang.Boolean enableResourcePropertyConstraint)
.apiName(java.lang.String)
.apiName(IResolvable)
.groupId(java.lang.String)
.groupId(IResolvable)
.requestConfig(IResolvable)
.requestConfig(RequestConfigProperty)
.resultSample(java.lang.String)
.resultSample(IResolvable)
.resultType(java.lang.String)
.resultType(IResolvable)
.serviceConfig(IResolvable)
.serviceConfig(ServiceConfigProperty)
.visibility(java.lang.String)
.visibility(IResolvable)
// .allowSignatureMethod(java.lang.String)
// .allowSignatureMethod(IResolvable)
// .appCodeAuthType(java.lang.String)
// .appCodeAuthType(IResolvable)
// .authType(java.lang.String)
// .authType(IResolvable)
// .constParameters(IResolvable)
// .constParameters(java.util.List<IResolvable)
// .constParameters(ConstParametersProperty>)
// .description(java.lang.String)
// .description(IResolvable)
// .disableInternet(java.lang.Boolean)
// .disableInternet(IResolvable)
// .errorCodeSamples(IResolvable)
// .errorCodeSamples(java.util.List<IResolvable)
// .errorCodeSamples(ErrorCodeSamplesProperty>)
// .failResultSample(java.lang.String)
// .failResultSample(IResolvable)
// .forceNonceCheck(java.lang.Boolean)
// .forceNonceCheck(IResolvable)
// .openIdConnectConfig(IResolvable)
// .openIdConnectConfig(OpenIdConnectConfigProperty)
// .requestParameters(IResolvable)
// .requestParameters(java.util.List<IResolvable)
// .requestParameters(RequestParametersProperty>)
// .resultBodyModel(java.lang.String)
// .resultBodyModel(IResolvable)
// .resultDescriptions(java.lang.String)
// .resultDescriptions(IResolvable)
// .serviceParameters(IResolvable)
// .serviceParameters(java.util.List<IResolvable)
// .serviceParameters(ServiceParametersProperty>)
// .serviceParametersMap(IResolvable)
// .serviceParametersMap(java.util.List<IResolvable)
// .serviceParametersMap(ServiceParametersMapProperty>)
// .systemParameters(IResolvable)
// .systemParameters(java.util.List<IResolvable)
// .systemParameters(SystemParametersProperty>)
// .tags(java.util.List<TagsProperty>)
// .webSocketApiType(java.lang.String)
// .webSocketApiType(IResolvable)
.build();
Name | Type | Description |
---|---|---|
scope |
com.aliyun.ros.cdk.core.Construct |
No description. |
id |
java.lang.String |
No description. |
enableResourcePropertyConstraint |
java.lang.Boolean |
No description. |
apiName |
java.lang.String OR com.aliyun.ros.cdk.core.IResolvable |
Property apiName: The name of the API.Need [4, 50] Chinese\English\Number characters or "_",and should start with Chinese\/English character. |
groupId |
java.lang.String OR com.aliyun.ros.cdk.core.IResolvable |
Property groupId: The id of the Group. |
requestConfig |
com.aliyun.ros.cdk.core.IResolvable OR RequestConfigProperty |
Property requestConfig: The configuration of the request. |
resultSample |
java.lang.String OR com.aliyun.ros.cdk.core.IResolvable |
Property resultSample: The sample of the result. |
resultType |
java.lang.String OR com.aliyun.ros.cdk.core.IResolvable |
Property resultType: The format of service's response, "JSON", "TEXT", "BINARY", "XML", "HTML" or "PASSTHROUGH". |
serviceConfig |
com.aliyun.ros.cdk.core.IResolvable OR ServiceConfigProperty |
Property serviceConfig: The configuration of the service. |
visibility |
java.lang.String OR com.aliyun.ros.cdk.core.IResolvable |
Property visibility: Whether to make the API public. |
allowSignatureMethod |
java.lang.String OR com.aliyun.ros.cdk.core.IResolvable |
Property allowSignatureMethod: If the AuthType is APP authentication, you need to pass this value to specify the signature algorithm. |
appCodeAuthType |
java.lang.String OR com.aliyun.ros.cdk.core.IResolvable |
Property appCodeAuthType: When AuthType is APP authentication, the optional values are as follows: If not passed, the default value is DEFAULT: DEFAULT: Default (set by group). |
authType |
java.lang.String OR com.aliyun.ros.cdk.core.IResolvable |
Property authType: Type of authorization of the API . |
constParameters |
com.aliyun.ros.cdk.core.IResolvable OR java.util.List |
Property constParameters: The const parameters. |
description |
java.lang.String OR com.aliyun.ros.cdk.core.IResolvable |
Property description: Description of the API, less than 180 characters. |
disableInternet |
java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable |
Property disableInternet: Set DisableInternet to true, only support intranet to call API. |
errorCodeSamples |
com.aliyun.ros.cdk.core.IResolvable OR java.util.List |
Property errorCodeSamples: The Error Code samples. |
failResultSample |
java.lang.String OR com.aliyun.ros.cdk.core.IResolvable |
Property failResultSample: The sample of the fail result. |
forceNonceCheck |
java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable |
Property forceNonceCheck: Set ForceNonceCheck to true, compulsorily check X-Ca-Nonce when requesting, this is the unique identifier of the request, generally using UUID to identify. |
openIdConnectConfig |
com.aliyun.ros.cdk.core.IResolvable OR OpenIdConnectConfigProperty |
Property openIdConnectConfig: The configuration of the open id. |
requestParameters |
com.aliyun.ros.cdk.core.IResolvable OR java.util.List |
Property requestParameters: The request parameters. |
resultBodyModel |
java.lang.String OR com.aliyun.ros.cdk.core.IResolvable |
Property resultBodyModel: The return result of the API. |
resultDescriptions |
java.lang.String OR com.aliyun.ros.cdk.core.IResolvable |
Property resultDescriptions: The return description of the API. |
serviceParameters |
com.aliyun.ros.cdk.core.IResolvable OR java.util.List |
Property serviceParameters: The service parameters. |
serviceParametersMap |
com.aliyun.ros.cdk.core.IResolvable OR java.util.List |
Property serviceParametersMap: The mapping relation between (request parameters\const parameters\system parameters) and service parameters. |
systemParameters |
com.aliyun.ros.cdk.core.IResolvable OR java.util.List |
Property systemParameters: The system parameters. |
tags |
java.util.List<TagsProperty> |
Property tags: Tags to attach to instance. |
webSocketApiType |
java.lang.String OR com.aliyun.ros.cdk.core.IResolvable |
Property webSocketApiType: The type of the two-way communication API. |
scope
Required
- Type: com.aliyun.ros.cdk.core.Construct
id
Required
- Type: java.lang.String
enableResourcePropertyConstraint
Optional
- Type: java.lang.Boolean
apiName
Required
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property apiName: The name of the API.Need [4, 50] Chinese\English\Number characters or "_",and should start with Chinese\/English character.
groupId
Required
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property groupId: The id of the Group.
requestConfig
Required
- Type: com.aliyun.ros.cdk.core.IResolvable OR RequestConfigProperty
Property requestConfig: The configuration of the request.
resultSample
Required
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property resultSample: The sample of the result.
resultType
Required
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property resultType: The format of service's response, "JSON", "TEXT", "BINARY", "XML", "HTML" or "PASSTHROUGH".
Default is "JSON".
serviceConfig
Required
- Type: com.aliyun.ros.cdk.core.IResolvable OR ServiceConfigProperty
Property serviceConfig: The configuration of the service.
visibility
Required
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property visibility: Whether to make the API public.
"PUBLIC" or "PRIVATE".
allowSignatureMethod
Optional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property allowSignatureMethod: If the AuthType is APP authentication, you need to pass this value to specify the signature algorithm.
If you do not specify this parameter, the default value HmacSHA256 is used. Valid values: HmacSHA256 HmacSHA1,HmacSHA256
appCodeAuthType
Optional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property appCodeAuthType: When AuthType is APP authentication, the optional values are as follows: If not passed, the default value is DEFAULT: DEFAULT: Default (set by group).
DISABLE: Not allowed HEADER: Allow AppCode header authentication HEADER_QUERY: Allow AppCode header and query authentication
authType
Optional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property authType: Type of authorization of the API .
"APP","ANONYMOUS", or "APPOPENID"
constParameters
Optional
- Type: com.aliyun.ros.cdk.core.IResolvable OR java.util.List
ConstParametersProperty>
Property constParameters: The const parameters.
description
Optional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property description: Description of the API, less than 180 characters.
disableInternet
Optional
- Type: java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable
Property disableInternet: Set DisableInternet to true, only support intranet to call API.
Set DisableInternet to false, then the call is not restricted.
errorCodeSamples
Optional
- Type: com.aliyun.ros.cdk.core.IResolvable OR java.util.List
ErrorCodeSamplesProperty>
Property errorCodeSamples: The Error Code samples.
failResultSample
Optional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property failResultSample: The sample of the fail result.
forceNonceCheck
Optional
- Type: java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable
Property forceNonceCheck: Set ForceNonceCheck to true, compulsorily check X-Ca-Nonce when requesting, this is the unique identifier of the request, generally using UUID to identify.
The API gateway will verify the validity of this parameter after receiving this parameter. The same value can only be used once within 15 minutes. It can effectively prevent API replay attacks. Set ForceNonceCheck to false, then no check.
openIdConnectConfig
Optional
- Type: com.aliyun.ros.cdk.core.IResolvable OR OpenIdConnectConfigProperty
Property openIdConnectConfig: The configuration of the open id.
requestParameters
Optional
- Type: com.aliyun.ros.cdk.core.IResolvable OR java.util.List
RequestParametersProperty>
Property requestParameters: The request parameters.
resultBodyModel
Optional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property resultBodyModel: The return result of the API.
resultDescriptions
Optional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property resultDescriptions: The return description of the API.
serviceParameters
Optional
- Type: com.aliyun.ros.cdk.core.IResolvable OR java.util.List
ServiceParametersProperty>
Property serviceParameters: The service parameters.
serviceParametersMap
Optional
- Type: com.aliyun.ros.cdk.core.IResolvable OR java.util.List
ServiceParametersMapProperty>
Property serviceParametersMap: The mapping relation between (request parameters\const parameters\system parameters) and service parameters.
systemParameters
Optional
- Type: com.aliyun.ros.cdk.core.IResolvable OR java.util.List
SystemParametersProperty>
Property systemParameters: The system parameters.
tags
Optional
- Type: java.util.List<TagsProperty>
Property tags: Tags to attach to instance.
Max support 20 tags to add during create instance. Each tag with two properties Key and Value, and Key is required.
webSocketApiType
Optional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property webSocketApiType: The type of the two-way communication API.
COMMON: common API REGISTER: registered API UNREGISTER: unregistered API NOTIFY: downstream notification API
Methods
Name | Description |
---|---|
toString |
Returns a string representation of this construct. |
synthesize |
Allows this construct to emit artifacts into the cloud assembly during synthesis. |
addCondition |
No description. |
addCount |
No description. |
addDependency |
No description. |
addResourceDesc |
No description. |
applyRemovalPolicy |
No description. |
getAtt |
No description. |
setMetadata |
No description. |
toString
public java.lang.String toString()
Returns a string representation of this construct.
synthesize
public void synthesize(ISynthesisSession session)
Allows this construct to emit artifacts into the cloud assembly during synthesis.
This method is usually implemented by framework-level constructs such as Stack
and Asset
as they participate in synthesizing the cloud assembly.
- Type: com.aliyun.ros.cdk.core.ISynthesisSession
The synthesis session.
addCondition
public void addCondition(RosCondition condition)
- Type: com.aliyun.ros.cdk.core.RosCondition
addCount
public void addCount(java.lang.Number OR IResolvable count)
- Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable
addDependency
public void addDependency(Resource resource)
- Type: com.aliyun.ros.cdk.core.Resource
addResourceDesc
public void addResourceDesc(java.lang.String desc)
- Type: java.lang.String
applyRemovalPolicy
public void applyRemovalPolicy(RemovalPolicy policy)
- Type: com.aliyun.ros.cdk.core.RemovalPolicy
getAtt
public IResolvable getAtt(java.lang.String name)
- Type: java.lang.String
setMetadata
public void setMetadata(java.lang.String key, java.lang.Object value)
- Type: java.lang.String
- Type: java.lang.Object
Static Functions
Name | Description |
---|---|
isConstruct |
Return whether the given object is a Construct. |
isConstruct
import com.aliyun.ros.cdk.apigateway.Api;
Api.isConstruct(java.lang.Object x)
Return whether the given object is a Construct.
- Type: java.lang.Object
Properties
Name | Type | Description |
---|---|---|
node |
com.aliyun.ros.cdk.core.ConstructNode |
The construct tree node associated with this construct. |
ref |
java.lang.String |
No description. |
stack |
com.aliyun.ros.cdk.core.Stack |
The stack in which this resource is defined. |
resource |
com.aliyun.ros.cdk.core.RosResource |
No description. |
attrApiId |
com.aliyun.ros.cdk.core.IResolvable |
Attribute ApiId: The id of the API. |
node
Required
public ConstructNode getNode();
- Type: com.aliyun.ros.cdk.core.ConstructNode
The construct tree node associated with this construct.
ref
Required
public java.lang.String getRef();
- Type: java.lang.String
stack
Required
public Stack getStack();
- Type: com.aliyun.ros.cdk.core.Stack
The stack in which this resource is defined.
resource
Optional
public RosResource getResource();
- Type: com.aliyun.ros.cdk.core.RosResource
attrApiId
Required
public IResolvable getAttrApiId();
- Type: com.aliyun.ros.cdk.core.IResolvable
Attribute ApiId: The id of the API.