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 ros_cdk_apigateway
ros_cdk_apigateway.Api(
  scope: Construct,
  id: str,
  api_name: typing.Union[str, IResolvable],
  group_id: typing.Union[str, IResolvable],
  request_config: typing.Union[IResolvable, RequestConfigProperty],
  result_sample: typing.Union[str, IResolvable],
  result_type: typing.Union[str, IResolvable],
  service_config: typing.Union[IResolvable, ServiceConfigProperty],
  visibility: typing.Union[str, IResolvable],
  allow_signature_method: typing.Union[str, IResolvable] = None,
  app_code_auth_type: typing.Union[str, IResolvable] = None,
  auth_type: typing.Union[str, IResolvable] = None,
  const_parameters: typing.Union[IResolvable, typing.List[typing.Union[IResolvable, ConstParametersProperty]]] = None,
  description: typing.Union[str, IResolvable] = None,
  disable_internet: typing.Union[bool, IResolvable] = None,
  error_code_samples: typing.Union[IResolvable, typing.List[typing.Union[IResolvable, ErrorCodeSamplesProperty]]] = None,
  fail_result_sample: typing.Union[str, IResolvable] = None,
  force_nonce_check: typing.Union[bool, IResolvable] = None,
  open_id_connect_config: typing.Union[IResolvable, OpenIdConnectConfigProperty] = None,
  request_parameters: typing.Union[IResolvable, typing.List[typing.Union[IResolvable, RequestParametersProperty]]] = None,
  result_body_model: typing.Union[str, IResolvable] = None,
  result_descriptions: typing.Union[str, IResolvable] = None,
  service_parameters: typing.Union[IResolvable, typing.List[typing.Union[IResolvable, ServiceParametersProperty]]] = None,
  service_parameters_map: typing.Union[IResolvable, typing.List[typing.Union[IResolvable, ServiceParametersMapProperty]]] = None,
  system_parameters: typing.Union[IResolvable, typing.List[typing.Union[IResolvable, SystemParametersProperty]]] = None,
  tags: typing.List[TagsProperty] = None,
  web_socket_api_type: typing.Union[str, IResolvable] = None,
  enable_resource_property_constraint: bool = None
)
Name Type Description
scope ros_cdk_core.Construct No description.
id str No description.
api_name typing.Union[str, 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.
group_id typing.Union[str, ros_cdk_core.IResolvable] Property groupId: The id of the Group.
request_config typing.Union[ros_cdk_core.IResolvable, RequestConfigProperty] Property requestConfig: The configuration of the request.
result_sample typing.Union[str, ros_cdk_core.IResolvable] Property resultSample: The sample of the result.
result_type typing.Union[str, ros_cdk_core.IResolvable] Property resultType: The format of service's response, "JSON", "TEXT", "BINARY", "XML", "HTML" or "PASSTHROUGH".
service_config typing.Union[ros_cdk_core.IResolvable, ServiceConfigProperty] Property serviceConfig: The configuration of the service.
visibility typing.Union[str, ros_cdk_core.IResolvable] Property visibility: Whether to make the API public.
allow_signature_method typing.Union[str, ros_cdk_core.IResolvable] Property allowSignatureMethod: If the AuthType is APP authentication, you need to pass this value to specify the signature algorithm.
app_code_auth_type typing.Union[str, 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).
auth_type typing.Union[str, ros_cdk_core.IResolvable] Property authType: Type of authorization of the API .
const_parameters typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[ros_cdk_core.IResolvable, ConstParametersProperty]]] Property constParameters: The const parameters.
description typing.Union[str, ros_cdk_core.IResolvable] Property description: Description of the API, less than 180 characters.
disable_internet typing.Union[bool, ros_cdk_core.IResolvable] Property disableInternet: Set DisableInternet to true, only support intranet to call API.
error_code_samples typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[ros_cdk_core.IResolvable, ErrorCodeSamplesProperty]]] Property errorCodeSamples: The Error Code samples.
fail_result_sample typing.Union[str, ros_cdk_core.IResolvable] Property failResultSample: The sample of the fail result.
force_nonce_check typing.Union[bool, 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.
open_id_connect_config typing.Union[ros_cdk_core.IResolvable, OpenIdConnectConfigProperty] Property openIdConnectConfig: The configuration of the open id.
request_parameters typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[ros_cdk_core.IResolvable, RequestParametersProperty]]] Property requestParameters: The request parameters.
result_body_model typing.Union[str, ros_cdk_core.IResolvable] Property resultBodyModel: The return result of the API.
result_descriptions typing.Union[str, ros_cdk_core.IResolvable] Property resultDescriptions: The return description of the API.
service_parameters typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[ros_cdk_core.IResolvable, ServiceParametersProperty]]] Property serviceParameters: The service parameters.
service_parameters_map typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[ros_cdk_core.IResolvable, ServiceParametersMapProperty]]] Property serviceParametersMap: The mapping relation between (request parameters\const parameters\system parameters) and service parameters.
system_parameters typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[ros_cdk_core.IResolvable, SystemParametersProperty]]] Property systemParameters: The system parameters.
tags typing.List[TagsProperty] Property tags: Tags to attach to instance.
web_socket_api_type typing.Union[str, ros_cdk_core.IResolvable] Property webSocketApiType: The type of the two-way communication API.
enable_resource_property_constraint bool No description.

