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/v3/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,
is_pool: Optional[bool] = None,
available_prefix_id: Optional[str] = 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,
IsPool = false,
AvailablePrefixId = "string",
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),
IsPool: pulumi.Bool(false),
AvailablePrefixId: pulumi.String("string"),
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)
.status("string")
.prefixLength(0)
.roleId(0)
.markUtilized(false)
.isPool(false)
.availablePrefixId("string")
.siteId(0)
.description("string")
.tags("string")
.tenantId(0)
.vlanId(0)
.vrfId(0)
.build());
available_prefix_resource = netbox.AvailablePrefix("availablePrefixResource",
parent_prefix_id=0,
status="string",
prefix_length=0,
role_id=0,
mark_utilized=False,
is_pool=False,
available_prefix_id="string",
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,
isPool: false,
availablePrefixId: "string",
siteId: 0,
description: "string",
tags: ["string"],
tenantId: 0,
vlanId: 0,
vrfId: 0,
});
type: netbox:AvailablePrefix
properties:
availablePrefixId: string
description: string
isPool: false
markUtilized: false
parentPrefixId: 0
prefixLength: 0
roleId: 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 - Mark
Utilized bool - Role
Id double - Site
Id double - 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 - Mark
Utilized bool - Role
Id float64 - Site
Id float64 - []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 - mark
Utilized Boolean - role
Id Double - site
Id Double - 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 - mark
Utilized boolean - role
Id number - site
Id number - 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 - mark_
utilized bool - role_
id float - site_
id float - 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 - mark
Utilized Boolean - role
Id Number - site
Id Number - 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,
mark_utilized: Optional[bool] = None,
parent_prefix_id: Optional[float] = None,
prefix: Optional[str] = None,
prefix_length: Optional[float] = None,
role_id: Optional[float] = None,
site_id: Optional[float] = None,
status: Optional[str] = None,
tags: 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 - Mark
Utilized bool - Parent
Prefix doubleId - Prefix string
- Prefix
Length double - Role
Id double - Site
Id double - Status string
- Valid values are
active
,container
,reserved
anddeprecated
. - List<string>
- Tenant
Id double - Vlan
Id double - Vrf
Id double
- Available
Prefix stringId - The ID of this resource.
- Description string
- Is
Pool bool - Mark
Utilized bool - Parent
Prefix float64Id - Prefix string
- Prefix
Length float64 - Role
Id float64 - Site
Id float64 - Status string
- Valid values are
active
,container
,reserved
anddeprecated
. - []string
- Tenant
Id float64 - Vlan
Id float64 - Vrf
Id float64
- available
Prefix StringId - The ID of this resource.
- description String
- is
Pool Boolean - mark
Utilized Boolean - parent
Prefix DoubleId - prefix String
- prefix
Length Double - role
Id Double - site
Id Double - status String
- Valid values are
active
,container
,reserved
anddeprecated
. - List<String>
- tenant
Id Double - vlan
Id Double - vrf
Id Double
- available
Prefix stringId - The ID of this resource.
- description string
- is
Pool boolean - mark
Utilized boolean - parent
Prefix numberId - prefix string
- prefix
Length number - role
Id number - site
Id number - status string
- Valid values are
active
,container
,reserved
anddeprecated
. - string[]
- tenant
Id number - vlan
Id number - vrf
Id number
- available_
prefix_ strid - The ID of this resource.
- description str
- is_
pool bool - mark_
utilized bool - parent_
prefix_ floatid - prefix str
- prefix_
length float - role_
id float - site_
id float - status str
- Valid values are
active
,container
,reserved
anddeprecated
. - Sequence[str]
- tenant_
id float - vlan_
id float - vrf_
id float
- available
Prefix StringId - The ID of this resource.
- description String
- is
Pool Boolean - mark
Utilized Boolean - parent
Prefix NumberId - prefix String
- prefix
Length Number - role
Id Number - site
Id Number - status String
- Valid values are
active
,container
,reserved
anddeprecated
. - 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.