pulp_2to3_migration_client 0.0.1a1.dev01569436440
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.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/README.md +110 -0
- data/Rakefile +10 -0
- data/docs/AsyncOperationResponse.md +17 -0
- data/docs/InlineResponse200.md +23 -0
- data/docs/InlineResponse2001.md +23 -0
- data/docs/MigrationPlan.md +21 -0
- data/docs/MigrationPlanRun.md +17 -0
- data/docs/MigrationPlansApi.md +289 -0
- data/docs/Pulp2Content.md +31 -0
- data/docs/Pulp2contentApi.md +148 -0
- data/git_push.sh +58 -0
- data/lib/pulp_2to3_migration_client/api/migration_plans_api.rb +346 -0
- data/lib/pulp_2to3_migration_client/api/pulp2content_api.rb +185 -0
- data/lib/pulp_2to3_migration_client/api_client.rb +402 -0
- data/lib/pulp_2to3_migration_client/api_error.rb +57 -0
- data/lib/pulp_2to3_migration_client/configuration.rb +243 -0
- data/lib/pulp_2to3_migration_client/models/async_operation_response.rb +202 -0
- data/lib/pulp_2to3_migration_client/models/inline_response200.rb +235 -0
- data/lib/pulp_2to3_migration_client/models/inline_response2001.rb +235 -0
- data/lib/pulp_2to3_migration_client/models/migration_plan.rb +221 -0
- data/lib/pulp_2to3_migration_client/models/migration_plan_run.rb +199 -0
- data/lib/pulp_2to3_migration_client/models/pulp2_content.rb +357 -0
- data/lib/pulp_2to3_migration_client/version.rb +15 -0
- data/lib/pulp_2to3_migration_client.rb +47 -0
- data/pulp_2to3_migration_client.gemspec +39 -0
- data/spec/api/migration_plans_api_spec.rb +99 -0
- data/spec/api/pulp2content_api_spec.rb +73 -0
- data/spec/api_client_spec.rb +188 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/async_operation_response_spec.rb +41 -0
- data/spec/models/inline_response2001_spec.rb +59 -0
- data/spec/models/inline_response200_spec.rb +59 -0
- data/spec/models/migration_plan_run_spec.rb +41 -0
- data/spec/models/migration_plan_spec.rb +53 -0
- data/spec/models/pulp2_content_spec.rb +83 -0
- data/spec/spec_helper.rb +111 -0
- metadata +146 -0
@@ -0,0 +1,148 @@
|
|
1
|
+
# Pulp2to3MigrationClient::Pulp2contentApi
|
2
|
+
|
3
|
+
All URIs are relative to *http://localhost:24817*
|
4
|
+
|
5
|
+
Method | HTTP request | Description
|
6
|
+
------------- | ------------- | -------------
|
7
|
+
[**list**](Pulp2contentApi.md#list) | **GET** /pulp/api/v3/pulp2content/ | List pulp2 contents
|
8
|
+
[**read**](Pulp2contentApi.md#read) | **GET** {pulp2_content_href} | Inspect a pulp2 content
|
9
|
+
|
10
|
+
|
11
|
+
|
12
|
+
## list
|
13
|
+
|
14
|
+
> InlineResponse2001 list(opts)
|
15
|
+
|
16
|
+
List pulp2 contents
|
17
|
+
|
18
|
+
ViewSet for Pulp2Content model.
|
19
|
+
|
20
|
+
### Example
|
21
|
+
|
22
|
+
```ruby
|
23
|
+
# load the gem
|
24
|
+
require 'pulp_2to3_migration_client'
|
25
|
+
# setup authorization
|
26
|
+
Pulp2to3MigrationClient.configure do |config|
|
27
|
+
# Configure HTTP basic authorization: Basic
|
28
|
+
config.username = 'YOUR USERNAME'
|
29
|
+
config.password = 'YOUR PASSWORD'
|
30
|
+
end
|
31
|
+
|
32
|
+
api_instance = Pulp2to3MigrationClient::Pulp2contentApi.new
|
33
|
+
opts = {
|
34
|
+
pulp2_id: 'pulp2_id_example', # String |
|
35
|
+
pulp2_id__in: 'pulp2_id__in_example', # String | Filter results where pulp2_id is in a comma-separated list of values
|
36
|
+
pulp2_content_type_id: 'pulp2_content_type_id_example', # String |
|
37
|
+
pulp2_content_type_id__in: 'pulp2_content_type_id__in_example', # String | Filter results where pulp2_content_type_id is in a comma-separated list of values
|
38
|
+
pulp2_last_updated__lt: 3.4, # Float | Filter results where pulp2_last_updated is less than value
|
39
|
+
pulp2_last_updated__lte: 3.4, # Float | Filter results where pulp2_last_updated is less than or equal to value
|
40
|
+
pulp2_last_updated__gt: 3.4, # Float | Filter results where pulp2_last_updated is greater than value
|
41
|
+
pulp2_last_updated__gte: 3.4, # Float | Filter results where pulp2_last_updated is greater than or equal to value
|
42
|
+
pulp2_last_updated__range: 3.4, # Float | Filter results where pulp2_last_updated is between two comma separated values
|
43
|
+
pulp3_content: 'pulp3_content_example', # String | Foreign Key referenced by HREF
|
44
|
+
pulp2_last_updated: 'pulp2_last_updated_example', # String | ISO 8601 formatted dates are supported
|
45
|
+
limit: 56, # Integer | Number of results to return per page.
|
46
|
+
offset: 56, # Integer | The initial index from which to return the results.
|
47
|
+
fields: 'fields_example' # String | A list of fields to include in the response.
|
48
|
+
}
|
49
|
+
|
50
|
+
begin
|
51
|
+
#List pulp2 contents
|
52
|
+
result = api_instance.list(opts)
|
53
|
+
p result
|
54
|
+
rescue Pulp2to3MigrationClient::ApiError => e
|
55
|
+
puts "Exception when calling Pulp2contentApi->list: #{e}"
|
56
|
+
end
|
57
|
+
```
|
58
|
+
|
59
|
+
### Parameters
|
60
|
+
|
61
|
+
|
62
|
+
Name | Type | Description | Notes
|
63
|
+
------------- | ------------- | ------------- | -------------
|
64
|
+
**pulp2_id** | **String**| | [optional]
|
65
|
+
**pulp2_id__in** | **String**| Filter results where pulp2_id is in a comma-separated list of values | [optional]
|
66
|
+
**pulp2_content_type_id** | **String**| | [optional]
|
67
|
+
**pulp2_content_type_id__in** | **String**| Filter results where pulp2_content_type_id is in a comma-separated list of values | [optional]
|
68
|
+
**pulp2_last_updated__lt** | **Float**| Filter results where pulp2_last_updated is less than value | [optional]
|
69
|
+
**pulp2_last_updated__lte** | **Float**| Filter results where pulp2_last_updated is less than or equal to value | [optional]
|
70
|
+
**pulp2_last_updated__gt** | **Float**| Filter results where pulp2_last_updated is greater than value | [optional]
|
71
|
+
**pulp2_last_updated__gte** | **Float**| Filter results where pulp2_last_updated is greater than or equal to value | [optional]
|
72
|
+
**pulp2_last_updated__range** | **Float**| Filter results where pulp2_last_updated is between two comma separated values | [optional]
|
73
|
+
**pulp3_content** | **String**| Foreign Key referenced by HREF | [optional]
|
74
|
+
**pulp2_last_updated** | **String**| ISO 8601 formatted dates are supported | [optional]
|
75
|
+
**limit** | **Integer**| Number of results to return per page. | [optional]
|
76
|
+
**offset** | **Integer**| The initial index from which to return the results. | [optional]
|
77
|
+
**fields** | **String**| A list of fields to include in the response. | [optional]
|
78
|
+
|
79
|
+
### Return type
|
80
|
+
|
81
|
+
[**InlineResponse2001**](InlineResponse2001.md)
|
82
|
+
|
83
|
+
### Authorization
|
84
|
+
|
85
|
+
[Basic](../README.md#Basic)
|
86
|
+
|
87
|
+
### HTTP request headers
|
88
|
+
|
89
|
+
- **Content-Type**: Not defined
|
90
|
+
- **Accept**: application/json
|
91
|
+
|
92
|
+
|
93
|
+
## read
|
94
|
+
|
95
|
+
> Pulp2Content read(pulp2_content_href, opts)
|
96
|
+
|
97
|
+
Inspect a pulp2 content
|
98
|
+
|
99
|
+
ViewSet for Pulp2Content model.
|
100
|
+
|
101
|
+
### Example
|
102
|
+
|
103
|
+
```ruby
|
104
|
+
# load the gem
|
105
|
+
require 'pulp_2to3_migration_client'
|
106
|
+
# setup authorization
|
107
|
+
Pulp2to3MigrationClient.configure do |config|
|
108
|
+
# Configure HTTP basic authorization: Basic
|
109
|
+
config.username = 'YOUR USERNAME'
|
110
|
+
config.password = 'YOUR PASSWORD'
|
111
|
+
end
|
112
|
+
|
113
|
+
api_instance = Pulp2to3MigrationClient::Pulp2contentApi.new
|
114
|
+
pulp2_content_href = 'pulp2_content_href_example' # String | URI of Pulp2 Content. e.g.: /pulp/api/v3/pulp2content/1/
|
115
|
+
opts = {
|
116
|
+
fields: 'fields_example' # String | A list of fields to include in the response.
|
117
|
+
}
|
118
|
+
|
119
|
+
begin
|
120
|
+
#Inspect a pulp2 content
|
121
|
+
result = api_instance.read(pulp2_content_href, opts)
|
122
|
+
p result
|
123
|
+
rescue Pulp2to3MigrationClient::ApiError => e
|
124
|
+
puts "Exception when calling Pulp2contentApi->read: #{e}"
|
125
|
+
end
|
126
|
+
```
|
127
|
+
|
128
|
+
### Parameters
|
129
|
+
|
130
|
+
|
131
|
+
Name | Type | Description | Notes
|
132
|
+
------------- | ------------- | ------------- | -------------
|
133
|
+
**pulp2_content_href** | **String**| URI of Pulp2 Content. e.g.: /pulp/api/v3/pulp2content/1/ |
|
134
|
+
**fields** | **String**| A list of fields to include in the response. | [optional]
|
135
|
+
|
136
|
+
### Return type
|
137
|
+
|
138
|
+
[**Pulp2Content**](Pulp2Content.md)
|
139
|
+
|
140
|
+
### Authorization
|
141
|
+
|
142
|
+
[Basic](../README.md#Basic)
|
143
|
+
|
144
|
+
### HTTP request headers
|
145
|
+
|
146
|
+
- **Content-Type**: Not defined
|
147
|
+
- **Accept**: application/json
|
148
|
+
|
data/git_push.sh
ADDED
@@ -0,0 +1,58 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
|
3
|
+
#
|
4
|
+
# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com"
|
5
|
+
|
6
|
+
git_user_id=$1
|
7
|
+
git_repo_id=$2
|
8
|
+
release_note=$3
|
9
|
+
git_host=$4
|
10
|
+
|
11
|
+
if [ "$git_host" = "" ]; then
|
12
|
+
git_host="github.com"
|
13
|
+
echo "[INFO] No command line input provided. Set \$git_host to $git_host"
|
14
|
+
fi
|
15
|
+
|
16
|
+
if [ "$git_user_id" = "" ]; then
|
17
|
+
git_user_id="GIT_USER_ID"
|
18
|
+
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
|
19
|
+
fi
|
20
|
+
|
21
|
+
if [ "$git_repo_id" = "" ]; then
|
22
|
+
git_repo_id="GIT_REPO_ID"
|
23
|
+
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
|
24
|
+
fi
|
25
|
+
|
26
|
+
if [ "$release_note" = "" ]; then
|
27
|
+
release_note="Minor update"
|
28
|
+
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
|
29
|
+
fi
|
30
|
+
|
31
|
+
# Initialize the local directory as a Git repository
|
32
|
+
git init
|
33
|
+
|
34
|
+
# Adds the files in the local repository and stages them for commit.
|
35
|
+
git add .
|
36
|
+
|
37
|
+
# Commits the tracked changes and prepares them to be pushed to a remote repository.
|
38
|
+
git commit -m "$release_note"
|
39
|
+
|
40
|
+
# Sets the new remote
|
41
|
+
git_remote=`git remote`
|
42
|
+
if [ "$git_remote" = "" ]; then # git remote not defined
|
43
|
+
|
44
|
+
if [ "$GIT_TOKEN" = "" ]; then
|
45
|
+
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
|
46
|
+
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
|
47
|
+
else
|
48
|
+
git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git
|
49
|
+
fi
|
50
|
+
|
51
|
+
fi
|
52
|
+
|
53
|
+
git pull origin master
|
54
|
+
|
55
|
+
# Pushes (Forces) the changes in the local repository up to the remote repository
|
56
|
+
echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
|
57
|
+
git push origin master 2>&1 | grep -v 'To https'
|
58
|
+
|
@@ -0,0 +1,346 @@
|
|
1
|
+
=begin
|
2
|
+
#Pulp 3 API
|
3
|
+
|
4
|
+
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
5
|
+
|
6
|
+
The version of the OpenAPI document: v3
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.1.3-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'cgi'
|
14
|
+
|
15
|
+
module Pulp2to3MigrationClient
|
16
|
+
class MigrationPlansApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Create a migration plan
|
23
|
+
# MigrationPlan ViewSet.
|
24
|
+
# @param data [MigrationPlan]
|
25
|
+
# @param [Hash] opts the optional parameters
|
26
|
+
# @return [MigrationPlan]
|
27
|
+
def create(data, opts = {})
|
28
|
+
data, _status_code, _headers = create_with_http_info(data, opts)
|
29
|
+
data
|
30
|
+
end
|
31
|
+
|
32
|
+
# Create a migration plan
|
33
|
+
# MigrationPlan ViewSet.
|
34
|
+
# @param data [MigrationPlan]
|
35
|
+
# @param [Hash] opts the optional parameters
|
36
|
+
# @return [Array<(MigrationPlan, Integer, Hash)>] MigrationPlan data, response status code and response headers
|
37
|
+
def create_with_http_info(data, opts = {})
|
38
|
+
if @api_client.config.debugging
|
39
|
+
@api_client.config.logger.debug 'Calling API: MigrationPlansApi.create ...'
|
40
|
+
end
|
41
|
+
# verify the required parameter 'data' is set
|
42
|
+
if @api_client.config.client_side_validation && data.nil?
|
43
|
+
fail ArgumentError, "Missing the required parameter 'data' when calling MigrationPlansApi.create"
|
44
|
+
end
|
45
|
+
# resource path
|
46
|
+
local_var_path = '/pulp/api/v3/migration-plans/'
|
47
|
+
|
48
|
+
# query parameters
|
49
|
+
query_params = opts[:query_params] || {}
|
50
|
+
|
51
|
+
# header parameters
|
52
|
+
header_params = opts[:header_params] || {}
|
53
|
+
# HTTP header 'Accept' (if needed)
|
54
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
55
|
+
# HTTP header 'Content-Type'
|
56
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
57
|
+
|
58
|
+
# form parameters
|
59
|
+
form_params = opts[:form_params] || {}
|
60
|
+
|
61
|
+
# http body (model)
|
62
|
+
post_body = opts[:body] || @api_client.object_to_http_body(data)
|
63
|
+
|
64
|
+
# return_type
|
65
|
+
return_type = opts[:return_type] || 'MigrationPlan'
|
66
|
+
|
67
|
+
# auth_names
|
68
|
+
auth_names = opts[:auth_names] || ['Basic']
|
69
|
+
|
70
|
+
new_options = opts.merge(
|
71
|
+
:header_params => header_params,
|
72
|
+
:query_params => query_params,
|
73
|
+
:form_params => form_params,
|
74
|
+
:body => post_body,
|
75
|
+
:auth_names => auth_names,
|
76
|
+
:return_type => return_type
|
77
|
+
)
|
78
|
+
|
79
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
80
|
+
if @api_client.config.debugging
|
81
|
+
@api_client.config.logger.debug "API called: MigrationPlansApi#create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
82
|
+
end
|
83
|
+
return data, status_code, headers
|
84
|
+
end
|
85
|
+
|
86
|
+
# Delete a migration plan
|
87
|
+
# MigrationPlan ViewSet.
|
88
|
+
# @param migration_plan_href [String] URI of Migration Plan. e.g.: /pulp/api/v3/migration-plans/1/
|
89
|
+
# @param [Hash] opts the optional parameters
|
90
|
+
# @return [nil]
|
91
|
+
def delete(migration_plan_href, opts = {})
|
92
|
+
delete_with_http_info(migration_plan_href, opts)
|
93
|
+
nil
|
94
|
+
end
|
95
|
+
|
96
|
+
# Delete a migration plan
|
97
|
+
# MigrationPlan ViewSet.
|
98
|
+
# @param migration_plan_href [String] URI of Migration Plan. e.g.: /pulp/api/v3/migration-plans/1/
|
99
|
+
# @param [Hash] opts the optional parameters
|
100
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
101
|
+
def delete_with_http_info(migration_plan_href, opts = {})
|
102
|
+
if @api_client.config.debugging
|
103
|
+
@api_client.config.logger.debug 'Calling API: MigrationPlansApi.delete ...'
|
104
|
+
end
|
105
|
+
# verify the required parameter 'migration_plan_href' is set
|
106
|
+
if @api_client.config.client_side_validation && migration_plan_href.nil?
|
107
|
+
fail ArgumentError, "Missing the required parameter 'migration_plan_href' when calling MigrationPlansApi.delete"
|
108
|
+
end
|
109
|
+
# resource path
|
110
|
+
local_var_path = '{migration_plan_href}'.sub('{' + 'migration_plan_href' + '}', CGI.escape(migration_plan_href.to_s).gsub('%2F', '/'))
|
111
|
+
|
112
|
+
# query parameters
|
113
|
+
query_params = opts[:query_params] || {}
|
114
|
+
|
115
|
+
# header parameters
|
116
|
+
header_params = opts[:header_params] || {}
|
117
|
+
|
118
|
+
# form parameters
|
119
|
+
form_params = opts[:form_params] || {}
|
120
|
+
|
121
|
+
# http body (model)
|
122
|
+
post_body = opts[:body]
|
123
|
+
|
124
|
+
# return_type
|
125
|
+
return_type = opts[:return_type]
|
126
|
+
|
127
|
+
# auth_names
|
128
|
+
auth_names = opts[:auth_names] || ['Basic']
|
129
|
+
|
130
|
+
new_options = opts.merge(
|
131
|
+
:header_params => header_params,
|
132
|
+
:query_params => query_params,
|
133
|
+
:form_params => form_params,
|
134
|
+
:body => post_body,
|
135
|
+
:auth_names => auth_names,
|
136
|
+
:return_type => return_type
|
137
|
+
)
|
138
|
+
|
139
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
140
|
+
if @api_client.config.debugging
|
141
|
+
@api_client.config.logger.debug "API called: MigrationPlansApi#delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
142
|
+
end
|
143
|
+
return data, status_code, headers
|
144
|
+
end
|
145
|
+
|
146
|
+
# List migration plans
|
147
|
+
# MigrationPlan ViewSet.
|
148
|
+
# @param [Hash] opts the optional parameters
|
149
|
+
# @option opts [Integer] :limit Number of results to return per page.
|
150
|
+
# @option opts [Integer] :offset The initial index from which to return the results.
|
151
|
+
# @option opts [String] :fields A list of fields to include in the response.
|
152
|
+
# @return [InlineResponse200]
|
153
|
+
def list(opts = {})
|
154
|
+
data, _status_code, _headers = list_with_http_info(opts)
|
155
|
+
data
|
156
|
+
end
|
157
|
+
|
158
|
+
# List migration plans
|
159
|
+
# MigrationPlan ViewSet.
|
160
|
+
# @param [Hash] opts the optional parameters
|
161
|
+
# @option opts [Integer] :limit Number of results to return per page.
|
162
|
+
# @option opts [Integer] :offset The initial index from which to return the results.
|
163
|
+
# @option opts [String] :fields A list of fields to include in the response.
|
164
|
+
# @return [Array<(InlineResponse200, Integer, Hash)>] InlineResponse200 data, response status code and response headers
|
165
|
+
def list_with_http_info(opts = {})
|
166
|
+
if @api_client.config.debugging
|
167
|
+
@api_client.config.logger.debug 'Calling API: MigrationPlansApi.list ...'
|
168
|
+
end
|
169
|
+
# resource path
|
170
|
+
local_var_path = '/pulp/api/v3/migration-plans/'
|
171
|
+
|
172
|
+
# query parameters
|
173
|
+
query_params = opts[:query_params] || {}
|
174
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
175
|
+
query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
|
176
|
+
query_params[:'fields'] = opts[:'fields'] if !opts[:'fields'].nil?
|
177
|
+
|
178
|
+
# header parameters
|
179
|
+
header_params = opts[:header_params] || {}
|
180
|
+
# HTTP header 'Accept' (if needed)
|
181
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
182
|
+
|
183
|
+
# form parameters
|
184
|
+
form_params = opts[:form_params] || {}
|
185
|
+
|
186
|
+
# http body (model)
|
187
|
+
post_body = opts[:body]
|
188
|
+
|
189
|
+
# return_type
|
190
|
+
return_type = opts[:return_type] || 'InlineResponse200'
|
191
|
+
|
192
|
+
# auth_names
|
193
|
+
auth_names = opts[:auth_names] || ['Basic']
|
194
|
+
|
195
|
+
new_options = opts.merge(
|
196
|
+
:header_params => header_params,
|
197
|
+
:query_params => query_params,
|
198
|
+
:form_params => form_params,
|
199
|
+
:body => post_body,
|
200
|
+
:auth_names => auth_names,
|
201
|
+
:return_type => return_type
|
202
|
+
)
|
203
|
+
|
204
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
205
|
+
if @api_client.config.debugging
|
206
|
+
@api_client.config.logger.debug "API called: MigrationPlansApi#list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
207
|
+
end
|
208
|
+
return data, status_code, headers
|
209
|
+
end
|
210
|
+
|
211
|
+
# Inspect a migration plan
|
212
|
+
# MigrationPlan ViewSet.
|
213
|
+
# @param migration_plan_href [String] URI of Migration Plan. e.g.: /pulp/api/v3/migration-plans/1/
|
214
|
+
# @param [Hash] opts the optional parameters
|
215
|
+
# @option opts [String] :fields A list of fields to include in the response.
|
216
|
+
# @return [MigrationPlan]
|
217
|
+
def read(migration_plan_href, opts = {})
|
218
|
+
data, _status_code, _headers = read_with_http_info(migration_plan_href, opts)
|
219
|
+
data
|
220
|
+
end
|
221
|
+
|
222
|
+
# Inspect a migration plan
|
223
|
+
# MigrationPlan ViewSet.
|
224
|
+
# @param migration_plan_href [String] URI of Migration Plan. e.g.: /pulp/api/v3/migration-plans/1/
|
225
|
+
# @param [Hash] opts the optional parameters
|
226
|
+
# @option opts [String] :fields A list of fields to include in the response.
|
227
|
+
# @return [Array<(MigrationPlan, Integer, Hash)>] MigrationPlan data, response status code and response headers
|
228
|
+
def read_with_http_info(migration_plan_href, opts = {})
|
229
|
+
if @api_client.config.debugging
|
230
|
+
@api_client.config.logger.debug 'Calling API: MigrationPlansApi.read ...'
|
231
|
+
end
|
232
|
+
# verify the required parameter 'migration_plan_href' is set
|
233
|
+
if @api_client.config.client_side_validation && migration_plan_href.nil?
|
234
|
+
fail ArgumentError, "Missing the required parameter 'migration_plan_href' when calling MigrationPlansApi.read"
|
235
|
+
end
|
236
|
+
# resource path
|
237
|
+
local_var_path = '{migration_plan_href}'.sub('{' + 'migration_plan_href' + '}', CGI.escape(migration_plan_href.to_s).gsub('%2F', '/'))
|
238
|
+
|
239
|
+
# query parameters
|
240
|
+
query_params = opts[:query_params] || {}
|
241
|
+
query_params[:'fields'] = opts[:'fields'] if !opts[:'fields'].nil?
|
242
|
+
|
243
|
+
# header parameters
|
244
|
+
header_params = opts[:header_params] || {}
|
245
|
+
# HTTP header 'Accept' (if needed)
|
246
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
247
|
+
|
248
|
+
# form parameters
|
249
|
+
form_params = opts[:form_params] || {}
|
250
|
+
|
251
|
+
# http body (model)
|
252
|
+
post_body = opts[:body]
|
253
|
+
|
254
|
+
# return_type
|
255
|
+
return_type = opts[:return_type] || 'MigrationPlan'
|
256
|
+
|
257
|
+
# auth_names
|
258
|
+
auth_names = opts[:auth_names] || ['Basic']
|
259
|
+
|
260
|
+
new_options = opts.merge(
|
261
|
+
:header_params => header_params,
|
262
|
+
:query_params => query_params,
|
263
|
+
:form_params => form_params,
|
264
|
+
:body => post_body,
|
265
|
+
:auth_names => auth_names,
|
266
|
+
:return_type => return_type
|
267
|
+
)
|
268
|
+
|
269
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
270
|
+
if @api_client.config.debugging
|
271
|
+
@api_client.config.logger.debug "API called: MigrationPlansApi#read\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
272
|
+
end
|
273
|
+
return data, status_code, headers
|
274
|
+
end
|
275
|
+
|
276
|
+
# Run migration plan
|
277
|
+
# Trigger an asynchronous task to run a migration from Pulp 2.
|
278
|
+
# @param migration_plan_href [String] URI of Migration Plan. e.g.: /pulp/api/v3/migration-plans/1/
|
279
|
+
# @param data [MigrationPlanRun]
|
280
|
+
# @param [Hash] opts the optional parameters
|
281
|
+
# @return [AsyncOperationResponse]
|
282
|
+
def run(migration_plan_href, data, opts = {})
|
283
|
+
data, _status_code, _headers = run_with_http_info(migration_plan_href, data, opts)
|
284
|
+
data
|
285
|
+
end
|
286
|
+
|
287
|
+
# Run migration plan
|
288
|
+
# Trigger an asynchronous task to run a migration from Pulp 2.
|
289
|
+
# @param migration_plan_href [String] URI of Migration Plan. e.g.: /pulp/api/v3/migration-plans/1/
|
290
|
+
# @param data [MigrationPlanRun]
|
291
|
+
# @param [Hash] opts the optional parameters
|
292
|
+
# @return [Array<(AsyncOperationResponse, Integer, Hash)>] AsyncOperationResponse data, response status code and response headers
|
293
|
+
def run_with_http_info(migration_plan_href, data, opts = {})
|
294
|
+
if @api_client.config.debugging
|
295
|
+
@api_client.config.logger.debug 'Calling API: MigrationPlansApi.run ...'
|
296
|
+
end
|
297
|
+
# verify the required parameter 'migration_plan_href' is set
|
298
|
+
if @api_client.config.client_side_validation && migration_plan_href.nil?
|
299
|
+
fail ArgumentError, "Missing the required parameter 'migration_plan_href' when calling MigrationPlansApi.run"
|
300
|
+
end
|
301
|
+
# verify the required parameter 'data' is set
|
302
|
+
if @api_client.config.client_side_validation && data.nil?
|
303
|
+
fail ArgumentError, "Missing the required parameter 'data' when calling MigrationPlansApi.run"
|
304
|
+
end
|
305
|
+
# resource path
|
306
|
+
local_var_path = '{migration_plan_href}run/'.sub('{' + 'migration_plan_href' + '}', CGI.escape(migration_plan_href.to_s).gsub('%2F', '/'))
|
307
|
+
|
308
|
+
# query parameters
|
309
|
+
query_params = opts[:query_params] || {}
|
310
|
+
|
311
|
+
# header parameters
|
312
|
+
header_params = opts[:header_params] || {}
|
313
|
+
# HTTP header 'Accept' (if needed)
|
314
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
315
|
+
# HTTP header 'Content-Type'
|
316
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
317
|
+
|
318
|
+
# form parameters
|
319
|
+
form_params = opts[:form_params] || {}
|
320
|
+
|
321
|
+
# http body (model)
|
322
|
+
post_body = opts[:body] || @api_client.object_to_http_body(data)
|
323
|
+
|
324
|
+
# return_type
|
325
|
+
return_type = opts[:return_type] || 'AsyncOperationResponse'
|
326
|
+
|
327
|
+
# auth_names
|
328
|
+
auth_names = opts[:auth_names] || ['Basic']
|
329
|
+
|
330
|
+
new_options = opts.merge(
|
331
|
+
:header_params => header_params,
|
332
|
+
:query_params => query_params,
|
333
|
+
:form_params => form_params,
|
334
|
+
:body => post_body,
|
335
|
+
:auth_names => auth_names,
|
336
|
+
:return_type => return_type
|
337
|
+
)
|
338
|
+
|
339
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
340
|
+
if @api_client.config.debugging
|
341
|
+
@api_client.config.logger.debug "API called: MigrationPlansApi#run\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
342
|
+
end
|
343
|
+
return data, status_code, headers
|
344
|
+
end
|
345
|
+
end
|
346
|
+
end
|