Skip to content

Commit

Permalink
feat: Add default importer function to resources
Browse files Browse the repository at this point in the history
Fix #51
  • Loading branch information
Andreas Nieß committed Mar 14, 2021
1 parent 39ac08b commit 22c0538
Show file tree
Hide file tree
Showing 20 changed files with 109 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/resources/ipam_aggregate.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,11 @@ The ``tag`` block supports:

In addition to the above arguments, the following attributes are exported:
* ``id`` - The id (ref in Netbox) of this object.

## Import

Aggregates can be imported by `id` e.g.

```
$ terraform import netbox_ipam_aggregate.aggregate_test id
```
8 changes: 8 additions & 0 deletions docs/resources/ipam_ip_addresses.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,11 @@ The ``tag`` block supports:

In addition to the above arguments, the following attributes are exported:
* ``id`` - The id (ref in Netbox) of this object.

## Import

Ip addresses can be imported by `id` e.g.

```
$ terraform import netbox_ipam_ip_addresses.ip_test id
```
7 changes: 7 additions & 0 deletions docs/resources/ipam_prefix.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,10 @@ The ``tag`` block supports:
In addition to the above arguments, the following attributes are exported:
* ``id`` - The id (ref in Netbox) of this object.

## Import

Prefixes can be imported by `id` e.g.

```
$ terraform import netbox_ipam_prefix.prefix_test id
```
8 changes: 8 additions & 0 deletions docs/resources/ipam_service.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,11 @@ The ``tag`` block supports:

In addition to the above arguments, the following attributes are exported:
* ``id`` - The id (ref in Netbox) of this object.

## Import

Services can be imported by `id` e.g.

```
$ terraform import netbox_ipam_service.service_test id
```
8 changes: 8 additions & 0 deletions docs/resources/ipam_vlan.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,11 @@ The ``tag`` block supports:

In addition to the above arguments, the following attributes are exported:
* ``id`` - The id (ref in Netbox) of this object.

## Import

Vlans can be imported by `id` e.g.

```
$ terraform import netbox_ipam_vlan.vlan_test id
```
8 changes: 8 additions & 0 deletions docs/resources/ipam_vlan_group.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,11 @@ The following arguments are supported:

In addition to the above arguments, the following attributes are exported:
* ``id`` - The id (ref in Netbox) of this object.

## Import

Vlan groups can be imported by `id` e.g.

```
$ terraform import netbox_ipam_vlan_group.vlan_group_test id
```
8 changes: 8 additions & 0 deletions docs/resources/tenancy_tenant.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,11 @@ The ``tag`` block supports:

In addition to the above arguments, the following attributes are exported:
* ``id`` - The id (ref in Netbox) of this object.

## Import

Tenants can be imported by `id` e.g.

```
$ terraform import netbox_tenancy_tenant.tenant_test id
```
8 changes: 8 additions & 0 deletions docs/resources/tenancy_tenant_group.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,11 @@ The following arguments are supported:

In addition to the above arguments, the following attributes are exported:
* ``id`` - The id (ref in Netbox) of this object.

## Import

Tenant groups can be imported by `id` e.g.

```
$ terraform import netbox_tenancy_tenant_group.tenant_group_test id
```
8 changes: 8 additions & 0 deletions docs/resources/virtualization_interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,11 @@ The ``tag`` block supports:

In addition to the above arguments, the following attributes are exported:
* ``id`` - The id (ref in Netbox) of this object.

## Import

Virtualization interfaces can be imported by `id` e.g.

```
$ terraform import netbox_virtualization_interface.interface_test id
```
8 changes: 8 additions & 0 deletions docs/resources/virtualization_vm.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,11 @@ The ``tag`` block supports:

In addition to the above arguments, the following attributes are exported:
* ``id`` - The id (ref in Netbox) of this object.

## Import

Virtualization vms can be imported by `id` e.g.

```
$ terraform import netbox_virtualization_vm.vm_test id
```
3 changes: 3 additions & 0 deletions netbox/resource_netbox_ipam_aggregate.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ func resourceNetboxIpamAggregate() *schema.Resource {
Update: resourceNetboxIpamAggregateUpdate,
Delete: resourceNetboxIpamAggregateDelete,
Exists: resourceNetboxIpamAggregateExists,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},

