Skip to content

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.ListConstParametersProperty> 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.ListErrorCodeSamplesProperty> 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.ListRequestParametersProperty> 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.ListServiceParametersProperty> Property serviceParameters: The service parameters.
serviceParametersMap com.aliyun.ros.cdk.core.IResolvable OR java.util.ListServiceParametersMapProperty> 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.ListSystemParametersProperty> 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.

scopeRequired

  • Type: com.aliyun.ros.cdk.core.Construct

idRequired

  • Type: java.lang.String

enableResourcePropertyConstraintOptional

  • Type: java.lang.Boolean

apiNameRequired

  • 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.


groupIdRequired

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property groupId: The id of the Group.


requestConfigRequired

Property requestConfig: The configuration of the request.


resultSampleRequired

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property resultSample: The sample of the result.


resultTypeRequired

  • 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".


serviceConfigRequired

Property serviceConfig: The configuration of the service.


visibilityRequired

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property visibility: Whether to make the API public.

"PUBLIC" or "PRIVATE".


allowSignatureMethodOptional

  • 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


appCodeAuthTypeOptional

  • 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


authTypeOptional

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property authType: Type of authorization of the API .

"APP","ANONYMOUS", or "APPOPENID"


constParametersOptional

  • Type: com.aliyun.ros.cdk.core.IResolvable OR java.util.ListConstParametersProperty>

Property constParameters: The const parameters.


descriptionOptional

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property description: Description of the API, less than 180 characters.


disableInternetOptional

  • 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.


errorCodeSamplesOptional

  • Type: com.aliyun.ros.cdk.core.IResolvable OR java.util.ListErrorCodeSamplesProperty>

Property errorCodeSamples: The Error Code samples.


failResultSampleOptional

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property failResultSample: The sample of the fail result.


forceNonceCheckOptional

  • 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.


openIdConnectConfigOptional

Property openIdConnectConfig: The configuration of the open id.


requestParametersOptional

  • Type: com.aliyun.ros.cdk.core.IResolvable OR java.util.ListRequestParametersProperty>

Property requestParameters: The request parameters.


resultBodyModelOptional

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property resultBodyModel: The return result of the API.


resultDescriptionsOptional

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property resultDescriptions: The return description of the API.


serviceParametersOptional

  • Type: com.aliyun.ros.cdk.core.IResolvable OR java.util.ListServiceParametersProperty>

Property serviceParameters: The service parameters.


serviceParametersMapOptional

  • Type: com.aliyun.ros.cdk.core.IResolvable OR java.util.ListServiceParametersMapProperty>

Property serviceParametersMap: The mapping relation between (request parameters\const parameters\system parameters) and service parameters.


systemParametersOptional

  • Type: com.aliyun.ros.cdk.core.IResolvable OR java.util.ListSystemParametersProperty>

Property systemParameters: The system parameters.


tagsOptional

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.


webSocketApiTypeOptional

  • 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.

sessionRequired

  • Type: com.aliyun.ros.cdk.core.ISynthesisSession

The synthesis session.


addCondition

public void addCondition(RosCondition condition)

conditionRequired

  • Type: com.aliyun.ros.cdk.core.RosCondition

addCount

public void addCount(java.lang.Number OR IResolvable count)

countRequired

  • Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable

addDependency

public void addDependency(Resource resource)

resourceRequired

  • Type: com.aliyun.ros.cdk.core.Resource

addResourceDesc

public void addResourceDesc(java.lang.String desc)

descRequired

  • Type: java.lang.String

applyRemovalPolicy

public void applyRemovalPolicy(RemovalPolicy policy)

policyRequired

  • Type: com.aliyun.ros.cdk.core.RemovalPolicy

getAtt

public IResolvable getAtt(java.lang.String name)

nameRequired

  • Type: java.lang.String

setMetadata

public void setMetadata(java.lang.String key, java.lang.Object value)

keyRequired

  • Type: java.lang.String

valueRequired

  • 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.

xRequired

  • 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.

nodeRequired

public ConstructNode getNode();
  • Type: com.aliyun.ros.cdk.core.ConstructNode

The construct tree node associated with this construct.


refRequired

public java.lang.String getRef();
  • Type: java.lang.String

stackRequired

public Stack getStack();
  • Type: com.aliyun.ros.cdk.core.Stack

The stack in which this resource is defined.


resourceOptional

public RosResource getResource();
  • Type: com.aliyun.ros.cdk.core.RosResource

attrApiIdRequired

public IResolvable getAttrApiId();
  • Type: com.aliyun.ros.cdk.core.IResolvable

Attribute ApiId: The id of the API.