@@ -2,43 +2,43 @@ import { cliffy } from "../../../deps.ts";
2
2
import { Command } from "../../../util/command.ts" ;
3
3
import { parseAuth } from "../../../util/auth.ts" ;
4
4
import { http } from "../../../util/http.ts" ;
5
- import type { Cluster } from "./types.ts" ;
5
+ // import type { Cluster } from "./types.ts";
6
6
7
7
export const renameCmd = new Command ( )
8
8
. name ( "rename" )
9
9
. description ( "Rename a kafka cluster" )
10
- . option ( "--id=<string>" , "The id of your cluster" )
11
- . option ( "--name=<string>" , "The name of your cluster" )
10
+ . option ( "--id=<string>" , "The id of your cluster" , { required : true } )
11
+ . option ( "--name=<string>" , "The name of your cluster" , { required : true } )
12
12
. example (
13
13
"Rename" ,
14
- `upstash kafka cluster rename ${ crypto . randomUUID ( ) } new-name` ,
14
+ `upstash kafka cluster rename f860e7e2-27b8-4166-90d5-ea41e90b4809 new-name` ,
15
15
)
16
16
. action ( async ( options ) : Promise < void > => {
17
17
const authorization = await parseAuth ( options ) ;
18
18
19
- if ( ! options . id ) {
20
- if ( options . ci ) {
21
- throw new cliffy . ValidationError ( "id" ) ;
22
- }
23
- const clusters = await http . request < Cluster [ ] > ( {
24
- method : "GET" ,
25
- authorization,
26
- path : [ "v2" , "kafka" , "clusters" ] ,
27
- } ) ;
28
- options . id = await cliffy . Select . prompt ( {
29
- message : "Select a cluster to rename" ,
30
- options : clusters . map ( ( c ) => ( {
31
- name : c . name ,
32
- value : c . cluster_id ,
33
- } ) ) ,
34
- } ) ;
35
- }
19
+ // if (!options.id) {
20
+ // if (options.ci) {
21
+ // throw new cliffy.ValidationError("id");
22
+ // }
23
+ // const clusters = await http.request<Cluster[]>({
24
+ // method: "GET",
25
+ // authorization,
26
+ // path: ["v2", "kafka", "clusters"],
27
+ // });
28
+ // options.id = await cliffy.Select.prompt({
29
+ // message: "Select a cluster to rename",
30
+ // options: clusters.map((c) => ({
31
+ // name: c.name,
32
+ // value: c.cluster_id,
33
+ // })),
34
+ // });
35
+ // }
36
36
37
- if ( ! options . name ) {
38
- options . name = await cliffy . Input . prompt ( {
39
- message : "Choose a new name" ,
40
- } ) ;
41
- }
37
+ // if (!options.name) {
38
+ // options.name = await cliffy.Input.prompt({
39
+ // message: "Choose a new name",
40
+ // });
41
+ // }
42
42
const db = await http . request < Response > ( {
43
43
method : "POST" ,
44
44
authorization,
0 commit comments