Dimitar Yanakiev e98e974e20
Add endpoint for reading and updating site .env file (#564)
* feat(api): Add endpoint for reading site .env file

- Add GET /api/projects/{project}/servers/{server}/sites/{site}/env endpoint
- Add feature tests with SSH mocking

* added updating env

* fix coding style

* generate docs

---------

Co-authored-by: Saeed Vaziry <mr.saeedvaziry@gmail.com>
2025-04-05 19:59:57 +02:00

393 lines
10 KiB
YAML

## Autogenerated by Scribe. DO NOT MODIFY.
name: database-users
description: ''
endpoints:
-
httpMethods:
- GET
uri: 'api/projects/{project_id}/servers/{server_id}/database-users'
metadata:
groupName: database-users
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: list
description: 'Get all database users.'
authenticated: true
custom: []
headers:
Authorization: 'Bearer YOUR-API-KEY'
Content-Type: application/json
Accept: application/json
urlParameters:
project_id:
name: project_id
description: 'The ID of the project.'
required: true
example: 1
type: integer
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
server_id:
name: server_id
description: 'The ID of the server.'
required: true
example: 29
type: integer
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
project_id: 1
server_id: 29
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 200
content: '{"data":[{"id":null,"server_id":null,"username":"letha64","databases":[],"host":"%","status":null,"created_at":null,"updated_at":null},{"id":null,"server_id":null,"username":"hagenes.lurline","databases":[],"host":"%","status":null,"created_at":null,"updated_at":null}],"links":{"first":"\/?page=1","last":"\/?page=1","prev":null,"next":null},"meta":{"current_page":1,"from":1,"last_page":1,"links":[{"url":null,"label":"&laquo; Previous","active":false},{"url":"\/?page=1","label":"1","active":true},{"url":null,"label":"Next &raquo;","active":false}],"path":"\/","per_page":25,"to":2,"total":2}}'
headers: []
description: ''
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer d4g15bV3Pa6hDvck6eaEf8Z'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- POST
uri: 'api/projects/{project_id}/servers/{server_id}/database-users'
metadata:
groupName: database-users
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: create
description: 'Create a new database user.'
authenticated: true
custom: []
headers:
Authorization: 'Bearer YOUR-API-KEY'
Content-Type: application/json
Accept: application/json
urlParameters:
project_id:
name: project_id
description: 'The ID of the project.'
required: true
example: 1
type: integer
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
server_id:
name: server_id
description: 'The ID of the server.'
required: true
example: 29
type: integer
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
project_id: 1
server_id: 29
queryParameters: []
cleanQueryParameters: []
bodyParameters:
username:
name: username
description: ''
required: true
example: qui
type: string
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
password:
name: password
description: ''
required: true
example: 'xYv*3,#HQ=5<w!'
type: string
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
host:
name: host
description: 'Host, if it is a remote user.'
required: true
example: '%'
type: string
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanBodyParameters:
username: qui
password: 'xYv*3,#HQ=5<w!'
host: '%'
fileParameters: []
responses:
-
status: 200
content: '{"id":null,"server_id":null,"username":"marcelle95","databases":[],"host":"%","status":null,"created_at":null,"updated_at":null}'
headers: []
description: ''
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer 3vZ6f6kagacDEhV1Pde5b84'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- GET
uri: 'api/projects/{project_id}/servers/{server_id}/database-users/{databaseUser_id}'
metadata:
groupName: database-users
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: show
description: 'Get a database user by ID.'
authenticated: true
custom: []
headers:
Authorization: 'Bearer YOUR-API-KEY'
Content-Type: application/json
Accept: application/json
urlParameters:
project_id:
name: project_id
description: 'The ID of the project.'
required: true
example: 1
type: integer
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
server_id:
name: server_id
description: 'The ID of the server.'
required: true
example: 29
type: integer
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
databaseUser_id:
name: databaseUser_id
description: 'The ID of the databaseUser.'
required: true
example: 1
type: integer
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
project_id: 1
server_id: 29
databaseUser_id: 1
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 200
content: '{"id":null,"server_id":null,"username":"brandi53","databases":[],"host":"%","status":null,"created_at":null,"updated_at":null}'
headers: []
description: ''
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer af3b5ac6dP8ZV4vE1hk6eDg'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- POST
uri: 'api/projects/{project_id}/servers/{server_id}/database-users/{databaseUser_id}/link'
metadata:
groupName: database-users
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: link
description: 'Link to databases'
authenticated: true
custom: []
headers:
Authorization: 'Bearer YOUR-API-KEY'
Content-Type: application/json
Accept: application/json
urlParameters:
project_id:
name: project_id
description: 'The ID of the project.'
required: true
example: 1
type: integer
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
server_id:
name: server_id
description: 'The ID of the server.'
required: true
example: 29
type: integer
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
databaseUser_id:
name: databaseUser_id
description: 'The ID of the databaseUser.'
required: true
example: 4
type: integer
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
project_id: 1
server_id: 29
databaseUser_id: 4
queryParameters: []
cleanQueryParameters: []
bodyParameters:
databases:
name: databases
description: 'Array of database names to link to the user.'
required: true
example: maiores
type: string
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanBodyParameters:
databases: maiores
fileParameters: []
responses:
-
status: 200
content: '{"id":null,"server_id":null,"username":"kschmidt","databases":[],"host":"%","status":null,"created_at":null,"updated_at":null}'
headers: []
description: ''
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer b6f3Ed641gaZDcVa5k8vePh'
controller: null
method: null
route: null
custom: []
-
httpMethods:
- DELETE
uri: 'api/projects/{project_id}/servers/{server_id}/database-users/{databaseUser_id}'
metadata:
groupName: database-users
groupDescription: ''
subgroup: ''
subgroupDescription: ''
title: delete
description: 'Delete database user.'
authenticated: true
custom: []
headers:
Authorization: 'Bearer YOUR-API-KEY'
Content-Type: application/json
Accept: application/json
urlParameters:
project_id:
name: project_id
description: 'The ID of the project.'
required: true
example: 1
type: integer
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
server_id:
name: server_id
description: 'The ID of the server.'
required: true
example: 29
type: integer
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
databaseUser_id:
name: databaseUser_id
description: 'The ID of the databaseUser.'
required: true
example: 20
type: integer
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanUrlParameters:
project_id: 1
server_id: 29
databaseUser_id: 20
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
cleanBodyParameters: []
fileParameters: []
responses:
-
status: 204
content: null
headers: []
description: ''
custom: []
responseFields: []
auth:
- headers
- Authorization
- 'Bearer Zka6fh15g6eaV8vE34cDPdb'
controller: null
method: null
route: null
custom: []