Documentation ¶
Index ¶
- func AssignInternalFloatingIP(url string, session string, domainName string, netSuffix string, netOffset int, ...) error
- func CheckOutVLANDomain(url string, session string, domainid int) error
- func ConvComputeProfileNameToID(url string, session string, computeProfileName string) (int, error)
- func ConvHostGroupNameToID(url string, session string, hostGroupName string) (int, error)
- func ConvLocNameToID(url string, session string, locName string) (int, error)
- func ConvOrgNameToID(url string, session string, orgName string) (int, error)
- func ConvProfileNameToFlavorName(url string, session string, computeProfileName string) (string, error)
- func CreateVXLANSubnets(url string, session string, domainInfo Domain, globalParams GlobalParameters) error
- func DeleteDomain(url string, session string, domainName string) error
- func DeleteDomainParameter(url string, session string, domainid interface{}, paramkey string) error
- func DeleteDynamicLab(url string, session string, domainName string) error
- func DeleteHost(url string, session string, hostID interface{}) error
- func DeleteSubnet(url string, session string, subnetID interface{}) error
- func DeleteVXLANSubnets(url string, session string, domainName string) error
- func FindAvailableLabSlot(url string, session string, baseDomain string) (string, int, error)
- func FindAvailableMulticastGroup(url string, session string, multicastGroupBase string) (string, error)
- func FindAvailableVRIDs(url string, session string) (int, int, error)
- func GetDomainParameter(url string, session string, domainid interface{}, paramkey string) (string, error)
- func OverrideLogWriter(logWriter *syslog.Writer)
- func ReleaseVLANDomain(url string, session string, domainid int) error
- func RemoveSubnetFromDomain(url string, session string, subnetID interface{}) error
- func SetDomainParameter(url string, session string, domainid interface{}, paramkey string, ...) error
- func TheForemanLogin(url string) (string, error)
- type CommonParameter
- type CommonParameterQueryResults
- type ComputeProfileQueryResults
- type Domain
- type DomainInfo
- func CreateDynamicLab(url string, session string) (DomainInfo, error)
- func FindAvailableVLANDomain(url string, session string) (DomainInfo, error)
- func GetDomainDetails(url string, session string, domainid interface{}) (DomainInfo, error)
- func GetDomainsWithDetails(url string, session string) ([]DomainInfo, error)
- type DomainParametersAttributes
- type DomainPostData
- type DomainQueryResults
- type GlobalParameters
- type Host
- func CreateHost(url string, session string, labName string, hostName string, hostGroup string, ...) (Host, error)
- func GetHostDetails(url string, session string, hostID interface{}) (Host, error)
- func GetHosts(url string, session string) ([]Host, error)
- func GetHostsDetailsByDomainID(url string, session string, domainID int) ([]Host, error)
- type HostGroupQueryResults
- type HostParameters
- type HostParametersAttributes
- type HostPostData
- type HostQueryResults
- type InterfacePostData
- type InterfacesAttributes
- type Location
- type Locations
- type LocationsQueryResults
- type NetInterface
- type NetInterfaceRet
- type NewDomainData
- type NewHostData
- type Organization
- type Organizations
- type OrganizationsQueryResults
- type Parameters
- type Permissions
- type PuppetCaProxy
- type PuppetProxy
- type Sort
- type Subnet
- type SubnetInfo
- type SubnetParametersAttributes
- type SubnetPostData
- type Subnets
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvHostGroupNameToID ¶
func ConvLocNameToID ¶
Get the id of a location
func ConvOrgNameToID ¶
Get the id of a organization
func CreateVXLANSubnets ¶
func CreateVXLANSubnets(url string, session string, domainInfo Domain, globalParams GlobalParameters) error
func DeleteDomainParameter ¶
func DeleteHost ¶
func DeleteSubnet ¶
func DeleteVXLANSubnets ¶
func FindAvailableLabSlot ¶
func FindAvailableVRIDs ¶
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 OverrideLogWriter ¶
func RemoveSubnetFromDomain ¶
func SetDomainParameter ¶
func TheForemanLogin ¶
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)
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 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 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 ¶
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 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"` }
type LocationsQueryResults ¶
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 ¶
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 Parameters ¶
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 PuppetProxy ¶
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 SubnetPostData ¶
type SubnetPostData struct { OrganizationID int `json:"organization_id"` LocationID int `json:"location_id"` Subnet Subnet `json:"subnet"` }
Structures used for creating subnets