x-yc-apigateway-integration:object_storage extension
The x-yc-apigateway-integration:object_storage
extension delegates request handling to Object Storage for static file distribution.
You can add an extension to a specification using the specification constructor.
Supported parameters
The table below lists the parameters specific to API Gateway API gateways. You can find the description of other parameters in the OpenAPI 3.0 specification
Parameter | Type | Description |
---|---|---|
bucket |
string |
Bucket name. |
object |
string |
Object name. It supports parameter templating from the initial request path. The parameters are subsituted into object . |
error_object |
string | ErrorObjectSettings |
This is an optional parameter. The name of the object and the optional response code returned if object does not exist in the specified bucket . The parameters are subsituted into error_object . |
service_account_id |
string |
ID of the service account used for authorization when accessing Object Storage. If you omit the parameter, the service_account_id top-level parameter value will be used. If the parent parameter is also missing, the object will be available without authorization. |
The ErrorObjectSettings
object may contain the following parameters:
Parameter | Type | Description |
---|---|---|
object |
string |
Object name. The parameters are subsituted into object . |
statusCode |
number |
Returned response code |
Extension specification
Specification example:
/static/{file}:
get:
summary: Serve static file from Yandex Cloud Object Storage
parameters:
- name: file
in: path
required: true
schema:
type: string
x-yc-apigateway-integration:
type: object_storage
bucket: <bucket_name>
object: '{file}'
error_object: error.html
service_account_id: ajehfe65fhl********