Class: OpenapiClient::PolicyGitRepositoriesApi
- Inherits:
-
Object
- Object
- OpenapiClient::PolicyGitRepositoriesApi
- Defined in:
- lib/openapi_client/api/policy_git_repositories_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#activate_policy_repo(proj_id, repo_id, opts = {}) ⇒ ProjectRead
Activate Policy Repo Disable the currently active policy repo, this action means to turn off the gitops feature.
-
#activate_policy_repo_with_http_info(proj_id, repo_id, opts = {}) ⇒ Array<(ProjectRead, Integer, Hash)>
Activate Policy Repo Disable the currently active policy repo, this action means to turn off the gitops feature.
-
#create_policy_repo(proj_id, policy_repo_create, opts = {}) ⇒ PolicyRepoRead
Create Policy Repo Creates a new policy repository configuration under a given project.
-
#create_policy_repo_with_http_info(proj_id, policy_repo_create, opts = {}) ⇒ Array<(PolicyRepoRead, Integer, Hash)>
Create Policy Repo Creates a new policy repository configuration under a given project.
-
#delete_policy_repo(proj_id, repo_id, opts = {}) ⇒ nil
Delete Policy Repo Deletes an environment and all its related data.
-
#delete_policy_repo_with_http_info(proj_id, repo_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Delete Policy Repo Deletes an environment and all its related data.
-
#disable_active_policy_repo(proj_id, opts = {}) ⇒ ProjectRead
Disable Active Policy Repo Disable the currently active policy repo, this action means to turn off the gitops feature.
-
#disable_active_policy_repo_with_http_info(proj_id, opts = {}) ⇒ Array<(ProjectRead, Integer, Hash)>
Disable Active Policy Repo Disable the currently active policy repo, this action means to turn off the gitops feature.
-
#get_active_policy_repo(proj_id, opts = {}) ⇒ PolicyRepoRead
Get Active Policy Repo Gets the currently active repository, if such repository exists.
-
#get_active_policy_repo_with_http_info(proj_id, opts = {}) ⇒ Array<(PolicyRepoRead, Integer, Hash)>
Get Active Policy Repo Gets the currently active repository, if such repository exists.
-
#get_policy_repo(proj_id, repo_id, opts = {}) ⇒ PolicyRepoRead
Get Policy Repo Gets a single repository matching the given repo_id, if such repository exists.
-
#get_policy_repo_with_http_info(proj_id, repo_id, opts = {}) ⇒ Array<(PolicyRepoRead, Integer, Hash)>
Get Policy Repo Gets a single repository matching the given repo_id, if such repository exists.
-
#initialize(api_client = ApiClient.default) ⇒ PolicyGitRepositoriesApi
constructor
A new instance of PolicyGitRepositoriesApi.
-
#list_policy_repos(proj_id, opts = {}) ⇒ Array<PolicyRepoRead>
List Policy Repos Lists all the policy repositories under a given project.
-
#list_policy_repos_with_http_info(proj_id, opts = {}) ⇒ Array<(Array<PolicyRepoRead>, Integer, Hash)>
List Policy Repos Lists all the policy repositories under a given project.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ PolicyGitRepositoriesApi
Returns a new instance of PolicyGitRepositoriesApi.
19 20 21 |
# File 'lib/openapi_client/api/policy_git_repositories_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/openapi_client/api/policy_git_repositories_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#activate_policy_repo(proj_id, repo_id, opts = {}) ⇒ ProjectRead
Activate Policy Repo Disable the currently active policy repo, this action means to turn off the gitops feature. If there is no active policy repo, this action will do nothing.
28 29 30 31 |
# File 'lib/openapi_client/api/policy_git_repositories_api.rb', line 28 def activate_policy_repo(proj_id, repo_id, opts = {}) data, _status_code, _headers = activate_policy_repo_with_http_info(proj_id, repo_id, opts) data end |
#activate_policy_repo_with_http_info(proj_id, repo_id, opts = {}) ⇒ Array<(ProjectRead, Integer, Hash)>
Activate Policy Repo Disable the currently active policy repo, this action means to turn off the gitops feature. If there is no active policy repo, this action will do nothing.
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 |
# File 'lib/openapi_client/api/policy_git_repositories_api.rb', line 39 def activate_policy_repo_with_http_info(proj_id, repo_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PolicyGitRepositoriesApi.activate_policy_repo ...' end # verify the required parameter 'proj_id' is set if @api_client.config.client_side_validation && proj_id.nil? fail ArgumentError, "Missing the required parameter 'proj_id' when calling PolicyGitRepositoriesApi.activate_policy_repo" end # verify the required parameter 'repo_id' is set if @api_client.config.client_side_validation && repo_id.nil? fail ArgumentError, "Missing the required parameter 'repo_id' when calling PolicyGitRepositoriesApi.activate_policy_repo" end # resource path local_var_path = '/v2/projects/{proj_id}/repos/{repo_id}/activate'.sub('{' + 'proj_id' + '}', CGI.escape(proj_id.to_s)).sub('{' + 'repo_id' + '}', CGI.escape(repo_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']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ProjectRead' # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] = opts.merge( :operation => :"PolicyGitRepositoriesApi.activate_policy_repo", :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: PolicyGitRepositoriesApi#activate_policy_repo\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#create_policy_repo(proj_id, policy_repo_create, opts = {}) ⇒ PolicyRepoRead
Create Policy Repo Creates a new policy repository configuration under a given project. The given repository is created with status ‘pending’, it will be changed and used as the ‘active’ repository for the policy only after a successful attempt to use it. The repository main branch must be present in the remote.
97 98 99 100 |
# File 'lib/openapi_client/api/policy_git_repositories_api.rb', line 97 def create_policy_repo(proj_id, policy_repo_create, opts = {}) data, _status_code, _headers = create_policy_repo_with_http_info(proj_id, policy_repo_create, opts) data end |
#create_policy_repo_with_http_info(proj_id, policy_repo_create, opts = {}) ⇒ Array<(PolicyRepoRead, Integer, Hash)>
Create Policy Repo Creates a new policy repository configuration under a given project. The given repository is created with status 'pending', it will be changed and used as the 'active' repository for the policy only after a successful attempt to use it. The repository main branch must be present in the remote.
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 155 156 157 158 159 160 161 162 163 |
# File 'lib/openapi_client/api/policy_git_repositories_api.rb', line 108 def create_policy_repo_with_http_info(proj_id, policy_repo_create, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PolicyGitRepositoriesApi.create_policy_repo ...' end # verify the required parameter 'proj_id' is set if @api_client.config.client_side_validation && proj_id.nil? fail ArgumentError, "Missing the required parameter 'proj_id' when calling PolicyGitRepositoriesApi.create_policy_repo" end # verify the required parameter 'policy_repo_create' is set if @api_client.config.client_side_validation && policy_repo_create.nil? fail ArgumentError, "Missing the required parameter 'policy_repo_create' when calling PolicyGitRepositoriesApi.create_policy_repo" end # resource path local_var_path = '/v2/projects/{proj_id}/repos'.sub('{' + 'proj_id' + '}', CGI.escape(proj_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']) # 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 # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(policy_repo_create) # return_type return_type = opts[:debug_return_type] || 'PolicyRepoRead' # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] = opts.merge( :operation => :"PolicyGitRepositoriesApi.create_policy_repo", :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: PolicyGitRepositoriesApi#create_policy_repo\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#delete_policy_repo(proj_id, repo_id, opts = {}) ⇒ nil
Delete Policy Repo Deletes an environment and all its related data.
171 172 173 174 |
# File 'lib/openapi_client/api/policy_git_repositories_api.rb', line 171 def delete_policy_repo(proj_id, repo_id, opts = {}) delete_policy_repo_with_http_info(proj_id, repo_id, opts) nil end |
#delete_policy_repo_with_http_info(proj_id, repo_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Delete Policy Repo Deletes an environment and all its related data.
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 222 223 224 225 226 227 228 229 230 231 232 |
# File 'lib/openapi_client/api/policy_git_repositories_api.rb', line 182 def delete_policy_repo_with_http_info(proj_id, repo_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PolicyGitRepositoriesApi.delete_policy_repo ...' end # verify the required parameter 'proj_id' is set if @api_client.config.client_side_validation && proj_id.nil? fail ArgumentError, "Missing the required parameter 'proj_id' when calling PolicyGitRepositoriesApi.delete_policy_repo" end # verify the required parameter 'repo_id' is set if @api_client.config.client_side_validation && repo_id.nil? fail ArgumentError, "Missing the required parameter 'repo_id' when calling PolicyGitRepositoriesApi.delete_policy_repo" end # resource path local_var_path = '/v2/projects/{proj_id}/repos/{repo_id}'.sub('{' + 'proj_id' + '}', CGI.escape(proj_id.to_s)).sub('{' + 'repo_id' + '}', CGI.escape(repo_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']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] = opts.merge( :operation => :"PolicyGitRepositoriesApi.delete_policy_repo", :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: PolicyGitRepositoriesApi#delete_policy_repo\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#disable_active_policy_repo(proj_id, opts = {}) ⇒ ProjectRead
Disable Active Policy Repo Disable the currently active policy repo, this action means to turn off the gitops feature. If there is no active policy repo, this action will do nothing.
239 240 241 242 |
# File 'lib/openapi_client/api/policy_git_repositories_api.rb', line 239 def disable_active_policy_repo(proj_id, opts = {}) data, _status_code, _headers = disable_active_policy_repo_with_http_info(proj_id, opts) data end |
#disable_active_policy_repo_with_http_info(proj_id, opts = {}) ⇒ Array<(ProjectRead, Integer, Hash)>
Disable Active Policy Repo Disable the currently active policy repo, this action means to turn off the gitops feature. If there is no active policy repo, this action will do nothing.
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/openapi_client/api/policy_git_repositories_api.rb', line 249 def disable_active_policy_repo_with_http_info(proj_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PolicyGitRepositoriesApi.disable_active_policy_repo ...' end # verify the required parameter 'proj_id' is set if @api_client.config.client_side_validation && proj_id.nil? fail ArgumentError, "Missing the required parameter 'proj_id' when calling PolicyGitRepositoriesApi.disable_active_policy_repo" end # resource path local_var_path = '/v2/projects/{proj_id}/repos/disable'.sub('{' + 'proj_id' + '}', CGI.escape(proj_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']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ProjectRead' # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] = opts.merge( :operation => :"PolicyGitRepositoriesApi.disable_active_policy_repo", :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: PolicyGitRepositoriesApi#disable_active_policy_repo\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_active_policy_repo(proj_id, opts = {}) ⇒ PolicyRepoRead
Get Active Policy Repo Gets the currently active repository, if such repository exists.
302 303 304 305 |
# File 'lib/openapi_client/api/policy_git_repositories_api.rb', line 302 def get_active_policy_repo(proj_id, opts = {}) data, _status_code, _headers = get_active_policy_repo_with_http_info(proj_id, opts) data end |
#get_active_policy_repo_with_http_info(proj_id, opts = {}) ⇒ Array<(PolicyRepoRead, Integer, Hash)>
Get Active Policy Repo Gets the currently active repository, if such repository exists.
312 313 314 315 316 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 |
# File 'lib/openapi_client/api/policy_git_repositories_api.rb', line 312 def get_active_policy_repo_with_http_info(proj_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PolicyGitRepositoriesApi.get_active_policy_repo ...' end # verify the required parameter 'proj_id' is set if @api_client.config.client_side_validation && proj_id.nil? fail ArgumentError, "Missing the required parameter 'proj_id' when calling PolicyGitRepositoriesApi.get_active_policy_repo" end # resource path local_var_path = '/v2/projects/{proj_id}/repos/active'.sub('{' + 'proj_id' + '}', CGI.escape(proj_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']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'PolicyRepoRead' # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] = opts.merge( :operation => :"PolicyGitRepositoriesApi.get_active_policy_repo", :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: PolicyGitRepositoriesApi#get_active_policy_repo\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_policy_repo(proj_id, repo_id, opts = {}) ⇒ PolicyRepoRead
Get Policy Repo Gets a single repository matching the given repo_id, if such repository exists.
366 367 368 369 |
# File 'lib/openapi_client/api/policy_git_repositories_api.rb', line 366 def get_policy_repo(proj_id, repo_id, opts = {}) data, _status_code, _headers = get_policy_repo_with_http_info(proj_id, repo_id, opts) data end |
#get_policy_repo_with_http_info(proj_id, repo_id, opts = {}) ⇒ Array<(PolicyRepoRead, Integer, Hash)>
Get Policy Repo Gets a single repository matching the given repo_id, if such repository exists.
377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 |
# File 'lib/openapi_client/api/policy_git_repositories_api.rb', line 377 def get_policy_repo_with_http_info(proj_id, repo_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PolicyGitRepositoriesApi.get_policy_repo ...' end # verify the required parameter 'proj_id' is set if @api_client.config.client_side_validation && proj_id.nil? fail ArgumentError, "Missing the required parameter 'proj_id' when calling PolicyGitRepositoriesApi.get_policy_repo" end # verify the required parameter 'repo_id' is set if @api_client.config.client_side_validation && repo_id.nil? fail ArgumentError, "Missing the required parameter 'repo_id' when calling PolicyGitRepositoriesApi.get_policy_repo" end # resource path local_var_path = '/v2/projects/{proj_id}/repos/{repo_id}'.sub('{' + 'proj_id' + '}', CGI.escape(proj_id.to_s)).sub('{' + 'repo_id' + '}', CGI.escape(repo_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']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'PolicyRepoRead' # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] = opts.merge( :operation => :"PolicyGitRepositoriesApi.get_policy_repo", :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: PolicyGitRepositoriesApi#get_policy_repo\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_policy_repos(proj_id, opts = {}) ⇒ Array<PolicyRepoRead>
List Policy Repos Lists all the policy repositories under a given project.
436 437 438 439 |
# File 'lib/openapi_client/api/policy_git_repositories_api.rb', line 436 def list_policy_repos(proj_id, opts = {}) data, _status_code, _headers = list_policy_repos_with_http_info(proj_id, opts) data end |
#list_policy_repos_with_http_info(proj_id, opts = {}) ⇒ Array<(Array<PolicyRepoRead>, Integer, Hash)>
List Policy Repos Lists all the policy repositories under a given project.
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 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 |
# File 'lib/openapi_client/api/policy_git_repositories_api.rb', line 448 def list_policy_repos_with_http_info(proj_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PolicyGitRepositoriesApi.list_policy_repos ...' end # verify the required parameter 'proj_id' is set if @api_client.config.client_side_validation && proj_id.nil? fail ArgumentError, "Missing the required parameter 'proj_id' when calling PolicyGitRepositoriesApi.list_policy_repos" end if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1 fail ArgumentError, 'invalid value for "opts[:"page"]" when calling PolicyGitRepositoriesApi.list_policy_repos, must be greater than or equal to 1.' end if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] > 100 fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling PolicyGitRepositoriesApi.list_policy_repos, must be smaller than or equal to 100.' end if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] < 1 fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling PolicyGitRepositoriesApi.list_policy_repos, must be greater than or equal to 1.' end # resource path local_var_path = '/v2/projects/{proj_id}/repos'.sub('{' + 'proj_id' + '}', CGI.escape(proj_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Array<PolicyRepoRead>' # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] = opts.merge( :operation => :"PolicyGitRepositoriesApi.list_policy_repos", :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: PolicyGitRepositoriesApi#list_policy_repos\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |