This file is indexed.

/usr/lib/python3/dist-packages/gnocchi/tests/functional/gabbits/resource.yaml is in python3-gnocchi 4.2.0-0ubuntu5.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
#
# Test the resource API to achieve coverage of just the
# ResourcesController and ResourceController class code.
#

fixtures:
    - ConfigFixture

defaults:
  request_headers:
    # User foobar
    authorization: "basic Zm9vYmFyOg=="
    content-type: application/json

tests:

# We will need an archive for use in later tests so we create it
# here. This could be done in a fixture but since the API allows it
# may as well use it.

    - name: create archive policy
      desc: for later use
      POST: /v1/archive_policy
      request_headers:
        # User admin
        authorization: "basic YWRtaW46"
      data:
          name: medium
          definition:
              - granularity: 1 second
      status: 201

    - name: create archive policy rule
      POST: /v1/archive_policy_rule
      request_headers:
        # User admin
        authorization: "basic YWRtaW46"
      data:
        name: test_rule
        metric_pattern: "disk.io.*"
        archive_policy_name: medium
      status: 201

    - name: root of all
      GET: /
      response_headers:
          content-type: /application/json/
      response_json_paths:
          $.versions[0].links[0].href: $SCHEME://$NETLOC/v1/

    - name: root of v1
      GET: /v1
      redirects: true
      response_json_paths:
          $.version: "1.0"
          $.links.`len`: 13
          $.links[0].href: $SCHEME://$NETLOC/v1
          $.links[9].href: $SCHEME://$NETLOC/v1/resource

    - name: root of resource
      GET: /v1/resource
      response_json_paths:
          $.generic: $SCHEME://$NETLOC/v1/resource/generic

    - name: typo of resource
      GET: /v1/resoue
      status: 404

    - name: typo of resource extra
      GET: /v1/resource/foobar
      status: 404

# Explore that GETting a list of resources demonstrates the expected
# behaviors notably with regard to content negotiation.

    - name: generic resource list
      desc: there are no generic resources yet
      GET: /v1/resource/generic
      response_strings:
          - "[]"

    - name: generic resource bad accept
      desc: Expect 406 on bad accept type
      GET: $LAST_URL
      request_headers:
          accept: text/plain
      status: 406
      response_strings:
          - 406 Not Acceptable

    - name: generic resource complex accept
      desc: failover accept media type appropriately
      GET: $LAST_URL
      request_headers:
          accept: text/plain, application/json; q=0.8
      response_strings:
          - "[]"

# Try creating a new generic resource in various ways.

    - name: generic resource
      desc: there are no generic resources yet
      GET: /v1/resource/generic
      response_strings:
          - "[]"

    - name: post generic resource
      POST: $LAST_URL
      data:
          id: f93450f2-d8a5-4d67-9985-02511241e7d1
          started_at: "2014-01-03T02:02:02.000000"
          user_id: 0fbb231484614b1a80131fc22f6afc9c
          project_id: f3d41b770cc14f0bb94a1d5be9c0e3ea
      status: 201
      response_headers:
          location: $SCHEME://$NETLOC/v1/resource/generic/f93450f2-d8a5-4d67-9985-02511241e7d1
          content-type: /^application\/json/
      response_json_paths:
          $.creator: foobar
          $.user_id: 0fbb231484614b1a80131fc22f6afc9c

    - name: post same resource refuse
      desc: We can only post one identified resource once
      POST: $LAST_URL
      data:
          id: f93450f2-d8a5-4d67-9985-02511241e7d1
          started_at: "2014-01-03T02:02:02.000000"
          user_id: 0fbb231484614b1a80131fc22f6afc9c
          project_id: f3d41b770cc14f0bb94a1d5be9c0e3ea
      status: 409

    - name: post generic resource bad content type
      POST: $LAST_URL
      request_headers:
          content-type: text/plain
      data: '{"id": "f93450f2-d8a5-4d67-9985-02511241e7d1", "started_at": "2014-01-03T02:02:02.000000", "user_id": "0fbb231484614b1a80131fc22f6afc9c", "project_id": "f3d41b770cc14f0bb94a1d5be9c0e3ea"}'
      status: 415

