Esta página ainda não está disponível no idioma selecionado. Estamos trabalhando para adicionar mais opções de idiomas. Agradecemos sua compreensão.

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
On this page

Configuring API Cascading

Updated on 2024-06-25 GMT+08:00

API cascading allows you to cascade two ROMA Connect instances in one or more regions. This lets one instance use an API of the other instance as its backend service for cross-instance API calling. A dedicated authentication channel will be used for API cascading to prevent authentication conflict.

  • Cascading instance: uses an API of the other instance as its backend service.
  • Cascaded instance: provides its API to the other instance as a backend service.

API cascading enables you to provide APIs in one instance for another instance to improve the reuse capability of API assets, without having to deploy backend services in different instances repeatedly.

Prerequisites

  • The two instances can communicate with each other.
  • If the two instances are located in different networks and communicate with each other through an air wall, their IP address and port number must be configured on the air wall. In addition, the air wall must use the TCP protocol for secure access. A dedicated VPN or tunnel can also be used for cross-network interworking.

Procedure

  1. Enable cascading for the cascaded instance.
    1. Log in to the ROMA Connect console that displays the cascaded instance. On the Instances page, click View Console.
    2. Choose Instance Information > Configuration Parameters, and locate the cascade parameter.
    3. Click Edit on the right of the parameter, set Current Value to on, and click Save.
    4. Click on the left of the parameter and configure the following parameters.
      Table 1 Parameters related to the cascading function

      Parameter

      Description

      cascade_auth_key

      Encryption key used for authentication between two APIs.

      This must be the same for the cascaded and cascading instance pair.

      cascade_instance_ids

      IDs of the instances that are allowed to cascade the current instance. Use commas (,) to separate multiple (max. 5) instance IDs.

  2. Enable cascading for the cascading instance.
    1. Log in to the ROMA Connect console that displays the cascading instance. On the Instances page, click View Console.
    2. Choose Instance Information > Configuration Parameters, and locate the cascade function.
    3. Click Edit on the right, set Current Value to on, and click Save.
    4. Click on the left and configure the following parameters.
      Table 2 Parameters related to the cascading function

      Parameter

      Description

      cascade_auth_key

      Encryption key used for authentication between two APIs.

      This must be the same for the cascaded and cascading instance pair.

      cascade_instance_ids

      This parameter is not required for cascading instances.

  3. Create a load balance channel from the cascading instance to the cascaded instance.
    1. In the navigation pane of the cascading instance console, choose API Connect > API Policies. On the Load Balance Channels tab, click Create Load Balance Channel.
    2. On the page displayed, configure load balance channel information.
      Table 3 Basic information

      Parameter

      Description

      Name

      Enter a load balance channel name.

      Using naming rules facilitates future search.

      Port

      Enter the access port number of the ECS in the load balance channel.

      The port number is the protocol used by the API in the cascaded instance.

      80: HTTP

      443: HTTPS

      Routing Algorithm

      Select an algorithm for routing backend service requests. The load balance channel determines which server the algorithm will send the requests to.

      • WRR: Requests are forwarded to each cloud server in order of server weight.
      • WLC: Requests are forwarded to the cloud server with the fewest live connections in order of server weight.
      • SH: Requests are forwarded to the cloud server by source IP address. Requests with the same source IP address are forwarded to the same server unless the server is unavailable.
      • URI hashing: Requests are forwarded to the cloud server by request path. Requests from the same path are forwarded to the same server unless the server is unavailable.
    3. Configure servers. To access APIs of the cascaded instance, select Specify IP addresses.
    4. Click Create Server Group. In the dialog box displayed, configure group information and click OK.

      Servers can be added to different groups.

      Table 4 Server group configuration

      Parameter

      Description

      Group Name

      Enter a server group name. Using naming rules facilitates future search.

      Weight

      Enter the weight of the server group. The larger the weight, the more requests can be forwarded to the servers in the group.

      Description

      Enter a brief description of the server group.

    5. Click Add Backend Server Addresses and configure backend servers.
      Table 5 Backend server information

      Parameter

      Description

      Backend Server Address

      Enter the API access address of the cascaded instance.

      • IP address format:
        • Set this parameter to the EIP of the cascaded instance if the two instances communicate with each other over a public network.
        • Set this parameter to the APIC connection address of the cascaded instance if the two instances communicate with each other over a VPC intranet.
      • Domain name format: Enter the access domain name of the API.

      Standby Node

      Enabled: The backend server serves as a standby node. It works only when all non-standby nodes are faulty.

      Port

      Enter the access port number of the backend server.

      0: uses the load balance channel port.

      Server Status

      Specify whether to enable the server. Requests are distributed to the server only after it is enabled.

    6. Configure the health check.

      The health check function is enabled by default. If you do not need the health check, disable this function.

      Table 6 Health check parameters

      Parameter

      Description

      Protocol

      Select the protocol used for the health check.

      Options: TCP, HTTP, HTTPS

      Two-way Authentication

      Available for Protocol set to HTTPS.

      Specify whether to enable two-way authentication between ROMA Connect and backend servers.

      Path

      Mandatory for Protocol set to HTTP or HTTPS.

      Enter the health check URL.

      Method

      Mandatory for Protocol set to HTTP or HTTPS.

      Select the HTTP request method used for the health check.

      Options: GET or HEAD

      Health Check Port

      Enter the destination port of the health check.

      Default: port number configured for the load balance channel

      Healthy Threshold

      Number of consecutive successful checks required for an ECS to be considered healthy.

      Example: If set to 2, ROMA Connect declares the ECS status to be healthy when the check is successful twice in a row.

      Unhealthy Threshold

      Number of consecutive failed checks required for an ECS to be considered unhealthy.

      Example: If set to 5, ROMA Connect declares the ECS status to be abnormal when the check fails five times in a row.

      Timeout (s)

      Response timeout of a health check, in seconds. If no response is received within this time, the health check fails.

      Interval (s)

      Interval between consecutive checks.

      Response Codes

      Mandatory for Protocol set to HTTP or HTTPS.

      When the server returns a specified HTTP response code, the server declares the response to be successful.

      Supports multiple response codes.

    7. Click Finish.
  4. On the cascading instance, create an API and set the backend address to the API in the cascaded instance.

    For details about how to create an API, see Creating an API. Only the configuration of defining the backend service is different between the cascading and the cascaded instances, as shown as follows.

    Table 7 Backend service access parameters

    Parameter

    Description

    Backend Type

    Select a backend service type. When the API of the cascaded instance is used as the backend service, select HTTP/HTTPS.

    Load Balance Channel

    Determine whether to use a load balance channel to access backend services. When the API of the cascaded instance is used as the backend service, select Configure.

    URL

    Configure the URL of the backend service.

    • Method: Select the request method of the backend service based on the API request method of the cascaded instance.
    • Protocol: Select the request protocol used by the backend service based on the API request protocol of the cascaded instance.
    • Load Balance Channel: Select the load balance channel created in 3.
    • Path: Enter the request path of the backend service, for example, /getUserInfo/{userId}. A URL can have multiple path parameters, each enclosed by braces.

      If the path needs to contain an environment variable, enclose the environment variable in number signs (#)

      Example: /#path#

      Environment variable names are case sensitive.

      Multiple environment variables can be added.

      Example: /#path##request#

    Cascading Flag

    Determine whether to use the cascading mode to access backend services. Enable this option.

    Host Header

    Define the Host header field carried in the backend service request. If you have specified Backend Server Address with an IP address when creating a load balance channel in 3, set Host Header to the domain name of the API of the cascaded instance.

    Timeout (ms)

    Enter the timeout interval of a backend service request.

    Default: 5000

    Retries

    Number of retries after ROMA Connect fails to call the backend service.

    • -1: The retry function is disabled. However, requests will be retried once by default except for those using POST and PATCH.
    • 0 to 10: This parameter is enabled and will make the configured number of retries. The number must be less than that of backend servers enabled in the load balance channel.

    Two-Way Authentication

    Available for Protocol set to HTTPS.

    Determine whether to enable two-way authentication between ROMA Connect and backend services. When the API of the cascaded instance is used as the backend service, do not enable two-way authentication.

    Backend Authentication

    Determine whether to enable backend authentication. When the API of the cascaded instance is used as the backend service, do not enable backend authentication.

Usamos cookies para aprimorar nosso site e sua experiência. Ao continuar a navegar em nosso site, você aceita nossa política de cookies. Saiba mais

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback