Class: NutanixVmm::VmAntiAffinityPoliciesApi
- Inherits:
-
Object
- Object
- NutanixVmm::VmAntiAffinityPoliciesApi
- Defined in:
- lib/nutanix_vmm/api/vm_anti_affinity_policies_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#create_vm_anti_affinity_policy(ntnx_request_id, vmm_v40_ahv_policies_vm_anti_affinity_policy, opts = {}) ⇒ CreateVmAntiAffinityPolicy202Response
Create VM-VM anti-affinity policy Creates a VM-VM anti-affinity policy.
-
#create_vm_anti_affinity_policy_with_http_info(ntnx_request_id, vmm_v40_ahv_policies_vm_anti_affinity_policy, opts = {}) ⇒ Array<(CreateVmAntiAffinityPolicy202Response, Integer, Hash)>
Create VM-VM anti-affinity policy Creates a VM-VM anti-affinity policy.
-
#delete_legacy_vm_anti_affinity_policy_by_id(ext_id, ntnx_request_id, opts = {}) ⇒ DeleteLegacyVmAntiAffinityPolicyById202Response
Delete legacy VM-VM anti-affinity policy Deletes the legacy VM-VM anti-affinity policy.
-
#delete_legacy_vm_anti_affinity_policy_by_id_with_http_info(ext_id, ntnx_request_id, opts = {}) ⇒ Array<(DeleteLegacyVmAntiAffinityPolicyById202Response, Integer, Hash)>
Delete legacy VM-VM anti-affinity policy Deletes the legacy VM-VM anti-affinity policy.
-
#delete_vm_anti_affinity_policy_by_id(ext_id, if_match, ntnx_request_id, opts = {}) ⇒ DeleteVmAntiAffinityPolicyById202Response
Delete VM-VM anti-affinity policy Deletes the requested VM-VM anti-affinity policy.
-
#delete_vm_anti_affinity_policy_by_id_with_http_info(ext_id, if_match, ntnx_request_id, opts = {}) ⇒ Array<(DeleteVmAntiAffinityPolicyById202Response, Integer, Hash)>
Delete VM-VM anti-affinity policy Deletes the requested VM-VM anti-affinity policy.
-
#get_vm_anti_affinity_policy_by_id(ext_id, opts = {}) ⇒ GetVmAntiAffinityPolicyById200Response
Get VM-VM anti-affinity policy based on the provided external identifier Fetches the VM-VM anti-affinity policy of the provided VM-VM anti-affinity policy external identifier.
-
#get_vm_anti_affinity_policy_by_id_with_http_info(ext_id, opts = {}) ⇒ Array<(GetVmAntiAffinityPolicyById200Response, Integer, Hash)>
Get VM-VM anti-affinity policy based on the provided external identifier Fetches the VM-VM anti-affinity policy of the provided VM-VM anti-affinity policy external identifier.
-
#initialize(api_client = ApiClient.default) ⇒ VmAntiAffinityPoliciesApi
constructor
A new instance of VmAntiAffinityPoliciesApi.
-
#list_legacy_vm_anti_affinity_policies(opts = {}) ⇒ ListLegacyVmAntiAffinityPolicies200Response
List legacy VM-VM anti-affinity policies List legacy VM-VM anti-affinity policies.
-
#list_legacy_vm_anti_affinity_policies_with_http_info(opts = {}) ⇒ Array<(ListLegacyVmAntiAffinityPolicies200Response, Integer, Hash)>
List legacy VM-VM anti-affinity policies List legacy VM-VM anti-affinity policies.
-
#list_vm_anti_affinity_policies(opts = {}) ⇒ ListVmAntiAffinityPolicies200Response
List VM-VM anti-affinity policies List VM-VM anti-affinity policies.
-
#list_vm_anti_affinity_policies_with_http_info(opts = {}) ⇒ Array<(ListVmAntiAffinityPolicies200Response, Integer, Hash)>
List VM-VM anti-affinity policies List VM-VM anti-affinity policies.
-
#list_vm_anti_affinity_policy_vm_compliance_states(vm_anti_affinity_policy_ext_id, opts = {}) ⇒ ListVmAntiAffinityPolicyVmComplianceStates200Response
List compliance states of VMs in the VM-VM anti-affinity policy based on the provided external identifier Lists compliance states of VMs in the VM-VM anti-affinity policy of the provided VM-VM anti-affinity policy external identifier.
-
#list_vm_anti_affinity_policy_vm_compliance_states_with_http_info(vm_anti_affinity_policy_ext_id, opts = {}) ⇒ Array<(ListVmAntiAffinityPolicyVmComplianceStates200Response, Integer, Hash)>
List compliance states of VMs in the VM-VM anti-affinity policy based on the provided external identifier Lists compliance states of VMs in the VM-VM anti-affinity policy of the provided VM-VM anti-affinity policy external identifier.
-
#update_vm_anti_affinity_policy_by_id(ext_id, if_match, ntnx_request_id, vmm_v40_ahv_policies_vm_anti_affinity_policy, opts = {}) ⇒ UpdateVmAntiAffinityPolicyById202Response
Update VM-VM anti-affinity policy Updates the requested VM-VM anti-affinity policy.
-
#update_vm_anti_affinity_policy_by_id_with_http_info(ext_id, if_match, ntnx_request_id, vmm_v40_ahv_policies_vm_anti_affinity_policy, opts = {}) ⇒ Array<(UpdateVmAntiAffinityPolicyById202Response, Integer, Hash)>
Update VM-VM anti-affinity policy Updates the requested VM-VM anti-affinity policy.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ VmAntiAffinityPoliciesApi
Returns a new instance of VmAntiAffinityPoliciesApi.
19 20 21 |
# File 'lib/nutanix_vmm/api/vm_anti_affinity_policies_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/nutanix_vmm/api/vm_anti_affinity_policies_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#create_vm_anti_affinity_policy(ntnx_request_id, vmm_v40_ahv_policies_vm_anti_affinity_policy, opts = {}) ⇒ CreateVmAntiAffinityPolicy202Response
Create VM-VM anti-affinity policy Creates a VM-VM anti-affinity policy.
28 29 30 31 |
# File 'lib/nutanix_vmm/api/vm_anti_affinity_policies_api.rb', line 28 def create_vm_anti_affinity_policy(ntnx_request_id, vmm_v40_ahv_policies_vm_anti_affinity_policy, opts = {}) data, _status_code, _headers = create_vm_anti_affinity_policy_with_http_info(ntnx_request_id, vmm_v40_ahv_policies_vm_anti_affinity_policy, opts) data end |
#create_vm_anti_affinity_policy_with_http_info(ntnx_request_id, vmm_v40_ahv_policies_vm_anti_affinity_policy, opts = {}) ⇒ Array<(CreateVmAntiAffinityPolicy202Response, Integer, Hash)>
Create VM-VM anti-affinity policy Creates a VM-VM anti-affinity policy.
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
# File 'lib/nutanix_vmm/api/vm_anti_affinity_policies_api.rb', line 39 def create_vm_anti_affinity_policy_with_http_info(ntnx_request_id, vmm_v40_ahv_policies_vm_anti_affinity_policy, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: VmAntiAffinityPoliciesApi.create_vm_anti_affinity_policy ...' end # verify the required parameter 'ntnx_request_id' is set if @api_client.config.client_side_validation && ntnx_request_id.nil? fail ArgumentError, "Missing the required parameter 'ntnx_request_id' when calling VmAntiAffinityPoliciesApi.create_vm_anti_affinity_policy" end # verify the required parameter 'vmm_v40_ahv_policies_vm_anti_affinity_policy' is set if @api_client.config.client_side_validation && vmm_v40_ahv_policies_vm_anti_affinity_policy.nil? fail ArgumentError, "Missing the required parameter 'vmm_v40_ahv_policies_vm_anti_affinity_policy' when calling VmAntiAffinityPoliciesApi.create_vm_anti_affinity_policy" end # resource path local_var_path = '/vmm/v4.0/ahv/policies/vm-anti-affinity-policies' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end header_params[:'NTNX-Request-Id'] = ntnx_request_id # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(vmm_v40_ahv_policies_vm_anti_affinity_policy) # return_type return_type = opts[:debug_return_type] || 'CreateVmAntiAffinityPolicy202Response' # auth_names auth_names = opts[:debug_auth_names] || ['apiKeyAuthScheme', 'basicAuthScheme'] = opts.merge( :operation => :"VmAntiAffinityPoliciesApi.create_vm_anti_affinity_policy", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: VmAntiAffinityPoliciesApi#create_vm_anti_affinity_policy\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#delete_legacy_vm_anti_affinity_policy_by_id(ext_id, ntnx_request_id, opts = {}) ⇒ DeleteLegacyVmAntiAffinityPolicyById202Response
Delete legacy VM-VM anti-affinity policy Deletes the legacy VM-VM anti-affinity policy.
103 104 105 106 |
# File 'lib/nutanix_vmm/api/vm_anti_affinity_policies_api.rb', line 103 def delete_legacy_vm_anti_affinity_policy_by_id(ext_id, ntnx_request_id, opts = {}) data, _status_code, _headers = delete_legacy_vm_anti_affinity_policy_by_id_with_http_info(ext_id, ntnx_request_id, opts) data end |
#delete_legacy_vm_anti_affinity_policy_by_id_with_http_info(ext_id, ntnx_request_id, opts = {}) ⇒ Array<(DeleteLegacyVmAntiAffinityPolicyById202Response, Integer, Hash)>
Delete legacy VM-VM anti-affinity policy Deletes the legacy VM-VM anti-affinity policy.
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 |
# File 'lib/nutanix_vmm/api/vm_anti_affinity_policies_api.rb', line 114 def delete_legacy_vm_anti_affinity_policy_by_id_with_http_info(ext_id, ntnx_request_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: VmAntiAffinityPoliciesApi.delete_legacy_vm_anti_affinity_policy_by_id ...' end # verify the required parameter 'ext_id' is set if @api_client.config.client_side_validation && ext_id.nil? fail ArgumentError, "Missing the required parameter 'ext_id' when calling VmAntiAffinityPoliciesApi.delete_legacy_vm_anti_affinity_policy_by_id" end pattern = Regexp.new(/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/) if @api_client.config.client_side_validation && ext_id !~ pattern fail ArgumentError, "invalid value for 'ext_id' when calling VmAntiAffinityPoliciesApi.delete_legacy_vm_anti_affinity_policy_by_id, must conform to the pattern #{pattern}." end # verify the required parameter 'ntnx_request_id' is set if @api_client.config.client_side_validation && ntnx_request_id.nil? fail ArgumentError, "Missing the required parameter 'ntnx_request_id' when calling VmAntiAffinityPoliciesApi.delete_legacy_vm_anti_affinity_policy_by_id" end # resource path local_var_path = '/vmm/v4.0/ahv/policies/legacy-vm-anti-affinity-policies/{extId}'.sub('{' + 'extId' + '}', CGI.escape(ext_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] header_params[:'NTNX-Request-Id'] = ntnx_request_id # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'DeleteLegacyVmAntiAffinityPolicyById202Response' # auth_names auth_names = opts[:debug_auth_names] || ['apiKeyAuthScheme', 'basicAuthScheme'] = opts.merge( :operation => :"VmAntiAffinityPoliciesApi.delete_legacy_vm_anti_affinity_policy_by_id", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: VmAntiAffinityPoliciesApi#delete_legacy_vm_anti_affinity_policy_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#delete_vm_anti_affinity_policy_by_id(ext_id, if_match, ntnx_request_id, opts = {}) ⇒ DeleteVmAntiAffinityPolicyById202Response
Delete VM-VM anti-affinity policy Deletes the requested VM-VM anti-affinity policy.
179 180 181 182 |
# File 'lib/nutanix_vmm/api/vm_anti_affinity_policies_api.rb', line 179 def delete_vm_anti_affinity_policy_by_id(ext_id, if_match, ntnx_request_id, opts = {}) data, _status_code, _headers = delete_vm_anti_affinity_policy_by_id_with_http_info(ext_id, if_match, ntnx_request_id, opts) data end |
#delete_vm_anti_affinity_policy_by_id_with_http_info(ext_id, if_match, ntnx_request_id, opts = {}) ⇒ Array<(DeleteVmAntiAffinityPolicyById202Response, Integer, Hash)>
Delete VM-VM anti-affinity policy Deletes the requested VM-VM anti-affinity policy.
191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 |
# File 'lib/nutanix_vmm/api/vm_anti_affinity_policies_api.rb', line 191 def delete_vm_anti_affinity_policy_by_id_with_http_info(ext_id, if_match, ntnx_request_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: VmAntiAffinityPoliciesApi.delete_vm_anti_affinity_policy_by_id ...' end # verify the required parameter 'ext_id' is set if @api_client.config.client_side_validation && ext_id.nil? fail ArgumentError, "Missing the required parameter 'ext_id' when calling VmAntiAffinityPoliciesApi.delete_vm_anti_affinity_policy_by_id" end pattern = Regexp.new(/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/) if @api_client.config.client_side_validation && ext_id !~ pattern fail ArgumentError, "invalid value for 'ext_id' when calling VmAntiAffinityPoliciesApi.delete_vm_anti_affinity_policy_by_id, must conform to the pattern #{pattern}." end # verify the required parameter 'if_match' is set if @api_client.config.client_side_validation && if_match.nil? fail ArgumentError, "Missing the required parameter 'if_match' when calling VmAntiAffinityPoliciesApi.delete_vm_anti_affinity_policy_by_id" end # verify the required parameter 'ntnx_request_id' is set if @api_client.config.client_side_validation && ntnx_request_id.nil? fail ArgumentError, "Missing the required parameter 'ntnx_request_id' when calling VmAntiAffinityPoliciesApi.delete_vm_anti_affinity_policy_by_id" end # resource path local_var_path = '/vmm/v4.0/ahv/policies/vm-anti-affinity-policies/{extId}'.sub('{' + 'extId' + '}', CGI.escape(ext_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] header_params[:'If-Match'] = if_match header_params[:'NTNX-Request-Id'] = ntnx_request_id # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'DeleteVmAntiAffinityPolicyById202Response' # auth_names auth_names = opts[:debug_auth_names] || ['apiKeyAuthScheme', 'basicAuthScheme'] = opts.merge( :operation => :"VmAntiAffinityPoliciesApi.delete_vm_anti_affinity_policy_by_id", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: VmAntiAffinityPoliciesApi#delete_vm_anti_affinity_policy_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_vm_anti_affinity_policy_by_id(ext_id, opts = {}) ⇒ GetVmAntiAffinityPolicyById200Response
Get VM-VM anti-affinity policy based on the provided external identifier Fetches the VM-VM anti-affinity policy of the provided VM-VM anti-affinity policy external identifier.
259 260 261 262 |
# File 'lib/nutanix_vmm/api/vm_anti_affinity_policies_api.rb', line 259 def get_vm_anti_affinity_policy_by_id(ext_id, opts = {}) data, _status_code, _headers = get_vm_anti_affinity_policy_by_id_with_http_info(ext_id, opts) data end |
#get_vm_anti_affinity_policy_by_id_with_http_info(ext_id, opts = {}) ⇒ Array<(GetVmAntiAffinityPolicyById200Response, Integer, Hash)>
Get VM-VM anti-affinity policy based on the provided external identifier Fetches the VM-VM anti-affinity policy of the provided VM-VM anti-affinity policy external identifier.
269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 |
# File 'lib/nutanix_vmm/api/vm_anti_affinity_policies_api.rb', line 269 def get_vm_anti_affinity_policy_by_id_with_http_info(ext_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: VmAntiAffinityPoliciesApi.get_vm_anti_affinity_policy_by_id ...' end # verify the required parameter 'ext_id' is set if @api_client.config.client_side_validation && ext_id.nil? fail ArgumentError, "Missing the required parameter 'ext_id' when calling VmAntiAffinityPoliciesApi.get_vm_anti_affinity_policy_by_id" end pattern = Regexp.new(/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/) if @api_client.config.client_side_validation && ext_id !~ pattern fail ArgumentError, "invalid value for 'ext_id' when calling VmAntiAffinityPoliciesApi.get_vm_anti_affinity_policy_by_id, must conform to the pattern #{pattern}." end # resource path local_var_path = '/vmm/v4.0/ahv/policies/vm-anti-affinity-policies/{extId}'.sub('{' + 'extId' + '}', CGI.escape(ext_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'GetVmAntiAffinityPolicyById200Response' # auth_names auth_names = opts[:debug_auth_names] || ['apiKeyAuthScheme', 'basicAuthScheme'] = opts.merge( :operation => :"VmAntiAffinityPoliciesApi.get_vm_anti_affinity_policy_by_id", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: VmAntiAffinityPoliciesApi#get_vm_anti_affinity_policy_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_legacy_vm_anti_affinity_policies(opts = {}) ⇒ ListLegacyVmAntiAffinityPolicies200Response
List legacy VM-VM anti-affinity policies List legacy VM-VM anti-affinity policies.
329 330 331 332 |
# File 'lib/nutanix_vmm/api/vm_anti_affinity_policies_api.rb', line 329 def list_legacy_vm_anti_affinity_policies(opts = {}) data, _status_code, _headers = list_legacy_vm_anti_affinity_policies_with_http_info(opts) data end |
#list_legacy_vm_anti_affinity_policies_with_http_info(opts = {}) ⇒ Array<(ListLegacyVmAntiAffinityPolicies200Response, Integer, Hash)>
List legacy VM-VM anti-affinity policies List legacy VM-VM anti-affinity policies.
341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 |
# File 'lib/nutanix_vmm/api/vm_anti_affinity_policies_api.rb', line 341 def list_legacy_vm_anti_affinity_policies_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: VmAntiAffinityPoliciesApi.list_legacy_vm_anti_affinity_policies ...' end if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 0 fail ArgumentError, 'invalid value for "opts[:"page"]" when calling VmAntiAffinityPoliciesApi.list_legacy_vm_anti_affinity_policies, must be greater than or equal to 0.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling VmAntiAffinityPoliciesApi.list_legacy_vm_anti_affinity_policies, must be smaller than or equal to 100.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling VmAntiAffinityPoliciesApi.list_legacy_vm_anti_affinity_policies, must be greater than or equal to 1.' end # resource path local_var_path = '/vmm/v4.0/ahv/policies/legacy-vm-anti-affinity-policies' # query parameters query_params = opts[:query_params] || {} query_params[:'$page'] = opts[:'page'] if !opts[:'page'].nil? query_params[:'$limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'$filter'] = opts[:'filter'] if !opts[:'filter'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ListLegacyVmAntiAffinityPolicies200Response' # auth_names auth_names = opts[:debug_auth_names] || ['apiKeyAuthScheme', 'basicAuthScheme'] = opts.merge( :operation => :"VmAntiAffinityPoliciesApi.list_legacy_vm_anti_affinity_policies", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: VmAntiAffinityPoliciesApi#list_legacy_vm_anti_affinity_policies\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_vm_anti_affinity_policies(opts = {}) ⇒ ListVmAntiAffinityPolicies200Response
List VM-VM anti-affinity policies List VM-VM anti-affinity policies.
408 409 410 411 |
# File 'lib/nutanix_vmm/api/vm_anti_affinity_policies_api.rb', line 408 def list_vm_anti_affinity_policies(opts = {}) data, _status_code, _headers = list_vm_anti_affinity_policies_with_http_info(opts) data end |
#list_vm_anti_affinity_policies_with_http_info(opts = {}) ⇒ Array<(ListVmAntiAffinityPolicies200Response, Integer, Hash)>
List VM-VM anti-affinity policies List VM-VM anti-affinity policies.
421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 |
# File 'lib/nutanix_vmm/api/vm_anti_affinity_policies_api.rb', line 421 def list_vm_anti_affinity_policies_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: VmAntiAffinityPoliciesApi.list_vm_anti_affinity_policies ...' end if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 0 fail ArgumentError, 'invalid value for "opts[:"page"]" when calling VmAntiAffinityPoliciesApi.list_vm_anti_affinity_policies, must be greater than or equal to 0.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling VmAntiAffinityPoliciesApi.list_vm_anti_affinity_policies, must be smaller than or equal to 100.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling VmAntiAffinityPoliciesApi.list_vm_anti_affinity_policies, must be greater than or equal to 1.' end # resource path local_var_path = '/vmm/v4.0/ahv/policies/vm-anti-affinity-policies' # query parameters query_params = opts[:query_params] || {} query_params[:'$page'] = opts[:'page'] if !opts[:'page'].nil? query_params[:'$limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'$filter'] = opts[:'filter'] if !opts[:'filter'].nil? query_params[:'$orderby'] = opts[:'orderby'] if !opts[:'orderby'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ListVmAntiAffinityPolicies200Response' # auth_names auth_names = opts[:debug_auth_names] || ['apiKeyAuthScheme', 'basicAuthScheme'] = opts.merge( :operation => :"VmAntiAffinityPoliciesApi.list_vm_anti_affinity_policies", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: VmAntiAffinityPoliciesApi#list_vm_anti_affinity_policies\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_vm_anti_affinity_policy_vm_compliance_states(vm_anti_affinity_policy_ext_id, opts = {}) ⇒ ListVmAntiAffinityPolicyVmComplianceStates200Response
List compliance states of VMs in the VM-VM anti-affinity policy based on the provided external identifier Lists compliance states of VMs in the VM-VM anti-affinity policy of the provided VM-VM anti-affinity policy external identifier.
488 489 490 491 |
# File 'lib/nutanix_vmm/api/vm_anti_affinity_policies_api.rb', line 488 def list_vm_anti_affinity_policy_vm_compliance_states(vm_anti_affinity_policy_ext_id, opts = {}) data, _status_code, _headers = list_vm_anti_affinity_policy_vm_compliance_states_with_http_info(vm_anti_affinity_policy_ext_id, opts) data end |
#list_vm_anti_affinity_policy_vm_compliance_states_with_http_info(vm_anti_affinity_policy_ext_id, opts = {}) ⇒ Array<(ListVmAntiAffinityPolicyVmComplianceStates200Response, Integer, Hash)>
List compliance states of VMs in the VM-VM anti-affinity policy based on the provided external identifier Lists compliance states of VMs in the VM-VM anti-affinity policy of the provided VM-VM anti-affinity policy external identifier.
500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 |
# File 'lib/nutanix_vmm/api/vm_anti_affinity_policies_api.rb', line 500 def list_vm_anti_affinity_policy_vm_compliance_states_with_http_info(vm_anti_affinity_policy_ext_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: VmAntiAffinityPoliciesApi.list_vm_anti_affinity_policy_vm_compliance_states ...' end # verify the required parameter 'vm_anti_affinity_policy_ext_id' is set if @api_client.config.client_side_validation && vm_anti_affinity_policy_ext_id.nil? fail ArgumentError, "Missing the required parameter 'vm_anti_affinity_policy_ext_id' when calling VmAntiAffinityPoliciesApi.list_vm_anti_affinity_policy_vm_compliance_states" end pattern = Regexp.new(/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/) if @api_client.config.client_side_validation && vm_anti_affinity_policy_ext_id !~ pattern fail ArgumentError, "invalid value for 'vm_anti_affinity_policy_ext_id' when calling VmAntiAffinityPoliciesApi.list_vm_anti_affinity_policy_vm_compliance_states, must conform to the pattern #{pattern}." end if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 0 fail ArgumentError, 'invalid value for "opts[:"page"]" when calling VmAntiAffinityPoliciesApi.list_vm_anti_affinity_policy_vm_compliance_states, must be greater than or equal to 0.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling VmAntiAffinityPoliciesApi.list_vm_anti_affinity_policy_vm_compliance_states, must be smaller than or equal to 100.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling VmAntiAffinityPoliciesApi.list_vm_anti_affinity_policy_vm_compliance_states, must be greater than or equal to 1.' end # resource path local_var_path = '/vmm/v4.0/ahv/policies/vm-anti-affinity-policies/{vmAntiAffinityPolicyExtId}/vm-compliance-states'.sub('{' + 'vmAntiAffinityPolicyExtId' + '}', CGI.escape(vm_anti_affinity_policy_ext_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'$page'] = opts[:'page'] if !opts[:'page'].nil? query_params[:'$limit'] = opts[:'limit'] if !opts[:'limit'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ListVmAntiAffinityPolicyVmComplianceStates200Response' # auth_names auth_names = opts[:debug_auth_names] || ['apiKeyAuthScheme', 'basicAuthScheme'] = opts.merge( :operation => :"VmAntiAffinityPoliciesApi.list_vm_anti_affinity_policy_vm_compliance_states", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: VmAntiAffinityPoliciesApi#list_vm_anti_affinity_policy_vm_compliance_states\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#update_vm_anti_affinity_policy_by_id(ext_id, if_match, ntnx_request_id, vmm_v40_ahv_policies_vm_anti_affinity_policy, opts = {}) ⇒ UpdateVmAntiAffinityPolicyById202Response
Update VM-VM anti-affinity policy Updates the requested VM-VM anti-affinity policy.
575 576 577 578 |
# File 'lib/nutanix_vmm/api/vm_anti_affinity_policies_api.rb', line 575 def update_vm_anti_affinity_policy_by_id(ext_id, if_match, ntnx_request_id, vmm_v40_ahv_policies_vm_anti_affinity_policy, opts = {}) data, _status_code, _headers = update_vm_anti_affinity_policy_by_id_with_http_info(ext_id, if_match, ntnx_request_id, vmm_v40_ahv_policies_vm_anti_affinity_policy, opts) data end |
#update_vm_anti_affinity_policy_by_id_with_http_info(ext_id, if_match, ntnx_request_id, vmm_v40_ahv_policies_vm_anti_affinity_policy, opts = {}) ⇒ Array<(UpdateVmAntiAffinityPolicyById202Response, Integer, Hash)>
Update VM-VM anti-affinity policy Updates the requested VM-VM anti-affinity policy.
588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 |
# File 'lib/nutanix_vmm/api/vm_anti_affinity_policies_api.rb', line 588 def update_vm_anti_affinity_policy_by_id_with_http_info(ext_id, if_match, ntnx_request_id, vmm_v40_ahv_policies_vm_anti_affinity_policy, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: VmAntiAffinityPoliciesApi.update_vm_anti_affinity_policy_by_id ...' end # verify the required parameter 'ext_id' is set if @api_client.config.client_side_validation && ext_id.nil? fail ArgumentError, "Missing the required parameter 'ext_id' when calling VmAntiAffinityPoliciesApi.update_vm_anti_affinity_policy_by_id" end pattern = Regexp.new(/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/) if @api_client.config.client_side_validation && ext_id !~ pattern fail ArgumentError, "invalid value for 'ext_id' when calling VmAntiAffinityPoliciesApi.update_vm_anti_affinity_policy_by_id, must conform to the pattern #{pattern}." end # verify the required parameter 'if_match' is set if @api_client.config.client_side_validation && if_match.nil? fail ArgumentError, "Missing the required parameter 'if_match' when calling VmAntiAffinityPoliciesApi.update_vm_anti_affinity_policy_by_id" end # verify the required parameter 'ntnx_request_id' is set if @api_client.config.client_side_validation && ntnx_request_id.nil? fail ArgumentError, "Missing the required parameter 'ntnx_request_id' when calling VmAntiAffinityPoliciesApi.update_vm_anti_affinity_policy_by_id" end # verify the required parameter 'vmm_v40_ahv_policies_vm_anti_affinity_policy' is set if @api_client.config.client_side_validation && vmm_v40_ahv_policies_vm_anti_affinity_policy.nil? fail ArgumentError, "Missing the required parameter 'vmm_v40_ahv_policies_vm_anti_affinity_policy' when calling VmAntiAffinityPoliciesApi.update_vm_anti_affinity_policy_by_id" end # resource path local_var_path = '/vmm/v4.0/ahv/policies/vm-anti-affinity-policies/{extId}'.sub('{' + 'extId' + '}', CGI.escape(ext_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end header_params[:'If-Match'] = if_match header_params[:'NTNX-Request-Id'] = ntnx_request_id # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(vmm_v40_ahv_policies_vm_anti_affinity_policy) # return_type return_type = opts[:debug_return_type] || 'UpdateVmAntiAffinityPolicyById202Response' # auth_names auth_names = opts[:debug_auth_names] || ['apiKeyAuthScheme', 'basicAuthScheme'] = opts.merge( :operation => :"VmAntiAffinityPoliciesApi.update_vm_anti_affinity_policy_by_id", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PUT, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: VmAntiAffinityPoliciesApi#update_vm_anti_affinity_policy_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |