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_applicability/applicability.yml
2 2
http_interactions:
3 3
- request:
4 4
    method: post
5
    uri: https://admin:HeQSzZgm6ZEKG8aHrJEGW7aGD85Wrj57@runcible.example.com/pulp/api/v2/consumers/
5
    uri: https://admin:admin@obelix.example.com/pulp/api/v2/consumers/
6 6
    body:
7 7
      encoding: UTF-8
8 8
      string: '{"id":"integration_test_consumer","name":"boo"}'
......
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 18
      Content-Length:
17 19
      - '47'
18
      User-Agent:
19
      - Ruby
20
      Host:
21
      - obelix.example.com
20 22
  response:
21 23
    status:
22 24
      code: 201
23 25
      message: CREATED
24 26
    headers:
25 27
      Date:
26
      - Fri, 29 Apr 2016 16:26:47 GMT
28
      - Tue, 14 Nov 2017 20:18:40 GMT
27 29
      Server:
28 30
      - Apache/2.4.6 (CentOS)
29 31
      Content-Length:
30
      - '2481'
32
      - '2497'
31 33
      Location:
32
      - https://runcible.example.com/pulp/api/v2/consumers/integration_test_consumer/
34
      - https://obelix.example.com/pulp/api/v2/consumers/integration_test_consumer/
35
      Connection:
36
      - close
33 37
      Content-Type:
34 38
      - application/json; charset=utf-8
35 39
    body:
36 40
      encoding: UTF-8
37 41
      string: '{"consumer": {"display_name": "integration_test_consumer", "description":
38 42
        null, "_ns": "consumers", "notes": {}, "rsa_pub": null, "capabilities": {},
39
        "_id": {"$oid": "57238b47aca4886d952eeacc"}, "id": "integration_test_consumer",
43
        "_id": {"$oid": "5a0b4fa070be6f049ca06fb8"}, "id": "integration_test_consumer",
40 44
        "_href": "/pulp/api/v2/consumers/integration_test_consumer/"}, "certificate":
41
        "-----BEG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1lcjEoMCYGCgmSJomT8ixkAQETGDVhMGI0ZmEwNzBiZTZmMDQ5\nY2EwNmZiODCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAzl4FMW7nYGzsLTH0\nKfrXFVpZqSujIvBZXku2rkp3KGFnBLO9FykxU/m43Vk8DVUVCrta26HRhqey2iGo\npyLs8xt9nDF8gD946H60FDv17A9MSHYSWAF2pwZUAzkE5+obv1a5TI4+pOLk4lWE\n5OhJxyy7TceuRx83pEh58pfdBP8CAwEAATANBgkqhkiG9w0BAQUFAAOCAgEAP8c3\nUg7qu29N09yVVQ0dUann78YjSGrmk1L34YgNiq+p3ZD5laDSAtUQt7WW75+M97V5\nRdVuHyc6SfV4t29rVJF6XRi4wGAm0ZlYXNRxZpnZY+pQYYGWvN9NuhAuO81NqFB6\nW2iqDHF/Lt557qbCESwaXhgYEFDYQ7nMP7l2m8WrHEKz5inPi62VDZ1piEF9OR+H\noxHGrbggb7KOQdHQsxNupk1j/6qmhGdPLalWvV2ygQyokYGD+191HEpaxE/zJ7q8\nUPs6Y9CEEn3BRFPER619oiJqsRpcsOioHXzm3gomhoDbY9YJlZL63wmzDWWdnbOl\nPud6U9dh0hZbxdJPIrx+PskEtLOh0waFoGLw85MqMzb39n2ZbGdVrbArOk49OH3t\newuauyPH3FcRP2fLFOiYXTak0tQycN+86yVNKFj7YpuKyvn9qrrLS5v8uF9qli6v\nv5vWzovGcVWzZA4+ExkPv/DTLFRki4OBjJ3INJ4TpSLwKkXJ5SRY/QW1OB+fvoqV\nl7eiY9EZ3syfI7YjnDY/dIvTa8oQwcT12F+56awkn50tyGmQpssPORLPSALiMVPi\nXCpRnfaX4RO3Ban9Pt8UdPROlwaBvOr0CP0f5ZxkrHtbX2dVgsSvTQIOkJ81nXdB\nUQTA/EpAwGEMLfsFurf+IQ/ByV+azp3Y1mwEQLE=\n-----END
43 47
        CERTIFICATE-----"}'
44 48
    http_version: 
45
  recorded_at: Fri, 29 Apr 2016 16:26:47 GMT
49
  recorded_at: Tue, 14 Nov 2017 20:18:40 GMT
46 50
- request:
47 51
    method: post
48
    uri: https://admin:HeQSzZgm6ZEKG8aHrJEGW7aGD85Wrj57@runcible.example.com/pulp/api/v2/consumers/content/applicability/
52
    uri: https://admin:admin@obelix.example.com/pulp/api/v2/consumers/content/applicability/
49 53
    body:
50 54
      encoding: UTF-8
51 55
      string: '{"criteria":{"filters":{"id":{"$in":["integration_test_consumer"]}}},"content_types":["erratum"]}'
......
54 58
      - application/json
55 59
      Accept-Encoding:
56 60
      - gzip, deflate
61
      User-Agent:
62
      - rest-client/2.0.2 (linux-gnu x86_64) ruby/2.2.4p230
57 63
      Content-Type:
58 64
      - application/json
59 65
      Content-Length:
60 66
      - '97'
61
      User-Agent:
62
      - Ruby
67
      Host:
68
      - obelix.example.com
63 69
  response:
64 70
    status:
65 71
      code: 200
66 72
      message: OK
67 73
    headers:
68 74
      Date:
69
      - Fri, 29 Apr 2016 16:26:47 GMT
75
      - Tue, 14 Nov 2017 20:18:40 GMT
70 76
      Server:
71 77
      - Apache/2.4.6 (CentOS)
72 78
      Content-Length:
73 79
      - '2'
80
      Connection:
81
      - close
74 82
      Content-Type:
75 83
      - application/json; charset=utf-8
76 84
    body:
77 85
      encoding: UTF-8
78 86
      string: "[]"
79 87
    http_version: 
80
  recorded_at: Fri, 29 Apr 2016 16:26:47 GMT
88
  recorded_at: Tue, 14 Nov 2017 20:18:40 GMT
81 89
- request:
82 90
    method: delete
83
    uri: https://admin:HeQSzZgm6ZEKG8aHrJEGW7aGD85Wrj57@runcible.example.com/pulp/api/v2/consumers/integration_test_consumer/
91
    uri: https://admin:admin@obelix.example.com/pulp/api/v2/consumers/integration_test_consumer/
84 92
    body:
85 93
      encoding: US-ASCII
86 94
      string: ''
......
89 97
      - application/json
90 98
      Accept-Encoding:
91 99
      - gzip, deflate
100
      User-Agent:
101
      - rest-client/2.0.2 (linux-gnu x86_64) ruby/2.2.4p230
92 102
      Content-Type:
93 103
      - application/json
94
      User-Agent:
95
      - Ruby
104
      Host:
105
      - obelix.example.com
96 106
  response:
97 107
    status:
98 108
      code: 200
99 109
      message: OK
100 110
    headers:
101 111
      Date:
102
      - Fri, 29 Apr 2016 16:26:47 GMT
112
      - Tue, 14 Nov 2017 20:18:40 GMT
103 113
      Server:
104 114
      - Apache/2.4.6 (CentOS)
105 115
      Content-Length:
106 116
      - '4'
117
      Connection:
118
      - close
107 119
      Content-Type:
108 120
      - application/json; charset=utf-8
109 121
    body:
110 122
      encoding: UTF-8
111 123
      string: 'null'
112 124
    http_version: 
113
  recorded_at: Fri, 29 Apr 2016 16:26:47 GMT
114
recorded_with: VCR 3.0.1
125
  recorded_at: Tue, 14 Nov 2017 20:18:40 GMT
126
recorded_with: VCR 3.0.3

Also available in: Unified diff