api

package
v0.0.0-...-711964f Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2017 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DockerHubRequest

type DockerHubRequest struct {
	CallbackURL string      `json:"callback_url"`
	PushData    *PushData   `json:"push_data"`
	Repository  *Repository `json:"repository"`
}

DockerHubRequest mimics DockerHub's request.

type InServiceStrategy

type InServiceStrategy struct {
	LaunchConfig *LaunchConfig `json:"launchConfig"`
}

InServiceStrategy mimics Rancher's InServiceStrategy JSON response.

type LaunchConfig

type LaunchConfig struct {
	ImageUUID   string            `json:"imageUuid"`
	Kind        string            `json:"kind"`
	Ports       []string          `json:"ports"`
	Labels      map[string]string `json:"labels"`
	Environment map[string]string `json:"environment"`
}

LaunchConfig mimics Rancher's LaunchConfig JSON response.

type PushData

type PushData struct {
	Tag string
}

PushData mimics DockerHub's JSON model.

type RancherAPI

type RancherAPI struct {
	Address, Host, APIKey, APISecret, ProjectID, DockerHubKey string
	Port                                                      int
	Services                                                  map[string]*Service
	LoadBalancers                                             map[string]*Service
}

RancherAPI is the main struct

func (*RancherAPI) FinishUpgradeService

func (ra *RancherAPI) FinishUpgradeService(s *Service) bool

FinishUpgradeService calls Rancher's JSON API with the `finishupgrade` action.

func (*RancherAPI) LoadServices

func (ra *RancherAPI) LoadServices()

LoadServices calls Rancher's JSON API for all the services.

func (*RancherAPI) RefreshService

func (ra *RancherAPI) RefreshService(s *Service)

RefreshService does a GET to Rancher's JSON API for that specific `Service`

func (*RancherAPI) Run

func (ra *RancherAPI) Run()

Run starts the callback HTTP server and listens on `BindAddress:BindPort`

func (*RancherAPI) UpgradeService

func (ra *RancherAPI) UpgradeService(s *Service)

UpgradeService calls Rancher's JSON API with the `upgrade` action.

type Repository

type Repository struct {
	Name     string
	RepoName string `json:"repo_name"`
}

Repository mimics DockerHub's JSON model.

type Response

type Response struct {
	Data []*Service
}

Response mimics Rancher's Services JSON response.

type Service

type Service struct {
	ID, Kind, Type, Name, State, AccountID, FQDN string
	LaunchConfig                                 *LaunchConfig
	Actions                                      map[string]string
}

Service mimics Rancher's Service JSON response.

type Strategy

type Strategy struct {
	InServiceStrategy *InServiceStrategy `json:"inServiceStrategy"`
	ToServiceStrategy *InServiceStrategy `json:"toServiceStrategy"`
}

Strategy mimics Rancher's Strategy JSON response.

type UpgradeResponse

type UpgradeResponse struct {
	ID, Type, Code, Message, FieldName, State string
	Status                                    int
	Actions                                   map[string]string
}

UpgradeResponse mimics Rancher's UpgradeResponse JSON response.

Jump to

Keyboard shortcuts

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