Skip to content

Commit 91aa6f8

Browse files
committed
Update for API changes
1 parent 69ed071 commit 91aa6f8

7 files changed

Lines changed: 106 additions & 236 deletions

File tree

README.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -95,41 +95,41 @@ vector site ssh-key remove <site_id> <key_id>
9595
```bash
9696
# List and view environments
9797
vector env list <site_id>
98-
vector env show <site_id> <env_name>
98+
vector env show <env_id>
9999

100100
# Create and manage environments
101101
vector env create <site_id> --name staging --custom-domain example.com --php-version 8.3 [--is-production]
102-
vector env update <site_id> <env_name> [--name <name>] [--custom-domain <domain>]
103-
vector env delete <site_id> <env_name>
102+
vector env update <env_id> [--name <name>] [--custom-domain <domain>]
103+
vector env delete <env_id>
104104

105105
# Reset database password
106-
vector env reset-db-password <site_id> <env_name>
106+
vector env reset-db-password <env_id>
107107
```
108108

109109
### Environment Secrets
110110

111111
```bash
112-
vector env secret list <site_id> <env_name>
113-
vector env secret show <site_id> <env_name> <secret_id>
114-
vector env secret create <site_id> <env_name> --key MY_SECRET --value "secret-value"
115-
vector env secret update <site_id> <env_name> <secret_id> [--key <key>] [--value <value>]
116-
vector env secret delete <site_id> <env_name> <secret_id>
112+
vector env secret list <env_id>
113+
vector env secret show <secret_id>
114+
vector env secret create <env_id> --key MY_SECRET --value "secret-value"
115+
vector env secret update <secret_id> [--key <key>] [--value <value>]
116+
vector env secret delete <secret_id>
117117
```
118118

119119
### Deployments
120120

121121
```bash
122-
vector deploy list <site_id> <env_name>
123-
vector deploy show <site_id> <env_name> <deploy_id>
124-
vector deploy trigger <site_id> <env_name>
125-
vector deploy rollback <site_id> <env_name> [--target-deployment-id <id>]
122+
vector deploy list <env_id>
123+
vector deploy show <deploy_id>
124+
vector deploy trigger <env_id>
125+
vector deploy rollback <env_id> [--target-deployment-id <id>]
126126
```
127127

128128
### SSL
129129

130130
```bash
131-
vector ssl status <site_id> <env_name>
132-
vector ssl nudge <site_id> <env_name> [--retry]
131+
vector ssl status <env_id>
132+
vector ssl nudge <env_id> [--retry]
133133
```
134134

135135
### Database

src/cli.rs