# Create a new generic resource, demonstrate that including no data
# gets a useful 400 response.

    - name: post generic resource no data
      POST: /v1/resource/generic
      status: 400

    - name: post generic with invalid metric name
      POST: $LAST_URL
      data:
          metrics:
              "disk/iops":
                  archive_policy_name: medium
      status: 400
      response_strings:
          - "'/' is not supported in metric name"

    - name: post generic resource to modify
      POST: $LAST_URL
      data:
          id: 75C44741-CC60-4033-804E-2D3098C7D2E9
          user_id: 0fbb231484614b1a80131fc22f6afc9c
          project_id: f3d41b770cc14f0bb94a1d5be9c0e3ea
      status: 201
      response_json_paths:
          $.metrics: {} # empty dictionary

# PATCH that generic resource to change its attributes and to
# associate metrics. If a metric does not exist there should be a
# graceful failure.
    - name: patch generic resource
      PATCH: $LOCATION
      data:
          user_id: foobar
      status: 200
      response_json_paths:
          user_id: foobar

    - name: patch generic resource with same data
      desc: Ensure no useless revision have been created
      PATCH: /v1/resource/generic/75C44741-CC60-4033-804E-2D3098C7D2E9
      data:
          user_id: foobar
      status: 200
      response_json_paths:
          user_id: foobar
          revision_start: $RESPONSE['$.revision_start']

    - name: patch generic resource with id
      PATCH: $LAST_URL
      data:
          id: foobar
      status: 400
      response_strings:
          - "Invalid input: extra keys not allowed @ data["
          - "'id']"

    - name: patch generic with metrics
      PATCH: $LAST_URL
      data:
          metrics:
              disk.iops:
                  archive_policy_name: medium
      status: 200
      response_strings:
        - '"disk.iops": '

    - name: get generic history
      desc: Ensure we can get the history
      GET: /v1/resource/generic/75C44741-CC60-4033-804E-2D3098C7D2E9/history?sort=revision_end:asc-nullslast
      response_json_paths:
        $.`len`: 2
        $[1].revision_end: null
        $[1].metrics.'disk.iops': $RESPONSE["metrics.'disk.iops'"]

    - name: get generic history with links page 1
      desc: Ensure we can get the history
      GET: /v1/resource/generic/75C44741-CC60-4033-804E-2D3098C7D2E9/history?sort=revision_end:asc-nullslast&limit=1
      response_headers:
        link: "<$SCHEME://$NETLOC/v1/resource/generic/75C44741-CC60-4033-804E-2D3098C7D2E9/history?limit=1&marker=75c44741-cc60-4033-804e-2d3098c7d2e9%401&sort=revision_end%3Aasc-nullslast>; rel=\"next\""
      response_json_paths:
        $.`len`: 1

    - name: get generic history with links page 2
      desc: Ensure we can get the history
      GET: /v1/resource/generic/75C44741-CC60-4033-804E-2D3098C7D2E9/history?limit=1&marker=75c44741-cc60-4033-804e-2d3098c7d2e9@1&sort=revision_end:asc-nullslast
      response_json_paths:
        $.`len`: 1
        $[0].revision_end: null

    - name: patch generic bad metric association
      PATCH: /v1/resource/generic/75C44741-CC60-4033-804E-2D3098C7D2E9
      data:
          metrics:
              disk.iops: f3d41b77-0cc1-4f0b-b94a-1d5be9c0e3ea
      status: 400
      response_strings:
          - Metric f3d41b77-0cc1-4f0b-b94a-1d5be9c0e3ea does not exist

    - name: patch generic with bad archive policy
      PATCH: $LAST_URL
      data:
          metrics:
              disk.iops:
                  archive_policy_name: noexist
      status: 400
      response_strings:
          - Archive policy noexist does not exist

    - name: patch generic with no archive policy rule
      PATCH: $LAST_URL
      data:
          metrics:
              disk.iops: {}
      status: 400
      response_strings:
          - No archive policy name specified and no archive policy rule found matching the metric name disk.iops

    - name: patch generic with archive policy rule
      PATCH: $LAST_URL
      data:
          metrics:
              disk.io.rate: {}
      status: 200

    - name: get patched resource
      desc: confirm the patched resource is properly patched
      GET: $LAST_URL
      data:
          user_id: foobar

    - name: patch resource empty dict
      desc: an empty dict in patch is an existence check
      PATCH:  $LAST_URL
      data: "{}"
      status: 200
      data:
          user_id: foobar

    - name: patch resource without change with metrics in response
      desc: an empty dict in patch is an existence check
      PATCH:  $LAST_URL
      data: "{}"
      status: 200
      response_json_paths:
          $.metrics.'disk.io.rate': $RESPONSE["$.metrics.'disk.io.rate'"]

    - name: patch generic with invalid metric name
      PATCH: $LAST_URL
      data:
          metrics:
              "disk/iops":
                  archive_policy_name: medium
      status: 400
      response_strings:
          - "'/' is not supported in metric name"

# Failure modes for history

    - name: post generic history
      desc: should don't work
      POST: /v1/resource/generic/75C44741-CC60-4033-804E-2D3098C7D2E9/history
      status: 405

    - name: delete generic history
      desc: should don't work
      DELETE: $LAST_URL
      status: 405

# Failure modes for PATCHing a resource

    - name: patch resource no data
      desc: providing no data is an error
      PATCH: /v1/resource/generic/75C44741-CC60-4033-804E-2D3098C7D2E9
      status: 400
      response_strings:
          - "Unable to decode body:"

    - name: patch resource bad data
      desc: providing data that is not a dict is an error
      PATCH: $LAST_URL
      status: 400
      data:
          - Beer and pickles
      response_strings:
          - "Invalid input: expected a dictionary"

    - name: patch noexit resource
      desc: "patching something that doesn't exist is a 404"
      PATCH: /v1/resource/generic/77777777-CC60-4033-804E-2D3098C7D2E9
      status: 404

# GET single resource failure modes

    - name: get noexist resource
      desc: if a resource does not exist 404
      GET: $LAST_URL
      status: 404
      response_strings:
          - The resource could not be found.

    - name: get bad resource id
      desc: https://bugs.launchpad.net/gnocchi/+bug/1425588
      GET:  /v1/resource/generic/noexist
      status: 404
      response_strings:
          - The resource could not be found.

    - name: get metrics for this not-existing resource
      GET: /v1/resource/generic/77777777-CC60-4033-804E-2D3098C7D2E9/metric/cpu.util
      status: 404

# List resources

    - name: list generic resources
      GET: /v1/resource/generic
      response_json_paths:
          $[0].user_id: 0fbb231484614b1a80131fc22f6afc9c
          $[-1].user_id: foobar

    - name: list generic resources with attrs param
      GET: /v1/resource/generic?attrs=id&attrs=started_at&attrs=user_id
      response_json_paths:
          $[0].`len`: 3
          $[0].id: $RESPONSE['$[0].id']
          $[0].started_at: $RESPONSE['$[0].started_at']
          $[0].user_id: $RESPONSE['$[0].user_id']
          $[1].`len`: 3

    - name: list generic resources with invalid attrs param
      GET: /v1/resource/generic?attrs=id&attrs=foo&attrs=bar
      response_json_paths:
          $[0].`len`: 1
          $[0].id: $RESPONSE['$[0].id']
          $[1].`len`: 1

    - name: list generic resources without attrs param
      GET: /v1/resource/generic
      response_json_paths:
          $[0].`len`: 13
          $[1].`len`: 13

    - name: list generic resources with attrs header
      GET: /v1/resource/generic
      request_headers:
          Accept: "application/json; attrs=id+started_at+user_id"
      response_json_paths:
          $[0].`len`: 3
          $[0].id: $RESPONSE['$[0].id']
          $[0].started_at: $RESPONSE['$[0].started_at']
          $[0].user_id: $RESPONSE['$[0].user_id']
          $[1].`len`: 3

    - name: list generic resources with invalid attrs header
      GET: /v1/resource/generic
      request_headers:
          Accept: "application/json; attrs=id+foo+bar"
      response_json_paths:
          $[0].`len`: 1
          $[0].id: $RESPONSE['$[0].id']
          $[1].`len`: 1

    - name: list generic resources without attrs header
      GET: /v1/resource/generic
      request_headers:
          Accept: "application/json"
      response_json_paths:
          $[0].`len`: 13
          $[1].`len`: 13

    - name: list all resources
      GET: /v1/resource/generic
      response_strings:
          - '"type": "generic"'

