infra_mgmt

package
v1.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 8, 2024 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var InfraHostAttrTypes = map[string]attr.Type{
	"configs":              types.ListType{ElemType: types.ObjectType{AttrTypes: InfraServiceHostConfigAttrTypes}},
	"connectivity_monitor": types.MapType{ElemType: types.StringType},
	"created_at":           timetypes.RFC3339Type{},
	"created_by":           types.StringType,
	"description":          types.StringType,
	"display_name":         types.StringType,
	"host_subtype":         types.StringType,
	"host_type":            types.StringType,
	"host_version":         types.StringType,
	"id":                   types.StringType,
	"ip_address":           types.StringType,
	"ip_space":             types.StringType,
	"legacy_id":            types.StringType,
	"location_id":          types.StringType,
	"mac_address":          types.StringType,
	"maintenance_mode":     types.StringType,
	"nat_ip":               types.StringType,
	"noa_cluster":          types.StringType,
	"ophid":                types.StringType,
	"pool_id":              types.StringType,
	"serial_number":        types.StringType,
	"tags":                 types.MapType{ElemType: types.StringType},
	"tags_all":             types.MapType{ElemType: types.StringType},
	"timezone":             types.StringType,
	"updated_at":           timetypes.RFC3339Type{},
}
View Source
var InfraHostResourceSchemaAttributes = map[string]schema.Attribute{
	"configs": schema.ListNestedAttribute{
		NestedObject: schema.NestedAttributeObject{
			Attributes: InfraServiceHostConfigResourceSchemaAttributes,
		},
		Computed:            true,
		MarkdownDescription: "The list of Host-specific configurations for each Service deployed on this Host.",
	},
	"connectivity_monitor": schema.MapAttribute{
		ElementType: types.StringType,
		Computed:    true,
		MarkdownDescription: "Represents the connectivity monitor properties of a Host, to enable/disable connectivity monitoring for redundant network interfaces.\n\n" +
			"  The \"endpoint_type\" is:\n" +
			"  - `\"csp\"` for enabling monitoring\n" +
			"  - `\"\"` for disabling monitoring (default)\n\n" +
			"  Note: Currently, all fields except \"endpoint_type\" are read-only, and will be overridden to default values in case they are edited.\n\n" +
			"  Example:\n" +
			"  ```\n{\n    \"connectivity_monitor\": {\n      \"cost\":1000000,\n      \"endpoint_type\":\"csp\",\n      \"endpoint\":\"http://csp.infoblox.com\",\n      \"interval\":15,\n      \"failure_threshold\":1,\n      \"success_threshold\":2\n    }\n  }\n```",
	},
	"created_at": schema.StringAttribute{
		CustomType:          timetypes.RFC3339Type{},
		Computed:            true,
		MarkdownDescription: "The timestamp of creation of Host.",
	},
	"created_by": schema.StringAttribute{
		Computed:            true,
		MarkdownDescription: "The creator of the Host (internal use only).",
	},
	"description": schema.StringAttribute{
		Optional:            true,
		MarkdownDescription: "The description of the Host (optional).",
	},
	"display_name": schema.StringAttribute{
		Required:            true,
		MarkdownDescription: "The name of the Host (unique).",
	},
	"host_subtype": schema.StringAttribute{
		Computed:            true,
		MarkdownDescription: "The sub-type of a specific Host type.  Example: For Host type BloxOne Appliance, sub-type could be \"B105\" or \"VEP1425\"",
	},
	"host_type": schema.StringAttribute{
		Computed:            true,
		MarkdownDescription: "The type of Host.  Should be one of: 1. NIOS , 2. NIOS HA, 3. BloxOne VM , 4. BloxOne Appliance, 5. BloxOne Container, 6. CNIOS",
	},
	"host_version": schema.StringAttribute{
		Computed:            true,
		MarkdownDescription: "The version of the Host platform services.",
	},
	"id": schema.StringAttribute{
		Computed:            true,
		MarkdownDescription: "The resource identifier.",
		PlanModifiers: []planmodifier.String{
			stringplanmodifier.UseStateForUnknown(),
		},
	},
	"ip_address": schema.StringAttribute{
		Computed:            true,
		MarkdownDescription: "The IP address of the Host.",
	},
	"ip_space": schema.StringAttribute{
		Optional:            true,
		MarkdownDescription: "The IP Space of the Host.",
	},
	"legacy_id": schema.StringAttribute{
		Computed:            true,
		MarkdownDescription: "The legacy Host object identifier.",
	},
	"location_id": schema.StringAttribute{
		Optional:            true,
		MarkdownDescription: "The resource identifier.",
	},
	"mac_address": schema.StringAttribute{
		Computed:            true,
		MarkdownDescription: "The MAC address of the Host.",
	},
	"maintenance_mode": schema.StringAttribute{
		Optional: true,
		Computed: true,
		Default:  stringdefault.StaticString("disabled"),
	},
	"nat_ip": schema.StringAttribute{
		Computed:            true,
		MarkdownDescription: "The NAT IP address of the Host.",
	},
	"noa_cluster": schema.StringAttribute{
		Computed:            true,
		MarkdownDescription: "The CSP cluster identifier (internal use only).",
	},
	"ophid": schema.StringAttribute{
		Computed:            true,
		MarkdownDescription: "The unique On-Prem Host ID generated by the On-Prem device and assigned to the Host once it is registered and logged into the Infoblox Cloud.",
	},
	"pool_id": schema.StringAttribute{
		Optional: true,
		Computed: true,
		PlanModifiers: []planmodifier.String{
			stringplanmodifier.UseStateForUnknown(),
		},
		MarkdownDescription: "The resource identifier.",
	},
	"serial_number": schema.StringAttribute{
		Optional:            true,
		MarkdownDescription: "The unique serial number of the Host.",
	},
	"tags": schema.MapAttribute{
		ElementType:         types.StringType,
		Optional:            true,
		Computed:            true,
		Default:             mapdefault.StaticValue(types.MapNull(types.StringType)),
		MarkdownDescription: "Tags associated with this Host.",
	},
	"tags_all": schema.MapAttribute{
		ElementType:         types.StringType,
		Computed:            true,
		MarkdownDescription: "Tags associated with this Host including default tags.",
	},
	"timezone": schema.StringAttribute{
		Computed:            true,
		MarkdownDescription: "The timezone of the Host.",
	},
	"updated_at": schema.StringAttribute{
		CustomType:          timetypes.RFC3339Type{},
		Computed:            true,
		MarkdownDescription: "The timestamp of the latest update on Host.",
	},
}
View Source
var InfraServiceAttrTypes = map[string]attr.Type{
	"configs":          types.ListType{ElemType: types.ObjectType{AttrTypes: InfraServiceHostConfigAttrTypes}},
	"created_at":       timetypes.RFC3339Type{},
	"description":      types.StringType,
	"desired_state":    types.StringType,
	"desired_version":  types.StringType,
	"id":               types.StringType,
	"interface_labels": types.ListType{ElemType: types.StringType},
	"name":             types.StringType,
	"pool_id":          types.StringType,
	"service_type":     types.StringType,
	"tags":             types.MapType{ElemType: types.StringType},
	"tags_all":         types.MapType{ElemType: types.StringType},
	"updated_at":       timetypes.RFC3339Type{},
}
View Source
var InfraServiceHostConfigAttrTypes = map[string]attr.Type{
	"current_version": types.StringType,
	"extra_data":      types.StringType,
	"host_id":         types.StringType,
	"id":              types.StringType,
	"service_id":      types.StringType,
	"service_type":    types.StringType,
	"upgraded_at":     timetypes.RFC3339Type{},
}
View Source
var InfraServiceHostConfigResourceSchemaAttributes = map[string]schema.Attribute{
	"current_version": schema.StringAttribute{
		Optional:            true,
		MarkdownDescription: "The current version of the Service deployed on the Host.",
	},
	"extra_data": schema.StringAttribute{
		Optional:            true,
		MarkdownDescription: "The field to carry any extra data specific to this configuration.",
	},
	"host_id": schema.StringAttribute{
		Optional:            true,
		MarkdownDescription: "The resource identifier.",
	},
	"id": schema.StringAttribute{
		Computed:            true,
		MarkdownDescription: "The resource identifier.",
	},
	"service_id": schema.StringAttribute{
		Optional:            true,
		MarkdownDescription: "The resource identifier.",
	},
	"service_type": schema.StringAttribute{
		Optional:            true,
		MarkdownDescription: "The type of the Service deployed on the Host (`dns`, `cdc`, etc.). The following is a list of the different Services and their string types (the string types are to be used with the APIs for the `service_type` field):\n\n  | Service name | Service type | \n  | ------ | ------ | \n  | Access Authentication | authn | \n  | Anycast | anycast | \n  | Data Connector | cdc | \n  | DHCP | dhcp | \n  | DNS | dns | \n  | DNS Forwarding Proxy | dfp | \n  | NIOS Grid Connector | orpheus | \n  | MS AD Sync | msad | \n  | NTP | ntp | \n  | BGP | bgp | \n  | RIP | rip | \n  | OSPF | ospf | \n",
	},
	"upgraded_at": schema.StringAttribute{
		CustomType:          timetypes.RFC3339Type{},
		Optional:            true,
		MarkdownDescription: "The timestamp of the latest upgrade of the Host-specific Service configuration.",
	},
}

Functions

func DataSourceFlattenInfraHost added in v1.3.0

func DataSourceFlattenInfraHost(ctx context.Context, from *inframgmt.Host, diags *diag.Diagnostics) types.Object

func DataSourceFlattenInfraService added in v1.3.0

func DataSourceFlattenInfraService(ctx context.Context, from *inframgmt.Service, diags *diag.Diagnostics) types.Object

func ExpandInfraHost

func ExpandInfraHost(ctx context.Context, o types.Object, diags *diag.Diagnostics) *inframgmt.Host

func ExpandInfraService

func ExpandInfraService(ctx context.Context, o types.Object, diags *diag.Diagnostics) *inframgmt.Service

func ExpandInfraServiceHostConfig

func ExpandInfraServiceHostConfig(ctx context.Context, o types.Object, diags *diag.Diagnostics) *inframgmt.ServiceHostConfig

func FlattenInfraServiceHostConfig

func FlattenInfraServiceHostConfig(ctx context.Context, from *inframgmt.ServiceHostConfig, diags *diag.Diagnostics) types.Object

func InfraServiceResourceSchemaAttributes

func InfraServiceResourceSchemaAttributes() map[string]schema.Attribute

func InfraServiceResourceSchemaAttributesWithTimeouts

func InfraServiceResourceSchemaAttributesWithTimeouts(ctx context.Context) map[string]schema.Attribute

