Skip to content

Commit 31dfefc

Browse files
committed
Make the entry actions more discoverable
Group them under st2.kv.entry.* Signed-off-by: Jacob Floyd <[email protected]>
1 parent 6352608 commit 31dfefc

9 files changed

+20
-20
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,18 @@ You can also use dynamic values from the datastore. See the
4343
* ``kv.grep_object`` - Find datastore items which name matches the provided query
4444
amd deserialize their values from JSON serialized objects.
4545

46-
* ``kv.get_entry`` - Retrieve entry object in a JSON serialized object from the
46+
* ``kv.entry.get`` - Retrieve entry in a JSON serialized object from the
4747
datastore. An entry is a standard JSON object with properties.
4848
Fails if the datastore key does not exist.
49-
* ``kv.upsert_entry_property`` - Update or insert a property in the named entry
49+
* ``kv.entry.upsert_property`` - Update or insert a property in the named entry
5050
of a JSON serialized object. Then, serialize and store the updated object.
5151
The property's value may be any json-serializable type.
5252
Fails if the datastore key does not exist. A coordination backend is recommended.
53-
* ``kv.append_entry_property`` - Add the value to the end of an array property
53+
* ``kv.entry.append_property`` - Add the value to the end of an array property
5454
in the named entry of a JSON serialized object. Then, serialize and store the
5555
updated object. The property must be an array. The value to append can be anything.
5656
Fails if the datastore key does not exist. A coordination backend is recommended.
57-
* ``kv.delete_entry_property`` - Delete a property from a named entry of a JSON
57+
* ``kv.entry.delete_property`` - Delete a property from a named entry of a JSON
5858
serialized object in the datastore. If the entry is empty, delete it as well.
5959
Fails if the datastore key does not exist. A coordination backend is recommended.
6060

actions/kv_append_entry_property.py renamed to actions/kv_entry_append_property.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
from lib.action import St2BaseAction
66

77
__all__ = [
8-
'St2KVPAppendEntryPropertyAction'
8+
'St2KVPEntryAppendPropertyAction'
99
]
1010

1111

12-
class St2KVPAppendEntryPropertyAction(St2BaseAction):
12+
class St2KVPEntryAppendPropertyAction(St2BaseAction):
1313
# noinspection PyShadowingBuiltins
1414
def run(self, key, entry, property, value):
1515
with coordination_service.get_coordinator().get_lock('st2.kv_entry.' + key):

actions/kv_append_entry_property.yaml renamed to actions/kv_entry_append_property.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
name: 'kv.append_entry_property'
2+
name: 'kv.entry.append_property'
33
enabled: true
44
description: |
55
Add a value to the end of an array property under a named entry (sub-object)
@@ -9,7 +9,7 @@ description: |
99
This action does not support encrypted datastore objects.
1010
1111
runner_type: python-script
12-
entry_point: kv_append_entry_property.py
12+
entry_point: kv_entry_append_property.py
1313
parameters:
1414
key:
1515
required: true

actions/kv_delete_entry_property.py renamed to actions/kv_entry_delete_property.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
from lib.action import St2BaseAction
66

77
__all__ = [
8-
'St2KVPDeleteEntryPropertyAction'
8+
'St2KVPEntryDeletePropertyAction'
99
]
1010

1111

12-
class St2KVPDeleteEntryPropertyAction(St2BaseAction):
12+
class St2KVPEntryDeletePropertyAction(St2BaseAction):
1313
# noinspection PyShadowingBuiltins
1414
def run(self, key, entry, property):
1515
with coordination_service.get_coordinator().get_lock('st2.kv_entry.' + key):

actions/kv_delete_entry_property.yaml renamed to actions/kv_entry_delete_property.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
name: 'kv.delete_entry_property'
2+
name: 'kv.entry.delete_property'
33
enabled: true
44
description: |
55
Delete a property (if it exists) under a named entry (sub-object) of a
@@ -10,7 +10,7 @@ description: |
1010
This action does not support encrypted datastore objects.
1111
1212
runner_type: python-script
13-
entry_point: kv_delete_entry_property.py
13+
entry_point: kv_entry_delete_property.py
1414
parameters:
1515
key:
1616
required: true

actions/kv_get_entry.py renamed to actions/kv_entry_get.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
from lib.action import St2BaseAction
44

55
__all__ = [
6-
'St2KVPGetEntryAction'
6+
'St2KVPEntryGetAction'
77
]
88

99

10-
class St2KVPGetEntryAction(St2BaseAction):
10+
class St2KVPEntryGetAction(St2BaseAction):
1111
# noinspection PyShadowingBuiltins
1212
def run(self, key, entry, fallback):
1313
# get and deserialize object or fail.

actions/kv_get_entry.yaml renamed to actions/kv_entry_get.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
name: 'kv.get_entry'
2+
name: 'kv.entry.get'
33
enabled: true
44
description: |
55
Get a named entry (sub-object) of a serialized object in kv datastore
@@ -10,7 +10,7 @@ description: |
1010
This action does not support encrypted datastore objects.
1111
1212
runner_type: python-script
13-
entry_point: kv_get_entry.py
13+
entry_point: kv_entry_get.py
1414
parameters:
1515
key:
1616
required: true

actions/kv_upsert_entry_property.py renamed to actions/kv_entry_upsert_property.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
from lib.action import St2BaseAction
66

77
__all__ = [
8-
'St2KVPUpsertEntryPropertyAction'
8+
'St2KVPEntryUpsertPropertyAction'
99
]
1010

1111

12-
class St2KVPUpsertEntryPropertyAction(St2BaseAction):
12+
class St2KVPEntryUpsertPropertyAction(St2BaseAction):
1313
# noinspection PyShadowingBuiltins
1414
def run(self, key, entry, property, value):
1515
with coordination_service.get_coordinator().get_lock('st2.kv_entry.' + key):

actions/kv_upsert_entry_property.yaml renamed to actions/kv_entry_upsert_property.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
name: 'kv.upsert_entry_property'
2+
name: 'kv.entry.upsert_property'
33
enabled: true
44
description: |
55
Insert or update a property under a named entry (sub-object) of a serialized object in kv datastore.
@@ -8,7 +8,7 @@ description: |
88
This action does not support encrypted datastore objects.
99
1010
runner_type: python-script
11-
entry_point: kv_upsert_entry_property.py
11+
entry_point: kv_entry_upsert_property.py
1212
parameters:
1313
key:
1414
required: true

0 commit comments

Comments
 (0)