pulp

package
v0.0.0-...-2e72785 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2016 License: Apache-2.0 Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(v bool) *bool

func CheckResponse

func CheckResponse(r *http.Response) error

func Int

func Int(v int) *int

func String

func String(v string) *string

func Stringify

func Stringify(message interface{}) string

Stringify attempts to create a reasonable string representation of types in the library. It does things like resolve pointers to their values and omits struct fields with nil values.

Types

type CallReport

type CallReport struct {
	Result       string `json:"result"`
	Error        *Error `json:"error"`
	SpawnedTasks []struct {
		Href   string `json:"_href"`
		TaskId string `json:"task_id"`
	} `json:"spawned_tasks"`
}

Pulp Api docs: http://pulp.readthedocs.org/en/latest/dev-guide/conventions/sync-v-async.html#call-report

type Client

type Client struct {
	DisableSsl         bool
	InsecureSkipVerify bool

	UserAgent string

	// Services used for talking to different parts of the Pulp API.
	Repositories *RepositoriesService
	Tasks        *TasksService
	// contains filtered or unexported fields
}

func NewClient

func NewClient(host string, User string, Passwd string, DisableSsl bool, InsecureSkipVerify bool, httpClient *http.Client) (client *Client, err error)

func (*Client) BaseURL

func (c *Client) BaseURL() *url.URL

func (*Client) Do

func (c *Client) Do(req *http.Request, v interface{}) (*Response, error)

func (*Client) NewRequest

func (c *Client) NewRequest(method, path string, opt interface{}) (*http.Request, error)

func (*Client) SetBaseURL

func (c *Client) SetBaseURL(urlStr string) error

func (*Client) SetHost

func (c *Client) SetHost(hostStr string) error

func (*Client) SetTimeout

func (c *Client) SetTimeout(timeout int)

set timeout in milliseconds

type Content

type Content struct {
	State        string   `json:"state"`
	ItemsTotal   int      `json:"items_total"`
	ItemsLeft    int      `json:"items_left"`
	SizeTotal    int      `json:"size_total"`
	SizeLeft     int      `json:"size_left"`
	ErrorDetails []string `json:"error_details"`
}

included in task

type Error

type Error struct {
	Code        string          `json:"code"`
	Description string          `json:"description"`
	Data        json.RawMessage `json:"data"`
	Sub_errors  json.RawMessage `json:"sub_errors"`
}

Pulp Api docs: http://pulp.readthedocs.org/en/latest/dev-guide/conventions/exceptions.html#error-details

func (*Error) Error

func (e *Error) Error() string

type ErrorResponse

type ErrorResponse struct {
	Response     *http.Response // HTTP response that caused this error
	ResourceID   string         `json:"resource_id"`
	Message      string         `json:"error_message"` // error message
	ErrorDetails *Error         `json:"error"`         // more detail on individual errors

}

Pulp Api docs: http://pulp.readthedocs.org/en/latest/dev-guide/conventions/exceptions.html#exception-handling

func (*ErrorResponse) Error

func (r *ErrorResponse) Error() string

type GetRepositoryOptions

type GetRepositoryOptions struct {
	Details bool `url:"details,omitempty" json:"details,omitempty"`
}

type Importer

type Importer struct {
	Id             string          `json:"id"`
	ImporterConfig *ImporterConfig `json:"config"`
	Content        *Content        `json:"content"`
	Metadata       *Metadata       `json:"metadata"`
}

type ImporterConfig

type ImporterConfig struct {
	Feed          string `json:"feed"`
	RemoveMissing bool   `json:"remove_missing"`
}

type ListOptions

type ListOptions struct {
	Page    int `url:"page,omitempty" json:"page,omitempty"`
	PerPage int `url:"per_page,omitempty" json:"per_page,omitempty"`
}

type Metadata

type Metadata struct {
	State string
	Error string
}

included in task

type RepositoriesService

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

func (*RepositoriesService) GetRepository

func (s *RepositoriesService) GetRepository(
	repository string,
	opt *GetRepositoryOptions) (*Repository, *Response, error)

func (*RepositoriesService) ListRepositories

func (s *RepositoriesService) ListRepositories(opt *GetRepositoryOptions) ([]*Repository, *Response, error)

func (*RepositoriesService) SyncRepository

func (s *RepositoriesService) SyncRepository(repository string) (*CallReport, *Response, error)

type Repository

type Repository struct {
	Id        string      `json:"id"`
	Name      string      `json:"display_name"`
	Importers []*Importer `json:"importers"`
}

func (Repository) String

func (r Repository) String() string

type Response

type Response struct {
	*http.Response
}

type Task

type Task struct {
	Id             string `json:"task_id"`
	StartTime      string `json:"start_time"`
	FinishTime     string `json:"finish_time"`
	State          string `json:"state"`
	Error          *Error `json:"error"`
	ProgressReport struct {

		// yum importer
		YumImporter *Importer `json:"yum_importer"`

		// docker importer
		DockerImporter *Importer `json:"docker_importer"`
	} `json:"progress_report"`

	Result struct {
		Details struct {
			Content *Content `json:"content"`
		} `json:"details"`
	} `json:"result"`
}

included in task

func (*Task) Importer

func (t *Task) Importer() (importer string)

func (*Task) String

func (t *Task) String() string

type TasksService

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

func (*TasksService) GetTask

func (s *TasksService) GetTask(task string) (*Task, *Response, error)

func (*TasksService) ListTasks

func (s *TasksService) ListTasks() ([]*Task, *Response, error)

Jump to

Keyboard shortcuts

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