func NewHostsDataSource

func NewHostsDataSource() datasource.DataSource

func NewHostsResource

func NewHostsResource() resource.Resource

func NewServicesDataSource

func NewServicesDataSource() datasource.DataSource

func NewServicesResource

func NewServicesResource() resource.Resource

Types

type HostsDataSource

type HostsDataSource struct {
	// contains filtered or unexported fields
}

HostsDataSource defines the data source implementation.

func (*HostsDataSource) Configure

func (*HostsDataSource) Metadata

func (*HostsDataSource) Read

func (*HostsDataSource) Schema

type HostsResource

type HostsResource struct {
	// contains filtered or unexported fields
}

HostsResource defines the resource implementation.

func (*HostsResource) Configure

func (*HostsResource) Create

func (*HostsResource) Delete

func (*HostsResource) ImportState

func (*HostsResource) Metadata

func (*HostsResource) Read

func (*HostsResource) Schema

func (*HostsResource) Update

type InfraHostModel

type InfraHostModel struct {
	Configs             types.List        `tfsdk:"configs"`
	ConnectivityMonitor types.Map         `tfsdk:"connectivity_monitor"`
	CreatedAt           timetypes.RFC3339 `tfsdk:"created_at"`
	CreatedBy           types.String      `tfsdk:"created_by"`
	Description         types.String      `tfsdk:"description"`
	DisplayName         types.String      `tfsdk:"display_name"`
	HostSubtype         types.String      `tfsdk:"host_subtype"`
	HostType            types.String      `tfsdk:"host_type"`
	HostVersion         types.String      `tfsdk:"host_version"`
	Id                  types.String      `tfsdk:"id"`
	IpAddress           types.String      `tfsdk:"ip_address"`
	IpSpace             types.String      `tfsdk:"ip_space"`
	LegacyId            types.String      `tfsdk:"legacy_id"`
	LocationId          types.String      `tfsdk:"location_id"`
	MacAddress          types.String      `tfsdk:"mac_address"`
	MaintenanceMode     types.String      `tfsdk:"maintenance_mode"`
	NatIp               types.String      `tfsdk:"nat_ip"`
	NoaCluster          types.String      `tfsdk:"noa_cluster"`
	Ophid               types.String      `tfsdk:"ophid"`
	PoolId              types.String      `tfsdk:"pool_id"`
	SerialNumber        types.String      `tfsdk:"serial_number"`
	Tags                types.Map         `tfsdk:"tags"`
	TagsAll             types.Map         `tfsdk:"tags_all"`
	Timezone            types.String      `tfsdk:"timezone"`
	UpdatedAt           timetypes.RFC3339 `tfsdk:"updated_at"`
}

func (*InfraHostModel) Expand

func (m *InfraHostModel) Expand(ctx context.Context, diags *diag.Diagnostics) *inframgmt.Host

func (*InfraHostModel) Flatten

func (m *InfraHostModel) Flatten(ctx context.Context, from *inframgmt.Host, diags *diag.Diagnostics)

type InfraHostModelWithFilter

type InfraHostModelWithFilter struct {
	Filters         types.Map      `tfsdk:"filters"`
	TagFilters      types.Map      `tfsdk:"tag_filters"`
	Results         types.List     `tfsdk:"results"`
	RetryIfNotFound types.Bool     `tfsdk:"retry_if_not_found"`
	Timeouts        timeouts.Value `tfsdk:"timeouts"`
}

