Class: SwaggerClient::Robotv1Api
- Inherits:
-
Object
- Object
- SwaggerClient::Robotv1Api
- Defined in:
- lib/harbor_swagger_client/api/robotv1_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#create_robot_v1(project_id_or_name, robot, opts = {}) ⇒ RobotCreated
Create a robot account Create a robot account.
-
#create_robot_v1_with_http_info(project_id_or_name, robot, opts = {}) ⇒ Array<(RobotCreated, Fixnum, Hash)>
Create a robot account Create a robot account.
-
#delete_robot_v1(project_id_or_name, robot_id, opts = {}) ⇒ nil
Delete a robot account This endpoint deletes specific robot account information by robot ID.
-
#delete_robot_v1_with_http_info(project_id_or_name, robot_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Delete a robot account This endpoint deletes specific robot account information by robot ID.
-
#get_robot_by_idv1(project_id_or_name, robot_id, opts = {}) ⇒ Robot
Get a robot account This endpoint returns specific robot account information by robot ID.
-
#get_robot_by_idv1_with_http_info(project_id_or_name, robot_id, opts = {}) ⇒ Array<(Robot, Fixnum, Hash)>
Get a robot account This endpoint returns specific robot account information by robot ID.
-
#initialize(api_client = ApiClient.default) ⇒ Robotv1Api
constructor
A new instance of Robotv1Api.
-
#list_robot_v1(project_id_or_name, opts = {}) ⇒ Array<Robot>
Get all robot accounts of specified project Get all robot accounts of specified project.
-
#list_robot_v1_with_http_info(project_id_or_name, opts = {}) ⇒ Array<(Array<Robot>, Fixnum, Hash)>
Get all robot accounts of specified project Get all robot accounts of specified project.
-
#update_robot_v1(project_id_or_name, robot_id, robot, opts = {}) ⇒ nil
Update status of robot account.
-
#update_robot_v1_with_http_info(project_id_or_name, robot_id, robot, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Update status of robot account.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ Robotv1Api
Returns a new instance of Robotv1Api.
19 20 21 |
# File 'lib/harbor_swagger_client/api/robotv1_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/harbor_swagger_client/api/robotv1_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#create_robot_v1(project_id_or_name, robot, opts = {}) ⇒ RobotCreated
Create a robot account Create a robot account
29 30 31 32 |
# File 'lib/harbor_swagger_client/api/robotv1_api.rb', line 29 def create_robot_v1(project_id_or_name, robot, opts = {}) data, _status_code, _headers = create_robot_v1_with_http_info(project_id_or_name, robot, opts) data end |
#create_robot_v1_with_http_info(project_id_or_name, robot, opts = {}) ⇒ Array<(RobotCreated, Fixnum, Hash)>
Create a robot account Create a robot account
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 |
# File 'lib/harbor_swagger_client/api/robotv1_api.rb', line 41 def create_robot_v1_with_http_info(project_id_or_name, robot, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: Robotv1Api.create_robot_v1 ...' end # verify the required parameter 'project_id_or_name' is set if @api_client.config.client_side_validation && project_id_or_name.nil? fail ArgumentError, "Missing the required parameter 'project_id_or_name' when calling Robotv1Api.create_robot_v1" end # verify the required parameter 'robot' is set if @api_client.config.client_side_validation && robot.nil? fail ArgumentError, "Missing the required parameter 'robot' when calling Robotv1Api.create_robot_v1" end if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1 fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling Robotv1Api.create_robot_v1, the character length must be great than or equal to 1.' end # resource path local_var_path = '/projects/{project_id_or_name}/robots'.sub('{' + 'project_id_or_name' + '}', project_id_or_name.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil? # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(robot) auth_names = ['basic'] 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, :return_type => 'RobotCreated') if @api_client.config.debugging @api_client.config.logger.debug "API called: Robotv1Api#create_robot_v1\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#delete_robot_v1(project_id_or_name, robot_id, opts = {}) ⇒ nil
Delete a robot account This endpoint deletes specific robot account information by robot ID.
96 97 98 99 |
# File 'lib/harbor_swagger_client/api/robotv1_api.rb', line 96 def delete_robot_v1(project_id_or_name, robot_id, opts = {}) delete_robot_v1_with_http_info(project_id_or_name, robot_id, opts) nil end |
#delete_robot_v1_with_http_info(project_id_or_name, robot_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Delete a robot account This endpoint deletes specific robot account information by robot ID.
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 144 145 146 147 148 149 150 151 152 153 154 |
# File 'lib/harbor_swagger_client/api/robotv1_api.rb', line 108 def delete_robot_v1_with_http_info(project_id_or_name, robot_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: Robotv1Api.delete_robot_v1 ...' end # verify the required parameter 'project_id_or_name' is set if @api_client.config.client_side_validation && project_id_or_name.nil? fail ArgumentError, "Missing the required parameter 'project_id_or_name' when calling Robotv1Api.delete_robot_v1" end # verify the required parameter 'robot_id' is set if @api_client.config.client_side_validation && robot_id.nil? fail ArgumentError, "Missing the required parameter 'robot_id' when calling Robotv1Api.delete_robot_v1" end if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1 fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling Robotv1Api.delete_robot_v1, the character length must be great than or equal to 1.' end # resource path local_var_path = '/projects/{project_id_or_name}/robots/{robot_id}'.sub('{' + 'project_id_or_name' + '}', project_id_or_name.to_s).sub('{' + 'robot_id' + '}', robot_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil? # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['basic'] data, status_code, headers = @api_client.call_api(:DELETE, 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: Robotv1Api#delete_robot_v1\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_robot_by_idv1(project_id_or_name, robot_id, opts = {}) ⇒ Robot
Get a robot account This endpoint returns specific robot account information by robot ID.
162 163 164 165 |
# File 'lib/harbor_swagger_client/api/robotv1_api.rb', line 162 def get_robot_by_idv1(project_id_or_name, robot_id, opts = {}) data, _status_code, _headers = get_robot_by_idv1_with_http_info(project_id_or_name, robot_id, opts) data end |
#get_robot_by_idv1_with_http_info(project_id_or_name, robot_id, opts = {}) ⇒ Array<(Robot, Fixnum, Hash)>
Get a robot account This endpoint returns specific robot account information by robot ID.
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 219 220 221 |
# File 'lib/harbor_swagger_client/api/robotv1_api.rb', line 174 def get_robot_by_idv1_with_http_info(project_id_or_name, robot_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: Robotv1Api.get_robot_by_idv1 ...' end # verify the required parameter 'project_id_or_name' is set if @api_client.config.client_side_validation && project_id_or_name.nil? fail ArgumentError, "Missing the required parameter 'project_id_or_name' when calling Robotv1Api.get_robot_by_idv1" end # verify the required parameter 'robot_id' is set if @api_client.config.client_side_validation && robot_id.nil? fail ArgumentError, "Missing the required parameter 'robot_id' when calling Robotv1Api.get_robot_by_idv1" end if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1 fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling Robotv1Api.get_robot_by_idv1, the character length must be great than or equal to 1.' end # resource path local_var_path = '/projects/{project_id_or_name}/robots/{robot_id}'.sub('{' + 'project_id_or_name' + '}', project_id_or_name.to_s).sub('{' + 'robot_id' + '}', robot_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil? # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['basic'] 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 => 'Robot') if @api_client.config.debugging @api_client.config.logger.debug "API called: Robotv1Api#get_robot_by_idv1\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_robot_v1(project_id_or_name, opts = {}) ⇒ Array<Robot>
Get all robot accounts of specified project Get all robot accounts of specified project
231 232 233 234 |
# File 'lib/harbor_swagger_client/api/robotv1_api.rb', line 231 def list_robot_v1(project_id_or_name, opts = {}) data, _status_code, _headers = list_robot_v1_with_http_info(project_id_or_name, opts) data end |
#list_robot_v1_with_http_info(project_id_or_name, opts = {}) ⇒ Array<(Array<Robot>, Fixnum, Hash)>
Get all robot accounts of specified project Get all robot accounts of specified project
245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 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 |
# File 'lib/harbor_swagger_client/api/robotv1_api.rb', line 245 def list_robot_v1_with_http_info(project_id_or_name, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: Robotv1Api.list_robot_v1 ...' end # verify the required parameter 'project_id_or_name' is set if @api_client.config.client_side_validation && project_id_or_name.nil? fail ArgumentError, "Missing the required parameter 'project_id_or_name' when calling Robotv1Api.list_robot_v1" end if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1 fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling Robotv1Api.list_robot_v1, the character length must be great than or equal to 1.' end if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100 fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling Robotv1Api.list_robot_v1, must be smaller than or equal to 100.' end # resource path local_var_path = '/projects/{project_id_or_name}/robots'.sub('{' + 'project_id_or_name' + '}', project_id_or_name.to_s) # query parameters query_params = {} query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'q'] = opts[:'q'] if !opts[:'q'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil? # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['basic'] 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 => 'Array<Robot>') if @api_client.config.debugging @api_client.config.logger.debug "API called: Robotv1Api#list_robot_v1\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#update_robot_v1(project_id_or_name, robot_id, robot, opts = {}) ⇒ nil
Update status of robot account. Used to disable/enable a specified robot account.
304 305 306 307 |
# File 'lib/harbor_swagger_client/api/robotv1_api.rb', line 304 def update_robot_v1(project_id_or_name, robot_id, robot, opts = {}) update_robot_v1_with_http_info(project_id_or_name, robot_id, robot, opts) nil end |
#update_robot_v1_with_http_info(project_id_or_name, robot_id, robot, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Update status of robot account. Used to disable/enable a specified robot account.
317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 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 |
# File 'lib/harbor_swagger_client/api/robotv1_api.rb', line 317 def update_robot_v1_with_http_info(project_id_or_name, robot_id, robot, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: Robotv1Api.update_robot_v1 ...' end # verify the required parameter 'project_id_or_name' is set if @api_client.config.client_side_validation && project_id_or_name.nil? fail ArgumentError, "Missing the required parameter 'project_id_or_name' when calling Robotv1Api.update_robot_v1" end # verify the required parameter 'robot_id' is set if @api_client.config.client_side_validation && robot_id.nil? fail ArgumentError, "Missing the required parameter 'robot_id' when calling Robotv1Api.update_robot_v1" end # verify the required parameter 'robot' is set if @api_client.config.client_side_validation && robot.nil? fail ArgumentError, "Missing the required parameter 'robot' when calling Robotv1Api.update_robot_v1" end if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1 fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling Robotv1Api.update_robot_v1, the character length must be great than or equal to 1.' end # resource path local_var_path = '/projects/{project_id_or_name}/robots/{robot_id}'.sub('{' + 'project_id_or_name' + '}', project_id_or_name.to_s).sub('{' + 'robot_id' + '}', robot_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil? # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(robot) auth_names = ['basic'] data, status_code, headers = @api_client.call_api(:PUT, 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: Robotv1Api#update_robot_v1\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |