3 Resource DatastoreCRUD.robot
7 [Arguments] ${controller_ip} ${field bases}
8 [Documentation] Initializes the cars shard by creating a 0th car with POST then deleting it.
9 ... Field bases are a dictionary of datastore record field values onto which is appended
10 ... an incremental value to uniquely identify the record from which it came.
11 ... Typically, you will use the Create Dictionary keyword on arguments which look like this:
12 ... id=${EMPTY} category=coupe model=model manufacturer=mfg year=2
13 ${node}= Set Variable ${EMPTY}
14 ${prefix}= Set Variable {"car:cars":{"car-entry":[{
15 ${postfix}= Set Variable }]}}
16 Create Records ${controller_ip} ${node} ${0} ${0} ${prefix} ${field bases}
18 ${node}= Set Variable car:cars/car-entry
19 Delete Records ${controller_ip} ${node} ${0} ${0}
22 [Arguments] ${controller_ip} ${first} ${last} ${field bases}
23 [Documentation] Creates cars with record IDs of specified range using POST.
24 ... If first and last are equal, only one record is updated.
25 ... Field bases are a dictionary of datastore record field values onto which is appended
26 ... an incremental value to uniquely identify the record from which it came.
27 ... Typically, you will use the Create Dictionary keyword on an argument which looks like this:
28 ... id=${EMPTY} category=coupe model=model manufacturer=mfg year=2
29 ${node}= Set Variable car:cars
30 ${prefix}= Set Variable {"car-entry":[{
31 ${postfix}= Set Variable }]}
32 Create Records ${controller_ip} ${node} ${first} ${last} ${prefix} ${field bases}
36 [Arguments] ${controller_ip} ${first} ${last} ${field bases}
37 [Documentation] Updates cars with record IDs of the specified using PUT.
38 ... If first and last are equal, only one record is updated.
39 ... Field bases are a dictionary of datastore record field values onto which is appended
40 ... an incremental value to uniquely identify the record from which it came.
41 ... Typically, you will use the Create Dictionary keyword on arguments which look like this:
42 ... id=${EMPTY} category=coupe model=model manufacturer=mfg year=2
43 ${node}= Set Variable car:cars/car-entry
44 ${prefix}= Set Variable {"car-entry":[{
45 ${postfix}= Set Variable }]}
46 Update Records ${controller_ip} ${node} ${first} ${last} ${prefix} ${field bases}
50 [Arguments] ${controller_ip}
51 [Documentation] Returns all records from the cars shard in JSON format.
52 ${node}= Set Variable car:cars
53 ${result}= Read Records ${controller_ip} ${node}
57 [Arguments] ${controller_ip} ${id}
58 [Documentation] Returns the specified record from the cars shard in JSON format.
59 ${node}= Set Variable car:cars/car-entry/${id}
60 ${result}= Read Records ${controller_ip} ${node}
64 [Arguments] ${controller_ip}
65 [Documentation] Deletes all records from the cars shard.
66 ${node}= Set Variable car:cars
67 Delete All Records ${controller_ip} ${node}
70 [Arguments] ${controller_ip} ${first} ${last}
71 [Documentation] Deletes the specified range of records from the cars shard.
72 ${node}= Set Variable car:cars/car-entry
73 Delete Records ${controller_ip} ${node} ${first} ${last}