Lines changed: 22 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -260,10 +260,8 @@ pub enum EnvCommands {
260260
},
261261
/// Show environment details
262262
Show {
263-
/// Site ID
264-
site_id: String,
265-
/// Environment name
266-
env_name: String,
263+
/// Environment ID
264+
env_id: String,
267265
},
268266
/// Create a new environment
269267
Create {
@@ -287,10 +285,8 @@ pub enum EnvCommands {
287285
},
288286
/// Update an environment
289287
Update {
290-
/// Site ID
291-
site_id: String,
292-
/// Environment name
293-
env_name: String,
288+
/// Environment ID
289+
env_id: String,
294290
/// New environment name
295291
#[arg(long)]
296292
name: Option<String>,
@@ -303,17 +299,13 @@ pub enum EnvCommands {
303299
},
304300
/// Delete an environment
305301
Delete {
306-
/// Site ID
307-
site_id: String,
308-
/// Environment name
309-
env_name: String,
302+
/// Environment ID
303+
env_id: String,
310304
},
311305
/// Reset environment database password
312306
ResetDbPassword {
313-
/// Site ID
314-
site_id: String,
315-
/// Environment name
316-
env_name: String,
307+
/// Environment ID
308+
env_id: String,
317309
},
318310
/// Manage environment secrets
319311
Secret {
@@ -326,10 +318,8 @@ pub enum EnvCommands {
326318
pub enum EnvSecretCommands {
327319
/// List secrets for an environment
328320
List {
329-
/// Site ID
330-
site_id: String,
331-
/// Environment name
332-
env_name: String,
321+
/// Environment ID
322+
env_id: String,
333323
/// Page number
334324
#[arg(long, default_value = "1")]
335325
page: u32,
@@ -339,19 +329,13 @@ pub enum EnvSecretCommands {
339329
},
340330
/// Show secret details
341331
Show {
342-
/// Site ID
343-
site_id: String,
344-
/// Environment name
345-
env_name: String,
346332
/// Secret ID
347333
secret_id: String,
348334
},
349335
/// Create a secret
350336
Create {
351-
/// Site ID
352-
site_id: String,
353-
/// Environment name
354-
env_name: String,
337+
/// Environment ID
338+
env_id: String,
355339
/// Secret key
356340
#[arg(long)]
357341
key: String,
@@ -361,10 +345,6 @@ pub enum EnvSecretCommands {
361345
},
362346
/// Update a secret
363347
Update {
364-
/// Site ID
365-
site_id: String,
366-
/// Environment name
367-
env_name: String,
368348
/// Secret ID
369349
secret_id: String,
370350
/// Secret key
@@ -376,10 +356,6 @@ pub enum EnvSecretCommands {
376356
},
377357
/// Delete a secret
378358
Delete {
379-
/// Site ID
380-
site_id: String,
381-
/// Environment name
382-
env_name: String,
383359
/// Secret ID
384360
secret_id: String,
385361
},
@@ -389,10 +365,8 @@ pub enum EnvSecretCommands {
389365
pub enum DeployCommands {
390366
/// List deployments for an environment
391367
List {
392-
/// Site ID
393-
site_id: String,
394-
/// Environment name
395-
env_name: String,
368+
/// Environment ID
369+
env_id: String,
396370
/// Page number
397371
#[arg(long, default_value = "1")]
398372
page: u32,
@@ -402,26 +376,18 @@ pub enum DeployCommands {
402376
},
403377
/// Show deployment details
404378
Show {
405-
/// Site ID
406-
site_id: String,
407-
/// Environment name
408-
env_name: String,
409379
/// Deployment ID
410380
deploy_id: String,
411381
},
412382
/// Trigger a new deployment
413383
Trigger {
414-
/// Site ID
415-
site_id: String,
416-
/// Environment name
417-
env_name: String,
384+
/// Environment ID
385+
env_id: String,
418386
},
419387
/// Rollback to a previous deployment
420388
Rollback {
421-
/// Site ID
422-
site_id: String,
423-
/// Environment name
424-
env_name: String,
389+
/// Environment ID
390+
env_id: String,
425391
/// Target deployment ID to rollback to
426392
#[arg(long)]
427393
target_deployment_id: Option<String>,
@@ -432,17 +398,13 @@ pub enum DeployCommands {
432398
pub enum SslCommands {
433399
/// Check SSL status
434400
Status {
435-
/// Site ID
436-
site_id: String,
437-
/// Environment name
438-
env_name: String,
401+
/// Environment ID
402+
env_id: String,
439403
},
440404
/// Nudge SSL provisioning
441405
Nudge {
442-
/// Site ID
443-
site_id: String,
444-
/// Environment name
445-
env_name: String,
406+
/// Environment ID
407+
env_id: String,
446408
/// Retry from failed state
447409
#[arg(long)]
448410
retry: bool,

src/commands/account.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ pub fn secret_list(
353353
format: OutputFormat,
354354
) -> Result<(), ApiError> {
355355
let query = PaginationQuery { page, per_page };
356-
let response: Value = client.get_with_query("/api/v1/vector/secrets", &query)?;
356+
let response: Value = client.get_with_query("/api/v1/vector/global-secrets", &query)?;
357357

358358
if format == OutputFormat::Json {
359359
print_json(&response);
@@ -394,7 +394,7 @@ pub fn secret_show(
394394
secret_id: &str,
395395
format: OutputFormat,
396396
) -> Result<(), ApiError> {
397-
let response: Value = client.get(&format!("/api/v1/vector/secrets/{}", secret_id))?;
397+
let response: Value = client.get(&format!("/api/v1/vector/global-secrets/{}", secret_id))?;
398398

399399
if format == OutputFormat::Json {
400400
print_json(&response);
@@ -430,7 +430,7 @@ pub fn secret_create(
430430
value: value.to_string(),
431431
};
432432

433-
let response: Value = client.post("/api/v1/vector/secrets", &body)?;
433+
let response: Value = client.post("/api/v1/vector/global-secrets", &body)?;
434434

435435
if format == OutputFormat::Json {
436436
print_json(&response);
@@ -456,7 +456,7 @@ pub fn secret_update(
456456
) -> Result<(), ApiError> {
457457
let body = UpdateSecretRequest { key, value };
458458

459-
let response: Value = client.put(&format!("/api/v1/vector/secrets/{}", secret_id), &body)?;
459+
let response: Value = client.put(&format!("/api/v1/vector/global-secrets/{}", secret_id), &body)?;
460460

461461
if format == OutputFormat::Json {
462462
print_json(&response);
@@ -472,7 +472,7 @@ pub fn secret_delete(
472472
secret_id: &str,
473473
format: OutputFormat,
474474
) -> Result<(), ApiError> {
475-
let response: Value = client.delete(&format!("/api/v1/vector/secrets/{}", secret_id))?;
475+
let response: Value = client.delete(&format!("/api/v1/vector/global-secrets/{}", secret_id))?;
476476

477477
if format == OutputFormat::Json {
478478
print_json(&response);

src/commands/deploy.rs

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,14 @@ struct RollbackRequest {
2121

2222
pub fn list(
2323
client: &ApiClient,
24-
site_id: &str,
25-
env_name: &str,
24+
env_id: &str,
2625
page: u32,
2726
per_page: u32,
2827
format: OutputFormat,
2928
) -> Result<(), ApiError> {
3029
let query = PaginationQuery { page, per_page };
3130
let response: Value = client.get_with_query(
32-
&format!(
33-
"/api/v1/vector/sites/{}/environments/{}/deployments",
34-
site_id, env_name
35-
),
31+
&format!("/api/v1/vector/environments/{}/deployments", env_id),
3632
&query,
3733
)?;
3834

@@ -73,15 +69,10 @@ pub fn list(
7369

7470
pub fn show(
7571
client: &ApiClient,
76-
site_id: &str,
77-
env_name: &str,
7872
deploy_id: &str,
7973
format: OutputFormat,
8074
) -> Result<(), ApiError> {
81-
let response: Value = client.get(&format!(
82-
"/api/v1/vector/sites/{}/environments/{}/deployments/{}",
83-
site_id, env_name, deploy_id
84-
))?;
75+
let response: Value = client.get(&format!("/api/v1/vector/deployments/{}", deploy_id))?;
8576

8677
if format == OutputFormat::Json {
8778
print_json(&response);
@@ -127,13 +118,12 @@ pub fn show(
127118

128119
pub fn trigger(
129120
client: &ApiClient,
130-
site_id: &str,
131-
env_name: &str,
121+
env_id: &str,
132122
format: OutputFormat,
133123
) -> Result<(), ApiError> {
134124
let response: Value = client.post_empty(&format!(
135-
"/api/v1/vector/sites/{}/environments/{}/deployments",
136-
site_id, env_name
125+
"/api/v1/vector/environments/{}/deployments",
126+
env_id
137127
))?;
138128

139129
if format == OutputFormat::Json {
@@ -153,8 +143,7 @@ pub fn trigger(
153143

154144
pub fn rollback(
155145
client: &ApiClient,
156-
site_id: &str,
157-
env_name: &str,
146+
env_id: &str,
158147
target_deployment_id: Option<String>,
159148
format: OutputFormat,
160149
) -> Result<(), ApiError> {
@@ -163,10 +152,7 @@ pub fn rollback(
163152
};
164153

165154
let response: Value = client.post(
166-
&format!(
167-
"/api/v1/vector/sites/{}/environments/{}/rollback",
168-
site_id, env_name
169-
),
155+
&format!("/api/v1/vector/environments/{}/rollback", env_id),
170156
&body,
171157
)?;
172158

0 commit comments

Comments
 (0)