theforeman

package
v0.0.0-...-4cccea2 Latest Latest
Warning

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

Go to latest
Published: May 22, 2020 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssignInternalFloatingIP

func AssignInternalFloatingIP(url string, session string, domainName string, netSuffix string, netOffset int, overrideIP string) error

func CheckOutVLANDomain

func CheckOutVLANDomain(url string, session string, domainid int) error

func ConvComputeProfileNameToID

func ConvComputeProfileNameToID(url string, session string, computeProfileName string) (int, error)

func ConvHostGroupNameToID

func ConvHostGroupNameToID(url string, session string, hostGroupName string) (int, error)

func ConvLocNameToID

func ConvLocNameToID(url string, session string, locName string) (int, error)

Get the id of a location

func ConvOrgNameToID

func ConvOrgNameToID(url string, session string, orgName string) (int, error)

Get the id of a organization

func ConvProfileNameToFlavorName

func ConvProfileNameToFlavorName(url string, session string, computeProfileName string) (string, error)

func CreateVXLANSubnets

func CreateVXLANSubnets(url string, session string, domainInfo Domain, globalParams GlobalParameters) error

func DeleteDomain

func DeleteDomain(url string, session string, domainName string) error

func DeleteDomainParameter

func DeleteDomainParameter(url string, session string, domainid interface{}, paramkey string) error

func DeleteDynamicLab

func DeleteDynamicLab(url string, session string, domainName string) error

func DeleteHost

func DeleteHost(url string, session string, hostID interface{}) error

func DeleteSubnet

func DeleteSubnet(url string, session string, subnetID interface{}) error

func DeleteVXLANSubnets

func DeleteVXLANSubnets(url string, session string, domainName string) error

func FindAvailableLabSlot

func FindAvailableLabSlot(url string, session string, baseDomain string) (string, int, error)

func FindAvailableMulticastGroup

func FindAvailableMulticastGroup(url string, session string, multicastGroupBase string) (string, error)

func FindAvailableVRIDs

func FindAvailableVRIDs(url string, session string) (int, int, error)

Checks both internal and external used vrids to find a couple that are free for use and returns two integers that can be used for either.

func GetDomainParameter

func GetDomainParameter(url string, session string, domainid interface{}, paramkey string) (string, error)

func OverrideLogWriter

func OverrideLogWriter(logWriter *syslog.Writer)

func ReleaseVLANDomain

func ReleaseVLANDomain(url string, session string, domainid int) error

func RemoveSubnetFromDomain

func RemoveSubnetFromDomain(url string, session string, subnetID interface{}) error

func SetDomainParameter

func SetDomainParameter(url string, session string, domainid interface{}, paramkey string, paramvalue interface{}) error

func TheForemanLogin

func TheForemanLogin(url string) (string, error)

Types

type CommonParameter

type CommonParameter struct {
	CreatedAt     string `json:"created_at"`
	UpdatedAt     string `json:"updated_at"`
	IsHiddenValue bool   `json:"hidden_value?"`
	HiddenValue   string `json:"hidden_value"`
	ID            int    `json:"id"`
	Name          string `json:"name"`
	ParameterType string `json:"parameter_type"`
	Value         string `json:"value"`
}

func GetCommonParameters

func GetCommonParameters(url string, session string) ([]CommonParameter, error)

type CommonParameterQueryResults

type CommonParameterQueryResults struct {
	Total    int               `json:"total"`
	Subtotal int               `json:"subtotal"`
	Page     int               `json:"page"`
	PerPage  int               `json:"per_page"`
	Search   string            `json:"search"`
	Sort     Sort              `json:"sort"`
	Results  []CommonParameter `json:"results"`
}

Structure for holding global paramter api call data

type ComputeProfileQueryResults