# Metric handling when POSTing resources.

    - name: post new generic with non-existent metrics
      POST: /v1/resource/generic
      data:
          id: 85C44741-CC60-4033-804E-2D3098C7D2E9
          user_id: 0fbb231484614b1a80131fc22f6afc9c
          project_id: f3d41b770cc14f0bb94a1d5be9c0e3ea
          metrics:
              cpu.util: 10
      status: 400

    - name: post new generic with metrics bad policy
      POST: $LAST_URL
      data:
          id: 85C44741-CC60-4033-804E-2D3098C7D2E9
          user_id: 0fbb231484614b1a80131fc22f6afc9c
          project_id: f3d41b770cc14f0bb94a1d5be9c0e3ea
          metrics:
              cpu.util:
                  archive_policy_name: noexist
      status: 400

    - name: post new generic with metrics no policy rule
      POST: $LAST_URL
      data:
          id: 85BABE39-F7F7-455A-877B-62C22E11AA40
          user_id: 0fbb231484614b1a80131fc22f6afc9c
          project_id: f3d41b770cc14f0bb94a1d5be9c0e3ea
          metrics:
              cpu.util: {}
      status: 400
      response_strings:
        - No archive policy name specified and no archive policy rule found matching the metric name cpu.util

    - name: post new generic with metrics using policy rule
      POST: $LAST_URL
      data:
          id: 85BABE39-F7F7-455A-877B-62C22E11AA40
          user_id: 0fbb231484614b1a80131fc22f6afc9c
          project_id: f3d41b770cc14f0bb94a1d5be9c0e3ea
          metrics:
              disk.io.rate: {}
      status: 201

    - name: post new generic with metrics
      POST: $LAST_URL
      data:
          id: d13982cb-4cce-4f84-a96e-7581be1e599c
          user_id: 0fbb231484614b1a80131fc22f6afc9c
          project_id: f3d41b770cc14f0bb94a1d5be9c0e3ea
          metrics:
              disk.util:
                  archive_policy_name: medium
      status: 201
      response_json_paths:
        creator: foobar

    - name: post new generic with metrics and un-normalized user/project id from keystone middleware
      POST: $LAST_URL
      data:
          id: 85C44741-CC60-4033-804E-2D3098C7D2E9
          metrics:
              cpu.util:
                  archive_policy_name: medium
      status: 201
      response_json_paths:
        creator: foobar

    - name: get metrics for this resource
      desc: with async measure handling this is a null test
      GET: /v1/resource/generic/$RESPONSE['$.id']/metric/cpu.util/measures
      response_strings:
          - "[]"

