.. _vyos.rest.vyos_hostname_module:
***********************
vyos.rest.vyos_hostname
***********************
**Manage the system hostname on a VyOS device via the REST API.**
Version added: 1.0.0
.. contents::
:local:
:depth: 1
Synopsis
--------
- Manages the ``set system host-name`` configuration on a VyOS device using the HTTPS REST API.
- Mirrors the behaviour of ``vyos.vyos.vyos_hostname`` but uses the HTTP API instead of SSH/network_cli.
Requirements
------------
The below requirements are needed on the host that executes this module.
- VyOS 1.3+
Parameters
----------
.. raw:: html
| Parameter |
Choices/Defaults |
Comments |
|
api_key
string
/ required
|
|
API key configured on the device.
|
|
config
dictionary
|
|
Hostname configuration.
|
|
hostname
string
/ required
|
|
System hostname (max 63 characters, no underscores).
|
|
hostname
string
/ required
|
|
IP address or FQDN of the VyOS device.
|
|
port
integer
|
Default:
443
|
HTTPS port for the REST API.
|
|
state
string
|
Choices:
merged ←
- deleted
- gathered
|
merged - Ensure the hostname is set to the value in config.
deleted - Remove the configured hostname (resets to default).
gathered - Read the current hostname from the device and return it in gathered without making changes.
|
|
timeout
integer
|
Default:
30
|
Request timeout in seconds.
|
|
verify_ssl
boolean
|
|
Validate the device's TLS certificate.
|