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/generate_applicability.yml
1 1
---
2 2
http_interactions:
3 3
- request:
4
    method: get
5
    uri: https://admin:HeQSzZgm6ZEKG8aHrJEGW7aGD85Wrj57@runcible.example.com/pulp/api/v2/tasks/8313cf90-9119-42aa-a809-9340fc73911e/
6
    body:
7
      encoding: US-ASCII
8
      string: ''
9
    headers:
10
      Accept:
11
      - application/json
12
      Accept-Encoding:
13
      - gzip, deflate
14
      Content-Type:
15
      - application/json
16
      User-Agent:
17
      - Ruby
18
  response:
19
    status:
20
      code: 200
21
      message: OK
22
    headers:
23
      Date:
24
      - Fri, 29 Apr 2016 16:26:48 GMT
25
      Server:
26
      - Apache/2.4.6 (CentOS)
27
      Vary:
28
      - Accept-Encoding
29
      Content-Length:
30
      - '720'
31
      Content-Type:
32
      - application/json; charset=utf-8
33
    body:
34
      encoding: ASCII-8BIT
35
      string: '{"exception": null, "task_type": "pulp.server.managers.consumer.applicability.regenerate_applicability_for_consumers",
36
        "_href": "/pulp/api/v2/tasks/8313cf90-9119-42aa-a809-9340fc73911e/", "task_id":
37
        "8313cf90-9119-42aa-a809-9340fc73911e", "tags": ["pulp:action:content_applicability_regeneration"],
38
        "finish_time": "2016-04-29T16:26:48Z", "_ns": "task_status", "start_time":
39
        "2016-04-29T16:26:48Z", "traceback": null, "spawned_tasks": [], "progress_report":
40
        {}, "queue": "reserved_resource_worker-0@runcible.example.com.dq", "state":
41
        "finished", "worker_name": "reserved_resource_worker-0@runcible.example.com",
42
        "result": null, "error": null, "_id": {"$oid": "57238b48898f5c862fa3ebe6"},
43
        "id": "57238b48898f5c862fa3ebe6"}'
44
    http_version: 
45
  recorded_at: Fri, 29 Apr 2016 16:26:48 GMT
46
- request:
4 47
    method: post
5
    uri: https://admin:HeQSzZgm6ZEKG8aHrJEGW7aGD85Wrj57@runcible.example.com/pulp/api/v2/consumers/
48
    uri: https://admin:admin@obelix.example.com/pulp/api/v2/consumers/
6 49
    body:
7 50
      encoding: UTF-8
8 51
      string: '{"id":"integration_test_consumer","name":"boo"}'
......
11 54
      - application/json
12 55
      Accept-Encoding:
13 56
      - gzip, deflate
57
      User-Agent:
58
      - rest-client/2.0.2 (linux-gnu x86_64) ruby/2.2.4p230
14 59
      Content-Type:
15 60
      - application/json
16 61
      Content-Length:
17 62
      - '47'
18
      User-Agent:
19
      - Ruby
63
      Host:
64
      - obelix.example.com
20 65
  response:
21 66
    status:
22 67
      code: 201
23 68
      message: CREATED
24 69
    headers:
25 70
      Date:
26
      - Fri, 29 Apr 2016 16:26:47 GMT
71
      - Tue, 14 Nov 2017 20:18:40 GMT
27 72
      Server:
28 73
      - Apache/2.4.6 (CentOS)
29 74
      Content-Length:
30
      - '2481'
75
      - '2497'
31 76
      Location:
32
      - https://runcible.example.com/pulp/api/v2/consumers/integration_test_consumer/
77
      - https://obelix.example.com/pulp/api/v2/consumers/integration_test_consumer/
78
      Connection:
79
      - close
33 80
      Content-Type:
34 81
      - application/json; charset=utf-8
35 82
    body:
36 83
      encoding: UTF-8
37 84
      string: '{"consumer": {"display_name": "integration_test_consumer", "description":
38 85
        null, "_ns": "consumers", "notes": {}, "rsa_pub": null, "capabilities": {},
39
        "_id": {"$oid": "57238b48aca4886d952eead1"}, "id": "integration_test_consumer",
86
        "_id": {"$oid": "5a0b4fa070be6f049ca06fbc"}, "id": "integration_test_consumer",
40 87
        "_href": "/pulp/api/v2/consumers/integration_test_consumer/"}, "certificate":
