예제 #1
0
def blueprints_undo(socket_path, api_version, args, show_json=False):
    """Undo changes to a blueprint

    :param socket_path: Path to the Unix socket to use for API communication
    :type socket_path: str
    :param api_version: Version of the API to talk to. eg. "0"
    :type api_version: str
    :param args: List of remaining arguments from the cmdline
    :type args: list of str
    :param show_json: Set to True to show the JSON output instead of the human readable output
    :type show_json: bool

    blueprints undo <blueprint> <commit>   Undo changes to a blueprint by reverting to the selected commit.
    """
    if len(args) == 0:
        log.error("undo is missing the blueprint name and commit hash")
        return 1
    elif len(args) == 1:
        log.error("undo is missing commit hash")
        return 1

    api_route = client.api_url(api_version,
                               "/blueprints/undo/%s/%s" % (args[0], args[1]))
    result = client.post_url(socket_path, api_route, "")

    return handle_api_result(result, show_json)
예제 #2
0
def blueprints_tag(socket_path, api_version, args, show_json=False):
    """Tag the most recent blueprint commit as a release

    :param socket_path: Path to the Unix socket to use for API communication
    :type socket_path: str
    :param api_version: Version of the API to talk to. eg. "0"
    :type api_version: str
    :param args: List of remaining arguments from the cmdline
    :type args: list of str
    :param show_json: Set to True to show the JSON output instead of the human readable output
    :type show_json: bool

    blueprints tag <blueprint>             Tag the most recent blueprint commit as a release.
    """
    api_route = client.api_url(api_version, "/blueprints/tag/%s" % args[0])
    result = client.post_url(socket_path, api_route, "")

    return handle_api_result(result, show_json)