Documentation ¶
Index ¶
- func Bool(v bool) *bool
- func CheckResponse(r *http.Response) error
- func Int(v int) *int
- func String(v string) *string
- func Stringify(message interface{}) string
- type BasicAuthTransport
- type Client
- type ComputeAttributes
- type GetOptions
- type Host
- type HostGetAllOptions
- type HostParameterAttributes
- type Hostgroup
- type HostgroupGetAllOptions
- type HostgroupsService
- func (s *HostgroupsService) Create(ctx context.Context, hostgroup *Hostgroup) (*Hostgroup, *Response, error)
- func (s *HostgroupsService) Get(ctx context.Context, id string) (*Hostgroup, *Response, error)
- func (s *HostgroupsService) GetAll(ctx context.Context, opt *HostgroupGetAllOptions) ([]*Hostgroup, *Response, error)
- type HostsService
- func (s *HostsService) Create(ctx context.Context, host *Host) (*Host, *Response, error)
- func (s *HostsService) Delete(ctx context.Context, id string) (*Response, error)
- func (s *HostsService) Get(ctx context.Context, id string) (*Host, *Response, error)
- func (s *HostsService) GetAll(ctx context.Context, opt *HostGetAllOptions) ([]*Host, *Response, error)
- func (s *HostsService) Update(ctx context.Context, id string, host *Host) (*Host, *Response, error)
- type InterfaceAttributes
- type Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Bool ¶
Bool is a helper routine that allocates a new bool value to store v and returns a pointer to it.
func CheckResponse ¶
func Int ¶
Int is a helper routine that allocates a new int value to store v and returns a pointer to it.
Types ¶
type BasicAuthTransport ¶
type BasicAuthTransport struct { Username string Password string // Transport is the underlying HTTP transport to use when making requests. // It will default to http.DefaultTransport if nil. Transport http.RoundTripper }
BasicAuthTransport is an http.RoundTripper that authenticates all requests using HTTP Basic Authentication with the provided username and password.
func (*BasicAuthTransport) Client ¶
func (t *BasicAuthTransport) Client() *http.Client
Client returns an *http.Client that makes requests that are authenticated using HTTP Basic Authentication.
type Client ¶
type Client struct { // Base URL for API requests. BaseURL should always be specified with // a trailing slash. BaseURL *url.URL // Services used for talking to different parts of the Foreman API. Hosts *HostsService Hostgroups *HostgroupsService // contains filtered or unexported fields }
func (*Client) Do ¶
Do sends an API request and returns the API response. The API response is JSON decoded and stored in the value pointed to by v, or returned as an error if an API error has occurred. If v implements the io.Writer interface, the raw response body will be written to v, without attempting to first decode it.
The provided ctx must be non-nil. If it is canceled or times out, ctx.Err() will be returned.
type ComputeAttributes ¶
type ComputeAttributes struct { CPUs *int `json:"cpus,omitempty"` Cores *int `json:"corespersocket,omitempty"` Memory *int `json:"memory_mb,omitempty"` Cluster *string `json:"cluster,omitempty"` Path *string `json:"path,omitempty"` GuestID *string `json:"guest_id,omitempty"` SCSIControllerType *string `json:"scsi_controller_type,omitempty"` HardwareVersion *string `json:"hardware_version,omitempty"` Start *bool `json:"start,omitempty"` }
ComputeAttributes represents the attributes of a host.
type GetOptions ¶
type Host ¶
type Host struct { Name *string `json:"name,omitempty"` 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"` PuppetClassIDs *[]int `json:"puppetclass_ids,omitempty"` OperatingSystemID *string `json:"operatingsystem_id,omitempty"` MediumID *string `json:"medium_id,omitempty"` PTableID *int `json:"ptable_id,omitempty"` SubnetID *int `json:"subnet_id,omitempty"` ComputeResourceID *int `json:"compute_resource_id,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"` PuppetCAProxyID *int `json:"puppet_ca_proxy_id,omitempty"` ImageID *int `json:"image_id,omitempty"` HostParameterAttributes *HostParameterAttributes `json:"host_parameter_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"` RootPassword *string `json:"root_pass,omitempty"` InterfaceAttributes *InterfaceAttributes `json:"interface_attributes,omitempty"` ComputeAttributes *ComputeAttributes `json:"compute_attributes,omitempty"` }
type HostGetAllOptions ¶
type HostGetAllOptions struct { HostGroupID int `url:"hostgroup_id,omitempty"` LocationID int `url:"location_id,omitempty"` OrganizationID int `url:"organization_id,omitempty"` EnvironmentID int `url:"environment_id,omitempty"` Search int `url:"search,omitempty"` Order int `url:"order,omitempty"` GetOptions }
type HostParameterAttributes ¶
type HostParameterAttributes struct { Name *string `json:"name,omitempty"` Value *string `json:"value,omitempty"` }
HostParameterAttributes represents the Host's parameters.
type Hostgroup ¶
type Hostgroup struct { Name *string `json:"name"` ParentID *int `json:"parent_id"` EnvironmentID *int `json:"environment_id"` ComputeProfileID *int `json:"compute_profile_id"` OperatingSystemID *int `json:"operatingsystem_id"` ArchitectureID *int `json:"architecture_id"` PXELoader *string `json:"pxe_loader"` MediumID *int `json:"medium_id"` PTableID *int `json:"ptable_id"` PuppetCAProxyID *int `json:"puppet_ca_proxy_id"` SubnetID *int `json:"subnet_id"` DomainID *int `json:"domain_id"` RealmID *int `json:"realm_id"` PuppetProxyID *int `json:"puppet_proxy_id"` RootPassword *string `json:"root_pass"` }
type HostgroupGetAllOptions ¶
type HostgroupGetAllOptions struct { PuppetClassID string `url:"puppetclass_id"` Search string `url:"search"` Order string `url:"order"` GetOptions }
type HostgroupsService ¶
type HostgroupsService service
func (*HostgroupsService) GetAll ¶
func (s *HostgroupsService) GetAll(ctx context.Context, opt *HostgroupGetAllOptions) ([]*Hostgroup, *Response, error)
type HostsService ¶
type HostsService service
func (*HostsService) GetAll ¶
func (s *HostsService) GetAll(ctx context.Context, opt *HostGetAllOptions) ([]*Host, *Response, error)
type InterfaceAttributes ¶
type InterfaceAttributes struct { MAC *string `json:"mac,omitempty"` IP *string `json:"ip,omitempty"` IP6 *string `json:"ip6,omitempty"` Type *string `json:"type,omitempty"` Name *string `json:"name,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"` Primary *bool `json:"primary,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"` AttachedTo *string `json:"attached_to,omitempty"` Mode *string `json:"mode,omitempty"` AttachedDevices *[]string `json:"attached_devices,omitempty"` BondOptions *string `json:"bond_options,omitempty"` ComputeAttributes *ComputeAttributes `json:"compute_attributes,omitempty"` }
InterfaceAttributes represents the attributes of a hosts' interface(s).
Source Files ¶
- architectures.go
- audits.go
- auth_source_ldaps.go
- autosign.go
- bookmarks.go
- common_parameters.go
- compute_attributes.go
- compute_parameters.go
- compute_profiles.go
- compute_resources.go
- config_groups.go
- config_reports.go
- config_templates.go
- dashboard.go
- domains.go
- environments.go
- external_usergroups.go
- fact_values.go
- filters.go
- foreman.go
- home.go
- host_classes.go
- hostgroup_classes.go
- hostgroups.go
- hosts.go
- images.go
- interfaces.go
- locations.go
- mail_notifications.go
- media.go
- models.go
- operating_systems.go
- organizations.go
- os_default_templates.go
- override_values.go
- parameters.go
- permissions.go
- plugins.go
- provisioning_templates.go
- ptables.go
- puppetclasses.go
- realms.go
- reports.go
- roles.go
- settings.go
- smart_class_parameters.go
- smart_proxies.go
- smart_variables.go
- statistics.go
- strings.go
- subnets.go
- tasks.go
- template_combinations.go
- template_kinds.go
- usergroups.go
- users.go