@leaflow/sdk 0.0.0-dev.410.gb8719fe → 0.0.0-dev.415.gb9e4b83

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.
Files changed (837) hide show
  1. package/dist/compute/v2/generated/functions.d.ts +2819 -0
  2. package/dist/compute/v2/generated/functions.js +3040 -0
  3. package/dist/compute/v2/generated/models.d.ts +3548 -0
  4. package/dist/compute/v2/generated/models.js +438 -0
  5. package/dist/compute/v2/generated/schemas.zod.d.ts +2088 -0
  6. package/dist/compute/v2/generated/schemas.zod.js +2532 -0
  7. package/dist/compute/v2/generated/validators/associateElasticIPRequestBody.zod.d.ts +42 -0
  8. package/dist/compute/v2/generated/validators/associateElasticIPRequestBody.zod.js +40 -0
  9. package/dist/compute/v2/generated/validators/attachNetworkInterfaceRequestBody.zod.d.ts +40 -0
  10. package/dist/compute/v2/generated/validators/attachNetworkInterfaceRequestBody.zod.js +39 -0
  11. package/dist/compute/v2/generated/validators/attachVolumeRequestBody.zod.d.ts +40 -0
  12. package/dist/compute/v2/generated/validators/attachVolumeRequestBody.zod.js +39 -0
  13. package/dist/compute/v2/generated/validators/availabilityZoneID.zod.d.ts +41 -0
  14. package/dist/compute/v2/generated/validators/availabilityZoneID.zod.js +44 -0
  15. package/dist/compute/v2/generated/validators/availabilityZoneListResponseBody.zod.d.ts +50 -0
  16. package/dist/compute/v2/generated/validators/availabilityZoneListResponseBody.zod.js +41 -0
  17. package/dist/compute/v2/generated/validators/availabilityZoneResource.zod.d.ts +43 -0
  18. package/dist/compute/v2/generated/validators/availabilityZoneResource.zod.js +47 -0
  19. package/dist/compute/v2/generated/validators/billingCancellation.zod.d.ts +45 -0
  20. package/dist/compute/v2/generated/validators/billingCancellation.zod.js +46 -0
  21. package/dist/compute/v2/generated/validators/billingChoice.zod.d.ts +54 -0
  22. package/dist/compute/v2/generated/validators/billingChoice.zod.js +46 -0
  23. package/dist/compute/v2/generated/validators/billingComponent.zod.d.ts +64 -0
  24. package/dist/compute/v2/generated/validators/billingComponent.zod.js +49 -0
  25. package/dist/compute/v2/generated/validators/billingLineQuantity.zod.d.ts +42 -0
  26. package/dist/compute/v2/generated/validators/billingLineQuantity.zod.js +38 -0
  27. package/dist/compute/v2/generated/validators/billingMeter.zod.d.ts +48 -0
  28. package/dist/compute/v2/generated/validators/billingMeter.zod.js +46 -0
  29. package/dist/compute/v2/generated/validators/billingPeriod.zod.d.ts +45 -0
  30. package/dist/compute/v2/generated/validators/billingPeriod.zod.js +40 -0
  31. package/dist/compute/v2/generated/validators/billingQuantity.zod.d.ts +49 -0
  32. package/dist/compute/v2/generated/validators/billingQuantity.zod.js +42 -0
  33. package/dist/compute/v2/generated/validators/bootVolume.zod.d.ts +72 -0
  34. package/dist/compute/v2/generated/validators/bootVolume.zod.js +40 -0
  35. package/dist/compute/v2/generated/validators/cancellationMode.zod.d.ts +41 -0
  36. package/dist/compute/v2/generated/validators/cancellationMode.zod.js +38 -0
  37. package/dist/compute/v2/generated/validators/checkoutMode.zod.d.ts +41 -0
  38. package/dist/compute/v2/generated/validators/checkoutMode.zod.js +38 -0
  39. package/dist/compute/v2/generated/validators/checkoutOptions.zod.d.ts +48 -0
  40. package/dist/compute/v2/generated/validators/checkoutOptions.zod.js +53 -0
  41. package/dist/compute/v2/generated/validators/consoleResponseBody.zod.d.ts +40 -0
  42. package/dist/compute/v2/generated/validators/consoleResponseBody.zod.js +40 -0
  43. package/dist/compute/v2/generated/validators/createElasticIPRequestBody.zod.d.ts +72 -0
  44. package/dist/compute/v2/generated/validators/createElasticIPRequestBody.zod.js +53 -0
  45. package/dist/compute/v2/generated/validators/createElasticIPResponseBody.zod.d.ts +138 -0
  46. package/dist/compute/v2/generated/validators/createElasticIPResponseBody.zod.js +48 -0
  47. package/dist/compute/v2/generated/validators/createInstanceRequestBody.zod.d.ts +196 -0
  48. package/dist/compute/v2/generated/validators/createInstanceRequestBody.zod.js +81 -0
  49. package/dist/compute/v2/generated/validators/createInstanceResponseBody.zod.d.ts +160 -0
  50. package/dist/compute/v2/generated/validators/createInstanceResponseBody.zod.js +57 -0
  51. package/dist/compute/v2/generated/validators/createLaunchTemplateRequestBody.zod.d.ts +79 -0
  52. package/dist/compute/v2/generated/validators/createLaunchTemplateRequestBody.zod.js +45 -0
  53. package/dist/compute/v2/generated/validators/createLaunchTemplateResponseBody.zod.d.ts +87 -0
  54. package/dist/compute/v2/generated/validators/createLaunchTemplateResponseBody.zod.js +41 -0
  55. package/dist/compute/v2/generated/validators/createNetworkInterfaceAddressRequestBody.zod.d.ts +41 -0
  56. package/dist/compute/v2/generated/validators/createNetworkInterfaceAddressRequestBody.zod.js +43 -0
  57. package/dist/compute/v2/generated/validators/createNetworkInterfaceRequestBody.zod.d.ts +45 -0
  58. package/dist/compute/v2/generated/validators/createNetworkInterfaceRequestBody.zod.js +53 -0
  59. package/dist/compute/v2/generated/validators/createPrivateImageRequestBody.zod.d.ts +50 -0
  60. package/dist/compute/v2/generated/validators/createPrivateImageRequestBody.zod.js +45 -0
  61. package/dist/compute/v2/generated/validators/createPrivateImageResponseBody.zod.d.ts +120 -0
  62. package/dist/compute/v2/generated/validators/createPrivateImageResponseBody.zod.js +48 -0
  63. package/dist/compute/v2/generated/validators/createSecurityGroupRequestBody.zod.d.ts +44 -0
  64. package/dist/compute/v2/generated/validators/createSecurityGroupRequestBody.zod.js +43 -0
  65. package/dist/compute/v2/generated/validators/createSecurityGroupRuleRequestBody.zod.d.ts +52 -0
  66. package/dist/compute/v2/generated/validators/createSecurityGroupRuleRequestBody.zod.js +62 -0
  67. package/dist/compute/v2/generated/validators/createVirtualPrivateCloudPeeringRequestBody.zod.d.ts +44 -0
  68. package/dist/compute/v2/generated/validators/createVirtualPrivateCloudPeeringRequestBody.zod.js +43 -0
  69. package/dist/compute/v2/generated/validators/createVirtualPrivateCloudRequestBody.zod.d.ts +44 -0
  70. package/dist/compute/v2/generated/validators/createVirtualPrivateCloudRequestBody.zod.js +47 -0
  71. package/dist/compute/v2/generated/validators/createVirtualPrivateCloudRouteRequestBody.zod.d.ts +45 -0
  72. package/dist/compute/v2/generated/validators/createVirtualPrivateCloudRouteRequestBody.zod.js +51 -0
  73. package/dist/compute/v2/generated/validators/createVirtualPrivateCloudSubnetRequestBody.zod.d.ts +43 -0
  74. package/dist/compute/v2/generated/validators/createVirtualPrivateCloudSubnetRequestBody.zod.js +45 -0
  75. package/dist/compute/v2/generated/validators/createVolumeBackupRequestBody.zod.d.ts +50 -0
  76. package/dist/compute/v2/generated/validators/createVolumeBackupRequestBody.zod.js +43 -0
  77. package/dist/compute/v2/generated/validators/createVolumeBackupResponseBody.zod.d.ts +112 -0
  78. package/dist/compute/v2/generated/validators/createVolumeBackupResponseBody.zod.js +48 -0
  79. package/dist/compute/v2/generated/validators/createVolumeRequestBody.zod.d.ts +70 -0
  80. package/dist/compute/v2/generated/validators/createVolumeRequestBody.zod.js +54 -0
  81. package/dist/compute/v2/generated/validators/createVolumeResponseBody.zod.d.ts +149 -0
  82. package/dist/compute/v2/generated/validators/createVolumeResponseBody.zod.js +48 -0
  83. package/dist/compute/v2/generated/validators/createVolumeSnapshotRequestBody.zod.d.ts +50 -0
  84. package/dist/compute/v2/generated/validators/createVolumeSnapshotRequestBody.zod.js +45 -0
  85. package/dist/compute/v2/generated/validators/createVolumeSnapshotResponseBody.zod.d.ts +111 -0
  86. package/dist/compute/v2/generated/validators/createVolumeSnapshotResponseBody.zod.js +48 -0
  87. package/dist/compute/v2/generated/validators/cursorPagination.zod.d.ts +41 -0
  88. package/dist/compute/v2/generated/validators/cursorPagination.zod.js +41 -0
  89. package/dist/compute/v2/generated/validators/deleteElasticIPResponseBody.zod.d.ts +144 -0
  90. package/dist/compute/v2/generated/validators/deleteElasticIPResponseBody.zod.js +45 -0
  91. package/dist/compute/v2/generated/validators/deleteElasticIpParams.zod.d.ts +43 -0
  92. package/dist/compute/v2/generated/validators/deleteElasticIpParams.zod.js +41 -0
  93. package/dist/compute/v2/generated/validators/deleteInstanceParams.zod.d.ts +43 -0
  94. package/dist/compute/v2/generated/validators/deleteInstanceParams.zod.js +41 -0
  95. package/dist/compute/v2/generated/validators/deleteInstanceResponseBody.zod.d.ts +164 -0
  96. package/dist/compute/v2/generated/validators/deleteInstanceResponseBody.zod.js +45 -0
  97. package/dist/compute/v2/generated/validators/deletePrivateImageParams.zod.d.ts +43 -0
  98. package/dist/compute/v2/generated/validators/deletePrivateImageParams.zod.js +41 -0
  99. package/dist/compute/v2/generated/validators/deletePrivateImageResponseBody.zod.d.ts +126 -0
  100. package/dist/compute/v2/generated/validators/deletePrivateImageResponseBody.zod.js +45 -0
  101. package/dist/compute/v2/generated/validators/deleteVolumeBackupParams.zod.d.ts +43 -0
  102. package/dist/compute/v2/generated/validators/deleteVolumeBackupParams.zod.js +41 -0
  103. package/dist/compute/v2/generated/validators/deleteVolumeBackupResponseBody.zod.d.ts +118 -0
  104. package/dist/compute/v2/generated/validators/deleteVolumeBackupResponseBody.zod.js +45 -0
  105. package/dist/compute/v2/generated/validators/deleteVolumeParams.zod.d.ts +43 -0
  106. package/dist/compute/v2/generated/validators/deleteVolumeParams.zod.js +41 -0
  107. package/dist/compute/v2/generated/validators/deleteVolumeResponseBody.zod.d.ts +155 -0
  108. package/dist/compute/v2/generated/validators/deleteVolumeResponseBody.zod.js +45 -0
  109. package/dist/compute/v2/generated/validators/deleteVolumeSnapshotParams.zod.d.ts +43 -0
  110. package/dist/compute/v2/generated/validators/deleteVolumeSnapshotParams.zod.js +41 -0
  111. package/dist/compute/v2/generated/validators/deleteVolumeSnapshotResponseBody.zod.d.ts +117 -0
  112. package/dist/compute/v2/generated/validators/deleteVolumeSnapshotResponseBody.zod.js +45 -0
  113. package/dist/compute/v2/generated/validators/elasticIP.zod.d.ts +134 -0
  114. package/dist/compute/v2/generated/validators/elasticIP.zod.js +115 -0
  115. package/dist/compute/v2/generated/validators/elasticIPAssociation.zod.d.ts +51 -0
  116. package/dist/compute/v2/generated/validators/elasticIPAssociation.zod.js +50 -0
  117. package/dist/compute/v2/generated/validators/elasticIPAssociationID.zod.d.ts +41 -0
  118. package/dist/compute/v2/generated/validators/elasticIPAssociationID.zod.js +44 -0
  119. package/dist/compute/v2/generated/validators/elasticIPID.zod.d.ts +41 -0
  120. package/dist/compute/v2/generated/validators/elasticIPID.zod.js +44 -0
  121. package/dist/compute/v2/generated/validators/elasticIPLine.zod.d.ts +112 -0
  122. package/dist/compute/v2/generated/validators/elasticIPLine.zod.js +65 -0
  123. package/dist/compute/v2/generated/validators/elasticIPLineID.zod.d.ts +41 -0
  124. package/dist/compute/v2/generated/validators/elasticIPLineID.zod.js +44 -0
  125. package/dist/compute/v2/generated/validators/elasticIPLineListResponseBody.zod.d.ts +116 -0
  126. package/dist/compute/v2/generated/validators/elasticIPLineListResponseBody.zod.js +41 -0
  127. package/dist/compute/v2/generated/validators/elasticIPListResponseBody.zod.d.ts +141 -0
  128. package/dist/compute/v2/generated/validators/elasticIPListResponseBody.zod.js +41 -0
  129. package/dist/compute/v2/generated/validators/elasticIPOperation.zod.d.ts +50 -0
  130. package/dist/compute/v2/generated/validators/elasticIPOperation.zod.js +50 -0
  131. package/dist/compute/v2/generated/validators/elasticIPReleaseResource.zod.d.ts +44 -0
  132. package/dist/compute/v2/generated/validators/elasticIPReleaseResource.zod.js +43 -0
  133. package/dist/compute/v2/generated/validators/error.zod.d.ts +43 -0
  134. package/dist/compute/v2/generated/validators/error.zod.js +44 -0
  135. package/dist/compute/v2/generated/validators/existingBootVolume.zod.d.ts +45 -0
  136. package/dist/compute/v2/generated/validators/existingBootVolume.zod.js +46 -0
  137. package/dist/compute/v2/generated/validators/existingElasticIP.zod.d.ts +43 -0
  138. package/dist/compute/v2/generated/validators/existingElasticIP.zod.js +40 -0
  139. package/dist/compute/v2/generated/validators/existingPrimaryNetworkInterface.zod.d.ts +43 -0
  140. package/dist/compute/v2/generated/validators/existingPrimaryNetworkInterface.zod.js +40 -0
  141. package/dist/compute/v2/generated/validators/freeSubnetCidr.zod.d.ts +41 -0
  142. package/dist/compute/v2/generated/validators/freeSubnetCidr.zod.js +39 -0
  143. package/dist/compute/v2/generated/validators/generatedPassword.zod.d.ts +42 -0
  144. package/dist/compute/v2/generated/validators/generatedPassword.zod.js +38 -0
  145. package/dist/compute/v2/generated/validators/getVirtualPrivateCloudFreeSubnetCidrParams.zod.d.ts +43 -0
  146. package/dist/compute/v2/generated/validators/getVirtualPrivateCloudFreeSubnetCidrParams.zod.js +45 -0
  147. package/dist/compute/v2/generated/validators/iPv4HostAddress.zod.d.ts +41 -0
  148. package/dist/compute/v2/generated/validators/iPv4HostAddress.zod.js +43 -0
  149. package/dist/compute/v2/generated/validators/imageID.zod.d.ts +41 -0
  150. package/dist/compute/v2/generated/validators/imageID.zod.js +44 -0
  151. package/dist/compute/v2/generated/validators/instance.zod.d.ts +157 -0
  152. package/dist/compute/v2/generated/validators/instance.zod.js +149 -0
  153. package/dist/compute/v2/generated/validators/instanceAssociationTarget.zod.d.ts +40 -0
  154. package/dist/compute/v2/generated/validators/instanceAssociationTarget.zod.js +41 -0
  155. package/dist/compute/v2/generated/validators/instanceElasticIP.zod.d.ts +70 -0
  156. package/dist/compute/v2/generated/validators/instanceElasticIP.zod.js +40 -0
  157. package/dist/compute/v2/generated/validators/instanceFamily.zod.d.ts +57 -0
  158. package/dist/compute/v2/generated/validators/instanceFamily.zod.js +54 -0
  159. package/dist/compute/v2/generated/validators/instanceFamilyCategory.zod.d.ts +42 -0
  160. package/dist/compute/v2/generated/validators/instanceFamilyCategory.zod.js +38 -0
  161. package/dist/compute/v2/generated/validators/instanceFamilyID.zod.d.ts +41 -0
  162. package/dist/compute/v2/generated/validators/instanceFamilyID.zod.js +44 -0
  163. package/dist/compute/v2/generated/validators/instanceFamilyListResponseBody.zod.d.ts +64 -0
  164. package/dist/compute/v2/generated/validators/instanceFamilyListResponseBody.zod.js +41 -0
  165. package/dist/compute/v2/generated/validators/instanceID.zod.d.ts +41 -0
  166. package/dist/compute/v2/generated/validators/instanceID.zod.js +44 -0
  167. package/dist/compute/v2/generated/validators/instanceListResponseBody.zod.d.ts +161 -0
  168. package/dist/compute/v2/generated/validators/instanceListResponseBody.zod.js +41 -0
  169. package/dist/compute/v2/generated/validators/instanceNetworkInterfaceID.zod.d.ts +41 -0
  170. package/dist/compute/v2/generated/validators/instanceNetworkInterfaceID.zod.js +44 -0
  171. package/dist/compute/v2/generated/validators/instanceOperation.zod.d.ts +61 -0
  172. package/dist/compute/v2/generated/validators/instanceOperation.zod.js +63 -0
  173. package/dist/compute/v2/generated/validators/instanceReleaseResource.zod.d.ts +44 -0
  174. package/dist/compute/v2/generated/validators/instanceReleaseResource.zod.js +43 -0
  175. package/dist/compute/v2/generated/validators/instanceRestriction.zod.d.ts +49 -0
  176. package/dist/compute/v2/generated/validators/instanceRestriction.zod.js +60 -0
  177. package/dist/compute/v2/generated/validators/instanceType.zod.d.ts +80 -0
  178. package/dist/compute/v2/generated/validators/instanceType.zod.js +58 -0
  179. package/dist/compute/v2/generated/validators/instanceTypeID.zod.d.ts +41 -0
  180. package/dist/compute/v2/generated/validators/instanceTypeID.zod.js +44 -0
  181. package/dist/compute/v2/generated/validators/instanceTypeListResponseBody.zod.d.ts +87 -0
  182. package/dist/compute/v2/generated/validators/instanceTypeListResponseBody.zod.js +41 -0
  183. package/dist/compute/v2/generated/validators/instanceVolumeID.zod.d.ts +41 -0
  184. package/dist/compute/v2/generated/validators/instanceVolumeID.zod.js +44 -0
  185. package/dist/compute/v2/generated/validators/internetChargeType.zod.d.ts +41 -0
  186. package/dist/compute/v2/generated/validators/internetChargeType.zod.js +38 -0
  187. package/dist/compute/v2/generated/validators/launchTemplate.zod.d.ts +47 -0
  188. package/dist/compute/v2/generated/validators/launchTemplate.zod.js +47 -0
  189. package/dist/compute/v2/generated/validators/launchTemplateBootVolume.zod.d.ts +47 -0
  190. package/dist/compute/v2/generated/validators/launchTemplateBootVolume.zod.js +48 -0
  191. package/dist/compute/v2/generated/validators/launchTemplateDataVolume.zod.d.ts +46 -0
  192. package/dist/compute/v2/generated/validators/launchTemplateDataVolume.zod.js +46 -0
  193. package/dist/compute/v2/generated/validators/launchTemplateElasticIP.zod.d.ts +46 -0
  194. package/dist/compute/v2/generated/validators/launchTemplateElasticIP.zod.js +45 -0
  195. package/dist/compute/v2/generated/validators/launchTemplateID.zod.d.ts +41 -0
  196. package/dist/compute/v2/generated/validators/launchTemplateID.zod.js +44 -0
  197. package/dist/compute/v2/generated/validators/launchTemplateListResponseBody.zod.d.ts +54 -0
  198. package/dist/compute/v2/generated/validators/launchTemplateListResponseBody.zod.js +41 -0
  199. package/dist/compute/v2/generated/validators/launchTemplateNetworkInterface.zod.d.ts +42 -0
  200. package/dist/compute/v2/generated/validators/launchTemplateNetworkInterface.zod.js +47 -0
  201. package/dist/compute/v2/generated/validators/launchTemplateReference.zod.d.ts +41 -0
  202. package/dist/compute/v2/generated/validators/launchTemplateReference.zod.js +46 -0
  203. package/dist/compute/v2/generated/validators/launchTemplateVersion.zod.d.ts +75 -0
  204. package/dist/compute/v2/generated/validators/launchTemplateVersion.zod.js +57 -0
  205. package/dist/compute/v2/generated/validators/launchTemplateVersionListResponseBody.zod.d.ts +82 -0
  206. package/dist/compute/v2/generated/validators/launchTemplateVersionListResponseBody.zod.js +41 -0
  207. package/dist/compute/v2/generated/validators/listAvailabilityZonesParams.zod.d.ts +46 -0
  208. package/dist/compute/v2/generated/validators/listAvailabilityZonesParams.zod.js +53 -0
  209. package/dist/compute/v2/generated/validators/listElasticIpLinesParams.zod.d.ts +48 -0
  210. package/dist/compute/v2/generated/validators/listElasticIpLinesParams.zod.js +55 -0
  211. package/dist/compute/v2/generated/validators/listElasticIpTrafficUsageParams.zod.d.ts +52 -0
  212. package/dist/compute/v2/generated/validators/listElasticIpTrafficUsageParams.zod.js +55 -0
  213. package/dist/compute/v2/generated/validators/listElasticIpsParams.zod.d.ts +45 -0
  214. package/dist/compute/v2/generated/validators/listElasticIpsParams.zod.js +47 -0
  215. package/dist/compute/v2/generated/validators/listInstanceFamiliesParams.zod.d.ts +46 -0
  216. package/dist/compute/v2/generated/validators/listInstanceFamiliesParams.zod.js +53 -0
  217. package/dist/compute/v2/generated/validators/listInstanceNetworkInterfacesParams.zod.d.ts +45 -0
  218. package/dist/compute/v2/generated/validators/listInstanceNetworkInterfacesParams.zod.js +51 -0
  219. package/dist/compute/v2/generated/validators/listInstanceTypesParams.zod.d.ts +48 -0
  220. package/dist/compute/v2/generated/validators/listInstanceTypesParams.zod.js +57 -0
  221. package/dist/compute/v2/generated/validators/listInstanceVolumesParams.zod.d.ts +45 -0
  222. package/dist/compute/v2/generated/validators/listInstanceVolumesParams.zod.js +51 -0
  223. package/dist/compute/v2/generated/validators/listInstancesParams.zod.d.ts +47 -0
  224. package/dist/compute/v2/generated/validators/listInstancesParams.zod.js +53 -0
  225. package/dist/compute/v2/generated/validators/listLaunchTemplateVersionsParams.zod.d.ts +45 -0
  226. package/dist/compute/v2/generated/validators/listLaunchTemplateVersionsParams.zod.js +51 -0
  227. package/dist/compute/v2/generated/validators/listLaunchTemplatesParams.zod.d.ts +46 -0
  228. package/dist/compute/v2/generated/validators/listLaunchTemplatesParams.zod.js +53 -0
  229. package/dist/compute/v2/generated/validators/listNetworkInterfacesParams.zod.d.ts +45 -0
  230. package/dist/compute/v2/generated/validators/listNetworkInterfacesParams.zod.js +51 -0
  231. package/dist/compute/v2/generated/validators/listOperationLogsParams.zod.d.ts +47 -0
  232. package/dist/compute/v2/generated/validators/listOperationLogsParams.zod.js +57 -0
  233. package/dist/compute/v2/generated/validators/listPrivateImagesParams.zod.d.ts +46 -0
  234. package/dist/compute/v2/generated/validators/listPrivateImagesParams.zod.js +53 -0
  235. package/dist/compute/v2/generated/validators/listPublicImagesParams.zod.d.ts +46 -0
  236. package/dist/compute/v2/generated/validators/listPublicImagesParams.zod.js +53 -0
  237. package/dist/compute/v2/generated/validators/listQuotasParams.zod.d.ts +45 -0
  238. package/dist/compute/v2/generated/validators/listQuotasParams.zod.js +47 -0
  239. package/dist/compute/v2/generated/validators/listRegionsParams.zod.d.ts +45 -0
  240. package/dist/compute/v2/generated/validators/listRegionsParams.zod.js +47 -0
  241. package/dist/compute/v2/generated/validators/listSecurityGroupRulesParams.zod.d.ts +45 -0
  242. package/dist/compute/v2/generated/validators/listSecurityGroupRulesParams.zod.js +51 -0
  243. package/dist/compute/v2/generated/validators/listSecurityGroupsParams.zod.d.ts +47 -0
  244. package/dist/compute/v2/generated/validators/listSecurityGroupsParams.zod.js +55 -0
  245. package/dist/compute/v2/generated/validators/listVirtualPrivateCloudPeeringsParams.zod.d.ts +45 -0
  246. package/dist/compute/v2/generated/validators/listVirtualPrivateCloudPeeringsParams.zod.js +51 -0
  247. package/dist/compute/v2/generated/validators/listVirtualPrivateCloudRoutesParams.zod.d.ts +45 -0
  248. package/dist/compute/v2/generated/validators/listVirtualPrivateCloudRoutesParams.zod.js +51 -0
  249. package/dist/compute/v2/generated/validators/listVirtualPrivateCloudSubnetsParams.zod.d.ts +45 -0
  250. package/dist/compute/v2/generated/validators/listVirtualPrivateCloudSubnetsParams.zod.js +51 -0
  251. package/dist/compute/v2/generated/validators/listVirtualPrivateCloudsParams.zod.d.ts +46 -0
  252. package/dist/compute/v2/generated/validators/listVirtualPrivateCloudsParams.zod.js +53 -0
  253. package/dist/compute/v2/generated/validators/listVolumeBackupsParams.zod.d.ts +46 -0
  254. package/dist/compute/v2/generated/validators/listVolumeBackupsParams.zod.js +53 -0
  255. package/dist/compute/v2/generated/validators/listVolumeSnapshotsParams.zod.d.ts +46 -0
  256. package/dist/compute/v2/generated/validators/listVolumeSnapshotsParams.zod.js +53 -0
  257. package/dist/compute/v2/generated/validators/listVolumeTypesParams.zod.d.ts +47 -0
  258. package/dist/compute/v2/generated/validators/listVolumeTypesParams.zod.js +55 -0
  259. package/dist/compute/v2/generated/validators/listVolumesParams.zod.d.ts +47 -0
  260. package/dist/compute/v2/generated/validators/listVolumesParams.zod.js +51 -0
  261. package/dist/compute/v2/generated/validators/money.zod.d.ts +38 -0
  262. package/dist/compute/v2/generated/validators/money.zod.js +38 -0
  263. package/dist/compute/v2/generated/validators/networkInterface.zod.d.ts +100 -0
  264. package/dist/compute/v2/generated/validators/networkInterface.zod.js +62 -0
  265. package/dist/compute/v2/generated/validators/networkInterfaceAddress.zod.d.ts +54 -0
  266. package/dist/compute/v2/generated/validators/networkInterfaceAddress.zod.js +49 -0
  267. package/dist/compute/v2/generated/validators/networkInterfaceAddressAssociationTarget.zod.d.ts +40 -0
  268. package/dist/compute/v2/generated/validators/networkInterfaceAddressAssociationTarget.zod.js +41 -0
  269. package/dist/compute/v2/generated/validators/networkInterfaceAddressID.zod.d.ts +41 -0
  270. package/dist/compute/v2/generated/validators/networkInterfaceAddressID.zod.js +44 -0
  271. package/dist/compute/v2/generated/validators/networkInterfaceAttachment.zod.d.ts +58 -0
  272. package/dist/compute/v2/generated/validators/networkInterfaceAttachment.zod.js +51 -0
  273. package/dist/compute/v2/generated/validators/networkInterfaceAttachmentList.zod.d.ts +65 -0
  274. package/dist/compute/v2/generated/validators/networkInterfaceAttachmentList.zod.js +41 -0
  275. package/dist/compute/v2/generated/validators/networkInterfaceID.zod.d.ts +41 -0
  276. package/dist/compute/v2/generated/validators/networkInterfaceID.zod.js +44 -0
  277. package/dist/compute/v2/generated/validators/networkInterfaceListResponseBody.zod.d.ts +107 -0
  278. package/dist/compute/v2/generated/validators/networkInterfaceListResponseBody.zod.js +41 -0
  279. package/dist/compute/v2/generated/validators/networkInterfaceOperation.zod.d.ts +50 -0
  280. package/dist/compute/v2/generated/validators/networkInterfaceOperation.zod.js +52 -0
  281. package/dist/compute/v2/generated/validators/newBootVolume.zod.d.ts +67 -0
  282. package/dist/compute/v2/generated/validators/newBootVolume.zod.js +52 -0
  283. package/dist/compute/v2/generated/validators/newCompute.zod.d.ts +57 -0
  284. package/dist/compute/v2/generated/validators/newCompute.zod.js +43 -0
  285. package/dist/compute/v2/generated/validators/newDataVolume.zod.d.ts +63 -0
  286. package/dist/compute/v2/generated/validators/newDataVolume.zod.js +52 -0
  287. package/dist/compute/v2/generated/validators/newElasticIP.zod.d.ts +66 -0
  288. package/dist/compute/v2/generated/validators/newElasticIP.zod.js +52 -0
  289. package/dist/compute/v2/generated/validators/newLaunchTemplateVersion.zod.d.ts +76 -0
  290. package/dist/compute/v2/generated/validators/newLaunchTemplateVersion.zod.js +62 -0
  291. package/dist/compute/v2/generated/validators/newPrimaryNetworkInterface.zod.d.ts +45 -0
  292. package/dist/compute/v2/generated/validators/newPrimaryNetworkInterface.zod.js +47 -0
  293. package/dist/compute/v2/generated/validators/offsetPagination.zod.d.ts +43 -0
  294. package/dist/compute/v2/generated/validators/offsetPagination.zod.js +43 -0
  295. package/dist/compute/v2/generated/validators/operationLogID.zod.d.ts +41 -0
  296. package/dist/compute/v2/generated/validators/operationLogID.zod.js +44 -0
  297. package/dist/compute/v2/generated/validators/operationLogListResponseBody.zod.d.ts +65 -0
  298. package/dist/compute/v2/generated/validators/operationLogListResponseBody.zod.js +41 -0
  299. package/dist/compute/v2/generated/validators/operationLogResource.zod.d.ts +58 -0
  300. package/dist/compute/v2/generated/validators/operationLogResource.zod.js +68 -0
  301. package/dist/compute/v2/generated/validators/passwordChoice.zod.d.ts +47 -0
  302. package/dist/compute/v2/generated/validators/passwordChoice.zod.js +40 -0
  303. package/dist/compute/v2/generated/validators/performanceFormula.zod.d.ts +43 -0
  304. package/dist/compute/v2/generated/validators/performanceFormula.zod.js +43 -0
  305. package/dist/compute/v2/generated/validators/primaryNetworkInterface.zod.d.ts +49 -0
  306. package/dist/compute/v2/generated/validators/primaryNetworkInterface.zod.js +40 -0
  307. package/dist/compute/v2/generated/validators/privateImageListResponseBody.zod.d.ts +123 -0
  308. package/dist/compute/v2/generated/validators/privateImageListResponseBody.zod.js +41 -0
  309. package/dist/compute/v2/generated/validators/privateImageOperation.zod.d.ts +46 -0
  310. package/dist/compute/v2/generated/validators/privateImageOperation.zod.js +43 -0
  311. package/dist/compute/v2/generated/validators/privateImageReleaseResource.zod.d.ts +44 -0
  312. package/dist/compute/v2/generated/validators/privateImageReleaseResource.zod.js +43 -0
  313. package/dist/compute/v2/generated/validators/privateImageResource.zod.d.ts +117 -0
  314. package/dist/compute/v2/generated/validators/privateImageResource.zod.js +110 -0
  315. package/dist/compute/v2/generated/validators/projectQuota.zod.d.ts +63 -0
  316. package/dist/compute/v2/generated/validators/projectQuota.zod.js +48 -0
  317. package/dist/compute/v2/generated/validators/projectQuotaListResponseBody.zod.d.ts +69 -0
  318. package/dist/compute/v2/generated/validators/projectQuotaListResponseBody.zod.js +41 -0
  319. package/dist/compute/v2/generated/validators/publicImageListResponseBody.zod.d.ts +61 -0
  320. package/dist/compute/v2/generated/validators/publicImageListResponseBody.zod.js +41 -0
  321. package/dist/compute/v2/generated/validators/publicImageResource.zod.d.ts +55 -0
  322. package/dist/compute/v2/generated/validators/publicImageResource.zod.js +65 -0
  323. package/dist/compute/v2/generated/validators/quotaResourceType.zod.d.ts +53 -0
  324. package/dist/compute/v2/generated/validators/quotaResourceType.zod.js +53 -0
  325. package/dist/compute/v2/generated/validators/quotaSource.zod.d.ts +41 -0
  326. package/dist/compute/v2/generated/validators/quotaSource.zod.js +38 -0
  327. package/dist/compute/v2/generated/validators/rebootInstanceRequestBody.zod.d.ts +40 -0
  328. package/dist/compute/v2/generated/validators/rebootInstanceRequestBody.zod.js +41 -0
  329. package/dist/compute/v2/generated/validators/rebuildInstanceRequestBody.zod.d.ts +50 -0
  330. package/dist/compute/v2/generated/validators/rebuildInstanceRequestBody.zod.js +41 -0
  331. package/dist/compute/v2/generated/validators/rebuildInstanceResponseBody.zod.d.ts +157 -0
  332. package/dist/compute/v2/generated/validators/rebuildInstanceResponseBody.zod.js +43 -0
  333. package/dist/compute/v2/generated/validators/regionID.zod.d.ts +41 -0
  334. package/dist/compute/v2/generated/validators/regionID.zod.js +44 -0
  335. package/dist/compute/v2/generated/validators/regionListResponseBody.zod.d.ts +131 -0
  336. package/dist/compute/v2/generated/validators/regionListResponseBody.zod.js +41 -0
  337. package/dist/compute/v2/generated/validators/regionResource.zod.d.ts +124 -0
  338. package/dist/compute/v2/generated/validators/regionResource.zod.js +52 -0
  339. package/dist/compute/v2/generated/validators/releaseResource.zod.d.ts +75 -0
  340. package/dist/compute/v2/generated/validators/releaseResource.zod.js +51 -0
  341. package/dist/compute/v2/generated/validators/releaseSetItem.zod.d.ts +78 -0
  342. package/dist/compute/v2/generated/validators/releaseSetItem.zod.js +42 -0
  343. package/dist/compute/v2/generated/validators/rescueInstanceRequestBody.zod.d.ts +42 -0
  344. package/dist/compute/v2/generated/validators/rescueInstanceRequestBody.zod.js +44 -0
  345. package/dist/compute/v2/generated/validators/rescueInstanceResponseBody.zod.d.ts +157 -0
  346. package/dist/compute/v2/generated/validators/rescueInstanceResponseBody.zod.js +40 -0
  347. package/dist/compute/v2/generated/validators/resetInstancePasswordResponseBody.zod.d.ts +40 -0
  348. package/dist/compute/v2/generated/validators/resetInstancePasswordResponseBody.zod.js +41 -0
  349. package/dist/compute/v2/generated/validators/revertVolumeRequestBody.zod.d.ts +40 -0
  350. package/dist/compute/v2/generated/validators/revertVolumeRequestBody.zod.js +39 -0
  351. package/dist/compute/v2/generated/validators/runInstanceCommandRequestBody.zod.d.ts +43 -0
  352. package/dist/compute/v2/generated/validators/runInstanceCommandRequestBody.zod.js +50 -0
  353. package/dist/compute/v2/generated/validators/runInstanceCommandResponseBody.zod.d.ts +44 -0
  354. package/dist/compute/v2/generated/validators/runInstanceCommandResponseBody.zod.js +49 -0
  355. package/dist/compute/v2/generated/validators/securityGroup.zod.d.ts +46 -0
  356. package/dist/compute/v2/generated/validators/securityGroup.zod.js +48 -0
  357. package/dist/compute/v2/generated/validators/securityGroupID.zod.d.ts +41 -0
  358. package/dist/compute/v2/generated/validators/securityGroupID.zod.js +44 -0
  359. package/dist/compute/v2/generated/validators/securityGroupIDOrWildcard.zod.d.ts +39 -0
  360. package/dist/compute/v2/generated/validators/securityGroupIDOrWildcard.zod.js +40 -0
  361. package/dist/compute/v2/generated/validators/securityGroupListResponseBody.zod.d.ts +53 -0
  362. package/dist/compute/v2/generated/validators/securityGroupListResponseBody.zod.js +41 -0
  363. package/dist/compute/v2/generated/validators/securityGroupRule.zod.d.ts +52 -0
  364. package/dist/compute/v2/generated/validators/securityGroupRule.zod.js +56 -0
  365. package/dist/compute/v2/generated/validators/securityGroupRuleDirection.zod.d.ts +41 -0
  366. package/dist/compute/v2/generated/validators/securityGroupRuleDirection.zod.js +36 -0
  367. package/dist/compute/v2/generated/validators/securityGroupRuleID.zod.d.ts +41 -0
  368. package/dist/compute/v2/generated/validators/securityGroupRuleID.zod.js +44 -0
  369. package/dist/compute/v2/generated/validators/securityGroupRuleListResponseBody.zod.d.ts +59 -0
  370. package/dist/compute/v2/generated/validators/securityGroupRuleListResponseBody.zod.js +41 -0
  371. package/dist/compute/v2/generated/validators/subnetID.zod.d.ts +41 -0
  372. package/dist/compute/v2/generated/validators/subnetID.zod.js +44 -0
  373. package/dist/compute/v2/generated/validators/suppliedPassword.zod.d.ts +45 -0
  374. package/dist/compute/v2/generated/validators/suppliedPassword.zod.js +45 -0
  375. package/dist/compute/v2/generated/validators/terminationPolicy.zod.d.ts +41 -0
  376. package/dist/compute/v2/generated/validators/terminationPolicy.zod.js +38 -0
  377. package/dist/compute/v2/generated/validators/trafficUsage.zod.d.ts +44 -0
  378. package/dist/compute/v2/generated/validators/trafficUsage.zod.js +44 -0
  379. package/dist/compute/v2/generated/validators/trafficUsageListResponseBody.zod.d.ts +49 -0
  380. package/dist/compute/v2/generated/validators/trafficUsageListResponseBody.zod.js +41 -0
  381. package/dist/compute/v2/generated/validators/updateElasticIPRequestBody.zod.d.ts +53 -0
  382. package/dist/compute/v2/generated/validators/updateElasticIPRequestBody.zod.js +48 -0
  383. package/dist/compute/v2/generated/validators/updateElasticIPResponseBody.zod.d.ts +138 -0
  384. package/dist/compute/v2/generated/validators/updateElasticIPResponseBody.zod.js +49 -0
  385. package/dist/compute/v2/generated/validators/updateInstanceRequestBody.zod.d.ts +55 -0
  386. package/dist/compute/v2/generated/validators/updateInstanceRequestBody.zod.js +60 -0
  387. package/dist/compute/v2/generated/validators/updateInstanceResponseBody.zod.d.ts +158 -0
  388. package/dist/compute/v2/generated/validators/updateInstanceResponseBody.zod.js +49 -0
  389. package/dist/compute/v2/generated/validators/updateLaunchTemplateRequestBody.zod.d.ts +44 -0
  390. package/dist/compute/v2/generated/validators/updateLaunchTemplateRequestBody.zod.js +48 -0
  391. package/dist/compute/v2/generated/validators/updateNetworkInterfaceRequestBody.zod.d.ts +43 -0
  392. package/dist/compute/v2/generated/validators/updateNetworkInterfaceRequestBody.zod.js +49 -0
  393. package/dist/compute/v2/generated/validators/updatePrivateImageRequestBody.zod.d.ts +41 -0
  394. package/dist/compute/v2/generated/validators/updatePrivateImageRequestBody.zod.js +39 -0
  395. package/dist/compute/v2/generated/validators/updateSecurityGroupRequestBody.zod.d.ts +43 -0
  396. package/dist/compute/v2/generated/validators/updateSecurityGroupRequestBody.zod.js +41 -0
  397. package/dist/compute/v2/generated/validators/updateVirtualPrivateCloudRequestBody.zod.d.ts +41 -0
  398. package/dist/compute/v2/generated/validators/updateVirtualPrivateCloudRequestBody.zod.js +39 -0
  399. package/dist/compute/v2/generated/validators/updateVirtualPrivateCloudSubnetRequestBody.zod.d.ts +41 -0
  400. package/dist/compute/v2/generated/validators/updateVirtualPrivateCloudSubnetRequestBody.zod.js +39 -0
  401. package/dist/compute/v2/generated/validators/updateVolumeBackupRequestBody.zod.d.ts +41 -0
  402. package/dist/compute/v2/generated/validators/updateVolumeBackupRequestBody.zod.js +41 -0
  403. package/dist/compute/v2/generated/validators/updateVolumeRequestBody.zod.d.ts +52 -0
  404. package/dist/compute/v2/generated/validators/updateVolumeRequestBody.zod.js +54 -0
  405. package/dist/compute/v2/generated/validators/updateVolumeResponseBody.zod.d.ts +149 -0
  406. package/dist/compute/v2/generated/validators/updateVolumeResponseBody.zod.js +49 -0
  407. package/dist/compute/v2/generated/validators/updateVolumeSnapshotRequestBody.zod.d.ts +41 -0
  408. package/dist/compute/v2/generated/validators/updateVolumeSnapshotRequestBody.zod.js +41 -0
  409. package/dist/compute/v2/generated/validators/virtualPrivateCloud.zod.d.ts +60 -0
  410. package/dist/compute/v2/generated/validators/virtualPrivateCloud.zod.js +56 -0
  411. package/dist/compute/v2/generated/validators/virtualPrivateCloudID.zod.d.ts +41 -0
  412. package/dist/compute/v2/generated/validators/virtualPrivateCloudID.zod.js +44 -0
  413. package/dist/compute/v2/generated/validators/virtualPrivateCloudIDOrWildcard.zod.d.ts +39 -0
  414. package/dist/compute/v2/generated/validators/virtualPrivateCloudIDOrWildcard.zod.js +40 -0
  415. package/dist/compute/v2/generated/validators/virtualPrivateCloudListResponseBody.zod.d.ts +67 -0
  416. package/dist/compute/v2/generated/validators/virtualPrivateCloudListResponseBody.zod.js +41 -0
  417. package/dist/compute/v2/generated/validators/virtualPrivateCloudOperation.zod.d.ts +46 -0
  418. package/dist/compute/v2/generated/validators/virtualPrivateCloudOperation.zod.js +41 -0
  419. package/dist/compute/v2/generated/validators/virtualPrivateCloudPeeringID.zod.d.ts +41 -0
  420. package/dist/compute/v2/generated/validators/virtualPrivateCloudPeeringID.zod.js +44 -0
  421. package/dist/compute/v2/generated/validators/virtualPrivateCloudPeeringListResponseBody.zod.d.ts +73 -0
  422. package/dist/compute/v2/generated/validators/virtualPrivateCloudPeeringListResponseBody.zod.js +41 -0
  423. package/dist/compute/v2/generated/validators/virtualPrivateCloudPeeringOperation.zod.d.ts +44 -0
  424. package/dist/compute/v2/generated/validators/virtualPrivateCloudPeeringOperation.zod.js +43 -0
  425. package/dist/compute/v2/generated/validators/virtualPrivateCloudPeeringResource.zod.d.ts +66 -0
  426. package/dist/compute/v2/generated/validators/virtualPrivateCloudPeeringResource.zod.js +62 -0
  427. package/dist/compute/v2/generated/validators/virtualPrivateCloudRouteID.zod.d.ts +41 -0
  428. package/dist/compute/v2/generated/validators/virtualPrivateCloudRouteID.zod.js +44 -0
  429. package/dist/compute/v2/generated/validators/virtualPrivateCloudRouteListResponseBody.zod.d.ts +57 -0
  430. package/dist/compute/v2/generated/validators/virtualPrivateCloudRouteListResponseBody.zod.js +41 -0
  431. package/dist/compute/v2/generated/validators/virtualPrivateCloudRouteResource.zod.d.ts +50 -0
  432. package/dist/compute/v2/generated/validators/virtualPrivateCloudRouteResource.zod.js +54 -0
  433. package/dist/compute/v2/generated/validators/virtualPrivateCloudRouteType.zod.d.ts +41 -0
  434. package/dist/compute/v2/generated/validators/virtualPrivateCloudRouteType.zod.js +38 -0
  435. package/dist/compute/v2/generated/validators/virtualPrivateCloudSubnet.zod.d.ts +48 -0
  436. package/dist/compute/v2/generated/validators/virtualPrivateCloudSubnet.zod.js +54 -0
  437. package/dist/compute/v2/generated/validators/virtualPrivateCloudSubnetListResponseBody.zod.d.ts +55 -0
  438. package/dist/compute/v2/generated/validators/virtualPrivateCloudSubnetListResponseBody.zod.js +41 -0
  439. package/dist/compute/v2/generated/validators/volumeAttachment.zod.d.ts +63 -0
  440. package/dist/compute/v2/generated/validators/volumeAttachment.zod.js +56 -0
  441. package/dist/compute/v2/generated/validators/volumeAttachmentList.zod.d.ts +70 -0
  442. package/dist/compute/v2/generated/validators/volumeAttachmentList.zod.js +41 -0
  443. package/dist/compute/v2/generated/validators/volumeBackupID.zod.d.ts +41 -0
  444. package/dist/compute/v2/generated/validators/volumeBackupID.zod.js +44 -0
  445. package/dist/compute/v2/generated/validators/volumeBackupListResponseBody.zod.d.ts +115 -0
  446. package/dist/compute/v2/generated/validators/volumeBackupListResponseBody.zod.js +41 -0
  447. package/dist/compute/v2/generated/validators/volumeBackupOperation.zod.d.ts +45 -0
  448. package/dist/compute/v2/generated/validators/volumeBackupOperation.zod.js +43 -0
  449. package/dist/compute/v2/generated/validators/volumeBackupReleaseResource.zod.d.ts +44 -0
  450. package/dist/compute/v2/generated/validators/volumeBackupReleaseResource.zod.js +43 -0
  451. package/dist/compute/v2/generated/validators/volumeBackupResource.zod.d.ts +108 -0
  452. package/dist/compute/v2/generated/validators/volumeBackupResource.zod.js +90 -0
  453. package/dist/compute/v2/generated/validators/volumeID.zod.d.ts +41 -0
  454. package/dist/compute/v2/generated/validators/volumeID.zod.js +44 -0
  455. package/dist/compute/v2/generated/validators/volumeListResponseBody.zod.d.ts +152 -0
  456. package/dist/compute/v2/generated/validators/volumeListResponseBody.zod.js +41 -0
  457. package/dist/compute/v2/generated/validators/volumeOperation.zod.d.ts +51 -0
  458. package/dist/compute/v2/generated/validators/volumeOperation.zod.js +53 -0
  459. package/dist/compute/v2/generated/validators/volumePerformance.zod.d.ts +41 -0
  460. package/dist/compute/v2/generated/validators/volumePerformance.zod.js +41 -0
  461. package/dist/compute/v2/generated/validators/volumeReleaseResource.zod.d.ts +44 -0
  462. package/dist/compute/v2/generated/validators/volumeReleaseResource.zod.js +43 -0
  463. package/dist/compute/v2/generated/validators/volumeResource.zod.d.ts +145 -0
  464. package/dist/compute/v2/generated/validators/volumeResource.zod.js +93 -0
  465. package/dist/compute/v2/generated/validators/volumeSnapshotID.zod.d.ts +41 -0
  466. package/dist/compute/v2/generated/validators/volumeSnapshotID.zod.js +44 -0
  467. package/dist/compute/v2/generated/validators/volumeSnapshotListResponseBody.zod.d.ts +114 -0
  468. package/dist/compute/v2/generated/validators/volumeSnapshotListResponseBody.zod.js +41 -0
  469. package/dist/compute/v2/generated/validators/volumeSnapshotOperation.zod.d.ts +45 -0
  470. package/dist/compute/v2/generated/validators/volumeSnapshotOperation.zod.js +43 -0
  471. package/dist/compute/v2/generated/validators/volumeSnapshotReleaseResource.zod.d.ts +45 -0
  472. package/dist/compute/v2/generated/validators/volumeSnapshotReleaseResource.zod.js +43 -0
  473. package/dist/compute/v2/generated/validators/volumeSnapshotResource.zod.d.ts +107 -0
  474. package/dist/compute/v2/generated/validators/volumeSnapshotResource.zod.js +87 -0
  475. package/dist/compute/v2/generated/validators/volumeTypeID.zod.d.ts +41 -0
  476. package/dist/compute/v2/generated/validators/volumeTypeID.zod.js +44 -0
  477. package/dist/compute/v2/generated/validators/volumeTypeListResponseBody.zod.d.ts +103 -0
  478. package/dist/compute/v2/generated/validators/volumeTypeListResponseBody.zod.js +41 -0
  479. package/dist/compute/v2/generated/validators/volumeTypePerformance.zod.d.ts +51 -0
  480. package/dist/compute/v2/generated/validators/volumeTypePerformance.zod.js +42 -0
  481. package/dist/compute/v2/generated/validators/volumeTypeResource.zod.d.ts +96 -0
  482. package/dist/compute/v2/generated/validators/volumeTypeResource.zod.js +55 -0
  483. package/dist/index.d.ts +1 -1
  484. package/dist/index.js +1 -1
  485. package/dist/routes.d.ts +362 -236
  486. package/dist/routes.js +376 -236
  487. package/package.json +1 -1
  488. package/dist/compute/v1/generated/functions.d.ts +0 -2481
  489. package/dist/compute/v1/generated/functions.js +0 -2736
  490. package/dist/compute/v1/generated/models.d.ts +0 -2813
  491. package/dist/compute/v1/generated/models.js +0 -363
  492. package/dist/compute/v1/generated/schemas.zod.d.ts +0 -1501
  493. package/dist/compute/v1/generated/schemas.zod.js +0 -1390
  494. package/dist/compute/v1/generated/validators/allocateFloatingIPRequestBody.zod.d.ts +0 -59
  495. package/dist/compute/v1/generated/validators/allocateFloatingIPRequestBody.zod.js +0 -44
  496. package/dist/compute/v1/generated/validators/allocateFloatingIPResponseBody.zod.d.ts +0 -99
  497. package/dist/compute/v1/generated/validators/allocateFloatingIPResponseBody.zod.js +0 -37
  498. package/dist/compute/v1/generated/validators/attachDiskRequestBody.zod.d.ts +0 -29
  499. package/dist/compute/v1/generated/validators/attachDiskRequestBody.zod.js +0 -27
  500. package/dist/compute/v1/generated/validators/attachFloatingIPRequestBody.zod.d.ts +0 -29
  501. package/dist/compute/v1/generated/validators/attachFloatingIPRequestBody.zod.js +0 -27
  502. package/dist/compute/v1/generated/validators/attachPortRequestBody.zod.d.ts +0 -29
  503. package/dist/compute/v1/generated/validators/attachPortRequestBody.zod.js +0 -27
  504. package/dist/compute/v1/generated/validators/backupCapacityPack.zod.d.ts +0 -44
  505. package/dist/compute/v1/generated/validators/backupCapacityPack.zod.js +0 -58
  506. package/dist/compute/v1/generated/validators/backupCapacityPackListResponseBody.zod.d.ts +0 -51
  507. package/dist/compute/v1/generated/validators/backupCapacityPackListResponseBody.zod.js +0 -30
  508. package/dist/compute/v1/generated/validators/backupListResponseBody.zod.d.ts +0 -61
  509. package/dist/compute/v1/generated/validators/backupListResponseBody.zod.js +0 -30
  510. package/dist/compute/v1/generated/validators/backupOperation.zod.d.ts +0 -34
  511. package/dist/compute/v1/generated/validators/backupOperation.zod.js +0 -32
  512. package/dist/compute/v1/generated/validators/backupResource.zod.d.ts +0 -54
  513. package/dist/compute/v1/generated/validators/backupResource.zod.js +0 -53
  514. package/dist/compute/v1/generated/validators/backupService.zod.d.ts +0 -46
  515. package/dist/compute/v1/generated/validators/backupService.zod.js +0 -68
  516. package/dist/compute/v1/generated/validators/billingChoice.zod.d.ts +0 -43
  517. package/dist/compute/v1/generated/validators/billingChoice.zod.js +0 -35
  518. package/dist/compute/v1/generated/validators/billingComponent.zod.d.ts +0 -54
  519. package/dist/compute/v1/generated/validators/billingComponent.zod.js +0 -43
  520. package/dist/compute/v1/generated/validators/billingMeter.zod.d.ts +0 -36
  521. package/dist/compute/v1/generated/validators/billingMeter.zod.js +0 -34
  522. package/dist/compute/v1/generated/validators/billingPeriod.zod.d.ts +0 -34
  523. package/dist/compute/v1/generated/validators/billingPeriod.zod.js +0 -29
  524. package/dist/compute/v1/generated/validators/billingQuantity.zod.d.ts +0 -32
  525. package/dist/compute/v1/generated/validators/billingQuantity.zod.js +0 -27
  526. package/dist/compute/v1/generated/validators/bindFloatingIPRequestBody.zod.d.ts +0 -29
  527. package/dist/compute/v1/generated/validators/bindFloatingIPRequestBody.zod.js +0 -27
  528. package/dist/compute/v1/generated/validators/bootDisk.zod.d.ts +0 -58
  529. package/dist/compute/v1/generated/validators/bootDisk.zod.js +0 -29
  530. package/dist/compute/v1/generated/validators/cancellationMode.zod.d.ts +0 -30
  531. package/dist/compute/v1/generated/validators/cancellationMode.zod.js +0 -27
  532. package/dist/compute/v1/generated/validators/checkoutMode.zod.d.ts +0 -30
  533. package/dist/compute/v1/generated/validators/checkoutMode.zod.js +0 -27
  534. package/dist/compute/v1/generated/validators/checkoutOptions.zod.d.ts +0 -37
  535. package/dist/compute/v1/generated/validators/checkoutOptions.zod.js +0 -42
  536. package/dist/compute/v1/generated/validators/commandResultResponseBody.zod.d.ts +0 -33
  537. package/dist/compute/v1/generated/validators/commandResultResponseBody.zod.js +0 -38
  538. package/dist/compute/v1/generated/validators/consoleOutputResponseBody.zod.d.ts +0 -29
  539. package/dist/compute/v1/generated/validators/consoleOutputResponseBody.zod.js +0 -29
  540. package/dist/compute/v1/generated/validators/consoleResponseBody.zod.d.ts +0 -29
  541. package/dist/compute/v1/generated/validators/consoleResponseBody.zod.js +0 -29
  542. package/dist/compute/v1/generated/validators/createBackupCapacityPackRequestBody.zod.d.ts +0 -54
  543. package/dist/compute/v1/generated/validators/createBackupCapacityPackRequestBody.zod.js +0 -31
  544. package/dist/compute/v1/generated/validators/createBackupCapacityPackResponseBody.zod.d.ts +0 -48
  545. package/dist/compute/v1/generated/validators/createBackupCapacityPackResponseBody.zod.js +0 -35
  546. package/dist/compute/v1/generated/validators/createBackupRequestBody.zod.d.ts +0 -31
  547. package/dist/compute/v1/generated/validators/createBackupRequestBody.zod.js +0 -29
  548. package/dist/compute/v1/generated/validators/createBackupServiceRequestBody.zod.d.ts +0 -36
  549. package/dist/compute/v1/generated/validators/createBackupServiceRequestBody.zod.js +0 -28
  550. package/dist/compute/v1/generated/validators/createBackupServiceResponseBody.zod.d.ts +0 -48
  551. package/dist/compute/v1/generated/validators/createBackupServiceResponseBody.zod.js +0 -35
  552. package/dist/compute/v1/generated/validators/createDiskRequestBody.zod.d.ts +0 -59
  553. package/dist/compute/v1/generated/validators/createDiskRequestBody.zod.js +0 -42
  554. package/dist/compute/v1/generated/validators/createDiskResponseBody.zod.d.ts +0 -109
  555. package/dist/compute/v1/generated/validators/createDiskResponseBody.zod.js +0 -37
  556. package/dist/compute/v1/generated/validators/createImageRequestBody.zod.d.ts +0 -56
  557. package/dist/compute/v1/generated/validators/createImageRequestBody.zod.js +0 -35
  558. package/dist/compute/v1/generated/validators/createImageResponseBody.zod.d.ts +0 -94
  559. package/dist/compute/v1/generated/validators/createImageResponseBody.zod.js +0 -37
  560. package/dist/compute/v1/generated/validators/createPeeringRequestBody.zod.d.ts +0 -33
  561. package/dist/compute/v1/generated/validators/createPeeringRequestBody.zod.js +0 -31
  562. package/dist/compute/v1/generated/validators/createPortRequestBody.zod.d.ts +0 -34
  563. package/dist/compute/v1/generated/validators/createPortRequestBody.zod.js +0 -40
  564. package/dist/compute/v1/generated/validators/createPrivateNetworkRequestBody.zod.d.ts +0 -33
  565. package/dist/compute/v1/generated/validators/createPrivateNetworkRequestBody.zod.js +0 -35
  566. package/dist/compute/v1/generated/validators/createRouteRequestBody.zod.d.ts +0 -34
  567. package/dist/compute/v1/generated/validators/createRouteRequestBody.zod.js +0 -40
  568. package/dist/compute/v1/generated/validators/createSecurityGroupRequestBody.zod.d.ts +0 -33
  569. package/dist/compute/v1/generated/validators/createSecurityGroupRequestBody.zod.js +0 -31
  570. package/dist/compute/v1/generated/validators/createSecurityRuleRequestBody.zod.d.ts +0 -44
  571. package/dist/compute/v1/generated/validators/createSecurityRuleRequestBody.zod.js +0 -50
  572. package/dist/compute/v1/generated/validators/createSnapshotRequestBody.zod.d.ts +0 -31
  573. package/dist/compute/v1/generated/validators/createSnapshotRequestBody.zod.js +0 -31
  574. package/dist/compute/v1/generated/validators/createSubnetRequestBody.zod.d.ts +0 -32
  575. package/dist/compute/v1/generated/validators/createSubnetRequestBody.zod.js +0 -34
  576. package/dist/compute/v1/generated/validators/cursorPagination.zod.d.ts +0 -30
  577. package/dist/compute/v1/generated/validators/cursorPagination.zod.js +0 -30
  578. package/dist/compute/v1/generated/validators/deleteBackupCapacityPackParams.zod.d.ts +0 -32
  579. package/dist/compute/v1/generated/validators/deleteBackupCapacityPackParams.zod.js +0 -30
  580. package/dist/compute/v1/generated/validators/deleteBackupServiceParams.zod.d.ts +0 -32
  581. package/dist/compute/v1/generated/validators/deleteBackupServiceParams.zod.js +0 -30
  582. package/dist/compute/v1/generated/validators/deleteDiskParams.zod.d.ts +0 -32
  583. package/dist/compute/v1/generated/validators/deleteDiskParams.zod.js +0 -30
  584. package/dist/compute/v1/generated/validators/deleteDiskResponseBody.zod.d.ts +0 -121
  585. package/dist/compute/v1/generated/validators/deleteDiskResponseBody.zod.js +0 -32
  586. package/dist/compute/v1/generated/validators/deleteImageParams.zod.d.ts +0 -32
  587. package/dist/compute/v1/generated/validators/deleteImageParams.zod.js +0 -30
  588. package/dist/compute/v1/generated/validators/deleteImageResponseBody.zod.d.ts +0 -106
  589. package/dist/compute/v1/generated/validators/deleteImageResponseBody.zod.js +0 -32
  590. package/dist/compute/v1/generated/validators/deleteInstanceParams.zod.d.ts +0 -32
  591. package/dist/compute/v1/generated/validators/deleteInstanceParams.zod.js +0 -30
  592. package/dist/compute/v1/generated/validators/deleteInstanceResponseBody.zod.d.ts +0 -135
  593. package/dist/compute/v1/generated/validators/deleteInstanceResponseBody.zod.js +0 -32
  594. package/dist/compute/v1/generated/validators/deleteSnapshotQuotaParams.zod.d.ts +0 -32
  595. package/dist/compute/v1/generated/validators/deleteSnapshotQuotaParams.zod.js +0 -30
  596. package/dist/compute/v1/generated/validators/diskAttachment.zod.d.ts +0 -46
  597. package/dist/compute/v1/generated/validators/diskAttachment.zod.js +0 -36
  598. package/dist/compute/v1/generated/validators/diskAttachmentList.zod.d.ts +0 -53
  599. package/dist/compute/v1/generated/validators/diskAttachmentList.zod.js +0 -30
  600. package/dist/compute/v1/generated/validators/diskListResponseBody.zod.d.ts +0 -112
  601. package/dist/compute/v1/generated/validators/diskListResponseBody.zod.js +0 -30
  602. package/dist/compute/v1/generated/validators/diskOperation.zod.d.ts +0 -39
  603. package/dist/compute/v1/generated/validators/diskOperation.zod.js +0 -32
  604. package/dist/compute/v1/generated/validators/diskResource.zod.d.ts +0 -105
  605. package/dist/compute/v1/generated/validators/diskResource.zod.js +0 -100
  606. package/dist/compute/v1/generated/validators/diskTypeListResponseBody.zod.d.ts +0 -83
  607. package/dist/compute/v1/generated/validators/diskTypeListResponseBody.zod.js +0 -30
  608. package/dist/compute/v1/generated/validators/diskTypePurpose.zod.d.ts +0 -30
  609. package/dist/compute/v1/generated/validators/diskTypePurpose.zod.js +0 -27
  610. package/dist/compute/v1/generated/validators/diskTypeResource.zod.d.ts +0 -76
  611. package/dist/compute/v1/generated/validators/diskTypeResource.zod.js +0 -54
  612. package/dist/compute/v1/generated/validators/error.zod.d.ts +0 -32
  613. package/dist/compute/v1/generated/validators/error.zod.js +0 -33
  614. package/dist/compute/v1/generated/validators/existingBootDisk.zod.d.ts +0 -34
  615. package/dist/compute/v1/generated/validators/existingBootDisk.zod.js +0 -36
  616. package/dist/compute/v1/generated/validators/floatingIPListResponseBody.zod.d.ts +0 -102
  617. package/dist/compute/v1/generated/validators/floatingIPListResponseBody.zod.js +0 -30
  618. package/dist/compute/v1/generated/validators/floatingIPOperation.zod.d.ts +0 -38
  619. package/dist/compute/v1/generated/validators/floatingIPOperation.zod.js +0 -30
  620. package/dist/compute/v1/generated/validators/floatingIPResource.zod.d.ts +0 -95
  621. package/dist/compute/v1/generated/validators/floatingIPResource.zod.js +0 -93
  622. package/dist/compute/v1/generated/validators/getInstanceConsoleOutputParams.zod.d.ts +0 -32
  623. package/dist/compute/v1/generated/validators/getInstanceConsoleOutputParams.zod.js +0 -35
  624. package/dist/compute/v1/generated/validators/iPv4Binding.zod.d.ts +0 -41
  625. package/dist/compute/v1/generated/validators/iPv4Binding.zod.js +0 -35
  626. package/dist/compute/v1/generated/validators/iPv4PoolListResponseBody.zod.d.ts +0 -66
  627. package/dist/compute/v1/generated/validators/iPv4PoolListResponseBody.zod.js +0 -30
  628. package/dist/compute/v1/generated/validators/iPv4PoolResource.zod.d.ts +0 -59
  629. package/dist/compute/v1/generated/validators/iPv4PoolResource.zod.js +0 -31
  630. package/dist/compute/v1/generated/validators/iPv6ResponseBody.zod.d.ts +0 -35
  631. package/dist/compute/v1/generated/validators/iPv6ResponseBody.zod.js +0 -31
  632. package/dist/compute/v1/generated/validators/imageListResponseBody.zod.d.ts +0 -97
  633. package/dist/compute/v1/generated/validators/imageListResponseBody.zod.js +0 -30
  634. package/dist/compute/v1/generated/validators/imageOperation.zod.d.ts +0 -35
  635. package/dist/compute/v1/generated/validators/imageOperation.zod.js +0 -32
  636. package/dist/compute/v1/generated/validators/imageResource.zod.d.ts +0 -91
  637. package/dist/compute/v1/generated/validators/imageResource.zod.js +0 -117
  638. package/dist/compute/v1/generated/validators/imageVisibility.zod.d.ts +0 -30
  639. package/dist/compute/v1/generated/validators/imageVisibility.zod.js +0 -27
  640. package/dist/compute/v1/generated/validators/instanceListResponseBody.zod.d.ts +0 -126
  641. package/dist/compute/v1/generated/validators/instanceListResponseBody.zod.js +0 -30
  642. package/dist/compute/v1/generated/validators/instanceOperation.zod.d.ts +0 -47
  643. package/dist/compute/v1/generated/validators/instanceOperation.zod.js +0 -49
  644. package/dist/compute/v1/generated/validators/instanceResource.zod.d.ts +0 -122
  645. package/dist/compute/v1/generated/validators/instanceResource.zod.js +0 -130
  646. package/dist/compute/v1/generated/validators/instanceRestriction.zod.d.ts +0 -39
  647. package/dist/compute/v1/generated/validators/instanceRestriction.zod.js +0 -35
  648. package/dist/compute/v1/generated/validators/instanceTypeListResponseBody.zod.d.ts +0 -74
  649. package/dist/compute/v1/generated/validators/instanceTypeListResponseBody.zod.js +0 -30
  650. package/dist/compute/v1/generated/validators/instanceTypeResource.zod.d.ts +0 -67
  651. package/dist/compute/v1/generated/validators/instanceTypeResource.zod.js +0 -47
  652. package/dist/compute/v1/generated/validators/launchInstanceRequestBody.zod.d.ts +0 -121
  653. package/dist/compute/v1/generated/validators/launchInstanceRequestBody.zod.js +0 -71
  654. package/dist/compute/v1/generated/validators/launchInstanceResponseBody.zod.d.ts +0 -125
  655. package/dist/compute/v1/generated/validators/launchInstanceResponseBody.zod.js +0 -46
  656. package/dist/compute/v1/generated/validators/listAvailabilityZonesParams.zod.d.ts +0 -34
  657. package/dist/compute/v1/generated/validators/listAvailabilityZonesParams.zod.js +0 -40
  658. package/dist/compute/v1/generated/validators/listBackupCapacityPacksParams.zod.d.ts +0 -34
  659. package/dist/compute/v1/generated/validators/listBackupCapacityPacksParams.zod.js +0 -40
  660. package/dist/compute/v1/generated/validators/listBackupsParams.zod.d.ts +0 -35
  661. package/dist/compute/v1/generated/validators/listBackupsParams.zod.js +0 -37
  662. package/dist/compute/v1/generated/validators/listDiskTypesParams.zod.d.ts +0 -39
  663. package/dist/compute/v1/generated/validators/listDiskTypesParams.zod.js +0 -39
  664. package/dist/compute/v1/generated/validators/listDisksParams.zod.d.ts +0 -36
  665. package/dist/compute/v1/generated/validators/listDisksParams.zod.js +0 -38
  666. package/dist/compute/v1/generated/validators/listFloatingIpsParams.zod.d.ts +0 -34
  667. package/dist/compute/v1/generated/validators/listFloatingIpsParams.zod.js +0 -40
  668. package/dist/compute/v1/generated/validators/listImagesParams.zod.d.ts +0 -39
  669. package/dist/compute/v1/generated/validators/listImagesParams.zod.js +0 -39
  670. package/dist/compute/v1/generated/validators/listInstanceDisksParams.zod.d.ts +0 -34
  671. package/dist/compute/v1/generated/validators/listInstanceDisksParams.zod.js +0 -40
  672. package/dist/compute/v1/generated/validators/listInstancePortsParams.zod.d.ts +0 -34
  673. package/dist/compute/v1/generated/validators/listInstancePortsParams.zod.js +0 -40
  674. package/dist/compute/v1/generated/validators/listInstanceTypesParams.zod.d.ts +0 -35
  675. package/dist/compute/v1/generated/validators/listInstanceTypesParams.zod.js +0 -41
  676. package/dist/compute/v1/generated/validators/listInstancesParams.zod.d.ts +0 -36
  677. package/dist/compute/v1/generated/validators/listInstancesParams.zod.js +0 -42
  678. package/dist/compute/v1/generated/validators/listIpv4PoolsParams.zod.d.ts +0 -35
  679. package/dist/compute/v1/generated/validators/listIpv4PoolsParams.zod.js +0 -37
  680. package/dist/compute/v1/generated/validators/listOperationLogsParams.zod.d.ts +0 -36
  681. package/dist/compute/v1/generated/validators/listOperationLogsParams.zod.js +0 -46
  682. package/dist/compute/v1/generated/validators/listPeeringsParams.zod.d.ts +0 -34
  683. package/dist/compute/v1/generated/validators/listPeeringsParams.zod.js +0 -36
  684. package/dist/compute/v1/generated/validators/listPortsParams.zod.d.ts +0 -34
  685. package/dist/compute/v1/generated/validators/listPortsParams.zod.js +0 -36
  686. package/dist/compute/v1/generated/validators/listPrivateNetworksParams.zod.d.ts +0 -35
  687. package/dist/compute/v1/generated/validators/listPrivateNetworksParams.zod.js +0 -41
  688. package/dist/compute/v1/generated/validators/listRegionsParams.zod.d.ts +0 -34
  689. package/dist/compute/v1/generated/validators/listRegionsParams.zod.js +0 -36
  690. package/dist/compute/v1/generated/validators/listRoutesParams.zod.d.ts +0 -34
  691. package/dist/compute/v1/generated/validators/listRoutesParams.zod.js +0 -36
  692. package/dist/compute/v1/generated/validators/listSecurityGroupRulesParams.zod.d.ts +0 -34
  693. package/dist/compute/v1/generated/validators/listSecurityGroupRulesParams.zod.js +0 -40
  694. package/dist/compute/v1/generated/validators/listSecurityGroupsParams.zod.d.ts +0 -36
  695. package/dist/compute/v1/generated/validators/listSecurityGroupsParams.zod.js +0 -45
  696. package/dist/compute/v1/generated/validators/listSnapshotsParams.zod.d.ts +0 -35
  697. package/dist/compute/v1/generated/validators/listSnapshotsParams.zod.js +0 -37
  698. package/dist/compute/v1/generated/validators/listSubnetsParams.zod.d.ts +0 -34
  699. package/dist/compute/v1/generated/validators/listSubnetsParams.zod.js +0 -36
  700. package/dist/compute/v1/generated/validators/money.zod.d.ts +0 -27
  701. package/dist/compute/v1/generated/validators/money.zod.js +0 -27
  702. package/dist/compute/v1/generated/validators/newBootDisk.zod.d.ts +0 -54
  703. package/dist/compute/v1/generated/validators/newBootDisk.zod.js +0 -42
  704. package/dist/compute/v1/generated/validators/newCompute.zod.d.ts +0 -47
  705. package/dist/compute/v1/generated/validators/newCompute.zod.js +0 -35
  706. package/dist/compute/v1/generated/validators/newFloatingIP.zod.d.ts +0 -48
  707. package/dist/compute/v1/generated/validators/newFloatingIP.zod.js +0 -33
  708. package/dist/compute/v1/generated/validators/nextFreeCidrResponseBody.zod.d.ts +0 -29
  709. package/dist/compute/v1/generated/validators/nextFreeCidrResponseBody.zod.js +0 -29
  710. package/dist/compute/v1/generated/validators/offsetPagination.zod.d.ts +0 -32
  711. package/dist/compute/v1/generated/validators/offsetPagination.zod.js +0 -32
  712. package/dist/compute/v1/generated/validators/operationLogListResponseBody.zod.d.ts +0 -47
  713. package/dist/compute/v1/generated/validators/operationLogListResponseBody.zod.js +0 -30
  714. package/dist/compute/v1/generated/validators/operationLogResource.zod.d.ts +0 -40
  715. package/dist/compute/v1/generated/validators/operationLogResource.zod.js +0 -48
  716. package/dist/compute/v1/generated/validators/peeringListResponseBody.zod.d.ts +0 -59
  717. package/dist/compute/v1/generated/validators/peeringListResponseBody.zod.js +0 -30
  718. package/dist/compute/v1/generated/validators/peeringOperation.zod.d.ts +0 -33
  719. package/dist/compute/v1/generated/validators/peeringOperation.zod.js +0 -32
  720. package/dist/compute/v1/generated/validators/peeringResource.zod.d.ts +0 -52
  721. package/dist/compute/v1/generated/validators/peeringResource.zod.js +0 -47
  722. package/dist/compute/v1/generated/validators/portAddress.zod.d.ts +0 -41
  723. package/dist/compute/v1/generated/validators/portAddress.zod.js +0 -34
  724. package/dist/compute/v1/generated/validators/portAttachment.zod.d.ts +0 -45
  725. package/dist/compute/v1/generated/validators/portAttachment.zod.js +0 -35
  726. package/dist/compute/v1/generated/validators/portAttachmentList.zod.d.ts +0 -52
  727. package/dist/compute/v1/generated/validators/portAttachmentList.zod.js +0 -30
  728. package/dist/compute/v1/generated/validators/portListResponseBody.zod.d.ts +0 -91
  729. package/dist/compute/v1/generated/validators/portListResponseBody.zod.js +0 -30
  730. package/dist/compute/v1/generated/validators/portOperation.zod.d.ts +0 -35
  731. package/dist/compute/v1/generated/validators/portOperation.zod.js +0 -30
  732. package/dist/compute/v1/generated/validators/portResource.zod.d.ts +0 -84
  733. package/dist/compute/v1/generated/validators/portResource.zod.js +0 -47
  734. package/dist/compute/v1/generated/validators/powerRequest.zod.d.ts +0 -29
  735. package/dist/compute/v1/generated/validators/powerRequest.zod.js +0 -27
  736. package/dist/compute/v1/generated/validators/privateNetworkListResponseBody.zod.d.ts +0 -41
  737. package/dist/compute/v1/generated/validators/privateNetworkListResponseBody.zod.js +0 -30
  738. package/dist/compute/v1/generated/validators/privateNetworkResource.zod.d.ts +0 -34
  739. package/dist/compute/v1/generated/validators/privateNetworkResource.zod.js +0 -32
  740. package/dist/compute/v1/generated/validators/rebootInstanceRequestBody.zod.d.ts +0 -29
  741. package/dist/compute/v1/generated/validators/rebootInstanceRequestBody.zod.js +0 -30
  742. package/dist/compute/v1/generated/validators/rebuildInstanceRequestBody.zod.d.ts +0 -33
  743. package/dist/compute/v1/generated/validators/rebuildInstanceRequestBody.zod.js +0 -34
  744. package/dist/compute/v1/generated/validators/rebuildInstanceResponseBody.zod.d.ts +0 -122
  745. package/dist/compute/v1/generated/validators/rebuildInstanceResponseBody.zod.js +0 -29
  746. package/dist/compute/v1/generated/validators/regionListResponseBody.zod.d.ts +0 -151
  747. package/dist/compute/v1/generated/validators/regionListResponseBody.zod.js +0 -30
  748. package/dist/compute/v1/generated/validators/regionResource.zod.d.ts +0 -144
  749. package/dist/compute/v1/generated/validators/regionResource.zod.js +0 -45
  750. package/dist/compute/v1/generated/validators/releaseFloatingIPResponseBody.zod.d.ts +0 -111
  751. package/dist/compute/v1/generated/validators/releaseFloatingIPResponseBody.zod.js +0 -32
  752. package/dist/compute/v1/generated/validators/releaseFloatingIpParams.zod.d.ts +0 -32
  753. package/dist/compute/v1/generated/validators/releaseFloatingIpParams.zod.js +0 -30
  754. package/dist/compute/v1/generated/validators/releaseResource.zod.d.ts +0 -39
  755. package/dist/compute/v1/generated/validators/releaseResource.zod.js +0 -43
  756. package/dist/compute/v1/generated/validators/releaseSetItem.zod.d.ts +0 -42
  757. package/dist/compute/v1/generated/validators/releaseSetItem.zod.js +0 -31
  758. package/dist/compute/v1/generated/validators/renameBackupRequestBody.zod.d.ts +0 -30
  759. package/dist/compute/v1/generated/validators/renameBackupRequestBody.zod.js +0 -28
  760. package/dist/compute/v1/generated/validators/renameDiskRequestBody.zod.d.ts +0 -30
  761. package/dist/compute/v1/generated/validators/renameDiskRequestBody.zod.js +0 -28
  762. package/dist/compute/v1/generated/validators/renameImageRequestBody.zod.d.ts +0 -30
  763. package/dist/compute/v1/generated/validators/renameImageRequestBody.zod.js +0 -28
  764. package/dist/compute/v1/generated/validators/renameInstanceRequestBody.zod.d.ts +0 -30
  765. package/dist/compute/v1/generated/validators/renameInstanceRequestBody.zod.js +0 -28
  766. package/dist/compute/v1/generated/validators/renamePrivateNetworkRequestBody.zod.d.ts +0 -30
  767. package/dist/compute/v1/generated/validators/renamePrivateNetworkRequestBody.zod.js +0 -28
  768. package/dist/compute/v1/generated/validators/renameSecurityGroupRequestBody.zod.d.ts +0 -30
  769. package/dist/compute/v1/generated/validators/renameSecurityGroupRequestBody.zod.js +0 -28
  770. package/dist/compute/v1/generated/validators/renameSnapshotRequestBody.zod.d.ts +0 -30
  771. package/dist/compute/v1/generated/validators/renameSnapshotRequestBody.zod.js +0 -28
  772. package/dist/compute/v1/generated/validators/resetPasswordRequestBody.zod.d.ts +0 -31
  773. package/dist/compute/v1/generated/validators/resetPasswordRequestBody.zod.js +0 -36
  774. package/dist/compute/v1/generated/validators/resetPasswordResponseBody.zod.d.ts +0 -29
  775. package/dist/compute/v1/generated/validators/resetPasswordResponseBody.zod.js +0 -29
  776. package/dist/compute/v1/generated/validators/resizeDiskRequestBody.zod.d.ts +0 -38
  777. package/dist/compute/v1/generated/validators/resizeDiskRequestBody.zod.js +0 -33
  778. package/dist/compute/v1/generated/validators/resizeDiskResponseBody.zod.d.ts +0 -109
  779. package/dist/compute/v1/generated/validators/resizeDiskResponseBody.zod.js +0 -37
  780. package/dist/compute/v1/generated/validators/resizeInstanceRequestBody.zod.d.ts +0 -39
  781. package/dist/compute/v1/generated/validators/resizeInstanceRequestBody.zod.js +0 -37
  782. package/dist/compute/v1/generated/validators/resizeInstanceResponseBody.zod.d.ts +0 -123
  783. package/dist/compute/v1/generated/validators/resizeInstanceResponseBody.zod.js +0 -37
  784. package/dist/compute/v1/generated/validators/resourceCancellation.zod.d.ts +0 -40
  785. package/dist/compute/v1/generated/validators/resourceCancellation.zod.js +0 -39
  786. package/dist/compute/v1/generated/validators/restoreBackupRequestBody.zod.d.ts +0 -59
  787. package/dist/compute/v1/generated/validators/restoreBackupRequestBody.zod.js +0 -43
  788. package/dist/compute/v1/generated/validators/revertDiskRequestBody.zod.d.ts +0 -29
  789. package/dist/compute/v1/generated/validators/revertDiskRequestBody.zod.js +0 -27
  790. package/dist/compute/v1/generated/validators/routeListResponseBody.zod.d.ts +0 -41
  791. package/dist/compute/v1/generated/validators/routeListResponseBody.zod.js +0 -30
  792. package/dist/compute/v1/generated/validators/routeResource.zod.d.ts +0 -34
  793. package/dist/compute/v1/generated/validators/routeResource.zod.js +0 -38
  794. package/dist/compute/v1/generated/validators/runCommandRequestBody.zod.d.ts +0 -32
  795. package/dist/compute/v1/generated/validators/runCommandRequestBody.zod.js +0 -39
  796. package/dist/compute/v1/generated/validators/securityGroupListResponseBody.zod.d.ts +0 -41
  797. package/dist/compute/v1/generated/validators/securityGroupListResponseBody.zod.js +0 -30
  798. package/dist/compute/v1/generated/validators/securityGroupResource.zod.d.ts +0 -34
  799. package/dist/compute/v1/generated/validators/securityGroupResource.zod.js +0 -34
  800. package/dist/compute/v1/generated/validators/securityRuleListResponseBody.zod.d.ts +0 -50
  801. package/dist/compute/v1/generated/validators/securityRuleListResponseBody.zod.js +0 -30
  802. package/dist/compute/v1/generated/validators/securityRuleResource.zod.d.ts +0 -43
  803. package/dist/compute/v1/generated/validators/securityRuleResource.zod.js +0 -41
  804. package/dist/compute/v1/generated/validators/setFloatingIPBandwidthRequestBody.zod.d.ts +0 -38
  805. package/dist/compute/v1/generated/validators/setFloatingIPBandwidthRequestBody.zod.js +0 -35
  806. package/dist/compute/v1/generated/validators/setFloatingIPBandwidthResponseBody.zod.d.ts +0 -99
  807. package/dist/compute/v1/generated/validators/setFloatingIPBandwidthResponseBody.zod.js +0 -37
  808. package/dist/compute/v1/generated/validators/setInstanceLabelsRequestBody.zod.d.ts +0 -30
  809. package/dist/compute/v1/generated/validators/setInstanceLabelsRequestBody.zod.js +0 -30
  810. package/dist/compute/v1/generated/validators/setInstanceNotesRequestBody.zod.d.ts +0 -30
  811. package/dist/compute/v1/generated/validators/setInstanceNotesRequestBody.zod.js +0 -31
  812. package/dist/compute/v1/generated/validators/setSnapshotQuotaRequestBody.zod.d.ts +0 -55
  813. package/dist/compute/v1/generated/validators/setSnapshotQuotaRequestBody.zod.js +0 -38
  814. package/dist/compute/v1/generated/validators/setSnapshotQuotaResponseBody.zod.d.ts +0 -68
  815. package/dist/compute/v1/generated/validators/setSnapshotQuotaResponseBody.zod.js +0 -35
  816. package/dist/compute/v1/generated/validators/snapshotListResponseBody.zod.d.ts +0 -61
  817. package/dist/compute/v1/generated/validators/snapshotListResponseBody.zod.js +0 -30
  818. package/dist/compute/v1/generated/validators/snapshotOperation.zod.d.ts +0 -34
  819. package/dist/compute/v1/generated/validators/snapshotOperation.zod.js +0 -32
  820. package/dist/compute/v1/generated/validators/snapshotQuota.zod.d.ts +0 -67
  821. package/dist/compute/v1/generated/validators/snapshotQuota.zod.js +0 -86
  822. package/dist/compute/v1/generated/validators/snapshotResource.zod.d.ts +0 -54
  823. package/dist/compute/v1/generated/validators/snapshotResource.zod.js +0 -48
  824. package/dist/compute/v1/generated/validators/subnetListResponseBody.zod.d.ts +0 -41
  825. package/dist/compute/v1/generated/validators/subnetListResponseBody.zod.js +0 -30
  826. package/dist/compute/v1/generated/validators/subnetResource.zod.d.ts +0 -34
  827. package/dist/compute/v1/generated/validators/subnetResource.zod.js +0 -32
  828. package/dist/compute/v1/generated/validators/suggestSubnetCidrParams.zod.d.ts +0 -32
  829. package/dist/compute/v1/generated/validators/suggestSubnetCidrParams.zod.js +0 -34
  830. package/dist/compute/v1/generated/validators/terminationPolicy.zod.d.ts +0 -30
  831. package/dist/compute/v1/generated/validators/terminationPolicy.zod.js +0 -27
  832. package/dist/compute/v1/generated/validators/zoneListResponseBody.zod.d.ts +0 -38
  833. package/dist/compute/v1/generated/validators/zoneListResponseBody.zod.js +0 -30
  834. package/dist/compute/v1/generated/validators/zoneResource.zod.d.ts +0 -31
  835. package/dist/compute/v1/generated/validators/zoneResource.zod.js +0 -33
  836. /package/dist/compute/{v1 → v2}/index.d.ts +0 -0
  837. /package/dist/compute/{v1 → v2}/index.js +0 -0
