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/update.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:15 GMT
28
      - Tue, 14 Nov 2017 20:18:57 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": "57238b63aca4886d952eeaff"}, "id": "integration_test_consumer",
43
        "_id": {"$oid": "5a0b4fb170be6f049d38d85f"}, "id": "integration_test_consumer",
40 44
        "_href": "/pulp/api/v2/consumers/integration_test_consumer/"}, "certificate":
41
        "-----BEGIN RSA P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oMCYGCgmSJomT8ixkAQETGDVhMGI0ZmIxNzBiZTZmMDQ5\nZDM4ZDg1ZjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAnx1bWpWrQNjtyGMW\nbymPoXdIyAVHtT4nh2C29iwWcEBis7g9dhyMfEjMvANR+pd5rtcfNJkElzfELYlD\n0bqIhT06GD5th6wRrK3pvr4otof590lOGt/WbHmWdPeBHLRjZ5x2fmMBjk3airlt\nivCALijP+1ikzTyposaYeUyyCbsCAwEAATANBgkqhkiG9w0BAQUFAAOCAgEAy+1e\nxFSNKSW+oAdFjckHw8m8i2EVKY1IU/YpD102xYAHHFgYc8Sl4Oigx1ba4uSpEREY\n7ceCVy4G+A3tBcOZxhrc87Qi4c8MaxcjTe4jSxRaJtycYnhu+cgxKT+EMdF+rPJJ\narKFQKP25RD5vX3YubBgp1/4MAaLzurubXMN/fLhlo/flWmnSiDPVpZtwYwBCz00\n1wAqq0ZuLPu7u4nM7RHbcItexHURiJBp0ncxLGhayZARV8nBUZmdvpP8ZbP0IXGw\nT2OyE2Uh2tTYDiraEAeCB86NBs7JMHFfTs+UlTKopxyaJumTD+hiR+JBcyvBq1ip\nF+y1KVGSLMuz4VH061faNQDBYvIjxZY3OJzabiFwdCnZQLzeikshTROWBrF0grUO\nDwMNmFnDdo32gjlKirrSa6e7ivJxulW6Q4AnYmhpCwXomxJjeIeDm7vHiQx7kxtI\n7MpNlRZPX0nbRueEegKf0fFeZPoargqDaEEEQB82v3EEAn9FYywv1fKURQ3grlJe\nc9QO/zJ+ubEz/vjWlKxzIWW7EGpSDPrOZoMTEzNlKpqQ/qnv/YygbuXzmvh0owOA\nWu75bBYvNMeVJFa1pM+d1pkeiwLxjf9h1Iopk1665JRDIiUszPobhU8MxccMfYkH\nlc508FBIUfifMOUzfyJsPEnfQ5k8vFlHSQsa+2k=\n-----END
43 47
        CERTIFICATE-----"}'
44 48
    http_version: 
45
  recorded_at: Fri, 29 Apr 2016 16:27:15 GMT
49
  recorded_at: Tue, 14 Nov 2017 20:18:57 GMT
46 50
- request:
47 51
    method: put
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: UTF-8
51 55
      string: '{"delta":{"description":"Test description"}}'
......
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
      - '44'
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:27:15 GMT
75
      - Tue, 14 Nov 2017 20:18:57 GMT
70 76
      Server:
71 77
      - Apache/2.4.6 (CentOS)
72 78
      Vary:
73 79
      - Accept-Encoding
74 80
      Content-Length:
75 81
      - '292'
82
      Connection:
83
      - close
76 84
      Content-Type:
77 85
      - application/json; charset=utf-8
78 86
    body:
79 87
      encoding: ASCII-8BIT
80 88
      string: '{"display_name": "integration_test_consumer", "description": "Test
81 89
        description", "_ns": "consumers", "notes": {}, "rsa_pub": null, "capabilities":
82
        {}, "_id": {"$oid": "57238b63aca4886d952eeaff"}, "id": "integration_test_consumer",
90
        {}, "_id": {"$oid": "5a0b4fb170be6f049d38d85f"}, "id": "integration_test_consumer",
83 91
        "_href": "/pulp/api/v2/consumers/integration_test_consumer/"}'
84 92
    http_version: 
85
  recorded_at: Fri, 29 Apr 2016 16:27:15 GMT
93
  recorded_at: Tue, 14 Nov 2017 20:18:57 GMT
86 94
- request:
87 95
    method: delete
88
    uri: https://admin:HeQSzZgm6ZEKG8aHrJEGW7aGD85Wrj57@runcible.example.com/pulp/api/v2/consumers/integration_test_consumer/
96
    uri: https://admin:admin@obelix.example.com/pulp/api/v2/consumers/integration_test_consumer/
89 97
    body:
90 98
      encoding: US-ASCII
91 99
      string: ''
......
94 102
      - application/json
95 103
      Accept-Encoding:
96 104
      - gzip, deflate
105
      User-Agent:
106
      - rest-client/2.0.2 (linux-gnu x86_64) ruby/2.2.4p230
97 107
      Content-Type:
98 108
      - application/json
99
      User-Agent:
100
      - Ruby
109
      Host:
110
      - obelix.example.com
101 111
  response:
102 112
    status:
103 113
      code: 200
104 114
      message: OK
105 115
    headers:
106 116
      Date:
107
      - Fri, 29 Apr 2016 16:27:15 GMT
117
      - Tue, 14 Nov 2017 20:18:57 GMT
108 118
      Server:
109 119
      - Apache/2.4.6 (CentOS)
110 120
      Content-Length:
111 121
      - '4'
122
      Connection:
123
      - close
112 124
      Content-Type:
113 125
      - application/json; charset=utf-8
114 126
    body:
115 127
      encoding: UTF-8
116 128
      string: 'null'
117 129
    http_version: 
118
  recorded_at: Fri, 29 Apr 2016 16:27:15 GMT
119
recorded_with: VCR 3.0.1
130
  recorded_at: Tue, 14 Nov 2017 20:18:57 GMT
131
recorded_with: VCR 3.0.3

Also available in: Unified diff