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/general_methods/retrieve.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:16 GMT
28
      - Tue, 14 Nov 2017 20:18:56 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": "57238b64aca4886d952eeb07"}, "id": "integration_test_consumer",
43
        "_id": {"$oid": "5a0b4fb070be6f049ee2a564"}, "id": "integration_test_consumer",
40 44
        "_href": "/pulp/api/v2/consumers/integration_test_consumer/"}, "certificate":
41
        "-----BEGIN R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 48
    http_version: 
45
  recorded_at: Fri, 29 Apr 2016 16:27:16 GMT
49
  recorded_at: Tue, 14 Nov 2017 20:18:56 GMT
46 50
- request:
47 51
    method: get
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:27:16 GMT
73
      - Tue, 14 Nov 2017 20:18:56 GMT
68 74
      Server:
69 75
      - Apache/2.4.6 (CentOS)
70 76
      Vary:
71 77
      - Accept-Encoding
72 78
      Content-Length:
73 79
      - '278'
80
      Connection:
81
      - close
74 82
      Content-Type:
75 83
      - application/json; charset=utf-8
76 84
    body:
77 85
      encoding: ASCII-8BIT
78 86
      string: '{"display_name": "integration_test_consumer", "description": null,
79 87
        "_ns": "consumers", "notes": {}, "rsa_pub": null, "capabilities": {}, "_id":
80
        {"$oid": "57238b64aca4886d952eeb07"}, "id": "integration_test_consumer", "_href":
88
        {"$oid": "5a0b4fb070be6f049ee2a564"}, "id": "integration_test_consumer", "_href":
81 89
        "/pulp/api/v2/consumers/integration_test_consumer/"}'
82 90
    http_version: 
83
  recorded_at: Fri, 29 Apr 2016 16:27:16 GMT
91
  recorded_at: Tue, 14 Nov 2017 20:18:56 GMT
84 92
- request:
85 93
    method: delete
86
    uri: https://admin:HeQSzZgm6ZEKG8aHrJEGW7aGD85Wrj57@runcible.example.com/pulp/api/v2/consumers/integration_test_consumer/
94
    uri: https://admin:admin@obelix.example.com/pulp/api/v2/consumers/integration_test_consumer/
87 95
    body:
88 96
      encoding: US-ASCII
89 97
      string: ''
......
92 100
      - application/json
93 101
      Accept-Encoding:
94 102
      - gzip, deflate
103
      User-Agent:
104
      - rest-client/2.0.2 (linux-gnu x86_64) ruby/2.2.4p230
95 105
      Content-Type:
96 106
      - application/json
97
      User-Agent:
98
      - Ruby
107
      Host:
108
      - obelix.example.com
99 109
  response:
100 110
    status:
101 111
      code: 200
102 112
      message: OK
103 113
    headers:
104 114
      Date:
105
      - Fri, 29 Apr 2016 16:27:16 GMT
115
      - Tue, 14 Nov 2017 20:18:56 GMT
106 116
      Server:
107 117
      - Apache/2.4.6 (CentOS)
108 118
      Content-Length:
109 119
      - '4'
120
      Connection:
121
      - close
110 122
      Content-Type:
111 123
      - application/json; charset=utf-8
112 124
    body:
113 125
      encoding: UTF-8
114 126
      string: 'null'
115 127
    http_version: 
116
  recorded_at: Fri, 29 Apr 2016 16:27:16 GMT
117
recorded_with: VCR 3.0.1
128
  recorded_at: Tue, 14 Nov 2017 20:18:57 GMT
129
recorded_with: VCR 3.0.3

Also available in: Unified diff