netbox.AvailablePrefix
Explore with Pulumi AI
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as netbox from "@pulumi/netbox";
const testPrefix = netbox.getPrefix({
cidr: "10.0.0.0/24",
});
const testAvailablePrefix = new netbox.AvailablePrefix("testAvailablePrefix", {
parentPrefixId: testPrefix.then(testPrefix => testPrefix.id),
prefixLength: 25,
status: "active",
});
import pulumi
import pulumi_netbox as netbox
test_prefix = netbox.get_prefix(cidr="10.0.0.0/24")
test_available_prefix = netbox.AvailablePrefix("testAvailablePrefix",
parent_prefix_id=test_prefix.id,
prefix_length=25,
status="active")
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/netbox/v4/netbox"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
testPrefix, err := netbox.LookupPrefix(ctx, &netbox.LookupPrefixArgs{
Cidr: pulumi.StringRef("10.0.0.0/24"),
}, nil)
if err != nil {
return err
}
_, err = netbox.NewAvailablePrefix(ctx, "testAvailablePrefix", &netbox.AvailablePrefixArgs{
ParentPrefixId: pulumi.Float64(testPrefix.Id),
PrefixLength: pulumi.Float64(25),
Status: pulumi.String("active"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Netbox = Pulumi.Netbox;
return await Deployment.RunAsync(() =>
{
var testPrefix = Netbox.GetPrefix.Invoke(new()
{
Cidr = "10.0.0.0/24",
});
var testAvailablePrefix = new Netbox.AvailablePrefix("testAvailablePrefix", new()
{
ParentPrefixId = testPrefix.Apply(getPrefixResult => getPrefixResult.Id),
PrefixLength = 25,
Status = "active",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.netbox.NetboxFunctions;
import com.pulumi.netbox.inputs.GetPrefixArgs;
import com.pulumi.netbox.AvailablePrefix;
import com.pulumi.netbox.AvailablePrefixArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var testPrefix = NetboxFunctions.getPrefix(GetPrefixArgs.builder()
.cidr("10.0.0.0/24")
.build());
var testAvailablePrefix = new AvailablePrefix("testAvailablePrefix", AvailablePrefixArgs.builder()
.parentPrefixId(testPrefix.applyValue(getPrefixResult -> getPrefixResult.id()))
.prefixLength(25)
.status("active")
.build());
}
}
resources:
testAvailablePrefix:
type: netbox:AvailablePrefix
properties:
parentPrefixId: ${testPrefix.id}
prefixLength: 25
status: active
variables:
testPrefix:
fn::invoke:
function: netbox:getPrefix
arguments:
cidr: 10.0.0.0/24
Create AvailablePrefix Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new AvailablePrefix(name: string, args: AvailablePrefixArgs, opts?: CustomResourceOptions);
@overload
def AvailablePrefix(resource_name: str,
args: AvailablePrefixArgs,
opts: Optional[ResourceOptions] = None)
@overload
def AvailablePrefix(resource_name: str,
opts: Optional[ResourceOptions] = None,
parent_prefix_id: Optional[float] = None,
status: Optional[str] = None,
prefix_length: Optional[float] = None,
role_id: Optional[float] = None,
mark_utilized: Optional[bool] = None,
location_id: Optional[float] = None,
is_pool: Optional[bool] = None,
region_id: Optional[float] = None,
available_prefix_id: Optional[str] = None,
site_group_id: Optional[float] = None,
site_id: Optional[float] = None,
description: Optional[str] = None,
tags: Optional[Sequence[str]] = None,
tenant_id: Optional[float] = None,
vlan_id: Optional[float] = None,
vrf_id: Optional[float] = None)
func NewAvailablePrefix(ctx *Context, name string, args AvailablePrefixArgs, opts ...ResourceOption) (*AvailablePrefix, error)
public AvailablePrefix(string name, AvailablePrefixArgs args, CustomResourceOptions? opts = null)
public AvailablePrefix(String name, AvailablePrefixArgs args)
public AvailablePrefix(String name, AvailablePrefixArgs args, CustomResourceOptions options)
type: netbox:AvailablePrefix
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args AvailablePrefixArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args AvailablePrefixArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args AvailablePrefixArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args AvailablePrefixArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args AvailablePrefixArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var availablePrefixResource = new Netbox.AvailablePrefix("availablePrefixResource", new()
{
ParentPrefixId = 0,
Status = "string",
PrefixLength = 0,
RoleId = 0,
MarkUtilized = false,
LocationId = 0,
IsPool = false,
RegionId = 0,
AvailablePrefixId = "string",
SiteGroupId = 0,
SiteId = 0,
Description = "string",
Tags = new[]
{
"string",
},
TenantId = 0,
VlanId = 0,
VrfId = 0,
});
example, err := netbox.NewAvailablePrefix(ctx, "availablePrefixResource", &netbox.AvailablePrefixArgs{
ParentPrefixId: pulumi.Float64(0),
Status: pulumi.String("string"),
PrefixLength: pulumi.Float64(0),
RoleId: pulumi.Float64(0),
MarkUtilized: pulumi.Bool(false),
LocationId: pulumi.Float64(0),
IsPool: pulumi.Bool(false),
RegionId: pulumi.Float64(0),
AvailablePrefixId: pulumi.String("string"),
SiteGroupId: pulumi.Float64(0),
SiteId: pulumi.Float64(0),
Description: pulumi.String("string"),
Tags: pulumi.StringArray{
pulumi.String("string"),
},
TenantId: pulumi.Float64(0),
VlanId: pulumi.Float64(0),
VrfId: pulumi.Float64(0),
})
var availablePrefixResource = new AvailablePrefix("availablePrefixResource", AvailablePrefixArgs.builder()
.parentPrefixId(0.0)
.status("string")
.prefixLength(0.0)
.roleId(0.0)
.markUtilized(false)
.locationId(0.0)
.isPool(false)
.regionId(0.0)
.availablePrefixId("string")
.siteGroupId(0.0)
.siteId(0.0)
.description("string")
.tags("string")
.tenantId(0.0)
.vlanId(0.0)
.vrfId(0.0)
.build());
available_prefix_resource = netbox.AvailablePrefix("availablePrefixResource",
parent_prefix_id=0,
status="string",
prefix_length=0,
role_id=0,
mark_utilized=False,
location_id=0,
is_pool=False,
region_id=0,
available_prefix_id="string",
site_group_id=0,
site_id=0,
description="string",
tags=["string"],
tenant_id=0,
vlan_id=0,
vrf_id=0)
const availablePrefixResource = new netbox.AvailablePrefix("availablePrefixResource", {
parentPrefixId: 0,
status: "string",
prefixLength: 0,
roleId: 0,
markUtilized: false,
locationId: 0,
isPool: false,
regionId: 0,
availablePrefixId: "string",
siteGroupId: 0,
siteId: 0,
description: "string",
tags: ["string"],
tenantId: 0,
vlanId: 0,
vrfId: 0,
});
type: netbox:AvailablePrefix
properties:
availablePrefixId: string
description: string
isPool: false
locationId: 0
markUtilized: false
parentPrefixId: 0
prefixLength: 0
regionId: 0
roleId: 0
siteGroupId: 0
siteId: 0
status: string
tags:
- string
tenantId: 0
vlanId: 0
vrfId: 0
AvailablePrefix Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The AvailablePrefix resource accepts the following input properties:
- Parent
Prefix doubleId - Prefix
Length double - Status string
- Valid values are
active
,container
,reserved
anddeprecated
. - Available
Prefix stringId - The ID of this resource.
- Description string
- Is
Pool bool - Location
Id double - Conflicts with
site_id
,site_group_id
andregion_id
. - Mark
Utilized bool - Region
Id double - Conflicts with
location_id
,site_id
andsite_group_id
. - Role
Id double - Site
Group doubleId - Conflicts with
location_id
,site_id
andregion_id
. - Site
Id double - Conflicts with
location_id
,site_group_id
andregion_id
. - List<string>
- Tenant
Id double - Vlan
Id double - Vrf
Id double
- Parent
Prefix float64Id - Prefix
Length float64 - Status string
- Valid values are
active
,container
,reserved
anddeprecated
. - Available
Prefix stringId - The ID of this resource.
- Description string
- Is
Pool bool - Location
Id float64 - Conflicts with
site_id
,site_group_id
andregion_id
. - Mark
Utilized bool - Region
Id float64 - Conflicts with
location_id
,site_id
andsite_group_id
. - Role
Id float64 - Site
Group float64Id - Conflicts with
location_id
,site_id
andregion_id
. - Site
Id float64 - Conflicts with
location_id
,site_group_id
andregion_id
. - []string
- Tenant
Id float64 - Vlan
Id float64 - Vrf
Id float64
- parent
Prefix DoubleId - prefix
Length Double - status String
- Valid values are
active
,container
,reserved
anddeprecated
. - available
Prefix StringId - The ID of this resource.
- description String
- is
Pool Boolean - location
Id Double - Conflicts with
site_id
,site_group_id
andregion_id
. - mark
Utilized Boolean - region
Id Double - Conflicts with
location_id
,site_id
andsite_group_id
. - role
Id Double - site
Group DoubleId - Conflicts with
location_id
,site_id
andregion_id
. - site
Id Double - Conflicts with
location_id
,site_group_id
andregion_id
. - List<String>
- tenant
Id Double - vlan
Id Double - vrf
Id Double
- parent
Prefix numberId - prefix
Length number - status string
- Valid values are
active
,container
,reserved
anddeprecated
. - available
Prefix stringId - The ID of this resource.
- description string
- is
Pool boolean - location
Id number - Conflicts with
site_id
,site_group_id
andregion_id
. - mark
Utilized boolean - region
Id number - Conflicts with
location_id
,site_id
andsite_group_id
. - role
Id number - site
Group numberId - Conflicts with
location_id
,site_id
andregion_id
. - site
Id number - Conflicts with
location_id
,site_group_id
andregion_id
. - string[]
- tenant
Id number - vlan
Id number - vrf
Id number
- parent_
prefix_ floatid - prefix_
length float - status str
- Valid values are
active
,container
,reserved
anddeprecated
. - available_
prefix_ strid - The ID of this resource.
- description str
- is_
pool bool - location_
id float - Conflicts with
site_id
,site_group_id
andregion_id
. - mark_
utilized bool - region_
id float - Conflicts with
location_id
,site_id
andsite_group_id
. - role_
id float - site_
group_ floatid - Conflicts with
location_id
,site_id
andregion_id
. - site_
id float - Conflicts with
location_id
,site_group_id
andregion_id
. - Sequence[str]
- tenant_
id float - vlan_
id float - vrf_
id float
- parent
Prefix NumberId - prefix
Length Number - status String
- Valid values are
active
,container
,reserved
anddeprecated
. - available
Prefix StringId - The ID of this resource.
- description String
- is
Pool Boolean - location
Id Number - Conflicts with
site_id
,site_group_id
andregion_id
. - mark
Utilized Boolean - region
Id Number - Conflicts with
location_id
,site_id
andsite_group_id
. - role
Id Number - site
Group NumberId - Conflicts with
location_id
,site_id
andregion_id
. - site
Id Number - Conflicts with
location_id
,site_group_id
andregion_id
. - List<String>
- tenant
Id Number - vlan
Id Number - vrf
Id Number
Outputs
All input properties are implicitly available as output properties. Additionally, the AvailablePrefix resource produces the following output properties:
Look up Existing AvailablePrefix Resource
Get an existing AvailablePrefix resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: AvailablePrefixState, opts?: CustomResourceOptions): AvailablePrefix
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
available_prefix_id: Optional[str] = None,
description: Optional[str] = None,
is_pool: Optional[bool] = None,
location_id: Optional[float] = None,
mark_utilized: Optional[bool] = None,
parent_prefix_id: Optional[float] = None,
prefix: Optional[str] = None,
prefix_length: Optional[float] = None,
region_id: Optional[float] = None,
role_id: Optional[float] = None,
site_group_id: Optional[float] = None,
site_id: Optional[float] = None,
status: Optional[str] = None,
tags: Optional[Sequence[str]] = None,
tags_alls: Optional[Sequence[str]] = None,
tenant_id: Optional[float] = None,
vlan_id: Optional[float] = None,
vrf_id: Optional[float] = None) -> AvailablePrefix
func GetAvailablePrefix(ctx *Context, name string, id IDInput, state *AvailablePrefixState, opts ...ResourceOption) (*AvailablePrefix, error)
public static AvailablePrefix Get(string name, Input<string> id, AvailablePrefixState? state, CustomResourceOptions? opts = null)
public static AvailablePrefix get(String name, Output<String> id, AvailablePrefixState state, CustomResourceOptions options)
resources: _: type: netbox:AvailablePrefix get: id: ${id}
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Available
Prefix stringId - The ID of this resource.
- Description string
- Is
Pool bool - Location
Id double - Conflicts with
site_id
,site_group_id
andregion_id
. - Mark
Utilized bool - Parent
Prefix doubleId - Prefix string
- Prefix
Length double - Region
Id double - Conflicts with
location_id
,site_id
andsite_group_id
. - Role
Id double - Site
Group doubleId - Conflicts with
location_id
,site_id
andregion_id
. - Site
Id double - Conflicts with
location_id
,site_group_id
andregion_id
. - Status string
- Valid values are
active
,container
,reserved
anddeprecated
. - List<string>
- List<string>
- Tenant
Id double - Vlan
Id double - Vrf
Id double
- Available
Prefix stringId - The ID of this resource.
- Description string
- Is
Pool bool - Location
Id float64 - Conflicts with
site_id
,site_group_id
andregion_id
. - Mark
Utilized bool - Parent
Prefix float64Id - Prefix string
- Prefix
Length float64 - Region
Id float64 - Conflicts with
location_id
,site_id
andsite_group_id
. - Role
Id float64 - Site
Group float64Id - Conflicts with
location_id
,site_id
andregion_id
. - Site
Id float64 - Conflicts with
location_id
,site_group_id
andregion_id
. - Status string
- Valid values are
active
,container
,reserved
anddeprecated
. - []string
- []string
- Tenant
Id float64 - Vlan
Id float64 - Vrf
Id float64
- available
Prefix StringId - The ID of this resource.
- description String
- is
Pool Boolean - location
Id Double - Conflicts with
site_id
,site_group_id
andregion_id
. - mark
Utilized Boolean - parent
Prefix DoubleId - prefix String
- prefix
Length Double - region
Id Double - Conflicts with
location_id
,site_id
andsite_group_id
. - role
Id Double - site
Group DoubleId - Conflicts with
location_id
,site_id
andregion_id
. - site
Id Double - Conflicts with
location_id
,site_group_id
andregion_id
. - status String
- Valid values are
active
,container
,reserved
anddeprecated
. - List<String>
- List<String>
- tenant
Id Double - vlan
Id Double - vrf
Id Double
- available
Prefix stringId - The ID of this resource.
- description string
- is
Pool boolean - location
Id number - Conflicts with
site_id
,site_group_id
andregion_id
. - mark
Utilized boolean - parent
Prefix numberId - prefix string
- prefix
Length number - region
Id number - Conflicts with
location_id
,site_id
andsite_group_id
. - role
Id number - site
Group numberId - Conflicts with
location_id
,site_id
andregion_id
. - site
Id number - Conflicts with
location_id
,site_group_id
andregion_id
. - status string
- Valid values are
active
,container
,reserved
anddeprecated
. - string[]
- string[]
- tenant
Id number - vlan
Id number - vrf
Id number
- available_
prefix_ strid - The ID of this resource.
- description str
- is_
pool bool - location_
id float - Conflicts with
site_id
,site_group_id
andregion_id
. - mark_
utilized bool - parent_
prefix_ floatid - prefix str
- prefix_
length float - region_
id float - Conflicts with
location_id
,site_id
andsite_group_id
. - role_
id float - site_
group_ floatid - Conflicts with
location_id
,site_id
andregion_id
. - site_
id float - Conflicts with
location_id
,site_group_id
andregion_id
. - status str
- Valid values are
active
,container
,reserved
anddeprecated
. - Sequence[str]
- Sequence[str]
- tenant_
id float - vlan_
id float - vrf_
id float
- available
Prefix StringId - The ID of this resource.
- description String
- is
Pool Boolean - location
Id Number - Conflicts with
site_id
,site_group_id
andregion_id
. - mark
Utilized Boolean - parent
Prefix NumberId - prefix String
- prefix
Length Number - region
Id Number - Conflicts with
location_id
,site_id
andsite_group_id
. - role
Id Number - site
Group NumberId - Conflicts with
location_id
,site_id
andregion_id
. - site
Id Number - Conflicts with
location_id
,site_group_id
andregion_id
. - status String
- Valid values are
active
,container
,reserved
anddeprecated
. - List<String>
- List<String>
- tenant
Id Number - vlan
Id Number - vrf
Id Number
Package Details
- Repository
- netbox e-breuninger/terraform-provider-netbox
- License
- Notes
- This Pulumi package is based on the
netbox
Terraform Provider.