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/profiles/retrieve_profile.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:27:20 GMT
28
      - Tue, 14 Nov 2017 20:18:58 GMT
27 29
      Server:
28 30
      - Apache/2.4.6 (CentOS)
29 31
      Content-Length:
30
      - '2481'
32
      - '2501'
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": "57238b68aca4886d952eeb0c"}, "id": "integration_test_consumer",
43
        "_id": {"$oid": "5a0b4fb270be6f049ee2a570"}, "id": "integration_test_consumer",
40 44
        "_href": "/pulp/api/v2/consumers/integration_test_consumer/"}, "certificate":
41
        "-----BEG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_version: 
45
  recorded_at: Fri, 29 Apr 2016 16:27:20 GMT
49
  recorded_at: Tue, 14 Nov 2017 20:18:58 GMT
46 50
- request:
47 51
    method: post
48
    uri: https://admin:HeQSzZgm6ZEKG8aHrJEGW7aGD85Wrj57@runcible.example.com/pulp/api/v2/consumers/integration_test_consumer/profiles//
52
    uri: https://admin:admin@obelix.example.com/pulp/api/v2/consumers/integration_test_consumer/profiles//
49 53
    body:
50 54
      encoding: UTF-8
51 55
      string: '{"content_type":"rpm","profile":[{"vendor":"FedoraHosted","name":"elephant","version":"0.3","release":"0.8","arch":"noarch","epoch":"1"}]}'
......
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
      - '138'
61
      User-Agent:
62
      - Ruby
67
      Host:
68
      - obelix.example.com
63 69
  response:
64 70
    status:
65 71
      code: 201
66 72
      message: CREATED
67 73
    headers:
68 74
      Date:
69
      - Fri, 29 Apr 2016 16:27:20 GMT
75
      - Tue, 14 Nov 2017 20:18:58 GMT
70 76
      Server:
71 77
      - Apache/2.4.6 (CentOS)
72 78
      Content-Length:
73 79
      - '467'
74 80
      Location:
75
      - https://runcible.example.com/pulp/api/v2/consumers/integration_test_consumer/profiles/rpm/
81
      - https://obelix.example.com/pulp/api/v2/consumers/integration_test_consumer/profiles/rpm/
82
      Connection:
83
      - close
76 84
      Content-Type:
77 85
      - application/json; charset=utf-8
78 86
    body:
......
81 89
        "1", "version": "0.3", "release": "0.8", "arch": "noarch"}], "_href": "/pulp/api/v2/consumers/integration_test_consumer/profiles/rpm/",
82 90
        "_ns": "consumer_unit_profiles", "profile_hash": "d90bb3279565b158bdffa9db6f8f4cf1e6189a4bda6d3bbca1c353627d911302",
83 91
        "consumer_id": "integration_test_consumer", "content_type": "rpm", "_id":
84
        {"$oid": "57238b69aca4886d96d97f1a"}, "id": "57238b69aca4886d96d97f1a"}'
92
        {"$oid": "5a0b4fb270be6f049ca06fd9"}, "id": "5a0b4fb270be6f049ca06fd9"}'
85 93
    http_version: 
86
  recorded_at: Fri, 29 Apr 2016 16:27:21 GMT
94
  recorded_at: Tue, 14 Nov 2017 20:18:58 GMT
87 95
- request:
88 96
    method: get
89
    uri: https://admin:HeQSzZgm6ZEKG8aHrJEGW7aGD85Wrj57@runcible.example.com/pulp/api/v2/consumers/integration_test_consumer/profiles/rpm//
97
    uri: https://admin:admin@obelix.example.com/pulp/api/v2/consumers/integration_test_consumer/profiles/rpm//
90 98
    body:
91 99
      encoding: US-ASCII
92 100
      string: ''
......
95 103
      - application/json
96 104
      Accept-Encoding:
97 105
      - gzip, deflate
106
      User-Agent:
107
      - rest-client/2.0.2 (linux-gnu x86_64) ruby/2.2.4p230
98 108
      Content-Type:
99 109
      - application/json
100
      User-Agent:
101
      - Ruby
110
      Host:
111
      - obelix.example.com
102 112
  response:
103 113
    status:
104 114
      code: 200
105 115
      message: OK
106 116
    headers:
107 117
      Date:
108
      - Fri, 29 Apr 2016 16:27:21 GMT
118
      - Tue, 14 Nov 2017 20:18:58 GMT
109 119
      Server:
110 120
      - Apache/2.4.6 (CentOS)
111 121
      Vary:
112 122
      - Accept-Encoding
113 123
      Content-Length:
114 124
      - '467'
125
      Connection:
126
      - close
115 127
      Content-Type:
116 128
      - application/json; charset=utf-8
117 129
    body:
......
120 132
        "1", "version": "0.3", "release": "0.8", "arch": "noarch"}], "_href": "/pulp/api/v2/consumers/integration_test_consumer/profiles/rpm/",
121 133
        "_ns": "consumer_unit_profiles", "profile_hash": "d90bb3279565b158bdffa9db6f8f4cf1e6189a4bda6d3bbca1c353627d911302",
122 134
        "consumer_id": "integration_test_consumer", "content_type": "rpm", "_id":
123
        {"$oid": "57238b69aca4886d96d97f1a"}, "id": "57238b69aca4886d96d97f1a"}'
135
        {"$oid": "5a0b4fb270be6f049ca06fd9"}, "id": "5a0b4fb270be6f049ca06fd9"}'
124 136
    http_version: 
125
  recorded_at: Fri, 29 Apr 2016 16:27:21 GMT
137
  recorded_at: Tue, 14 Nov 2017 20:18:58 GMT
126 138
- request:
127 139
    method: delete
128
    uri: https://admin:HeQSzZgm6ZEKG8aHrJEGW7aGD85Wrj57@runcible.example.com/pulp/api/v2/consumers/integration_test_consumer/
140
    uri: https://admin:admin@obelix.example.com/pulp/api/v2/consumers/integration_test_consumer/
129 141
    body:
130 142
      encoding: US-ASCII
131 143
      string: ''
......
134 146
      - application/json
135 147
      Accept-Encoding:
136 148
      - gzip, deflate
149
      User-Agent:
150
      - rest-client/2.0.2 (linux-gnu x86_64) ruby/2.2.4p230
137 151
      Content-Type:
138 152
      - application/json
139
      User-Agent:
140
      - Ruby
153
      Host:
154
      - obelix.example.com
141 155
  response:
142 156
    status:
143 157
      code: 200
144 158
      message: OK
145 159
    headers:
146 160
      Date:
147
      - Fri, 29 Apr 2016 16:27:21 GMT
161
      - Tue, 14 Nov 2017 20:18:58 GMT
148 162
      Server:
149 163
      - Apache/2.4.6 (CentOS)
150 164
      Content-Length:
151 165
      - '4'
166
      Connection:
167
      - close
152 168
      Content-Type:
153 169
      - application/json; charset=utf-8
154 170
    body:
155 171
      encoding: UTF-8
156 172
      string: 'null'
157 173
    http_version: 
158
  recorded_at: Fri, 29 Apr 2016 16:27:21 GMT
159
recorded_with: VCR 3.0.1
174
  recorded_at: Tue, 14 Nov 2017 20:18:58 GMT
175
recorded_with: VCR 3.0.3

Also available in: Unified diff