hyperstack 1.25.0a0__py3-none-any.whl → 1.41.2a0__py3-none-any.whl

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 (225) hide show
  1. hyperstack/__init__.py +80 -131
  2. hyperstack/api/__init__.py +2 -0
  3. hyperstack/api/alive_api.py +240 -0
  4. hyperstack/api/api_key_api.py +16 -20
  5. hyperstack/api/assigning_member_role_api.py +15 -17
  6. hyperstack/api/auth_api.py +1050 -5
  7. hyperstack/api/beta_access_api.py +856 -0
  8. hyperstack/api/billing_api.py +6461 -673
  9. hyperstack/api/calculate_api.py +8 -9
  10. hyperstack/api/callbacks_api.py +120 -126
  11. hyperstack/api/cluster_events_api.py +1 -2
  12. hyperstack/api/clusters_api.py +2816 -199
  13. hyperstack/api/compliance_api.py +14 -18
  14. hyperstack/api/credit_api.py +17 -15
  15. hyperstack/api/customer_contract_api.py +30 -33
  16. hyperstack/api/dashboard_api.py +4 -5
  17. hyperstack/api/deployment_api.py +4 -8
  18. hyperstack/api/environment_api.py +285 -16
  19. hyperstack/api/firewall_attachment_api.py +11 -9
  20. hyperstack/api/firewalls_api.py +341 -347
  21. hyperstack/api/flavor_api.py +4 -5
  22. hyperstack/api/floating_ip_api.py +50 -49
  23. hyperstack/api/gpu_api.py +1 -2
  24. hyperstack/api/image_api.py +35 -39
  25. hyperstack/api/invite_api.py +288 -18
  26. hyperstack/api/keypair_api.py +22 -26
  27. hyperstack/api/organization_api.py +12 -15
  28. hyperstack/api/partner_config_api.py +564 -0
  29. hyperstack/api/payment_api.py +299 -18
  30. hyperstack/api/permission_api.py +4 -5
  31. hyperstack/api/policy_api.py +4 -5
  32. hyperstack/api/pricebook_api.py +14 -12
  33. hyperstack/api/profile_api.py +13 -17
  34. hyperstack/api/rbac_role_api.py +20 -25
  35. hyperstack/api/region_api.py +7 -8
  36. hyperstack/api/security_rules_api.py +1 -2
  37. hyperstack/api/snapshot_events_api.py +1 -2
  38. hyperstack/api/snapshots_api.py +166 -172
  39. hyperstack/api/stock_api.py +4 -5
  40. hyperstack/api/template_api.py +14 -19
  41. hyperstack/api/user_api.py +55 -49
  42. hyperstack/api/user_detail_choice_api.py +1 -2
  43. hyperstack/api/user_permission_api.py +8 -10
  44. hyperstack/api/virtual_machine_api.py +1529 -929
  45. hyperstack/api/virtual_machine_events_api.py +21 -22
  46. hyperstack/api/vnc_url_api.py +54 -50
  47. hyperstack/api/volume_api.py +340 -40
  48. hyperstack/api/volume_attachment_api.py +342 -42
  49. hyperstack/api_client.py +1 -1
  50. hyperstack/configuration.py +1 -11
  51. hyperstack/models/__init__.py +77 -130
  52. hyperstack/models/{environment_fieldsfor_volume.py → access_token_field.py} +7 -7
  53. hyperstack/models/attach_volume_fields.py +6 -2
  54. hyperstack/models/attach_volumes_payload.py +4 -2
  55. hyperstack/models/{virtual_machine_usage.py → attachments_fields_for_volume.py} +13 -11
  56. hyperstack/models/{flavor_vm_fields.py → attributes.py} +15 -18
  57. hyperstack/models/auth_get_token_response_model.py +4 -6
  58. hyperstack/models/{future_node_model.py → beta_access_request_fields.py} +27 -25
  59. hyperstack/models/{create_gpu.py → beta_access_request_payload.py} +9 -11
  60. hyperstack/models/{create_discount_response.py → beta_access_request_response_model.py} +11 -11
  61. hyperstack/models/{export_billing_data_request.py → beta_access_status_item.py} +20 -23
  62. hyperstack/models/{get_all_discount_for_all_organization_response.py → beta_access_status_response_model.py} +15 -15
  63. hyperstack/models/{exclude_billing_post_response.py → billing_history.py} +13 -11
  64. hyperstack/models/billing_history_data_synthesis_details.py +105 -0
  65. hyperstack/models/{vm_usage_response.py → billing_history_fine_tuning.py} +23 -19
  66. hyperstack/models/billing_history_model_evalutation_details.py +105 -0
  67. hyperstack/models/{get_all_discounts_fields.py → billing_history_serverless_inference.py} +23 -24
  68. hyperstack/models/billing_history_serverless_inference_details.py +105 -0
  69. hyperstack/models/{billingmetricesfields.py → billing_metrices_fields.py} +4 -4
  70. hyperstack/models/{billingmetricesresponse.py → billing_metrices_response.py} +7 -7
  71. hyperstack/models/cluster_fields.py +27 -9
  72. hyperstack/models/{add_update_flavor_organization_payload.py → cluster_flavor_fields.py} +28 -26
  73. hyperstack/models/{historical_instances_fields.py → cluster_node_fields.py} +24 -22
  74. hyperstack/models/{internal_instance_flavor_fields.py → cluster_node_group_fields.py} +17 -17
  75. hyperstack/models/{create_update_policy_response_model.py → cluster_node_groups_create_response.py} +21 -11
  76. hyperstack/models/{create_update_permission_response_model.py → cluster_node_groups_get_response.py} +11 -11
  77. hyperstack/models/{auth_request_login_response_model.py → cluster_node_groups_list_response.py} +15 -11
  78. hyperstack/models/{contract_eligible_instance_fields.py → cluster_node_instance_fields.py} +13 -11
  79. hyperstack/models/{image_logos.py → cluster_nodes_list_response.py} +14 -14
  80. hyperstack/models/{internal_environment_fields.py → cluster_version.py} +13 -9
  81. hyperstack/models/cluster_versions.py +10 -2
  82. hyperstack/models/{future_nodes_stock_model.py → colors.py} +17 -15
  83. hyperstack/models/contract_discount_plan_fields.py +3 -1
  84. hyperstack/models/contract_instance_fields.py +7 -1
  85. hyperstack/models/{future_node_response_model.py → create_cluster_node_fields.py} +23 -18
  86. hyperstack/models/{update_gpu.py → create_cluster_node_group_payload.py} +12 -11
  87. hyperstack/models/create_cluster_payload.py +31 -8
  88. hyperstack/models/create_environment.py +1 -1
  89. hyperstack/models/create_instances_payload.py +7 -7
  90. hyperstack/models/create_profile_payload.py +1 -1
  91. hyperstack/models/create_snapshot_payload.py +2 -4
  92. hyperstack/models/create_volume_payload.py +1 -1
  93. hyperstack/models/data_synthesis_billing_history_details_response_schema.py +95 -0
  94. hyperstack/models/{deployment_fieldsforstartdeployments.py → deployment_fields_for_start_deployments.py} +4 -4
  95. hyperstack/models/{editlabelofanexisting_vm_payload.py → edit_label_of_an_existing_vm_payload.py} +4 -4
  96. hyperstack/models/environment_features.py +14 -2
  97. hyperstack/models/{node_stocks_payload.py → environment_fields_for_volume.py} +10 -12
  98. hyperstack/models/flavor_fields.py +3 -1
  99. hyperstack/models/{customer_fields.py → flavor_label_fields.py} +7 -7
  100. hyperstack/models/{getcreditandthresholdinfo.py → get_credit_and_threshold_info.py} +4 -4
  101. hyperstack/models/{getcreditandthresholdinfoinresponse.py → get_credit_and_threshold_info_in_response.py} +7 -7
  102. hyperstack/models/{region_payload.py → get_instance_logs_response.py} +7 -9
  103. hyperstack/models/instance_fields.py +8 -4
  104. hyperstack/models/instance_flavor_fields.py +13 -1
  105. hyperstack/models/{flavor_response.py → keypair_environment_features.py} +20 -16
  106. hyperstack/models/{internal_instance_keypair_fields.py → keypair_environment_fields.py} +13 -11
  107. hyperstack/models/keypair_fields.py +6 -2
  108. hyperstack/models/{lastdaycostfields.py → last_day_cost_fields.py} +4 -4
  109. hyperstack/models/{lastdaycostresponse.py → last_day_cost_response.py} +7 -7
  110. hyperstack/models/{export_billing_data_response.py → logos.py} +13 -9
  111. hyperstack/models/{verify_api_key_response_model.py → manual_reconciliation_model.py} +13 -13
  112. hyperstack/models/{creditrequestresponse.py → master_flavors_response.py} +14 -14
  113. hyperstack/models/{customer_payload.py → mfa_status_fields.py} +8 -10
  114. hyperstack/models/{gpu.py → mfa_status_response.py} +11 -11
  115. hyperstack/models/model_evaluation_billing_history_details_response_schema.py +95 -0
  116. hyperstack/models/{organization_thresholdfields.py → organization_threshold_fields.py} +4 -4
  117. hyperstack/models/{organizationthresholdupdateresponse.py → organization_threshold_update_response.py} +7 -7
  118. hyperstack/models/{organizationthresholdsresponse.py → organization_thresholds_response.py} +7 -7
  119. hyperstack/models/{logo_get_response.py → pagination.py} +12 -12
  120. hyperstack/models/{billing_response.py → partner_config.py} +31 -20
  121. hyperstack/models/payment_details_fields.py +5 -1
  122. hyperstack/models/{logout_payload.py → primary_color.py} +10 -8
  123. hyperstack/models/region_fields.py +16 -2
  124. hyperstack/models/{vm_usage_request_payload.py → request_instance_logs_payload.py} +8 -8
  125. hyperstack/models/{stock_visibility_user_payload.py → request_instance_logs_response.py} +8 -8
  126. hyperstack/models/{contract_billing_history.py → resource_level_billing_bucket_details_resources.py} +10 -10
  127. hyperstack/models/{node_response_model.py → resource_level_billing_history_resources_cluster.py} +21 -11
  128. hyperstack/models/resource_level_billing_history_response_attributes.py +3 -1
  129. hyperstack/models/{get_all_contracts_response_model.py → resource_level_bucket_billing_details_response_model.py} +11 -15
  130. hyperstack/models/{contract_billing_history_response_model.py → resource_level_bucket_billing_history_response_model.py} +11 -11
  131. hyperstack/models/resource_level_cluster_billing_details_response_model.py +95 -0
  132. hyperstack/models/resource_level_cluster_billing_history_response_model.py +95 -0
  133. hyperstack/models/{get_discount_detail_response.py → resource_level_cluster_graph_billing_details_response_model.py} +11 -11
  134. hyperstack/models/{organization_object_response.py → resource_level_graph_billing_details_bucket.py} +18 -14
  135. hyperstack/models/{update_discounts_status_payload.py → secondary_color.py} +10 -8
  136. hyperstack/models/{security_rules_fieldsfor_instance.py → security_rules_fields_for_instance.py} +4 -4
  137. hyperstack/models/serverless_inferenced_billing_history_details_response_schema.py +95 -0
  138. hyperstack/models/snapshot_fields.py +6 -1
  139. hyperstack/models/snapshot_retrieve_fields.py +29 -2
  140. hyperstack/models/start_deployment.py +3 -3
  141. hyperstack/models/{subscribeorunsubscribeupdatepayload.py → subscribe_or_unsubscribe_update_payload.py} +4 -4
  142. hyperstack/models/token_based_billing_history_response.py +95 -0
  143. hyperstack/models/{update_keypairnameresponse.py → update_keypair_name_response.py} +4 -4
  144. hyperstack/models/update_volume_attachment_payload.py +87 -0
  145. hyperstack/models/{verify_api_key_payload.py → update_volume_payload.py} +7 -7
  146. hyperstack/models/{stock_visibility_user_list_response.py → update_volume_response.py} +14 -16
  147. hyperstack/models/{auth_request_login_fields.py → uris.py} +19 -9
  148. hyperstack/models/{userinfopostpayload.py → user_info_post_payload.py} +4 -4
  149. hyperstack/models/{node_stock_response_model.py → user_organizations_response.py} +14 -14
  150. hyperstack/models/users_info_fields.py +3 -1
  151. hyperstack/models/volume_attachment_fields.py +9 -5
  152. hyperstack/models/volume_fields.py +14 -4
  153. hyperstack/models/{volume_fieldsfor_instance.py → volume_fields_for_instance.py} +4 -4
  154. hyperstack/models/volumes.py +17 -11
  155. hyperstack/models/{instances_summary_fields.py → volumes_fields.py} +33 -29
  156. hyperstack/models/workload_billing_history_response.py +95 -0
  157. {hyperstack-1.25.0a0.dist-info → hyperstack-1.41.2a0.dist-info}/METADATA +2 -2
  158. hyperstack-1.41.2a0.dist-info/RECORD +350 -0
  159. {hyperstack-1.25.0a0.dist-info → hyperstack-1.41.2a0.dist-info}/WHEEL +1 -1
  160. hyperstack/models/api_key_verify_fields.py +0 -93
  161. hyperstack/models/billing_immune_resources_response.py +0 -95
  162. hyperstack/models/contract_billing_history_response_attributes.py +0 -99
  163. hyperstack/models/contract_change_payload.py +0 -101
  164. hyperstack/models/contract_eligible_instances_response.py +0 -101
  165. hyperstack/models/contract_event_create_model.py +0 -91
  166. hyperstack/models/contract_resource_payload.py +0 -95
  167. hyperstack/models/contractl_billing_history_response_metrics.py +0 -87
  168. hyperstack/models/create_contract_fields.py +0 -110
  169. hyperstack/models/create_contract_payload.py +0 -106
  170. hyperstack/models/create_discounts_payload.py +0 -112
  171. hyperstack/models/create_update_permission_payload.py +0 -93
  172. hyperstack/models/create_update_policy_payload.py +0 -93
  173. hyperstack/models/creditrechargelimitfield.py +0 -93
  174. hyperstack/models/creditrechargelimitresponse.py +0 -99
  175. hyperstack/models/creditrequests.py +0 -96
  176. hyperstack/models/data.py +0 -91
  177. hyperstack/models/discount_entity_model.py +0 -97
  178. hyperstack/models/discount_fields.py +0 -100
  179. hyperstack/models/discount_plan_fields.py +0 -108
  180. hyperstack/models/discount_resource_fields.py +0 -93
  181. hyperstack/models/discount_resource_payload.py +0 -93
  182. hyperstack/models/exclude_billing_post_payload.py +0 -91
  183. hyperstack/models/field_change.py +0 -91
  184. hyperstack/models/flavor_payload.py +0 -101
  185. hyperstack/models/flavor_vms_response.py +0 -99
  186. hyperstack/models/future_node_stock_model.py +0 -93
  187. hyperstack/models/future_node_update_model.py +0 -98
  188. hyperstack/models/get_all_contract_fields.py +0 -100
  189. hyperstack/models/get_discount_response.py +0 -99
  190. hyperstack/models/get_entity_discount_detail_response.py +0 -108
  191. hyperstack/models/get_token_payload.py +0 -89
  192. hyperstack/models/get_version_response.py +0 -91
  193. hyperstack/models/historical_instance.py +0 -101
  194. hyperstack/models/infrahub_resource_object_response.py +0 -119
  195. hyperstack/models/insert_discount_plan_fields.py +0 -112
  196. hyperstack/models/internal_instance_fields.py +0 -156
  197. hyperstack/models/internal_instance_image_fields.py +0 -95
  198. hyperstack/models/internal_instances_response.py +0 -99
  199. hyperstack/models/internal_security_rules_fields_for_instance.py +0 -104
  200. hyperstack/models/internal_volume_attachment_fields.py +0 -98
  201. hyperstack/models/internal_volume_fields.py +0 -95
  202. hyperstack/models/internal_volumes_response.py +0 -99
  203. hyperstack/models/new_stock_update_response_model.py +0 -89
  204. hyperstack/models/node_model.py +0 -114
  205. hyperstack/models/node_payload_model.py +0 -97
  206. hyperstack/models/node_power_usage_model.py +0 -120
  207. hyperstack/models/node_stock_payload_model.py +0 -95
  208. hyperstack/models/organizationcreditrechargelimitresponse.py +0 -95
  209. hyperstack/models/power_usage_model.py +0 -89
  210. hyperstack/models/pricebook_resource_object_response.py +0 -107
  211. hyperstack/models/refresh_token_payload.py +0 -89
  212. hyperstack/models/region_response.py +0 -95
  213. hyperstack/models/set_defaults_payload.py +0 -89
  214. hyperstack/models/single_visibility_user_response.py +0 -91
  215. hyperstack/models/success_response_model.py +0 -89
  216. hyperstack/models/token_fields.py +0 -91
  217. hyperstack/models/update_contract_payload.py +0 -104
  218. hyperstack/models/update_discounts_payload.py +0 -102
  219. hyperstack/models/user_transfer_payload.py +0 -89
  220. hyperstack/models/volume_status_change_fields.py +0 -96
  221. hyperstack/models/volumes_last_status_change_response.py +0 -99
  222. hyperstack/models/warning_mail_log_fields.py +0 -99
  223. hyperstack/models/warning_mail_log_response.py +0 -101
  224. hyperstack-1.25.0a0.dist-info/RECORD +0 -401
  225. {hyperstack-1.25.0a0.dist-info → hyperstack-1.41.2a0.dist-info}/top_level.txt +0 -0
