# Store New Pool
API call format
POST images/pools //Use token authorization
{
"name": "<pool_name>",
"bucket": "<pool_bucket>",
"patterns": [
"<pool_pattern_1>",
"<pool_pattern_2>",
]
}
POST images/private/pools //Use Api key
{
"name": "<pool_name>",
"bucket": "<pool_bucket>",
"patterns": [
"<pool_pattern_1>",
"<pool_pattern_2>",
]
}
Description
Store new pool
Precondition:
- Authorization token/Api key is needed.
- Mandatory elements:
- name - pool name
- bucket - pool bucket
- patterns - regex patterns for request filtering. Should be a valid regular expression
Postcondition:
- On success response code should be 200.
- On success JSON formatted details for the created pool are returned.
- On failure an error will be returned with the right error code and description.
Example:
[Request] POST https://<base_api_url>/images/pools
{
"name": "<pool_name>",
"bucket": "<pool_bucket>",
"patterns": [
"<pool_pattern_1>",
"<pool_pattern_2>",
]
}
[Request] POST https://<base_api_url>/images/private/pools
{
"name": "<pool_name>",
"bucket": "<pool_bucket>",
"patterns": [
"<pool_pattern_1>",
"<pool_pattern_2>",
]
}
[Request Headers] {"Content-Type":"application/json","Accept":"application/json","Authorization":"<IdToken>"} //Use token autorization
[Request Headers] {"Content-Type":"application/json","Accept":"application/json","X-Api-Key":"<api_key>"} //Use Api Key
[Response] 201
[Response Headers] {"Content-Type":["application/json"],"Content-Length":["..."],"Connection":["keep-alive"],"Date":["..... GMT"],"x-amzn-RequestId":["....."],....]}
[Responce]
{
"status": true,
"data": "Item was created successfully",
"url": "https://<base_api_url>/images/pools/<pool_guid>"
}