30 Commits

Author SHA1 Message Date
Mateusz Filipowicz
b9284f7758 docs: improve documentation for 1.0.0 release (#75)
* docs: add examples and recreate TF documentation

* update readme

* add information about experimental support of firewall zones
2025-03-22 19:13:16 +01:00
Mateusz Filipowicz
b1688313c0 docs: improve provider documentation (#29)
* docs: improve provider documentation

* fix accidentally changed type of stormctrl_ucast_rate

* docs: add badges and plans to readme
2025-02-26 18:56:45 +01:00
Mateusz Filipowicz
e7164c0460 feat: add DNS record resource and datasources (#25)
* add DNS record

* revamp tests

* lint

* cleanup

* feat dns test

* chore: add DNS Record tests

* linting

* f
2025-02-26 01:17:59 +01:00
Mateusz Filipowicz
b7fe359f6c feat: support API Key authentication to UniFi controller (#22) 2025-02-23 19:51:18 +01:00
Paul Tyng
0401ae6913 Add support for port aggregation (#182)
* Add support for port aggregation

Fixes #142

* Return `*unifi.Device` from `allocateDevice`

* Merge `TestAccDevice_switch_portOverrides` and `TestAccDevice_remove_portOverrides`

* Add tests

Note that only switches with a Broadcom, Microsemi or Nephos chipset support both port mirroring and port aggregation.

```java
package com.ubnt.data;

public class Device extends X implements Sanitizable
{

  // ...

  public int getMaxMirrorSession() {
    int n = 0;
    if (this.getModel() == Model.\u00f8\u00f50000) {
      n = 2;
    }
    else if (this.isBroadcomSwitch() || this.isMicrosemiSwitch() || this.isMediaTekSwitch() || this.isNephosSwitch()) {
      n = 1;
    }
    return this.thisforObject().getInt("max_mirror_sessions", n);
  }

  public int getMaxAggregation() {
    int n = 0;
    if (this.isBroadcomSwitch() || this.isMicrosemiSwitch() || this.isNephosSwitch()) {
      n = 6;
    }
    return this.thisforObject().getInt("max_aggregate_sessions", n);
  }

  // ...

  public boolean isBroadcomSwitch() {
    final Model model = this.getModel();
    return model.getChipset().typeOf(Chipset.\u00f400000) && model.getType() == DeviceType.if;
  }

  public boolean isMicrosemiSwitch() {
    final Model model = this.getModel();
    return model.getChipset().typeOf(Chipset.o00000) && model.getType() == DeviceType.if;
  }

  public boolean isMediaTekSwitch() {
    final Model model = this.getModel();
    return model.getChipset().typeOf(Chipset.\u00d3O0000) && model.getType() == DeviceType.if;
  }

  public boolean isNephosSwitch() {
    final Model model = this.getModel();
    return model.getChipset().typeOf(Chipset.\u00d5O0000) && model.getType() == DeviceType.if;
  }

  // ...

}
```

To extract the list of models that use one of these chipsets I used the following script (executed as `java --class-path path/to/ace.jar main.java`):

```java
import com.ubnt.data.Model;

class UniFiModels {
  public static void main(String[] args) {
    /*
    for (Model model : Model.values()) {
      System.out.printf(
          "Model = %s\nSKU = %s\nType = %s\nFeatures = %s\nChipset = %s\nSysId = %s\nPortNum = %s\n\n",
          model,
          model.getSku(),
          model.getType(),
          model.getFeatures(),
          model.getChipset(),
          model.getSysId(),
          model.getPortNum());
    }
    */

    for (Model model : Model.values()) {
      System.out.printf("%s: %s (%s)\n", model.getChipset(), model, model.getSku());
    }
  }
}

```

---------

Co-authored-by: Joshua Spence <josh@spence.com.au>
2023-03-08 18:02:34 +11:00
Paul Tyng
d02c97bd55 Updates for controller v7.1 and dependency updates 2022-07-02 22:02:22 -04:00
Paul Tyng
28872f6fa5 Add PMF mode support to unifi_wlan 2021-09-16 09:19:48 -04:00
Paul Tyng
1ccbbc405a Update test to use unifi_ap_group 2021-09-16 08:56:37 -04:00
Paul Tyng
f38166b55c Add guide to docs for managing firewall rules across multiple sites 2021-09-13 08:56:51 -04:00
Paul Tyng
ede214c5c5 Add WPA3 support to unifi_wlan
Fixes #154
2021-09-10 15:29:03 -04:00
Tommi2Day
cfc0f57622 allow using id or name for unifi_network data source
Add sample and update docs along

implements #174
2021-09-07 18:25:42 -04:00
Tommi2Day
0c3a36b215 add data source unifi_user
implements #174
2021-09-07 18:25:42 -04:00
Kurt McAlpine
f468e4763e Implement unifi_setting_mgmt resource 2021-04-06 12:01:50 -04:00
Paul Tyng
60ff5eca1b Add unifi_dynamic_dns resource
Fixes #126
2021-03-28 14:54:50 -04:00
Paul Tyng
8c315dc5ce Add unifi_static_route
Fixes #42
2021-03-27 20:36:27 -04:00
Paul Tyng
118f612b49 Modify device a little to allow creation, add basic testing 2021-03-27 16:58:23 -04:00
Lyle Franklin
2694fcb3f5 Support importing networks by name (#113)
- E.g. `terraform import unifi_network.mynetwork name=LAN`
- Bumps cidr prefix in tests to avoid:
    Call to function "cidrsubnet" failed: prefix extension of 4 does not
    accommodate a subnet numbered 18.
2021-03-21 16:17:13 -04:00
wolf-cosmose
051ed9875e Add rudimentary support for resource unifi_device (#112) 2021-03-20 22:38:32 -04:00
Paul Tyng
2f1537b9a8 Support site import by name/short ID
Fixes #91
2021-03-07 14:30:16 -05:00
Paul Tyng
74e7b8500a Document firewall rule import
Fixes #93
2021-03-07 14:30:16 -05:00
Paul Tyng
9b94816903 Update example for v6 2021-02-22 13:00:39 -05:00
James Toyer
097aa6c225 Add examples for port profile 2021-02-22 12:53:21 -05:00
Chris Clonch
afa0ebf2a3 Add site import to docs (#90)
* Add site import to docs
* Add user_group import to docs
2021-01-11 09:31:47 -05:00
Kurt McAlpine
bfe4382722 Support importing networks and wlans from other sites 2020-11-03 19:20:26 -05:00
Ben Davies
cbc9bdc85f Added basic WAN support, including WAN type, network group, WAN IP, username and password 2020-10-21 09:35:29 -04:00
Kurt McAlpine
5379c8da64 Implement site resource 2020-10-20 13:53:32 -04:00
Paul Tyng
e60a4faa5f Add support for controller v6 2020-10-20 13:06:58 -04:00
Paul Tyng
f2314ac214 Fix some issues in examples so they run 2020-10-16 21:39:51 -04:00
Paul Tyng
46709ebf37 Docs updates, more examples, some tool updates
Change docs dirs based on registry expectations
2020-06-29 22:49:13 -04:00
Paul Tyng
accc02a8a5 Add examples / descriptions and generate website 2020-05-22 21:16:46 -04:00