@@ -46,10 +46,9 @@ class FirewallsApi:
46
46
 
47
47
 
48
48
  @validate_call
49
- def add_firewall_rule_to_firewall(
49
+ def delete_security_group_details(
50
50
  self,
51
- firewall_id: StrictInt,
52
- payload: CreateFirewallRulePayload,
51
+ id: StrictInt,
53
52
  _request_timeout: Union[
54
53
  None,
55
54
  Annotated[StrictFloat, Field(gt=0)],
@@ -62,15 +61,13 @@ class FirewallsApi:
62
61
  _content_type: Optional[StrictStr] = None,
63
62
  _headers: Optional[Dict[StrictStr, Any]] = None,
64
63
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
65
- ) -> FirewallRule:
66
- """Add firewall rule to firewall
64
+ ) -> ResponseModel:
65
+ """Delete firewall
67
66
 
68
- Creates a [**firewall rule**](https://infrahub-doc.nexgencloud.com/docs/network-security/security-rules) and adds it to an existing firewall. Include the firewall ID in the path, and provide the firewall rule configuration in the request body.
67
+ Deletes a firewall by specifying the firewall ID in the path. If the firewall is currently attached to a virtual machine, it must be detached before deletion. For more information, [**click here**](https://docs...cloud/docs/api-reference/core-resources/firewalls/delete-firewall).
69
68
 
70
- :param firewall_id: (required)
71
- :type firewall_id: int
72
- :param payload: (required)
73
- :type payload: CreateFirewallRulePayload
69
+ :param id: (required)
70
+ :type id: int
74
71
  :param _request_timeout: timeout setting for this request. If one
75
72
  number provided, it will be total request
76
73
  timeout. It can also be a pair (tuple) of
@@ -93,9 +90,8 @@ class FirewallsApi:
93
90
  :return: Returns the result object.
94
91
  """ # noqa: E501
95
92
 
96
- _param = self._add_firewall_rule_to_firewall_serialize(
97
- firewall_id=firewall_id,
98
- payload=payload,
93
+ _param = self._delete_security_group_details_serialize(
94
+ id=id,
99
95
  _request_auth=_request_auth,
100
96
  _content_type=_content_type,
101
97
  _headers=_headers,
@@ -103,10 +99,12 @@ class FirewallsApi:
103
99
  )
104
100
 
105
101
  _response_types_map: Dict[str, Optional[str]] = {
106
- '200': "FirewallRule",
102
+ '200': "ResponseModel",
107
103
  '400': "ErrorResponseModel",
108
104
  '401': "ErrorResponseModel",
109
105
  '403': "ErrorResponseModel",
106
+ '404': "ErrorResponseModel",
107
+ '409': "ErrorResponseModel",
110
108
  '500': None,
111
109
  }
112
110
  response_data = self.api_client.call_api(
@@ -121,10 +119,9 @@ class FirewallsApi:
121
119
 
122
120
 
123
121
  @validate_call
124
- def add_firewall_rule_to_firewall_with_http_info(
122
+ def delete_security_group_details_with_http_info(
125
123
  self,
126
- firewall_id: StrictInt,
127
- payload: CreateFirewallRulePayload,
124
+ id: StrictInt,
128
125
  _request_timeout: Union[
129
126
  None,
130
127
  Annotated[StrictFloat, Field(gt=0)],
@@ -137,15 +134,13 @@ class FirewallsApi:
137
134
  _content_type: Optional[StrictStr] = None,
138
135
  _headers: Optional[Dict[StrictStr, Any]] = None,
139
136
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
140
- ) -> ApiResponse[FirewallRule]:
141
- """Add firewall rule to firewall
137
+ ) -> ApiResponse[ResponseModel]:
138
+ """Delete firewall
142
139
 
143
- Creates a [**firewall rule**](https://infrahub-doc.nexgencloud.com/docs/network-security/security-rules) and adds it to an existing firewall. Include the firewall ID in the path, and provide the firewall rule configuration in the request body.
140
+ Deletes a firewall by specifying the firewall ID in the path. If the firewall is currently attached to a virtual machine, it must be detached before deletion. For more information, [**click here**](https://docs...cloud/docs/api-reference/core-resources/firewalls/delete-firewall).
144
141
 
145
- :param firewall_id: (required)
146
- :type firewall_id: int
147
- :param payload: (required)
148
- :type payload: CreateFirewallRulePayload
142
+ :param id: (required)
143
+ :type id: int
149
144
  :param _request_timeout: timeout setting for this request. If one
150
145
  number provided, it will be total request
151
146
  timeout. It can also be a pair (tuple) of
@@ -168,9 +163,8 @@ class FirewallsApi:
168
163
  :return: Returns the result object.
169
164
  """ # noqa: E501
170
165
 
171
- _param = self._add_firewall_rule_to_firewall_serialize(
172
- firewall_id=firewall_id,
173
- payload=payload,
166
+ _param = self._delete_security_group_details_serialize(
167
+ id=id,
174
168
  _request_auth=_request_auth,
175
169
  _content_type=_content_type,
176
170
  _headers=_headers,
@@ -178,10 +172,12 @@ class FirewallsApi:
178
172
  )
179
173
 
180
174
  _response_types_map: Dict[str, Optional[str]] = {
181
- '200': "FirewallRule",
175
+ '200': "ResponseModel",
182
176
  '400': "ErrorResponseModel",
183
177
  '401': "ErrorResponseModel",
184
178
  '403': "ErrorResponseModel",
179
+ '404': "ErrorResponseModel",
180
+ '409': "ErrorResponseModel",
185
181
  '500': None,
186
182
  }
187
183
  response_data = self.api_client.call_api(
@@ -196,10 +192,9 @@ class FirewallsApi:
196
192
 
197
193
 
198
194
  @validate_call
199
- def add_firewall_rule_to_firewall_without_preload_content(
195
+ def delete_security_group_details_without_preload_content(
200
196
  self,
201
- firewall_id: StrictInt,
202
- payload: CreateFirewallRulePayload,
197
+ id: StrictInt,
203
198
  _request_timeout: Union[
204
199
  None,
205
200
  Annotated[StrictFloat, Field(gt=0)],
@@ -213,14 +208,12 @@ class FirewallsApi:
213
208
  _headers: Optional[Dict[StrictStr, Any]] = None,
214
209
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
215
210
  ) -> RESTResponseType:
216
- """Add firewall rule to firewall
211
+ """Delete firewall
217
212
 
218
- Creates a [**firewall rule**](https://infrahub-doc.nexgencloud.com/docs/network-security/security-rules) and adds it to an existing firewall. Include the firewall ID in the path, and provide the firewall rule configuration in the request body.
213
+ Deletes a firewall by specifying the firewall ID in the path. If the firewall is currently attached to a virtual machine, it must be detached before deletion. For more information, [**click here**](https://docs...cloud/docs/api-reference/core-resources/firewalls/delete-firewall).
219
214
 
220
- :param firewall_id: (required)
221
- :type firewall_id: int
222
- :param payload: (required)
223
- :type payload: CreateFirewallRulePayload
215
+ :param id: (required)
216
+ :type id: int
224
217
  :param _request_timeout: timeout setting for this request. If one
225
218
  number provided, it will be total request
226
219
  timeout. It can also be a pair (tuple) of
@@ -243,9 +236,8 @@ class FirewallsApi:
243
236
  :return: Returns the result object.
244
237
  """ # noqa: E501
245
238
 
246
- _param = self._add_firewall_rule_to_firewall_serialize(
247
- firewall_id=firewall_id,
248
- payload=payload,
239
+ _param = self._delete_security_group_details_serialize(
240
+ id=id,
249
241
  _request_auth=_request_auth,
250
242
  _content_type=_content_type,
251
243
  _headers=_headers,
@@ -253,10 +245,12 @@ class FirewallsApi:
253
245
  )
254
246
 
255
247
  _response_types_map: Dict[str, Optional[str]] = {
256
- '200': "FirewallRule",
248
+ '200': "ResponseModel",
257
249
  '400': "ErrorResponseModel",
258
250
  '401': "ErrorResponseModel",
259
251
  '403': "ErrorResponseModel",
252
+ '404': "ErrorResponseModel",
253
+ '409': "ErrorResponseModel",
260
254
  '500': None,
261
255
  }
262
256
  response_data = self.api_client.call_api(
@@ -266,10 +260,9 @@ class FirewallsApi:
266
260
  return response_data.response
267
261
 
268
262
 
269
- def _add_firewall_rule_to_firewall_serialize(
263
+ def _delete_security_group_details_serialize(
270
264
  self,
271
- firewall_id,
272
- payload,
265
+ id,
273
266
  _request_auth,
274
267
  _content_type,
275
268
  _headers,
@@ -291,14 +284,12 @@ class FirewallsApi:
291
284
  _body_params: Optional[bytes] = None
292
285
 
293
286
  # process the path parameters
294
- if firewall_id is not None:
295
- _path_params['firewall_id'] = firewall_id
287
+ if id is not None:
288
+ _path_params['id'] = id
296
289
  # process the query parameters
297
290
  # process the header parameters
298
291
  # process the form parameters
299
292
  # process the body parameter
300
- if payload is not None:
301
- _body_params = payload
302
293
 
303
294
 
304
295
  # set the HTTP header `Accept`
@@ -309,29 +300,15 @@ class FirewallsApi:
309
300
  ]
310
301
  )
311
302
 
312
- # set the HTTP header `Content-Type`
313
- if _content_type:
314
- _header_params['Content-Type'] = _content_type
315
- else:
316
- _default_content_type = (
317
- self.api_client.select_header_content_type(
318
- [
319
- 'application/json'
320
- ]
321
- )
322
- )
323
- if _default_content_type is not None:
324
- _header_params['Content-Type'] = _default_content_type
325
303
 
326
304
  # authentication setting
327
305
  _auth_settings: List[str] = [
328
- 'apiKey',
329
- 'accessToken'
306
+ 'apiKey'
330
307
  ]
331
308
 
332
309
  return self.api_client.param_serialize(
333
- method='POST',
334
- resource_path='/core/firewalls/{firewall_id}/firewall-rules',
310
+ method='DELETE',
311
+ resource_path='/core/firewalls/{id}',
335
312
  path_params=_path_params,
336
313
  query_params=_query_params,
337
314
  header_params=_header_params,
@@ -348,9 +325,10 @@ class FirewallsApi:
348
325
 
349
326
 
350
327
  @validate_call
351
- def create_firewall(
328
+ def delete_security_group_rule_delete(
352
329
  self,
353
- payload: CreateFirewallPayload,
330
+ firewall_id: StrictInt,
331
+ firewall_rule_id: StrictInt,
354
332
  _request_timeout: Union[
355
333
  None,
356
334
  Annotated[StrictFloat, Field(gt=0)],
@@ -363,13 +341,15 @@ class FirewallsApi:
363
341
  _content_type: Optional[StrictStr] = None,
364
342
  _headers: Optional[Dict[StrictStr, Any]] = None,
365
343
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
366
- ) -> FirewallResponse:
367
- """Create firewall
344
+ ) -> ResponseModel:
345
+ """Delete firewall rules from firewall
368
346
 
369
- Creates a firewall to which firewall rules can be added. A firewall can be attached to one or more virtual machines to control inbound and outbound traffic. In the body of the request, include the name of the firewall, the ID of the environment within which the firewall will be created, and an optional description. To obtain the ID of the environment, make a request to the [**list environments**](https://infrahub-doc.nexgencloud.com/docs/api-reference/core-resources/environments/list-environments) endpoint.
347
+ Removes a firewall rule from firewall by providing the firewall ID and firewall rule ID in the path. For more information, [**click here**](https://docs...cloud/docs/api-reference/core-resources/firewalls/remove-firewall-rule-from-firewall).
370
348
 
371
- :param payload: (required)
372
- :type payload: CreateFirewallPayload
349
+ :param firewall_id: (required)
350
+ :type firewall_id: int
351
+ :param firewall_rule_id: (required)
352
+ :type firewall_rule_id: int
373
353
  :param _request_timeout: timeout setting for this request. If one
374
354
  number provided, it will be total request
375
355
  timeout. It can also be a pair (tuple) of
@@ -392,8 +372,9 @@ class FirewallsApi:
392
372
  :return: Returns the result object.
393
373
  """ # noqa: E501
394
374
 
395
- _param = self._create_firewall_serialize(
396
- payload=payload,
375
+ _param = self._delete_security_group_rule_delete_serialize(
376
+ firewall_id=firewall_id,
377
+ firewall_rule_id=firewall_rule_id,
397
378
  _request_auth=_request_auth,
398
379
  _content_type=_content_type,
399
380
  _headers=_headers,
@@ -401,7 +382,7 @@ class FirewallsApi:
401
382
  )
402
383
 
403
384
  _response_types_map: Dict[str, Optional[str]] = {
404
- '200': "FirewallResponse",
385
+ '200': "ResponseModel",
405
386
  '400': "ErrorResponseModel",
406
387
  '401': "ErrorResponseModel",
407
388
  '403': "ErrorResponseModel",
@@ -421,9 +402,10 @@ class FirewallsApi:
421
402
 
422
403
 
423
404
  @validate_call
424
- def create_firewall_with_http_info(
405
+ def delete_security_group_rule_delete_with_http_info(
425
406
  self,
426
- payload: CreateFirewallPayload,
407
+ firewall_id: StrictInt,
408
+ firewall_rule_id: StrictInt,
427
409
  _request_timeout: Union[
428
410
  None,
429
411
  Annotated[StrictFloat, Field(gt=0)],
@@ -436,13 +418,15 @@ class FirewallsApi:
436
418
  _content_type: Optional[StrictStr] = None,
437
419
  _headers: Optional[Dict[StrictStr, Any]] = None,
438
420
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
439
- ) -> ApiResponse[FirewallResponse]:
440
- """Create firewall
421
+ ) -> ApiResponse[ResponseModel]:
422
+ """Delete firewall rules from firewall
441
423
 
442
- Creates a firewall to which firewall rules can be added. A firewall can be attached to one or more virtual machines to control inbound and outbound traffic. In the body of the request, include the name of the firewall, the ID of the environment within which the firewall will be created, and an optional description. To obtain the ID of the environment, make a request to the [**list environments**](https://infrahub-doc.nexgencloud.com/docs/api-reference/core-resources/environments/list-environments) endpoint.
424
+ Removes a firewall rule from firewall by providing the firewall ID and firewall rule ID in the path. For more information, [**click here**](https://docs...cloud/docs/api-reference/core-resources/firewalls/remove-firewall-rule-from-firewall).
443
425
 
444
- :param payload: (required)
445
- :type payload: CreateFirewallPayload
426
+ :param firewall_id: (required)
427
+ :type firewall_id: int
428
+ :param firewall_rule_id: (required)
429
+ :type firewall_rule_id: int
446
430
  :param _request_timeout: timeout setting for this request. If one
447
431
  number provided, it will be total request
448
432
  timeout. It can also be a pair (tuple) of
@@ -465,8 +449,9 @@ class FirewallsApi:
465
449
  :return: Returns the result object.
466
450
  """ # noqa: E501
467
451
 
468
- _param = self._create_firewall_serialize(
469
- payload=payload,
452
+ _param = self._delete_security_group_rule_delete_serialize(
453
+ firewall_id=firewall_id,
454
+ firewall_rule_id=firewall_rule_id,
470
455
  _request_auth=_request_auth,
471
456
  _content_type=_content_type,
472
457
  _headers=_headers,
@@ -474,7 +459,7 @@ class FirewallsApi:
474
459
  )
475
460
 
476
461
  _response_types_map: Dict[str, Optional[str]] = {
477
- '200': "FirewallResponse",
462
+ '200': "ResponseModel",
478
463
  '400': "ErrorResponseModel",
479
464
  '401': "ErrorResponseModel",
480
465
  '403': "ErrorResponseModel",
@@ -494,9 +479,10 @@ class FirewallsApi:
494
479
 
495
480
 
496
481
  @validate_call
497
- def create_firewall_without_preload_content(
482
+ def delete_security_group_rule_delete_without_preload_content(
498
483
  self,
499
- payload: CreateFirewallPayload,
484
+ firewall_id: StrictInt,
485
+ firewall_rule_id: StrictInt,
500
486
  _request_timeout: Union[
501
487
  None,
502
488
  Annotated[StrictFloat, Field(gt=0)],
@@ -510,12 +496,14 @@ class FirewallsApi:
510
496
  _headers: Optional[Dict[StrictStr, Any]] = None,
511
497
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
512
498
  ) -> RESTResponseType:
513
- """Create firewall
499
+ """Delete firewall rules from firewall
514
500
 
515
- Creates a firewall to which firewall rules can be added. A firewall can be attached to one or more virtual machines to control inbound and outbound traffic. In the body of the request, include the name of the firewall, the ID of the environment within which the firewall will be created, and an optional description. To obtain the ID of the environment, make a request to the [**list environments**](https://infrahub-doc.nexgencloud.com/docs/api-reference/core-resources/environments/list-environments) endpoint.
501
+ Removes a firewall rule from firewall by providing the firewall ID and firewall rule ID in the path. For more information, [**click here**](https://docs...cloud/docs/api-reference/core-resources/firewalls/remove-firewall-rule-from-firewall).
516
502
 
517
- :param payload: (required)
518
- :type payload: CreateFirewallPayload
503
+ :param firewall_id: (required)
504
+ :type firewall_id: int
505
+ :param firewall_rule_id: (required)
506
+ :type firewall_rule_id: int
519
507
  :param _request_timeout: timeout setting for this request. If one
520
508
  number provided, it will be total request
521
509
  timeout. It can also be a pair (tuple) of
@@ -538,8 +526,9 @@ class FirewallsApi:
538
526
  :return: Returns the result object.
539
527
  """ # noqa: E501
540
528
 
541
- _param = self._create_firewall_serialize(
542
- payload=payload,
529
+ _param = self._delete_security_group_rule_delete_serialize(
530
+ firewall_id=firewall_id,
531
+ firewall_rule_id=firewall_rule_id,
543
532
  _request_auth=_request_auth,
544
533
  _content_type=_content_type,
545
534
  _headers=_headers,
@@ -547,7 +536,7 @@ class FirewallsApi:
547
536
  )
548
537
 
549
538
  _response_types_map: Dict[str, Optional[str]] = {
550
- '200': "FirewallResponse",
539
+ '200': "ResponseModel",
551
540
  '400': "ErrorResponseModel",
552
541
  '401': "ErrorResponseModel",
553
542
  '403': "ErrorResponseModel",
@@ -562,9 +551,10 @@ class FirewallsApi:
562
551
  return response_data.response
563
552
 
564
553
 
565
- def _create_firewall_serialize(
554
+ def _delete_security_group_rule_delete_serialize(
566
555
  self,
567
- payload,
556
+ firewall_id,
557
+ firewall_rule_id,
568
558
  _request_auth,
569
559
  _content_type,
570
560
  _headers,
@@ -586,12 +576,14 @@ class FirewallsApi:
586
576
  _body_params: Optional[bytes] = None
587
577
 
588
578
  # process the path parameters
579
+ if firewall_id is not None:
580
+ _path_params['firewall_id'] = firewall_id
581
+ if firewall_rule_id is not None:
582
+ _path_params['firewall_rule_id'] = firewall_rule_id
589
583
  # process the query parameters
590
584
  # process the header parameters
591
585
  # process the form parameters
592
586
  # process the body parameter
593
- if payload is not None:
594
- _body_params = payload
595
587
 
596
588
 
597
589
  # set the HTTP header `Accept`
@@ -602,29 +594,15 @@ class FirewallsApi:
602
594
  ]
603
595
  )
604
596
 
605
- # set the HTTP header `Content-Type`
606
- if _content_type:
607
- _header_params['Content-Type'] = _content_type
608
- else:
609
- _default_content_type = (
610
- self.api_client.select_header_content_type(
611
- [
612
- 'application/json'
613
- ]
614
- )
615
- )
616
- if _default_content_type is not None:
617
- _header_params['Content-Type'] = _default_content_type
618
597
 
619
598
  # authentication setting
620
599
  _auth_settings: List[str] = [
621
- 'apiKey',
622
- 'accessToken'
600
+ 'apiKey'
623
601
  ]
624
602
 
625
603
  return self.api_client.param_serialize(
626
- method='POST',
627
- resource_path='/core/firewalls',
604
+ method='DELETE',
605
+ resource_path='/core/firewalls/{firewall_id}/firewall-rules/{firewall_rule_id}',
628
606
  path_params=_path_params,
629
607
  query_params=_query_params,
630
608
  header_params=_header_params,
@@ -641,9 +619,12 @@ class FirewallsApi:
641
619
 
642
620
 
643
621
  @validate_call
644
- def delete_firewall(
622
+ def get_security_group(
645
623
  self,
646
- id: StrictInt,
624
+ page: Optional[StrictInt] = None,
625
+ page_size: Optional[StrictInt] = None,
626
+ search: Optional[StrictStr] = None,
627
+ environment: Annotated[Optional[StrictStr], Field(description="Filter Environment ID or Name")] = None,
647
628
  _request_timeout: Union[
648
629
  None,
649
630
  Annotated[StrictFloat, Field(gt=0)],
@@ -656,13 +637,19 @@ class FirewallsApi:
656
637
  _content_type: Optional[StrictStr] = None,
657
638
  _headers: Optional[Dict[StrictStr, Any]] = None,
658
639
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
659
- ) -> ResponseModel:
660
- """Delete firewall
640
+ ) -> FirewallsListResponse:
641
+ """List firewalls
661
642
 
662
- Deletes a firewall by specifying the firewall ID in the path. If the firewall is currently attached to a virtual machine, it must be detached before deletion. For more information, [**click here**](https://infrahub-doc.nexgencloud.com/docs/api-reference/core-resources/firewalls/delete-firewall).
643
+ Retrieves a list of existing firewalls and their details, including the security rules they contain and information about the virtual machines to which they are attached. For more information about the firewalls features offered by Infrahub, [**click here**](https://docs...cloud/docs/network-security/security-groups).
663
644
 
664
- :param id: (required)
665
- :type id: int
645
+ :param page:
646
+ :type page: int
647
+ :param page_size:
648
+ :type page_size: int
649
+ :param search:
650
+ :type search: str
651
+ :param environment: Filter Environment ID or Name
652
+ :type environment: str
666
653
  :param _request_timeout: timeout setting for this request. If one
667
654
  number provided, it will be total request
668
655
  timeout. It can also be a pair (tuple) of
@@ -685,8 +672,11 @@ class FirewallsApi:
685
672
  :return: Returns the result object.
686
673
  """ # noqa: E501
687
674
 
688
- _param = self._delete_firewall_serialize(
689
- id=id,
675
+ _param = self._get_security_group_serialize(
676
+ page=page,
677
+ page_size=page_size,
678
+ search=search,
679
+ environment=environment,
690
680
  _request_auth=_request_auth,
691
681
  _content_type=_content_type,
692
682
  _headers=_headers,
@@ -694,12 +684,10 @@ class FirewallsApi:
694
684
  )
695
685
 
696
686
  _response_types_map: Dict[str, Optional[str]] = {
697
- '200': "ResponseModel",
687
+ '200': "FirewallsListResponse",
698
688
  '400': "ErrorResponseModel",
699
689
  '401': "ErrorResponseModel",
700
690
  '403': "ErrorResponseModel",
701
- '404': "ErrorResponseModel",
702
- '409': "ErrorResponseModel",
703
691
  '500': None,
704
692
  }
705
693
  response_data = self.api_client.call_api(
@@ -714,9 +702,12 @@ class FirewallsApi:
714
702
 
715
703
 
716
704
  @validate_call
717
- def delete_firewall_with_http_info(
705
+ def get_security_group_with_http_info(
718
706
  self,
719
- id: StrictInt,
707
+ page: Optional[StrictInt] = None,
708
+ page_size: Optional[StrictInt] = None,
709
+ search: Optional[StrictStr] = None,
710
+ environment: Annotated[Optional[StrictStr], Field(description="Filter Environment ID or Name")] = None,
720
711
  _request_timeout: Union[
721
712
  None,
722
713
  Annotated[StrictFloat, Field(gt=0)],
@@ -729,13 +720,19 @@ class FirewallsApi:
729
720
  _content_type: Optional[StrictStr] = None,
730
721
  _headers: Optional[Dict[StrictStr, Any]] = None,
731
722
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
732
- ) -> ApiResponse[ResponseModel]:
733
- """Delete firewall
723
+ ) -> ApiResponse[FirewallsListResponse]:
724
+ """List firewalls
734
725
 
735
- Deletes a firewall by specifying the firewall ID in the path. If the firewall is currently attached to a virtual machine, it must be detached before deletion. For more information, [**click here**](https://infrahub-doc.nexgencloud.com/docs/api-reference/core-resources/firewalls/delete-firewall).
726
+ Retrieves a list of existing firewalls and their details, including the security rules they contain and information about the virtual machines to which they are attached. For more information about the firewalls features offered by Infrahub, [**click here**](https://docs...cloud/docs/network-security/security-groups).
736
727
 
737
- :param id: (required)
738
- :type id: int
728
+ :param page:
729
+ :type page: int
730
+ :param page_size:
731
+ :type page_size: int
732
+ :param search:
733
+ :type search: str
734
+ :param environment: Filter Environment ID or Name
735
+ :type environment: str
739
736
  :param _request_timeout: timeout setting for this request. If one
740
737
  number provided, it will be total request
741
738
  timeout. It can also be a pair (tuple) of
@@ -758,8 +755,11 @@ class FirewallsApi:
758
755
  :return: Returns the result object.
759
756
  """ # noqa: E501
760
757
 
761
- _param = self._delete_firewall_serialize(
762
- id=id,
758
+ _param = self._get_security_group_serialize(
759
+ page=page,
760
+ page_size=page_size,
761
+ search=search,
762
+ environment=environment,
763
763
  _request_auth=_request_auth,
764
764
  _content_type=_content_type,
765
765
  _headers=_headers,
@@ -767,12 +767,10 @@ class FirewallsApi:
767
767
  )
768
768
 
769
769
  _response_types_map: Dict[str, Optional[str]] = {
770
- '200': "ResponseModel",
770
+ '200': "FirewallsListResponse",
771
771
  '400': "ErrorResponseModel",
772
772
  '401': "ErrorResponseModel",
773
773
  '403': "ErrorResponseModel",
774
- '404': "ErrorResponseModel",
775
- '409': "ErrorResponseModel",
776
774
  '500': None,
777
775
  }
778
776
  response_data = self.api_client.call_api(
@@ -787,9 +785,12 @@ class FirewallsApi:
787
785
 
788
786
 
789
787
  @validate_call
790
- def delete_firewall_without_preload_content(
788
+ def get_security_group_without_preload_content(
791
789
  self,
792
- id: StrictInt,
790
+ page: Optional[StrictInt] = None,
791
+ page_size: Optional[StrictInt] = None,
792
+ search: Optional[StrictStr] = None,
793
+ environment: Annotated[Optional[StrictStr], Field(description="Filter Environment ID or Name")] = None,
793
794
  _request_timeout: Union[
794
795
  None,
795
796
  Annotated[StrictFloat, Field(gt=0)],
@@ -803,12 +804,18 @@ class FirewallsApi:
803
804
  _headers: Optional[Dict[StrictStr, Any]] = None,
804
805
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
805
806
  ) -> RESTResponseType:
806
- """Delete firewall
807
+ """List firewalls
807
808
 
808
- Deletes a firewall by specifying the firewall ID in the path. If the firewall is currently attached to a virtual machine, it must be detached before deletion. For more information, [**click here**](https://infrahub-doc.nexgencloud.com/docs/api-reference/core-resources/firewalls/delete-firewall).
809
+ Retrieves a list of existing firewalls and their details, including the security rules they contain and information about the virtual machines to which they are attached. For more information about the firewalls features offered by Infrahub, [**click here**](https://docs...cloud/docs/network-security/security-groups).
809
810
 
810
- :param id: (required)
811
- :type id: int
811
+ :param page:
812
+ :type page: int
813
+ :param page_size:
814
+ :type page_size: int
815
+ :param search:
816
+ :type search: str
817
+ :param environment: Filter Environment ID or Name
818
+ :type environment: str
812
819
  :param _request_timeout: timeout setting for this request. If one
813
820
  number provided, it will be total request
814
821
  timeout. It can also be a pair (tuple) of
@@ -831,8 +838,11 @@ class FirewallsApi:
831
838
  :return: Returns the result object.
832
839
  """ # noqa: E501
833
840
 
834
- _param = self._delete_firewall_serialize(
835
- id=id,
841
+ _param = self._get_security_group_serialize(
842
+ page=page,
843
+ page_size=page_size,
844
+ search=search,
845
+ environment=environment,
836
846
  _request_auth=_request_auth,
837
847
  _content_type=_content_type,
838
848
  _headers=_headers,
@@ -840,12 +850,10 @@ class FirewallsApi:
840
850
  )
841
851
 
842
852
  _response_types_map: Dict[str, Optional[str]] = {
843
- '200': "ResponseModel",
853
+ '200': "FirewallsListResponse",
844
854
  '400': "ErrorResponseModel",
845
855
  '401': "ErrorResponseModel",
846
856
  '403': "ErrorResponseModel",
847
- '404': "ErrorResponseModel",
848
- '409': "ErrorResponseModel",
849
857
  '500': None,
850
858
  }
851
859
  response_data = self.api_client.call_api(
@@ -855,9 +863,12 @@ class FirewallsApi:
855
863
  return response_data.response
856
864
 
857
865
 
858
- def _delete_firewall_serialize(
866
+ def _get_security_group_serialize(
859
867
  self,
860
- id,
868
+ page,
869
+ page_size,
870
+ search,
871
+ environment,
861
872
  _request_auth,
862
873
  _content_type,
863
874
  _headers,
@@ -879,14 +890,28 @@ class FirewallsApi:
879
890
  _body_params: Optional[bytes] = None
880
891
 
881
892
  # process the path parameters
882
- if id is not None:
883
- _path_params['id'] = id
884
893
  # process the query parameters
885
- # process the header parameters
886
- # process the form parameters
887
- # process the body parameter
888
-
889
-
894
+ if page is not None:
895
+
896
+ _query_params.append(('page', page))
897
+
898
+ if page_size is not None:
899
+
900
+ _query_params.append(('pageSize', page_size))
901
+
902
+ if search is not None:
903
+
904
+ _query_params.append(('search', search))
905
+
906
+ if environment is not None:
907
+
908
+ _query_params.append(('environment', environment))
909
+
910
+ # process the header parameters
911
+ # process the form parameters
912
+ # process the body parameter
913
+
914
+
890
915
  # set the HTTP header `Accept`
891
916
  if 'Accept' not in _header_params:
892
917
  _header_params['Accept'] = self.api_client.select_header_accept(
@@ -898,13 +923,12 @@ class FirewallsApi:
898
923
 
899
924
  # authentication setting
900
925
  _auth_settings: List[str] = [
901
- 'apiKey',
902
- 'accessToken'
926
+ 'apiKey'
903
927
  ]
904
928
 
905
929
  return self.api_client.param_serialize(
906
- method='DELETE',
907
- resource_path='/core/firewalls/{id}',
930
+ method='GET',
931
+ resource_path='/core/firewalls',
908
932
  path_params=_path_params,
909
933
  query_params=_query_params,
910
934
  header_params=_header_params,
@@ -921,10 +945,9 @@ class FirewallsApi:
921
945
 
922
946
 
923
947
  @validate_call
924
- def delete_firewall_rules_from_firewall(
948
+ def get_security_group_details(
925
949
  self,
926
- firewall_id: StrictInt,
927
- firewall_rule_id: StrictInt,
950
+ id: StrictInt,
928
951
  _request_timeout: Union[
929
952
  None,
930
953
  Annotated[StrictFloat, Field(gt=0)],
@@ -937,15 +960,13 @@ class FirewallsApi:
937
960
  _content_type: Optional[StrictStr] = None,
938
961
  _headers: Optional[Dict[StrictStr, Any]] = None,
939
962
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
940
- ) -> ResponseModel:
941
- """Delete firewall rules from firewall
963
+ ) -> FirewallDetailResponse:
964
+ """Retrieve firewall details
942
965
 
943
- Removes a firewall rule from firewall by providing the firewall ID and firewall rule ID in the path. For more information, [**click here**](https://infrahub-doc.nexgencloud.com/docs/api-reference/core-resources/firewalls/remove-firewall-rule-from-firewall).
966
+ Retrieves the details of an existing firewall, including the security rules it contains and information about the virtual machines to which it is attached.
944
967
 
945
- :param firewall_id: (required)
946
- :type firewall_id: int
947
- :param firewall_rule_id: (required)
948
- :type firewall_rule_id: int
968
+ :param id: (required)
969
+ :type id: int
949
970
  :param _request_timeout: timeout setting for this request. If one
950
971
  number provided, it will be total request
951
972
  timeout. It can also be a pair (tuple) of
@@ -968,9 +989,8 @@ class FirewallsApi:
968
989
  :return: Returns the result object.
969
990
  """ # noqa: E501
970
991
 
971
- _param = self._delete_firewall_rules_from_firewall_serialize(
972
- firewall_id=firewall_id,
973
- firewall_rule_id=firewall_rule_id,
992
+ _param = self._get_security_group_details_serialize(
993
+ id=id,
974
994
  _request_auth=_request_auth,
975
995
  _content_type=_content_type,
976
996
  _headers=_headers,
@@ -978,12 +998,11 @@ class FirewallsApi:
978
998
  )
979
999
 
980
1000
  _response_types_map: Dict[str, Optional[str]] = {
981
- '200': "ResponseModel",
1001
+ '200': "FirewallDetailResponse",
982
1002
  '400': "ErrorResponseModel",
983
1003
  '401': "ErrorResponseModel",
984
1004
  '403': "ErrorResponseModel",
985
1005
  '404': "ErrorResponseModel",
986
- '409': "ErrorResponseModel",
987
1006
  '500': None,
988
1007
  }
989
1008
  response_data = self.api_client.call_api(
@@ -998,10 +1017,9 @@ class FirewallsApi:
998
1017
 
999
1018
 
1000
1019
  @validate_call
1001
- def delete_firewall_rules_from_firewall_with_http_info(
1020
+ def get_security_group_details_with_http_info(
1002
1021
  self,
1003
- firewall_id: StrictInt,
1004
- firewall_rule_id: StrictInt,
1022
+ id: StrictInt,
1005
1023
  _request_timeout: Union[
1006
1024
  None,
1007
1025
  Annotated[StrictFloat, Field(gt=0)],
@@ -1014,15 +1032,13 @@ class FirewallsApi:
1014
1032
  _content_type: Optional[StrictStr] = None,
1015
1033
  _headers: Optional[Dict[StrictStr, Any]] = None,
1016
1034
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1017
- ) -> ApiResponse[ResponseModel]:
1018
- """Delete firewall rules from firewall
1035
+ ) -> ApiResponse[FirewallDetailResponse]:
1036
+ """Retrieve firewall details
1019
1037
 
1020
- Removes a firewall rule from firewall by providing the firewall ID and firewall rule ID in the path. For more information, [**click here**](https://infrahub-doc.nexgencloud.com/docs/api-reference/core-resources/firewalls/remove-firewall-rule-from-firewall).
1038
+ Retrieves the details of an existing firewall, including the security rules it contains and information about the virtual machines to which it is attached.
1021
1039
 
1022
- :param firewall_id: (required)
1023
- :type firewall_id: int
1024
- :param firewall_rule_id: (required)
1025
- :type firewall_rule_id: int
1040
+ :param id: (required)
1041
+ :type id: int
1026
1042
  :param _request_timeout: timeout setting for this request. If one
1027
1043
  number provided, it will be total request
1028
1044
  timeout. It can also be a pair (tuple) of
@@ -1045,9 +1061,8 @@ class FirewallsApi:
1045
1061
  :return: Returns the result object.
1046
1062
  """ # noqa: E501
1047
1063
 
1048
- _param = self._delete_firewall_rules_from_firewall_serialize(
1049
- firewall_id=firewall_id,
1050
- firewall_rule_id=firewall_rule_id,
1064
+ _param = self._get_security_group_details_serialize(
1065
+ id=id,
1051
1066
  _request_auth=_request_auth,
1052
1067
  _content_type=_content_type,
1053
1068
  _headers=_headers,
@@ -1055,12 +1070,11 @@ class FirewallsApi:
1055
1070
  )
1056
1071
 
1057
1072
  _response_types_map: Dict[str, Optional[str]] = {
1058
- '200': "ResponseModel",
1073
+ '200': "FirewallDetailResponse",
1059
1074
  '400': "ErrorResponseModel",
1060
1075
  '401': "ErrorResponseModel",
1061
1076
  '403': "ErrorResponseModel",
1062
1077
  '404': "ErrorResponseModel",
1063
- '409': "ErrorResponseModel",
1064
1078
  '500': None,
1065
1079
  }
1066
1080
  response_data = self.api_client.call_api(
@@ -1075,10 +1089,9 @@ class FirewallsApi:
1075
1089
 
1076
1090
 
1077
1091
  @validate_call
1078
- def delete_firewall_rules_from_firewall_without_preload_content(
1092
+ def get_security_group_details_without_preload_content(
1079
1093
  self,
1080
- firewall_id: StrictInt,
1081
- firewall_rule_id: StrictInt,
1094
+ id: StrictInt,
1082
1095
  _request_timeout: Union[
1083
1096
  None,
1084
1097
  Annotated[StrictFloat, Field(gt=0)],
@@ -1092,14 +1105,12 @@ class FirewallsApi:
1092
1105
  _headers: Optional[Dict[StrictStr, Any]] = None,
1093
1106
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1094
1107
  ) -> RESTResponseType:
1095
- """Delete firewall rules from firewall
1108
+ """Retrieve firewall details
1096
1109
 
1097
- Removes a firewall rule from firewall by providing the firewall ID and firewall rule ID in the path. For more information, [**click here**](https://infrahub-doc.nexgencloud.com/docs/api-reference/core-resources/firewalls/remove-firewall-rule-from-firewall).
1110
+ Retrieves the details of an existing firewall, including the security rules it contains and information about the virtual machines to which it is attached.
1098
1111
 
1099
- :param firewall_id: (required)
1100
- :type firewall_id: int
1101
- :param firewall_rule_id: (required)
1102
- :type firewall_rule_id: int
1112
+ :param id: (required)
1113
+ :type id: int
1103
1114
  :param _request_timeout: timeout setting for this request. If one
1104
1115
  number provided, it will be total request
1105
1116
  timeout. It can also be a pair (tuple) of
@@ -1122,9 +1133,8 @@ class FirewallsApi:
1122
1133
  :return: Returns the result object.
1123
1134
  """ # noqa: E501
1124
1135
 
1125
- _param = self._delete_firewall_rules_from_firewall_serialize(
1126
- firewall_id=firewall_id,
1127
- firewall_rule_id=firewall_rule_id,
1136
+ _param = self._get_security_group_details_serialize(
1137
+ id=id,
1128
1138
  _request_auth=_request_auth,
1129
1139
  _content_type=_content_type,
1130
1140
  _headers=_headers,
@@ -1132,12 +1142,11 @@ class FirewallsApi:
1132
1142
  )
1133
1143
 
1134
1144
  _response_types_map: Dict[str, Optional[str]] = {
1135
- '200': "ResponseModel",
1145
+ '200': "FirewallDetailResponse",
1136
1146
  '400': "ErrorResponseModel",
1137
1147
  '401': "ErrorResponseModel",
1138
1148
  '403': "ErrorResponseModel",
1139
1149
  '404': "ErrorResponseModel",
1140
- '409': "ErrorResponseModel",
1141
1150
  '500': None,
1142
1151
  }
1143
1152
  response_data = self.api_client.call_api(
@@ -1147,10 +1156,9 @@ class FirewallsApi:
1147
1156
  return response_data.response
1148
1157
 
1149
1158
 
1150
- def _delete_firewall_rules_from_firewall_serialize(
1159
+ def _get_security_group_details_serialize(
1151
1160
  self,
1152
- firewall_id,
1153
- firewall_rule_id,
1161
+ id,
1154
1162
  _request_auth,
1155
1163
  _content_type,
1156
1164
  _headers,
@@ -1172,10 +1180,8 @@ class FirewallsApi:
1172
1180
  _body_params: Optional[bytes] = None
1173
1181
 
1174
1182
  # process the path parameters
1175
- if firewall_id is not None:
1176
- _path_params['firewall_id'] = firewall_id
1177
- if firewall_rule_id is not None:
1178
- _path_params['firewall_rule_id'] = firewall_rule_id
1183
+ if id is not None:
1184
+ _path_params['id'] = id
1179
1185
  # process the query parameters
1180
1186
  # process the header parameters
1181
1187
  # process the form parameters
@@ -1193,13 +1199,12 @@ class FirewallsApi:
1193
1199
 
1194
1200
  # authentication setting
1195
1201
  _auth_settings: List[str] = [
1196
- 'apiKey',
1197
- 'accessToken'
1202
+ 'apiKey'
1198
1203
  ]
1199
1204
 
1200
1205
  return self.api_client.param_serialize(
1201
- method='DELETE',
1202
- resource_path='/core/firewalls/{firewall_id}/firewall-rules/{firewall_rule_id}',
1206
+ method='GET',
1207
+ resource_path='/core/firewalls/{id}',
1203
1208
  path_params=_path_params,
1204
1209
  query_params=_query_params,
1205
1210
  header_params=_header_params,
@@ -1216,12 +1221,9 @@ class FirewallsApi:
1216
1221
 
1217
1222
 
1218
1223
  @validate_call
1219
- def list_firewalls(
1224
+ def post_security_group(
1220
1225
  self,
1221
- page: Optional[StrictInt] = None,
1222
- page_size: Optional[StrictInt] = None,
1223
- search: Optional[StrictStr] = None,
1224
- environment: Annotated[Optional[StrictStr], Field(description="Filter Environment ID or Name")] = None,
1226
+ payload: CreateFirewallPayload,
1225
1227
  _request_timeout: Union[
1226
1228
  None,
1227
1229
  Annotated[StrictFloat, Field(gt=0)],
@@ -1234,19 +1236,13 @@ class FirewallsApi:
1234
1236
  _content_type: Optional[StrictStr] = None,
1235
1237
  _headers: Optional[Dict[StrictStr, Any]] = None,
1236
1238
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1237
- ) -> FirewallsListResponse:
1238
- """List firewalls
1239
+ ) -> FirewallResponse:
1240
+ """Create firewall
1239
1241
 
1240
- Retrieves a list of existing firewalls and their details, including the security rules they contain and information about the virtual machines to which they are attached. For more information about the firewalls features offered by Infrahub, [**click here**](https://infrahub-doc.nexgencloud.com/docs/network-security/security-groups).
1242
+ Creates a firewall to which firewall rules can be added. A firewall can be attached to one or more virtual machines to control inbound and outbound traffic. In the body of the request, include the name of the firewall, the ID of the environment within which the firewall will be created, and an optional description. To obtain the ID of the environment, make a request to the [**list environments**](https://docs...cloud/docs/api-reference/core-resources/environments/list-environments) endpoint.
1241
1243
 
1242
- :param page:
1243
- :type page: int
1244
- :param page_size:
1245
- :type page_size: int
1246
- :param search:
1247
- :type search: str
1248
- :param environment: Filter Environment ID or Name
1249
- :type environment: str
1244
+ :param payload: (required)
1245
+ :type payload: CreateFirewallPayload
1250
1246
  :param _request_timeout: timeout setting for this request. If one
1251
1247
  number provided, it will be total request
1252
1248
  timeout. It can also be a pair (tuple) of
@@ -1269,11 +1265,8 @@ class FirewallsApi:
1269
1265
  :return: Returns the result object.
1270
1266
  """ # noqa: E501
1271
1267
 
1272
- _param = self._list_firewalls_serialize(
1273
- page=page,
1274
- page_size=page_size,
1275
- search=search,
1276
- environment=environment,
1268
+ _param = self._post_security_group_serialize(
1269
+ payload=payload,
1277
1270
  _request_auth=_request_auth,
1278
1271
  _content_type=_content_type,
1279
1272
  _headers=_headers,
@@ -1281,10 +1274,12 @@ class FirewallsApi:
1281
1274
  )
1282
1275
 
1283
1276
  _response_types_map: Dict[str, Optional[str]] = {
1284
- '200': "FirewallsListResponse",
1277
+ '200': "FirewallResponse",
1285
1278
  '400': "ErrorResponseModel",
1286
1279
  '401': "ErrorResponseModel",
1287
1280
  '403': "ErrorResponseModel",
1281
+ '404': "ErrorResponseModel",
1282
+ '409': "ErrorResponseModel",
1288
1283
  '500': None,
1289
1284
  }
1290
1285
  response_data = self.api_client.call_api(
@@ -1299,12 +1294,9 @@ class FirewallsApi:
1299
1294
 
1300
1295
 
1301
1296
  @validate_call
1302
- def list_firewalls_with_http_info(
1297
+ def post_security_group_with_http_info(
1303
1298
  self,
1304
- page: Optional[StrictInt] = None,
1305
- page_size: Optional[StrictInt] = None,
1306
- search: Optional[StrictStr] = None,
1307
- environment: Annotated[Optional[StrictStr], Field(description="Filter Environment ID or Name")] = None,
1299
+ payload: CreateFirewallPayload,
1308
1300
  _request_timeout: Union[
1309
1301
  None,
1310
1302
  Annotated[StrictFloat, Field(gt=0)],
@@ -1317,19 +1309,13 @@ class FirewallsApi:
1317
1309
  _content_type: Optional[StrictStr] = None,
1318
1310
  _headers: Optional[Dict[StrictStr, Any]] = None,
1319
1311
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1320
- ) -> ApiResponse[FirewallsListResponse]:
1321
- """List firewalls
1312
+ ) -> ApiResponse[FirewallResponse]:
1313
+ """Create firewall
1322
1314
 
1323
- Retrieves a list of existing firewalls and their details, including the security rules they contain and information about the virtual machines to which they are attached. For more information about the firewalls features offered by Infrahub, [**click here**](https://infrahub-doc.nexgencloud.com/docs/network-security/security-groups).
1315
+ Creates a firewall to which firewall rules can be added. A firewall can be attached to one or more virtual machines to control inbound and outbound traffic. In the body of the request, include the name of the firewall, the ID of the environment within which the firewall will be created, and an optional description. To obtain the ID of the environment, make a request to the [**list environments**](https://docs...cloud/docs/api-reference/core-resources/environments/list-environments) endpoint.
1324
1316
 
1325
- :param page:
1326
- :type page: int
1327
- :param page_size:
1328
- :type page_size: int
1329
- :param search:
1330
- :type search: str
1331
- :param environment: Filter Environment ID or Name
1332
- :type environment: str
1317
+ :param payload: (required)
1318
+ :type payload: CreateFirewallPayload
1333
1319
  :param _request_timeout: timeout setting for this request. If one
1334
1320
  number provided, it will be total request
1335
1321
  timeout. It can also be a pair (tuple) of
@@ -1352,11 +1338,8 @@ class FirewallsApi:
1352
1338
  :return: Returns the result object.
1353
1339
  """ # noqa: E501
1354
1340
 
1355
- _param = self._list_firewalls_serialize(
1356
- page=page,
1357
- page_size=page_size,
1358
- search=search,
1359
- environment=environment,
1341
+ _param = self._post_security_group_serialize(
1342
+ payload=payload,
1360
1343
  _request_auth=_request_auth,
1361
1344
  _content_type=_content_type,
1362
1345
  _headers=_headers,
@@ -1364,10 +1347,12 @@ class FirewallsApi:
1364
1347
  )
1365
1348
 
1366
1349
  _response_types_map: Dict[str, Optional[str]] = {
1367
- '200': "FirewallsListResponse",
1350
+ '200': "FirewallResponse",
1368
1351
  '400': "ErrorResponseModel",
1369
1352
  '401': "ErrorResponseModel",
1370
1353
  '403': "ErrorResponseModel",
1354
+ '404': "ErrorResponseModel",
1355
+ '409': "ErrorResponseModel",
1371
1356
  '500': None,
1372
1357
  }
1373
1358
  response_data = self.api_client.call_api(
@@ -1382,12 +1367,9 @@ class FirewallsApi:
1382
1367
 
1383
1368
 
1384
1369
  @validate_call
1385
- def list_firewalls_without_preload_content(
1370
+ def post_security_group_without_preload_content(
1386
1371
  self,
1387
- page: Optional[StrictInt] = None,
1388
- page_size: Optional[StrictInt] = None,
1389
- search: Optional[StrictStr] = None,
1390
- environment: Annotated[Optional[StrictStr], Field(description="Filter Environment ID or Name")] = None,
1372
+ payload: CreateFirewallPayload,
1391
1373
  _request_timeout: Union[
1392
1374
  None,
1393
1375
  Annotated[StrictFloat, Field(gt=0)],
@@ -1401,18 +1383,12 @@ class FirewallsApi:
1401
1383
  _headers: Optional[Dict[StrictStr, Any]] = None,
1402
1384
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1403
1385
  ) -> RESTResponseType:
1404
- """List firewalls
1386
+ """Create firewall
1405
1387
 
1406
- Retrieves a list of existing firewalls and their details, including the security rules they contain and information about the virtual machines to which they are attached. For more information about the firewalls features offered by Infrahub, [**click here**](https://infrahub-doc.nexgencloud.com/docs/network-security/security-groups).
1388
+ Creates a firewall to which firewall rules can be added. A firewall can be attached to one or more virtual machines to control inbound and outbound traffic. In the body of the request, include the name of the firewall, the ID of the environment within which the firewall will be created, and an optional description. To obtain the ID of the environment, make a request to the [**list environments**](https://docs...cloud/docs/api-reference/core-resources/environments/list-environments) endpoint.
1407
1389
 
1408
- :param page:
1409
- :type page: int
1410
- :param page_size:
1411
- :type page_size: int
1412
- :param search:
1413
- :type search: str
1414
- :param environment: Filter Environment ID or Name
1415
- :type environment: str
1390
+ :param payload: (required)
1391
+ :type payload: CreateFirewallPayload
1416
1392
  :param _request_timeout: timeout setting for this request. If one
1417
1393
  number provided, it will be total request
1418
1394
  timeout. It can also be a pair (tuple) of
@@ -1435,11 +1411,8 @@ class FirewallsApi:
1435
1411
  :return: Returns the result object.
1436
1412
  """ # noqa: E501
1437
1413
 
1438
- _param = self._list_firewalls_serialize(
1439
- page=page,
1440
- page_size=page_size,
1441
- search=search,
1442
- environment=environment,
1414
+ _param = self._post_security_group_serialize(
1415
+ payload=payload,
1443
1416
  _request_auth=_request_auth,
1444
1417
  _content_type=_content_type,
1445
1418
  _headers=_headers,
@@ -1447,10 +1420,12 @@ class FirewallsApi:
1447
1420
  )
1448
1421
 
1449
1422
  _response_types_map: Dict[str, Optional[str]] = {
1450
- '200': "FirewallsListResponse",
1423
+ '200': "FirewallResponse",
1451
1424
  '400': "ErrorResponseModel",
1452
1425
  '401': "ErrorResponseModel",
1453
1426
  '403': "ErrorResponseModel",
1427
+ '404': "ErrorResponseModel",
1428
+ '409': "ErrorResponseModel",
1454
1429
  '500': None,
1455
1430
  }
1456
1431
  response_data = self.api_client.call_api(
@@ -1460,12 +1435,9 @@ class FirewallsApi:
1460
1435
  return response_data.response
1461
1436
 
1462
1437
 
1463
- def _list_firewalls_serialize(
1438
+ def _post_security_group_serialize(
1464
1439
  self,
1465
- page,
1466
- page_size,
1467
- search,
1468
- environment,
1440
+ payload,
1469
1441
  _request_auth,
1470
1442
  _content_type,
1471
1443
  _headers,
@@ -1488,25 +1460,11 @@ class FirewallsApi:
1488
1460
 
1489
1461
  # process the path parameters
1490
1462
  # process the query parameters
1491
- if page is not None:
1492
-
1493
- _query_params.append(('page', page))
1494
-
1495
- if page_size is not None:
1496
-
1497
- _query_params.append(('pageSize', page_size))
1498
-
1499
- if search is not None:
1500
-
1501
- _query_params.append(('search', search))
1502
-
1503
- if environment is not None:
1504
-
1505
- _query_params.append(('environment', environment))
1506
-
1507
1463
  # process the header parameters
1508
1464
  # process the form parameters
1509
1465
  # process the body parameter
1466
+ if payload is not None:
1467
+ _body_params = payload
1510
1468
 
1511
1469
 
1512
1470
  # set the HTTP header `Accept`
@@ -1517,15 +1475,27 @@ class FirewallsApi:
1517
1475
  ]
1518
1476
  )
1519
1477
 
1478
+ # set the HTTP header `Content-Type`
1479
+ if _content_type:
1480
+ _header_params['Content-Type'] = _content_type
1481
+ else:
1482
+ _default_content_type = (
1483
+ self.api_client.select_header_content_type(
1484
+ [
1485
+ 'application/json'
1486
+ ]
1487
+ )
1488
+ )
1489
+ if _default_content_type is not None:
1490
+ _header_params['Content-Type'] = _default_content_type
1520
1491
 
1521
1492
  # authentication setting
1522
1493
  _auth_settings: List[str] = [
1523
- 'apiKey',
1524
- 'accessToken'
1494
+ 'apiKey'
1525
1495
  ]
1526
1496
 
1527
1497
  return self.api_client.param_serialize(
1528
- method='GET',
1498
+ method='POST',
1529
1499
  resource_path='/core/firewalls',
1530
1500
  path_params=_path_params,
1531
1501
  query_params=_query_params,
@@ -1543,9 +1513,10 @@ class FirewallsApi:
1543
1513
 
1544
1514
 
1545
1515
  @validate_call
1546
- def retrieve_firewall_details(
1516
+ def post_security_group_rules(
1547
1517
  self,
1548
- id: StrictInt,
1518
+ firewall_id: StrictInt,
1519
+ payload: CreateFirewallRulePayload,
1549
1520
  _request_timeout: Union[
1550
1521
  None,
1551
1522
  Annotated[StrictFloat, Field(gt=0)],
@@ -1558,13 +1529,15 @@ class FirewallsApi:
1558
1529
  _content_type: Optional[StrictStr] = None,
1559
1530
  _headers: Optional[Dict[StrictStr, Any]] = None,
1560
1531
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1561
- ) -> FirewallDetailResponse:
1562
- """Retrieve firewall details
1532
+ ) -> FirewallRule:
1533
+ """Add firewall rule to firewall
1563
1534
 
1564
- Retrieves the details of an existing firewall, including the security rules it contains and information about the virtual machines to which it is attached.
1535
+ Creates a [**firewall rule**](https://docs...cloud/docs/network-security/security-rules) and adds it to an existing firewall. Include the firewall ID in the path, and provide the firewall rule configuration in the request body.
1565
1536
 
1566
- :param id: (required)
1567
- :type id: int
1537
+ :param firewall_id: (required)
1538
+ :type firewall_id: int
1539
+ :param payload: (required)
1540
+ :type payload: CreateFirewallRulePayload
1568
1541
  :param _request_timeout: timeout setting for this request. If one
1569
1542
  number provided, it will be total request
1570
1543
  timeout. It can also be a pair (tuple) of
@@ -1587,8 +1560,9 @@ class FirewallsApi:
1587
1560
  :return: Returns the result object.
1588
1561
  """ # noqa: E501
1589
1562
 
1590
- _param = self._retrieve_firewall_details_serialize(
1591
- id=id,
1563
+ _param = self._post_security_group_rules_serialize(
1564
+ firewall_id=firewall_id,
1565
+ payload=payload,
1592
1566
  _request_auth=_request_auth,
1593
1567
  _content_type=_content_type,
1594
1568
  _headers=_headers,
@@ -1596,11 +1570,10 @@ class FirewallsApi:
1596
1570
  )
1597
1571
 
1598
1572
  _response_types_map: Dict[str, Optional[str]] = {
1599
- '200': "FirewallDetailResponse",
1573
+ '200': "FirewallRule",
1600
1574
  '400': "ErrorResponseModel",
1601
1575
  '401': "ErrorResponseModel",
1602
1576
  '403': "ErrorResponseModel",
1603
- '404': "ErrorResponseModel",
1604
1577
  '500': None,
1605
1578
  }
1606
1579
  response_data = self.api_client.call_api(
@@ -1615,9 +1588,10 @@ class FirewallsApi:
1615
1588
 
1616
1589
 
1617
1590
  @validate_call
1618
- def retrieve_firewall_details_with_http_info(
1591
+ def post_security_group_rules_with_http_info(
1619
1592
  self,
1620
- id: StrictInt,
1593
+ firewall_id: StrictInt,
1594
+ payload: CreateFirewallRulePayload,
1621
1595
  _request_timeout: Union[
1622
1596
  None,
1623
1597
  Annotated[StrictFloat, Field(gt=0)],
@@ -1630,13 +1604,15 @@ class FirewallsApi:
1630
1604
  _content_type: Optional[StrictStr] = None,
1631
1605
  _headers: Optional[Dict[StrictStr, Any]] = None,
1632
1606
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1633
- ) -> ApiResponse[FirewallDetailResponse]:
1634
- """Retrieve firewall details
1607
+ ) -> ApiResponse[FirewallRule]:
1608
+ """Add firewall rule to firewall
1635
1609
 
1636
- Retrieves the details of an existing firewall, including the security rules it contains and information about the virtual machines to which it is attached.
1610
+ Creates a [**firewall rule**](https://docs...cloud/docs/network-security/security-rules) and adds it to an existing firewall. Include the firewall ID in the path, and provide the firewall rule configuration in the request body.
1637
1611
 
1638
- :param id: (required)
1639
- :type id: int
1612
+ :param firewall_id: (required)
1613
+ :type firewall_id: int
1614
+ :param payload: (required)
1615
+ :type payload: CreateFirewallRulePayload
1640
1616
  :param _request_timeout: timeout setting for this request. If one
1641
1617
  number provided, it will be total request
1642
1618
  timeout. It can also be a pair (tuple) of
@@ -1659,8 +1635,9 @@ class FirewallsApi:
1659
1635
  :return: Returns the result object.
1660
1636
  """ # noqa: E501
1661
1637
 
1662
- _param = self._retrieve_firewall_details_serialize(
1663
- id=id,
1638
+ _param = self._post_security_group_rules_serialize(
1639
+ firewall_id=firewall_id,
1640
+ payload=payload,
1664
1641
  _request_auth=_request_auth,
1665
1642
  _content_type=_content_type,
1666
1643
  _headers=_headers,
@@ -1668,11 +1645,10 @@ class FirewallsApi:
1668
1645
  )
1669
1646
 
1670
1647
  _response_types_map: Dict[str, Optional[str]] = {
1671
- '200': "FirewallDetailResponse",
1648
+ '200': "FirewallRule",
1672
1649
  '400': "ErrorResponseModel",
1673
1650
  '401': "ErrorResponseModel",
1674
1651
  '403': "ErrorResponseModel",
1675
- '404': "ErrorResponseModel",
1676
1652
  '500': None,
1677
1653
  }
1678
1654
  response_data = self.api_client.call_api(
@@ -1687,9 +1663,10 @@ class FirewallsApi:
1687
1663
 
1688
1664
 
1689
1665
  @validate_call
1690
- def retrieve_firewall_details_without_preload_content(
1666
+ def post_security_group_rules_without_preload_content(
1691
1667
  self,
1692
- id: StrictInt,
1668
+ firewall_id: StrictInt,
1669
+ payload: CreateFirewallRulePayload,
1693
1670
  _request_timeout: Union[
1694
1671
  None,
1695
1672
  Annotated[StrictFloat, Field(gt=0)],
@@ -1703,12 +1680,14 @@ class FirewallsApi:
1703
1680
  _headers: Optional[Dict[StrictStr, Any]] = None,
1704
1681
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1705
1682
  ) -> RESTResponseType:
1706
- """Retrieve firewall details
1683
+ """Add firewall rule to firewall
1707
1684
 
1708
- Retrieves the details of an existing firewall, including the security rules it contains and information about the virtual machines to which it is attached.
1685
+ Creates a [**firewall rule**](https://docs...cloud/docs/network-security/security-rules) and adds it to an existing firewall. Include the firewall ID in the path, and provide the firewall rule configuration in the request body.
1709
1686
 
1710
- :param id: (required)
1711
- :type id: int
1687
+ :param firewall_id: (required)
1688
+ :type firewall_id: int
1689
+ :param payload: (required)
1690
+ :type payload: CreateFirewallRulePayload
1712
1691
  :param _request_timeout: timeout setting for this request. If one
1713
1692
  number provided, it will be total request
1714
1693
  timeout. It can also be a pair (tuple) of
@@ -1731,8 +1710,9 @@ class FirewallsApi:
1731
1710
  :return: Returns the result object.
1732
1711
  """ # noqa: E501
1733
1712
 
1734
- _param = self._retrieve_firewall_details_serialize(
1735
- id=id,
1713
+ _param = self._post_security_group_rules_serialize(
1714
+ firewall_id=firewall_id,
1715
+ payload=payload,
1736
1716
  _request_auth=_request_auth,
1737
1717
  _content_type=_content_type,
1738
1718
  _headers=_headers,
@@ -1740,11 +1720,10 @@ class FirewallsApi:
1740
1720
  )
1741
1721
 
1742
1722
  _response_types_map: Dict[str, Optional[str]] = {
1743
- '200': "FirewallDetailResponse",
1723
+ '200': "FirewallRule",
1744
1724
  '400': "ErrorResponseModel",
1745
1725
  '401': "ErrorResponseModel",
1746
1726
  '403': "ErrorResponseModel",
1747
- '404': "ErrorResponseModel",
1748
1727
  '500': None,
1749
1728
  }
1750
1729
  response_data = self.api_client.call_api(
@@ -1754,9 +1733,10 @@ class FirewallsApi:
1754
1733
  return response_data.response
1755
1734
 
1756
1735
 
1757
- def _retrieve_firewall_details_serialize(
1736
+ def _post_security_group_rules_serialize(
1758
1737
  self,
1759
- id,
1738
+ firewall_id,
1739
+ payload,
1760
1740
  _request_auth,
1761
1741
  _content_type,
1762
1742
  _headers,
@@ -1778,12 +1758,14 @@ class FirewallsApi:
1778
1758
  _body_params: Optional[bytes] = None
1779
1759
 
1780
1760
  # process the path parameters
1781
- if id is not None:
1782
- _path_params['id'] = id
1761
+ if firewall_id is not None:
1762
+ _path_params['firewall_id'] = firewall_id
1783
1763
  # process the query parameters
1784
1764
  # process the header parameters
1785
1765
  # process the form parameters
1786
1766
  # process the body parameter
1767
+ if payload is not None:
1768
+ _body_params = payload
1787
1769
 
1788
1770
 
1789
1771
  # set the HTTP header `Accept`
@@ -1794,16 +1776,28 @@ class FirewallsApi:
1794
1776
  ]
1795
1777
  )
1796
1778
 
1779
+ # set the HTTP header `Content-Type`
1780
+ if _content_type:
1781
+ _header_params['Content-Type'] = _content_type
1782
+ else:
1783
+ _default_content_type = (
1784
+ self.api_client.select_header_content_type(
1785
+ [
1786
+ 'application/json'
1787
+ ]
1788
+ )
1789
+ )
1790
+ if _default_content_type is not None:
1791
+ _header_params['Content-Type'] = _default_content_type
1797
1792
 
1798
1793
  # authentication setting
1799
1794
  _auth_settings: List[str] = [
1800
- 'apiKey',
1801
- 'accessToken'
1795
+ 'apiKey'
1802
1796
  ]
1803
1797
 
1804
1798
  return self.api_client.param_serialize(
1805
- method='GET',
1806
- resource_path='/core/firewalls/{id}',
1799
+ method='POST',
1800
+ resource_path='/core/firewalls/{firewall_id}/firewall-rules',
1807
1801
  path_params=_path_params,
1808
1802
  query_params=_query_params,
1809
1803
  header_params=_header_params,