Project

General

Profile

Revision df1b6e2a

Added by Partha Aji about 5 years ago

Fixes #21661 - Retrieve All for consumers

This commit adds a couple of methods to retrieve all consumers in one
go.

View differences:

test/fixtures/vcr_cassettes/resources/consumer_bindings/bind.yml
2 2
http_interactions:
3 3
- request:
4 4
    method: get
5
    uri: https://admin:HeQSzZgm6ZEKG8aHrJEGW7aGD85Wrj57@runcible.example.com/pulp/api/v2/repositories/integration_test_id/?details=true
5
    uri: https://admin:admin@obelix.example.com/pulp/api/v2/repositories/integration_test_id/?details=true
6 6
    body:
7 7
      encoding: US-ASCII
8 8
      string: ''
......
11 11
      - application/json
12 12
      Accept-Encoding:
13 13
      - gzip, deflate
14
      User-Agent:
15
      - rest-client/2.0.2 (linux-gnu x86_64) ruby/2.2.4p230
14 16
      Content-Type:
15 17
      - application/json
16
      User-Agent:
17
      - Ruby
18
      Host:
19
      - obelix.example.com
18 20
  response:
19 21
    status:
20 22
      code: 200
21 23
      message: OK
22 24
    headers:
23 25
      Date:
24
      - Fri, 29 Apr 2016 16:26:52 GMT
26
      - Tue, 14 Nov 2017 20:18:47 GMT
25 27
      Server:
26 28
      - Apache/2.4.6 (CentOS)
27 29
      Vary:
28 30
      - Accept-Encoding
29 31
      Content-Length:
30
      - '1310'
32
      - '1438'
33
      Connection:
34
      - close
31 35
      Content-Type:
32 36
      - application/json; charset=utf-8
33 37
    body:
34 38
      encoding: ASCII-8BIT
35 39
      string: '{"scratchpad": {"checksum_type": "sha256"}, "display_name": "integration_test_id",
36
        "description": null, "distributors": [{"repo_id": "integration_test_id", "_href":
37
        "/pulp/api/v2/repositories/integration_test_id/distributors/yum_dist/", "_ns":
38
        "repo_distributors", "last_publish": null, "distributor_type_id": "yum_distributor",
39
        "auto_publish": false, "scratchpad": {}, "_id": {"$oid": "57238b4aaca4886d979905fc"},
40
        "config": {"http": true, "https": true, "relative_url": "path"}, "id": "yum_dist"}],
41
        "last_unit_added": null, "notes": {}, "last_unit_removed": null, "content_unit_counts":
42
        {"package_group": 2, "distribution": 1, "package_category": 1, "rpm": 8, "erratum":
43
        2}, "_ns": "repos", "importers": [{"scratchpad": {"repomd_revision": 1321893800,
44
        "previous_skip_list": []}, "_href": "/pulp/api/v2/repositories/integration_test_id/importers/yum_importer/",
45
        "_ns": "repo_importers", "importer_type_id": "yum_importer", "last_sync":
46
        "2016-04-29T16:26:51Z", "repo_id": "integration_test_id", "_id": {"$oid":
47
        "57238b4aaca4886d979905fb"}, "config": {"feed": "file:///var/www/repositories/zoo5"},
48
        "id": "yum_importer"}], "locally_stored_units": 14, "_id": {"$oid": "57238b4aaca4886d979905fa"},
49
        "total_repository_units": 14, "id": "integration_test_id", "_href": "/pulp/api/v2/repositories/integration_test_id/"}'
40
        "description": null, "distributors": [{"repo_id": "integration_test_id", "last_updated":
41
        "2017-11-14T20:18:42Z", "_href": "/pulp/api/v2/repositories/integration_test_id/distributors/yum_dist/",
42
        "last_override_config": {}, "last_publish": null, "distributor_type_id": "yum_distributor",
43
        "auto_publish": false, "scratchpad": {}, "_ns": "repo_distributors", "_id":
44
        {"$oid": "5a0b4fa270be6f049ca06fca"}, "config": {"http": true, "https": true,
45
        "relative_url": "path"}, "id": "yum_dist"}], "last_unit_added": "2017-11-14T20:18:47Z",
