ApiGateway API
SaaSus Smart API Gateway API Schema (1.0.0)
SaaSus Smart API Gateway API Schema
Obtain configuration information for api gateway function
Obtain configuration information for api gateway function.
Authorizations:
Responses
Response samples
- 200
- 500
{- "generated_file_status": "finished",
- "internal_endpoint_openapi_definition_file_download_url": "https://presigned-url-test.s3.ap-northeast-1.amazonaws.com/test.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=xxxxxx%2F20230710%2Fap-northeast-1%2Fs3%2Faws4_request",
- "internal_endpoint_mapping_file_download_url": "https://presigned-url-test.s3.ap-northeast-1.amazonaws.com/test.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=xxxxxx%2F20230710%2Fap-northeast-1%2Fs3%2Faws4_request",
- "status": "published",
- "role_arn": "arn:aws:iam::123456789012:role/role-name",
- "role_external_id": 1234567890,
- "internal_endpoint_health_check_path": "/health",
- "internal_endpoint_health_check_port": 80,
- "internal_endpoint_health_check_protocol": "HTTP or HTTPS",
- "internal_endpoint_health_status_codes": 200,
- "saas_subnet_ids": [
- "subnet-1234567890abcdef0",
- "subnet-1234567890abcdef1"
], - "saas_vpc_id": "vpc-12345678",
- "domain_name": "dev.saasus.io",
- "is_dns_validated": false,
- "certificate_dns_record": {
- "type": "CNAME",
- "name": "_k90jaskdfawehro.domain-of-saasus-client.com.",
- "value": "_cmojwc239j102mosd9.acm-validations.aws."
}, - "cloud_front_dns_record": {
- "type": "CNAME",
- "name": "_k90jaskdfawehro.domain-of-saasus-client.com.",
- "value": "_cmojwc239j102mosd9.acm-validations.aws."
}, - "vpc_endpoint_dns_record": {
- "type": "CNAME",
- "name": "_k90jaskdfawehro.domain-of-saasus-client.com.",
- "value": "_cmojwc239j102mosd9.acm-validations.aws."
}, - "default_domain_name": "d78bh0l3saarv.cloudfront.net",
- "saas_alb_arn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188",
- "endpoint_settings_list": [
- {
- "path": "/users/get-by-id",
- "method": "GET",
- "throttling": {
- "target": "tenant",
- "range": 600,
- "limit": 100
}, - "role_names": [
- "admin"
]
}
], - "tenant_routing_type": "path"
}
Update configuration information for api gateway function
Update configuration information for api gateway function.
Authorizations:
Request Body schema: application/jsonrequired
role_arn | string (ARN of the role to be AssumeRole) ARN of the role for SaaSus Platform to AssumeRole |
role_external_id | string (External id to use when AssumeRole) External id used by SaaSus when AssumeRole to operate SaaS |
internal_endpoint_health_check_path | string (Internal endpoint health check path) The path to be used for health checks on the internal endpoint. |
internal_endpoint_health_check_port | integer (Internal endpoint health check port) The port to be used for health checks on the internal endpoint. |
internal_endpoint_health_check_protocol | string (Internal endpoint health check protocol) The protocol to be used for health checks on the internal endpoint. |
internal_endpoint_health_status_codes | string (Internal endpoint health check status codes) The status codes to be used for health checks on the internal endpoint. |
saas_subnet_ids | Array of strings (SaaS Subnet IDs) Subnet IDs for SaaS |
saas_vpc_id | string (SaaS VPC ID) VPC ID for SaaS |
domain_name | string Domain Name |
saas_alb_arn | string (SaaS Application Load Balancer ARN) SaaS Application Load Balancer ARN |
Array of objects (Endpoint Settings List) Endpoint Settings List | |
tenant_routing_type | string (Tenant Routing Type) Enum: "path" "hostName" "headerValue" "none" Tenant Routing Type |
Responses
Request samples
- Payload
{- "role_arn": "arn:aws:iam::123456789012:role/role-name",
- "role_external_id": 1234567890,
- "internal_endpoint_health_check_path": "/health",
- "internal_endpoint_health_check_port": 80,
- "internal_endpoint_health_check_protocol": "HTTP or HTTPS",
- "internal_endpoint_health_status_codes": 200,
- "saas_subnet_ids": [
- "subnet-1234567890abcdef0",
- "subnet-1234567890abcdef1"
], - "saas_vpc_id": "vpc-12345678",
- "domain_name": "dev.saasus.io",
- "saas_alb_arn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188",
- "endpoint_settings_list": [
- {
- "path": "/users/get-by-id",
- "method": "GET",
- "throttling": {
- "target": "tenant",
- "range": 600,
- "limit": 100
}, - "role_names": [
- "admin"
]
}
], - "tenant_routing_type": "path"
}
Response samples
- 500
{- "type": "permission_denied",
- "message": "Error message"
}
API key list or get API key by condition
The response content changes based on the combination of parameters tenant_id, env_id, and user_id.
- If tenant_id is not specified, the full list is returned.
- If only tenant_id is specified, the API keys within that tenant are returned.
- If tenant_id and env_id are specified, the keys are filtered by the environment.
- If tenant_id, env_id, and user_id are specified, a complete match returns the API keys for the target user.
- Additionally, searching is supported even when only env_id or only user_id are provided.
Authorizations:
query Parameters
tenant_id | string If specified, the API keys for the target tenant are returned. |
env_id | integer If specified, the API keys for the target environment are returned. |
user_id | string If specified, the API keys for the target user (up to 2) are returned. |
tenant_only | boolean If true, only API keys that do not have a User_id specified are returned. |
Responses
Response samples
- 200
- 500
{- "api_keys": [
- {
- "api_key": "ZDMiIHN0UmVmOmRvY3VtZW50SUQ9Inhtc",
- "tenant_id": "69e732d6-8ecc-45c4-c2eb-8438f7ffe775",
- "env_id": "1",
- "user_id": "f94bfffc-8be2-11ec-b41a-0242ac120004"
}, - {
- "api_key": "icFS9Hit7jZjeSKMbNZP2cmfqBseyxnJZ",
- "tenant_id": "69e732d6-8ecc-45c4-c2eb-8438f7ffe775",
- "env_id": "1",
- "user_id": "f94bfffc-8be2-11ec-b41a-0242ac120004"
}
]
}
Create an API key
Creates or updates an API key based on the contents of the request body. All parameters are in the request body:
- tenant_id, env_id (required)
- user_id (optional)
Authorizations:
Request Body schema: application/jsonrequired
Payload for API key creation or update.
tenant_id required | string (Uuid) |
env_id required | integer (Id) |
user_id | string (Uuid) |
Responses
Request samples
- Payload
{- "tenant_id": "69e732d6-8ecc-45c4-c2eb-8438f7ffe775",
- "env_id": 1,
- "user_id": "69e732d6-8ecc-45c4-c2eb-8438f7ffe775"
}
Response samples
- 201
- 500
{- "api_key": "1234567890abcdef",
- "tenant_id": "69e732d6-8ecc-45c4-c2eb-8438f7ffe775",
- "env_id": 1,
- "user_id": "69e732d6-8ecc-45c4-c2eb-8438f7ffe775"
}
get API key details by API key
Get the details of the API key by specifying the API key.
Authorizations:
path Parameters
api_key required | string Example: 1234567890abcdef API Key |
Responses
Response samples
- 200
- 500
{- "api_key": "1234567890abcdef",
- "tenant_id": "69e732d6-8ecc-45c4-c2eb-8438f7ffe775",
- "env_id": 1,
- "user_id": "69e732d6-8ecc-45c4-c2eb-8438f7ffe775"
}
Update allowed IP addresses for the tenant
Update allowed IP addresses for the tenant.
Authorizations:
path Parameters
tenant_id required | string (Uuid) Example: 69e732d6-8ecc-45c4-c2eb-8438f7ffe775 Tenant ID |
Request Body schema: application/jsonrequired
allowed_ips required | Array of strings (Allowed IP addresses) Allowed IP addresses in CIDR format |
Responses
Request samples
- Payload
{- "allowed_ips": [
- "192.168.0.0/24",
- "172.16.0.0/24"
]
}
Response samples
- 500
{- "type": "permission_denied",
- "message": "Error message"
}
Get allowed IP addresses for the tenant
Get allowed IP addresses for the tenant.
Authorizations:
path Parameters
tenant_id required | string (Uuid) Example: 69e732d6-8ecc-45c4-c2eb-8438f7ffe775 Tenant ID |
Responses
Response samples
- 200
- 500
{- "allowed_ips": [
- "192.168.0.0/24",
- "172.16.0.0/24"
]
}
Update tenant information
Update tenant information.
Authorizations:
path Parameters
tenant_id required | string (Uuid) Example: 69e732d6-8ecc-45c4-c2eb-8438f7ffe775 Tenant ID |
Request Body schema: application/jsonrequired
object (Tenant Routing) Information about tenant routing. Refer to the tenant_routing_type in ApiGatewaySettings and route the request. | |||||||||
|
Responses
Request samples
- Payload
{- "routing": {
- "path": "/4c4eefe8-35fd-4e51-8bd4-798e090e439d",
- "header_key": "x-tenant-id",
- "header_value": "4c4eefe8-35fd-4e51-8bd4-798e090e439d",
- "host_name": "tenantid.api.samplesaas.saasus.io"
}
}
Response samples
- 500
{- "type": "permission_denied",
- "message": "Error message"
}
Get tenant information
Get tenant information.
Authorizations:
path Parameters
tenant_id required | string (Uuid) Example: 69e732d6-8ecc-45c4-c2eb-8438f7ffe775 Tenant ID |
Responses
Response samples
- 200
- 500
{- "id": "69e732d6-8ecc-45c4-c2eb-8438f7ffe775",
- "routing": {
- "path": "/4c4eefe8-35fd-4e51-8bd4-798e090e439d",
- "header_key": "x-tenant-id",
- "header_value": "4c4eefe8-35fd-4e51-8bd4-798e090e439d",
- "host_name": "tenantid.api.samplesaas.saasus.io"
}
}
Upload files to create an API Gateway
Upload files to create an API Gateway
Authorizations:
Request Body schema: application/json
content required | string <base64> (Api Gateway Input File Content) The content of the file to be uploaded to create an API Gateway. |
Responses
Request samples
- Payload
{- "content": "UEsDBBQACAAIAJr6oFQmTAuRfvOGAA=="
}
Response samples
- 500
{- "type": "permission_denied",
- "message": "Error message"
}