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_create/create.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:54 GMT
28
      - Tue, 14 Nov 2017 20:18:49 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": "57238b4eaca4886d97990603"}, "id": "integration_test_consumer",
43
        "_id": {"$oid": "5a0b4fa970be6f049ca06fcd"}, "id": "integration_test_consumer",
40 44
        "_href": "/pulp/api/v2/consumers/integration_test_consumer/"}, "certificate":
41
        "-----BEGIN RSA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----"}'
44 48
    http_version: 
45
  recorded_at: Fri, 29 Apr 2016 16:26:54 GMT
49
  recorded_at: Tue, 14 Nov 2017 20:18:49 GMT
46 50
- request:
47 51
    method: delete
48
    uri: https://admin:HeQSzZgm6ZEKG8aHrJEGW7aGD85Wrj57@runcible.example.com/pulp/api/v2/consumers/integration_test_consumer/
52
    uri: https://admin:admin@obelix.example.com/pulp/api/v2/consumers/integration_test_consumer/
49 53
    body:
50 54
      encoding: US-ASCII
51 55
      string: ''
......
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
      User-Agent:
60
      - Ruby
65
      Host:
66
      - obelix.example.com
61 67
  response:
62 68
    status:
63 69
      code: 200
64 70
      message: OK
65 71
    headers:
66 72
      Date:
67
      - Fri, 29 Apr 2016 16:26:54 GMT
73
      - Tue, 14 Nov 2017 20:18:49 GMT
68 74
      Server:
69 75
      - Apache/2.4.6 (CentOS)
70 76
      Content-Length:
71 77
      - '4'
78
      Connection:
79
      - close
72 80
      Content-Type:
73 81
      - application/json; charset=utf-8
74 82
    body:
75 83
      encoding: UTF-8
76 84
      string: 'null'
77 85
    http_version: 
78
  recorded_at: Fri, 29 Apr 2016 16:26:54 GMT
79
recorded_with: VCR 3.0.1
86
  recorded_at: Tue, 14 Nov 2017 20:18:49 GMT
87
recorded_with: VCR 3.0.3

Also available in: Unified diff