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/upload_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:21 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
      - '2485'
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": "57238b69aca4886d97990615"}, "id": "integration_test_consumer",
43
        "_id": {"$oid": "5a0b4fb270be6f049d38d865"}, "id": "integration_test_consumer",
40 44
        "_href": "/pulp/api/v2/consumers/integration_test_consumer/"}, "certificate":
41
        "-----BEGIN RSA P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 48
    http_version: 
45
  recorded_at: Fri, 29 Apr 2016 16:27:21 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":""}]}'
......
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
      - '137'
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:21 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
      - '466'
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
        "", "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": "0d63d9eddb6aacc1705bdc39b3ad249885462b93474d388699eef263de0f190f",
83 91
        "consumer_id": "integration_test_consumer", "content_type": "rpm", "_id":
84
        {"$oid": "57238b69aca4886d97990617"}, "id": "57238b69aca4886d97990617"}'
92
        {"$oid": "5a0b4fb270be6f049ca06fdb"}, "id": "5a0b4fb270be6f049ca06fdb"}'
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: delete
89
    uri: https://admin:HeQSzZgm6ZEKG8aHrJEGW7aGD85Wrj57@runcible.example.com/pulp/api/v2/consumers/integration_test_consumer/
97
    uri: https://admin:admin@obelix.example.com/pulp/api/v2/consumers/integration_test_consumer/
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:22 GMT
118
      - Tue, 14 Nov 2017 20:18:58 GMT
109 119
      Server:
110 120
      - Apache/2.4.6 (CentOS)
111 121
      Content-Length:
112 122
      - '4'
123
      Connection:
124
      - close
113 125
      Content-Type:
114 126
      - application/json; charset=utf-8
115 127
    body:
116 128
      encoding: UTF-8
117 129
      string: 'null'
118 130
    http_version: 
119
  recorded_at: Fri, 29 Apr 2016 16:27:22 GMT
120
recorded_with: VCR 3.0.1
131
  recorded_at: Tue, 14 Nov 2017 20:18:58 GMT
132
recorded_with: VCR 3.0.3

Also available in: Unified diff