noderings¶
Manage NodeRings resources: virtual machines, DNS, firewalls and SSH keys.
NodeRings is a cloud marketplace where independent hosting providers sell virtual machines through one account and one API.
- depends:
none beyond Salt
- configuration:
The module needs a NodeRings service account token. Put it in the minion configuration or in pillar:
noderings: token: <service account token> # optional organization_id: <organization id> api_url: https://api.noderings.com
Without
noderings:token, theNODERINGS_TOKENenvironment variable is used. Every function also acceptsprofileto read the settings from another key, for exampleprofile=noderings_staging.
- saltext.noderings.modules.noderings_mod.get_organization(profile='noderings')[source]¶
Return the organization the token belongs to.
CLI Example:
salt '*' noderings.get_organization
- saltext.noderings.modules.noderings_mod.get_credit_balance(profile='noderings')[source]¶
Return the organization’s prepaid credit balance. Hourly (usage-billed) servers draw from it.
CLI Example:
salt '*' noderings.get_credit_balance
- saltext.noderings.modules.noderings_mod.list_distros(profile='noderings')[source]¶
List the operating systems a VM can be installed with, as the names
create_vmtakes (for exampleubuntu_24_04).CLI Example:
salt '*' noderings.list_distros
- saltext.noderings.modules.noderings_mod.list_regions(profile='noderings')[source]¶
List the cities with servers for sale.
CLI Example:
salt '*' noderings.list_regions
- saltext.noderings.modules.noderings_mod.list_plans(country=None, city=None, billing_type=None, profile='noderings')[source]¶
List plan codes for sale, optionally in one city or of one billing type (
usage,subscriptionorfree).CLI Example:
salt '*' noderings.list_plans country="United States" city=Ashburn billing_type=usage
- saltext.noderings.modules.noderings_mod.list_offers(plan_code, country, city, billing_type='usage', sort='price', require_capabilities=None, profile='noderings')[source]¶
List the offers for a plan code in a city, best first. An offer is one provider’s plan, with its prices.
sortispriceorrating.CLI Example:
salt '*' noderings.list_offers SC-GC-1C-1G-20 "United States" Ashburn
- saltext.noderings.modules.noderings_mod.list_ssh_keys(profile='noderings')[source]¶
List the organization’s SSH keys.
CLI Example:
salt '*' noderings.list_ssh_keys
- saltext.noderings.modules.noderings_mod.get_ssh_key(name, profile='noderings')[source]¶
Return the SSH key with this name or ID, or
None.CLI Example:
salt '*' noderings.get_ssh_key laptop
- saltext.noderings.modules.noderings_mod.create_ssh_key(name, public_key, profile='noderings')[source]¶
Upload a public key. VMs get it as root’s authorized key.
CLI Example:
salt '*' noderings.create_ssh_key laptop "ssh-ed25519 AAAA... me@laptop"
- saltext.noderings.modules.noderings_mod.delete_ssh_key(name, profile='noderings')[source]¶
Delete an SSH key by name or ID. Returns
Falsewhen it does not exist.CLI Example:
salt '*' noderings.delete_ssh_key laptop
- saltext.noderings.modules.noderings_mod.list_zones(profile='noderings')[source]¶
List DNS zones.
CLI Example:
salt '*' noderings.list_zones
- saltext.noderings.modules.noderings_mod.get_zone(zone, profile='noderings')[source]¶
Return a DNS zone by name or ID, with its nameservers, or
None.CLI Example:
salt '*' noderings.get_zone example.com
- saltext.noderings.modules.noderings_mod.create_zone(zone, profile='noderings')[source]¶
Host a domain on NodeRings DNS. Set the returned nameservers at the registrar to make it live.
CLI Example:
salt '*' noderings.create_zone example.com
- saltext.noderings.modules.noderings_mod.delete_zone(zone, force=False, profile='noderings')[source]¶
Delete a DNS zone and all its records.
force=Truealso deletes a zone whose DS record is still at the registrar, which breaks resolution for validating resolvers. ReturnsFalsewhen it does not exist.CLI Example:
salt '*' noderings.delete_zone example.com
- saltext.noderings.modules.noderings_mod.list_records(zone, profile='noderings')[source]¶
List the records of a zone, one entry per name and type.
CLI Example:
salt '*' noderings.list_records example.com
- saltext.noderings.modules.noderings_mod.get_record(zone, name, rtype, profile='noderings')[source]¶
Return the records of one name and type, or
None.nameis relative to the zone (www,@for the apex) or fully qualified.CLI Example:
salt '*' noderings.get_record example.com www A
- saltext.noderings.modules.noderings_mod.set_record(zone, name, rtype, values, ttl=3600, profile='noderings')[source]¶
Create or replace the records of one name and type.
valuesis a list; hostnames should end with a dot, and TXT values are plain text without quotes.CLI Example:
salt '*' noderings.set_record example.com www A '["192.0.2.10"]' ttl=300 salt '*' noderings.set_record example.com @ MX '["10 mx1.example.net."]'
- saltext.noderings.modules.noderings_mod.delete_record(zone, name, rtype, profile='noderings')[source]¶
Delete the records of one name and type. Returns
Falsewhen there are none.CLI Example:
salt '*' noderings.delete_record example.com www A
- saltext.noderings.modules.noderings_mod.enable_dnssec(zone, profile='noderings')[source]¶
Sign a zone with DNSSEC and return the DS record to add at the registrar.
CLI Example:
salt '*' noderings.enable_dnssec example.com
- saltext.noderings.modules.noderings_mod.get_dnssec(zone, profile='noderings')[source]¶
Return the DNSSEC state of a zone, including its DS record.
CLI Example:
salt '*' noderings.get_dnssec example.com
- saltext.noderings.modules.noderings_mod.list_rulesets(profile='noderings')[source]¶
List firewall rulesets.
CLI Example:
salt '*' noderings.list_rulesets
- saltext.noderings.modules.noderings_mod.get_ruleset(ruleset, profile='noderings')[source]¶
Return a firewall ruleset by name or ID with its rules in order, or
None.CLI Example:
salt '*' noderings.get_ruleset web
- saltext.noderings.modules.noderings_mod.create_ruleset(ruleset, profile='noderings')[source]¶
Create an empty firewall ruleset.
CLI Example:
salt '*' noderings.create_ruleset web
- saltext.noderings.modules.noderings_mod.set_rules(ruleset, rules, profile='noderings')[source]¶
Make a ruleset hold exactly
rules, in this order. Rules run top to bottom; traffic that matches no rule is accepted, so end with a drop rule.Each rule is a mapping with
direction(ingressoregress),action(acceptordrop),protocol(defaulttcp),sourceanddestination(each withcidrs,address_groups,address_group_idsorvm_tags), anddestination_portsorsource_ports(one port such as443or one range such as8000-8100).CLI Example:
salt '*' noderings.set_rules web '[{"direction": "ingress", "action": "accept", "protocol": "tcp", "destination_ports": "22", "source": {"cidrs": ["0.0.0.0/0"]}}]'
- saltext.noderings.modules.noderings_mod.delete_ruleset(ruleset, force=False, profile='noderings')[source]¶
Delete a firewall ruleset.
force=Truealso deletes one that is still attached to VMs. ReturnsFalsewhen it does not exist.CLI Example:
salt '*' noderings.delete_ruleset web
- saltext.noderings.modules.noderings_mod.list_vms(tags=None, profile='noderings')[source]¶
List virtual machines, optionally only those with all of
tags.CLI Example:
salt '*' noderings.list_vms salt '*' noderings.list_vms tags='["web"]'
- saltext.noderings.modules.noderings_mod.get_vm(name, profile='noderings')[source]¶
Return a virtual machine by hostname or ID, or
None.CLI Example:
salt '*' noderings.get_vm web-1
- saltext.noderings.modules.noderings_mod.create_vm(name, plan_code=None, country=None, city=None, distro='ubuntu_24_04', billing_type='usage', ssh_keys=None, tags=None, firewall_ruleset=None, password=None, plan_id=None, region_id=None, provider_id=None, sort='price', wait=True, wait_timeout=900, profile='noderings')[source]¶
Order a virtual machine and return it once it is running.
Give either
plan_code,countryandcity(the cheapest matching offer is ordered, or the best rated withsort=rating), orplan_idandregion_idfromnoderings.list_offers.billing_type=usagebills by the hour from prepaid credit and stops when the VM is deleted.CLI Example:
salt '*' noderings.create_vm web-1 plan_code=SC-GC-1C-1G-20 country="United States" city=Ashburn ssh_keys='["laptop"]'
- saltext.noderings.modules.noderings_mod.delete_vm(name, profile='noderings')[source]¶
Delete a virtual machine. An hourly VM stops billing; a monthly subscription is cancelled without a refund. Returns
Falsewhen it does not exist.CLI Example:
salt '*' noderings.delete_vm web-1
- saltext.noderings.modules.noderings_mod.start_vm(name, wait=True, wait_timeout=900, profile='noderings')[source]¶
Start a stopped virtual machine.
CLI Example:
salt '*' noderings.start_vm web-1
- saltext.noderings.modules.noderings_mod.stop_vm(name, wait=True, wait_timeout=900, profile='noderings')[source]¶
Stop a virtual machine. Its disk and IP addresses are kept.
CLI Example:
salt '*' noderings.stop_vm web-1
- saltext.noderings.modules.noderings_mod.restart_vm(name, wait=True, wait_timeout=900, profile='noderings')[source]¶
Restart a virtual machine.
CLI Example:
salt '*' noderings.restart_vm web-1
- saltext.noderings.modules.noderings_mod.reinstall_vm(name, distro, ssh_keys=None, password=None, wait=True, wait_timeout=900, profile='noderings')[source]¶
Reinstall a virtual machine with another operating system. This erases the disk. The VM keeps its IP addresses.
CLI Example:
salt '*' noderings.reinstall_vm web-1 debian_13 ssh_keys='["laptop"]'
- saltext.noderings.modules.noderings_mod.attach_ruleset(name, ruleset, wait=True, wait_timeout=900, profile='noderings')[source]¶
Put a firewall ruleset in front of a virtual machine, replacing any other.
CLI Example:
salt '*' noderings.attach_ruleset web-1 web