Class: VSphereAutomation::CIS::TasksApi
- Inherits:
-
Object
- Object
- VSphereAutomation::CIS::TasksApi
- Defined in:
- lib/vsphere-automation-cis/api/tasks_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#cancel(task, action, opts = {}) ⇒ |VapiStdErrorsUnsupportedError|VapiStdErrorsUnauthenticatedError|VapiStdErrorsUnauthorizedError|VapiStdErrorsNotFoundError|VapiStdErrorsServiceUnavailableError|nil
Cancel a running operation associated with the task.
-
#cancel_with_http_info(task, action, opts = {}) ⇒ Array<(|VapiStdErrorsUnsupportedError|VapiStdErrorsUnauthenticatedError|VapiStdErrorsUnauthorizedError|VapiStdErrorsNotFoundError|VapiStdErrorsServiceUnavailableError|nil, Fixnum, Hash)>
private
Cancel a running operation associated with the task.
-
#get(task, opts = {}) ⇒ CisTasksResult|VapiStdErrorsResourceInaccessibleError|VapiStdErrorsUnauthenticatedError|VapiStdErrorsUnauthorizedError|VapiStdErrorsNotFoundError|VapiStdErrorsServiceUnavailableError|
Returns information about a task.
-
#get_with_http_info(task, opts = {}) ⇒ Array<(CisTasksResult|VapiStdErrorsResourceInaccessibleError|VapiStdErrorsUnauthenticatedError|VapiStdErrorsUnauthorizedError|VapiStdErrorsNotFoundError|VapiStdErrorsServiceUnavailableError|, Fixnum, Hash)>
private
Returns information about a task.
-
#initialize(api_client = ApiClient.default) ⇒ TasksApi
constructor
A new instance of TasksApi.
-
#list(opts = {}) ⇒ CisTasksListResult|VapiStdErrorsResourceInaccessibleError|VapiStdErrorsUnauthenticatedError|VapiStdErrorsUnauthorizedError|VapiStdErrorsServiceUnavailableError|
Returns information about at most 1000 visible (subject to permission checks) tasks matching the Tasks.FilterSpec.
-
#list_with_http_info(opts = {}) ⇒ Array<(CisTasksListResult|VapiStdErrorsResourceInaccessibleError|VapiStdErrorsUnauthenticatedError|VapiStdErrorsUnauthorizedError|VapiStdErrorsServiceUnavailableError|, Fixnum, Hash)>
private
Returns information about at most 1000 visible (subject to permission checks) tasks matching the Tasks.FilterSpec.
Constructor Details
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
14 15 16 |
# File 'lib/vsphere-automation-cis/api/tasks_api.rb', line 14 def api_client @api_client end |
Instance Method Details
#cancel(task, action, opts = {}) ⇒ |VapiStdErrorsUnsupportedError|VapiStdErrorsUnauthenticatedError|VapiStdErrorsUnauthorizedError|VapiStdErrorsNotFoundError|VapiStdErrorsServiceUnavailableError|nil
Cancel a running operation associated with the task. This is the best effort attempt. Operation may not be cancelled anymore once it reaches certain stage.
24 25 26 27 |
# File 'lib/vsphere-automation-cis/api/tasks_api.rb', line 24 def cancel(task, action, opts = {}) cancel_with_http_info(task, action, opts) nil end |
#cancel_with_http_info(task, action, opts = {}) ⇒ Array<(|VapiStdErrorsUnsupportedError|VapiStdErrorsUnauthenticatedError|VapiStdErrorsUnauthorizedError|VapiStdErrorsNotFoundError|VapiStdErrorsServiceUnavailableError|nil, Fixnum, Hash)>
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Cancel a running operation associated with the task. This is the best effort attempt. Operation may not be cancelled anymore once it reaches certain stage.
35 36 37 38 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 |
# File 'lib/vsphere-automation-cis/api/tasks_api.rb', line 35 def cancel_with_http_info(task, action, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TasksApi.cancel ...' end # verify the required parameter 'task' is set if @api_client.config.client_side_validation && task.nil? fail ArgumentError, "Missing the required parameter 'task' when calling TasksApi.cancel" end # verify the required parameter 'action' is set if @api_client.config.client_side_validation && action.nil? fail ArgumentError, "Missing the required parameter 'action' when calling TasksApi.cancel" end # verify enum value if @api_client.config.client_side_validation && !['cancel'].include?(action) fail ArgumentError, "invalid value for 'action', must be one of cancel" end # resource path local_var_path = '/cis/tasks/{task}'.sub('{' + 'task' + '}', task.to_s) # query parameters query_params = {} query_params[:'action'] = action # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['api_key'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: TasksApi#cancel\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get(task, opts = {}) ⇒ CisTasksResult|VapiStdErrorsResourceInaccessibleError|VapiStdErrorsUnauthenticatedError|VapiStdErrorsUnauthorizedError|VapiStdErrorsNotFoundError|VapiStdErrorsServiceUnavailableError|
Returns information about a task.
86 87 88 89 |
# File 'lib/vsphere-automation-cis/api/tasks_api.rb', line 86 def get(task, opts = {}) data, _status_code, _headers = get_with_http_info(task, opts) data end |
#get_with_http_info(task, opts = {}) ⇒ Array<(CisTasksResult|VapiStdErrorsResourceInaccessibleError|VapiStdErrorsUnauthenticatedError|VapiStdErrorsUnauthorizedError|VapiStdErrorsNotFoundError|VapiStdErrorsServiceUnavailableError|, Fixnum, Hash)>
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns information about a task.
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 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 |
# File 'lib/vsphere-automation-cis/api/tasks_api.rb', line 98 def get_with_http_info(task, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TasksApi.get ...' end # verify the required parameter 'task' is set if @api_client.config.client_side_validation && task.nil? fail ArgumentError, "Missing the required parameter 'task' when calling TasksApi.get" end # resource path local_var_path = '/cis/tasks/{task}'.sub('{' + 'task' + '}', task.to_s) # query parameters query_params = {} query_params[:'spec.return_all'] = opts[:'spec_return_all'] if !opts[:'spec_return_all'].nil? query_params[:'spec.exclude_result'] = opts[:'spec_exclude_result'] if !opts[:'spec_exclude_result'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['api_key'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => { '200' => 'CIS::CisTasksResult', '400' => 'CIS::VapiStdErrorsResourceInaccessibleError', '401' => 'CIS::VapiStdErrorsUnauthenticatedError', '403' => 'CIS::VapiStdErrorsUnauthorizedError', '404' => 'CIS::VapiStdErrorsNotFoundError', '503' => 'CIS::VapiStdErrorsServiceUnavailableError', }) if @api_client.config.debugging @api_client.config.logger.debug "API called: TasksApi#get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list(opts = {}) ⇒ CisTasksListResult|VapiStdErrorsResourceInaccessibleError|VapiStdErrorsUnauthenticatedError|VapiStdErrorsUnauthorizedError|VapiStdErrorsServiceUnavailableError|
Returns information about at most 1000 visible (subject to permission checks) tasks matching the Tasks.FilterSpec. All tasks must be in the same provider.
154 155 156 157 |
# File 'lib/vsphere-automation-cis/api/tasks_api.rb', line 154 def list(opts = {}) data, _status_code, _headers = list_with_http_info(opts) data end |
#list_with_http_info(opts = {}) ⇒ Array<(CisTasksListResult|VapiStdErrorsResourceInaccessibleError|VapiStdErrorsUnauthenticatedError|VapiStdErrorsUnauthorizedError|VapiStdErrorsServiceUnavailableError|, Fixnum, Hash)>
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns information about at most 1000 visible (subject to permission checks) tasks matching the Tasks.FilterSpec. All tasks must be in the same provider.
170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 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 |
# File 'lib/vsphere-automation-cis/api/tasks_api.rb', line 170 def list_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TasksApi.list ...' end if @api_client.config.client_side_validation && opts[:'filter_spec_status'] && !opts[:'filter_spec_status'].all? { |item| ['PENDING', 'RUNNING', 'BLOCKED', 'SUCCEEDED', 'FAILED'].include?(item) } fail ArgumentError, 'invalid value for "filter_spec_status", must include one of PENDING, RUNNING, BLOCKED, SUCCEEDED, FAILED' end # resource path local_var_path = '/cis/tasks' # query parameters query_params = {} query_params[:'filter_spec.tasks'] = @api_client.build_collection_param(opts[:'filter_spec_tasks'], :multi) if !opts[:'filter_spec_tasks'].nil? query_params[:'result_spec.return_all'] = opts[:'result_spec_return_all'] if !opts[:'result_spec_return_all'].nil? query_params[:'result_spec.exclude_result'] = opts[:'result_spec_exclude_result'] if !opts[:'result_spec_exclude_result'].nil? query_params[:'filter_spec.services'] = @api_client.build_collection_param(opts[:'filter_spec_services'], :multi) if !opts[:'filter_spec_services'].nil? query_params[:'filter_spec.status'] = @api_client.build_collection_param(opts[:'filter_spec_status'], :multi) if !opts[:'filter_spec_status'].nil? query_params[:'filter_spec.targets'] = @api_client.build_collection_param(opts[:'filter_spec_targets'], :multi) if !opts[:'filter_spec_targets'].nil? query_params[:'filter_spec.users'] = @api_client.build_collection_param(opts[:'filter_spec_users'], :multi) if !opts[:'filter_spec_users'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['api_key'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => { '200' => 'CIS::CisTasksListResult', '400' => 'CIS::VapiStdErrorsResourceInaccessibleError', '401' => 'CIS::VapiStdErrorsUnauthenticatedError', '403' => 'CIS::VapiStdErrorsUnauthorizedError', '503' => 'CIS::VapiStdErrorsServiceUnavailableError', }) if @api_client.config.debugging @api_client.config.logger.debug "API called: TasksApi#list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |