|
87 | 87 | "x-oauth-scope": "environment:write" |
88 | 88 | }, |
89 | 89 | "delete": { |
90 | | - "description": "Deletes the specified database branch", |
| 90 | + "description": "Deletes the specified database branch. By default, deletes immediately. Use force=false to schedule deletion with 1-hour grace period (only when soft deletion is enabled).", |
91 | 91 | "operationId": "v1-delete-a-branch", |
92 | 92 | "parameters": [ |
93 | 93 | { |
|
107 | 107 | { "type": "string", "format": "uuid", "deprecated": true } |
108 | 108 | ] |
109 | 109 | } |
| 110 | + }, |
| 111 | + { |
| 112 | + "name": "force", |
| 113 | + "required": false, |
| 114 | + "in": "query", |
| 115 | + "description": "If set to false, schedule deletion with 1-hour grace period (only when soft deletion is enabled).", |
| 116 | + "schema": { "default": "true", "type": "boolean" } |
110 | 117 | } |
111 | 118 | ], |
112 | 119 | "responses": { |
|
271 | 278 | "x-oauth-scope": "environment:write" |
272 | 279 | } |
273 | 280 | }, |
| 281 | + "/v1/branches/{branch_id_or_ref}/restore": { |
| 282 | + "post": { |
| 283 | + "description": "Cancels scheduled deletion and restores the branch to active state", |
| 284 | + "operationId": "v1-restore-a-branch", |
| 285 | + "parameters": [ |
| 286 | + { |
| 287 | + "name": "branch_id_or_ref", |
| 288 | + "required": true, |
| 289 | + "in": "path", |
| 290 | + "description": "Branch ID", |
| 291 | + "schema": { |
| 292 | + "oneOf": [ |
| 293 | + { |
| 294 | + "type": "string", |
| 295 | + "minLength": 20, |
| 296 | + "maxLength": 20, |
| 297 | + "pattern": "^[a-z]+$", |
| 298 | + "description": "Project ref" |
| 299 | + }, |
| 300 | + { "type": "string", "format": "uuid", "deprecated": true } |
| 301 | + ] |
| 302 | + } |
| 303 | + } |
| 304 | + ], |
| 305 | + "responses": { |
| 306 | + "200": { |
| 307 | + "description": "", |
| 308 | + "content": { |
| 309 | + "application/json": { |
| 310 | + "schema": { "$ref": "#/components/schemas/BranchRestoreResponse" } |
| 311 | + } |
| 312 | + } |
| 313 | + }, |
| 314 | + "500": { "description": "Failed to restore database branch" } |
| 315 | + }, |
| 316 | + "security": [{ "bearer": [] }], |
| 317 | + "summary": "Restore a scheduled branch deletion", |
| 318 | + "tags": ["Environments"], |
| 319 | + "x-badges": [{ "name": "OAuth scope: environment:write", "position": "after" }], |
| 320 | + "x-oauth-scope": "environment:write" |
| 321 | + } |
| 322 | + }, |
274 | 323 | "/v1/branches/{branch_id_or_ref}/diff": { |
275 | 324 | "get": { |
276 | 325 | "description": "Diffs the specified database branch", |
|
2011 | 2060 | "requestBody": { |
2012 | 2061 | "required": true, |
2013 | 2062 | "content": { |
2014 | | - "application/json": { "schema": { "type": "array", "items": { "type": "string" } } } |
| 2063 | + "application/json": { "schema": { "$ref": "#/components/schemas/DeleteSecretsBody" } } |
2015 | 2064 | } |
2016 | 2065 | }, |
2017 | 2066 | "responses": { |
|
3661 | 3710 | }, |
3662 | 3711 | "/v1/projects/{ref}/analytics/endpoints/logs.all": { |
3663 | 3712 | "get": { |
3664 | | - "description": "Executes a SQL query on the project's logs.\n\nEither the 'iso_timestamp_start' and 'iso_timestamp_end' parameters must be provided.\nIf both are not provided, only the last 1 minute of logs will be queried.\nThe timestamp range must be no more than 24 hours and is rounded to the nearest minute. If the range is more than 24 hours, a validation error will be thrown.\n", |
| 3713 | + "description": "Executes a SQL query on the project's logs.\n\nEither the `iso_timestamp_start` and `iso_timestamp_end` parameters must be provided.\nIf both are not provided, only the last 1 minute of logs will be queried.\nThe timestamp range must be no more than 24 hours and is rounded to the nearest minute. If the range is more than 24 hours, a validation error will be thrown.\n\nNote: Unless the `sql` parameter is provided, only edge_logs will be queried. See the [log query docs](/docs/guides/telemetry/logs?queryGroups=product&product=postgres&queryGroups=source&source=edge_logs#querying-with-the-logs-explorer:~:text=logs%20from%20the-,Sources,-drop%2Ddown%3A) for all available sources. \n", |
3665 | 3714 | "operationId": "v1-get-project-logs", |
3666 | 3715 | "parameters": [ |
3667 | 3716 | { |
|
3671 | 3720 | "description": "Project ref", |
3672 | 3721 | "schema": { "minLength": 20, "maxLength": 20, "pattern": "^[a-z]+$", "type": "string" } |
3673 | 3722 | }, |
3674 | | - { "name": "sql", "required": false, "in": "query", "schema": { "type": "string" } }, |
| 3723 | + { |
| 3724 | + "name": "sql", |
| 3725 | + "required": false, |
| 3726 | + "in": "query", |
| 3727 | + "description": "Custom SQL query to execute on the logs. See [querying logs](/docs/guides/telemetry/logs?queryGroups=product&product=postgres&queryGroups=source&source=edge_logs#querying-with-the-logs-explorer) for more details.", |
| 3728 | + "schema": { "type": "string" } |
| 3729 | + }, |
3675 | 3730 | { |
3676 | 3731 | "name": "iso_timestamp_start", |
3677 | 3732 | "required": false, |
|
3992 | 4047 | "tags": ["Database"], |
3993 | 4048 | "x-badges": [{ "name": "OAuth scope: database:write", "position": "after" }], |
3994 | 4049 | "x-oauth-scope": "database:write" |
| 4050 | + }, |
| 4051 | + "delete": { |
| 4052 | + "description": "Only available to selected partner OAuth apps", |
| 4053 | + "operationId": "v1-rollback-migrations", |
| 4054 | + "parameters": [ |
| 4055 | + { |
| 4056 | + "name": "ref", |
| 4057 | + "required": true, |
| 4058 | + "in": "path", |
| 4059 | + "description": "Project ref", |
| 4060 | + "schema": { "minLength": 20, "maxLength": 20, "pattern": "^[a-z]+$", "type": "string" } |
| 4061 | + }, |
| 4062 | + { |
| 4063 | + "name": "gte", |
| 4064 | + "required": true, |
| 4065 | + "in": "query", |
| 4066 | + "description": "Rollback migrations greater or equal to this version", |
| 4067 | + "schema": { "pattern": "^\\d+$", "type": "string" } |
| 4068 | + } |
| 4069 | + ], |
| 4070 | + "responses": { |
| 4071 | + "200": { "description": "" }, |
| 4072 | + "401": { "description": "Unauthorized" }, |
| 4073 | + "403": { "description": "Forbidden action" }, |
| 4074 | + "429": { "description": "Rate limit exceeded" }, |
| 4075 | + "500": { "description": "Failed to rollback database migration" } |
| 4076 | + }, |
| 4077 | + "security": [{ "bearer": [] }], |
| 4078 | + "summary": "[Beta] Rollback database migrations and remove them from history table", |
| 4079 | + "tags": ["Database"], |
| 4080 | + "x-badges": [{ "name": "OAuth scope: database:write", "position": "after" }], |
| 4081 | + "x-oauth-scope": "database:write" |
| 4082 | + } |
| 4083 | + }, |
| 4084 | + "/v1/projects/{ref}/database/migrations/{version}": { |
| 4085 | + "get": { |
| 4086 | + "description": "Only available to selected partner OAuth apps", |
| 4087 | + "operationId": "v1-get-a-migration", |
| 4088 | + "parameters": [ |
| 4089 | + { |
| 4090 | + "name": "ref", |
| 4091 | + "required": true, |
| 4092 | + "in": "path", |
| 4093 | + "description": "Project ref", |
| 4094 | + "schema": { "minLength": 20, "maxLength": 20, "pattern": "^[a-z]+$", "type": "string" } |
| 4095 | + }, |
| 4096 | + { |
| 4097 | + "name": "version", |
| 4098 | + "required": true, |
| 4099 | + "in": "path", |
| 4100 | + "schema": { "pattern": "^\\d+$", "type": "string" } |
| 4101 | + } |
| 4102 | + ], |
| 4103 | + "responses": { |
| 4104 | + "200": { |
| 4105 | + "description": "", |
| 4106 | + "content": { |
| 4107 | + "application/json": { |
| 4108 | + "schema": { "$ref": "#/components/schemas/V1GetMigrationResponse" } |
| 4109 | + } |
| 4110 | + } |
| 4111 | + }, |
| 4112 | + "401": { "description": "Unauthorized" }, |
| 4113 | + "403": { "description": "Forbidden action" }, |
| 4114 | + "429": { "description": "Rate limit exceeded" }, |
| 4115 | + "500": { "description": "Failed to get database migration" } |
| 4116 | + }, |
| 4117 | + "security": [{ "bearer": [] }], |
| 4118 | + "summary": "[Beta] Fetch an existing entry from migration history", |
| 4119 | + "tags": ["Database"], |
| 4120 | + "x-badges": [{ "name": "OAuth scope: database:read", "position": "after" }], |
| 4121 | + "x-oauth-scope": "database:read" |
| 4122 | + }, |
| 4123 | + "patch": { |
| 4124 | + "description": "Only available to selected partner OAuth apps", |
| 4125 | + "operationId": "v1-patch-a-migration", |
| 4126 | + "parameters": [ |
| 4127 | + { |
| 4128 | + "name": "ref", |
| 4129 | + "required": true, |
| 4130 | + "in": "path", |
| 4131 | + "description": "Project ref", |
| 4132 | + "schema": { "minLength": 20, "maxLength": 20, "pattern": "^[a-z]+$", "type": "string" } |
| 4133 | + }, |
| 4134 | + { |
| 4135 | + "name": "version", |
| 4136 | + "required": true, |
| 4137 | + "in": "path", |
| 4138 | + "schema": { "pattern": "^\\d+$", "type": "string" } |
| 4139 | + } |
| 4140 | + ], |
| 4141 | + "requestBody": { |
| 4142 | + "required": true, |
| 4143 | + "content": { |
| 4144 | + "application/json": { |
| 4145 | + "schema": { "$ref": "#/components/schemas/V1PatchMigrationBody" } |
| 4146 | + } |
| 4147 | + } |
| 4148 | + }, |
| 4149 | + "responses": { |
| 4150 | + "200": { "description": "" }, |
| 4151 | + "401": { "description": "Unauthorized" }, |
| 4152 | + "403": { "description": "Forbidden action" }, |
| 4153 | + "429": { "description": "Rate limit exceeded" }, |
| 4154 | + "500": { "description": "Failed to patch database migration" } |
| 4155 | + }, |
| 4156 | + "security": [{ "bearer": [] }], |
| 4157 | + "summary": "[Beta] Patch an existing entry in migration history", |
| 4158 | + "tags": ["Database"], |
| 4159 | + "x-badges": [{ "name": "OAuth scope: database:write", "position": "after" }], |
| 4160 | + "x-oauth-scope": "database:write" |
3995 | 4161 | } |
3996 | 4162 | }, |
3997 | 4163 | "/v1/projects/{ref}/database/query": { |
|
5395 | 5561 | "updated_at": { "type": "string", "format": "date-time" }, |
5396 | 5562 | "review_requested_at": { "type": "string", "format": "date-time" }, |
5397 | 5563 | "with_data": { "type": "boolean" }, |
5398 | | - "notify_url": { "type": "string", "format": "uri" } |
| 5564 | + "notify_url": { "type": "string", "format": "uri" }, |
| 5565 | + "deletion_scheduled_at": { "type": "string", "format": "date-time" }, |
| 5566 | + "preview_project_status": { |
| 5567 | + "type": "string", |
| 5568 | + "enum": [ |
| 5569 | + "INACTIVE", |
| 5570 | + "ACTIVE_HEALTHY", |
| 5571 | + "ACTIVE_UNHEALTHY", |
| 5572 | + "COMING_UP", |
| 5573 | + "UNKNOWN", |
| 5574 | + "GOING_DOWN", |
| 5575 | + "INIT_FAILED", |
| 5576 | + "REMOVED", |
| 5577 | + "RESTORING", |
| 5578 | + "UPGRADING", |
| 5579 | + "PAUSING", |
| 5580 | + "RESTORE_FAILED", |
| 5581 | + "RESTARTING", |
| 5582 | + "PAUSE_FAILED", |
| 5583 | + "RESIZING" |
| 5584 | + ] |
| 5585 | + } |
5399 | 5586 | }, |
5400 | 5587 | "required": [ |
5401 | 5588 | "id", |
|
5427 | 5614 | }, |
5428 | 5615 | "required": ["workflow_run_id", "message"] |
5429 | 5616 | }, |
| 5617 | + "BranchRestoreResponse": { |
| 5618 | + "type": "object", |
| 5619 | + "properties": { "message": { "type": "string", "enum": ["Branch restoration initiated"] } }, |
| 5620 | + "required": ["message"] |
| 5621 | + }, |
5430 | 5622 | "V1ListProjectsPaginatedResponse": { |
5431 | 5623 | "type": "object", |
5432 | 5624 | "properties": { |
|
6527 | 6719 | "required": ["name", "value"] |
6528 | 6720 | } |
6529 | 6721 | }, |
| 6722 | + "DeleteSecretsBody": { "type": "array", "items": { "type": "string" } }, |
6530 | 6723 | "SslEnforcementResponse": { |
6531 | 6724 | "type": "object", |
6532 | 6725 | "properties": { |
|
6977 | 7170 | "type": "object", |
6978 | 7171 | "properties": { "upstreamTarget": { "type": "string", "enum": ["main", "canary"] } }, |
6979 | 7172 | "required": ["upstreamTarget"] |
6980 | | - } |
| 7173 | + }, |
| 7174 | + "migrationVersion": { "type": "string" }, |
| 7175 | + "databasePoolMode": { "type": "string" } |
6981 | 7176 | }, |
6982 | | - "required": ["fileSizeLimit", "features", "capabilities", "external"] |
| 7177 | + "required": [ |
| 7178 | + "fileSizeLimit", |
| 7179 | + "features", |
| 7180 | + "capabilities", |
| 7181 | + "external", |
| 7182 | + "migrationVersion", |
| 7183 | + "databasePoolMode" |
| 7184 | + ] |
6983 | 7185 | }, |
6984 | 7186 | "UpdateStorageConfigBody": { |
6985 | 7187 | "type": "object", |
|
8531 | 8733 | "type": "object", |
8532 | 8734 | "properties": { |
8533 | 8735 | "query": { "type": "string", "minLength": 1 }, |
8534 | | - "name": { "type": "string" } |
| 8736 | + "name": { "type": "string" }, |
| 8737 | + "rollback": { "type": "string" } |
8535 | 8738 | }, |
8536 | 8739 | "required": ["query"] |
8537 | 8740 | }, |
8538 | 8741 | "V1UpsertMigrationBody": { |
8539 | 8742 | "type": "object", |
8540 | 8743 | "properties": { |
8541 | 8744 | "query": { "type": "string", "minLength": 1 }, |
8542 | | - "name": { "type": "string" } |
| 8745 | + "name": { "type": "string" }, |
| 8746 | + "rollback": { "type": "string" } |
8543 | 8747 | }, |
8544 | 8748 | "required": ["query"] |
8545 | 8749 | }, |
| 8750 | + "V1GetMigrationResponse": { |
| 8751 | + "type": "object", |
| 8752 | + "properties": { |
| 8753 | + "version": { "type": "string", "minLength": 1 }, |
| 8754 | + "name": { "type": "string" }, |
| 8755 | + "statements": { "type": "array", "items": { "type": "string" } }, |
| 8756 | + "rollback": { "type": "array", "items": { "type": "string" } }, |
| 8757 | + "created_by": { "type": "string" }, |
| 8758 | + "idempotency_key": { "type": "string" } |
| 8759 | + }, |
| 8760 | + "required": ["version"] |
| 8761 | + }, |
| 8762 | + "V1PatchMigrationBody": { |
| 8763 | + "type": "object", |
| 8764 | + "properties": { "name": { "type": "string" }, "rollback": { "type": "string" } } |
| 8765 | + }, |
8546 | 8766 | "V1RunQueryBody": { |
8547 | 8767 | "type": "object", |
8548 | 8768 | "properties": { |
|
0 commit comments