@@ -1,2736 +0,0 @@
1
- export const getListBackupsUrl = (params) => {
2
- const normalizedParams = new URLSearchParams();
3
- Object.entries(params || {}).forEach(([key, value]) => {
4
- if (value !== undefined) {
5
- normalizedParams.append(key, value === null ? "null" : String(value));
6
- }
7
- });
8
- const stringifiedParams = normalizedParams.toString();
9
- return stringifiedParams.length > 0
10
- ? `https://compute.leaflow.cloud/api/v1/backups?${stringifiedParams}`
11
- : `https://compute.leaflow.cloud/api/v1/backups`;
12
- };
13
- /**
14
- * @summary List backups
15
- */
16
- export const listBackups = async (params, options, fetchFn) => {
17
- const res = await (fetchFn ?? fetch)(getListBackupsUrl(params), {
18
- ...options,
19
- method: "GET",
20
- });
21
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
22
- const data = body ? JSON.parse(body) : {};
23
- return { data, status: res.status, headers: res.headers };
24
- };
25
- export const getCreateBackupUrl = () => {
26
- return `https://compute.leaflow.cloud/api/v1/backups`;
27
- };
28
- /**
29
- * A backup is a complete copy of a disk held in separate storage: **it remains restorable after the source disk is deleted, and can be restored to another availability zone in the same region.** A snapshot offers neither capability, as it resides in the same storage as the source disk and prevents that disk from being deleted while it exists.
30
- *
31
- * Disks attached to a running instance, including system disks, can be backed up.
32
- *
33
- * No order is placed. The backup is metered on the backup service of the disk's region by its `capacity_gib` for as long as it is retained, until it is deleted; see `get-backup-service`. Refused with 409 `BACKUP_SERVICE_NOT_ACTIVE` and `meta.region_id` when that service is not active.
34
- *
35
- * Returns the backup while it is taken; the duration depends on the amount of data. Read the backup until it is `available` or `failed`.
36
- * @summary Create a backup
37
- */
38
- export const createBackup = async (createBackupRequestBody, options, fetchFn) => {
39
- const getHeaders = (h) => {
40
- if (!h)
41
- return {};
42
- if (h instanceof Headers)
43
- return Object.fromEntries(h.entries());
44
- if (Symbol.iterator in h) {
45
- return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
46
- }
47
- const headers = {};
48
- for (const [name, value] of Object.entries(h)) {
49
- if (value !== undefined)
50
- headers[name] = value;
51
- }
52
- return headers;
53
- };
54
- const res = await (fetchFn ?? fetch)(getCreateBackupUrl(), {
55
- ...options,
56
- method: "POST",
57
- headers: { "Content-Type": "application/json", ...getHeaders(options?.headers) },
58
- body: JSON.stringify(createBackupRequestBody),
59
- });
60
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
61
- const data = body ? JSON.parse(body) : {};
62
- return { data, status: res.status, headers: res.headers };
63
- };
64
- export const getGetBackupUrl = (backupId) => {
65
- return `https://compute.leaflow.cloud/api/v1/backups/${encodeURIComponent(String(backupId))}`;
66
- };
67
- /**
68
- * Returns the stored state of the backup; it does not query the cloud. Use it to poll creation progress.
69
- * @summary Retrieve a backup
70
- */
71
- export const getBackup = async (backupId, options, fetchFn) => {
72
- const res = await (fetchFn ?? fetch)(getGetBackupUrl(backupId), {
73
- ...options,
74
- method: "GET",
75
- });
76
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
77
- const data = body ? JSON.parse(body) : {};
78
- return { data, status: res.status, headers: res.headers };
79
- };
80
- export const getRenameBackupUrl = (backupId) => {
81
- return `https://compute.leaflow.cloud/api/v1/backups/${encodeURIComponent(String(backupId))}`;
82
- };
83
- /**
84
- * @summary Rename a backup
85
- */
86
- export const renameBackup = async (backupId, renameBackupRequestBody, options, fetchFn) => {
87
- const getHeaders = (h) => {
88
- if (!h)
89
- return {};
90
- if (h instanceof Headers)
91
- return Object.fromEntries(h.entries());
92
- if (Symbol.iterator in h) {
93
- return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
94
- }
95
- const headers = {};
96
- for (const [name, value] of Object.entries(h)) {
97
- if (value !== undefined)
98
- headers[name] = value;
99
- }
100
- return headers;
101
- };
102
- const res = await (fetchFn ?? fetch)(getRenameBackupUrl(backupId), {
103
- ...options,
104
- method: "PATCH",
105
- headers: { "Content-Type": "application/json", ...getHeaders(options?.headers) },
106
- body: JSON.stringify(renameBackupRequestBody),
107
- });
108
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
109
- const data = body ? JSON.parse(body) : {};
110
- return { data, status: res.status, headers: res.headers };
111
- };
112
- export const getDeleteBackupUrl = (backupId) => {
113
- return `https://compute.leaflow.cloud/api/v1/backups/${encodeURIComponent(String(backupId))}`;
114
- };
115
- /**
116
- * Independent of the source disk: deletion succeeds whether or not that disk still exists. Metering of the backup ends once it is deleted.
117
- * @summary Delete a backup
118
- */
119
- export const deleteBackup = async (backupId, options, fetchFn) => {
120
- const res = await (fetchFn ?? fetch)(getDeleteBackupUrl(backupId), {
121
- ...options,
122
- method: "DELETE",
123
- });
124
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
125
- const data = body ? JSON.parse(body) : {};
126
- return { data, status: res.status, headers: res.headers };
127
- };
128
- export const getRestoreBackupUrl = (backupId) => {
129
- return `https://compute.leaflow.cloud/api/v1/backups/${encodeURIComponent(String(backupId))}:restore`;
130
- };
131
- /**
132
- * Restores onto a **newly created** disk. The source disk is unaffected and need not still exist.
133
- *
134
- * The target disk type may belong to another availability zone of the same region, and its capacity must not be smaller than the backup. Returns the new disk as `pending` with its Checkout Session; it cannot be attached until it is `available`.
135
- * @summary Restore from a backup
136
- */
137
- export const restoreBackup = async (backupId, restoreBackupRequestBody, options, fetchFn) => {
138
- const getHeaders = (h) => {
139
- if (!h)
140
- return {};
141
- if (h instanceof Headers)
142
- return Object.fromEntries(h.entries());
143
- if (Symbol.iterator in h) {
144
- return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
145
- }
146
- const headers = {};
147
- for (const [name, value] of Object.entries(h)) {
148
- if (value !== undefined)
149
- headers[name] = value;
150
- }
151
- return headers;
152
- };
153
- const res = await (fetchFn ?? fetch)(getRestoreBackupUrl(backupId), {
154
- ...options,
155
- method: "POST",
156
- headers: { "Content-Type": "application/json", ...getHeaders(options?.headers) },
157
- body: JSON.stringify(restoreBackupRequestBody),
158
- });
159
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
160
- const data = body ? JSON.parse(body) : {};
161
- return { data, status: res.status, headers: res.headers };
162
- };
163
- export const getListDiskTypesUrl = (params) => {
164
- const normalizedParams = new URLSearchParams();
165
- Object.entries(params || {}).forEach(([key, value]) => {
166
- if (value !== undefined) {
167
- normalizedParams.append(key, value === null ? "null" : String(value));
168
- }
169
- });
170
- const stringifiedParams = normalizedParams.toString();
171
- return stringifiedParams.length > 0
172
- ? `https://compute.leaflow.cloud/api/v1/disk-types?${stringifiedParams}`
173
- : `https://compute.leaflow.cloud/api/v1/disk-types`;
174
- };
175
- /**
176
- * Only disk types currently on sale are listed, both system disk types and data disk types; `purpose` narrows the list to one of the two. A withdrawn one disappears from here and can no longer be bought, while the disks already on it keep working and can still be resized.
177
- * @summary List disk types on sale
178
- */
179
- export const listDiskTypes = async (params, options, fetchFn) => {
180
- const res = await (fetchFn ?? fetch)(getListDiskTypesUrl(params), {
181
- ...options,
182
- method: "GET",
183
- });
184
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
185
- const data = body ? JSON.parse(body) : {};
186
- return { data, status: res.status, headers: res.headers };
187
- };
188
- export const getGetDiskTypeUrl = (diskTypeId) => {
189
- return `https://compute.leaflow.cloud/api/v1/disk-types/${encodeURIComponent(String(diskTypeId))}`;
190
- };
191
- /**
192
- * Retrieve capacity and performance constraints for an existing disk, including system disk types and types withdrawn from sale.
193
- * @summary Get a disk type
194
- */
195
- export const getDiskType = async (diskTypeId, options, fetchFn) => {
196
- const res = await (fetchFn ?? fetch)(getGetDiskTypeUrl(diskTypeId), {
197
- ...options,
198
- method: "GET",
199
- });
200
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
201
- const data = body ? JSON.parse(body) : {};
202
- return { data, status: res.status, headers: res.headers };
203
- };
204
- export const getListImagesUrl = (params) => {
205
- const normalizedParams = new URLSearchParams();
206
- Object.entries(params || {}).forEach(([key, value]) => {
207
- if (value !== undefined) {
208
- normalizedParams.append(key, value === null ? "null" : String(value));
209
- }
210
- });
211
- const stringifiedParams = normalizedParams.toString();
212
- return stringifiedParams.length > 0
213
- ? `https://compute.leaflow.cloud/api/v1/images?${stringifiedParams}`
214
- : `https://compute.leaflow.cloud/api/v1/images`;
215
- };
216
- /**
217
- * Lists the public images on sale together with the private images of this project. `visibility` narrows the list to one of the two.
218
- *
219
- * A public image is offered to every project. Only public images currently on sale are listed: one the platform withdraws disappears from here and can no longer install new instances, while the instances already running it keep running and can still be rebuilt onto it.
220
- *
221
- * A private image belongs to this project, which captured it from one of its instances, and is listed in every status, including while its capture is in progress and after the capture failed.
222
- *
223
- * An image can only be used in the region that holds it. An image whose `min_ram_mb` exceeds the memory of the selected instance type cannot boot; filter the options accordingly.
224
- * @summary List images
225
- */
226
- export const listImages = async (params, options, fetchFn) => {
227
- const res = await (fetchFn ?? fetch)(getListImagesUrl(params), {
228
- ...options,
229
- method: "GET",
230
- });
231
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
232
- const data = body ? JSON.parse(body) : {};
233
- return { data, status: res.status, headers: res.headers };
234
- };
235
- export const getCreateImageUrl = () => {
236
- return `https://compute.leaflow.cloud/api/v1/images`;
237
- };
238
- /**
239
- * Creates a private image of this project from the system disk of the instance; data disks are not included. The resulting image can create instances and rebuild them, and remains usable after the source instance is released.
240
- *
241
- * **The image reflects the moment the capture started. Later changes to the instance are not included.** The image is returned as `pending` with its Checkout Session, and the capture starts only once the order is accepted.
242
- *
243
- * The capture then has two phases, reported by the status of the image:
244
- *
245
- * - `provisioning` — the system disk is being read, usually for tens of seconds. The instance remains usable during this phase, although stopping it first is recommended for consistency.
246
- * - `uploading` — no longer tied to the system disk. **The instance may be started at this point; there is no need to wait for the capture to finish.** The duration of this phase is proportional to the size of the system disk, roughly 3 minutes for 20 GB.
247
- *
248
- * The file system of a running instance may be captured mid-write, in which case the image is equivalent to the disk contents after a power loss. Where consistency matters, stop the instance before starting the capture and start it again once the status becomes `uploading`.
249
- *
250
- * The instance can be started, stopped and used normally during the capture, but cannot be released.
251
- *
252
- * The image is billed for the storage it occupies, under the region's `private_image_billing`. Quote it with Billing first.
253
- * @summary Capture an instance as a private image
254
- */
255
- export const createImage = async (createImageRequestBody, options, fetchFn) => {
256
- const getHeaders = (h) => {
257
- if (!h)
258
- return {};
259
- if (h instanceof Headers)
260
- return Object.fromEntries(h.entries());
261
- if (Symbol.iterator in h) {
262
- return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
263
- }
264
- const headers = {};
265
- for (const [name, value] of Object.entries(h)) {
266
- if (value !== undefined)
267
- headers[name] = value;
268
- }
269
- return headers;
270
- };
271
- const res = await (fetchFn ?? fetch)(getCreateImageUrl(), {
272
- ...options,
273
- method: "POST",
274
- headers: { "Content-Type": "application/json", ...getHeaders(options?.headers) },
275
- body: JSON.stringify(createImageRequestBody),
276
- });
277
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
278
- const data = body ? JSON.parse(body) : {};
279
- return { data, status: res.status, headers: res.headers };
280
- };
281
- export const getGetImageUrl = (imageId) => {
282
- return `https://compute.leaflow.cloud/api/v1/images/${encodeURIComponent(String(imageId))}`;
283
- };
284
- /**
285
- * Returns a public image, or a private image of this project; any other image is reported as not found. Use this endpoint to poll capture progress. When `status` is `failed`, `failure_reason` states why.
286
- * @summary Retrieve an image
287
- */
288
- export const getImage = async (imageId, options, fetchFn) => {
289
- const res = await (fetchFn ?? fetch)(getGetImageUrl(imageId), {
290
- ...options,
291
- method: "GET",
292
- });
293
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
294
- const data = body ? JSON.parse(body) : {};
295
- return { data, status: res.status, headers: res.headers };
296
- };
297
- export const getRenameImageUrl = (imageId) => {
298
- return `https://compute.leaflow.cloud/api/v1/images/${encodeURIComponent(String(imageId))}`;
299
- };
300
- /**
301
- * Only a private image of this project can be renamed; any other image is reported as not found.
302
- * @summary Rename a private image
303
- */
304
- export const renameImage = async (imageId, renameImageRequestBody, options, fetchFn) => {
305
- const getHeaders = (h) => {
306
- if (!h)
307
- return {};
308
- if (h instanceof Headers)
309
- return Object.fromEntries(h.entries());
310
- if (Symbol.iterator in h) {
311
- return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
312
- }
313
- const headers = {};
314
- for (const [name, value] of Object.entries(h)) {
315
- if (value !== undefined)
316
- headers[name] = value;
317
- }
318
- return headers;
319
- };
320
- const res = await (fetchFn ?? fetch)(getRenameImageUrl(imageId), {
321
- ...options,
322
- method: "PATCH",
323
- headers: { "Content-Type": "application/json", ...getHeaders(options?.headers) },
324
- body: JSON.stringify(renameImageRequestBody),
325
- });
326
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
327
- const data = body ? JSON.parse(body) : {};
328
- return { data, status: res.status, headers: res.headers };
329
- };
330
- export const getDeleteImageUrl = (imageId, params) => {
331
- const normalizedParams = new URLSearchParams();
332
- Object.entries(params || {}).forEach(([key, value]) => {
333
- if (value !== undefined) {
334
- normalizedParams.append(key, value === null ? "null" : String(value));
335
- }
336
- });
337
- const stringifiedParams = normalizedParams.toString();
338
- return stringifiedParams.length > 0
339
- ? `https://compute.leaflow.cloud/api/v1/images/${encodeURIComponent(String(imageId))}?${stringifiedParams}`
340
- : `https://compute.leaflow.cloud/api/v1/images/${encodeURIComponent(String(imageId))}`;
341
- };
342
- /**
343
- * Only a private image of this project can be deleted; any other image is reported as not found.
344
- *
345
- * Deletion is rejected while instances created from the image still exist, as they need it in order to be rebuilt.
346
- *
347
- * An image whose capture has not finished can be deleted; the capture is aborted. This is the one operation accepted while the `create` operation is in progress.
348
- *
349
- * When subscriptions pay for the image, its `release_subscription_ids`, this request cancels them in Billing as `cancellation_mode` says, and the response carries that cancellation. Canceled now, they are refunded under their terms and release begins when Billing begins the cancellation; canceled at the end of their paid period, the image is kept until `scheduled_at`. Deleting again while the cancellation is open returns it. Without subscriptions, deletion begins at once and `cancellation` is null.
350
- * @summary Delete a private image
351
- */
352
- export const deleteImage = async (imageId, params, options, fetchFn) => {
353
- const res = await (fetchFn ?? fetch)(getDeleteImageUrl(imageId, params), {
354
- ...options,
355
- method: "DELETE",
356
- });
357
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
358
- const data = body ? JSON.parse(body) : {};
359
- return { data, status: res.status, headers: res.headers };
360
- };
361
- export const getListInstanceTypesUrl = (params) => {
362
- const normalizedParams = new URLSearchParams();
363
- Object.entries(params || {}).forEach(([key, value]) => {
364
- if (value !== undefined) {
365
- normalizedParams.append(key, value === null ? "null" : String(value));
366
- }
367
- });
368
- const stringifiedParams = normalizedParams.toString();
369
- return stringifiedParams.length > 0
370
- ? `https://compute.leaflow.cloud/api/v1/instance-types?${stringifiedParams}`
371
- : `https://compute.leaflow.cloud/api/v1/instance-types`;
372
- };
373
- /**
374
- * Only instance types currently on sale are listed. A withdrawn one disappears from here and can no longer be ordered, while the instances already running it keep running.
375
- * @summary List instance types on sale
376
- */
377
- export const listInstanceTypes = async (params, options, fetchFn) => {
378
- const res = await (fetchFn ?? fetch)(getListInstanceTypesUrl(params), {
379
- ...options,
380
- method: "GET",
381
- });
382
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
383
- const data = body ? JSON.parse(body) : {};
384
- return { data, status: res.status, headers: res.headers };
385
- };
386
- export const getListRegionsUrl = (params) => {
387
- const normalizedParams = new URLSearchParams();
388
- Object.entries(params || {}).forEach(([key, value]) => {
389
- if (value !== undefined) {
390
- normalizedParams.append(key, value === null ? "null" : String(value));
391
- }
392
- });
393
- const stringifiedParams = normalizedParams.toString();
394
- return stringifiedParams.length > 0
395
- ? `https://compute.leaflow.cloud/api/v1/regions?${stringifiedParams}`
396
- : `https://compute.leaflow.cloud/api/v1/regions`;
397
- };
398
- /**
399
- * @summary List available regions
400
- */
401
- export const listRegions = async (params, options, fetchFn) => {
402
- const res = await (fetchFn ?? fetch)(getListRegionsUrl(params), {
403
- ...options,
404
- method: "GET",
405
- });
406
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
407
- const data = body ? JSON.parse(body) : {};
408
- return { data, status: res.status, headers: res.headers };
409
- };
410
- export const getListAvailabilityZonesUrl = (regionId, params) => {
411
- const normalizedParams = new URLSearchParams();
412
- Object.entries(params || {}).forEach(([key, value]) => {
413
- if (value !== undefined) {
414
- normalizedParams.append(key, value === null ? "null" : String(value));
415
- }
416
- });
417
- const stringifiedParams = normalizedParams.toString();
418
- return stringifiedParams.length > 0
419
- ? `https://compute.leaflow.cloud/api/v1/regions/${encodeURIComponent(String(regionId))}/availability-zones?${stringifiedParams}`
420
- : `https://compute.leaflow.cloud/api/v1/regions/${encodeURIComponent(String(regionId))}/availability-zones`;
421
- };
422
- /**
423
- * A disk and an instance must reside in the same availability zone to be attached. Confirm the zone before creating either.
424
- * @summary List the availability zones of a region
425
- */
426
- export const listAvailabilityZones = async (regionId, params, options, fetchFn) => {
427
- const res = await (fetchFn ?? fetch)(getListAvailabilityZonesUrl(regionId, params), {
428
- ...options,
429
- method: "GET",
430
- });
431
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
432
- const data = body ? JSON.parse(body) : {};
433
- return { data, status: res.status, headers: res.headers };
434
- };
435
- export const getListDisksUrl = (params) => {
436
- const normalizedParams = new URLSearchParams();
437
- Object.entries(params || {}).forEach(([key, value]) => {
438
- if (value !== undefined) {
439
- normalizedParams.append(key, value === null ? "null" : String(value));
440
- }
441
- });
442
- const stringifiedParams = normalizedParams.toString();
443
- return stringifiedParams.length > 0
444
- ? `https://compute.leaflow.cloud/api/v1/disks?${stringifiedParams}`
445
- : `https://compute.leaflow.cloud/api/v1/disks`;
446
- };
447
- /**
448
- * When both `region_code` and `availability_zone` are supplied, only disks attachable to an instance at that location are returned.
449
- * @summary List disks
450
- */
451
- export const listDisks = async (params, options, fetchFn) => {
452
- const res = await (fetchFn ?? fetch)(getListDisksUrl(params), {
453
- ...options,
454
- method: "GET",
455
- });
456
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
457
- const data = body ? JSON.parse(body) : {};
458
- return { data, status: res.status, headers: res.headers };
459
- };
460
- export const getCreateDiskUrl = () => {
461
- return `https://compute.leaflow.cloud/api/v1/disks`;
462
- };
463
- /**
464
- * The disk is created in the availability zone of the selected disk type, and an instance must reside in the same zone to attach it. Choosing the disk type therefore determines the zone.
465
- *
466
- * A disk type that is off sale is rejected with `DISK_TYPE_OFF_SALE`, even though its identifier still resolves. Types that are off sale do not appear in the disk type listing; disks already bought on one keep working and can still be resized.
467
- * @summary Create a disk
468
- */
469
- export const createDisk = async (createDiskRequestBody, options, fetchFn) => {
470
- const getHeaders = (h) => {
471
- if (!h)
472
- return {};
473
- if (h instanceof Headers)
474
- return Object.fromEntries(h.entries());
475
- if (Symbol.iterator in h) {
476
- return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
477
- }
478
- const headers = {};
479
- for (const [name, value] of Object.entries(h)) {
480
- if (value !== undefined)
481
- headers[name] = value;
482
- }
483
- return headers;
484
- };
485
- const res = await (fetchFn ?? fetch)(getCreateDiskUrl(), {
486
- ...options,
487
- method: "POST",
488
- headers: { "Content-Type": "application/json", ...getHeaders(options?.headers) },
489
- body: JSON.stringify(createDiskRequestBody),
490
- });
491
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
492
- const data = body ? JSON.parse(body) : {};
493
- return { data, status: res.status, headers: res.headers };
494
- };
495
- export const getGetDiskUrl = (diskId) => {
496
- return `https://compute.leaflow.cloud/api/v1/disks/${encodeURIComponent(String(diskId))}`;
497
- };
498
- /**
499
- * Returns the stored state of the disk; it does not query the cloud.
500
- * @summary Retrieve a disk
501
- */
502
- export const getDisk = async (diskId, options, fetchFn) => {
503
- const res = await (fetchFn ?? fetch)(getGetDiskUrl(diskId), {
504
- ...options,
505
- method: "GET",
506
- });
507
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
508
- const data = body ? JSON.parse(body) : {};
509
- return { data, status: res.status, headers: res.headers };
510
- };
511
- export const getRenameDiskUrl = (diskId) => {
512
- return `https://compute.leaflow.cloud/api/v1/disks/${encodeURIComponent(String(diskId))}`;
513
- };
514
- /**
515
- * Changes the name only. Use the resize endpoint for capacity; type and availability zone are immutable.
516
- * @summary Rename a disk
517
- */
518
- export const renameDisk = async (diskId, renameDiskRequestBody, options, fetchFn) => {
519
- const getHeaders = (h) => {
520
- if (!h)
521
- return {};
522
- if (h instanceof Headers)
523
- return Object.fromEntries(h.entries());
524
- if (Symbol.iterator in h) {
525
- return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
526
- }
527
- const headers = {};
528
- for (const [name, value] of Object.entries(h)) {
529
- if (value !== undefined)
530
- headers[name] = value;
531
- }
532
- return headers;
533
- };
534
- const res = await (fetchFn ?? fetch)(getRenameDiskUrl(diskId), {
535
- ...options,
536
- method: "PATCH",
537
- headers: { "Content-Type": "application/json", ...getHeaders(options?.headers) },
538
- body: JSON.stringify(renameDiskRequestBody),
539
- });
540
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
541
- const data = body ? JSON.parse(body) : {};
542
- return { data, status: res.status, headers: res.headers };
543
- };
544
- export const getDeleteDiskUrl = (diskId, params) => {
545
- const normalizedParams = new URLSearchParams();
546
- Object.entries(params || {}).forEach(([key, value]) => {
547
- if (value !== undefined) {
548
- normalizedParams.append(key, value === null ? "null" : String(value));
549
- }
550
- });
551
- const stringifiedParams = normalizedParams.toString();
552
- return stringifiedParams.length > 0
553
- ? `https://compute.leaflow.cloud/api/v1/disks/${encodeURIComponent(String(diskId))}?${stringifiedParams}`
554
- : `https://compute.leaflow.cloud/api/v1/disks/${encodeURIComponent(String(diskId))}`;
555
- };
556
- /**
557
- * Deletion is rejected while the disk is attached, or while snapshots created from it still exist.
558
- *
559
- * When subscriptions pay for the disk, its `release_subscription_ids`, this request cancels them in Billing as `cancellation_mode` says, and the response carries that cancellation. Canceled now, they are refunded under their terms and release begins when Billing begins the cancellation; canceled at the end of their paid period, the disk is kept until `scheduled_at`. Deleting again while the cancellation is open returns it. Without subscriptions, deletion begins at once and `cancellation` is null.
560
- * @summary Delete a disk
561
- */
562
- export const deleteDisk = async (diskId, params, options, fetchFn) => {
563
- const res = await (fetchFn ?? fetch)(getDeleteDiskUrl(diskId, params), {
564
- ...options,
565
- method: "DELETE",
566
- });
567
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
568
- const data = body ? JSON.parse(body) : {};
569
- return { data, status: res.status, headers: res.headers };
570
- };
571
- export const getResizeDiskUrl = (diskId) => {
572
- return `https://compute.leaflow.cloud/api/v1/disks/${encodeURIComponent(String(diskId))}:resize`;
573
- };
574
- /**
575
- * Capacity can only be increased; shrinking is not supported. Returns the disk with the Checkout Session for the resize, which keeps the disk's usage type and period. The disk shows the `resize` operation until the resize is applied, its Checkout Session expires or its order is canceled, so other operations and a second resize are refused with `COMPUTE_RESOURCE_BUSY` meanwhile. The disk keeps its current size until the resize is applied; once `size_gb` shows the new size, extend the file system inside the instance. If checkout is not completed, the order is not accepted or the resize fails, the disk keeps its size and Billing shows the outcome.
576
- *
577
- * **An attached data disk whose performance scales with its size must be detached before it is resized.** The performance of an attached disk does not change until the disk is detached and attached again, so such a request is refused with `DISK_RESIZE_NEEDS_DETACH` rather than providing the new capacity at the performance of the previous size. Detach the disk, resize it, and attach it again.
578
- *
579
- * The request is refused only when the new size has a different performance level. A disk whose type has no QoS level, or whose performance has already reached the maximum of its type, can be resized while attached.
580
- *
581
- * **A system disk can be resized while attached**, because a system disk cannot be detached. System disk types use a performance level that does not scale with size, so resizing a system disk does not change its performance.
582
- * @summary Resize a disk
583
- */
584
- export const resizeDisk = async (diskId, resizeDiskRequestBody, options, fetchFn) => {
585
- const getHeaders = (h) => {
586
- if (!h)
587
- return {};
588
- if (h instanceof Headers)
589
- return Object.fromEntries(h.entries());
590
- if (Symbol.iterator in h) {
591
- return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
592
- }
593
- const headers = {};
594
- for (const [name, value] of Object.entries(h)) {
595
- if (value !== undefined)
596
- headers[name] = value;
597
- }
598
- return headers;
599
- };
600
- const res = await (fetchFn ?? fetch)(getResizeDiskUrl(diskId), {
601
- ...options,
602
- method: "POST",
603
- headers: { "Content-Type": "application/json", ...getHeaders(options?.headers) },
604
- body: JSON.stringify(resizeDiskRequestBody),
605
- });
606
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
607
- const data = body ? JSON.parse(body) : {};
608
- return { data, status: res.status, headers: res.headers };
609
- };
610
- export const getRevertDiskUrl = (diskId) => {
611
- return `https://compute.leaflow.cloud/api/v1/disks/${encodeURIComponent(String(diskId))}:revert`;
612
- };
613
- /**
614
- * Restores the contents of the disk to the moment the snapshot was taken. **All data written after that moment is lost and cannot be recovered.**
615
- *
616
- * Three restrictions apply: only the most recent snapshot of the disk can be reverted to; the disk must be detached from its instance first; and a disk resized since the snapshot was taken cannot be reverted. To return to an earlier point in time, or to keep the existing disk, create a new disk from the snapshot instead.
617
- *
618
- * The disk shows the `revert` operation until the revert is complete.
619
- * @summary Revert to a snapshot
620
- */
621
- export const revertDisk = async (diskId, revertDiskRequestBody, options, fetchFn) => {
622
- const getHeaders = (h) => {
623
- if (!h)
624
- return {};
625
- if (h instanceof Headers)
626
- return Object.fromEntries(h.entries());
627
- if (Symbol.iterator in h) {
628
- return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
629
- }
630
- const headers = {};
631
- for (const [name, value] of Object.entries(h)) {
632
- if (value !== undefined)
633
- headers[name] = value;
634
- }
635
- return headers;
636
- };
637
- const res = await (fetchFn ?? fetch)(getRevertDiskUrl(diskId), {
638
- ...options,
639
- method: "POST",
640
- headers: { "Content-Type": "application/json", ...getHeaders(options?.headers) },
641
- body: JSON.stringify(revertDiskRequestBody),
642
- });
643
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
644
- const data = body ? JSON.parse(body) : {};
645
- return { data, status: res.status, headers: res.headers };
646
- };
647
- export const getListFloatingIpsUrl = (params) => {
648
- const normalizedParams = new URLSearchParams();
649
- Object.entries(params || {}).forEach(([key, value]) => {
650
- if (value !== undefined) {
651
- normalizedParams.append(key, value === null ? "null" : String(value));
652
- }
653
- });
654
- const stringifiedParams = normalizedParams.toString();
655
- return stringifiedParams.length > 0
656
- ? `https://compute.leaflow.cloud/api/v1/floating-ips?${stringifiedParams}`
657
- : `https://compute.leaflow.cloud/api/v1/floating-ips`;
658
- };
659
- /**
660
- * @summary List floating IPs
661
- */
662
- export const listFloatingIps = async (params, options, fetchFn) => {
663
- const res = await (fetchFn ?? fetch)(getListFloatingIpsUrl(params), {
664
- ...options,
665
- method: "GET",
666
- });
667
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
668
- const data = body ? JSON.parse(body) : {};
669
- return { data, status: res.status, headers: res.headers };
670
- };
671
- export const getAllocateFloatingIpUrl = () => {
672
- return `https://compute.leaflow.cloud/api/v1/floating-ips`;
673
- };
674
- /**
675
- * If the private network is not yet connected to the internet, connectivity is established as part of this call.
676
- *
677
- * Returns the floating IP as `pending` with its Checkout Session; `address` is null until the address is allocated after the order is accepted. A requested `address` is not held while pending; if it is no longer available then, the floating IP ends `failed` with `provisioning_failed` and its charge is refunded.
678
- *
679
- * IPv6 is not requested through this endpoint. IPv6 addresses are assigned to instances by the private network; enable IPv6 on that network instead.
680
- *
681
- * Refused with `PRIVATE_NETWORK_UNAVAILABLE`, before any Checkout Session is created, when the private network's `status` is not `available`. `meta.private_network_id` names it.
682
- * @summary Allocate a floating IP
683
- */
684
- export const allocateFloatingIp = async (allocateFloatingIPRequestBody, options, fetchFn) => {
685
- const getHeaders = (h) => {
686
- if (!h)
687
- return {};
688
- if (h instanceof Headers)
689
- return Object.fromEntries(h.entries());
690
- if (Symbol.iterator in h) {
691
- return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
692
- }
693
- const headers = {};
694
- for (const [name, value] of Object.entries(h)) {
695
- if (value !== undefined)
696
- headers[name] = value;
697
- }
698
- return headers;
699
- };
700
- const res = await (fetchFn ?? fetch)(getAllocateFloatingIpUrl(), {
701
- ...options,
702
- method: "POST",
703
- headers: { "Content-Type": "application/json", ...getHeaders(options?.headers) },
704
- body: JSON.stringify(allocateFloatingIPRequestBody),
705
- });
706
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
707
- const data = body ? JSON.parse(body) : {};
708
- return { data, status: res.status, headers: res.headers };
709
- };
710
- export const getGetFloatingIpUrl = (floatingIpId) => {
711
- return `https://compute.leaflow.cloud/api/v1/floating-ips/${encodeURIComponent(String(floatingIpId))}`;
712
- };
713
- /**
714
- * @summary Retrieve a floating IP
715
- */
716
- export const getFloatingIp = async (floatingIpId, options, fetchFn) => {
717
- const res = await (fetchFn ?? fetch)(getGetFloatingIpUrl(floatingIpId), {
718
- ...options,
719
- method: "GET",
720
- });
721
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
722
- const data = body ? JSON.parse(body) : {};
723
- return { data, status: res.status, headers: res.headers };
724
- };
725
- export const getReleaseFloatingIpUrl = (floatingIpId, params) => {
726
- const normalizedParams = new URLSearchParams();
727
- Object.entries(params || {}).forEach(([key, value]) => {
728
- if (value !== undefined) {
729
- normalizedParams.append(key, value === null ? "null" : String(value));
730
- }
731
- });
732
- const stringifiedParams = normalizedParams.toString();
733
- return stringifiedParams.length > 0
734
- ? `https://compute.leaflow.cloud/api/v1/floating-ips/${encodeURIComponent(String(floatingIpId))}?${stringifiedParams}`
735
- : `https://compute.leaflow.cloud/api/v1/floating-ips/${encodeURIComponent(String(floatingIpId))}`;
736
- };
737
- /**
738
- * Releases the floating IP after unbinding it. The floating IP shows the `delete` operation until it is released.
739
- *
740
- * When subscriptions pay for the address, its `release_subscription_ids`, this request cancels them in Billing as `cancellation_mode` says, and the response carries that cancellation. Canceled now, they are refunded under their terms and release begins when Billing begins the cancellation; canceled at the end of their paid period, the floating IP is kept until `scheduled_at`. Deleting again while the cancellation is open returns it. Without subscriptions, release begins at once and `cancellation` is null.
741
- * @summary Release a floating IP
742
- */
743
- export const releaseFloatingIp = async (floatingIpId, params, options, fetchFn) => {
744
- const res = await (fetchFn ?? fetch)(getReleaseFloatingIpUrl(floatingIpId, params), {
745
- ...options,
746
- method: "DELETE",
747
- });
748
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
749
- const data = body ? JSON.parse(body) : {};
750
- return { data, status: res.status, headers: res.headers };
751
- };
752
- export const getSetFloatingIpBandwidthUrl = (floatingIpId) => {
753
- return `https://compute.leaflow.cloud/api/v1/floating-ips/${encodeURIComponent(String(floatingIpId))}/bandwidth`;
754
- };
755
- /**
756
- * Changes the bandwidth of this floating IP through an order that keeps its usage type and period; no separate bandwidth resource is created. The limit applies to inbound and outbound traffic alike. The floating IP shows the `set_bandwidth` operation until the change is applied, its Checkout Session expires or its order is canceled, so other operations and a second change are refused with `COMPUTE_RESOURCE_BUSY` meanwhile. The current limit stays in effect until the change is applied. If checkout is not completed, the order is not accepted or the change fails, `bandwidth_mbps` keeps its value and Billing shows the outcome.
757
- *
758
- * While the address is bound to an instance, the limit must not exceed the `max_bandwidth_mbps` of that instance's type; a higher limit is refused with `INSTANCE_BANDWIDTH_CEILING`. The limit of an address that is not bound is checked when the address is bound to an instance.
759
- * @summary Set the bandwidth limit
760
- */
761
- export const setFloatingIpBandwidth = async (floatingIpId, setFloatingIPBandwidthRequestBody, options, fetchFn) => {
762
- const getHeaders = (h) => {
763
- if (!h)
764
- return {};
765
- if (h instanceof Headers)
766
- return Object.fromEntries(h.entries());
767
- if (Symbol.iterator in h) {
768
- return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
769
- }
770
- const headers = {};
771
- for (const [name, value] of Object.entries(h)) {
772
- if (value !== undefined)
773
- headers[name] = value;
774
- }
775
- return headers;
776
- };
777
- const res = await (fetchFn ?? fetch)(getSetFloatingIpBandwidthUrl(floatingIpId), {
778
- ...options,
779
- method: "PUT",
780
- headers: { "Content-Type": "application/json", ...getHeaders(options?.headers) },
781
- body: JSON.stringify(setFloatingIPBandwidthRequestBody),
782
- });
783
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
784
- const data = body ? JSON.parse(body) : {};
785
- return { data, status: res.status, headers: res.headers };
786
- };
787
- export const getBindFloatingIpUrl = (floatingIpId) => {
788
- return `https://compute.leaflow.cloud/api/v1/floating-ips/${encodeURIComponent(String(floatingIpId))}:bind`;
789
- };
790
- /**
791
- * The floating IP shows the `bind` operation until the binding is confirmed.
792
- * @summary Bind a floating IP to a network interface
793
- */
794
- export const bindFloatingIp = async (floatingIpId, bindFloatingIPRequestBody, options, fetchFn) => {
795
- const getHeaders = (h) => {
796
- if (!h)
797
- return {};
798
- if (h instanceof Headers)
799
- return Object.fromEntries(h.entries());
800
- if (Symbol.iterator in h) {
801
- return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
802
- }
803
- const headers = {};
804
- for (const [name, value] of Object.entries(h)) {
805
- if (value !== undefined)
806
- headers[name] = value;
807
- }
808
- return headers;
809
- };
810
- const res = await (fetchFn ?? fetch)(getBindFloatingIpUrl(floatingIpId), {
811
- ...options,
812
- method: "POST",
813
- headers: { "Content-Type": "application/json", ...getHeaders(options?.headers) },
814
- body: JSON.stringify(bindFloatingIPRequestBody),
815
- });
816
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
817
- const data = body ? JSON.parse(body) : {};
818
- return { data, status: res.status, headers: res.headers };
819
- };
820
- export const getUnbindFloatingIpUrl = (floatingIpId) => {
821
- return `https://compute.leaflow.cloud/api/v1/floating-ips/${encodeURIComponent(String(floatingIpId))}:unbind`;
822
- };
823
- /**
824
- * The address remains held by the project and simply no longer points at any network interface. The floating IP shows the `unbind` operation until the change is confirmed.
825
- * @summary Unbind a floating IP
826
- */
827
- export const unbindFloatingIp = async (floatingIpId, options, fetchFn) => {
828
- const res = await (fetchFn ?? fetch)(getUnbindFloatingIpUrl(floatingIpId), {
829
- ...options,
830
- method: "POST",
831
- });
832
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
833
- const data = body ? JSON.parse(body) : {};
834
- return { data, status: res.status, headers: res.headers };
835
- };
836
- export const getListInstancesUrl = (params) => {
837
- const normalizedParams = new URLSearchParams();
838
- Object.entries(params || {}).forEach(([key, value]) => {
839
- if (value !== undefined) {
840
- normalizedParams.append(key, value === null ? "null" : String(value));
841
- }
842
- });
843
- const stringifiedParams = normalizedParams.toString();
844
- return stringifiedParams.length > 0
845
- ? `https://compute.leaflow.cloud/api/v1/instances?${stringifiedParams}`
846
- : `https://compute.leaflow.cloud/api/v1/instances`;
847
- };
848
- /**
849
- * Every instance in the project, newest first, in their stored state.
850
- * @summary List instances
851
- */
852
- export const listInstances = async (params, options, fetchFn) => {
853
- const res = await (fetchFn ?? fetch)(getListInstancesUrl(params), {
854
- ...options,
855
- method: "GET",
856
- });
857
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
858
- const data = body ? JSON.parse(body) : {};
859
- return { data, status: res.status, headers: res.headers };
860
- };
861
- export const getLaunchInstanceUrl = () => {
862
- return `https://compute.leaflow.cloud/api/v1/instances`;
863
- };
864
- /**
865
- * Creates a Billing Checkout Session, including for metered pricing, and returns one `pending` instance per requested instance with it. `billing` applies to the instance, its system disk and its floating IP alike. A pending instance has no virtual machine, system disk or address, and is not metered.
866
- *
867
- * Creation starts once Billing accepts the order: the instance becomes `provisioning`, then `active`. With automatic checkout, insufficient funds refuse the request and nothing is created. With deferred checkout, the instances stay `pending` until the customer completes checkout in Billing and the order is paid; an expired Checkout Session, or a canceled or expired order, leaves them `failed` with `checkout_expired`, `order_canceled` or `order_expired`. Do not submit another creation request after paying. After an uncertain response, look the Checkout Session up in Billing before submitting again.
868
- *
869
- * Choose an image or existing disk through boot_disk, and exactly one of port_id or subnet_id. Existing ports, boot disks or floating IPs require count=1. They are not held while the instance is pending; if one is no longer usable when the order is accepted, the instance ends `failed` with `provisioning_failed`. Image boots require boot_disk; existing disks retain their own subscription. Instances, disks and public IPs keep their own subscription items on the same order.
870
- *
871
- * Instances of one request succeed or fail individually. Each instance, with its system disk, network interface and floating IP, is created or fails as a whole. Instances that were created are kept; each failed instance ends `failed` with `provisioning_failed`, its part of the order is refunded, and the order then ends `partially_completed`. Each instance is named after this request with a number appended.
872
- *
873
- * The network is checked before the Checkout Session is created, and a request it refuses orders and charges nothing. It is refused with `PRIVATE_NETWORK_UNAVAILABLE` when the private network's `status` is not `available`, `SUBNET_UNAVAILABLE` or `SECURITY_GROUP_UNAVAILABLE` when the subnet or a security group is not ready, `SECURITY_GROUP_OTHER_PRIVATE_NETWORK` when a security group belongs to another private network, and `PORT_UNAVAILABLE` when the port's `status` is not `available`. `meta` names the resource.
874
- * @summary Create instances
875
- */
876
- export const launchInstance = async (launchInstanceRequestBody, options, fetchFn) => {
877
- const getHeaders = (h) => {
878
- if (!h)
879
- return {};
880
- if (h instanceof Headers)
881
- return Object.fromEntries(h.entries());
882
- if (Symbol.iterator in h) {
883
- return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
884
- }
885
- const headers = {};
886
- for (const [name, value] of Object.entries(h)) {
887
- if (value !== undefined)
888
- headers[name] = value;
889
- }
890
- return headers;
891
- };
892
- const res = await (fetchFn ?? fetch)(getLaunchInstanceUrl(), {
893
- ...options,
894
- method: "POST",
895
- headers: { "Content-Type": "application/json", ...getHeaders(options?.headers) },
896
- body: JSON.stringify(launchInstanceRequestBody),
897
- });
898
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
899
- const data = body ? JSON.parse(body) : {};
900
- return { data, status: res.status, headers: res.headers };
901
- };
902
- export const getGetInstanceUrl = (instanceId) => {
903
- return `https://compute.leaflow.cloud/api/v1/instances/${encodeURIComponent(String(instanceId))}`;
904
- };
905
- /**
906
- * Returns the stored state of the instance; it does not query the cloud. Use it to poll creation progress.
907
- * @summary Retrieve an instance
908
- */
909
- export const getInstance = async (instanceId, options, fetchFn) => {
910
- const res = await (fetchFn ?? fetch)(getGetInstanceUrl(instanceId), {
911
- ...options,
912
- method: "GET",
913
- });
914
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
915
- const data = body ? JSON.parse(body) : {};
916
- return { data, status: res.status, headers: res.headers };
917
- };
918
- export const getRenameInstanceUrl = (instanceId) => {
919
- return `https://compute.leaflow.cloud/api/v1/instances/${encodeURIComponent(String(instanceId))}`;
920
- };
921
- /**
922
- * Changes the display name only. The hostname inside the instance is unchanged; it equals the instance id.
923
- * @summary Rename an instance
924
- */
925
- export const renameInstance = async (instanceId, renameInstanceRequestBody, options, fetchFn) => {
926
- const getHeaders = (h) => {
927
- if (!h)
928
- return {};
929
- if (h instanceof Headers)
930
- return Object.fromEntries(h.entries());
931
- if (Symbol.iterator in h) {
932
- return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
933
- }
934
- const headers = {};
935
- for (const [name, value] of Object.entries(h)) {
936
- if (value !== undefined)
937
- headers[name] = value;
938
- }
939
- return headers;
940
- };
941
- const res = await (fetchFn ?? fetch)(getRenameInstanceUrl(instanceId), {
942
- ...options,
943
- method: "PATCH",
944
- headers: { "Content-Type": "application/json", ...getHeaders(options?.headers) },
945
- body: JSON.stringify(renameInstanceRequestBody),
946
- });
947
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
948
- const data = body ? JSON.parse(body) : {};
949
- return { data, status: res.status, headers: res.headers };
950
- };
951
- export const getDeleteInstanceUrl = (instanceId, params) => {
952
- const normalizedParams = new URLSearchParams();
953
- Object.entries(params || {}).forEach(([key, value]) => {
954
- if (value !== undefined) {
955
- normalizedParams.append(key, value === null ? "null" : String(value));
956
- }
957
- });
958
- const stringifiedParams = normalizedParams.toString();
959
- return stringifiedParams.length > 0
960
- ? `https://compute.leaflow.cloud/api/v1/instances/${encodeURIComponent(String(instanceId))}?${stringifiedParams}`
961
- : `https://compute.leaflow.cloud/api/v1/instances/${encodeURIComponent(String(instanceId))}`;
962
- };
963
- /**
964
- * The system disk is deleted with the instance, and **snapshots created from the system disk are deleted with it**. Data disks are detached and kept, and their snapshots and backups are unaffected. The primary network interface is released with the instance.
965
- *
966
- * An instance being captured as a private image cannot be released. Wait for the capture to finish, or delete that image first.
967
- *
968
- * When subscriptions pay for the instance, or for a disk deleted with it, its `release_subscription_ids`, this request cancels them in Billing as `cancellation_mode` says, and the response carries that cancellation. Canceled now, they are refunded under their terms and release begins when Billing begins the cancellation; canceled at the end of their paid period, the instance is kept until `scheduled_at`. Deleting again while the cancellation is open returns it. Without subscriptions, release begins at once and `cancellation` is null.
969
- * @summary Release an instance
970
- */
971
- export const deleteInstance = async (instanceId, params, options, fetchFn) => {
972
- const res = await (fetchFn ?? fetch)(getDeleteInstanceUrl(instanceId, params), {
973
- ...options,
974
- method: "DELETE",
975
- });
976
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
977
- const data = body ? JSON.parse(body) : {};
978
- return { data, status: res.status, headers: res.headers };
979
- };
980
- export const getRunInstanceCommandUrl = (instanceId) => {
981
- return `https://compute.leaflow.cloud/api/v1/instances/${encodeURIComponent(String(instanceId))}/commands`;
982
- };
983
- /**
984
- * Runs one command over SSH and returns what it wrote. **This is not a shell.** There is no terminal, no standard input and no way to answer a prompt: a command that waits for input produces nothing and is killed at the timeout. Chain steps with `&&`, or write a script and run that.
985
- *
986
- * **A command that fails is still a 200.** Its failure is its own result, not this endpoint's: read `exit_code` for what it exited with and `stderr` for what it said, and decide from those. A `grep` that matches nothing exits 1 and is a perfectly successful call.
987
- *
988
- * The status therefore answers a different question — did the command run at all. A non-2xx means it did not, and nothing about the instance was changed by this request: it was suspended, not running or had no floating IP; or it refused the platform key; or the connection could not be opened. Retrying is meaningful in those cases and is not for a non-zero `exit_code`.
989
- *
990
- * Three conditions must hold; the instance is unreachable otherwise:
991
- *
992
- * - it is `active`
993
- * - a floating IP is bound to it, since this endpoint connects over the public internet
994
- * - its security group permits inbound TCP 22
995
- *
996
- * Authentication uses the key the platform attaches to every instance at creation, so nothing has to be set up first. The instance must have applied that key at first boot, which images without a full cloud-init do not do.
997
- *
998
- * **Do not pass secrets in the command.** Read them from a file on the instance instead: neither the command nor its output is a confidential channel.
999
- *
1000
- * Each stream is capped at 1 MiB. Beyond that the rest is discarded and `truncated` is true.
1001
- * @summary Run a command on an instance
1002
- */
1003
- export const runInstanceCommand = async (instanceId, runCommandRequestBody, options, fetchFn) => {
1004
- const getHeaders = (h) => {
1005
- if (!h)
1006
- return {};
1007
- if (h instanceof Headers)
1008
- return Object.fromEntries(h.entries());
1009
- if (Symbol.iterator in h) {
1010
- return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
1011
- }
1012
- const headers = {};
1013
- for (const [name, value] of Object.entries(h)) {
1014
- if (value !== undefined)
1015
- headers[name] = value;
1016
- }
1017
- return headers;
1018
- };
1019
- const res = await (fetchFn ?? fetch)(getRunInstanceCommandUrl(instanceId), {
1020
- ...options,
1021
- method: "POST",
1022
- headers: { "Content-Type": "application/json", ...getHeaders(options?.headers) },
1023
- body: JSON.stringify(runCommandRequestBody),
1024
- });
1025
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1026
- const data = body ? JSON.parse(body) : {};
1027
- return { data, status: res.status, headers: res.headers };
1028
- };
1029
- export const getOpenInstanceConsoleUrl = (instanceId) => {
1030
- return `https://compute.leaflow.cloud/api/v1/instances/${encodeURIComponent(String(instanceId))}/console`;
1031
- };
1032
- /**
1033
- * Operates the instance directly from a browser and does not require the instance to be reachable over the network, which makes it usable when a network misconfiguration prevents login.
1034
- *
1035
- * The returned address is single-use and expires within minutes. Request a new one before each use.
1036
- * @summary Open a remote console
1037
- */
1038
- export const openInstanceConsole = async (instanceId, options, fetchFn) => {
1039
- const res = await (fetchFn ?? fetch)(getOpenInstanceConsoleUrl(instanceId), {
1040
- ...options,
1041
- method: "POST",
1042
- });
1043
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1044
- const data = body ? JSON.parse(body) : {};
1045
- return { data, status: res.status, headers: res.headers };
1046
- };
1047
- export const getGetInstanceConsoleOutputUrl = (instanceId, params) => {
1048
- const normalizedParams = new URLSearchParams();
1049
- Object.entries(params || {}).forEach(([key, value]) => {
1050
- if (value !== undefined) {
1051
- normalizedParams.append(key, value === null ? "null" : String(value));
1052
- }
1053
- });
1054
- const stringifiedParams = normalizedParams.toString();
1055
- return stringifiedParams.length > 0
1056
- ? `https://compute.leaflow.cloud/api/v1/instances/${encodeURIComponent(String(instanceId))}/console-output?${stringifiedParams}`
1057
- : `https://compute.leaflow.cloud/api/v1/instances/${encodeURIComponent(String(instanceId))}/console-output`;
1058
- };
1059
- /**
1060
- * The raw text produced by the instance during boot and by the kernel. Consult it first when login fails or the remote console shows no output: it reveals where boot stopped, whether the system disk was mounted, and whether initialisation reported errors.
1061
- *
1062
- * Instances in an error state, and instances suspended by the platform, can be read as well.
1063
- * @summary Read the console output
1064
- */
1065
- export const getInstanceConsoleOutput = async (instanceId, params, options, fetchFn) => {
1066
- const res = await (fetchFn ?? fetch)(getGetInstanceConsoleOutputUrl(instanceId, params), {
1067
- ...options,
1068
- method: "GET",
1069
- });
1070
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1071
- const data = body ? JSON.parse(body) : {};
1072
- return { data, status: res.status, headers: res.headers };
1073
- };
1074
- export const getSetInstanceLabelsUrl = (instanceId) => {
1075
- return `https://compute.leaflow.cloud/api/v1/instances/${encodeURIComponent(String(instanceId))}/labels`;
1076
- };
1077
- /**
1078
- * Records what this instance is for, as key-value pairs. Nothing on the platform reads them.
1079
- *
1080
- * **The whole set is replaced**: whatever is absent from the request is removed.
1081
- *
1082
- * Do not put credentials here. Labels are visible to platform operators.
1083
- * @summary Replace an instance's labels
1084
- */
1085
- export const setInstanceLabels = async (instanceId, setInstanceLabelsRequestBody, options, fetchFn) => {
1086
- const getHeaders = (h) => {
1087
- if (!h)
1088
- return {};
1089
- if (h instanceof Headers)
1090
- return Object.fromEntries(h.entries());
1091
- if (Symbol.iterator in h) {
1092
- return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
1093
- }
1094
- const headers = {};
1095
- for (const [name, value] of Object.entries(h)) {
1096
- if (value !== undefined)
1097
- headers[name] = value;
1098
- }
1099
- return headers;
1100
- };
1101
- const res = await (fetchFn ?? fetch)(getSetInstanceLabelsUrl(instanceId), {
1102
- ...options,
1103
- method: "PUT",
1104
- headers: { "Content-Type": "application/json", ...getHeaders(options?.headers) },
1105
- body: JSON.stringify(setInstanceLabelsRequestBody),
1106
- });
1107
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1108
- const data = body ? JSON.parse(body) : {};
1109
- return { data, status: res.status, headers: res.headers };
1110
- };
1111
- export const getSetInstanceNotesUrl = (instanceId) => {
1112
- return `https://compute.leaflow.cloud/api/v1/instances/${encodeURIComponent(String(instanceId))}/notes`;
1113
- };
1114
- /**
1115
- * A free-text note about this instance — what it runs, and what to be careful about before touching it.
1116
- *
1117
- * **The whole note is replaced**; send an empty string to clear it.
1118
- *
1119
- * Do not put credentials here. The note is visible to platform operators.
1120
- * @summary Replace an instance's note
1121
- */
1122
- export const setInstanceNotes = async (instanceId, setInstanceNotesRequestBody, options, fetchFn) => {
1123
- const getHeaders = (h) => {
1124
- if (!h)
1125
- return {};
1126
- if (h instanceof Headers)
1127
- return Object.fromEntries(h.entries());
1128
- if (Symbol.iterator in h) {
1129
- return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
1130
- }
1131
- const headers = {};
1132
- for (const [name, value] of Object.entries(h)) {
1133
- if (value !== undefined)
1134
- headers[name] = value;
1135
- }
1136
- return headers;
1137
- };
1138
- const res = await (fetchFn ?? fetch)(getSetInstanceNotesUrl(instanceId), {
1139
- ...options,
1140
- method: "PUT",
1141
- headers: { "Content-Type": "application/json", ...getHeaders(options?.headers) },
1142
- body: JSON.stringify(setInstanceNotesRequestBody),
1143
- });
1144
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1145
- const data = body ? JSON.parse(body) : {};
1146
- return { data, status: res.status, headers: res.headers };
1147
- };
1148
- export const getResetInstancePasswordUrl = (instanceId) => {
1149
- return `https://compute.leaflow.cloud/api/v1/instances/${encodeURIComponent(String(instanceId))}:resetPassword`;
1150
- };
1151
- /**
1152
- * Changes the root password without a reboot. The instance must be running.
1153
- *
1154
- * **Not every image supports this.** Images whose `supports_password_reset` is false cannot, and a new password can then only be set by rebuilding the instance, which erases all data on the system disk.
1155
- *
1156
- * The request is also rejected when the image is marked as supported but the corresponding component has been removed or stopped inside the instance.
1157
- * @summary Reset the login password
1158
- */
1159
- export const resetInstancePassword = async (instanceId, resetPasswordRequestBody, options, fetchFn) => {
1160
- const getHeaders = (h) => {
1161
- if (!h)
1162
- return {};
1163
- if (h instanceof Headers)
1164
- return Object.fromEntries(h.entries());
1165
- if (Symbol.iterator in h) {
1166
- return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
1167
- }
1168
- const headers = {};
1169
- for (const [name, value] of Object.entries(h)) {
1170
- if (value !== undefined)
1171
- headers[name] = value;
1172
- }
1173
- return headers;
1174
- };
1175
- const res = await (fetchFn ?? fetch)(getResetInstancePasswordUrl(instanceId), {
1176
- ...options,
1177
- method: "POST",
1178
- headers: { "Content-Type": "application/json", ...getHeaders(options?.headers) },
1179
- body: JSON.stringify(resetPasswordRequestBody),
1180
- });
1181
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1182
- const data = body ? JSON.parse(body) : {};
1183
- return { data, status: res.status, headers: res.headers };
1184
- };
1185
- export const getRebootInstanceUrl = (instanceId) => {
1186
- return `https://compute.leaflow.cloud/api/v1/instances/${encodeURIComponent(String(instanceId))}:reboot`;
1187
- };
1188
- /**
1189
- * A reboot defaults to soft, in which the operating system shuts down normally before starting again.
1190
- *
1191
- * A soft reboot has no effect once the system is unresponsive. Set `force` to reboot forcibly: a forced reboot does not wait for the operating system to shut down, so **unwritten data is lost**.
1192
- *
1193
- * A forced reboot is accepted while a soft reboot is in progress, which is the way out of a soft reboot the instance never carried out. Any other request for an operation, including a second soft reboot, is refused with `COMPUTE_RESOURCE_BUSY` while the reboot is in progress.
1194
- *
1195
- * An instance suspended by the platform must be unsuspended first.
1196
- *
1197
- * The instance shows the `reboot` operation until the reboot has finished.
1198
- * @summary Reboot an instance
1199
- */
1200
- export const rebootInstance = async (instanceId, rebootInstanceRequestBody, options, fetchFn) => {
1201
- const getHeaders = (h) => {
1202
- if (!h)
1203
- return {};
1204
- if (h instanceof Headers)
1205
- return Object.fromEntries(h.entries());
1206
- if (Symbol.iterator in h) {
1207
- return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
1208
- }
1209
- const headers = {};
1210
- for (const [name, value] of Object.entries(h)) {
1211
- if (value !== undefined)
1212
- headers[name] = value;
1213
- }
1214
- return headers;
1215
- };
1216
- const res = await (fetchFn ?? fetch)(getRebootInstanceUrl(instanceId), {
1217
- ...options,
1218
- method: "POST",
1219
- headers: { "Content-Type": "application/json", ...getHeaders(options?.headers) },
1220
- body: JSON.stringify(rebootInstanceRequestBody),
1221
- });
1222
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1223
- const data = body ? JSON.parse(body) : {};
1224
- return { data, status: res.status, headers: res.headers };
1225
- };
1226
- export const getRebuildInstanceUrl = (instanceId) => {
1227
- return `https://compute.leaflow.cloud/api/v1/instances/${encodeURIComponent(String(instanceId))}:rebuild`;
1228
- };
1229
- /**
1230
- * **All data on the system disk is erased and cannot be recovered.** Attached data disks are unaffected.
1231
- *
1232
- * The image this instance already runs is accepted even after the platform has withdrawn it, since rebuilding is the only way back into an instance broken from the inside. Any *other* withdrawn image is rejected with `IMAGE_RETIRED`, which is a change of image and therefore a new order.
1233
- *
1234
- * The instance shows the `rebuild` operation until the rebuild has finished.
1235
- * @summary Rebuild an instance
1236
- */
1237
- export const rebuildInstance = async (instanceId, rebuildInstanceRequestBody, options, fetchFn) => {
1238
- const getHeaders = (h) => {
1239
- if (!h)
1240
- return {};
1241
- if (h instanceof Headers)
1242
- return Object.fromEntries(h.entries());
1243
- if (Symbol.iterator in h) {
1244
- return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
1245
- }
1246
- const headers = {};
1247
- for (const [name, value] of Object.entries(h)) {
1248
- if (value !== undefined)
1249
- headers[name] = value;
1250
- }
1251
- return headers;
1252
- };
1253
- const res = await (fetchFn ?? fetch)(getRebuildInstanceUrl(instanceId), {
1254
- ...options,
1255
- method: "POST",
1256
- headers: { "Content-Type": "application/json", ...getHeaders(options?.headers) },
1257
- body: JSON.stringify(rebuildInstanceRequestBody),
1258
- });
1259
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1260
- const data = body ? JSON.parse(body) : {};
1261
- return { data, status: res.status, headers: res.headers };
1262
- };
1263
- export const getResizeInstanceUrl = (instanceId) => {
1264
- return `https://compute.leaflow.cloud/api/v1/instances/${encodeURIComponent(String(instanceId))}:resize`;
1265
- };
1266
- /**
1267
- * Creates a Billing Checkout Session for the change, including for metered pricing, and returns the instance with it. The instance keeps its usage type and period, priced with the target type's matching option; a target type without that option is refused with 409 `BILLING_OPTION_UNAVAILABLE`. Do not submit a new purchase after paying. After an uncertain response, look the Checkout Session up in Billing before submitting again.
1268
- *
1269
- * The instance shows the `resize` operation until the resize is applied, its Checkout Session expires or its order is canceled, so other operations and a second resize are refused with `COMPUTE_RESOURCE_BUSY` meanwhile. It keeps its current type until the resize is applied; the new type takes effect, and is billed from then on, when `instance_type_id` shows it. If checkout is not completed, the order is not accepted or the resize fails, the instance keeps its current type and Billing shows the outcome. A completed resize is final and cannot be reverted; to return to the previous type, submit another resize.
1270
- * @summary Resize an instance
1271
- */
1272
- export const resizeInstance = async (instanceId, resizeInstanceRequestBody, options, fetchFn) => {
1273
- const getHeaders = (h) => {
1274
- if (!h)
1275
- return {};
1276
- if (h instanceof Headers)
1277
- return Object.fromEntries(h.entries());
1278
- if (Symbol.iterator in h) {
1279
- return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
1280
- }
1281
- const headers = {};
1282
- for (const [name, value] of Object.entries(h)) {
1283
- if (value !== undefined)
1284
- headers[name] = value;
1285
- }
1286
- return headers;
1287
- };
1288
- const res = await (fetchFn ?? fetch)(getResizeInstanceUrl(instanceId), {
1289
- ...options,
1290
- method: "POST",
1291
- headers: { "Content-Type": "application/json", ...getHeaders(options?.headers) },
1292
- body: JSON.stringify(resizeInstanceRequestBody),
1293
- });
1294
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1295
- const data = body ? JSON.parse(body) : {};
1296
- return { data, status: res.status, headers: res.headers };
1297
- };
1298
- export const getStartInstanceUrl = (instanceId) => {
1299
- return `https://compute.leaflow.cloud/api/v1/instances/${encodeURIComponent(String(instanceId))}:start`;
1300
- };
1301
- /**
1302
- * Outstanding restrictions can prevent starting. The instance shows the `start` operation until it is running or the start has failed.
1303
- * @summary Start an instance
1304
- */
1305
- export const startInstance = async (instanceId, powerRequest, options, fetchFn) => {
1306
- const getHeaders = (h) => {
1307
- if (!h)
1308
- return {};
1309
- if (h instanceof Headers)
1310
- return Object.fromEntries(h.entries());
1311
- if (Symbol.iterator in h) {
1312
- return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
1313
- }
1314
- const headers = {};
1315
- for (const [name, value] of Object.entries(h)) {
1316
- if (value !== undefined)
1317
- headers[name] = value;
1318
- }
1319
- return headers;
1320
- };
1321
- const res = await (fetchFn ?? fetch)(getStartInstanceUrl(instanceId), {
1322
- ...options,
1323
- method: "POST",
1324
- headers: { "Content-Type": "application/json", ...getHeaders(options?.headers) },
1325
- body: JSON.stringify(powerRequest),
1326
- });
1327
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1328
- const data = body ? JSON.parse(body) : {};
1329
- return { data, status: res.status, headers: res.headers };
1330
- };
1331
- export const getStopInstanceUrl = (instanceId) => {
1332
- return `https://compute.leaflow.cloud/api/v1/instances/${encodeURIComponent(String(instanceId))}:stop`;
1333
- };
1334
- /**
1335
- * A stopped instance keeps its disks, network attachments and sellable quota. The instance shows the `stop` operation until it is stopped or the stop has failed.
1336
- * @summary Stop an instance
1337
- */
1338
- export const stopInstance = async (instanceId, powerRequest, options, fetchFn) => {
1339
- const getHeaders = (h) => {
1340
- if (!h)
1341
- return {};
1342
- if (h instanceof Headers)
1343
- return Object.fromEntries(h.entries());
1344
- if (Symbol.iterator in h) {
1345
- return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
1346
- }
1347
- const headers = {};
1348
- for (const [name, value] of Object.entries(h)) {
1349
- if (value !== undefined)
1350
- headers[name] = value;
1351
- }
1352
- return headers;
1353
- };
1354
- const res = await (fetchFn ?? fetch)(getStopInstanceUrl(instanceId), {
1355
- ...options,
1356
- method: "POST",
1357
- headers: { "Content-Type": "application/json", ...getHeaders(options?.headers) },
1358
- body: JSON.stringify(powerRequest),
1359
- });
1360
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1361
- const data = body ? JSON.parse(body) : {};
1362
- return { data, status: res.status, headers: res.headers };
1363
- };
1364
- export const getListInstanceDisksUrl = (instanceId, params) => {
1365
- const normalizedParams = new URLSearchParams();
1366
- Object.entries(params || {}).forEach(([key, value]) => {
1367
- if (value !== undefined) {
1368
- normalizedParams.append(key, value === null ? "null" : String(value));
1369
- }
1370
- });
1371
- const stringifiedParams = normalizedParams.toString();
1372
- return stringifiedParams.length > 0
1373
- ? `https://compute.leaflow.cloud/api/v1/instances/${encodeURIComponent(String(instanceId))}/disks?${stringifiedParams}`
1374
- : `https://compute.leaflow.cloud/api/v1/instances/${encodeURIComponent(String(instanceId))}/disks`;
1375
- };
1376
- /**
1377
- * @summary List the disks attached to an instance
1378
- */
1379
- export const listInstanceDisks = async (instanceId, params, options, fetchFn) => {
1380
- const res = await (fetchFn ?? fetch)(getListInstanceDisksUrl(instanceId, params), {
1381
- ...options,
1382
- method: "GET",
1383
- });
1384
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1385
- const data = body ? JSON.parse(body) : {};
1386
- return { data, status: res.status, headers: res.headers };
1387
- };
1388
- export const getAttachDiskUrl = (instanceId) => {
1389
- return `https://compute.leaflow.cloud/api/v1/instances/${encodeURIComponent(String(instanceId))}/disks`;
1390
- };
1391
- /**
1392
- * The disk must be in the same region and availability zone as the instance. Returns the disk; the instance shows the `attach_disk` operation and the disk the `attach` operation until the attachment is confirmed. Partition the disk and mount the file system inside the instance once it is attached.
1393
- * @summary Attach a disk
1394
- */
1395
- export const attachDisk = async (instanceId, attachDiskRequestBody, options, fetchFn) => {
1396
- const getHeaders = (h) => {
1397
- if (!h)
1398
- return {};
1399
- if (h instanceof Headers)
1400
- return Object.fromEntries(h.entries());
1401
- if (Symbol.iterator in h) {
1402
- return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
1403
- }
1404
- const headers = {};
1405
- for (const [name, value] of Object.entries(h)) {
1406
- if (value !== undefined)
1407
- headers[name] = value;
1408
- }
1409
- return headers;
1410
- };
1411
- const res = await (fetchFn ?? fetch)(getAttachDiskUrl(instanceId), {
1412
- ...options,
1413
- method: "POST",
1414
- headers: { "Content-Type": "application/json", ...getHeaders(options?.headers) },
1415
- body: JSON.stringify(attachDiskRequestBody),
1416
- });
1417
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1418
- const data = body ? JSON.parse(body) : {};
1419
- return { data, status: res.status, headers: res.headers };
1420
- };
1421
- export const getDetachDiskUrl = (instanceId, diskId) => {
1422
- return `https://compute.leaflow.cloud/api/v1/instances/${encodeURIComponent(String(instanceId))}/disks/${encodeURIComponent(String(diskId))}`;
1423
- };
1424
- /**
1425
- * Unmount the device inside the instance before calling this endpoint. Forcibly detaching a file system that is being written to corrupts data.
1426
- *
1427
- * The disk the instance boots from cannot be detached, whether it is the system disk bought with the instance or a disk supplied as the existing boot_disk at launch. Such a request is refused with `INSTANCE_BOOT_DISK_LOCKED` and changes nothing; releasing the instance is what frees that disk.
1428
- *
1429
- * Returns the disk; the instance shows the `detach_disk` operation and the disk the `detach` operation until the disk is detached.
1430
- * @summary Detach a disk
1431
- */
1432
- export const detachDisk = async (instanceId, diskId, options, fetchFn) => {
1433
- const res = await (fetchFn ?? fetch)(getDetachDiskUrl(instanceId, diskId), {
1434
- ...options,
1435
- method: "DELETE",
1436
- });
1437
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1438
- const data = body ? JSON.parse(body) : {};
1439
- return { data, status: res.status, headers: res.headers };
1440
- };
1441
- export const getAttachInstanceFloatingIpUrl = (instanceId) => {
1442
- return `https://compute.leaflow.cloud/api/v1/instances/${encodeURIComponent(String(instanceId))}/floating-ips`;
1443
- };
1444
- /**
1445
- * Changes the public IP binding on the instance's primary network interface. The instance shows the `bind_floating_ip` operation until the binding is confirmed.
1446
- * @summary Bind a floating IP to an instance
1447
- */
1448
- export const attachInstanceFloatingIp = async (instanceId, attachFloatingIPRequestBody, options, fetchFn) => {
1449
- const getHeaders = (h) => {
1450
- if (!h)
1451
- return {};
1452
- if (h instanceof Headers)
1453
- return Object.fromEntries(h.entries());
1454
- if (Symbol.iterator in h) {
1455
- return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
1456
- }
1457
- const headers = {};
1458
- for (const [name, value] of Object.entries(h)) {
1459
- if (value !== undefined)
1460
- headers[name] = value;
1461
- }
1462
- return headers;
1463
- };
1464
- const res = await (fetchFn ?? fetch)(getAttachInstanceFloatingIpUrl(instanceId), {
1465
- ...options,
1466
- method: "POST",
1467
- headers: { "Content-Type": "application/json", ...getHeaders(options?.headers) },
1468
- body: JSON.stringify(attachFloatingIPRequestBody),
1469
- });
1470
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1471
- const data = body ? JSON.parse(body) : {};
1472
- return { data, status: res.status, headers: res.headers };
1473
- };
1474
- export const getDetachInstanceFloatingIpUrl = (instanceId, floatingIpId) => {
1475
- return `https://compute.leaflow.cloud/api/v1/instances/${encodeURIComponent(String(instanceId))}/floating-ips/${encodeURIComponent(String(floatingIpId))}`;
1476
- };
1477
- /**
1478
- * Changes the public IP binding on the instance's primary network interface. The instance shows the `unbind_floating_ip` operation until the change is confirmed.
1479
- * @summary Unbind the floating IP of an instance
1480
- */
1481
- export const detachInstanceFloatingIp = async (instanceId, floatingIpId, options, fetchFn) => {
1482
- const res = await (fetchFn ?? fetch)(getDetachInstanceFloatingIpUrl(instanceId, floatingIpId), {
1483
- ...options,
1484
- method: "DELETE",
1485
- });
1486
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1487
- const data = body ? JSON.parse(body) : {};
1488
- return { data, status: res.status, headers: res.headers };
1489
- };
1490
- export const getListInstancePortsUrl = (instanceId, params) => {
1491
- const normalizedParams = new URLSearchParams();
1492
- Object.entries(params || {}).forEach(([key, value]) => {
1493
- if (value !== undefined) {
1494
- normalizedParams.append(key, value === null ? "null" : String(value));
1495
- }
1496
- });
1497
- const stringifiedParams = normalizedParams.toString();
1498
- return stringifiedParams.length > 0
1499
- ? `https://compute.leaflow.cloud/api/v1/instances/${encodeURIComponent(String(instanceId))}/ports?${stringifiedParams}`
1500
- : `https://compute.leaflow.cloud/api/v1/instances/${encodeURIComponent(String(instanceId))}/ports`;
1501
- };
1502
- /**
1503
- * @summary List the network interfaces of an instance
1504
- */
1505
- export const listInstancePorts = async (instanceId, params, options, fetchFn) => {
1506
- const res = await (fetchFn ?? fetch)(getListInstancePortsUrl(instanceId, params), {
1507
- ...options,
1508
- method: "GET",
1509
- });
1510
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1511
- const data = body ? JSON.parse(body) : {};
1512
- return { data, status: res.status, headers: res.headers };
1513
- };
1514
- export const getAttachPortUrl = (instanceId) => {
1515
- return `https://compute.leaflow.cloud/api/v1/instances/${encodeURIComponent(String(instanceId))}/ports`;
1516
- };
1517
- /**
1518
- * Returns the network interface; the instance shows the `attach_port` operation and the interface the `attach` operation until the attachment is confirmed.
1519
- * @summary Attach a network interface
1520
- */
1521
- export const attachPort = async (instanceId, attachPortRequestBody, options, fetchFn) => {
1522
- const getHeaders = (h) => {
1523
- if (!h)
1524
- return {};
1525
- if (h instanceof Headers)
1526
- return Object.fromEntries(h.entries());
1527
- if (Symbol.iterator in h) {
1528
- return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
1529
- }
1530
- const headers = {};
1531
- for (const [name, value] of Object.entries(h)) {
1532
- if (value !== undefined)
1533
- headers[name] = value;
1534
- }
1535
- return headers;
1536
- };
1537
- const res = await (fetchFn ?? fetch)(getAttachPortUrl(instanceId), {
1538
- ...options,
1539
- method: "POST",
1540
- headers: { "Content-Type": "application/json", ...getHeaders(options?.headers) },
1541
- body: JSON.stringify(attachPortRequestBody),
1542
- });
1543
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1544
- const data = body ? JSON.parse(body) : {};
1545
- return { data, status: res.status, headers: res.headers };
1546
- };
1547
- export const getDetachPortUrl = (instanceId, portId) => {
1548
- return `https://compute.leaflow.cloud/api/v1/instances/${encodeURIComponent(String(instanceId))}/ports/${encodeURIComponent(String(portId))}`;
1549
- };
1550
- /**
1551
- * The primary network interface cannot be detached; the instance would lose its network address.
1552
- *
1553
- * Returns the network interface; the instance shows the `detach_port` operation and the interface the `detach` operation until it is detached.
1554
- * @summary Detach a network interface
1555
- */
1556
- export const detachPort = async (instanceId, portId, options, fetchFn) => {
1557
- const res = await (fetchFn ?? fetch)(getDetachPortUrl(instanceId, portId), {
1558
- ...options,
1559
- method: "DELETE",
1560
- });
1561
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1562
- const data = body ? JSON.parse(body) : {};
1563
- return { data, status: res.status, headers: res.headers };
1564
- };
1565
- export const getListOperationLogsUrl = (params) => {
1566
- const normalizedParams = new URLSearchParams();
1567
- Object.entries(params || {}).forEach(([key, value]) => {
1568
- if (value !== undefined) {
1569
- normalizedParams.append(key, value === null ? "null" : String(value));
1570
- }
1571
- });
1572
- const stringifiedParams = normalizedParams.toString();
1573
- return stringifiedParams.length > 0
1574
- ? `https://compute.leaflow.cloud/api/v1/operation-logs?${stringifiedParams}`
1575
- : `https://compute.leaflow.cloud/api/v1/operation-logs`;
1576
- };
1577
- /**
1578
- * Records every write operation in the project: who performed it, when, on what, and whether it succeeded. Read operations are not recorded.
1579
- *
1580
- * **Operations performed by the platform are included, but the individual operator is not disclosed** and `by_platform` is true. Suspension for non-payment and bans for abuse are examples: the time at which an instance was stopped by the platform is needed, whereas the operator is internal information.
1581
- *
1582
- * Fields such as passwords are replaced with a placeholder as the record is written and never appear in `payload`.
1583
- * @summary List the operation log of the project
1584
- */
1585
- export const listOperationLogs = async (params, options, fetchFn) => {
1586
- const res = await (fetchFn ?? fetch)(getListOperationLogsUrl(params), {
1587
- ...options,
1588
- method: "GET",
1589
- });
1590
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1591
- const data = body ? JSON.parse(body) : {};
1592
- return { data, status: res.status, headers: res.headers };
1593
- };
1594
- export const getListPortsUrl = (params) => {
1595
- const normalizedParams = new URLSearchParams();
1596
- Object.entries(params || {}).forEach(([key, value]) => {
1597
- if (value !== undefined) {
1598
- normalizedParams.append(key, value === null ? "null" : String(value));
1599
- }
1600
- });
1601
- const stringifiedParams = normalizedParams.toString();
1602
- return stringifiedParams.length > 0
1603
- ? `https://compute.leaflow.cloud/api/v1/ports?${stringifiedParams}`
1604
- : `https://compute.leaflow.cloud/api/v1/ports`;
1605
- };
1606
- /**
1607
- * @summary List network interfaces
1608
- */
1609
- export const listPorts = async (params, options, fetchFn) => {
1610
- const res = await (fetchFn ?? fetch)(getListPortsUrl(params), {
1611
- ...options,
1612
- method: "GET",
1613
- });
1614
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1615
- const data = body ? JSON.parse(body) : {};
1616
- return { data, status: res.status, headers: res.headers };
1617
- };
1618
- export const getCreatePortUrl = () => {
1619
- return `https://compute.leaflow.cloud/api/v1/ports`;
1620
- };
1621
- /**
1622
- * The new network interface is not attached to any instance. Primary network interfaces are not created here; they are created with the instance.
1623
- * @summary Create a network interface
1624
- */
1625
- export const createPort = async (createPortRequestBody, options, fetchFn) => {
1626
- const getHeaders = (h) => {
1627
- if (!h)
1628
- return {};
1629
- if (h instanceof Headers)
1630
- return Object.fromEntries(h.entries());
1631
- if (Symbol.iterator in h) {
1632
- return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
1633
- }
1634
- const headers = {};
1635
- for (const [name, value] of Object.entries(h)) {
1636
- if (value !== undefined)
1637
- headers[name] = value;
1638
- }
1639
- return headers;
1640
- };
1641
- const res = await (fetchFn ?? fetch)(getCreatePortUrl(), {
1642
- ...options,
1643
- method: "POST",
1644
- headers: { "Content-Type": "application/json", ...getHeaders(options?.headers) },
1645
- body: JSON.stringify(createPortRequestBody),
1646
- });
1647
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1648
- const data = body ? JSON.parse(body) : {};
1649
- return { data, status: res.status, headers: res.headers };
1650
- };
1651
- export const getDeletePortUrl = (portId) => {
1652
- return `https://compute.leaflow.cloud/api/v1/ports/${encodeURIComponent(String(portId))}`;
1653
- };
1654
- /**
1655
- * The primary network interface cannot be deleted on its own, as it is released with the instance. A network interface still attached to an instance cannot be deleted either.
1656
- * @summary Delete a network interface
1657
- */
1658
- export const deletePort = async (portId, options, fetchFn) => {
1659
- const res = await (fetchFn ?? fetch)(getDeletePortUrl(portId), {
1660
- ...options,
1661
- method: "DELETE",
1662
- });
1663
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1664
- const data = body ? JSON.parse(body) : {};
1665
- return { data, status: res.status, headers: res.headers };
1666
- };
1667
- export const getListPrivateNetworksUrl = (params) => {
1668
- const normalizedParams = new URLSearchParams();
1669
- Object.entries(params || {}).forEach(([key, value]) => {
1670
- if (value !== undefined) {
1671
- normalizedParams.append(key, value === null ? "null" : String(value));
1672
- }
1673
- });
1674
- const stringifiedParams = normalizedParams.toString();
1675
- return stringifiedParams.length > 0
1676
- ? `https://compute.leaflow.cloud/api/v1/private-networks?${stringifiedParams}`
1677
- : `https://compute.leaflow.cloud/api/v1/private-networks`;
1678
- };
1679
- /**
1680
- * @summary List private networks
1681
- */
1682
- export const listPrivateNetworks = async (params, options, fetchFn) => {
1683
- const res = await (fetchFn ?? fetch)(getListPrivateNetworksUrl(params), {
1684
- ...options,
1685
- method: "GET",
1686
- });
1687
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1688
- const data = body ? JSON.parse(body) : {};
1689
- return { data, status: res.status, headers: res.headers };
1690
- };
1691
- export const getCreatePrivateNetworkUrl = () => {
1692
- return `https://compute.leaflow.cloud/api/v1/private-networks`;
1693
- };
1694
- /**
1695
- * Creates a private network definition and its default security group. The default security group denies all inbound traffic and permits all outbound traffic.
1696
- * @summary Create a private network
1697
- */
1698
- export const createPrivateNetwork = async (createPrivateNetworkRequestBody, options, fetchFn) => {
1699
- const getHeaders = (h) => {
1700
- if (!h)
1701
- return {};
1702
- if (h instanceof Headers)
1703
- return Object.fromEntries(h.entries());
1704
- if (Symbol.iterator in h) {
1705
- return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
1706
- }
1707
- const headers = {};
1708
- for (const [name, value] of Object.entries(h)) {
1709
- if (value !== undefined)
1710
- headers[name] = value;
1711
- }
1712
- return headers;
1713
- };
1714
- const res = await (fetchFn ?? fetch)(getCreatePrivateNetworkUrl(), {
1715
- ...options,
1716
- method: "POST",
1717
- headers: { "Content-Type": "application/json", ...getHeaders(options?.headers) },
1718
- body: JSON.stringify(createPrivateNetworkRequestBody),
1719
- });
1720
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1721
- const data = body ? JSON.parse(body) : {};
1722
- return { data, status: res.status, headers: res.headers };
1723
- };
1724
- export const getGetPrivateNetworkUrl = (privateNetworkId) => {
1725
- return `https://compute.leaflow.cloud/api/v1/private-networks/${encodeURIComponent(String(privateNetworkId))}`;
1726
- };
1727
- /**
1728
- * @summary Retrieve a private network
1729
- */
1730
- export const getPrivateNetwork = async (privateNetworkId, options, fetchFn) => {
1731
- const res = await (fetchFn ?? fetch)(getGetPrivateNetworkUrl(privateNetworkId), {
1732
- ...options,
1733
- method: "GET",
1734
- });
1735
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1736
- const data = body ? JSON.parse(body) : {};
1737
- return { data, status: res.status, headers: res.headers };
1738
- };
1739
- export const getRenamePrivateNetworkUrl = (privateNetworkId) => {
1740
- return `https://compute.leaflow.cloud/api/v1/private-networks/${encodeURIComponent(String(privateNetworkId))}`;
1741
- };
1742
- /**
1743
- * Changes the display name only. The CIDR, the routes and the internet gateway are immutable.
1744
- * @summary Rename a private network
1745
- */
1746
- export const renamePrivateNetwork = async (privateNetworkId, renamePrivateNetworkRequestBody, options, fetchFn) => {
1747
- const getHeaders = (h) => {
1748
- if (!h)
1749
- return {};
1750
- if (h instanceof Headers)
1751
- return Object.fromEntries(h.entries());
1752
- if (Symbol.iterator in h) {
1753
- return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
1754
- }
1755
- const headers = {};
1756
- for (const [name, value] of Object.entries(h)) {
1757
- if (value !== undefined)
1758
- headers[name] = value;
1759
- }
1760
- return headers;
1761
- };
1762
- const res = await (fetchFn ?? fetch)(getRenamePrivateNetworkUrl(privateNetworkId), {
1763
- ...options,
1764
- method: "PATCH",
1765
- headers: { "Content-Type": "application/json", ...getHeaders(options?.headers) },
1766
- body: JSON.stringify(renamePrivateNetworkRequestBody),
1767
- });
1768
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1769
- const data = body ? JSON.parse(body) : {};
1770
- return { data, status: res.status, headers: res.headers };
1771
- };
1772
- export const getDeletePrivateNetworkUrl = (privateNetworkId) => {
1773
- return `https://compute.leaflow.cloud/api/v1/private-networks/${encodeURIComponent(String(privateNetworkId))}`;
1774
- };
1775
- /**
1776
- * Deletion is rejected while instances or network interfaces remain in the network. Its subnets, routes, security groups and IPv6 configuration are removed with it.
1777
- * @summary Release a private network
1778
- */
1779
- export const deletePrivateNetwork = async (privateNetworkId, options, fetchFn) => {
1780
- const res = await (fetchFn ?? fetch)(getDeletePrivateNetworkUrl(privateNetworkId), {
1781
- ...options,
1782
- method: "DELETE",
1783
- });
1784
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1785
- const data = body ? JSON.parse(body) : {};
1786
- return { data, status: res.status, headers: res.headers };
1787
- };
1788
- export const getGetPrivateNetworkIpv6Url = (privateNetworkId) => {
1789
- return `https://compute.leaflow.cloud/api/v1/private-networks/${encodeURIComponent(String(privateNetworkId))}/ipv6`;
1790
- };
1791
- /**
1792
- * @summary Retrieve the IPv6 configuration of a private network
1793
- */
1794
- export const getPrivateNetworkIpv6 = async (privateNetworkId, options, fetchFn) => {
1795
- const res = await (fetchFn ?? fetch)(getGetPrivateNetworkIpv6Url(privateNetworkId), {
1796
- ...options,
1797
- method: "GET",
1798
- });
1799
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1800
- const data = body ? JSON.parse(body) : {};
1801
- return { data, status: res.status, headers: res.headers };
1802
- };
1803
- export const getEnablePrivateNetworkIpv6Url = (privateNetworkId) => {
1804
- return `https://compute.leaflow.cloud/api/v1/private-networks/${encodeURIComponent(String(privateNetworkId))}:enableIpv6`;
1805
- };
1806
- /**
1807
- * Allocates an IPv6 prefix to the private network. Addresses are assigned to instances by the network itself, can be neither requested nor released individually, and consume no public IPv4 address.
1808
- *
1809
- * If the private network is not yet connected to the internet, connectivity is established as part of this call.
1810
- * @summary Enable IPv6 on a private network
1811
- */
1812
- export const enablePrivateNetworkIpv6 = async (privateNetworkId, options, fetchFn) => {
1813
- const res = await (fetchFn ?? fetch)(getEnablePrivateNetworkIpv6Url(privateNetworkId), {
1814
- ...options,
1815
- method: "POST",
1816
- });
1817
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1818
- const data = body ? JSON.parse(body) : {};
1819
- return { data, status: res.status, headers: res.headers };
1820
- };
1821
- export const getDisablePrivateNetworkIpv6Url = (privateNetworkId) => {
1822
- return `https://compute.leaflow.cloud/api/v1/private-networks/${encodeURIComponent(String(privateNetworkId))}:disableIpv6`;
1823
- };
1824
- /**
1825
- * A released prefix is not re-allocated immediately.
1826
- * @summary Disable IPv6 on a private network
1827
- */
1828
- export const disablePrivateNetworkIpv6 = async (privateNetworkId, options, fetchFn) => {
1829
- const res = await (fetchFn ?? fetch)(getDisablePrivateNetworkIpv6Url(privateNetworkId), {
1830
- ...options,
1831
- method: "POST",
1832
- });
1833
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1834
- const data = body ? JSON.parse(body) : {};
1835
- return { data, status: res.status, headers: res.headers };
1836
- };
1837
- export const getListRoutesUrl = (privateNetworkId, params) => {
1838
- const normalizedParams = new URLSearchParams();
1839
- Object.entries(params || {}).forEach(([key, value]) => {
1840
- if (value !== undefined) {
1841
- normalizedParams.append(key, value === null ? "null" : String(value));
1842
- }
1843
- });
1844
- const stringifiedParams = normalizedParams.toString();
1845
- return stringifiedParams.length > 0
1846
- ? `https://compute.leaflow.cloud/api/v1/private-networks/${encodeURIComponent(String(privateNetworkId))}/routes?${stringifiedParams}`
1847
- : `https://compute.leaflow.cloud/api/v1/private-networks/${encodeURIComponent(String(privateNetworkId))}/routes`;
1848
- };
1849
- /**
1850
- * @summary List static routes
1851
- */
1852
- export const listRoutes = async (privateNetworkId, params, options, fetchFn) => {
1853
- const res = await (fetchFn ?? fetch)(getListRoutesUrl(privateNetworkId, params), {
1854
- ...options,
1855
- method: "GET",
1856
- });
1857
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1858
- const data = body ? JSON.parse(body) : {};
1859
- return { data, status: res.status, headers: res.headers };
1860
- };
1861
- export const getCreateRouteUrl = (privateNetworkId) => {
1862
- return `https://compute.leaflow.cloud/api/v1/private-networks/${encodeURIComponent(String(privateNetworkId))}/routes`;
1863
- };
1864
- /**
1865
- * Three forms that would sever connectivity are rejected: a destination of `0.0.0.0/0`, which overrides the default route and takes every floating IP offline immediately; a destination equal to the CIDR of a subnet, which overrides its directly connected route; and a next hop equal to the gateway of a subnet, which points back at the router itself.
1866
- * @summary Create a static route
1867
- */
1868
- export const createRoute = async (privateNetworkId, createRouteRequestBody, options, fetchFn) => {
1869
- const getHeaders = (h) => {
1870
- if (!h)
1871
- return {};
1872
- if (h instanceof Headers)
1873
- return Object.fromEntries(h.entries());
1874
- if (Symbol.iterator in h) {
1875
- return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
1876
- }
1877
- const headers = {};
1878
- for (const [name, value] of Object.entries(h)) {
1879
- if (value !== undefined)
1880
- headers[name] = value;
1881
- }
1882
- return headers;
1883
- };
1884
- const res = await (fetchFn ?? fetch)(getCreateRouteUrl(privateNetworkId), {
1885
- ...options,
1886
- method: "POST",
1887
- headers: { "Content-Type": "application/json", ...getHeaders(options?.headers) },
1888
- body: JSON.stringify(createRouteRequestBody),
1889
- });
1890
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1891
- const data = body ? JSON.parse(body) : {};
1892
- return { data, status: res.status, headers: res.headers };
1893
- };
1894
- export const getDeleteRouteUrl = (privateNetworkId, routeId) => {
1895
- return `https://compute.leaflow.cloud/api/v1/private-networks/${encodeURIComponent(String(privateNetworkId))}/routes/${encodeURIComponent(String(routeId))}`;
1896
- };
1897
- /**
1898
- * @summary Delete a static route
1899
- */
1900
- export const deleteRoute = async (privateNetworkId, routeId, options, fetchFn) => {
1901
- const res = await (fetchFn ?? fetch)(getDeleteRouteUrl(privateNetworkId, routeId), {
1902
- ...options,
1903
- method: "DELETE",
1904
- });
1905
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1906
- const data = body ? JSON.parse(body) : undefined;
1907
- return { data, status: res.status, headers: res.headers };
1908
- };
1909
- export const getListSubnetsUrl = (privateNetworkId, params) => {
1910
- const normalizedParams = new URLSearchParams();
1911
- Object.entries(params || {}).forEach(([key, value]) => {
1912
- if (value !== undefined) {
1913
- normalizedParams.append(key, value === null ? "null" : String(value));
1914
- }
1915
- });
1916
- const stringifiedParams = normalizedParams.toString();
1917
- return stringifiedParams.length > 0
1918
- ? `https://compute.leaflow.cloud/api/v1/private-networks/${encodeURIComponent(String(privateNetworkId))}/subnets?${stringifiedParams}`
1919
- : `https://compute.leaflow.cloud/api/v1/private-networks/${encodeURIComponent(String(privateNetworkId))}/subnets`;
1920
- };
1921
- /**
1922
- * IPv6 subnets are included, with `ip_version` 6. They are created when IPv6 is enabled and cannot be deleted individually.
1923
- * @summary List subnets
1924
- */
1925
- export const listSubnets = async (privateNetworkId, params, options, fetchFn) => {
1926
- const res = await (fetchFn ?? fetch)(getListSubnetsUrl(privateNetworkId, params), {
1927
- ...options,
1928
- method: "GET",
1929
- });
1930
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1931
- const data = body ? JSON.parse(body) : {};
1932
- return { data, status: res.status, headers: res.headers };
1933
- };
1934
- export const getCreateSubnetUrl = (privateNetworkId) => {
1935
- return `https://compute.leaflow.cloud/api/v1/private-networks/${encodeURIComponent(String(privateNetworkId))}/subnets`;
1936
- };
1937
- /**
1938
- * @summary Create a subnet
1939
- */
1940
- export const createSubnet = async (privateNetworkId, createSubnetRequestBody, options, fetchFn) => {
1941
- const getHeaders = (h) => {
1942
- if (!h)
1943
- return {};
1944
- if (h instanceof Headers)
1945
- return Object.fromEntries(h.entries());
1946
- if (Symbol.iterator in h) {
1947
- return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
1948
- }
1949
- const headers = {};
1950
- for (const [name, value] of Object.entries(h)) {
1951
- if (value !== undefined)
1952
- headers[name] = value;
1953
- }
1954
- return headers;
1955
- };
1956
- const res = await (fetchFn ?? fetch)(getCreateSubnetUrl(privateNetworkId), {
1957
- ...options,
1958
- method: "POST",
1959
- headers: { "Content-Type": "application/json", ...getHeaders(options?.headers) },
1960
- body: JSON.stringify(createSubnetRequestBody),
1961
- });
1962
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1963
- const data = body ? JSON.parse(body) : {};
1964
- return { data, status: res.status, headers: res.headers };
1965
- };
1966
- export const getSuggestSubnetCidrUrl = (privateNetworkId, params) => {
1967
- const normalizedParams = new URLSearchParams();
1968
- Object.entries(params || {}).forEach(([key, value]) => {
1969
- if (value !== undefined) {
1970
- normalizedParams.append(key, value === null ? "null" : String(value));
1971
- }
1972
- });
1973
- const stringifiedParams = normalizedParams.toString();
1974
- return stringifiedParams.length > 0
1975
- ? `https://compute.leaflow.cloud/api/v1/private-networks/${encodeURIComponent(String(privateNetworkId))}/subnets/next-free-cidr?${stringifiedParams}`
1976
- : `https://compute.leaflow.cloud/api/v1/private-networks/${encodeURIComponent(String(privateNetworkId))}/subnets/next-free-cidr`;
1977
- };
1978
- /**
1979
- * The returned value is a suggestion and is validated again when the subnet is created. It exists to avoid errors when computing the next free CIDR by hand.
1980
- * @summary Suggest the next free CIDR
1981
- */
1982
- export const suggestSubnetCidr = async (privateNetworkId, params, options, fetchFn) => {
1983
- const res = await (fetchFn ?? fetch)(getSuggestSubnetCidrUrl(privateNetworkId, params), {
1984
- ...options,
1985
- method: "GET",
1986
- });
1987
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1988
- const data = body ? JSON.parse(body) : {};
1989
- return { data, status: res.status, headers: res.headers };
1990
- };
1991
- export const getDeleteSubnetUrl = (privateNetworkId, subnetId) => {
1992
- return `https://compute.leaflow.cloud/api/v1/private-networks/${encodeURIComponent(String(privateNetworkId))}/subnets/${encodeURIComponent(String(subnetId))}`;
1993
- };
1994
- /**
1995
- * Deletion is rejected while network interfaces remain in the subnet, or while a static route has a next hop inside its CIDR.
1996
- * @summary Delete a subnet
1997
- */
1998
- export const deleteSubnet = async (privateNetworkId, subnetId, options, fetchFn) => {
1999
- const res = await (fetchFn ?? fetch)(getDeleteSubnetUrl(privateNetworkId, subnetId), {
2000
- ...options,
2001
- method: "DELETE",
2002
- });
2003
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
2004
- const data = body ? JSON.parse(body) : undefined;
2005
- return { data, status: res.status, headers: res.headers };
2006
- };
2007
- export const getListSecurityGroupsUrl = (params) => {
2008
- const normalizedParams = new URLSearchParams();
2009
- Object.entries(params || {}).forEach(([key, value]) => {
2010
- if (value !== undefined) {
2011
- normalizedParams.append(key, value === null ? "null" : String(value));
2012
- }
2013
- });
2014
- const stringifiedParams = normalizedParams.toString();
2015
- return stringifiedParams.length > 0
2016
- ? `https://compute.leaflow.cloud/api/v1/security-groups?${stringifiedParams}`
2017
- : `https://compute.leaflow.cloud/api/v1/security-groups`;
2018
- };
2019
- /**
2020
- * @summary List security groups
2021
- */
2022
- export const listSecurityGroups = async (params, options, fetchFn) => {
2023
- const res = await (fetchFn ?? fetch)(getListSecurityGroupsUrl(params), {
2024
- ...options,
2025
- method: "GET",
2026
- });
2027
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
2028
- const data = body ? JSON.parse(body) : {};
2029
- return { data, status: res.status, headers: res.headers };
2030
- };
2031
- export const getCreateSecurityGroupUrl = () => {
2032
- return `https://compute.leaflow.cloud/api/v1/security-groups`;
2033
- };
2034
- /**
2035
- * A new security group carries one rule, permitting ICMP fragmentation-needed messages (type 3, code 4). Without it path MTU discovery fails, which presents as connections that establish and then stall on large packets.
2036
- * @summary Create a security group
2037
- */
2038
- export const createSecurityGroup = async (createSecurityGroupRequestBody, options, fetchFn) => {
2039
- const getHeaders = (h) => {
2040
- if (!h)
2041
- return {};
2042
- if (h instanceof Headers)
2043
- return Object.fromEntries(h.entries());
2044
- if (Symbol.iterator in h) {
2045
- return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
2046
- }
2047
- const headers = {};
2048
- for (const [name, value] of Object.entries(h)) {
2049
- if (value !== undefined)
2050
- headers[name] = value;
2051
- }
2052
- return headers;
2053
- };
2054
- const res = await (fetchFn ?? fetch)(getCreateSecurityGroupUrl(), {
2055
- ...options,
2056
- method: "POST",
2057
- headers: { "Content-Type": "application/json", ...getHeaders(options?.headers) },
2058
- body: JSON.stringify(createSecurityGroupRequestBody),
2059
- });
2060
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
2061
- const data = body ? JSON.parse(body) : {};
2062
- return { data, status: res.status, headers: res.headers };
2063
- };
2064
- export const getGetSecurityGroupUrl = (securityGroupId) => {
2065
- return `https://compute.leaflow.cloud/api/v1/security-groups/${encodeURIComponent(String(securityGroupId))}`;
2066
- };
2067
- /**
2068
- * @summary Retrieve a security group
2069
- */
2070
- export const getSecurityGroup = async (securityGroupId, options, fetchFn) => {
2071
- const res = await (fetchFn ?? fetch)(getGetSecurityGroupUrl(securityGroupId), {
2072
- ...options,
2073
- method: "GET",
2074
- });
2075
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
2076
- const data = body ? JSON.parse(body) : {};
2077
- return { data, status: res.status, headers: res.headers };
2078
- };
2079
- export const getRenameSecurityGroupUrl = (securityGroupId) => {
2080
- return `https://compute.leaflow.cloud/api/v1/security-groups/${encodeURIComponent(String(securityGroupId))}`;
2081
- };
2082
- /**
2083
- * Changes the name only. Use the rule endpoints to change rules.
2084
- * @summary Rename a security group
2085
- */
2086
- export const renameSecurityGroup = async (securityGroupId, renameSecurityGroupRequestBody, options, fetchFn) => {
2087
- const getHeaders = (h) => {
2088
- if (!h)
2089
- return {};
2090
- if (h instanceof Headers)
2091
- return Object.fromEntries(h.entries());
2092
- if (Symbol.iterator in h) {
2093
- return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
2094
- }
2095
- const headers = {};
2096
- for (const [name, value] of Object.entries(h)) {
2097
- if (value !== undefined)
2098
- headers[name] = value;
2099
- }
2100
- return headers;
2101
- };
2102
- const res = await (fetchFn ?? fetch)(getRenameSecurityGroupUrl(securityGroupId), {
2103
- ...options,
2104
- method: "PATCH",
2105
- headers: { "Content-Type": "application/json", ...getHeaders(options?.headers) },
2106
- body: JSON.stringify(renameSecurityGroupRequestBody),
2107
- });
2108
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
2109
- const data = body ? JSON.parse(body) : {};
2110
- return { data, status: res.status, headers: res.headers };
2111
- };
2112
- export const getDeleteSecurityGroupUrl = (securityGroupId) => {
2113
- return `https://compute.leaflow.cloud/api/v1/security-groups/${encodeURIComponent(String(securityGroupId))}`;
2114
- };
2115
- /**
2116
- * The default security group cannot be deleted, as it is released with the private network. A security group still referenced by a network interface cannot be deleted either.
2117
- * @summary Delete a security group
2118
- */
2119
- export const deleteSecurityGroup = async (securityGroupId, options, fetchFn) => {
2120
- const res = await (fetchFn ?? fetch)(getDeleteSecurityGroupUrl(securityGroupId), {
2121
- ...options,
2122
- method: "DELETE",
2123
- });
2124
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
2125
- const data = body ? JSON.parse(body) : undefined;
2126
- return { data, status: res.status, headers: res.headers };
2127
- };
2128
- export const getListSecurityGroupRulesUrl = (securityGroupId, params) => {
2129
- const normalizedParams = new URLSearchParams();
2130
- Object.entries(params || {}).forEach(([key, value]) => {
2131
- if (value !== undefined) {
2132
- normalizedParams.append(key, value === null ? "null" : String(value));
2133
- }
2134
- });
2135
- const stringifiedParams = normalizedParams.toString();
2136
- return stringifiedParams.length > 0
2137
- ? `https://compute.leaflow.cloud/api/v1/security-groups/${encodeURIComponent(String(securityGroupId))}/rules?${stringifiedParams}`
2138
- : `https://compute.leaflow.cloud/api/v1/security-groups/${encodeURIComponent(String(securityGroupId))}/rules`;
2139
- };
2140
- /**
2141
- * @summary List security group rules
2142
- */
2143
- export const listSecurityGroupRules = async (securityGroupId, params, options, fetchFn) => {
2144
- const res = await (fetchFn ?? fetch)(getListSecurityGroupRulesUrl(securityGroupId, params), {
2145
- ...options,
2146
- method: "GET",
2147
- });
2148
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
2149
- const data = body ? JSON.parse(body) : {};
2150
- return { data, status: res.status, headers: res.headers };
2151
- };
2152
- export const getCreateSecurityGroupRuleUrl = (securityGroupId) => {
2153
- return `https://compute.leaflow.cloud/api/v1/security-groups/${encodeURIComponent(String(securityGroupId))}/rules`;
2154
- };
2155
- /**
2156
- * Adding an identical rule twice is rejected. For that comparison `0.0.0.0/0`, `::/0` and an omitted value are treated as equivalent.
2157
- * @summary Create a security group rule
2158
- */
2159
- export const createSecurityGroupRule = async (securityGroupId, createSecurityRuleRequestBody, options, fetchFn) => {
2160
- const getHeaders = (h) => {
2161
- if (!h)
2162
- return {};
2163
- if (h instanceof Headers)
2164
- return Object.fromEntries(h.entries());
2165
- if (Symbol.iterator in h) {
2166
- return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
2167
- }
2168
- const headers = {};
2169
- for (const [name, value] of Object.entries(h)) {
2170
- if (value !== undefined)
2171
- headers[name] = value;
2172
- }
2173
- return headers;
2174
- };
2175
- const res = await (fetchFn ?? fetch)(getCreateSecurityGroupRuleUrl(securityGroupId), {
2176
- ...options,
2177
- method: "POST",
2178
- headers: { "Content-Type": "application/json", ...getHeaders(options?.headers) },
2179
- body: JSON.stringify(createSecurityRuleRequestBody),
2180
- });
2181
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
2182
- const data = body ? JSON.parse(body) : {};
2183
- return { data, status: res.status, headers: res.headers };
2184
- };
2185
- export const getDeleteSecurityGroupRuleUrl = (securityGroupId, ruleId) => {
2186
- return `https://compute.leaflow.cloud/api/v1/security-groups/${encodeURIComponent(String(securityGroupId))}/rules/${encodeURIComponent(String(ruleId))}`;
2187
- };
2188
- /**
2189
- * @summary Delete a security group rule
2190
- */
2191
- export const deleteSecurityGroupRule = async (securityGroupId, ruleId, options, fetchFn) => {
2192
- const res = await (fetchFn ?? fetch)(getDeleteSecurityGroupRuleUrl(securityGroupId, ruleId), {
2193
- ...options,
2194
- method: "DELETE",
2195
- });
2196
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
2197
- const data = body ? JSON.parse(body) : undefined;
2198
- return { data, status: res.status, headers: res.headers };
2199
- };
2200
- export const getGetSnapshotQuotaUrl = (regionId) => {
2201
- return `https://compute.leaflow.cloud/api/v1/regions/${encodeURIComponent(String(regionId))}/snapshot-quota`;
2202
- };
2203
- /**
2204
- * The snapshot count quota for the authenticated project in this region. Counts simultaneous
2205
- * snapshot holdings, not lifetime create calls or storage bytes. Without an active purchase,
2206
- * limit and available are zero; existing holdings, if any, still appear in used.
2207
- *
2208
- * pending and provisioning creations reserve a slot. Snapshots being deleted or whose cleanup
2209
- * is uncertain retain their slots until absence or deletion is confirmed. available is
2210
- * max(limit - used, 0) while active, and zero when creation is not permitted; additional
2211
- * creation is refused while the quota is inactive, suspended or exhausted.
2212
- *
2213
- * Deleting the quota, which cancels its subscription, is refused while any snapshot exists in the
2214
- * region with SNAPSHOT_QUOTA_IN_USE. Reclaiming the quota for non-payment deletes its snapshots, as
2215
- * for other reclaimed resources.
2216
- * @summary Get regional snapshot quota
2217
- */
2218
- export const getSnapshotQuota = async (regionId, options, fetchFn) => {
2219
- const res = await (fetchFn ?? fetch)(getGetSnapshotQuotaUrl(regionId), {
2220
- ...options,
2221
- method: "GET",
2222
- });
2223
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
2224
- const data = body ? JSON.parse(body) : {};
2225
- return { data, status: res.status, headers: res.headers };
2226
- };
2227
- export const getSetSnapshotQuotaUrl = (regionId) => {
2228
- return `https://compute.leaflow.cloud/api/v1/regions/${encodeURIComponent(String(regionId))}/snapshot-quota`;
2229
- };
2230
- /**
2231
- * Purchases or changes the maximum number of snapshots this project may hold in this region.
2232
- * limit is the target total, not an additional number of slots or a consumable create allowance.
2233
- * billing chooses how the quota is bought, among the prices Billing offers for the region's
2234
- * `snapshot_quota_billing`; a change of an existing purchase keeps its usage type and period, and billing
2235
- * must name them. The purchased quantity is this count.
2236
- *
2237
- * Returns the quota with the Checkout Session. pending_limit records the target while the current limit stays
2238
- * in force; the new limit applies once the order is accepted and the quota is activated. Snapshots
2239
- * create no further orders or subscriptions, and deleting one frees a slot without refunding the
2240
- * quota purchase.
2241
- *
2242
- * Repeating the same target and billing choice while its purchase is pending returns the same Checkout Session. A
2243
- * conflicting pending purchase is refused with SNAPSHOT_QUOTA_CHANGE_PENDING. An already effective
2244
- * identical target and billing choice returns its existing purchase without charging again; renewing its
2245
- * term is a separate Billing renewal operation. A requested limit below used is refused with
2246
- * 409 SNAPSHOT_QUOTA_IN_USE, with meta.used and meta.limit. A change never deletes snapshots.
2247
- * @summary Set regional snapshot quota
2248
- */
2249
- export const setSnapshotQuota = async (regionId, setSnapshotQuotaRequestBody, options, fetchFn) => {
2250
- const getHeaders = (h) => {
2251
- if (!h)
2252
- return {};
2253
- if (h instanceof Headers)
2254
- return Object.fromEntries(h.entries());
2255
- if (Symbol.iterator in h) {
2256
- return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
2257
- }
2258
- const headers = {};
2259
- for (const [name, value] of Object.entries(h)) {
2260
- if (value !== undefined)
2261
- headers[name] = value;
2262
- }
2263
- return headers;
2264
- };
2265
- const res = await (fetchFn ?? fetch)(getSetSnapshotQuotaUrl(regionId), {
2266
- ...options,
2267
- method: "PUT",
2268
- headers: { "Content-Type": "application/json", ...getHeaders(options?.headers) },
2269
- body: JSON.stringify(setSnapshotQuotaRequestBody),
2270
- });
2271
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
2272
- const data = body ? JSON.parse(body) : {};
2273
- return { data, status: res.status, headers: res.headers };
2274
- };
2275
- export const getDeleteSnapshotQuotaUrl = (regionId, params) => {
2276
- const normalizedParams = new URLSearchParams();
2277
- Object.entries(params || {}).forEach(([key, value]) => {
2278
- if (value !== undefined) {
2279
- normalizedParams.append(key, value === null ? "null" : String(value));
2280
- }
2281
- });
2282
- const stringifiedParams = normalizedParams.toString();
2283
- return stringifiedParams.length > 0
2284
- ? `https://compute.leaflow.cloud/api/v1/regions/${encodeURIComponent(String(regionId))}/snapshot-quota?${stringifiedParams}`
2285
- : `https://compute.leaflow.cloud/api/v1/regions/${encodeURIComponent(String(regionId))}/snapshot-quota`;
2286
- };
2287
- /**
2288
- * Cancels the quota's subscription in Billing as `cancellation_mode` says and returns the cancellation. Refused with 409 `SNAPSHOT_QUOTA_IN_USE` while any snapshot exists in the region; delete the snapshots first. Refused with 409 `SNAPSHOT_QUOTA_NOT_ACTIVE` when no subscription pays for a quota in the region.
2289
- *
2290
- * Canceled now, it is refunded under its terms; canceled at the end of its paid period, the quota stays in force until `scheduled_at`. Deleting again while the cancellation is open returns it.
2291
- * @summary Delete regional snapshot quota
2292
- */
2293
- export const deleteSnapshotQuota = async (regionId, params, options, fetchFn) => {
2294
- const res = await (fetchFn ?? fetch)(getDeleteSnapshotQuotaUrl(regionId, params), {
2295
- ...options,
2296
- method: "DELETE",
2297
- });
2298
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
2299
- const data = body ? JSON.parse(body) : {};
2300
- return { data, status: res.status, headers: res.headers };
2301
- };
2302
- export const getGetBackupServiceUrl = (regionId) => {
2303
- return `https://compute.leaflow.cloud/api/v1/regions/${encodeURIComponent(String(regionId))}/backup-service`;
2304
- };
2305
- /**
2306
- * The backup service of the authenticated project in this region. Backups can be created only while it is `active`. Each hour, Compute covers retained backup capacity up to the total `capacity_gib` of the capacity packs active in the region and meters only the excess on this service's subscription, per GiB-hour.
2307
- *
2308
- * Deleting the service, which cancels its subscription, is refused while any backup is retained in the region with `BACKUP_SERVICE_IN_USE`. Delete the backups first. Capacity packs are deleted separately, under their own refund terms. Reclaiming the service for non-payment deletes its backups.
2309
- * @summary Get the backup service of a region
2310
- */
2311
- export const getBackupService = async (regionId, options, fetchFn) => {
2312
- const res = await (fetchFn ?? fetch)(getGetBackupServiceUrl(regionId), {
2313
- ...options,
2314
- method: "GET",
2315
- });
2316
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
2317
- const data = body ? JSON.parse(body) : {};
2318
- return { data, status: res.status, headers: res.headers };
2319
- };
2320
- export const getCreateBackupServiceUrl = (regionId) => {
2321
- return `https://compute.leaflow.cloud/api/v1/regions/${encodeURIComponent(String(regionId))}/backup-service`;
2322
- };
2323
- /**
2324
- * Purchases the backup service for this project and region. The service itself has no charge; backups are metered under it by retained capacity. It takes no billing choice. Returns the service as `pending` with its Checkout Session; it becomes `active` once the order is accepted.
2325
- *
2326
- * Refused with 409 `BACKUP_SERVICE_EXISTS` while an activation is pending or the service is active or suspended.
2327
- * @summary Activate the backup service in a region
2328
- */
2329
- export const createBackupService = async (regionId, createBackupServiceRequestBody, options, fetchFn) => {
2330
- const getHeaders = (h) => {
2331
- if (!h)
2332
- return {};
2333
- if (h instanceof Headers)
2334
- return Object.fromEntries(h.entries());
2335
- if (Symbol.iterator in h) {
2336
- return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
2337
- }
2338
- const headers = {};
2339
- for (const [name, value] of Object.entries(h)) {
2340
- if (value !== undefined)
2341
- headers[name] = value;
2342
- }
2343
- return headers;
2344
- };
2345
- const res = await (fetchFn ?? fetch)(getCreateBackupServiceUrl(regionId), {
2346
- ...options,
2347
- method: "POST",
2348
- headers: { "Content-Type": "application/json", ...getHeaders(options?.headers) },
2349
- body: JSON.stringify(createBackupServiceRequestBody),
2350
- });
2351
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
2352
- const data = body ? JSON.parse(body) : {};
2353
- return { data, status: res.status, headers: res.headers };
2354
- };
2355
- export const getDeleteBackupServiceUrl = (regionId, params) => {
2356
- const normalizedParams = new URLSearchParams();
2357
- Object.entries(params || {}).forEach(([key, value]) => {
2358
- if (value !== undefined) {
2359
- normalizedParams.append(key, value === null ? "null" : String(value));
2360
- }
2361
- });
2362
- const stringifiedParams = normalizedParams.toString();
2363
- return stringifiedParams.length > 0
2364
- ? `https://compute.leaflow.cloud/api/v1/regions/${encodeURIComponent(String(regionId))}/backup-service?${stringifiedParams}`
2365
- : `https://compute.leaflow.cloud/api/v1/regions/${encodeURIComponent(String(regionId))}/backup-service`;
2366
- };
2367
- /**
2368
- * Cancels the service's subscription in Billing as `cancellation_mode` says and returns the cancellation. Refused with 409 `BACKUP_SERVICE_IN_USE` while any backup is retained in the region; delete the backups first. Capacity packs are deleted separately. Refused with 409 `BACKUP_SERVICE_NOT_ACTIVE` when no subscription pays for a service in the region.
2369
- *
2370
- * Canceled now, it is refunded under its terms; canceled at the end of its paid period, the service stays in force until `scheduled_at`. Deleting again while the cancellation is open returns it.
2371
- * @summary Delete the backup service of a region
2372
- */
2373
- export const deleteBackupService = async (regionId, params, options, fetchFn) => {
2374
- const res = await (fetchFn ?? fetch)(getDeleteBackupServiceUrl(regionId, params), {
2375
- ...options,
2376
- method: "DELETE",
2377
- });
2378
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
2379
- const data = body ? JSON.parse(body) : {};
2380
- return { data, status: res.status, headers: res.headers };
2381
- };
2382
- export const getListBackupCapacityPacksUrl = (regionId, params) => {
2383
- const normalizedParams = new URLSearchParams();
2384
- Object.entries(params || {}).forEach(([key, value]) => {
2385
- if (value !== undefined) {
2386
- normalizedParams.append(key, value === null ? "null" : String(value));
2387
- }
2388
- });
2389
- const stringifiedParams = normalizedParams.toString();
2390
- return stringifiedParams.length > 0
2391
- ? `https://compute.leaflow.cloud/api/v1/regions/${encodeURIComponent(String(regionId))}/backup-capacity-packs?${stringifiedParams}`
2392
- : `https://compute.leaflow.cloud/api/v1/regions/${encodeURIComponent(String(regionId))}/backup-capacity-packs`;
2393
- };
2394
- /**
2395
- * The capacity packs of the authenticated project in this region, newest first, including ended ones.
2396
- * @summary List backup capacity packs
2397
- */
2398
- export const listBackupCapacityPacks = async (regionId, params, options, fetchFn) => {
2399
- const res = await (fetchFn ?? fetch)(getListBackupCapacityPacksUrl(regionId, params), {
2400
- ...options,
2401
- method: "GET",
2402
- });
2403
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
2404
- const data = body ? JSON.parse(body) : {};
2405
- return { data, status: res.status, headers: res.headers };
2406
- };
2407
- export const getCreateBackupCapacityPackUrl = (regionId) => {
2408
- return `https://compute.leaflow.cloud/api/v1/regions/${encodeURIComponent(String(regionId))}/backup-capacity-packs`;
2409
- };
2410
- /**
2411
- * Purchases a capacity pack, backup capacity for this project and region bought in advance by month or year: `billing` must be licensed with a period, as Billing offers for the region's `capacity_pack_billing`. Compute applies the coverage: each hour, retained backup capacity up to the total `capacity_gib` of the packs active in the region is covered, and Compute meters only the excess on the backup service's subscription. A pack is not a Billing allowance or credit; Billing takes its order and payment and handles its renewal and cancellation through the pack's subscription.
2412
- *
2413
- * Returns the pack as `pending` with its Checkout Session; it applies once the order is accepted. Refused with 409 `BACKUP_SERVICE_NOT_ACTIVE` and `meta.region_id` when the region's backup service is not active.
2414
- * @summary Buy a backup capacity pack
2415
- */
2416
- export const createBackupCapacityPack = async (regionId, createBackupCapacityPackRequestBody, options, fetchFn) => {
2417
- const getHeaders = (h) => {
2418
- if (!h)
2419
- return {};
2420
- if (h instanceof Headers)
2421
- return Object.fromEntries(h.entries());
2422
- if (Symbol.iterator in h) {
2423
- return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
2424
- }
2425
- const headers = {};
2426
- for (const [name, value] of Object.entries(h)) {
2427
- if (value !== undefined)
2428
- headers[name] = value;
2429
- }
2430
- return headers;
2431
- };
2432
- const res = await (fetchFn ?? fetch)(getCreateBackupCapacityPackUrl(regionId), {
2433
- ...options,
2434
- method: "POST",
2435
- headers: { "Content-Type": "application/json", ...getHeaders(options?.headers) },
2436
- body: JSON.stringify(createBackupCapacityPackRequestBody),
2437
- });
2438
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
2439
- const data = body ? JSON.parse(body) : {};
2440
- return { data, status: res.status, headers: res.headers };
2441
- };
2442
- export const getDeleteBackupCapacityPackUrl = (regionId, packId, params) => {
2443
- const normalizedParams = new URLSearchParams();
2444
- Object.entries(params || {}).forEach(([key, value]) => {
2445
- if (value !== undefined) {
2446
- normalizedParams.append(key, value === null ? "null" : String(value));
2447
- }
2448
- });
2449
- const stringifiedParams = normalizedParams.toString();
2450
- return stringifiedParams.length > 0
2451
- ? `https://compute.leaflow.cloud/api/v1/regions/${encodeURIComponent(String(regionId))}/backup-capacity-packs/${encodeURIComponent(String(packId))}?${stringifiedParams}`
2452
- : `https://compute.leaflow.cloud/api/v1/regions/${encodeURIComponent(String(regionId))}/backup-capacity-packs/${encodeURIComponent(String(packId))}`;
2453
- };
2454
- /**
2455
- * Cancels the pack's subscription in Billing as `cancellation_mode` says and returns the cancellation. Refused with 404 `BACKUP_CAPACITY_PACK_NOT_FOUND` when the project has no pack of this ID in the region, and with 409 `BACKUP_CAPACITY_PACK_ENDED` when the pack has ended.
2456
- *
2457
- * Canceled now, it is refunded under its terms; canceled at the end of its paid period, its coverage stays in force until `scheduled_at`. Deleting again while the cancellation is open returns it.
2458
- * @summary Delete a backup capacity pack
2459
- */
2460
- export const deleteBackupCapacityPack = async (regionId, packId, params, options, fetchFn) => {
2461
- const res = await (fetchFn ?? fetch)(getDeleteBackupCapacityPackUrl(regionId, packId, params), {
2462
- ...options,
2463
- method: "DELETE",
2464
- });
2465
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
2466
- const data = body ? JSON.parse(body) : {};
2467
- return { data, status: res.status, headers: res.headers };
2468
- };
2469
- export const getListSnapshotsUrl = (params) => {
2470
- const normalizedParams = new URLSearchParams();
2471
- Object.entries(params || {}).forEach(([key, value]) => {
2472
- if (value !== undefined) {
2473
- normalizedParams.append(key, value === null ? "null" : String(value));
2474
- }
2475
- });
2476
- const stringifiedParams = normalizedParams.toString();
2477
- return stringifiedParams.length > 0
2478
- ? `https://compute.leaflow.cloud/api/v1/snapshots?${stringifiedParams}`
2479
- : `https://compute.leaflow.cloud/api/v1/snapshots`;
2480
- };
2481
- /**
2482
- * @summary List snapshots
2483
- */
2484
- export const listSnapshots = async (params, options, fetchFn) => {
2485
- const res = await (fetchFn ?? fetch)(getListSnapshotsUrl(params), {
2486
- ...options,
2487
- method: "GET",
2488
- });
2489
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
2490
- const data = body ? JSON.parse(body) : {};
2491
- return { data, status: res.status, headers: res.headers };
2492
- };
2493
- export const getCreateSnapshotUrl = () => {
2494
- return `https://compute.leaflow.cloud/api/v1/snapshots`;
2495
- };
2496
- /**
2497
- * Disks attached to a running instance can be snapshotted. A snapshot records the state of the block device at a point in time and may be inconsistent at the file-system level, so run `sync` inside the instance first where the data matters.
2498
- *
2499
- * **A snapshot of a system disk cannot be used to revert that system disk**: reverting requires the disk to be detached, and a system disk cannot be detached. It can be used to create a new data disk. To preserve and restore an entire system, use a private image; for a copy that crosses availability zones and survives deletion of the disk, use a backup.
2500
- *
2501
- * Snapshot slots are purchased separately for this project and the source disk's region. This operation reserves one available slot and returns the snapshot as `pending`; it places no order and charges nothing. `pending` and `provisioning` snapshots occupy slots, so concurrent requests cannot exceed the purchased limit. Read the snapshot until it is `available` or `failed`.
2502
- *
2503
- * Refused with SNAPSHOT_QUOTA_EXCEEDED when no slot is available. meta.region_id, meta.limit and meta.used identify the applicable quota. A failed creation releases its slot only after any snapshot data has been confirmed absent or removed.
2504
- * @summary Create a snapshot
2505
- */
2506
- export const createSnapshot = async (createSnapshotRequestBody, options, fetchFn) => {
2507
- const getHeaders = (h) => {
2508
- if (!h)
2509
- return {};
2510
- if (h instanceof Headers)
2511
- return Object.fromEntries(h.entries());
2512
- if (Symbol.iterator in h) {
2513
- return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
2514
- }
2515
- const headers = {};
2516
- for (const [name, value] of Object.entries(h)) {
2517
- if (value !== undefined)
2518
- headers[name] = value;
2519
- }
2520
- return headers;
2521
- };
2522
- const res = await (fetchFn ?? fetch)(getCreateSnapshotUrl(), {
2523
- ...options,
2524
- method: "POST",
2525
- headers: { "Content-Type": "application/json", ...getHeaders(options?.headers) },
2526
- body: JSON.stringify(createSnapshotRequestBody),
2527
- });
2528
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
2529
- const data = body ? JSON.parse(body) : {};
2530
- return { data, status: res.status, headers: res.headers };
2531
- };
2532
- export const getGetSnapshotUrl = (snapshotId) => {
2533
- return `https://compute.leaflow.cloud/api/v1/snapshots/${encodeURIComponent(String(snapshotId))}`;
2534
- };
2535
- /**
2536
- * @summary Retrieve a snapshot
2537
- */
2538
- export const getSnapshot = async (snapshotId, options, fetchFn) => {
2539
- const res = await (fetchFn ?? fetch)(getGetSnapshotUrl(snapshotId), {
2540
- ...options,
2541
- method: "GET",
2542
- });
2543
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
2544
- const data = body ? JSON.parse(body) : {};
2545
- return { data, status: res.status, headers: res.headers };
2546
- };
2547
- export const getRenameSnapshotUrl = (snapshotId) => {
2548
- return `https://compute.leaflow.cloud/api/v1/snapshots/${encodeURIComponent(String(snapshotId))}`;
2549
- };
2550
- /**
2551
- * @summary Rename a snapshot
2552
- */
2553
- export const renameSnapshot = async (snapshotId, renameSnapshotRequestBody, options, fetchFn) => {
2554
- const getHeaders = (h) => {
2555
- if (!h)
2556
- return {};
2557
- if (h instanceof Headers)
2558
- return Object.fromEntries(h.entries());
2559
- if (Symbol.iterator in h) {
2560
- return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
2561
- }
2562
- const headers = {};
2563
- for (const [name, value] of Object.entries(h)) {
2564
- if (value !== undefined)
2565
- headers[name] = value;
2566
- }
2567
- return headers;
2568
- };
2569
- const res = await (fetchFn ?? fetch)(getRenameSnapshotUrl(snapshotId), {
2570
- ...options,
2571
- method: "PATCH",
2572
- headers: { "Content-Type": "application/json", ...getHeaders(options?.headers) },
2573
- body: JSON.stringify(renameSnapshotRequestBody),
2574
- });
2575
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
2576
- const data = body ? JSON.parse(body) : {};
2577
- return { data, status: res.status, headers: res.headers };
2578
- };
2579
- export const getDeleteSnapshotUrl = (snapshotId) => {
2580
- return `https://compute.leaflow.cloud/api/v1/snapshots/${encodeURIComponent(String(snapshotId))}`;
2581
- };
2582
- /**
2583
- * Deletes this snapshot without canceling the project's snapshot quota purchase. A snapshot has no individual Billing subscription. Its slot stays occupied until the deletion is confirmed.
2584
- * @summary Delete a snapshot
2585
- */
2586
- export const deleteSnapshot = async (snapshotId, options, fetchFn) => {
2587
- const res = await (fetchFn ?? fetch)(getDeleteSnapshotUrl(snapshotId), {
2588
- ...options,
2589
- method: "DELETE",
2590
- });
2591
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
2592
- const data = body ? JSON.parse(body) : {};
2593
- return { data, status: res.status, headers: res.headers };
2594
- };
2595
- export const getListIpv4PoolsUrl = (params) => {
2596
- const normalizedParams = new URLSearchParams();
2597
- Object.entries(params || {}).forEach(([key, value]) => {
2598
- if (value !== undefined) {
2599
- normalizedParams.append(key, value === null ? "null" : String(value));
2600
- }
2601
- });
2602
- const stringifiedParams = normalizedParams.toString();
2603
- return stringifiedParams.length > 0
2604
- ? `https://compute.leaflow.cloud/api/v1/ipv4-pools?${stringifiedParams}`
2605
- : `https://compute.leaflow.cloud/api/v1/ipv4-pools`;
2606
- };
2607
- /**
2608
- * Lists the public IP pools available for new allocations in this region.
2609
- * @summary List public IP pools
2610
- */
2611
- export const listIpv4Pools = async (params, options, fetchFn) => {
2612
- const res = await (fetchFn ?? fetch)(getListIpv4PoolsUrl(params), {
2613
- ...options,
2614
- method: "GET",
2615
- });
2616
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
2617
- const data = body ? JSON.parse(body) : {};
2618
- return { data, status: res.status, headers: res.headers };
2619
- };
2620
- export const getListPeeringsUrl = (params) => {
2621
- const normalizedParams = new URLSearchParams();
2622
- Object.entries(params || {}).forEach(([key, value]) => {
2623
- if (value !== undefined) {
2624
- normalizedParams.append(key, value === null ? "null" : String(value));
2625
- }
2626
- });
2627
- const stringifiedParams = normalizedParams.toString();
2628
- return stringifiedParams.length > 0
2629
- ? `https://compute.leaflow.cloud/api/v1/peerings?${stringifiedParams}`
2630
- : `https://compute.leaflow.cloud/api/v1/peerings`;
2631
- };
2632
- /**
2633
- * @summary List peerings
2634
- */
2635
- export const listPeerings = async (params, options, fetchFn) => {
2636
- const res = await (fetchFn ?? fetch)(getListPeeringsUrl(params), {
2637
- ...options,
2638
- method: "GET",
2639
- });
2640
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
2641
- const data = body ? JSON.parse(body) : {};
2642
- return { data, status: res.status, headers: res.headers };
2643
- };
2644
- export const getCreatePeeringUrl = () => {
2645
- return `https://compute.leaflow.cloud/api/v1/peerings`;
2646
- };
2647
- /**
2648
- * Request IPv4 peering between non-overlapping VPCs in the same Region. The target project must accept before any connectivity is created. Does not change security groups or provide transitive routing.
2649
- * @summary Create peering
2650
- */
2651
- export const createPeering = async (createPeeringRequestBody, options, fetchFn) => {
2652
- const getHeaders = (h) => {
2653
- if (!h)
2654
- return {};
2655
- if (h instanceof Headers)
2656
- return Object.fromEntries(h.entries());
2657
- if (Symbol.iterator in h) {
2658
- return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
2659
- }
2660
- const headers = {};
2661
- for (const [name, value] of Object.entries(h)) {
2662
- if (value !== undefined)
2663
- headers[name] = value;
2664
- }
2665
- return headers;
2666
- };
2667
- const res = await (fetchFn ?? fetch)(getCreatePeeringUrl(), {
2668
- ...options,
2669
- method: "POST",
2670
- headers: { "Content-Type": "application/json", ...getHeaders(options?.headers) },
2671
- body: JSON.stringify(createPeeringRequestBody),
2672
- });
2673
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
2674
- const data = body ? JSON.parse(body) : {};
2675
- return { data, status: res.status, headers: res.headers };
2676
- };
2677
- export const getGetPeeringUrl = (peeringId) => {
2678
- return `https://compute.leaflow.cloud/api/v1/peerings/${encodeURIComponent(String(peeringId))}`;
2679
- };
2680
- /**
2681
- * @summary Get peering
2682
- */
2683
- export const getPeering = async (peeringId, options, fetchFn) => {
2684
- const res = await (fetchFn ?? fetch)(getGetPeeringUrl(peeringId), {
2685
- ...options,
2686
- method: "GET",
2687
- });
2688
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
2689
- const data = body ? JSON.parse(body) : {};
2690
- return { data, status: res.status, headers: res.headers };
2691
- };
2692
- export const getDeletePeeringUrl = (peeringId) => {
2693
- return `https://compute.leaflow.cloud/api/v1/peerings/${encodeURIComponent(String(peeringId))}`;
2694
- };
2695
- /**
2696
- * @summary Delete peering
2697
- */
2698
- export const deletePeering = async (peeringId, options, fetchFn) => {
2699
- const res = await (fetchFn ?? fetch)(getDeletePeeringUrl(peeringId), {
2700
- ...options,
2701
- method: "DELETE",
2702
- });
2703
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
2704
- const data = body ? JSON.parse(body) : {};
2705
- return { data, status: res.status, headers: res.headers };
2706
- };
2707
- export const getAcceptPeeringUrl = (peeringId) => {
2708
- return `https://compute.leaflow.cloud/api/v1/peerings/${encodeURIComponent(String(peeringId))}:accept`;
2709
- };
2710
- /**
2711
- * @summary Accept peering
2712
- */
2713
- export const acceptPeering = async (peeringId, options, fetchFn) => {
2714
- const res = await (fetchFn ?? fetch)(getAcceptPeeringUrl(peeringId), {
2715
- ...options,
2716
- method: "POST",
2717
- });
2718
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
2719
- const data = body ? JSON.parse(body) : {};
2720
- return { data, status: res.status, headers: res.headers };
2721
- };
2722
- export const getRejectPeeringUrl = (peeringId) => {
2723
- return `https://compute.leaflow.cloud/api/v1/peerings/${encodeURIComponent(String(peeringId))}:reject`;
2724
- };
2725
- /**
2726
- * @summary Reject peering
2727
- */
2728
- export const rejectPeering = async (peeringId, options, fetchFn) => {
2729
- const res = await (fetchFn ?? fetch)(getRejectPeeringUrl(peeringId), {
2730
- ...options,
2731
- method: "POST",
2732
- });
2733
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
2734
- const data = body ? JSON.parse(body) : {};
2735
- return { data, status: res.status, headers: res.headers };
2736
- };