@@ -31,11 +31,15 @@ import {
3131 marshalSetSecurityGroupRulesRequest ,
3232 marshalSetServerRequest ,
3333 marshalSetSnapshotRequest ,
34+ marshalUpdateImageRequest ,
3435 marshalUpdateIpRequest ,
3536 marshalUpdatePlacementGroupRequest ,
3637 marshalUpdatePlacementGroupServersRequest ,
3738 marshalUpdatePrivateNICRequest ,
39+ marshalUpdateSecurityGroupRequest ,
40+ marshalUpdateSecurityGroupRuleRequest ,
3841 marshalUpdateServerRequest ,
42+ marshalUpdateSnapshotRequest ,
3943 marshalUpdateVolumeRequest ,
4044 unmarshalAttachServerVolumeResponse ,
4145 unmarshalCreateImageResponse ,
@@ -87,10 +91,14 @@ import {
8791 unmarshalSetSecurityGroupRulesResponse ,
8892 unmarshalSetServerResponse ,
8993 unmarshalSetSnapshotResponse ,
94+ unmarshalUpdateImageResponse ,
9095 unmarshalUpdateIpResponse ,
9196 unmarshalUpdatePlacementGroupResponse ,
9297 unmarshalUpdatePlacementGroupServersResponse ,
98+ unmarshalUpdateSecurityGroupResponse ,
99+ unmarshalUpdateSecurityGroupRuleResponse ,
93100 unmarshalUpdateServerResponse ,
101+ unmarshalUpdateSnapshotResponse ,
94102 unmarshalUpdateVolumeResponse ,
95103} from './marshalling.gen'
96104import type {
@@ -196,15 +204,23 @@ import type {
196204 SetPlacementGroupServersResponse ,
197205 SetSecurityGroupRulesRequest ,
198206 SetSecurityGroupRulesResponse ,
207+ UpdateImageRequest ,
208+ UpdateImageResponse ,
199209 UpdateIpRequest ,
200210 UpdateIpResponse ,
201211 UpdatePlacementGroupRequest ,
202212 UpdatePlacementGroupResponse ,
203213 UpdatePlacementGroupServersRequest ,
204214 UpdatePlacementGroupServersResponse ,
205215 UpdatePrivateNICRequest ,
216+ UpdateSecurityGroupRequest ,
217+ UpdateSecurityGroupResponse ,
218+ UpdateSecurityGroupRuleRequest ,
219+ UpdateSecurityGroupRuleResponse ,
206220 UpdateServerRequest ,
207221 UpdateServerResponse ,
222+ UpdateSnapshotRequest ,
223+ UpdateSnapshotResponse ,
208224 UpdateVolumeRequest ,
209225 UpdateVolumeResponse ,
210226} from './types.gen'
@@ -534,12 +550,6 @@ export class API extends ParentAPI {
534550 ) } /user_data/${ validatePathParam ( 'key' , request . key ) } `,
535551 } )
536552
537- /**
538- * Attach a volume to a server.
539- *
540- * @param request - The request {@link AttachServerVolumeRequest}
541- * @returns A Promise of AttachServerVolumeResponse
542- */
543553 attachServerVolume = ( request : Readonly < AttachServerVolumeRequest > ) =>
544554 this . client . fetch < AttachServerVolumeResponse > (
545555 {
@@ -559,12 +569,6 @@ export class API extends ParentAPI {
559569 unmarshalAttachServerVolumeResponse ,
560570 )
561571
562- /**
563- * Detach a volume from a server.
564- *
565- * @param request - The request {@link DetachServerVolumeRequest}
566- * @returns A Promise of DetachServerVolumeResponse
567- */
568572 detachServerVolume = ( request : Readonly < DetachServerVolumeRequest > ) =>
569573 this . client . fetch < DetachServerVolumeResponse > (
570574 {
@@ -672,6 +676,28 @@ export class API extends ParentAPI {
672676 unmarshalSetImageResponse ,
673677 )
674678
679+ /**
680+ * Update image. Update the properties of an image.
681+ *
682+ * @param request - The request {@link UpdateImageRequest}
683+ * @returns A Promise of UpdateImageResponse
684+ */
685+ updateImage = ( request : Readonly < UpdateImageRequest > ) =>
686+ this . client . fetch < UpdateImageResponse > (
687+ {
688+ body : JSON . stringify (
689+ marshalUpdateImageRequest ( request , this . client . settings ) ,
690+ ) ,
691+ headers : jsonContentHeaders ,
692+ method : 'PATCH' ,
693+ path : `/instance/v1/zones/${ validatePathParam (
694+ 'zone' ,
695+ request . zone ?? this . client . settings . defaultZone ,
696+ ) } /images/${ validatePathParam ( 'imageId' , request . imageId ) } `,
697+ } ,
698+ unmarshalUpdateImageResponse ,
699+ )
700+
675701 /**
676702 * Delete an Instance image. Delete the image with the specified ID.
677703 *
@@ -777,6 +803,28 @@ export class API extends ParentAPI {
777803 unmarshalSetSnapshotResponse ,
778804 )
779805
806+ /**
807+ * Update a snapshot. Update the properties of a snapshot.
808+ *
809+ * @param request - The request {@link UpdateSnapshotRequest}
810+ * @returns A Promise of UpdateSnapshotResponse
811+ */
812+ updateSnapshot = ( request : Readonly < UpdateSnapshotRequest > ) =>
813+ this . client . fetch < UpdateSnapshotResponse > (
814+ {
815+ body : JSON . stringify (
816+ marshalUpdateSnapshotRequest ( request , this . client . settings ) ,
817+ ) ,
818+ headers : jsonContentHeaders ,
819+ method : 'PATCH' ,
820+ path : `/instance/v1/zones/${ validatePathParam (
821+ 'zone' ,
822+ request . zone ?? this . client . settings . defaultZone ,
823+ ) } /snapshots/${ validatePathParam ( 'snapshotId' , request . snapshotId ) } `,
824+ } ,
825+ unmarshalUpdateSnapshotResponse ,
826+ )
827+
780828 /**
781829 * Delete a snapshot. Delete the snapshot with the specified ID.
782830 *
@@ -1051,6 +1099,31 @@ export class API extends ParentAPI {
10511099 unmarshalSetSecurityGroupResponse ,
10521100 )
10531101
1102+ /**
1103+ * Update a security group. Update the properties of security group.
1104+ *
1105+ * @param request - The request {@link UpdateSecurityGroupRequest}
1106+ * @returns A Promise of UpdateSecurityGroupResponse
1107+ */
1108+ updateSecurityGroup = ( request : Readonly < UpdateSecurityGroupRequest > ) =>
1109+ this . client . fetch < UpdateSecurityGroupResponse > (
1110+ {
1111+ body : JSON . stringify (
1112+ marshalUpdateSecurityGroupRequest ( request , this . client . settings ) ,
1113+ ) ,
1114+ headers : jsonContentHeaders ,
1115+ method : 'PATCH' ,
1116+ path : `/instance/v1/zones/${ validatePathParam (
1117+ 'zone' ,
1118+ request . zone ?? this . client . settings . defaultZone ,
1119+ ) } /security_groups/${ validatePathParam (
1120+ 'securityGroupId' ,
1121+ request . securityGroupId ,
1122+ ) } `,
1123+ } ,
1124+ unmarshalUpdateSecurityGroupResponse ,
1125+ )
1126+
10541127 /**
10551128 * Get default rules. Lists the default rules applied to all the security
10561129 * groups.
@@ -1227,6 +1300,37 @@ export class API extends ParentAPI {
12271300 unmarshalSetSecurityGroupRuleResponse ,
12281301 )
12291302
1303+ /**
1304+ * Update security group rule. Update the properties of a rule from a
1305+ * specified security group.
1306+ *
1307+ * @param request - The request {@link UpdateSecurityGroupRuleRequest}
1308+ * @returns A Promise of UpdateSecurityGroupRuleResponse
1309+ */
1310+ updateSecurityGroupRule = (
1311+ request : Readonly < UpdateSecurityGroupRuleRequest > ,
1312+ ) =>
1313+ this . client . fetch < UpdateSecurityGroupRuleResponse > (
1314+ {
1315+ body : JSON . stringify (
1316+ marshalUpdateSecurityGroupRuleRequest ( request , this . client . settings ) ,
1317+ ) ,
1318+ headers : jsonContentHeaders ,
1319+ method : 'PATCH' ,
1320+ path : `/instance/v1/zones/${ validatePathParam (
1321+ 'zone' ,
1322+ request . zone ?? this . client . settings . defaultZone ,
1323+ ) } /security_groups/${ validatePathParam (
1324+ 'securityGroupId' ,
1325+ request . securityGroupId ,
1326+ ) } /rules/${ validatePathParam (
1327+ 'securityGroupRuleId' ,
1328+ request . securityGroupRuleId ,
1329+ ) } `,
1330+ } ,
1331+ unmarshalUpdateSecurityGroupRuleResponse ,
1332+ )
1333+
12301334 protected pageOfListPlacementGroups = (
12311335 request : Readonly < ListPlacementGroupsRequest > = { } ,
12321336 ) =>
0 commit comments