type ComputeProfileQueryResults struct {
	CreatedAt         string `json:"created_at"`
	UpdatedAt         string `json:"updated_at"`
	ID                int    `json:"id"`
	Name              string `json:"name"`
	ComputeAttributes []struct {
		ID                   int    `json:"id"`
		Name                 string `json:"name"`
		ComputeResourceID    int    `json:"compute_resource_id"`
		ComputeResourceName  string `json:"compute_resource_name"`
		ProviderFriendlyName string `json:"provider_friendly_name"`
		ComputeProfileID     int    `json:"compute_profile_id"`
		ComputeProfileName   string `json:"compute_profile_name"`
	} `json:"compute_attributes"`
}

Struct for holding the api query results for compute profiles

type Domain

type Domain struct {
	Fullname  string `json:"fullname"`
	CreatedAt string `json:"created_at"`
	UpdatedAt string `json:"updated_at"`
	ID        int    `json:"id"`
	Name      string `json:"name"`
	DNSID     int    `json:"dns_id"`
	DNS       string `json:"dns"`
}

func CreateDynamicLabDomain

func CreateDynamicLabDomain(url string, session string, globalParams GlobalParameters) (Domain, error)

func CreateNewDomain

func CreateNewDomain(url string, session string, domainData DomainPostData) (Domain, error)

func GetDomains

func GetDomains(url string, session string) ([]Domain, error)

type DomainInfo

type DomainInfo struct {
	Fullname      string          `json:"fullname"`
	CreatedAt     string          `json:"created_at"`
	UpdatedAt     string          `json:"updated_at"`
	ID            int             `json:"id"`
	Name          string          `json:"name"`
	DNSID         int             `json:"dns_id"`
	DNS           string          `json:"dns"`
	Subnets       []Subnets       `json:"subnets"`
	Interfaces    []interface{}   `json:"interfaces"`
	Parameters    []Parameters    `json:"parameters"`
	Locations     []Locations     `json:"locations"`
	Organizations []Organizations `json:"organizations"`
}

Structures for pulling info for a single domain

func CreateDynamicLab

func CreateDynamicLab(url string, session string) (DomainInfo, error)

func FindAvailableVLANDomain

func FindAvailableVLANDomain(url string, session string) (DomainInfo, error)

func GetDomainDetails

func GetDomainDetails(url string, session string, domainid interface{}) (DomainInfo, error)

func GetDomainsWithDetails

func GetDomainsWithDetails(url string, session string) ([]DomainInfo, error)

type DomainParametersAttributes

type DomainParametersAttributes struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type DomainPostData

type DomainPostData struct {
	OrganizationID int           `json:"organization_id"`
	LocationID     int           `json:"location_id"`
	Domain         NewDomainData `json:"domain"`
}

Structures used when creating a new domain

type DomainQueryResults

type DomainQueryResults struct {
	Total    int      `json:"total"`
	Subtotal int      `json:"subtotal"`
	Page     int      `json:"page"`
	PerPage  int      `json:"per_page"`
	Search   string   `json:"search"`
	Sort     Sort     `json:"sort"`
	Results  []Domain `json:"results"`
}

type GlobalParameters

type GlobalParameters struct {
	LabOrgName          string
	LabLocationName     string
	LabBaseDomainName   string
	MulticastGroupBase  string
	VXLANNetworkPrefix  string
	VXLANNetmask        string
	VXLANThirdOctetStep int
	VXLANNetworks       []string
}

func GetGlobalParameters

func GetGlobalParameters(url string, session string) (GlobalParameters, error)

type Host

type Host struct {
	Name                     string            `json:"name"`
	IP                       string            `json:"ip,omitempty"`
	IP6                      string            `json:"ip6,omitempty"`
	EnvironmentID            int               `json:"environment_id,omitempty"`
	EnvironmentName          string            `json:"environment_name,omitempty"`
	Mac                      string            `json:"mac,omitempty"`
	RealmID                  int               `json:"realm_id,omitempty"`
	RealmName                string            `json:"realm_id,omitempty"`
	SpMac                    string            `json:"sp_mac,omitempty"`
	SpIP                     string            `json:"sp_ip,omitempty"`
	SpName                   string            `json:"sp_name,omitempty"`
	DomainID                 int               `json:"domain_id,omitempty"`
	DomainName               string            `json:"domain_name,omitempty"`
	ArchitectureID           int               `json:"architecture_id,omitempty"`
	ArchitectureName         string            `json:"architecture_name,omitempty"`
	OperatingsystemID        int               `json:"operatingsystem_id,omitempty"`
	OperatingsystemName      string            `json:"operatingsystem_name,omitempty"`
	SubnetID                 int               `json:"subnet_id,omitempty"`
	SubnetName               string            `json:"subnet_name,omitempty"`
	Subnet6ID                int               `json:"subnet6_id,omitempty"`
	Subnet6Name              string            `json:"subnet6_name,omitempty"`
	SpSubnetID               int               `json:"sp_subnet_id,omitempty"`
	PtableID                 int               `json:"ptable_id,omitempty"`
	PtableName               string            `json:"ptable_name,omitempty"`
	MediumID                 int               `json:"medium_id,omitempty"`
	MediumName               string            `json:"medium_name,omitempty"`
	PXELoader                string            `json:"pxe_loader,omitempty"`
	Build                    bool              `json:"build,omitempty"`
	Comment                  string            `json:"comment,omitempty"`
	Disk                     interface{}       `json:"disk,omitempty"`
	InstalledAt              interface{}       `json:"instanlled_at,omitempty"`
	ModelID                  int               `json:"model_id,omitempty"`
	HostgroupID              int               `json:"hostgroup_id,omitempty"`
	OwnerID                  int               `json:"owner_id,omitempty"`
	OwnerName                string            `json:"owner_name,omitempty"`
	OwnerType                string            `json:"owner_type,omitempty"`
	Enabled                  bool              `json:"enabled,omitempty"`
	Managed                  bool              `json:"managed,omitempty"`
	UseImage                 interface{}       `json:"use_image,omitempty"`
	ImageFile                string            `json:"image_file,omitempty"`
	UUID                     string            `json:"uuid,omitempty"`
	ComputeResourceID        int               `json:"compute_resource_id,omitempty"`
	ComputeResourceName      string            `json:"compute_resource_name,omitempty"`
	ComputeProfileID         int               `json:"compute_profile_id,omitempty"`
	ComputeProfileName       string            `json:"compute_profile_name,omitempty"`
	Capabilities             []string          `json:"capabilities,omitempty"`
	CertName                 string            `json:"certname,omitempty"`
	ImageID                  int               `json:"image_id,omitempty"`
	ImageName                string            `json:"image_name,omitempty"`
	CreatedAt                string            `json:"created_at,omitempty"`
	UpdatedAt                string            `json:"updated_at,omitempty"`
	LastCompile              interface{}       `json:"last_compile,omitempty"`
	GlobalStatus             int               `json:"global_status,omitempty"`
	GlobalStatusLabel        string            `json:"global_status_label,omitempty"`
	UptimeSeconds            interface{}       `json:"uptime_seconds,omitempty"`
	OrganizationID           int               `json:"organization_id,omitempty"`
	OrganizationName         string            `json:"organization_name,omitempty"`
	LocationID               int               `json:"location_id,omitempty"`
	LocationName             string            `json:"location_name,omitempty"`
	PuppetStatus             int               `json:"puppet_proxy_status,omitempty"`
	ModelName                string            `json:"model_name,omitempty"`
	ConfigurationStatus      int               `json:"configuration_status,omitempty"`
	ConfigurationStatusLabel string            `json:"configuration_status_label,omitempty"`
	BuildStatus              int               `json:"build_status,omitempty"`
	BuildStatusLabel         string            `json:"build_status_label,omitempty"`
	ID                       int               `json:"id,omitempty"`
	PuppetProxyID            int               `json:"puppet_proxy_id,omitempty"`
	PuppetProxyName          string            `json:"puppet_proxy_name,omitempty"`
	PuppetCAProxyID          int               `json:"puppet_ca_proxy_id,omitempty"`
	PuppetCAProxyName        string            `json:"puppet_ca_proxy_name,omitempty"`
	PuppetProxy              PuppetProxy       `json:"puppet_proxy,omitempty"`
	PuppetCaProxy            PuppetCaProxy     `json:"puppet_ca_proxy,omitempty"`
	Parameters               []interface{}     `json:"parameters,omitempty"`
	HostGroupName            string            `json:"host_group_name,omitempty"`
	HostGroupTitle           string            `json:"host_group_title,omitempty"`
	AllParameters            []HostParameters  `json:"all_parameters,omitempty"`
	Interfaces               []NetInterfaceRet `json:"interfaces,omitempty"`
	PuppeClasses             []interface{}     `json:"puppetclasses,omitempty"`
	ConfigGroups             []interface{}     `json:"config_groups,omitempty"`
	AllPuppeClasses          []interface{}     `json:"all_puppetclasses,omitempty"`
}