# Interrogate the NamedMetricController

    - name: list the generics
      GET: /v1/resource/generic

    - name: request metrics from one of the generics
      GET: /v1/resource/generic/$RESPONSE['$[-1].id']/metric
      response_json_paths:
          $.`len`: 1
          $[0].name: cpu.util
          $[0].resource_id: 85c44741-cc60-4033-804e-2d3098c7d2e9

    - name: request metrics from non uuid metrics
      desc: 404 from GenericResourceController
      GET: /v1/resource/generic/not.a.uuid/metric
      status: 404

    - name: request cpuutil metric from generic
      GET: /v1/resource/generic/85C44741-CC60-4033-804E-2D3098C7D2E9/metric/cpu.util
      response_json_paths:
          $.archive_policy.name: medium

    - name: try post cpuutil metric to generic
      POST: $LAST_URL
      status: 405

    - name: request cpuutil measures from generic
      desc: with async measure handling this is a null test
      GET: /v1/resource/generic/85C44741-CC60-4033-804E-2D3098C7D2E9/metric/cpu.util/measures
      response_strings:
          - "[]"

    - name: post cpuutil measures
      POST: $LAST_URL
      data:
          - timestamp: "2015-03-06T14:33:57"
            value: 43.1
          - timestamp: "2015-03-06T14:34:12"
            value: 12
      status: 202
      response_headers:
        content-length: 0

    - name: request cpuutil measures again
      GET: $LAST_URL
      poll:
          count: 50
          delay: .1
      response_json_paths:
          $[0][0]: "2015-03-06T14:33:57+00:00"
          $[0][1]: 1.0
          $[0][2]: 43.100000000000001

    - name: post metric at generic
      POST: /v1/resource/generic/85C44741-CC60-4033-804E-2D3098C7D2E9/metric
      status: 200
      data:
          electron.spin:
              archive_policy_name: medium
      response_json_paths:
          $[/name][1].name: electron.spin
          $[/name][1].resource_id: 85c44741-cc60-4033-804e-2d3098c7d2e9

    - name: post metric at generic with empty definition
      POST: $LAST_URL
      status: 400
      data:
          foo.bar: {}
      response_strings:
        - No archive policy name specified and no archive policy rule found matching the metric name foo.bar

    - name: post metric at generic using archive policy rule
      POST: $LAST_URL
      status: 200
      data:
          disk.io.rate: {}
      response_json_paths:
          $[/name][1].name: disk.io.rate
          $[/name][1].resource_id: 85c44741-cc60-4033-804e-2d3098c7d2e9

    - name: duplicate metrics at generic
      POST: $LAST_URL
      status: 409
      data:
          electron.spin:
              archive_policy_name: medium
      response_strings:
          - Named metric electron.spin already exists

    - name: post metrics at generic bad policy
      POST: $LAST_URL
      status: 400
      data:
          electron.charge:
              archive_policy_name: high
      response_strings:
          - Archive policy high does not exist

# Check bad timestamps

    - name: post new generic with bad timestamp
      POST: /v1/resource/generic
      data:
          id: 95C44741-CC60-4033-804E-2D3098C7D2E9
          user_id: 0fbb231484614b1a80131fc22f6afc9c
          project_id: f3d41b770cc14f0bb94a1d5be9c0e3ea
          metrics:
              cpu.util:
                  archive_policy_name: medium
          ended_at: "2001-12-15T02:59:43"
          started_at: "2014-12-15T02:59:43"
      status: 400
      response_strings:
          - Start timestamp cannot be after end timestamp

# Post metrics to unknown resource

    - name: post to non uuid metrics
      desc: 404 from GenericResourceController
      POST: /v1/resource/generic/not.a.uuid/metric
      data:
          some.metric:
              archive_policy_name: medium
      status: 404

    - name: post to missing uuid metrics
      desc: 404 from NamedMetricController
      POST: /v1/resource/generic/d5a5994e-ee90-11e4-88cf-685b35afa334/metric
      data:
          some.metric:
              archive_policy_name: medium
      status: 404

# Post measurements on unknown things

    - name: post measure on unknown metric
      desc: 404 from NamedMetricController with metric error
      POST: /v1/resource/generic/85C44741-CC60-4033-804E-2D3098C7D2E9/metric/unknown/measures
      data:
          - timestamp: "2015-03-06T14:33:57"
            value: 43.1
      status: 404
      response_strings:
          - Metric unknown does not exist