41
        "-----BEGIN RSA PRIVATE KEY-----\nMIICXAIBAAKBgQCwOuu0csv8mTgYbKjG4Hq3ZNSxHRoovH/WmM2YFC+B5GI/biWe\n/bvy/vUrn4Is4t6KEE4vs8VM7Fp4EebZntF1eikL9cP8tNUnHrE/y2ykzjvMNKxj\ny1sjUPR4FIrTmxNyCm0H4hsvwkP8gx1fT9j7Ao+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UCt8aeYvQFrOvl0glTfo36aUQc\nVhYjJsqStA7B/q3yA4TDhKrPMy8FIJCkP8584ltWZGfaCEoPw+N3JrTLrWusKye8\n7wLkA+FvziPDVp2y6a/iHh083IECAwEAATANBgkqhkiG9w0BAQUFAAOCAgEAgxVQ\nLkFwhJpLK21yBC0IMT8R4u+CjLWefelGCo+Nqevrp+9nL+wyEI7KibjYIMBQ5/ez\n6Hybd9OfqwTCknEhk3B1kzI+6aQQ58LreIxfvVd2Izisgbrm7TWi3ntZTZPpVs/M\ny7N4knaUSt0XrteDDP/okcK/unrbdE92g+miD94RsLzy5KizPQTzkhmAsYb/o9Sd\n9MfNoqOpsF5CM7qEXVEVACBFHhe8vNY0xy1VPkpzroqsjouyuQ1fM9zwZM0GGGde\n9ZWwJEnS9SpwRdeQc1Cdx9BzwzYYtCmQZNH8/melb32UCP6BZZYMWjqSBAo3BDWq\n4r66vhWuv1WZMjtH3p7hfru+dKRgpLAyBLyOOUKS0WCaPKB/6d0/0OQXUpLJB22y\ni2BAQNF6ruAP6rIsq7mgmz+UmZur9EPlekgcrUw9Z2J6lgnGIdjnfO3O1chzaeHM\nmza57/ZyK6ynwROh9UcUPqm3YhxDWgaE0XYZqRyYvIxfQBaLMyltRN24WN9oTMY9\n0ivHuFqMleEYkiWqry3l0vsvehfeH6eSMuC8aadS4cRgpdSJeH/9+hyBI9KcRk6L\ngHEBYfpn2Gp2qGCi8kV8j01hZ2mdTSYS5Mlbd9/YhcHonnkNykgZx4gV2ySNpewA\nckvALW9cKT/PQcVbjJ6apNk2dPn99Ls5uMxVrmI=\n-----END
43 90
        CERTIFICATE-----"}'
44 91
    http_version: 
45
  recorded_at: Fri, 29 Apr 2016 16:26:48 GMT
92
  recorded_at: Tue, 14 Nov 2017 20:18:40 GMT
46 93
- request:
47 94
    method: post
48
    uri: https://admin:HeQSzZgm6ZEKG8aHrJEGW7aGD85Wrj57@runcible.example.com/pulp/api/v2/consumers/actions/content/regenerate_applicability//
95
    uri: https://admin:admin@obelix.example.com/pulp/api/v2/consumers/actions/content/regenerate_applicability//
49 96
    body:
50 97
      encoding: UTF-8
51 98
      string: '{"consumer_criteria":{"filters":{"id":{"$in":["integration_test_consumer"]}}}}'
......
54 101
      - application/json
55 102
      Accept-Encoding:
56 103
      - gzip, deflate
104
      User-Agent:
105
      - rest-client/2.0.2 (linux-gnu x86_64) ruby/2.2.4p230
57 106
      Content-Type:
58 107
      - application/json
59 108
      Content-Length:
60 109
      - '78'
61
      User-Agent:
62
      - Ruby
110
      Host:
111
      - obelix.example.com
63 112
  response:
64 113
    status:
65 114
      code: 202
66 115
      message: ACCEPTED
67 116
    headers:
68 117
      Date:
69
      - Fri, 29 Apr 2016 16:26:48 GMT
118
      - Tue, 14 Nov 2017 20:18:40 GMT
70 119
      Server:
71 120
      - Apache/2.4.6 (CentOS)
72 121
      Content-Length:
73 122
      - '172'
123
      Connection:
124
      - close
74 125
      Content-Type:
75 126
      - application/json; charset=utf-8
76 127
    body:
77 128
      encoding: UTF-8
78
      string: '{"spawned_tasks": [{"_href": "/pulp/api/v2/tasks/8313cf90-9119-42aa-a809-9340fc73911e/",
79
        "task_id": "8313cf90-9119-42aa-a809-9340fc73911e"}], "result": null, "error":
129
      string: '{"spawned_tasks": [{"_href": "/pulp/api/v2/tasks/9b9da808-df37-488e-8768-948893df08ae/",
130
        "task_id": "9b9da808-df37-488e-8768-948893df08ae"}], "result": null, "error":
80 131
        null}'
81 132
    http_version: 
82
  recorded_at: Fri, 29 Apr 2016 16:26:48 GMT
133
  recorded_at: Tue, 14 Nov 2017 20:18:40 GMT
83 134
- request:
84 135
    method: get
85
    uri: https://admin:HeQSzZgm6ZEKG8aHrJEGW7aGD85Wrj57@runcible.example.com/pulp/api/v2/tasks/8313cf90-9119-42aa-a809-9340fc73911e/
136
    uri: https://admin:admin@obelix.example.com/pulp/api/v2/tasks/9b9da808-df37-488e-8768-948893df08ae/