Structures used to hold the returned host value

func CreateHost

func CreateHost(url string,
	session string,
	labName string,
	hostName string,
	hostGroup string,
	role string) (Host, error)

Create a new host

func GetHostDetails

func GetHostDetails(url string, session string, hostID interface{}) (Host, error)

func GetHosts

func GetHosts(url string, session string) ([]Host, error)

func GetHostsDetailsByDomainID

func GetHostsDetailsByDomainID(url string, session string, domainID int) ([]Host, error)

type HostGroupQueryResults

type HostGroupQueryResults struct {
	CreatedAt           string `json:"created_at"`
	UpdatedAt           string `json:"updated_at"`
	ID                  int    `json:"id"`
	Name                string `json:"name"`
	ComputeProfileName  string `json:"compute_profile_name"`
	ComputeProfileID    int    `json:"compute_profile_id"`
	ComputeResourceName string `json:"compute_resource_name"`
	ComputeResourceID   int    `json:"compute_resource_id"`
	ArchitectureName    string `json:"architecture_name"`
	ArchitectureID      int    `json:"architecture_id"`
}

Struct for holding the api query results for compute profiles

func GetHostgroupInfo

func GetHostgroupInfo(url string, session string, hostGroup interface{}) (HostGroupQueryResults, error)

type HostParameters

type HostParameters struct {
	Name          string      `json:"name,omitempty"`
	Priority      interface{} `json:"name,omitempty"`
	ID            int         `json:"name,omitempty"`
	Value         interface{} `json:"value,omitempty"`
	ParameterType string      `json:"parameter_type,omitempty"`
	CreatedAt     string      `json:"created_at,omitempty"`
	UpdatedAt     string      `json:"updated_at,omitempty"`
	Permissions   Permissions `json:"permissions,omitempty"`
}

type HostParametersAttributes

type HostParametersAttributes struct {
	Name  string `json:"name,omitempty"`
	Value string `json:"value,omitempty"`
}

type HostPostData

type HostPostData struct {
	OrganizationID int         `json:"organization_id,omitempty"`
	LocationID     int         `json:"location_id,omitempty"`
	Host           NewHostData `json:"host"`
}

Structures used to create a new host

type HostQueryResults

type HostQueryResults struct {
	Total    int    `json:"total"`
	Subtotal int    `json:"subtotal"`
	Page     int    `json:"page"`
	PerPage  int    `json:"per_page"`
	Search   string `json:"search"`
	Sort     Sort   `json:"sort"`
	Results  []Host `json:"results"`
}

Structures used when pulling back a host listing

type InterfacePostData

type InterfacePostData struct {
	OrganizationID int          `json:"organization_id,omitempty"`
	LocationID     int          `json:"location_id,omitempty"`
	HostID         string       `json:"location_id,omitempty"`
	Interface      NetInterface `json:"interface"`
}

Structures used to create a new interface

type InterfacesAttributes

type InterfacesAttributes struct {
	Primary           NetInterface `json:"1,omitempty"`
	Management        NetInterface `json:"2,omitempty"`
	Storage           NetInterface `json:"3,omitempty"`
	StorageManagement NetInterface `json:"4,omitempty"`
	Tenant            NetInterface `json:"5,omitempty"`
	LBAAS             NetInterface `json:"6,omitempty"`
	InsideNet         NetInterface `json:"7,omitempty"`
	GatewayNet        NetInterface `json:"8,omitempty"`
}

type Location

type Location struct {
	Ancestry    interface{} `json:"ancestry"`
	ParentID    int         `json:"parent_id"`
	ParentName  string      `json:"parent_name"`
	CreatedAt   string      `json:"created_at"`
	UpdatedAt   string      `json:"updated_at"`
	ID          int         `json:"id"`
	Name        string      `json:"name"`
	Title       string      `json:"title"`
	Description string      `json:"description"`
}

Defined in domains.go

type Sort struct {
	By    interface{} `json:"by"`
	Order interface{} `json:"order"`
}

func GetLocations

func GetLocations(url string, session string) ([]Location, error)

Structures for pulling a domain listing

type Locations

type Locations struct {
	ID          int    `json:"id"`
	Name        string `json:"name"`
	Title       string `json:"title"`
	Description string `json:"description"`
}

type LocationsQueryResults

type LocationsQueryResults struct {
	Total    int        `json:"total"`
	Subtotal int        `json:"subtotal"`
	Page     int        `json:"page"`
	PerPage  int        `json:"per_page"`
	Search   string     `json:"search"`
	Sort     Sort       `json:"sort"`
	Results  []Location `json:"results"`
}

type NetInterface

type NetInterface struct {
	Name            string   `json:"name,omitempty"`
	Primary         bool     `json:"primary,omitempty"`
	IP              string   `json:"ip,omitempty"`
	IP6             string   `json:"ip6,omitempty"`
	Mac             string   `json:"mac,omitempty"`
	Type            string   `json:"type,omitempty"`
	SubnetID        int      `json:"subnet_id,omitempty"`
	Subnet6ID       int      `json:"subnet6_id,omitempty"`
	DomainID        int      `json:"domain_id,omitempty"`
	Identifier      string   `json:"identifier,omitempty"`
	Managed         bool     `json:"managed,omitempty"`
	Provision       bool     `json:"provision,omitempty"`
	Username        string   `json:"username,omitempty"`
	Password        string   `json:"password,omitempty"`
	Provider        string   `json:"provider,omitempty"`
	Virtual         bool     `json:"virtual,omitempty"`
	Tag             string   `json:"tag,omitempty"`
	Mtu             int      `json:"mtu,omitempty"`
	AttachedTo      string   `json:"attached_to,omitempty"`
	Mode            string   `json:"mode,omitempty"`
	AttachedDevices []string `json:"attached_devices,omitempty"`
	BondOptions     string   `json:"bond_options,omitempty"`
}

type NetInterfaceRet

type NetInterfaceRet struct {
	SubnetID        int         `json:"subnet_id,omitempty"`
	SubnetName      string      `json:"subnet_name,omitempty"`
	Subnet6ID       int         `json:"subnet6_id,omitempty"`
	Subnet6Name     string      `json:"subnet6_name,omitempty"`
	DomainID        int         `json:"domain_id,omitempty"`
	DomainName      string      `json:"domain_name,omitempty"`
	CreatedAt       string      `json:"created_at,omitempty"`
	UpdatedAt       string      `json:"updated_at,omitempty"`
	Managed         bool        `json:"managed,omitempty"`
	Identifier      string      `json:"identifier,omitempty"`
	ID              int         `json:"id,omitempty"`
	Name            string      `json:"name,omitempty"`
	IP              string      `json:"ip,omitempty"`
	IP6             string      `json:"ip6,omitempty"`
	Mac             string      `json:"mac,omitempty"`
	Mtu             int         `json:"mtu,omitempty"`
	Fqdn            string      `json:"fqdn,omitempty"`
	Primary         bool        `json:"primary,omitempty"`
	Provision       bool        `json:"provision,omitempty"`
	Type            string      `json:"type,omitempty"`
	Virtual         bool        `json:"virtual,omitempty"`
	Username        string      `json:"username,omitempty"`
	Password        string      `json:"password,omitempty"`
	Provider        string      `json:"provider,omitempty"`
	Tag             string      `json:"tag,omitempty"`
	AttachedTo      string      `json:"attached_to,omitempty"`
	Mode            string      `json:"mode,omitempty"`
	AttachedDevices interface{} `json:"attached_devices,omitempty"`
	BondOptions     string      `json:"bond_options,omitempty"`
}

