@@ -65,6 +65,19 @@ export class Nodes extends APIResource {
6565 return this . _client . get ( path `/v1/nodes/${ id } ` , options ) ;
6666 }
6767
68+ /**
69+ * Redeploy a node by replacing its current VM with a new one. Optionally update
70+ * the VM image and cloud init user data.
71+ *
72+ * @example
73+ * ```ts
74+ * const node = await client.nodes.redeploy('id');
75+ * ```
76+ */
77+ redeploy ( id : string , body : NodeRedeployParams , options ?: RequestOptions ) : APIPromise < Node > {
78+ return this . _client . put ( path `/v1/nodes/${ id } /redeploy` , { body, ...options } ) ;
79+ }
80+
6881 /**
6982 * Release an auto reserved VM node from its procurement, reducing the
7083 * procurement's desired quantity by 1
@@ -480,6 +493,28 @@ export interface NodeExtendParams {
480493 max_price_per_node_hour : number ;
481494}
482495
496+ export interface NodeRedeployParams {
497+ /**
498+ * Update the cloud init user data for VMs running on this node
499+ */
500+ cloud_init_user_data ?: Array < number > ;
501+
502+ /**
503+ * Redeploy node with this VM image ID
504+ */
505+ image_id ?: string ;
506+
507+ /**
508+ * If false, then the new VM will inherit any configuration (like image_id,
509+ * cloud_init_user_data) that is left empty in this request from the current VM.
510+ *
511+ * If true, then any configuration left empty will be set as empty in the new VM.
512+ * E.g if cloud_init_user_data is left unset and override_empty is true, then the
513+ * new VM will not have any cloud init user data. override_empty defaults to false.
514+ */
515+ override_empty ?: boolean ;
516+ }
517+
483518export declare namespace Nodes {
484519 export {
485520 type AcceleratorType as AcceleratorType ,
@@ -496,5 +531,6 @@ export declare namespace Nodes {
496531 type NodeCreateParams as NodeCreateParams ,
497532 type NodeListParams as NodeListParams ,
498533 type NodeExtendParams as NodeExtendParams ,
534+ type NodeRedeployParams as NodeRedeployParams ,
499535 } ;
500536}
0 commit comments