scopeRequired

  • Type: ros_cdk_core.Construct

idRequired

  • Type: str

api_nameRequired

  • Type: typing.Union[str, 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.


group_idRequired

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property groupId: The id of the Group.


request_configRequired

Property requestConfig: The configuration of the request.


result_sampleRequired

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property resultSample: The sample of the result.


result_typeRequired

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property resultType: The format of service's response, "JSON", "TEXT", "BINARY", "XML", "HTML" or "PASSTHROUGH".

Default is "JSON".


service_configRequired

Property serviceConfig: The configuration of the service.


visibilityRequired

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property visibility: Whether to make the API public.

"PUBLIC" or "PRIVATE".


allow_signature_methodOptional

  • Type: typing.Union[str, 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


app_code_auth_typeOptional

  • Type: typing.Union[str, 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


auth_typeOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property authType: Type of authorization of the API .

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


const_parametersOptional

  • Type: typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[ros_cdk_core.IResolvable, ConstParametersProperty]]]

Property constParameters: The const parameters.


descriptionOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

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


disable_internetOptional

  • Type: typing.Union[bool, 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.


error_code_samplesOptional

  • Type: typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[ros_cdk_core.IResolvable, ErrorCodeSamplesProperty]]]

Property errorCodeSamples: The Error Code samples.


fail_result_sampleOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property failResultSample: The sample of the fail result.


force_nonce_checkOptional

  • Type: typing.Union[bool, 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.


open_id_connect_configOptional

Property openIdConnectConfig: The configuration of the open id.


request_parametersOptional

  • Type: typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[ros_cdk_core.IResolvable, RequestParametersProperty]]]

Property requestParameters: The request parameters.


result_body_modelOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property resultBodyModel: The return result of the API.


result_descriptionsOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property resultDescriptions: The return description of the API.


service_parametersOptional

  • Type: typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[ros_cdk_core.IResolvable, ServiceParametersProperty]]]

Property serviceParameters: The service parameters.


service_parameters_mapOptional

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


system_parametersOptional

  • Type: typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[ros_cdk_core.IResolvable, SystemParametersProperty]]]

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.


web_socket_api_typeOptional

  • Type: typing.Union[str, 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


enable_resource_property_constraintOptional

  • Type: bool

Methods

Name Description
to_string Returns a string representation of this construct.
synthesize Allows this construct to emit artifacts into the cloud assembly during synthesis.
add_condition No description.
add_count No description.
add_dependency No description.
add_resource_desc No description.
apply_removal_policy No description.
get_att No description.
set_metadata No description.

to_string

def to_string() -> str

Returns a string representation of this construct.

synthesize

def synthesize(
  session: ISynthesisSession
) -> None

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: ros_cdk_core.ISynthesisSession

The synthesis session.


add_condition

def add_condition(
  condition: RosCondition
) -> None

conditionRequired

  • Type: ros_cdk_core.RosCondition

add_count

def add_count(
  count: typing.Union[typing.Union[int, float], IResolvable]
) -> None

countRequired

  • Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]

add_dependency

def add_dependency(
  resource: Resource
) -> None

resourceRequired

  • Type: ros_cdk_core.Resource

add_resource_desc

def add_resource_desc(
  desc: str
) -> None

descRequired

  • Type: str

apply_removal_policy

def apply_removal_policy(
  policy: RemovalPolicy
) -> None

policyRequired

  • Type: ros_cdk_core.RemovalPolicy

get_att

def get_att(
  name: str
) -> IResolvable

nameRequired

  • Type: str

set_metadata

def set_metadata(
  key: str,
  value: typing.Any
) -> None

keyRequired

  • Type: str

valueRequired

  • Type: typing.Any

Static Functions

Name Description
is_construct Return whether the given object is a Construct.

is_construct

import ros_cdk_apigateway
ros_cdk_apigateway.Api.is_construct(
  x: typing.Any
)

Return whether the given object is a Construct.

xRequired

  • Type: typing.Any

Properties

Name Type Description
node ros_cdk_core.ConstructNode The construct tree node associated with this construct.
ref str No description.
stack ros_cdk_core.Stack The stack in which this resource is defined.
resource ros_cdk_core.RosResource No description.
attr_api_id ros_cdk_core.IResolvable Attribute ApiId: The id of the API.

nodeRequired

node: ConstructNode
  • Type: ros_cdk_core.ConstructNode

The construct tree node associated with this construct.


refRequired

ref: str
  • Type: str

stackRequired

stack: Stack
  • Type: ros_cdk_core.Stack

The stack in which this resource is defined.


resourceOptional

resource: RosResource
  • Type: ros_cdk_core.RosResource

attr_api_idRequired

attr_api_id: IResolvable
  • Type: ros_cdk_core.IResolvable

Attribute ApiId: The id of the API.