func AddBridgeInterface

func AddBridgeInterface(url string, session string, identifier string, hostName interface{}, domainID int, subnetID int) (NetInterfaceRet, error)

type NewDomainData

type NewDomainData struct {
	Name                       string                       `json:"name"`
	Fullname                   string                       `json:"fullname"`
	DomainParametersAttributes []DomainParametersAttributes `json:"domain_parameters_attributes"`
}

type NewHostData

type NewHostData struct {
	Name                     string                     `json:"name"`
	LocationID               int                        `json:"location_id,omitempty"`
	OrganizationID           int                        `json:"organization_id,omitempty"`
	EnvironmentID            string                     `json:"environment_id,omitempty"`
	IP                       string                     `json:"ip,omitempty"`
	Mac                      string                     `json:"mac,omitempty"`
	ArchitectureID           int                        `json:"architecture_id,omitempty"`
	DomainID                 int                        `json:"domain_id,omitempty"`
	RealmID                  int                        `json:"realm_id,omitempty"`
	PuppetProxyID            int                        `json:"puppet_proxy_id,omitempty"`
	PuppetCAProxyID          int                        `json:"puppet_ca_proxy_id,omitempty"`
	PuppeClaassIDs           []interface{}              `json:"puppet_class_ids,omitempty"`
	ConfigGroupIDs           []interface{}              `json:"config_group_ids,omitempty"`
	OperatingsystemID        int                        `json:"operatingsystem_id,omitempty"`
	MediumID                 int                        `json:"medium_id,omitempty"`
	PXELoader                string                     `json:"pxe_loader,omitempty"`
	PtableID                 int                        `json:"ptable_id,omitempty"`
	SubnetID                 int                        `json:"subnet_id,omitempty"`
	ComputeResourceID        int                        `json:"compute_resource_id,omitempty"`
	RootPass                 string                     `json:"root_pass,omitempty"`
	ModelID                  int                        `json:"model_id,omitempty"`
	HostgroupID              int                        `json:"hostgroup_id,omitempty"`
	OwnerID                  int                        `json:"owner_id,omitempty"`
	OwnerType                string                     `json:"owner_type,omitempty"`
	ImageID                  int                        `json:"image_id,omitempty"`
	HostParametersAttributes []HostParametersAttributes `json:"host_parameters_attributes,omitempty"`
	Build                    bool                       `json:"build,omitempty"`
	Enabled                  bool                       `json:"enabled,omitempty"`
	ProvisionMethod          string                     `json:"provision_method,omitempty"`
	Managed                  bool                       `json:"managed,omitempty"`
	ProgressReportID         string                     `json:"progress_report_id,omitempty"`
	Comment                  string                     `json:"comment,omitempty"`
	Capabilities             string                     `json:"capabilities,omitempty"`
	ComputeProfileID         int                        `json:"compute_profile_id,omitempty"`
	InterfacesAttributes     InterfacesAttributes       `json:"interfaces_attributes,omitempty"`
}

type Organization

type Organization struct {
	Ancestry    interface{} `json:"ancestry"`
	ParentID    int         `json:"parent_id"`
	ParentName  string      `json:"parent_name"`
	CreatedAt   string      `json:"created_at"`
	UpdatedAt   string      `json:"updated_at"`
	ID          int         `json:"id"`
	Name        string      `json:"name"`
	Title       string      `json:"title"`
	Description string      `json:"description"`
}

Defined in domains.go

type Sort struct {
	By    interface{} `json:"by"`
	Order interface{} `json:"order"`
}

func GetOrganizations

func GetOrganizations(url string, session string) ([]Organization, error)

Structures for pulling a domain listing

type Organizations

type Organizations struct {
	ID          int    `json:"id"`
	Name        string `json:"name"`
	Title       string `json:"title"`
	Description string `json:"description"`
}

type OrganizationsQueryResults

