"Fossies" - the Fresh Open Source Software Archive

Member "cloudkitty-9.0.0/cloudkitty/tests/gabbi/rating/hash/gabbits/hash-errors.yaml" (10 Apr 2019, 9378 Bytes) of package /linux/misc/openstack/cloudkitty-9.0.0.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Ansible YAML source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "hash-errors.yaml": 8.0.0_vs_9.0.0.

    1 fixtures:
    2   - HashMapConfigFixture
    3 
    4 tests:
    5 
    6   - name: get an invalid service
    7     url: /v1/rating/module_config/hashmap/services/d28490b2-fb3c-11e5-988b-eb9539c935dc
    8     status: 404
    9     response_strings:
   10       - "No such service: None (UUID: d28490b2-fb3c-11e5-988b-eb9539c935dc)"
   11 
   12   - name: get an invalid field
   13     url: /v1/rating/module_config/hashmap/fields/d28490b2-fb3c-11e5-988b-eb9539c935dc
   14     status: 404
   15     response_strings:
   16       - "No such field: d28490b2-fb3c-11e5-988b-eb9539c935dc"
   17 
   18   - name: get an invalid mapping
   19     url: /v1/rating/module_config/hashmap/mappings/d28490b2-fb3c-11e5-988b-eb9539c935dc
   20     status: 404
   21     response_strings:
   22       - "No such mapping: d28490b2-fb3c-11e5-988b-eb9539c935dc"
   23 
   24   - name: get an invalid threshold
   25     url: /v1/rating/module_config/hashmap/thresholds/d28490b2-fb3c-11e5-988b-eb9539c935dc
   26     status: 404
   27     response_strings:
   28       - "No such threshold: d28490b2-fb3c-11e5-988b-eb9539c935dc"
   29 
   30   - name: get an invalid group
   31     url: /v1/rating/module_config/hashmap/groups/d28490b2-fb3c-11e5-988b-eb9539c935dc
   32     status: 404
   33     response_strings:
   34       - "No such group: None (UUID: d28490b2-fb3c-11e5-988b-eb9539c935dc)"
   35 
   36   - name: create a service
   37     url: /v1/rating/module_config/hashmap/services
   38     method: POST
   39     request_headers:
   40         content-type: application/json
   41         x-roles: admin
   42     data:
   43       name: "cpu"
   44     status: 201
   45     response_json_paths:
   46       $.name: "cpu"
   47     response_store_environ:
   48       hash_error_service_id: $.service_id
   49 
   50   - name: create a duplicate service
   51     url: /v1/rating/module_config/hashmap/services
   52     method: POST
   53     request_headers:
   54       content-type: application/json
   55       x-roles: admin
   56     data:
   57       name: "cpu"
   58     status: 409
   59     response_strings:
   60       - "Service cpu already exists (UUID: $RESPONSE['$.service_id'])"
   61 
   62   - name: create a service mapping with an invalid type
   63     url: /v1/rating/module_config/hashmap/mappings
   64     method: POST
   65     request_headers:
   66         content-type: application/json
   67         x-roles: admin
   68     data:
   69       service_id: "371bcd08-009f-11e6-91de-8745729038b2"
   70       type: "fail"
   71       cost: "0.2"
   72     status: 400
   73     response_strings:
   74       - "Invalid input for field/attribute type. Value: 'fail'. Value should be one of: "
   75 
   76   - name: create a field
   77     url: /v1/rating/module_config/hashmap/fields
   78     method: POST
   79     request_headers:
   80         content-type: application/json
   81         x-roles: admin
   82     data:
   83       service_id: $ENVIRON['hash_error_service_id']
   84       name: "flavor_id"
   85     status: 201
   86     response_json_paths:
   87       $.service_id: $ENVIRON['hash_error_service_id']
   88       $.name: "flavor_id"
   89     response_store_environ:
   90       hash_error_field_id: $.field_id
   91 
   92   - name: create a duplicate field
   93     url: /v1/rating/module_config/hashmap/fields
   94     method: POST
   95     request_headers:
   96       content-type: application/json
   97       x-roles: admin
   98     data:
   99       service_id: $RESPONSE['$.service_id']
  100       name: "flavor_id"
  101     status: 409
  102     response_strings:
  103       - "Field $RESPONSE['$.name'] already exists (UUID: $RESPONSE['$.field_id'])"
  104 
  105   - name: modify unknown mapping
  106     url: /v1/rating/module_config/hashmap/mappings/42
  107     method: PUT
  108     request_headers:
  109         content-type: application/json
  110         x-roles: admin
  111     data:
  112       service_id: "cf1e7d1e-fcc4-11e5-9c93-b7775ce62e3c"
  113       type: "flat"
  114       cost: "0.10000000"
  115     status: 404
  116     response_strings:
  117       - "No such mapping: 42"
  118 
  119   - name: create a field mapping to check updates
  120     url: /v1/rating/module_config/hashmap/mappings
  121     method: POST
  122     request_headers:
  123         content-type: application/json
  124         x-roles: admin
  125     data:
  126       field_id: $ENVIRON['hash_error_field_id']
  127       type: "flat"
  128       cost: "0.2"
  129       value: "fail"
  130     status: 201
  131 
  132   - name: remove the value of a field mapping
  133     url: /v1/rating/module_config/hashmap/mappings/$RESPONSE['$.mapping_id']
  134     method: PUT
  135     request_headers:
  136         content-type: application/json
  137         x-roles: admin
  138     data:
  139       type: "rate"
  140       cost: "0.2"
  141       value: ''
  142     status: 400
  143     response_strings:
  144       - "You must specify a value for a field mapping."
  145 
  146   - name: create a service mapping with an invalid service_id
  147     url: /v1/rating/module_config/hashmap/mappings
  148     method: POST
  149     request_headers:
  150         content-type: application/json
  151         x-roles: admin
  152     data:
  153       service_id: "de23e3fe-0097-11e6-a44d-2b09512e61d9"
  154       type: "flat"
  155       cost: "0.2"
  156     status: 400
  157     response_strings:
  158       - "No such service: None (UUID: de23e3fe-0097-11e6-a44d-2b09512e61d9)"
  159 
  160   - name: create a field mapping with an invalid field_id
  161     url: /v1/rating/module_config/hashmap/mappings
  162     method: POST
  163     request_headers:
  164         content-type: application/json
  165         x-roles: admin
  166     data:
  167       field_id: "de23e3fe-0097-11e6-a44d-2b09512e61d9"
  168       type: "flat"
  169       cost: "0.2"
  170       value: "fail"
  171     status: 400
  172     response_strings:
  173       - "No such field: de23e3fe-0097-11e6-a44d-2b09512e61d9"
  174 
  175   - name: create a service threshold with an invalid service_id
  176     url: /v1/rating/module_config/hashmap/thresholds
  177     method: POST
  178     request_headers:
  179         content-type: application/json
  180         x-roles: admin
  181     data:
  182       service_id: "de23e3fe-0097-11e6-a44d-2b09512e61d9"
  183       type: "flat"
  184       cost: "0.2"
  185       level: "1.0"
  186     status: 400
  187     response_strings:
  188       - "No such service: None (UUID: de23e3fe-0097-11e6-a44d-2b09512e61d9)"
  189 
  190   - name: create a field threshold with an invalid field_id
  191     url: /v1/rating/module_config/hashmap/thresholds
  192     method: POST
  193     request_headers:
  194         content-type: application/json
  195         x-roles: admin
  196     data:
  197       field_id: "de23e3fe-0097-11e6-a44d-2b09512e61d9"
  198       type: "flat"
  199       cost: "0.2"
  200       level: "1.0"
  201     status: 400
  202     response_strings:
  203       - "No such field: de23e3fe-0097-11e6-a44d-2b09512e61d9"
  204 
  205   - name: create a mapping with both parent id set
  206     url: /v1/rating/module_config/hashmap/mappings
  207     method: POST
  208     request_headers:
  209         content-type: application/json
  210         x-roles: admin
  211     data:
  212       service_id: "de23e3fe-0097-11e6-a44d-2b09512e61d9"
  213       field_id: "de23e3fe-0097-11e6-a44d-2b09512e61d9"
  214       type: "flat"
  215       cost: "0.2"
  216     status: 400
  217     response_strings:
  218       - "You can only specify one parent."
  219 
  220   - name: create a mapping with a value and no parent
  221     url: /v1/rating/module_config/hashmap/mappings
  222     method: POST
  223     request_headers:
  224         content-type: application/json
  225         x-roles: admin
  226     data:
  227       type: "flat"
  228       cost: "0.2"
  229       value: "fail"
  230     status: 400
  231     response_strings:
  232       - "You must specify one parent."
  233 
  234   - name: create a field mapping with a parent and no value
  235     url: /v1/rating/module_config/hashmap/mappings
  236     method: POST
  237     request_headers:
  238         content-type: application/json
  239         x-roles: admin
  240     data:
  241       field_id: $ENVIRON['hash_error_field_id']
  242       type: "flat"
  243       cost: "0.2"
  244     status: 400
  245     response_strings:
  246       - "You must specify a value for a field mapping."
  247 
  248   - name: create a threshold with both parent id set
  249     url: /v1/rating/module_config/hashmap/thresholds
  250     method: POST
  251     request_headers:
  252         content-type: application/json
  253         x-roles: admin
  254     data:
  255       service_id: "de23e3fe-0097-11e6-a44d-2b09512e61d9"
  256       field_id: "de23e3fe-0097-11e6-a44d-2b09512e61d9"
  257       type: "flat"
  258       cost: "0.2"
  259       level: "1.0"
  260     status: 400
  261     response_strings:
  262       - "You can only specify one parent."
  263 
  264   - name: create a threshold with no parent
  265     url: /v1/rating/module_config/hashmap/thresholds
  266     method: POST
  267     request_headers:
  268         content-type: application/json
  269         x-roles: admin
  270     data:
  271       type: "flat"
  272       cost: "0.2"
  273       level: "1.0"
  274     status: 400
  275     response_strings:
  276       - "You must specify one parent."
  277 
  278   - name: create a service threshold with a parent and no level
  279     url: /v1/rating/module_config/hashmap/thresholds
  280     method: POST
  281     request_headers:
  282         content-type: application/json
  283         x-roles: admin
  284     data:
  285       service_id: $ENVIRON['hash_error_service_id']
  286       type: "flat"
  287       cost: "0.2"
  288     status: 400
  289     response_strings:
  290       - "Invalid input for field/attribute level. Value: 'None'. Mandatory field missing."
  291 
  292   - name: delete unknown threshold
  293     url: /v1/rating/module_config/hashmap/thresholds/d28490b2-fb3c-11e5-988b-eb9539c935dc
  294     method: DELETE
  295     status: 404
  296     response_strings:
  297       - "No such threshold: d28490b2-fb3c-11e5-988b-eb9539c935dc"
  298 
  299   - name: delete unknown mapping
  300     url: /v1/rating/module_config/hashmap/mappings/d28490b2-fb3c-11e5-988b-eb9539c935dc
  301     method: DELETE
  302     status: 404
  303     response_strings:
  304       - "No such mapping: d28490b2-fb3c-11e5-988b-eb9539c935dc"
  305 
  306   - name: delete unknown field
  307     url: /v1/rating/module_config/hashmap/fields/d28490b2-fb3c-11e5-988b-eb9539c935dc
  308     method: DELETE
  309     status: 404
  310     response_strings:
  311       - "No such field: d28490b2-fb3c-11e5-988b-eb9539c935dc"
  312 
  313   - name: delete unknown service
  314     url: /v1/rating/module_config/hashmap/services/d28490b2-fb3c-11e5-988b-eb9539c935dc
  315     method: DELETE
  316     status: 404
  317     response_strings:
  318       - "No such service: None (UUID: d28490b2-fb3c-11e5-988b-eb9539c935dc)"