46
        "notes": {}, "last_unit_removed": null, "content_unit_counts": {"package_group":
47
        2, "distribution": 1, "package_category": 1, "rpm": 8, "erratum": 2}, "_ns":
48
        "repos", "importers": [{"repo_id": "integration_test_id", "last_updated":
49
        "2017-11-14T20:18:42Z", "_href": "/pulp/api/v2/repositories/integration_test_id/importers/yum_importer/",
50
        "_ns": "repo_importers", "importer_type_id": "yum_importer", "last_override_config":
51
        {}, "last_sync": "2017-11-14T20:18:47Z", "scratchpad": {"repomd_revision":
52
        1321893800}, "_id": {"$oid": "5a0b4fa270be6f049ca06fc9"}, "config": {"feed":
53
        "file:///var/www/repositories/zoo5"}, "id": "yum_importer"}], "locally_stored_units":
54
        14, "_id": {"$oid": "5a0b4fa270be6f049ca06fc8"}, "total_repository_units":
55
        14, "id": "integration_test_id", "_href": "/pulp/api/v2/repositories/integration_test_id/"}'
50 56
    http_version: 
51
  recorded_at: Fri, 29 Apr 2016 16:26:53 GMT
57
  recorded_at: Tue, 14 Nov 2017 20:18:47 GMT
52 58
- request:
53 59
    method: post
54
    uri: https://admin:HeQSzZgm6ZEKG8aHrJEGW7aGD85Wrj57@runcible.example.com/pulp/api/v2/consumers/integration_test_consumer_support/bindings//
60
    uri: https://admin:admin@obelix.example.com/pulp/api/v2/consumers/integration_test_consumer_support/bindings//
55 61
    body:
56 62
      encoding: UTF-8
57 63
      string: '{"repo_id":"integration_test_id","distributor_id":"yum_dist","notify_agent":false}'
......
60 66
      - application/json
61 67
      Accept-Encoding:
62 68
      - gzip, deflate
69
      User-Agent:
70
      - rest-client/2.0.2 (linux-gnu x86_64) ruby/2.2.4p230
63 71
      Content-Type:
64 72
      - application/json
65 73
      Content-Length:
66 74
      - '82'
67
      User-Agent:
68
      - Ruby
75
      Host:
76
      - obelix.example.com
69 77
  response:
70 78
    status:
71 79
      code: 200
72 80
      message: OK
73 81
    headers:
74 82
      Date:
75
      - Fri, 29 Apr 2016 16:26:53 GMT
83
      - Tue, 14 Nov 2017 20:18:47 GMT
76 84
      Server:
77 85
      - Apache/2.4.6 (CentOS)
78 86
      Vary:
79 87
      - Accept-Encoding
80 88
      Content-Length:
81 89
      - '358'
90
      Connection:
91
      - close
82 92
      Content-Type:
83 93
      - application/json; charset=utf-8
84 94
    body:
......
86 96
      string: '{"spawned_tasks": [], "result": {"notify_agent": false, "repo_id":
87 97
        "integration_test_id", "deleted": false, "_ns": "consumer_bindings", "distributor_id":
88 98
        "yum_dist", "consumer_id": "integration_test_consumer_support", "consumer_actions":
89
        [], "binding_config": {}, "_id": {"$oid": "57238b4daca4886d979905ff"}, "id":
90
        "57238b4daca4886d979905ff"}, "error": null}'
99
        [], "binding_config": {}, "_id": {"$oid": "5a0b4fa770be6f049ee2a554"}, "id":
100
        "5a0b4fa770be6f049ee2a554"}, "error": null}'
91 101
    http_version: 
92
  recorded_at: Fri, 29 Apr 2016 16:26:53 GMT
93
recorded_with: VCR 3.0.1
102
  recorded_at: Tue, 14 Nov 2017 20:18:47 GMT
103
recorded_with: VCR 3.0.3

Also available in: Unified diff