type OrganizationsQueryResults struct {
	Total    int            `json:"total"`
	Subtotal int            `json:"subtotal"`
	Page     int            `json:"page"`
	PerPage  int            `json:"per_page"`
	Search   string         `json:"search"`
	Sort     Sort           `json:"sort"`
	Results  []Organization `json:"results"`
}

type Parameters

type Parameters struct {
	Priority      int         `json:"priority"`
	CreatedAt     string      `json:"created_at"`
	UpdatedAt     string      `json:"updated_at"`
	ID            int         `json:"id"`
	Name          string      `json:"name"`
	ParameterType string      `json:"parameter_type"`
	Value         interface{} `json:"value"`
}

type Permissions

type Permissions struct {
	ViewHosts      bool `json:"view_hosts,omitempty"`
	CreateHosts    bool `json:"create_hosts,omitempty"`
	EditHosts      bool `json:"edit_hosts,omitempty"`
	DestroyHosts   bool `json:"destroy_hosts,omitempty"`
	BuildHosts     bool `json:"build_hosts,omitempty"`
	PowerHosts     bool `json:"power_hosts,omitempty"`
	ConsoleHosts   bool `json:"console_hosts,omitempty"`
	IpmiBootHosts  bool `json:"ipmi_boot_hosts,omitempty"`
	PuppetrunHosts bool `json:"puppetrun_hosts,omitempty"`
}

type PuppetCaProxy

type PuppetCaProxy struct {
	Name string `json:"name,omitempty"`
	ID   int    `json:"id,omitempty"`
	URL  string `json:"url,omitempty"`
}

type PuppetProxy

type PuppetProxy struct {
	Name string `json:"name,omitempty"`
	ID   int    `json:"id,omitempty"`
	URL  string `json:"url,omitempty"`
}

type Sort

type Sort struct {
	By    string `json:"by"`
	Order string `json:"order"`
}

Structures for pulling a domain listing

type Subnet

type Subnet struct {
	Name                       string                       `json:"name"`
	NetworkType                string                       `json:"network_type"`
	Network                    string                       `json:"network"`
	Mask                       string                       `json:"mask"`
	Gateway                    string                       `json:"gateway"`
	From                       string                       `json:"from"`
	To                         string                       `json:"to"`
	Ipam                       string                       `json:"ipam"`
	BootMode                   string                       `json:"boot-mode"`
	DomainIds                  []int                        `json:"domain_ids"`
	Vlanid                     int                          `json:"vlanid"`
	Mtu                        int                          `json:"mtu"`
	SubnetParametersAttributes []SubnetParametersAttributes `json:"subnet_parameters_attributes"`
}

func CreateSubnet

func CreateSubnet(url string, session string, subnetData SubnetPostData) (Subnet, error)

type SubnetInfo

type SubnetInfo struct {
	Name        string       `json:"name"`
	NetworkType string       `json:"network_type"`
	Network     string       `json:"network"`
	Mask        string       `json:"mask"`
	Gateway     string       `json:"gateway"`
	From        string       `json:"from"`
	To          string       `json:"to"`
	Ipam        string       `json:"ipam"`
	BootMode    string       `json:"boot-mode"`
	DomainIds   []int        `json:"domain_ids"`
	Vlanid      int          `json:"vlanid"`
	Mtu         int          `json:"mtu"`
	Parameters  []Parameters `json:"parameters"`
}

Structures used when pulling subnet info

func GetSubnetDetails

func GetSubnetDetails(url string, session string, subnetID interface{}) (SubnetInfo, error)

type SubnetParametersAttributes

type SubnetParametersAttributes struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type SubnetPostData

type SubnetPostData struct {
	OrganizationID int    `json:"organization_id"`
	LocationID     int    `json:"location_id"`
	Subnet         Subnet `json:"subnet"`
}

Structures used for creating subnets

type Subnets

type Subnets struct {
	ID             int    `json:"id"`
	Name           string `json:"name"`
	Description    string `json:"description"`
	NetworkAddress string `json:"network_address"`
}

Jump to

Keyboard shortcuts

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