The magnumclient.common.utils
Module¶
-
magnumclient.common.utils.
args_array_to_patch
(op, attributes)¶
-
magnumclient.common.utils.
common_filters
(marker=None, limit=None, sort_key=None, sort_dir=None)¶ Generate common filters for any list request.
Parameters: - marker – entity ID from which to start returning entities.
- limit – maximum number of entities to return.
- sort_key – field to use for sorting.
- sort_dir – direction of sorting: ‘asc’ or ‘desc’.
Returns: list of string filters.
-
magnumclient.common.utils.
format_labels
(lbls, parse_comma=True)¶ Reformat labels into dict of format expected by the API.
-
magnumclient.common.utils.
handle_json_from_file
(json_arg)¶ Attempts to read JSON file by the file url.
Parameters: json_arg – May be a file name containing the JSON. Returns: A list or dictionary parsed from JSON.
-
magnumclient.common.utils.
handle_labels
(labels)¶
-
magnumclient.common.utils.
print_list_field
(field)¶
-
magnumclient.common.utils.
split_and_deserialize
(string)¶ Split and try to JSON deserialize a string.
Gets a string with the KEY=VALUE format, split it (using ‘=’ as the separator) and try to JSON deserialize the VALUE. :returns: A tuple of (key, value).