The magnumclient.common.utils Module

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.config_cluster(cluster, cluster_template, cfg_dir, force=False)

Return and write configuration for the given cluster.

magnumclient.common.utils.format_labels(lbls, parse_comma=True)

Reformat labels into dict of format expected by the API.

magnumclient.common.utils.generate_csr_and_key()

Return a dict with a new csr and key.

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).

Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.