86 137
    body:
87 138
      encoding: US-ASCII
88 139
      string: ''
......
91 142
      - application/json
92 143
      Accept-Encoding:
93 144
      - gzip, deflate
145
      User-Agent:
146
      - rest-client/2.0.2 (linux-gnu x86_64) ruby/2.2.4p230
94 147
      Content-Type:
95 148
      - application/json
96
      User-Agent:
97
      - Ruby
149
      Host:
150
      - obelix.example.com
98 151
  response:
99 152
    status:
100 153
      code: 200
101 154
      message: OK
102 155
    headers:
103 156
      Date:
104
      - Fri, 29 Apr 2016 16:26:48 GMT
157
      - Tue, 14 Nov 2017 20:18:41 GMT
105 158
      Server:
106 159
      - Apache/2.4.6 (CentOS)
107 160
      Vary:
108 161
      - Accept-Encoding
109 162
      Content-Length:
110
      - '720'
163
      - '716'
164
      Connection:
165
      - close
111 166
      Content-Type:
112 167
      - application/json; charset=utf-8
113 168
    body:
114 169
      encoding: ASCII-8BIT
115 170
      string: '{"exception": null, "task_type": "pulp.server.managers.consumer.applicability.regenerate_applicability_for_consumers",
116
        "_href": "/pulp/api/v2/tasks/8313cf90-9119-42aa-a809-9340fc73911e/", "task_id":
117
        "8313cf90-9119-42aa-a809-9340fc73911e", "tags": ["pulp:action:content_applicability_regeneration"],
118
        "finish_time": "2016-04-29T16:26:48Z", "_ns": "task_status", "start_time":
119
        "2016-04-29T16:26:48Z", "traceback": null, "spawned_tasks": [], "progress_report":
120
        {}, "queue": "reserved_resource_worker-0@runcible.example.com.dq", "state":
121
        "finished", "worker_name": "reserved_resource_worker-0@runcible.example.com",
122
        "result": null, "error": null, "_id": {"$oid": "57238b48898f5c862fa3ebe6"},
123
        "id": "57238b48898f5c862fa3ebe6"}'
171
        "_href": "/pulp/api/v2/tasks/9b9da808-df37-488e-8768-948893df08ae/", "task_id":
172
        "9b9da808-df37-488e-8768-948893df08ae", "tags": ["pulp:action:content_applicability_regeneration"],
173
        "finish_time": "2017-11-14T20:18:40Z", "_ns": "task_status", "start_time":
174
        "2017-11-14T20:18:40Z", "traceback": null, "spawned_tasks": [], "progress_report":
175
        {}, "queue": "reserved_resource_worker-1@obelix.example.com.dq", "state":
176
        "finished", "worker_name": "reserved_resource_worker-1@obelix.example.com",
177
        "result": null, "error": null, "_id": {"$oid": "5a0b4fa01fbc3e9fdb584dfc"},
178
        "id": "5a0b4fa01fbc3e9fdb584dfc"}'
124 179
    http_version: 
125
  recorded_at: Fri, 29 Apr 2016 16:26:48 GMT
180
  recorded_at: Tue, 14 Nov 2017 20:18:41 GMT
126 181
- request:
127 182
    method: delete
128
    uri: https://admin:HeQSzZgm6ZEKG8aHrJEGW7aGD85Wrj57@runcible.example.com/pulp/api/v2/consumers/integration_test_consumer/
183
    uri: https://admin:admin@obelix.example.com/pulp/api/v2/consumers/integration_test_consumer/
129 184
    body:
130 185
      encoding: US-ASCII
131 186
      string: ''
......
134 189
      - application/json
135 190
      Accept-Encoding:
136 191
      - gzip, deflate
192
      User-Agent:
193
      - rest-client/2.0.2 (linux-gnu x86_64) ruby/2.2.4p230
137 194
      Content-Type:
138 195
      - application/json
139
      User-Agent:
140
      - Ruby
196
      Host:
197
      - obelix.example.com
141 198
  response:
142 199
    status:
143 200
      code: 200
144 201
      message: OK
145 202
    headers:
146 203
      Date:
147
      - Fri, 29 Apr 2016 16:26:49 GMT
204
      - Tue, 14 Nov 2017 20:18:41 GMT
148 205
      Server:
149 206
      - Apache/2.4.6 (CentOS)
150 207
      Content-Length:
151 208
      - '4'
209
      Connection:
210
      - close
152 211
      Content-Type:
153 212
      - application/json; charset=utf-8
154 213
    body:
155 214
      encoding: UTF-8
156 215
      string: 'null'
157 216
    http_version: 
158
  recorded_at: Fri, 29 Apr 2016 16:26:49 GMT
159
recorded_with: VCR 3.0.1
217
  recorded_at: Tue, 14 Nov 2017 20:18:41 GMT
218
recorded_with: VCR 3.0.3

Also available in: Unified diff