ResourceNode
__init_subclass__(service_name=None, name=None, **kwargs)
Initializes the custom subclasses of ResourceNode to ResourceNodeRegistry.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
service_name |
_type_
|
Name of the AWS service. Defaults to None. |
None
|
name |
_type_
|
Name of the AWS Resource Node. Defaults to None. |
None
|
complement_api_parameters_list(operation_name, related_operations_data, relations_of_operation, raw_api_parameters_list)
Uses the raw_api_parameters_list
and appends pagination parameters(MaxResults,...) to them.
Also provided for easy subclass overriding.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
operation_name |
str
|
Name of the operation. |
required |
related_operations_data |
Union[List, Dict]
|
All related operations data |
required |
relations_of_operation |
List[Dict]
|
Relations of the operation |
required |
raw_api_parameters_list |
List
|
Generated raw API parameters |
required |
Returns:
Type | Description |
---|---|
List[Dict]
|
List[Dict]: Valid API parameters to call the boto operation with |
define_extra_relations()
Extra relations defined in the custom subclasses of ResourceNode
Returns:
Type | Description |
---|---|
Union[List[Dict], List[Relation]]
|
Union[List[Dict], List[Relation]]: List of relations as dicts or Relation objects |
generate_api_parameters_from_operation_data(operation_name, relations_of_operation, related_operations_data)
Generates API parameters for the given operation including pagination parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
operation_name |
str
|
Name of the operation |
required |
relations_of_operation |
List[Dict]
|
Relations of the operation |
required |
related_operations_data |
Union[List, Dict]
|
All related operations data |
required |
Returns:
Name | Type | Description |
---|---|---|
List |
Tuple[Union[List, bool], Union[Error, None]]
|
Generated API Parameters to call the Operations with |
generate_jmespath_selector_from_relations(operation_name, relation_list)
Tries to generate the jmespath selector string from given relations. Could be overridden with custom subclasses.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
operation_name |
str
|
Name of the operation |
required |
relation_list |
List[Dict]
|
List of relations for the operation. Used to generate the jmespath selector. |
required |
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
Jmespath selector string |
get_operation_names()
Returns the available operation names in the ResourceNode.
Returns:
Type | Description |
---|---|
List[str]
|
List[str]: Operation names tied to the ResourceNode |
get_operations_relations(operation_name)
summary
Parameters:
Name | Type | Description | Default |
---|---|---|---|
operation_name |
str
|
Name of the operation. |
required |
Returns:
Type | Description |
---|---|
Tuple[Union[List[Dict], bool], Union[Error, None]]
|
Tuple[Union[List[Dict], bool], Union[Error, None]]: Returns value and error. True: No required parameters False: Failure List[Dict]: List of relations |
get_pagination_token_output_to_parameter_name_mapping(operation_name)
Some Operations paginate their output using Pagination Token Parameters defined in PAGINATION_TOKEN_KEYS
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
operation_name |
str
|
Name of the operation in the resource_node. |
required |
Returns:
Type | Description |
---|---|
Union[Dict[str, str], bool]
|
Union[Dict[str, str], bool]: False or A dictionary with |