Schema: map[string]*schema.Schema{
"custom_fields": {
Expand Down
3 changes: 3 additions & 0 deletions netbox/resource_netbox_ipam_ip_addresses.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ func resourceNetboxIpamIPAddresses() *schema.Resource {
Update: resourceNetboxIpamIPAddressesUpdate,
Delete: resourceNetboxIpamIPAddressesDelete,
Exists: resourceNetboxIpamIPAddressesExists,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},

Schema: map[string]*schema.Schema{
"address": {
Expand Down
3 changes: 3 additions & 0 deletions netbox/resource_netbox_ipam_prefix.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ func resourceNetboxIpamPrefix() *schema.Resource {
Update: resourceNetboxIpamPrefixUpdate,
Delete: resourceNetboxIpamPrefixDelete,
Exists: resourceNetboxIpamPrefixExists,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},

Schema: map[string]*schema.Schema{
"description": {
Expand Down
3 changes: 3 additions & 0 deletions netbox/resource_netbox_ipam_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ func resourceNetboxIpamService() *schema.Resource {
Update: resourceNetboxIpamServiceUpdate,
Delete: resourceNetboxIpamServiceDelete,
Exists: resourceNetboxIpamServiceExists,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},

Schema: map[string]*schema.Schema{
"custom_fields": {
Expand Down
3 changes: 3 additions & 0 deletions netbox/resource_netbox_ipam_vlan.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ func resourceNetboxIpamVlan() *schema.Resource {
Update: resourceNetboxIpamVlanUpdate,
Delete: resourceNetboxIpamVlanDelete,
Exists: resourceNetboxIpamVlanExists,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},

Schema: map[string]*schema.Schema{
"custom_fields": {
Expand Down
3 changes: 3 additions & 0 deletions netbox/resource_netbox_ipam_vlan_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ func resourceNetboxIpamVlanGroup() *schema.Resource {
Update: resourceNetboxIpamVlanGroupUpdate,
Delete: resourceNetboxIpamVlanGroupDelete,
Exists: resourceNetboxIpamVlanGroupExists,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},

Schema: map[string]*schema.Schema{
"name": {
Expand Down
3 changes: 3 additions & 0 deletions netbox/resource_netbox_tenancy_tenant.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ func resourceNetboxTenancyTenant() *schema.Resource {
Update: resourceNetboxTenancyTenantUpdate,
Delete: resourceNetboxTenancyTenantDelete,
Exists: resourceNetboxTenancyTenantExists,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},

Schema: map[string]*schema.Schema{
"comments": {
Expand Down
3 changes: 3 additions & 0 deletions netbox/resource_netbox_tenancy_tenant_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ func resourceNetboxTenancyTenantGroup() *schema.Resource {
Update: resourceNetboxTenancyTenantGroupUpdate,
Delete: resourceNetboxTenancyTenantGroupDelete,
Exists: resourceNetboxTenancyTenantGroupExists,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},

Schema: map[string]*schema.Schema{
"name": {
Expand Down
3 changes: 3 additions & 0 deletions netbox/resource_netbox_virtualization_interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ func resourceNetboxVirtualizationInterface() *schema.Resource {
Update: resourceNetboxVirtualizationInterfaceUpdate,
Delete: resourceNetboxVirtualizationInterfaceDelete,
Exists: resourceNetboxVirtualizationInterfaceExists,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},

Schema: map[string]*schema.Schema{
"description": {
Expand Down
3 changes: 3 additions & 0 deletions netbox/resource_netbox_virtualization_vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ func resourceNetboxVirtualizationVM() *schema.Resource {
Update: resourceNetboxVirtualizationVMUpdate,
Delete: resourceNetboxVirtualizationVMDelete,
Exists: resourceNetboxVirtualizationVMExists,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},

Schema: map[string]*schema.Schema{
"cluster_id": {
Expand Down

0 comments on commit 22c0538

Please sign in to comment.