# DELETE-ing generics

    - name: delete generic
      DELETE: /v1/resource/generic/75C44741-CC60-4033-804E-2D3098C7D2E9
      status: 204

    - name: delete noexist generic
      DELETE: /v1/resource/generic/77777777-CC60-4033-804E-2D3098C7D2E9
      status: 404

# Delete a batch of resources by attributes filter

    - name: create resource one
      desc: before test batch delete, create some resources using a float in started_at
      POST: /v1/resource/generic
      data:
          id: f93450f2-aaaa-4d67-9985-02511241e7d1
          started_at: 1388714522.0
          user_id: 0fbb231484614b1a80131fc22f6afc9c
          project_id: f3d41b770cc14f0bb94a1d5be9c0e3ea
      status: 201

    - name: create resource two
      desc: before test batch delete, create some resources
      POST: $LAST_URL
      data:
          id: f93450f2-bbbb-4d67-9985-02511241e7d1
          started_at: "2014-01-03T02:02:02.000000"
          user_id: 0fbb231484614b1a80131fc22f6afc9c
          project_id: f3d41b770cc14f0bb94a1d5be9c0e3ea
      status: 201

    - name: create resource three
      desc: before test batch delete, create some resources
      POST: $LAST_URL
      data:
          id: f93450f2-cccc-4d67-9985-02511241e7d1
          started_at: "2014-08-04T00:00:00.000000"
          user_id: 0fbb231484614b1a80131fc22f6afc9c
          project_id: f3d41b770cc14f0bb94a1d5be9c0e3ea
      status: 201

    - name: create resource four
      desc: before test batch delete, create some resources
      POST: $LAST_URL
      data:
          id: f93450f2-dddd-4d67-9985-02511241e7d1
          started_at: "2014-08-04T00:00:00.000000"
          user_id: 0fbb231484614b1a80131fc22f6afc9c
          project_id: f3d41b770cc14f0bb94a1d5be9c0e3ea
      status: 201

    - name: create resource five
      desc: before test batch delete, create some resources
      POST: $LAST_URL
      data:
          id: f93450f2-eeee-4d67-9985-02511241e7d1
          started_at: "2015-08-14T00:00:00.000000"
          user_id: 0fbb231484614b1a80131fc22f6afc9c
          project_id: f3d41b770cc14f0bb94a1d5be9c0e3ea
      status: 201

    - name: create resource six
      desc: before test batch delete, create some resources
      POST: $LAST_URL
      data:
          id: f93450f2-ffff-4d67-9985-02511241e7d1
          started_at: "2015-08-14T00:00:00.000000"
          user_id: 0fbb231484614b1a80131fc22f6afc9c
          project_id: f3d41b770cc14f0bb94a1d5be9c0e3ea
      status: 201

    - name: create resource seven
      desc: before test batch delete, create some resources
      POST: $LAST_URL
      data:
          id: cd09ecce-3e17-4733-ad32-8a6b2034dcfd
          started_at: "2015-08-14T00:00:00.000000"
          user_id: 0fbb231484614b1a80131fc22f6afc9c
          project_id: f3d41b770cc14f0bb94a1d5be9c0e3ea
      status: 201

    - name: create resource eight
      desc: before test batch delete, create some resources
      POST: $LAST_URL
      data:
          id: 05fde895-cf8a-475c-90a7-a4c8598d935d
          started_at: "2015-08-14T00:00:00.000000"
          user_id: 0fbb231484614b1a80131fc22f6afc9c
          project_id: f3d41b770cc14f0bb94a1d5be9c0e3ea
      status: 201

    - name: get resource one
      desc: ensure the resources exists
      GET: /v1/resource/generic/f93450f2-aaaa-4d67-9985-02511241e7d1
      status: 200

    - name: get resource two
      desc: ensure the resources exists
      GET: /v1/resource/generic/f93450f2-bbbb-4d67-9985-02511241e7d1
      status: 200

    - name: get resource three
      desc: ensure the resources exists
      GET: /v1/resource/generic/f93450f2-cccc-4d67-9985-02511241e7d1
      status: 200

    - name: get resource four
      desc: ensure the resources exists
      GET: /v1/resource/generic/f93450f2-dddd-4d67-9985-02511241e7d1
      status: 200

    - name: get resource five
      desc: ensure the resources exists
      GET: /v1/resource/generic/f93450f2-eeee-4d67-9985-02511241e7d1
      status: 200

    - name: get resource six
      desc: ensure the resources exists
      GET: /v1/resource/generic/f93450f2-ffff-4d67-9985-02511241e7d1
      status: 200

    - name: get resource seven
      desc: ensure the resources exists
      GET: /v1/resource/generic/cd09ecce-3e17-4733-ad32-8a6b2034dcfd
      status: 200

    - name: get resource eight
      desc: ensure the resources exists
      GET: /v1/resource/generic/05fde895-cf8a-475c-90a7-a4c8598d935d
      status: 200

    - name: delete random data structure
      desc: delete an empty list test
      DELETE: /v1/resource/generic
      data:
          resource_ids:
              []
          attrs:
              test
      status: 400

    - name: delete something empty
      desc: use  empty filter for delete
      DELETE: $LAST_URL
      data: ""
      status: 400

    - name: delete something empty a
      desc: use  empty filter for delete
      DELETE: $LAST_URL
      data:
          in:
             id: []
      status: 400
      response_strings:
        - length of value must be at least 1

    - name: delete something empty b
      desc: use  empty filter for delete
      DELETE: $LAST_URL
      data:
          in: {}
      status: 400

    - name: delete something empty c
      desc: use  empty filter for delete
      DELETE: $LAST_URL
      data:
          in:
              and: []
      status: 400

    - name: delete something empty d
      desc: use empty filter for delete
      DELETE: $LAST_URL
      data:
          in:
              and:
                  - or: []
                  - id:
                      =: ""
      status: 400

    - name: delete something empty e
      desc: use  empty filter for delete
      DELETE: $LAST_URL
      data:
          and: []
      status: 400

    - name: delete something empty f
      desc: use  empty filter for delete
      DELETE: $LAST_URL
      data:
          and:
              - in:
                  id: []
              - started_at: ""
      status: 400

    - name: delete batch of resources filter by started_at
      desc: delete the created resources
      DELETE: /v1/resource/generic
      data:
          eq:
            started_at: "2014-08-04"
      status: 200
      response_json_paths:
        $.deleted: 2

    - name: delete batch of resources filter by multiple ids
      desc: delete the created resources
      DELETE: /v1/resource/generic
      data:
          in:
            id:
              - f93450f2-aaaa-4d67-9985-02511241e7d1
              - f93450f2-bbbb-4d67-9985-02511241e7d1
      status: 200
      response_json_paths:
        $.deleted: 2


    - name: delete both existent and non-existent data
      desc: delete exits and non-exist data
      DELETE: $LAST_URL
      data:
          in:
            id:
              - f93450f2-eeee-4d67-9985-02511241e7d1
              - f93450f2-ffff-4d67-9985-02511241e7d1
              - f93450f2-yyyy-4d67-9985-02511241e7d1
              - f93450f2-xxxx-4d67-9985-02511241e7d1
      status: 200
      response_json_paths:
        $.deleted: 2

    - name: delete multiple non-existent resources
      desc: delete a batch of non-existent resources
      DELETE: $LAST_URL
      data:
          in:
            id:
              - f93450f2-zzzz-4d67-9985-02511241e7d1
              - f93450f2-kkkk-4d67-9985-02511241e7d1
      status: 200
      response_json_paths:
        $.deleted: 0

    - name: delete multiple with query string
      DELETE: $LAST_URL?filter=id%20in%20%5Bcd09ecce-3e17-4733-ad32-8a6b2034dcfd%2C%2005fde895-cf8a-475c-90a7-a4c8598d935d%5D
      response_json_paths:
        $.deleted: 2