diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d642a24941..45da848fa0 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -134,6 +134,12 @@ jobs: - name: Test build working-directory: "rtd-docs" run: make html + - name: Run scripts tests + working-directory: "rtd-docs" + run: | + source .sphinx/venv/bin/activate + pip install -r requirements-dev.txt + cd _scripts && python -m pytest . ci-check: runs-on: ubuntu-slim diff --git a/docs/usr/tools/cli_page.md.j2 b/docs/usr/tools/cli_page.md.j2 index 1937c27bf1..02385eea4c 100644 --- a/docs/usr/tools/cli_page.md.j2 +++ b/docs/usr/tools/cli_page.md.j2 @@ -29,11 +29,9 @@ {% endif %} -{% if keywords_text or (keywords and (keywords.lead or keywords.params)) %} +{% if keywords_text or (keywords and keywords.params) %} #### **Keywords** -{% if keywords and keywords.lead %}{{ keywords.lead|safe }} - -{% elif keywords_text %}{{ keywords_text|safe }} +{% if keywords_text %}{{ keywords_text|safe }} {% endif %} {% if keywords and keywords.params %} diff --git a/docs/usr/tools/generate.py b/docs/usr/tools/generate.py index c028a3eb3f..12b4f1f2c1 100755 --- a/docs/usr/tools/generate.py +++ b/docs/usr/tools/generate.py @@ -6,9 +6,9 @@ import argparse import json +from pathlib import Path import re import sys -from pathlib import Path try: from jinja2 import Environment, FileSystemLoader, select_autoescape @@ -63,68 +63,94 @@ def normalize_period_spacing(text): """Normalize spacing after periods to single space.""" - return re.sub(r'\.\s{2,}', '. ', text) + return re.sub(r"\.\s{2,}", ". ", text) def fix_ellipsis(text): """Replace '...' with proper ellipsis symbol '…'.""" - return re.sub(r'\.\.\.(?!\w)', '…', text) + return re.sub(r"\.\.\.(?!\w)", "…", text) def fix_lexical_illusions(text): """Remove repeated words (lexical illusions).""" - text = re.sub(r'(\d+)\*(\d+)\*(\d+)', r'\1 * \2 * \3', text) - if re.search(r'[*+\-=/]\s*\d+\s*[*+\-=/]', text): + text = re.sub(r"(\d+)\*(\d+)\*(\d+)", r"\1 * \2 * \3", text) + if re.search(r"[*+\-=/]\s*\d+\s*[*+\-=/]", text): return text - text = re.sub(r'\bOptional\s+\w+\.\s+Optional\.\s+Optional\s+', - lambda m: m.group(0).replace(' Optional. Optional ', ' '), text, flags=re.IGNORECASE) - text = re.sub(r'\bOptional\s+\w+\.\s+Optional\.\s+Optional\b', - lambda m: m.group(0).replace(' Optional. Optional', ''), text, flags=re.IGNORECASE) - text = re.sub(r'\bOptional\s+\w+\.\s+Optional\.', - lambda m: m.group(0).replace(' Optional.', ''), text, flags=re.IGNORECASE) - text = re.sub(r'\bOptional\.\s+Optional\.', 'Optional.', text, flags=re.IGNORECASE) - text = re.sub(r'\balso\s+also\b', 'also', text, flags=re.IGNORECASE) - text = re.sub(r'\band\s+and\b', 'and', text, flags=re.IGNORECASE) - text = re.sub(r'\b(the|a|an|is|are|was|were)\s+\1\b', r'\1', text, flags=re.IGNORECASE) + text = re.sub( + r"\bOptional\s+\w+\.\s+Optional\.\s+Optional\s+", + lambda m: m.group(0).replace(" Optional. Optional ", " "), + text, + flags=re.IGNORECASE, + ) + text = re.sub( + r"\bOptional\s+\w+\.\s+Optional\.\s+Optional\b", + lambda m: m.group(0).replace(" Optional. Optional", ""), + text, + flags=re.IGNORECASE, + ) + text = re.sub( + r"\bOptional\s+\w+\.\s+Optional\.", + lambda m: m.group(0).replace(" Optional.", ""), + text, + flags=re.IGNORECASE, + ) + text = re.sub( + r"\bOptional\.\s+Optional\.", "Optional.", text, flags=re.IGNORECASE + ) + text = re.sub(r"\balso\s+also\b", "also", text, flags=re.IGNORECASE) + text = re.sub(r"\band\s+and\b", "and", text, flags=re.IGNORECASE) + text = re.sub( + r"\b(the|a|an|is|are|was|were)\s+\1\b", + r"\1", + text, + flags=re.IGNORECASE, + ) return text def fix_curly_quotes(text): """Replace straight quotes with curly quotes.""" - if '
' in text or '`' not in text: - left_quote = "\u201C" - right_quote = "\u201D" - text = re.sub(r'"([a-zA-Z0-9\-]+)"', left_quote + r'\1' + right_quote, text) - text = re.sub(r'"(\d+-\w+)"', left_quote + r'\1' + right_quote, text) + if "
" in text or "`" not in text: + left_quote = "\u201c" + right_quote = "\u201d" + text = re.sub( + r'"([a-zA-Z0-9\-]+)"', left_quote + r"\1" + right_quote, text + ) + text = re.sub(r'"(\d+-\w+)"', left_quote + r"\1" + right_quote, text) return text def fix_weasel_words(text): """Remove or replace weasel words like 'very'.""" - return re.sub(r'\bvery\s+', '', text, flags=re.IGNORECASE) + return re.sub(r"\bvery\s+", "", text, flags=re.IGNORECASE) def fix_common_misspellings(text): """Fix common misspellings found in generated documentation.""" misspellings = { - 'intented': 'intended', - 'sensative': 'sensitive', - 'authorititative': 'authoritative', - 'conntected': 'connected', - 'freqeuncy': 'frequency', - 'inteface': 'interface', - 'adddress': 'address', - 'contoller': 'controller', - 'identifing': 'identifying', - 'seperated': 'separated', - 'specifed': 'specified', - 'assoicated': 'associated', - 'dimissing': 'dismissing', - 'transfered': 'transferred', + "intented": "intended", + "sensative": "sensitive", + "authorititative": "authoritative", + "conntected": "connected", + "freqeuncy": "frequency", + "inteface": "interface", + "adddress": "address", + "contoller": "controller", + "identifing": "identifying", + "seperated": "separated", + "specifed": "specified", + "assoicated": "associated", + "dimissing": "dismissing", + "transfered": "transferred", } for wrong, correct in misspellings.items(): - text = re.sub(r'\b' + re.escape(wrong) + r'\b', correct, text, flags=re.IGNORECASE) + text = re.sub( + r"\b" + re.escape(wrong) + r"\b", + correct, + text, + flags=re.IGNORECASE, + ) return text @@ -154,7 +180,7 @@ def escape_md(text): """Escape markdown pipe characters.""" if not text: return "" - return text.replace('|', '\\|') + return text.replace("|", "\\|") def bold_list_leaders(text): @@ -165,7 +191,7 @@ def bold_list_leaders(text): processed = [] for ln in lines: stripped = ln.lstrip() - indent = (m.group(0) if (m := re.match(r"^\s+", ln)) else "") + indent = m.group(0) if (m := re.match(r"^\s+", ln)) else "" if stripped.startswith("- ") and ":" in stripped: head, rest = stripped[2:].split(":", 1) head = head.strip() @@ -180,7 +206,7 @@ def parse_param_or_type_line(line, prefix): if not line.startswith(prefix): return None try: - after = line[len(prefix):] + after = line[len(prefix) :] name, value = after.split(":", 1) return name.strip(), value.strip() except ValueError: @@ -194,7 +220,9 @@ def collect_continuation_lines(lines, start_idx): while j < len(lines): next_line = lines[j] next_stripped = next_line.strip() - if next_stripped.startswith(":param ") or next_stripped.startswith(":type "): + if next_stripped.startswith(":param ") or next_stripped.startswith( + ":type " + ): break collected.append(next_stripped) j += 1 @@ -238,14 +266,16 @@ def is_sentence_fragment(sent, prev_sentences, index): if abs(len(sent_lower) - len(prev_lower)) > 10: return True if index > 0 and not sent[0].isupper(): - if re.match(r'^(mode|and|or|the|a|an|to|for|with|in|on|at)\s+', sent_lower): + if re.match( + r"^(mode|and|or|the|a|an|to|for|with|in|on|at)\s+", sent_lower + ): return True return False def remove_duplicate_sentences(text): """Remove duplicate sentences and fragments from text.""" - sentences = re.split(r'\.\s+', text) + sentences = re.split(r"\.\s+", text) seen = set() cleaned = [] for i, sent in enumerate(sentences): @@ -253,13 +283,15 @@ def remove_duplicate_sentences(text): if not sent: continue sent_lower = sent.lower() - if sent_lower not in seen and not is_sentence_fragment(sent, cleaned, i): + if sent_lower not in seen and not is_sentence_fragment( + sent, cleaned, i + ): seen.add(sent_lower) cleaned.append(sent) if cleaned: - result = '. '.join(cleaned) - if not result.endswith('.'): - result += '.' + result = ". ".join(cleaned) + if not result.endswith("."): + result += "." return result.strip() return text @@ -276,7 +308,9 @@ def normalize_options_list(options): moved_notes.append( "If credentials are not provided on the command-line, they will be prompted for interactively." ) - eff_text = eff_text.split("If credentials are not provided", 1)[0].rstrip() + eff_text = eff_text.split("If credentials are not provided", 1)[ + 0 + ].rstrip() if eff_text: eff_text = apply_all_text_fixes(eff_text) @@ -290,9 +324,11 @@ def normalize_options_list(options): def remove_optional_prefix(text): """Remove leading Optional/Required prefixes from descriptions.""" - while re.match(r'^(Optional|Required)\.\s+', text, flags=re.IGNORECASE): - text = re.sub(r'^(Optional|Required)\.\s+', '', text, flags=re.IGNORECASE) - text = re.sub(r'^Optional\s+', '', text, flags=re.IGNORECASE) + while re.match(r"^(Optional|Required)\.\s+", text, flags=re.IGNORECASE): + text = re.sub( + r"^(Optional|Required)\.\s+", "", text, flags=re.IGNORECASE + ) + text = re.sub(r"^Optional\s+", "", text, flags=re.IGNORECASE) return text @@ -311,7 +347,12 @@ def clean_lead_text(lead_lines, parsed_param_names): continue cleaned.append(line) lead = "\n".join(cleaned).strip() - lead = re.sub(r'(:param\s+\w+:\s+(?:Optional|Required))\.\s{2,}', r'\1. ', lead, flags=re.IGNORECASE) + lead = re.sub( + r"(:param\s+\w+:\s+(?:Optional|Required))\.\s{2,}", + r"\1. ", + lead, + flags=re.IGNORECASE, + ) lead = apply_all_text_fixes(lead) return format_keyword_text(lead) @@ -380,7 +421,9 @@ def parse_keywords_text(keywords_text): line = raw.strip() if line.startswith(":param "): - next_idx, param_name = parse_param_line(lines, i, params, param_order, parsed_param_names) + next_idx, param_name = parse_param_line( + lines, i, params, param_order, parsed_param_names + ) if param_name: current_param = param_name i = next_idx @@ -492,9 +535,7 @@ def extract_positional_args(usage, command_path): return [ t.strip(",|") for t in tokens - if t not in {"...", "COMMAND", "|"} - and "{" not in t - and "}" not in t + if t not in {"...", "COMMAND", "|"} and "{" not in t and "}" not in t ] @@ -520,9 +561,11 @@ def format_positional_args(args): def is_malformed_content(content): """Check if content looks like malformed concatenated text.""" - if re.match(r'^\[--[\w-]+', content.strip()): + if re.match(r"^\[--[\w-]+", content.strip()): return True - if len(content) > 500 and not any(marker in content for marker in ['. ', '.\n', '
', '\n\n']): + if len(content) > 500 and not any( + marker in content for marker in [". ", ".\n", "
", "\n\n"] + ): return True return False @@ -533,7 +576,9 @@ def clean_additional_sections(additional_sections): for sec in additional_sections: if isinstance(sec, dict) and isinstance(sec.get("content"), str): content = sec["content"] - if sec.get("title") == "additional_info" and is_malformed_content(content): + if sec.get("title") == "additional_info" and is_malformed_content( + content + ): continue content = apply_all_text_fixes(content) sec["content"] = bold_list_leaders(content) @@ -559,13 +604,17 @@ def generate_command_markdown(env, command, command_path): if not ln.strip().lower().startswith("cli help for:") ] overview = normalize_text("\n".join(overview_lines)) - if overview and overview.endswith("
") and should_blank_overview(overview): + if ( + overview + and overview.endswith("
") + and should_blank_overview(overview) + ): overview = "" usage_raw = command.get("usage", "") options = command.get("options", []) keywords_text = command.get("keywords_text", "") keywords = parse_keywords_text(keywords_text) - + usage = format_usage(usage_raw, command_path) if overview_lines: ov_line = overview_lines[0].strip() @@ -575,9 +624,7 @@ def generate_command_markdown(env, command, command_path): additional_sections = command.get("additional_sections", []) has_pos_section = has_positional_section(additional_sections) positional_args = ( - [] - if has_pos_section - else extract_positional_args(usage, command_path) + [] if has_pos_section else extract_positional_args(usage, command_path) ) if (not has_pos_section) and not positional_args and overview: @@ -629,11 +676,11 @@ def path_to_filename(path): def pluralize_for_filename(base_name): """Convert singular filename to plural form for lookup.""" plural_map = { - 'commissioning-script': 'commissioning-scripts', - 'event': 'events', - 'ipaddress': 'ipaddresses', - 'node-result': 'node-results', - 'vmfs-datastore': 'vmfs-datastores', + "commissioning-script": "commissioning-scripts", + "event": "events", + "ipaddress": "ipaddresses", + "node-result": "node-results", + "vmfs-datastore": "vmfs-datastores", } return plural_map.get(base_name, base_name) @@ -727,9 +774,7 @@ def parse_key_to_group(key): return top, command_path if len(parts) == 2: return parts[1], parts[1] - fallback = ( - " ".join(parts[1:]) if parts and parts[0] == "maas" else key - ) + fallback = " ".join(parts[1:]) if parts and parts[0] == "maas" else key return fallback or key, fallback or key @@ -792,7 +837,9 @@ def main(): output_dir.mkdir(parents=True, exist_ok=True) if Environment is None: - print("Error: Jinja2 is required to render templates.", file=sys.stderr) + print( + "Error: Jinja2 is required to render templates.", file=sys.stderr + ) return 1 env = Environment( loader=FileSystemLoader(args.template_dir), @@ -807,9 +854,7 @@ def main(): if not k: continue seen_keys[k] = node - unique_commands = [ - seen_keys[k] for k in sorted(seen_keys.keys()) - ] + unique_commands = [seen_keys[k] for k in sorted(seen_keys.keys())] groups = group_commands_by_resource(unique_commands) @@ -869,7 +914,7 @@ def main(): with open(filepath, "w", encoding="utf-8") as wf: wf.write(markdown_content) - print(f"Documentation generation completed!") + print("Documentation generation completed!") print(f"Output directory: {output_dir}") print(f"Files created: {files_created}") print(f"Files updated: {files_updated}") @@ -882,4 +927,5 @@ def main(): if __name__ == "__main__": - exit(main()) \ No newline at end of file + exit(main()) + diff --git a/docs/usr/tools/maas_cli_introspection.py b/docs/usr/tools/maas_cli_introspection.py index ff79d80dd2..6da651afed 100755 --- a/docs/usr/tools/maas_cli_introspection.py +++ b/docs/usr/tools/maas_cli_introspection.py @@ -54,12 +54,16 @@ def _patch_maas_metadata(): if _ilm is not None: _orig = getattr(_ilm, "distribution", None) if _orig is not None: + def _fake(name): if name == "maas": + class _Dummy: version = "0.0.0" + return _Dummy() return _orig(name) + _ilm.distribution = _fake @@ -73,6 +77,7 @@ def build_parser(argv0="maas"): if not snap_env_was_set: try: import maascli.snap + os.environ["SNAP"] = "/snap/maas/current" os.environ["SNAP_DATA"] = "/var/snap/maas/current" os.environ["SNAP_COMMON"] = "/var/snap/maas/common" @@ -104,12 +109,14 @@ def generate_api_description_from_source(): try: import django + django.setup() except ImportError: return None try: from maasserver.api.doc import get_api_description + return get_api_description() except ImportError: return None @@ -181,15 +188,18 @@ def collect_optional_rows(parser): metavar = None if getattr(action, "metavar", None): metavar = action.metavar - elif getattr(action, "nargs", None) not in (0, None) and getattr( - action, "type", None - ) is not bool: + elif ( + getattr(action, "nargs", None) not in (0, None) + and getattr(action, "type", None) is not bool + ): metavar = action.dest.upper().replace("-", "_") if metavar: option_sig = f"{option_sig} {metavar}" help_text = help_text or "" help_text = str(help_text).replace("|", r"\|") - help_text = "
".join(line.strip() for line in help_text.splitlines()).strip() + help_text = "
".join( + line.strip() for line in help_text.splitlines() + ).strip() rows.append( { "option": option_sig, @@ -286,10 +296,7 @@ def describe_parser(parser, path): "options": collect_optional_rows(parser), "children": [], "overview": description.strip() - or ( - "CLI help for: " - + re.sub(r"^\s*usage\s*:?\s*", "", usage) - ), + or ("CLI help for: " + re.sub(r"^\s*usage\s*:?\s*", "", usage)), "example": "", "keywords_text": str(epilog).strip(), "accepts_json": accepts_json, @@ -312,9 +319,7 @@ def walk(parser, path): def flatten(node): """Flatten a tree of nodes into a list.""" - out = [ - {k: v for k, v in node.items() if k != "children"} - ] + out = [{k: v for k, v in node.items() if k != "children"}] for c in node.get("children", []): out.extend(flatten(c)) return out @@ -356,7 +361,9 @@ def _parse_positional_args_compact(full_text, matches): for i, match in enumerate(matches): arg_name = match.group(1) desc_start = match.end() - desc_end = matches[i + 1].start() if i + 1 < len(matches) else len(full_text) + desc_end = ( + matches[i + 1].start() if i + 1 < len(matches) else len(full_text) + ) desc = full_text[desc_start:desc_end].strip() if desc.endswith(".") and i + 1 < len(matches): desc = desc[:-1].strip() @@ -406,18 +413,19 @@ def _parse_positional_args_multiline(content): def normalize_positional_args(content): """Normalize positional arguments section by extracting argument names and descriptions.""" full_text = " ".join(line.strip() for line in content if line.strip()) - matches = list(re.finditer(r'(\S+)\s{2,}', full_text)) + matches = list(re.finditer(r"(\S+)\s{2,}", full_text)) if len(matches) > 1: entries = _parse_positional_args_compact(full_text, matches) else: entries = _parse_positional_args_multiline(content) - + return "\n".join(entries) def extract_usage_and_overview(lines, command): """Extract usage string and overview description from help text lines.""" + def is_usage_line(s): return re_usage_line.match(s) is not None @@ -429,8 +437,10 @@ def is_usage_line(s): in_usage = True usage_lines.append(s) continue - elif in_usage and s and not s.startswith( - ("options:", "optional arguments:") + elif ( + in_usage + and s + and not s.startswith(("options:", "optional arguments:")) ): usage_lines.append(s) elif in_usage and ( @@ -442,7 +452,9 @@ def is_usage_line(s): elif in_usage: break - usage = " ".join(usage_lines) if usage_lines else f"usage: maas {command} [-h]" + usage = ( + " ".join(usage_lines) if usage_lines else f"usage: maas {command} [-h]" + ) in_usage_section = False overview = "" @@ -451,8 +463,12 @@ def is_usage_line(s): if is_usage_line(s): in_usage_section = True continue - if in_usage_section and s and not s.startswith( - ("usage", "options", "optional arguments", "[") + if ( + in_usage_section + and s + and not s.startswith( + ("usage", "options", "optional arguments", "[") + ) ): overview = s break @@ -516,14 +532,18 @@ def collect_additional_text(lines, overview, section_raw_lines): return "" -def handle_section_header(state, line_stripped, section_raw_lines, options, additional_sections): +def handle_section_header( + state, line_stripped, section_raw_lines, options, additional_sections +): """Handle transition to a new section header. Returns updated parsing state dict.""" if state["current_section"] is not None: if state["current_section"] in ("options", "optional arguments"): if state["current_option"] is not None: - options.append(finalize_option( - state["current_option"], state["current_desc_lines"] - )) + options.append( + finalize_option( + state["current_option"], state["current_desc_lines"] + ) + ) elif state["current_section_content"]: additional_sections.append( finalize_section( @@ -534,7 +554,9 @@ def handle_section_header(state, line_stripped, section_raw_lines, options, addi ) ) - section_raw_lines.update(rl.strip() for rl in state["current_section_content_raw"]) + section_raw_lines.update( + rl.strip() for rl in state["current_section_content_raw"] + ) new_section = line_stripped.rstrip(":") in_options = new_section in ("options", "optional arguments") @@ -560,7 +582,9 @@ def process_option_line(line, s, current_option, current_desc_lines, options): if m := re_opt_desc.match(s): return m.group("opt").strip(), [m.group("desc").strip()] return s, [] - elif current_option is not None and (line.startswith(" ") or line.startswith("\t")): + elif current_option is not None and ( + line.startswith(" ") or line.startswith("\t") + ): current_desc_lines.append(s) return current_option, current_desc_lines @@ -571,7 +595,7 @@ def parse_help_sections(lines, overview): options = [] additional_sections = [] section_raw_lines = set() - + state = { "current_section": None, "current_section_content": [], @@ -587,14 +611,23 @@ def parse_help_sections(lines, overview): if line_stripped.endswith(":") and not line_stripped.startswith("-"): state = handle_section_header( - state, line_stripped, section_raw_lines, options, additional_sections + state, + line_stripped, + section_raw_lines, + options, + additional_sections, ) continue if state["in_options"]: - state["current_option"], state["current_desc_lines"] = process_option_line( - line, line_stripped, state["current_option"], - state["current_desc_lines"], options + state["current_option"], state["current_desc_lines"] = ( + process_option_line( + line, + line_stripped, + state["current_option"], + state["current_desc_lines"], + options, + ) ) elif state["in_other_section"]: state["current_section_content"].append(line) @@ -608,9 +641,11 @@ def parse_help_sections(lines, overview): if state["current_section"] is not None: if state["current_section"] in ("options", "optional arguments"): if state["current_option"] is not None: - options.append(finalize_option( - state["current_option"], state["current_desc_lines"] - )) + options.append( + finalize_option( + state["current_option"], state["current_desc_lines"] + ) + ) else: if state["current_section_content"]: additional_sections.append( @@ -622,9 +657,13 @@ def parse_help_sections(lines, overview): ) ) - additional_text = collect_additional_text(lines, overview, section_raw_lines) + additional_text = collect_additional_text( + lines, overview, section_raw_lines + ) if additional_text: - additional_sections.append({"title": "additional_info", "content": additional_text}) + additional_sections.append( + {"title": "additional_info", "content": additional_text} + ) return options, additional_sections @@ -827,7 +866,9 @@ def _collect_action_form_reports(handler_class, name, action_form_registry): if not issubclass(handler_class, base_class): continue form_fields = _get_form_field_names(action_form_class) - docstring_params = _get_action_docstring_params(handler_class, action_name) + docstring_params = _get_action_docstring_params( + handler_class, action_name + ) missing = form_fields - docstring_params if not missing: continue @@ -945,7 +986,8 @@ def main(): try: parser = build_parser() - except Exception: + except Exception as e: + print(f"could not build parser: {e}", file=sys.stderr) return 2 try_register_api_profile(parser) diff --git a/rtd-docs/.gitignore b/rtd-docs/.gitignore index fe4a02ae84..9079b2fd5a 100644 --- a/rtd-docs/.gitignore +++ b/rtd-docs/.gitignore @@ -18,6 +18,7 @@ _build # Generated Documentation reference/api-reference/api-v2-generated.md +reference/cli-reference/* # Node.js package*.json diff --git a/rtd-docs/Makefile b/rtd-docs/Makefile index 81b97b760c..c7843fa0a8 100644 --- a/rtd-docs/Makefile +++ b/rtd-docs/Makefile @@ -79,7 +79,7 @@ pymarkdownlnt-install: install: $(VENVDIR) run: install - . $(VENV); $(VENVDIR)/bin/sphinx-autobuild -b dirhtml --host $(SPHINX_HOST) --port $(SPHINX_PORT) "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) + . $(VENV); $(VENVDIR)/bin/sphinx-autobuild -b dirhtml --host $(SPHINX_HOST) --port $(SPHINX_PORT) "$(SOURCEDIR)" "$(BUILDDIR)" --ignore "reference/api-reference/api-v2-generated.md" --ignore "reference/cli-reference/*" $(SPHINXOPTS) # Does not depend on $(BUILDDIR) to rebuild properly at every run. html: install diff --git a/rtd-docs/_ext/generate_cli_docs_extension.py b/rtd-docs/_ext/generate_cli_docs_extension.py new file mode 100644 index 0000000000..1f16403baa --- /dev/null +++ b/rtd-docs/_ext/generate_cli_docs_extension.py @@ -0,0 +1,65 @@ +#!/usr/bin/env python3 +# Copyright 2026 Canonical Ltd. This software is licensed under the +# GNU Affero General Public License version 3 (see the file LICENSE). + +"""Sphinx extension to automatically generate CLI documentation. + +This extension runs during the Sphinx build process and automatically +generates the CLI documentation by calling generate_cli_docs.py, which +in turn generates the CLI documentation markdown file. + +The generated file is created before Sphinx processes the markdown files, +ensuring the CLI documentation is always up-to-date. +""" + +from pathlib import Path +import sys + +from sphinx.util import logging + +logger = logging.getLogger(__name__) + + +def generate_cli_docs(app, config): + """Generate API documentation during Sphinx build. + + This function is called during the config-inited phase of Sphinx, + which happens before any source files are read. + """ + rtd_docs_dir = Path(app.srcdir) + scripts_dir = rtd_docs_dir / "_scripts" + + generate_script = scripts_dir / "generate_cli_docs.py" + + if not generate_script.exists(): + logger.warning( + f"API docs generator script not found: {generate_script}" + ) + return + + sys.path.insert(0, str(scripts_dir)) + + try: + import generate_cli_docs as gen_module + + gen_module.generate_cli_docs() + + except Exception as e: + logger.warning(f"Failed to generate API documentation: {e}") + import traceback + + logger.warning(traceback.format_exc()) + + +def setup(app): + """Sphinx extension setup function. + + This function is called by Sphinx to register the extension. + """ + app.connect("config-inited", generate_cli_docs) + + return { + "version": "1.0", + "parallel_read_safe": True, + "parallel_write_safe": True, + } diff --git a/rtd-docs/_scripts/_templates/cli_index.md.j2 b/rtd-docs/_scripts/_templates/cli_index.md.j2 new file mode 100644 index 0000000000..c74857672a --- /dev/null +++ b/rtd-docs/_scripts/_templates/cli_index.md.j2 @@ -0,0 +1,13 @@ +{# Copyright 2025 Canonical Ltd. This software is licensed under the +# GNU Affero General Public License version 3 (see the file LICENSE). +#} +# CLI reference + +```{toctree} +:titlesonly: +:maxdepth: 2 + +{% for name in entries %} +{{ name }} +{% endfor %} +``` diff --git a/rtd-docs/_scripts/_templates/cli_page.md.j2 b/rtd-docs/_scripts/_templates/cli_page.md.j2 new file mode 100644 index 0000000000..629a14cf4c --- /dev/null +++ b/rtd-docs/_scripts/_templates/cli_page.md.j2 @@ -0,0 +1,142 @@ +{# Copyright 2025 Canonical Ltd. This software is licensed under the +# GNU Affero General Public License version 3 (see the file LICENSE). +#} +## {{ title }} + +{% if overview %}{{ overview }} +{% endif %} + +```bash +{{ usage }} + +``` + +{% if positional_args %} +### **Positional arguments** +| Argument | Effect | +|---|---| +{% for arg in positional_args %} +| {{ arg }} | {% if arg in positional_arg_descriptions %}{{ positional_arg_descriptions[arg] }}{% else %}The {{ arg }} parameter{% endif %} | +{% endfor %} + +{% endif %} + +{% if options %} +### **Command-line options** +| Option | Effect | +|---|---| +{% for row in options %} +| {{ row.option }} | {{ row.effect|safe }} | +{% endfor %} + +{% endif %} + +{% if keywords_text or (keywords and keywords.params) %} +### **Keywords** +{% if keywords_text %}{{ keywords_text|safe }} + +{% endif %} +{% if keywords and keywords.params %} +{% for p in keywords.params %} +#### Keyword "{{ p.name }}" +{% set desc_trimmed = (p.desc|trim) if p.desc else '' %} +{% if p.type %}Optional {{ p.type }}.{% else %}Optional.{% endif %}{% if desc_trimmed %} {{ desc_trimmed|safe }}{% endif %} + +{% endfor %} +{% endif %} +{% endif %} + +{% if additional_sections %} +{% for section in additional_sections %} +{% if section.title == "run modes" %} +### **Run modes** +{% set lines = section.content.split('\n') %} +{% set ns = namespace(started=false) %} +{% for line in lines %} +{% set line_stripped = line.strip() %} +{% set ns.is_excluded = false %} +{% for prefix in run_modes_excluded_prefixes %} + {% if line_stripped.startswith(prefix) %} + {% set ns.is_excluded = true %} + {% endif %} +{% endfor %} +{% if line_stripped and not ns.is_excluded %} +{% if not ns.started %} +| Mode | Effect | +|---|---| +{% set ns.started = true %} +{% endif %} +{% set parts = line_stripped.split(' ', 1) %} +{% if parts|length == 2 %} +| {{ parts[0] }} | {{ parts[1] }} | +{% else %} +| {{ line_stripped }} | | +{% endif %} +{% endif %} +{% endfor %} + +When installing region or rack+region modes, MAAS needs a PostgreSQL database to connect to. + +If you want to set up PostgreSQL for a non-production deployment on this machine, and configure it for use with MAAS, you can install the `maas-test-db` snap before running `maas init`: + +{% elif section.title == "positional arguments" %} + +### **Positional arguments** +| Argument | Effect | +|---|---| +{% set lines = section.content.split('\n') %} +{% for line in lines %} +{% set line_stripped = line.strip() %} +{% set ns = namespace(is_excluded=false) %} +{% for prefix in positional_args_excluded_prefixes %} + {% if line_stripped.startswith(prefix) %} + {% set ns.is_excluded = true %} + {% endif %} +{% endfor %} +{% if line_stripped and not ns.is_excluded %} +{% set parts = line_stripped.split(' ', 1) %} +{% if parts|length == 2 %} +| {{ parts[0] }} | {{ parts[1] }} | +{% else %} +| {{ line_stripped }} | | +{% endif %} +{% endif %} +{% endfor %} + +{% elif section.title == "additional_info" %} +{{ section.content|safe }} +{% elif section.title == "drill down" %} + +### **Drill down** +| Command | Effect | +|---|---| +{% for l in section.content.split('\n') %} +{% set t = l.rstrip() %} +{% if t and t.strip() != 'COMMAND' %} +{% set s = t.strip() %} +{% if ' ' in s %} +{% set p = s.split(' ', 1) %} +| {{ p[0] }} | {{ p[1].strip() }} | +{% endif %} +{% endif %} +{% endfor %} + +{% elif section.title == "the maas-test-db snap before running 'maas init'" %} + +```bash +{{ section.content | replace(' ', '') | trim }} + +``` + +{% else %} + +### **{{ section.title|safe }}** +{{ section.content|safe }} + +{% endif %} +{% endfor %} +{% endif %} + +{% if accepts_json or returns_json %} +Note: This command{% if accepts_json %} accepts JSON{% endif %}{% if accepts_json and returns_json %} and{% endif %}{% if returns_json %} returns JSON{% endif %}. +{% endif %} diff --git a/rtd-docs/_scripts/generate_cli_docs.py b/rtd-docs/_scripts/generate_cli_docs.py new file mode 100755 index 0000000000..add0ef8ec8 --- /dev/null +++ b/rtd-docs/_scripts/generate_cli_docs.py @@ -0,0 +1,914 @@ +#!/usr/bin/env python3 +# Copyright 2026 Canonical Ltd. This software is licensed under the +# GNU Affero General Public License version 3 (see the file LICENSE). + +"""Generate MAAS CLI documentation from introspector JSON.""" + +from pathlib import Path +import re +import sys + +from get_cli_spec import create_cli_items +from jinja2 import Environment, FileSystemLoader, select_autoescape + +RTD_DOCS = Path(__file__).parent.parent + + +positional_arg_descriptions = { + "system_id": "The system ID of the machine/device (e.g., `abc123`)", + "id": "The ID of the resource (e.g., `1`, `abc123`)", + "name": "The name of the resource (e.g., `my-machine`, `my-zone`)", + "data ...": "Additional settings you can add (e.g., `architecture=amd64 hostname=my-machine`)", +} + +run_modes_excluded_prefixes = [ + "{", + "}", + "When installing", + "If you want", + "sudo", + "PostgreSQL", + "this", + "-h", +] + +positional_args_excluded_prefixes = [ + "{", + "}", + "-", +] + +top_level = { + "login", + "logout", + "list", + "refresh", + "configauth", + "apikey", + "changepassword", + "config-tls", + "config-vault", + "createadmin", + "msm", + "status", + "init", + "config", + "migrate", +} + + +def normalize_period_spacing(text): + """Normalize spacing after periods to single space.""" + return re.sub(r"\.\s{2,}", ". ", text) + + +def fix_ellipsis(text): + """Replace '...' with proper ellipsis symbol '…'.""" + return re.sub(r"\.\.\.(?!\w)", "…", text) + + +def fix_lexical_illusions(text): + """Remove repeated words (lexical illusions).""" + text = re.sub(r"(\d+)\*(\d+)\*(\d+)", r"\1 * \2 * \3", text) + if re.search(r"[*+\-=/]\s*\d+\s*[*+\-=/]", text): + return text + text = re.sub( + r"\bOptional\s+\w+\.\s+Optional\.\s+Optional\s+", + lambda m: m.group(0).replace(" Optional. Optional ", " "), + text, + flags=re.IGNORECASE, + ) + text = re.sub( + r"\bOptional\s+\w+\.\s+Optional\.\s+Optional\b", + lambda m: m.group(0).replace(" Optional. Optional", ""), + text, + flags=re.IGNORECASE, + ) + text = re.sub( + r"\bOptional\s+\w+\.\s+Optional\.", + lambda m: m.group(0).replace(" Optional.", ""), + text, + flags=re.IGNORECASE, + ) + text = re.sub( + r"\bOptional\.\s+Optional\.", "Optional.", text, flags=re.IGNORECASE + ) + text = re.sub(r"\balso\s+also\b", "also", text, flags=re.IGNORECASE) + text = re.sub(r"\band\s+and\b", "and", text, flags=re.IGNORECASE) + text = re.sub( + r"\b(the|a|an|is|are|was|were)\s+\1\b", + r"\1", + text, + flags=re.IGNORECASE, + ) + return text + + +def fix_curly_quotes(text): + """Replace straight quotes with curly quotes.""" + if "
" in text or "`" not in text: + left_quote = "\u201c" + right_quote = "\u201d" + text = re.sub( + r'"([a-zA-Z0-9\-]+)"', left_quote + r"\1" + right_quote, text + ) + text = re.sub(r'"(\d+-\w+)"', left_quote + r"\1" + right_quote, text) + return text + + +def fix_weasel_words(text): + """Remove or replace weasel words like 'very'.""" + return re.sub(r"\bvery\s+", "", text, flags=re.IGNORECASE) + + +def fix_common_misspellings(text): + """Fix common misspellings found in generated documentation.""" + misspellings = { + "intented": "intended", + "sensative": "sensitive", + "authorititative": "authoritative", + "conntected": "connected", + "freqeuncy": "frequency", + "inteface": "interface", + "adddress": "address", + "contoller": "controller", + "identifing": "identifying", + "seperated": "separated", + "specifed": "specified", + "assoicated": "associated", + "dimissing": "dismissing", + "transfered": "transferred", + } + + for wrong, correct in misspellings.items(): + text = re.sub( + r"\b" + re.escape(wrong) + r"\b", + correct, + text, + flags=re.IGNORECASE, + ) + + return text + + +def apply_all_text_fixes(text): + """Apply all text normalization fixes.""" + if not text: + return "" + text = normalize_period_spacing(text) + text = fix_ellipsis(text) + text = fix_lexical_illusions(text) + text = fix_curly_quotes(text) + text = fix_weasel_words(text) + text = fix_common_misspellings(text) + return text + + +def normalize_text(text): + """Normalize text for Markdown output.""" + if not text: + return "" + text = re.sub(r"\r\n|\r|\n", " ", text.strip()).replace("|", "\\|") + return apply_all_text_fixes(text) + + +def escape_md(text): + """Escape markdown pipe characters.""" + if not text: + return "" + return text.replace("|", "\\|") + + +def bold_list_leaders(text): + """Bold the leader word(s) in list items like "- Name: details".""" + if not text: + return text + lines = text.splitlines() + processed = [] + for ln in lines: + stripped = ln.lstrip() + indent = m.group(0) if (m := re.match(r"^\s+", ln)) else "" + if stripped.startswith("- ") and ":" in stripped: + head, rest = stripped[2:].split(":", 1) + head = head.strip() + processed.append(f"{indent}- **{head}**:{rest}") + else: + processed.append(ln) + return "\n".join(processed) + + +def parse_param_or_type_line(line, prefix): + """Parse a :param or :type line, returning (name, value) or None if invalid.""" + if not line.startswith(prefix): + return None + try: + after = line[len(prefix) :] + name, value = after.split(":", 1) + return name.strip(), value.strip() + except ValueError: + return None + + +def collect_continuation_lines(lines, start_idx): + """Collect continuation lines until next :param or :type, returning lines and next index.""" + collected = [] + j = start_idx + 1 + while j < len(lines): + next_line = lines[j] + next_stripped = next_line.strip() + if next_stripped.startswith(":param ") or next_stripped.startswith( + ":type " + ): + break + collected.append(next_stripped) + j += 1 + return collected, j + + +def format_keyword_text(text): + """Format keyword text: escape markdown, replace sphinx-style references, join lines.""" + text = escape_md(text) + text = re.sub(r"(?m)^:([a-z0-9_\-]+):", r"**:\1:**", text) + text = apply_all_text_fixes(text) + return " ".join(text.splitlines()) if text else "" + + +def bold_sphinx_directives(text): + """Bold Sphinx-style directives like :name: without other formatting.""" + return re.sub(r"(?m)^:([a-z0-9_\-]+):", r"**:\1:**", text) + + +def should_blank_overview(overview): + """Decide whether to blank out overview per formatting heuristic.""" + tmp = overview.replace("
", " ").strip() + return bool(tmp and "." not in tmp and tmp.count(" ")) + + +def has_positional_section(additional_sections): + """Check if additional_sections contains a positional arguments section.""" + return any( + isinstance(sec, dict) + and str(sec.get("title", "")).strip().lower() == "positional arguments" + for sec in additional_sections + ) + + +def is_sentence_fragment(sent, prev_sentences, index): + """Check if a sentence is a fragment that should be removed.""" + sent_lower = sent.lower() + for prev_sent in prev_sentences: + prev_lower = prev_sent.lower() + if sent_lower in prev_lower or prev_lower in sent_lower: + if abs(len(sent_lower) - len(prev_lower)) > 10: + return True + if index > 0 and not sent[0].isupper(): + if re.match( + r"^(mode|and|or|the|a|an|to|for|with|in|on|at)\s+", sent_lower + ): + return True + return False + + +def remove_duplicate_sentences(text): + """Remove duplicate sentences and fragments from text.""" + sentences = re.split(r"\.\s+", text) + seen = set() + cleaned = [] + for i, sent in enumerate(sentences): + sent = sent.strip() + if not sent: + continue + sent_lower = sent.lower() + if sent_lower not in seen and not is_sentence_fragment( + sent, cleaned, i + ): + seen.add(sent_lower) + cleaned.append(sent) + if cleaned: + result = ". ".join(cleaned) + if not result.endswith("."): + result += "." + return result.strip() + return text + + +def normalize_options_list(options): + """Normalize options rows and extract moved notes.""" + normalized = [] + moved_notes = [] + for row in options: + opt_text = str(row.get("option", "")).rstrip() + eff_text = str(row.get("effect", "")).strip() + + if "If credentials are not provided" in eff_text: + moved_notes.append( + "If credentials are not provided on the command-line, they will be prompted for interactively." + ) + eff_text = eff_text.split("If credentials are not provided", 1)[ + 0 + ].rstrip() + + if eff_text: + eff_text = apply_all_text_fixes(eff_text) + eff_text = remove_duplicate_sentences(eff_text) + + if opt_text: + normalized.append({"option": opt_text, "effect": eff_text}) + + return normalized, moved_notes + + +def remove_optional_prefix(text): + """Remove leading Optional/Required prefixes from descriptions.""" + while re.match(r"^(Optional|Required)\.\s+", text, flags=re.IGNORECASE): + text = re.sub( + r"^(Optional|Required)\.\s+", "", text, flags=re.IGNORECASE + ) + text = re.sub(r"^Optional\s+", "", text, flags=re.IGNORECASE) + return text + + +def clean_lead_text(lead_lines, parsed_param_names): + """Remove parsed :param/:type lines from lead text.""" + cleaned = [] + for line in lead_lines: + line_stripped = line.strip() + if line_stripped.startswith(":param "): + parsed = parse_param_or_type_line(line_stripped, ":param ") + if parsed and parsed[0] in parsed_param_names: + continue + if line_stripped.startswith(":type "): + parsed = parse_param_or_type_line(line_stripped, ":type ") + if parsed and parsed[0] in parsed_param_names: + continue + cleaned.append(line) + lead = "\n".join(cleaned).strip() + lead = re.sub( + r"(:param\s+\w+:\s+(?:Optional|Required))\.\s{2,}", + r"\1. ", + lead, + flags=re.IGNORECASE, + ) + lead = apply_all_text_fixes(lead) + return format_keyword_text(lead) + + +def parse_param_line(lines, i, params, param_order, parsed_param_names): + """Parse a :param line and return next index and current param name.""" + raw = lines[i] + line = raw.strip() + parsed = parse_param_or_type_line(line, ":param ") + if parsed is None: + return i + 1, None + name, desc = parsed + parsed_param_names.add(name) + if name not in params: + params[name] = {"name": name, "desc": "", "type": ""} + param_order.append(name) + entry = params[name] + entry_desc_lines = [desc] + continuation_lines, next_idx = collect_continuation_lines(lines, i) + entry_desc_lines.extend(continuation_lines) + desc_text = "\n".join(entry_desc_lines).strip() + entry["desc"] = normalize_period_spacing(desc_text) + return next_idx, name + + +def parse_type_line(line, params, param_order): + """Parse a :type line. Returns True if parsed successfully.""" + parsed = parse_param_or_type_line(line, ":type ") + if parsed is None: + return False + name, typ = parsed + if name not in params: + params[name] = {"name": name, "desc": "", "type": ""} + param_order.append(name) + params[name]["type"] = typ + return True + + +def process_continuation_line(raw, current_param, params): + """Process a continuation line for current parameter.""" + if re.match(r"^\s", raw): + entry = params.get(current_param, {}) + desc_text = (entry.get("desc", "") + "\n" + raw.rstrip()).strip() + entry["desc"] = normalize_period_spacing(desc_text) + params[current_param] = entry + return True + return False + + +def parse_keywords_text(keywords_text): + """Parse sphinx-style epilog into structured keywords.""" + result = {"lead": "", "params": []} + if not keywords_text: + return result + + lines = keywords_text.splitlines() + lead_lines = [] + params = {} + param_order = [] + current_param = None + parsed_param_names = set() + + i = 0 + while i < len(lines): + raw = lines[i] + line = raw.strip() + + if line.startswith(":param "): + next_idx, param_name = parse_param_line( + lines, i, params, param_order, parsed_param_names + ) + if param_name: + current_param = param_name + i = next_idx + continue + lead_lines.append(raw) + i += 1 + elif line.startswith(":type "): + if parse_type_line(line, params, param_order): + i += 1 + continue + lead_lines.append(raw) + i += 1 + else: + if current_param is None: + if line.startswith(":param "): + parsed = parse_param_or_type_line(line, ":param ") + if parsed and parsed[0] in parsed_param_names: + i += 1 + continue + lead_lines.append(raw) + else: + if not process_continuation_line(raw, current_param, params): + lead_lines.append(raw) + i += 1 + + ordered_params = [params[name] for name in param_order] + lead = clean_lead_text(lead_lines, parsed_param_names) + + for e in ordered_params: + desc_text = remove_optional_prefix(e.get("desc", "").strip()) + desc_text = apply_all_text_fixes(desc_text) + e["desc"] = format_keyword_text(desc_text) + e["type"] = escape_md(e.get("type", "")).strip() + + result["lead"] = lead + result["params"] = ordered_params + return result + + +def format_usage(usage, command_path): + """Format usage string for Markdown.""" + if not usage: + parts = command_path.split() + return f"maas {' '.join(parts)} [-h]" + + usage = re.sub(r"^\s*usage\s*:?\s*", "", usage) + markers = [ + " positional arguments:", + " options:", + " optional arguments:", + " Keywords", + " Command-line options", + ] + for marker in markers: + idx = usage.find(marker) + if idx != -1: + usage = usage[:idx].rstrip() + + parts = command_path.split() + if parts and parts[0] in top_level: + return usage + + usage_parts = usage.split() + if len(usage_parts) > 1 and usage_parts[0] == "maas": + usage_parts[1] = "$PROFILE" + usage = " ".join(usage_parts) + + return usage + + +def format_options(options): + """Format command options as a Markdown table.""" + if not options: + return "" + + lines = [] + lines.append("#### Command-line options") + lines.append("| Option | Effect |") + lines.append("|---|---|") + for row in options: + opt_text = str(row.get("option", "")).strip() + eff_text = str(row.get("effect", "")).strip() + lines.append(f"| {opt_text} | {eff_text} |") + lines.append("") + return "\n".join(lines) + + +def extract_positional_args(usage, command_path): + """Extract positional arguments from usage.""" + if not usage: + return [] + parts = command_path.split() + if len(parts) == 1 and parts[0] in top_level: + return [] + scrubbed = re.sub(r"\[[^\]]*\]", "", usage) + tokens = scrubbed.split() + if not tokens: + return [] + if tokens and tokens[0] == "maas": + tokens.pop(0) + if tokens and tokens[0] == "$PROFILE": + tokens.pop(0) + path_tokens = command_path.split() + i = 0 + for pt in path_tokens: + if i < len(tokens) and tokens[i] == pt: + i += 1 + tokens = tokens[i:] + return [ + t.strip(",|") + for t in tokens + if t not in {"...", "COMMAND", "|"} and "{" not in t and "}" not in t + ] + + +def format_positional_args(args): + """Format positional arguments as Markdown table.""" + if not args: + return "" + + markdown = "#### Positional arguments\n" + markdown += "| Argument | Effect |\n" + markdown += "|----------|--------|\n" + + for arg in args: + description = positional_arg_descriptions.get( + arg, f"The {arg} parameter" + ) + + markdown += f"| {arg} | {description} |\n" + + markdown += "\n" + return markdown + + +def is_malformed_content(content): + """Check if content looks like malformed concatenated text.""" + if re.match(r"^\[--[\w-]+", content.strip()): + return True + if len(content) > 500 and not any( + marker in content for marker in [". ", ".\n", "
", "\n\n"] + ): + return True + return False + + +def clean_additional_sections(additional_sections): + """Filter and clean additional sections.""" + cleaned = [] + for sec in additional_sections: + if isinstance(sec, dict) and isinstance(sec.get("content"), str): + content = sec["content"] + if sec.get("title") == "additional_info" and is_malformed_content( + content + ): + continue + content = apply_all_text_fixes(content) + sec["content"] = bold_list_leaders(content) + if sec["content"].strip(): + cleaned.append(sec) + else: + cleaned.append(sec) + return cleaned + + +def render_with_template(env, context): + """Render template with context.""" + template = env.get_template("cli_page.md.j2") + return template.render(**context) + + +def extract_subcommand_title(command_path: str, group_name: str) -> str: + """Extract the subcommand action from a command path, stripping the group prefix.""" + parts = command_path.split() + if len(parts) > 1 and parts[0] == group_name: + return " ".join(parts[1:]) + return command_path + + +def generate_command_markdown(env, command, command_path, group_name=""): + """Generate Markdown content for a single command using Jinja2.""" + overview_raw = command.get("overview", "") or "" + overview_lines = [ + ln + for ln in overview_raw.splitlines() + if not ln.strip().lower().startswith("cli help for:") + ] + overview = normalize_text("\n".join(overview_lines)) + if ( + overview + and overview.endswith("
") + and should_blank_overview(overview) + ): + overview = "" + usage_raw = command.get("usage", "") + options = command.get("options", []) + keywords_text = command.get("keywords_text", "") + keywords = parse_keywords_text(keywords_text) + + usage = format_usage(usage_raw, command_path) + if overview_lines: + ov_line = overview_lines[0].strip() + if ov_line and usage.endswith(ov_line): + usage = usage[: -len(ov_line)].rstrip() + + additional_sections = command.get("additional_sections", []) + has_pos_section = has_positional_section(additional_sections) + positional_args = ( + [] if has_pos_section else extract_positional_args(usage, command_path) + ) + + if (not has_pos_section) and not positional_args and overview: + token_only = re.match( + r"^[a-z_][a-z0-9_]*(\s+[a-z_][a-z0-9_]*)+$", + overview.replace("
", " "), + ) + if token_only and len(command_path.split()) >= 2: + positional_args = overview.replace("
", " ").split() + overview = "" + + normalized_options, moved_notes = normalize_options_list(options) + + if moved_notes: + additional_sections.append( + {"title": "additional_info", "content": "\n".join(moved_notes)} + ) + + if keywords_text and not (keywords.get("params") or keywords.get("lead")): + keywords_text = apply_all_text_fixes(keywords_text) + keywords_text = bold_sphinx_directives(keywords_text) + else: + keywords_text = "" + + # Use keywords.lead as main overview as it is more detailed + # and not really an overview of the keywords, but of the command + # subcommand instead. + keywords_lead = keywords.get("lead", "") + if keywords_lead: + overview = keywords_lead + keywords["lead"] = "" + + if overview: + overview = re.sub(r"\s*
\s*", " ", overview).strip() + + additional_sections = clean_additional_sections(additional_sections) + + context = { + "title": extract_subcommand_title(command_path, group_name), + "overview": overview, + "usage": usage, + "positional_args": positional_args, + "positional_arg_descriptions": positional_arg_descriptions, + "run_modes_excluded_prefixes": run_modes_excluded_prefixes, + "positional_args_excluded_prefixes": positional_args_excluded_prefixes, + "options": normalized_options, + "keywords_text": keywords_text, + "keywords": keywords, + "accepts_json": bool(command.get("accepts_json", False)), + "returns_json": bool(command.get("returns_json", False)), + "additional_sections": additional_sections, + } + return render_with_template(env, context) + + +def path_to_filename(path): + """Convert command path to filename.""" + return path.replace(" ", "-").lower() + ".md" + + +def pluralize_for_filename(base_name): + """Convert singular filename to plural form for lookup.""" + plural_map = { + "commissioning-script": "commissioning-scripts", + "event": "events", + "ipaddress": "ipaddresses", + "node-result": "node-results", + "vmfs-datastore": "vmfs-datastores", + } + return plural_map.get(base_name, base_name) + + +def find_existing_topic_number(base_name, output_dir): + """Find existing file with topic number or return None.""" + if not output_dir.exists(): + return None, None + + search_names = [base_name] + plural_name = pluralize_for_filename(base_name) + if plural_name != base_name: + search_names.append(plural_name) + + for search_name in search_names: + pattern = re.compile(rf"^{re.escape(search_name)}-(\d+).md$") + tba_pattern = re.compile(rf"^{re.escape(search_name)}-tba.md$") + + for file in output_dir.glob("**/*.md"): + filename = file.name + if m := pattern.match(filename): + return m.group(1), search_name + if tba_pattern.match(filename): + return "tba", search_name + + return None, None + + +def singularize_resource(resource): + """Singularize a CLI resource token.""" + curated = { + "machines": "machine", + "nodes": "node", + "subnets": "subnet", + "fabrics": "fabric", + "vlans": "vlan", + "spaces": "space", + "tags": "tag", + "users": "user", + "zones": "zone", + "resource-pools": "resource-pool", + "interfaces": "interface", + "ipranges": "iprange", + "ipaddresses": "ipaddress", + "files": "file", + "partitions": "partition", + "block-devices": "block-device", + "raid": "raid", + "bcaches": "bcache", + "vm-hosts": "vm-host", + "vm-clusters": "vm-cluster", + "boot-resources": "boot-resource", + "boot-sources": "boot-source", + "devices": "device", + "node-devices": "node-device", + "discoveries": "discovery", + "dnsresources": "dnsresource", + "static-routes": "static-route", + "package-repositories": "package-repository", + "vmfs-datastores": "vmfs-datastore", + "volume-groups": "volume-group", + "rack-controllers": "rack-controller", + "region-controllers": "region-controller", + "maas": "maas", + } + if resource in curated: + return curated[resource] + + if "-" in resource and resource.endswith("s"): + return resource[:-1] + + if resource.endswith("es") and len(resource) > 3: + return resource[:-2] + if resource.endswith("s") and len(resource) > 2: + return resource[:-1] + return resource + + +def parse_key_to_group(key): + """Return (group_name, command_path_for_usage).""" + parts = key.split() + if len(parts) >= 3 and parts[0] == "maas": + if len(parts) >= 4: + resource = parts[2] + group = singularize_resource(resource) + command_path = " ".join(parts[2:]) + return group, command_path + if len(parts) == 3: + top = parts[1] + command_path = " ".join(parts[1:]) + return top, command_path + if len(parts) == 2: + return parts[1], parts[1] + fallback = " ".join(parts[1:]) if parts and parts[0] == "maas" else key + return fallback or key, fallback or key + + +def group_commands_by_resource(commands): + """Group commands by resource base (singular), or by top-level cmd.""" + groups = {} + for cmd in commands: + key = str(cmd.get("key", "")) + group, command_path = parse_key_to_group(key) + groups.setdefault(group, []).append((cmd, command_path or group)) + return groups + + +def generate_cli_docs(): + nodes = create_cli_items() + + if not isinstance(nodes, list) or not nodes: + print("Warning: No commands found in input", file=sys.stderr) + return 0 + + output_dir = RTD_DOCS / "reference" / "cli-reference" + output_dir.mkdir(parents=True, exist_ok=True) + + env = Environment( + loader=FileSystemLoader(RTD_DOCS / "_scripts" / "_templates"), + autoescape=select_autoescape(enabled_extensions=(".j2",)), + trim_blocks=True, + lstrip_blocks=True, + ) + + seen_keys = {} + for node in nodes: + k = str(node.get("key", "")) + if not k: + continue + seen_keys[k] = node + unique_commands = [seen_keys[k] for k in sorted(seen_keys.keys())] + + groups = group_commands_by_resource(unique_commands) + + files_created = 0 + files_updated = 0 + files_skipped = 0 + files_would_change = 0 + + groups_to_skip = {"local", "admin"} + generated_entries = [] + + for group_name, cmd_list in sorted(groups.items()): + if group_name in groups_to_skip: + continue + + filename = ( + f"{group_name}.md" + if " " not in group_name + else path_to_filename(group_name) + ) + + filepath = output_dir / filename + + markdown_parts = [f"# {group_name}\n"] + for command, command_path in sorted( + cmd_list, key=lambda t: (t[1], str(t[0].get("key", ""))) + ): + markdown_parts.append( + generate_command_markdown( + env, command, command_path, group_name + ) + ) + markdown_parts.append("") + markdown_content = "\n".join(markdown_parts).rstrip() + "\n" + + if filepath.exists(): + with open(filepath, "r", encoding="utf-8") as f: + existing_content = f.read() + if existing_content == markdown_content: + files_skipped += 1 + else: + files_updated += 1 + files_would_change += 1 + with open(filepath, "w", encoding="utf-8") as wf: + wf.write(markdown_content) + else: + files_created += 1 + files_would_change += 1 + with open(filepath, "w", encoding="utf-8") as wf: + wf.write(markdown_content) + + generated_entries.append(filename[: -len(".md")]) + + index_template = env.get_template("cli_index.md.j2") + index_content = index_template.render(entries=sorted(generated_entries)) + index_path = output_dir / "index.md" + if index_path.exists(): + with open(index_path, "r", encoding="utf-8") as f: + if f.read() != index_content: + files_updated += 1 + with open(index_path, "w", encoding="utf-8") as wf: + wf.write(index_content) + else: + files_skipped += 1 + else: + files_created += 1 + with open(index_path, "w", encoding="utf-8") as wf: + wf.write(index_content) + + print(f"✓ Successfully generated CLI Documentation at {output_dir}") + print(f"-- Files created: {files_created}") + print(f"-- Files updated: {files_updated}") + print(f"-- Files skipped: {files_skipped}") + print(f"-- Total commands processed: {len(unique_commands)}") + + return 0 + + +def main(): + return generate_cli_docs() + + +if __name__ == "__main__": + exit(main()) diff --git a/rtd-docs/_scripts/get_api_spec.py b/rtd-docs/_scripts/get_api_spec.py index f4cf0129fa..0d98a50998 100644 --- a/rtd-docs/_scripts/get_api_spec.py +++ b/rtd-docs/_scripts/get_api_spec.py @@ -5,25 +5,16 @@ """Discover MAAS CLI commands by constructing argparse tree from source.""" import os -import sys from typing import Any +from utils import add_repo_src_to_path + try: import importlib.metadata as _ilm except ImportError: _ilm = None -def add_repo_src_to_path(): - """Add repository src directory to Python path.""" - repo_root = os.path.abspath( - os.path.join(os.path.dirname(__file__), "..", "..") - ) - src_dir = os.path.join(repo_root, "src") - if os.path.isdir(src_dir) and src_dir not in sys.path: - sys.path.insert(0, src_dir) - - def _patch_maas_metadata(): """Patch importlib.metadata.distribution for 'maas' so imports succeed in-repo.""" if _ilm is not None: diff --git a/rtd-docs/_scripts/get_cli_spec.py b/rtd-docs/_scripts/get_cli_spec.py new file mode 100755 index 0000000000..d071e427ca --- /dev/null +++ b/rtd-docs/_scripts/get_cli_spec.py @@ -0,0 +1,1012 @@ +#!/usr/bin/env python3 +# Copyright 2026 Canonical Ltd. This software is licensed under the +# GNU Affero General Public License version 3 (see the file LICENSE). + +"""Discover MAAS CLI commands by constructing argparse tree from source.""" + +import argparse +from importlib.util import find_spec +from inspect import getdoc +import json +import os +import re +import sys + +from utils import add_repo_src_to_path + +try: + import importlib.metadata as _ilm +except ImportError: + _ilm = None + + +re_usage_line = re.compile(r"^usage\s*:?", re.IGNORECASE) +re_opt_desc = re.compile(r"^(?P\S.*?\S)\s{2,}(?P.+)$") + +builtins = { + "login", + "logout", + "list", + "refresh", + "init", + "config", + "status", + "migrate", + "apikey", + "configauth", + "config-tls", + "config-vault", + "createadmin", + "changepassword", + "msm", +} + + +def _patch_maas_metadata(): + """Patch importlib.metadata.distribution for 'maas' so imports succeed in-repo.""" + if _ilm is not None: + _orig = getattr(_ilm, "distribution", None) + if _orig is not None: + + def _fake(name): + if name == "maas": + + class _Dummy: + version = "0.0.0" + + return _Dummy() + return _orig(name) + + _ilm.distribution = _fake + + +def build_parser(argv0="maas"): + """Build and return the MAAS CLI argument parser.""" + _patch_maas_metadata() + try: + from maascli.parser import prepare_parser + + snap_env_was_set = "SNAP" in os.environ + if not snap_env_was_set: + try: + # Importing maascli.snap for its side effects + if find_spec("maascli.snap") is None: + raise Exception("could not import maascli.snap") + + os.environ["SNAP"] = "/snap/maas/current" + os.environ["SNAP_DATA"] = "/var/snap/maas/current" + os.environ["SNAP_COMMON"] = "/var/snap/maas/common" + except ImportError: + pass + + fake_argv = [argv0] + parser = prepare_parser(fake_argv) + + if not snap_env_was_set and "SNAP" in os.environ: + del os.environ["SNAP"] + if "SNAP_DATA" in os.environ: + del os.environ["SNAP_DATA"] + if "SNAP_COMMON" in os.environ: + del os.environ["SNAP_COMMON"] + + return parser + except ImportError: + raise + + +def generate_api_description_from_source(): + """Generate API description from source code without needing a live server.""" + try: + if "DJANGO_SETTINGS_MODULE" not in os.environ: + os.environ.setdefault( + "DJANGO_SETTINGS_MODULE", "maasserver.djangosettings.settings" + ) + + try: + import django + + django.setup() + except ImportError: + return None + + try: + from maasserver.api.doc import get_api_description + + return get_api_description() + except ImportError: + return None + except Exception: + return None + + +def try_register_api_profile(parser): + """Register API profile from source-generated API description.""" + try: + from maascli.api import profile_help, register_resources + + for action in parser._actions: + if isinstance(action, argparse._SubParsersAction): + if any(name not in builtins for name in action.choices.keys()): + return True + + description = generate_api_description_from_source() + if description is None: + return False + + from maascli.utils import api_url as _normalize_api_url + + base_url = os.environ.get( + "MAAS_INTROSPECT_URL", "http://localhost:5240/MAAS/" + ) + api_base = _normalize_api_url(base_url) + + profile = { + "name": "local", + "url": api_base, + "credentials": ("key", "secret", "token"), + "description": description, + } + sub = parser.subparsers.add_parser( + profile["name"], + help="Interact with %(url)s" % profile, + description=( + "Issue commands to the MAAS region controller at " + "%(url)s." % profile + ), + epilog=profile_help, + ) + register_resources(profile, sub) + return True + except Exception: + return False + + +def get_subparsers(parser): + """Extract all subparsers from the argument parser.""" + subparsers = [] + for action in parser._actions: + if isinstance(action, argparse._SubParsersAction): + subparsers.append(action) + return subparsers + + +def collect_optional_rows(parser): + """Collect optional argument rows from parser.""" + rows = [] + for action in parser._get_optional_actions(): + if not getattr(action, "option_strings", None): + continue + help_text = getattr(action, "help", None) + if help_text == argparse.SUPPRESS or help_text == "==SUPPRESS==": + continue + option_sig = ", ".join(action.option_strings) + metavar = None + if getattr(action, "metavar", None): + metavar = action.metavar + elif ( + getattr(action, "nargs", None) not in (0, None) + and getattr(action, "type", None) is not bool + ): + metavar = action.dest.upper().replace("-", "_") + if metavar: + option_sig = f"{option_sig} {metavar}" + help_text = help_text or "" + help_text = str(help_text).replace("|", r"\|") + help_text = "
".join( + line.strip() for line in help_text.splitlines() + ).strip() + rows.append( + { + "option": option_sig, + "effect": help_text, + "flags": list(action.option_strings), + "required": bool(getattr(action, "required", False)), + "choices": ( + list(getattr(action, "choices", []) or []) + if getattr(action, "choices", None) is not None + else None + ), + "nargs": getattr(action, "nargs", None), + "metavar": getattr(action, "metavar", None) or metavar, + "dest": getattr(action, "dest", None), + "default": ( + None + if getattr(action, "default", None) is argparse.SUPPRESS + else getattr(action, "default", None) + ), + } + ) + return rows + + +def node_key(path): + """Generate a key from a command path.""" + return " ".join(path) + + +def parse_simple_sections(help_text, description): + """Parse additional sections from help text (e.g., 'Examples:', 'See also:').""" + additional_sections = [] + lines = help_text.splitlines() + current_section = None + current_section_content = [] + + for line in lines: + s = line.strip() + if ( + s.endswith(":") + and not s.startswith("-") + and s not in ["usage:", "options:", "optional arguments:"] + ): + if current_section is not None and current_section_content: + additional_sections.append( + { + "title": current_section, + "content": "\n".join(current_section_content), + } + ) + current_section = s.rstrip(":") + current_section_content = [] + elif current_section is not None: + current_section_content.append(line) + elif ( + s + and not s.startswith(("usage", "options", "optional arguments")) + and s != description.strip() + ): + current_section_content.append(line) + + if current_section is not None and current_section_content: + additional_sections.append( + { + "title": current_section, + "content": "\n".join(current_section_content), + } + ) + + return additional_sections + + +def describe_parser(parser, path): + """Describe a parser node with its usage, options, and metadata.""" + usage = parser.format_usage().strip() + description = parser.description or "" + epilog = parser.epilog or "" + + accepts_json = ":param" in (epilog or "") + returns_json = False + + additional_sections = [] + if len(path) == 2 and path[0] == "maas": + try: + help_text = parser.format_help() + additional_sections = parse_simple_sections(help_text, description) + except Exception: + pass + + return { + "key": node_key(path), + "argv": path[1:], + "usage": usage, + "options": collect_optional_rows(parser), + "children": [], + "overview": description.strip() + or ("CLI help for: " + re.sub(r"^\s*usage\s*:?\s*", "", usage)), + "example": "", + "keywords_text": str(epilog).strip(), + "accepts_json": accepts_json, + "returns_json": returns_json, + "additional_sections": additional_sections, + } + + +def walk(parser, path): + """Recursively walk the parser tree and build a node structure.""" + node = describe_parser(parser, path) + subparsers = get_subparsers(parser) + for sp in subparsers: + for name, subparser in sorted(sp.choices.items()): + child_path = path + [name] + child_node = walk(subparser, child_path) + node["children"].append(child_node) + return node + + +def flatten(node): + """Flatten a tree of nodes into a list.""" + out = [{k: v for k, v in node.items() if k != "children"}] + for c in node.get("children", []): + out.extend(flatten(c)) + return out + + +def normalize_drill_down(content): + """Normalize drill-down section content by pairing commands with descriptions.""" + entries = [] + i = 0 + while i < len(content): + line_text = content[i].strip() + if not line_text or line_text == "COMMAND": + i += 1 + continue + if " " in line_text: + entries.append(line_text) + i += 1 + continue + desc = "" + if i + 1 < len(content): + next_line = content[i + 1] + if next_line.startswith(" ") or next_line.startswith("\t"): + desc = next_line.strip() + i += 2 + else: + i += 1 + else: + i += 1 + if desc: + entries.append(f"{line_text} {desc}") + else: + entries.append(line_text) + return "\n".join(entries) + + +def _parse_positional_args_compact(full_text, matches): + """Parse positional args when multiple args are on one line (compact format).""" + entries = [] + for i, match in enumerate(matches): + arg_name = match.group(1) + desc_start = match.end() + desc_end = ( + matches[i + 1].start() if i + 1 < len(matches) else len(full_text) + ) + desc = full_text[desc_start:desc_end].strip() + if desc.endswith(".") and i + 1 < len(matches): + desc = desc[:-1].strip() + if desc: + entries.append(f"{arg_name} {desc}") + else: + entries.append(arg_name) + return entries + + +def _parse_positional_args_multiline(content): + """Parse positional args when each arg is on separate lines (multiline format).""" + entries = [] + i = 0 + while i < len(content): + head = content[i] + head_stripped = head.strip() + name = head_stripped + first_desc = "" + m = re.match(r"^(?P\S.*?)\s{2,}(?P.+)$", head_stripped) + if m: + name = m.group("name").strip() + first_desc = m.group("desc").strip() + if not name: + i += 1 + continue + desc_parts = [] + if first_desc: + desc_parts.append(first_desc) + j = i + 1 + while j < len(content): + next_line = content[j] + if next_line.startswith(" ") or next_line.startswith("\t"): + desc_parts.append(next_line.strip()) + j += 1 + else: + break + desc = " ".join(desc_parts).strip() + if desc: + entries.append(f"{name} {desc}") + else: + entries.append(name) + i = j + return entries + + +def normalize_positional_args(content): + """Normalize positional arguments section by extracting argument names and descriptions.""" + full_text = " ".join(line.strip() for line in content if line.strip()) + matches = list(re.finditer(r"(\S+)\s{2,}", full_text)) + + if len(matches) > 1: + entries = _parse_positional_args_compact(full_text, matches) + else: + entries = _parse_positional_args_multiline(content) + + return "\n".join(entries) + + +def extract_usage_and_overview(lines, command): + """Extract usage string and overview description from help text lines.""" + + def is_usage_line(s): + return re_usage_line.match(s) is not None + + usage_lines = [] + in_usage = False + for line in lines: + s = line.strip() + if is_usage_line(s): + in_usage = True + usage_lines.append(s) + continue + elif ( + in_usage + and s + and not s.startswith(("options:", "optional arguments:")) + ): + usage_lines.append(s) + elif in_usage and ( + s.startswith("options:") or s.startswith("optional arguments:") + ): + break + elif in_usage and not s: + continue + elif in_usage: + break + + usage = ( + " ".join(usage_lines) if usage_lines else f"usage: maas {command} [-h]" + ) + + in_usage_section = False + overview = "" + for line in lines: + s = line.strip() + if is_usage_line(s): + in_usage_section = True + continue + if ( + in_usage_section + and s + and not s.startswith( + ("usage", "options", "optional arguments", "[") + ) + ): + overview = s + break + + if not overview: + overview = f"CLI help for: maas {command} [-h]" + + return usage, overview + + +def finalize_option(current_option, current_desc_lines): + """Create option dict from option text and description lines.""" + desc = " ".join(current_desc_lines).strip() + opt_text = current_option + if not desc: + m = re_opt_desc.match(opt_text) or re.match( + r"^(?P\S.*?\S)\s{2,}(?P.+)$", opt_text + ) + if m: + opt_text = m.group("opt").strip() + desc = m.group("desc").strip() + return {"option": opt_text, "effect": desc} + + +def finalize_section( + current_section, + current_section_content, + current_section_content_raw, + section_raw_lines, +): + """Finalize a section by normalizing content and tracking raw lines.""" + content = "\n".join(current_section_content) + title_lower = current_section.strip().lower() + if title_lower == "drill down": + content = normalize_drill_down(current_section_content) + elif title_lower == "positional arguments": + content = normalize_positional_args(current_section_content) + + section_raw_lines.update(rl.strip() for rl in current_section_content_raw) + return {"title": current_section, "content": content} + + +def collect_additional_text(lines, overview, section_raw_lines): + """Collect text that doesn't belong to any specific section.""" + additional_text = [] + for line in lines: + s = line.strip() + if ( + s + and not s.startswith(("usage", "options", "optional arguments")) + and not s.endswith(":") + and s not in section_raw_lines + and s != overview + and not s.startswith(("-", "--")) + ): + additional_text.append(line) + + if additional_text: + extra = " ".join(t.strip() for t in additional_text if t.strip()) + return extra.replace("|", r"\|") + return "" + + +def handle_section_header( + state, line_stripped, section_raw_lines, options, additional_sections +): + """Handle transition to a new section header. Returns updated parsing state dict.""" + if state["current_section"] is not None: + if state["current_section"] in ("options", "optional arguments"): + if state["current_option"] is not None: + options.append( + finalize_option( + state["current_option"], state["current_desc_lines"] + ) + ) + elif state["current_section_content"]: + additional_sections.append( + finalize_section( + state["current_section"], + state["current_section_content"], + state["current_section_content_raw"], + section_raw_lines, + ) + ) + + section_raw_lines.update( + rl.strip() for rl in state["current_section_content_raw"] + ) + new_section = line_stripped.rstrip(":") + in_options = new_section in ("options", "optional arguments") + + return { + "current_section": new_section, + "current_option": None, + "current_desc_lines": [], + "current_section_content": [], + "current_section_content_raw": [], + "in_options": in_options, + "in_other_section": not in_options, + } + + +def process_option_line(line, s, current_option, current_desc_lines, options): + """Process a single line in the options section. Returns updated option state.""" + if not s: + return current_option, current_desc_lines + + if s.startswith("-"): + if current_option is not None: + options.append(finalize_option(current_option, current_desc_lines)) + if m := re_opt_desc.match(s): + return m.group("opt").strip(), [m.group("desc").strip()] + return s, [] + elif current_option is not None and ( + line.startswith(" ") or line.startswith("\t") + ): + current_desc_lines.append(s) + + return current_option, current_desc_lines + + +def parse_help_sections(lines, overview): + """Parse options and additional sections from argparse help text.""" + options = [] + additional_sections = [] + section_raw_lines = set() + + state = { + "current_section": None, + "current_section_content": [], + "current_section_content_raw": [], + "current_option": None, + "current_desc_lines": [], + "in_options": False, + "in_other_section": False, + } + + for line in lines: + line_stripped = line.strip() + + if line_stripped.endswith(":") and not line_stripped.startswith("-"): + state = handle_section_header( + state, + line_stripped, + section_raw_lines, + options, + additional_sections, + ) + continue + + if state["in_options"]: + state["current_option"], state["current_desc_lines"] = ( + process_option_line( + line, + line_stripped, + state["current_option"], + state["current_desc_lines"], + options, + ) + ) + elif state["in_other_section"]: + state["current_section_content"].append(line) + state["current_section_content_raw"].append(line) + else: + if line_stripped and not line_stripped.startswith( + ("usage", "options", "optional arguments") + ): + state["current_section_content"].append(line) + + if state["current_section"] is not None: + if state["current_section"] in ("options", "optional arguments"): + if state["current_option"] is not None: + options.append( + finalize_option( + state["current_option"], state["current_desc_lines"] + ) + ) + else: + if state["current_section_content"]: + additional_sections.append( + finalize_section( + state["current_section"], + state["current_section_content"], + state["current_section_content_raw"], + section_raw_lines, + ) + ) + + additional_text = collect_additional_text( + lines, overview, section_raw_lines + ) + if additional_text: + additional_sections.append( + {"title": "additional_info", "content": additional_text} + ) + + return options, additional_sections + + +def synthesize_top_level_node(command, parser): + """Build node for top-level command from parser.""" + help_text = "" + try: + subparsers = get_subparsers(parser) + for sp in subparsers: + if command in sp.choices: + help_text = sp.choices[command].format_help() + break + except Exception: + pass + + lines = help_text.splitlines() + usage, overview = extract_usage_and_overview(lines, command) + options, additional_sections = parse_help_sections(lines, overview) + + return { + "key": f"maas {command}", + "argv": [command], + "usage": usage, + "options": options, + "children": [], + "overview": overview, + "example": "", + "keywords_text": "", + "accepts_json": False, + "returns_json": False, + "additional_sections": additional_sections, + } + + +def discover_top_level_from_parser(parser): + """Discover top-level commands from parser.""" + commands = [] + subparsers = get_subparsers(parser) + for sp in subparsers: + for name in sp.choices.keys(): + if ( + name.replace("-", "").isalnum() + and len(name) > 1 + and not name.startswith(("-", "--")) + and name not in commands + ): + commands.append(name) + return commands + + +def _get_form_field_names(form_class): + """Return the set of field names for a Django Form/ModelForm class.""" + if form_class is None: + return set() + fields = getattr(form_class, "base_fields", None) or getattr( + form_class, "declared_fields", {} + ) + return set(fields.keys()) + + +def _get_model_form_class(handler_class): + """Return the model_form class for a handler, or None.""" + try: + form = getattr(handler_class, "model_form", None) + if form is not None and callable(form): + return form + except (NotImplementedError, AttributeError, TypeError): + pass + return None + + +def _extract_docstring_params(doc): + """Extract @param names from annotated docstring; skip URI params.""" + from maasserver.api.annotations import APIDocstringParser + + if not doc or not APIDocstringParser.is_annotated_docstring(doc): + return set() + try: + parser = APIDocstringParser() + parser.parse(doc) + ap_dict = parser.get_dict() + except Exception: + return set() + out = set() + for param in ap_dict.get("params") or []: + name = (param.get("name") or "").strip() + if name and "{" not in name and "}" not in name: + out.add(name) + return out + + +def _get_docstring_param_names(handler_class): + """Return param names from all action docstrings (skip URI params).""" + exports = getattr(handler_class, "exports", None) + if not exports: + return set() + param_names = set() + for _signature, func in exports.items(): + param_names |= _extract_docstring_params(getdoc(func)) + return param_names + + +def _get_action_docstring_params(handler_class, action_name): + """Return param names from a single action's docstring (skip URI params).""" + func = getattr(handler_class, action_name, None) + return set() if func is None else _extract_docstring_params(getdoc(func)) + + +def _get_action_form_registry(): + """(base_handler_class, action_name, form_class) for action-level forms.""" + from maasserver.api.nodes import NodesHandler + from maasserver.node_constraint_filter_forms import ReadNodesForm + + return [ + (NodesHandler, "read", ReadNodesForm), + ] + + +def _setup_django() -> bool: + """Ensure Django is configured for docstring sync checks.""" + _patch_maas_metadata() + if "DJANGO_SETTINGS_MODULE" not in os.environ: + os.environ.setdefault( + "DJANGO_SETTINGS_MODULE", + "maasserver.djangosettings.settings", + ) + try: + import django + + django.setup() + return True + except ImportError: + print( + "Django is required for --check-docstring-sync. " + "Run with PYTHONPATH=src.", + file=sys.stderr, + ) + return False + + +def _get_api_resources(): + """Return API resources or None on import failure.""" + from maasserver.api.doc import find_api_resources + + try: + from maasserver import urls_api as urlconf + except ImportError as e: + print(f"Cannot import maasserver.urls_api: {e}", file=sys.stderr) + return None + return find_api_resources(urlconf) + + +def _iter_unique_handlers(resources): + """Yield (handler_class, name) for each unique handler.""" + from piston3.handler import BaseHandler + + seen = set() + for resource in sorted( + resources, key=lambda r: getattr(r.handler, "__name__", "") + ): + for handler in (resource.handler, resource.anonymous): + if handler is None: + continue + handler_class = ( + type(handler) if isinstance(handler, BaseHandler) else handler + ) + if handler_class in seen: + continue + seen.add(handler_class) + name = getattr(handler_class, "__name__", str(handler_class)) + yield handler_class, name + + +def _collect_model_form_reports(handler_class, name): + """Return report rows for handler-level model_form drift.""" + form_class = _get_model_form_class(handler_class) + if form_class is None: + return [] + form_fields = _get_form_field_names(form_class) + docstring_params = _get_docstring_param_names(handler_class) + missing = form_fields - docstring_params + if not missing: + return [] + return [ + ( + name, + form_class.__name__, + sorted(form_fields), + sorted(docstring_params), + sorted(missing), + ) + ] + + +def _collect_action_form_reports(handler_class, name, action_form_registry): + """Return report rows for action-level form/docstring drift.""" + rows = [] + for base_class, action_name, action_form_class in action_form_registry: + if not issubclass(handler_class, base_class): + continue + form_fields = _get_form_field_names(action_form_class) + docstring_params = _get_action_docstring_params( + handler_class, action_name + ) + missing = form_fields - docstring_params + if not missing: + continue + rows.append( + ( + f"{name}.{action_name}", + action_form_class.__name__, + sorted(form_fields), + sorted(docstring_params), + sorted(missing), + ) + ) + return rows + + +def _deduplicate_reports(reports): + """Group reports by form/docstring content; collect handler names.""" + grouped = {} + for name, form_name, form_fields, doc_params, missing in reports: + key = ( + form_name, + tuple(form_fields), + tuple(doc_params), + tuple(missing), + ) + if key not in grouped: + grouped[key] = { + "form_name": form_name, + "form_fields": form_fields, + "doc_params": doc_params, + "missing": missing, + "handlers": [], + } + grouped[key]["handlers"].append(name) + return list(grouped.values()) + + +def _print_sync_report(reports, total_handlers): + """Print human-readable summary of sync check results.""" + if not reports: + print( + f"All {total_handlers} handlers are in sync. " + "No form fields missing from docstrings " + "(model_form or action-level forms)." + ) + return 0 + + deduplicated = _deduplicate_reports(reports) + total_missing = sum(len(item["missing"]) for item in deduplicated) + total_handlers_with_drift = sum( + len(item["handlers"]) for item in deduplicated + ) + + print("Handlers/actions with form fields missing from docstring params:\n") + for item in deduplicated: + handlers = item["handlers"] + if len(handlers) == 1: + handler_str = handlers[0] + else: + handler_str = f"{', '.join(handlers)}" + print(f" {handler_str} (form: {item['form_name']})") + print(f" Form fields: {item['form_fields']}") + print(f" Docstring params: {item['doc_params']}") + print(f" Missing from docstring: {item['missing']}") + print() + + print(f"Total handlers checked: {total_handlers}") + print(f"Total handlers with drift: {total_handlers_with_drift}") + print(f"Unique mismatches: {len(deduplicated)}") + print(f"Total form fields missing from docstrings: {total_missing}") + return 0 + + +def check_docstring_sync(): + """Compare handler form fields vs docstring params; report what's missing.""" + if not _setup_django(): + return 2 + + resources = _get_api_resources() + if resources is None: + return 2 + + action_form_registry = _get_action_form_registry() + reports = [] + total_handlers = 0 + + for handler_class, name in _iter_unique_handlers(resources): + total_handlers += 1 + reports.extend(_collect_model_form_reports(handler_class, name)) + reports.extend( + _collect_action_form_reports( + handler_class, name, action_form_registry + ) + ) + + return _print_sync_report(reports, total_handlers) + + +def create_cli_items(): + add_repo_src_to_path() + + try: + parser = build_parser() + except Exception as e: + raise Exception(f"could not build parser: {e}") from e + + try_register_api_profile(parser) + + root_path = ["maas"] + root = walk(parser, root_path) + items = flatten(root) + + top_level_commands = discover_top_level_from_parser(parser) + items = [it for it in items if len(it.get("argv", [])) != 1] + + for cmd in top_level_commands: + items.append(synthesize_top_level_node(cmd, parser)) + + return items + + +def main(): + """Main entry point for CLI introspection.""" + + arg_parser = argparse.ArgumentParser( + description="Discover MAAS CLI commands or check docstring/form sync." + ) + arg_parser.add_argument( + "--check-docstring-sync", + action="store_true", + help="Compare handler form fields vs docstring params; report missing.", + ) + args = arg_parser.parse_args() + + if args.check_docstring_sync: + return check_docstring_sync() + + items = create_cli_items() + + json.dump(items, sys.stdout, indent=2) + sys.stdout.write("\n") + return 0 + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/rtd-docs/_scripts/tests/test_generate_cli_docs.py b/rtd-docs/_scripts/tests/test_generate_cli_docs.py new file mode 100644 index 0000000000..d9fda05bdb --- /dev/null +++ b/rtd-docs/_scripts/tests/test_generate_cli_docs.py @@ -0,0 +1,148 @@ +# Copyright 2026 Canonical Ltd. This software is licensed under the +# GNU Affero General Public License version 3 (see the file LICENSE). + +"""Tests for `generate` module.""" + +from pathlib import Path +import tempfile + +import pytest + +# Skip Jinja2-dependent tests if Jinja2 is not available in the environment. +pytest.importorskip("jinja2") + +from generate_cli_docs import ( + bold_list_leaders, + extract_positional_args, + find_existing_topic_number, + format_options, + format_positional_args, + format_usage, + generate_command_markdown, + group_commands_by_resource, + parse_keywords_text, +) +from jinja2 import Environment, FileSystemLoader, select_autoescape + +TEMPLATES_DIR = Path(__file__).parent.parent.joinpath("_templates") + + +def test_bold_list_leaders(): + """Test bolding of list item leaders.""" + bolded = bold_list_leaders("- Name: description\n - nested: keep") + assert "- **Name**: description" in bolded + assert "- **nested**: keep" in bolded + + +def test_parse_keywords_text(): + """Test parsing of sphinx-style keyword text.""" + epilog = ( + ":param foo: first line\n" + " second line\n" + ":type foo: str\n" + ":param bar: only line\n" + "note: not a directive\n" + ) + out = parse_keywords_text(epilog) + assert isinstance(out["params"], list) and len(out["params"]) == 2 + names = {p["name"] for p in out["params"]} + assert names == {"foo", "bar"} + foo = [p for p in out["params"] if p["name"] == "foo"][0] + assert "second line" in foo["desc"] + assert foo["type"] == "str" + + +def test_format_usage(): + """Test usage string formatting.""" + usage = ( + "usage: maas $PROFILE machines read SYSTEM_ID [options]\n" + "\noptions:\n -h, --help show help\n" + ) + formatted = format_usage(usage, "machines read") + assert "maas" in formatted and "machines" in formatted + + assert format_usage("", "login") == "maas login [-h]" + + +def test_extract_positional_args(): + """Test extraction of positional arguments from usage.""" + usage = "maas $PROFILE machines read SYSTEM_ID [options]" + args = extract_positional_args(usage, "machines read") + assert any( + arg.lower() in {"system_id", "system-id", "systemid"} for arg in args + ) + + +def test_extract_positional_args_top_level_suppressed(): + """Top-level commands should not inject positional args.""" + usage = "maas login PROFILE URL [CREDENTIALS]" + assert extract_positional_args(usage, "login") == [] + + +def test_format_options(): + """Test formatting of command options as markdown table.""" + table = format_options( + [ + {"option": "-h, --help", "effect": "Show help"}, + {"option": "--foo FOO", "effect": "Foo effect"}, + ] + ) + assert "#### Command-line options" in table + assert "| -h, --help | Show help |" in table + + +def test_format_positional_args(): + """Test formatting of positional arguments as markdown table.""" + pos = format_positional_args(["system_id", "name"]) + assert "#### Positional arguments" in pos + assert "system ID of the machine" in pos + assert "The name of the resource" in pos + + +def test_group_commands_by_resource(): + """Test grouping commands by resource.""" + cmds = [ + {"key": "maas $PROFILE machines read"}, + {"key": "maas $PROFILE machines create"}, + {"key": "maas login"}, + ] + groups = group_commands_by_resource(cmds) + assert "machine" in groups + assert "login" in groups + + +def test_find_existing_topic_number(): + """Test finding existing topic number from filename.""" + with tempfile.TemporaryDirectory() as tmpdir: + outdir = Path(tmpdir) + (outdir / "machines-12345.md").write_text("x", encoding="utf-8") + (outdir / "machine-12345.md").write_text("x", encoding="utf-8") + suffix, base_name = find_existing_topic_number("machine", outdir) + assert suffix == "12345" and base_name in {"machine", "machines"} + + +def test_generate_command_markdown(): + """Test that command markdown is generated correctly.""" + env = Environment( + loader=FileSystemLoader(TEMPLATES_DIR), + autoescape=select_autoescape(enabled_extensions=(".j2",)), + trim_blocks=True, + lstrip_blocks=True, + ) + command = { + "overview": "Overview line", + "usage": "usage: maas foo [-h]", + "options": [{"option": "-h, --help", "effect": "show this help"}], + "additional_sections": [ + {"title": "positional arguments", "content": "name The name"}, + {"title": "additional_info", "content": "Final paragraph text."}, + ], + "keywords_text": "", + "accepts_json": False, + "returns_json": False, + } + + out = generate_command_markdown(env, command, "foo bar") + pos = out.find("### **Command-line options**") + extra = out.find("Final paragraph text.") + assert pos != -1 and extra != -1 and extra > pos diff --git a/rtd-docs/_scripts/tests/test_get_cli_spec.py b/rtd-docs/_scripts/tests/test_get_cli_spec.py new file mode 100644 index 0000000000..d9894f4891 --- /dev/null +++ b/rtd-docs/_scripts/tests/test_get_cli_spec.py @@ -0,0 +1,155 @@ +# Copyright 2026 Canonical Ltd. This software is licensed under the +# GNU Affero General Public License version 3 (see the file LICENSE). + +"""Tests for `maas_cli_introspection` module.""" + +import argparse + +from get_cli_spec import ( + _get_action_form_registry, + _get_form_field_names, + _get_model_form_class, + _setup_django, + collect_optional_rows, + describe_parser, + normalize_drill_down, + normalize_positional_args, +) +import pytest +from utils import add_repo_src_to_path + + +def test_collect_optional_rows_filters_suppressed(): + """Test that collect_optional_rows filters out suppressed options.""" + parser = argparse.ArgumentParser() + parser.add_argument("--visible", help="This should appear") + parser.add_argument("--suppressed", help=argparse.SUPPRESS) + parser.add_argument("--another-visible", help="This should also appear") + + rows = collect_optional_rows(parser) + option_names = {row["option"].split()[0] for row in rows} + + assert "--visible" in option_names + assert "--another-visible" in option_names + assert "--suppressed" not in option_names + + +def test_normalize_drill_down(): + """Test normalization of drill-down content.""" + drill = [ + "COMMAND", + "machines manage machines", + " subnets", + "users manage users", + ] + norm_drill = normalize_drill_down(drill) + assert "machines manage machines" in norm_drill + assert "users manage users" in norm_drill + + +def test_normalize_drill_down_empty(): + """Test normalization of empty drill-down content.""" + empty_drill = ["COMMAND"] + assert normalize_drill_down(empty_drill) == "" + + +def test_normalize_positional_args(): + """Test normalization of positional arguments.""" + + positional = [ + "system_id The system ID", + " continued line", + "name", + " desc line", + ] + norm_pos = normalize_positional_args(positional) + assert "system_id The system ID continued line" in norm_pos + assert "name desc line" in norm_pos + + +def test_describe_parser(): + """Test that describe_parser extracts parser information correctly.""" + parser = argparse.ArgumentParser( + description="Log in to a remote API, and remember its description and credentials." + ) + parser.add_argument("profile_name", help="The profile name") + parser.add_argument("url", help="The URL of the remote API") + parser.add_argument("credentials", nargs="?", help="The credentials") + + node = describe_parser(parser, ["maas", "login"]) + + assert node["key"] == "maas login" + assert node["argv"] == ["login"] + assert ( + "login" in node["overview"].lower() + or "api" in node["overview"].lower() + ) + assert len(node["options"]) >= 1 + + +def test_get_form_field_names(): + """Test that _get_form_field_names extracts field names from forms.""" + + class Form: + declared_fields = {"field1": None, "field2": None} + + assert _get_form_field_names(Form) == {"field1", "field2"} + + class FormWithBase: + base_fields = {"base1": None} + + assert _get_form_field_names(FormWithBase) == {"base1"} + + assert _get_form_field_names(None) == set() + + class EmptyForm: + declared_fields = {} + + assert _get_form_field_names(EmptyForm) == set() + + +def test_get_model_form_class(): + """Test that _get_model_form_class extracts model_form from handlers.""" + + class Form: + pass + + class Handler: + model_form = Form + + assert _get_model_form_class(Handler) == Form + + class HandlerNoForm: + pass + + assert _get_model_form_class(HandlerNoForm) is None + + class HandlerNoneForm: + model_form = None + + assert _get_model_form_class(HandlerNoneForm) is None + + class HandlerBadForm: + model_form = "not a class" + + assert _get_model_form_class(HandlerBadForm) is None + + +# TODO: Fix this test (or add some dependencies), it is currently not +# working if running only with the docs venv. It likely requires some +# more dependencies which were skipped since they are not necessary to +# build the docs. +@pytest.mark.skip +def test_get_action_form_registry(): + """Test that _get_action_form_registry returns correct structure.""" + add_repo_src_to_path() + _setup_django() + + registry = _get_action_form_registry() + assert isinstance(registry, list) + assert len(registry) > 0 + + for entry in registry: + assert len(entry) == 3 + _, action_name, _ = entry + assert isinstance(action_name, str) diff --git a/rtd-docs/_scripts/utils.py b/rtd-docs/_scripts/utils.py new file mode 100644 index 0000000000..9d6834c736 --- /dev/null +++ b/rtd-docs/_scripts/utils.py @@ -0,0 +1,33 @@ +# Copyright 2026 Canonical Ltd. This software is licensed under the +# GNU Affero General Public License version 3 (see the file LICENSE). + + +from pathlib import Path +import sys + + +# TODO: Ideally we should just install MAAS as a package instead +# during docs generation. Unclear if this will lead to lots of +# dependency issues and/or bloat, so preserving this way instead. +def add_repo_src_to_path(): + """Add repository src directory to Python path. + + Assumes the root of the repo is being tracked by git, and that it + is the first parent that is so. + """ + project_root = next( + ( + parent + for parent in Path(__file__).parents + if (parent / ".git").exists() + ), + None, + ) + if project_root is None: + raise Exception( + "root of the project was not found... is your MAAS repo not being tracked by git?" + ) + + src_dir = project_root / "src" + if src_dir.is_dir() and src_dir not in sys.path: + sys.path.insert(0, str(src_dir)) diff --git a/rtd-docs/conf.py b/rtd-docs/conf.py index 586b44dd9f..1f7e64b0ab 100644 --- a/rtd-docs/conf.py +++ b/rtd-docs/conf.py @@ -284,6 +284,7 @@ extensions = [ "generate_api_docs_extension", # Auto-generate API docs during build + "generate_cli_docs_extension", # Auto-generate CLI docs during build "canonical_sphinx", "notfound.extension", "sphinx_design", diff --git a/rtd-docs/reference/cli-reference/account.md b/rtd-docs/reference/cli-reference/account.md deleted file mode 100644 index a0730b43a8..0000000000 --- a/rtd-docs/reference/cli-reference/account.md +++ /dev/null @@ -1,83 +0,0 @@ -# account - -Enter keyword arguments in the form `key=value`. - -## Create an authorisation token - -```bash -maas $PROFILE account create-authorisation-token [--help] [-d] [-k] [data ...] -``` - -Create an authorisation OAuth token and OAuth consumer. - -### Keyword "name" - -Optional String. Optional name of the token that will be generated. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Delete an authorisation token - -```bash -maas $PROFILE account delete-authorisation-token [--help] [-d] [-k] [data ...] -``` - -Delete an authorisation OAuth token and the related OAuth consumer. - -### Keyword "token_key" - -Required String. The key of the token to be deleted. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## List authorisation tokens - -```bash -maas $PROFILE account list-authorisation-tokens [--help] [-d] [-k] [data ...] -``` - -List authorisation tokens available to the currently logged-in user. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Modify authorisation token - -```bash -maas $PROFILE account update-token-name [--help] [-d] [-k] [data ...] -``` - -Modify the consumer name of an authorisation OAuth token. - -### Keyword "token" - -Required String. Can be the whole token or only the token key. - -### Keyword "name" - -Required String. New name of the token. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | diff --git a/rtd-docs/reference/cli-reference/apikey.md b/rtd-docs/reference/cli-reference/apikey.md deleted file mode 100644 index 6fab30c6a7..0000000000 --- a/rtd-docs/reference/cli-reference/apikey.md +++ /dev/null @@ -1,20 +0,0 @@ -# apikey - -Manage a user's API keys. Shows existing keys unless --generate or --delete is passed. - -```bash -maas apikey [-h] [--username USERNAME] [--generate] [--delete DELETE] [--update UPDATE] [--name API_KEY_NAME] [--with-names] -``` - -## Command-line options - -| Option | Effect | -|---------------------|------------------------------------------------------| -| -h, --help | show this help message and exit | -| --username USERNAME | Specifies the username for the admin. | -| --generate | Generate a new api key. | -| --delete DELETE | Delete the supplied api key. | -| --update UPDATE | Update the supplied api key name. | -| --name API_KEY_NAME | Name of the token. This argument should be passed to | -| | --update or --generate options | -| --with-names | Display tokens with their names. | diff --git a/rtd-docs/reference/cli-reference/bcache-cache-set.md b/rtd-docs/reference/cli-reference/bcache-cache-set.md deleted file mode 100644 index b137562fdb..0000000000 --- a/rtd-docs/reference/cli-reference/bcache-cache-set.md +++ /dev/null @@ -1,126 +0,0 @@ -# bcache-cache-set - -Enter keyword arguments in the form `key=value`. - -## Delete a bcache set - -```bash -maas $PROFILE bcache-cache-set delete [--help] [-d] [-k] system_id id [data ...] -``` - -### Positional arguments - -- system_id -- id - -Delete bcache cache set on a machine. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Read a bcache cache set - -```bash -maas $PROFILE bcache-cache-set read [--help] [-d] [-k] system_id id [data ...] -``` - -### Positional arguments - -- system_id -- id - -Read bcache cache set on a machine. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Update a bcache set - -```bash -maas $PROFILE bcache-cache-set update [--help] [-d] [-k] system_id id [data ...] -``` - -### Positional arguments - -- system_id -- id - -Update bcache cache set on a machine. - -Note: specifying both a cache_device and a cache_partition is not allowed. - -### Keyword "cache_device" - -Optional String. Cache block device to replace current one. - -### Keyword "cache_partition" - -Optional String. Cache partition to replace current one. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Creates a bcache cache set - -```bash -maas $PROFILE bcache-cache-sets create [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -Creates a bcache cache set. - -Note: specifying both a cache_device and a cache_partition is not allowed. - -### Keyword "cache_device" - -Optional String. Cache block device. - -### Keyword "cache_partition" - -Optional String. Cache partition. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## List bcache sets - -```bash -maas $PROFILE bcache-cache-sets read [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -List all bcache cache sets belonging to a machine. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | diff --git a/rtd-docs/reference/cli-reference/bcache.md b/rtd-docs/reference/cli-reference/bcache.md deleted file mode 100644 index dd242193e7..0000000000 --- a/rtd-docs/reference/cli-reference/bcache.md +++ /dev/null @@ -1,184 +0,0 @@ -# bcache - -Enter keyword arguments in the form `key=value`. - -## Delete a bcache - -```bash -maas $PROFILE bcache delete [--help] [-d] [-k] system_id id [data ...] -``` - -### Positional arguments - -- system_id -- id - -Delete bcache on a machine. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Read a bcache device - -```bash -maas $PROFILE bcache read [--help] [-d] [-k] system_id id [data ...] -``` - -### Positional arguments - -- system_id -- id - -Read bcache device on a machine. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Update a bcache - -```bash -maas $PROFILE bcache update [--help] [-d] [-k] system_id id [data ...] -``` - -### Positional arguments - -- system_id -- id - -Update bcache on a machine. - -Specifying both a device and a partition for a given role (cache or backing) is not allowed. - -### Keyword "name" - -Optional String. Name of the Bcache. - -### Keyword "uuid" - -Optional String. UUID of the Bcache. - -### Keyword "cache_set" - -Optional String. Cache set to replace current one. - -### Keyword "backing_device" - -Optional String. Backing block device to replace current one. - -### Keyword "backing_partition" - -Optional String. Backing partition to replace current one. - -### Keyword "cache_mode" - -Optional String. Cache mode: ``WRITEBACK``, ``WRITETHROUGH``, ``WRITEAROUND``. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Creates a bcache - -```bash -maas $PROFILE bcaches create [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -Creates a bcache. - -Specifying both a device and a partition for a given role (cache or backing) is not allowed. - -### Keyword "name" - -Optional String. Name of the Bcache. - -### Keyword "uuid" - -Optional String. UUID of the Bcache. - -### Keyword "cache_set" - -Optional String. Cache set. - -### Keyword "backing_device" - -Optional String. Backing block device. - -### Keyword "backing_partition" - -Optional String. Backing partition. - -### Keyword "cache_mode" - -Optional String. Cache mode: ``WRITEBACK``, ``WRITETHROUGH``, ``WRITEAROUND``. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Creates a bcache - -```bash -maas $PROFILE bcaches create [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -Creates a bcache. - -Specifying both a device and a partition for a given role (cache or backing) is not allowed. - -### Keyword "name" - -Optional String. Name of the Bcache. - -### Keyword "uuid" - -Optional String. UUID of the Bcache. - -### Keyword "cache_set" - -Optional String. Cache set. - -### Keyword "backing_device" - -Optional String. Backing block device. - -### Keyword "backing_partition" - -Optional String. Backing partition. - -### Keyword "cache_mode" - -Optional String. Cache mode: ``WRITEBACK``, ``WRITETHROUGH``, ``WRITEAROUND``. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | diff --git a/rtd-docs/reference/cli-reference/block-device.md b/rtd-docs/reference/cli-reference/block-device.md deleted file mode 100644 index e47d1128a4..0000000000 --- a/rtd-docs/reference/cli-reference/block-device.md +++ /dev/null @@ -1,339 +0,0 @@ -# block-device - -Enter keyword arguments in the form `key=value`. - -## Add a tag - -```bash -maas $PROFILE block-device add-tag [--help] [-d] [-k] system_id id [data ...] -``` - -### Positional arguments - -- system_id -- id - -Add a tag to block device on a given machine. - -### Keyword "tag" - -Required String. The tag being added. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Delete a block device - -```bash -maas $PROFILE block-device delete [--help] [-d] [-k] system_id id [data ...] -``` - -### Positional arguments - -- system_id -- id - -Delete block device on a given machine. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Format block device - -```bash -maas $PROFILE block-device format [--help] [-d] [-k] system_id id [data ...] -``` - -### Positional arguments - -- system_id -- id - -Format block device with filesystem. - -### Keyword "fstype" - -Required String. Type of filesystem. - -### Keyword "uuid" - -Optional String. UUID of the filesystem. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Mount a filesystem - -```bash -maas $PROFILE block-device mount [--help] [-d] [-k] system_id id [data ...] -``` - -### Positional arguments - -- system_id -- id - -Mount the filesystem on block device. - -### Keyword "mount_point" - -Required String. Path on the filesystem to mount. - -### Keyword "mount_options" - -Optional String. Options to pass to mount(8). - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Read a block device - -```bash -maas $PROFILE block-device read [--help] [-d] [-k] system_id id [data ...] -``` - -### Positional arguments - -- system_id -- id - -Read a block device on a given machine. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Remove a tag - -```bash -maas $PROFILE block-device remove-tag [--help] [-d] [-k] system_id id [data ...] -``` - -### Positional arguments - -- system_id -- id - -Remove a tag from block device on a given machine. - -### Keyword "tag" - -Optional String. The tag being removed. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Set boot disk - -```bash -maas $PROFILE block-device set-boot-disk [--help] [-d] [-k] system_id id [data ...] -``` - -### Positional arguments - -- system_id -- id - -Set a block device as the boot disk for the machine. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Unformat a block device - -```bash -maas $PROFILE block-device unformat [--help] [-d] [-k] system_id id [data ...] -``` - -### Positional arguments - -- system_id -- id - -Unformat a previously formatted block device. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Unmount a filesystem - -```bash -maas $PROFILE block-device unmount [--help] [-d] [-k] system_id id [data ...] -``` - -### Positional arguments - -- system_id -- id - -Unmount the filesystem on block device. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Update a block device - -```bash -maas $PROFILE block-device update [--help] [-d] [-k] system_id id [data ...] -``` - -### Positional arguments - -- system_id -- id - -Update block device on a given machine. - -Machines must have a status of Ready to have access to all options. Machines with Deployed status can only have the name, model, serial, and/or id_path updated for a block device. This is intented to allow a bad block device to be replaced while the machine remains deployed. - -### Keyword "name" - -Optional String. (Physical devices) Name of the block device. - -### Keyword "model" - -Optional String. (Physical devices) Model of the block device. - -### Keyword "serial" - -Optional String. (Physical devices) Serial number of the block device. - -### Keyword "id_path" - -Optional String (physical device). Only used if model and serial cannot be provided. This should be a path that is fixed and doesn't change depending on the boot order or kernel version. - -### Keyword "size" - -Optional String. (Physical devices) Size of the block device. - -### Keyword "block_size" - -Optional String. (Physical devices) Block size of the block device. - -### Keyword "name" - -Optional String. (Virtual devices) Name of the block device. - -### Keyword "uuid" - -Optional String. (Virtual devices) UUID of the block device. - -### Keyword "size" - -Optional String. (Virtual devices) Size of the block device. (Only allowed for logical volumes.) - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Create a block device - -```bash -maas $PROFILE block-devices create [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -Create a physical block device. - -### Keyword "name" - -Required String. Name of the block device. - -### Keyword "model" - -Optional String. Model of the block device. - -### Keyword "serial" - -Optional String. Serial number of the block device. - -### Keyword "id_path" - -Optional String. Only used if model and serial cannot be provided. This should be a path that is fixed and doesn't change depending on the boot order or kernel version. - -### Keyword "size" - -Required String. Size of the block device. - -### Keyword "block_size" - -Required String. Block size of the block device. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## List block devices - -```bash -maas $PROFILE block-devices read [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -List all block devices belonging to a machine. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | diff --git a/rtd-docs/reference/cli-reference/boot-resource.md b/rtd-docs/reference/cli-reference/boot-resource.md deleted file mode 100644 index 1f61070e6d..0000000000 --- a/rtd-docs/reference/cli-reference/boot-resource.md +++ /dev/null @@ -1,159 +0,0 @@ -# boot-resource - -Enter keyword arguments in the form `key=value`. - -## Delete a boot resource - -```bash -maas $PROFILE boot-resource delete [--help] [-d] [-k] id [data ...] -``` - -### Positional arguments - -- id - -Delete a boot resource by id. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Read a boot resource - -```bash -maas $PROFILE boot-resource read [--help] [-d] [-k] id [data ...] -``` - -### Positional arguments - -- id - -Reads a boot resource by id - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Upload a new boot resource - -```bash -maas $PROFILE boot-resources create [--help] [-d] [-k] [data ...] -``` - -Uploads a new boot resource. - -### Keyword "name" - -Required String. Name of the boot resource. - -### Keyword "architecture" - -Required String. Architecture the boot resource supports. - -### Keyword "sha256" - -Required String. The ``sha256`` hash of the resource. - -### Keyword "size" - -Required String. The size of the resource in bytes. - -### Keyword "title" - -Optional String. Title for the boot resource. - -### Keyword "filetype" - -Optional String.. Filetype for uploaded content. (Default: ``tgz``. Supported: ``tgz``, ``tbz``, ``txz``, ``ddtgz``, ``ddtbz``, ``ddtxz``, ``ddtar``, ``ddbz2``, ``ddgz``, ``ddxz``, ``ddraw``) - -### Keyword "base_image" - -Optional String. The Base OS image a custom image is built on top of. Only required for custom image. - -### Keyword "content" - -Optional String.. Image content. Note: this is not a normal parameter, but an ``application/octet-stream`` file upload. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Import boot resources - -```bash -maas $PROFILE boot-resources import [--help] [-d] [-k] [data ...] -``` - -Import the boot resources. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Importing status - -```bash -maas $PROFILE boot-resources is-importing [--help] [-d] [-k] [data ...] -``` - -Get the status of importing resources. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## List boot resources - -```bash -maas $PROFILE boot-resources read [--help] [-d] [-k] [data ...] -``` - -List all boot resources - -### Keyword "type" - -Optional String. Type of boot resources to list. If not provided, returns all types. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Stop import boot resources - -```bash -maas $PROFILE boot-resources stop-import [--help] [-d] [-k] [data ...] -``` - -Stop import the boot resources. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | diff --git a/rtd-docs/reference/cli-reference/boot-source-selection.md b/rtd-docs/reference/cli-reference/boot-source-selection.md deleted file mode 100644 index 8e96ff2f76..0000000000 --- a/rtd-docs/reference/cli-reference/boot-source-selection.md +++ /dev/null @@ -1,147 +0,0 @@ -# boot-source-selection - -Enter keyword arguments in the form `key=value`. - -## Delete a boot source - -```bash -maas $PROFILE boot-source-selection delete [--help] [-d] [-k] boot_source_id id [data ...] -``` - -### Positional arguments - -- boot_source_id -- id - -Delete a boot source with the given id. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Read a boot source selection - -```bash -maas $PROFILE boot-source-selection read [--help] [-d] [-k] boot_source_id id [data ...] -``` - -### Positional arguments - -- boot_source_id -- id - -Read a boot source selection with the given id. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Update a boot-source selection - -```bash -maas $PROFILE boot-source-selection update [--help] [-d] [-k] boot_source_id id [data ...] -``` - -### Positional arguments - -- boot_source_id -- id - -Update a boot source selection with the given id. - -### Keyword "os" - -Optional String. The OS (e.g. ubuntu, centos) for which to import resources. - -### Keyword "release" - -Optional String. The release for which to import resources. - -### Keyword "arches" - -Optional String. The list of architectures for which to import resources. - -### Keyword "subarches" - -Optional String. The list of sub-architectures for which to import resources. - -### Keyword "labels" - -Optional String. The list of labels for which to import resources. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Create a boot-source selection - -```bash -maas $PROFILE boot-source-selections create [--help] [-d] [-k] boot_source_id [data ...] -``` - -### Positional arguments - -- boot_source_id - -Create a new boot source selection. - -### Keyword "os" - -Optional String. The OS (e.g. ubuntu, centos) for which to import resources. - -### Keyword "release" - -Optional String. The release for which to import resources. - -### Keyword "arches" - -Optional String. The architecture list for which to import resources. - -### Keyword "subarches" - -Optional String. The subarchitecture list for which to import resources. - -### Keyword "labels" - -Optional String. The label lists for which to import resources. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Read a boot source selection - -```bash -maas $PROFILE boot-source-selection read [--help] [-d] [-k] boot_source_id id [data ...] -``` - -### Positional arguments - -- boot_source_id -- id - -Read a boot source selection with the given id. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | diff --git a/rtd-docs/reference/cli-reference/boot-source.md b/rtd-docs/reference/cli-reference/boot-source.md deleted file mode 100644 index 691320bcd5..0000000000 --- a/rtd-docs/reference/cli-reference/boot-source.md +++ /dev/null @@ -1,121 +0,0 @@ -# boot-source - -Enter keyword arguments in the form `key=value`. - -## Delete a boot source - -```bash -maas $PROFILE boot-source delete [--help] [-d] [-k] id [data ...] -``` - -### Positional arguments - -- id - -Delete a boot source with the given id. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Read a boot source - -```bash -maas $PROFILE boot-source read [--help] [-d] [-k] id [data ...] -``` - -### Positional arguments - -- id - -Read a boot source with the given id. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Update a boot source - -```bash -maas $PROFILE boot-source update [--help] [-d] [-k] id [data ...] -``` - -### Positional arguments - -- id - -Update a boot source with the given id. - -### Keyword "url" - -Optional String. The URL of the BootSource. - -### Keyword "keyring_filename" - -Optional String. The path to the keyring file for this BootSource. - -### Keyword "keyring_data" - -Optional String. The GPG keyring for this BootSource, base64-encoded data. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Create a boot source - -```bash -maas $PROFILE boot-sources create [--help] [-d] [-k] [data ...] -``` - -Create a new boot source. - -Note that in addition to ``url``, you must supply either ``keyring_data`` or ``keyring_filename``. - -### Keyword "url" - -Required String. The URL of the BootSource. - -### Keyword "keyring_filename" - -Optional String. The path to the keyring file for this BootSource. - -### Keyword "keyring_data" - -Optional String. The GPG keyring for this BootSource, base64-encoded. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## List boot sources - -```bash -maas $PROFILE boot-sources read [--help] [-d] [-k] [data ...] -``` - -List all boot sources. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | diff --git a/rtd-docs/reference/cli-reference/changepassword.md b/rtd-docs/reference/cli-reference/changepassword.md deleted file mode 100644 index 701fc023e0..0000000000 --- a/rtd-docs/reference/cli-reference/changepassword.md +++ /dev/null @@ -1,21 +0,0 @@ -# changepassword - -Change a MAAS user's password. - -```bash -maas changepassword [-h] [--database DATABASE] [username] -``` - -## Positional arguments - -| Argument | Effect | -|----------|-------------------------------------------------------| -| username | Username to change password for; by default, it's the | -| | current username. | - -## Command-line options - -| Option | Effect | -|---------------------|------------------------------------------------------| -| -h, --help | show this help message and exit | -| --database DATABASE | Specifies the database to use. Default is "default". | diff --git a/rtd-docs/reference/cli-reference/commissioning-scripts.md b/rtd-docs/reference/cli-reference/commissioning-scripts.md deleted file mode 100644 index 164d1874b0..0000000000 --- a/rtd-docs/reference/cli-reference/commissioning-scripts.md +++ /dev/null @@ -1,111 +0,0 @@ -# commissioning-scripts - -Enter keyword arguments in the form `key=value`. - -## Delete a commissioning script - -*This operation has been deprecated in favour of `node-script delete`.* - -```bash -maas $PROFILE commissioning-script delete [--help] [-d] [-k] name [data ...] -``` - -### Positional arguments - -- name - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Read a commissioning script - -*This operation has been deprecated in favour of `node-script read`.* - -```bash -maas $PROFILE commissioning-script read [--help] [-d] [-k] name [data ...] -``` - -### Positional arguments - -- name - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Update a commissioning script - -*This operation has been deprecated in favour of `node-script update`.* - -```bash -maas $PROFILE commissioning-script update [--help] [-d] [-k] name [data ...] -``` - -### Positional arguments - -- name - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Create a new commissioning script - -*This operation has been deprecated in favour of `node-scripts create`.* - -```bash -maas $PROFILE commissioning-scripts create [--help] [-d] [-k] [data ...] -``` - -Each commissioning script is identified by a unique name. By convention the name should consist of a two-digit number, a dash, and a brief descriptive identifier consisting only of ASCII characters. You don't need to follow this convention, but not doing so opens you up to risks w.r.t. encoding and ordering. The name must not contain any whitespace, quotes, or apostrophes. - -A commissioning machine will run each of the scripts in lexicographical order. There are no promises about how non-ASCII characters are sorted, or even how upper-case letters are sorted relative to lower-case letters. So where ordering matters, use unique numbers. - -Scripts built into MAAS will have names starting with "00-maas" or "99-maas" to ensure that they run first or last, respectively. - -Usually a commissioning script will be just that, a script. Ideally a script should be ASCII text to avoid any confusion over encoding. But in some cases a commissioning script might consist of a binary tool provided by a hardware vendor. Either way, the script gets passed to the commissioning machine in the exact form in which it was uploaded. - -### Keyword "name" - -Unique identifying name for the script. Names should follow the pattern of "25-burn-in-hard-disk" (all ASCII, and with numbers greater than zero, and generally no "weird" characters). - -### Keyword "content" - -A script file, to be uploaded in binary form. Note: this is not a normal parameter, but a file upload. Its filename is ignored; MAAS will know it by the name you pass to the request. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## List commissioning scripts - -*This operation has been deprecated in favour of `node-scripts read`.* - -```bash -maas $PROFILE commissioning-scripts read [--help] [-d] [-k] [data ...] -``` - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | diff --git a/rtd-docs/reference/cli-reference/config-tls.md b/rtd-docs/reference/cli-reference/config-tls.md deleted file mode 100644 index 09877b5b0c..0000000000 --- a/rtd-docs/reference/cli-reference/config-tls.md +++ /dev/null @@ -1,29 +0,0 @@ -# config-tls - -Enable or disable TLS for MAAS. - -```bash -maas config-tls enable [-h] [--cacert CACERT] [-p PORT] [--yes] key cert -``` - -```bash -maas config-tls disable [-h] -``` - -## Positional arguments - -| Argument | Effect | -|----------|-----------------------------------| -| key | path to the private key | -| cert | path to certificate in PEM format | - -## Command-line options - -| Option | Effect | -|----------------------|-------------------------------------------------------| -| -h, --help | show this help message and exit | -| --cacert CACERT | path to CA certificates chain in PEM format (default: | -| | None) | -| -p PORT, --port PORT | HTTPS port (default: 5443) | -| --yes | Skip interactive confirmation (default: False) | -| | | diff --git a/rtd-docs/reference/cli-reference/config-vault.md b/rtd-docs/reference/cli-reference/config-vault.md deleted file mode 100644 index 5a7d2f46d7..0000000000 --- a/rtd-docs/reference/cli-reference/config-vault.md +++ /dev/null @@ -1,32 +0,0 @@ -# config-vault - -Configure HashiCorp Vault for use with MAAS. - -```bash -maas config-vault configure [-h] [--mount MOUNT] [--yes] url role_id wrapped_token secrets_path -``` - -```bash -maas config-vault migrate [-h] -``` - -```bash -maas config-vault status [-h] -``` - -## Positional arguments - -| Argument | Effect | -|---------------|--------------------------------------------------| -| url | Vault URL | -| role_id | Vault AppRole Role ID | -| wrapped_token | Vault wrapped token for the AppRole secret_id | -| secrets_path | Path prefix for MAAS secrets in Vault KV storage | - -## Command-line options - -| Option | Effect | -|---------------|------------------------------------------------| -| -h, --help | show this help message and exit | -| --mount MOUNT | Vault KV mount path (default: secret) | -| --yes | Skip interactive confirmation (default: False) | diff --git a/rtd-docs/reference/cli-reference/config.md b/rtd-docs/reference/cli-reference/config.md deleted file mode 100644 index efe1e33355..0000000000 --- a/rtd-docs/reference/cli-reference/config.md +++ /dev/null @@ -1,41 +0,0 @@ -# config - -View or change controller configuration. - -```bash -maas config [-h] [--show] [--show-database-password] [--show-secret] \ -[--maas-url MAAS_URL] [--vault-uri VAULT_URI] \ -[--vault-approle-id VAULT_APPROLE_ID] [--vault-wrapped-token VAULT_WRAPPED_TOKEN] \ -[--vault-secrets-path VAULT_SECRETS_PATH] [--vault-secrets-mount VAULT_SECRETS_MOUNT] \ -[--secret SECRET] [--num-workers NUM_WORKERS] [--enable-debug] [--disable-debug] \ -[--enable-debug-queries] [--disable-debug-queries] [--parsable] -``` - -## Command-line options - -| Option | Effect | -|-------------------------------------------|--------------------------------------------------------| -| -h, --help | show this help message and exit | -| --show | Show the current configuration. Default when no | -| | parameters are provided. | -| --show-database-password | Show the hidden database password. | -| --show-secret | Show the hidden secret. | -| --maas-url MAAS_URL | URL that MAAS should use for communicate from the | -| | nodes to MAAS and other controllers of MAAS. | -| --vault-uri VAULT_URI | Vault URI | -| --vault-approle-id VAULT_APPROLE_ID | Vault AppRole Role ID | -| --vault-wrapped-token VAULT_WRAPPED_TOKEN | Vault Wrapped Token for AppRole ID | -| --vault-secrets-path VAULT_SECRETS_PATH | Path prefix for MAAS secrets in Vault KV storage | -| --vault-secrets-mount VAULT_SECRETS_MOUNT | Vault KV mount path | -| --secret SECRET | Secret token required for the rack controller to talk | -| | to the region controller(s). Only used when in 'rack' | -| | mode. | -| --num-workers NUM_WORKERS | Number of regiond worker processes to run. | -| --enable-debug | Enable debug mode for detailed error and log | -| | reporting. | -| --disable-debug | Disable debug mode. | -| --enable-debug-queries | Enable query debugging. Reports number of queries and | -| | time for all actions performed. Requires debug to also | -| | be True. mode for detailed error and log reporting. | -| --disable-debug-queries | Disable query debugging. | -| --parsable | Output the current configuration in a parsable format. | diff --git a/rtd-docs/reference/cli-reference/configauth.md b/rtd-docs/reference/cli-reference/configauth.md deleted file mode 100644 index 5352591ace..0000000000 --- a/rtd-docs/reference/cli-reference/configauth.md +++ /dev/null @@ -1,25 +0,0 @@ -# configauth - -Configure external authentication. - -```bash -maas configauth [-h] [--candid-agent-file CANDID_AGENT_FILE] [--candid-domain CANDID_DOMAIN] [--candid-admin-group CANDID_ADMIN_GROUP] [--rbac-url RBAC_URL] [--rbac-service-name RBAC_SERVICE_NAME] [--json] -``` - -## Command-line options - -| Option | Effect | -|-----------------------------------------|-------------------------------------------------------| -| -h, --help | show this help message and exit | -| --candid-agent-file CANDID_AGENT_FILE | Agent file containing Candid authentication | -| | information | -| --candid-domain CANDID_DOMAIN | The authentication domain to look up users in for the | -| | external Candid server | -| --candid-admin-group CANDID_ADMIN_GROUP | Group of users whose members are made admins in MAAS | -| --rbac-url RBAC_URL | The URL for the Canonical RBAC service to use | -| --rbac-service-name RBAC_SERVICE_NAME | Optionally, the name of the RBAC service to register | -| | this MAAS as. If not provided, a list with services | -| | that the user can register will be displayed, to | -| | choose from | -| --json | Return the current authentication configuration as | -| | JSON | diff --git a/rtd-docs/reference/cli-reference/createadmin.md b/rtd-docs/reference/cli-reference/createadmin.md deleted file mode 100644 index fb3488c69f..0000000000 --- a/rtd-docs/reference/cli-reference/createadmin.md +++ /dev/null @@ -1,17 +0,0 @@ -# createadmin - -Create a MAAS administrator account. - -```bash -maas createadmin [-h] [--username USERNAME] [--password PASSWORD] [--email EMAIL] [--ssh-import SSH_IMPORT] -``` - -## Command-line options | Option | Effect | - -|-------------------------|-------------------------------------------------------| -| -h, --help | show this help message and exit | -| --username USERNAME | Username for the new account. | -| --password PASSWORD | Force a given password instead of prompting. | -| --email EMAIL | Specifies the email for the admin. | -| --ssh-import SSH_IMPORT | Import SSH keys from Launchpad (lp:user-id) or Github | -| | (gh:user-id). | diff --git a/rtd-docs/reference/cli-reference/device.md b/rtd-docs/reference/cli-reference/device.md deleted file mode 100644 index c1dd4a7d64..0000000000 --- a/rtd-docs/reference/cli-reference/device.md +++ /dev/null @@ -1,376 +0,0 @@ -# device - -Enter keyword arguments in the form `key=value`. - -## Delete a device - -```bash -maas $PROFILE device delete [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -Delete a device with the given system_id. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Get system details - -```bash -maas $PROFILE device details [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -Returns system details -- for example, LLDP and ``lshw`` XML dumps. - -Returns a ``{detail_type: xml, ...}`` map, where ``detail_type`` is something like "lldp" or "lshw". - -Note that this is returned as BSON and not JSON. This is for efficiency, but mainly because JSON can't do binary content without applying additional encoding like base-64. The example output below is represented in ASCII using ``bsondump example.bson`` and is for demonstrative purposes. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Get power parameters - -```bash -maas $PROFILE device power-parameters [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -Gets power parameters for a given system_id, if any. For some types of power control this will include private information such as passwords and secret keys. - -Note that this method is reserved for admin users and returns a 403 if the user is not one. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Read a node - -```bash -maas $PROFILE device read [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -Reads a node with the given system_id. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Reset device configuration - -```bash -maas $PROFILE device restore-default-configuration [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -Restore the configuration options of a device with the given system_id to default values. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Reset networking options - -```bash -maas $PROFILE device restore-networking-configuration [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -Restore the networking options of a device with the given system_id to default values. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Deprecated, use set-workload-annotations - -```bash -maas $PROFILE device set-owner-data [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -Deprecated, use set-workload-annotations instead. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Set key=value data - -```bash -maas $PROFILE device set-workload-annotations [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -Set `key=value` data for the current owner. - -Pass any `key=value` form data to this method to add, modify, or remove. A key is removed when the value for that key is set to an empty string. - -This operation will not remove any previous keys unless explicitly passed with an empty string. All workload annotations are removed when the machine is no longer allocated to a user. - -### Keyword "key" - -Required String. ``key`` can be any string value. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Update a device - -```bash -maas $PROFILE device update [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -Update a device with a given system_id. - -### Keyword "hostname" - -Optional String. The hostname for this device. - -### Keyword "description" - -Optional String. The optional description for this machine. - -### Keyword "domain" - -Optional String. The domain for this device. - -### Keyword "parent" - -Optional String. Optional `system_id` to indicate this device's parent. If the parent is already set and this parameter is omitted, the parent will be unchanged. - -### Keyword "zone" - -Optional String. Name of a valid physical zone in which to place this node. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## MAC address registered - -```bash -maas $PROFILE devices is-registered [--help] [-d] [-k] [data ...] -``` - -Returns whether or not the given MAC address is registered within this MAAS (and attached to a non-retired node). - -### Keyword "mac_address" - -Required URL String. The MAC address to be checked. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## List Nodes visible to the user - -```bash -maas $PROFILE devices read [--help] [-d] [-k] [data ...] -``` - -List nodes visible to current user, optionally filtered by criteria. - -Nodes are sorted by id (i.e. most recent last) and grouped by type. - -### Keyword "hostname" - -Optional String. Only nodes relating to the node with the matching hostname will be returned. This can be specified multiple times to see multiple nodes. - -### Keyword "cpu_count" - -Optional Int. Only nodes with the specified minimum number of CPUs will be included. - -### Keyword "mem" - -Optional String. Only nodes with the specified minimum amount of RAM (in MiB) will be included. - -### Keyword "mac_address" - -Optional String. Only nodes relating to the node owning the specified MAC address will be returned. This can be specified multiple times to see multiple nodes. - -### Keyword "id" - -Optional String. Only nodes relating to the nodes with matching system ids will be returned. - -### Keyword "domain" - -Optional String. Only nodes relating to the nodes in the domain will be returned. - -### Keyword "zone" - -Optional String. Only nodes relating to the nodes in the zone will be returned. - -### Keyword "pool" - -Optional String. Only nodes belonging to the pool will be returned. - -### Keyword "agent_name" - -Optional String. Only nodes relating to the nodes with matching agent names will be returned. - -### Keyword "fabrics" - -Optional String. Only nodes with interfaces in specified fabrics will be returned. - -### Keyword "not_fabrics" - -Optional String. Only nodes with interfaces not in specified fabrics will be returned. - -### Keyword "vlans" - -Optional String. Only nodes with interfaces in specified VLANs will be returned. - -### Keyword "not_vlans" - -Optional String. Only nodes with interfaces not in specified VLANs will be returned. - -### Keyword "subnets" - -Optional String. Only nodes with interfaces in specified subnets will be returned. - -### Keyword "not_subnets" - -Optional String. Only nodes with interfaces not in specified subnets will be returned. - -### Keyword "link_speed" - -Optional String. Only nodes with interfaces with link speeds greater than or equal to link_speed will be returned. - -### Keyword "status" - -Optional String. Only nodes with specified status will be returned. - -### Keyword "pod" - -Optional String. Only nodes that belong to a specified pod will be returned. - -### Keyword "not_pod" - -Optional String. Only nodes that don't belong to a specified pod will be returned. - -### Keyword "pod_type" - -Optional String. Only nodes that belong to a pod of the specified type will be returned. - -### Keyword "not_pod_type" - -Optional String. Only nodes that don't belong a pod of the specified type will be returned. - -### Keyword "devices" - -Optional String. Only return nodes which have one or more devices containing the following constraints in the format `key=value[,key2=value2[,...]]`. - -Each key can be one of the following: - -- ``vendor_id``: The device vendor id -- ``product_id``: The device product id -- ``vendor_name``: The device vendor name, not case sensative -- ``product_name``: The device product name, not case sensative -- ``commissioning_driver``: The device uses this driver during commissioning. -Type: String. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Assign nodes to a zone - -```bash -maas $PROFILE devices set-zone [--help] [-d] [-k] [data ...] -``` - -Assigns a given node to a given zone. - -### Keyword "zone" - -Required String. The zone name. - -### Keyword "nodes" - -Required String. The node to add. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | diff --git a/rtd-docs/reference/cli-reference/dhcp-snippet.md b/rtd-docs/reference/cli-reference/dhcp-snippet.md deleted file mode 100644 index 7644923447..0000000000 --- a/rtd-docs/reference/cli-reference/dhcp-snippet.md +++ /dev/null @@ -1,136 +0,0 @@ -# dhcp-snippet - -Enter keyword arguments in the form `key=value`. - -## Delete a DHCP snippet - -```bash -maas $PROFILE dhcpsnippet delete [--help] [-d] [-k] id [data ...] -``` - -### Positional arguments - -- id - -Delete a DHCP snippet with the given id. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Read a DHCP snippet - -```bash -maas $PROFILE dhcpsnippet read [--help] [-d] [-k] id [data ...] -``` - -### Positional arguments - -- id - -Read a DHCP snippet with the given id. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Revert DHCP snippet to earlier version - -```bash -maas $PROFILE dhcpsnippet revert [--help] [-d] [-k] id [data ...] -``` - -### Positional arguments - -- id - -Revert the value of a DHCP snippet with the given id to an earlier revision. - -### Keyword "to" - -Required Int. What revision in the DHCP snippet's history to revert to. This can either be an ID or a negative number representing how far back to go. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Update a DHCP snippet - -```bash -maas $PROFILE dhcpsnippet update [--help] [-d] [-k] id [data ...] -``` - -### Positional arguments - -- id - -Update a DHCP snippet with the given id. - -### Keyword "name" - -Optional String. The name of the DHCP snippet. - -### Keyword "value" - -Optional String. The new value of the DHCP snippet to be used in dhcpd.conf. Previous values are stored and can be reverted. -Type: String. - -### Keyword "description" - -Optional String. A description of what the DHCP snippet does. - -### Keyword "enabled" - -Optional Boolean. Whether or not the DHCP snippet is currently enabled. - -### Keyword "node" - -Optional String. The node the DHCP snippet is to be used for. Can not be set if subnet is set. - -### Keyword "subnet" - -Optional String. The subnet the DHCP snippet is to be used for. Can not be set if node is set. - -### Keyword "global_snippet" - -Optional Boolean. Set the DHCP snippet to be a global option. This removes any node or subnet links. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Read a DHCP snippet - -```bash -maas $PROFILE dhcpsnippet read [--help] [-d] [-k] id [data ...] -``` - -### Positional arguments - -- id - -Read a DHCP snippet with the given id. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | diff --git a/rtd-docs/reference/cli-reference/discovery.md b/rtd-docs/reference/cli-reference/discovery.md deleted file mode 100644 index 16117aae71..0000000000 --- a/rtd-docs/reference/cli-reference/discovery.md +++ /dev/null @@ -1,201 +0,0 @@ -# discovery - -Enter keyword arguments in the form `key=value`. - -## List all discovered devices with an unknown IP address - -```bash -maas $PROFILE discoveries by-unknown-ip [--help] [-d] [-k] [data ...] -``` - -Lists all discovered devices with an unknown IP address. Filters the list of discovered devices by excluding any discoveries where a known MAAS node is configured with the IP address of a discovery, or has been observed using it after it was assigned by a MAAS-managed DHCP server. - -Discoveries are listed in the order they were last observed on the network (most recent first). - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Lists all discovered devices completely unknown to MAAS - -```bash -maas $PROFILE discoveries by-unknown-ip-and-mac [--help] [-d] [-k] [data ...] -``` - -Lists all discovered devices completely unknown to MAAS. Filters the list of discovered devices by excluding any discoveries where a known MAAS node is configured with either the MAC address or the IP address of a discovery. - -Discoveries are listed in the order they were last observed on the network (most recent first). - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## List all discovered devices with unknown MAC - -```bash -maas $PROFILE discoveries by-unknown-mac [--help] [-d] [-k] [data ...] -``` - -Filters the list of discovered devices by excluding any discoveries where an interface known to MAAS is configured with a discovered MAC address. - -Discoveries are listed in the order they were last observed on the network (most recent first). - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Delete all discovered neighbours - -```bash -maas $PROFILE discoveries clear [--help] [-d] [-k] [data ...] -``` - -Deletes all discovered neighbours and/or mDNS entries. Note: One of ``mdns``, ``neighbours``, or ``all`` parameters must be supplied. - -### Keyword "mdns" - -Optional Boolean. Delete all mDNS entries. - -### Keyword "neighbours" - -Optional Boolean. Delete all neighbour entries. - -### Keyword "all" - -Optional Boolean. Delete all discovery data. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Delete discoveries that match a MAC and IP - -```bash -maas $PROFILE discoveries clear-by-mac-and-ip [--help] [-d] [-k] [data ...] -``` - -Deletes all discovered neighbours (and associated reverse DNS entries) associated with the given IP address and MAC address. - -### Keyword "ip" - -Required String. IP address - -### Keyword "mac" - -Required String. MAC address - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## List all discovered devices - -```bash -maas $PROFILE discoveries read [--help] [-d] [-k] [data ...] -``` - -Lists all the devices MAAS has discovered. Discoveries are listed in the order they were last observed on the network (most recent first). - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Run discovery scan on rack networks - -```bash -maas $PROFILE discoveries scan [--help] [-d] [-k] [data ...] -``` - -Immediately run a neighbour discovery scan on all rack networks. - -This command causes each connected rack controller to execute the 'maas-rack scan-network' command, which will scan all CIDRs configured on the rack controller using 'nmap' (if it is installed) or 'ping'. - -Network discovery must not be set to 'disabled' for this command to be useful. - -Scanning will be started in the background, and could take a long time on rack controllers that do not have 'nmap' installed and are connected to large networks. - -If the call is a success, this method will return a dictionary of results with the following keys: - -``result``: A human-readable string summarizing the results. - -``scan_attempted_on``: A list of rack system_id values where a scan was attempted. (That is, an RPC connection was successful and a subsequent call was intended.) - -``failed_to_connect_to``: A list of rack system_id values where the RPC connection failed. - -``scan_started_on``: A list of rack system_id values where a scan was successfully started. - -``scan_failed_on``: A list of rack system_id values where a scan was attempted, but failed because a scan was already in progress. - -``rpc_call_timed_out_on``: A list of rack system_id values where the RPC connection was made, but the call timed out before a ten second timeout elapsed. - -### Keyword "cidr" - -Optional String. The subnet CIDR(s) to scan (can be specified multiple times). If not specified, defaults to all networks. - -### Keyword "force" - -Optional Boolean. If True, will force the scan, even if all networks are specified. (This may not be the best idea, depending on acceptable use agreements, and the politics of the organization that owns the network.) Note that this parameter is required if all networks are specified. Default: False. - -### Keyword "always_use_ping" - -Optional String. If True, will force the scan to use 'ping' even if 'nmap' is installed. Default: False. - -### Keyword "slow" - -Optional String. If True, and 'nmap' is being used, will limit the scan to nine packets per second. If the scanner is 'ping', this option has no effect. Default: False. - -### Keyword "threads" - -Optional String. The number of threads to use during scanning. If 'nmap' is the scanner, the default is one thread per 'nmap' process. If 'ping' is the scanner, the default is four threads per CPU. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Read a discovery - -```bash -maas $PROFILE discovery read [--help] [-d] [-k] discovery_id [data ...] -``` - -### Positional arguments - -- discovery_id - -Read a discovery with the given discovery_id. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | diff --git a/rtd-docs/reference/cli-reference/dnsresource-records.md b/rtd-docs/reference/cli-reference/dnsresource-records.md deleted file mode 100644 index 3b98a107de..0000000000 --- a/rtd-docs/reference/cli-reference/dnsresource-records.md +++ /dev/null @@ -1,161 +0,0 @@ -# dnsresource-records - -Enter keyword arguments in the form `key=value`. - -## Delete a DNS resource record - -```bash -maas $PROFILE dnsresource-record delete [--help] [-d] [-k] id [data ...] -``` - -### Positional arguments - -- id - -Delete a DNS resource record with the given id. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Read a DNS resource record description Read a DNS resource record with the given id - -```bash -maas $PROFILE dnsresource-record read [--help] [-d] [-k] id [data ...] -``` - -### Positional arguments - -- id - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Update a DNS resource record - -```bash -maas $PROFILE dnsresource-record update [--help] [-d] [-k] id [data ...] -``` - -### Positional arguments - -- id - -Update a DNS resource record with the given id. - -### Keyword "rrtype" - -Optional String. Resource type. - -### Keyword "rrdata" - -Optional String. Resource data (everything to the right of type.) - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Create a DNS resource record - -```bash -maas $PROFILE dnsresource-records create [--help] [-d] [-k] [data ...] -``` - -Create a new DNS resource record. - -### Keyword "fqdn" - -Optional String. Hostname (with domain) for the dnsresource. Either ``fqdn`` or ``name`` and ``domain`` must be specified. ``fqdn`` is ignored if either name or domain is given (e.g. ). - -### Keyword "name" - -Optional String. The name (or hostname without a domain) of the DNS resource record (e.g. ) - -### Keyword "domain" - -Optional String. The domain (name or id) where to create the DNS resource record (Domain (e.g. 'maas') - -### Keyword "rrtype" - -Optional String. The resource record type (e.g ``cname``, ``mx``, ``ns``, ``srv``, ``sshfp``, ``txt``). - -### Keyword "rrdata" - -Optional String. The resource record data (e.g. 'your-maas', '10 mail.your-maas.maas') - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## List all DNS resource records - -```bash -maas $PROFILE dnsresource-records read [--help] [-d] [-k] [data ...] -``` - -List all DNS resource records. - -### Keyword "domain" - -Optional String. Restricts the listing to entries for the domain. - -### Keyword "name" - -Optional String. Restricts the listing to entries of the given name. - -### Keyword "rrtype" - -Optional String. Restricts the listing to entries which have records of the given rrtype. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## List all DNS resource records - -```bash -maas $PROFILE dnsresource-records read [--help] [-d] [-k] [data ...] -``` - -List all DNS resource records. - -### Keyword "domain" - -Optional String. Restricts the listing to entries for the domain. - -### Keyword "name" - -Optional String. Restricts the listing to entries of the given name. - -### Keyword "rrtype" - -Optional String. Restricts the listing to entries which have records of the given rrtype. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | diff --git a/rtd-docs/reference/cli-reference/dnsresource.md b/rtd-docs/reference/cli-reference/dnsresource.md deleted file mode 100644 index 8765be2241..0000000000 --- a/rtd-docs/reference/cli-reference/dnsresource.md +++ /dev/null @@ -1,119 +0,0 @@ -# dnsresource - -Enter keyword arguments in the form `key=value`. - -## Delete a DNS resource - -```bash -maas $PROFILE dnsresource delete [--help] [-d] [-k] id [data ...] -``` - -### Positional arguments - -- id - -Delete a DNS resource with the given id. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Read a DNS resource - -```bash -maas $PROFILE dnsresource read [--help] [-d] [-k] id [data ...] -``` - -### Positional arguments - -- id - -Read a DNS resource by id. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Update a DNS resource - -```bash -maas $PROFILE dnsresource update [--help] [-d] [-k] id [data ...] -``` - -### Positional arguments - -- id - -Update a DNS resource with the given id. - -### Keyword "fqdn" - -Optional String. Hostname (with domain) for the dnsresource. Either ``fqdn`` or ``name`` and ``domain`` must be specified. ``fqdn`` is ignored if either ``name`` or ``domain`` is given. - -### Keyword "name" - -Optional String. Hostname (without domain). - -### Keyword "domain" - -Optional String. Domain (name or id). - -### Keyword "address_ttl" - -Optional String. Default TTL for entries in this zone. - -### Keyword "ip_addresses" - -Optional String. Address (ip or id) to assign to the dnsresource. This creates an A or AAAA record, for each of the supplied ip_addresses, IPv4 or IPv6, respectively. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Create a DNS resource - -```bash -maas $PROFILE dnsresources create [--help] [-d] [-k] [data ...] -``` - -Create a DNS resource. - -### Keyword "fqdn" - -Optional String. Hostname (with domain) for the dnsresource. Either ``fqdn`` or ``name`` and ``domain`` must be specified. ``fqdn`` is ignored if either ``name`` or ``domain`` is given. - -### Keyword "name" - -Required String. Hostname (without domain). - -### Keyword "domain" - -Required String. Domain (name or id). - -### Keyword "address_ttl" - -Optional String. Default TTL for entries in this zone. - -### Keyword "ip_addresses" - -Optional String. Address (ip or id) to assign to the dnsresource. This creates an A or AAAA record, for each of the supplied ip_addresses, IPv4 or IPv6, respectively. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | diff --git a/rtd-docs/reference/cli-reference/domain.md b/rtd-docs/reference/cli-reference/domain.md deleted file mode 100644 index 6b21d453d3..0000000000 --- a/rtd-docs/reference/cli-reference/domain.md +++ /dev/null @@ -1,163 +0,0 @@ -# domain - -Enter keyword arguments in the form `key=value`. - -## Delete domain - -```bash -maas $PROFILE domain delete [--help] [-d] [-k] id [data ...] -``` - -### Positional arguments - -- id - -Delete a domain with the given id. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Read domain - -```bash -maas $PROFILE domain read [--help] [-d] [-k] id [data ...] -``` - -### Positional arguments - -- id - -Read a domain with the given id. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Set domain as default - -```bash -maas $PROFILE domain set-default [--help] [-d] [-k] id [data ...] -``` - -### Positional arguments - -- id - -Set the specified domain to be the default. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Update a domain - -```bash -maas $PROFILE domain update [--help] [-d] [-k] id [data ...] -``` - -### Positional arguments - -- id - -Update a domain with the given id. - -### Keyword "name" - -Required String. Name of the domain. - -### Keyword "authoritative" - -Optional String. True if we are authoritative for this domain. - -### Keyword "ttl" - -Optional String. The default TTL for this domain. - -### Keyword "forward_dns_servers" - -Optional String. List of IP addresses for forward DNS servers when MAAS is not authoritative for this domain. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Create a domain - -```bash -maas $PROFILE domains create [--help] [-d] [-k] [data ...] -``` - -Create a domain. - -### Keyword "name" - -Required String. Name of the domain. - -### Keyword "authoritative" - -Optional String. Class type of the domain. - -### Keyword "forward_dns_servers" - -Optional String. List of forward dns server IP addresses when MAAS is not authorititative. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## List all domains - -```bash -maas $PROFILE domains read [--help] [-d] [-k] [data ...] -``` - -List all domains. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Set the SOA serial number - -```bash -maas $PROFILE domains set-serial [--help] [-d] [-k] [data ...] -``` - -Set the SOA serial number for all DNS zones. - -### Keyword "serial" - -Required Int. Serial number to use next. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | diff --git a/rtd-docs/reference/cli-reference/events.md b/rtd-docs/reference/cli-reference/events.md deleted file mode 100644 index 09a9d276c7..0000000000 --- a/rtd-docs/reference/cli-reference/events.md +++ /dev/null @@ -1,59 +0,0 @@ -# events - -Enter keyword arguments in the form `key=value`. - -## List node events - -```bash -maas $PROFILE events query [--help] [-d] [-k] [data ...] -``` - -List node events, optionally filtered by various criteria via URL query parameters. - -### Keyword "hostname" - -Optional String. An optional hostname. Only events relating to the node with the matching hostname will be returned. This can be specified multiple times to get events relating to more than one node. - -### Keyword "mac_address" - -Optional String. An optional list of MAC addresses. Only nodes with matching MAC addresses will be returned. - -### Keyword "id" - -Optional String. An optional list of system ids. Only nodes with matching system ids will be returned. - -### Keyword "zone" - -Optional String. An optional name for a physical zone. Only nodes in the zone will be returned. - -### Keyword "agent_name" - -Optional String. An optional agent name. Only nodes with matching agent names will be returned. - -### Keyword "level" - -Optional String. Desired minimum log level of returned events. Returns this level of events and greater. Choose from: AUDIT, CRITICAL, DEBUG, ERROR, INFO, WARNING. The default is INFO. - -### Keyword "limit" - -Optional String. Optional number of events to return. Default 100. Maximum: 1000. - -### Keyword "before" - -Optional String. Optional event id. Defines where to start returning older events. - -### Keyword "after" - -Optional String. Optional event id. Defines where to start returning newer events. - -### Keyword "owner" - -Optional String. If specified, filters the list to show only events owned by the specified username. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | diff --git a/rtd-docs/reference/cli-reference/fabric.md b/rtd-docs/reference/cli-reference/fabric.md deleted file mode 100644 index a4a7a4b773..0000000000 --- a/rtd-docs/reference/cli-reference/fabric.md +++ /dev/null @@ -1,119 +0,0 @@ -# fabric - -Enter keyword arguments in the form `key=value`. - -## Delete a fabric - -```bash -maas $PROFILE fabric delete [--help] [-d] [-k] id [data ...] -``` - -### Positional arguments - -- id - -Delete a fabric with the given id. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Read a fabric - -```bash -maas $PROFILE fabric read [--help] [-d] [-k] id [data ...] -``` - -### Positional arguments - -- id - -Read a fabric with the given id. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Update fabric - -```bash -maas $PROFILE fabric update [--help] [-d] [-k] id [data ...] -``` - -### Positional arguments - -- id - -Update a fabric with the given id. - -### Keyword "name" - -Optional String. Name of the fabric. - -### Keyword "description" - -Optional String. Description of the fabric. - -### Keyword "class_type" - -Optional String. Class type of the fabric. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Create a fabric - -```bash -maas $PROFILE fabrics create [--help] [-d] [-k] [data ...] -``` - -Create a fabric. - -### Keyword "name" - -Optional String. Name of the fabric. - -### Keyword "description" - -Optional String. Description of the fabric. - -### Keyword "class_type" - -Optional String. Class type of the fabric. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## List fabrics - -```bash -maas $PROFILE fabrics read [--help] [-d] [-k] [data ...] -``` - -List all fabrics. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | diff --git a/rtd-docs/reference/cli-reference/file.md b/rtd-docs/reference/cli-reference/file.md deleted file mode 100644 index f995f8de8e..0000000000 --- a/rtd-docs/reference/cli-reference/file.md +++ /dev/null @@ -1,123 +0,0 @@ -# file - -Enter keyword arguments in the form `key=value`. - -## Delete a file - -```bash -maas $PROFILE file delete [--help] [-d] [-k] filename [data ...] -``` - -### Positional arguments - -- filename - -Delete a file with the given file name. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Read a stored file - -```bash -maas $PROFILE file read [--help] [-d] [-k] filename [data ...] -``` - -### Positional arguments - -- filename - -Reads a stored file with the given file name. The content of the file is base64-encoded. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Delete a file - -```bash -maas $PROFILE file delete [--help] [-d] [-k] filename [data ...] -``` - -### Positional arguments - -- filename - -Delete a file with the given file name. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Get a named file - -```bash -maas $PROFILE files get [--help] [-d] [-k] [data ...] -``` - -Get a named file from the file storage. - -### Keyword "filename" - -Required String. The name of the file. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Get a file by key - -```bash -maas $PROFILE files get-by-key [--help] [-d] [-k] [data ...] -``` - -Get a file from the file storage with the given key. - -### Keyword "key" - -Required String. The file's key. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## List files - -```bash -maas $PROFILE files read [--help] [-d] [-k] [data ...] -``` - -List the files from the file storage. The returned files are ordered by file name and the content is excluded. - -### Keyword "prefix" - -Optional String. Prefix used to filter returned files. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | diff --git a/rtd-docs/reference/cli-reference/index.md b/rtd-docs/reference/cli-reference/index.md deleted file mode 100644 index 784530f6c0..0000000000 --- a/rtd-docs/reference/cli-reference/index.md +++ /dev/null @@ -1,74 +0,0 @@ -# CLI reference - -```{toctree} -:titlesonly: -:maxdepth: 2 - -account -apikey -bcache-cache-set -bcache -block-device -boot-resource -boot-source -boot-source-selection -changepassword -commissioning-scripts -configauth -config -config-tls -config-vault -createadmin -device -dhcp-snippet -discovery -dnsresource -dnsresource-records -domain -events -fabric -file -init -interface -ipaddresses -iprange -license-key -list -login -logout -maas -machine -migrate -network -node-device -node -node-result -node-script -node-script-result -notification -oidc -package-repository -partition -pod -rack-controller -raid -refresh -region-controller -resource-pool -space -sshkey -sslkey -static-route -status -subnet -tag -user -user-group -version -vlan -vm-cluster -vmfs-datastores -vm-host -volume-group -zone -``` diff --git a/rtd-docs/reference/cli-reference/init.md b/rtd-docs/reference/cli-reference/init.md deleted file mode 100644 index 0990f45452..0000000000 --- a/rtd-docs/reference/cli-reference/init.md +++ /dev/null @@ -1,30 +0,0 @@ -# init - -Initialize MAAS in the specified run mode. - -```bash -maas init [-h] {region+rack,region,rack} ... -``` - -## Command-line options - -| Option | Effect | -|------------|---------------------------------| -| -h, --help | show this help message and exit | - -## Run modes - -| Mode | Effect | -|-------------|----------------------------------| -| region+rack | Both region and rack controllers | -| region | Region controller only | -| rack | Rack controller only | - -When installing region or rack+region modes, MAAS needs a PostgreSQL database to connect to. - -If you want to set up PostgreSQL for a non-production deployment on this machine, and configure it for use with MAAS, you can install the `maas-test-db` snap before running `maas init`: - -```bash -sudo snap install maas-test-db -sudo maas init region+rack --database-uri maas-test-db:/// -``` diff --git a/rtd-docs/reference/cli-reference/interface.md b/rtd-docs/reference/cli-reference/interface.md deleted file mode 100644 index 74ad1020e9..0000000000 --- a/rtd-docs/reference/cli-reference/interface.md +++ /dev/null @@ -1,643 +0,0 @@ -# interface - -Enter keyword arguments in the form `key=value`. - -## Add a tag to an interface - -```bash -maas $PROFILE interface add-tag [--help] [-d] [-k] system_id id [data ...] -``` - -### Positional arguments - -- system_id -- id - -Add a tag to an interface with the given `system_id` and interface `id`. - -### Keyword "tag" - -Optional String. The tag to add. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Delete an interface - -```bash -maas $PROFILE interface delete [--help] [-d] [-k] system_id id [data ...] -``` - -### Positional arguments - -- system_id -- id - -Delete an interface with the given `system_id` and interface `id`. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Disconnect an interface - -```bash -maas $PROFILE interface disconnect [--help] [-d] [-k] system_id id [data ...] -``` - -### Positional arguments - -- system_id -- id - -Disconnect an interface with the given `system_id` and interface `id`. - -Deletes any linked subnets and IP addresses, and disconnects the interface from any associated VLAN. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Link interface to a subnet - -```bash -maas $PROFILE interface link-subnet [--help] [-d] [-k] system_id id [data ...] -``` - -### Positional arguments - -- system_id -- id - -Link an interface with the given `system_id` and interface `id` to a subnet. - -### Keyword "mode" - -Required String. ``AUTO``,``DHCP``, ``STATIC`` or ``LINK_UP`` connection to subnet. - -Mode definitions: - -- ``AUTO``: Assign this interface a static IP address from the provided subnet. The subnet must be a managed subnet. The IP address will not be assigned until the node goes to be deployed. - -- ``DHCP``: Bring this interface up with DHCP on the given subnet. Only one subnet can be set to ``DHCP``. If the subnet is managed this interface will pull from the dynamic IP range. - -- ``STATIC``: Bring this interface up with a static IP address on the given subnet. Any number of static links can exist on an interface. - -- ``LINK_UP``: Bring this interface up only on the given subnet. No IP address will be assigned to this interface. The interface cannot have any current ``AUTO``, ``DHCP`` or ``STATIC`` links. - -### Keyword "subnet" - -Required Int. Subnet id linked to interface. - -### Keyword "ip_address" - -Optional String. IP address for the interface in subnet. Only used when mode is ``STATIC``. If not provided an IP address from subnet will be auto selected. - -### Keyword "force" - -Optional Boolean. If True, allows ``LINK_UP`` to be set on the interface even if other links already exist. Also allows the selection of any VLAN, even a VLAN MAAS does not believe the interface to currently be on. Using this option will cause all other links on the interface to be deleted. (Defaults to False.) - -### Keyword "default_gateway" - -Optional String. True sets the gateway IP address for the subnet as the default gateway for the node this interface belongs to. Option can only be used with the ``AUTO`` and ``STATIC`` modes. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Read an interface - -```bash -maas $PROFILE interface read [--help] [-d] [-k] system_id id [data ...] -``` - -### Positional arguments - -- system_id -- id - -Read an interface with the given `system_id` and interface `id`. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Remove a tag from an interface - -```bash -maas $PROFILE interface remove-tag [--help] [-d] [-k] system_id id [data ...] -``` - -### Positional arguments - -- system_id -- id - -Remove a tag from an interface with the given `system_id` and interface `id`. - -### Keyword "tag" - -Optional String. The tag to remove. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Set the default gateway on a machine - -```bash -maas $PROFILE interface set-default-gateway [--help] [-d] [-k] system_id id [data ...] -``` - -### Positional arguments - -- system_id -- id - -Set the given interface id on the given `system_id` as the default gateway. - -If this interface has more than one subnet with a gateway IP in the same IP address family then specifying the ID of the link on this interface is required. - -### Keyword "link_id" - -Optional Int. ID of the link on this interface to select the default gateway IP address from. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Unlink interface from subnet - -```bash -maas $PROFILE interface unlink-subnet [--help] [-d] [-k] system_id id [data ...] -``` - -### Positional arguments - -- system_id -- id - -Unlink an interface with the given `system_id` and interface `id` from a subnet. - -### Keyword "id" - -Optional Int. ID of the subnet link on the interface to remove. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Update an interface - -```bash -maas $PROFILE interface update [--help] [-d] [-k] system_id id [data ...] -``` - -### Positional arguments - -- system_id -- id - -Update an interface with the given `system_id` and interface `id`. - -Note: machines must have a status of Ready or Broken to have access to all options. Machines with Deployed status can only have the name and/or mac_address updated for an interface. This is intented to allow a bad interface to be replaced while the machine remains deployed. - -### Keyword "name" - -Optional String. (Physical interfaces) Name of the interface. - -### Keyword "mac_address" - -Optional String. (Physical interfaces) MAC address of the interface. - -### Keyword "tags" - -Optional String. (Physical interfaces) Tags for the interface. - -### Keyword "vlan" - -Optional Int. (Physical interfaces) Untagged VLAN id the interface is connected to. If not set then the interface is considered disconnected. - -### Keyword "name" - -Optional String. (Bond interfaces) Name of the interface. - -### Keyword "mac_address" - -Optional String. (Bond interfaces) MAC address of the interface. - -### Keyword "tags" - -Optional String. (Bond interfaces) Tags for the interface. - -### Keyword "vlan" - -Optional Int. (Bond interfaces) Untagged VLAN id the interface is connected to. If not set then the interface is considered disconnected. - -### Keyword "parents" - -Optional Int. (Bond interfaces) Parent interface ids that make this bond. - -### Keyword "tags" - -Optional String. (VLAN interfaces) Tags for the interface. - -### Keyword "vlan" - -Optional Int. (VLAN interfaces) Tagged VLAN id the interface is connected to. - -### Keyword "parent" - -Optional Int. (VLAN interfaces) Parent interface ids for the VLAN interface. - -### Keyword "name" - -Optional String. (Bridge interfaces) Name of the interface. - -### Keyword "mac_address" - -Optional String. (Bridge interfaces) MAC address of the interface. - -### Keyword "tags" - -Optional String. (Bridge interfaces) Tags for the interface. - -### Keyword "vlan" - -Optional Int. (Bridge interfaces) VLAN id the interface is connected to. - -### Keyword "parent" - -Optional Int. (Bridge interfaces) Parent interface ids for this bridge interface. - -### Keyword "bridge_type" - -Optional String. (Bridge interfaces) Type of bridge to create. Possible values are: ``standard``, ``ovs``. - -### Keyword "bridge_stp" - -Optional Boolean. (Bridge interfaces) Turn spanning tree protocol on or off. (Default: False). - -### Keyword "bridge_fd" - -Optional Int. (Bridge interfaces) Set bridge forward delay to time seconds. (Default: 15). - -### Keyword "bond_miimon" - -Optional Int. (Bonds) The link monitoring freqeuncy in milliseconds. (Default: 100). - -### Keyword "bond_downdelay" - -Optional Int. (Bonds) Specifies the time, in milliseconds, to wait before disabling a slave after a link failure has been detected. - -### Keyword "bond_updelay" - -Optional Int. (Bonds) Specifies the time, in milliseconds, to wait before enabling a slave after a link recovery has been detected. - -### Keyword "bond_lacp_rate" - -Optional String. (Bonds) Option specifying the rate in which we'll ask our link partner to transmit LACPDU packets in 802.3ad mode. Available options are ``fast`` or ``slow``. (Default: ``slow``). - -### Keyword "bond_xmit_hash_policy" - -Optional String. (Bonds) The transmit hash policy to use for slave selection in balance-xor, 802.3ad, and tlb modes. Possible values are: ``layer2``, ``layer2+3``, ``layer3+4``, ``encap2+3``, ``encap3+4``. - -### Keyword "bond_mode" - -Optional String. (Bonds) -The operating mode of the bond. (Default: ``active-backup``). - -Supported bonding modes (bond-mode): - -- ``balance-rr``: Transmit packets in sequential order from the first available slave through the last. This mode provides load balancing and fault tolerance. - -- ``active-backup``: Only one slave in the bond is active. A different slave becomes active if, and only if, the active slave fails. The bond's MAC address is externally visible on only one port (network adapter) to avoid confusing the switch. - -- ``balance-xor``: Transmit based on the selected transmit hash policy. The default policy is a simple [(source MAC address XOR'd with destination MAC address XOR packet type ID) modulo slave count]. - -- ``broadcast``: Transmits everything on all slave interfaces. This mode provides fault tolerance. - -- ``802.3ad``: IEEE 802.3ad Dynamic link aggregation. Creates aggregation groups that share the same speed and duplex settings. Utilizes all slaves in the active aggregator according to the 802.3ad specification. - -- ``balance-tlb``: Adaptive transmit load balancing: channel bonding that does not require any special switch support. - -- ``balance-alb``: Adaptive load balancing: includes balance-tlb plus receive load balancing (rlb) for IPV4 traffic, and does not require any special switch support. The receive load balancing is achieved by ARP negotiation. - -### Keyword "mtu" - -Optional String. Maximum transmission unit. - -### Keyword "accept_ra" - -Optional String. Accept router advertisements. (IPv6 only) - -### Keyword "link_connected" - -Optional Boolean. (Physical interfaces) Whether or not the interface is physically conntected to an uplink. (Default: True). - -### Keyword "interface_speed" - -Optional Int. (Physical interfaces) The speed of the interface in Mbit/s. (Default: 0). - -### Keyword "link_speed" - -Optional Int. (Physical interfaces) The speed of the link in Mbit/s. (Default: 0). - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Create a bond interface - -```bash -maas $PROFILE interfaces create-bond [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -Create a bond interface on a machine. - -### Keyword "name" - -Required String. Name of the interface. - -### Keyword "mac_address" - -Optional String. MAC address of the interface. - -### Keyword "tags" - -Optional String. Tags for the interface. - -### Keyword "vlan" - -Optional String. VLAN the interface is connected to. If not provided then the interface is considered disconnected. - -### Keyword "parents" - -Required Int. Parent interface ids that make this bond. - -### Keyword "bond_mode" - -Optional String. The operating mode of the bond. (Default: active-backup). - -Supported bonding modes: - -- ``balance-rr``: Transmit packets in sequential order from the first available slave through the last. This mode provides load balancing and fault tolerance. - -- ``active-backup``: Only one slave in the bond is active. A different slave becomes active if, and only if, the active slave fails. The bond's MAC address is externally visible on only one port (network adapter) to avoid confusing the switch. - -- ``balance-xor``: Transmit based on the selected transmit hash policy. The default policy is a simple [(source MAC address XOR'd with destination MAC address XOR packet type ID) modulo slave count]. - -- ``broadcast``: Transmits everything on all slave interfaces. This mode provides fault tolerance. - -- ``802.3ad``: IEEE 802.3ad dynamic link aggregation. Creates aggregation groups that share the same speed and duplex settings. Uses all slaves in the active aggregator according to the 802.3ad specification. - -- ``balance-tlb``: Adaptive transmit load balancing: channel bonding that does not require any special switch support. - - ``balance-alb``: Adaptive load balancing: includes balance-tlb plus receive load balancing (rlb) for IPV4 traffic, and does not require any special switch support. The receive load balancing is achieved by ARP negotiation. - -### Keyword "bond_miimon" - -Optional Int. The link monitoring freqeuncy in milliseconds. (Default: 100). - -### Keyword "bond_downdelay" - -Optional Int. Specifies the time, in milliseconds, to wait before disabling a slave after a link failure has been detected. - -### Keyword "bond_updelay" - -Optional Int. Specifies the time, in milliseconds, to wait before enabling a slave after a link recovery has been detected. - -### Keyword "bond_lacp_rate" - -Optional String. Option specifying the rate at which to ask the link partner to transmit LACPDU packets in 802.3ad mode. Available options are ``fast`` or ``slow``. (Default: ``slow``). - -### Keyword "bond_xmit_hash_policy" - -Optional String. The transmit -hash policy to use for slave selection in balance-xor, 802.3ad, and tlb -modes. Possible values are: ``layer2``, ``layer2+3``, ``layer3+4``, ``encap2+3``, ``encap3+4``. (Default: ``layer2``) - -### Keyword "bond_num_grat_arp" - -Optional Int. The number of peer notifications (IPv4 ARP or IPv6 Neighbour Advertisements) to be issued after a failover. (Default: 1) - -### Keyword "mtu" - -Optional Int. Maximum transmission unit. - -### Keyword "accept_ra" - -Optional Boolean. Accept router advertisements. (IPv6 only) - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Create a bridge interface - -```bash -maas $PROFILE interfaces create-bridge [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -Create a bridge interface on a machine. - -### Keyword "name" - -Optional String. Name of the interface. - -### Keyword "mac_address" - -Optional String. MAC address of the interface. - -### Keyword "tags" - -Optional String. Tags for the interface. - -### Keyword "vlan" - -Optional String. VLAN the interface is connected to. - -### Keyword "parent" - -Optional Int. Parent interface id for this bridge interface. - -### Keyword "bridge_type" - -Optional String. The type of bridge to create. Possible values are: ``standard``, ``ovs``. - -### Keyword "bridge_stp" - -Optional Boolean. Turn spanning tree protocol on or off. (Default: False). - -### Keyword "bridge_fd" - -Optional Int. Set bridge forward delay to time seconds. (Default: 15). - -### Keyword "mtu" - -Optional Int. Maximum transmission unit. - -### Keyword "accept_ra" - -Optional Boolean. Accept router advertisements. (IPv6 only) - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Create a physical interface - -```bash -maas $PROFILE interfaces create-physical [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -Create a physical interface on a machine and device. - -### Keyword "name" - -Optional String. Name of the interface. - -### Keyword "mac_address" - -Required String. MAC address of the interface. - -### Keyword "tags" - -Optional String. Tags for the interface. - -### Keyword "vlan" - -Optional String. Untagged VLAN the interface is connected to. If not provided then the interface is considered disconnected. - -### Keyword "mtu" - -Optional Int. Maximum transmission unit. - -### Keyword "accept_ra" - -Optional Boolean. Accept router advertisements. (IPv6 only) - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Create a VLAN interface - -```bash -maas $PROFILE interfaces create-vlan [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -Create a VLAN interface on a machine. - -### Keyword "tags" - -Optional String. Tags for the interface. - -### Keyword "vlan" - -Required String. Tagged VLAN the interface is connected to. - -### Keyword "parent" - -Required Int. Parent interface id for this VLAN interface. - -### Keyword "mtu" - -Optional Int. Maximum transmission unit. - -### Keyword "accept_ra" - -Optional Boolean. Accept router advertisements. (IPv6 only) - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## List interfaces - -```bash -maas $PROFILE interfaces read [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -List all interfaces belonging to a machine, device, or rack controller. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | diff --git a/rtd-docs/reference/cli-reference/ipaddresses.md b/rtd-docs/reference/cli-reference/ipaddresses.md deleted file mode 100644 index 7c70f453c5..0000000000 --- a/rtd-docs/reference/cli-reference/ipaddresses.md +++ /dev/null @@ -1,97 +0,0 @@ -# ipaddresses - -Enter keyword arguments in the form `key=value`. - -## List IP addresses - -```bash -maas $PROFILE ipaddresses read [--help] [-d] [-k] [data ...] -``` - -List all IP addresses known to MAAS. By default, gets a listing of all IP addresses allocated to the requesting user. - -### Keyword "ip" - -Optional String. If specified, will only display information for the specified IP address. - -### Keyword "all" - -Optional Boolean. (Admin users only) If True, all reserved IP addresses will be shown. (By default, only addresses of type 'User reserved' that are assigned to the requesting user are shown.) - -### Keyword "owner" - -Optional String. (Admin users only) If specified, filters the list to show only IP addresses owned by the specified username. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Release an IP address - -```bash -maas $PROFILE ipaddresses release [--help] [-d] [-k] [data ...] -``` - -Release an IP address that was previously reserved by the user. - -### Keyword "ip" - -Required String. The IP address to release. - -### Keyword "force" - -Optional Boolean. If True, allows a MAAS administrator to force an IP address to be released, even if it is not a user-reserved IP address or does not belong to the requesting user. Use with caution. - -### Keyword "discovered" - -Optional Boolean. If True, allows a MAAS administrator to release a discovered address. Only valid if 'force' is specified. If not specified, MAAS will attempt to release any type of address except for discovered addresses. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Reserve an IP address - -```bash -maas $PROFILE ipaddresses reserve [--help] [-d] [-k] [data ...] -``` - -Reserve an IP address for use outside of MAAS. Returns an IP adddress that MAAS will not allow any of its known nodes to use; it is free for use by the requesting user until released by the user. - -The user must supply either a subnet or a specific IP address within a subnet. - -### Keyword "subnet" - -Optional String. CIDR representation of the subnet on which the IP reservation is required. E.g. 10.1.2.0/24 - -### Keyword "ip" - -Optional String. The IP address, which must be within a known subnet. - -### Keyword "ip_address" - -Optional String. (Deprecated.) Alias for 'ip' parameter. Provided for backward compatibility. - -### Keyword "hostname" - -Optional String. The hostname to use for the specified IP address. If no domain component is given, the default domain will be used. - -### Keyword "mac" - -Optional String. The MAC address that should be linked to this reservation. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | diff --git a/rtd-docs/reference/cli-reference/iprange.md b/rtd-docs/reference/cli-reference/iprange.md deleted file mode 100644 index 4f9f1883f9..0000000000 --- a/rtd-docs/reference/cli-reference/iprange.md +++ /dev/null @@ -1,127 +0,0 @@ -# iprange - -Enter keyword arguments in the form `key=value`. - -## Delete an IP range - -```bash -maas $PROFILE iprange delete [--help] [-d] [-k] id [data ...] -``` - -### Positional arguments - -- id - -Delete an IP range with the given id. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Read an IP range - -```bash -maas $PROFILE iprange read [--help] [-d] [-k] id [data ...] -``` - -### Positional arguments - -- id - -Read an IP range with the given id. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Update an IP range - -```bash -maas $PROFILE iprange update [--help] [-d] [-k] id [data ...] -``` - -### Positional arguments - -- id - -Update an IP range with the given id. - -### Keyword "start_ip" - -Optional String. Start IP address of this range (inclusive). - -### Keyword "end_ip" - -Optional String. End IP address of this range (inclusive). - -### Keyword "comment" - -Optional String. A description of this range. (optional) - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Create an IP range - -```bash -maas $PROFILE ipranges create [--help] [-d] [-k] [data ...] -``` - -Create a new IP range. - -### Keyword "type" - -Required String. Type of this range. (``dynamic`` or ``reserved``) - -### Keyword "start_ip" - -Required String. Start IP address of this range (inclusive). - -### Keyword "end_ip" - -Required String. End IP address of this range (inclusive). - -### Keyword "subnet" - -Required Int. Subnet associated with this range. - -### Keyword "comment" - -Optional String. A description of this range. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## List all IP ranges - -```bash -maas $PROFILE ipranges read [--help] [-d] [-k] [data ...] -``` - -List all available IP ranges. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | diff --git a/rtd-docs/reference/cli-reference/license-key.md b/rtd-docs/reference/cli-reference/license-key.md deleted file mode 100644 index 81ecb94c26..0000000000 --- a/rtd-docs/reference/cli-reference/license-key.md +++ /dev/null @@ -1,114 +0,0 @@ -# license-key - -Enter keyword arguments in the form `key=value`. - -## Delete license key - -```bash -maas $PROFILE license-key delete [--help] [-d] [-k] osystem distro_series [data ...] -``` - -### Positional arguments - -- osystem -- distro_series - -Delete license key for the given operation system and distro series. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Read license key - -```bash -maas $PROFILE license-key read [--help] [-d] [-k] osystem distro_series [data ...] -``` - -### Positional arguments - -- osystem -- distro_series - -Read a license key for the given operating sytem and distro series. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Update license key - -```bash -maas $PROFILE license-key update [--help] [-d] [-k] osystem distro_series [data ...] -``` - -### Positional arguments - -- osystem -- distro_series - -Update a license key for the given operating system and distro series. - -### Keyword "license_key" - -Optional String. License key for osystem/distro_series combo. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Define a license key - -```bash -maas $PROFILE license-keys create [--help] [-d] [-k] [data ...] -``` - -Define a license key. - -### Keyword "osystem" - -Required String. Operating system that the key belongs to. - -### Keyword "distro_series" - -Required String. OS release that the key belongs to. - -### Keyword "license_key" - -Required String. License key for osystem/distro_series combo. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## List license keys - -```bash -maas $PROFILE license-keys read [--help] [-d] [-k] [data ...] -``` - -List all available license keys. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | diff --git a/rtd-docs/reference/cli-reference/list.md b/rtd-docs/reference/cli-reference/list.md deleted file mode 100644 index 7d861cbcf5..0000000000 --- a/rtd-docs/reference/cli-reference/list.md +++ /dev/null @@ -1,13 +0,0 @@ -# list - -List remote APIs that have been logged-in to. - -```bash -maas list [-h] -``` - -## Command-line options - -| Option | Effect | -|------------|---------------------------------| -| -h, --help | show this help message and exit | diff --git a/rtd-docs/reference/cli-reference/login.md b/rtd-docs/reference/cli-reference/login.md deleted file mode 100644 index 8f36922364..0000000000 --- a/rtd-docs/reference/cli-reference/login.md +++ /dev/null @@ -1,33 +0,0 @@ -# login - -Log in to a remote API, and remember its description and credentials. - -```bash -maas login [-h] [--cacerts CACERTS] [-k] profile-name url [credentials] -``` - -## Positional arguments - -| Argument | Effect | -|--------------|----------------------------------------------------------| -| profile-name | The name with which you will later refer to this remote | -| | server and credentials within this tool | -| url | The URL of the remote API, e.g. | -| | or if you wish to | -| | specify the API version | -| credentials | The credentials, also known as the API key, for the | -| | remote MAAS server. These can be found in the user | -| | preferences page in the web UI; they take the form of a | -| | long random-looking string composed of three parts, | -| | separated by colons | - -## Command-line options - -| Option | Effect | -|-------------------|-----------------------------------| -| -h, --help | show this help message and exit | -| --cacerts CACERTS | Certificate CA file in PEM format | -| -k, --insecure | Disable SSL certificate check | -| | | - -If credentials are not provided on the command-line, they will be prompted for interactively. diff --git a/rtd-docs/reference/cli-reference/logout.md b/rtd-docs/reference/cli-reference/logout.md deleted file mode 100644 index cdba578fad..0000000000 --- a/rtd-docs/reference/cli-reference/logout.md +++ /dev/null @@ -1,22 +0,0 @@ -# logout - -Log out of a remote API, purging any stored credentials. - -```bash -maas logout [-h] profile-name -``` - -## Positional arguments - -| Argument | Effect | -|--------------|-------------------------------------------------------------| -| profile-name | The name with which a remote server and its credentials are | -| | referred to within this tool. | - -## Command-line options - -| Option | Effect | -|------------|---------------------------------| -| -h, --help | show this help message and exit | - -This will remove the given profile from your command-line client. You can re-create it by logging in again later. diff --git a/rtd-docs/reference/cli-reference/maas.md b/rtd-docs/reference/cli-reference/maas.md deleted file mode 100644 index a90a14cd3c..0000000000 --- a/rtd-docs/reference/cli-reference/maas.md +++ /dev/null @@ -1,113 +0,0 @@ -# maas - -Enter keyword arguments in the form `key=value`. - -## Get a configuration value - -```bash -maas $PROFILE maas get-config [--help] [-d] [-k] [data ...] -``` - -Get a configuration value. - -### Keyword "name" - -Required String. The name of the configuration item to be retrieved. See "Available configuration items" for the list of names & descriptions. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Set a configuration value - -```bash -maas $PROFILE maas set-config [--help] [-d] [-k] [data ...] -``` - -Set a configuration value. - -### Keyword "value" - -Optional String. The value of the configuration item to be set. - -### Keyword "name" - -Required. The name of the configuration item to be set. See "Available configuration items" for the list of names & descriptions. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Available configuration items - -- **:active_discovery_interval:** Active subnet mapping interval. When enabled, each rack will scan subnets enabled for active mapping. This helps ensure discovery information is accurate and complete. -- **:auto_vlan_creation:** Automatically create VLANs and Fabrics for interfaces. Enables the creation of a default VLAN and Fabric for discovered network interfaces when MAAS cannot connect it to an existing one. When disabled, the interface is left disconnected in these cases. -- **:boot_images_auto_import:** Automatically import/refresh the boot images every 60 minutes. -- **:boot_images_no_proxy:** Set no_proxy with the image repository address when MAAS is behind (or set with) a proxy.. By default, when MAAS is behind (and set with) a proxy, it is used to download images from the image repository. In some situations (e.g. when using a local image repository) it doesn't make sense for MAAS to use the proxy to download images because it can access them directly. Setting this option allows MAAS to access the (local) image repository directly by setting the no_proxy variable for the MAAS env with the address of the image repository. -- **:commissioning_distro_series:** Default Ubuntu release used for commissioning. -- **:completed_intro:** Marks if the initial intro has been completed. -- **:curtin_verbose:** Run the fast-path installer with higher verbosity. This provides more detail in the installation logs. -- **:default_distro_series:** Default OS release used for deployment. -- **:default_dns_ttl:** Default Time-To-Live for the DNS. If no TTL value is specified at a more specific point this is how long DNS responses are valid, in seconds. -- **:default_min_hwe_kernel:** Default Minimum Kernel Version. The default minimum kernel version used on all new and commissioned nodes. -- **:default_osystem:** Default operating system used for deployment. -- **:default_storage_layout: Default storage layout. Storage layout that is applied to a node when it is commissioned. Available choices are:** 'bcache' (Bcache layout), 'blank' (No storage (blank) layout), 'custom' (Custom layout (from commissioning storage config)), 'flat' (Flat layout), 'lvm' (LVM layout), 'vmfs6' (VMFS6 layout), 'vmfs7' (VMFS7 layout). -- **:disk_erase_with_quick_erase:** Use quick erase by default when erasing disks.. This is not a secure erase; it wipes only the beginning and end of each disk. -- **:disk_erase_with_secure_erase:** Use secure erase by default when erasing disks. Will only be used on devices that support secure erase. Other devices will fall back to full wipe or quick erase depending on the selected options. -- **:dns_trusted_acl:** List of external networks (not previously known), that will be allowed to use MAAS for DNS resolution.. MAAS keeps a list of networks that are allowed to use MAAS for DNS resolution. This option allows to add extra networks (not previously known) to the trusted ACL where this list of networks is kept. It also supports specifying IPs or ACL names. -- **:dnssec_validation:** Enable DNSSEC validation of upstream zones. Only used when MAAS is running its own DNS server. This value is used as the value of 'dnssec_validation' in the DNS server config. -- **:enable_analytics:** Enable Google Analytics in MAAS UI to shape improvements in user experience. -- **:enable_disk_erasing_on_release:** Erase nodes' disks prior to releasing. Forces users to always erase disks when releasing. -- **:enable_http_proxy:** Enable the use of an APT or YUM and HTTP/HTTPS proxy. Provision nodes to use the built-in HTTP proxy (or user specified proxy) for APT or YUM. MAAS also uses the proxy for downloading boot images. -- **:enable_third_party_drivers:** Enable the installation of proprietary drivers (i.e. HPVSA). -- **:enlist_commissioning:** Whether to run commissioning during enlistment.. Enables running all built-in commissioning scripts during enlistment. -- **:force_v1_network_yaml:** Always use the legacy v1 YAML (rather than Netplan format, also known as v2 YAML) when composing the network configuration for a machine.. -- **:hardware_sync_interval:** Hardware Sync Interval. The interval to send hardware info to MAAS fromhardware sync enabled machines, in systemd time span syntax. -- **:http_proxy:** Proxy for APT or YUM and HTTP/HTTPS. This will be passed onto provisioned nodes to use as a proxy for APT or YUM traffic. MAAS also uses the proxy for downloading boot images. If no URL is provided, the built-in MAAS proxy will be used. -- **:kernel_opts:** Boot parameters to pass to the kernel by default. -- **:maas_auto_ipmi_cipher_suite_id: MAAS IPMI Default Cipher Suite ID. The default IPMI cipher suite ID to use when connecting to the BMC via ipmitools Available choices are: '' (freeipmi-tools default), '12' (12 - HMAC-MD5::MD5-128::AES-CBC-128), '17' (17 - HMAC-SHA256::HMAC_SHA256_128::AES-CBC-128), '3' (3 - HMAC-SHA1::HMAC-SHA1-96::AES-CBC-128), '8' (8 - HMAC-MD5::HMAC-MD5-128::**AES-CBC-128). -- **:maas_auto_ipmi_k_g_bmc_key:** The IPMI K_g key to set during BMC configuration.. This IPMI K_g BMC key is used to encrypt all IPMI traffic to a BMC. Once set, all clients will REQUIRE this key upon being commissioned. Any current machines that were previously commissioned will not require this key until they are recommissioned. -- **:maas_auto_ipmi_user:** MAAS IPMI user.. The name of the IPMI user that MAAS automatically creates during enlistment/commissioning. -- **:maas_auto_ipmi_user_privilege_level: MAAS IPMI privilege level. The default IPMI privilege level to use when creating the MAAS user and talking IPMI BMCs Available choices are:** 'ADMIN' (Administrator), 'OPERATOR' (Operator), 'USER' (User). -- **:maas_auto_ipmi_workaround_flags: IPMI Workaround Flags. The default workaround flag (-W options) to use for ipmipower commands Available choices are:** '' (None), 'authcap' (Authcap), 'endianseq' (Endianseq), 'forcepermsg' (Forcepermsg), 'idzero' (Idzero), 'integritycheckvalue' (Integritycheckvalue), 'intel20' (Intel20), 'ipmiping' (Ipmiping), 'nochecksumcheck' (Nochecksumcheck), 'opensesspriv' (Opensesspriv), 'sun20' (Sun20), 'supermicro20' (Supermicro20), 'unexpectedauth' (Unexpectedauth). -- **:maas_internal_domain:** Domain name used by MAAS for internal mapping of MAAS provided services.. This domain should not collide with an upstream domain provided by the set upstream DNS. -- **:maas_name:** MAAS name. -- **:maas_proxy_port: Port to bind the MAAS built-in proxy (default:** 8000). Defines the port used to bind the built-in proxy. The default port is 8000. -- **:maas_syslog_port: Port to bind the MAAS built-in syslog (default:** 5247). Defines the port used to bind the built-in syslog. The default port is 5247. -- **:max_node_commissioning_results:** The maximum number of commissioning results runs which are stored. -- **:max_node_installation_results:** The maximum number of installation result runs which are stored. -- **:max_node_release_results:** The maximum number of release result runs which are stored. -- **:max_node_testing_results:** The maximum number of testing results runs which are stored. -- **:network_discovery:** . When enabled, MAAS will use passive techniques (such as listening to ARP requests and mDNS advertisements) to observe networks attached to rack controllers. Active subnet mapping will also be available to be enabled on the configured subnets. -- **:node_timeout:** Time, in minutes, until the node times out during commissioning, testing, deploying, or entering rescue mode.. Commissioning, testing, deploying, and entering rescue mode all set a timeout when beginning. If MAAS does not hear from the node within the specified number of minutes the node is powered off and set into a failed status. -- **:ntp_external_only:** Use external NTP servers only. Configure all region controller hosts, rack controller hosts, and subsequently deployed machines to refer directly to the configured external NTP servers. Otherwise only region controller hosts will be configured to use those external NTP servers, rack contoller hosts will in turn refer to the regions' NTP servers, and deployed machines will refer to the racks' NTP servers. -- **:ntp_servers:** Addresses of NTP servers. NTP servers, specified as IP addresses or hostnames delimited by commas and/or spaces, to be used as time references for MAAS itself, the machines MAAS deploys, and devices that make use of MAAS's DHCP services. -- **:prefer_v4_proxy:** Sets IPv4 DNS resolution before IPv6. If prefer_v4_proxy is set, the proxy will be set to prefer IPv4 DNS resolution before it attempts to perform IPv6 DNS resolution. -- **:prometheus_enabled:** Enable Prometheus exporter. Whether to enable Prometheus exporter functions, including Cluster metrics endpoint and Push gateway (if configured). -- **:prometheus_push_gateway:** Address or hostname of the Prometheus push gateway.. Defines the address or hostname of the Prometheus push gateway where MAAS will send data to. -- **:prometheus_push_interval: Interval of how often to send data to Prometheus (default:** to 60 minutes).. The internal of how often MAAS will send stats to Prometheus in minutes. -- **:promtail_enabled:** Enable streaming logs to Promtail.. Whether to stream logs to Promtail -- **:promtail_port:** TCP port of the Promtail Push API.. Defines the TCP port of the Promtail push API where MAAS will stream logs to. -- **:release_notifications:** Enable or disable notifications for new MAAS releases.. -- **:remote_syslog:** Remote syslog server to forward machine logs. A remote syslog server that MAAS will set on enlisting, commissioning, testing, and deploying machines to send all log messages. Clearing this value will restore the default behaviour of forwarding syslog to MAAS. -- **:session_length:** Session timeout (seconds). Configure timeout of session (seconds). Minimum 10s, maximum 2 weeks (1209600s). -- **:subnet_ip_exhaustion_threshold_count:** If the number of free IP addresses on a subnet becomes less than or equal to this threshold, an IP exhaustion warning will appear for that subnet. -- **:theme:** MAAS theme. -- **:tls_cert_expiration_notification_enabled:** Notify when the certificate is due to expire. Enable/Disable notification about certificate expiration. -- **:tls_cert_expiration_notification_interval:** Certificate expiration reminder (days). Configure notification when certificate is due to expire in (days). -- **:upstream_dns:** Upstream DNS used to resolve domains not managed by this MAAS (space-separated IP addresses). Only used when MAAS is running its own DNS server. This value is used as the value of 'forwarders' in the DNS server config. -- **:use_peer_proxy:** Use the built-in proxy with an external proxy as a peer. If enable_http_proxy is set, the built-in proxy will be configured to use http_proxy as a peer proxy. The deployed machines will be configured to use the built-in proxy. -- **:use_rack_proxy:** Use DNS and HTTP metadata proxy on the rack controllers when a machine is booted. All DNS and HTTP metadata traffic will flow through the rack controller that a machine is booting from. This isolated region controllers from machines. -- **:vcenter_datacenter:** VMware vCenter datacenter. VMware vCenter datacenter which is passed to a deployed VMware ESXi host. -- **:vcenter_password:** VMware vCenter password. VMware vCenter server password which is passed to a deployed VMware ESXi host. -- **:vcenter_server:** VMware vCenter server FQDN or IP address. VMware vCenter server FQDN or IP address which is passed to a deployed VMware ESXi host. -- **:vcenter_username:** VMware vCenter username. VMware vCenter server username which is passed to a deployed VMware ESXi host. -- **:windows_kms_host:** Windows KMS activation host. FQDN or IP address of the host that provides the KMS Windows activation service. (Only needed for Windows deployments using KMS activation.) diff --git a/rtd-docs/reference/cli-reference/machine.md b/rtd-docs/reference/cli-reference/machine.md deleted file mode 100644 index fdcd1d6a49..0000000000 --- a/rtd-docs/reference/cli-reference/machine.md +++ /dev/null @@ -1,1596 +0,0 @@ -# machine - -Enter keyword arguments in the form `key=value`. - -## Abort a node operation - -```bash -maas $PROFILE machine abort [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -Abort a node's current operation. - -### Keyword "comment" - -Optional String. Comment for the event log. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Clear set default gateways - -```bash -maas $PROFILE machine clear-default-gateways [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -Clear any set default gateways on a machine with the given system_id. - -This will clear both IPv4 and IPv6 gateways on the machine. This will transition the logic of identifing the best gateway to MAAS. This logic is determined based the following criteria: - -1. Managed subnets over unmanaged subnets. -2. Bond interfaces over physical interfaces. -3. Machine's boot interface over all other interfaces except bonds. -4. Physical interfaces over VLAN interfaces. -5. Sticky IP links over user reserved IP links. -6. User reserved IP links over auto IP links. - -If the default gateways need to be specific for this machine you can set which interface and subnet's gateway to use when this machine is deployed with the `interfaces set-default-gateway` API. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Commission a machine - -```bash -maas $PROFILE machine commission [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -Begin commissioning process for a machine. - -A machine in the 'ready', 'declared' or 'failed test' state may initiate a commissioning cycle where it is checked out and tested in preparation for transitioning to the 'ready' state. If it is already in the 'ready' state this is considered a re-commissioning process which is useful if commissioning tests were changed after it previously commissioned. - -### Keyword "enable_ssh" - -Optional Int. Whether to enable SSH for the commissioning environment using the user's SSH key(s). '1' == True, '0' == False. - -### Keyword "skip_bmc_config" - -Optional Int. Whether to skip re-configuration of the BMC for IPMI based machines. '1' == True, '0' == False. - -### Keyword "skip_networking" - -Optional Int. Whether to skip re-configuring the networking on the machine after the commissioning has completed. '1' == True, '0' == False. - -### Keyword "skip_storage" - -Optional Int. Whether to skip re-configuring the storage on the machine after the commissioning has completed. '1' == True, '0' == False. - -### Keyword "commissioning_scripts" - -Optional String. A comma separated list of commissioning script names and tags to be run. By default all custom commissioning scripts are run. Built-in commissioning scripts always run. Selecting 'update_firmware' or 'configure_hba' will run firmware updates or configure HBA's on matching machines. - -### Keyword "testing_scripts" - -Optional String. A comma separated list of testing script names and tags to be run. By default all tests tagged 'commissioning' will be run. Set to 'none' to disable running tests. - -### Keyword "parameters" - -Optional String. Scripts selected to run may define their own parameters. These parameters may be passed using the parameter name. Optionally a parameter may have the script name prepended to have that parameter only apply to that specific script. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Delete a machine - -```bash -maas $PROFILE machine delete [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -Deletes a machine with the given system_id. - -Note: A machine cannot be deleted if it hosts pod virtual machines. Use ``force`` to override this behavior. Forcing deletion will also remove hosted pods. E.g. ``/machines/abc123/?force=1``. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Deploy a machine - -```bash -maas $PROFILE machine deploy [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -Deploys an operating system to a machine with the given system_id. - -### Keyword "user_data" - -Optional String. If present, this blob of base64-encoded user-data to be made available to the machines through the metadata service. - -### Keyword "distro_series" - -Optional String. If present, this parameter specifies the OS release the machine will use. - -### Keyword "hwe_kernel" - -Optional String. If present, this parameter specified the kernel to be used on the machine - -### Keyword "agent_name" - -Optional String. An optional agent name to attach to the acquired machine. - -### Keyword "bridge_all" - -Optional Boolean. Optionally create a bridge interface for every configured interface on the machine. The created bridges will be removed once the machine is released. (Default: false) - -### Keyword "bridge_type" - -Optional String. Optionally create the bridges with this type. Possible values are: ``standard``, ``ovs``. - -### Keyword "bridge_stp" - -Optional Boolean. Optionally turn spanning tree protocol on or off for the bridges created on every configured interface. (Default: false) - -### Keyword "bridge_fd" - -Optional Int. Optionally adjust the forward delay to time seconds. (Default: 15) - -### Keyword "comment" - -Optional String. Optional comment for the event log. - -### Keyword "install_rackd" - -Optional Boolean. If true, the rack controller will be installed on this machine. - -### Keyword "install_kvm" - -Optional Boolean. If true, KVM will be installed on this machine and added to MAAS. - -### Keyword "register_vmhost" - -Optional Boolean. If true, the machine will be registered as a LXD VM host in MAAS. - -### Keyword "ephemeral_deploy" - -Optional Boolean. If true, machine will be deployed ephemerally even if it has disks. - -### Keyword "vcenter_registration" - -Optional Boolean. If false, do not send globally defined VMware vCenter credentials to the machine. - -### Keyword "enable_hw_sync" - -Optional Boolean. If true, machine will be deployed with a small agent periodically pushing hardware data to detect any change in devices. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Get system details - -```bash -maas $PROFILE machine details [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -Returns system details -- for example, LLDP and ``lshw`` XML dumps. - -Returns a ``{detail_type: xml, ...}`` map, where ``detail_type`` is something like "lldp" or "lshw". - -Note that this is returned as BSON and not JSON. This is for efficiency, but mainly because JSON can't do binary content without applying additional encoding like base-64. The example output below is represented in ASCII using ``bsondump example.bson`` and is for demonstrative purposes. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Exit rescue mode - -```bash -maas $PROFILE machine exit-rescue-mode [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -Exits the rescue mode process on a machine with the given system_id. - -A machine in the 'rescue mode' state may exit the rescue mode process. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Get curtin configuration - -```bash -maas $PROFILE machine get-curtin-config [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -Return the rendered curtin configuration for the machine. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Get a machine token - -```bash -maas $PROFILE machine get-token [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Lock a machine - -```bash -maas $PROFILE machine lock [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -Mark a machine with the given system_id as 'Locked' to prevent changes. - -### Keyword "comment" - -Optional String. Optional comment for the event log. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Mark a machine as Broken - -```bash -maas $PROFILE machine mark-broken [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -Mark a machine with the given system_id as 'Broken'. - -If the node is allocated, release it first. - -### Keyword "comment" - -Optional. Optional comment for the event log. Will be displayed on the node as an error description until marked fixed. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Mark a machine as Fixed - -```bash -maas $PROFILE machine mark-fixed [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -Mark a machine with the given system_id as 'Fixed'. - -### Keyword "comment" - -Optional String. Optional comment for the event log. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Mount a special-purpose filesystem - -```bash -maas $PROFILE machine mount-special [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -Mount a special-purpose filesystem, like tmpfs on a machine with the given system_id. - -### Keyword "fstype" - -Required String. The filesystem type. This must be a filesystem that does not require a block special device. - -### Keyword "mount_point" - -Required String. Path on the filesystem to mount. - -### Keyword "mount_option" - -Optional String. Options to pass to mount(8). - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Ignore failed tests - -```bash -maas $PROFILE machine override-failed-testing [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -Ignore failed tests and put node back into a usable state. - -### Keyword "comment" - -Optional String. Comment for the event log. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Power off a node - -```bash -maas $PROFILE machine power-off [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -Powers off a given node. - -### Keyword "stop_mode" - -Optional String. Power-off mode. If 'soft', perform a soft power down if the node's power type supports it, otherwise perform a hard power off. For all values other than 'soft', and by default, perform a hard power off. A soft power off generally asks the OS to shutdown the system gracefully before powering off, while a hard power off occurs immediately without any warning to the OS. - -### Keyword "comment" - -Optional String. Comment for the event log. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Turn on a node - -```bash -maas $PROFILE machine power-on [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -Turn on the given node with optional user-data and comment. - -### Keyword "user_data" - -Optional String. Base64-encoded blob of data to be made available to the nodes through the metadata service. - -### Keyword "comment" - -Optional String. Comment for the event log. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Get power parameters - -```bash -maas $PROFILE machine power-parameters [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -Gets power parameters for a given system_id, if any. For some types of power control this will include private information such as passwords and secret keys. - -Note that this method is reserved for admin users and returns a 403 if the user is not one. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Get the power state of a node - -```bash -maas $PROFILE machine query-power-state [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -Gets the power state of a given node. MAAS sends a request to the node's power controller, which asks it about the node's state. The reply to this could be delayed by up to 30 seconds while waiting for the power controller to respond. Use this method sparingly as it ties up an appserver thread while waiting. - -### Keyword "system_id" - -Required String. The node to query. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Read a node - -```bash -maas $PROFILE machine read [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -Reads a node with the given system_id. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Release a machine - -```bash -maas $PROFILE machine release [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -Releases a machine with the given system_id. Note that this operation is the opposite of allocating a machine. - -**Erasing drives**: - -If neither ``secure_erase`` nor ``quick_erase`` are specified, MAAS will overwrite the whole disk with null bytes. This can be very slow. - -If both ``secure_erase`` and ``quick_erase`` are specified and the drive does NOT have a secure erase feature, MAAS will behave as if only ``quick_erase`` was specified. - -If ``secure_erase`` is specified and ``quick_erase`` is NOT specified and the drive does NOT have a secure erase feature, MAAS will behave as if ``secure_erase`` was NOT specified, i.e. MAAS will overwrite the whole disk with null bytes. This can be very slow. - -### Keyword "comment" - -Optional String. Optional comment for the event log. - -### Keyword "erase" - -Optional Boolean. Erase the disk when releasing. - -### Keyword "secure_erase" - -Optional Boolean. Use the drive's secure erase feature if available. In some cases, this can be much faster than overwriting the drive. Some drives implement secure erasure by overwriting themselves so this could still be slow. - -### Keyword "quick_erase" - -Optional Boolean. Wipe 2MiB at the start and at the end of the drive to make data recovery inconvenient and unlikely to happen by accident. This is not secure. - -### Keyword "force" - -Optional Boolean. Will force the release of a machine. If the machine was deployed as a KVM host, this will be deleted as well as all machines inside the KVM host. USE WITH CAUTION. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Enter rescue mode - -```bash -maas $PROFILE machine rescue-mode [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -Begins the rescue mode process on a machine with the given system_id. - -A machine in the 'deployed' or 'broken' state may initiate the rescue mode process. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## [data ...] - -```bash -maas $PROFILE machine restore-default-configuration [--help] [-d] [-k] system_id -``` - -Restore default configuration - -### Positional arguments - -- system_id - -Restores the default configuration options on a machine with the given system_id. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Restore networking options - -```bash -maas $PROFILE machine restore-networking-configuration [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -Restores networking options to their initial state on a machine with the given system_id. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## [data ...] - -```bash -maas $PROFILE machine restore-storage-configuration [--help] [-d] [-k] system_id -``` - -Restore storage configuration - -### Positional arguments - -- system_id - -Restores storage configuration options to their initial state on a machine with the given system_id. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Deprecated, use set-workload-annotations - -```bash -maas $PROFILE machine set-owner-data [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -Deprecated, use set-workload-annotations instead. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Change storage layout - -```bash -maas $PROFILE machine set-storage-layout [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -Changes the storage layout on machine with the given system_id. - -This operation can only be performed on a machine with a status of 'Ready'. - -Note: This will clear the current storage layout and any extra configuration and replace it will the new layout. - -### Keyword "storage_layout" - -Required String. Storage layout for the machine: ``flat``, ``lvm``, ``bcache``, ``vmfs6``, ``vmfs7``, ``custom`` or ``blank``. - -### Keyword "boot_size" - -Optional String. Size of the boot partition (e.g. 512M, 1G). - -### Keyword "root_size" - -Optional String. Size of the root partition (e.g. 24G). - -### Keyword "root_device" - -Optional String. Physical block device to place the root partition (e.g. /dev/sda). - -### Keyword "vg_name" - -Optional String. LVM only. Name of created volume group. - -### Keyword "lv_name" - -Optional String. LVM only. Name of created logical volume. - -### Keyword "lv_size" - -Optional String. LVM only. Size of created logical volume. - -### Keyword "cache_device" - -Optional String. Bcache only. Physical block device to use as the cache device (e.g. /dev/sda). - -### Keyword "cache_mode" - -Optional String. Bcache only. Cache mode for bcache device: ``writeback``, ``writethrough``, ``writearound``. - -### Keyword "cache_size" - -Optional String. Bcache only. Size of the cache partition to create on the cache device (e.g. 48G). - -### Keyword "cache_no_part" - -Optional Boolean. Bcache only. Don't create a partition on the cache device. Use the entire disk as the cache device. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Set key=value data - -```bash -maas $PROFILE machine set-workload-annotations [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -Set key=value data for the current owner. - -Pass any key=value form data to this method to add, modify, or remove. A key is removed when the value for that key is set to an empty string. - -This operation will not remove any previous keys unless explicitly passed with an empty string. All workload annotations are removed when the machine is no longer allocated to a user. - -### Keyword "key" - -Required String. ``key`` can be any string value. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Begin testing process for a node - -```bash -maas $PROFILE machine test [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -Begins the testing process for a given node. - -A node in the 'ready', 'allocated', 'deployed', 'broken', or any failed state may run tests. If testing is started and successfully passes from 'broken' or any failed state besides 'failed commissioning' the node will be returned to a ready state. Otherwise the node will return to the state it was when testing started. - -### Keyword "enable_ssh" - -Optional Int. Whether to enable SSH for the testing environment using the user's SSH key(s). 0 == false. 1 == true. -Type: Int. - -### Keyword "testing_scripts" - -Optional String. A comma-separated list of testing script names and tags to be run. By default all tests tagged 'commissioning' will be run. - -### Keyword "parameters" - -Optional String. Scripts selected to run may define their own parameters. These parameters may be passed using the parameter name. Optionally a parameter may have the script name prepended to have that parameter only apply to that specific script. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Unlock a machine - -```bash -maas $PROFILE machine unlock [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - - system_id - -Mark a machine with the given system_id as 'Unlocked' to allow changes. - -### Keyword "comment" - -Optional String. Optional comment for the event log. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Unmount a special-purpose filesystem - -```bash -maas $PROFILE machine unmount-special [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -Unmount a special-purpose filesystem, like tmpfs, on a machine with the given system_id. - -### Keyword "mount_point" - -Required String. Path on the filesystem to unmount. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Update a machine - -```bash -maas $PROFILE machine update [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -Updates a machine with the given system_id. - -### Keyword "hostname" - -Optional String. The new hostname for this machine. - -### Keyword "description" - -Optional String. The new description for this machine. - -### Keyword "domain" - -Optional String. The domain for this machine. If not given the default domain is used. - -### Keyword "architecture" - -Optional String. The new architecture for this machine. - -### Keyword "min_hwe_kernel" - -Optional String. A string containing the minimum kernel version allowed to be ran on this machine. - -### Keyword "power_type" - -Optional String. The new power type for this machine. If you use the default value, power_parameters will be set to the empty string. Available to admin users. See the `Power types`_ section for a list of the available power types. - -### Keyword "power_parameters_skip_check" - -Optional Boolean. Whether or not the new power parameters for this machine should be checked against the expected power parameters for the machine's power type ('true' or 'false'). The default is 'false'. - -### Keyword "pool" - -Optional String. The resource pool to which the machine should belong. All machines belong to the 'default' resource pool if they do not belong to any other resource pool. - -### Keyword "zone" - -Optional String. Name of a valid physical zone in which to place this machine. - -### Keyword "swap_size" - -Optional String. Specifies the size of the swap file, in bytes. Field accept K, M, G and T suffixes for values expressed respectively in kilobytes, megabytes, gigabytes and terabytes. - -### Keyword "disable_ipv4" - -Optional Boolean. Deprecated. If specified, must be false. - -### Keyword "cpu_count" - -Optional Int. The amount of CPU cores the machine has. - -### Keyword "memory" - -Optional String. How much memory the machine has. Field accept K, M, G and T suffixes for values expressed respectively in kilobytes, megabytes, gigabytes and terabytes. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Accept all declared machines - -```bash -maas $PROFILE machines accept-all [--help] [-d] [-k] [data ...] -``` - -Accept all declared machines into MAAS. Machines can be enlisted in the MAAS anonymously or by non-admin users, as opposed to by an admin. These machines are held in the New state; a MAAS admin must first verify the authenticity of these enlistments, and accept them. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Add special hardware - -```bash -maas $PROFILE machines add-chassis [--help] [-d] [-k] [data ...] -``` - -Add special hardware types. - -### Keyword "chassis_type" - -Required String. The type of hardware: - -- ``hmcz``: IBM Hardware Management Console (HMC) for Z -- ``mscm``: Moonshot Chassis Manager. -- ``msftocs``: Microsoft OCS Chassis Manager. -- ``powerkvm``: Virtual Machines on Power KVM, managed by Virsh. -- ``proxmox``: Virtual Machines managed by Proxmox -- ``recs_box``: Christmann RECS|Box servers. -- ``sm15k``: Seamicro 1500 Chassis. -- ``ucsm``: Cisco UCS Manager. -- ``virsh``: virtual machines managed by Virsh. -- ``vmware`` is the type for virtual machines managed by VMware. - -### Keyword "hostname" - -Required String. The URL, hostname, or IP address to access the chassis. - -### Keyword "username" - -Optional String. The username used to access the chassis. This field is required for the recs_box, seamicro15k, vmware, mscm, msftocs, ucsm, and hmcz chassis types. - -### Keyword "password" - -Optional String. The password used to access the chassis. This field is required for the ``recs_box``, ``seamicro15k``, ``vmware``, ``mscm``, ``msftocs``, ``ucsm``, and ``hmcz`` chassis types. - -### Keyword "accept_all" - -Optional String. If true, all enlisted machines will be commissioned. - -### Keyword "rack_controller" - -Optional String. The system_id of the rack controller to send the add chassis command through. If none is specifed MAAS will automatically determine the rack controller to use. - -### Keyword "domain" - -Optional String. The domain that each new machine added should use. - -### Keyword "prefix_filter" - -Optional String. (``virsh``, ``vmware``, ``powerkvm``, ``proxmox``, ``hmcz`` only.) Filter machines with supplied prefix. - -### Keyword "power_control" - -Optional String. (``seamicro15k`` only) The power_control to use, either ipmi (default), restapi, or restapi2. - -The following are optional if you are adding a proxmox chassis. - -### Keyword "token_name" - -Optional String. The name the authentication token to be used instead of a password. - -### Keyword "token_secret" - -Optional String. The token secret to be used in combination with the power_token_name used in place of a password. - -### Keyword "verify_ssl" - -Optional Boolean. Whether SSL connections should be verified. - -The following are optional if you are adding a recs_box, vmware or msftocs chassis. - -### Keyword "port" - -Optional Int. (``recs_box``, ``vmware``, ``msftocs`` only) The port to use when accessing the chassis. - -The following are optional if you are adding a vmware chassis. - -### Keyword "protocol" - -Optional String. (``vmware`` only) The protocol to use when accessing the VMware chassis (default: https). - -### Keyword "return" - -Optional String. A string containing the chassis powered on by which rack -controller. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Allocate a machine - -```bash -maas $PROFILE machines allocate [--help] [-d] [-k] [data ...] -``` - -Allocates an available machine for deployment. Constraints parameters can be used to allocate a machine that possesses certain characteristics. All the constraints are optional and when multiple constraints are provided, they are combined using 'AND' semantics. - -### Keyword "name" - -Optional String. Hostname or FQDN of the desired machine. If a FQDN is specified, both the domain and the hostname portions must match. - -### Keyword "system_id" - -Optional String. system_id of the desired machine. - -### Keyword "arch" - -Optional String.. Architecture of the returned machine (e.g. 'i386/generic', 'amd64', 'armhf/highbank', etc.). If multiple architectures are specified, the machine to acquire may match any of the given architectures. To request multiple architectures, this parameter must be repeated in the request with each value. - -### Keyword "cpu_count" - -Optional Int Minimum number of CPUs a returned machine must have. A machine with additional CPUs may be allocated if there is no exact match, or if the 'mem' constraint is not also specified. - -### Keyword "mem" - -Optional Int. The minimum amount of memory (expressed in MB) the returned machine must have. A machine with additional memory may be allocated if there is no exact match, or the 'cpu_count' constraint is not also specified. - -### Keyword "tags" - -Optional String. Tags the machine must match in order to be acquired. If multiple tag names are specified, the machine must be tagged with all of them. To request multiple tags, this parameter must be repeated in the request with each value. - -### Keyword "not_tags" - -Optional String. Tags the machine must NOT match. If multiple tag names are specified, the machine must NOT be tagged with ANY of them. To request exclusion of multiple tags, this parameter must be repeated in the request with each value. - -### Keyword "zone" - -Optional String. Physical zone name the machine must be located in. - -### Keyword "not_in_zone" - -Optional String. List of physical zones from which the machine must not be acquired. If multiple zones are specified, the machine must NOT be associated with ANY of them. To request multiple zones to exclude, this parameter must be repeated in the request with each value. - -### Keyword "pool" - -Optional String. Resource pool name the machine must belong to. - -### Keyword "not_in_pool" - -Optional String. List of resource pool from which the machine must not be acquired. If multiple pools are specified, the machine must NOT be associated with ANY of them. To request multiple pools to exclude, this parameter must be repeated in the request with each value. - -### Keyword "pod" - -Optional String. Pod the machine must be located in. - -### Keyword "not_pod" - -Optional String. Pod the machine must not be located in. - -### Keyword "pod_type" - -Optional String. Pod type the machine must be located in. - -### Keyword "not_pod_type" - -Optional String. Pod type the machine must not be located in. - -### Keyword "subnets" - -Optional String. Subnets that must be linked to the machine. - -"Linked to" means the node must be configured to acquire an address in the specified subnet, have a static IP address in the specified subnet, or have been observed to DHCP from the specified subnet during commissioning time (which implies that it *could* have an address on the specified subnet). - -Subnets can be specified by one of the following criteria: - -- : Match the subnet by its 'id' field -- fabric:: Match all subnets in a given fabric. -- ip:: Match the subnet containing with the - with the longest-prefix match. -- name:: Match a subnet with the given name. -- space:: Match all subnets in a given space. -- vid:: Match a subnet on a VLAN with the specified VID. - Valid values range from 0 through 4094 (inclusive). An untagged VLAN - can be specified by using the value "0". -- vlan:: Match all subnets on the given VLAN. - -Note that (as of this writing), the 'fabric', 'space', 'vid', and 'vlan' specifiers are only useful for the 'not_spaces' version of this constraint, because they will most likely force the query to match ALL the subnets in each fabric, space, or VLAN, and thus not return any nodes. (This is not a particularly useful behavior, so may be changed in the future.) - -If multiple subnets are specified, the machine must be associated with all of them. To request multiple subnets, this parameter must be repeated in the request with each value. - -Note that this replaces the legacy 'networks' constraint in MAAS 1.x. - -### Keyword "not_subnets" - -Optional String. Subnets that must NOT be linked to the machine. - -See the 'subnets' constraint documentation above for more information about how each subnet can be specified. - -If multiple subnets are specified, the machine must NOT be associated with ANY of them. To request multiple subnets to exclude, this parameter must be repeated in the request with each value. (Or a fabric, space, or VLAN specifier may be used to match multiple subnets). - -Note that this replaces the legacy 'not_networks' constraint in MAAS 1.x. - -### Keyword "storage" - -Optional String. A list of storage constraint identifiers, in the form: ``label:size(tag[,tag[,...])][,label:...]``. - -### Keyword "interfaces" - -Optional String. A labeled constraint map associating constraint labels with interface properties that should be matched. Returned nodes must have one or more interface matching the specified constraints. The labeled constraint map must be in the format: ``label:key=value[,key2=value2[,...]]``. - -Each key can be one of the following: - -- ``id``: Matches an interface with the specific id -- ``fabric``: Matches an interface attached to the specified fabric. -- ``fabric_class``: Matches an interface attached to a fabric with the specified class. -- ``ip``: Matches an interface with the specified IP address assigned to it. -- ``mode``: Matches an interface with the specified mode. (Currently, the only supported mode is "unconfigured".) -- ``name``: Matches an interface with the specified name. (For example, "eth0".) -- ``hostname``: Matches an interface attached to the node with the specified hostname. -- ``subnet``: Matches an interface attached to the specified subnet. -- ``space``: Matches an interface attached to the specified space. -- ``subnet_cidr``: Matches an interface attached to the specified subnet CIDR. (For example, "192.168.0.0/24".) -- ``type``: Matches an interface of the specified type. (Valid types: "physical", "vlan", "bond", "bridge", or "unknown".) -- ``vlan``: Matches an interface on the specified VLAN. -- ``vid``: Matches an interface on a VLAN with the specified VID. -- ``tag``: Matches an interface tagged with the specified tag. -- ``link_speed``: Matches an interface with link_speed equal to or greater than the specified speed. - -### Keyword "fabrics" - -Optional String. Set of fabrics that the machine must be associated with in order to be acquired. If multiple fabrics names are specified, the machine can be in any of the specified fabrics. To request multiple possible fabrics to match, this parameter must be repeated in the request with each value. - -### Keyword "not_fabrics" - -Optional String. Fabrics the machine must NOT be associated with in order to be acquired. If multiple fabrics names are specified, the machine must NOT be in ANY of them. To request exclusion of multiple fabrics, this parameter must be repeated in the request with each value. - -### Keyword "fabric_classes" - -Optional String. Set of fabric class types whose fabrics the machine must be associated with in order to be acquired. If multiple fabrics class types are specified, the machine can be in any matching fabric. To request multiple possible fabrics class types to match, this parameter must be repeated in the request with each value. - -### Keyword "not_fabric_classes" - -Optional String. Fabric class types whose fabrics the machine must NOT be associated with in order to be acquired. If multiple fabrics names are specified, the machine must NOT be in ANY of them. To request exclusion of multiple fabrics, this parameter must be repeated in the request with each value. - -### Keyword "agent_name" - -Optional String. An optional agent name to attach to the acquired machine. - -### Keyword "comment" - -Optional String. Comment for the event log. - -### Keyword "bridge_all" - -Optional Boolean. Optionally create a bridge interface for every configured interface on the machine. The created bridges will be removed once the machine is released. (Default: False) - -### Keyword "bridge_stp" - -Optional Boolean. Optionally turn spanning tree protocol on or off for the bridges created on every configured interface. (Default: off) - -### Keyword "bridge_fd" - -Optional Int. Optionally adjust the forward delay to time seconds. (Default: 15) - -### Keyword "devices" - -Optional String. Only return a node which have one or more devices containing the following constraints in the format `key=value[,key2=value2[,...]]`. - -Each key can be one of the following: - -- ``vendor_id``: The device vendor id -- ``product_id``: The device product id -- ``vendor_name``: The device vendor name, not case sensative -- ``product_name``: The device product name, not case sensative -- ``commissioning_driver``: The device uses this driver during commissioning. - -### Keyword "dry_run" - -Optional Boolean. Optional boolean to indicate that the machine should not actually be acquired (this is for support/troubleshooting, or users who want to see which machine would match a constraint, without acquiring a machine). Defaults to False. - -### Keyword "verbose" - -Optional Boolean. Optional boolean to indicate that the user would like additional verbosity in the constraints_by_type field (each constraint will be prefixed by ``verbose_``, and contain the full data structure that indicates which machine(s) matched). - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Clone storage and/or interface configurations - -```bash -maas $PROFILE machines clone [--help] [-d] [-k] [data ...] -``` - -Clone storage and/or interface configurations. A machine storage and/or interface configuration can be cloned to a set of destination machines. - -For storage configuration, cloning the destination machine must have at least the same number of physical block devices or more, along with the physical block devices being the same size or greater. - -For interface configuration, cloning the destination machine must have at least the same number of interfaces with the same names. The destination machine can have more interfaces than the source, as long as the subset of interfaces on the destination have the same matching names as the source. - -### Keyword "source" - -Required String. The system_id of the machine that is the source of the configuration. - -### Keyword "destinations" - -Required String. A list of system_ids to clone the configuration to. - -### Keyword "interfaces" - -Required Boolean. Whether to clone interface configuration. Defaults to False. - -### Keyword "storage" - -Required Boolean. Whether to clone storage configuration. Defaults to False. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Create a new machine - -```bash -maas $PROFILE machines create [--help] [-d] [-k] [data ...] -``` - -Create a new machine. Adding a server to MAAS will (by default) cause the machine to network boot into an ephemeral environment to collect hardware information. - -In anonymous enlistment (and when the enlistment is done by a non-admin), the machine is held in the "New" state for approval by a MAAS admin. - -The minimum data required is: - -- architecture= (e.g. "i386/generic") -- mac_addresses= (e.g. "aa:bb:cc:dd:ee:ff") - -### Keyword "architecture" - -Required String. unicode. A string containing the architecture type of the machine. (For example, "i386", or "amd64".) To - -### Keyword "min_hwe_kernel" - -Optional String. A string containing the minimum kernel version allowed to be ran on this machine. - -### Keyword "subarchitecture" - -Optional String. A string containing the subarchitecture type of the machine. (For example, "generic" or "hwe-t".) To determine the supported subarchitectures, use the boot-resources endpoint. - -### Keyword "mac_addresses" - -Required String. One or more MAC addresses for the machine. To specify more than one MAC address, the parameter must be specified twice. (such as "machines new mac_addresses=01:02:03:04:05:06 mac_addresses=02:03:04:05:06:07") - -### Keyword "hostname" - -Optional String. A hostname. If not given, one will be generated. - -### Keyword "description" - -Optional String. A optional description. - -### Keyword "domain" - -Optional String. The domain of the machine. If not given the default domain is used. - -### Keyword "power_type" - -Optional String. A power management type, if applicable (e.g. "virsh", "ipmi"). - -### Keyword "commission" - -Optional Boolean. Request the newly created machine to be created with status set to COMMISSIONING. Machines will wait for COMMISSIONING results and not time out. Machines created by administrators will be commissioned unless set to false. - -### Keyword "deployed" - -Optional Boolean. Request the newly created machine to be created with status set to DEPLOYED. Setting this to true implies commissioning=false, meaning that the machine won't go through the commissioning process. - -### Keyword "enable_ssh" - -Optional Int. Whether to enable SSH for the commissioning environment using the user's SSH key(s). '1' == True, '0' == False. - -### Keyword "skip_bmc_config" - -Optional Int. Whether to skip re-configuration of the BMC for IPMI based machines. '1' == True, '0' == False. - -### Keyword "skip_networking" - -Optional Int. Whether to skip re-configuring the networking on the machine after the commissioning has completed. '1' == True, '0' == False. - -### Keyword "skip_storage" - -Optional Int. Whether to skip re-configuring the storage on the machine after the commissioning has completed. '1' == True, '0' == False. - -### Keyword "commissioning_scripts" - -Optional String. A comma separated list of commissioning script names and tags to be run. By default all custom commissioning scripts are run. Built-in commissioning scripts always run. Selecting 'update_firmware' or 'configure_hba' will run firmware updates or configure HBA's on matching machines. - -### Keyword "testing_scripts" - -Optional. A comma separated list of testing script names and tags to be run. By default all tests tagged 'commissioning' will be run. Set to 'none' to disable running tests. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## MAC address registered - -```bash -maas $PROFILE machines is-registered [--help] [-d] [-k] [data ...] -``` - -Returns whether or not the given MAC address is registered within this MAAS (and attached to a non-retired node). - -### Keyword "mac_address" - -Required URL String. The MAC address to be checked. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## List allocated - -```bash -maas $PROFILE machines list-allocated [--help] [-d] [-k] [data ...] -``` - -List machines that were allocated to the User. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Get power parameters - -```bash -maas $PROFILE machines power-parameters [--help] [-d] [-k] [data ...] -``` - -Get power parameters for multiple machines. To request power parameters for a specific machine or more than one machine: -``op=power_parameters&id=abc123&id=def456``. - -### Keyword "id" - -Required URL String. A system ID. To request more than one machine, provide multiple ``id`` arguments in the request. Only machines with matching system ids will be returned. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## List Nodes visible to the user - -```bash -maas $PROFILE machines read [--help] [-d] [-k] [data ...] -``` - -List nodes visible to current user, optionally filtered by criteria. - -Nodes are sorted by id (i.e. most recent last) and grouped by type. - -### Keyword "hostname" - -Optional String. Only nodes relating to the node with the matching hostname will be returned. This can be specified multiple times to see multiple nodes. - -### Keyword "cpu_count" - -Optional Int. Only nodes with the specified minimum number of CPUs will be included. - -### Keyword "mem" - -Optional String. Only nodes with the specified minimum amount of RAM (in MiB) will be included. - -### Keyword "mac_address" - -Optional String. Only nodes relating to the node owning the specified MAC address will be returned. This can be specified multiple times to see multiple nodes. - -### Keyword "id" - -Optional String. Only nodes relating to the nodes with matching system ids will be returned. - -### Keyword "domain" - -Optional String. Only nodes relating to the nodes in the domain will be returned. - -### Keyword "zone" - -Optional String. Only nodes relating to the nodes in the zone will be returned. - -### Keyword "pool" - -Optional String. Only nodes belonging to the pool will be returned. - -### Keyword "agent_name" - -Optional String. Only nodes relating to the nodes with matching agent names will be returned. - -### Keyword "fabrics" - -Optional String. Only nodes with interfaces in specified fabrics will be returned. - -### Keyword "not_fabrics" - -Optional String. Only nodes with interfaces not in specified fabrics will be returned. - -### Keyword "vlans" - -Optional String. Only nodes with interfaces in specified VLANs will be returned. - -### Keyword "not_vlans" - -Optional String. Only nodes with interfaces not in specified VLANs will be returned. - -### Keyword "subnets" - -Optional String. Only nodes with interfaces in specified subnets will be returned. - -### Keyword "not_subnets" - -Optional String. Only nodes with interfaces not in specified subnets will be returned. - -### Keyword "link_speed" - -Optional String. Only nodes with interfaces with link speeds greater than or equal to link_speed will be returned. - -### Keyword "status" - -Optional String. Only nodes with specified status will be returned. - -### Keyword "pod" - -Optional String. Only nodes that belong to a specified pod will be returned. - -### Keyword "not_pod" - -Optional String. Only nodes that don't belong to a specified pod will be returned. - -### Keyword "pod_type" - -Optional String. Only nodes that belong to a pod of the specified type will be returned. - -### Keyword "not_pod_type" - -Optional String. Only nodes that don't belong a pod of the specified type will be returned. - -### Keyword "devices" - -Optional String. Only return nodes which have one or more devices containing the following constraints in the format `key=value[,key2=value2[,...]]`. - -Each key can be one of the following: - -- ``vendor_id``: The device vendor id -- ``product_id``: The device product id -- ``vendor_name``: The device vendor name, not case sensative -- ``product_name``: The device product name, not case sensative -- ``commissioning_driver``: The device uses this driver during commissioning. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Release machines - -```bash -maas $PROFILE machines release [--help] [-d] [-k] [data ...] -``` - -Release multiple machines. Places the machines back into the pool, ready to be reallocated. - -### Keyword "machines" - -Required String. A list of system_ids of the machines which are to be released. (An empty list is acceptable). - -### Keyword "comment" - -Optional String. Optional comment for the event log. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Assign nodes to a zone - -```bash -maas $PROFILE machines set-zone [--help] [-d] [-k] [data ...] -``` - -Assigns a given node to a given zone. - -### Keyword "zone" - -Required String. The zone name. - -### Keyword "nodes" - -Required String. The node to add. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | diff --git a/rtd-docs/reference/cli-reference/migrate.md b/rtd-docs/reference/cli-reference/migrate.md deleted file mode 100644 index a18bd784a4..0000000000 --- a/rtd-docs/reference/cli-reference/migrate.md +++ /dev/null @@ -1,13 +0,0 @@ -# migrate - -Perform migrations on connected database. - -```bash -maas migrate [-h] -``` - -## Command-line options - -| Option | Effect | -|------------|---------------------------------| -| -h, --help | show this help message and exit | diff --git a/rtd-docs/reference/cli-reference/network.md b/rtd-docs/reference/cli-reference/network.md deleted file mode 100644 index c7d3c83385..0000000000 --- a/rtd-docs/reference/cli-reference/network.md +++ /dev/null @@ -1,64 +0,0 @@ -# network - -Enter keyword arguments in the form `key=value`. - -## Returns the list of MAC addresses connected to this network - -```bash -maas $PROFILE network list-connected-macs [--help] [-d] [-k] name [data ...] -``` - -### Positional arguments - -- name - -Only MAC addresses for nodes visible to the requesting user are -returned. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Read network definition - -This operation has been deprecated in favour of `subnet read`. - -```bash -maas $PROFILE network read [--help] [-d] [-k] name [data ...] -``` - -### Positional arguments - -- name - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## List networks - -```bash -maas $PROFILE networks read [--help] [-d] [-k] [data ...] -``` - -### Keyword "node" - -Optionally, nodes which must be attached to any returned networks. If more thanone node is given, the result will be restricted to networks that these nodes have in common. - -This operation has been deprecated in favour of `subnets read`. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | diff --git a/rtd-docs/reference/cli-reference/node-device.md b/rtd-docs/reference/cli-reference/node-device.md deleted file mode 100644 index 35352c243b..0000000000 --- a/rtd-docs/reference/cli-reference/node-device.md +++ /dev/null @@ -1,51 +0,0 @@ -# node-device - -Enter keyword arguments in the form `key=value`. - -## Return node devices - -```bash -maas $PROFILE node-devices read [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -Return a list of devices attached to the node given by a system_id. - -### Keyword "bus" - -Optional String. Only return devices attached to the specified bus. Can be PCIE or USB. Defaults to all. - -### Keyword "hardware_type" - -Optional String. Only return scripts for the given hardware type. Can be ``node``, ``cpu``, ``memory``, ``storage`` or ``gpu``. Defaults to all. - -### Keyword "vendor_id" - -Optional String. Only return devices which have the specified vendor id. - -### Keyword "product_id" - -Optional String. Only return devices which have the specified product id. - -### Keyword "vendor_name" - -Optional String. Only return devices which have the specified vendor_name. - -### Keyword "product_name" - -Optional String. Only return devices which have the specified product_name. - -### Keyword "commissioning_driver" - -Optional String. Only return devices which use the specified driver when commissioning. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | diff --git a/rtd-docs/reference/cli-reference/node-result.md b/rtd-docs/reference/cli-reference/node-result.md deleted file mode 100644 index 0652c6af79..0000000000 --- a/rtd-docs/reference/cli-reference/node-result.md +++ /dev/null @@ -1,31 +0,0 @@ -# node-result - -Enter keyword arguments in the form `key=value`. - -## Read commissioning results - -```bash -maas $PROFILE node-results read [--help] [-d] [-k] [data ...] -``` - -Read the commissioning results per node visible to the user, optionally filtered. - -### Keyword "system_id" - -Optional String. An optional list of system ids. Only the results related to the nodes with these system ids will be returned. - -### Keyword "name" - -Optional String. An optional list of names. Only the results with the specified names will be returned. - -### Keyword "result_type" - -Optional String. An optional result_type. Only the results with the specified result_type will be returned. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | diff --git a/rtd-docs/reference/cli-reference/node-script-result.md b/rtd-docs/reference/cli-reference/node-script-result.md deleted file mode 100644 index 71ceaae5dc..0000000000 --- a/rtd-docs/reference/cli-reference/node-script-result.md +++ /dev/null @@ -1,175 +0,0 @@ -# node-script-result - -Enter keyword arguments in the form `key=value`. - -## Delete script results - -```bash -maas $PROFILE node-script-result delete [--help] [-d] [-k] system_id id [data ...] -``` - -### Positional arguments - -- system_id -- id - -Delete script results from the given system_id with the given id. - -"id" can either by the script set id, ``current-commissioning``, ``current-testing``, or ``current-installation``. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Download script results - -```bash -maas $PROFILE node-script-result download [--help] [-d] [-k] system_id id [data ...] -``` - -### Positional arguments - -- system_id -- id - -Download a compressed tar containing all results from the given system_id with the given id. - -"id" can either by the script set id, ``current-commissioning``, ``current-testing``, or ``current-installation``. - -### Keyword "hardware_type" - -Optional String. Only return scripts for the given hardware type. Can be ``node``, ``cpu``, ``memory``, or ``storage``. Defaults to all. - -### Keyword "filters" - -Optional String. A comma seperated list to show only results that ran with a script name or tag. - -### Keyword "output" - -Optional String. Can be either ``combined``, ``stdout``, ``stderr``, or ``all``. By default only the combined output is returned. - -### Keyword "filetype" - -Optional String. Filetype to output, can be ``txt`` or ``tar.xz``. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Get specific script result - -```bash -maas $PROFILE node-script-result read [--help] [-d] [-k] system_id id [data ...] -``` - -### Positional arguments - -- system_id -- id - -View a set of test results for a given system_id and script id. - -"id" can either by the script set id, ``current-commissioning``, ``current-testing``, or ``current-installation``. - -### Keyword "hardware_type" - -Optional String. Only return scripts for the given hardware type. Can be ``node``, ``cpu``, ``memory``, or ``storage``. Defaults to all. - -### Keyword "include_output" - -Optional. Include the base64 encoded output from the script if any value for include_output is given. - -### Keyword "filters" - -Optional String. A comma seperated list to show only results that ran with a script name, tag, or id. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Update specific script result - -```bash -maas $PROFILE node-script-result update [--help] [-d] [-k] system_id id [data ...] -``` - -### Positional arguments - -- system_id -- id - -Update a set of test results for a given system_id and script id. - -"id" can either be the script set id, ``current-commissioning``, ``current-testing``, or ``current-installation``. - -### Keyword "hardware_type" - -Optional String. Only return scripts for the given hardware type. Can be ``node``, ``cpu``, ``memory``, or ``storage``. Defaults to all. - -### Keyword "filters" - -Optional String. A comma seperated list to show only results that ran with a script name, tag, or id. - -### Keyword "include_output" - -Optional String. Include the base64 encoded output from the script if any value for include_output is given. - -### Keyword "suppressed" - -Optional Boolean. Set whether or not this script result should be suppressed using 'true' or 'false'. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Return script results - -```bash -maas $PROFILE node-script-results read [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -Return a list of script results grouped by run for the given system_id. - -### Keyword "type" - -Optional String. Only return scripts with the given type. This can be ``commissioning``, ``testing``, ``installion`` or ``release``. Defaults to showing all. - -### Keyword "hardware_type" - -Optional String. Only return scripts for the given hardware type. Can be ``node``, ``cpu``, ``memory``, or ``storage``. Defaults to all. - -### Keyword "include_output" - -Optional String. Include base64 encoded output from the script. Note that any value of include_output will include the encoded output from the script. - -### Keyword "filters" - -Optional String. A comma seperated list to show only results with a script name or tag. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | diff --git a/rtd-docs/reference/cli-reference/node-script.md b/rtd-docs/reference/cli-reference/node-script.md deleted file mode 100644 index a4c9ff3850..0000000000 --- a/rtd-docs/reference/cli-reference/node-script.md +++ /dev/null @@ -1,323 +0,0 @@ -# node-script - -Enter keyword arguments in the form `key=value`. - -## Add a tag - -```bash -maas $PROFILE node-script add-tag [--help] [-d] [-k] name [data ...] -``` - -### Positional arguments - -- name - -Add a single tag to a script with the given name. - -### Keyword "tag" - -Optional String. The tag being added. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Delete a script - -```bash -maas $PROFILE node-script delete [--help] [-d] [-k] name [data ...] -``` - -### Positional arguments - -- name - -Deletes a script with the given name. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Download a script - -```bash -maas $PROFILE node-script download [--help] [-d] [-k] name [data ...] -``` - -### Positional arguments - -- name - -Download a script with the given name. - -### Keyword "revision" - -Optional Int. What revision to download, latest by default. Can use rev as a shortcut. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Return script metadata - -```bash -maas $PROFILE node-script read [--help] [-d] [-k] name [data ...] -``` - -### Positional arguments - -- name - -Return metadata belonging to the script with the given name. - -### Keyword "include_script" - -Optional String. Include the base64 encoded script content if any value is given for include_script. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Remove a tag - -```bash -maas $PROFILE node-script remove-tag [--help] [-d] [-k] name [data ...] -``` - -### Positional arguments - -- name - -Remove a tag from a script with the given name. - -### Keyword "tag" - -Optional String. The tag being removed. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Revert a script version - -```bash -maas $PROFILE node-script revert [--help] [-d] [-k] name [data ...] -``` - -### Positional arguments - -- name - -Revert a script with the given name to an earlier version. - -### Keyword "to" - -Optional Int. What revision in the script's history to revert to. This can either be an ID or a negative number representing how far back to go. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Update a script - -```bash -maas $PROFILE node-script update [--help] [-d] [-k] name [data ...] -``` - -### Positional arguments - -- name - -Update a script with the given name. - -### Keyword "title" - -Optional String. The title of the script. - -### Keyword "description" - -Optional String. A description of what the script does. - -### Keyword "tags" - -Optional String. A comma seperated list of tags for this script. - -### Keyword "type" - -Optional String. The type defines when the script should be used. Can be ``commissioning``, ``testing`` or ``release``. It defaults to ``testing``. - -### Keyword "hardware_type" - -Optional String. The hardware_type defines what type of hardware the script is assoicated with. May be ``cpu``, ``memory``, ``storage``, ``network``, or ``node``. - -### Keyword "parallel" - -Optional Int. Whether the script may be run in parallel with other scripts. May be disabled to run by itself, instance to run along scripts with the same name, or any to run along any script. ``1`` == True, ``0`` == False. - -### Keyword "timeout" - -Optional Int. How long the script is allowed to run before failing. 0 gives unlimited time, defaults to 0. - -### Keyword "destructive" - -Optional Boolean. Whether or not the script overwrites data on any drive on the running system. Destructive scripts can not be run on deployed systems. Defaults to false. - -### Keyword "script" - -Optional String. The content of the script to be uploaded in binary form. Note: this is not a normal parameter, but a file upload. Its filename is ignored; MAAS will know it by the name you pass to the request. Optionally you can ignore the name and script parameter in favor of uploading a single file as part of the request. - -### Keyword "comment" - -Optional String. A comment about what this change does. - -### Keyword "for_hardware" - -Optional String. A list of modalias, PCI IDs, and/or USB IDs the script will automatically run on. Must start with ``modalias:``, ``pci:``, or ``usb:``. - -### Keyword "may_reboot" - -Optional Boolean. Whether or not the script may reboot the system while running. - -### Keyword "recommission" - -Optional Boolean. Whether built-in commissioning scripts should be rerun after successfully running this scripts. - -### Keyword "apply_configured_networking" - -Optional Boolean. Whether to apply the provided network configuration before the script runs. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Create a new script - -```bash -maas $PROFILE node-scripts create [--help] [-d] [-k] [data ...] -``` - -Create a new script. - -### Keyword "name" - -Required String. The name of the script. - -### Keyword "title" - -Optional String. The title of the script. - -### Keyword "description" - -Optional String. A description of what the script does. - -### Keyword "tags" - -Optional String. A comma seperated list of tags for this script. - -### Keyword "type" - -Optional String. The script_type defines when the script should be used: ``commissioning`` or ``testing`` or ``release``. Defaults to ``testing``. - -### Keyword "hardware_type" - -Optional String. The hardware_type defines what type of hardware the script is assoicated with. May be CPU, memory, storage, network, or node. - -### Keyword "parallel" - -Optional Int. Whether the script may be run in parallel with other scripts. May be disabled to run by itself, instance to run along scripts with the same name, or any to run along any script. 1 == True, 0 == False. - -### Keyword "timeout" - -Optional Int. How long the script is allowed to run before failing. 0 gives unlimited time, defaults to 0. - -### Keyword "destructive" - -Optional Boolean. Whether or not the script overwrites data on any drive on the running system. Destructive scripts can not be run on deployed systems. Defaults to false. - -### Keyword "script" - -Optional String. The content of the script to be uploaded in binary form. Note: this is not a normal parameter, but a file upload. Its filename is ignored; MAAS will know it by the name you pass to the request. Optionally you can ignore the name and script parameter in favor of uploading a single file as part of the request. - -### Keyword "comment" - -Optional String. A comment about what this change does. - -### Keyword "for_hardware" - -Optional String. A list of modalias, PCI IDs, and/or USB IDs the script will automatically run on. Must start with ``modalias:``, ``pci:``, or ``usb:``. - -### Keyword "may_reboot" - -Optional Boolean. Whether or not the script may reboot the system while running. - -### Keyword "recommission" - -Optional String. Whether builtin commissioning scripts should be rerun after successfully running this scripts. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## List stored scripts - -```bash -maas $PROFILE node-scripts read [--help] [-d] [-k] [data ...] -``` - -Return a list of stored scripts. Note that parameters should be passed in the URI, e.g.``/script/?type=testing``. - -### Keyword "type" - -Optional String. Only return scripts with the given type. This can be ``commissioning``, ``testing`` or ``release``. Defaults to showing all. - -### Keyword "hardware_type" - -Optional String. Only return scripts for the given hardware type. Can be ``cpu``, ``memory``, ``storage``, ``network``, or ``node``. Defaults to all. - -### Keyword "include_script" - -Optional String. Include the base64- encoded script content. - -### Keyword "filters" - -Optional String. A comma seperated list to show only results with a script name or tag. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | diff --git a/rtd-docs/reference/cli-reference/node.md b/rtd-docs/reference/cli-reference/node.md deleted file mode 100644 index 53ae4a4676..0000000000 --- a/rtd-docs/reference/cli-reference/node.md +++ /dev/null @@ -1,89 +0,0 @@ -# node - -Enter keyword arguments in the form `key=value`. - -## Delete a node - -```bash -maas $PROFILE node delete [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -Deletes a node with a given system_id. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Get system details - -```bash -maas $PROFILE node details [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -Returns system details -- for example, LLDP and ``lshw`` XML dumps. - -Returns a ``{detail_type: xml, ...}`` map, where ``detail_type`` is something like "lldp" or "lshw". - -Note that this is returned as BSON and not JSON. This is for efficiency, but mainly because JSON can't do binary content without applying additional encoding like base-64. The example output below is represented in ASCII using ``bsondump example.bson`` and is for demonstrative purposes. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Get power parameters - -```bash -maas $PROFILE node power-parameters [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -Gets power parameters for a given system_id, if any. For some types of power control this will include private information such as passwords and secret keys. - -Note that this method is reserved for admin users and returns a 403 if the user is not one. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Read a node - -```bash -maas $PROFILE node read [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -Reads a node with the given system_id. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | diff --git a/rtd-docs/reference/cli-reference/notification.md b/rtd-docs/reference/cli-reference/notification.md deleted file mode 100644 index 19d6212bf9..0000000000 --- a/rtd-docs/reference/cli-reference/notification.md +++ /dev/null @@ -1,175 +0,0 @@ -# notification - -Enter keyword arguments in the form `key=value`. - -## Delete a notification - -```bash -maas $PROFILE notification delete [--help] [-d] [-k] id [data ...] -``` - -### Positional arguments - -- id - -Delete a notification with a given id. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Dismiss a notification - -```bash -maas $PROFILE notification dismiss [--help] [-d] [-k] id [data ...] -``` - -### Positional arguments - -- id - -Dismiss a notification with the given id. It is safe to call multiple times for the same notification. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Read a notification - -```bash -maas $PROFILE notification read [--help] [-d] [-k] id [data ...] -``` - -### Positional arguments - -- id - -Read a notification with the given id. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Update a notification - -```bash -maas $PROFILE notification update [--help] [-d] [-k] id [data ...] -``` - -### Positional arguments - -- id - -Update a notification with a given id. This is available to admins *only*. One of the ``user``, ``users`` or ``admins`` parameters must be set to True for the notification to be visible to anyone. - -### Keyword "message" - -Required String. The message for this notification. May contain basic HTML, such as formatting. This string will be sanitised before display so that it doesn't break MAAS HTML. - -### Keyword "context" - -Optional String. Optional JSON context. The root object *must* be an object (i.e. a mapping). The values herein can be referenced by ``message`` with Python's "format" (not %) codes. - -### Keyword "category" - -Optional String. Choose from: ``error``, ``warning``, ``success``, or ``info``. Defaults to ``info``. - -### Keyword "ident" - -Optional String. Unique identifier for this notification. - -### Keyword "user" - -Optional String. User ID this notification is intended for. By default it will not be targeted to any individual user. - -### Keyword "users" - -Optional Boolean. True to notify all users, defaults to false, i.e. not targeted to all users. - -### Keyword "admins" - -Optional Boolean. True to notify all admins, defaults to false, i.e. not targeted to all admins. - -### Keyword "dismissable" - -Optional Boolean. True to allow users dimissing the notification. Defaults to true. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Create a notification - -```bash -maas $PROFILE notifications create [--help] [-d] [-k] [data ...] -``` - -Create a new notification. This is available to admins *only*. One of the ``user``, ``users`` or ``admins`` parameters must be set to True for the notification to be visible to anyone. - -### Keyword "message" - -Required String. The message for this notification. May contain basic HTML, such as formatting. This string will be sanitised before display so that it doesn't break MAAS HTML. - -### Keyword "context" - -Optional String. Optional JSON context. The root object *must* be an object (i.e. a mapping). The values herein can be referenced by ``message`` with Python's "format" (not %) codes. - -### Keyword "category" - -Optional String. Choose from: ``error``, ``warning``, ``success``, or ``info``. Defaults to ``info``. - -### Keyword "ident" - -Optional String. Unique identifier for this notification. - -### Keyword "user" - -Optional. User ID this notification is intended for. By default it will not be targeted to any individual user. - -### Keyword "users" - -Optional Boolean. True to notify all users, defaults to false, i.e. not targeted to all users. - -### Keyword "admins" - -Optional Boolean. True to notify all admins, defaults to false, i.e. not targeted to all admins. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## List notifications - -```bash -maas $PROFILE notifications read [--help] [-d] [-k] [data ...] -``` - -List notifications relevant to the invoking user. Notifications that have been dismissed are *not* returned. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | diff --git a/rtd-docs/reference/cli-reference/oidc.md b/rtd-docs/reference/cli-reference/oidc.md deleted file mode 100644 index e60c7f4209..0000000000 --- a/rtd-docs/reference/cli-reference/oidc.md +++ /dev/null @@ -1,189 +0,0 @@ -# oidc - -## Delete OIDC provider - -```bash -maas $PROFILE oidc-provider delete [--help] [-d] [-k] id - -``` - -### Positional arguments - -| Argument | Effect | -| --- | --- | -| id | The ID of the resource (e.g., `1`, `abc123`) | - -### Command-line options - -| Option | Effect | -| --- | --- | -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check. | - -Delete an OIDC provider by ID. - -## Get OIDC provider - -```bash -maas $PROFILE oidc-provider read [--help] [-d] [-k] id - -``` - -### Positional arguments - -| Argument | Effect | -| --- | --- | -| id | The ID of the resource (e.g., `1`, `abc123`) | - -### Command-line options - -| Option | Effect | -| --- | --- | -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check. | - -Retrieve an OIDC provider by ID. - -## Update OIDC provider - -```bash -maas $PROFILE oidc-provider update [--help] [-d] [-k] id [data ...] - -``` - -### Positional arguments - -| Argument | Effect | -| --- | --- | -| id | The ID of the resource (e.g., `1`, `abc123`) | - -### Command-line options - -| Option | Effect | -| --- | --- | -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check. | - -Update an existing OIDC provider by ID. - -#### Keyword "name" - -Optional String. New name for the OIDC provider. - -#### Keyword "issuer_url" - -Optional String. New issuer URL for the OIDC provider. - -#### Keyword "client_id" - -Optional String. New client ID for the OIDC provider. - -#### Keyword "client_secret" - -Optional String. New client secret for the OIDC provider. - -#### Keyword "enabled" - -Optional Boolean. Whether the OIDC provider should be enabled. - -#### Keyword "token_type" - -Optional String. New token type for the OIDC provider (JWT or Opaque). - -#### Keyword "redirect_uri" - -Optional String. New redirect URI for the OIDC provider. - -#### Keyword "scopes" - -Optional String. Space-separated list of scopes for the OIDC provider. - -Note: This command accepts JSON. - -## Create OIDC provider - -```bash -maas $PROFILE oidc-providers create [--help] [-d] [-k] [data ...] - -``` - -### Command-line options - -| Option | Effect | -| --- | --- | -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check. | - -Create a new OIDC provider. - -#### Keyword "name" - -Optional String. Name for the new OIDC provider. - -#### Keyword "issuer_url" - -Optional String. Issuer URL for the new OIDC provider. - -#### Keyword "client_id" - -Optional String. Client ID for the new OIDC provider. - -#### Keyword "client_secret" - -Optional String. Client secret for the new OIDC provider. - -#### Keyword "enabled" - -Optional Boolean. Whether the OIDC provider is enabled. Defaults to false. - -#### Keyword "token_type" - -Optional String. Token type for the OIDC provider (JWT or Opaque). Defaults to JWT. - -#### Keyword "redirect_uri" - -Optional String. Redirect URI for the OIDC provider. - -#### Keyword "scopes" - -Optional String. Space-separated list of scopes for the OIDC provider. - -Note: This command accepts JSON. - -## Get active OIDC provider - -```bash -maas $PROFILE oidc-providers get-active [--help] [-d] [-k] - -``` - -### Command-line options - -| Option | Effect | -| --- | --- | -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check. | - -Get the currently enabled OIDC provider. - -## List OIDC providers - -```bash -maas $PROFILE oidc-providers read [--help] [-d] [-k] - -``` - -### Command-line options - -| Option | Effect | -| --- | --- | -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check. | - -List all configured OIDC providers. diff --git a/rtd-docs/reference/cli-reference/package-repository.md b/rtd-docs/reference/cli-reference/package-repository.md deleted file mode 100644 index 302dd3a9e4..0000000000 --- a/rtd-docs/reference/cli-reference/package-repository.md +++ /dev/null @@ -1,195 +0,0 @@ -# package-repository - -Enter keyword arguments in the form `key=value`. - -## Create a package repository - -```bash -maas $PROFILE package-repositories create [--help] [-d] [-k] [data ...] -``` - -Create a new package repository. - -### Keyword "name" - -Required String. The name of the package repository. - -### Keyword "url" - -Required String. The url of the package repository. - -### Keyword "distributions" - -Optional String. Which package distributions to include. - -### Keyword "disabled_pockets" - -Optional String. The list of pockets to disable. - -### Keyword "disabled_components" - -Optional String. The list of components to disable. Only applicable to the default Ubuntu repositories. - -### Keyword "components" - -Optional String. The list of components to enable. Only applicable to custom repositories. - -### Keyword "arches" - -Optional String. The list of supported architectures. - -### Keyword "key" - -Optional String. The authentication key to use with the repository. - -### Keyword "disable_sources" - -Optional Boolean. Disable deb-src lines. - -### Keyword "enabled" - -Optional Boolean. Whether or not the repository is enabled. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## List package repositories - -```bash -maas $PROFILE package-repositories read [--help] [-d] [-k] [data ...] -``` - -List all available package repositories. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Delete a package repository - -```bash -maas $PROFILE package-repository delete [--help] [-d] [-k] id [data ...] -``` - -### Positional arguments - -- id - -Delete a package repository with the given id. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Read a package repository - -```bash -maas $PROFILE package-repository read [--help] [-d] [-k] id [data ...] -``` - -### Positional arguments - -- id - -Read a package repository with the given id. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Update a package repository - -```bash -maas $PROFILE package-repository update [--help] [-d] [-k] id [data ...] -``` - -### Positional arguments - -- id - -Update the package repository with the given id. - -### Keyword "name" - -Optional String. The name of the package repository. - -### Keyword "url" - -Optional String. The url of the package repository. - -### Keyword "distributions" - -Optional String. Which package distributions to include. - -### Keyword "disabled_pockets" - -Optional String. The list of pockets to disable. - -### Keyword "disabled_components" - -Optional String. The list of components to disable. Only applicable to the default Ubuntu repositories. - -### Keyword "components" - -Optional String. The list of components to enable. Only applicable to custom repositories. - -### Keyword "arches" - -Optional String. The list of supported architectures. - -### Keyword "key" - -Optional String. The authentication key to use with the repository. - -### Keyword "disable_sources" - -Optional Boolean. Disable deb-src lines. - -### Keyword "enabled" - -Optional Boolean. Whether or not the repository is enabled. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Delete a package repository - -```bash -maas $PROFILE package-repository delete [--help] [-d] [-k] id [data ...] -``` - -### Positional arguments - -- id - -Delete a package repository with the given id. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | diff --git a/rtd-docs/reference/cli-reference/partition.md b/rtd-docs/reference/cli-reference/partition.md deleted file mode 100644 index 5001219850..0000000000 --- a/rtd-docs/reference/cli-reference/partition.md +++ /dev/null @@ -1,214 +0,0 @@ -# partition - -Enter keyword arguments in the form `key=value`. - -## Create a partition - -```bash -maas $PROFILE partitions create [--help] [-d] [-k] system_id device_id [data ...] -``` - -### Positional arguments - -- system_id -- device_id - -Create a partition on a block device. - -### Keyword "size" - -Optional Int. The size of the partition in bytes. If not specified, all available space will be used. - -### Keyword "uuid" - -Optional String. UUID for the partition. Only used if the partition table type for the block device is GPT. - -### Keyword "bootable" - -Optional Boolean. If the partition should be marked bootable. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit | -| -d, --debug | Display more information about API responses | -| -k, --insecure | Disable SSL certificate check | - -## List partitions - -```bash -maas $PROFILE partitions read [--help] [-d] [-k] system_id device_id [data ...] -``` - -### Positional arguments - -- system_id -- device_id - -List partitions on a device with the given system_id and device_id. - -### Command-line options - -| Option | Effect | -|----------------|----------------------------------------------| -| --help, -h | Show this help message and exit | -| -d, --debug | Display more information about API responses | -| -k, --insecure | Disable SSL certificate check | - -## Format a partition - -```bash -maas $PROFILE partition format [--help] [-d] [-k] system_id device_id id [data ...] -``` - -### Positional arguments - -- system_id -- device_id -- id - -Format the partition on machine system_id and device device_id with the given partition id. - -### Keyword "fstype" - -Required String. Type of filesystem. - -### Keyword "uuid" - -Optional String. The UUID for the filesystem. - -### Keyword "label" - -Optional String. The label for the filesystem. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Mount a filesystem - -```bash -maas $PROFILE partition mount [--help] [-d] [-k] system_id device_id id [data ...] -``` - -### Positional arguments - -- system_id -- device_id -- id - -Mount a filesystem on machine system_id, device device_id and partition id. - -### Keyword "mount_point" - -Required String. Path on the filesystem to mount. - -### Keyword "mount_options" - -Optional String. Options to pass to mount(8). - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Read a partition - -```bash -maas $PROFILE partition read [--help] [-d] [-k] system_id device_id id [data ...] -``` - -### Positional arguments - -- system_id -- device_id -- id - -Read the partition from machine system_id and device device_id with the given partition id. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Remove a tag - -```bash -maas $PROFILE partition remove-tag [--help] [-d] [-k] system_id device_id id [data ...] -``` - -### Positional arguments - -- system_id -- device_id -- id - -Remove a tag from a partition on machine system_id, device device_id and partition id. - -### Keyword "tag" - -Required String. The tag being removed. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | -| | | - -## Unformat a partition - -```bash -maas $PROFILE partition unformat [--help] [-d] [-k] system_id device_id id [data ...] -``` - -### Positional arguments - -- system_id -- device_id -- id - -Unformat the partition on machine system_id and device device_id with the given partition id. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Unmount a filesystem - -```bash -maas $PROFILE partition unmount [--help] [-d] [-k] system_id device_id id [data ...] -``` - -### Positional arguments - -- system_id -- device_id -- id - -Unmount a filesystem on machine system_id, device device_id and partition id. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | diff --git a/rtd-docs/reference/cli-reference/pod.md b/rtd-docs/reference/cli-reference/pod.md deleted file mode 100644 index b008cc125b..0000000000 --- a/rtd-docs/reference/cli-reference/pod.md +++ /dev/null @@ -1,360 +0,0 @@ -# pod - -Enter keyword arguments in the form `key=value`. - -## Add a tag to a VM host - -```bash -maas $PROFILE pod add-tag [--help] [-d] [-k] id [data ...] -``` - -### Positional arguments - -- id - -Adds a tag to a given VM host. - -### Keyword "tag" - -Required String. The tag to add. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Compose a virtual machine on the host - -```bash -maas $PROFILE pod compose [--help] [-d] [-k] id [data ...] -``` - -### Positional arguments - -- id - -Compose a new machine from a VM host. - -### Keyword "cores" - -Optional Int. The minimum number of CPU cores. - -### Keyword "memory" - -Optional Int. The minimum amount of memory, specified in MiB (e.g. 2 MiB == 2*1024*1024). - -### Keyword "hugepages_backed" - -Optional Boolean. Whether to request hugepages backing for the machine. - -### Keyword "pinned_cores" - -Optional Int. List of host CPU cores to pin the VM to. If this is passed, the "cores" parameter is ignored. - -### Keyword "cpu_speed" - -Optional Int. The minimum CPU speed, specified in MHz. - -### Keyword "architecture" - -Optional String. The architecture of the new machine (e.g. amd64). This must be an architecture the VM host supports. - -### Keyword "storage" - -Optional String. A list of storage constraint identifiers in the form ``label:size(tag,tag,...), label:size(tag,tag,...)``. For more information please see the CLI VM host management page of the official MAAS documentation. - -### Keyword "interfaces" - -Optional String. A labeled constraint map associating constraint labels with desired interface properties. MAAS will assign interfaces that match the given interface properties. - -Format: ``label:key=value,key=value,...`` - -Keys: - -- ``id``: Matches an interface with the specific id -- ``fabric``: Matches an interface attached to the specified fabric. -- ``fabric_class``: Matches an interface attached to a fabric with the specified class. -- ``ip``: Matches an interface whose VLAN is on the subnet implied by the given IP address, and allocates the specified IP address for the machine on that interface (if it is available). -- ``mode``: Matches an interface with the specified mode. (Currently, the only supported mode is "unconfigured".) -- ``name``: Matches an interface with the specified name. (For example, "eth0".) -- ``hostname``: Matches an interface attached to the node with the specified hostname. -- ``subnet``: Matches an interface attached to the specified subnet. -- ``space``: Matches an interface attached to the specified space. -- ``subnet_cidr``: Matches an interface attached to the specified subnet CIDR. (For example, "192.168.0.0/24".) -- ``type``: Matches an interface of the specified type. (Valid types: "physical", "vlan", "bond", "bridge", or "unknown".) -- ``vlan``: Matches an interface on the specified VLAN. -- ``vid``: Matches an interface on a VLAN with the specified VID. -- ``tag``: Matches an interface tagged with the specified tag. - -### Keyword "hostname" - -Optional String. The hostname of the newly composed machine. - -### Keyword "domain" - -Optional Int. The ID of the domain in which to put the newly composed machine. - -### Keyword "zone" - -Optional Int. The ID of the zone in which to put the newly composed machine. - -### Keyword "pool" - -Optional Int. The ID of the pool in which to put the newly composed machine. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Deletes a VM host - -```bash -maas $PROFILE pod delete [--help] [-d] [-k] id [data ...] -``` - -### Positional arguments - -- id - -Deletes a VM host with the given ID. - -### Keyword "decompose" - -Optional Boolean. Whether to also also decompose all machines in the VM host on removal. If not provided, machines will not be removed. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Obtain VM host parameters - -```bash -maas $PROFILE pod parameters [--help] [-d] [-k] id [data ...] -``` - -### Positional arguments - -- id - -This returns a VM host's configuration parameters. For some types of VM host, this will include private information such as passwords and secret keys. - -Note: This method is reserved for admin users. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## This operation has been deprecated in favour of 'Virtual-machine-host read' - -```bash -maas $PROFILE pod read [--help] [-d] [-k] id [data ...] -``` - -### Positional arguments - -- id - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Refresh a VM host - -```bash -maas $PROFILE pod refresh [--help] [-d] [-k] id [data ...] -``` - -### Positional arguments - -- id - -Performs VM host discovery and updates all discoveredinformation and discovered machines. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Remove a tag from a VM host - -```bash -maas $PROFILE pod remove-tag [--help] [-d] [-k] id [data ...] -``` - -### Positional arguments - -- id - -Removes a given tag from a VM host. - -### Keyword "tag" - -Required String. The tag to add. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Update a specific VM host - -```bash -maas $PROFILE pod update [--help] [-d] [-k] id [data ...] -``` - -### Positional arguments - -- id - -Update a specific VM host by ID. - -Note: A VM host's 'type' cannot be updated. The VM host must be deleted and re-added to change the type. - -### Keyword "name" - -Optional String. The VM host's name. - -### Keyword "pool" - -Optional String. The name of the resource pool associated with this VM host -- composed machines will be assigned to this resource pool by default. - -### Keyword "cpu_over_commit_ratio" - -Optional Int. CPU overcommit ratio (0-10) - -### Keyword "memory_over_commit_ratio" - -Optional Int. CPU overcommit ratio (0-10) - -### Keyword "default_storage_pool" - -Optional String. Default KVM storage pool to use when the VM host has storage pools. - -### Keyword "power_address" - -Optional String. Address for power control of the VM host. - -### Keyword "power_pass" - -Optional String. Password for access to power control of the VM host. - -### Keyword "zone" - -Optional String. The VM host's zone. - -### Keyword "default_macvlan_mode" - -Optional String. Default macvlan mode for VM hosts that use it: bridge, passthru, private, vepa. - -### Keyword "tags" - -Optional String. Tag or tags (command separated) associated with the VM host. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Create a VM host - -```bash -maas $PROFILE pods create [--help] [-d] [-k] [data ...] -``` - -Create or discover a new VM host. - -### Keyword "type" - -Required String. The type of VM host to create: ``lxd`` or ``virsh``. - -### Keyword "power_address" - -Required String. Address that gives MAAS access to the VM host power control. For example, for virsh ``qemu+ssh://172.16.99.2/system`` For ``lxd``, this is just the address of the host. - -### Keyword "power_user" - -Required String. Username to use for power control of the VM host. Required for ``virsh`` VM hosts that do not have SSH set up for public-key authentication. - -### Keyword "power_pass" - -Required String. Password to use for power control of the VM host. Required ``virsh`` VM hosts that do not have SSH set up for public-key authentication and for ``lxd`` if the MAAS certificate is not registered already in the LXD server. - -### Keyword "name" - -Optional String. The new VM host's name. - -### Keyword "zone" - -Optional String. The new VM host's zone. - -### Keyword "pool" - -Optional String. The name of the resource pool the new VM host will belong to. Machines composed from this VM host will be assigned to this resource pool by default. - -### Keyword "tags" - -Optional String. A tag or list of tags ( comma delimited) to assign to the new VM host. - -### Keyword "project" - -Optional String. For ``lxd`` VM hosts, the project that MAAS will manage. If not provided, the ``default`` project will be used. If a nonexistent name is given, a new project with that name will be created. - -### Keyword "certificate" - -Optional String. X.509 certificate used to verify the identity of the user. If ``certificate`` and ``key`` are not provided, and the VM created is LXD type, a X.509 certificate will be created. - -### Keyword "key" - -Optional String. private key used for authentication. If ``certificate`` and ``key`` are not provided, and the VM created is LXD type, a RSA key will be created. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## List VM hosts - -```bash -maas $PROFILE pods read [--help] [-d] [-k] [data ...] -``` - -Get a listing of all VM hosts. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | diff --git a/rtd-docs/reference/cli-reference/rack-controller.md b/rtd-docs/reference/cli-reference/rack-controller.md deleted file mode 100644 index 319c314f8d..0000000000 --- a/rtd-docs/reference/cli-reference/rack-controller.md +++ /dev/null @@ -1,539 +0,0 @@ -# rack-controller - -Enter keyword arguments in the form `key=value`. - -## Abort a node operation - -```bash -maas $PROFILE rack-controller abort [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -Abort a node's current operation. - -### Keyword "comment" - -Optional String. Comment for the event log. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Delete a rack controller - -```bash -maas $PROFILE rack-controller delete [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -Deletes a rack controller with the given system_id. A rack controller cannot be deleted if it is set to `primary_rack` on a `VLAN` and another rack controller cannot be used to provide DHCP for said VLAN. Use `force` to override this behavior. - -Using `force` will also allow deleting a rack controller that is hosting pod virtual machines. The pod will also be deleted. - -Rack controllers that are also region controllers will be converted to a region controller (and hosted pods will not be affected). - -### Keyword "force" - -Optional Boolean. Always delete the rack controller even if it is the `primary_rack` on a `VLAN` and another rack controller cannot provide DHCP on that VLAN. This will disable DHCP on those VLANs. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Get system details - -```bash -maas $PROFILE rack-controller details [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -Returns system details -- for example, LLDP and ``lshw`` XML dumps. - -Returns a ``{detail_type: xml, ...}`` map, where ``detail_type`` is something like "lldp" or "lshw". - -Note that this is returned as BSON and not JSON. This is for efficiency, but mainly because JSON can't do binary content without applying additional encoding like base-64. The example output below is represented in ASCII using ``bsondump example.bson`` and is for demonstrative purposes. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Import boot images - -```bash -maas $PROFILE rack-controller import-boot-images [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -Import boot images on a given rack controller or all rack controllers. (deprecated) - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## List available boot images - -```bash -maas $PROFILE rack-controller list-boot-images [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -Lists all available boot images for a given rack controller system_id and whether they are in sync with the region controller. (deprecated) - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Ignore failed tests - -```bash -maas $PROFILE rack-controller override-failed-testing [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -Ignore failed tests and put node back into a usable state. - -### Keyword "comment" - -Optional String. Comment for the event log. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Power off a node - -```bash -maas $PROFILE rack-controller power-off [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -Powers off a given node. - -### Keyword "stop_mode" - -Optional String. Power-off mode. If 'soft', perform a soft power down if the node's power type supports it, otherwise perform a hard power off. For all values other than 'soft', and by default, perform a hard power off. A soft power off generally asks the OS to shutdown the system gracefully before powering off, while a hard power off occurs immediately without any warning to the OS. - -### Keyword "comment" - -Optional String. Comment for the event log. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Turn on a node - -```bash -maas $PROFILE rack-controller power-on [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -Turn on the given node with optional user-data and comment. - -### Keyword "user_data" - -Optional String. Base64-encoded blob of data to be made available to the nodes through the metadata service. - -### Keyword "comment" - -Optional String. Comment for the event log. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Get power parameters - -```bash -maas $PROFILE rack-controller power-parameters [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -Gets power parameters for a given system_id, if any. For some types of power control this will include private information such as passwords and secret keys. - -Note that this method is reserved for admin users and returns a 403 if the user is not one. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Get the power state of a node - -```bash -maas $PROFILE rack-controller query-power-state [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -Gets the power state of a given node. MAAS sends a request to the node's power controller, which asks it about the node's state. The reply to this could be delayed by up to 30 seconds while waiting for the power controller to respond. Use this method sparingly as it ties up an appserver thread while waiting. - -### Keyword "system_id" - -Required String. The node to query. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Read a node - -```bash -maas $PROFILE rack-controller read [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -Reads a node with the given system_id. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Begin testing process for a node - -```bash -maas $PROFILE rack-controller test [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -Begins the testing process for a given node. - -A node in the 'ready', 'allocated', 'deployed', 'broken', or any failed state may run tests. If testing is started and successfully passes from 'broken' or any failed state besides 'failed commissioning' the node will be returned to a ready state. Otherwise the node will return to the state it was when testing started. - -### Keyword "enable_ssh" - -Optional Int. Whether to enable SSH for the testing environment using the user's SSH key(s). 0 == false. 1 == true. - -### Keyword "testing_scripts" - -Optional String. A comma-separated list of testing script names and tags to be run. By default all tests tagged 'commissioning' will be run. - -### Keyword "parameters" - -Optional String. Scripts selected to run may define their own parameters. These parameters may be passed using the parameter name. Optionally a parameter may have the script name prepended to have that parameter only apply to that specific script. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Update a rack controller - -```bash -maas $PROFILE rack-controller update [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -Updates a rack controller with the given system_id. - -### Keyword "description" - -Optional String. The new description for this given rack controller. - -### Keyword "power_type" - -Optional String. The new power type for the given rack controller. If you use the default value, power_parameters will be set to an empty string. See the `Power types`_ section for a list of available power types. Note that only admin users can set this parameter. - -### Keyword "power_parameters_skip_check" - -Optional Boolean. If true, the new power parameters for the given rack controller will be checked against the expected parameters for the rack controller's power type. Default is false. - -### Keyword "zone" - -Optional String. The name of a valid zone in which to place the given rack controller. - -### Keyword "domain" - -Optional String. The domain for this controller. If not given the default domain is used. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Import boot images - -```bash -maas $PROFILE rack-controller import-boot-images [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -Import boot images on a given rack controller or all rack controllers. (deprecated) - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## MAC address registered - -```bash -maas $PROFILE rack-controllers is-registered [--help] [-d] [-k] [data ...] -``` - -Returns whether or not the given MAC address is registered within this MAAS (and attached to a non-retired node). - -### Keyword "mac_address" - -Required URL String. The MAC address to be checked. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Get power parameters - -```bash -maas $PROFILE rack-controllers power-parameters [--help] [-d] [-k] [data ...] -``` - -Get power parameters for multiple machines. To request power parameters for a specific machine or more than one machine: - -``op=power_parameters&id=abc123&id=def456``. - -### Keyword "id" - -Required URL String. A system ID. To request more than one machine, provide multiple ``id`` arguments in the request. Only machines with matching system ids will be returned. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## List Nodes visible to the user - -```bash -maas $PROFILE rack-controllers read [--help] [-d] [-k] [data ...] -``` - -List nodes visible to current user, optionally filtered by criteria. - -Nodes are sorted by id (i.e. most recent last) and grouped by type. - -### Keyword "hostname" - -Optional String. Only nodes relating to the node with the matching hostname will be returned. This can be specified multiple times to see multiple nodes. - -### Keyword "cpu_count" - -Optional Int. Only nodes with the specified minimum number of CPUs will be included. - -### Keyword "mem" - -Optional String. Only nodes with the specified minimum amount of RAM (in MiB) will be included. - -### Keyword "mac_address" - -Optional String. Only nodes relating to the node owning the specified MAC address will be returned. This can be specified multiple times to see multiple nodes. - -### Keyword "id" - -Optional String. Only nodes relating to the nodes with matching system ids will be returned. - -### Keyword "domain" - -Optional String. Only nodes relating to the nodes in the domain will be returned. - -### Keyword "zone" - -Optional String. Only nodes relating to the nodes in the zone will be returned. - -### Keyword "pool" - -Optional String. Only nodes belonging to the pool will be returned. - -### Keyword "agent_name" - -Optional String. Only nodes relating to the nodes with matching agent names will be returned. - -### Keyword "fabrics" - -Optional String. Only nodes with interfaces in specified fabrics will be returned. - -### Keyword "not_fabrics" - -Optional String. Only nodes with interfaces not in specified fabrics will be returned. - -### Keyword "vlans" - -Optional String. Only nodes with interfaces in specified VLANs will be returned. - -### Keyword "not_vlans" - -Optional String. Only nodes with interfaces not in specified VLANs will be returned. - -### Keyword "subnets" - -Optional String. Only nodes with interfaces in specified subnets will be returned. - -### Keyword "not_subnets" - -Optional String. Only nodes with interfaces not in specified subnets will be returned. - -### Keyword "link_speed" - -Optional String. Only nodes with interfaces with link speeds greater than or equal to link_speed will be returned. - -### Keyword "status" - -Optional String. Only nodes with specified status will be returned. - -### Keyword "pod" - -Optional String. Only nodes that belong to a specified pod will be returned. - -### Keyword "not_pod" - -Optional String. Only nodes that don't belong to a specified pod will be returned. - -### Keyword "pod_type" - -Optional String. Only nodes that belong to a pod of the specified type will be returned. - -### Keyword "not_pod_type" - -Optional String. Only nodes that don't belong a pod of the specified type will be returned. - -### Keyword "devices" - -Optional String. Only return nodes which have one or more devices containing the following constraints in the `format key=value[,key2=value2[,...]]`. - -Each key can be one of the following: - -- ``vendor_id``: The device vendor id -- ``product_id``: The device product id -- ``vendor_name``: The device vendor name, not case sensative -- ``product_name``: The device product name, not case sensative -- ``commissioning_driver``: The device uses this driver during commissioning. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Assign nodes to a zone - -```bash -maas $PROFILE rack-controllers set-zone [--help] [-d] [-k] [data ...] -``` - -Assigns a given node to a given zone. - -### Keyword "zone" - -Required String. The zone name. - -### Keyword "nodes" - -Required String. The node to add. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | diff --git a/rtd-docs/reference/cli-reference/raid.md b/rtd-docs/reference/cli-reference/raid.md deleted file mode 100644 index 3fa0673f93..0000000000 --- a/rtd-docs/reference/cli-reference/raid.md +++ /dev/null @@ -1,174 +0,0 @@ -# raid - -Enter keyword arguments in the form `key=value`. - -## Delete a RAID - -```bash -maas $PROFILE raid delete [--help] [-d] [-k] system_id id [data ...] -``` - -### Positional arguments - -- system_id -- id - -Delete a RAID with the given id on a machine with the given system_id. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Read a RAID - -```bash -maas $PROFILE raid read [--help] [-d] [-k] system_id id [data ...] -``` - -### Positional arguments - -- system_id -- id - -Read RAID with the given id on a machine with the given system_id. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Update a RAID - -```bash -maas $PROFILE raid update [--help] [-d] [-k] system_id id [data ...] -``` - -### Positional arguments - -- system_id -- id - -Update a RAID with the given id on a machine with the given system_id. - -### Keyword "name" - -Optional String. Name of the RAID. - -### Keyword "uuid" - -Optional String. UUID of the RAID. - -### Keyword "add_block_devices" - -Optional String. Block devices to add to the RAID. - -### Keyword "remove_block_devices" - -Optional String. Block devices to remove from the RAID. - -### Keyword "add_spare_devices" - -Optional String. Spare block devices to add to the RAID. - -### Keyword "remove_spare_devices" - -Optional String. Spare block devices to remove from the RAID. - -### Keyword "add_partitions" - -Optional String. Partitions to add to the RAID. - -### Keyword "remove_partitions" - -Optional String. Partitions to remove from the RAID. - -### Keyword "add_spare_partitions" - -Optional String. Spare partitions to add to the RAID. - -### Keyword "remove_spare_partitions" - -Optional String. Spare partitions to remove from the RAID. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Set up a RAID - -```bash -maas $PROFILE raids create [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -Set up a RAID on a machine with the given system_id. - -### Keyword "name" - -Optional String. Name of the RAID. - -### Keyword "uuid" - -Optional String. UUID of the RAID. - -### Keyword "level" - -Required Int. RAID level. - -### Keyword "block_devices" - -Optional String. Block devices to add to the RAID. - -### Keyword "spare_devices" - -Optional String. Spare block devices to add to the RAID. - -### Keyword "partitions" - -Optional String. Partitions to add to the RAID. - -### Keyword "spare_partitions" - -Optional String. Spare partitions to add to the RAID. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## List all RAIDs - -```bash -maas $PROFILE raids read [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -List all RAIDs belonging to a machine with the given system_id. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | diff --git a/rtd-docs/reference/cli-reference/refresh.md b/rtd-docs/reference/cli-reference/refresh.md deleted file mode 100644 index d45c143d77..0000000000 --- a/rtd-docs/reference/cli-reference/refresh.md +++ /dev/null @@ -1,15 +0,0 @@ -# refresh - -Refresh the API descriptions of all profiles. - -```bash -maas refresh [-h] -``` - -This retrieves the latest version of the help information for each profile. Use it to update your command-line client's information after an upgrade to the MAAS server. - -## Command-line options - -| Option | Effect | -|-----------|---------------------------------| -| h, --help | show this help message and exit | diff --git a/rtd-docs/reference/cli-reference/region-controller.md b/rtd-docs/reference/cli-reference/region-controller.md deleted file mode 100644 index 1a9d4bcd8d..0000000000 --- a/rtd-docs/reference/cli-reference/region-controller.md +++ /dev/null @@ -1,175 +0,0 @@ -# region-controller - -Enter keyword arguments in the form `key=value`. - -## Delete a region controller - -```bash -maas $PROFILE region-controller delete [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -Deletes a region controller with the given system_id. - -A region controller cannot be deleted if it hosts pod virtual machines. Use `force` to override this behavior. Forcing deletion will also remove hosted pods. - -### Keyword "force" - -Optional Boolean. Tells MAAS to override disallowing deletion of region controllers that host pod virtual machines. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Get system details - -```bash -maas $PROFILE region-controller details [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -Returns system details -- for example, LLDP and ``lshw`` XML dumps. - -Returns a ``{detail_type: xml, ...}`` map, where ``detail_type`` is something like "lldp" or "lshw". - -Note that this is returned as BSON and not JSON. This is for efficiency, but mainly because JSON can't do binary content without applying additional encoding like base-64. The example output below is represented in ASCII using ``bsondump example.bson`` and is for demonstrative purposes. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Get power parameters - -```bash -maas $PROFILE region-controller power-parameters [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -Gets power parameters for a given system_id, if any. For some types of power control this will include private information such as passwords and secret keys. - -Note that this method is reserved for admin users and returns a 403 if the user is not one. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Read a node - -```bash -maas $PROFILE region-controller read [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -Reads a node with the given system_id. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Update a region controller - -```bash -maas $PROFILE region-controller update [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -Updates a region controller with the given system_id. - -### Keyword "description" - -Optional String. The new description for this given region controller. - -### Keyword "power_type" - -Optional String. The new power type for this region controller. If you use the default value, power_parameters will be set to the empty string. Available to admin users. See the `Power types`_ section for a list of the available power types. - -### Keyword "power_parameters_skip_check" - -Optional String. Whether or not the new power parameters for this region controller should be checked against the expected power parameters for the region controller's power type ('true' or 'false'). The default is 'false'. - -### Keyword "zone" - -Optional String. Name of a valid physical zone in which to place this region controller. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Read a node - -```bash -maas $PROFILE region-controller read [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -Reads a node with the given system_id. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Assign nodes to a zone - -```bash -maas $PROFILE region-controllers set-zone [--help] [-d] [-k] [data ...] -``` - -Assigns a given node to a given zone. - -### Keyword "zone" - -Required String. The zone name. - -### Keyword "nodes" - -Required String. The node to add. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | diff --git a/rtd-docs/reference/cli-reference/resource-pool.md b/rtd-docs/reference/cli-reference/resource-pool.md deleted file mode 100644 index 8a97f21369..0000000000 --- a/rtd-docs/reference/cli-reference/resource-pool.md +++ /dev/null @@ -1,105 +0,0 @@ -# resource-pool - -Enter keyword arguments in the form `key=value`. - -## Deletes a resource pool - -```bash -maas $PROFILE resource-pool delete [--help] [-d] [-k] id [data ...] -``` - -### Positional arguments - -- id - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Returns a resource pool - -```bash -maas $PROFILE resource-pool read [--help] [-d] [-k] id [data ...] -``` - -### Positional arguments - -- id - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Updates a resource pool's name or description - -```bash -maas $PROFILE resource-pool update [--help] [-d] [-k] id [data ...] -``` - -### Positional arguments - -- id - -Note that any other given parameters are silently ignored. - -### Keyword "description" - -Optional String. A brief description of the resource pool. - -### Keyword "name" - -Optional String. The resource pool's new name. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Creates a new resource pool - -```bash -maas $PROFILE resource-pools create [--help] [-d] [-k] [data ...] -``` - -### Keyword "name" Required. The new resource pool's name - -Type: String. - -### Keyword "description" - -Optional String. A brief description of the new resource pool. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Get a listing of all resource pools - -```bash -maas $PROFILE resource-pools read [--help] [-d] [-k] [data ...] -``` - -Note that there is always at least one resource pool: default. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | diff --git a/rtd-docs/reference/cli-reference/space.md b/rtd-docs/reference/cli-reference/space.md deleted file mode 100644 index a405adb65c..0000000000 --- a/rtd-docs/reference/cli-reference/space.md +++ /dev/null @@ -1,111 +0,0 @@ -# space - -Enter keyword arguments in the form `key=value`. - -## Delete a space - -```bash -maas $PROFILE space delete [--help] [-d] [-k] id [data ...] -``` - -### Positional arguments - -- id - -Deletes a space with the given ID. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Reads a space - -```bash -maas $PROFILE space read [--help] [-d] [-k] id [data ...] -``` - -### Positional arguments - -- id - -Gets a space with the given ID. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Update space - -```bash -maas $PROFILE space update [--help] [-d] [-k] id [data ...] -``` - -### Positional arguments - -- id - -Updates a space with the given ID. - -### Keyword "name" - -Required String. The name of the new space. - -### Keyword "description" - -Optional String. A description of the new space. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Create a space - -```bash -maas $PROFILE spaces create [--help] [-d] [-k] [data ...] -``` - -Create a new space. - -### Keyword "name" - -Required String. The name of the new space. - -### Keyword "description" - -Optional String. A description of the new space. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## List all spaces - -```bash -maas $PROFILE spaces read [--help] [-d] [-k] [data ...] -``` - -Generates a list of all spaces. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | diff --git a/rtd-docs/reference/cli-reference/sshkey.md b/rtd-docs/reference/cli-reference/sshkey.md deleted file mode 100644 index 2690d3241b..0000000000 --- a/rtd-docs/reference/cli-reference/sshkey.md +++ /dev/null @@ -1,122 +0,0 @@ -# sshkey - -## Delete an SSH key - -```bash -maas $PROFILE sshkey delete [--help] [-d] [-k] id [data ...] - -``` - -### Positional arguments - -| Argument | Effect | -|---|---| -| id | The ID of the resource (e.g., `1`, `abc123`) | - -### Command-line options - -| Option | Effect | -|---|---| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check. | - -Deletes the SSH key with the given ID. - -#### Keyword "id" - -Optional Int. An SSH key ID. - -Note: This command accepts JSON. - -## Retrieve an SSH key - -```bash -maas $PROFILE sshkey read [--help] [-d] [-k] id [data ...] - -``` - -### Positional arguments - -| Argument | Effect | -|---|---| -| id | The ID of the resource (e.g., `1`, `abc123`) | - -### Command-line options - -| Option | Effect | -|---|---| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check. | - -Retrieves an SSH key with the given ID. - -#### Keyword "id" - -Optional Int. An SSH key ID. - -Note: This command accepts JSON. - -## Add a new SSH key - -```bash -maas $PROFILE sshkeys create [--help] [-d] [-k] [data ...] - -``` - -### Command-line options - -| Option | Effect | -|---|---| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check. | - -Add a new SSH key to the requesting or supplied user's
account. - -#### Keyword "key" - -Optional String. A public SSH key
should be provided in the request payload as form data with the name
'key':

``key: "key-type public-key-data"``

- ``key-type``: ecdsa-sha2-nistp256, ecdsa-sha2-nistp384,
ecdsa-sha2-nistp521, ssh-ed25519, ssh-rsa
- ``public key data``: Base64-encoded key data. - -Note: This command accepts JSON. - -## Import SSH keys - -```bash -maas $PROFILE sshkeys import [--help] [-d] [-k] [data ...] - -``` - -### Command-line options - -| Option | Effect | -|---|---| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check. | - -Import the requesting user's SSH keys for a given protocol
and authorization ID in protocol:auth_id format. - -#### Keyword "keysource" - -Optional String. The source
of the keys to import should be provided in the request payload as form
data:

E.g. ``source:user``

- ``source``: lp (Launchpad), gh (GitHub)
- ``user``: User login - -Note: This command accepts JSON. - -## List SSH keys - -```bash -maas $PROFILE sshkeys read [--help] [-d] [-k] - -``` - -### Command-line options - -| Option | Effect | -|---|---| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check. | - -List all keys belonging to the requesting user. diff --git a/rtd-docs/reference/cli-reference/sslkey.md b/rtd-docs/reference/cli-reference/sslkey.md deleted file mode 100644 index 7af20b8be1..0000000000 --- a/rtd-docs/reference/cli-reference/sslkey.md +++ /dev/null @@ -1,51 +0,0 @@ -# sslkey - -Enter keyword arguments in the form `key=value`. - -## Delete an SSL key - -```bash -maas $PROFILE sslkey delete [--help] [-d] [-k] id [data ...] -``` - -### Positional arguments - -- id - -Deletes the SSL key with the given ID. - -### Keyword "id" - -Required Int. An SSH key ID. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit | -| -d, --debug | Display more information about API responses | -| -k, --insecure | Disable SSL certificate check | - -## Retrieve an SSL key - -```bash -maas $PROFILE sslkey read [--help] [-d] [-k] id [data ...] -``` - -### Positional arguments - -- id - -Retrieves an SSL key with the given ID. - -### Keyword "id" - -Required Int. An SSL key ID. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit | -| -d, --debug | Display more information about API responses | -| -k, --insecure | Disable SSL certificate check | diff --git a/rtd-docs/reference/cli-reference/static-route.md b/rtd-docs/reference/cli-reference/static-route.md deleted file mode 100644 index 0bfbda58dd..0000000000 --- a/rtd-docs/reference/cli-reference/static-route.md +++ /dev/null @@ -1,127 +0,0 @@ -# static-route - -Enter keyword arguments in the form `key=value`. - -## Delete static route - -```bash -maas $PROFILE static-route delete [--help] [-d] [-k] id [data ...] -``` - -### Positional arguments - -- id - -Deletes the static route with the given ID. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Get a static route - -```bash -maas $PROFILE static-route read [--help] [-d] [-k] id [data ...] -``` - -### Positional arguments - -- id - -Gets a static route with the given ID. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Update a static route - -```bash -maas $PROFILE static-route update [--help] [-d] [-k] id [data ...] -``` - -### Positional arguments - -- id - -Updates a static route with the given ID. - -### Keyword "source" - -Optional String. Source subnet name for the route. - -### Keyword "destination" - -Optional String. Destination subnet name for the route. - -### Keyword "gateway_ip" - -Optional String. IP address of the gateway on the source subnet. - -### Keyword "metric" - -Optional Int. Weight of the route on a deployed machine. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Create a static route - -```bash -maas $PROFILE static-routes create [--help] [-d] [-k] [data ...] -``` - -Creates a static route. - -### Keyword "source" - -Required String. Source subnet name for the route. - -### Keyword "destination" - -Required String. Destination subnet name for the route. - -### Keyword "gateway_ip" - -Required String. IP address of the gateway on the source subnet. - -### Keyword "metric" - -Optional Int. Weight of the route on a deployed machine. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## List static routes - -```bash -maas $PROFILE static-routes read [--help] [-d] [-k] [data ...] -``` - -Lists all static routes. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | diff --git a/rtd-docs/reference/cli-reference/status.md b/rtd-docs/reference/cli-reference/status.md deleted file mode 100644 index 1056e732cf..0000000000 --- a/rtd-docs/reference/cli-reference/status.md +++ /dev/null @@ -1,14 +0,0 @@ -# status - -Running `maas status` in the MAAS CLI provides an overview of key services. Understanding these services is essential for management and troubleshooting: - -- **Regiond (Region Controller):** Manages the MAAS environment, handling API requests, PostgreSQL, DNS, caching, and the web UI. -- **Rackd (Rack Controller):** Manages physical machines, providing DHCP, TFTP, and power control under the region controller. -- **Bind9 (DNS):** Provides domain name resolution for managed machines. -- **DHCPD (DHCP):** Assigns IP addresses during commissioning and deployment. -- **TFTP:** Transfers boot images for PXE booting. -- **NTP:** Synchronizes system clocks for accurate logging and coordination. -- **HTTP (Nginx):** Acts as a reverse proxy and serves the MAAS web interface. -- **Proxy (Squid):** Caches frequently accessed data to optimize network efficiency. - -Monitoring these services with `maas status` ensures smooth infrastructure operation. diff --git a/rtd-docs/reference/cli-reference/subnet.md b/rtd-docs/reference/cli-reference/subnet.md deleted file mode 100644 index dbe411f7b3..0000000000 --- a/rtd-docs/reference/cli-reference/subnet.md +++ /dev/null @@ -1,327 +0,0 @@ -# subnet - -Enter keyword arguments in the form `key=value`. - -## Delete a subnet - -```bash -maas $PROFILE subnet delete [--help] [-d] [-k] id [data ...] -``` - -### Positional arguments - -- id - -Delete a subnet with the given ID. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Summary of IP addresses - -```bash -maas $PROFILE subnet ip-addresses [--help] [-d] [-k] id [data ...] -``` - -### Positional arguments - -- id - -Returns a summary of IP addresses assigned to this subnet. - -### Keyword "with_username" - -Optional Int. If '0', suppresses the display of usernames associated with each address. '1' == True, '0' == False. (Default: '1') - -### Keyword "with_summary" - -Optional Int. If '0', suppresses the display of nodes, BMCs, and and DNS records associated with each address. '1' == True, '0' == False. (Default: True) - -### Keyword "with_node_summary" - -Optional Int. Deprecated. Use 'with_summary'. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Get a subnet - -```bash -maas $PROFILE subnet read [--help] [-d] [-k] id [data ...] -``` - -### Positional arguments - -- id - -Get information about a subnet with the given ID. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## List reserved IP ranges - -```bash -maas $PROFILE subnet reserved-ip-ranges [--help] [-d] [-k] id [data ...] -``` - -### Positional arguments - -- id - -Lists IP ranges currently reserved in the subnet. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Get subnet statistics - -```bash -maas $PROFILE subnet statistics [--help] [-d] [-k] id [data ...] -``` - -### Positional arguments - -- id - -Returns statistics for the specified subnet, including: - -- **num_available**: the number of available IP addresses -- **largest_available**: the largest number of contiguous free IP addresses -- **num_unavailable**: the number of unavailable IP addresses -- **total_addresses**: the sum of the available plus unavailable addresses -- **usage**: the (floating point) usage percentage of this subnet -- **usage_string**: the (formatted unicode) usage percentage of this subnet -- **ranges**: the specific IP ranges present in ths subnet (if specified) - -Note: to supply additional optional parameters for this request, addthem to the request URI, for example: - -``/subnets/1/?op=statistics&include_suggestions=1`` - -### Keyword "include_ranges" - -Optional Int. If '1', includes detailed information about the usage of this range. '1' == True, '0' == False. - -### Keyword "include_suggestions" - -Optional Int. If '1', includes the suggested gateway and dynamic range for this subnet, if it were to be configured. '1' == True, '0' == False. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## List unreserved IP ranges - -```bash -maas $PROFILE subnet unreserved-ip-ranges [--help] [-d] [-k] id [data ...] -``` - -### Positional arguments - -- id - -Lists IP ranges currently unreserved in the subnet. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Update a subnet - -```bash -maas $PROFILE subnet update [--help] [-d] [-k] id [data ...] -``` - -### Positional arguments - -- id - -Update a subnet with the given ID. - -### Keyword "cidr" - -Optional String. The network CIDR for this subnet. - -### Keyword "name" - -Optional String. The subnet's name. - -### Keyword "description" - -Optional String. The subnet's description. - -### Keyword "vlan" - -Optional String. VLAN this subnet belongs to. Defaults to the default VLAN for the provided fabric or defaults to the default VLAN in the default fabric (if unspecified). - -### Keyword "fabric" - -Optional String. Fabric for the subnet. Defaults to the fabric the provided VLAN belongs to, or defaults to the default fabric. - -### Keyword "vid" - -Optional Int. VID of the VLAN this subnet belongs to. Only used when vlan is not provided. Picks the VLAN with this VID in the provided fabric or the default fabric if one is not given. - -### Keyword "gateway_ip" - -Optional String. The gateway IP address for this subnet. - -### Keyword "rdns_mode" - -Optional Int. How reverse DNS is handled for this subnet. One of: - -- ``0`` Disabled: No reverse zone is created. -- ``1`` Enabled: Generate reverse zone. -- ``2`` RFC2317: Extends '1' to create the necessary parent zone with the appropriate CNAME resource records for the network, if the network is small enough to require the support described in RFC2317. - -### Keyword "allow_dns" - -Optional Int. Configure MAAS DNS to allow DNS resolution from this subnet. '0' == False, '1' == True. - -### Keyword "allow_proxy" - -Optional Int. Configure maas-proxy to allow requests from this subnet. '0' == False, '1' == True. - -### Keyword "dns_servers" - -Optional String. Comma-separated list of DNS servers for this subnet. - -### Keyword "managed" - -Optional Int. In MAAS 2.0+, all subnets are assumed to be managed by default. - -### Keyword "disabled_boot_architectures" - -Optional String. A comma or space separated list of boot architectures which will not be responded to by isc-dhcpd. Values may be the MAAS name for the boot architecture, the IANA hex value, or the isc-dhcpd octet. - -Only managed subnets allow DHCP to be enabled on their related dynamic ranges. (Thus, dynamic ranges become "informational only"; an indication that another DHCP server is currently handling them, or that MAAS will handle them when the subnet is enabled for management.) - -Managed subnets do not allow IP allocation by default. The meaning of a "reserved" IP range is reversed for an unmanaged subnet. (That is, for managed subnets, "reserved" means "MAAS cannot allocate any IP address within this reserved block". For unmanaged subnets, "reserved" means "MAAS must allocate IP addresses only from reserved IP ranges." - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Create a subnet - -```bash -maas $PROFILE subnets create [--help] [-d] [-k] [data ...] -``` - -Creates a new subnet. - -### Keyword "cidr" - -Required String. The network CIDR for this subnet. - -### Keyword "name" - -Optional String. The subnet's name. - -### Keyword "description" - -Optional String. The subnet's description. - -### Keyword "vlan" - -Optional String. VLAN this subnet belongs to. Defaults to the default VLAN for the provided fabric or defaults to the default VLAN in the default fabric (if unspecified). - -### Keyword "fabric" - -Optional String. Fabric for the subnet. Defaults to the fabric the provided VLAN belongs to, or defaults to the default fabric. - -### Keyword "vid" - -Optional Int. VID of the VLAN this subnet belongs to. Only used when vlan is not provided. Picks the VLAN with this VID in the provided fabric or the default fabric if one is not given. - -### Keyword "gateway_ip" - -Optional String. The gateway IP address for this subnet. - -### Keyword "rdns_mode" - -Optional Int. How reverse DNS is handled for this subnet. One of: - -- ``0`` Disabled: No reverse zone is created. -- ``1`` Enabled: Generate reverse zone. -- ``2`` RFC2317: Extends '1' to create the necessary parent zone with the appropriate CNAME resource records for the network, if the network is small enough to require the support described in RFC2317. - -### Keyword "allow_dns" - -Optional Int. Configure MAAS DNS to allow DNS resolution from this subnet. '0' == False, '1' == True. - -### Keyword "allow_proxy" - -Optional Int. Configure maas-proxy to allow requests from this subnet. '0' == False, '1' == True. - -### Keyword "dns_servers" - -Optional String. Comma-separated list of DNS servers for this subnet. - -### Keyword "managed" - -Optional Int. In MAAS 2.0+, all subnets are assumed to be managed by default. - -### Keyword "disabled_boot_architectures" - -Optional String. A comma or space separated list of boot architectures which will not be responded to by isc-dhcpd. Values may be the MAAS name for the boot architecture, the IANA hex value, or the isc-dhcpd octet. - -Only managed subnets allow DHCP to be enabled on their related dynamic ranges. (Thus, dynamic ranges become "informational only"; an indication that another DHCP server is currently handling them, or that MAAS will handle them when the subnet is enabled for management.) - -Managed subnets do not allow IP allocation by default. The meaning of a "reserved" IP range is reversed for an unmanaged subnet. (That is, for managed subnets, "reserved" means "MAAS cannot allocate any IP address within this reserved block". For unmanaged subnets, "reserved" means "MAAS must allocate IP addresses only from reserved IP ranges." - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## List all subnets - -```bash -maas $PROFILE subnets read [--help] [-d] [-k] [data ...] -``` - -Get a list of all subnets. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | diff --git a/rtd-docs/reference/cli-reference/tag.md b/rtd-docs/reference/cli-reference/tag.md deleted file mode 100644 index 7f8a76df8b..0000000000 --- a/rtd-docs/reference/cli-reference/tag.md +++ /dev/null @@ -1,247 +0,0 @@ -# tag - -Enter keyword arguments in the form `key=value`. - -## Delete a tag - -```bash -maas $PROFILE tag delete [--help] [-d] [-k] name [data ...] -``` - -### Positional arguments - -- name - -Deletes a tag by name. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## List devices by tag - -```bash -maas $PROFILE tag devices [--help] [-d] [-k] name [data ...] -``` - -### Positional arguments - -- name - -Get a JSON list containing device objects that match the given tag name. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## List machines by tag - -```bash -maas $PROFILE tag machines [--help] [-d] [-k] name [data ...] -``` - -### Positional arguments - -- name - -Get a JSON list containing machine objects that match the given tag name. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## List nodes by tag - -```bash -maas $PROFILE tag nodes [--help] [-d] [-k] name [data ...] -``` - -### Positional arguments - -- name - -Get a JSON list containing node objects that match the given tag name. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## List rack controllers by tag - -```bash -maas $PROFILE tag rack-controllers [--help] [-d] [-k] name [data ...] -``` - -### Positional arguments - -- name - -Get a JSON list containing rack-controller objectsthat match the given tag name. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Read a specific tag - -```bash -maas $PROFILE tag read [--help] [-d] [-k] name [data ...] -``` - -### Positional arguments - -- name - -Returns a JSON object containing information about a specific tag. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Trigger a tag-node mapping rebuild - -```bash -maas $PROFILE tag rebuild [--help] [-d] [-k] name [data ...] -``` - -### Positional arguments - -- name - -Tells MAAS to rebuild the tag-to-node mappings. This is a maintenance operation and should not be necessary under normal circumstances. Adding nodes or updating a tag definition should automatically trigger the mapping rebuild. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## List region controllers by tag - -```bash -maas $PROFILE tag region-controllers [--help] [-d] [-k] name [data ...] -``` - -### Positional arguments - -- name - -Get a JSON list containing region-controller objects that match the given tag name. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Update a tag - -```bash -maas $PROFILE tag update [--help] [-d] [-k] name [data ...] -``` - -### Positional arguments - -- name - -Update elements of a given tag. - -### Keyword "name" - -Optional String. The new tag name. Because the name will be used in urls, it should be short. - -### Keyword "comment" - -Optional String. A description of what the the tag will be used for in natural language. - -### Keyword "definition" - -Optional String. An XPATH query that is evaluated against the hardware_details stored for all nodes (i.e. the output of ``lshw -xml``). - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Update nodes associated with this tag - -```bash -maas $PROFILE tag update-nodes [--help] [-d] [-k] name [data ...] -``` - -### Positional arguments - -- name - -Add or remove nodes associated with the given tag. Note that you must supply either the ``add`` or ``remove`` parameter. - -### Keyword "add" - -Optional String. The system_id to tag. - -### Keyword "remove" - -Optional String. The system_id to untag. - -### Keyword "definition" - -Optional String. If given, the definition (XPATH expression) will be validated against the current definition of the tag. If the value does not match, MAAS assumes the worker is out of date and will drop the update. - -### Keyword "rack_controller" - -Optional String. The system ID of the rack controller that processed the given tag initially. If not given, the requester must be a MAAS admin. If given, the requester must be the rack controller. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## List tags - -```bash -maas $PROFILE tags read [--help] [-d] [-k] [data ...] -``` - -Outputs a JSON object containing an array of all currently defined tag objects. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | diff --git a/rtd-docs/reference/cli-reference/user-group.md b/rtd-docs/reference/cli-reference/user-group.md deleted file mode 100644 index 1ff514a8ba..0000000000 --- a/rtd-docs/reference/cli-reference/user-group.md +++ /dev/null @@ -1,292 +0,0 @@ -# user-group - -## Add an entitlement to a user group - -```bash -maas $PROFILE user-group add-entitlement [--help] [-d] [-k] id [data ...] - -``` - -### Positional arguments - -| Argument | Effect | -|---|---| -| id | The ID of the resource (e.g., `1`, `abc123`) | - -### Command-line options - -| Option | Effect | -|---|---| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check. | - -### Keywords - -#### Keyword "resource_type" - -Optional String. The resource type ('maas' or 'pool'). - -#### Keyword "resource_id" - -Optional Int. The resource ID. Must be 0 for 'maas' type. - -#### Keyword "entitlement" - -Optional String. The entitlement name. - -Note: This command accepts JSON. - -## Add a user to a user group - -```bash -maas $PROFILE user-group add-member [--help] [-d] [-k] id [data ...] - -``` - -### Positional arguments - -| Argument | Effect | -|---|---| -| id | The ID of the resource (e.g., `1`, `abc123`) | - -### Command-line options - -| Option | Effect | -|---|---| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check. | - -### Keywords - -#### Keyword "username" - -Optional String. The username to add. - -Note: This command accepts JSON. - -## Delete a user group - -```bash -maas $PROFILE user-group delete [--help] [-d] [-k] id - -``` - -### Positional arguments - -| Argument | Effect | -|---|---| -| id | The ID of the resource (e.g., `1`, `abc123`) | - -### Command-line options - -| Option | Effect | -|---|---| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check. | - -## List entitlements of a user group - -```bash -maas $PROFILE user-group list-entitlements [--help] [-d] [-k] id - -``` - -### Positional arguments - -| Argument | Effect | -|---|---| -| id | The ID of the resource (e.g., `1`, `abc123`) | - -### Command-line options - -| Option | Effect | -|---|---| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check. | - -## Lists members of a user group - -```bash -maas $PROFILE user-group list-members [--help] [-d] [-k] id - -``` - -### Positional arguments - -| Argument | Effect | -|---|---| -| id | The ID of the resource (e.g., `1`, `abc123`) | - -### Command-line options - -| Option | Effect | -|---|---| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check. | - -## Return a user group - -```bash -maas $PROFILE user-group read [--help] [-d] [-k] id - -``` - -### Positional arguments - -| Argument | Effect | -|---|---| -| id | The ID of the resource (e.g., `1`, `abc123`) | - -### Command-line options - -| Option | Effect | -|---|---| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check. | - -## Remove an entitlement from a user group - -```bash -maas $PROFILE user-group remove-entitlement [--help] [-d] [-k] id [data ...] - -``` - -### Positional arguments - -| Argument | Effect | -|---|---| -| id | The ID of the resource (e.g., `1`, `abc123`) | - -### Command-line options - -| Option | Effect | -|---|---| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check. | - -### Keywords - -#### Keyword "resource_type" - -Optional String. The resource type
('maas' or 'pool'). - -#### Keyword "resource_id" - -Optional Int. The resource ID. - -#### Keyword "entitlement" - -Optional String. The entitlement name. - -Note: This command accepts JSON. - -## Removes a user from a user group - -```bash -maas $PROFILE user-group remove-member [--help] [-d] [-k] id [data ...] - -``` - -### Positional arguments - -| Argument | Effect | -|---|---| -| id | The ID of the resource (e.g., `1`, `abc123`) | - -### Command-line options - -| Option | Effect | -|---|---| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check. | - -### Keywords - -#### Keyword "username" - -Optional String. The username to remove. - -Note: This command accepts JSON. - -## Update a user group - -```bash -maas $PROFILE user-group update [--help] [-d] [-k] id [data ...] - -``` - -### Positional arguments - -| Argument | Effect | -|---|---| -| id | The ID of the resource (e.g., `1`, `abc123`) | - -### Command-line options - -| Option | Effect | -|---|---| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check. | - -### Keywords - -#### Keyword "name" - -Optional String. The group name. - -#### Keyword "description" - -Optional String. The group description. - -Note: This command accepts JSON. - -## Create a new user group - -```bash -maas $PROFILE user-groups create [--help] [-d] [-k] [data ...] - -``` - -### Command-line options - -| Option | Effect | -|---|---| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check. | - -### Keywords - -#### Keyword "name" - -Optional String. The group name. - -#### Keyword "description" - -Optional String. The group description. - -Note: This command accepts JSON. - -## List all user groups - -```bash -maas $PROFILE user-groups read [--help] [-d] [-k] - -``` - -### Command-line options - -| Option | Effect | -|---|---| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check. | diff --git a/rtd-docs/reference/cli-reference/user.md b/rtd-docs/reference/cli-reference/user.md deleted file mode 100644 index 0dbbc2ecde..0000000000 --- a/rtd-docs/reference/cli-reference/user.md +++ /dev/null @@ -1,111 +0,0 @@ -# user - -Enter keyword arguments in the form `key=value`. - -## Delete a user - -```bash -maas $PROFILE user delete [--help] [-d] [-k] username [data ...] -``` - -### Positional arguments - -- username - -Deletes a given username. - -### Keyword "transfer_resources_to" - -Optional String. An optional username. If supplied, the allocated resources of the user being deleted will be transferred to this user. A user can't be removed unless its resources (machines, IP addresses, ...), are released or transfered to another user. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Retrieve user details - -```bash -maas $PROFILE user read [--help] [-d] [-k] username [data ...] -``` - -### Positional arguments - -- username - -Retrieve a user's details. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Create a MAAS user account - -```bash -maas $PROFILE users create [--help] [-d] [-k] [data ...] -``` - -Creates a MAAS user account. This is not safe: the password is sent in plaintext. Avoid it for production, unless you are confident that you can prevent eavesdroppers from observing the request. - -### Keyword "username" - -Required String. Identifier-style username for the new user. - -### Keyword "email" - -Required String. Email address for the new user. - -### Keyword "password" - -Required String. Password for the new user. - -### Keyword "is_superuser" - -Required Boolean. Whether the new user is to be an administrator. ('0' == False, '1' == True) - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## List users - -```bash -maas $PROFILE users read [--help] [-d] [-k] [data ...] -``` - -List users - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Retrieve logged-in user - -```bash -maas $PROFILE users whoami [--help] [-d] [-k] [data ...] -``` - -Returns the currently logged-in user. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | diff --git a/rtd-docs/reference/cli-reference/version.md b/rtd-docs/reference/cli-reference/version.md deleted file mode 100644 index 8cdcee7965..0000000000 --- a/rtd-docs/reference/cli-reference/version.md +++ /dev/null @@ -1,17 +0,0 @@ -# version - -Get MAAS version information. - -```bash -maas $PROFILE version read [--help] [-d] [-k] [data ...] -``` - -Read version and capabilities of this MAAS instance. - -## Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | diff --git a/rtd-docs/reference/cli-reference/vlan.md b/rtd-docs/reference/cli-reference/vlan.md deleted file mode 100644 index bd2848bae4..0000000000 --- a/rtd-docs/reference/cli-reference/vlan.md +++ /dev/null @@ -1,158 +0,0 @@ -# vlan - -Enter keyword arguments in the form `key=value`. - -## Delete a VLAN - -```bash -maas $PROFILE vlan delete [--help] [-d] [-k] fabric_id vid [data ...] -``` - -### Positional arguments - -- fabric_id -- vid - -Delete VLAN on a given fabric. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit| -| -d, --debug | Display more information about API responses| -| -k, --insecure | Disable SSL certificate check | - -## Retrieve VLAN - -```bash -maas $PROFILE vlan read [--help] [-d] [-k] fabric_id vid [data ...] -``` - -### Positional arguments - -- fabric_id -- vid - -Retrieves a VLAN on a given fabric_id. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit| -| -d, --debug | Display more information about API responses| -| -k, --insecure | Disable SSL certificate check | - -## Update VLAN - -```bash -maas $PROFILE vlan update [--help] [-d] [-k] fabric_id vid [data ...] -``` - -### Positional arguments - -- fabric_id -- vid - -Updates a given VLAN. - -### Keyword "name" - -Optional String. Name of the VLAN. - -### Keyword "description" - -Optional String. Description of the VLAN. - -### Keyword "mtu" - -Optional Int. The MTU to use on the VLAN. - -### Keyword "dhcp_on" - -Optional Boolean. Whether or not DHCP should be managed on the VLAN. - -### Keyword "primary_rack" - -Optional String. The primary rack controller managing the VLAN (system_id). - -### Keyword "secondary_rack" - -Optional String. The secondary rack controller managing the VLAN (system_id). - -### Keyword "relay_vlan" - -Optional Int. Relay VLAN ID. Only set when this VLAN will be using a DHCP relay to forward DHCP requests to another VLAN that MAAS is managing. MAAS will not run the DHCP relay itself, it must be configured to proxy requests to the primary and/or secondary rack controller interfaces for the VLAN specified in this field. - -### Keyword "space" - -Optional String. The space this VLAN should be placed in. Passing in an empty string (or the string 'undefined') will cause the VLAN to be placed in the 'undefined' space. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit| -| -d, --debug | Display more information about API responses| -| -k, --insecure | Disable SSL certificate check | - -## Create a VLAN - -```bash -maas $PROFILE vlans create [--help] [-d] [-k] fabric_id [data ...] -``` - -### Positional arguments - -- fabric_id - -Creates a new VLAN. - -### Keyword "name" - -Optional String. Name of the VLAN. - -### Keyword "description" - -Optional String. Description of the new VLAN. - -### Keyword "vid" - -Required Int. VLAN ID of the new VLAN. - -### Keyword "mtu" - -Optional Int. The MTU to use on the VLAN. - -### Keyword "space" - -Optional String. The space this VLAN should be placed in. Passing in an empty string (or the string 'undefined') will cause the VLAN to be placed in the 'undefined' space. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit| -| -d, --debug | Display more information about API responses| -| -k, --insecure | Disable SSL certificate check | - -## List VLANs - -```bash -maas $PROFILE vlans read [--help] [-d] [-k] fabric_id [data ...] -``` - -### Positional arguments - -- fabric_id - -List all VLANs belonging to given fabric. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit| -| -d, --debug | Display more information about API responses| -| -k, --insecure | Disable SSL certificate check | diff --git a/rtd-docs/reference/cli-reference/vm-cluster.md b/rtd-docs/reference/cli-reference/vm-cluster.md deleted file mode 100644 index f79bc00a39..0000000000 --- a/rtd-docs/reference/cli-reference/vm-cluster.md +++ /dev/null @@ -1,77 +0,0 @@ -# vm-cluster - -Enter keyword arguments in the form `key=value`. - -## Deletes a VM cluster - -```bash -maas $PROFILE vm-cluster delete [--help] [-d] [-k] id [data ...] -``` - -### Positional arguments - -- id - -Deletes a VM cluster with the given ID. - -### Keyword "decompose" - -Optional Boolean. Whether to also decompose all machines in the VM cluster on removal. If not provided, machines will not be removed. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit| -| -d, --debug | Display more information about API responses| -| -k, --insecure | Disable SSL certificate check | - -## This operation has been deprecated in favor of 'Virtual-machine-host read' - -```bash -maas $PROFILE vm-cluster read [--help] [-d] [-k] id [data ...] -``` - -### Positional arguments - -- id - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit| -| -d, --debug | Display more information about API responses| -| -k, --insecure | Disable SSL certificate check | - -## Update a VM cluster - -```bash -maas $PROFILE vm-cluster update [--help] [-d] [-k] id [data ...] -``` - -### Positional arguments - -- id - -Update a specific VM cluster by ID. - -### Keyword "name" - -Optional String. The VM cluster's name. - -### Keyword "pool" - -Optional String. The name of the resource pool associated with this VM Cluster -- this change is propagated to VM hosts - -### Keyword "zone" - -Optional String. The VM cluster's zone. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit| -| -d, --debug | Display more information about API responses| -| -k, --insecure | Disable SSL certificate check | diff --git a/rtd-docs/reference/cli-reference/vm-host.md b/rtd-docs/reference/cli-reference/vm-host.md deleted file mode 100644 index fca775cb4d..0000000000 --- a/rtd-docs/reference/cli-reference/vm-host.md +++ /dev/null @@ -1,361 +0,0 @@ -# vm-host - -Enter keyword arguments in the form `key=value`. - -## Add a tag to a VM host - -```bash -maas $PROFILE vm-host add-tag [--help] [-d] [-k] id [data ...] -``` - -### Positional arguments - -- id - -Adds a tag to a given VM host. - -### Keyword "tag" - -Required String. The tag to add. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit| -| -d, --debug | Display more information about API responses| -| -k, --insecure | Disable SSL certificate check | - -## Compose a virtual machine on the host - -```bash -maas $PROFILE vm-host compose [--help] [-d] [-k] id [data ...] -``` - -### Positional arguments - -- id - -Compose a new machine from a VM host. - -### Keyword "cores" - -Optional Int. The minimum number of CPU cores. - -### Keyword "memory" - -Optional Int. The minimum amount of memory, specified in MiB (e.g. 2 MiB == 2*1024*1024). - -### Keyword "hugepages_backed" - -Optional Boolean. Whether to request hugepages backing for the machine. - -### Keyword "pinned_cores" - -Optional Int. List of host CPU cores to pin the VM to. If this is passed, the "cores" parameter is ignored. - -### Keyword "cpu_speed" - -Optional Int. The minimum CPU speed, specified in MHz. - -### Keyword "architecture" - -Optional String. The architecture of the new machine (e.g. amd64). This must be an architecture the VM host supports. - -### Keyword "storage" - -Optional String. A list of storage constraint identifiers in the form ``label:size(tag,tag,), label:size(tag,tag,)``. For more information please see the CLI VM host management page of the official MAAS documentation. - -### Keyword "interfaces" - -Optional. A labeled constraint map associating constraint labels with desired interface properties. MAAS will assign interfaces that match the given interface properties. - -Format: ``label:key=value,key=value,`` - -Keys: - -- ``id``: Matches an interface with the specific id -- ``fabric``: Matches an interface attached to the specified fabric. -- ``fabric_class``: Matches an interface attached to a fabric with the specified class. -- ``ip``: Matches an interface whose VLAN is on the subnet implied by the given IP address, and allocates the specified IP address for the machine on that interface (if it is available). -- ``mode``: Matches an interface with the specified mode. (Currently, the only supported mode is "unconfigured".) -- ``name``: Matches an interface with the specified name. (For example, "eth0".) -- ``hostname``: Matches an interface attached to the node with the specified hostname. -- ``subnet``: Matches an interface attached to the specified subnet. -- ``space``: Matches an interface attached to the specified space. -- ``subnet_cidr``: Matches an interface attached to the specified subnet CIDR. (For example, "192.168.0.0/24".) -- ``type``: Matches an interface of the specified type. (Valid types: "physical", "vlan", "bond", "bridge", or "unknown".) -- ``vlan``: Matches an interface on the specified VLAN. -- ``vid``: Matches an interface on a VLAN with the specified VID. -- ``tag``: Matches an interface tagged with the specified tag. - -### Keyword "hostname" - -Optional String. The hostname of the newly composed machine. - -### Keyword "domain" - -Optional Int. The ID of the domain in which to put the newly composed machine. - -### Keyword "zone" - -Optional Int. The ID of the zone in which to put the newly composed machine. - -### Keyword "pool" - -Optional Int. The ID of the pool in which to put the newly composed machine. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit| -| -d, --debug | Display more information about API responses| -| -k, --insecure | Disable SSL certificate check | - -## Deletes a VM host - -```bash -maas $PROFILE vm-host delete [--help] [-d] [-k] id [data ...] -``` - -### Positional arguments - -- id - -Deletes a VM host with the given ID. - -### Keyword "decompose" - -Optional Boolean. Whether to also decompose all machines in the VM host on removal. If not provided, machines will not be removed. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit| -| -d, --debug | Display more information about API responses| -| -k, --insecure | Disable SSL certificate check | - -## Obtain VM host parameters - -```bash -maas $PROFILE vm-host parameters [--help] [-d] [-k] id [data ...] -``` - -### Positional arguments - -- id - -This returns a VM host's configuration parameters. For some types of VM host, this will include private information such as passwords and secret keys. - -Note: This method is reserved for admin users. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit| -| -d, --debug | Display more information about API responses| -| -k, --insecure | Disable SSL certificate check | - -## This operation has been deprecated in favor of 'Virtual-machine-host read' - -```bash -maas $PROFILE vm-host read [--help] [-d] [-k] id [data ...] -``` - -### Positional arguments - -- id - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit| -| -d, --debug | Display more information about API responses| -| -k, --insecure | Disable SSL certificate check | - -## Refresh a VM host - -```bash -maas $PROFILE vm-host refresh [--help] [-d] [-k] id [data ...] -``` - -### Positional arguments - -- id - -Performs VM host discovery and updates all discovered information and discovered machines. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit| -| -d, --debug | Display more information about API responses| -| -k, --insecure | Disable SSL certificate check | - -## Remove a tag from a VM host - -```bash -maas $PROFILE vm-host remove-tag [--help] [-d] [-k] id [data ...] -``` - -### Positional arguments - -- id - -Removes a given tag from a VM host. - -### Keyword "tag" - -Required String. The tag to add. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit| -| -d, --debug | Display more information about API responses| -| -k, --insecure | Disable SSL certificate check | - -## Update a specific VM host - -```bash -maas $PROFILE vm-host update [--help] [-d] [-k] id [data ...] -``` - -### Positional arguments - -- id - -Update a specific VM host by ID. - -Note: A VM host's 'type' cannot be updated. The VM host must be deleted and re-added to change the type. - -### Keyword "name" - -Optional String. The VM host's name. - -### Keyword "pool" - -Optional String. The name of the resource pool associated with this VM host -- composed machines will be assigned to this resource pool by default. - -### Keyword "cpu_over_commit_ratio" - -Optional Int. CPU overcommit ratio (0-10) - -### Keyword "memory_over_commit_ratio" - -Optional Int. CPU overcommit ratio (0-10) - -### Keyword "default_storage_pool" - -Optional String. Default KVM storage pool to use when the VM host has storage pools. - -### Keyword "power_address" - -Optional String. Address for power control of the VM host. - -### Keyword "power_pass" - -Optional String. Password for access to power control of the VM host. - -### Keyword "zone" - -Optional String. The VM host's zone. - -### Keyword "default_macvlan_mode" - -Optional String. Default macvlan mode for VM hosts that use it: bridge, passthru, private, vepa. - -### Keyword "tags" - -Optional String. Tag or tags (command separated) associated with the VM host. - -### Command-line options - -| Option | Effect | -|----------------|----------------------------------------------| -| --help, -h | Show this help message and exit | -| -d, --debug | Display more information about API responses | -| -k, --insecure | Disable SSL certificate check | -| | | - -## Create a VM host - -```bash -maas $PROFILE vm-hosts create [--help] [-d] [-k] [data ...] -``` - -Create or discover a new VM host. - -### Keyword "type" - -Required String. The type of VM host to create: ``lxd`` or ``virsh``. - -### Keyword "power_address" - -Required String. Address that gives MAAS access to the VM host power control. For example, for virsh ``qemu+ssh://172.16.99.2/system`` For ``lxd``, this is just the address of the host. - -### Keyword "power_user" - -Required String. Username to use for power control of the VM host. Required for ``virsh`` VM hosts that do not have SSH set up for public-key authentication. - -### Keyword "power_pass" - -Required String. Password to use for power control of the VM host. Required ``virsh`` VM hosts that do not have SSH set up for public-key authentication and for ``lxd`` if the MAAS certificate is not registered already in the LXD server. - -### Keyword "name" - -Optional String. The new VM host's name. - -### Keyword "zone" - -Optional String. The new VM host's zone. - -### Keyword "pool" - -Optional String. The name of the resource pool the new VM host will belong to. Machines composed from this VM host will be assigned to this resource pool by default. - -### Keyword "tags" - -Optional String. A tag or list of tags ( comma delimited) to assign to the new VM host. - -### Keyword "project" - -Optional String. For ``lxd`` VM hosts, the project that MAAS will manage. If not provided, the ``default`` project will be used. If a nonexistent name is given, a new project with that name will be created. - -### Keyword "certificate" - -Optional. X.509 certificate used to verify the identity of the user. If ``certificate`` and ``key`` are not provided, and the VM created is LXD type, a X.509 certificate will be created. - -### Keyword "key" - -Optional String. private key used for authentication. If ``certificate`` and ``key`` are not provided, and the VM created is LXD type, a RSA key will be created. - -### Command-line options - -| Option | Effect | -|----------------|----------------------------------------------| -| --help, -h | Show this help message and exit | -| -d, --debug | Display more information about API responses | -| -k, --insecure | Disable SSL certificate check | - -## List VM hosts - -```bash -maas $PROFILE vm-hosts read [--help] [-d] [-k] [data ...] -``` - -Get a listing of all VM hosts. - -### Command-line options - -| Option | Effect | -|----------------|----------------------------------------------| -| --help, -h | Show this help message and exit | -| -d, --debug | Display more information about API responses | -| -k, --insecure | Disable SSL certificate check | diff --git a/rtd-docs/reference/cli-reference/vmfs-datastores.md b/rtd-docs/reference/cli-reference/vmfs-datastores.md deleted file mode 100644 index 927b48a362..0000000000 --- a/rtd-docs/reference/cli-reference/vmfs-datastores.md +++ /dev/null @@ -1,144 +0,0 @@ -# vmfs-datastores - -Enter keyword arguments in the form `key=value`. - -## Delete the specified VMFS datastore - -```bash -maas $PROFILE vmfs-datastore delete [--help] [-d] [-k] system_id id [data ...] -``` - -### Positional arguments - -- system_id -- id - -Delete a VMFS datastore with the given id from the machine with the given system_id. - -### Command-line options - -| Option | Effect | -|----------------|-----------------------------------------------| -| --help, -h | Show this help message and exit| -| -d, --debug | Display more information about API responses| -| -k, --insecure | Disable SSL certificate check | - -## Read a VMFS datastore - -```bash -maas $PROFILE vmfs-datastore read [--help] [-d] [-k] system_id id [data ...] -``` - -### Positional arguments - -- system_id -- id - -Read a VMFS datastore with the given id on the machine with the given system_id. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit| -| -d, --debug | Display more information about API responses| -| -k, --insecure | Disable SSL certificate check | - -## Update a VMFS datastore - -```bash -maas $PROFILE vmfs-datastore update [--help] [-d] [-k] system_id id [data ...] -``` - -### Positional arguments - -- system_id -- id - -Update a VMFS datastore with the given id on the machine with the given system_id. - -### Keyword "name" - -Optional String. Name of the VMFS datastore. - -### Keyword "uuid" - -Optional String. UUID of the VMFS datastore. - -### Keyword "add_block_devices" - -Optional String. Block devices to add to the VMFS datastore. - -### Keyword "add_partitions" - -Optional String. Partitions to add to the VMFS datastore. - -### Keyword "remove_partitions" - -Optional String. Partitions to remove from the VMFS datastore. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit| -| -d, --debug | Display more information about API responses| -| -k, --insecure | Disable SSL certificate check | - -## Create a VMFS datastore - -```bash -maas $PROFILE vmfs-datastores create [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -Create a VMFS datastore belonging to a machine with the given system_id. - -Note that at least one valid block device or partition is required. - -### Keyword "name" - -Required String. Name of the VMFS datastore. - -### Keyword "uuid" - -Optional String. (optional) UUID of the VMFS group. - -### Keyword "block_devices" - -Optional String. Block devices to add to the VMFS datastore. - -### Keyword "partitions" - -Optional String. Partitions to add to the VMFS datastore. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit| -| -d, --debug | Display more information about API responses| -| -k, --insecure | Disable SSL certificate check | - -## List all VMFS datastores - -```bash -maas $PROFILE vmfs-datastores read [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -List all VMFS datastores belonging to a machine with the given system_id. - -### Command-line options - -| Option | Effect | -|----------------|----------------------------------------------| -| --help, -h | Show this help message and exit | -| -d, --debug | Display more information about API responses | -| -k, --insecure | Disable SSL certificate check | diff --git a/rtd-docs/reference/cli-reference/volume-group.md b/rtd-docs/reference/cli-reference/volume-group.md deleted file mode 100644 index 835556da4e..0000000000 --- a/rtd-docs/reference/cli-reference/volume-group.md +++ /dev/null @@ -1,214 +0,0 @@ -# volume-group - -Enter keyword arguments in the form `key=value`. - -## Create a logical volume - -```bash -maas $PROFILE volume-group create-logical-volume [--help] [-d] [-k] system_id id -``` - -Create a logical volume - -### Positional arguments - -- system_id -- id - -Create a logical volume in the volume group with the given id on the machine with the given system_id. - -### Keyword "name" - -Required String. Name of the logical volume. - -### Keyword "uuid" - -Optional String. (optional) UUID of the logical volume. - -### Keyword "size" - -Optional String. (optional) Size of the logical volume. Must be larger than or equal to 4,194,304 bytes. E.g. ``4194304``. Will default to free space in the volume group if not given. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Delete volume group - -```bash -maas $PROFILE volume-group delete [--help] [-d] [-k] system_id id [data ...] -``` - -### Positional arguments - -- system_id -- id - -Delete a volume group with the given id from the machine with the given system_id. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Delete a logical volume - -```bash -maas $PROFILE volume-group delete-logical-volume [--help] [-d] [-k] system_id id -``` - -Delete a logical volume - -### Positional arguments - -- system_id -- id - -Delete a logical volume in the volume group with the given id on the machine with the given system_id. - -Note: this operation returns HTTP status code 204 even if the logical volume id does not exist. - -### Keyword "id" - -Required Int. The logical volume id. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Read a volume group - -```bash -maas $PROFILE volume-group read [--help] [-d] [-k] system_id id [data ...] -``` - -### Positional arguments - -- system_id -- id - -Read a volume group with the given id on the machine with the given system_id. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Update a volume group - -```bash -maas $PROFILE volume-group update [--help] [-d] [-k] system_id id [data ...] -``` - -### Positional arguments - -- system_id -- id - -Update a volume group with the given id on the machine with the given system_id. - -### Keyword "name" - -Optional String. Name of the volume group. - -### Keyword "uuid" - -Optional String. UUID of the volume group. - -### Keyword "add_block_devices" - -Optional String. Block devices to add to the volume group. - -### Keyword "remove_block_devices" - -Optional String. Block devices to remove from the volume group. - -### Keyword "add_partitions" - -Optional String. Partitions to add to the volume group. - -### Keyword "remove_partitions" - -Optional String. Partitions to remove from the volume group. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Create a volume group - -```bash -maas $PROFILE volume-groups create [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -Create a volume group belonging to a machine with the given system_id. - -Note that at least one valid block device or partition is required. - -### Keyword "name" - -Required String. Name of the volume group. - -### Keyword "uuid" - -Optional String. (optional) UUID of the volume group. - -### Keyword "block_devices" - -Optional String. Block devices to add to the volume group. - -### Keyword "partitions" - -Optional String. Partitions to add to the volume group. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## List all volume groups - -```bash -maas $PROFILE volume-groups read [--help] [-d] [-k] system_id [data ...] -``` - -### Positional arguments - -- system_id - -List all volume groups belonging to a machine with the given system_id. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - - diff --git a/rtd-docs/reference/cli-reference/zone.md b/rtd-docs/reference/cli-reference/zone.md deleted file mode 100644 index adba3f4731..0000000000 --- a/rtd-docs/reference/cli-reference/zone.md +++ /dev/null @@ -1,104 +0,0 @@ -# zone - -Enter keyword arguments in the form `key=value`. - -## Delete a zone - -```bash -maas $PROFILE zone delete [--help] [-d] [-k] name [data ...] -``` - -### Positional arguments - -- name - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Return a named zone - -```bash -maas $PROFILE zone read [--help] [-d] [-k] name [data ...] -``` - -### Positional arguments - -- name - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Update a zone's name or description - -```bash -maas $PROFILE zone update [--help] [-d] [-k] name [data ...] -``` - -### Positional arguments - -- name - -Note that only 'name' and 'description' parameters are honored. Others, such as 'resource-uri' or 'id' will be ignored. - -### Keyword "description" - -Optional String. A brief description of | the | new zone. | - -### Keyword "name" - -Optional String. The zone's new name. - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Create a new zone - -```bash -maas $PROFILE zones create [--help] [-d] [-k] [data ...] -``` - -### Keyword "name" Required. The new zone's name - -Type: String. - -### Keyword "description" - -Optional String. A brief description of | the | new zone. | - -### Command-line options - -| Option | Effect | -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | - -## Get a listing of all zones - -Note that there is always at least one zone called "default." - -```bash -maas $PROFILE zones read [--help] [-d] [-k] [data ...] -``` - -### Command-line options | Option | Effect | - -|-----|-----| -| --help, -h | Show this help message and exit. | -| -d, --debug | Display more information about API responses. | -| -k, --insecure | Disable SSL certificate check | diff --git a/rtd-docs/requirements-dev.txt b/rtd-docs/requirements-dev.txt new file mode 100644 index 0000000000..73e7ba4e62 --- /dev/null +++ b/rtd-docs/requirements-dev.txt @@ -0,0 +1,4 @@ +-r requirements.txt + +# Necessary to run our tests for the scripts +pytest==9.0.3 diff --git a/rtd-docs/requirements.txt b/rtd-docs/requirements.txt index f6fdebdfb2..08e75ba56b 100644 --- a/rtd-docs/requirements.txt +++ b/rtd-docs/requirements.txt @@ -117,3 +117,6 @@ uvicorn==0.42.0 watchfiles==1.1.1 webencodings==0.5.1 websockets==16.0 + +# Other dependencies for CLI documentation generation +httplib2==0.31.2