nvoi 0.1.8 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +1 -5
- data/Gemfile.lock +17 -8
- data/Rakefile +1 -1
- data/lib/nvoi/cli/config/command.rb +46 -41
- data/lib/nvoi/cli/credentials/edit/command.rb +20 -20
- data/lib/nvoi/cli/credentials/show/command.rb +1 -1
- data/lib/nvoi/cli/db/command.rb +10 -10
- data/lib/nvoi/cli/delete/command.rb +2 -2
- data/lib/nvoi/cli/deploy/command.rb +2 -2
- data/lib/nvoi/cli/deploy/steps/configure_tunnel.rb +2 -2
- data/lib/nvoi/cli/deploy/steps/provision_server.rb +1 -1
- data/lib/nvoi/cli/deploy/steps/provision_volume.rb +1 -1
- data/lib/nvoi/cli/exec/command.rb +3 -3
- data/lib/nvoi/cli/logs/command.rb +2 -2
- data/lib/nvoi/cli/onboard/command.rb +176 -622
- data/lib/nvoi/cli/onboard/steps/app.rb +108 -0
- data/lib/nvoi/cli/onboard/steps/app_name.rb +26 -0
- data/lib/nvoi/cli/onboard/steps/compute.rb +139 -0
- data/lib/nvoi/cli/onboard/steps/database.rb +97 -0
- data/lib/nvoi/cli/onboard/steps/domain.rb +48 -0
- data/lib/nvoi/cli/onboard/steps/env.rb +67 -0
- data/lib/nvoi/cli/onboard/ui.rb +84 -0
- data/lib/nvoi/cli/unlock/command.rb +2 -2
- data/lib/nvoi/cli.rb +0 -32
- data/lib/nvoi/configuration/app_service.rb +54 -0
- data/lib/nvoi/configuration/application.rb +44 -0
- data/lib/nvoi/configuration/builder.rb +417 -0
- data/lib/nvoi/configuration/database.rb +56 -0
- data/lib/nvoi/configuration/deploy.rb +15 -0
- data/lib/nvoi/{objects/service_spec.rb → configuration/deployment.rb} +4 -3
- data/lib/nvoi/{objects/config_override.rb → configuration/override.rb} +4 -4
- data/lib/nvoi/configuration/providers.rb +78 -0
- data/lib/nvoi/configuration/result.rb +43 -0
- data/lib/nvoi/configuration/root.rb +234 -0
- data/lib/nvoi/configuration/server.rb +39 -0
- data/lib/nvoi/configuration/service.rb +62 -0
- data/lib/nvoi/external/cloud/aws.rb +12 -12
- data/lib/nvoi/external/cloud/hetzner.rb +7 -7
- data/lib/nvoi/external/cloud/scaleway.rb +7 -7
- data/lib/nvoi/external/cloud/types.rb +42 -0
- data/lib/nvoi/external/database/mysql.rb +1 -1
- data/lib/nvoi/external/database/postgres.rb +1 -1
- data/lib/nvoi/external/database/provider.rb +1 -1
- data/lib/nvoi/external/database/sqlite.rb +1 -1
- data/lib/nvoi/external/database/types.rb +55 -0
- data/lib/nvoi/external/dns/cloudflare.rb +6 -6
- data/lib/nvoi/external/dns/types.rb +24 -0
- data/lib/nvoi/utils/config_loader.rb +12 -12
- data/lib/nvoi/utils/credential_store.rb +4 -4
- data/lib/nvoi/utils/env_resolver.rb +3 -3
- data/lib/nvoi/utils/namer.rb +2 -2
- data/lib/nvoi/utils/presence.rb +23 -0
- data/lib/nvoi/version.rb +1 -1
- data/lib/nvoi.rb +2 -17
- metadata +95 -58
- data/.claude/todo/refactor/00-overview.md +0 -171
- data/.claude/todo/refactor/01-objects.md +0 -96
- data/.claude/todo/refactor/02-utils.md +0 -143
- data/.claude/todo/refactor/03-external-cloud.md +0 -164
- data/.claude/todo/refactor/04-external-dns.md +0 -104
- data/.claude/todo/refactor/05-external.md +0 -133
- data/.claude/todo/refactor/06-cli.md +0 -123
- data/.claude/todo/refactor/07-cli-deploy-command.md +0 -177
- data/.claude/todo/refactor/08-cli-deploy-steps.md +0 -201
- data/.claude/todo/refactor/09-cli-delete-command.md +0 -169
- data/.claude/todo/refactor/10-cli-exec-command.md +0 -157
- data/.claude/todo/refactor/11-cli-credentials-command.md +0 -190
- data/.claude/todo/refactor/12-cli-db-command.md +0 -128
- data/.claude/todo/refactor/_target.md +0 -79
- data/.claude/todo/refactor-execution/00-entrypoint.md +0 -49
- data/.claude/todo/refactor-execution/01-objects.md +0 -42
- data/.claude/todo/refactor-execution/02-utils.md +0 -41
- data/.claude/todo/refactor-execution/03-external-cloud.md +0 -38
- data/.claude/todo/refactor-execution/04-external-dns.md +0 -35
- data/.claude/todo/refactor-execution/05-external-other.md +0 -46
- data/.claude/todo/refactor-execution/06-cli-deploy.md +0 -45
- data/.claude/todo/refactor-execution/07-cli-delete.md +0 -43
- data/.claude/todo/refactor-execution/08-cli-exec.md +0 -30
- data/.claude/todo/refactor-execution/09-cli-credentials.md +0 -34
- data/.claude/todo/refactor-execution/10-cli-db.md +0 -31
- data/.claude/todo/refactor-execution/11-cli-router.md +0 -44
- data/.claude/todo/refactor-execution/12-cleanup.md +0 -120
- data/.claude/todo/refactor-execution/_monitoring-strategy.md +0 -126
- data/.claude/todo/scaleway.impl.md +0 -644
- data/.claude/todo/scaleway.reference.md +0 -520
- data/.claude/todos/buckets.md +0 -41
- data/.claude/todos.md +0 -550
- data/ingest +0 -0
- data/lib/nvoi/config_api/actions/app.rb +0 -53
- data/lib/nvoi/config_api/actions/compute_provider.rb +0 -55
- data/lib/nvoi/config_api/actions/database.rb +0 -70
- data/lib/nvoi/config_api/actions/domain_provider.rb +0 -40
- data/lib/nvoi/config_api/actions/env.rb +0 -32
- data/lib/nvoi/config_api/actions/init.rb +0 -67
- data/lib/nvoi/config_api/actions/secret.rb +0 -32
- data/lib/nvoi/config_api/actions/server.rb +0 -66
- data/lib/nvoi/config_api/actions/service.rb +0 -52
- data/lib/nvoi/config_api/actions/volume.rb +0 -40
- data/lib/nvoi/config_api/base.rb +0 -38
- data/lib/nvoi/config_api/result.rb +0 -26
- data/lib/nvoi/config_api.rb +0 -93
- data/lib/nvoi/objects/configuration.rb +0 -483
- data/lib/nvoi/objects/database.rb +0 -56
- data/lib/nvoi/objects/dns.rb +0 -14
- data/lib/nvoi/objects/firewall.rb +0 -11
- data/lib/nvoi/objects/network.rb +0 -11
- data/lib/nvoi/objects/server.rb +0 -14
- data/lib/nvoi/objects/tunnel.rb +0 -14
- data/lib/nvoi/objects/volume.rb +0 -17
|
@@ -1,520 +0,0 @@
|
|
|
1
|
-
# Scaleway API Reference Documentation
|
|
2
|
-
|
|
3
|
-
## 1. Authentication
|
|
4
|
-
|
|
5
|
-
- **Base URL**: `https://api.scaleway.com`
|
|
6
|
-
- **Auth Header**: `X-Auth-Token: <secret_key>` (NOT Bearer token)
|
|
7
|
-
- **Content-Type**: `application/json`
|
|
8
|
-
|
|
9
|
-
## 2. API Structure
|
|
10
|
-
|
|
11
|
-
Scaleway uses **zoned** and **regional** APIs:
|
|
12
|
-
|
|
13
|
-
```
|
|
14
|
-
# Zoned APIs (Instances, Block Storage)
|
|
15
|
-
https://api.scaleway.com/instance/v1/zones/{zone}/servers
|
|
16
|
-
https://api.scaleway.com/block/v1alpha1/zones/{zone}/volumes
|
|
17
|
-
|
|
18
|
-
# Regional APIs (VPC/Private Networks)
|
|
19
|
-
https://api.scaleway.com/vpc/v2/regions/{region}/private-networks
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
### Zones
|
|
23
|
-
- `fr-par-1`, `fr-par-2`, `fr-par-3`
|
|
24
|
-
- `nl-ams-1`, `nl-ams-2`, `nl-ams-3`
|
|
25
|
-
- `pl-waw-1`, `pl-waw-2`, `pl-waw-3`
|
|
26
|
-
|
|
27
|
-
### Regions
|
|
28
|
-
- `fr-par` (Paris)
|
|
29
|
-
- `nl-ams` (Amsterdam)
|
|
30
|
-
- `pl-waw` (Warsaw)
|
|
31
|
-
|
|
32
|
-
### Zone to Region Mapping
|
|
33
|
-
- `fr-par-1`, `fr-par-2`, `fr-par-3` → `fr-par`
|
|
34
|
-
- `nl-ams-1`, `nl-ams-2`, `nl-ams-3` → `nl-ams`
|
|
35
|
-
- `pl-waw-1`, `pl-waw-2`, `pl-waw-3` → `pl-waw`
|
|
36
|
-
|
|
37
|
-
---
|
|
38
|
-
|
|
39
|
-
## 3. Servers (Instances) API
|
|
40
|
-
|
|
41
|
-
### Endpoints
|
|
42
|
-
|
|
43
|
-
| Operation | Method | Path |
|
|
44
|
-
|-----------|--------|------|
|
|
45
|
-
| List servers | GET | `/instance/v1/zones/{zone}/servers` |
|
|
46
|
-
| Get server | GET | `/instance/v1/zones/{zone}/servers/{id}` |
|
|
47
|
-
| Create server | POST | `/instance/v1/zones/{zone}/servers` |
|
|
48
|
-
| Delete server | DELETE | `/instance/v1/zones/{zone}/servers/{id}` |
|
|
49
|
-
| Server action | POST | `/instance/v1/zones/{zone}/servers/{id}/action` |
|
|
50
|
-
| List server types | GET | `/instance/v1/zones/{zone}/products/servers` |
|
|
51
|
-
| List images | GET | `/instance/v1/zones/{zone}/images` |
|
|
52
|
-
|
|
53
|
-
### Create Server Request Body
|
|
54
|
-
|
|
55
|
-
```json
|
|
56
|
-
{
|
|
57
|
-
"name": "my-server",
|
|
58
|
-
"commercial_type": "DEV1-S",
|
|
59
|
-
"image": "881d7a33-4cfa-4046-b5cf-c33cb9c62fb6",
|
|
60
|
-
"project": "697ef834-9bd0-4181-ae29-b0bcd0e574ae",
|
|
61
|
-
"enable_ipv6": false,
|
|
62
|
-
"boot_type": "local",
|
|
63
|
-
"tags": ["tag1", "tag2"],
|
|
64
|
-
"security_group": "sg-uuid"
|
|
65
|
-
}
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
### Server Response Structure
|
|
69
|
-
|
|
70
|
-
```json
|
|
71
|
-
{
|
|
72
|
-
"server": {
|
|
73
|
-
"id": "uuid",
|
|
74
|
-
"name": "my-server",
|
|
75
|
-
"state": "running",
|
|
76
|
-
"commercial_type": "DEV1-S",
|
|
77
|
-
"public_ip": {
|
|
78
|
-
"id": "ip-uuid",
|
|
79
|
-
"address": "51.15.x.x",
|
|
80
|
-
"dynamic": false
|
|
81
|
-
},
|
|
82
|
-
"private_ip": null,
|
|
83
|
-
"volumes": {},
|
|
84
|
-
"security_group": {
|
|
85
|
-
"id": "sg-uuid",
|
|
86
|
-
"name": "sg-name"
|
|
87
|
-
},
|
|
88
|
-
"tags": [],
|
|
89
|
-
"zone": "fr-par-1"
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
### Server States
|
|
95
|
-
- `stopped`
|
|
96
|
-
- `stopping`
|
|
97
|
-
- `starting`
|
|
98
|
-
- `running`
|
|
99
|
-
- `locked`
|
|
100
|
-
|
|
101
|
-
### Server Action Request
|
|
102
|
-
|
|
103
|
-
```json
|
|
104
|
-
{
|
|
105
|
-
"action": "poweron"
|
|
106
|
-
}
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
Available actions: `poweron`, `poweroff`, `reboot`, `terminate`
|
|
110
|
-
|
|
111
|
-
### List Server Types Response
|
|
112
|
-
|
|
113
|
-
```json
|
|
114
|
-
{
|
|
115
|
-
"servers": {
|
|
116
|
-
"DEV1-S": {
|
|
117
|
-
"monthly_price": 0.0,
|
|
118
|
-
"hourly_price": 0.0,
|
|
119
|
-
"alt_names": [],
|
|
120
|
-
"per_volume_constraint": {
|
|
121
|
-
"l_ssd": {
|
|
122
|
-
"min_size": 20000000000,
|
|
123
|
-
"max_size": 80000000000
|
|
124
|
-
}
|
|
125
|
-
},
|
|
126
|
-
"volumes_constraint": {
|
|
127
|
-
"min_size": 20000000000,
|
|
128
|
-
"max_size": 80000000000
|
|
129
|
-
},
|
|
130
|
-
"ncpus": 2,
|
|
131
|
-
"ram": 2147483648,
|
|
132
|
-
"arch": "x86_64",
|
|
133
|
-
"baremetal": false
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
### Common Commercial Types
|
|
140
|
-
- `DEV1-S`, `DEV1-M`, `DEV1-L`, `DEV1-XL`
|
|
141
|
-
- `GP1-XS`, `GP1-S`, `GP1-M`, `GP1-L`, `GP1-XL`
|
|
142
|
-
- `PRO2-XXS`, `PRO2-XS`, `PRO2-S`, `PRO2-M`, `PRO2-L`
|
|
143
|
-
|
|
144
|
-
---
|
|
145
|
-
|
|
146
|
-
## 4. Security Groups API
|
|
147
|
-
|
|
148
|
-
### Endpoints
|
|
149
|
-
|
|
150
|
-
| Operation | Method | Path |
|
|
151
|
-
|-----------|--------|------|
|
|
152
|
-
| List | GET | `/instance/v1/zones/{zone}/security_groups` |
|
|
153
|
-
| Get | GET | `/instance/v1/zones/{zone}/security_groups/{id}` |
|
|
154
|
-
| Create | POST | `/instance/v1/zones/{zone}/security_groups` |
|
|
155
|
-
| Update | PUT | `/instance/v1/zones/{zone}/security_groups/{id}` |
|
|
156
|
-
| Delete | DELETE | `/instance/v1/zones/{zone}/security_groups/{id}` |
|
|
157
|
-
| List rules | GET | `/instance/v1/zones/{zone}/security_groups/{id}/rules` |
|
|
158
|
-
| Create rule | POST | `/instance/v1/zones/{zone}/security_groups/{id}/rules` |
|
|
159
|
-
| Delete rule | DELETE | `/instance/v1/zones/{zone}/security_groups/{id}/rules/{rule_id}` |
|
|
160
|
-
|
|
161
|
-
### Create Security Group Request
|
|
162
|
-
|
|
163
|
-
```json
|
|
164
|
-
{
|
|
165
|
-
"name": "my-firewall",
|
|
166
|
-
"description": "SSH access",
|
|
167
|
-
"organization": "org-uuid",
|
|
168
|
-
"project": "project-uuid",
|
|
169
|
-
"stateful": true,
|
|
170
|
-
"inbound_default_policy": "drop",
|
|
171
|
-
"outbound_default_policy": "accept",
|
|
172
|
-
"enable_default_security": true
|
|
173
|
-
}
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
### Security Group Response
|
|
177
|
-
|
|
178
|
-
```json
|
|
179
|
-
{
|
|
180
|
-
"security_group": {
|
|
181
|
-
"id": "uuid",
|
|
182
|
-
"name": "my-firewall",
|
|
183
|
-
"description": "SSH access",
|
|
184
|
-
"enable_default_security": true,
|
|
185
|
-
"inbound_default_policy": "drop",
|
|
186
|
-
"outbound_default_policy": "accept",
|
|
187
|
-
"organization": "org-uuid",
|
|
188
|
-
"project": "project-uuid",
|
|
189
|
-
"stateful": true,
|
|
190
|
-
"state": "available",
|
|
191
|
-
"servers": [],
|
|
192
|
-
"zone": "fr-par-1"
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
```
|
|
196
|
-
|
|
197
|
-
### Create Rule Request
|
|
198
|
-
|
|
199
|
-
```json
|
|
200
|
-
{
|
|
201
|
-
"protocol": "TCP",
|
|
202
|
-
"direction": "inbound",
|
|
203
|
-
"action": "accept",
|
|
204
|
-
"ip_range": "0.0.0.0/0",
|
|
205
|
-
"dest_port_from": 22,
|
|
206
|
-
"dest_port_to": 22,
|
|
207
|
-
"position": 1,
|
|
208
|
-
"editable": true
|
|
209
|
-
}
|
|
210
|
-
```
|
|
211
|
-
|
|
212
|
-
### Rule Protocols
|
|
213
|
-
- `TCP`
|
|
214
|
-
- `UDP`
|
|
215
|
-
- `ICMP`
|
|
216
|
-
- `ANY`
|
|
217
|
-
|
|
218
|
-
### Rule Directions
|
|
219
|
-
- `inbound`
|
|
220
|
-
- `outbound`
|
|
221
|
-
|
|
222
|
-
### Rule Actions
|
|
223
|
-
- `accept`
|
|
224
|
-
- `drop`
|
|
225
|
-
|
|
226
|
-
---
|
|
227
|
-
|
|
228
|
-
## 5. Private Networks (VPC) API
|
|
229
|
-
|
|
230
|
-
### Endpoints
|
|
231
|
-
|
|
232
|
-
| Operation | Method | Path |
|
|
233
|
-
|-----------|--------|------|
|
|
234
|
-
| List | GET | `/vpc/v2/regions/{region}/private-networks` |
|
|
235
|
-
| Get | GET | `/vpc/v2/regions/{region}/private-networks/{id}` |
|
|
236
|
-
| Create | POST | `/vpc/v2/regions/{region}/private-networks` |
|
|
237
|
-
| Update | PATCH | `/vpc/v2/regions/{region}/private-networks/{id}` |
|
|
238
|
-
| Delete | DELETE | `/vpc/v2/regions/{region}/private-networks/{id}` |
|
|
239
|
-
|
|
240
|
-
### Create Private Network Request
|
|
241
|
-
|
|
242
|
-
```json
|
|
243
|
-
{
|
|
244
|
-
"name": "my-network",
|
|
245
|
-
"project_id": "project-uuid",
|
|
246
|
-
"subnets": ["10.0.1.0/24"],
|
|
247
|
-
"vpc_id": "vpc-uuid",
|
|
248
|
-
"tags": ["tag1"]
|
|
249
|
-
}
|
|
250
|
-
```
|
|
251
|
-
|
|
252
|
-
### Private Network Response
|
|
253
|
-
|
|
254
|
-
```json
|
|
255
|
-
{
|
|
256
|
-
"id": "pn-uuid",
|
|
257
|
-
"name": "my-network",
|
|
258
|
-
"organization_id": "org-uuid",
|
|
259
|
-
"project_id": "project-uuid",
|
|
260
|
-
"region": "fr-par",
|
|
261
|
-
"subnets": [
|
|
262
|
-
{
|
|
263
|
-
"id": "subnet-uuid",
|
|
264
|
-
"subnet": "10.0.1.0/24",
|
|
265
|
-
"created_at": "2024-01-01T00:00:00Z",
|
|
266
|
-
"updated_at": "2024-01-01T00:00:00Z"
|
|
267
|
-
}
|
|
268
|
-
],
|
|
269
|
-
"vpc_id": "vpc-uuid",
|
|
270
|
-
"dhcp_enabled": true,
|
|
271
|
-
"created_at": "2024-01-01T00:00:00Z",
|
|
272
|
-
"updated_at": "2024-01-01T00:00:00Z",
|
|
273
|
-
"tags": []
|
|
274
|
-
}
|
|
275
|
-
```
|
|
276
|
-
|
|
277
|
-
### List Response
|
|
278
|
-
|
|
279
|
-
```json
|
|
280
|
-
{
|
|
281
|
-
"private_networks": [...],
|
|
282
|
-
"total_count": 1
|
|
283
|
-
}
|
|
284
|
-
```
|
|
285
|
-
|
|
286
|
-
---
|
|
287
|
-
|
|
288
|
-
## 6. Private NICs API (Instance to Network Attachment)
|
|
289
|
-
|
|
290
|
-
### Endpoints
|
|
291
|
-
|
|
292
|
-
| Operation | Method | Path |
|
|
293
|
-
|-----------|--------|------|
|
|
294
|
-
| List | GET | `/instance/v1/zones/{zone}/servers/{server_id}/private_nics` |
|
|
295
|
-
| Get | GET | `/instance/v1/zones/{zone}/servers/{server_id}/private_nics/{nic_id}` |
|
|
296
|
-
| Create | POST | `/instance/v1/zones/{zone}/servers/{server_id}/private_nics` |
|
|
297
|
-
| Update | PATCH | `/instance/v1/zones/{zone}/servers/{server_id}/private_nics/{nic_id}` |
|
|
298
|
-
| Delete | DELETE | `/instance/v1/zones/{zone}/servers/{server_id}/private_nics/{nic_id}` |
|
|
299
|
-
|
|
300
|
-
### Create Private NIC Request
|
|
301
|
-
|
|
302
|
-
```json
|
|
303
|
-
{
|
|
304
|
-
"private_network_id": "pn-uuid",
|
|
305
|
-
"ip_ids": []
|
|
306
|
-
}
|
|
307
|
-
```
|
|
308
|
-
|
|
309
|
-
### Private NIC Response
|
|
310
|
-
|
|
311
|
-
```json
|
|
312
|
-
{
|
|
313
|
-
"private_nic": {
|
|
314
|
-
"id": "nic-uuid",
|
|
315
|
-
"server_id": "server-uuid",
|
|
316
|
-
"private_network_id": "pn-uuid",
|
|
317
|
-
"mac_address": "02:00:00:00:00:01",
|
|
318
|
-
"state": "available",
|
|
319
|
-
"tags": []
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
```
|
|
323
|
-
|
|
324
|
-
### Private NIC States
|
|
325
|
-
- `available`
|
|
326
|
-
- `syncing`
|
|
327
|
-
- `syncing_error`
|
|
328
|
-
|
|
329
|
-
---
|
|
330
|
-
|
|
331
|
-
## 7. Block Storage API
|
|
332
|
-
|
|
333
|
-
### Endpoints
|
|
334
|
-
|
|
335
|
-
| Operation | Method | Path |
|
|
336
|
-
|-----------|--------|------|
|
|
337
|
-
| List | GET | `/block/v1alpha1/zones/{zone}/volumes` |
|
|
338
|
-
| Get | GET | `/block/v1alpha1/zones/{zone}/volumes/{id}` |
|
|
339
|
-
| Create | POST | `/block/v1alpha1/zones/{zone}/volumes` |
|
|
340
|
-
| Update | PATCH | `/block/v1alpha1/zones/{zone}/volumes/{id}` |
|
|
341
|
-
| Delete | DELETE | `/block/v1alpha1/zones/{zone}/volumes/{id}` |
|
|
342
|
-
|
|
343
|
-
### Create Volume Request
|
|
344
|
-
|
|
345
|
-
```json
|
|
346
|
-
{
|
|
347
|
-
"name": "my-volume",
|
|
348
|
-
"perf_iops": 5000,
|
|
349
|
-
"from_empty": {
|
|
350
|
-
"size": 53687091200
|
|
351
|
-
},
|
|
352
|
-
"project_id": "project-uuid",
|
|
353
|
-
"tags": []
|
|
354
|
-
}
|
|
355
|
-
```
|
|
356
|
-
|
|
357
|
-
### Volume Response
|
|
358
|
-
|
|
359
|
-
```json
|
|
360
|
-
{
|
|
361
|
-
"id": "vol-uuid",
|
|
362
|
-
"name": "my-volume",
|
|
363
|
-
"type": "sbs_5k",
|
|
364
|
-
"size": 53687091200,
|
|
365
|
-
"project_id": "project-uuid",
|
|
366
|
-
"zone": "fr-par-1",
|
|
367
|
-
"specs": {
|
|
368
|
-
"perf_iops": 5000,
|
|
369
|
-
"class": "sbs"
|
|
370
|
-
},
|
|
371
|
-
"status": "available",
|
|
372
|
-
"created_at": "2024-01-01T00:00:00Z",
|
|
373
|
-
"updated_at": "2024-01-01T00:00:00Z",
|
|
374
|
-
"references": [],
|
|
375
|
-
"parent_snapshot_id": null,
|
|
376
|
-
"tags": []
|
|
377
|
-
}
|
|
378
|
-
```
|
|
379
|
-
|
|
380
|
-
### Volume IOPS Options
|
|
381
|
-
- `5000` - Standard
|
|
382
|
-
- `15000` - High performance
|
|
383
|
-
|
|
384
|
-
### Volume Statuses
|
|
385
|
-
- `unknown_status`
|
|
386
|
-
- `creating`
|
|
387
|
-
- `available`
|
|
388
|
-
- `in_use`
|
|
389
|
-
- `deleting`
|
|
390
|
-
- `error`
|
|
391
|
-
- `snapshotting`
|
|
392
|
-
- `resizing`
|
|
393
|
-
- `locked`
|
|
394
|
-
|
|
395
|
-
### Attaching Volumes to Instances
|
|
396
|
-
|
|
397
|
-
Volume attachment is done via Instance API by updating the server's volumes:
|
|
398
|
-
|
|
399
|
-
```
|
|
400
|
-
PATCH /instance/v1/zones/{zone}/servers/{server_id}
|
|
401
|
-
```
|
|
402
|
-
|
|
403
|
-
```json
|
|
404
|
-
{
|
|
405
|
-
"volumes": {
|
|
406
|
-
"0": {
|
|
407
|
-
"id": "root-volume-uuid"
|
|
408
|
-
},
|
|
409
|
-
"1": {
|
|
410
|
-
"id": "block-volume-uuid"
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
}
|
|
414
|
-
```
|
|
415
|
-
|
|
416
|
-
**Important Notes:**
|
|
417
|
-
- Since April 2024, Block API cannot create volumes attached to instances
|
|
418
|
-
- Volumes must be attached via Instance API
|
|
419
|
-
- Include ALL volumes (including root) when updating
|
|
420
|
-
|
|
421
|
-
---
|
|
422
|
-
|
|
423
|
-
## 8. VPC API
|
|
424
|
-
|
|
425
|
-
### Endpoints
|
|
426
|
-
|
|
427
|
-
| Operation | Method | Path |
|
|
428
|
-
|-----------|--------|------|
|
|
429
|
-
| List | GET | `/vpc/v2/regions/{region}/vpcs` |
|
|
430
|
-
| Get | GET | `/vpc/v2/regions/{region}/vpcs/{id}` |
|
|
431
|
-
| Create | POST | `/vpc/v2/regions/{region}/vpcs` |
|
|
432
|
-
| Update | PATCH | `/vpc/v2/regions/{region}/vpcs/{id}` |
|
|
433
|
-
| Delete | DELETE | `/vpc/v2/regions/{region}/vpcs/{id}` |
|
|
434
|
-
|
|
435
|
-
### Create VPC Request
|
|
436
|
-
|
|
437
|
-
```json
|
|
438
|
-
{
|
|
439
|
-
"name": "my-vpc",
|
|
440
|
-
"project_id": "project-uuid",
|
|
441
|
-
"tags": [],
|
|
442
|
-
"enable_routing": true
|
|
443
|
-
}
|
|
444
|
-
```
|
|
445
|
-
|
|
446
|
-
### VPC Response
|
|
447
|
-
|
|
448
|
-
```json
|
|
449
|
-
{
|
|
450
|
-
"id": "vpc-uuid",
|
|
451
|
-
"name": "my-vpc",
|
|
452
|
-
"organization_id": "org-uuid",
|
|
453
|
-
"project_id": "project-uuid",
|
|
454
|
-
"region": "fr-par",
|
|
455
|
-
"tags": [],
|
|
456
|
-
"is_default": false,
|
|
457
|
-
"routing_enabled": true,
|
|
458
|
-
"created_at": "2024-01-01T00:00:00Z",
|
|
459
|
-
"updated_at": "2024-01-01T00:00:00Z",
|
|
460
|
-
"private_network_count": 0
|
|
461
|
-
}
|
|
462
|
-
```
|
|
463
|
-
|
|
464
|
-
---
|
|
465
|
-
|
|
466
|
-
## 9. Error Response Format
|
|
467
|
-
|
|
468
|
-
```json
|
|
469
|
-
{
|
|
470
|
-
"type": "invalid_request_error",
|
|
471
|
-
"message": "Validation Error",
|
|
472
|
-
"fields": {
|
|
473
|
-
"name": ["name is required"]
|
|
474
|
-
}
|
|
475
|
-
}
|
|
476
|
-
```
|
|
477
|
-
|
|
478
|
-
### HTTP Status Codes
|
|
479
|
-
- `200` - Success
|
|
480
|
-
- `201` - Created
|
|
481
|
-
- `204` - No Content (successful delete)
|
|
482
|
-
- `400` - Bad Request
|
|
483
|
-
- `401` - Unauthorized
|
|
484
|
-
- `403` - Forbidden
|
|
485
|
-
- `404` - Not Found
|
|
486
|
-
- `409` - Conflict
|
|
487
|
-
- `422` - Unprocessable Entity
|
|
488
|
-
- `429` - Rate Limited
|
|
489
|
-
- `500` - Internal Server Error
|
|
490
|
-
|
|
491
|
-
---
|
|
492
|
-
|
|
493
|
-
## 10. Pagination
|
|
494
|
-
|
|
495
|
-
List endpoints support pagination:
|
|
496
|
-
|
|
497
|
-
```
|
|
498
|
-
GET /instance/v1/zones/{zone}/servers?page=1&per_page=50
|
|
499
|
-
```
|
|
500
|
-
|
|
501
|
-
Response includes:
|
|
502
|
-
```json
|
|
503
|
-
{
|
|
504
|
-
"servers": [...],
|
|
505
|
-
"total_count": 100
|
|
506
|
-
}
|
|
507
|
-
```
|
|
508
|
-
|
|
509
|
-
---
|
|
510
|
-
|
|
511
|
-
## 11. Sources
|
|
512
|
-
|
|
513
|
-
- [Scaleway Instance API](https://www.scaleway.com/en/developers/api/instances/)
|
|
514
|
-
- [Scaleway VPC API](https://www.scaleway.com/en/developers/api/vpc/)
|
|
515
|
-
- [Scaleway Block Storage API](https://www.scaleway.com/en/developers/api/block/)
|
|
516
|
-
- [Scaleway CLI - Instance](https://cli.scaleway.com/instance/)
|
|
517
|
-
- [Scaleway CLI - VPC](https://cli.scaleway.com/vpc/)
|
|
518
|
-
- [Scaleway CLI - Block](https://cli.scaleway.com/block/)
|
|
519
|
-
- [Security Groups API Reference](https://bump.sh/demo/hub/scaleway-developers/doc/instance-v1/group/endpoint-security-groups)
|
|
520
|
-
- [Scaleway API Overview](https://www.scaleway.com/en/developers/api/)
|
data/.claude/todos/buckets.md
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
# Scaleway Bucket Automation
|
|
2
|
-
|
|
3
|
-
Automate bucket provisioning for new tenants/environments.
|
|
4
|
-
|
|
5
|
-
## API
|
|
6
|
-
|
|
7
|
-
No separate management API - use S3-compatible REST API directly via `aws-sdk-s3` gem.
|
|
8
|
-
|
|
9
|
-
```ruby
|
|
10
|
-
require "aws-sdk-s3"
|
|
11
|
-
|
|
12
|
-
client = Aws::S3::Client.new(
|
|
13
|
-
region: "fr-par",
|
|
14
|
-
endpoint: "https://s3.fr-par.scw.cloud",
|
|
15
|
-
access_key_id: Rails.application.credentials.dig(:scaleway, :access_key_id),
|
|
16
|
-
secret_access_key: Rails.application.credentials.dig(:scaleway, :secret_key)
|
|
17
|
-
)
|
|
18
|
-
|
|
19
|
-
# Create bucket
|
|
20
|
-
client.create_bucket(bucket: "tenant-#{tenant_slug}-#{Rails.env}")
|
|
21
|
-
|
|
22
|
-
# Set CORS
|
|
23
|
-
client.put_bucket_cors(
|
|
24
|
-
bucket: bucket_name,
|
|
25
|
-
cors_configuration: {
|
|
26
|
-
cors_rules: [{
|
|
27
|
-
allowed_origins: ["https://notiplus.com", "https://*.notiplus.com"],
|
|
28
|
-
allowed_methods: ["GET", "PUT"],
|
|
29
|
-
allowed_headers: ["*"],
|
|
30
|
-
max_age_seconds: 3000
|
|
31
|
-
}]
|
|
32
|
-
}
|
|
33
|
-
)
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
## Tasks
|
|
37
|
-
|
|
38
|
-
- [ ] Create `Scaleway::BucketService` to handle create/configure
|
|
39
|
-
- [ ] Add rake task for provisioning new environment buckets
|
|
40
|
-
- [ ] Hook into tenant creation flow (if multi-tenant)
|
|
41
|
-
- [ ] Add lifecycle rules for old/temp files cleanup
|