awsc.base_control.ListResourceFieldsEditor

class awsc.base_control.ListResourceFieldsEditor(provider, retrieve_method, retrieve_path, update_method, entry_name_arg, fields, entry_key='name', entry_name_arg_update=None, as_json=True, message='Update successful')

Class for simplifying generating an editor for resources which are essentially just a set of fields. Allows for a more restricted editing session compared to ListResourceDocumentEditor.

Methods

display_content(response)

Creates the display format for the resource retrieved from AWS.

edit(selection)

Executes the full editing workflow.

hotkey_callback(control)

This function can be passed as a hotkey callback to a ResourceLister.

retrieve_content(selection)

Called when the data for the edited entry is being retrieved.

update_content(selection, newcontent)

Updates the data on AWS with the data edited by the user.

__init__(provider, retrieve_method, retrieve_path, update_method, entry_name_arg, fields, entry_key='name', entry_name_arg_update=None, as_json=True, message='Update successful')

Initializes a ListResourceDocumentEditor.

Parameters:
provider :str

boto3 client provider name

retrieve_methodstr

The method name for the provider to retrieve the document of the edited resource

retrieve_pathstr

Path to the root of the document in the response for the retrieve method

update_methodstr

The method name for the provider to call to update the resource

entry_name_argstr

The name of the kwarg for the retrieve_method which must be passed the entry’s key.

update_document_argstr

The name of the kwarg for the update_method which receives the updated document.

entry_name_is_listbool

If true, pass entry_name_arg to retrieve_method as a list.

entry_keystr

The field in the entry which contains the value for the entry name argument.

entry_name_arg_updatestr

The name of the kwarg for the update_method which must be passed the entry’s key. If None, use the same as for the retrieve_method.

as_jsonbool or dict

If true, each field is passed as a json object. If false, all list and map fields are converted to their representation via json.dumps before passing. For a ListResourceDocumentEditor, this only affects the root object.

ignored_fieldslist

A list of fields to ignore (remove) from the retrieved data. Informational fields that cause compatibility issues.

static_fieldsdict

A mapping of field name to field value for keyword arguments that have a static value in the API call.

Methods

__init__(provider, retrieve_method, ...[, ...])

Initializes a ListResourceDocumentEditor.

display_content(response)

Creates the display format for the resource retrieved from AWS.

edit(selection)

Executes the full editing workflow.

hotkey_callback(control)

This function can be passed as a hotkey callback to a ResourceLister.

retrieve_content(selection)

Called when the data for the edited entry is being retrieved.

update_content(selection, newcontent)

Updates the data on AWS with the data edited by the user.