Skip to content

Commit

Permalink
update apidoc for katello 3.14 (#660)
Browse files Browse the repository at this point in the history
* update apidoc for katello 3.14

* Add size parameter to upload

Fixes: #659

* re-record activation_key fixtures for katello 3.14
  • Loading branch information
evgeni authored and Matthias Dellweg committed Dec 12, 2019
1 parent 4ab1fbe commit c2248eb
Show file tree
Hide file tree
Showing 41 changed files with 2,125 additions and 2,001 deletions.
7 changes: 5 additions & 2 deletions plugins/modules/katello_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,15 +179,18 @@ def main():

if not content_unit:
if not module.check_mode:
content_upload = module.resource_action('content_uploads', 'create', repository_scope)
size = os.stat(entity_dict['src']).st_size
content_upload_payload = {'size': size}
content_upload_payload.update(repository_scope)
content_upload = module.resource_action('content_uploads', 'create', content_upload_payload)
content_upload_scope = {'id': content_upload['upload_id']}
content_upload_scope.update(repository_scope)

offset = 0

with open(entity_dict['src'], 'rb') as contentfile:
for chunk in iter(lambda: contentfile.read(CONTENT_CHUNK_SIZE), b""):
data = {'content': chunk, 'offset': offset}
data = {'content': chunk, 'offset': offset, 'size': len(chunk)}
module.resource_action('content_uploads', 'update', params=content_upload_scope, data=data)

offset += len(chunk)
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/apidoc/katello.json

Large diffs are not rendered by default.

66 changes: 33 additions & 33 deletions tests/test_playbooks/fixtures/activation_key-0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ interactions:
User-Agent:
- apypie (https://github.com/Apipie/apypie)
method: GET
uri: https://centos7-katello-3-13.yatsu.example.com/api/status
uri: https://centos7-katello-3-14.yatsu.example.com/api/status
response:
body:
string: '{"result":"ok","status":200,"version":"1.23.1","api_version":2}'
string: '{"result":"ok","status":200,"version":"1.24.0","api_version":2}'
headers:
Cache-Control:
- max-age=0, private, must-revalidate
Expand All @@ -29,23 +29,23 @@ interactions:
Content-Type:
- application/json; charset=utf-8
Date:
- Wed, 04 Dec 2019 13:46:09 GMT
- Thu, 12 Dec 2019 15:13:48 GMT
ETag:
- W/"f26fab35869f9a602399f2f56dc6b2ef"
- W/"53b0d6d0bf9fce118840f03bbd316797"
Foreman_api_version:
- '2'
Foreman_current_location:
- ; ANY
Foreman_current_organization:
- ; ANY
Foreman_version:
- 1.23.1
- 1.24.0
Keep-Alive:
- timeout=5, max=10000
Server:
- Apache
Set-Cookie:
- _session_id=f8e47e5c777f0c9c876fce36e3ad0210; path=/; secure; HttpOnly; SameSite=Lax
- _session_id=a07b1f87e6d6baf732c7a9828b3f6145; path=/; secure; HttpOnly; SameSite=Lax
Status:
- 200 OK
Strict-Transport-Security:
Expand All @@ -61,9 +61,9 @@ interactions:
X-Powered-By:
- Phusion Passenger 4.0.53
X-Request-Id:
- 65c71b77-3afe-4266-957c-ea85c9607984
- ac55174c-8cd7-4308-9dd3-6a814347f413
X-Runtime:
- '0.044810'
- '0.086086'
X-XSS-Protection:
- 1; mode=block
status:
Expand All @@ -79,18 +79,18 @@ interactions:
Connection:
- keep-alive
Cookie:
- _session_id=f8e47e5c777f0c9c876fce36e3ad0210
- _session_id=a07b1f87e6d6baf732c7a9828b3f6145
User-Agent:
- apypie (https://github.com/Apipie/apypie)
method: GET
uri: https://centos7-katello-3-13.yatsu.example.com/katello/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296
uri: https://centos7-katello-3-14.yatsu.example.com/katello/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296
response:
body:
string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\
: 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\
: {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\"\
:\"Test_Organization\",\"created_at\":\"2019-12-04 13:45:58 UTC\",\"updated_at\"\
:\"2019-12-04 13:45:58 UTC\",\"id\":3,\"name\":\"Test Organization\",\"title\"\
:\"Test_Organization\",\"created_at\":\"2019-12-12 15:13:35 UTC\",\"updated_at\"\
:\"2019-12-12 15:13:35 UTC\",\"id\":3,\"name\":\"Test Organization\",\"title\"\
:\"Test Organization\",\"description\":\"A test organization\"}]\n}\n"
headers:
Cache-Control:
Expand All @@ -104,17 +104,17 @@ interactions:
Content-Type:
- application/json; charset=utf-8
Date:
- Wed, 04 Dec 2019 13:46:09 GMT
- Thu, 12 Dec 2019 15:13:48 GMT
ETag:
- W/"481cd5f74c94ea17fc14bdd94140cb15-gzip"
- W/"8163b611dd00b4069fdd125dbb79385f-gzip"
Foreman_api_version:
- '2'
Foreman_current_location:
- ; ANY
Foreman_current_organization:
- ; ANY
Foreman_version:
- 1.23.1
- 1.24.0
Keep-Alive:
- timeout=5, max=9999
Server:
Expand All @@ -136,9 +136,9 @@ interactions:
X-Powered-By:
- Phusion Passenger 4.0.53
X-Request-Id:
- 6d726b13-2bf4-4b0e-ade0-a321db1b9ec3
- f7969669-d262-49b9-b914-d550e36eb80c
X-Runtime:
- '0.019829'
- '0.025024'
X-XSS-Protection:
- 1; mode=block
content-length:
Expand All @@ -156,11 +156,11 @@ interactions:
Connection:
- keep-alive
Cookie:
- _session_id=f8e47e5c777f0c9c876fce36e3ad0210
- _session_id=a07b1f87e6d6baf732c7a9828b3f6145
User-Agent:
- apypie (https://github.com/Apipie/apypie)
method: GET
uri: https://centos7-katello-3-13.yatsu.example.com/katello/api/organizations/3/activation_keys?search=name%3D%22Test+Activation+Key%22&per_page=4294967296
uri: https://centos7-katello-3-14.yatsu.example.com/katello/api/organizations/3/activation_keys?search=name%3D%22Test+Activation+Key%22&per_page=4294967296
response:
body:
string: '{"total":0,"subtotal":0,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Test
Expand All @@ -179,7 +179,7 @@ interactions:
Content-Type:
- application/json; charset=utf-8
Date:
- Wed, 04 Dec 2019 13:46:09 GMT
- Thu, 12 Dec 2019 15:13:48 GMT
ETag:
- W/"654689cec84b94eec4bd8af1e8960bb6-gzip"
Foreman_api_version:
Expand All @@ -189,7 +189,7 @@ interactions:
Foreman_current_organization:
- ; ANY
Foreman_version:
- 1.23.1
- 1.24.0
Keep-Alive:
- timeout=5, max=9998
Server:
Expand All @@ -211,9 +211,9 @@ interactions:
X-Powered-By:
- Phusion Passenger 4.0.53
X-Request-Id:
- fac8ce0e-8f3c-4d66-b43e-a33e74912147
- 5fc22b66-9bd4-4f2c-b912-454133c0751e
X-Runtime:
- '0.018399'
- '0.023264'
X-XSS-Protection:
- 1; mode=block
content-length:
Expand All @@ -235,17 +235,17 @@ interactions:
Content-Type:
- application/json
Cookie:
- _session_id=f8e47e5c777f0c9c876fce36e3ad0210
- _session_id=a07b1f87e6d6baf732c7a9828b3f6145
User-Agent:
- apypie (https://github.com/Apipie/apypie)
method: POST
uri: https://centos7-katello-3-13.yatsu.example.com/katello/api/activation_keys
uri: https://centos7-katello-3-14.yatsu.example.com/katello/api/activation_keys
response:
body:
string: ' {"service_level":null,"content_overrides":[],"id":1,"name":"Test
Activation Key","description":null,"unlimited_hosts":true,"auto_attach":true,"content_view_id":null,"environment_id":null,"usage_count":0,"user_id":4,"max_hosts":null,"release_version":null,"purpose_usage":null,"purpose_role":null,"organization_id":3,"organization":{"name":"Test
Organization","label":"Test_Organization","id":3},"created_at":"2019-12-04
13:46:09 UTC","updated_at":"2019-12-04 13:46:11 UTC","content_view":null,"environment":null,"products":[],"host_collections":[],"purpose_addons":[],"permissions":{"view_activation_keys":true,"edit_activation_keys":true,"destroy_activation_keys":true}}
Activation Key","description":null,"unlimited_hosts":true,"auto_attach":null,"content_view_id":null,"environment_id":null,"usage_count":0,"user_id":4,"max_hosts":null,"release_version":null,"purpose_usage":null,"purpose_role":null,"organization_id":3,"organization":{"name":"Test
Organization","label":"Test_Organization","id":3},"created_at":"2019-12-12
15:13:49 UTC","updated_at":"2019-12-12 15:13:49 UTC","content_view":null,"environment":null,"products":[],"host_collections":[],"purpose_addons":[],"permissions":{"view_activation_keys":true,"edit_activation_keys":true,"destroy_activation_keys":true}}
'
headers:
Expand All @@ -260,17 +260,17 @@ interactions:
Content-Type:
- application/json; charset=utf-8
Date:
- Wed, 04 Dec 2019 13:46:09 GMT
- Thu, 12 Dec 2019 15:13:48 GMT
ETag:
- W/"721387585ba418f1955642bbef0bbb8b-gzip"
- W/"1bd3877810664d49341971952ace5567-gzip"
Foreman_api_version:
- '2'
Foreman_current_location:
- ; ANY
Foreman_current_organization:
- ; ANY
Foreman_version:
- 1.23.1
- 1.24.0
Keep-Alive:
- timeout=5, max=9997
Server:
Expand All @@ -294,9 +294,9 @@ interactions:
X-Powered-By:
- Phusion Passenger 4.0.53
X-Request-Id:
- f421c1db-51d7-4441-ac61-880067680cf6
- 0f026b48-c869-4b86-af0e-c1515066e93b
X-Runtime:
- '1.568567'
- '0.682141'
X-XSS-Protection:
- 1; mode=block
content-length:
Expand Down
Loading

0 comments on commit c2248eb

Please sign in to comment.