func (*InfraHostModelWithFilter) FlattenResults

func (m *InfraHostModelWithFilter) FlattenResults(ctx context.Context, from []inframgmt.Host, diags *diag.Diagnostics)

type InfraServiceHostConfigModel

type InfraServiceHostConfigModel struct {
	CurrentVersion types.String      `tfsdk:"current_version"`
	ExtraData      types.String      `tfsdk:"extra_data"`
	HostId         types.String      `tfsdk:"host_id"`
	Id             types.String      `tfsdk:"id"`
	ServiceId      types.String      `tfsdk:"service_id"`
	ServiceType    types.String      `tfsdk:"service_type"`
	UpgradedAt     timetypes.RFC3339 `tfsdk:"upgraded_at"`
}

func (*InfraServiceHostConfigModel) Expand

func (*InfraServiceHostConfigModel) Flatten

type InfraServiceModel

type InfraServiceModel struct {
	Configs         types.List        `tfsdk:"configs"`
	CreatedAt       timetypes.RFC3339 `tfsdk:"created_at"`
	Description     types.String      `tfsdk:"description"`
	DesiredState    types.String      `tfsdk:"desired_state"`
	DesiredVersion  types.String      `tfsdk:"desired_version"`
	Id              types.String      `tfsdk:"id"`
	InterfaceLabels types.List        `tfsdk:"interface_labels"`
	Name            types.String      `tfsdk:"name"`
	PoolId          types.String      `tfsdk:"pool_id"`
	ServiceType     types.String      `tfsdk:"service_type"`
	Tags            types.Map         `tfsdk:"tags"`
	TagsAll         types.Map         `tfsdk:"tags_all"`
	UpdatedAt       timetypes.RFC3339 `tfsdk:"updated_at"`
}

func (*InfraServiceModel) Expand

func (*InfraServiceModel) Flatten

func (m *InfraServiceModel) Flatten(ctx context.Context, from *inframgmt.Service, diags *diag.Diagnostics)

type InfraServiceModelWithFilter

type InfraServiceModelWithFilter struct {
	Filters    types.Map  `tfsdk:"filters"`
	TagFilters types.Map  `tfsdk:"tag_filters"`
	Results    types.List `tfsdk:"results"`
}

func (*InfraServiceModelWithFilter) FlattenResults

func (m *InfraServiceModelWithFilter) FlattenResults(ctx context.Context, from []inframgmt.Service, diags *diag.Diagnostics)

type InfraServiceModelWithTimeouts

type InfraServiceModelWithTimeouts struct {
	Configs         types.List        `tfsdk:"configs"`
	CreatedAt       timetypes.RFC3339 `tfsdk:"created_at"`
	Description     types.String      `tfsdk:"description"`
	DesiredState    types.String      `tfsdk:"desired_state"`
	DesiredVersion  types.String      `tfsdk:"desired_version"`
	Id              types.String      `tfsdk:"id"`
	InterfaceLabels types.List        `tfsdk:"interface_labels"`
	Name            types.String      `tfsdk:"name"`
	PoolId          types.String      `tfsdk:"pool_id"`
	ServiceType     types.String      `tfsdk:"service_type"`
	Tags            types.Map         `tfsdk:"tags"`
	TagsAll         types.Map         `tfsdk:"tags_all"`
	UpdatedAt       timetypes.RFC3339 `tfsdk:"updated_at"`
	Timeouts        timeouts.Value    `tfsdk:"timeouts"`
	WaitForState    types.Bool        `tfsdk:"wait_for_state"`
}

InfraServiceModelWithTimeouts is a helper model that also contains the timeouts for the InfraServiceModel. The plugin framework does not deal well with embedded structs, so have to duplicate the fields and Flatten/Expand functions here from InfraServiceModel. https://github.com/hashicorp/terraform-plugin-framework/issues/242

func (*InfraServiceModelWithTimeouts) Expand

func (*InfraServiceModelWithTimeouts) Flatten

type ServicesDataSource

type ServicesDataSource struct {
	// contains filtered or unexported fields
}

ServicesDataSource defines the data source implementation.

func (*ServicesDataSource) Configure

func (*ServicesDataSource) Metadata

func (*ServicesDataSource) Read

func (*ServicesDataSource) Schema

type ServicesResource

type ServicesResource struct {
	// contains filtered or unexported fields
}

ServicesResource defines the resource implementation.

func (*ServicesResource) Configure

func (*ServicesResource) Create

func (*ServicesResource) Delete

func (*ServicesResource) ImportState

func (*ServicesResource) Metadata

func (*ServicesResource) Read

func (*ServicesResource) Schema

func (*ServicesResource) Update

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL